diff --git a/build/assets/index-1194f5b5.js b/build/assets/index-d57b3dfa.js similarity index 98% rename from build/assets/index-1194f5b5.js rename to build/assets/index-d57b3dfa.js index 4240c677e..62a78c478 100644 --- a/build/assets/index-1194f5b5.js +++ b/build/assets/index-d57b3dfa.js @@ -3,7 +3,7 @@ var Q4=Object.defineProperty;var ex=(tt,et,nt)=>et in tt?Q4(tt,et,{enumerable:!0 * * @author Feross Aboukhadijeh * @license MIT - */(function(tt){const et=base64Js,nt=ieee754,rt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;tt.Buffer=st,tt.SlowBuffer=wt,tt.INSPECT_MAX_BYTES=50;const it=2147483647;tt.kMaxLength=it,st.TYPED_ARRAY_SUPPORT=ot(),!st.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 ot(){try{const cn=new Uint8Array(1),Xt={foo:function(){return 42}};return Object.setPrototypeOf(Xt,Uint8Array.prototype),Object.setPrototypeOf(cn,Xt),cn.foo()===42}catch{return!1}}Object.defineProperty(st.prototype,"parent",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.buffer}}),Object.defineProperty(st.prototype,"offset",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.byteOffset}});function at(cn){if(cn>it)throw new RangeError('The value "'+cn+'" is invalid for option "size"');const Xt=new Uint8Array(cn);return Object.setPrototypeOf(Xt,st.prototype),Xt}function st(cn,Xt,Kt){if(typeof cn=="number"){if(typeof Xt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ht(cn)}return lt(cn,Xt,Kt)}st.poolSize=8192;function lt(cn,Xt,Kt){if(typeof cn=="string")return dt(cn,Xt);if(ArrayBuffer.isView(cn))return mt(cn);if(cn==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof cn);if(yn(cn,ArrayBuffer)||cn&&yn(cn.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(yn(cn,SharedArrayBuffer)||cn&&yn(cn.buffer,SharedArrayBuffer)))return gt(cn,Xt,Kt);if(typeof cn=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const kn=cn.valueOf&&cn.valueOf();if(kn!=null&&kn!==cn)return st.from(kn,Xt,Kt);const Mn=yt(cn);if(Mn)return Mn;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof cn[Symbol.toPrimitive]=="function")return st.from(cn[Symbol.toPrimitive]("string"),Xt,Kt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof cn)}st.from=function(cn,Xt,Kt){return lt(cn,Xt,Kt)},Object.setPrototypeOf(st.prototype,Uint8Array.prototype),Object.setPrototypeOf(st,Uint8Array);function ct(cn){if(typeof cn!="number")throw new TypeError('"size" argument must be of type number');if(cn<0)throw new RangeError('The value "'+cn+'" is invalid for option "size"')}function ut(cn,Xt,Kt){return ct(cn),cn<=0?at(cn):Xt!==void 0?typeof Kt=="string"?at(cn).fill(Xt,Kt):at(cn).fill(Xt):at(cn)}st.alloc=function(cn,Xt,Kt){return ut(cn,Xt,Kt)};function ht(cn){return ct(cn),at(cn<0?0:bt(cn)|0)}st.allocUnsafe=function(cn){return ht(cn)},st.allocUnsafeSlow=function(cn){return ht(cn)};function dt(cn,Xt){if((typeof Xt!="string"||Xt==="")&&(Xt="utf8"),!st.isEncoding(Xt))throw new TypeError("Unknown encoding: "+Xt);const Kt=xt(cn,Xt)|0;let kn=at(Kt);const Mn=kn.write(cn,Xt);return Mn!==Kt&&(kn=kn.slice(0,Mn)),kn}function pt(cn){const Xt=cn.length<0?0:bt(cn.length)|0,Kt=at(Xt);for(let kn=0;kn=it)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+it.toString(16)+" bytes");return cn|0}function wt(cn){return+cn!=cn&&(cn=0),st.alloc(+cn)}st.isBuffer=function(Xt){return Xt!=null&&Xt._isBuffer===!0&&Xt!==st.prototype},st.compare=function(Xt,Kt){if(yn(Xt,Uint8Array)&&(Xt=st.from(Xt,Xt.offset,Xt.byteLength)),yn(Kt,Uint8Array)&&(Kt=st.from(Kt,Kt.offset,Kt.byteLength)),!st.isBuffer(Xt)||!st.isBuffer(Kt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Xt===Kt)return 0;let kn=Xt.length,Mn=Kt.length;for(let On=0,Bn=Math.min(kn,Mn);OnMn.length?(st.isBuffer(Bn)||(Bn=st.from(Bn)),Bn.copy(Mn,On)):Uint8Array.prototype.set.call(Mn,Bn,On);else if(st.isBuffer(Bn))Bn.copy(Mn,On);else throw new TypeError('"list" argument must be an Array of Buffers');On+=Bn.length}return Mn};function xt(cn,Xt){if(st.isBuffer(cn))return cn.length;if(ArrayBuffer.isView(cn)||yn(cn,ArrayBuffer))return cn.byteLength;if(typeof cn!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof cn);const Kt=cn.length,kn=arguments.length>2&&arguments[2]===!0;if(!kn&&Kt===0)return 0;let Mn=!1;for(;;)switch(Xt){case"ascii":case"latin1":case"binary":return Kt;case"utf8":case"utf-8":return En(cn).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt*2;case"hex":return Kt>>>1;case"base64":return Tn(cn).length;default:if(Mn)return kn?-1:En(cn).length;Xt=(""+Xt).toLowerCase(),Mn=!0}}st.byteLength=xt;function kt(cn,Xt,Kt){let kn=!1;if((Xt===void 0||Xt<0)&&(Xt=0),Xt>this.length||((Kt===void 0||Kt>this.length)&&(Kt=this.length),Kt<=0)||(Kt>>>=0,Xt>>>=0,Kt<=Xt))return"";for(cn||(cn="utf8");;)switch(cn){case"hex":return Ft(this,Xt,Kt);case"utf8":case"utf-8":return vt(this,Xt,Kt);case"ascii":return Wt(this,Xt,Kt);case"latin1":case"binary":return zt(this,Xt,Kt);case"base64":return $t(this,Xt,Kt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,Xt,Kt);default:if(kn)throw new TypeError("Unknown encoding: "+cn);cn=(cn+"").toLowerCase(),kn=!0}}st.prototype._isBuffer=!0;function St(cn,Xt,Kt){const kn=cn[Xt];cn[Xt]=cn[Kt],cn[Kt]=kn}st.prototype.swap16=function(){const Xt=this.length;if(Xt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Kt=0;KtKt&&(Xt+=" ... "),""},rt&&(st.prototype[rt]=st.prototype.inspect),st.prototype.compare=function(Xt,Kt,kn,Mn,On){if(yn(Xt,Uint8Array)&&(Xt=st.from(Xt,Xt.offset,Xt.byteLength)),!st.isBuffer(Xt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Xt);if(Kt===void 0&&(Kt=0),kn===void 0&&(kn=Xt?Xt.length:0),Mn===void 0&&(Mn=0),On===void 0&&(On=this.length),Kt<0||kn>Xt.length||Mn<0||On>this.length)throw new RangeError("out of range index");if(Mn>=On&&Kt>=kn)return 0;if(Mn>=On)return-1;if(Kt>=kn)return 1;if(Kt>>>=0,kn>>>=0,Mn>>>=0,On>>>=0,this===Xt)return 0;let Bn=On-Mn,Xn=kn-Kt;const Vn=Math.min(Bn,Xn),Gn=this.slice(Mn,On),zn=Xt.slice(Kt,kn);for(let Zn=0;Zn2147483647?Kt=2147483647:Kt<-2147483648&&(Kt=-2147483648),Kt=+Kt,hn(Kt)&&(Kt=Mn?0:cn.length-1),Kt<0&&(Kt=cn.length+Kt),Kt>=cn.length){if(Mn)return-1;Kt=cn.length-1}else if(Kt<0)if(Mn)Kt=0;else return-1;if(typeof Xt=="string"&&(Xt=st.from(Xt,kn)),st.isBuffer(Xt))return Xt.length===0?-1:At(cn,Xt,Kt,kn,Mn);if(typeof Xt=="number")return Xt=Xt&255,typeof Uint8Array.prototype.indexOf=="function"?Mn?Uint8Array.prototype.indexOf.call(cn,Xt,Kt):Uint8Array.prototype.lastIndexOf.call(cn,Xt,Kt):At(cn,[Xt],Kt,kn,Mn);throw new TypeError("val must be string, number or Buffer")}function At(cn,Xt,Kt,kn,Mn){let On=1,Bn=cn.length,Xn=Xt.length;if(kn!==void 0&&(kn=String(kn).toLowerCase(),kn==="ucs2"||kn==="ucs-2"||kn==="utf16le"||kn==="utf-16le")){if(cn.length<2||Xt.length<2)return-1;On=2,Bn/=2,Xn/=2,Kt/=2}function Vn(zn,Zn){return On===1?zn[Zn]:zn.readUInt16BE(Zn*On)}let Gn;if(Mn){let zn=-1;for(Gn=Kt;GnBn&&(Kt=Bn-Xn),Gn=Kt;Gn>=0;Gn--){let zn=!0;for(let Zn=0;ZnMn&&(kn=Mn)):kn=Mn;const On=Xt.length;kn>On/2&&(kn=On/2);let Bn;for(Bn=0;Bn>>0,isFinite(kn)?(kn=kn>>>0,Mn===void 0&&(Mn="utf8")):(Mn=kn,kn=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const On=this.length-Kt;if((kn===void 0||kn>On)&&(kn=On),Xt.length>0&&(kn<0||Kt<0)||Kt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Mn||(Mn="utf8");let Bn=!1;for(;;)switch(Mn){case"hex":return Et(this,Xt,Kt,kn);case"utf8":case"utf-8":return Ct(this,Xt,Kt,kn);case"ascii":case"latin1":case"binary":return Lt(this,Xt,Kt,kn);case"base64":return jt(this,Xt,Kt,kn);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt(this,Xt,Kt,kn);default:if(Bn)throw new TypeError("Unknown encoding: "+Mn);Mn=(""+Mn).toLowerCase(),Bn=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $t(cn,Xt,Kt){return Xt===0&&Kt===cn.length?et.fromByteArray(cn):et.fromByteArray(cn.slice(Xt,Kt))}function vt(cn,Xt,Kt){Kt=Math.min(cn.length,Kt);const kn=[];let Mn=Xt;for(;Mn239?4:On>223?3:On>191?2:1;if(Mn+Xn<=Kt){let Vn,Gn,zn,Zn;switch(Xn){case 1:On<128&&(Bn=On);break;case 2:Vn=cn[Mn+1],(Vn&192)===128&&(Zn=(On&31)<<6|Vn&63,Zn>127&&(Bn=Zn));break;case 3:Vn=cn[Mn+1],Gn=cn[Mn+2],(Vn&192)===128&&(Gn&192)===128&&(Zn=(On&15)<<12|(Vn&63)<<6|Gn&63,Zn>2047&&(Zn<55296||Zn>57343)&&(Bn=Zn));break;case 4:Vn=cn[Mn+1],Gn=cn[Mn+2],zn=cn[Mn+3],(Vn&192)===128&&(Gn&192)===128&&(zn&192)===128&&(Zn=(On&15)<<18|(Vn&63)<<12|(Gn&63)<<6|zn&63,Zn>65535&&Zn<1114112&&(Bn=Zn))}}Bn===null?(Bn=65533,Xn=1):Bn>65535&&(Bn-=65536,kn.push(Bn>>>10&1023|55296),Bn=56320|Bn&1023),kn.push(Bn),Mn+=Xn}return Ot(kn)}const It=4096;function Ot(cn){const Xt=cn.length;if(Xt<=It)return String.fromCharCode.apply(String,cn);let Kt="",kn=0;for(;knkn)&&(Kt=kn);let Mn="";for(let On=Xt;Onkn&&(Xt=kn),Kt<0?(Kt+=kn,Kt<0&&(Kt=0)):Kt>kn&&(Kt=kn),KtKt)throw new RangeError("Trying to access beyond buffer length")}st.prototype.readUintLE=st.prototype.readUIntLE=function(Xt,Kt,kn){Xt=Xt>>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=this[Xt],On=1,Bn=0;for(;++Bn>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=this[Xt+--Kt],On=1;for(;Kt>0&&(On*=256);)Mn+=this[Xt+--Kt]*On;return Mn},st.prototype.readUint8=st.prototype.readUInt8=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,1,this.length),this[Xt]},st.prototype.readUint16LE=st.prototype.readUInt16LE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,2,this.length),this[Xt]|this[Xt+1]<<8},st.prototype.readUint16BE=st.prototype.readUInt16BE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,2,this.length),this[Xt]<<8|this[Xt+1]},st.prototype.readUint32LE=st.prototype.readUInt32LE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),(this[Xt]|this[Xt+1]<<8|this[Xt+2]<<16)+this[Xt+3]*16777216},st.prototype.readUint32BE=st.prototype.readUInt32BE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),this[Xt]*16777216+(this[Xt+1]<<16|this[Xt+2]<<8|this[Xt+3])},st.prototype.readBigUInt64LE=xn(function(Xt){Xt=Xt>>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=Kt+this[++Xt]*2**8+this[++Xt]*2**16+this[++Xt]*2**24,On=this[++Xt]+this[++Xt]*2**8+this[++Xt]*2**16+kn*2**24;return BigInt(Mn)+(BigInt(On)<>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=Kt*2**24+this[++Xt]*2**16+this[++Xt]*2**8+this[++Xt],On=this[++Xt]*2**24+this[++Xt]*2**16+this[++Xt]*2**8+kn;return(BigInt(Mn)<>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=this[Xt],On=1,Bn=0;for(;++Bn=On&&(Mn-=Math.pow(2,8*Kt)),Mn},st.prototype.readIntBE=function(Xt,Kt,kn){Xt=Xt>>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=Kt,On=1,Bn=this[Xt+--Mn];for(;Mn>0&&(On*=256);)Bn+=this[Xt+--Mn]*On;return On*=128,Bn>=On&&(Bn-=Math.pow(2,8*Kt)),Bn},st.prototype.readInt8=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,1,this.length),this[Xt]&128?(255-this[Xt]+1)*-1:this[Xt]},st.prototype.readInt16LE=function(Xt,Kt){Xt=Xt>>>0,Kt||Ut(Xt,2,this.length);const kn=this[Xt]|this[Xt+1]<<8;return kn&32768?kn|4294901760:kn},st.prototype.readInt16BE=function(Xt,Kt){Xt=Xt>>>0,Kt||Ut(Xt,2,this.length);const kn=this[Xt+1]|this[Xt]<<8;return kn&32768?kn|4294901760:kn},st.prototype.readInt32LE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),this[Xt]|this[Xt+1]<<8|this[Xt+2]<<16|this[Xt+3]<<24},st.prototype.readInt32BE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),this[Xt]<<24|this[Xt+1]<<16|this[Xt+2]<<8|this[Xt+3]},st.prototype.readBigInt64LE=xn(function(Xt){Xt=Xt>>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=this[Xt+4]+this[Xt+5]*2**8+this[Xt+6]*2**16+(kn<<24);return(BigInt(Mn)<>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=(Kt<<24)+this[++Xt]*2**16+this[++Xt]*2**8+this[++Xt];return(BigInt(Mn)<>>0,Kt||Ut(Xt,4,this.length),nt.read(this,Xt,!0,23,4)},st.prototype.readFloatBE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),nt.read(this,Xt,!1,23,4)},st.prototype.readDoubleLE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,8,this.length),nt.read(this,Xt,!0,52,8)},st.prototype.readDoubleBE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,8,this.length),nt.read(this,Xt,!1,52,8)};function Pt(cn,Xt,Kt,kn,Mn,On){if(!st.isBuffer(cn))throw new TypeError('"buffer" argument must be a Buffer instance');if(Xt>Mn||Xtcn.length)throw new RangeError("Index out of range")}st.prototype.writeUintLE=st.prototype.writeUIntLE=function(Xt,Kt,kn,Mn){if(Xt=+Xt,Kt=Kt>>>0,kn=kn>>>0,!Mn){const Xn=Math.pow(2,8*kn)-1;Pt(this,Xt,Kt,kn,Xn,0)}let On=1,Bn=0;for(this[Kt]=Xt&255;++Bn>>0,kn=kn>>>0,!Mn){const Xn=Math.pow(2,8*kn)-1;Pt(this,Xt,Kt,kn,Xn,0)}let On=kn-1,Bn=1;for(this[Kt+On]=Xt&255;--On>=0&&(Bn*=256);)this[Kt+On]=Xt/Bn&255;return Kt+kn},st.prototype.writeUint8=st.prototype.writeUInt8=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,1,255,0),this[Kt]=Xt&255,Kt+1},st.prototype.writeUint16LE=st.prototype.writeUInt16LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,65535,0),this[Kt]=Xt&255,this[Kt+1]=Xt>>>8,Kt+2},st.prototype.writeUint16BE=st.prototype.writeUInt16BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,65535,0),this[Kt]=Xt>>>8,this[Kt+1]=Xt&255,Kt+2},st.prototype.writeUint32LE=st.prototype.writeUInt32LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,4294967295,0),this[Kt+3]=Xt>>>24,this[Kt+2]=Xt>>>16,this[Kt+1]=Xt>>>8,this[Kt]=Xt&255,Kt+4},st.prototype.writeUint32BE=st.prototype.writeUInt32BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,4294967295,0),this[Kt]=Xt>>>24,this[Kt+1]=Xt>>>16,this[Kt+2]=Xt>>>8,this[Kt+3]=Xt&255,Kt+4};function Ht(cn,Xt,Kt,kn,Mn){Jt(Xt,kn,Mn,cn,Kt,7);let On=Number(Xt&BigInt(4294967295));cn[Kt++]=On,On=On>>8,cn[Kt++]=On,On=On>>8,cn[Kt++]=On,On=On>>8,cn[Kt++]=On;let Bn=Number(Xt>>BigInt(32)&BigInt(4294967295));return cn[Kt++]=Bn,Bn=Bn>>8,cn[Kt++]=Bn,Bn=Bn>>8,cn[Kt++]=Bn,Bn=Bn>>8,cn[Kt++]=Bn,Kt}function Qt(cn,Xt,Kt,kn,Mn){Jt(Xt,kn,Mn,cn,Kt,7);let On=Number(Xt&BigInt(4294967295));cn[Kt+7]=On,On=On>>8,cn[Kt+6]=On,On=On>>8,cn[Kt+5]=On,On=On>>8,cn[Kt+4]=On;let Bn=Number(Xt>>BigInt(32)&BigInt(4294967295));return cn[Kt+3]=Bn,Bn=Bn>>8,cn[Kt+2]=Bn,Bn=Bn>>8,cn[Kt+1]=Bn,Bn=Bn>>8,cn[Kt]=Bn,Kt+8}st.prototype.writeBigUInt64LE=xn(function(Xt,Kt=0){return Ht(this,Xt,Kt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeBigUInt64BE=xn(function(Xt,Kt=0){return Qt(this,Xt,Kt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeIntLE=function(Xt,Kt,kn,Mn){if(Xt=+Xt,Kt=Kt>>>0,!Mn){const Vn=Math.pow(2,8*kn-1);Pt(this,Xt,Kt,kn,Vn-1,-Vn)}let On=0,Bn=1,Xn=0;for(this[Kt]=Xt&255;++On>0)-Xn&255;return Kt+kn},st.prototype.writeIntBE=function(Xt,Kt,kn,Mn){if(Xt=+Xt,Kt=Kt>>>0,!Mn){const Vn=Math.pow(2,8*kn-1);Pt(this,Xt,Kt,kn,Vn-1,-Vn)}let On=kn-1,Bn=1,Xn=0;for(this[Kt+On]=Xt&255;--On>=0&&(Bn*=256);)Xt<0&&Xn===0&&this[Kt+On+1]!==0&&(Xn=1),this[Kt+On]=(Xt/Bn>>0)-Xn&255;return Kt+kn},st.prototype.writeInt8=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,1,127,-128),Xt<0&&(Xt=255+Xt+1),this[Kt]=Xt&255,Kt+1},st.prototype.writeInt16LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,32767,-32768),this[Kt]=Xt&255,this[Kt+1]=Xt>>>8,Kt+2},st.prototype.writeInt16BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,32767,-32768),this[Kt]=Xt>>>8,this[Kt+1]=Xt&255,Kt+2},st.prototype.writeInt32LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,2147483647,-2147483648),this[Kt]=Xt&255,this[Kt+1]=Xt>>>8,this[Kt+2]=Xt>>>16,this[Kt+3]=Xt>>>24,Kt+4},st.prototype.writeInt32BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,2147483647,-2147483648),Xt<0&&(Xt=4294967295+Xt+1),this[Kt]=Xt>>>24,this[Kt+1]=Xt>>>16,this[Kt+2]=Xt>>>8,this[Kt+3]=Xt&255,Kt+4},st.prototype.writeBigInt64LE=xn(function(Xt,Kt=0){return Ht(this,Xt,Kt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),st.prototype.writeBigInt64BE=xn(function(Xt,Kt=0){return Qt(this,Xt,Kt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function an(cn,Xt,Kt,kn,Mn,On){if(Kt+kn>cn.length)throw new RangeError("Index out of range");if(Kt<0)throw new RangeError("Index out of range")}function Yt(cn,Xt,Kt,kn,Mn){return Xt=+Xt,Kt=Kt>>>0,Mn||an(cn,Xt,Kt,4),nt.write(cn,Xt,Kt,kn,23,4),Kt+4}st.prototype.writeFloatLE=function(Xt,Kt,kn){return Yt(this,Xt,Kt,!0,kn)},st.prototype.writeFloatBE=function(Xt,Kt,kn){return Yt(this,Xt,Kt,!1,kn)};function nn(cn,Xt,Kt,kn,Mn){return Xt=+Xt,Kt=Kt>>>0,Mn||an(cn,Xt,Kt,8),nt.write(cn,Xt,Kt,kn,52,8),Kt+8}st.prototype.writeDoubleLE=function(Xt,Kt,kn){return nn(this,Xt,Kt,!0,kn)},st.prototype.writeDoubleBE=function(Xt,Kt,kn){return nn(this,Xt,Kt,!1,kn)},st.prototype.copy=function(Xt,Kt,kn,Mn){if(!st.isBuffer(Xt))throw new TypeError("argument should be a Buffer");if(kn||(kn=0),!Mn&&Mn!==0&&(Mn=this.length),Kt>=Xt.length&&(Kt=Xt.length),Kt||(Kt=0),Mn>0&&Mn=this.length)throw new RangeError("Index out of range");if(Mn<0)throw new RangeError("sourceEnd out of bounds");Mn>this.length&&(Mn=this.length),Xt.length-Kt>>0,kn=kn===void 0?this.length:kn>>>0,Xt||(Xt=0);let On;if(typeof Xt=="number")for(On=Kt;On2**32?Mn=wn(String(Kt)):typeof Kt=="bigint"&&(Mn=String(Kt),(Kt>BigInt(2)**BigInt(32)||Kt<-(BigInt(2)**BigInt(32)))&&(Mn=wn(Mn)),Mn+="n"),kn+=` It must be ${Xt}. Received ${Mn}`,kn},RangeError);function wn(cn){let Xt="",Kt=cn.length;const kn=cn[0]==="-"?1:0;for(;Kt>=kn+4;Kt-=3)Xt=`_${cn.slice(Kt-3,Kt)}${Xt}`;return`${cn.slice(0,Kt)}${Xt}`}function rn(cn,Xt,Kt){vn(Xt,"offset"),(cn[Xt]===void 0||cn[Xt+Kt]===void 0)&&Cn(Xt,cn.length-(Kt+1))}function Jt(cn,Xt,Kt,kn,Mn,On){if(cn>Kt||cn3?Xt===0||Xt===BigInt(0)?Xn=`>= 0${Bn} and < 2${Bn} ** ${(On+1)*8}${Bn}`:Xn=`>= -(2${Bn} ** ${(On+1)*8-1}${Bn}) and < 2 ** ${(On+1)*8-1}${Bn}`:Xn=`>= ${Xt}${Bn} and <= ${Kt}${Bn}`,new tn.ERR_OUT_OF_RANGE("value",Xn,cn)}rn(kn,Mn,On)}function vn(cn,Xt){if(typeof cn!="number")throw new tn.ERR_INVALID_ARG_TYPE(Xt,"number",cn)}function Cn(cn,Xt,Kt){throw Math.floor(cn)!==cn?(vn(cn,Kt),new tn.ERR_OUT_OF_RANGE(Kt||"offset","an integer",cn)):Xt<0?new tn.ERR_BUFFER_OUT_OF_BOUNDS:new tn.ERR_OUT_OF_RANGE(Kt||"offset",`>= ${Kt?1:0} and <= ${Xt}`,cn)}const $n=/[^+/0-9A-Za-z-_]/g;function Nn(cn){if(cn=cn.split("=")[0],cn=cn.trim().replace($n,""),cn.length<2)return"";for(;cn.length%4!==0;)cn=cn+"=";return cn}function En(cn,Xt){Xt=Xt||1/0;let Kt;const kn=cn.length;let Mn=null;const On=[];for(let Bn=0;Bn55295&&Kt<57344){if(!Mn){if(Kt>56319){(Xt-=3)>-1&&On.push(239,191,189);continue}else if(Bn+1===kn){(Xt-=3)>-1&&On.push(239,191,189);continue}Mn=Kt;continue}if(Kt<56320){(Xt-=3)>-1&&On.push(239,191,189),Mn=Kt;continue}Kt=(Mn-55296<<10|Kt-56320)+65536}else Mn&&(Xt-=3)>-1&&On.push(239,191,189);if(Mn=null,Kt<128){if((Xt-=1)<0)break;On.push(Kt)}else if(Kt<2048){if((Xt-=2)<0)break;On.push(Kt>>6|192,Kt&63|128)}else if(Kt<65536){if((Xt-=3)<0)break;On.push(Kt>>12|224,Kt>>6&63|128,Kt&63|128)}else if(Kt<1114112){if((Xt-=4)<0)break;On.push(Kt>>18|240,Kt>>12&63|128,Kt>>6&63|128,Kt&63|128)}else throw new Error("Invalid code point")}return On}function sn(cn){const Xt=[];for(let Kt=0;Kt>8,Mn=Kt%256,On.push(Mn),On.push(kn);return On}function Tn(cn){return et.toByteArray(Nn(cn))}function In(cn,Xt,Kt,kn){let Mn;for(Mn=0;Mn=Xt.length||Mn>=cn.length);++Mn)Xt[Mn+Kt]=cn[Mn];return Mn}function yn(cn,Xt){return cn instanceof Xt||cn!=null&&cn.constructor!=null&&cn.constructor.name!=null&&cn.constructor.name===Xt.name}function hn(cn){return cn!==cn}const fn=function(){const cn="0123456789abcdef",Xt=new Array(256);for(let Kt=0;Kt<16;++Kt){const kn=Kt*16;for(let Mn=0;Mn<16;++Mn)Xt[kn+Mn]=cn[Kt]+cn[Mn]}return Xt}();function xn(cn){return typeof BigInt>"u"?jn:cn}function jn(){throw new Error("BigInt not supported")}})(buffer$2);var browser$d={exports:{}},process$1=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(tt){if(cachedSetTimeout===setTimeout)return setTimeout(tt,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(tt,0);try{return cachedSetTimeout(tt,0)}catch{try{return cachedSetTimeout.call(null,tt,0)}catch{return cachedSetTimeout.call(this,tt,0)}}}function runClearTimeout(tt){if(cachedClearTimeout===clearTimeout)return clearTimeout(tt);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(tt);try{return cachedClearTimeout(tt)}catch{try{return cachedClearTimeout.call(null,tt)}catch{return cachedClearTimeout.call(this,tt)}}}var queue$2=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$2=currentQueue.concat(queue$2):queueIndex=-1,queue$2.length&&drainQueue())}function drainQueue(){if(!draining){var tt=runTimeout(cleanUpNextTick);draining=!0;for(var et=queue$2.length;et;){for(currentQueue=queue$2,queue$2=[];++queueIndex1)for(var nt=1;ntit)throw new RangeError('The value "'+cn+'" is invalid for option "size"');const Xt=new Uint8Array(cn);return Object.setPrototypeOf(Xt,st.prototype),Xt}function st(cn,Xt,Kt){if(typeof cn=="number"){if(typeof Xt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ht(cn)}return lt(cn,Xt,Kt)}st.poolSize=8192;function lt(cn,Xt,Kt){if(typeof cn=="string")return dt(cn,Xt);if(ArrayBuffer.isView(cn))return mt(cn);if(cn==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof cn);if(yn(cn,ArrayBuffer)||cn&&yn(cn.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(yn(cn,SharedArrayBuffer)||cn&&yn(cn.buffer,SharedArrayBuffer)))return gt(cn,Xt,Kt);if(typeof cn=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const kn=cn.valueOf&&cn.valueOf();if(kn!=null&&kn!==cn)return st.from(kn,Xt,Kt);const Mn=yt(cn);if(Mn)return Mn;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof cn[Symbol.toPrimitive]=="function")return st.from(cn[Symbol.toPrimitive]("string"),Xt,Kt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof cn)}st.from=function(cn,Xt,Kt){return lt(cn,Xt,Kt)},Object.setPrototypeOf(st.prototype,Uint8Array.prototype),Object.setPrototypeOf(st,Uint8Array);function ct(cn){if(typeof cn!="number")throw new TypeError('"size" argument must be of type number');if(cn<0)throw new RangeError('The value "'+cn+'" is invalid for option "size"')}function ut(cn,Xt,Kt){return ct(cn),cn<=0?at(cn):Xt!==void 0?typeof Kt=="string"?at(cn).fill(Xt,Kt):at(cn).fill(Xt):at(cn)}st.alloc=function(cn,Xt,Kt){return ut(cn,Xt,Kt)};function ht(cn){return ct(cn),at(cn<0?0:bt(cn)|0)}st.allocUnsafe=function(cn){return ht(cn)},st.allocUnsafeSlow=function(cn){return ht(cn)};function dt(cn,Xt){if((typeof Xt!="string"||Xt==="")&&(Xt="utf8"),!st.isEncoding(Xt))throw new TypeError("Unknown encoding: "+Xt);const Kt=xt(cn,Xt)|0;let kn=at(Kt);const Mn=kn.write(cn,Xt);return Mn!==Kt&&(kn=kn.slice(0,Mn)),kn}function pt(cn){const Xt=cn.length<0?0:bt(cn.length)|0,Kt=at(Xt);for(let kn=0;kn=it)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+it.toString(16)+" bytes");return cn|0}function wt(cn){return+cn!=cn&&(cn=0),st.alloc(+cn)}st.isBuffer=function(Xt){return Xt!=null&&Xt._isBuffer===!0&&Xt!==st.prototype},st.compare=function(Xt,Kt){if(yn(Xt,Uint8Array)&&(Xt=st.from(Xt,Xt.offset,Xt.byteLength)),yn(Kt,Uint8Array)&&(Kt=st.from(Kt,Kt.offset,Kt.byteLength)),!st.isBuffer(Xt)||!st.isBuffer(Kt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Xt===Kt)return 0;let kn=Xt.length,Mn=Kt.length;for(let On=0,Bn=Math.min(kn,Mn);OnMn.length?(st.isBuffer(Bn)||(Bn=st.from(Bn)),Bn.copy(Mn,On)):Uint8Array.prototype.set.call(Mn,Bn,On);else if(st.isBuffer(Bn))Bn.copy(Mn,On);else throw new TypeError('"list" argument must be an Array of Buffers');On+=Bn.length}return Mn};function xt(cn,Xt){if(st.isBuffer(cn))return cn.length;if(ArrayBuffer.isView(cn)||yn(cn,ArrayBuffer))return cn.byteLength;if(typeof cn!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof cn);const Kt=cn.length,kn=arguments.length>2&&arguments[2]===!0;if(!kn&&Kt===0)return 0;let Mn=!1;for(;;)switch(Xt){case"ascii":case"latin1":case"binary":return Kt;case"utf8":case"utf-8":return En(cn).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt*2;case"hex":return Kt>>>1;case"base64":return Tn(cn).length;default:if(Mn)return kn?-1:En(cn).length;Xt=(""+Xt).toLowerCase(),Mn=!0}}st.byteLength=xt;function kt(cn,Xt,Kt){let kn=!1;if((Xt===void 0||Xt<0)&&(Xt=0),Xt>this.length||((Kt===void 0||Kt>this.length)&&(Kt=this.length),Kt<=0)||(Kt>>>=0,Xt>>>=0,Kt<=Xt))return"";for(cn||(cn="utf8");;)switch(cn){case"hex":return Ft(this,Xt,Kt);case"utf8":case"utf-8":return vt(this,Xt,Kt);case"ascii":return Wt(this,Xt,Kt);case"latin1":case"binary":return zt(this,Xt,Kt);case"base64":return $t(this,Xt,Kt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,Xt,Kt);default:if(kn)throw new TypeError("Unknown encoding: "+cn);cn=(cn+"").toLowerCase(),kn=!0}}st.prototype._isBuffer=!0;function St(cn,Xt,Kt){const kn=cn[Xt];cn[Xt]=cn[Kt],cn[Kt]=kn}st.prototype.swap16=function(){const Xt=this.length;if(Xt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Kt=0;KtKt&&(Xt+=" ... "),""},rt&&(st.prototype[rt]=st.prototype.inspect),st.prototype.compare=function(Xt,Kt,kn,Mn,On){if(yn(Xt,Uint8Array)&&(Xt=st.from(Xt,Xt.offset,Xt.byteLength)),!st.isBuffer(Xt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Xt);if(Kt===void 0&&(Kt=0),kn===void 0&&(kn=Xt?Xt.length:0),Mn===void 0&&(Mn=0),On===void 0&&(On=this.length),Kt<0||kn>Xt.length||Mn<0||On>this.length)throw new RangeError("out of range index");if(Mn>=On&&Kt>=kn)return 0;if(Mn>=On)return-1;if(Kt>=kn)return 1;if(Kt>>>=0,kn>>>=0,Mn>>>=0,On>>>=0,this===Xt)return 0;let Bn=On-Mn,Xn=kn-Kt;const Vn=Math.min(Bn,Xn),Gn=this.slice(Mn,On),zn=Xt.slice(Kt,kn);for(let Jn=0;Jn2147483647?Kt=2147483647:Kt<-2147483648&&(Kt=-2147483648),Kt=+Kt,hn(Kt)&&(Kt=Mn?0:cn.length-1),Kt<0&&(Kt=cn.length+Kt),Kt>=cn.length){if(Mn)return-1;Kt=cn.length-1}else if(Kt<0)if(Mn)Kt=0;else return-1;if(typeof Xt=="string"&&(Xt=st.from(Xt,kn)),st.isBuffer(Xt))return Xt.length===0?-1:At(cn,Xt,Kt,kn,Mn);if(typeof Xt=="number")return Xt=Xt&255,typeof Uint8Array.prototype.indexOf=="function"?Mn?Uint8Array.prototype.indexOf.call(cn,Xt,Kt):Uint8Array.prototype.lastIndexOf.call(cn,Xt,Kt):At(cn,[Xt],Kt,kn,Mn);throw new TypeError("val must be string, number or Buffer")}function At(cn,Xt,Kt,kn,Mn){let On=1,Bn=cn.length,Xn=Xt.length;if(kn!==void 0&&(kn=String(kn).toLowerCase(),kn==="ucs2"||kn==="ucs-2"||kn==="utf16le"||kn==="utf-16le")){if(cn.length<2||Xt.length<2)return-1;On=2,Bn/=2,Xn/=2,Kt/=2}function Vn(zn,Jn){return On===1?zn[Jn]:zn.readUInt16BE(Jn*On)}let Gn;if(Mn){let zn=-1;for(Gn=Kt;GnBn&&(Kt=Bn-Xn),Gn=Kt;Gn>=0;Gn--){let zn=!0;for(let Jn=0;JnMn&&(kn=Mn)):kn=Mn;const On=Xt.length;kn>On/2&&(kn=On/2);let Bn;for(Bn=0;Bn>>0,isFinite(kn)?(kn=kn>>>0,Mn===void 0&&(Mn="utf8")):(Mn=kn,kn=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const On=this.length-Kt;if((kn===void 0||kn>On)&&(kn=On),Xt.length>0&&(kn<0||Kt<0)||Kt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Mn||(Mn="utf8");let Bn=!1;for(;;)switch(Mn){case"hex":return Et(this,Xt,Kt,kn);case"utf8":case"utf-8":return Ct(this,Xt,Kt,kn);case"ascii":case"latin1":case"binary":return Lt(this,Xt,Kt,kn);case"base64":return jt(this,Xt,Kt,kn);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt(this,Xt,Kt,kn);default:if(Bn)throw new TypeError("Unknown encoding: "+Mn);Mn=(""+Mn).toLowerCase(),Bn=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $t(cn,Xt,Kt){return Xt===0&&Kt===cn.length?et.fromByteArray(cn):et.fromByteArray(cn.slice(Xt,Kt))}function vt(cn,Xt,Kt){Kt=Math.min(cn.length,Kt);const kn=[];let Mn=Xt;for(;Mn239?4:On>223?3:On>191?2:1;if(Mn+Xn<=Kt){let Vn,Gn,zn,Jn;switch(Xn){case 1:On<128&&(Bn=On);break;case 2:Vn=cn[Mn+1],(Vn&192)===128&&(Jn=(On&31)<<6|Vn&63,Jn>127&&(Bn=Jn));break;case 3:Vn=cn[Mn+1],Gn=cn[Mn+2],(Vn&192)===128&&(Gn&192)===128&&(Jn=(On&15)<<12|(Vn&63)<<6|Gn&63,Jn>2047&&(Jn<55296||Jn>57343)&&(Bn=Jn));break;case 4:Vn=cn[Mn+1],Gn=cn[Mn+2],zn=cn[Mn+3],(Vn&192)===128&&(Gn&192)===128&&(zn&192)===128&&(Jn=(On&15)<<18|(Vn&63)<<12|(Gn&63)<<6|zn&63,Jn>65535&&Jn<1114112&&(Bn=Jn))}}Bn===null?(Bn=65533,Xn=1):Bn>65535&&(Bn-=65536,kn.push(Bn>>>10&1023|55296),Bn=56320|Bn&1023),kn.push(Bn),Mn+=Xn}return Ot(kn)}const It=4096;function Ot(cn){const Xt=cn.length;if(Xt<=It)return String.fromCharCode.apply(String,cn);let Kt="",kn=0;for(;knkn)&&(Kt=kn);let Mn="";for(let On=Xt;Onkn&&(Xt=kn),Kt<0?(Kt+=kn,Kt<0&&(Kt=0)):Kt>kn&&(Kt=kn),KtKt)throw new RangeError("Trying to access beyond buffer length")}st.prototype.readUintLE=st.prototype.readUIntLE=function(Xt,Kt,kn){Xt=Xt>>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=this[Xt],On=1,Bn=0;for(;++Bn>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=this[Xt+--Kt],On=1;for(;Kt>0&&(On*=256);)Mn+=this[Xt+--Kt]*On;return Mn},st.prototype.readUint8=st.prototype.readUInt8=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,1,this.length),this[Xt]},st.prototype.readUint16LE=st.prototype.readUInt16LE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,2,this.length),this[Xt]|this[Xt+1]<<8},st.prototype.readUint16BE=st.prototype.readUInt16BE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,2,this.length),this[Xt]<<8|this[Xt+1]},st.prototype.readUint32LE=st.prototype.readUInt32LE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),(this[Xt]|this[Xt+1]<<8|this[Xt+2]<<16)+this[Xt+3]*16777216},st.prototype.readUint32BE=st.prototype.readUInt32BE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),this[Xt]*16777216+(this[Xt+1]<<16|this[Xt+2]<<8|this[Xt+3])},st.prototype.readBigUInt64LE=xn(function(Xt){Xt=Xt>>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=Kt+this[++Xt]*2**8+this[++Xt]*2**16+this[++Xt]*2**24,On=this[++Xt]+this[++Xt]*2**8+this[++Xt]*2**16+kn*2**24;return BigInt(Mn)+(BigInt(On)<>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=Kt*2**24+this[++Xt]*2**16+this[++Xt]*2**8+this[++Xt],On=this[++Xt]*2**24+this[++Xt]*2**16+this[++Xt]*2**8+kn;return(BigInt(Mn)<>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=this[Xt],On=1,Bn=0;for(;++Bn=On&&(Mn-=Math.pow(2,8*Kt)),Mn},st.prototype.readIntBE=function(Xt,Kt,kn){Xt=Xt>>>0,Kt=Kt>>>0,kn||Ut(Xt,Kt,this.length);let Mn=Kt,On=1,Bn=this[Xt+--Mn];for(;Mn>0&&(On*=256);)Bn+=this[Xt+--Mn]*On;return On*=128,Bn>=On&&(Bn-=Math.pow(2,8*Kt)),Bn},st.prototype.readInt8=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,1,this.length),this[Xt]&128?(255-this[Xt]+1)*-1:this[Xt]},st.prototype.readInt16LE=function(Xt,Kt){Xt=Xt>>>0,Kt||Ut(Xt,2,this.length);const kn=this[Xt]|this[Xt+1]<<8;return kn&32768?kn|4294901760:kn},st.prototype.readInt16BE=function(Xt,Kt){Xt=Xt>>>0,Kt||Ut(Xt,2,this.length);const kn=this[Xt+1]|this[Xt]<<8;return kn&32768?kn|4294901760:kn},st.prototype.readInt32LE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),this[Xt]|this[Xt+1]<<8|this[Xt+2]<<16|this[Xt+3]<<24},st.prototype.readInt32BE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),this[Xt]<<24|this[Xt+1]<<16|this[Xt+2]<<8|this[Xt+3]},st.prototype.readBigInt64LE=xn(function(Xt){Xt=Xt>>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=this[Xt+4]+this[Xt+5]*2**8+this[Xt+6]*2**16+(kn<<24);return(BigInt(Mn)<>>0,vn(Xt,"offset");const Kt=this[Xt],kn=this[Xt+7];(Kt===void 0||kn===void 0)&&Cn(Xt,this.length-8);const Mn=(Kt<<24)+this[++Xt]*2**16+this[++Xt]*2**8+this[++Xt];return(BigInt(Mn)<>>0,Kt||Ut(Xt,4,this.length),nt.read(this,Xt,!0,23,4)},st.prototype.readFloatBE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,4,this.length),nt.read(this,Xt,!1,23,4)},st.prototype.readDoubleLE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,8,this.length),nt.read(this,Xt,!0,52,8)},st.prototype.readDoubleBE=function(Xt,Kt){return Xt=Xt>>>0,Kt||Ut(Xt,8,this.length),nt.read(this,Xt,!1,52,8)};function Pt(cn,Xt,Kt,kn,Mn,On){if(!st.isBuffer(cn))throw new TypeError('"buffer" argument must be a Buffer instance');if(Xt>Mn||Xtcn.length)throw new RangeError("Index out of range")}st.prototype.writeUintLE=st.prototype.writeUIntLE=function(Xt,Kt,kn,Mn){if(Xt=+Xt,Kt=Kt>>>0,kn=kn>>>0,!Mn){const Xn=Math.pow(2,8*kn)-1;Pt(this,Xt,Kt,kn,Xn,0)}let On=1,Bn=0;for(this[Kt]=Xt&255;++Bn>>0,kn=kn>>>0,!Mn){const Xn=Math.pow(2,8*kn)-1;Pt(this,Xt,Kt,kn,Xn,0)}let On=kn-1,Bn=1;for(this[Kt+On]=Xt&255;--On>=0&&(Bn*=256);)this[Kt+On]=Xt/Bn&255;return Kt+kn},st.prototype.writeUint8=st.prototype.writeUInt8=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,1,255,0),this[Kt]=Xt&255,Kt+1},st.prototype.writeUint16LE=st.prototype.writeUInt16LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,65535,0),this[Kt]=Xt&255,this[Kt+1]=Xt>>>8,Kt+2},st.prototype.writeUint16BE=st.prototype.writeUInt16BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,65535,0),this[Kt]=Xt>>>8,this[Kt+1]=Xt&255,Kt+2},st.prototype.writeUint32LE=st.prototype.writeUInt32LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,4294967295,0),this[Kt+3]=Xt>>>24,this[Kt+2]=Xt>>>16,this[Kt+1]=Xt>>>8,this[Kt]=Xt&255,Kt+4},st.prototype.writeUint32BE=st.prototype.writeUInt32BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,4294967295,0),this[Kt]=Xt>>>24,this[Kt+1]=Xt>>>16,this[Kt+2]=Xt>>>8,this[Kt+3]=Xt&255,Kt+4};function Ht(cn,Xt,Kt,kn,Mn){Zt(Xt,kn,Mn,cn,Kt,7);let On=Number(Xt&BigInt(4294967295));cn[Kt++]=On,On=On>>8,cn[Kt++]=On,On=On>>8,cn[Kt++]=On,On=On>>8,cn[Kt++]=On;let Bn=Number(Xt>>BigInt(32)&BigInt(4294967295));return cn[Kt++]=Bn,Bn=Bn>>8,cn[Kt++]=Bn,Bn=Bn>>8,cn[Kt++]=Bn,Bn=Bn>>8,cn[Kt++]=Bn,Kt}function Qt(cn,Xt,Kt,kn,Mn){Zt(Xt,kn,Mn,cn,Kt,7);let On=Number(Xt&BigInt(4294967295));cn[Kt+7]=On,On=On>>8,cn[Kt+6]=On,On=On>>8,cn[Kt+5]=On,On=On>>8,cn[Kt+4]=On;let Bn=Number(Xt>>BigInt(32)&BigInt(4294967295));return cn[Kt+3]=Bn,Bn=Bn>>8,cn[Kt+2]=Bn,Bn=Bn>>8,cn[Kt+1]=Bn,Bn=Bn>>8,cn[Kt]=Bn,Kt+8}st.prototype.writeBigUInt64LE=xn(function(Xt,Kt=0){return Ht(this,Xt,Kt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeBigUInt64BE=xn(function(Xt,Kt=0){return Qt(this,Xt,Kt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeIntLE=function(Xt,Kt,kn,Mn){if(Xt=+Xt,Kt=Kt>>>0,!Mn){const Vn=Math.pow(2,8*kn-1);Pt(this,Xt,Kt,kn,Vn-1,-Vn)}let On=0,Bn=1,Xn=0;for(this[Kt]=Xt&255;++On>0)-Xn&255;return Kt+kn},st.prototype.writeIntBE=function(Xt,Kt,kn,Mn){if(Xt=+Xt,Kt=Kt>>>0,!Mn){const Vn=Math.pow(2,8*kn-1);Pt(this,Xt,Kt,kn,Vn-1,-Vn)}let On=kn-1,Bn=1,Xn=0;for(this[Kt+On]=Xt&255;--On>=0&&(Bn*=256);)Xt<0&&Xn===0&&this[Kt+On+1]!==0&&(Xn=1),this[Kt+On]=(Xt/Bn>>0)-Xn&255;return Kt+kn},st.prototype.writeInt8=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,1,127,-128),Xt<0&&(Xt=255+Xt+1),this[Kt]=Xt&255,Kt+1},st.prototype.writeInt16LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,32767,-32768),this[Kt]=Xt&255,this[Kt+1]=Xt>>>8,Kt+2},st.prototype.writeInt16BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,2,32767,-32768),this[Kt]=Xt>>>8,this[Kt+1]=Xt&255,Kt+2},st.prototype.writeInt32LE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,2147483647,-2147483648),this[Kt]=Xt&255,this[Kt+1]=Xt>>>8,this[Kt+2]=Xt>>>16,this[Kt+3]=Xt>>>24,Kt+4},st.prototype.writeInt32BE=function(Xt,Kt,kn){return Xt=+Xt,Kt=Kt>>>0,kn||Pt(this,Xt,Kt,4,2147483647,-2147483648),Xt<0&&(Xt=4294967295+Xt+1),this[Kt]=Xt>>>24,this[Kt+1]=Xt>>>16,this[Kt+2]=Xt>>>8,this[Kt+3]=Xt&255,Kt+4},st.prototype.writeBigInt64LE=xn(function(Xt,Kt=0){return Ht(this,Xt,Kt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),st.prototype.writeBigInt64BE=xn(function(Xt,Kt=0){return Qt(this,Xt,Kt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function an(cn,Xt,Kt,kn,Mn,On){if(Kt+kn>cn.length)throw new RangeError("Index out of range");if(Kt<0)throw new RangeError("Index out of range")}function Yt(cn,Xt,Kt,kn,Mn){return Xt=+Xt,Kt=Kt>>>0,Mn||an(cn,Xt,Kt,4),nt.write(cn,Xt,Kt,kn,23,4),Kt+4}st.prototype.writeFloatLE=function(Xt,Kt,kn){return Yt(this,Xt,Kt,!0,kn)},st.prototype.writeFloatBE=function(Xt,Kt,kn){return Yt(this,Xt,Kt,!1,kn)};function nn(cn,Xt,Kt,kn,Mn){return Xt=+Xt,Kt=Kt>>>0,Mn||an(cn,Xt,Kt,8),nt.write(cn,Xt,Kt,kn,52,8),Kt+8}st.prototype.writeDoubleLE=function(Xt,Kt,kn){return nn(this,Xt,Kt,!0,kn)},st.prototype.writeDoubleBE=function(Xt,Kt,kn){return nn(this,Xt,Kt,!1,kn)},st.prototype.copy=function(Xt,Kt,kn,Mn){if(!st.isBuffer(Xt))throw new TypeError("argument should be a Buffer");if(kn||(kn=0),!Mn&&Mn!==0&&(Mn=this.length),Kt>=Xt.length&&(Kt=Xt.length),Kt||(Kt=0),Mn>0&&Mn=this.length)throw new RangeError("Index out of range");if(Mn<0)throw new RangeError("sourceEnd out of bounds");Mn>this.length&&(Mn=this.length),Xt.length-Kt>>0,kn=kn===void 0?this.length:kn>>>0,Xt||(Xt=0);let On;if(typeof Xt=="number")for(On=Kt;On2**32?Mn=wn(String(Kt)):typeof Kt=="bigint"&&(Mn=String(Kt),(Kt>BigInt(2)**BigInt(32)||Kt<-(BigInt(2)**BigInt(32)))&&(Mn=wn(Mn)),Mn+="n"),kn+=` It must be ${Xt}. Received ${Mn}`,kn},RangeError);function wn(cn){let Xt="",Kt=cn.length;const kn=cn[0]==="-"?1:0;for(;Kt>=kn+4;Kt-=3)Xt=`_${cn.slice(Kt-3,Kt)}${Xt}`;return`${cn.slice(0,Kt)}${Xt}`}function rn(cn,Xt,Kt){vn(Xt,"offset"),(cn[Xt]===void 0||cn[Xt+Kt]===void 0)&&Cn(Xt,cn.length-(Kt+1))}function Zt(cn,Xt,Kt,kn,Mn,On){if(cn>Kt||cn3?Xt===0||Xt===BigInt(0)?Xn=`>= 0${Bn} and < 2${Bn} ** ${(On+1)*8}${Bn}`:Xn=`>= -(2${Bn} ** ${(On+1)*8-1}${Bn}) and < 2 ** ${(On+1)*8-1}${Bn}`:Xn=`>= ${Xt}${Bn} and <= ${Kt}${Bn}`,new tn.ERR_OUT_OF_RANGE("value",Xn,cn)}rn(kn,Mn,On)}function vn(cn,Xt){if(typeof cn!="number")throw new tn.ERR_INVALID_ARG_TYPE(Xt,"number",cn)}function Cn(cn,Xt,Kt){throw Math.floor(cn)!==cn?(vn(cn,Kt),new tn.ERR_OUT_OF_RANGE(Kt||"offset","an integer",cn)):Xt<0?new tn.ERR_BUFFER_OUT_OF_BOUNDS:new tn.ERR_OUT_OF_RANGE(Kt||"offset",`>= ${Kt?1:0} and <= ${Xt}`,cn)}const $n=/[^+/0-9A-Za-z-_]/g;function Nn(cn){if(cn=cn.split("=")[0],cn=cn.trim().replace($n,""),cn.length<2)return"";for(;cn.length%4!==0;)cn=cn+"=";return cn}function En(cn,Xt){Xt=Xt||1/0;let Kt;const kn=cn.length;let Mn=null;const On=[];for(let Bn=0;Bn55295&&Kt<57344){if(!Mn){if(Kt>56319){(Xt-=3)>-1&&On.push(239,191,189);continue}else if(Bn+1===kn){(Xt-=3)>-1&&On.push(239,191,189);continue}Mn=Kt;continue}if(Kt<56320){(Xt-=3)>-1&&On.push(239,191,189),Mn=Kt;continue}Kt=(Mn-55296<<10|Kt-56320)+65536}else Mn&&(Xt-=3)>-1&&On.push(239,191,189);if(Mn=null,Kt<128){if((Xt-=1)<0)break;On.push(Kt)}else if(Kt<2048){if((Xt-=2)<0)break;On.push(Kt>>6|192,Kt&63|128)}else if(Kt<65536){if((Xt-=3)<0)break;On.push(Kt>>12|224,Kt>>6&63|128,Kt&63|128)}else if(Kt<1114112){if((Xt-=4)<0)break;On.push(Kt>>18|240,Kt>>12&63|128,Kt>>6&63|128,Kt&63|128)}else throw new Error("Invalid code point")}return On}function sn(cn){const Xt=[];for(let Kt=0;Kt>8,Mn=Kt%256,On.push(Mn),On.push(kn);return On}function Tn(cn){return et.toByteArray(Nn(cn))}function In(cn,Xt,Kt,kn){let Mn;for(Mn=0;Mn=Xt.length||Mn>=cn.length);++Mn)Xt[Mn+Kt]=cn[Mn];return Mn}function yn(cn,Xt){return cn instanceof Xt||cn!=null&&cn.constructor!=null&&cn.constructor.name!=null&&cn.constructor.name===Xt.name}function hn(cn){return cn!==cn}const fn=function(){const cn="0123456789abcdef",Xt=new Array(256);for(let Kt=0;Kt<16;++Kt){const kn=Kt*16;for(let Mn=0;Mn<16;++Mn)Xt[kn+Mn]=cn[Kt]+cn[Mn]}return Xt}();function xn(cn){return typeof BigInt>"u"?jn:cn}function jn(){throw new Error("BigInt not supported")}})(buffer$2);var browser$d={exports:{}},process$1=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(tt){if(cachedSetTimeout===setTimeout)return setTimeout(tt,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(tt,0);try{return cachedSetTimeout(tt,0)}catch{try{return cachedSetTimeout.call(null,tt,0)}catch{return cachedSetTimeout.call(this,tt,0)}}}function runClearTimeout(tt){if(cachedClearTimeout===clearTimeout)return clearTimeout(tt);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(tt);try{return cachedClearTimeout(tt)}catch{try{return cachedClearTimeout.call(null,tt)}catch{return cachedClearTimeout.call(this,tt)}}}var queue$2=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$2=currentQueue.concat(queue$2):queueIndex=-1,queue$2.length&&drainQueue())}function drainQueue(){if(!draining){var tt=runTimeout(cleanUpNextTick);draining=!0;for(var et=queue$2.length;et;){for(currentQueue=queue$2,queue$2=[];++queueIndex1)for(var nt=1;ntet in tt?Q4(tt,et,{enumerable:!0 `+it[at].replace(" at new "," at ");return tt.displayName&<.includes("")&&(lt=lt.replace("",tt.displayName)),lt}while(1<=at&&0<=st);break}}}finally{Na=!1,Error.prepareStackTrace=nt}return(tt=tt?tt.displayName||tt.name:"")?Ma(tt):""}function Pa(tt){switch(tt.tag){case 5:return Ma(tt.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return tt=Oa(tt.type,!1),tt;case 11:return tt=Oa(tt.type.render,!1),tt;case 1:return tt=Oa(tt.type,!0),tt;default:return""}}function Qa(tt){if(tt==null)return null;if(typeof tt=="function")return tt.displayName||tt.name||null;if(typeof tt=="string")return tt;switch(tt){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof tt=="object")switch(tt.$$typeof){case Ca:return(tt.displayName||"Context")+".Consumer";case Ba:return(tt._context.displayName||"Context")+".Provider";case Da:var et=tt.render;return tt=tt.displayName,tt||(tt=et.displayName||et.name||"",tt=tt!==""?"ForwardRef("+tt+")":"ForwardRef"),tt;case Ga:return et=tt.displayName||null,et!==null?et:Qa(tt.type)||"Memo";case Ha:et=tt._payload,tt=tt._init;try{return Qa(tt(et))}catch{}}return null}function Ra(tt){var et=tt.type;switch(tt.tag){case 24:return"Cache";case 9:return(et.displayName||"Context")+".Consumer";case 10:return(et._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return tt=et.render,tt=tt.displayName||tt.name||"",et.displayName||(tt!==""?"ForwardRef("+tt+")":"ForwardRef");case 7:return"Fragment";case 5:return et;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(et);case 8:return et===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof et=="function")return et.displayName||et.name||null;if(typeof et=="string")return et}return null}function Sa(tt){switch(typeof tt){case"boolean":case"number":case"string":case"undefined":return tt;case"object":return tt;default:return""}}function Ta(tt){var et=tt.type;return(tt=tt.nodeName)&&tt.toLowerCase()==="input"&&(et==="checkbox"||et==="radio")}function Ua(tt){var et=Ta(tt)?"checked":"value",nt=Object.getOwnPropertyDescriptor(tt.constructor.prototype,et),rt=""+tt[et];if(!tt.hasOwnProperty(et)&&typeof nt<"u"&&typeof nt.get=="function"&&typeof nt.set=="function"){var it=nt.get,ot=nt.set;return Object.defineProperty(tt,et,{configurable:!0,get:function(){return it.call(this)},set:function(at){rt=""+at,ot.call(this,at)}}),Object.defineProperty(tt,et,{enumerable:nt.enumerable}),{getValue:function(){return rt},setValue:function(at){rt=""+at},stopTracking:function(){tt._valueTracker=null,delete tt[et]}}}}function Va(tt){tt._valueTracker||(tt._valueTracker=Ua(tt))}function Wa(tt){if(!tt)return!1;var et=tt._valueTracker;if(!et)return!0;var nt=et.getValue(),rt="";return tt&&(rt=Ta(tt)?tt.checked?"true":"false":tt.value),tt=rt,tt!==nt?(et.setValue(tt),!0):!1}function Xa(tt){if(tt=tt||(typeof document<"u"?document:void 0),typeof tt>"u")return null;try{return tt.activeElement||tt.body}catch{return tt.body}}function Ya(tt,et){var nt=et.checked;return A$3({},et,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:nt??tt._wrapperState.initialChecked})}function Za(tt,et){var nt=et.defaultValue==null?"":et.defaultValue,rt=et.checked!=null?et.checked:et.defaultChecked;nt=Sa(et.value!=null?et.value:nt),tt._wrapperState={initialChecked:rt,initialValue:nt,controlled:et.type==="checkbox"||et.type==="radio"?et.checked!=null:et.value!=null}}function ab(tt,et){et=et.checked,et!=null&&ta(tt,"checked",et,!1)}function bb(tt,et){ab(tt,et);var nt=Sa(et.value),rt=et.type;if(nt!=null)rt==="number"?(nt===0&&tt.value===""||tt.value!=nt)&&(tt.value=""+nt):tt.value!==""+nt&&(tt.value=""+nt);else if(rt==="submit"||rt==="reset"){tt.removeAttribute("value");return}et.hasOwnProperty("value")?cb(tt,et.type,nt):et.hasOwnProperty("defaultValue")&&cb(tt,et.type,Sa(et.defaultValue)),et.checked==null&&et.defaultChecked!=null&&(tt.defaultChecked=!!et.defaultChecked)}function db(tt,et,nt){if(et.hasOwnProperty("value")||et.hasOwnProperty("defaultValue")){var rt=et.type;if(!(rt!=="submit"&&rt!=="reset"||et.value!==void 0&&et.value!==null))return;et=""+tt._wrapperState.initialValue,nt||et===tt.value||(tt.value=et),tt.defaultValue=et}nt=tt.name,nt!==""&&(tt.name=""),tt.defaultChecked=!!tt._wrapperState.initialChecked,nt!==""&&(tt.name=nt)}function cb(tt,et,nt){(et!=="number"||Xa(tt.ownerDocument)!==tt)&&(nt==null?tt.defaultValue=""+tt._wrapperState.initialValue:tt.defaultValue!==""+nt&&(tt.defaultValue=""+nt))}var eb=Array.isArray;function fb(tt,et,nt,rt){if(tt=tt.options,et){et={};for(var it=0;it"+et.valueOf().toString()+"",et=mb.firstChild;tt.firstChild;)tt.removeChild(tt.firstChild);for(;et.firstChild;)tt.appendChild(et.firstChild)}});function ob(tt,et){if(et){var nt=tt.firstChild;if(nt&&nt===tt.lastChild&&nt.nodeType===3){nt.nodeValue=et;return}}tt.textContent=et}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(tt){qb.forEach(function(et){et=et+tt.charAt(0).toUpperCase()+tt.substring(1),pb[et]=pb[tt]})});function rb(tt,et,nt){return et==null||typeof et=="boolean"||et===""?"":nt||typeof et!="number"||et===0||pb.hasOwnProperty(tt)&&pb[tt]?(""+et).trim():et+"px"}function sb(tt,et){tt=tt.style;for(var nt in et)if(et.hasOwnProperty(nt)){var rt=nt.indexOf("--")===0,it=rb(nt,et[nt],rt);nt==="float"&&(nt="cssFloat"),rt?tt.setProperty(nt,it):tt[nt]=it}}var tb=A$3({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(tt,et){if(et){if(tb[tt]&&(et.children!=null||et.dangerouslySetInnerHTML!=null))throw Error(p$9(137,tt));if(et.dangerouslySetInnerHTML!=null){if(et.children!=null)throw Error(p$9(60));if(typeof et.dangerouslySetInnerHTML!="object"||!("__html"in et.dangerouslySetInnerHTML))throw Error(p$9(61))}if(et.style!=null&&typeof et.style!="object")throw Error(p$9(62))}}function vb(tt,et){if(tt.indexOf("-")===-1)return typeof et.is=="string";switch(tt){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(tt){return tt=tt.target||tt.srcElement||window,tt.correspondingUseElement&&(tt=tt.correspondingUseElement),tt.nodeType===3?tt.parentNode:tt}var yb=null,zb=null,Ab=null;function Bb(tt){if(tt=Cb(tt)){if(typeof yb!="function")throw Error(p$9(280));var et=tt.stateNode;et&&(et=Db(et),yb(tt.stateNode,tt.type,et))}}function Eb(tt){zb?Ab?Ab.push(tt):Ab=[tt]:zb=tt}function Fb(){if(zb){var tt=zb,et=Ab;if(Ab=zb=null,Bb(tt),et)for(tt=0;tt>>=0,tt===0?32:31-(pc(tt)/qc|0)|0}var rc=64,sc=4194304;function tc(tt){switch(tt&-tt){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return tt&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return tt&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return tt}}function uc(tt,et){var nt=tt.pendingLanes;if(nt===0)return 0;var rt=0,it=tt.suspendedLanes,ot=tt.pingedLanes,at=nt&268435455;if(at!==0){var st=at&~it;st!==0?rt=tc(st):(ot&=at,ot!==0&&(rt=tc(ot)))}else at=nt&~it,at!==0?rt=tc(at):ot!==0&&(rt=tc(ot));if(rt===0)return 0;if(et!==0&&et!==rt&&!(et&it)&&(it=rt&-rt,ot=et&-et,it>=ot||it===16&&(ot&4194240)!==0))return et;if(rt&4&&(rt|=nt&16),et=tt.entangledLanes,et!==0)for(tt=tt.entanglements,et&=rt;0nt;nt++)et.push(tt);return et}function Ac(tt,et,nt){tt.pendingLanes|=et,et!==536870912&&(tt.suspendedLanes=0,tt.pingedLanes=0),tt=tt.eventTimes,et=31-oc(et),tt[et]=nt}function Bc(tt,et){var nt=tt.pendingLanes&~et;tt.pendingLanes=et,tt.suspendedLanes=0,tt.pingedLanes=0,tt.expiredLanes&=et,tt.mutableReadLanes&=et,tt.entangledLanes&=et,et=tt.entanglements;var rt=tt.eventTimes;for(tt=tt.expirationTimes;0=be$1),ee$2=String.fromCharCode(32),fe$1=!1;function ge$1(tt,et){switch(tt){case"keyup":return $d.indexOf(et.keyCode)!==-1;case"keydown":return et.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(tt){return tt=tt.detail,typeof tt=="object"&&"data"in tt?tt.data:null}var ie$1=!1;function je$1(tt,et){switch(tt){case"compositionend":return he$1(et);case"keypress":return et.which!==32?null:(fe$1=!0,ee$2);case"textInput":return tt=et.data,tt===ee$2&&fe$1?null:tt;default:return null}}function ke$1(tt,et){if(ie$1)return tt==="compositionend"||!ae$1&&ge$1(tt,et)?(tt=nd(),md=ld=kd=null,ie$1=!1,tt):null;switch(tt){case"paste":return null;case"keypress":if(!(et.ctrlKey||et.altKey||et.metaKey)||et.ctrlKey&&et.altKey){if(et.char&&1=et)return{node:nt,offset:et-tt};tt=rt}e:{for(;nt;){if(nt.nextSibling){nt=nt.nextSibling;break e}nt=nt.parentNode}nt=void 0}nt=Je(nt)}}function Le$1(tt,et){return tt&&et?tt===et?!0:tt&&tt.nodeType===3?!1:et&&et.nodeType===3?Le$1(tt,et.parentNode):"contains"in tt?tt.contains(et):tt.compareDocumentPosition?!!(tt.compareDocumentPosition(et)&16):!1:!1}function Me$2(){for(var tt=window,et=Xa();et instanceof tt.HTMLIFrameElement;){try{var nt=typeof et.contentWindow.location.href=="string"}catch{nt=!1}if(nt)tt=et.contentWindow;else break;et=Xa(tt.document)}return et}function Ne$2(tt){var et=tt&&tt.nodeName&&tt.nodeName.toLowerCase();return et&&(et==="input"&&(tt.type==="text"||tt.type==="search"||tt.type==="tel"||tt.type==="url"||tt.type==="password")||et==="textarea"||tt.contentEditable==="true")}function Oe$1(tt){var et=Me$2(),nt=tt.focusedElem,rt=tt.selectionRange;if(et!==nt&&nt&&nt.ownerDocument&&Le$1(nt.ownerDocument.documentElement,nt)){if(rt!==null&&Ne$2(nt)){if(et=rt.start,tt=rt.end,tt===void 0&&(tt=et),"selectionStart"in nt)nt.selectionStart=et,nt.selectionEnd=Math.min(tt,nt.value.length);else if(tt=(et=nt.ownerDocument||document)&&et.defaultView||window,tt.getSelection){tt=tt.getSelection();var it=nt.textContent.length,ot=Math.min(rt.start,it);rt=rt.end===void 0?ot:Math.min(rt.end,it),!tt.extend&&ot>rt&&(it=rt,rt=ot,ot=it),it=Ke(nt,ot);var at=Ke(nt,rt);it&&at&&(tt.rangeCount!==1||tt.anchorNode!==it.node||tt.anchorOffset!==it.offset||tt.focusNode!==at.node||tt.focusOffset!==at.offset)&&(et=et.createRange(),et.setStart(it.node,it.offset),tt.removeAllRanges(),ot>rt?(tt.addRange(et),tt.extend(at.node,at.offset)):(et.setEnd(at.node,at.offset),tt.addRange(et)))}}for(et=[],tt=nt;tt=tt.parentNode;)tt.nodeType===1&&et.push({element:tt,left:tt.scrollLeft,top:tt.scrollTop});for(typeof nt.focus=="function"&&nt.focus(),nt=0;nt=document.documentMode,Qe=null,Re$1=null,Se$1=null,Te$1=!1;function Ue(tt,et,nt){var rt=nt.window===nt?nt.document:nt.nodeType===9?nt:nt.ownerDocument;Te$1||Qe==null||Qe!==Xa(rt)||(rt=Qe,"selectionStart"in rt&&Ne$2(rt)?rt={start:rt.selectionStart,end:rt.selectionEnd}:(rt=(rt.ownerDocument&&rt.ownerDocument.defaultView||window).getSelection(),rt={anchorNode:rt.anchorNode,anchorOffset:rt.anchorOffset,focusNode:rt.focusNode,focusOffset:rt.focusOffset}),Se$1&&Ie(Se$1,rt)||(Se$1=rt,rt=oe$1(Re$1,"onSelect"),0Tf||(tt.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$3(tt,et){Tf++,Sf[Tf]=tt.current,tt.current=et}var Vf={},H$3=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(tt,et){var nt=tt.type.contextTypes;if(!nt)return Vf;var rt=tt.stateNode;if(rt&&rt.__reactInternalMemoizedUnmaskedChildContext===et)return rt.__reactInternalMemoizedMaskedChildContext;var it={},ot;for(ot in nt)it[ot]=et[ot];return rt&&(tt=tt.stateNode,tt.__reactInternalMemoizedUnmaskedChildContext=et,tt.__reactInternalMemoizedMaskedChildContext=it),it}function Zf(tt){return tt=tt.childContextTypes,tt!=null}function $f(){E$2(Wf),E$2(H$3)}function ag(tt,et,nt){if(H$3.current!==Vf)throw Error(p$9(168));G$3(H$3,et),G$3(Wf,nt)}function bg(tt,et,nt){var rt=tt.stateNode;if(et=et.childContextTypes,typeof rt.getChildContext!="function")return nt;rt=rt.getChildContext();for(var it in rt)if(!(it in et))throw Error(p$9(108,Ra(tt)||"Unknown",it));return A$3({},nt,rt)}function cg(tt){return tt=(tt=tt.stateNode)&&tt.__reactInternalMemoizedMergedChildContext||Vf,Xf=H$3.current,G$3(H$3,tt),G$3(Wf,Wf.current),!0}function dg(tt,et,nt){var rt=tt.stateNode;if(!rt)throw Error(p$9(169));nt?(tt=bg(tt,et,Xf),rt.__reactInternalMemoizedMergedChildContext=tt,E$2(Wf),E$2(H$3),G$3(H$3,tt)):E$2(Wf),G$3(Wf,nt)}var eg=null,fg=!1,gg=!1;function hg(tt){eg===null?eg=[tt]:eg.push(tt)}function ig(tt){fg=!0,hg(tt)}function jg(){if(!gg&&eg!==null){gg=!0;var tt=0,et=C$2;try{var nt=eg;for(C$2=1;tt>=at,it-=at,rg=1<<32-oc(et)+it|nt<Et?(Ct=At,At=null):Ct=At.sibling;var Lt=dt(bt,At,xt[Et],kt);if(Lt===null){At===null&&(At=Ct);break}tt&&At&&Lt.alternate===null&&et(bt,At),wt=ot(Lt,wt,Et),Tt===null?St=Lt:Tt.sibling=Lt,Tt=Lt,At=Ct}if(Et===xt.length)return nt(bt,At),I$4&&tg(bt,Et),St;if(At===null){for(;EtEt?(Ct=At,At=null):Ct=At.sibling;var jt=dt(bt,At,Lt.value,kt);if(jt===null){At===null&&(At=Ct);break}tt&&At&&jt.alternate===null&&et(bt,At),wt=ot(jt,wt,Et),Tt===null?St=jt:Tt.sibling=jt,Tt=jt,At=Ct}if(Lt.done)return nt(bt,At),I$4&&tg(bt,Et),St;if(At===null){for(;!Lt.done;Et++,Lt=xt.next())Lt=ht(bt,Lt.value,kt),Lt!==null&&(wt=ot(Lt,wt,Et),Tt===null?St=Lt:Tt.sibling=Lt,Tt=Lt);return I$4&&tg(bt,Et),St}for(At=rt(bt,At);!Lt.done;Et++,Lt=xt.next())Lt=pt(At,bt,Et,Lt.value,kt),Lt!==null&&(tt&&Lt.alternate!==null&&At.delete(Lt.key===null?Et:Lt.key),wt=ot(Lt,wt,Et),Tt===null?St=Lt:Tt.sibling=Lt,Tt=Lt);return tt&&At.forEach(function(Rt){return et(bt,Rt)}),I$4&&tg(bt,Et),St}function yt(bt,wt,xt,kt){if(typeof xt=="object"&&xt!==null&&xt.type===ya&&xt.key===null&&(xt=xt.props.children),typeof xt=="object"&&xt!==null){switch(xt.$$typeof){case va:e:{for(var St=xt.key,Tt=wt;Tt!==null;){if(Tt.key===St){if(St=xt.type,St===ya){if(Tt.tag===7){nt(bt,Tt.sibling),wt=it(Tt,xt.props.children),wt.return=bt,bt=wt;break e}}else if(Tt.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===Ha&&uh(St)===Tt.type){nt(bt,Tt.sibling),wt=it(Tt,xt.props),wt.ref=sh$1(bt,Tt,xt),wt.return=bt,bt=wt;break e}nt(bt,Tt);break}else et(bt,Tt);Tt=Tt.sibling}xt.type===ya?(wt=Ah(xt.props.children,bt.mode,kt,xt.key),wt.return=bt,bt=wt):(kt=yh(xt.type,xt.key,xt.props,null,bt.mode,kt),kt.ref=sh$1(bt,wt,xt),kt.return=bt,bt=kt)}return at(bt);case wa:e:{for(Tt=xt.key;wt!==null;){if(wt.key===Tt)if(wt.tag===4&&wt.stateNode.containerInfo===xt.containerInfo&&wt.stateNode.implementation===xt.implementation){nt(bt,wt.sibling),wt=it(wt,xt.children||[]),wt.return=bt,bt=wt;break e}else{nt(bt,wt);break}else et(bt,wt);wt=wt.sibling}wt=zh(xt,bt.mode,kt),wt.return=bt,bt=wt}return at(bt);case Ha:return Tt=xt._init,yt(bt,wt,Tt(xt._payload),kt)}if(eb(xt))return mt(bt,wt,xt,kt);if(Ka(xt))return gt(bt,wt,xt,kt);th(bt,xt)}return typeof xt=="string"&&xt!==""||typeof xt=="number"?(xt=""+xt,wt!==null&&wt.tag===6?(nt(bt,wt.sibling),wt=it(wt,xt),wt.return=bt,bt=wt):(nt(bt,wt),wt=xh(xt,bt.mode,kt),wt.return=bt,bt=wt),at(bt)):nt(bt,wt)}return yt}var Bh=vh(!0),Ch$1=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(tt){if(tt===Dh)throw Error(p$9(174));return tt}function Ih(tt,et){switch(G$3(Gh,et),G$3(Fh,tt),G$3(Eh,Dh),tt=et.nodeType,tt){case 9:case 11:et=(et=et.documentElement)?et.namespaceURI:lb(null,"");break;default:tt=tt===8?et.parentNode:et,et=tt.namespaceURI||null,tt=tt.tagName,et=lb(et,tt)}E$2(Eh),G$3(Eh,et)}function Jh(){E$2(Eh),E$2(Fh),E$2(Gh)}function Kh$1(tt){Hh(Gh.current);var et=Hh(Eh.current),nt=lb(et,tt.type);et!==nt&&(G$3(Fh,tt),G$3(Eh,nt))}function Lh(tt){Fh.current===tt&&(E$2(Eh),E$2(Fh))}var M$3=Uf(0);function Mh(tt){for(var et=tt;et!==null;){if(et.tag===13){var nt=et.memoizedState;if(nt!==null&&(nt=nt.dehydrated,nt===null||nt.data==="$?"||nt.data==="$!"))return et}else if(et.tag===19&&et.memoizedProps.revealOrder!==void 0){if(et.flags&128)return et}else if(et.child!==null){et.child.return=et,et=et.child;continue}if(et===tt)break;for(;et.sibling===null;){if(et.return===null||et.return===tt)return null;et=et.return}et.sibling.return=et.return,et=et.sibling}return null}var Nh=[];function Oh(){for(var tt=0;ttnt?nt:4,tt(!0);var rt=Qh.transition;Qh.transition={};try{tt(!1),et()}finally{C$2=nt,Qh.transition=rt}}function Fi(){return di().memoizedState}function Gi(tt,et,nt){var rt=lh(tt);if(nt={lane:rt,action:nt,hasEagerState:!1,eagerState:null,next:null},Hi(tt))Ii(et,nt);else if(nt=Yg(tt,et,nt,rt),nt!==null){var it=L$3();mh(nt,tt,rt,it),Ji(nt,et,rt)}}function ri(tt,et,nt){var rt=lh(tt),it={lane:rt,action:nt,hasEagerState:!1,eagerState:null,next:null};if(Hi(tt))Ii(et,it);else{var ot=tt.alternate;if(tt.lanes===0&&(ot===null||ot.lanes===0)&&(ot=et.lastRenderedReducer,ot!==null))try{var at=et.lastRenderedState,st=ot(at,nt);if(it.hasEagerState=!0,it.eagerState=st,He$1(st,at)){var lt=et.interleaved;lt===null?(it.next=it,Xg(et)):(it.next=lt.next,lt.next=it),et.interleaved=it;return}}catch{}finally{}nt=Yg(tt,et,it,rt),nt!==null&&(it=L$3(),mh(nt,tt,rt,it),Ji(nt,et,rt))}}function Hi(tt){var et=tt.alternate;return tt===N$3||et!==null&&et===N$3}function Ii(tt,et){Th=Sh=!0;var nt=tt.pending;nt===null?et.next=et:(et.next=nt.next,nt.next=et),tt.pending=et}function Ji(tt,et,nt){if(nt&4194240){var rt=et.lanes;rt&=tt.pendingLanes,nt|=rt,et.lanes=nt,Cc(tt,nt)}}var ai={readContext:Vg,useCallback:Q$2,useContext:Q$2,useEffect:Q$2,useImperativeHandle:Q$2,useInsertionEffect:Q$2,useLayoutEffect:Q$2,useMemo:Q$2,useReducer:Q$2,useRef:Q$2,useState:Q$2,useDebugValue:Q$2,useDeferredValue:Q$2,useTransition:Q$2,useMutableSource:Q$2,useSyncExternalStore:Q$2,useId:Q$2,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(tt,et){return ci().memoizedState=[tt,et===void 0?null:et],tt},useContext:Vg,useEffect:vi,useImperativeHandle:function(tt,et,nt){return nt=nt!=null?nt.concat([tt]):null,ti(4194308,4,yi.bind(null,et,tt),nt)},useLayoutEffect:function(tt,et){return ti(4194308,4,tt,et)},useInsertionEffect:function(tt,et){return ti(4,2,tt,et)},useMemo:function(tt,et){var nt=ci();return et=et===void 0?null:et,tt=tt(),nt.memoizedState=[tt,et],tt},useReducer:function(tt,et,nt){var rt=ci();return et=nt!==void 0?nt(et):et,rt.memoizedState=rt.baseState=et,tt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tt,lastRenderedState:et},rt.queue=tt,tt=tt.dispatch=Gi.bind(null,N$3,tt),[rt.memoizedState,tt]},useRef:function(tt){var et=ci();return tt={current:tt},et.memoizedState=tt},useState:qi,useDebugValue:Ai,useDeferredValue:function(tt){return ci().memoizedState=tt},useTransition:function(){var tt=qi(!1),et=tt[0];return tt=Ei.bind(null,tt[1]),ci().memoizedState=tt,[et,tt]},useMutableSource:function(){},useSyncExternalStore:function(tt,et,nt){var rt=N$3,it=ci();if(I$4){if(nt===void 0)throw Error(p$9(407));nt=nt()}else{if(nt=et(),R$2===null)throw Error(p$9(349));Rh&30||ni(rt,et,nt)}it.memoizedState=nt;var ot={value:nt,getSnapshot:et};return it.queue=ot,vi(ki.bind(null,rt,ot,tt),[tt]),rt.flags|=2048,li(9,mi.bind(null,rt,ot,nt,et),void 0,null),nt},useId:function(){var tt=ci(),et=R$2.identifierPrefix;if(I$4){var nt=sg,rt=rg;nt=(rt&~(1<<32-oc(rt)-1)).toString(32)+nt,et=":"+et+"R"+nt,nt=Uh++,0<\/script>",tt=tt.removeChild(tt.firstChild)):typeof rt.is=="string"?tt=at.createElement(nt,{is:rt.is}):(tt=at.createElement(nt),nt==="select"&&(at=tt,rt.multiple?at.multiple=!0:rt.size&&(at.size=rt.size))):tt=at.createElementNS(tt,nt),tt[Of]=et,tt[Pf]=rt,Aj(tt,et,!1,!1),et.stateNode=tt;e:{switch(at=vb(nt,rt),nt){case"dialog":D$2("cancel",tt),D$2("close",tt),it=rt;break;case"iframe":case"object":case"embed":D$2("load",tt),it=rt;break;case"video":case"audio":for(it=0;itHj&&(et.flags|=128,rt=!0,Ej(ot,!1),et.lanes=4194304)}else{if(!rt)if(tt=Mh(at),tt!==null){if(et.flags|=128,rt=!0,nt=tt.updateQueue,nt!==null&&(et.updateQueue=nt,et.flags|=4),Ej(ot,!0),ot.tail===null&&ot.tailMode==="hidden"&&!at.alternate&&!I$4)return S$4(et),null}else 2*B$2()-ot.renderingStartTime>Hj&&nt!==1073741824&&(et.flags|=128,rt=!0,Ej(ot,!1),et.lanes=4194304);ot.isBackwards?(at.sibling=et.child,et.child=at):(nt=ot.last,nt!==null?nt.sibling=at:et.child=at,ot.last=at)}return ot.tail!==null?(et=ot.tail,ot.rendering=et,ot.tail=et.sibling,ot.renderingStartTime=B$2(),et.sibling=null,nt=M$3.current,G$3(M$3,rt?nt&1|2:nt&1),et):(S$4(et),null);case 22:case 23:return Ij(),rt=et.memoizedState!==null,tt!==null&&tt.memoizedState!==null!==rt&&(et.flags|=8192),rt&&et.mode&1?gj&1073741824&&(S$4(et),et.subtreeFlags&6&&(et.flags|=8192)):S$4(et),null;case 24:return null;case 25:return null}throw Error(p$9(156,et.tag))}function Jj(tt,et){switch(wg(et),et.tag){case 1:return Zf(et.type)&&$f(),tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 3:return Jh(),E$2(Wf),E$2(H$3),Oh(),tt=et.flags,tt&65536&&!(tt&128)?(et.flags=tt&-65537|128,et):null;case 5:return Lh(et),null;case 13:if(E$2(M$3),tt=et.memoizedState,tt!==null&&tt.dehydrated!==null){if(et.alternate===null)throw Error(p$9(340));Ig()}return tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 19:return E$2(M$3),null;case 4:return Jh(),null;case 10:return Rg(et.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U$3=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V$4=null;function Mj(tt,et){var nt=tt.ref;if(nt!==null)if(typeof nt=="function")try{nt(null)}catch(rt){W$8(tt,et,rt)}else nt.current=null}function Nj(tt,et,nt){try{nt()}catch(rt){W$8(tt,et,rt)}}var Oj=!1;function Pj(tt,et){if(Cf=dd,tt=Me$2(),Ne$2(tt)){if("selectionStart"in tt)var nt={start:tt.selectionStart,end:tt.selectionEnd};else e:{nt=(nt=tt.ownerDocument)&&nt.defaultView||window;var rt=nt.getSelection&&nt.getSelection();if(rt&&rt.rangeCount!==0){nt=rt.anchorNode;var it=rt.anchorOffset,ot=rt.focusNode;rt=rt.focusOffset;try{nt.nodeType,ot.nodeType}catch{nt=null;break e}var at=0,st=-1,lt=-1,ct=0,ut=0,ht=tt,dt=null;t:for(;;){for(var pt;ht!==nt||it!==0&&ht.nodeType!==3||(st=at+it),ht!==ot||rt!==0&&ht.nodeType!==3||(lt=at+rt),ht.nodeType===3&&(at+=ht.nodeValue.length),(pt=ht.firstChild)!==null;)dt=ht,ht=pt;for(;;){if(ht===tt)break t;if(dt===nt&&++ct===it&&(st=at),dt===ot&&++ut===rt&&(lt=at),(pt=ht.nextSibling)!==null)break;ht=dt,dt=ht.parentNode}ht=pt}nt=st===-1||lt===-1?null:{start:st,end:lt}}else nt=null}nt=nt||{start:0,end:0}}else nt=null;for(Df={focusedElem:tt,selectionRange:nt},dd=!1,V$4=et;V$4!==null;)if(et=V$4,tt=et.child,(et.subtreeFlags&1028)!==0&&tt!==null)tt.return=et,V$4=tt;else for(;V$4!==null;){et=V$4;try{var mt=et.alternate;if(et.flags&1024)switch(et.tag){case 0:case 11:case 15:break;case 1:if(mt!==null){var gt=mt.memoizedProps,yt=mt.memoizedState,bt=et.stateNode,wt=bt.getSnapshotBeforeUpdate(et.elementType===et.type?gt:Lg(et.type,gt),yt);bt.__reactInternalSnapshotBeforeUpdate=wt}break;case 3:var xt=et.stateNode.containerInfo;xt.nodeType===1?xt.textContent="":xt.nodeType===9&&xt.documentElement&&xt.removeChild(xt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$9(163))}}catch(kt){W$8(et,et.return,kt)}if(tt=et.sibling,tt!==null){tt.return=et.return,V$4=tt;break}V$4=et.return}return mt=Oj,Oj=!1,mt}function Qj(tt,et,nt){var rt=et.updateQueue;if(rt=rt!==null?rt.lastEffect:null,rt!==null){var it=rt=rt.next;do{if((it.tag&tt)===tt){var ot=it.destroy;it.destroy=void 0,ot!==void 0&&Nj(et,nt,ot)}it=it.next}while(it!==rt)}}function Rj(tt,et){if(et=et.updateQueue,et=et!==null?et.lastEffect:null,et!==null){var nt=et=et.next;do{if((nt.tag&tt)===tt){var rt=nt.create;nt.destroy=rt()}nt=nt.next}while(nt!==et)}}function Sj(tt){var et=tt.ref;if(et!==null){var nt=tt.stateNode;switch(tt.tag){case 5:tt=nt;break;default:tt=nt}typeof et=="function"?et(tt):et.current=tt}}function Tj(tt){var et=tt.alternate;et!==null&&(tt.alternate=null,Tj(et)),tt.child=null,tt.deletions=null,tt.sibling=null,tt.tag===5&&(et=tt.stateNode,et!==null&&(delete et[Of],delete et[Pf],delete et[of],delete et[Qf],delete et[Rf])),tt.stateNode=null,tt.return=null,tt.dependencies=null,tt.memoizedProps=null,tt.memoizedState=null,tt.pendingProps=null,tt.stateNode=null,tt.updateQueue=null}function Uj(tt){return tt.tag===5||tt.tag===3||tt.tag===4}function Vj(tt){e:for(;;){for(;tt.sibling===null;){if(tt.return===null||Uj(tt.return))return null;tt=tt.return}for(tt.sibling.return=tt.return,tt=tt.sibling;tt.tag!==5&&tt.tag!==6&&tt.tag!==18;){if(tt.flags&2||tt.child===null||tt.tag===4)continue e;tt.child.return=tt,tt=tt.child}if(!(tt.flags&2))return tt.stateNode}}function Wj(tt,et,nt){var rt=tt.tag;if(rt===5||rt===6)tt=tt.stateNode,et?nt.nodeType===8?nt.parentNode.insertBefore(tt,et):nt.insertBefore(tt,et):(nt.nodeType===8?(et=nt.parentNode,et.insertBefore(tt,nt)):(et=nt,et.appendChild(tt)),nt=nt._reactRootContainer,nt!=null||et.onclick!==null||(et.onclick=Bf));else if(rt!==4&&(tt=tt.child,tt!==null))for(Wj(tt,et,nt),tt=tt.sibling;tt!==null;)Wj(tt,et,nt),tt=tt.sibling}function Xj(tt,et,nt){var rt=tt.tag;if(rt===5||rt===6)tt=tt.stateNode,et?nt.insertBefore(tt,et):nt.appendChild(tt);else if(rt!==4&&(tt=tt.child,tt!==null))for(Xj(tt,et,nt),tt=tt.sibling;tt!==null;)Xj(tt,et,nt),tt=tt.sibling}var X$2=null,Yj=!1;function Zj(tt,et,nt){for(nt=nt.child;nt!==null;)ak(tt,et,nt),nt=nt.sibling}function ak(tt,et,nt){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,nt)}catch{}switch(nt.tag){case 5:U$3||Mj(nt,et);case 6:var rt=X$2,it=Yj;X$2=null,Zj(tt,et,nt),X$2=rt,Yj=it,X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?tt.parentNode.removeChild(nt):tt.removeChild(nt)):X$2.removeChild(nt.stateNode));break;case 18:X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?Kf(tt.parentNode,nt):tt.nodeType===1&&Kf(tt,nt),bd(tt)):Kf(X$2,nt.stateNode));break;case 4:rt=X$2,it=Yj,X$2=nt.stateNode.containerInfo,Yj=!0,Zj(tt,et,nt),X$2=rt,Yj=it;break;case 0:case 11:case 14:case 15:if(!U$3&&(rt=nt.updateQueue,rt!==null&&(rt=rt.lastEffect,rt!==null))){it=rt=rt.next;do{var ot=it,at=ot.destroy;ot=ot.tag,at!==void 0&&(ot&2||ot&4)&&Nj(nt,et,at),it=it.next}while(it!==rt)}Zj(tt,et,nt);break;case 1:if(!U$3&&(Mj(nt,et),rt=nt.stateNode,typeof rt.componentWillUnmount=="function"))try{rt.props=nt.memoizedProps,rt.state=nt.memoizedState,rt.componentWillUnmount()}catch(st){W$8(nt,et,st)}Zj(tt,et,nt);break;case 21:Zj(tt,et,nt);break;case 22:nt.mode&1?(U$3=(rt=U$3)||nt.memoizedState!==null,Zj(tt,et,nt),U$3=rt):Zj(tt,et,nt);break;default:Zj(tt,et,nt)}}function bk(tt){var et=tt.updateQueue;if(et!==null){tt.updateQueue=null;var nt=tt.stateNode;nt===null&&(nt=tt.stateNode=new Lj),et.forEach(function(rt){var it=ck.bind(null,tt,rt);nt.has(rt)||(nt.add(rt),rt.then(it,it))})}}function dk(tt,et){var nt=et.deletions;if(nt!==null)for(var rt=0;rtit&&(it=at),rt&=~ot}if(rt=it,rt=B$2()-rt,rt=(120>rt?120:480>rt?480:1080>rt?1080:1920>rt?1920:3e3>rt?3e3:4320>rt?4320:1960*mk(rt/1960))-rt,10tt?16:tt,xk===null)var rt=!1;else{if(tt=xk,xk=null,yk=0,K$7&6)throw Error(p$9(331));var it=K$7;for(K$7|=4,V$4=tt.current;V$4!==null;){var ot=V$4,at=ot.child;if(V$4.flags&16){var st=ot.deletions;if(st!==null){for(var lt=0;ltB$2()-gk?Lk(tt,0):sk|=nt),Ek(tt,et)}function Zk(tt,et){et===0&&(tt.mode&1?(et=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):et=1);var nt=L$3();tt=Zg(tt,et),tt!==null&&(Ac(tt,et,nt),Ek(tt,nt))}function vj(tt){var et=tt.memoizedState,nt=0;et!==null&&(nt=et.retryLane),Zk(tt,nt)}function ck(tt,et){var nt=0;switch(tt.tag){case 13:var rt=tt.stateNode,it=tt.memoizedState;it!==null&&(nt=it.retryLane);break;case 19:rt=tt.stateNode;break;default:throw Error(p$9(314))}rt!==null&&rt.delete(et),Zk(tt,nt)}var Wk;Wk=function(tt,et,nt){if(tt!==null)if(tt.memoizedProps!==et.pendingProps||Wf.current)Ug=!0;else{if(!(tt.lanes&nt)&&!(et.flags&128))return Ug=!1,zj(tt,et,nt);Ug=!!(tt.flags&131072)}else Ug=!1,I$4&&et.flags&1048576&&ug(et,ng,et.index);switch(et.lanes=0,et.tag){case 2:var rt=et.type;jj(tt,et),tt=et.pendingProps;var it=Yf(et,H$3.current);Tg(et,nt),it=Xh(null,et,rt,tt,it,nt);var ot=bi();return et.flags|=1,typeof it=="object"&&it!==null&&typeof it.render=="function"&&it.$$typeof===void 0?(et.tag=1,et.memoizedState=null,et.updateQueue=null,Zf(rt)?(ot=!0,cg(et)):ot=!1,et.memoizedState=it.state!==null&&it.state!==void 0?it.state:null,ah(et),it.updater=nh,et.stateNode=it,it._reactInternals=et,rh$1(et,rt,tt,nt),et=kj(null,et,rt,!0,ot,nt)):(et.tag=0,I$4&&ot&&vg(et),Yi(null,et,it,nt),et=et.child),et;case 16:rt=et.elementType;e:{switch(jj(tt,et),tt=et.pendingProps,it=rt._init,rt=it(rt._payload),et.type=rt,it=et.tag=$k(rt),tt=Lg(rt,tt),it){case 0:et=dj(null,et,rt,tt,nt);break e;case 1:et=ij(null,et,rt,tt,nt);break e;case 11:et=Zi(null,et,rt,tt,nt);break e;case 14:et=aj(null,et,rt,Lg(rt.type,tt),nt);break e}throw Error(p$9(306,rt,""))}return et;case 0:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),dj(tt,et,rt,it,nt);case 1:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),ij(tt,et,rt,it,nt);case 3:e:{if(lj(et),tt===null)throw Error(p$9(387));rt=et.pendingProps,ot=et.memoizedState,it=ot.element,bh(tt,et),gh(et,rt,null,nt);var at=et.memoizedState;if(rt=at.element,ot.isDehydrated)if(ot={element:rt,isDehydrated:!1,cache:at.cache,pendingSuspenseBoundaries:at.pendingSuspenseBoundaries,transitions:at.transitions},et.updateQueue.baseState=ot,et.memoizedState=ot,et.flags&256){it=Ki(Error(p$9(423)),et),et=mj(tt,et,rt,nt,it);break e}else if(rt!==it){it=Ki(Error(p$9(424)),et),et=mj(tt,et,rt,nt,it);break e}else for(yg=Lf(et.stateNode.containerInfo.firstChild),xg=et,I$4=!0,zg=null,nt=Ch$1(et,null,rt,nt),et.child=nt;nt;)nt.flags=nt.flags&-3|4096,nt=nt.sibling;else{if(Ig(),rt===it){et=$i(tt,et,nt);break e}Yi(tt,et,rt,nt)}et=et.child}return et;case 5:return Kh$1(et),tt===null&&Eg(et),rt=et.type,it=et.pendingProps,ot=tt!==null?tt.memoizedProps:null,at=it.children,Ef(rt,it)?at=null:ot!==null&&Ef(rt,ot)&&(et.flags|=32),hj(tt,et),Yi(tt,et,at,nt),et.child;case 6:return tt===null&&Eg(et),null;case 13:return pj(tt,et,nt);case 4:return Ih(et,et.stateNode.containerInfo),rt=et.pendingProps,tt===null?et.child=Bh(et,null,rt,nt):Yi(tt,et,rt,nt),et.child;case 11:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),Zi(tt,et,rt,it,nt);case 7:return Yi(tt,et,et.pendingProps,nt),et.child;case 8:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 12:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 10:e:{if(rt=et.type._context,it=et.pendingProps,ot=et.memoizedProps,at=it.value,G$3(Mg,rt._currentValue),rt._currentValue=at,ot!==null)if(He$1(ot.value,at)){if(ot.children===it.children&&!Wf.current){et=$i(tt,et,nt);break e}}else for(ot=et.child,ot!==null&&(ot.return=et);ot!==null;){var st=ot.dependencies;if(st!==null){at=ot.child;for(var lt=st.firstContext;lt!==null;){if(lt.context===rt){if(ot.tag===1){lt=ch$1(-1,nt&-nt),lt.tag=2;var ct=ot.updateQueue;if(ct!==null){ct=ct.shared;var ut=ct.pending;ut===null?lt.next=lt:(lt.next=ut.next,ut.next=lt),ct.pending=lt}}ot.lanes|=nt,lt=ot.alternate,lt!==null&&(lt.lanes|=nt),Sg(ot.return,nt,et),st.lanes|=nt;break}lt=lt.next}}else if(ot.tag===10)at=ot.type===et.type?null:ot.child;else if(ot.tag===18){if(at=ot.return,at===null)throw Error(p$9(341));at.lanes|=nt,st=at.alternate,st!==null&&(st.lanes|=nt),Sg(at,nt,et),at=ot.sibling}else at=ot.child;if(at!==null)at.return=ot;else for(at=ot;at!==null;){if(at===et){at=null;break}if(ot=at.sibling,ot!==null){ot.return=at.return,at=ot;break}at=at.return}ot=at}Yi(tt,et,it.children,nt),et=et.child}return et;case 9:return it=et.type,rt=et.pendingProps.children,Tg(et,nt),it=Vg(it),rt=rt(it),et.flags|=1,Yi(tt,et,rt,nt),et.child;case 14:return rt=et.type,it=Lg(rt,et.pendingProps),it=Lg(rt.type,it),aj(tt,et,rt,it,nt);case 15:return cj(tt,et,et.type,et.pendingProps,nt);case 17:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),jj(tt,et),et.tag=1,Zf(rt)?(tt=!0,cg(et)):tt=!1,Tg(et,nt),ph(et,rt,it),rh$1(et,rt,it,nt),kj(null,et,rt,!0,tt,nt);case 19:return yj(tt,et,nt);case 22:return ej(tt,et,nt)}throw Error(p$9(156,et.tag))};function Gk(tt,et){return ac(tt,et)}function al(tt,et,nt,rt){this.tag=tt,this.key=nt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=et,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=rt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg$1(tt,et,nt,rt){return new al(tt,et,nt,rt)}function bj(tt){return tt=tt.prototype,!(!tt||!tt.isReactComponent)}function $k(tt){if(typeof tt=="function")return bj(tt)?1:0;if(tt!=null){if(tt=tt.$$typeof,tt===Da)return 11;if(tt===Ga)return 14}return 2}function wh(tt,et){var nt=tt.alternate;return nt===null?(nt=Bg$1(tt.tag,et,tt.key,tt.mode),nt.elementType=tt.elementType,nt.type=tt.type,nt.stateNode=tt.stateNode,nt.alternate=tt,tt.alternate=nt):(nt.pendingProps=et,nt.type=tt.type,nt.flags=0,nt.subtreeFlags=0,nt.deletions=null),nt.flags=tt.flags&14680064,nt.childLanes=tt.childLanes,nt.lanes=tt.lanes,nt.child=tt.child,nt.memoizedProps=tt.memoizedProps,nt.memoizedState=tt.memoizedState,nt.updateQueue=tt.updateQueue,et=tt.dependencies,nt.dependencies=et===null?null:{lanes:et.lanes,firstContext:et.firstContext},nt.sibling=tt.sibling,nt.index=tt.index,nt.ref=tt.ref,nt}function yh(tt,et,nt,rt,it,ot){var at=2;if(rt=tt,typeof tt=="function")bj(tt)&&(at=1);else if(typeof tt=="string")at=5;else e:switch(tt){case ya:return Ah(nt.children,it,ot,et);case za:at=8,it|=8;break;case Aa:return tt=Bg$1(12,nt,et,it|2),tt.elementType=Aa,tt.lanes=ot,tt;case Ea:return tt=Bg$1(13,nt,et,it),tt.elementType=Ea,tt.lanes=ot,tt;case Fa:return tt=Bg$1(19,nt,et,it),tt.elementType=Fa,tt.lanes=ot,tt;case Ia:return qj(nt,it,ot,et);default:if(typeof tt=="object"&&tt!==null)switch(tt.$$typeof){case Ba:at=10;break e;case Ca:at=9;break e;case Da:at=11;break e;case Ga:at=14;break e;case Ha:at=16,rt=null;break e}throw Error(p$9(130,tt==null?tt:typeof tt,""))}return et=Bg$1(at,nt,et,it),et.elementType=tt,et.type=rt,et.lanes=ot,et}function Ah(tt,et,nt,rt){return tt=Bg$1(7,tt,rt,et),tt.lanes=nt,tt}function qj(tt,et,nt,rt){return tt=Bg$1(22,tt,rt,et),tt.elementType=Ia,tt.lanes=nt,tt.stateNode={isHidden:!1},tt}function xh(tt,et,nt){return tt=Bg$1(6,tt,null,et),tt.lanes=nt,tt}function zh(tt,et,nt){return et=Bg$1(4,tt.children!==null?tt.children:[],tt.key,et),et.lanes=nt,et.stateNode={containerInfo:tt.containerInfo,pendingChildren:null,implementation:tt.implementation},et}function bl(tt,et,nt,rt,it){this.tag=et,this.containerInfo=tt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=rt,this.onRecoverableError=it,this.mutableSourceEagerHydrationData=null}function cl(tt,et,nt,rt,it,ot,at,st,lt){return tt=new bl(tt,et,nt,st,lt),et===1?(et=1,ot===!0&&(et|=8)):et=0,ot=Bg$1(3,null,null,et),tt.current=ot,ot.stateNode=tt,ot.memoizedState={element:rt,isDehydrated:nt,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(ot),tt}function dl(tt,et,nt){var rt=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(tt){console.error(tt)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot$1,m$9=reactDomExports;createRoot$1=client$1.createRoot=m$9.createRoot,client$1.hydrateRoot=m$9.hydrateRoot;function _extends$u(){return _extends$u=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.forEach(nt=>$6ed0406888f73fc4$var$setRef(nt,et))}function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...tt){return reactExports.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...tt),tt)}const $5e63c961fc1ce211$export$8c6ed5c666ac1360=reactExports.forwardRef((tt,et)=>{const{children:nt,...rt}=tt,it=reactExports.Children.toArray(nt),ot=it.find($5e63c961fc1ce211$var$isSlottable);if(ot){const at=ot.props.children,st=it.map(lt=>lt===ot?reactExports.Children.count(at)>1?reactExports.Children.only(null):reactExports.isValidElement(at)?at.props.children:null:lt);return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$u({},rt,{ref:et}),reactExports.isValidElement(at)?reactExports.cloneElement(at,void 0,st):null)}return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$u({},rt,{ref:et}),nt)});$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName="Slot";const $5e63c961fc1ce211$var$SlotClone=reactExports.forwardRef((tt,et)=>{const{children:nt,...rt}=tt;return reactExports.isValidElement(nt)?reactExports.cloneElement(nt,{...$5e63c961fc1ce211$var$mergeProps(rt,nt.props),ref:et?$6ed0406888f73fc4$export$43e446d32b3d21af(et,nt.ref):nt.ref}):reactExports.Children.count(nt)>1?reactExports.Children.only(null):null});$5e63c961fc1ce211$var$SlotClone.displayName="SlotClone";const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45=({children:tt})=>reactExports.createElement(reactExports.Fragment,null,tt);function $5e63c961fc1ce211$var$isSlottable(tt){return reactExports.isValidElement(tt)&&tt.type===$5e63c961fc1ce211$export$d9f1ccf0bdb05d45}function $5e63c961fc1ce211$var$mergeProps(tt,et){const nt={...et};for(const rt in et){const it=tt[rt],ot=et[rt];/^on[A-Z]/.test(rt)?it&&ot?nt[rt]=(...st)=>{ot(...st),it(...st)}:it&&(nt[rt]=it):rt==="style"?nt[rt]={...it,...ot}:rt==="className"&&(nt[rt]=[it,ot].filter(Boolean).join(" "))}return{...tt,...nt}}const $8927f6f2acc4f386$var$NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$8927f6f2acc4f386$export$250ffa63cdc0d034=$8927f6f2acc4f386$var$NODES.reduce((tt,et)=>{const nt=reactExports.forwardRef((rt,it)=>{const{asChild:ot,...at}=rt,st=ot?$5e63c961fc1ce211$export$8c6ed5c666ac1360:et;return reactExports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),reactExports.createElement(st,_extends$u({},at,{ref:it}))});return nt.displayName=`Primitive.${et}`,{...tt,[et]:nt}},{});function $8927f6f2acc4f386$export$6d1a0317bde7de7f(tt,et){tt&&reactDomExports.flushSync(()=>tt.dispatchEvent(et))}const $f1701beae083dbae$export$602eac185826482c=reactExports.forwardRef((tt,et)=>{var nt;const{container:rt=globalThis==null||(nt=globalThis.document)===null||nt===void 0?void 0:nt.body,...it}=tt;return rt?ReactDOM.createPortal(reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},it,{ref:et})),rt):null}),$f1701beae083dbae$export$be92b6f5f03c0fe9=$f1701beae083dbae$export$602eac185826482c;var has=Object.prototype.hasOwnProperty;function dequal(tt,et){var nt,rt;if(tt===et)return!0;if(tt&&et&&(nt=tt.constructor)===et.constructor){if(nt===Date)return tt.getTime()===et.getTime();if(nt===RegExp)return tt.toString()===et.toString();if(nt===Array){if((rt=tt.length)===et.length)for(;rt--&&dequal(tt[rt],et[rt]););return rt===-1}if(!nt||typeof tt=="object"){rt=0;for(nt in tt)if(has.call(tt,nt)&&++rt&&!has.call(et,nt)||!(nt in et)||!dequal(tt[nt],et[nt]))return!1;return Object.keys(et).length===rt}}return tt!==tt&&et!==et}function shallow$2(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let rt=0;rt0;)at[st]=arguments[st+4];tt.call(this,at),tt.captureStackTrace&&tt.captureStackTrace(this,et),this.rule=nt,this.value=rt,this.cause=it,this.target=ot}return tt&&(et.__proto__=tt),et.prototype=Object.create(tt&&tt.prototype),et.prototype.constructor=et,et}(Error),Context$2=function(et,nt){et===void 0&&(et=[]),nt===void 0&&(nt=[]),this.chain=et,this.nextRuleModifiers=nt};Context$2.prototype._applyRule=function(et,nt){var rt=this;return function(){for(var it=[],ot=arguments.length;ot--;)it[ot]=arguments[ot];return rt.chain.push(new Rule(nt,et.apply(rt,it),it,rt.nextRuleModifiers)),rt.nextRuleModifiers=[],rt}};Context$2.prototype._applyModifier=function(et,nt){return this.nextRuleModifiers.push(new Modifier(nt,et.simple,et.async)),this};Context$2.prototype._clone=function(){return new Context$2(this.chain.slice(),this.nextRuleModifiers.slice())};Context$2.prototype.test=function(et){return this.chain.every(function(nt){return nt._test(et)})};Context$2.prototype.testAll=function(et){var nt=[];return this.chain.forEach(function(rt){try{rt._check(et)}catch(it){nt.push(new ValidationError(rt,et,it))}}),nt};Context$2.prototype.check=function(et){this.chain.forEach(function(nt){try{nt._check(et)}catch(rt){throw new ValidationError(nt,et,rt)}})};Context$2.prototype.testAsync=function(et){var nt=this;return new Promise(function(rt,it){executeAsyncRules(et,nt.chain.slice(),rt,it)})};function executeAsyncRules(tt,et,nt,rt){if(et.length){var it=et.shift();it._testAsync(tt).then(function(){executeAsyncRules(tt,et,nt,rt)},function(ot){rt(new ValidationError(it,tt,ot))})}else nt(tt)}var consideredEmpty=function(tt,et){return et&&typeof tt=="string"&&tt.trim().length===0?!0:tt==null};function optional(tt,et){return et===void 0&&(et=!1),{simple:function(nt){return consideredEmpty(nt,et)||tt.check(nt)===void 0},async:function(nt){return consideredEmpty(nt,et)||tt.testAsync(nt)}}}function v8n(){return typeof Proxy<"u"?proxyContext(new Context$2):proxylessContext(new Context$2)}var customRules={};v8n.extend=function(tt){Object.assign(customRules,tt)};v8n.clearCustomRules=function(){customRules={}};function proxyContext(tt){return new Proxy(tt,{get:function(nt,rt){if(rt in nt)return nt[rt];var it=proxyContext(tt._clone());if(rt in availableModifiers)return it._applyModifier(availableModifiers[rt],rt);if(rt in customRules)return it._applyRule(customRules[rt],rt);if(rt in availableRules)return it._applyRule(availableRules[rt],rt)}})}function proxylessContext(tt){var et=function(it,ot){return Object.keys(it).forEach(function(at){ot[at]=function(){for(var st=[],lt=arguments.length;lt--;)st[lt]=arguments[lt];var ct=proxylessContext(ot._clone()),ut=ct._applyRule(it[at],at).apply(void 0,st);return ut}}),ot},nt=et(availableRules,tt),rt=et(customRules,nt);return Object.keys(availableModifiers).forEach(function(it){Object.defineProperty(rt,it,{get:function(){var ot=proxylessContext(rt._clone());return ot._applyModifier(availableModifiers[it],it)}})}),rt}var availableModifiers={not:{simple:function(tt){return function(et){return!tt(et)}},async:function(tt){return function(et){return Promise.resolve(tt(et)).then(function(nt){return!nt}).catch(function(){return!0})}}},some:{simple:function(tt){return function(et){return split$1(et).some(function(nt){try{return tt(nt)}catch{return!1}})}},async:function(tt){return function(et){return Promise.all(split$1(et).map(function(nt){try{return tt(nt).catch(function(){return!1})}catch{return!1}})).then(function(nt){return nt.some(Boolean)})}}},every:{simple:function(tt){return function(et){return et!==!1&&split$1(et).every(tt)}},async:function(tt){return function(et){return Promise.all(split$1(et).map(tt)).then(function(nt){return nt.every(Boolean)})}}},strict:{simple:function(tt,et){return function(nt){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&tt(nt):tt(nt)}},async:function(tt,et){return function(nt){return Promise.resolve(tt(nt)).then(function(rt){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&rt:rt}).catch(function(){return!1})}}}};function isSchemaRule(tt){return tt&&tt.name==="schema"&&tt.args.length>0&&typeof tt.args[0]=="object"}function split$1(tt){return typeof tt=="string"?tt.split(""):tt}var availableRules={equal:function(tt){return function(et){return et==tt}},exact:function(tt){return function(et){return et===tt}},number:function(tt){return tt===void 0&&(tt=!0),function(et){return typeof et=="number"&&(tt||isFinite(et))}},integer:function(){return function(tt){var et=Number.isInteger||isIntegerPolyfill;return et(tt)}},numeric:function(){return function(tt){return!isNaN(parseFloat(tt))&&isFinite(tt)}},string:function(){return testType("string")},boolean:function(){return testType("boolean")},undefined:function(){return testType("undefined")},null:function(){return testType("null")},array:function(){return testType("array")},object:function(){return testType("object")},instanceOf:function(tt){return function(et){return et instanceof tt}},pattern:function(tt){return function(et){return tt.test(et)}},lowercase:function(){return function(tt){return typeof tt=="boolean"||tt===tt.toLowerCase()&&tt.trim()!==""}},uppercase:function(){return function(tt){return tt===tt.toUpperCase()&&tt.trim()!==""}},vowel:function(){return function(tt){return/^[aeiou]+$/i.test(tt)}},consonant:function(){return function(tt){return/^(?=[^aeiou])([a-z]+)$/i.test(tt)}},first:function(tt){return function(et){return et[0]==tt}},last:function(tt){return function(et){return et[et.length-1]==tt}},empty:function(){return function(tt){return tt.length===0}},length:function(tt,et){return function(nt){return nt.length>=tt&&nt.length<=(et||tt)}},minLength:function(tt){return function(et){return et.length>=tt}},maxLength:function(tt){return function(et){return et.length<=tt}},negative:function(){return function(tt){return tt<0}},positive:function(){return function(tt){return tt>=0}},between:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},range:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},lessThan:function(tt){return function(et){return ettt}},greaterThanOrEqual:function(tt){return function(et){return et>=tt}},even:function(){return function(tt){return tt%2===0}},odd:function(){return function(tt){return tt%2!==0}},includes:function(tt){return function(et){return~et.indexOf(tt)}},schema:function(tt){return testSchema(tt)},passesAnyOf:function(){for(var tt=[],et=arguments.length;et--;)tt[et]=arguments[et];return function(nt){return tt.some(function(rt){return rt.test(nt)})}},optional};function testType(tt){return function(et){return Array.isArray(et)&&tt==="array"||et===null&&tt==="null"||typeof et===tt}}function isIntegerPolyfill(tt){return typeof tt=="number"&&isFinite(tt)&&Math.floor(tt)===tt}function testSchema(tt){return{simple:function(et){var nt=[];if(Object.keys(tt).forEach(function(rt){var it=tt[rt];try{it.check((et||{})[rt])}catch(ot){ot.target=rt,nt.push(ot)}}),nt.length>0)throw nt;return!0},async:function(et){var nt=[],rt=Object.keys(tt).map(function(it){var ot=tt[it];return ot.testAsync((et||{})[it]).catch(function(at){at.target=it,nt.push(at)})});return Promise.all(rt).then(function(){if(nt.length>0)throw nt;return!0})}}}var e$6="colors",t$7="sizes",r$c="space",n$7={gap:r$c,gridGap:r$c,columnGap:r$c,gridColumnGap:r$c,rowGap:r$c,gridRowGap:r$c,inset:r$c,insetBlock:r$c,insetBlockEnd:r$c,insetBlockStart:r$c,insetInline:r$c,insetInlineEnd:r$c,insetInlineStart:r$c,margin:r$c,marginTop:r$c,marginRight:r$c,marginBottom:r$c,marginLeft:r$c,marginBlock:r$c,marginBlockEnd:r$c,marginBlockStart:r$c,marginInline:r$c,marginInlineEnd:r$c,marginInlineStart:r$c,padding:r$c,paddingTop:r$c,paddingRight:r$c,paddingBottom:r$c,paddingLeft:r$c,paddingBlock:r$c,paddingBlockEnd:r$c,paddingBlockStart:r$c,paddingInline:r$c,paddingInlineEnd:r$c,paddingInlineStart:r$c,top:r$c,right:r$c,bottom:r$c,left:r$c,scrollMargin:r$c,scrollMarginTop:r$c,scrollMarginRight:r$c,scrollMarginBottom:r$c,scrollMarginLeft:r$c,scrollMarginX:r$c,scrollMarginY:r$c,scrollMarginBlock:r$c,scrollMarginBlockEnd:r$c,scrollMarginBlockStart:r$c,scrollMarginInline:r$c,scrollMarginInlineEnd:r$c,scrollMarginInlineStart:r$c,scrollPadding:r$c,scrollPaddingTop:r$c,scrollPaddingRight:r$c,scrollPaddingBottom:r$c,scrollPaddingLeft:r$c,scrollPaddingX:r$c,scrollPaddingY:r$c,scrollPaddingBlock:r$c,scrollPaddingBlockEnd:r$c,scrollPaddingBlockStart:r$c,scrollPaddingInline:r$c,scrollPaddingInlineEnd:r$c,scrollPaddingInlineStart:r$c,fontSize:"fontSizes",background:e$6,backgroundColor:e$6,backgroundImage:e$6,borderImage:e$6,border:e$6,borderBlock:e$6,borderBlockEnd:e$6,borderBlockStart:e$6,borderBottom:e$6,borderBottomColor:e$6,borderColor:e$6,borderInline:e$6,borderInlineEnd:e$6,borderInlineStart:e$6,borderLeft:e$6,borderLeftColor:e$6,borderRight:e$6,borderRightColor:e$6,borderTop:e$6,borderTopColor:e$6,caretColor:e$6,color:e$6,columnRuleColor:e$6,fill:e$6,outline:e$6,outlineColor:e$6,stroke:e$6,textDecorationColor:e$6,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t$7,minBlockSize:t$7,maxBlockSize:t$7,inlineSize:t$7,minInlineSize:t$7,maxInlineSize:t$7,width:t$7,minWidth:t$7,maxWidth:t$7,height:t$7,minHeight:t$7,maxHeight:t$7,flexBasis:t$7,gridTemplateColumns:t$7,gridTemplateRows:t$7,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i$7=(tt,et)=>typeof et=="function"?{"()":Function.prototype.toString.call(et)}:et,o$2=()=>{const tt=Object.create(null);return(et,nt,...rt)=>{const it=(ot=>JSON.stringify(ot,i$7))(et);return it in tt?tt[it]:tt[it]=nt(et,...rt)}},l$6=Symbol.for("sxs.internal"),s$5=(tt,et)=>Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)),a$4=tt=>{for(const et in tt)return!0;return!1},{hasOwnProperty:c$8}=Object.prototype,d$6=tt=>tt.includes("-")?tt:tt.replace(/[A-Z]/g,et=>"-"+et.toLowerCase()),g$9=/\s+(?![^()]*\))/,p$8=tt=>et=>tt(...typeof et=="string"?String(et).split(g$9):[et]),u$6={appearance:tt=>({WebkitAppearance:tt,appearance:tt}),backfaceVisibility:tt=>({WebkitBackfaceVisibility:tt,backfaceVisibility:tt}),backdropFilter:tt=>({WebkitBackdropFilter:tt,backdropFilter:tt}),backgroundClip:tt=>({WebkitBackgroundClip:tt,backgroundClip:tt}),boxDecorationBreak:tt=>({WebkitBoxDecorationBreak:tt,boxDecorationBreak:tt}),clipPath:tt=>({WebkitClipPath:tt,clipPath:tt}),content:tt=>({content:tt.includes('"')||tt.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(tt)?tt:`"${tt}"`}),hyphens:tt=>({WebkitHyphens:tt,hyphens:tt}),maskImage:tt=>({WebkitMaskImage:tt,maskImage:tt}),maskSize:tt=>({WebkitMaskSize:tt,maskSize:tt}),tabSize:tt=>({MozTabSize:tt,tabSize:tt}),textSizeAdjust:tt=>({WebkitTextSizeAdjust:tt,textSizeAdjust:tt}),userSelect:tt=>({WebkitUserSelect:tt,userSelect:tt}),marginBlock:p$8((tt,et)=>({marginBlockStart:tt,marginBlockEnd:et||tt})),marginInline:p$8((tt,et)=>({marginInlineStart:tt,marginInlineEnd:et||tt})),maxSize:p$8((tt,et)=>({maxBlockSize:tt,maxInlineSize:et||tt})),minSize:p$8((tt,et)=>({minBlockSize:tt,minInlineSize:et||tt})),paddingBlock:p$8((tt,et)=>({paddingBlockStart:tt,paddingBlockEnd:et||tt})),paddingInline:p$8((tt,et)=>({paddingInlineStart:tt,paddingInlineEnd:et||tt}))},h$a=/([\d.]+)([^]*)/,f$8=(tt,et)=>tt.length?tt.reduce((nt,rt)=>(nt.push(...et.map(it=>it.includes("&")?it.replace(/&/g,/[ +>|~]/.test(rt)&&/&.*&/.test(it)?`:is(${rt})`:rt):rt+" "+it)),nt),[]):et,m$8=(tt,et)=>tt in b$7&&typeof et=="string"?et.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(nt,rt,it,ot)=>rt+(it==="stretch"?`-moz-available${ot};${d$6(tt)}:${rt}-webkit-fill-available`:`-moz-fit-content${ot};${d$6(tt)}:${rt}fit-content`)+ot):String(et),b$7={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$3=tt=>tt?tt+"-":"",k$9=(tt,et,nt)=>tt.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(rt,it,ot,at,st)=>at=="$"==!!ot?rt:(it||at=="--"?"calc(":"")+"var(--"+(at==="$"?S$3(et)+(st.includes("$")?"":S$3(nt))+st.replace(/\$/g,"-"):st)+")"+(it||at=="--"?"*"+(it||"")+(ot||"1")+")":"")),y$8=/\s*,\s*(?![^()]*\))/,B$1=Object.prototype.toString,$$3=(tt,et,nt,rt,it)=>{let ot,at,st;const lt=(ct,ut,ht)=>{let dt,pt;const mt=gt=>{for(dt in gt){const wt=dt.charCodeAt(0)===64,xt=wt&&Array.isArray(gt[dt])?gt[dt]:[gt[dt]];for(pt of xt){const kt=/[A-Z]/.test(bt=dt)?bt:bt.replace(/-[^]/g,Tt=>Tt[1].toUpperCase()),St=typeof pt=="object"&&pt&&pt.toString===B$1&&(!rt.utils[kt]||!ut.length);if(kt in rt.utils&&!St){const Tt=rt.utils[kt];if(Tt!==at){at=Tt,mt(Tt(pt)),at=null;continue}}else if(kt in u$6){const Tt=u$6[kt];if(Tt!==st){st=Tt,mt(Tt(pt)),st=null;continue}}if(wt&&(yt=dt.slice(1)in rt.media?"@media "+rt.media[dt.slice(1)]:dt,dt=yt.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(Tt,At,Et,Ct,Lt,jt)=>{const Rt=h$a.test(At),$t=.0625*(Rt?-1:1),[vt,It]=Rt?[Ct,At]:[At,Ct];return"("+(Et[0]==="="?"":Et[0]===">"===Rt?"max-":"min-")+vt+":"+(Et[0]!=="="&&Et.length===1?It.replace(h$a,(Ot,Wt,zt)=>Number(Wt)+$t*(Et===">"?1:-1)+zt):It)+(Lt?") and ("+(Lt[0]===">"?"min-":"max-")+vt+":"+(Lt.length===1?jt.replace(h$a,(Ot,Wt,zt)=>Number(Wt)+$t*(Lt===">"?-1:1)+zt):jt):"")+")"})),St){const Tt=wt?ht.concat(dt):[...ht],At=wt?[...ut]:f$8(ut,dt.split(y$8));ot!==void 0&&it(x$8(...ot)),ot=void 0,lt(pt,At,Tt)}else ot===void 0&&(ot=[[],ut,ht]),dt=wt||dt.charCodeAt(0)!==36?dt:`--${S$3(rt.prefix)}${dt.slice(1).replace(/\$/g,"-")}`,pt=St?pt:typeof pt=="number"?pt&&kt in I$3?String(pt)+"px":String(pt):k$9(m$8(kt,pt??""),rt.prefix,rt.themeMap[kt]),ot[0].push(`${wt?`${dt} `:`${d$6(dt)}:`}${pt}`)}}var yt,bt};mt(ct),ot!==void 0&&it(x$8(...ot)),ot=void 0};lt(tt,et,nt)},x$8=(tt,et,nt)=>`${nt.map(rt=>`${rt}{`).join("")}${et.length?`${et.join(",")}{`:""}${tt.join(";")}${et.length?"}":""}${Array(nt.length?nt.length+1:0).join("}")}`,I$3={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=tt=>String.fromCharCode(tt+(tt>25?39:97)),z$6=tt=>(et=>{let nt,rt="";for(nt=Math.abs(et);nt>52;nt=nt/52|0)rt=R$1(nt%52)+rt;return R$1(nt%52)+rt})(((et,nt)=>{let rt=nt.length;for(;rt;)et=33*et^nt.charCodeAt(--rt);return et})(5381,JSON.stringify(tt))>>>0),W$7=["themed","global","styled","onevar","resonevar","allvar","inline"],j$2=tt=>{if(tt.href&&!tt.href.startsWith(location.origin))return!1;try{return!!tt.cssRules}catch{return!1}},E$1=tt=>{let et;const nt=()=>{const{cssRules:it}=et.sheet;return[].map.call(it,(ot,at)=>{const{cssText:st}=ot;let lt="";if(st.startsWith("--sxs"))return"";if(it[at-1]&&(lt=it[at-1].cssText).startsWith("--sxs")){if(!ot.cssRules.length)return"";for(const ct in et.rules)if(et.rules[ct].group===ot)return`--sxs{--sxs:${[...et.rules[ct].cache].join(" ")}}${st}`;return ot.cssRules.length?`${lt}${st}`:""}return st}).join("")},rt=()=>{if(et){const{rules:st,sheet:lt}=et;if(!lt.deleteRule){for(;Object(Object(lt.cssRules)[0]).type===3;)lt.cssRules.splice(0,1);lt.cssRules=[]}for(const ct in st)delete st[ct]}const it=Object(tt).styleSheets||[];for(const st of it)if(j$2(st)){for(let lt=0,ct=st.cssRules;ct[lt];++lt){const ut=Object(ct[lt]);if(ut.type!==1)continue;const ht=Object(ct[lt+1]);if(ht.type!==4)continue;++lt;const{cssText:dt}=ut;if(!dt.startsWith("--sxs"))continue;const pt=dt.slice(14,-3).trim().split(/\s+/),mt=W$7[pt[0]];mt&&(et||(et={sheet:st,reset:rt,rules:{},toString:nt}),et.rules[mt]={group:ht,index:lt,cache:new Set(pt)})}if(et)break}if(!et){const st=(lt,ct)=>({type:ct,cssRules:[],insertRule(ut,ht){this.cssRules.splice(ht,0,st(ut,{import:3,undefined:1}[(ut.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return lt==="@media{}"?`@media{${[].map.call(this.cssRules,ut=>ut.cssText).join("")}}`:lt}});et={sheet:tt?(tt.head||tt).appendChild(document.createElement("style")).sheet:st("","text/css"),rules:{},reset:rt,toString:nt}}const{sheet:ot,rules:at}=et;for(let st=W$7.length-1;st>=0;--st){const lt=W$7[st];if(!at[lt]){const ct=W$7[st+1],ut=at[ct]?at[ct].index:ot.cssRules.length;ot.insertRule("@media{}",ut),ot.insertRule(`--sxs{--sxs:${st}}`,ut),at[lt]={group:ot.cssRules[ut+1],index:ut,cache:new Set([st])}}v$8(at[lt])}};return rt(),et},v$8=tt=>{const et=tt.group;let nt=et.cssRules.length;tt.apply=rt=>{try{et.insertRule(rt,nt),++nt}catch{}}},T$2=Symbol(),w$6=o$2(),M$2=(tt,et)=>w$6(tt,()=>(...nt)=>{let rt={type:null,composers:new Set};for(const it of nt)if(it!=null)if(it[l$6]){rt.type==null&&(rt.type=it[l$6].type);for(const ot of it[l$6].composers)rt.composers.add(ot)}else it.constructor!==Object||it.$$typeof?rt.type==null&&(rt.type=it):rt.composers.add(C$1(it,tt));return rt.type==null&&(rt.type="span"),rt.composers.size||rt.composers.add(["PJLV",{},[],[],{},[]]),P$3(tt,rt,et)}),C$1=({variants:tt,compoundVariants:et,defaultVariants:nt,...rt},it)=>{const ot=`${S$3(it.prefix)}c-${z$6(rt)}`,at=[],st=[],lt=Object.create(null),ct=[];for(const dt in nt)lt[dt]=String(nt[dt]);if(typeof tt=="object"&&tt)for(const dt in tt){ut=lt,ht=dt,c$8.call(ut,ht)||(lt[dt]="undefined");const pt=tt[dt];for(const mt in pt){const gt={[dt]:String(mt)};String(mt)==="undefined"&&ct.push(dt);const yt=pt[mt],bt=[gt,yt,!a$4(yt)];at.push(bt)}}var ut,ht;if(typeof et=="object"&&et)for(const dt of et){let{css:pt,...mt}=dt;pt=typeof pt=="object"&&pt||{};for(const yt in mt)mt[yt]=String(mt[yt]);const gt=[mt,pt,!a$4(pt)];st.push(gt)}return[ot,rt,at,st,lt,ct]},P$3=(tt,et,nt)=>{const[rt,it,ot,at]=L$2(et.composers),st=typeof et.type=="function"||et.type.$$typeof?(ht=>{function dt(){for(let pt=0;ptdt.rules[pt]={apply:mt=>dt[T$2].push([pt,mt])}),dt})(nt):null,lt=(st||nt).rules,ct=`.${rt}${it.length>1?`:where(.${it.slice(1).join(".")})`:""}`,ut=ht=>{ht=typeof ht=="object"&&ht||A$2;const{css:dt,...pt}=ht,mt={};for(const bt in ot)if(delete pt[bt],bt in ht){let wt=ht[bt];typeof wt=="object"&&wt?mt[bt]={"@initial":ot[bt],...wt}:(wt=String(wt),mt[bt]=wt!=="undefined"||at.has(bt)?wt:ot[bt])}else mt[bt]=ot[bt];const gt=new Set([...it]);for(const[bt,wt,xt,kt]of et.composers){nt.rules.styled.cache.has(bt)||(nt.rules.styled.cache.add(bt),$$3(wt,[`.${bt}`],[],tt,At=>{lt.styled.apply(At)}));const St=O(xt,mt,tt.media),Tt=O(kt,mt,tt.media,!0);for(const At of St)if(At!==void 0)for(const[Et,Ct,Lt]of At){const jt=`${bt}-${z$6(Ct)}-${Et}`;gt.add(jt);const Rt=(Lt?nt.rules.resonevar:nt.rules.onevar).cache,$t=Lt?lt.resonevar:lt.onevar;Rt.has(jt)||(Rt.add(jt),$$3(Ct,[`.${jt}`],[],tt,vt=>{$t.apply(vt)}))}for(const At of Tt)if(At!==void 0)for(const[Et,Ct]of At){const Lt=`${bt}-${z$6(Ct)}-${Et}`;gt.add(Lt),nt.rules.allvar.cache.has(Lt)||(nt.rules.allvar.cache.add(Lt),$$3(Ct,[`.${Lt}`],[],tt,jt=>{lt.allvar.apply(jt)}))}}if(typeof dt=="object"&&dt){const bt=`${rt}-i${z$6(dt)}-css`;gt.add(bt),nt.rules.inline.cache.has(bt)||(nt.rules.inline.cache.add(bt),$$3(dt,[`.${bt}`],[],tt,wt=>{lt.inline.apply(wt)}))}for(const bt of String(ht.className||"").trim().split(/\s+/))bt&>.add(bt);const yt=pt.className=[...gt].join(" ");return{type:et.type,className:yt,selector:ct,props:pt,toString:()=>yt,deferredInjector:st}};return s$5(ut,{className:rt,selector:ct,[l$6]:et,toString:()=>(nt.rules.styled.cache.has(rt)||ut(),rt)})},L$2=tt=>{let et="";const nt=[],rt={},it=[];for(const[ot,,,,at,st]of tt){et===""&&(et=ot),nt.push(ot),it.push(...st);for(const lt in at){const ct=at[lt];(rt[lt]===void 0||ct!=="undefined"||st.includes(ct))&&(rt[lt]=ct)}}return[et,nt,rt,new Set(it)]},O=(tt,et,nt,rt)=>{const it=[];e:for(let[ot,at,st]of tt){if(st)continue;let lt,ct=0,ut=!1;for(lt in ot){const ht=ot[lt];let dt=et[lt];if(dt!==ht){if(typeof dt!="object"||!dt)continue e;{let pt,mt,gt=0;for(const yt in dt){if(ht===String(dt[yt])){if(yt!=="@initial"){const bt=yt.slice(1);(mt=mt||[]).push(bt in nt?nt[bt]:yt.replace(/^@media ?/,"")),ut=!0}ct+=gt,pt=!0}++gt}if(mt&&mt.length&&(at={["@media "+mt.join(", ")]:at}),!pt)continue e}}}(it[ct]=it[ct]||[]).push([rt?"cv":`${lt}-${ot[lt]}`,at,ut])}return it},A$2={},N$2=o$2(),D$1=(tt,et)=>N$2(tt,()=>(...nt)=>{const rt=()=>{for(let it of nt){it=typeof it=="object"&&it||{};let ot=z$6(it);if(!et.rules.global.cache.has(ot)){if(et.rules.global.cache.add(ot),"@import"in it){let at=[].indexOf.call(et.sheet.cssRules,et.rules.themed.group)-1;for(let st of[].concat(it["@import"]))st=st.includes('"')||st.includes("'")?st:`"${st}"`,et.sheet.insertRule(`@import ${st};`,at++);delete it["@import"]}$$3(it,[],[],tt,at=>{et.rules.global.apply(at)})}}return""};return s$5(rt,{toString:rt})}),H$2=o$2(),V$3=(tt,et)=>H$2(tt,()=>nt=>{const rt=`${S$3(tt.prefix)}k-${z$6(nt)}`,it=()=>{if(!et.rules.global.cache.has(rt)){et.rules.global.cache.add(rt);const ot=[];$$3(nt,[],[],tt,st=>ot.push(st));const at=`@keyframes ${rt}{${ot.join("")}}`;et.rules.global.apply(at)}return rt};return s$5(it,{get name(){return it()},toString:it})}),G$2=class{constructor(et,nt,rt,it){this.token=et==null?"":String(et),this.value=nt==null?"":String(nt),this.scale=rt==null?"":String(rt),this.prefix=it==null?"":String(it)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S$3(this.prefix)+S$3(this.scale)+this.token}toString(){return this.computedValue}},F$2=o$2(),J$2=(tt,et)=>F$2(tt,()=>(nt,rt)=>{rt=typeof nt=="object"&&nt||Object(rt);const it=`.${nt=(nt=typeof nt=="string"?nt:"")||`${S$3(tt.prefix)}t-${z$6(rt)}`}`,ot={},at=[];for(const lt in rt){ot[lt]={};for(const ct in rt[lt]){const ut=`--${S$3(tt.prefix)}${lt}-${ct}`,ht=k$9(String(rt[lt][ct]),tt.prefix,lt);ot[lt][ct]=new G$2(ct,ht,lt,tt.prefix),at.push(`${ut}:${ht}`)}}const st=()=>{if(at.length&&!et.rules.themed.cache.has(nt)){et.rules.themed.cache.add(nt);const lt=`${rt===tt.theme?":root,":""}.${nt}{${at.join(";")}}`;et.rules.themed.apply(lt)}return nt};return{...ot,get className(){return st()},selector:it,toString:st}}),U$2=o$2(),X$1,Y$2=o$2(),q$7=tt=>{const et=(nt=>{let rt=!1;const it=U$2(nt,ot=>{rt=!0;const at="prefix"in(ot=typeof ot=="object"&&ot||{})?String(ot.prefix):"",st=typeof ot.media=="object"&&ot.media||{},lt=typeof ot.root=="object"?ot.root||null:globalThis.document||null,ct=typeof ot.theme=="object"&&ot.theme||{},ut={prefix:at,media:st,theme:ct,themeMap:typeof ot.themeMap=="object"&&ot.themeMap||{...n$7},utils:typeof ot.utils=="object"&&ot.utils||{}},ht=E$1(lt),dt={css:M$2(ut,ht),globalCss:D$1(ut,ht),keyframes:V$3(ut,ht),createTheme:J$2(ut,ht),reset(){ht.reset(),dt.theme.toString()},theme:{},sheet:ht,config:ut,prefix:at,getCssText:ht.toString,toString:ht.toString};return String(dt.theme=dt.createTheme(ct)),dt});return rt||it.reset(),it})(tt);return et.styled=(({config:nt,sheet:rt})=>Y$2(nt,()=>{const it=M$2(nt,rt);return(...ot)=>{const at=it(...ot),st=at[l$6].type,lt=React$1.forwardRef((ct,ut)=>{const ht=ct&&ct.as||st,{props:dt,deferredInjector:pt}=at(ct);return delete dt.as,dt.ref=ut,pt?React$1.createElement(React$1.Fragment,null,React$1.createElement(ht,dt),React$1.createElement(pt,null)):React$1.createElement(ht,dt)});return lt.className=at.className,lt.displayName=`Styled.${st.displayName||st.name||st}`,lt.selector=at.selector,lt.toString=()=>at.selector,lt[l$6]=at[l$6],lt}}))(et),et},K$6=()=>X$1||(X$1=q$7()),re$4=(...tt)=>K$6().styled(...tt);function clamp$9(tt,et,nt){return Math.max(et,Math.min(tt,nt))}const V$2={toVector(tt,et){return tt===void 0&&(tt=et),Array.isArray(tt)?tt:[tt,tt]},add(tt,et){return[tt[0]+et[0],tt[1]+et[1]]},sub(tt,et){return[tt[0]-et[0],tt[1]-et[1]]},addTo(tt,et){tt[0]+=et[0],tt[1]+=et[1]},subTo(tt,et){tt[0]-=et[0],tt[1]-=et[1]}};function rubberband(tt,et,nt){return et===0||Math.abs(et)===1/0?Math.pow(tt,nt*5):tt*et*nt/(et+nt*tt)}function rubberbandIfOutOfBounds(tt,et,nt,rt=.15){return rt===0?clamp$9(tt,et,nt):ttnt?+rubberband(tt-nt,nt-et,rt)+nt:tt}function computeRubberband(tt,[et,nt],[rt,it]){const[[ot,at],[st,lt]]=tt;return[rubberbandIfOutOfBounds(et,ot,at,rt),rubberbandIfOutOfBounds(nt,st,lt,it)]}function _toPrimitive$C(tt,et){if(typeof tt!="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var rt=nt.call(tt,et||"default");if(typeof rt!="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _toPropertyKey$C(tt){var et=_toPrimitive$C(tt,"string");return typeof et=="symbol"?et:String(et)}function _defineProperty$G(tt,et,nt){return et=_toPropertyKey$C(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$F(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);et&&(rt=rt.filter(function(it){return Object.getOwnPropertyDescriptor(tt,it).enumerable})),nt.push.apply(nt,rt)}return nt}function _objectSpread2$2(tt){for(var et=1;et{var nt,rt;return et.target===tt.currentTarget||((nt=tt.currentTarget)===null||nt===void 0||(rt=nt.contains)===null||rt===void 0?void 0:rt.call(nt,et.target))})}function getTouchList(tt){return tt.type==="touchend"||tt.type==="touchcancel"?tt.changedTouches:tt.targetTouches}function getValueEvent(tt){return isTouch$1(tt)?getTouchList(tt)[0]:tt}function touchIds(tt){return getCurrentTargetTouchList(tt).map(et=>et.identifier)}function pointerId(tt){const et=getValueEvent(tt);return isTouch$1(tt)?et.identifier:et.pointerId}function pointerValues(tt){const et=getValueEvent(tt);return[et.clientX,et.clientY]}function getEventDetails(tt){const et={};if("buttons"in tt&&(et.buttons=tt.buttons),"shiftKey"in tt){const{shiftKey:nt,altKey:rt,metaKey:it,ctrlKey:ot}=tt;Object.assign(et,{shiftKey:nt,altKey:rt,metaKey:it,ctrlKey:ot})}return et}function call$2(tt,...et){return typeof tt=="function"?tt(...et):tt}function noop$b(){}function chain(...tt){return tt.length===0?noop$b:tt.length===1?tt[0]:function(){let et;for(const nt of tt)et=nt.apply(this,arguments)||et;return et}}function assignDefault(tt,et){return Object.assign({},et,tt||{})}const BEFORE_LAST_KINEMATICS_DELAY=32;class Engine{constructor(et,nt,rt){this.ctrl=et,this.args=nt,this.key=rt,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(et){this.ctrl.state[this.key]=et}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:et,shared:nt,ingKey:rt,args:it}=this;nt[rt]=et._active=et.active=et._blocked=et._force=!1,et._step=[!1,!1],et.intentional=!1,et._movement=[0,0],et._distance=[0,0],et._direction=[0,0],et._delta=[0,0],et._bounds=[[-1/0,1/0],[-1/0,1/0]],et.args=it,et.axis=void 0,et.memo=void 0,et.elapsedTime=et.timeDelta=0,et.direction=[0,0],et.distance=[0,0],et.overflow=[0,0],et._movementBound=[!1,!1],et.velocity=[0,0],et.movement=[0,0],et.delta=[0,0],et.timeStamp=0}start(et){const nt=this.state,rt=this.config;nt._active||(this.reset(),this.computeInitial(),nt._active=!0,nt.target=et.target,nt.currentTarget=et.currentTarget,nt.lastOffset=rt.from?call$2(rt.from,nt):nt.offset,nt.offset=nt.lastOffset,nt.startTime=nt.timeStamp=et.timeStamp)}computeValues(et){const nt=this.state;nt._values=et,nt.values=this.config.transform(et)}computeInitial(){const et=this.state;et._initial=et._values,et.initial=et.values}compute(et){const{state:nt,config:rt,shared:it}=this;nt.args=this.args;let ot=0;if(et&&(nt.event=et,rt.preventDefault&&et.cancelable&&nt.event.preventDefault(),nt.type=et.type,it.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,it.locked=!!document.pointerLockElement,Object.assign(it,getEventDetails(et)),it.down=it.pressed=it.buttons%2===1||it.touches>0,ot=et.timeStamp-nt.timeStamp,nt.timeStamp=et.timeStamp,nt.elapsedTime=nt.timeStamp-nt.startTime),nt._active){const Tt=nt._delta.map(Math.abs);V$2.addTo(nt._distance,Tt)}this.axisIntent&&this.axisIntent(et);const[at,st]=nt._movement,[lt,ct]=rt.threshold,{_step:ut,values:ht}=nt;if(rt.hasCustomTransform?(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&ht[0]),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&ht[1])):(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&Math.sign(at)*lt),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&Math.sign(st)*ct)),nt.intentional=ut[0]!==!1||ut[1]!==!1,!nt.intentional)return;const dt=[0,0];if(rt.hasCustomTransform){const[Tt,At]=ht;dt[0]=ut[0]!==!1?Tt-ut[0]:0,dt[1]=ut[1]!==!1?At-ut[1]:0}else dt[0]=ut[0]!==!1?at-ut[0]:0,dt[1]=ut[1]!==!1?st-ut[1]:0;this.restrictToAxis&&!nt._blocked&&this.restrictToAxis(dt);const pt=nt.offset,mt=nt._active&&!nt._blocked||nt.active;mt&&(nt.first=nt._active&&!nt.active,nt.last=!nt._active&&nt.active,nt.active=it[this.ingKey]=nt._active,et&&(nt.first&&("bounds"in rt&&(nt._bounds=call$2(rt.bounds,nt)),this.setup&&this.setup()),nt.movement=dt,this.computeOffset()));const[gt,yt]=nt.offset,[[bt,wt],[xt,kt]]=nt._bounds;nt.overflow=[gtwt?1:0,ytkt?1:0],nt._movementBound[0]=nt.overflow[0]?nt._movementBound[0]===!1?nt._movement[0]:nt._movementBound[0]:!1,nt._movementBound[1]=nt.overflow[1]?nt._movementBound[1]===!1?nt._movement[1]:nt._movementBound[1]:!1;const St=nt._active?rt.rubberband||[0,0]:[0,0];if(nt.offset=computeRubberband(nt._bounds,nt.offset,St),nt.delta=V$2.sub(nt.offset,pt),this.computeMovement(),mt&&(!nt.last||ot>BEFORE_LAST_KINEMATICS_DELAY)){nt.delta=V$2.sub(nt.offset,pt);const Tt=nt.delta.map(Math.abs);V$2.addTo(nt.distance,Tt),nt.direction=nt.delta.map(Math.sign),nt._direction=nt._delta.map(Math.sign),!nt.first&&ot>0&&(nt.velocity=[Tt[0]/ot,Tt[1]/ot],nt.timeDelta=ot)}}emit(){const et=this.state,nt=this.shared,rt=this.config;if(et._active||this.clean(),(et._blocked||!et.intentional)&&!et._force&&!rt.triggerAllEvents)return;const it=this.handler(_objectSpread2$2(_objectSpread2$2(_objectSpread2$2({},nt),et),{},{[this.aliasKey]:et.values}));it!==void 0&&(et.memo=it)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function selectAxis([tt,et],nt){const rt=Math.abs(tt),it=Math.abs(et);if(rt>it&&rt>nt)return"x";if(it>rt&&it>nt)return"y"}class CoordinatesEngine extends Engine{constructor(...et){super(...et),_defineProperty$G(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V$2.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V$2.sub(this.state.offset,this.state.lastOffset)}axisIntent(et){const nt=this.state,rt=this.config;if(!nt.axis&&et){const it=typeof rt.axisThreshold=="object"?rt.axisThreshold[getPointerType(et)]:rt.axisThreshold;nt.axis=selectAxis(nt._movement,it)}nt._blocked=(rt.lockDirection||!!rt.axis)&&!nt.axis||!!rt.axis&&rt.axis!==nt.axis}restrictToAxis(et){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":et[1]=0;break;case"y":et[0]=0;break}}}const identity$e=tt=>tt,DEFAULT_RUBBERBAND=.15,commonConfigResolver={enabled(tt=!0){return tt},eventOptions(tt,et,nt){return _objectSpread2$2(_objectSpread2$2({},nt.shared.eventOptions),tt)},preventDefault(tt=!1){return tt},triggerAllEvents(tt=!1){return tt},rubberband(tt=0){switch(tt){case!0:return[DEFAULT_RUBBERBAND,DEFAULT_RUBBERBAND];case!1:return[0,0];default:return V$2.toVector(tt)}},from(tt){if(typeof tt=="function")return tt;if(tt!=null)return V$2.toVector(tt)},transform(tt,et,nt){const rt=tt||nt.shared.transform;return this.hasCustomTransform=!!rt,rt||identity$e},threshold(tt){return V$2.toVector(tt,0)}},DEFAULT_AXIS_THRESHOLD=0,coordinatesConfigResolver=_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{axis(tt,et,{axis:nt}){if(this.lockDirection=nt==="lock",!this.lockDirection)return nt},axisThreshold(tt=DEFAULT_AXIS_THRESHOLD){return tt},bounds(tt={}){if(typeof tt=="function")return ot=>coordinatesConfigResolver.bounds(tt(ot));if("current"in tt)return()=>tt.current;if(typeof HTMLElement=="function"&&tt instanceof HTMLElement)return tt;const{left:et=-1/0,right:nt=1/0,top:rt=-1/0,bottom:it=1/0}=tt;return[[et,nt],[rt,it]]}}),KEYS_DELTA_MAP={ArrowRight:(tt,et=1)=>[tt*et,0],ArrowLeft:(tt,et=1)=>[-1*tt*et,0],ArrowUp:(tt,et=1)=>[0,-1*tt*et],ArrowDown:(tt,et=1)=>[0,tt*et]};class DragEngine extends CoordinatesEngine{constructor(...et){super(...et),_defineProperty$G(this,"ingKey","dragging")}reset(){super.reset();const et=this.state;et._pointerId=void 0,et._pointerActive=!1,et._keyboardActive=!1,et._preventScroll=!1,et._delayed=!1,et.swipe=[0,0],et.tap=!1,et.canceled=!1,et.cancel=this.cancel.bind(this)}setup(){const et=this.state;if(et._bounds instanceof HTMLElement){const nt=et._bounds.getBoundingClientRect(),rt=et.currentTarget.getBoundingClientRect(),it={left:nt.left-rt.left+et.offset[0],right:nt.right-rt.right+et.offset[0],top:nt.top-rt.top+et.offset[1],bottom:nt.bottom-rt.bottom+et.offset[1]};et._bounds=coordinatesConfigResolver.bounds(it)}}cancel(){const et=this.state;et.canceled||(et.canceled=!0,et._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(et){const nt=this.config,rt=this.state;if(et.buttons!=null&&(Array.isArray(nt.pointerButtons)?!nt.pointerButtons.includes(et.buttons):nt.pointerButtons!==-1&&nt.pointerButtons!==et.buttons))return;const it=this.ctrl.setEventIds(et);nt.pointerCapture&&et.target.setPointerCapture(et.pointerId),!(it&&it.size>1&&rt._pointerActive)&&(this.start(et),this.setupPointer(et),rt._pointerId=pointerId(et),rt._pointerActive=!0,this.computeValues(pointerValues(et)),this.computeInitial(),nt.preventScrollAxis&&getPointerType(et)!=="mouse"?(rt._active=!1,this.setupScrollPrevention(et)):nt.delay>0?(this.setupDelayTrigger(et),nt.triggerAllEvents&&(this.compute(et),this.emit())):this.startPointerDrag(et))}startPointerDrag(et){const nt=this.state;nt._active=!0,nt._preventScroll=!0,nt._delayed=!1,this.compute(et),this.emit()}pointerMove(et){const nt=this.state,rt=this.config;if(!nt._pointerActive)return;const it=pointerId(et);if(nt._pointerId!==void 0&&it!==nt._pointerId)return;const ot=pointerValues(et);if(document.pointerLockElement===et.target?nt._delta=[et.movementX,et.movementY]:(nt._delta=V$2.sub(ot,nt._values),this.computeValues(ot)),V$2.addTo(nt._movement,nt._delta),this.compute(et),nt._delayed&&nt.intentional){this.timeoutStore.remove("dragDelay"),nt.active=!1,this.startPointerDrag(et);return}if(rt.preventScrollAxis&&!nt._preventScroll)if(nt.axis)if(nt.axis===rt.preventScrollAxis||rt.preventScrollAxis==="xy"){nt._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(et);return}else return;this.emit()}pointerUp(et){this.ctrl.setEventIds(et);try{this.config.pointerCapture&&et.target.hasPointerCapture(et.pointerId)&&et.target.releasePointerCapture(et.pointerId)}catch{}const nt=this.state,rt=this.config;if(!nt._active||!nt._pointerActive)return;const it=pointerId(et);if(nt._pointerId!==void 0&&it!==nt._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(et);const[ot,at]=nt._distance;if(nt.tap=ot<=rt.tapsThreshold&&at<=rt.tapsThreshold,nt.tap&&rt.filterTaps)nt._force=!0;else{const[st,lt]=nt._delta,[ct,ut]=nt._movement,[ht,dt]=rt.swipe.velocity,[pt,mt]=rt.swipe.distance,gt=rt.swipe.duration;if(nt.elapsedTimeht&&Math.abs(ct)>pt&&(nt.swipe[0]=Math.sign(st)),bt>dt&&Math.abs(ut)>mt&&(nt.swipe[1]=Math.sign(lt))}}this.emit()}pointerClick(et){!this.state.tap&&et.detail>0&&(et.preventDefault(),et.stopPropagation())}setupPointer(et){const nt=this.config,rt=nt.device;nt.pointerLock&&et.currentTarget.requestPointerLock(),nt.pointerCapture||(this.eventStore.add(this.sharedConfig.window,rt,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,rt,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,rt,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(et){this.state._preventScroll&&et.cancelable&&et.preventDefault()}setupScrollPrevention(et){this.state._preventScroll=!1,persistEvent(et);const nt=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",nt),this.eventStore.add(this.sharedConfig.window,"touch","cancel",nt),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,et)}setupDelayTrigger(et){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(et)},this.config.delay)}keyDown(et){const nt=KEYS_DELTA_MAP[et.key];if(nt){const rt=this.state,it=et.shiftKey?10:et.altKey?.1:1;this.start(et),rt._delta=nt(this.config.keyboardDisplacement,it),rt._keyboardActive=!0,V$2.addTo(rt._movement,rt._delta),this.compute(et),this.emit()}}keyUp(et){et.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(et),this.emit())}bind(et){const nt=this.config.device;et(nt,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(et(nt,"change",this.pointerMove.bind(this)),et(nt,"end",this.pointerUp.bind(this)),et(nt,"cancel",this.pointerUp.bind(this)),et("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(et("key","down",this.keyDown.bind(this)),et("key","up",this.keyUp.bind(this))),this.config.filterTaps&&et("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function persistEvent(tt){"persist"in tt&&typeof tt.persist=="function"&&tt.persist()}const isBrowser$2=typeof window<"u"&&window.document&&window.document.createElement;function supportsTouchEvents(){return isBrowser$2&&"ontouchstart"in window}function isTouchScreen(){return supportsTouchEvents()||isBrowser$2&&window.navigator.maxTouchPoints>1}function supportsPointerEvents(){return isBrowser$2&&"onpointerdown"in window}function supportsPointerLock(){return isBrowser$2&&"exitPointerLock"in window.document}function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch{return!1}}const SUPPORT={isBrowser:isBrowser$2,gesture:supportsGestureEvents(),touch:supportsTouchEvents(),touchscreen:isTouchScreen(),pointer:supportsPointerEvents(),pointerLock:supportsPointerLock()},DEFAULT_PREVENT_SCROLL_DELAY=250,DEFAULT_DRAG_DELAY=180,DEFAULT_SWIPE_VELOCITY=.5,DEFAULT_SWIPE_DISTANCE=50,DEFAULT_SWIPE_DURATION=250,DEFAULT_KEYBOARD_DISPLACEMENT=10,DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{device(tt,et,{pointer:{touch:nt=!1,lock:rt=!1,mouse:it=!1}={}}){return this.pointerLock=rt&&SUPPORT.pointerLock,SUPPORT.touch&&nt?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!it?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(tt,et,{preventScroll:nt}){if(this.preventScrollDelay=typeof nt=="number"?nt:nt||nt===void 0&&tt?DEFAULT_PREVENT_SCROLL_DELAY:void 0,!(!SUPPORT.touchscreen||nt===!1))return tt||(nt!==void 0?"y":void 0)},pointerCapture(tt,et,{pointer:{capture:nt=!0,buttons:rt=1,keys:it=!0}={}}){return this.pointerButtons=rt,this.keys=it,!this.pointerLock&&this.device==="pointer"&&nt},threshold(tt,et,{filterTaps:nt=!1,tapsThreshold:rt=3,axis:it=void 0}){const ot=V$2.toVector(tt,nt?rt:it?1:0);return this.filterTaps=nt,this.tapsThreshold=rt,ot},swipe({velocity:tt=DEFAULT_SWIPE_VELOCITY,distance:et=DEFAULT_SWIPE_DISTANCE,duration:nt=DEFAULT_SWIPE_DURATION}={}){return{velocity:this.transform(V$2.toVector(tt)),distance:this.transform(V$2.toVector(et)),duration:nt}},delay(tt=0){switch(tt){case!0:return DEFAULT_DRAG_DELAY;case!1:return 0;default:return tt}},axisThreshold(tt){return tt?_objectSpread2$2(_objectSpread2$2({},DEFAULT_DRAG_AXIS_THRESHOLD),tt):DEFAULT_DRAG_AXIS_THRESHOLD},keyboardDisplacement(tt=DEFAULT_KEYBOARD_DISPLACEMENT){return tt}});_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{device(tt,et,{shared:nt,pointer:{touch:rt=!1}={}}){if(nt.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&rt)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(tt,et,{scaleBounds:nt={},angleBounds:rt={}}){const it=at=>{const st=assignDefault(call$2(nt,at),{min:-1/0,max:1/0});return[st.min,st.max]},ot=at=>{const st=assignDefault(call$2(rt,at),{min:-1/0,max:1/0});return[st.min,st.max]};return typeof nt!="function"&&typeof rt!="function"?[it(),ot()]:at=>[it(at),ot(at)]},threshold(tt,et,nt){return this.lockDirection=nt.axis==="lock",V$2.toVector(tt,this.lockDirection?[.1,3]:0)},modifierKey(tt){return tt===void 0?"ctrlKey":tt},pinchOnWheel(tt=!0){return tt}});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});const EngineMap=new Map,ConfigResolverMap=new Map;function registerAction(tt){EngineMap.set(tt.key,tt.engine),ConfigResolverMap.set(tt.key,tt.resolver)}const dragAction={key:"drag",engine:DragEngine,resolver:dragConfigResolver};function _objectWithoutPropertiesLoose$p(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}function _objectWithoutProperties$m(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$p(tt,et),rt,it;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(it=0;it=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}const sharedConfigResolver={target(tt){if(tt)return()=>"current"in tt?tt.current:tt},enabled(tt=!0){return tt},window(tt=SUPPORT.isBrowser?window:void 0){return tt},eventOptions({passive:tt=!0,capture:et=!1}={}){return{passive:tt,capture:et}},transform(tt){return tt}},_excluded$1K=["target","eventOptions","window","enabled","transform"];function resolveWith(tt={},et){const nt={};for(const[rt,it]of Object.entries(et))switch(typeof it){case"function":nt[rt]=it.call(nt,tt[rt],rt,tt);break;case"object":nt[rt]=resolveWith(tt[rt],it);break;case"boolean":it&&(nt[rt]=tt[rt]);break}return nt}function parse$3(tt,et,nt={}){const rt=tt,{target:it,eventOptions:ot,window:at,enabled:st,transform:lt}=rt,ct=_objectWithoutProperties$m(rt,_excluded$1K);if(nt.shared=resolveWith({target:it,eventOptions:ot,window:at,enabled:st,transform:lt},sharedConfigResolver),et){const ut=ConfigResolverMap.get(et);nt[et]=resolveWith(_objectSpread2$2({shared:nt.shared},ct),ut)}else for(const ut in ct){const ht=ConfigResolverMap.get(ut);ht&&(nt[ut]=resolveWith(_objectSpread2$2({shared:nt.shared},ct[ut]),ht))}return nt}class EventStore{constructor(et,nt){_defineProperty$G(this,"_listeners",new Set),this._ctrl=et,this._gestureKey=nt}add(et,nt,rt,it,ot){const at=this._listeners,st=toDomEventType(nt,rt),lt=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},ct=_objectSpread2$2(_objectSpread2$2({},lt),ot);et.addEventListener(st,it,ct);const ut=()=>{et.removeEventListener(st,it,ct),at.delete(ut)};return at.add(ut),ut}clean(){this._listeners.forEach(et=>et()),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty$G(this,"_timeouts",new Map)}add(et,nt,rt=140,...it){this.remove(et),this._timeouts.set(et,window.setTimeout(nt,rt,...it))}remove(et){const nt=this._timeouts.get(et);nt&&window.clearTimeout(nt)}clean(){this._timeouts.forEach(et=>void window.clearTimeout(et)),this._timeouts.clear()}}let Controller$1=class{constructor(et){_defineProperty$G(this,"gestures",new Set),_defineProperty$G(this,"_targetEventStore",new EventStore(this)),_defineProperty$G(this,"gestureEventStores",{}),_defineProperty$G(this,"gestureTimeoutStores",{}),_defineProperty$G(this,"handlers",{}),_defineProperty$G(this,"config",{}),_defineProperty$G(this,"pointerIds",new Set),_defineProperty$G(this,"touchIds",new Set),_defineProperty$G(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),resolveGestures(this,et)}setEventIds(et){if(isTouch$1(et))return this.touchIds=new Set(touchIds(et)),this.touchIds;if("pointerId"in et)return et.type==="pointerup"||et.type==="pointercancel"?this.pointerIds.delete(et.pointerId):et.type==="pointerdown"&&this.pointerIds.add(et.pointerId),this.pointerIds}applyHandlers(et,nt){this.handlers=et,this.nativeHandlers=nt}applyConfig(et,nt){this.config=parse$3(et,nt,this.config)}clean(){this._targetEventStore.clean();for(const et of this.gestures)this.gestureEventStores[et].clean(),this.gestureTimeoutStores[et].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...et){const nt=this.config.shared,rt={};let it;if(!(nt.target&&(it=nt.target(),!it))){if(nt.enabled){for(const at of this.gestures){const st=this.config[at],lt=bindToProps(rt,st.eventOptions,!!it);if(st.enabled){const ct=EngineMap.get(at);new ct(this,et,at).bind(lt)}}const ot=bindToProps(rt,nt.eventOptions,!!it);for(const at in this.nativeHandlers)ot(at,"",st=>this.nativeHandlers[at](_objectSpread2$2(_objectSpread2$2({},this.state.shared),{},{event:st,args:et})),void 0,!0)}for(const ot in rt)rt[ot]=chain(...rt[ot]);if(!it)return rt;for(const ot in rt){const{device:at,capture:st,passive:lt}=parseProp(ot);this._targetEventStore.add(it,at,"",rt[ot],{capture:st,passive:lt})}}}};function setupGesture(tt,et){tt.gestures.add(et),tt.gestureEventStores[et]=new EventStore(tt,et),tt.gestureTimeoutStores[et]=new TimeoutStore}function resolveGestures(tt,et){et.drag&&setupGesture(tt,"drag"),et.wheel&&setupGesture(tt,"wheel"),et.scroll&&setupGesture(tt,"scroll"),et.move&&setupGesture(tt,"move"),et.pinch&&setupGesture(tt,"pinch"),et.hover&&setupGesture(tt,"hover")}const bindToProps=(tt,et,nt)=>(rt,it,ot,at={},st=!1)=>{var lt,ct;const ut=(lt=at.capture)!==null&<!==void 0?lt:et.capture,ht=(ct=at.passive)!==null&&ct!==void 0?ct:et.passive;let dt=st?rt:toHandlerProp(rt,it,ut);nt&&ht&&(dt+="Passive"),tt[dt]=tt[dt]||[],tt[dt].push(ot)};function useRecognizers(tt,et={},nt,rt){const it=React$1.useMemo(()=>new Controller$1(tt),[]);if(it.applyHandlers(tt,rt),it.applyConfig(et,nt),React$1.useEffect(it.effect.bind(it)),React$1.useEffect(()=>it.clean.bind(it),[]),et.target===void 0)return it.bind.bind(it)}function useDrag$2(tt,et){return registerAction(dragAction),useRecognizers({drag:tt},et||{},"drag")}function $e42e1063c40fb3ef$export$b9ecd428b558ff10(tt,et,{checkForDefaultPrevented:nt=!0}={}){return function(it){if(tt==null||tt(it),nt===!1||!it.defaultPrevented)return et==null?void 0:et(it)}}function $c512c27ab02ef895$export$50c7b4e9d9f19c1(tt,et=[]){let nt=[];function rt(ot,at){const st=reactExports.createContext(at),lt=nt.length;nt=[...nt,at];function ct(ht){const{scope:dt,children:pt,...mt}=ht,gt=(dt==null?void 0:dt[tt][lt])||st,yt=reactExports.useMemo(()=>mt,Object.values(mt));return reactExports.createElement(gt.Provider,{value:yt},pt)}function ut(ht,dt){const pt=(dt==null?void 0:dt[tt][lt])||st,mt=reactExports.useContext(pt);if(mt)return mt;if(at!==void 0)return at;throw new Error(`\`${ht}\` must be used within \`${ot}\``)}return ct.displayName=ot+"Provider",[ct,ut]}const it=()=>{const ot=nt.map(at=>reactExports.createContext(at));return function(st){const lt=(st==null?void 0:st[tt])||ot;return reactExports.useMemo(()=>({[`__scope${tt}`]:{...st,[tt]:lt}}),[st,lt])}};return it.scopeName=tt,[rt,$c512c27ab02ef895$var$composeContextScopes(it,...et)]}function $c512c27ab02ef895$var$composeContextScopes(...tt){const et=tt[0];if(tt.length===1)return et;const nt=()=>{const rt=tt.map(it=>({useScope:it(),scopeName:it.scopeName}));return function(ot){const at=rt.reduce((st,{useScope:lt,scopeName:ct})=>{const ht=lt(ot)[`__scope${ct}`];return{...st,...ht}},{});return reactExports.useMemo(()=>({[`__scope${et.scopeName}`]:at}),[at])}};return nt.scopeName=et.scopeName,nt}function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt){const et=reactExports.useRef(tt);return reactExports.useEffect(()=>{et.current=tt}),reactExports.useMemo(()=>(...nt)=>{var rt;return(rt=et.current)===null||rt===void 0?void 0:rt.call(et,...nt)},[])}function $addc16e1bbe58fd0$export$3a72a57244d6e765(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt);reactExports.useEffect(()=>{const rt=it=>{it.key==="Escape"&&nt(it)};return et.addEventListener("keydown",rt),()=>et.removeEventListener("keydown",rt)},[nt,et])}const $5cb92bef7577960e$var$CONTEXT_UPDATE="dismissableLayer.update",$5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",$5cb92bef7577960e$var$FOCUS_OUTSIDE="dismissableLayer.focusOutside";let $5cb92bef7577960e$var$originalBodyPointerEvents;const $5cb92bef7577960e$var$DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$5cb92bef7577960e$export$177fb62ff3ec1f22=reactExports.forwardRef((tt,et)=>{var nt;const{disableOutsidePointerEvents:rt=!1,onEscapeKeyDown:it,onPointerDownOutside:ot,onFocusOutside:at,onInteractOutside:st,onDismiss:lt,...ct}=tt,ut=reactExports.useContext($5cb92bef7577960e$var$DismissableLayerContext),[ht,dt]=reactExports.useState(null),pt=(nt=ht==null?void 0:ht.ownerDocument)!==null&&nt!==void 0?nt:globalThis==null?void 0:globalThis.document,[,mt]=reactExports.useState({}),gt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,Et=>dt(Et)),yt=Array.from(ut.layers),[bt]=[...ut.layersWithOutsidePointerEventsDisabled].slice(-1),wt=yt.indexOf(bt),xt=ht?yt.indexOf(ht):-1,kt=ut.layersWithOutsidePointerEventsDisabled.size>0,St=xt>=wt,Tt=$5cb92bef7577960e$var$usePointerDownOutside(Et=>{const Ct=Et.target,Lt=[...ut.branches].some(jt=>jt.contains(Ct));!St||Lt||(ot==null||ot(Et),st==null||st(Et),Et.defaultPrevented||lt==null||lt())},pt),At=$5cb92bef7577960e$var$useFocusOutside(Et=>{const Ct=Et.target;[...ut.branches].some(jt=>jt.contains(Ct))||(at==null||at(Et),st==null||st(Et),Et.defaultPrevented||lt==null||lt())},pt);return $addc16e1bbe58fd0$export$3a72a57244d6e765(Et=>{xt===ut.layers.size-1&&(it==null||it(Et),!Et.defaultPrevented&<&&(Et.preventDefault(),lt()))},pt),reactExports.useEffect(()=>{if(ht)return rt&&(ut.layersWithOutsidePointerEventsDisabled.size===0&&($5cb92bef7577960e$var$originalBodyPointerEvents=pt.body.style.pointerEvents,pt.body.style.pointerEvents="none"),ut.layersWithOutsidePointerEventsDisabled.add(ht)),ut.layers.add(ht),$5cb92bef7577960e$var$dispatchUpdate(),()=>{rt&&ut.layersWithOutsidePointerEventsDisabled.size===1&&(pt.body.style.pointerEvents=$5cb92bef7577960e$var$originalBodyPointerEvents)}},[ht,pt,rt,ut]),reactExports.useEffect(()=>()=>{ht&&(ut.layers.delete(ht),ut.layersWithOutsidePointerEventsDisabled.delete(ht),$5cb92bef7577960e$var$dispatchUpdate())},[ht,ut]),reactExports.useEffect(()=>{const Et=()=>mt({});return document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Et),()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Et)},[]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},ct,{ref:gt,style:{pointerEvents:kt?St?"auto":"none":void 0,...tt.style},onFocusCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocusCapture,At.onFocusCapture),onBlurCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlurCapture,At.onBlurCapture),onPointerDownCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDownCapture,Tt.onPointerDownCapture)}))});function $5cb92bef7577960e$var$usePointerDownOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),rt=reactExports.useRef(!1),it=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ot=st=>{if(st.target&&!rt.current){let ut=function(){$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE,nt,ct,{discrete:!0})};var lt=ut;const ct={originalEvent:st};st.pointerType==="touch"?(et.removeEventListener("click",it.current),it.current=ut,et.addEventListener("click",it.current,{once:!0})):ut()}else et.removeEventListener("click",it.current);rt.current=!1},at=window.setTimeout(()=>{et.addEventListener("pointerdown",ot)},0);return()=>{window.clearTimeout(at),et.removeEventListener("pointerdown",ot),et.removeEventListener("click",it.current)}},[et,nt]),{onPointerDownCapture:()=>rt.current=!0}}function $5cb92bef7577960e$var$useFocusOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),rt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const it=ot=>{ot.target&&!rt.current&&$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE,nt,{originalEvent:ot},{discrete:!1})};return et.addEventListener("focusin",it),()=>et.removeEventListener("focusin",it)},[et,nt]),{onFocusCapture:()=>rt.current=!0,onBlurCapture:()=>rt.current=!1}}function $5cb92bef7577960e$var$dispatchUpdate(){const tt=new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);document.dispatchEvent(tt)}function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(tt,et,nt,{discrete:rt}){const it=nt.originalEvent.target,ot=new CustomEvent(tt,{bubbles:!1,cancelable:!0,detail:nt});et&&it.addEventListener(tt,et,{once:!0}),rt?$8927f6f2acc4f386$export$6d1a0317bde7de7f(it,ot):it.dispatchEvent(ot)}const $9f79659886946c16$export$e5c5a5f917a5871c=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{},$1746a345f3d73bb7$var$useReactId=React$2["useId".toString()]||(()=>{});let $1746a345f3d73bb7$var$count=0;function $1746a345f3d73bb7$export$f680877a34711e37(tt){const[et,nt]=reactExports.useState($1746a345f3d73bb7$var$useReactId());return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{tt||nt(rt=>rt??String($1746a345f3d73bb7$var$count++))},[tt]),tt||(et?`radix-${et}`:"")}const sides=["top","right","bottom","left"],min$4=Math.min,max$5=Math.max,round$4=Math.round,floor=Math.floor,createCoords=tt=>({x:tt,y:tt}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$8(tt,et,nt){return max$5(tt,min$4(et,nt))}function evaluate$1(tt,et){return typeof tt=="function"?tt(et):tt}function getSide(tt){return tt.split("-")[0]}function getAlignment(tt){return tt.split("-")[1]}function getOppositeAxis(tt){return tt==="x"?"y":"x"}function getAxisLength(tt){return tt==="y"?"height":"width"}function getSideAxis(tt){return["top","bottom"].includes(getSide(tt))?"y":"x"}function getAlignmentAxis(tt){return getOppositeAxis(getSideAxis(tt))}function getAlignmentSides(tt,et,nt){nt===void 0&&(nt=!1);const rt=getAlignment(tt),it=getAlignmentAxis(tt),ot=getAxisLength(it);let at=it==="x"?rt===(nt?"end":"start")?"right":"left":rt==="start"?"bottom":"top";return et.reference[ot]>et.floating[ot]&&(at=getOppositePlacement$1(at)),[at,getOppositePlacement$1(at)]}function getExpandedPlacements(tt){const et=getOppositePlacement$1(tt);return[getOppositeAlignmentPlacement(tt),et,getOppositeAlignmentPlacement(et)]}function getOppositeAlignmentPlacement(tt){return tt.replace(/start|end/g,et=>oppositeAlignmentMap[et])}function getSideList(tt,et,nt){const rt=["left","right"],it=["right","left"],ot=["top","bottom"],at=["bottom","top"];switch(tt){case"top":case"bottom":return nt?et?it:rt:et?rt:it;case"left":case"right":return et?ot:at;default:return[]}}function getOppositeAxisPlacements(tt,et,nt,rt){const it=getAlignment(tt);let ot=getSideList(getSide(tt),nt==="start",rt);return it&&(ot=ot.map(at=>at+"-"+it),et&&(ot=ot.concat(ot.map(getOppositeAlignmentPlacement)))),ot}function getOppositePlacement$1(tt){return tt.replace(/left|right|bottom|top/g,et=>oppositeSideMap[et])}function expandPaddingObject(tt){return{top:0,right:0,bottom:0,left:0,...tt}}function getPaddingObject(tt){return typeof tt!="number"?expandPaddingObject(tt):{top:tt,right:tt,bottom:tt,left:tt}}function rectToClientRect$1(tt){return{...tt,top:tt.y,left:tt.x,right:tt.x+tt.width,bottom:tt.y+tt.height}}function computeCoordsFromPlacement(tt,et,nt){let{reference:rt,floating:it}=tt;const ot=getSideAxis(et),at=getAlignmentAxis(et),st=getAxisLength(at),lt=getSide(et),ct=ot==="y",ut=rt.x+rt.width/2-it.width/2,ht=rt.y+rt.height/2-it.height/2,dt=rt[st]/2-it[st]/2;let pt;switch(lt){case"top":pt={x:ut,y:rt.y-it.height};break;case"bottom":pt={x:ut,y:rt.y+rt.height};break;case"right":pt={x:rt.x+rt.width,y:ht};break;case"left":pt={x:rt.x-it.width,y:ht};break;default:pt={x:rt.x,y:rt.y}}switch(getAlignment(et)){case"start":pt[at]-=dt*(nt&&ct?-1:1);break;case"end":pt[at]+=dt*(nt&&ct?-1:1);break}return pt}const computePosition$1=async(tt,et,nt)=>{const{placement:rt="bottom",strategy:it="absolute",middleware:ot=[],platform:at}=nt,st=ot.filter(Boolean),lt=await(at.isRTL==null?void 0:at.isRTL(et));let ct=await at.getElementRects({reference:tt,floating:et,strategy:it}),{x:ut,y:ht}=computeCoordsFromPlacement(ct,rt,lt),dt=rt,pt={},mt=0;for(let gt=0;gt({name:"arrow",options:tt,async fn(et){const{x:nt,y:rt,placement:it,rects:ot,platform:at,elements:st,middlewareData:lt}=et,{element:ct,padding:ut=0}=evaluate$1(tt,et)||{};if(ct==null)return{};const ht=getPaddingObject(ut),dt={x:nt,y:rt},pt=getAlignmentAxis(it),mt=getAxisLength(pt),gt=await at.getDimensions(ct),yt=pt==="y",bt=yt?"top":"left",wt=yt?"bottom":"right",xt=yt?"clientHeight":"clientWidth",kt=ot.reference[mt]+ot.reference[pt]-dt[pt]-ot.floating[mt],St=dt[pt]-ot.reference[pt],Tt=await(at.getOffsetParent==null?void 0:at.getOffsetParent(ct));let At=Tt?Tt[xt]:0;(!At||!await(at.isElement==null?void 0:at.isElement(Tt)))&&(At=st.floating[xt]||ot.floating[mt]);const Et=kt/2-St/2,Ct=At/2-gt[mt]/2-1,Lt=min$4(ht[bt],Ct),jt=min$4(ht[wt],Ct),Rt=Lt,$t=At-gt[mt]-jt,vt=At/2-gt[mt]/2+Et,It=clamp$8(Rt,vt,$t),Ot=!lt.arrow&&getAlignment(it)!=null&&vt!=It&&ot.reference[mt]/2-(vtRt<=0)){var Ct,Lt;const Rt=(((Ct=ot.flip)==null?void 0:Ct.index)||0)+1,$t=St[Rt];if($t)return{data:{index:Rt,overflows:Et},reset:{placement:$t}};let vt=(Lt=Et.filter(It=>It.overflows[0]<=0).sort((It,Ot)=>It.overflows[1]-Ot.overflows[1])[0])==null?void 0:Lt.placement;if(!vt)switch(pt){case"bestFit":{var jt;const It=(jt=Et.map(Ot=>[Ot.placement,Ot.overflows.filter(Wt=>Wt>0).reduce((Wt,zt)=>Wt+zt,0)]).sort((Ot,Wt)=>Ot[1]-Wt[1])[0])==null?void 0:jt[0];It&&(vt=It);break}case"initialPlacement":vt=st;break}if(it!==vt)return{reset:{placement:vt}}}return{}}}};function getSideOffsets$1(tt,et){return{top:tt.top-et.height,right:tt.right-et.width,bottom:tt.bottom-et.height,left:tt.left-et.width}}function isAnySideFullyClipped$1(tt){return sides.some(et=>tt[et]>=0)}const hide$2=function(tt){return tt===void 0&&(tt={}),{name:"hide",options:tt,async fn(et){const{rects:nt}=et,{strategy:rt="referenceHidden",...it}=evaluate$1(tt,et);switch(rt){case"referenceHidden":{const ot=await detectOverflow$1(et,{...it,elementContext:"reference"}),at=getSideOffsets$1(ot,nt.reference);return{data:{referenceHiddenOffsets:at,referenceHidden:isAnySideFullyClipped$1(at)}}}case"escaped":{const ot=await detectOverflow$1(et,{...it,altBoundary:!0}),at=getSideOffsets$1(ot,nt.floating);return{data:{escapedOffsets:at,escaped:isAnySideFullyClipped$1(at)}}}default:return{}}}}};async function convertValueToCoords(tt,et){const{placement:nt,platform:rt,elements:it}=tt,ot=await(rt.isRTL==null?void 0:rt.isRTL(it.floating)),at=getSide(nt),st=getAlignment(nt),lt=getSideAxis(nt)==="y",ct=["left","top"].includes(at)?-1:1,ut=ot&<?-1:1,ht=evaluate$1(et,tt);let{mainAxis:dt,crossAxis:pt,alignmentAxis:mt}=typeof ht=="number"?{mainAxis:ht,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...ht};return st&&typeof mt=="number"&&(pt=st==="end"?mt*-1:mt),lt?{x:pt*ut,y:dt*ct}:{x:dt*ct,y:pt*ut}}const offset$3=function(tt){return tt===void 0&&(tt=0),{name:"offset",options:tt,async fn(et){const{x:nt,y:rt}=et,it=await convertValueToCoords(et,tt);return{x:nt+it.x,y:rt+it.y,data:it}}}},shift=function(tt){return tt===void 0&&(tt={}),{name:"shift",options:tt,async fn(et){const{x:nt,y:rt,placement:it}=et,{mainAxis:ot=!0,crossAxis:at=!1,limiter:st={fn:yt=>{let{x:bt,y:wt}=yt;return{x:bt,y:wt}}},...lt}=evaluate$1(tt,et),ct={x:nt,y:rt},ut=await detectOverflow$1(et,lt),ht=getSideAxis(getSide(it)),dt=getOppositeAxis(ht);let pt=ct[dt],mt=ct[ht];if(ot){const yt=dt==="y"?"top":"left",bt=dt==="y"?"bottom":"right",wt=pt+ut[yt],xt=pt-ut[bt];pt=clamp$8(wt,pt,xt)}if(at){const yt=ht==="y"?"top":"left",bt=ht==="y"?"bottom":"right",wt=mt+ut[yt],xt=mt-ut[bt];mt=clamp$8(wt,mt,xt)}const gt=st.fn({...et,[dt]:pt,[ht]:mt});return{...gt,data:{x:gt.x-nt,y:gt.y-rt}}}}},limitShift=function(tt){return tt===void 0&&(tt={}),{options:tt,fn(et){const{x:nt,y:rt,placement:it,rects:ot,middlewareData:at}=et,{offset:st=0,mainAxis:lt=!0,crossAxis:ct=!0}=evaluate$1(tt,et),ut={x:nt,y:rt},ht=getSideAxis(it),dt=getOppositeAxis(ht);let pt=ut[dt],mt=ut[ht];const gt=evaluate$1(st,et),yt=typeof gt=="number"?{mainAxis:gt,crossAxis:0}:{mainAxis:0,crossAxis:0,...gt};if(lt){const xt=dt==="y"?"height":"width",kt=ot.reference[dt]-ot.floating[xt]+yt.mainAxis,St=ot.reference[dt]+ot.reference[xt]-yt.mainAxis;ptSt&&(pt=St)}if(ct){var bt,wt;const xt=dt==="y"?"width":"height",kt=["top","left"].includes(getSide(it)),St=ot.reference[ht]-ot.floating[xt]+(kt&&((bt=at.offset)==null?void 0:bt[ht])||0)+(kt?0:yt.crossAxis),Tt=ot.reference[ht]+ot.reference[xt]+(kt?0:((wt=at.offset)==null?void 0:wt[ht])||0)-(kt?yt.crossAxis:0);mtTt&&(mt=Tt)}return{[dt]:pt,[ht]:mt}}}},size=function(tt){return tt===void 0&&(tt={}),{name:"size",options:tt,async fn(et){const{placement:nt,rects:rt,platform:it,elements:ot}=et,{apply:at=()=>{},...st}=evaluate$1(tt,et),lt=await detectOverflow$1(et,st),ct=getSide(nt),ut=getAlignment(nt),ht=getSideAxis(nt)==="y",{width:dt,height:pt}=rt.floating;let mt,gt;ct==="top"||ct==="bottom"?(mt=ct,gt=ut===(await(it.isRTL==null?void 0:it.isRTL(ot.floating))?"start":"end")?"left":"right"):(gt=ct,mt=ut==="end"?"top":"bottom");const yt=pt-lt[mt],bt=dt-lt[gt],wt=!et.middlewareData.shift;let xt=yt,kt=bt;if(ht){const Tt=dt-lt.left-lt.right;kt=ut||wt?min$4(bt,Tt):Tt}else{const Tt=pt-lt.top-lt.bottom;xt=ut||wt?min$4(yt,Tt):Tt}if(wt&&!ut){const Tt=max$5(lt.left,0),At=max$5(lt.right,0),Et=max$5(lt.top,0),Ct=max$5(lt.bottom,0);ht?kt=dt-2*(Tt!==0||At!==0?Tt+At:max$5(lt.left,lt.right)):xt=pt-2*(Et!==0||Ct!==0?Et+Ct:max$5(lt.top,lt.bottom))}await at({...et,availableWidth:kt,availableHeight:xt});const St=await it.getDimensions(ot.floating);return dt!==St.width||pt!==St.height?{reset:{rects:!0}}:{}}}};function getNodeName$1(tt){return isNode(tt)?(tt.nodeName||"").toLowerCase():"#document"}function getWindow$1(tt){var et;return(tt==null||(et=tt.ownerDocument)==null?void 0:et.defaultView)||window}function getDocumentElement$1(tt){var et;return(et=(isNode(tt)?tt.ownerDocument:tt.document)||window.document)==null?void 0:et.documentElement}function isNode(tt){return tt instanceof Node||tt instanceof getWindow$1(tt).Node}function isElement$1(tt){return tt instanceof Element||tt instanceof getWindow$1(tt).Element}function isHTMLElement$3(tt){return tt instanceof HTMLElement||tt instanceof getWindow$1(tt).HTMLElement}function isShadowRoot$1(tt){return typeof ShadowRoot>"u"?!1:tt instanceof ShadowRoot||tt instanceof getWindow$1(tt).ShadowRoot}function isOverflowElement(tt){const{overflow:et,overflowX:nt,overflowY:rt,display:it}=getComputedStyle$2(tt);return/auto|scroll|overlay|hidden|clip/.test(et+rt+nt)&&!["inline","contents"].includes(it)}function isTableElement$1(tt){return["table","td","th"].includes(getNodeName$1(tt))}function isContainingBlock(tt){const et=isWebKit(),nt=getComputedStyle$2(tt);return nt.transform!=="none"||nt.perspective!=="none"||(nt.containerType?nt.containerType!=="normal":!1)||!et&&(nt.backdropFilter?nt.backdropFilter!=="none":!1)||!et&&(nt.filter?nt.filter!=="none":!1)||["transform","perspective","filter"].some(rt=>(nt.willChange||"").includes(rt))||["paint","layout","strict","content"].some(rt=>(nt.contain||"").includes(rt))}function getContainingBlock$1(tt){let et=getParentNode$1(tt);for(;isHTMLElement$3(et)&&!isLastTraversableNode(et);){if(isContainingBlock(et))return et;et=getParentNode$1(et)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(tt){return["html","body","#document"].includes(getNodeName$1(tt))}function getComputedStyle$2(tt){return getWindow$1(tt).getComputedStyle(tt)}function getNodeScroll$1(tt){return isElement$1(tt)?{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}:{scrollLeft:tt.pageXOffset,scrollTop:tt.pageYOffset}}function getParentNode$1(tt){if(getNodeName$1(tt)==="html")return tt;const et=tt.assignedSlot||tt.parentNode||isShadowRoot$1(tt)&&tt.host||getDocumentElement$1(tt);return isShadowRoot$1(et)?et.host:et}function getNearestOverflowAncestor(tt){const et=getParentNode$1(tt);return isLastTraversableNode(et)?tt.ownerDocument?tt.ownerDocument.body:tt.body:isHTMLElement$3(et)&&isOverflowElement(et)?et:getNearestOverflowAncestor(et)}function getOverflowAncestors(tt,et,nt){var rt;et===void 0&&(et=[]),nt===void 0&&(nt=!0);const it=getNearestOverflowAncestor(tt),ot=it===((rt=tt.ownerDocument)==null?void 0:rt.body),at=getWindow$1(it);return ot?et.concat(at,at.visualViewport||[],isOverflowElement(it)?it:[],at.frameElement&&nt?getOverflowAncestors(at.frameElement):[]):et.concat(it,getOverflowAncestors(it,[],nt))}function getCssDimensions(tt){const et=getComputedStyle$2(tt);let nt=parseFloat(et.width)||0,rt=parseFloat(et.height)||0;const it=isHTMLElement$3(tt),ot=it?tt.offsetWidth:nt,at=it?tt.offsetHeight:rt,st=round$4(nt)!==ot||round$4(rt)!==at;return st&&(nt=ot,rt=at),{width:nt,height:rt,$:st}}function unwrapElement(tt){return isElement$1(tt)?tt:tt.contextElement}function getScale$1(tt){const et=unwrapElement(tt);if(!isHTMLElement$3(et))return createCoords(1);const nt=et.getBoundingClientRect(),{width:rt,height:it,$:ot}=getCssDimensions(et);let at=(ot?round$4(nt.width):nt.width)/rt,st=(ot?round$4(nt.height):nt.height)/it;return(!at||!Number.isFinite(at))&&(at=1),(!st||!Number.isFinite(st))&&(st=1),{x:at,y:st}}const noOffsets=createCoords(0);function getVisualOffsets(tt){const et=getWindow$1(tt);return!isWebKit()||!et.visualViewport?noOffsets:{x:et.visualViewport.offsetLeft,y:et.visualViewport.offsetTop}}function shouldAddVisualOffsets(tt,et,nt){return et===void 0&&(et=!1),!nt||et&&nt!==getWindow$1(tt)?!1:et}function getBoundingClientRect$1(tt,et,nt,rt){et===void 0&&(et=!1),nt===void 0&&(nt=!1);const it=tt.getBoundingClientRect(),ot=unwrapElement(tt);let at=createCoords(1);et&&(rt?isElement$1(rt)&&(at=getScale$1(rt)):at=getScale$1(tt));const st=shouldAddVisualOffsets(ot,nt,rt)?getVisualOffsets(ot):createCoords(0);let lt=(it.left+st.x)/at.x,ct=(it.top+st.y)/at.y,ut=it.width/at.x,ht=it.height/at.y;if(ot){const dt=getWindow$1(ot),pt=rt&&isElement$1(rt)?getWindow$1(rt):rt;let mt=dt.frameElement;for(;mt&&rt&&pt!==dt;){const gt=getScale$1(mt),yt=mt.getBoundingClientRect(),bt=getComputedStyle$2(mt),wt=yt.left+(mt.clientLeft+parseFloat(bt.paddingLeft))*gt.x,xt=yt.top+(mt.clientTop+parseFloat(bt.paddingTop))*gt.y;lt*=gt.x,ct*=gt.y,ut*=gt.x,ht*=gt.y,lt+=wt,ct+=xt,mt=getWindow$1(mt).frameElement}}return rectToClientRect$1({width:ut,height:ht,x:lt,y:ct})}function convertOffsetParentRelativeRectToViewportRelativeRect(tt){let{rect:et,offsetParent:nt,strategy:rt}=tt;const it=isHTMLElement$3(nt),ot=getDocumentElement$1(nt);if(nt===ot)return et;let at={scrollLeft:0,scrollTop:0},st=createCoords(1);const lt=createCoords(0);if((it||!it&&rt!=="fixed")&&((getNodeName$1(nt)!=="body"||isOverflowElement(ot))&&(at=getNodeScroll$1(nt)),isHTMLElement$3(nt))){const ct=getBoundingClientRect$1(nt);st=getScale$1(nt),lt.x=ct.x+nt.clientLeft,lt.y=ct.y+nt.clientTop}return{width:et.width*st.x,height:et.height*st.y,x:et.x*st.x-at.scrollLeft*st.x+lt.x,y:et.y*st.y-at.scrollTop*st.y+lt.y}}function getClientRects(tt){return Array.from(tt.getClientRects())}function getWindowScrollBarX$1(tt){return getBoundingClientRect$1(getDocumentElement$1(tt)).left+getNodeScroll$1(tt).scrollLeft}function getDocumentRect$1(tt){const et=getDocumentElement$1(tt),nt=getNodeScroll$1(tt),rt=tt.ownerDocument.body,it=max$5(et.scrollWidth,et.clientWidth,rt.scrollWidth,rt.clientWidth),ot=max$5(et.scrollHeight,et.clientHeight,rt.scrollHeight,rt.clientHeight);let at=-nt.scrollLeft+getWindowScrollBarX$1(tt);const st=-nt.scrollTop;return getComputedStyle$2(rt).direction==="rtl"&&(at+=max$5(et.clientWidth,rt.clientWidth)-it),{width:it,height:ot,x:at,y:st}}function getViewportRect$1(tt,et){const nt=getWindow$1(tt),rt=getDocumentElement$1(tt),it=nt.visualViewport;let ot=rt.clientWidth,at=rt.clientHeight,st=0,lt=0;if(it){ot=it.width,at=it.height;const ct=isWebKit();(!ct||ct&&et==="fixed")&&(st=it.offsetLeft,lt=it.offsetTop)}return{width:ot,height:at,x:st,y:lt}}function getInnerBoundingClientRect$1(tt,et){const nt=getBoundingClientRect$1(tt,!0,et==="fixed"),rt=nt.top+tt.clientTop,it=nt.left+tt.clientLeft,ot=isHTMLElement$3(tt)?getScale$1(tt):createCoords(1),at=tt.clientWidth*ot.x,st=tt.clientHeight*ot.y,lt=it*ot.x,ct=rt*ot.y;return{width:at,height:st,x:lt,y:ct}}function getClientRectFromClippingAncestor(tt,et,nt){let rt;if(et==="viewport")rt=getViewportRect$1(tt,nt);else if(et==="document")rt=getDocumentRect$1(getDocumentElement$1(tt));else if(isElement$1(et))rt=getInnerBoundingClientRect$1(et,nt);else{const it=getVisualOffsets(tt);rt={...et,x:et.x-it.x,y:et.y-it.y}}return rectToClientRect$1(rt)}function hasFixedPositionAncestor(tt,et){const nt=getParentNode$1(tt);return nt===et||!isElement$1(nt)||isLastTraversableNode(nt)?!1:getComputedStyle$2(nt).position==="fixed"||hasFixedPositionAncestor(nt,et)}function getClippingElementAncestors(tt,et){const nt=et.get(tt);if(nt)return nt;let rt=getOverflowAncestors(tt,[],!1).filter(st=>isElement$1(st)&&getNodeName$1(st)!=="body"),it=null;const ot=getComputedStyle$2(tt).position==="fixed";let at=ot?getParentNode$1(tt):tt;for(;isElement$1(at)&&!isLastTraversableNode(at);){const st=getComputedStyle$2(at),lt=isContainingBlock(at);!lt&&st.position==="fixed"&&(it=null),(ot?!lt&&!it:!lt&&st.position==="static"&&!!it&&["absolute","fixed"].includes(it.position)||isOverflowElement(at)&&!lt&&hasFixedPositionAncestor(tt,at))?rt=rt.filter(ut=>ut!==at):it=st,at=getParentNode$1(at)}return et.set(tt,rt),rt}function getClippingRect$1(tt){let{element:et,boundary:nt,rootBoundary:rt,strategy:it}=tt;const at=[...nt==="clippingAncestors"?getClippingElementAncestors(et,this._c):[].concat(nt),rt],st=at[0],lt=at.reduce((ct,ut)=>{const ht=getClientRectFromClippingAncestor(et,ut,it);return ct.top=max$5(ht.top,ct.top),ct.right=min$4(ht.right,ct.right),ct.bottom=min$4(ht.bottom,ct.bottom),ct.left=max$5(ht.left,ct.left),ct},getClientRectFromClippingAncestor(et,st,it));return{width:lt.right-lt.left,height:lt.bottom-lt.top,x:lt.left,y:lt.top}}function getDimensions$1(tt){return getCssDimensions(tt)}function getRectRelativeToOffsetParent(tt,et,nt){const rt=isHTMLElement$3(et),it=getDocumentElement$1(et),ot=nt==="fixed",at=getBoundingClientRect$1(tt,!0,ot,et);let st={scrollLeft:0,scrollTop:0};const lt=createCoords(0);if(rt||!rt&&!ot)if((getNodeName$1(et)!=="body"||isOverflowElement(it))&&(st=getNodeScroll$1(et)),rt){const ct=getBoundingClientRect$1(et,!0,ot,et);lt.x=ct.x+et.clientLeft,lt.y=ct.y+et.clientTop}else it&&(lt.x=getWindowScrollBarX$1(it));return{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function getTrueOffsetParent$1(tt,et){return!isHTMLElement$3(tt)||getComputedStyle$2(tt).position==="fixed"?null:et?et(tt):tt.offsetParent}function getOffsetParent$1(tt,et){const nt=getWindow$1(tt);if(!isHTMLElement$3(tt))return nt;let rt=getTrueOffsetParent$1(tt,et);for(;rt&&isTableElement$1(rt)&&getComputedStyle$2(rt).position==="static";)rt=getTrueOffsetParent$1(rt,et);return rt&&(getNodeName$1(rt)==="html"||getNodeName$1(rt)==="body"&&getComputedStyle$2(rt).position==="static"&&!isContainingBlock(rt))?nt:rt||getContainingBlock$1(tt)||nt}const getElementRects=async function(tt){let{reference:et,floating:nt,strategy:rt}=tt;const it=this.getOffsetParent||getOffsetParent$1,ot=this.getDimensions;return{reference:getRectRelativeToOffsetParent(et,await it(nt),rt),floating:{x:0,y:0,...await ot(nt)}}};function isRTL(tt){return getComputedStyle$2(tt).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement$1,getClippingRect:getClippingRect$1,getOffsetParent:getOffsetParent$1,getElementRects,getClientRects,getDimensions:getDimensions$1,getScale:getScale$1,isElement:isElement$1,isRTL};function observeMove(tt,et){let nt=null,rt;const it=getDocumentElement$1(tt);function ot(){clearTimeout(rt),nt&&nt.disconnect(),nt=null}function at(st,lt){st===void 0&&(st=!1),lt===void 0&&(lt=1),ot();const{left:ct,top:ut,width:ht,height:dt}=tt.getBoundingClientRect();if(st||et(),!ht||!dt)return;const pt=floor(ut),mt=floor(it.clientWidth-(ct+ht)),gt=floor(it.clientHeight-(ut+dt)),yt=floor(ct),wt={rootMargin:-pt+"px "+-mt+"px "+-gt+"px "+-yt+"px",threshold:max$5(0,min$4(1,lt))||1};let xt=!0;function kt(St){const Tt=St[0].intersectionRatio;if(Tt!==lt){if(!xt)return at();Tt?at(!1,Tt):rt=setTimeout(()=>{at(!1,1e-7)},100)}xt=!1}try{nt=new IntersectionObserver(kt,{...wt,root:it.ownerDocument})}catch{nt=new IntersectionObserver(kt,wt)}nt.observe(tt)}return at(!0),ot}function autoUpdate(tt,et,nt,rt){rt===void 0&&(rt={});const{ancestorScroll:it=!0,ancestorResize:ot=!0,elementResize:at=typeof ResizeObserver=="function",layoutShift:st=typeof IntersectionObserver=="function",animationFrame:lt=!1}=rt,ct=unwrapElement(tt),ut=it||ot?[...ct?getOverflowAncestors(ct):[],...getOverflowAncestors(et)]:[];ut.forEach(bt=>{it&&bt.addEventListener("scroll",nt,{passive:!0}),ot&&bt.addEventListener("resize",nt)});const ht=ct&&st?observeMove(ct,nt):null;let dt=-1,pt=null;at&&(pt=new ResizeObserver(bt=>{let[wt]=bt;wt&&wt.target===ct&&pt&&(pt.unobserve(et),cancelAnimationFrame(dt),dt=requestAnimationFrame(()=>{pt&&pt.observe(et)})),nt()}),ct&&!lt&&pt.observe(ct),pt.observe(et));let mt,gt=lt?getBoundingClientRect$1(tt):null;lt&&yt();function yt(){const bt=getBoundingClientRect$1(tt);gt&&(bt.x!==gt.x||bt.y!==gt.y||bt.width!==gt.width||bt.height!==gt.height)&&nt(),gt=bt,mt=requestAnimationFrame(yt)}return nt(),()=>{ut.forEach(bt=>{it&&bt.removeEventListener("scroll",nt),ot&&bt.removeEventListener("resize",nt)}),ht&&ht(),pt&&pt.disconnect(),pt=null,lt&&cancelAnimationFrame(mt)}}const computePosition=(tt,et,nt)=>{const rt=new Map,it={platform,...nt},ot={...it.platform,_c:rt};return computePosition$1(tt,et,{...it,platform:ot})},arrow$2=tt=>{function et(nt){return{}.hasOwnProperty.call(nt,"current")}return{name:"arrow",options:tt,fn(nt){const{element:rt,padding:it}=typeof tt=="function"?tt(nt):tt;return rt&&et(rt)?rt.current!=null?arrow$3({element:rt.current,padding:it}).fn(nt):{}:rt?arrow$3({element:rt,padding:it}).fn(nt):{}}}};var index$2=typeof document<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function deepEqual$3(tt,et){if(tt===et)return!0;if(typeof tt!=typeof et)return!1;if(typeof tt=="function"&&tt.toString()===et.toString())return!0;let nt,rt,it;if(tt&&et&&typeof tt=="object"){if(Array.isArray(tt)){if(nt=tt.length,nt!=et.length)return!1;for(rt=nt;rt--!==0;)if(!deepEqual$3(tt[rt],et[rt]))return!1;return!0}if(it=Object.keys(tt),nt=it.length,nt!==Object.keys(et).length)return!1;for(rt=nt;rt--!==0;)if(!{}.hasOwnProperty.call(et,it[rt]))return!1;for(rt=nt;rt--!==0;){const ot=it[rt];if(!(ot==="_owner"&&tt.$$typeof)&&!deepEqual$3(tt[ot],et[ot]))return!1}return!0}return tt!==tt&&et!==et}function getDPR(tt){return typeof window>"u"?1:(tt.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(tt,et){const nt=getDPR(tt);return Math.round(et*nt)/nt}function useLatestRef(tt){const et=reactExports.useRef(tt);return index$2(()=>{et.current=tt}),et}function useFloating(tt){tt===void 0&&(tt={});const{placement:et="bottom",strategy:nt="absolute",middleware:rt=[],platform:it,elements:{reference:ot,floating:at}={},transform:st=!0,whileElementsMounted:lt,open:ct}=tt,[ut,ht]=reactExports.useState({x:0,y:0,strategy:nt,placement:et,middlewareData:{},isPositioned:!1}),[dt,pt]=reactExports.useState(rt);deepEqual$3(dt,rt)||pt(rt);const[mt,gt]=reactExports.useState(null),[yt,bt]=reactExports.useState(null),wt=reactExports.useCallback(Ot=>{Ot!=Tt.current&&(Tt.current=Ot,gt(Ot))},[gt]),xt=reactExports.useCallback(Ot=>{Ot!==At.current&&(At.current=Ot,bt(Ot))},[bt]),kt=ot||mt,St=at||yt,Tt=reactExports.useRef(null),At=reactExports.useRef(null),Et=reactExports.useRef(ut),Ct=useLatestRef(lt),Lt=useLatestRef(it),jt=reactExports.useCallback(()=>{if(!Tt.current||!At.current)return;const Ot={placement:et,strategy:nt,middleware:dt};Lt.current&&(Ot.platform=Lt.current),computePosition(Tt.current,At.current,Ot).then(Wt=>{const zt={...Wt,isPositioned:!0};Rt.current&&!deepEqual$3(Et.current,zt)&&(Et.current=zt,reactDomExports.flushSync(()=>{ht(zt)}))})},[dt,et,nt,Lt]);index$2(()=>{ct===!1&&Et.current.isPositioned&&(Et.current.isPositioned=!1,ht(Ot=>({...Ot,isPositioned:!1})))},[ct]);const Rt=reactExports.useRef(!1);index$2(()=>(Rt.current=!0,()=>{Rt.current=!1}),[]),index$2(()=>{if(kt&&(Tt.current=kt),St&&(At.current=St),kt&&St){if(Ct.current)return Ct.current(kt,St,jt);jt()}},[kt,St,jt,Ct]);const $t=reactExports.useMemo(()=>({reference:Tt,floating:At,setReference:wt,setFloating:xt}),[wt,xt]),vt=reactExports.useMemo(()=>({reference:kt,floating:St}),[kt,St]),It=reactExports.useMemo(()=>{const Ot={position:nt,left:0,top:0};if(!vt.floating)return Ot;const Wt=roundByDPR(vt.floating,ut.x),zt=roundByDPR(vt.floating,ut.y);return st?{...Ot,transform:"translate("+Wt+"px, "+zt+"px)",...getDPR(vt.floating)>=1.5&&{willChange:"transform"}}:{position:nt,left:Wt,top:zt}},[nt,st,vt.floating,ut.x,ut.y]);return reactExports.useMemo(()=>({...ut,update:jt,refs:$t,elements:vt,floatingStyles:It}),[ut,jt,$t,vt,It])}const $7e8f5cd07187803e$export$21b07c8f274aebd5=reactExports.forwardRef((tt,et)=>{const{children:nt,width:rt=10,height:it=5,...ot}=tt;return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg,_extends$u({},ot,{ref:et,width:rt,height:it,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),tt.asChild?nt:reactExports.createElement("polygon",{points:"0,0 30,0 15,10"}))}),$7e8f5cd07187803e$export$be92b6f5f03c0fe9=$7e8f5cd07187803e$export$21b07c8f274aebd5;function $db6c3485150b8e66$export$1ab7ae714698c4b8(tt){const[et,nt]=reactExports.useState(void 0);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(tt){nt({width:tt.offsetWidth,height:tt.offsetHeight});const rt=new ResizeObserver(it=>{if(!Array.isArray(it)||!it.length)return;const ot=it[0];let at,st;if("borderBoxSize"in ot){const lt=ot.borderBoxSize,ct=Array.isArray(lt)?lt[0]:lt;at=ct.inlineSize,st=ct.blockSize}else at=tt.offsetWidth,st=tt.offsetHeight;nt({width:at,height:st})});return rt.observe(tt,{box:"border-box"}),()=>rt.unobserve(tt)}else nt(void 0)},[tt]),et}const $cf1ac5d9fe0e8206$var$POPPER_NAME="Popper",[$cf1ac5d9fe0e8206$var$createPopperContext,$cf1ac5d9fe0e8206$export$722aac194ae923]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME),[$cf1ac5d9fe0e8206$var$PopperProvider,$cf1ac5d9fe0e8206$var$usePopperContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME),$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9=tt=>{const{__scopePopper:et,children:nt}=tt,[rt,it]=reactExports.useState(null);return reactExports.createElement($cf1ac5d9fe0e8206$var$PopperProvider,{scope:et,anchor:rt,onAnchorChange:it},nt)},$cf1ac5d9fe0e8206$var$ANCHOR_NAME="PopperAnchor",$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d=reactExports.forwardRef((tt,et)=>{const{__scopePopper:nt,virtualRef:rt,...it}=tt,ot=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME,nt),at=reactExports.useRef(null),st=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,at);return reactExports.useEffect(()=>{ot.onAnchorChange((rt==null?void 0:rt.current)||at.current)}),rt?null:reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},it,{ref:st}))}),$cf1ac5d9fe0e8206$var$CONTENT_NAME="PopperContent",[$cf1ac5d9fe0e8206$var$PopperContentProvider,$cf1ac5d9fe0e8206$var$useContentContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME),$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc=reactExports.forwardRef((tt,et)=>{var nt,rt,it,ot,at,st,lt,ct;const{__scopePopper:ut,side:ht="bottom",sideOffset:dt=0,align:pt="center",alignOffset:mt=0,arrowPadding:gt=0,avoidCollisions:yt=!0,collisionBoundary:bt=[],collisionPadding:wt=0,sticky:xt="partial",hideWhenDetached:kt=!1,updatePositionStrategy:St="optimized",onPlaced:Tt,...At}=tt,Et=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME,ut),[Ct,Lt]=reactExports.useState(null),jt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,$n=>Lt($n)),[Rt,$t]=reactExports.useState(null),vt=$db6c3485150b8e66$export$1ab7ae714698c4b8(Rt),It=(nt=vt==null?void 0:vt.width)!==null&&nt!==void 0?nt:0,Ot=(rt=vt==null?void 0:vt.height)!==null&&rt!==void 0?rt:0,Wt=ht+(pt!=="center"?"-"+pt:""),zt=typeof wt=="number"?wt:{top:0,right:0,bottom:0,left:0,...wt},Ft=Array.isArray(bt)?bt:[bt],Nt=Ft.length>0,Ut={padding:zt,boundary:Ft.filter($cf1ac5d9fe0e8206$var$isNotNull),altBoundary:Nt},{refs:Pt,floatingStyles:Ht,placement:Qt,isPositioned:an,middlewareData:Yt}=useFloating({strategy:"fixed",placement:Wt,whileElementsMounted:(...$n)=>autoUpdate(...$n,{animationFrame:St==="always"}),elements:{reference:Et.anchor},middleware:[offset$3({mainAxis:dt+Ot,alignmentAxis:mt}),yt&&shift({mainAxis:!0,crossAxis:!1,limiter:xt==="partial"?limitShift():void 0,...Ut}),yt&&flip$2({...Ut}),size({...Ut,apply:({elements:$n,rects:Nn,availableWidth:En,availableHeight:sn})=>{const{width:pn,height:Tn}=Nn.reference,In=$n.floating.style;In.setProperty("--radix-popper-available-width",`${En}px`),In.setProperty("--radix-popper-available-height",`${sn}px`),In.setProperty("--radix-popper-anchor-width",`${pn}px`),In.setProperty("--radix-popper-anchor-height",`${Tn}px`)}}),Rt&&arrow$2({element:Rt,padding:gt}),$cf1ac5d9fe0e8206$var$transformOrigin({arrowWidth:It,arrowHeight:Ot}),kt&&hide$2({strategy:"referenceHidden",...Ut})]}),[nn,tn]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(Qt),dn=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Tt);$9f79659886946c16$export$e5c5a5f917a5871c(()=>{an&&(dn==null||dn())},[an,dn]);const wn=(it=Yt.arrow)===null||it===void 0?void 0:it.x,rn=(ot=Yt.arrow)===null||ot===void 0?void 0:ot.y,Jt=((at=Yt.arrow)===null||at===void 0?void 0:at.centerOffset)!==0,[vn,Cn]=reactExports.useState();return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{Ct&&Cn(window.getComputedStyle(Ct).zIndex)},[Ct]),reactExports.createElement("div",{ref:Pt.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ht,transform:an?Ht.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:vn,"--radix-popper-transform-origin":[(st=Yt.transformOrigin)===null||st===void 0?void 0:st.x,(lt=Yt.transformOrigin)===null||lt===void 0?void 0:lt.y].join(" ")},dir:tt.dir},reactExports.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider,{scope:ut,placedSide:nn,onArrowChange:$t,arrowX:wn,arrowY:rn,shouldHideArrow:Jt},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({"data-side":nn,"data-align":tn},At,{ref:jt,style:{...At.style,animation:an?void 0:"none",opacity:(ct=Yt.hide)!==null&&ct!==void 0&&ct.referenceHidden?0:void 0}}))))}),$cf1ac5d9fe0e8206$var$ARROW_NAME="PopperArrow",$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0=reactExports.forwardRef(function(et,nt){const{__scopePopper:rt,...it}=et,ot=$cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME,rt),at=$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[ot.placedSide];return reactExports.createElement("span",{ref:ot.onArrowChange,style:{position:"absolute",left:ot.arrowX,top:ot.arrowY,[at]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[ot.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[ot.placedSide],visibility:ot.shouldHideArrow?"hidden":void 0}},reactExports.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9,_extends$u({},it,{ref:nt,style:{...it.style,display:"block"}})))});function $cf1ac5d9fe0e8206$var$isNotNull(tt){return tt!==null}const $cf1ac5d9fe0e8206$var$transformOrigin=tt=>({name:"transformOrigin",options:tt,fn(et){var nt,rt,it,ot,at;const{placement:st,rects:lt,middlewareData:ct}=et,ht=((nt=ct.arrow)===null||nt===void 0?void 0:nt.centerOffset)!==0,dt=ht?0:tt.arrowWidth,pt=ht?0:tt.arrowHeight,[mt,gt]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(st),yt={start:"0%",center:"50%",end:"100%"}[gt],bt=((rt=(it=ct.arrow)===null||it===void 0?void 0:it.x)!==null&&rt!==void 0?rt:0)+dt/2,wt=((ot=(at=ct.arrow)===null||at===void 0?void 0:at.y)!==null&&ot!==void 0?ot:0)+pt/2;let xt="",kt="";return mt==="bottom"?(xt=ht?yt:`${bt}px`,kt=`${-pt}px`):mt==="top"?(xt=ht?yt:`${bt}px`,kt=`${lt.floating.height+pt}px`):mt==="right"?(xt=`${-pt}px`,kt=ht?yt:`${wt}px`):mt==="left"&&(xt=`${lt.floating.width+pt}px`,kt=ht?yt:`${wt}px`),{data:{x:xt,y:kt}}}});function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(tt){const[et,nt="center"]=tt.split("-");return[et,nt]}const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9=$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9,$cf1ac5d9fe0e8206$export$b688253958b8dfe7=$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d,$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2=$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc,$cf1ac5d9fe0e8206$export$21b07c8f274aebd5=$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;function $fe963b355347cc68$export$3e6543de14f8614f(tt,et){return reactExports.useReducer((nt,rt)=>{const it=et[nt][rt];return it??nt},tt)}const $921a889cee6df7e8$export$99c2b779aa4e8b8b=tt=>{const{present:et,children:nt}=tt,rt=$921a889cee6df7e8$var$usePresence(et),it=typeof nt=="function"?nt({present:rt.isPresent}):reactExports.Children.only(nt),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(rt.ref,it.ref);return typeof nt=="function"||rt.isPresent?reactExports.cloneElement(it,{ref:ot}):null};$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName="Presence";function $921a889cee6df7e8$var$usePresence(tt){const[et,nt]=reactExports.useState(),rt=reactExports.useRef({}),it=reactExports.useRef(tt),ot=reactExports.useRef("none"),at=tt?"mounted":"unmounted",[st,lt]=$fe963b355347cc68$export$3e6543de14f8614f(at,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const ct=$921a889cee6df7e8$var$getAnimationName(rt.current);ot.current=st==="mounted"?ct:"none"},[st]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const ct=rt.current,ut=it.current;if(ut!==tt){const dt=ot.current,pt=$921a889cee6df7e8$var$getAnimationName(ct);tt?lt("MOUNT"):pt==="none"||(ct==null?void 0:ct.display)==="none"?lt("UNMOUNT"):lt(ut&&dt!==pt?"ANIMATION_OUT":"UNMOUNT"),it.current=tt}},[tt,lt]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(et){const ct=ht=>{const pt=$921a889cee6df7e8$var$getAnimationName(rt.current).includes(ht.animationName);ht.target===et&&pt&&reactDomExports.flushSync(()=>lt("ANIMATION_END"))},ut=ht=>{ht.target===et&&(ot.current=$921a889cee6df7e8$var$getAnimationName(rt.current))};return et.addEventListener("animationstart",ut),et.addEventListener("animationcancel",ct),et.addEventListener("animationend",ct),()=>{et.removeEventListener("animationstart",ut),et.removeEventListener("animationcancel",ct),et.removeEventListener("animationend",ct)}}else lt("ANIMATION_END")},[et,lt]),{isPresent:["mounted","unmountSuspended"].includes(st),ref:reactExports.useCallback(ct=>{ct&&(rt.current=getComputedStyle(ct)),nt(ct)},[])}}function $921a889cee6df7e8$var$getAnimationName(tt){return(tt==null?void 0:tt.animationName)||"none"}function $71cd76cc60e0454e$export$6f32135080cb4c3({prop:tt,defaultProp:et,onChange:nt=()=>{}}){const[rt,it]=$71cd76cc60e0454e$var$useUncontrolledState({defaultProp:et,onChange:nt}),ot=tt!==void 0,at=ot?tt:rt,st=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(nt),lt=reactExports.useCallback(ct=>{if(ot){const ht=typeof ct=="function"?ct(tt):ct;ht!==tt&&st(ht)}else it(ct)},[ot,tt,it,st]);return[at,lt]}function $71cd76cc60e0454e$var$useUncontrolledState({defaultProp:tt,onChange:et}){const nt=reactExports.useState(tt),[rt]=nt,it=reactExports.useRef(rt),ot=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(et);return reactExports.useEffect(()=>{it.current!==rt&&(ot(rt),it.current=rt)},[rt,it,ot]),nt}const $ea1ef594cf570d83$export$439d29a4e110a164=reactExports.forwardRef((tt,et)=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$u({},tt,{ref:et,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...tt.style}}))),$ea1ef594cf570d83$export$be92b6f5f03c0fe9=$ea1ef594cf570d83$export$439d29a4e110a164,[$a093c7e1ec25a057$var$createTooltipContext,$a093c7e1ec25a057$export$1c540a2224f0d865]=$c512c27ab02ef895$export$50c7b4e9d9f19c1("Tooltip",[$cf1ac5d9fe0e8206$export$722aac194ae923]),$a093c7e1ec25a057$var$usePopperScope=$cf1ac5d9fe0e8206$export$722aac194ae923(),$a093c7e1ec25a057$var$PROVIDER_NAME="TooltipProvider",$a093c7e1ec25a057$var$TOOLTIP_OPEN="tooltip.open",[$a093c7e1ec25a057$var$TooltipProviderContextProvider,$a093c7e1ec25a057$var$useTooltipProviderContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PROVIDER_NAME),$a093c7e1ec25a057$var$TOOLTIP_NAME="Tooltip",[$a093c7e1ec25a057$var$TooltipContextProvider,$a093c7e1ec25a057$var$useTooltipContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME),$a093c7e1ec25a057$export$28c660c63b792dea=tt=>{const{__scopeTooltip:et,children:nt,open:rt,defaultOpen:it=!1,onOpenChange:ot,disableHoverableContent:at,delayDuration:st}=tt,lt=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TOOLTIP_NAME,tt.__scopeTooltip),ct=$a093c7e1ec25a057$var$usePopperScope(et),[ut,ht]=reactExports.useState(null),dt=$1746a345f3d73bb7$export$f680877a34711e37(),pt=reactExports.useRef(0),mt=at??lt.disableHoverableContent,gt=st??lt.delayDuration,yt=reactExports.useRef(!1),[bt=!1,wt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:rt,defaultProp:it,onChange:At=>{At?(lt.onOpen(),document.dispatchEvent(new CustomEvent($a093c7e1ec25a057$var$TOOLTIP_OPEN))):lt.onClose(),ot==null||ot(At)}}),xt=reactExports.useMemo(()=>bt?yt.current?"delayed-open":"instant-open":"closed",[bt]),kt=reactExports.useCallback(()=>{window.clearTimeout(pt.current),yt.current=!1,wt(!0)},[wt]),St=reactExports.useCallback(()=>{window.clearTimeout(pt.current),wt(!1)},[wt]),Tt=reactExports.useCallback(()=>{window.clearTimeout(pt.current),pt.current=window.setTimeout(()=>{yt.current=!0,wt(!0)},gt)},[gt,wt]);return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),reactExports.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9,ct,reactExports.createElement($a093c7e1ec25a057$var$TooltipContextProvider,{scope:et,contentId:dt,open:bt,stateAttribute:xt,trigger:ut,onTriggerChange:ht,onTriggerEnter:reactExports.useCallback(()=>{lt.isOpenDelayed?Tt():kt()},[lt.isOpenDelayed,Tt,kt]),onTriggerLeave:reactExports.useCallback(()=>{mt?St():window.clearTimeout(pt.current)},[St,mt]),onOpen:kt,onClose:St,disableHoverableContent:mt},nt))},$a093c7e1ec25a057$var$TRIGGER_NAME="TooltipTrigger",$a093c7e1ec25a057$export$8c610744efcf8a1d=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...rt}=tt,it=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),ot=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),at=$a093c7e1ec25a057$var$usePopperScope(nt),st=reactExports.useRef(null),lt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,st,it.onTriggerChange),ct=reactExports.useRef(!1),ut=reactExports.useRef(!1),ht=reactExports.useCallback(()=>ct.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",ht),[ht]),reactExports.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7,_extends$u({asChild:!0},at),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$u({"aria-describedby":it.open?it.contentId:void 0,"data-state":it.stateAttribute},rt,{ref:lt,onPointerMove:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerMove,dt=>{dt.pointerType!=="touch"&&!ut.current&&!ot.isPointerInTransitRef.current&&(it.onTriggerEnter(),ut.current=!0)}),onPointerLeave:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerLeave,()=>{it.onTriggerLeave(),ut.current=!1}),onPointerDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDown,()=>{ct.current=!0,document.addEventListener("pointerup",ht,{once:!0})}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocus,()=>{ct.current||it.onOpen()}),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlur,it.onClose),onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onClick,it.onClose)})))}),$a093c7e1ec25a057$var$PORTAL_NAME="TooltipPortal",[$a093c7e1ec25a057$var$PortalProvider,$a093c7e1ec25a057$var$usePortalContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME,{forceMount:void 0}),$a093c7e1ec25a057$var$CONTENT_NAME="TooltipContent",$a093c7e1ec25a057$export$e9003e2be37ec060=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),{forceMount:rt=nt.forceMount,side:it="top",...ot}=tt,at=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:rt||at.open},at.disableHoverableContent?reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$u({side:it},ot,{ref:et})):reactExports.createElement($a093c7e1ec25a057$var$TooltipContentHoverable,_extends$u({side:it},ot,{ref:et})))}),$a093c7e1ec25a057$var$TooltipContentHoverable=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),rt=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),it=reactExports.useRef(null),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,it),[at,st]=reactExports.useState(null),{trigger:lt,onClose:ct}=nt,ut=it.current,{onPointerInTransitChange:ht}=rt,dt=reactExports.useCallback(()=>{st(null),ht(!1)},[ht]),pt=reactExports.useCallback((mt,gt)=>{const yt=mt.currentTarget,bt={x:mt.clientX,y:mt.clientY},wt=$a093c7e1ec25a057$var$getExitSideFromRect(bt,yt.getBoundingClientRect()),xt=$a093c7e1ec25a057$var$getPaddedExitPoints(bt,wt),kt=$a093c7e1ec25a057$var$getPointsFromRect(gt.getBoundingClientRect()),St=$a093c7e1ec25a057$var$getHull([...xt,...kt]);st(St),ht(!0)},[ht]);return reactExports.useEffect(()=>()=>dt(),[dt]),reactExports.useEffect(()=>{if(lt&&ut){const mt=yt=>pt(yt,ut),gt=yt=>pt(yt,lt);return lt.addEventListener("pointerleave",mt),ut.addEventListener("pointerleave",gt),()=>{lt.removeEventListener("pointerleave",mt),ut.removeEventListener("pointerleave",gt)}}},[lt,ut,pt,dt]),reactExports.useEffect(()=>{if(at){const mt=gt=>{const yt=gt.target,bt={x:gt.clientX,y:gt.clientY},wt=(lt==null?void 0:lt.contains(yt))||(ut==null?void 0:ut.contains(yt)),xt=!$a093c7e1ec25a057$var$isPointInPolygon(bt,at);wt?dt():xt&&(dt(),ct())};return document.addEventListener("pointermove",mt),()=>document.removeEventListener("pointermove",mt)}},[lt,ut,at,ct,dt]),reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$u({},tt,{ref:ot}))}),[$a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,$a093c7e1ec25a057$var$useVisuallyHiddenContentContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME,{isInside:!1}),$a093c7e1ec25a057$var$TooltipContentImpl=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,children:rt,"aria-label":it,onEscapeKeyDown:ot,onPointerDownOutside:at,...st}=tt,lt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,nt),ct=$a093c7e1ec25a057$var$usePopperScope(nt),{onClose:ut}=lt;return reactExports.useEffect(()=>(document.addEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut),()=>document.removeEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut)),[ut]),reactExports.useEffect(()=>{if(lt.trigger){const ht=dt=>{const pt=dt.target;pt!=null&&pt.contains(lt.trigger)&&ut()};return window.addEventListener("scroll",ht,{capture:!0}),()=>window.removeEventListener("scroll",ht,{capture:!0})}},[lt.trigger,ut]),reactExports.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:ot,onPointerDownOutside:at,onFocusOutside:ht=>ht.preventDefault(),onDismiss:ut},reactExports.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2,_extends$u({"data-state":lt.stateAttribute},ct,st,{ref:et,style:{...st.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),reactExports.createElement($5e63c961fc1ce211$export$d9f1ccf0bdb05d45,null,rt),reactExports.createElement($a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,{scope:nt,isInside:!0},reactExports.createElement($ea1ef594cf570d83$export$be92b6f5f03c0fe9,{id:lt.contentId,role:"tooltip"},it||rt))))}),$a093c7e1ec25a057$var$ARROW_NAME="TooltipArrow",$a093c7e1ec25a057$export$c27ee0ad710f7559=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...rt}=tt,it=$a093c7e1ec25a057$var$usePopperScope(nt);return $a093c7e1ec25a057$var$useVisuallyHiddenContentContext($a093c7e1ec25a057$var$ARROW_NAME,nt).isInside?null:reactExports.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5,_extends$u({},it,rt,{ref:et}))});function $a093c7e1ec25a057$var$getExitSideFromRect(tt,et){const nt=Math.abs(et.top-tt.y),rt=Math.abs(et.bottom-tt.y),it=Math.abs(et.right-tt.x),ot=Math.abs(et.left-tt.x);switch(Math.min(nt,rt,it,ot)){case ot:return"left";case it:return"right";case nt:return"top";case rt:return"bottom";default:throw new Error("unreachable")}}function $a093c7e1ec25a057$var$getPaddedExitPoints(tt,et,nt=5){const rt=[];switch(et){case"top":rt.push({x:tt.x-nt,y:tt.y+nt},{x:tt.x+nt,y:tt.y+nt});break;case"bottom":rt.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y-nt});break;case"left":rt.push({x:tt.x+nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y+nt});break;case"right":rt.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x-nt,y:tt.y+nt});break}return rt}function $a093c7e1ec25a057$var$getPointsFromRect(tt){const{top:et,right:nt,bottom:rt,left:it}=tt;return[{x:it,y:et},{x:nt,y:et},{x:nt,y:rt},{x:it,y:rt}]}function $a093c7e1ec25a057$var$isPointInPolygon(tt,et){const{x:nt,y:rt}=tt;let it=!1;for(let ot=0,at=et.length-1;otrt!=ut>rt&&nt<(ct-st)*(rt-lt)/(ut-lt)+st&&(it=!it)}return it}function $a093c7e1ec25a057$var$getHull(tt){const et=tt.slice();return et.sort((nt,rt)=>nt.xrt.x?1:nt.yrt.y?1:0),$a093c7e1ec25a057$var$getHullPresorted(et)}function $a093c7e1ec25a057$var$getHullPresorted(tt){if(tt.length<=1)return tt.slice();const et=[];for(let rt=0;rt=2;){const ot=et[et.length-1],at=et[et.length-2];if((ot.x-at.x)*(it.y-at.y)>=(ot.y-at.y)*(it.x-at.x))et.pop();else break}et.push(it)}et.pop();const nt=[];for(let rt=tt.length-1;rt>=0;rt--){const it=tt[rt];for(;nt.length>=2;){const ot=nt[nt.length-1],at=nt[nt.length-2];if((ot.x-at.x)*(it.y-at.y)>=(ot.y-at.y)*(it.x-at.x))nt.pop();else break}nt.push(it)}return nt.pop(),et.length===1&&nt.length===1&&et[0].x===nt[0].x&&et[0].y===nt[0].y?et:et.concat(nt)}const $a093c7e1ec25a057$export$be92b6f5f03c0fe9=$a093c7e1ec25a057$export$28c660c63b792dea,$a093c7e1ec25a057$export$41fb9f06171c75f4=$a093c7e1ec25a057$export$8c610744efcf8a1d,$a093c7e1ec25a057$export$7c6e2c02157bb7d2=$a093c7e1ec25a057$export$e9003e2be37ec060,$a093c7e1ec25a057$export$21b07c8f274aebd5=$a093c7e1ec25a057$export$c27ee0ad710f7559;function _objectWithoutPropertiesLoose$o(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}function _objectWithoutProperties$l(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$o(tt,et),rt,it;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(it=0;it=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}let LevaErrors;(function(tt){tt[tt.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",tt[tt.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",tt[tt.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",tt[tt.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",tt[tt.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",tt[tt.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",tt[tt.THEME_ERROR=6]="THEME_ERROR",tt[tt.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",tt[tt.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",tt[tt.EMPTY_KEY=9]="EMPTY_KEY"})(LevaErrors||(LevaErrors={}));const ErrorList={[LevaErrors.UNSUPPORTED_INPUT]:(tt,et)=>[`An input with type \`${tt}\` input was found at path \`${et}\` but it's not supported yet.`],[LevaErrors.NO_COMPONENT_FOR_TYPE]:(tt,et)=>[`Type \`${tt}\` found at path \`${et}\` can't be displayed in panel because no component supports it yet.`],[LevaErrors.UNKNOWN_INPUT]:(tt,et)=>[`input at path \`${tt}\` is not recognized.`,et],[LevaErrors.DUPLICATE_KEYS]:(tt,et,nt)=>[`Key \`${tt}\` of path \`${et}\` already exists at path \`${nt}\`. Even nested keys need to be unique. Rename one of the keys.`],[LevaErrors.ALREADY_REGISTERED_TYPE]:tt=>[`Type ${tt} has already been registered. You can't register a component with the same type.`],[LevaErrors.CLIPBOARD_ERROR]:tt=>["Error copying the value",tt],[LevaErrors.THEME_ERROR]:(tt,et)=>[`Error accessing the theme \`${tt}.${et}\` value.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error getting the value at path \`${tt}\`. There is probably an error in your \`render\` function.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error accessing the value at path \`${tt}\``],[LevaErrors.INPUT_TYPE_OVERRIDE]:(tt,et,nt)=>[`Input at path \`${tt}\` already exists with type: \`${et}\`. Its type cannot be overridden with type \`${nt}\`.`],[LevaErrors.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function _log(tt,et,...nt){const[rt,...it]=ErrorList[et](...nt);console[tt]("LEVA: "+rt,...it)}const warn$3=_log.bind(null,"warn"),log$2=_log.bind(null,"log"),_excluded$a$1=["value"],_excluded2$4$1=["schema"],_excluded3$1$1=["value"],Schemas=[],Plugins={};function getValueType(tt){let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$a$1);for(let rt of Schemas){const it=rt(et,nt);if(it)return it}}function register(tt,et){let{schema:nt}=et,rt=_objectWithoutProperties$l(et,_excluded2$4$1);if(tt in Plugins){warn$3(LevaErrors.ALREADY_REGISTERED_TYPE,tt);return}Schemas.push((it,ot)=>nt(it,ot)&&tt),Plugins[tt]=rt}function createInternalPlugin(tt){return tt}function normalize$3$1(tt,et,nt,rt){const{normalize:it}=Plugins[tt];if(it)return it(et,nt,rt);if(typeof et!="object"||!("value"in et))return{value:et};const{value:ot}=et,at=_objectWithoutProperties$l(et,_excluded3$1$1);return{value:ot,settings:at}}function sanitize$4(tt,et,nt,rt,it,ot){const{sanitize:at}=Plugins[tt];return at?at(et,nt,rt,it,ot):et}function format$2$1(tt,et,nt){const{format:rt}=Plugins[tt];return rt?rt(et,nt):et}function _defineProperty$F(tt,et,nt){return et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$E(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);et&&(rt=rt.filter(function(it){return Object.getOwnPropertyDescriptor(tt,it).enumerable})),nt.push.apply(nt,rt)}return nt}function _objectSpread2$1(tt){for(var et=1;ettt>nt?nt:tt{if(tt===""||typeof tt=="number")return tt;try{const et=evaluate(tt);if(!isNaN(et))return et}catch{}return parseFloat(tt)},log10=Math.log(10);function getStep(tt){let et=Math.abs(+String(tt).replace(".",""));if(et===0)return .01;for(;et!==0&&et%10===0;)et/=10;const nt=Math.floor(Math.log(et)/log10)+1,rt=Math.floor(Math.log10(Math.abs(tt))),it=Math.pow(10,rt-nt);return Math.max(it,.001)}const range$8=(tt,et,nt)=>nt===et?0:(clamp$7(tt,et,nt)-et)/(nt-et),invertedRange=(tt,et,nt)=>tt*(nt-et)+et,getUid=()=>"_"+Math.random().toString(36).substr(2,9),parens=/\(([0-9+\-*/^ .]+)\)/,exp$1=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,mul=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,div=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,add$5=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,sub=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function evaluate(tt){if(isNaN(Number(tt)))if(parens.test(tt)){const et=tt.replace(parens,(nt,rt)=>String(evaluate(rt)));return evaluate(et)}else if(exp$1.test(tt)){const et=tt.replace(exp$1,(nt,rt,it)=>String(Math.pow(Number(rt),Number(it))));return evaluate(et)}else if(mul.test(tt)){const et=tt.replace(mul,(nt,rt,it)=>String(Number(rt)*Number(it)));return evaluate(et)}else if(div.test(tt)){const et=tt.replace(div,(nt,rt,it)=>{if(it!=0)return String(Number(rt)/Number(it));throw new Error("Division by zero")});return evaluate(et)}else if(add$5.test(tt)){const et=tt.replace(add$5,(nt,rt,it)=>String(Number(rt)+Number(it)));return evaluate(et)}else if(sub.test(tt)){const et=tt.replace(sub,(nt,rt,it)=>String(Number(rt)-Number(it)));return evaluate(et)}else return Number(tt);return Number(tt)}function pick$1(tt,et){return et.reduce((nt,rt)=>(tt&&tt.hasOwnProperty(rt)&&(nt[rt]=tt[rt]),nt),{})}function omit$1(tt,et){const nt=_objectSpread2$1({},tt);return et.forEach(rt=>rt in tt&&delete nt[rt]),nt}function mapArrayToKeys(tt,et){return tt.reduce((nt,rt,it)=>Object.assign(nt,{[et[it]]:rt}),{})}function isObject$o(tt){return Object.prototype.toString.call(tt)==="[object Object]"}const isEmptyObject$1=tt=>isObject$o(tt)&&Object.keys(tt).length===0;let SpecialInputs;(function(tt){tt.BUTTON="BUTTON",tt.BUTTON_GROUP="BUTTON_GROUP",tt.MONITOR="MONITOR",tt.FOLDER="FOLDER"})(SpecialInputs||(SpecialInputs={}));let LevaInputs;(function(tt){tt.SELECT="SELECT",tt.IMAGE="IMAGE",tt.NUMBER="NUMBER",tt.COLOR="COLOR",tt.STRING="STRING",tt.BOOLEAN="BOOLEAN",tt.INTERVAL="INTERVAL",tt.VECTOR3D="VECTOR3D",tt.VECTOR2D="VECTOR2D"})(LevaInputs||(LevaInputs={}));const _excluded$9$1=["type","__customInput"],_excluded2$3$1=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],_excluded3$6=["type"];function parseOptions(tt,et,nt={},rt){var it,ot;if(typeof tt!="object"||Array.isArray(tt))return{type:rt,input:tt,options:_objectSpread2$1({key:et,label:et,optional:!1,disabled:!1,order:0},nt)};if("__customInput"in tt){const{type:St,__customInput:Tt}=tt,At=_objectWithoutProperties$l(tt,_excluded$9$1);return parseOptions(Tt,et,At,St)}const{render:at,label:st,optional:lt,order:ct=0,disabled:ut,hint:ht,onChange:dt,onEditStart:pt,onEditEnd:mt,transient:gt}=tt,yt=_objectWithoutProperties$l(tt,_excluded2$3$1),bt=_objectSpread2$1({render:at,key:et,label:st??et,hint:ht,transient:gt??!!dt,onEditStart:pt,onEditEnd:mt,disabled:ut,optional:lt,order:ct},nt);let{type:wt}=yt,xt=_objectWithoutProperties$l(yt,_excluded3$6);if(wt=rt??wt,wt in SpecialInputs)return{type:wt,input:xt,options:bt};let kt;return rt&&isObject$o(xt)&&"value"in xt?kt=xt.value:kt=isEmptyObject$1(xt)?void 0:xt,{type:wt,input:kt,options:_objectSpread2$1(_objectSpread2$1({},bt),{},{onChange:dt,optional:(it=bt.optional)!==null&&it!==void 0?it:!1,disabled:(ot=bt.disabled)!==null&&ot!==void 0?ot:!1})}}function normalizeInput(tt,et,nt,rt){const it=parseOptions(tt,et),{type:ot,input:at,options:st}=it;if(ot)return ot in SpecialInputs?it:{type:ot,input:normalize$3$1(ot,at,nt,rt),options:st};let lt=getValueType(at);return lt?{type:lt,input:normalize$3$1(lt,at,nt,rt),options:st}:(lt=getValueType({value:at}),lt?{type:lt,input:normalize$3$1(lt,{value:at},nt,rt),options:st}:!1)}function updateInput(tt,et,nt,rt,it){const{value:ot,type:at,settings:st}=tt;tt.value=sanitizeValue({type:at,value:ot,settings:st},et,nt,rt),tt.fromPanel=it}const ValueError=function(et,nt,rt){this.type="LEVA_ERROR",this.message="LEVA: "+et,this.previousValue=nt,this.error=rt};function sanitizeValue({type:tt,value:et,settings:nt},rt,it,ot){const at=tt!=="SELECT"&&typeof rt=="function"?rt(et):rt;let st;try{st=sanitize$4(tt,at,nt,et,it,ot)}catch(lt){throw new ValueError(`The value \`${rt}\` did not result in a correct value.`,et,lt)}return dequal(st,et)?et:st}const debounce$6=(tt,et,nt=!1)=>{let rt=0;return function(){const it=arguments,ot=nt&&!rt,at=()=>tt.apply(this,it);window.clearTimeout(rt),rt=window.setTimeout(at,et),ot&&at()}},multiplyStep=tt=>tt.shiftKey?5:tt.altKey?1/5:1;function render(tt,et){const nt=console.error;console.error=()=>{},ReactDOM.render(tt,et),console.error=nt}const _excluded$8$1=["value"],_excluded2$2$1=["min","max"],schema$3=tt=>{if(typeof tt=="number")return!0;if(typeof tt=="string"){const et=parseFloat(tt);return isNaN(et)?!1:tt.substring((""+et).length).trim().length<4}return!1},sanitize$3=(tt,{min:et=-1/0,max:nt=1/0,suffix:rt})=>{const it=parseFloat(tt);if(tt===""||isNaN(it))throw Error("Invalid number");const ot=clamp$7(it,et,nt);return rt?ot+rt:ot},format$1$2=(tt,{pad:et=0,suffix:nt})=>{const rt=parseFloat(tt).toFixed(et);return nt?rt+nt:rt},normalize$2$2=tt=>{let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$8$1);const{min:rt=-1/0,max:it=1/0}=nt,ot=_objectWithoutProperties$l(nt,_excluded2$2$1);let at=parseFloat(et);const st=typeof et=="string"?et.substring((""+at).length):void 0;at=clamp$7(at,rt,it);let lt=nt.step;lt||(Number.isFinite(rt)?Number.isFinite(it)?lt=+(Math.abs(it-rt)/100).toPrecision(1):lt=+(Math.abs(at-rt)/100).toPrecision(1):Number.isFinite(it)&&(lt=+(Math.abs(it-at)/100).toPrecision(1)));const ct=lt?getStep(lt)*10:getStep(at);lt=lt||ct/10;const ut=Math.round(clamp$7(Math.log10(1/ct),0,2));return{value:st?at+st:at,settings:_objectSpread2$1({initialValue:at,step:lt,pad:ut,min:rt,max:it,suffix:st},ot)}},sanitizeStep$1=(tt,{step:et,initialValue:nt})=>{const rt=Math.round((tt-nt)/et);return nt+rt*et};var props$3$1=Object.freeze({__proto__:null,schema:schema$3,sanitize:sanitize$3,format:format$1$2,normalize:normalize$2$2,sanitizeStep:sanitizeStep$1});function _extends$t(){return _extends$t=Object.assign?Object.assign.bind():function(tt){for(var et=1;et({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function createStateClass(tt,et){const[nt,rt]=tt.split(" "),it={};return nt!=="none"&&(it.boxShadow=`${et.inset?"inset ":""}0 0 0 $borderWidths${[et.key]} $colors${nt!=="default"&&nt||et.borderColor}`),rt&&(it.backgroundColor=rt),it}const utils$r={$inputStyle:()=>tt=>createStateClass(tt,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>tt=>createStateClass(tt,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>tt=>createStateClass(tt,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>tt=>createStateClass(tt,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:styled$5,css:css$1,createTheme:createTheme$2,globalCss,keyframes:keyframes$1}=q$7({prefix:"leva",theme:getDefaultTheme(),utils:_objectSpread2$1(_objectSpread2$1({},utils$r),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:tt=>({"&:focus":utils$r.$focusStyle()(tt)}),$focusWithin:tt=>({"&:focus-within":utils$r.$focusStyle()(tt)}),$hover:tt=>({"&:hover":utils$r.$hoverStyle()(tt)}),$active:tt=>({"&:active":utils$r.$activeStyle()(tt)})})}),globalStyles=globalCss({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function mergeTheme(tt){const et=getDefaultTheme();if(!tt)return{theme:et,className:""};Object.keys(tt).forEach(rt=>{Object.assign(et[rt],tt[rt])});const nt=createTheme$2(et);return{theme:et,className:nt.className}}function useTh(tt,et){const{theme:nt}=reactExports.useContext(ThemeContext$3);if(!(tt in nt)||!(et in nt[tt]))return warn$3(LevaErrors.THEME_ERROR,tt,et),"";let rt=et;for(;;){let it=nt[tt][rt];if(typeof it=="string"&&it.charAt(0)==="$")rt=it.substr(1);else return it}}const StyledInput$2=styled$5("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),InnerLabel=styled$5("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${StyledInput$2}`]:{paddingLeft:0}}),InnerNumberLabel=styled$5(InnerLabel,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),InputContainer=styled$5("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),_excluded$7$2=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],_excluded2$1$2=["onUpdate"];function ValueInput(tt){let{innerLabel:et,value:nt,onUpdate:rt,onChange:it,onKeyDown:ot,type:at,id:st,inputType:lt="text",rows:ct=0}=tt,ut=_objectWithoutProperties$l(tt,_excluded$7$2);const{id:ht,emitOnEditStart:dt,emitOnEditEnd:pt,disabled:mt}=useInputContext(),gt=st||ht,yt=reactExports.useRef(null),bt=ct>0,wt=bt?"textarea":"input",xt=reactExports.useCallback(Tt=>At=>{const Et=At.currentTarget.value;Tt(Et)},[]);React$1.useEffect(()=>{const Tt=yt.current,At=xt(Et=>{rt(Et),pt()});return Tt==null||Tt.addEventListener("blur",At),()=>Tt==null?void 0:Tt.removeEventListener("blur",At)},[xt,rt,pt]);const kt=reactExports.useCallback(Tt=>{Tt.key==="Enter"&&xt(rt)(Tt)},[xt,rt]),St=Object.assign({as:wt},bt?{rows:ct}:{},ut);return React$1.createElement(InputContainer,{textArea:bt},et&&typeof et=="string"?React$1.createElement(InnerLabel,null,et):et,React$1.createElement(StyledInput$2,_extends$t({levaType:at,ref:yt,id:gt,type:lt,autoComplete:"off",spellCheck:"false",value:nt,onChange:xt(it),onFocus:()=>dt(),onKeyPress:kt,onKeyDown:ot,disabled:mt},St)))}function NumberInput(tt){let{onUpdate:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded2$1$2);const rt=reactExports.useCallback(ot=>et(parseNumber(ot)),[et]),it=reactExports.useCallback(ot=>{const at=ot.key==="ArrowUp"?1:ot.key==="ArrowDown"?-1:0;if(at){ot.preventDefault();const st=ot.altKey?.1:ot.shiftKey?10:1;et(lt=>parseFloat(lt)+at*st)}},[et]);return React$1.createElement(ValueInput,_extends$t({},nt,{onUpdate:rt,onKeyDown:it,type:"number"}))}const StyledFolder=styled$5("div",{}),StyledWrapper=styled$5("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),StyledTitle=styled$5("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & > svg`]:{opacity:1}}),StyledContent=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${StyledFolder}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),StyledRow=styled$5("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${StyledContent} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),StyledInputRow=styled$5(StyledRow,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),CopyLabelContainer=styled$5("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),StyledOptionalToggle=styled$5("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),StyledLabel=styled$5("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),StyledInputWrapper$1=styled$5("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${StyledLabel}`]:{pointerEvents:"auto"}}}}}),Overlay$1=styled$5("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),StyledToolTipContent=styled$5("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),ToolTipArrow=styled$5($a093c7e1ec25a057$export$21b07c8f274aebd5,{fill:"$toolTipBackground"});function Portal$1({children:tt}){const{className:et}=reactExports.useContext(ThemeContext$3);return React$1.createElement($f1701beae083dbae$export$be92b6f5f03c0fe9,{className:et},tt)}const _excluded$6$2=["align"];function OptionalToggle(){const{id:tt,disable:et,disabled:nt}=useInputContext();return React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledOptionalToggle,{id:tt+"__disable",type:"checkbox",checked:!nt,onChange:()=>et(!nt)}),React$1.createElement("label",{htmlFor:tt+"__disable"}))}function RawLabel(tt){const{id:et,optional:nt,hint:rt}=useInputContext(),it=tt.htmlFor||(et?{htmlFor:et}:null),ot=!rt&&typeof tt.children=="string"?{title:tt.children}:null;return React$1.createElement(React$1.Fragment,null,nt&&React$1.createElement(OptionalToggle,null),rt!==void 0?React$1.createElement($a093c7e1ec25a057$export$be92b6f5f03c0fe9,null,React$1.createElement($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0},React$1.createElement(StyledLabel,_extends$t({},it,tt))),React$1.createElement($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{side:"top",sideOffset:2},React$1.createElement(StyledToolTipContent,null,rt,React$1.createElement(ToolTipArrow,null)))):React$1.createElement(StyledLabel,_extends$t({},it,ot,tt)))}function Label$2(tt){let{align:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$6$2);const{value:rt,label:it,key:ot,disabled:at}=useInputContext(),{hideCopyButton:st}=usePanelSettingsContext(),lt=!st&&ot!==void 0,[ct,ut]=reactExports.useState(!1),ht=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[ot]:rt??""})),ut(!0)}catch{warn$3(LevaErrors.CLIPBOARD_ERROR,{[ot]:rt})}};return React$1.createElement(CopyLabelContainer,{align:et,onPointerLeave:()=>ut(!1)},React$1.createElement(RawLabel,nt),lt&&!at&&React$1.createElement("div",{title:`Click to copy ${typeof it=="string"?it:ot} value`},ct?React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):React$1.createElement("svg",{onClick:ht,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),React$1.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const _excluded$5$2=["toggled"],Svg$1=styled$5("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Chevron(tt){let{toggled:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$5$2);return React$1.createElement(Svg$1,_extends$t({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${et?0:-90}deg)`}},nt),React$1.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const _excluded$4$2=["input"];function Row(tt){let{input:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$4$2);return et?React$1.createElement(StyledInputRow,nt):React$1.createElement(StyledRow,nt)}function useInputSetters({value:tt,type:et,settings:nt,setValue:rt}){const[it,ot]=reactExports.useState(format$2$1(et,tt,nt)),at=reactExports.useRef(tt),st=reactExports.useRef(nt);st.current=nt;const lt=reactExports.useCallback(ut=>ot(format$2$1(et,ut,st.current)),[et]),ct=reactExports.useCallback(ut=>{try{rt(ut)}catch(ht){const{type:dt,previousValue:pt}=ht;if(dt!=="LEVA_ERROR")throw ht;lt(pt)}},[lt,rt]);return reactExports.useEffect(()=>{dequal(tt,at.current)||lt(tt),at.current=tt},[tt,lt]),{displayValue:it,onChange:ot,onUpdate:ct}}function useDrag$1(tt,et){const{emitOnEditStart:nt,emitOnEditEnd:rt}=useInputContext();return useDrag$2(it=>{it.first&&(document.body.classList.add("leva__panel__dragged"),nt==null||nt());const ot=tt(it);return it.last&&(document.body.classList.remove("leva__panel__dragged"),rt==null||rt()),ot},et)}function useCanvas2d(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),rt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const it=debounce$6(()=>{et.current.width=et.current.offsetWidth*window.devicePixelRatio,et.current.height=et.current.offsetHeight*window.devicePixelRatio,tt(et.current,nt.current)},250);return window.addEventListener("resize",it),rt.current||(it(),rt.current=!0),()=>window.removeEventListener("resize",it)},[tt]),reactExports.useEffect(()=>{nt.current=et.current.getContext("2d")},[]),[et,nt]}function useTransform(){const tt=reactExports.useRef(null),et=reactExports.useRef({x:0,y:0}),nt=reactExports.useCallback(rt=>{Object.assign(et.current,rt),tt.current&&(tt.current.style.transform=`translate3d(${et.current.x}px, ${et.current.y}px, 0)`)},[]);return[tt,nt]}const _excluded$3$2=["__refCount"],getInputAtPath=(tt,et)=>{if(!tt[et])return null;const nt=tt[et];return _objectWithoutProperties$l(nt,_excluded$3$2)};function useInput(tt){const et=useStoreContext(),[nt,rt]=reactExports.useState(getInputAtPath(et.getData(),tt)),it=reactExports.useCallback(ct=>et.setValueAtPath(tt,ct,!0),[tt,et]),ot=reactExports.useCallback(ct=>et.setSettingsAtPath(tt,ct),[tt,et]),at=reactExports.useCallback(ct=>et.disableInputAtPath(tt,ct),[tt,et]),st=reactExports.useCallback(()=>et.emitOnEditStart(tt),[tt,et]),lt=reactExports.useCallback(()=>et.emitOnEditEnd(tt),[tt,et]);return reactExports.useEffect(()=>{rt(getInputAtPath(et.getData(),tt));const ct=et.useStore.subscribe(ut=>getInputAtPath(ut.data,tt),rt,{equalityFn:shallow$2});return()=>ct()},[et,tt]),[nt,{set:it,setSettings:ot,disable:at,storeId:et.storeId,emitOnEditStart:st,emitOnEditEnd:lt}]}const RangeGrid=styled$5("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Range=styled$5("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Scrubber=styled$5("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),RangeWrapper=styled$5("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),Indicator=styled$5("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function RangeSlider({value:tt,min:et,max:nt,onDrag:rt,step:it,initialValue:ot}){const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(0),ct=useTh("sizes","scrubberWidth"),ut=useDrag$1(({event:dt,first:pt,xy:[mt],movement:[gt],memo:yt})=>{if(pt){const{width:wt,left:xt}=at.current.getBoundingClientRect();lt.current=wt-parseFloat(ct),yt=(dt==null?void 0:dt.target)===st.current?tt:invertedRange((mt-xt)/wt,et,nt)}const bt=yt+invertedRange(gt/lt.current,0,nt-et);return rt(sanitizeStep$1(bt,{step:it,initialValue:ot})),yt}),ht=range$8(tt,et,nt);return React$1.createElement(RangeWrapper,_extends$t({ref:at},ut()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:0,right:`${(1-ht)*100}%`}})),React$1.createElement(Scrubber,{ref:st,style:{left:`calc(${ht} * (100% - ${ct}))`}}))}const DraggableLabel=React$1.memo(({label:tt,onUpdate:et,step:nt,innerLabelTrim:rt})=>{const[it,ot]=reactExports.useState(!1),at=useDrag$1(({active:st,delta:[lt],event:ct,memo:ut=0})=>(ot(st),ut+=lt/2,Math.abs(ut)>=1&&(et(ht=>parseFloat(ht)+Math.floor(ut)*nt*multiplyStep(ct)),ut=0),ut));return React$1.createElement(InnerNumberLabel,_extends$t({dragging:it,title:tt.length>1?tt:""},at()),tt.slice(0,rt))});function Number$1({label:tt,id:et,displayValue:nt,onUpdate:rt,onChange:it,settings:ot,innerLabelTrim:at=1}){const st=at>0&&React$1.createElement(DraggableLabel,{label:tt,step:ot.step,onUpdate:rt,innerLabelTrim:at});return React$1.createElement(NumberInput,{id:et,value:String(nt),onUpdate:rt,onChange:it,innerLabel:st})}function NumberComponent(){const tt=useInputContext(),{label:et,value:nt,onUpdate:rt,settings:it,id:ot}=tt,{min:at,max:st}=it,lt=st!==1/0&&at!==-1/0;return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,et),React$1.createElement(RangeGrid,{hasRange:lt},lt&&React$1.createElement(RangeSlider,_extends$t({value:parseFloat(nt),onDrag:rt},it)),React$1.createElement(Number$1,_extends$t({},tt,{id:ot,label:"value",innerLabelTrim:lt?0:1}))))}const{sanitizeStep}=props$3$1,rest=_objectWithoutProperties$l(props$3$1,["sanitizeStep"]);var number$6=_objectSpread2$1({component:NumberComponent},rest);const schema$2$1=(tt,et)=>v8n().schema({options:v8n().passesAnyOf(v8n().object(),v8n().array())}).test(et),sanitize$2$1=(tt,{values:et})=>{if(et.indexOf(tt)<0)throw Error("Selected value doesn't match Select options");return tt},format$3=(tt,{values:et})=>et.indexOf(tt),normalize$1$2=tt=>{let{value:et,options:nt}=tt,rt,it;return Array.isArray(nt)?(it=nt,rt=nt.map(ot=>String(ot))):(it=Object.values(nt),rt=Object.keys(nt)),"value"in tt?it.includes(et)||(rt.unshift(String(et)),it.unshift(et)):et=it[0],Object.values(nt).includes(et)||(nt[String(et)]=et),{value:et,settings:{keys:rt,values:it}}};var props$2$1=Object.freeze({__proto__:null,schema:schema$2$1,sanitize:sanitize$2$1,format:format$3,normalize:normalize$1$2});const SelectContainer=styled$5("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),NativeSelect=styled$5("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),PresentationalSelect=styled$5("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${NativeSelect}:focus + &`]:{$focusStyle:""},[`${NativeSelect}:hover + &`]:{$hoverStyle:""}});function Select$4({displayValue:tt,value:et,onUpdate:nt,id:rt,settings:it,disabled:ot}){const{keys:at,values:st}=it,lt=reactExports.useRef();return et===st[tt]&&(lt.current=at[tt]),React$1.createElement(SelectContainer,null,React$1.createElement(NativeSelect,{id:rt,value:tt,onChange:ct=>nt(st[Number(ct.currentTarget.value)]),disabled:ot},at.map((ct,ut)=>React$1.createElement("option",{key:ct,value:ut},ct))),React$1.createElement(PresentationalSelect,null,lt.current),React$1.createElement(Chevron,{toggled:!0}))}function SelectComponent(){const{label:tt,value:et,displayValue:nt,onUpdate:rt,id:it,disabled:ot,settings:at}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Select$4,{id:it,value:et,displayValue:nt,onUpdate:rt,settings:at,disabled:ot}))}var select$1=_objectSpread2$1({component:SelectComponent},props$2$1);const schema$1$1=tt=>v8n().string().test(tt),sanitize$1$1=tt=>{if(typeof tt!="string")throw Error("Invalid string");return tt},normalize$5=({value:tt,editable:et=!0,rows:nt=!1})=>({value:tt,settings:{editable:et,rows:typeof nt=="number"?nt:nt?5:0}});var props$1$1=Object.freeze({__proto__:null,schema:schema$1$1,sanitize:sanitize$1$1,normalize:normalize$5});const _excluded$2$2=["displayValue","onUpdate","onChange","editable"],NonEditableString=styled$5("div",{whiteSpace:"pre-wrap"});function String$1(tt){let{displayValue:et,onUpdate:nt,onChange:rt,editable:it=!0}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$2);return it?React$1.createElement(ValueInput,_extends$t({value:et,onUpdate:nt,onChange:rt},ot)):React$1.createElement(NonEditableString,null,et)}function StringComponent(){const{label:tt,settings:et,displayValue:nt,onUpdate:rt,onChange:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(String$1,_extends$t({displayValue:nt,onUpdate:rt,onChange:it},et)))}var string$1=_objectSpread2$1({component:StringComponent},props$1$1);const schema$4=tt=>v8n().boolean().test(tt),sanitize$5=tt=>{if(typeof tt!="boolean")throw Error("Invalid boolean");return tt};var props$4=Object.freeze({__proto__:null,schema:schema$4,sanitize:sanitize$5});const StyledInputWrapper=styled$5("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Boolean$1({value:tt,onUpdate:et,id:nt,disabled:rt}){return React$1.createElement(StyledInputWrapper,null,React$1.createElement("input",{id:nt,type:"checkbox",checked:tt,onChange:it=>et(it.currentTarget.checked),disabled:rt}),React$1.createElement("label",{htmlFor:nt},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},React$1.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function BooleanComponent(){const{label:tt,value:et,onUpdate:nt,disabled:rt,id:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Boolean$1,{value:et,onUpdate:nt,id:it,disabled:rt}))}var boolean=_objectSpread2$1({component:BooleanComponent},props$4);const _excluded$1$4=["locked"];function Coordinate({value:tt,id:et,valueKey:nt,settings:rt,onUpdate:it,innerLabelTrim:ot}){const at=reactExports.useRef(tt[nt]);at.current=tt[nt];const st=reactExports.useCallback(ct=>it({[nt]:sanitizeValue({type:"NUMBER",value:at.current,settings:rt},ct)}),[it,rt,nt]),lt=useInputSetters({type:"NUMBER",value:tt[nt],settings:rt,setValue:st});return React$1.createElement(Number$1,{id:et,label:nt,value:tt[nt],displayValue:lt.displayValue,onUpdate:lt.onUpdate,onChange:lt.onChange,settings:rt,innerLabelTrim:ot})}const Container$2=styled$5("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function Lock(tt){let{locked:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$4);return React$1.createElement("svg",_extends$t({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nt),et?React$1.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):React$1.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Vector({value:tt,onUpdate:et,settings:nt,innerLabelTrim:rt}){const{id:it,setSettings:ot}=useInputContext(),{lock:at,locked:st}=nt;return React$1.createElement(Container$2,{withLock:at},at&&React$1.createElement(Lock,{locked:st,onClick:()=>ot({locked:!st})}),Object.keys(tt).map((lt,ct)=>React$1.createElement(Coordinate,{id:ct===0?it:`${it}.${lt}`,key:lt,valueKey:lt,value:tt,settings:nt[lt],onUpdate:et,innerLabelTrim:rt})))}const normalizeKeyedNumberSettings=(tt,et)=>{const nt={};let rt=0,it=1/0;Object.entries(tt).forEach(([ot,at])=>{nt[ot]=normalize$2$2(_objectSpread2$1({value:at},et[ot])).settings,rt=Math.max(rt,nt[ot].step),it=Math.min(it,nt[ot].pad)});for(let ot in nt){const{step:at,min:st,max:lt}=et[ot]||{};!isFinite(at)&&(!isFinite(st)||!isFinite(lt))&&(nt[ot].step=rt,nt[ot].pad=it)}return nt},_excluded$1J=["lock"],_excluded2$j=["value"];function getVectorSchema(tt){const et=v8n().array().length(tt).every.number(),nt=rt=>{if(!rt||typeof rt!="object")return!1;const it=Object.values(rt);return it.length===tt&&it.every(ot=>isFinite(ot))};return rt=>et.test(rt)||nt(rt)}function getVectorType(tt){return Array.isArray(tt)?"array":"object"}function convert$6(tt,et,nt){return getVectorType(tt)===et?tt:et==="array"?Object.values(tt):mapArrayToKeys(tt,nt)}const sanitizeVector=(tt,et,nt)=>{const rt=convert$6(tt,"object",et.keys);for(let at in rt)rt[at]=sanitize$3(rt[at],et[at]);const it=Object.keys(rt);let ot={};if(it.length===et.keys.length)ot=rt;else{const at=convert$6(nt,"object",et.keys);if(it.length===1&&et.locked){const st=it[0],lt=rt[st],ct=at[st],ut=ct!==0?lt/ct:1;for(let ht in at)ht===st?ot[st]=lt:ot[ht]=at[ht]*ut}else ot=_objectSpread2$1(_objectSpread2$1({},at),rt)}return convert$6(ot,et.format,et.keys)},formatVector=(tt,et)=>convert$6(tt,"object",et.keys),isNumberSettings=tt=>!!tt&&("step"in tt||"min"in tt||"max"in tt);function normalizeVector(tt,et,nt=[]){const{lock:rt=!1}=et,it=_objectWithoutProperties$l(et,_excluded$1J),ot=Array.isArray(tt)?"array":"object",at=ot==="object"?Object.keys(tt):nt,st=convert$6(tt,"object",at),lt=isNumberSettings(it)?at.reduce((ut,ht)=>Object.assign(ut,{[ht]:it}),{}):it,ct=normalizeKeyedNumberSettings(st,lt);return{value:ot==="array"?tt:st,settings:_objectSpread2$1(_objectSpread2$1({},ct),{},{format:ot,keys:at,lock:rt,locked:!1})}}function getVectorPlugin(tt){return{schema:getVectorSchema(tt.length),normalize:et=>{let{value:nt}=et,rt=_objectWithoutProperties$l(et,_excluded2$j);return normalizeVector(nt,rt,tt)},format:(et,nt)=>formatVector(et,nt),sanitize:(et,nt,rt)=>sanitizeVector(et,nt,rt)}}var r$b={grad:.9,turn:360,rad:360/(2*Math.PI)},t$6=function(tt){return typeof tt=="string"?tt.length>0:typeof tt=="number"},n$6=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt+0},e$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt>et?tt:et},u$5=function(tt){return(tt=isFinite(tt)?tt%360:0)>0?tt:tt+360},a$3=function(tt){return{r:e$5(tt.r,0,255),g:e$5(tt.g,0,255),b:e$5(tt.b,0,255),a:e$5(tt.a)}},o$1=function(tt){return{r:n$6(tt.r),g:n$6(tt.g),b:n$6(tt.b),a:n$6(tt.a,3)}},i$6=/^#([0-9a-f]{3,8})$/i,s$4=function(tt){var et=tt.toString(16);return et.length<2?"0"+et:et},h$9=function(tt){var et=tt.r,nt=tt.g,rt=tt.b,it=tt.a,ot=Math.max(et,nt,rt),at=ot-Math.min(et,nt,rt),st=at?ot===et?(nt-rt)/at:ot===nt?2+(rt-et)/at:4+(et-nt)/at:0;return{h:60*(st<0?st+6:st),s:ot?at/ot*100:0,v:ot/255*100,a:it}},b$6=function(tt){var et=tt.h,nt=tt.s,rt=tt.v,it=tt.a;et=et/360*6,nt/=100,rt/=100;var ot=Math.floor(et),at=rt*(1-nt),st=rt*(1-(et-ot)*nt),lt=rt*(1-(1-et+ot)*nt),ct=ot%6;return{r:255*[rt,st,at,at,lt,rt][ct],g:255*[lt,rt,rt,st,at,at][ct],b:255*[at,at,lt,rt,rt,st][ct],a:it}},g$8=function(tt){return{h:u$5(tt.h),s:e$5(tt.s,0,100),l:e$5(tt.l,0,100),a:e$5(tt.a)}},d$5=function(tt){return{h:n$6(tt.h),s:n$6(tt.s),l:n$6(tt.l),a:n$6(tt.a,3)}},f$7=function(tt){return b$6((nt=(et=tt).s,{h:et.h,s:(nt*=((rt=et.l)<50?rt:100-rt)/100)>0?2*nt/(rt+nt)*100:0,v:rt+nt,a:et.a}));var et,nt,rt},c$7=function(tt){return{h:(et=h$9(tt)).h,s:(it=(200-(nt=et.s))*(rt=et.v)/100)>0&&it<200?nt*rt/100/(it<=100?it:200-it)*100:0,l:it/2,a:et.a};var et,nt,rt,it},l$5=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p$7=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v$7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m$7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y$7={string:[[function(tt){var et=i$6.exec(tt);return et?(tt=et[1]).length<=4?{r:parseInt(tt[0]+tt[0],16),g:parseInt(tt[1]+tt[1],16),b:parseInt(tt[2]+tt[2],16),a:tt.length===4?n$6(parseInt(tt[3]+tt[3],16)/255,2):1}:tt.length===6||tt.length===8?{r:parseInt(tt.substr(0,2),16),g:parseInt(tt.substr(2,2),16),b:parseInt(tt.substr(4,2),16),a:tt.length===8?n$6(parseInt(tt.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(tt){var et=v$7.exec(tt)||m$7.exec(tt);return et?et[2]!==et[4]||et[4]!==et[6]?null:a$3({r:Number(et[1])/(et[2]?100/255:1),g:Number(et[3])/(et[4]?100/255:1),b:Number(et[5])/(et[6]?100/255:1),a:et[7]===void 0?1:Number(et[7])/(et[8]?100:1)}):null},"rgb"],[function(tt){var et=l$5.exec(tt)||p$7.exec(tt);if(!et)return null;var nt,rt,it=g$8({h:(nt=et[1],rt=et[2],rt===void 0&&(rt="deg"),Number(nt)*(r$b[rt]||1)),s:Number(et[3]),l:Number(et[4]),a:et[5]===void 0?1:Number(et[5])/(et[6]?100:1)});return f$7(it)},"hsl"]],object:[[function(tt){var et=tt.r,nt=tt.g,rt=tt.b,it=tt.a,ot=it===void 0?1:it;return t$6(et)&&t$6(nt)&&t$6(rt)?a$3({r:Number(et),g:Number(nt),b:Number(rt),a:Number(ot)}):null},"rgb"],[function(tt){var et=tt.h,nt=tt.s,rt=tt.l,it=tt.a,ot=it===void 0?1:it;if(!t$6(et)||!t$6(nt)||!t$6(rt))return null;var at=g$8({h:Number(et),s:Number(nt),l:Number(rt),a:Number(ot)});return f$7(at)},"hsl"],[function(tt){var et=tt.h,nt=tt.s,rt=tt.v,it=tt.a,ot=it===void 0?1:it;if(!t$6(et)||!t$6(nt)||!t$6(rt))return null;var at=function(st){return{h:u$5(st.h),s:e$5(st.s,0,100),v:e$5(st.v,0,100),a:e$5(st.a)}}({h:Number(et),s:Number(nt),v:Number(rt),a:Number(ot)});return b$6(at)},"hsv"]]},N$1=function(tt,et){for(var nt=0;nt=.5},tt.prototype.toHex=function(){return et=o$1(this.rgba),nt=et.r,rt=et.g,it=et.b,at=(ot=et.a)<1?s$4(n$6(255*ot)):"","#"+s$4(nt)+s$4(rt)+s$4(it)+at;var et,nt,rt,it,ot,at},tt.prototype.toRgb=function(){return o$1(this.rgba)},tt.prototype.toRgbString=function(){return et=o$1(this.rgba),nt=et.r,rt=et.g,it=et.b,(ot=et.a)<1?"rgba("+nt+", "+rt+", "+it+", "+ot+")":"rgb("+nt+", "+rt+", "+it+")";var et,nt,rt,it,ot},tt.prototype.toHsl=function(){return d$5(c$7(this.rgba))},tt.prototype.toHslString=function(){return et=d$5(c$7(this.rgba)),nt=et.h,rt=et.s,it=et.l,(ot=et.a)<1?"hsla("+nt+", "+rt+"%, "+it+"%, "+ot+")":"hsl("+nt+", "+rt+"%, "+it+"%)";var et,nt,rt,it,ot},tt.prototype.toHsv=function(){return et=h$9(this.rgba),{h:n$6(et.h),s:n$6(et.s),v:n$6(et.v),a:n$6(et.a,3)};var et},tt.prototype.invert=function(){return w$5({r:255-(et=this.rgba).r,g:255-et.g,b:255-et.b,a:et.a});var et},tt.prototype.saturate=function(et){return et===void 0&&(et=.1),w$5(M$1(this.rgba,et))},tt.prototype.desaturate=function(et){return et===void 0&&(et=.1),w$5(M$1(this.rgba,-et))},tt.prototype.grayscale=function(){return w$5(M$1(this.rgba,-1))},tt.prototype.lighten=function(et){return et===void 0&&(et=.1),w$5($$2(this.rgba,et))},tt.prototype.darken=function(et){return et===void 0&&(et=.1),w$5($$2(this.rgba,-et))},tt.prototype.rotate=function(et){return et===void 0&&(et=15),this.hue(this.hue()+et)},tt.prototype.alpha=function(et){return typeof et=="number"?w$5({r:(nt=this.rgba).r,g:nt.g,b:nt.b,a:et}):n$6(this.rgba.a,3);var nt},tt.prototype.hue=function(et){var nt=c$7(this.rgba);return typeof et=="number"?w$5({h:et,s:nt.s,l:nt.l,a:nt.a}):n$6(nt.h)},tt.prototype.isEqual=function(et){return this.toHex()===w$5(et).toHex()},tt}(),w$5=function(tt){return tt instanceof j$1?tt:new j$1(tt)},S$2=[],k$8=function(tt){tt.forEach(function(et){S$2.indexOf(et)<0&&(et(j$1,y$7),S$2.push(et))})};function namesPlugin(tt,et){var nt={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},rt={};for(var it in nt)rt[nt[it]]=it;var ot={};tt.prototype.toName=function(at){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var st,lt,ct=rt[this.toHex()];if(ct)return ct;if(at!=null&&at.closest){var ut=this.toRgb(),ht=1/0,dt="black";if(!ot.length)for(var pt in nt)ot[pt]=new tt(nt[pt]).toRgb();for(var mt in nt){var gt=(st=ut,lt=ot[mt],Math.pow(st.r-lt.r,2)+Math.pow(st.g-lt.g,2)+Math.pow(st.b-lt.b,2));gt=0||(it[nt]=tt[nt]);return it}function i$5(tt){var et=reactExports.useRef(tt),nt=reactExports.useRef(function(rt){et.current&&et.current(rt)});return et.current=tt,nt.current}var s$3=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt0:yt.buttons>0)&&it.current?ot(d$4(it.current,yt,st.current)):gt(!1)},mt=function(){return gt(!1)};function gt(yt){var bt=lt.current,wt=v$6(it.current),xt=yt?wt.addEventListener:wt.removeEventListener;xt(bt?"touchmove":"mousemove",pt),xt(bt?"touchend":"mouseup",mt)}return[function(yt){var bt=yt.nativeEvent,wt=it.current;if(wt&&(h$8(bt),!function(kt,St){return St&&!f$6(kt)}(bt,lt.current)&&wt)){if(f$6(bt)){lt.current=!0;var xt=bt.changedTouches||[];xt.length&&(st.current=xt[0].identifier)}wt.focus(),ot(d$4(wt,bt,st.current)),gt(!0)}},function(yt){var bt=yt.which||yt.keyCode;bt<37||bt>40||(yt.preventDefault(),at({left:bt===39?.05:bt===37?-.05:0,top:bt===40?.05:bt===38?-.05:0}))},gt]},[at,ot]),ut=ct[0],ht=ct[1],dt=ct[2];return reactExports.useEffect(function(){return dt},[dt]),React$1.createElement("div",u$4({},rt,{onTouchStart:ut,onMouseDown:ut,className:"react-colorful__interactive",ref:it,onKeyDown:ht,tabIndex:0,role:"slider"}))}),g$7=function(tt){return tt.filter(Boolean).join(" ")},p$6=function(tt){var et=tt.color,nt=tt.left,rt=tt.top,it=rt===void 0?.5:rt,ot=g$7(["react-colorful__pointer",tt.className]);return React$1.createElement("div",{className:ot,style:{top:100*it+"%",left:100*nt+"%"}},React$1.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:et}}))},b$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt},y$6=function(tt){var et=tt.s,nt=tt.v,rt=tt.a,it=(200-et)*nt/100;return{h:b$5(tt.h),s:b$5(it>0&&it<200?et*nt/100/(it<=100?it:200-it)*100:0),l:b$5(it/2),a:b$5(rt,2)}},q$6=function(tt){var et=y$6(tt);return"hsl("+et.h+", "+et.s+"%, "+et.l+"%)"},k$7=function(tt){var et=y$6(tt);return"hsla("+et.h+", "+et.s+"%, "+et.l+"%, "+et.a+")"},I$1=function(tt){var et=tt.h,nt=tt.s,rt=tt.v,it=tt.a;et=et/360*6,nt/=100,rt/=100;var ot=Math.floor(et),at=rt*(1-nt),st=rt*(1-(et-ot)*nt),lt=rt*(1-(1-et+ot)*nt),ct=ot%6;return{r:b$5(255*[rt,st,at,at,lt,rt][ct]),g:b$5(255*[lt,rt,rt,st,at,at][ct]),b:b$5(255*[at,at,lt,rt,rt,st][ct]),a:b$5(it,2)}},L$1=function(tt){var et=tt.r,nt=tt.g,rt=tt.b,it=tt.a,ot=Math.max(et,nt,rt),at=ot-Math.min(et,nt,rt),st=at?ot===et?(nt-rt)/at:ot===nt?2+(rt-et)/at:4+(et-nt)/at:0;return{h:b$5(60*(st<0?st+6:st)),s:b$5(ot?at/ot*100:0),v:b$5(ot/255*100),a:it}},S$1=React$1.memo(function(tt){var et=tt.hue,nt=tt.onChange,rt=g$7(["react-colorful__hue",tt.className]);return React$1.createElement("div",{className:rt},React$1.createElement(m$6,{onMove:function(it){nt({h:360*it.left})},onKey:function(it){nt({h:s$3(et+360*it.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$5(et),"aria-valuemax":"360","aria-valuemin":"0"},React$1.createElement(p$6,{className:"react-colorful__hue-pointer",left:et/360,color:q$6({h:et,s:100,v:100,a:1})})))}),T$1=React$1.memo(function(tt){var et=tt.hsva,nt=tt.onChange,rt={backgroundColor:q$6({h:et.h,s:100,v:100,a:1})};return React$1.createElement("div",{className:"react-colorful__saturation",style:rt},React$1.createElement(m$6,{onMove:function(it){nt({s:100*it.left,v:100-100*it.top})},onKey:function(it){nt({s:s$3(et.s+100*it.left,0,100),v:s$3(et.v-100*it.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$5(et.s)+"%, Brightness "+b$5(et.v)+"%"},React$1.createElement(p$6,{className:"react-colorful__saturation-pointer",top:1-et.v/100,left:et.s/100,color:q$6(et)})))}),F$1=function(tt,et){if(tt===et)return!0;for(var nt in tt)if(tt[nt]!==et[nt])return!1;return!0};function Y$1(tt,et,nt){var rt=i$5(nt),it=reactExports.useState(function(){return tt.toHsva(et)}),ot=it[0],at=it[1],st=reactExports.useRef({color:et,hsva:ot});reactExports.useEffect(function(){if(!tt.equal(et,st.current.color)){var ct=tt.toHsva(et);st.current={hsva:ct,color:et},at(ct)}},[et,tt]),reactExports.useEffect(function(){var ct;F$1(ot,st.current.hsva)||tt.equal(ct=tt.fromHsva(ot),st.current.color)||(st.current={hsva:ot,color:ct},rt(ct))},[ot,tt,rt]);var lt=reactExports.useCallback(function(ct){at(function(ut){return Object.assign({},ut,ct)})},[]);return[ot,lt]}var V$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$1=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$1=new Map,Q$1=function(tt){V$1(function(){var et=tt.current?tt.current.ownerDocument:document;if(et!==void 0&&!J$1.has(et)){var nt=et.createElement("style");nt.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$1.set(et,nt);var rt=$$1();rt&&nt.setAttribute("nonce",rt),et.head.appendChild(nt)}},[])},U$1=function(tt){var et=tt.className,nt=tt.colorModel,rt=tt.color,it=rt===void 0?nt.defaultColor:rt,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,it,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut,className:"react-colorful__last-control"}))},ee$1=function(tt){var et=tt.className,nt=tt.hsva,rt=tt.onChange,it={backgroundImage:"linear-gradient(90deg, "+k$7(Object.assign({},nt,{a:0}))+", "+k$7(Object.assign({},nt,{a:1}))+")"},ot=g$7(["react-colorful__alpha",et]),at=b$5(100*nt.a);return React$1.createElement("div",{className:ot},React$1.createElement("div",{className:"react-colorful__alpha-gradient",style:it}),React$1.createElement(m$6,{onMove:function(st){rt({a:st.left})},onKey:function(st){rt({a:s$3(nt.a+st.left)})},"aria-label":"Alpha","aria-valuetext":at+"%","aria-valuenow":at,"aria-valuemin":"0","aria-valuemax":"100"},React$1.createElement(p$6,{className:"react-colorful__alpha-pointer",left:nt.a,color:k$7(nt)})))},re$3=function(tt){var et=tt.className,nt=tt.colorModel,rt=tt.color,it=rt===void 0?nt.defaultColor:rt,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,it,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut}),React$1.createElement(ee$1,{hsva:ct,onChange:ut,className:"react-colorful__last-control"}))},xe$1={defaultColor:{r:0,g:0,b:0,a:1},toHsva:L$1,fromHsva:I$1,equal:F$1},Ce=function(tt){return React$1.createElement(re$3,u$4({},tt,{colorModel:xe$1}))},Me$1={defaultColor:{r:0,g:0,b:0},toHsva:function(tt){return L$1({r:tt.r,g:tt.g,b:tt.b,a:1})},fromHsva:function(tt){return{r:(et=I$1(tt)).r,g:et.g,b:et.b};var et},equal:F$1},Ne$1=function(tt){return React$1.createElement(U$1,u$4({},tt,{colorModel:Me$1}))},propTypes$1={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function tt(rt,it,ot,at,st,lt){if(lt!==ReactPropTypesSecret){var ct=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw ct.name="Invariant Violation",ct}}tt.isRequired=tt;function et(){return tt}var nt={array:tt,bigint:tt,bool:tt,func:tt,number:tt,object:tt,string:tt,symbol:tt,any:tt,arrayOf:et,element:tt,elementType:tt,instanceOf:et,node:tt,objectOf:et,oneOf:et,oneOfType:et,shape:et,exact:et,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return nt.PropTypes=nt,nt};propTypes$1.exports=factoryWithThrowingShims();var propTypesExports=propTypes$1.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function __decorate(tt,et,nt,rt){var it=arguments.length,ot=it<3?et:rt===null?rt=Object.getOwnPropertyDescriptor(et,nt):rt,at;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ot=Reflect.decorate(tt,et,nt,rt);else for(var st=tt.length-1;st>=0;st--)(at=tt[st])&&(ot=(it<3?at(ot):it>3?at(et,nt,ot):at(et,nt))||ot);return it>3&&ot&&Object.defineProperty(et,nt,ot),ot}function __awaiter(tt,et,nt,rt){function it(ot){return ot instanceof nt?ot:new nt(function(at){at(ot)})}return new(nt||(nt=Promise))(function(ot,at){function st(ut){try{ct(rt.next(ut))}catch(ht){at(ht)}}function lt(ut){try{ct(rt.throw(ut))}catch(ht){at(ht)}}function ct(ut){ut.done?ot(ut.value):it(ut.value).then(st,lt)}ct((rt=rt.apply(tt,et||[])).next())})}function __generator(tt,et){var nt={label:0,sent:function(){if(ot[0]&1)throw ot[1];return ot[1]},trys:[],ops:[]},rt,it,ot,at;return at={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(at[Symbol.iterator]=function(){return this}),at;function st(ct){return function(ut){return lt([ct,ut])}}function lt(ct){if(rt)throw new TypeError("Generator is already executing.");for(;at&&(at=0,ct[0]&&(nt=0)),nt;)try{if(rt=1,it&&(ot=ct[0]&2?it.return:ct[0]?it.throw||((ot=it.return)&&ot.call(it),0):it.next)&&!(ot=ot.call(it,ct[1])).done)return ot;switch(it=0,ot&&(ct=[ct[0]&2,ot.value]),ct[0]){case 0:case 1:ot=ct;break;case 4:return nt.label++,{value:ct[1],done:!1};case 5:nt.label++,it=ct[1],ct=[0];continue;case 7:ct=nt.ops.pop(),nt.trys.pop();continue;default:if(ot=nt.trys,!(ot=ot.length>0&&ot[ot.length-1])&&(ct[0]===6||ct[0]===2)){nt=0;continue}if(ct[0]===3&&(!ot||ct[1]>ot[0]&&ct[1]0)&&!(it=rt.next()).done;)ot.push(it.value)}catch(st){at={error:st}}finally{try{it&&!it.done&&(nt=rt.return)&&nt.call(rt)}finally{if(at)throw at.error}}return ot}function __spread(){for(var tt=[],et=0;et0?rt:tt.name,writable:!1,configurable:!1,enumerable:!0})}return nt}function withMimeType(tt){var et=tt.name,nt=et&&et.lastIndexOf(".")!==-1;if(nt&&!tt.type){var rt=et.split(".").pop().toLowerCase(),it=COMMON_MIME_TYPES.get(rt);it&&Object.defineProperty(tt,"type",{value:it,writable:!1,configurable:!1,enumerable:!0})}return tt}var FILES_TO_IGNORE=[".DS_Store","Thumbs.db"];function fromEvent(tt){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(et){return isObject$n(tt)&&isDataTransfer(tt)?[2,getDataTransferFiles(tt.dataTransfer,tt.type)]:isChangeEvt(tt)?[2,getInputFiles(tt)]:Array.isArray(tt)&&tt.every(function(nt){return"getFile"in nt&&typeof nt.getFile=="function"})?[2,getFsHandleFiles(tt)]:[2,[]]})})}function isDataTransfer(tt){return isObject$n(tt.dataTransfer)}function isChangeEvt(tt){return isObject$n(tt)&&isObject$n(tt.target)}function isObject$n(tt){return typeof tt=="object"&&tt!==null}function getInputFiles(tt){return fromList(tt.target.files).map(function(et){return toFileWithPath(et)})}function getFsHandleFiles(tt){return __awaiter(this,void 0,void 0,function(){var et;return __generator(this,function(nt){switch(nt.label){case 0:return[4,Promise.all(tt.map(function(rt){return rt.getFile()}))];case 1:return et=nt.sent(),[2,et.map(function(rt){return toFileWithPath(rt)})]}})})}function getDataTransferFiles(tt,et){return __awaiter(this,void 0,void 0,function(){var nt,rt;return __generator(this,function(it){switch(it.label){case 0:return tt===null?[2,[]]:tt.items?(nt=fromList(tt.items).filter(function(ot){return ot.kind==="file"}),et!=="drop"?[2,nt]:[4,Promise.all(nt.map(toFilePromises))]):[3,2];case 1:return rt=it.sent(),[2,noIgnoredFiles(flatten$1(rt))];case 2:return[2,noIgnoredFiles(fromList(tt.files).map(function(ot){return toFileWithPath(ot)}))]}})})}function noIgnoredFiles(tt){return tt.filter(function(et){return FILES_TO_IGNORE.indexOf(et.name)===-1})}function fromList(tt){if(tt===null)return[];for(var et=[],nt=0;nt<\/script>",tt=tt.removeChild(tt.firstChild)):typeof rt.is=="string"?tt=at.createElement(nt,{is:rt.is}):(tt=at.createElement(nt),nt==="select"&&(at=tt,rt.multiple?at.multiple=!0:rt.size&&(at.size=rt.size))):tt=at.createElementNS(tt,nt),tt[Of]=et,tt[Pf]=rt,Aj(tt,et,!1,!1),et.stateNode=tt;e:{switch(at=vb(nt,rt),nt){case"dialog":D$2("cancel",tt),D$2("close",tt),it=rt;break;case"iframe":case"object":case"embed":D$2("load",tt),it=rt;break;case"video":case"audio":for(it=0;itHj&&(et.flags|=128,rt=!0,Ej(ot,!1),et.lanes=4194304)}else{if(!rt)if(tt=Mh(at),tt!==null){if(et.flags|=128,rt=!0,nt=tt.updateQueue,nt!==null&&(et.updateQueue=nt,et.flags|=4),Ej(ot,!0),ot.tail===null&&ot.tailMode==="hidden"&&!at.alternate&&!I$4)return S$4(et),null}else 2*B$2()-ot.renderingStartTime>Hj&&nt!==1073741824&&(et.flags|=128,rt=!0,Ej(ot,!1),et.lanes=4194304);ot.isBackwards?(at.sibling=et.child,et.child=at):(nt=ot.last,nt!==null?nt.sibling=at:et.child=at,ot.last=at)}return ot.tail!==null?(et=ot.tail,ot.rendering=et,ot.tail=et.sibling,ot.renderingStartTime=B$2(),et.sibling=null,nt=M$3.current,G$3(M$3,rt?nt&1|2:nt&1),et):(S$4(et),null);case 22:case 23:return Ij(),rt=et.memoizedState!==null,tt!==null&&tt.memoizedState!==null!==rt&&(et.flags|=8192),rt&&et.mode&1?gj&1073741824&&(S$4(et),et.subtreeFlags&6&&(et.flags|=8192)):S$4(et),null;case 24:return null;case 25:return null}throw Error(p$9(156,et.tag))}function Jj(tt,et){switch(wg(et),et.tag){case 1:return Zf(et.type)&&$f(),tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 3:return Jh(),E$2(Wf),E$2(H$3),Oh(),tt=et.flags,tt&65536&&!(tt&128)?(et.flags=tt&-65537|128,et):null;case 5:return Lh(et),null;case 13:if(E$2(M$3),tt=et.memoizedState,tt!==null&&tt.dehydrated!==null){if(et.alternate===null)throw Error(p$9(340));Ig()}return tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 19:return E$2(M$3),null;case 4:return Jh(),null;case 10:return Rg(et.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U$3=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V$4=null;function Mj(tt,et){var nt=tt.ref;if(nt!==null)if(typeof nt=="function")try{nt(null)}catch(rt){W$8(tt,et,rt)}else nt.current=null}function Nj(tt,et,nt){try{nt()}catch(rt){W$8(tt,et,rt)}}var Oj=!1;function Pj(tt,et){if(Cf=dd,tt=Me$2(),Ne$2(tt)){if("selectionStart"in tt)var nt={start:tt.selectionStart,end:tt.selectionEnd};else e:{nt=(nt=tt.ownerDocument)&&nt.defaultView||window;var rt=nt.getSelection&&nt.getSelection();if(rt&&rt.rangeCount!==0){nt=rt.anchorNode;var it=rt.anchorOffset,ot=rt.focusNode;rt=rt.focusOffset;try{nt.nodeType,ot.nodeType}catch{nt=null;break e}var at=0,st=-1,lt=-1,ct=0,ut=0,ht=tt,dt=null;t:for(;;){for(var pt;ht!==nt||it!==0&&ht.nodeType!==3||(st=at+it),ht!==ot||rt!==0&&ht.nodeType!==3||(lt=at+rt),ht.nodeType===3&&(at+=ht.nodeValue.length),(pt=ht.firstChild)!==null;)dt=ht,ht=pt;for(;;){if(ht===tt)break t;if(dt===nt&&++ct===it&&(st=at),dt===ot&&++ut===rt&&(lt=at),(pt=ht.nextSibling)!==null)break;ht=dt,dt=ht.parentNode}ht=pt}nt=st===-1||lt===-1?null:{start:st,end:lt}}else nt=null}nt=nt||{start:0,end:0}}else nt=null;for(Df={focusedElem:tt,selectionRange:nt},dd=!1,V$4=et;V$4!==null;)if(et=V$4,tt=et.child,(et.subtreeFlags&1028)!==0&&tt!==null)tt.return=et,V$4=tt;else for(;V$4!==null;){et=V$4;try{var mt=et.alternate;if(et.flags&1024)switch(et.tag){case 0:case 11:case 15:break;case 1:if(mt!==null){var gt=mt.memoizedProps,yt=mt.memoizedState,bt=et.stateNode,wt=bt.getSnapshotBeforeUpdate(et.elementType===et.type?gt:Lg(et.type,gt),yt);bt.__reactInternalSnapshotBeforeUpdate=wt}break;case 3:var xt=et.stateNode.containerInfo;xt.nodeType===1?xt.textContent="":xt.nodeType===9&&xt.documentElement&&xt.removeChild(xt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$9(163))}}catch(kt){W$8(et,et.return,kt)}if(tt=et.sibling,tt!==null){tt.return=et.return,V$4=tt;break}V$4=et.return}return mt=Oj,Oj=!1,mt}function Qj(tt,et,nt){var rt=et.updateQueue;if(rt=rt!==null?rt.lastEffect:null,rt!==null){var it=rt=rt.next;do{if((it.tag&tt)===tt){var ot=it.destroy;it.destroy=void 0,ot!==void 0&&Nj(et,nt,ot)}it=it.next}while(it!==rt)}}function Rj(tt,et){if(et=et.updateQueue,et=et!==null?et.lastEffect:null,et!==null){var nt=et=et.next;do{if((nt.tag&tt)===tt){var rt=nt.create;nt.destroy=rt()}nt=nt.next}while(nt!==et)}}function Sj(tt){var et=tt.ref;if(et!==null){var nt=tt.stateNode;switch(tt.tag){case 5:tt=nt;break;default:tt=nt}typeof et=="function"?et(tt):et.current=tt}}function Tj(tt){var et=tt.alternate;et!==null&&(tt.alternate=null,Tj(et)),tt.child=null,tt.deletions=null,tt.sibling=null,tt.tag===5&&(et=tt.stateNode,et!==null&&(delete et[Of],delete et[Pf],delete et[of],delete et[Qf],delete et[Rf])),tt.stateNode=null,tt.return=null,tt.dependencies=null,tt.memoizedProps=null,tt.memoizedState=null,tt.pendingProps=null,tt.stateNode=null,tt.updateQueue=null}function Uj(tt){return tt.tag===5||tt.tag===3||tt.tag===4}function Vj(tt){e:for(;;){for(;tt.sibling===null;){if(tt.return===null||Uj(tt.return))return null;tt=tt.return}for(tt.sibling.return=tt.return,tt=tt.sibling;tt.tag!==5&&tt.tag!==6&&tt.tag!==18;){if(tt.flags&2||tt.child===null||tt.tag===4)continue e;tt.child.return=tt,tt=tt.child}if(!(tt.flags&2))return tt.stateNode}}function Wj(tt,et,nt){var rt=tt.tag;if(rt===5||rt===6)tt=tt.stateNode,et?nt.nodeType===8?nt.parentNode.insertBefore(tt,et):nt.insertBefore(tt,et):(nt.nodeType===8?(et=nt.parentNode,et.insertBefore(tt,nt)):(et=nt,et.appendChild(tt)),nt=nt._reactRootContainer,nt!=null||et.onclick!==null||(et.onclick=Bf));else if(rt!==4&&(tt=tt.child,tt!==null))for(Wj(tt,et,nt),tt=tt.sibling;tt!==null;)Wj(tt,et,nt),tt=tt.sibling}function Xj(tt,et,nt){var rt=tt.tag;if(rt===5||rt===6)tt=tt.stateNode,et?nt.insertBefore(tt,et):nt.appendChild(tt);else if(rt!==4&&(tt=tt.child,tt!==null))for(Xj(tt,et,nt),tt=tt.sibling;tt!==null;)Xj(tt,et,nt),tt=tt.sibling}var X$2=null,Yj=!1;function Zj(tt,et,nt){for(nt=nt.child;nt!==null;)ak(tt,et,nt),nt=nt.sibling}function ak(tt,et,nt){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,nt)}catch{}switch(nt.tag){case 5:U$3||Mj(nt,et);case 6:var rt=X$2,it=Yj;X$2=null,Zj(tt,et,nt),X$2=rt,Yj=it,X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?tt.parentNode.removeChild(nt):tt.removeChild(nt)):X$2.removeChild(nt.stateNode));break;case 18:X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?Kf(tt.parentNode,nt):tt.nodeType===1&&Kf(tt,nt),bd(tt)):Kf(X$2,nt.stateNode));break;case 4:rt=X$2,it=Yj,X$2=nt.stateNode.containerInfo,Yj=!0,Zj(tt,et,nt),X$2=rt,Yj=it;break;case 0:case 11:case 14:case 15:if(!U$3&&(rt=nt.updateQueue,rt!==null&&(rt=rt.lastEffect,rt!==null))){it=rt=rt.next;do{var ot=it,at=ot.destroy;ot=ot.tag,at!==void 0&&(ot&2||ot&4)&&Nj(nt,et,at),it=it.next}while(it!==rt)}Zj(tt,et,nt);break;case 1:if(!U$3&&(Mj(nt,et),rt=nt.stateNode,typeof rt.componentWillUnmount=="function"))try{rt.props=nt.memoizedProps,rt.state=nt.memoizedState,rt.componentWillUnmount()}catch(st){W$8(nt,et,st)}Zj(tt,et,nt);break;case 21:Zj(tt,et,nt);break;case 22:nt.mode&1?(U$3=(rt=U$3)||nt.memoizedState!==null,Zj(tt,et,nt),U$3=rt):Zj(tt,et,nt);break;default:Zj(tt,et,nt)}}function bk(tt){var et=tt.updateQueue;if(et!==null){tt.updateQueue=null;var nt=tt.stateNode;nt===null&&(nt=tt.stateNode=new Lj),et.forEach(function(rt){var it=ck.bind(null,tt,rt);nt.has(rt)||(nt.add(rt),rt.then(it,it))})}}function dk(tt,et){var nt=et.deletions;if(nt!==null)for(var rt=0;rtit&&(it=at),rt&=~ot}if(rt=it,rt=B$2()-rt,rt=(120>rt?120:480>rt?480:1080>rt?1080:1920>rt?1920:3e3>rt?3e3:4320>rt?4320:1960*mk(rt/1960))-rt,10tt?16:tt,xk===null)var rt=!1;else{if(tt=xk,xk=null,yk=0,K$7&6)throw Error(p$9(331));var it=K$7;for(K$7|=4,V$4=tt.current;V$4!==null;){var ot=V$4,at=ot.child;if(V$4.flags&16){var st=ot.deletions;if(st!==null){for(var lt=0;ltB$2()-gk?Lk(tt,0):sk|=nt),Ek(tt,et)}function Zk(tt,et){et===0&&(tt.mode&1?(et=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):et=1);var nt=L$3();tt=Zg(tt,et),tt!==null&&(Ac(tt,et,nt),Ek(tt,nt))}function vj(tt){var et=tt.memoizedState,nt=0;et!==null&&(nt=et.retryLane),Zk(tt,nt)}function ck(tt,et){var nt=0;switch(tt.tag){case 13:var rt=tt.stateNode,it=tt.memoizedState;it!==null&&(nt=it.retryLane);break;case 19:rt=tt.stateNode;break;default:throw Error(p$9(314))}rt!==null&&rt.delete(et),Zk(tt,nt)}var Wk;Wk=function(tt,et,nt){if(tt!==null)if(tt.memoizedProps!==et.pendingProps||Wf.current)Ug=!0;else{if(!(tt.lanes&nt)&&!(et.flags&128))return Ug=!1,zj(tt,et,nt);Ug=!!(tt.flags&131072)}else Ug=!1,I$4&&et.flags&1048576&&ug(et,ng,et.index);switch(et.lanes=0,et.tag){case 2:var rt=et.type;jj(tt,et),tt=et.pendingProps;var it=Yf(et,H$3.current);Tg(et,nt),it=Xh(null,et,rt,tt,it,nt);var ot=bi();return et.flags|=1,typeof it=="object"&&it!==null&&typeof it.render=="function"&&it.$$typeof===void 0?(et.tag=1,et.memoizedState=null,et.updateQueue=null,Zf(rt)?(ot=!0,cg(et)):ot=!1,et.memoizedState=it.state!==null&&it.state!==void 0?it.state:null,ah(et),it.updater=nh,et.stateNode=it,it._reactInternals=et,rh$1(et,rt,tt,nt),et=kj(null,et,rt,!0,ot,nt)):(et.tag=0,I$4&&ot&&vg(et),Yi(null,et,it,nt),et=et.child),et;case 16:rt=et.elementType;e:{switch(jj(tt,et),tt=et.pendingProps,it=rt._init,rt=it(rt._payload),et.type=rt,it=et.tag=$k(rt),tt=Lg(rt,tt),it){case 0:et=dj(null,et,rt,tt,nt);break e;case 1:et=ij(null,et,rt,tt,nt);break e;case 11:et=Zi(null,et,rt,tt,nt);break e;case 14:et=aj(null,et,rt,Lg(rt.type,tt),nt);break e}throw Error(p$9(306,rt,""))}return et;case 0:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),dj(tt,et,rt,it,nt);case 1:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),ij(tt,et,rt,it,nt);case 3:e:{if(lj(et),tt===null)throw Error(p$9(387));rt=et.pendingProps,ot=et.memoizedState,it=ot.element,bh(tt,et),gh(et,rt,null,nt);var at=et.memoizedState;if(rt=at.element,ot.isDehydrated)if(ot={element:rt,isDehydrated:!1,cache:at.cache,pendingSuspenseBoundaries:at.pendingSuspenseBoundaries,transitions:at.transitions},et.updateQueue.baseState=ot,et.memoizedState=ot,et.flags&256){it=Ki(Error(p$9(423)),et),et=mj(tt,et,rt,nt,it);break e}else if(rt!==it){it=Ki(Error(p$9(424)),et),et=mj(tt,et,rt,nt,it);break e}else for(yg=Lf(et.stateNode.containerInfo.firstChild),xg=et,I$4=!0,zg=null,nt=Ch$1(et,null,rt,nt),et.child=nt;nt;)nt.flags=nt.flags&-3|4096,nt=nt.sibling;else{if(Ig(),rt===it){et=$i(tt,et,nt);break e}Yi(tt,et,rt,nt)}et=et.child}return et;case 5:return Kh$1(et),tt===null&&Eg(et),rt=et.type,it=et.pendingProps,ot=tt!==null?tt.memoizedProps:null,at=it.children,Ef(rt,it)?at=null:ot!==null&&Ef(rt,ot)&&(et.flags|=32),hj(tt,et),Yi(tt,et,at,nt),et.child;case 6:return tt===null&&Eg(et),null;case 13:return pj(tt,et,nt);case 4:return Ih(et,et.stateNode.containerInfo),rt=et.pendingProps,tt===null?et.child=Bh(et,null,rt,nt):Yi(tt,et,rt,nt),et.child;case 11:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),Zi(tt,et,rt,it,nt);case 7:return Yi(tt,et,et.pendingProps,nt),et.child;case 8:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 12:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 10:e:{if(rt=et.type._context,it=et.pendingProps,ot=et.memoizedProps,at=it.value,G$3(Mg,rt._currentValue),rt._currentValue=at,ot!==null)if(He$1(ot.value,at)){if(ot.children===it.children&&!Wf.current){et=$i(tt,et,nt);break e}}else for(ot=et.child,ot!==null&&(ot.return=et);ot!==null;){var st=ot.dependencies;if(st!==null){at=ot.child;for(var lt=st.firstContext;lt!==null;){if(lt.context===rt){if(ot.tag===1){lt=ch$1(-1,nt&-nt),lt.tag=2;var ct=ot.updateQueue;if(ct!==null){ct=ct.shared;var ut=ct.pending;ut===null?lt.next=lt:(lt.next=ut.next,ut.next=lt),ct.pending=lt}}ot.lanes|=nt,lt=ot.alternate,lt!==null&&(lt.lanes|=nt),Sg(ot.return,nt,et),st.lanes|=nt;break}lt=lt.next}}else if(ot.tag===10)at=ot.type===et.type?null:ot.child;else if(ot.tag===18){if(at=ot.return,at===null)throw Error(p$9(341));at.lanes|=nt,st=at.alternate,st!==null&&(st.lanes|=nt),Sg(at,nt,et),at=ot.sibling}else at=ot.child;if(at!==null)at.return=ot;else for(at=ot;at!==null;){if(at===et){at=null;break}if(ot=at.sibling,ot!==null){ot.return=at.return,at=ot;break}at=at.return}ot=at}Yi(tt,et,it.children,nt),et=et.child}return et;case 9:return it=et.type,rt=et.pendingProps.children,Tg(et,nt),it=Vg(it),rt=rt(it),et.flags|=1,Yi(tt,et,rt,nt),et.child;case 14:return rt=et.type,it=Lg(rt,et.pendingProps),it=Lg(rt.type,it),aj(tt,et,rt,it,nt);case 15:return cj(tt,et,et.type,et.pendingProps,nt);case 17:return rt=et.type,it=et.pendingProps,it=et.elementType===rt?it:Lg(rt,it),jj(tt,et),et.tag=1,Zf(rt)?(tt=!0,cg(et)):tt=!1,Tg(et,nt),ph(et,rt,it),rh$1(et,rt,it,nt),kj(null,et,rt,!0,tt,nt);case 19:return yj(tt,et,nt);case 22:return ej(tt,et,nt)}throw Error(p$9(156,et.tag))};function Gk(tt,et){return ac(tt,et)}function al(tt,et,nt,rt){this.tag=tt,this.key=nt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=et,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=rt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg$1(tt,et,nt,rt){return new al(tt,et,nt,rt)}function bj(tt){return tt=tt.prototype,!(!tt||!tt.isReactComponent)}function $k(tt){if(typeof tt=="function")return bj(tt)?1:0;if(tt!=null){if(tt=tt.$$typeof,tt===Da)return 11;if(tt===Ga)return 14}return 2}function wh(tt,et){var nt=tt.alternate;return nt===null?(nt=Bg$1(tt.tag,et,tt.key,tt.mode),nt.elementType=tt.elementType,nt.type=tt.type,nt.stateNode=tt.stateNode,nt.alternate=tt,tt.alternate=nt):(nt.pendingProps=et,nt.type=tt.type,nt.flags=0,nt.subtreeFlags=0,nt.deletions=null),nt.flags=tt.flags&14680064,nt.childLanes=tt.childLanes,nt.lanes=tt.lanes,nt.child=tt.child,nt.memoizedProps=tt.memoizedProps,nt.memoizedState=tt.memoizedState,nt.updateQueue=tt.updateQueue,et=tt.dependencies,nt.dependencies=et===null?null:{lanes:et.lanes,firstContext:et.firstContext},nt.sibling=tt.sibling,nt.index=tt.index,nt.ref=tt.ref,nt}function yh(tt,et,nt,rt,it,ot){var at=2;if(rt=tt,typeof tt=="function")bj(tt)&&(at=1);else if(typeof tt=="string")at=5;else e:switch(tt){case ya:return Ah(nt.children,it,ot,et);case za:at=8,it|=8;break;case Aa:return tt=Bg$1(12,nt,et,it|2),tt.elementType=Aa,tt.lanes=ot,tt;case Ea:return tt=Bg$1(13,nt,et,it),tt.elementType=Ea,tt.lanes=ot,tt;case Fa:return tt=Bg$1(19,nt,et,it),tt.elementType=Fa,tt.lanes=ot,tt;case Ia:return qj(nt,it,ot,et);default:if(typeof tt=="object"&&tt!==null)switch(tt.$$typeof){case Ba:at=10;break e;case Ca:at=9;break e;case Da:at=11;break e;case Ga:at=14;break e;case Ha:at=16,rt=null;break e}throw Error(p$9(130,tt==null?tt:typeof tt,""))}return et=Bg$1(at,nt,et,it),et.elementType=tt,et.type=rt,et.lanes=ot,et}function Ah(tt,et,nt,rt){return tt=Bg$1(7,tt,rt,et),tt.lanes=nt,tt}function qj(tt,et,nt,rt){return tt=Bg$1(22,tt,rt,et),tt.elementType=Ia,tt.lanes=nt,tt.stateNode={isHidden:!1},tt}function xh(tt,et,nt){return tt=Bg$1(6,tt,null,et),tt.lanes=nt,tt}function zh(tt,et,nt){return et=Bg$1(4,tt.children!==null?tt.children:[],tt.key,et),et.lanes=nt,et.stateNode={containerInfo:tt.containerInfo,pendingChildren:null,implementation:tt.implementation},et}function bl(tt,et,nt,rt,it){this.tag=et,this.containerInfo=tt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=rt,this.onRecoverableError=it,this.mutableSourceEagerHydrationData=null}function cl(tt,et,nt,rt,it,ot,at,st,lt){return tt=new bl(tt,et,nt,st,lt),et===1?(et=1,ot===!0&&(et|=8)):et=0,ot=Bg$1(3,null,null,et),tt.current=ot,ot.stateNode=tt,ot.memoizedState={element:rt,isDehydrated:nt,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(ot),tt}function dl(tt,et,nt){var rt=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(tt){console.error(tt)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot$1,m$9=reactDomExports;createRoot$1=client$1.createRoot=m$9.createRoot,client$1.hydrateRoot=m$9.hydrateRoot;function _extends$u(){return _extends$u=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.forEach(nt=>$6ed0406888f73fc4$var$setRef(nt,et))}function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...tt){return reactExports.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...tt),tt)}const $5e63c961fc1ce211$export$8c6ed5c666ac1360=reactExports.forwardRef((tt,et)=>{const{children:nt,...rt}=tt,it=reactExports.Children.toArray(nt),ot=it.find($5e63c961fc1ce211$var$isSlottable);if(ot){const at=ot.props.children,st=it.map(lt=>lt===ot?reactExports.Children.count(at)>1?reactExports.Children.only(null):reactExports.isValidElement(at)?at.props.children:null:lt);return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$u({},rt,{ref:et}),reactExports.isValidElement(at)?reactExports.cloneElement(at,void 0,st):null)}return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$u({},rt,{ref:et}),nt)});$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName="Slot";const $5e63c961fc1ce211$var$SlotClone=reactExports.forwardRef((tt,et)=>{const{children:nt,...rt}=tt;return reactExports.isValidElement(nt)?reactExports.cloneElement(nt,{...$5e63c961fc1ce211$var$mergeProps(rt,nt.props),ref:et?$6ed0406888f73fc4$export$43e446d32b3d21af(et,nt.ref):nt.ref}):reactExports.Children.count(nt)>1?reactExports.Children.only(null):null});$5e63c961fc1ce211$var$SlotClone.displayName="SlotClone";const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45=({children:tt})=>reactExports.createElement(reactExports.Fragment,null,tt);function $5e63c961fc1ce211$var$isSlottable(tt){return reactExports.isValidElement(tt)&&tt.type===$5e63c961fc1ce211$export$d9f1ccf0bdb05d45}function $5e63c961fc1ce211$var$mergeProps(tt,et){const nt={...et};for(const rt in et){const it=tt[rt],ot=et[rt];/^on[A-Z]/.test(rt)?it&&ot?nt[rt]=(...st)=>{ot(...st),it(...st)}:it&&(nt[rt]=it):rt==="style"?nt[rt]={...it,...ot}:rt==="className"&&(nt[rt]=[it,ot].filter(Boolean).join(" "))}return{...tt,...nt}}const $8927f6f2acc4f386$var$NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$8927f6f2acc4f386$export$250ffa63cdc0d034=$8927f6f2acc4f386$var$NODES.reduce((tt,et)=>{const nt=reactExports.forwardRef((rt,it)=>{const{asChild:ot,...at}=rt,st=ot?$5e63c961fc1ce211$export$8c6ed5c666ac1360:et;return reactExports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),reactExports.createElement(st,_extends$u({},at,{ref:it}))});return nt.displayName=`Primitive.${et}`,{...tt,[et]:nt}},{});function $8927f6f2acc4f386$export$6d1a0317bde7de7f(tt,et){tt&&reactDomExports.flushSync(()=>tt.dispatchEvent(et))}const $f1701beae083dbae$export$602eac185826482c=reactExports.forwardRef((tt,et)=>{var nt;const{container:rt=globalThis==null||(nt=globalThis.document)===null||nt===void 0?void 0:nt.body,...it}=tt;return rt?ReactDOM.createPortal(reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},it,{ref:et})),rt):null}),$f1701beae083dbae$export$be92b6f5f03c0fe9=$f1701beae083dbae$export$602eac185826482c;var has=Object.prototype.hasOwnProperty;function dequal(tt,et){var nt,rt;if(tt===et)return!0;if(tt&&et&&(nt=tt.constructor)===et.constructor){if(nt===Date)return tt.getTime()===et.getTime();if(nt===RegExp)return tt.toString()===et.toString();if(nt===Array){if((rt=tt.length)===et.length)for(;rt--&&dequal(tt[rt],et[rt]););return rt===-1}if(!nt||typeof tt=="object"){rt=0;for(nt in tt)if(has.call(tt,nt)&&++rt&&!has.call(et,nt)||!(nt in et)||!dequal(tt[nt],et[nt]))return!1;return Object.keys(et).length===rt}}return tt!==tt&&et!==et}function shallow$2(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let rt=0;rt0;)at[st]=arguments[st+4];tt.call(this,at),tt.captureStackTrace&&tt.captureStackTrace(this,et),this.rule=nt,this.value=rt,this.cause=it,this.target=ot}return tt&&(et.__proto__=tt),et.prototype=Object.create(tt&&tt.prototype),et.prototype.constructor=et,et}(Error),Context$2=function(et,nt){et===void 0&&(et=[]),nt===void 0&&(nt=[]),this.chain=et,this.nextRuleModifiers=nt};Context$2.prototype._applyRule=function(et,nt){var rt=this;return function(){for(var it=[],ot=arguments.length;ot--;)it[ot]=arguments[ot];return rt.chain.push(new Rule(nt,et.apply(rt,it),it,rt.nextRuleModifiers)),rt.nextRuleModifiers=[],rt}};Context$2.prototype._applyModifier=function(et,nt){return this.nextRuleModifiers.push(new Modifier(nt,et.simple,et.async)),this};Context$2.prototype._clone=function(){return new Context$2(this.chain.slice(),this.nextRuleModifiers.slice())};Context$2.prototype.test=function(et){return this.chain.every(function(nt){return nt._test(et)})};Context$2.prototype.testAll=function(et){var nt=[];return this.chain.forEach(function(rt){try{rt._check(et)}catch(it){nt.push(new ValidationError(rt,et,it))}}),nt};Context$2.prototype.check=function(et){this.chain.forEach(function(nt){try{nt._check(et)}catch(rt){throw new ValidationError(nt,et,rt)}})};Context$2.prototype.testAsync=function(et){var nt=this;return new Promise(function(rt,it){executeAsyncRules(et,nt.chain.slice(),rt,it)})};function executeAsyncRules(tt,et,nt,rt){if(et.length){var it=et.shift();it._testAsync(tt).then(function(){executeAsyncRules(tt,et,nt,rt)},function(ot){rt(new ValidationError(it,tt,ot))})}else nt(tt)}var consideredEmpty=function(tt,et){return et&&typeof tt=="string"&&tt.trim().length===0?!0:tt==null};function optional(tt,et){return et===void 0&&(et=!1),{simple:function(nt){return consideredEmpty(nt,et)||tt.check(nt)===void 0},async:function(nt){return consideredEmpty(nt,et)||tt.testAsync(nt)}}}function v8n(){return typeof Proxy<"u"?proxyContext(new Context$2):proxylessContext(new Context$2)}var customRules={};v8n.extend=function(tt){Object.assign(customRules,tt)};v8n.clearCustomRules=function(){customRules={}};function proxyContext(tt){return new Proxy(tt,{get:function(nt,rt){if(rt in nt)return nt[rt];var it=proxyContext(tt._clone());if(rt in availableModifiers)return it._applyModifier(availableModifiers[rt],rt);if(rt in customRules)return it._applyRule(customRules[rt],rt);if(rt in availableRules)return it._applyRule(availableRules[rt],rt)}})}function proxylessContext(tt){var et=function(it,ot){return Object.keys(it).forEach(function(at){ot[at]=function(){for(var st=[],lt=arguments.length;lt--;)st[lt]=arguments[lt];var ct=proxylessContext(ot._clone()),ut=ct._applyRule(it[at],at).apply(void 0,st);return ut}}),ot},nt=et(availableRules,tt),rt=et(customRules,nt);return Object.keys(availableModifiers).forEach(function(it){Object.defineProperty(rt,it,{get:function(){var ot=proxylessContext(rt._clone());return ot._applyModifier(availableModifiers[it],it)}})}),rt}var availableModifiers={not:{simple:function(tt){return function(et){return!tt(et)}},async:function(tt){return function(et){return Promise.resolve(tt(et)).then(function(nt){return!nt}).catch(function(){return!0})}}},some:{simple:function(tt){return function(et){return split$1(et).some(function(nt){try{return tt(nt)}catch{return!1}})}},async:function(tt){return function(et){return Promise.all(split$1(et).map(function(nt){try{return tt(nt).catch(function(){return!1})}catch{return!1}})).then(function(nt){return nt.some(Boolean)})}}},every:{simple:function(tt){return function(et){return et!==!1&&split$1(et).every(tt)}},async:function(tt){return function(et){return Promise.all(split$1(et).map(tt)).then(function(nt){return nt.every(Boolean)})}}},strict:{simple:function(tt,et){return function(nt){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&tt(nt):tt(nt)}},async:function(tt,et){return function(nt){return Promise.resolve(tt(nt)).then(function(rt){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&rt:rt}).catch(function(){return!1})}}}};function isSchemaRule(tt){return tt&&tt.name==="schema"&&tt.args.length>0&&typeof tt.args[0]=="object"}function split$1(tt){return typeof tt=="string"?tt.split(""):tt}var availableRules={equal:function(tt){return function(et){return et==tt}},exact:function(tt){return function(et){return et===tt}},number:function(tt){return tt===void 0&&(tt=!0),function(et){return typeof et=="number"&&(tt||isFinite(et))}},integer:function(){return function(tt){var et=Number.isInteger||isIntegerPolyfill;return et(tt)}},numeric:function(){return function(tt){return!isNaN(parseFloat(tt))&&isFinite(tt)}},string:function(){return testType("string")},boolean:function(){return testType("boolean")},undefined:function(){return testType("undefined")},null:function(){return testType("null")},array:function(){return testType("array")},object:function(){return testType("object")},instanceOf:function(tt){return function(et){return et instanceof tt}},pattern:function(tt){return function(et){return tt.test(et)}},lowercase:function(){return function(tt){return typeof tt=="boolean"||tt===tt.toLowerCase()&&tt.trim()!==""}},uppercase:function(){return function(tt){return tt===tt.toUpperCase()&&tt.trim()!==""}},vowel:function(){return function(tt){return/^[aeiou]+$/i.test(tt)}},consonant:function(){return function(tt){return/^(?=[^aeiou])([a-z]+)$/i.test(tt)}},first:function(tt){return function(et){return et[0]==tt}},last:function(tt){return function(et){return et[et.length-1]==tt}},empty:function(){return function(tt){return tt.length===0}},length:function(tt,et){return function(nt){return nt.length>=tt&&nt.length<=(et||tt)}},minLength:function(tt){return function(et){return et.length>=tt}},maxLength:function(tt){return function(et){return et.length<=tt}},negative:function(){return function(tt){return tt<0}},positive:function(){return function(tt){return tt>=0}},between:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},range:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},lessThan:function(tt){return function(et){return ettt}},greaterThanOrEqual:function(tt){return function(et){return et>=tt}},even:function(){return function(tt){return tt%2===0}},odd:function(){return function(tt){return tt%2!==0}},includes:function(tt){return function(et){return~et.indexOf(tt)}},schema:function(tt){return testSchema(tt)},passesAnyOf:function(){for(var tt=[],et=arguments.length;et--;)tt[et]=arguments[et];return function(nt){return tt.some(function(rt){return rt.test(nt)})}},optional};function testType(tt){return function(et){return Array.isArray(et)&&tt==="array"||et===null&&tt==="null"||typeof et===tt}}function isIntegerPolyfill(tt){return typeof tt=="number"&&isFinite(tt)&&Math.floor(tt)===tt}function testSchema(tt){return{simple:function(et){var nt=[];if(Object.keys(tt).forEach(function(rt){var it=tt[rt];try{it.check((et||{})[rt])}catch(ot){ot.target=rt,nt.push(ot)}}),nt.length>0)throw nt;return!0},async:function(et){var nt=[],rt=Object.keys(tt).map(function(it){var ot=tt[it];return ot.testAsync((et||{})[it]).catch(function(at){at.target=it,nt.push(at)})});return Promise.all(rt).then(function(){if(nt.length>0)throw nt;return!0})}}}var e$6="colors",t$7="sizes",r$c="space",n$7={gap:r$c,gridGap:r$c,columnGap:r$c,gridColumnGap:r$c,rowGap:r$c,gridRowGap:r$c,inset:r$c,insetBlock:r$c,insetBlockEnd:r$c,insetBlockStart:r$c,insetInline:r$c,insetInlineEnd:r$c,insetInlineStart:r$c,margin:r$c,marginTop:r$c,marginRight:r$c,marginBottom:r$c,marginLeft:r$c,marginBlock:r$c,marginBlockEnd:r$c,marginBlockStart:r$c,marginInline:r$c,marginInlineEnd:r$c,marginInlineStart:r$c,padding:r$c,paddingTop:r$c,paddingRight:r$c,paddingBottom:r$c,paddingLeft:r$c,paddingBlock:r$c,paddingBlockEnd:r$c,paddingBlockStart:r$c,paddingInline:r$c,paddingInlineEnd:r$c,paddingInlineStart:r$c,top:r$c,right:r$c,bottom:r$c,left:r$c,scrollMargin:r$c,scrollMarginTop:r$c,scrollMarginRight:r$c,scrollMarginBottom:r$c,scrollMarginLeft:r$c,scrollMarginX:r$c,scrollMarginY:r$c,scrollMarginBlock:r$c,scrollMarginBlockEnd:r$c,scrollMarginBlockStart:r$c,scrollMarginInline:r$c,scrollMarginInlineEnd:r$c,scrollMarginInlineStart:r$c,scrollPadding:r$c,scrollPaddingTop:r$c,scrollPaddingRight:r$c,scrollPaddingBottom:r$c,scrollPaddingLeft:r$c,scrollPaddingX:r$c,scrollPaddingY:r$c,scrollPaddingBlock:r$c,scrollPaddingBlockEnd:r$c,scrollPaddingBlockStart:r$c,scrollPaddingInline:r$c,scrollPaddingInlineEnd:r$c,scrollPaddingInlineStart:r$c,fontSize:"fontSizes",background:e$6,backgroundColor:e$6,backgroundImage:e$6,borderImage:e$6,border:e$6,borderBlock:e$6,borderBlockEnd:e$6,borderBlockStart:e$6,borderBottom:e$6,borderBottomColor:e$6,borderColor:e$6,borderInline:e$6,borderInlineEnd:e$6,borderInlineStart:e$6,borderLeft:e$6,borderLeftColor:e$6,borderRight:e$6,borderRightColor:e$6,borderTop:e$6,borderTopColor:e$6,caretColor:e$6,color:e$6,columnRuleColor:e$6,fill:e$6,outline:e$6,outlineColor:e$6,stroke:e$6,textDecorationColor:e$6,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t$7,minBlockSize:t$7,maxBlockSize:t$7,inlineSize:t$7,minInlineSize:t$7,maxInlineSize:t$7,width:t$7,minWidth:t$7,maxWidth:t$7,height:t$7,minHeight:t$7,maxHeight:t$7,flexBasis:t$7,gridTemplateColumns:t$7,gridTemplateRows:t$7,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i$7=(tt,et)=>typeof et=="function"?{"()":Function.prototype.toString.call(et)}:et,o$2=()=>{const tt=Object.create(null);return(et,nt,...rt)=>{const it=(ot=>JSON.stringify(ot,i$7))(et);return it in tt?tt[it]:tt[it]=nt(et,...rt)}},l$6=Symbol.for("sxs.internal"),s$5=(tt,et)=>Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)),a$4=tt=>{for(const et in tt)return!0;return!1},{hasOwnProperty:c$8}=Object.prototype,d$6=tt=>tt.includes("-")?tt:tt.replace(/[A-Z]/g,et=>"-"+et.toLowerCase()),g$9=/\s+(?![^()]*\))/,p$8=tt=>et=>tt(...typeof et=="string"?String(et).split(g$9):[et]),u$6={appearance:tt=>({WebkitAppearance:tt,appearance:tt}),backfaceVisibility:tt=>({WebkitBackfaceVisibility:tt,backfaceVisibility:tt}),backdropFilter:tt=>({WebkitBackdropFilter:tt,backdropFilter:tt}),backgroundClip:tt=>({WebkitBackgroundClip:tt,backgroundClip:tt}),boxDecorationBreak:tt=>({WebkitBoxDecorationBreak:tt,boxDecorationBreak:tt}),clipPath:tt=>({WebkitClipPath:tt,clipPath:tt}),content:tt=>({content:tt.includes('"')||tt.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(tt)?tt:`"${tt}"`}),hyphens:tt=>({WebkitHyphens:tt,hyphens:tt}),maskImage:tt=>({WebkitMaskImage:tt,maskImage:tt}),maskSize:tt=>({WebkitMaskSize:tt,maskSize:tt}),tabSize:tt=>({MozTabSize:tt,tabSize:tt}),textSizeAdjust:tt=>({WebkitTextSizeAdjust:tt,textSizeAdjust:tt}),userSelect:tt=>({WebkitUserSelect:tt,userSelect:tt}),marginBlock:p$8((tt,et)=>({marginBlockStart:tt,marginBlockEnd:et||tt})),marginInline:p$8((tt,et)=>({marginInlineStart:tt,marginInlineEnd:et||tt})),maxSize:p$8((tt,et)=>({maxBlockSize:tt,maxInlineSize:et||tt})),minSize:p$8((tt,et)=>({minBlockSize:tt,minInlineSize:et||tt})),paddingBlock:p$8((tt,et)=>({paddingBlockStart:tt,paddingBlockEnd:et||tt})),paddingInline:p$8((tt,et)=>({paddingInlineStart:tt,paddingInlineEnd:et||tt}))},h$a=/([\d.]+)([^]*)/,f$8=(tt,et)=>tt.length?tt.reduce((nt,rt)=>(nt.push(...et.map(it=>it.includes("&")?it.replace(/&/g,/[ +>|~]/.test(rt)&&/&.*&/.test(it)?`:is(${rt})`:rt):rt+" "+it)),nt),[]):et,m$8=(tt,et)=>tt in b$7&&typeof et=="string"?et.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(nt,rt,it,ot)=>rt+(it==="stretch"?`-moz-available${ot};${d$6(tt)}:${rt}-webkit-fill-available`:`-moz-fit-content${ot};${d$6(tt)}:${rt}fit-content`)+ot):String(et),b$7={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$3=tt=>tt?tt+"-":"",k$9=(tt,et,nt)=>tt.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(rt,it,ot,at,st)=>at=="$"==!!ot?rt:(it||at=="--"?"calc(":"")+"var(--"+(at==="$"?S$3(et)+(st.includes("$")?"":S$3(nt))+st.replace(/\$/g,"-"):st)+")"+(it||at=="--"?"*"+(it||"")+(ot||"1")+")":"")),y$8=/\s*,\s*(?![^()]*\))/,B$1=Object.prototype.toString,$$3=(tt,et,nt,rt,it)=>{let ot,at,st;const lt=(ct,ut,ht)=>{let dt,pt;const mt=gt=>{for(dt in gt){const wt=dt.charCodeAt(0)===64,xt=wt&&Array.isArray(gt[dt])?gt[dt]:[gt[dt]];for(pt of xt){const kt=/[A-Z]/.test(bt=dt)?bt:bt.replace(/-[^]/g,Tt=>Tt[1].toUpperCase()),St=typeof pt=="object"&&pt&&pt.toString===B$1&&(!rt.utils[kt]||!ut.length);if(kt in rt.utils&&!St){const Tt=rt.utils[kt];if(Tt!==at){at=Tt,mt(Tt(pt)),at=null;continue}}else if(kt in u$6){const Tt=u$6[kt];if(Tt!==st){st=Tt,mt(Tt(pt)),st=null;continue}}if(wt&&(yt=dt.slice(1)in rt.media?"@media "+rt.media[dt.slice(1)]:dt,dt=yt.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(Tt,At,Et,Ct,Lt,jt)=>{const Rt=h$a.test(At),$t=.0625*(Rt?-1:1),[vt,It]=Rt?[Ct,At]:[At,Ct];return"("+(Et[0]==="="?"":Et[0]===">"===Rt?"max-":"min-")+vt+":"+(Et[0]!=="="&&Et.length===1?It.replace(h$a,(Ot,Wt,zt)=>Number(Wt)+$t*(Et===">"?1:-1)+zt):It)+(Lt?") and ("+(Lt[0]===">"?"min-":"max-")+vt+":"+(Lt.length===1?jt.replace(h$a,(Ot,Wt,zt)=>Number(Wt)+$t*(Lt===">"?-1:1)+zt):jt):"")+")"})),St){const Tt=wt?ht.concat(dt):[...ht],At=wt?[...ut]:f$8(ut,dt.split(y$8));ot!==void 0&&it(x$8(...ot)),ot=void 0,lt(pt,At,Tt)}else ot===void 0&&(ot=[[],ut,ht]),dt=wt||dt.charCodeAt(0)!==36?dt:`--${S$3(rt.prefix)}${dt.slice(1).replace(/\$/g,"-")}`,pt=St?pt:typeof pt=="number"?pt&&kt in I$3?String(pt)+"px":String(pt):k$9(m$8(kt,pt??""),rt.prefix,rt.themeMap[kt]),ot[0].push(`${wt?`${dt} `:`${d$6(dt)}:`}${pt}`)}}var yt,bt};mt(ct),ot!==void 0&&it(x$8(...ot)),ot=void 0};lt(tt,et,nt)},x$8=(tt,et,nt)=>`${nt.map(rt=>`${rt}{`).join("")}${et.length?`${et.join(",")}{`:""}${tt.join(";")}${et.length?"}":""}${Array(nt.length?nt.length+1:0).join("}")}`,I$3={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=tt=>String.fromCharCode(tt+(tt>25?39:97)),z$6=tt=>(et=>{let nt,rt="";for(nt=Math.abs(et);nt>52;nt=nt/52|0)rt=R$1(nt%52)+rt;return R$1(nt%52)+rt})(((et,nt)=>{let rt=nt.length;for(;rt;)et=33*et^nt.charCodeAt(--rt);return et})(5381,JSON.stringify(tt))>>>0),W$7=["themed","global","styled","onevar","resonevar","allvar","inline"],j$2=tt=>{if(tt.href&&!tt.href.startsWith(location.origin))return!1;try{return!!tt.cssRules}catch{return!1}},E$1=tt=>{let et;const nt=()=>{const{cssRules:it}=et.sheet;return[].map.call(it,(ot,at)=>{const{cssText:st}=ot;let lt="";if(st.startsWith("--sxs"))return"";if(it[at-1]&&(lt=it[at-1].cssText).startsWith("--sxs")){if(!ot.cssRules.length)return"";for(const ct in et.rules)if(et.rules[ct].group===ot)return`--sxs{--sxs:${[...et.rules[ct].cache].join(" ")}}${st}`;return ot.cssRules.length?`${lt}${st}`:""}return st}).join("")},rt=()=>{if(et){const{rules:st,sheet:lt}=et;if(!lt.deleteRule){for(;Object(Object(lt.cssRules)[0]).type===3;)lt.cssRules.splice(0,1);lt.cssRules=[]}for(const ct in st)delete st[ct]}const it=Object(tt).styleSheets||[];for(const st of it)if(j$2(st)){for(let lt=0,ct=st.cssRules;ct[lt];++lt){const ut=Object(ct[lt]);if(ut.type!==1)continue;const ht=Object(ct[lt+1]);if(ht.type!==4)continue;++lt;const{cssText:dt}=ut;if(!dt.startsWith("--sxs"))continue;const pt=dt.slice(14,-3).trim().split(/\s+/),mt=W$7[pt[0]];mt&&(et||(et={sheet:st,reset:rt,rules:{},toString:nt}),et.rules[mt]={group:ht,index:lt,cache:new Set(pt)})}if(et)break}if(!et){const st=(lt,ct)=>({type:ct,cssRules:[],insertRule(ut,ht){this.cssRules.splice(ht,0,st(ut,{import:3,undefined:1}[(ut.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return lt==="@media{}"?`@media{${[].map.call(this.cssRules,ut=>ut.cssText).join("")}}`:lt}});et={sheet:tt?(tt.head||tt).appendChild(document.createElement("style")).sheet:st("","text/css"),rules:{},reset:rt,toString:nt}}const{sheet:ot,rules:at}=et;for(let st=W$7.length-1;st>=0;--st){const lt=W$7[st];if(!at[lt]){const ct=W$7[st+1],ut=at[ct]?at[ct].index:ot.cssRules.length;ot.insertRule("@media{}",ut),ot.insertRule(`--sxs{--sxs:${st}}`,ut),at[lt]={group:ot.cssRules[ut+1],index:ut,cache:new Set([st])}}v$8(at[lt])}};return rt(),et},v$8=tt=>{const et=tt.group;let nt=et.cssRules.length;tt.apply=rt=>{try{et.insertRule(rt,nt),++nt}catch{}}},T$2=Symbol(),w$6=o$2(),M$2=(tt,et)=>w$6(tt,()=>(...nt)=>{let rt={type:null,composers:new Set};for(const it of nt)if(it!=null)if(it[l$6]){rt.type==null&&(rt.type=it[l$6].type);for(const ot of it[l$6].composers)rt.composers.add(ot)}else it.constructor!==Object||it.$$typeof?rt.type==null&&(rt.type=it):rt.composers.add(C$1(it,tt));return rt.type==null&&(rt.type="span"),rt.composers.size||rt.composers.add(["PJLV",{},[],[],{},[]]),P$3(tt,rt,et)}),C$1=({variants:tt,compoundVariants:et,defaultVariants:nt,...rt},it)=>{const ot=`${S$3(it.prefix)}c-${z$6(rt)}`,at=[],st=[],lt=Object.create(null),ct=[];for(const dt in nt)lt[dt]=String(nt[dt]);if(typeof tt=="object"&&tt)for(const dt in tt){ut=lt,ht=dt,c$8.call(ut,ht)||(lt[dt]="undefined");const pt=tt[dt];for(const mt in pt){const gt={[dt]:String(mt)};String(mt)==="undefined"&&ct.push(dt);const yt=pt[mt],bt=[gt,yt,!a$4(yt)];at.push(bt)}}var ut,ht;if(typeof et=="object"&&et)for(const dt of et){let{css:pt,...mt}=dt;pt=typeof pt=="object"&&pt||{};for(const yt in mt)mt[yt]=String(mt[yt]);const gt=[mt,pt,!a$4(pt)];st.push(gt)}return[ot,rt,at,st,lt,ct]},P$3=(tt,et,nt)=>{const[rt,it,ot,at]=L$2(et.composers),st=typeof et.type=="function"||et.type.$$typeof?(ht=>{function dt(){for(let pt=0;ptdt.rules[pt]={apply:mt=>dt[T$2].push([pt,mt])}),dt})(nt):null,lt=(st||nt).rules,ct=`.${rt}${it.length>1?`:where(.${it.slice(1).join(".")})`:""}`,ut=ht=>{ht=typeof ht=="object"&&ht||A$2;const{css:dt,...pt}=ht,mt={};for(const bt in ot)if(delete pt[bt],bt in ht){let wt=ht[bt];typeof wt=="object"&&wt?mt[bt]={"@initial":ot[bt],...wt}:(wt=String(wt),mt[bt]=wt!=="undefined"||at.has(bt)?wt:ot[bt])}else mt[bt]=ot[bt];const gt=new Set([...it]);for(const[bt,wt,xt,kt]of et.composers){nt.rules.styled.cache.has(bt)||(nt.rules.styled.cache.add(bt),$$3(wt,[`.${bt}`],[],tt,At=>{lt.styled.apply(At)}));const St=O(xt,mt,tt.media),Tt=O(kt,mt,tt.media,!0);for(const At of St)if(At!==void 0)for(const[Et,Ct,Lt]of At){const jt=`${bt}-${z$6(Ct)}-${Et}`;gt.add(jt);const Rt=(Lt?nt.rules.resonevar:nt.rules.onevar).cache,$t=Lt?lt.resonevar:lt.onevar;Rt.has(jt)||(Rt.add(jt),$$3(Ct,[`.${jt}`],[],tt,vt=>{$t.apply(vt)}))}for(const At of Tt)if(At!==void 0)for(const[Et,Ct]of At){const Lt=`${bt}-${z$6(Ct)}-${Et}`;gt.add(Lt),nt.rules.allvar.cache.has(Lt)||(nt.rules.allvar.cache.add(Lt),$$3(Ct,[`.${Lt}`],[],tt,jt=>{lt.allvar.apply(jt)}))}}if(typeof dt=="object"&&dt){const bt=`${rt}-i${z$6(dt)}-css`;gt.add(bt),nt.rules.inline.cache.has(bt)||(nt.rules.inline.cache.add(bt),$$3(dt,[`.${bt}`],[],tt,wt=>{lt.inline.apply(wt)}))}for(const bt of String(ht.className||"").trim().split(/\s+/))bt&>.add(bt);const yt=pt.className=[...gt].join(" ");return{type:et.type,className:yt,selector:ct,props:pt,toString:()=>yt,deferredInjector:st}};return s$5(ut,{className:rt,selector:ct,[l$6]:et,toString:()=>(nt.rules.styled.cache.has(rt)||ut(),rt)})},L$2=tt=>{let et="";const nt=[],rt={},it=[];for(const[ot,,,,at,st]of tt){et===""&&(et=ot),nt.push(ot),it.push(...st);for(const lt in at){const ct=at[lt];(rt[lt]===void 0||ct!=="undefined"||st.includes(ct))&&(rt[lt]=ct)}}return[et,nt,rt,new Set(it)]},O=(tt,et,nt,rt)=>{const it=[];e:for(let[ot,at,st]of tt){if(st)continue;let lt,ct=0,ut=!1;for(lt in ot){const ht=ot[lt];let dt=et[lt];if(dt!==ht){if(typeof dt!="object"||!dt)continue e;{let pt,mt,gt=0;for(const yt in dt){if(ht===String(dt[yt])){if(yt!=="@initial"){const bt=yt.slice(1);(mt=mt||[]).push(bt in nt?nt[bt]:yt.replace(/^@media ?/,"")),ut=!0}ct+=gt,pt=!0}++gt}if(mt&&mt.length&&(at={["@media "+mt.join(", ")]:at}),!pt)continue e}}}(it[ct]=it[ct]||[]).push([rt?"cv":`${lt}-${ot[lt]}`,at,ut])}return it},A$2={},N$2=o$2(),D$1=(tt,et)=>N$2(tt,()=>(...nt)=>{const rt=()=>{for(let it of nt){it=typeof it=="object"&&it||{};let ot=z$6(it);if(!et.rules.global.cache.has(ot)){if(et.rules.global.cache.add(ot),"@import"in it){let at=[].indexOf.call(et.sheet.cssRules,et.rules.themed.group)-1;for(let st of[].concat(it["@import"]))st=st.includes('"')||st.includes("'")?st:`"${st}"`,et.sheet.insertRule(`@import ${st};`,at++);delete it["@import"]}$$3(it,[],[],tt,at=>{et.rules.global.apply(at)})}}return""};return s$5(rt,{toString:rt})}),H$2=o$2(),V$3=(tt,et)=>H$2(tt,()=>nt=>{const rt=`${S$3(tt.prefix)}k-${z$6(nt)}`,it=()=>{if(!et.rules.global.cache.has(rt)){et.rules.global.cache.add(rt);const ot=[];$$3(nt,[],[],tt,st=>ot.push(st));const at=`@keyframes ${rt}{${ot.join("")}}`;et.rules.global.apply(at)}return rt};return s$5(it,{get name(){return it()},toString:it})}),G$2=class{constructor(et,nt,rt,it){this.token=et==null?"":String(et),this.value=nt==null?"":String(nt),this.scale=rt==null?"":String(rt),this.prefix=it==null?"":String(it)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S$3(this.prefix)+S$3(this.scale)+this.token}toString(){return this.computedValue}},F$2=o$2(),J$2=(tt,et)=>F$2(tt,()=>(nt,rt)=>{rt=typeof nt=="object"&&nt||Object(rt);const it=`.${nt=(nt=typeof nt=="string"?nt:"")||`${S$3(tt.prefix)}t-${z$6(rt)}`}`,ot={},at=[];for(const lt in rt){ot[lt]={};for(const ct in rt[lt]){const ut=`--${S$3(tt.prefix)}${lt}-${ct}`,ht=k$9(String(rt[lt][ct]),tt.prefix,lt);ot[lt][ct]=new G$2(ct,ht,lt,tt.prefix),at.push(`${ut}:${ht}`)}}const st=()=>{if(at.length&&!et.rules.themed.cache.has(nt)){et.rules.themed.cache.add(nt);const lt=`${rt===tt.theme?":root,":""}.${nt}{${at.join(";")}}`;et.rules.themed.apply(lt)}return nt};return{...ot,get className(){return st()},selector:it,toString:st}}),U$2=o$2(),X$1,Y$2=o$2(),q$7=tt=>{const et=(nt=>{let rt=!1;const it=U$2(nt,ot=>{rt=!0;const at="prefix"in(ot=typeof ot=="object"&&ot||{})?String(ot.prefix):"",st=typeof ot.media=="object"&&ot.media||{},lt=typeof ot.root=="object"?ot.root||null:globalThis.document||null,ct=typeof ot.theme=="object"&&ot.theme||{},ut={prefix:at,media:st,theme:ct,themeMap:typeof ot.themeMap=="object"&&ot.themeMap||{...n$7},utils:typeof ot.utils=="object"&&ot.utils||{}},ht=E$1(lt),dt={css:M$2(ut,ht),globalCss:D$1(ut,ht),keyframes:V$3(ut,ht),createTheme:J$2(ut,ht),reset(){ht.reset(),dt.theme.toString()},theme:{},sheet:ht,config:ut,prefix:at,getCssText:ht.toString,toString:ht.toString};return String(dt.theme=dt.createTheme(ct)),dt});return rt||it.reset(),it})(tt);return et.styled=(({config:nt,sheet:rt})=>Y$2(nt,()=>{const it=M$2(nt,rt);return(...ot)=>{const at=it(...ot),st=at[l$6].type,lt=React$1.forwardRef((ct,ut)=>{const ht=ct&&ct.as||st,{props:dt,deferredInjector:pt}=at(ct);return delete dt.as,dt.ref=ut,pt?React$1.createElement(React$1.Fragment,null,React$1.createElement(ht,dt),React$1.createElement(pt,null)):React$1.createElement(ht,dt)});return lt.className=at.className,lt.displayName=`Styled.${st.displayName||st.name||st}`,lt.selector=at.selector,lt.toString=()=>at.selector,lt[l$6]=at[l$6],lt}}))(et),et},K$6=()=>X$1||(X$1=q$7()),re$4=(...tt)=>K$6().styled(...tt);function clamp$9(tt,et,nt){return Math.max(et,Math.min(tt,nt))}const V$2={toVector(tt,et){return tt===void 0&&(tt=et),Array.isArray(tt)?tt:[tt,tt]},add(tt,et){return[tt[0]+et[0],tt[1]+et[1]]},sub(tt,et){return[tt[0]-et[0],tt[1]-et[1]]},addTo(tt,et){tt[0]+=et[0],tt[1]+=et[1]},subTo(tt,et){tt[0]-=et[0],tt[1]-=et[1]}};function rubberband(tt,et,nt){return et===0||Math.abs(et)===1/0?Math.pow(tt,nt*5):tt*et*nt/(et+nt*tt)}function rubberbandIfOutOfBounds(tt,et,nt,rt=.15){return rt===0?clamp$9(tt,et,nt):ttnt?+rubberband(tt-nt,nt-et,rt)+nt:tt}function computeRubberband(tt,[et,nt],[rt,it]){const[[ot,at],[st,lt]]=tt;return[rubberbandIfOutOfBounds(et,ot,at,rt),rubberbandIfOutOfBounds(nt,st,lt,it)]}function _toPrimitive$C(tt,et){if(typeof tt!="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var rt=nt.call(tt,et||"default");if(typeof rt!="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _toPropertyKey$C(tt){var et=_toPrimitive$C(tt,"string");return typeof et=="symbol"?et:String(et)}function _defineProperty$G(tt,et,nt){return et=_toPropertyKey$C(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$F(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);et&&(rt=rt.filter(function(it){return Object.getOwnPropertyDescriptor(tt,it).enumerable})),nt.push.apply(nt,rt)}return nt}function _objectSpread2$2(tt){for(var et=1;et{var nt,rt;return et.target===tt.currentTarget||((nt=tt.currentTarget)===null||nt===void 0||(rt=nt.contains)===null||rt===void 0?void 0:rt.call(nt,et.target))})}function getTouchList(tt){return tt.type==="touchend"||tt.type==="touchcancel"?tt.changedTouches:tt.targetTouches}function getValueEvent(tt){return isTouch$1(tt)?getTouchList(tt)[0]:tt}function touchIds(tt){return getCurrentTargetTouchList(tt).map(et=>et.identifier)}function pointerId(tt){const et=getValueEvent(tt);return isTouch$1(tt)?et.identifier:et.pointerId}function pointerValues(tt){const et=getValueEvent(tt);return[et.clientX,et.clientY]}function getEventDetails(tt){const et={};if("buttons"in tt&&(et.buttons=tt.buttons),"shiftKey"in tt){const{shiftKey:nt,altKey:rt,metaKey:it,ctrlKey:ot}=tt;Object.assign(et,{shiftKey:nt,altKey:rt,metaKey:it,ctrlKey:ot})}return et}function call$2(tt,...et){return typeof tt=="function"?tt(...et):tt}function noop$b(){}function chain(...tt){return tt.length===0?noop$b:tt.length===1?tt[0]:function(){let et;for(const nt of tt)et=nt.apply(this,arguments)||et;return et}}function assignDefault(tt,et){return Object.assign({},et,tt||{})}const BEFORE_LAST_KINEMATICS_DELAY=32;class Engine{constructor(et,nt,rt){this.ctrl=et,this.args=nt,this.key=rt,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(et){this.ctrl.state[this.key]=et}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:et,shared:nt,ingKey:rt,args:it}=this;nt[rt]=et._active=et.active=et._blocked=et._force=!1,et._step=[!1,!1],et.intentional=!1,et._movement=[0,0],et._distance=[0,0],et._direction=[0,0],et._delta=[0,0],et._bounds=[[-1/0,1/0],[-1/0,1/0]],et.args=it,et.axis=void 0,et.memo=void 0,et.elapsedTime=et.timeDelta=0,et.direction=[0,0],et.distance=[0,0],et.overflow=[0,0],et._movementBound=[!1,!1],et.velocity=[0,0],et.movement=[0,0],et.delta=[0,0],et.timeStamp=0}start(et){const nt=this.state,rt=this.config;nt._active||(this.reset(),this.computeInitial(),nt._active=!0,nt.target=et.target,nt.currentTarget=et.currentTarget,nt.lastOffset=rt.from?call$2(rt.from,nt):nt.offset,nt.offset=nt.lastOffset,nt.startTime=nt.timeStamp=et.timeStamp)}computeValues(et){const nt=this.state;nt._values=et,nt.values=this.config.transform(et)}computeInitial(){const et=this.state;et._initial=et._values,et.initial=et.values}compute(et){const{state:nt,config:rt,shared:it}=this;nt.args=this.args;let ot=0;if(et&&(nt.event=et,rt.preventDefault&&et.cancelable&&nt.event.preventDefault(),nt.type=et.type,it.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,it.locked=!!document.pointerLockElement,Object.assign(it,getEventDetails(et)),it.down=it.pressed=it.buttons%2===1||it.touches>0,ot=et.timeStamp-nt.timeStamp,nt.timeStamp=et.timeStamp,nt.elapsedTime=nt.timeStamp-nt.startTime),nt._active){const Tt=nt._delta.map(Math.abs);V$2.addTo(nt._distance,Tt)}this.axisIntent&&this.axisIntent(et);const[at,st]=nt._movement,[lt,ct]=rt.threshold,{_step:ut,values:ht}=nt;if(rt.hasCustomTransform?(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&ht[0]),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&ht[1])):(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&Math.sign(at)*lt),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&Math.sign(st)*ct)),nt.intentional=ut[0]!==!1||ut[1]!==!1,!nt.intentional)return;const dt=[0,0];if(rt.hasCustomTransform){const[Tt,At]=ht;dt[0]=ut[0]!==!1?Tt-ut[0]:0,dt[1]=ut[1]!==!1?At-ut[1]:0}else dt[0]=ut[0]!==!1?at-ut[0]:0,dt[1]=ut[1]!==!1?st-ut[1]:0;this.restrictToAxis&&!nt._blocked&&this.restrictToAxis(dt);const pt=nt.offset,mt=nt._active&&!nt._blocked||nt.active;mt&&(nt.first=nt._active&&!nt.active,nt.last=!nt._active&&nt.active,nt.active=it[this.ingKey]=nt._active,et&&(nt.first&&("bounds"in rt&&(nt._bounds=call$2(rt.bounds,nt)),this.setup&&this.setup()),nt.movement=dt,this.computeOffset()));const[gt,yt]=nt.offset,[[bt,wt],[xt,kt]]=nt._bounds;nt.overflow=[gtwt?1:0,ytkt?1:0],nt._movementBound[0]=nt.overflow[0]?nt._movementBound[0]===!1?nt._movement[0]:nt._movementBound[0]:!1,nt._movementBound[1]=nt.overflow[1]?nt._movementBound[1]===!1?nt._movement[1]:nt._movementBound[1]:!1;const St=nt._active?rt.rubberband||[0,0]:[0,0];if(nt.offset=computeRubberband(nt._bounds,nt.offset,St),nt.delta=V$2.sub(nt.offset,pt),this.computeMovement(),mt&&(!nt.last||ot>BEFORE_LAST_KINEMATICS_DELAY)){nt.delta=V$2.sub(nt.offset,pt);const Tt=nt.delta.map(Math.abs);V$2.addTo(nt.distance,Tt),nt.direction=nt.delta.map(Math.sign),nt._direction=nt._delta.map(Math.sign),!nt.first&&ot>0&&(nt.velocity=[Tt[0]/ot,Tt[1]/ot],nt.timeDelta=ot)}}emit(){const et=this.state,nt=this.shared,rt=this.config;if(et._active||this.clean(),(et._blocked||!et.intentional)&&!et._force&&!rt.triggerAllEvents)return;const it=this.handler(_objectSpread2$2(_objectSpread2$2(_objectSpread2$2({},nt),et),{},{[this.aliasKey]:et.values}));it!==void 0&&(et.memo=it)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function selectAxis([tt,et],nt){const rt=Math.abs(tt),it=Math.abs(et);if(rt>it&&rt>nt)return"x";if(it>rt&&it>nt)return"y"}class CoordinatesEngine extends Engine{constructor(...et){super(...et),_defineProperty$G(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V$2.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V$2.sub(this.state.offset,this.state.lastOffset)}axisIntent(et){const nt=this.state,rt=this.config;if(!nt.axis&&et){const it=typeof rt.axisThreshold=="object"?rt.axisThreshold[getPointerType(et)]:rt.axisThreshold;nt.axis=selectAxis(nt._movement,it)}nt._blocked=(rt.lockDirection||!!rt.axis)&&!nt.axis||!!rt.axis&&rt.axis!==nt.axis}restrictToAxis(et){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":et[1]=0;break;case"y":et[0]=0;break}}}const identity$e=tt=>tt,DEFAULT_RUBBERBAND=.15,commonConfigResolver={enabled(tt=!0){return tt},eventOptions(tt,et,nt){return _objectSpread2$2(_objectSpread2$2({},nt.shared.eventOptions),tt)},preventDefault(tt=!1){return tt},triggerAllEvents(tt=!1){return tt},rubberband(tt=0){switch(tt){case!0:return[DEFAULT_RUBBERBAND,DEFAULT_RUBBERBAND];case!1:return[0,0];default:return V$2.toVector(tt)}},from(tt){if(typeof tt=="function")return tt;if(tt!=null)return V$2.toVector(tt)},transform(tt,et,nt){const rt=tt||nt.shared.transform;return this.hasCustomTransform=!!rt,rt||identity$e},threshold(tt){return V$2.toVector(tt,0)}},DEFAULT_AXIS_THRESHOLD=0,coordinatesConfigResolver=_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{axis(tt,et,{axis:nt}){if(this.lockDirection=nt==="lock",!this.lockDirection)return nt},axisThreshold(tt=DEFAULT_AXIS_THRESHOLD){return tt},bounds(tt={}){if(typeof tt=="function")return ot=>coordinatesConfigResolver.bounds(tt(ot));if("current"in tt)return()=>tt.current;if(typeof HTMLElement=="function"&&tt instanceof HTMLElement)return tt;const{left:et=-1/0,right:nt=1/0,top:rt=-1/0,bottom:it=1/0}=tt;return[[et,nt],[rt,it]]}}),KEYS_DELTA_MAP={ArrowRight:(tt,et=1)=>[tt*et,0],ArrowLeft:(tt,et=1)=>[-1*tt*et,0],ArrowUp:(tt,et=1)=>[0,-1*tt*et],ArrowDown:(tt,et=1)=>[0,tt*et]};class DragEngine extends CoordinatesEngine{constructor(...et){super(...et),_defineProperty$G(this,"ingKey","dragging")}reset(){super.reset();const et=this.state;et._pointerId=void 0,et._pointerActive=!1,et._keyboardActive=!1,et._preventScroll=!1,et._delayed=!1,et.swipe=[0,0],et.tap=!1,et.canceled=!1,et.cancel=this.cancel.bind(this)}setup(){const et=this.state;if(et._bounds instanceof HTMLElement){const nt=et._bounds.getBoundingClientRect(),rt=et.currentTarget.getBoundingClientRect(),it={left:nt.left-rt.left+et.offset[0],right:nt.right-rt.right+et.offset[0],top:nt.top-rt.top+et.offset[1],bottom:nt.bottom-rt.bottom+et.offset[1]};et._bounds=coordinatesConfigResolver.bounds(it)}}cancel(){const et=this.state;et.canceled||(et.canceled=!0,et._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(et){const nt=this.config,rt=this.state;if(et.buttons!=null&&(Array.isArray(nt.pointerButtons)?!nt.pointerButtons.includes(et.buttons):nt.pointerButtons!==-1&&nt.pointerButtons!==et.buttons))return;const it=this.ctrl.setEventIds(et);nt.pointerCapture&&et.target.setPointerCapture(et.pointerId),!(it&&it.size>1&&rt._pointerActive)&&(this.start(et),this.setupPointer(et),rt._pointerId=pointerId(et),rt._pointerActive=!0,this.computeValues(pointerValues(et)),this.computeInitial(),nt.preventScrollAxis&&getPointerType(et)!=="mouse"?(rt._active=!1,this.setupScrollPrevention(et)):nt.delay>0?(this.setupDelayTrigger(et),nt.triggerAllEvents&&(this.compute(et),this.emit())):this.startPointerDrag(et))}startPointerDrag(et){const nt=this.state;nt._active=!0,nt._preventScroll=!0,nt._delayed=!1,this.compute(et),this.emit()}pointerMove(et){const nt=this.state,rt=this.config;if(!nt._pointerActive)return;const it=pointerId(et);if(nt._pointerId!==void 0&&it!==nt._pointerId)return;const ot=pointerValues(et);if(document.pointerLockElement===et.target?nt._delta=[et.movementX,et.movementY]:(nt._delta=V$2.sub(ot,nt._values),this.computeValues(ot)),V$2.addTo(nt._movement,nt._delta),this.compute(et),nt._delayed&&nt.intentional){this.timeoutStore.remove("dragDelay"),nt.active=!1,this.startPointerDrag(et);return}if(rt.preventScrollAxis&&!nt._preventScroll)if(nt.axis)if(nt.axis===rt.preventScrollAxis||rt.preventScrollAxis==="xy"){nt._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(et);return}else return;this.emit()}pointerUp(et){this.ctrl.setEventIds(et);try{this.config.pointerCapture&&et.target.hasPointerCapture(et.pointerId)&&et.target.releasePointerCapture(et.pointerId)}catch{}const nt=this.state,rt=this.config;if(!nt._active||!nt._pointerActive)return;const it=pointerId(et);if(nt._pointerId!==void 0&&it!==nt._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(et);const[ot,at]=nt._distance;if(nt.tap=ot<=rt.tapsThreshold&&at<=rt.tapsThreshold,nt.tap&&rt.filterTaps)nt._force=!0;else{const[st,lt]=nt._delta,[ct,ut]=nt._movement,[ht,dt]=rt.swipe.velocity,[pt,mt]=rt.swipe.distance,gt=rt.swipe.duration;if(nt.elapsedTimeht&&Math.abs(ct)>pt&&(nt.swipe[0]=Math.sign(st)),bt>dt&&Math.abs(ut)>mt&&(nt.swipe[1]=Math.sign(lt))}}this.emit()}pointerClick(et){!this.state.tap&&et.detail>0&&(et.preventDefault(),et.stopPropagation())}setupPointer(et){const nt=this.config,rt=nt.device;nt.pointerLock&&et.currentTarget.requestPointerLock(),nt.pointerCapture||(this.eventStore.add(this.sharedConfig.window,rt,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,rt,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,rt,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(et){this.state._preventScroll&&et.cancelable&&et.preventDefault()}setupScrollPrevention(et){this.state._preventScroll=!1,persistEvent(et);const nt=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",nt),this.eventStore.add(this.sharedConfig.window,"touch","cancel",nt),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,et)}setupDelayTrigger(et){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(et)},this.config.delay)}keyDown(et){const nt=KEYS_DELTA_MAP[et.key];if(nt){const rt=this.state,it=et.shiftKey?10:et.altKey?.1:1;this.start(et),rt._delta=nt(this.config.keyboardDisplacement,it),rt._keyboardActive=!0,V$2.addTo(rt._movement,rt._delta),this.compute(et),this.emit()}}keyUp(et){et.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(et),this.emit())}bind(et){const nt=this.config.device;et(nt,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(et(nt,"change",this.pointerMove.bind(this)),et(nt,"end",this.pointerUp.bind(this)),et(nt,"cancel",this.pointerUp.bind(this)),et("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(et("key","down",this.keyDown.bind(this)),et("key","up",this.keyUp.bind(this))),this.config.filterTaps&&et("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function persistEvent(tt){"persist"in tt&&typeof tt.persist=="function"&&tt.persist()}const isBrowser$2=typeof window<"u"&&window.document&&window.document.createElement;function supportsTouchEvents(){return isBrowser$2&&"ontouchstart"in window}function isTouchScreen(){return supportsTouchEvents()||isBrowser$2&&window.navigator.maxTouchPoints>1}function supportsPointerEvents(){return isBrowser$2&&"onpointerdown"in window}function supportsPointerLock(){return isBrowser$2&&"exitPointerLock"in window.document}function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch{return!1}}const SUPPORT={isBrowser:isBrowser$2,gesture:supportsGestureEvents(),touch:supportsTouchEvents(),touchscreen:isTouchScreen(),pointer:supportsPointerEvents(),pointerLock:supportsPointerLock()},DEFAULT_PREVENT_SCROLL_DELAY=250,DEFAULT_DRAG_DELAY=180,DEFAULT_SWIPE_VELOCITY=.5,DEFAULT_SWIPE_DISTANCE=50,DEFAULT_SWIPE_DURATION=250,DEFAULT_KEYBOARD_DISPLACEMENT=10,DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{device(tt,et,{pointer:{touch:nt=!1,lock:rt=!1,mouse:it=!1}={}}){return this.pointerLock=rt&&SUPPORT.pointerLock,SUPPORT.touch&&nt?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!it?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(tt,et,{preventScroll:nt}){if(this.preventScrollDelay=typeof nt=="number"?nt:nt||nt===void 0&&tt?DEFAULT_PREVENT_SCROLL_DELAY:void 0,!(!SUPPORT.touchscreen||nt===!1))return tt||(nt!==void 0?"y":void 0)},pointerCapture(tt,et,{pointer:{capture:nt=!0,buttons:rt=1,keys:it=!0}={}}){return this.pointerButtons=rt,this.keys=it,!this.pointerLock&&this.device==="pointer"&&nt},threshold(tt,et,{filterTaps:nt=!1,tapsThreshold:rt=3,axis:it=void 0}){const ot=V$2.toVector(tt,nt?rt:it?1:0);return this.filterTaps=nt,this.tapsThreshold=rt,ot},swipe({velocity:tt=DEFAULT_SWIPE_VELOCITY,distance:et=DEFAULT_SWIPE_DISTANCE,duration:nt=DEFAULT_SWIPE_DURATION}={}){return{velocity:this.transform(V$2.toVector(tt)),distance:this.transform(V$2.toVector(et)),duration:nt}},delay(tt=0){switch(tt){case!0:return DEFAULT_DRAG_DELAY;case!1:return 0;default:return tt}},axisThreshold(tt){return tt?_objectSpread2$2(_objectSpread2$2({},DEFAULT_DRAG_AXIS_THRESHOLD),tt):DEFAULT_DRAG_AXIS_THRESHOLD},keyboardDisplacement(tt=DEFAULT_KEYBOARD_DISPLACEMENT){return tt}});_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{device(tt,et,{shared:nt,pointer:{touch:rt=!1}={}}){if(nt.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&rt)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(tt,et,{scaleBounds:nt={},angleBounds:rt={}}){const it=at=>{const st=assignDefault(call$2(nt,at),{min:-1/0,max:1/0});return[st.min,st.max]},ot=at=>{const st=assignDefault(call$2(rt,at),{min:-1/0,max:1/0});return[st.min,st.max]};return typeof nt!="function"&&typeof rt!="function"?[it(),ot()]:at=>[it(at),ot(at)]},threshold(tt,et,nt){return this.lockDirection=nt.axis==="lock",V$2.toVector(tt,this.lockDirection?[.1,3]:0)},modifierKey(tt){return tt===void 0?"ctrlKey":tt},pinchOnWheel(tt=!0){return tt}});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});const EngineMap=new Map,ConfigResolverMap=new Map;function registerAction(tt){EngineMap.set(tt.key,tt.engine),ConfigResolverMap.set(tt.key,tt.resolver)}const dragAction={key:"drag",engine:DragEngine,resolver:dragConfigResolver};function _objectWithoutPropertiesLoose$p(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}function _objectWithoutProperties$m(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$p(tt,et),rt,it;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(it=0;it=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}const sharedConfigResolver={target(tt){if(tt)return()=>"current"in tt?tt.current:tt},enabled(tt=!0){return tt},window(tt=SUPPORT.isBrowser?window:void 0){return tt},eventOptions({passive:tt=!0,capture:et=!1}={}){return{passive:tt,capture:et}},transform(tt){return tt}},_excluded$1K=["target","eventOptions","window","enabled","transform"];function resolveWith(tt={},et){const nt={};for(const[rt,it]of Object.entries(et))switch(typeof it){case"function":nt[rt]=it.call(nt,tt[rt],rt,tt);break;case"object":nt[rt]=resolveWith(tt[rt],it);break;case"boolean":it&&(nt[rt]=tt[rt]);break}return nt}function parse$3(tt,et,nt={}){const rt=tt,{target:it,eventOptions:ot,window:at,enabled:st,transform:lt}=rt,ct=_objectWithoutProperties$m(rt,_excluded$1K);if(nt.shared=resolveWith({target:it,eventOptions:ot,window:at,enabled:st,transform:lt},sharedConfigResolver),et){const ut=ConfigResolverMap.get(et);nt[et]=resolveWith(_objectSpread2$2({shared:nt.shared},ct),ut)}else for(const ut in ct){const ht=ConfigResolverMap.get(ut);ht&&(nt[ut]=resolveWith(_objectSpread2$2({shared:nt.shared},ct[ut]),ht))}return nt}class EventStore{constructor(et,nt){_defineProperty$G(this,"_listeners",new Set),this._ctrl=et,this._gestureKey=nt}add(et,nt,rt,it,ot){const at=this._listeners,st=toDomEventType(nt,rt),lt=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},ct=_objectSpread2$2(_objectSpread2$2({},lt),ot);et.addEventListener(st,it,ct);const ut=()=>{et.removeEventListener(st,it,ct),at.delete(ut)};return at.add(ut),ut}clean(){this._listeners.forEach(et=>et()),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty$G(this,"_timeouts",new Map)}add(et,nt,rt=140,...it){this.remove(et),this._timeouts.set(et,window.setTimeout(nt,rt,...it))}remove(et){const nt=this._timeouts.get(et);nt&&window.clearTimeout(nt)}clean(){this._timeouts.forEach(et=>void window.clearTimeout(et)),this._timeouts.clear()}}let Controller$1=class{constructor(et){_defineProperty$G(this,"gestures",new Set),_defineProperty$G(this,"_targetEventStore",new EventStore(this)),_defineProperty$G(this,"gestureEventStores",{}),_defineProperty$G(this,"gestureTimeoutStores",{}),_defineProperty$G(this,"handlers",{}),_defineProperty$G(this,"config",{}),_defineProperty$G(this,"pointerIds",new Set),_defineProperty$G(this,"touchIds",new Set),_defineProperty$G(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),resolveGestures(this,et)}setEventIds(et){if(isTouch$1(et))return this.touchIds=new Set(touchIds(et)),this.touchIds;if("pointerId"in et)return et.type==="pointerup"||et.type==="pointercancel"?this.pointerIds.delete(et.pointerId):et.type==="pointerdown"&&this.pointerIds.add(et.pointerId),this.pointerIds}applyHandlers(et,nt){this.handlers=et,this.nativeHandlers=nt}applyConfig(et,nt){this.config=parse$3(et,nt,this.config)}clean(){this._targetEventStore.clean();for(const et of this.gestures)this.gestureEventStores[et].clean(),this.gestureTimeoutStores[et].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...et){const nt=this.config.shared,rt={};let it;if(!(nt.target&&(it=nt.target(),!it))){if(nt.enabled){for(const at of this.gestures){const st=this.config[at],lt=bindToProps(rt,st.eventOptions,!!it);if(st.enabled){const ct=EngineMap.get(at);new ct(this,et,at).bind(lt)}}const ot=bindToProps(rt,nt.eventOptions,!!it);for(const at in this.nativeHandlers)ot(at,"",st=>this.nativeHandlers[at](_objectSpread2$2(_objectSpread2$2({},this.state.shared),{},{event:st,args:et})),void 0,!0)}for(const ot in rt)rt[ot]=chain(...rt[ot]);if(!it)return rt;for(const ot in rt){const{device:at,capture:st,passive:lt}=parseProp(ot);this._targetEventStore.add(it,at,"",rt[ot],{capture:st,passive:lt})}}}};function setupGesture(tt,et){tt.gestures.add(et),tt.gestureEventStores[et]=new EventStore(tt,et),tt.gestureTimeoutStores[et]=new TimeoutStore}function resolveGestures(tt,et){et.drag&&setupGesture(tt,"drag"),et.wheel&&setupGesture(tt,"wheel"),et.scroll&&setupGesture(tt,"scroll"),et.move&&setupGesture(tt,"move"),et.pinch&&setupGesture(tt,"pinch"),et.hover&&setupGesture(tt,"hover")}const bindToProps=(tt,et,nt)=>(rt,it,ot,at={},st=!1)=>{var lt,ct;const ut=(lt=at.capture)!==null&<!==void 0?lt:et.capture,ht=(ct=at.passive)!==null&&ct!==void 0?ct:et.passive;let dt=st?rt:toHandlerProp(rt,it,ut);nt&&ht&&(dt+="Passive"),tt[dt]=tt[dt]||[],tt[dt].push(ot)};function useRecognizers(tt,et={},nt,rt){const it=React$1.useMemo(()=>new Controller$1(tt),[]);if(it.applyHandlers(tt,rt),it.applyConfig(et,nt),React$1.useEffect(it.effect.bind(it)),React$1.useEffect(()=>it.clean.bind(it),[]),et.target===void 0)return it.bind.bind(it)}function useDrag$2(tt,et){return registerAction(dragAction),useRecognizers({drag:tt},et||{},"drag")}function $e42e1063c40fb3ef$export$b9ecd428b558ff10(tt,et,{checkForDefaultPrevented:nt=!0}={}){return function(it){if(tt==null||tt(it),nt===!1||!it.defaultPrevented)return et==null?void 0:et(it)}}function $c512c27ab02ef895$export$50c7b4e9d9f19c1(tt,et=[]){let nt=[];function rt(ot,at){const st=reactExports.createContext(at),lt=nt.length;nt=[...nt,at];function ct(ht){const{scope:dt,children:pt,...mt}=ht,gt=(dt==null?void 0:dt[tt][lt])||st,yt=reactExports.useMemo(()=>mt,Object.values(mt));return reactExports.createElement(gt.Provider,{value:yt},pt)}function ut(ht,dt){const pt=(dt==null?void 0:dt[tt][lt])||st,mt=reactExports.useContext(pt);if(mt)return mt;if(at!==void 0)return at;throw new Error(`\`${ht}\` must be used within \`${ot}\``)}return ct.displayName=ot+"Provider",[ct,ut]}const it=()=>{const ot=nt.map(at=>reactExports.createContext(at));return function(st){const lt=(st==null?void 0:st[tt])||ot;return reactExports.useMemo(()=>({[`__scope${tt}`]:{...st,[tt]:lt}}),[st,lt])}};return it.scopeName=tt,[rt,$c512c27ab02ef895$var$composeContextScopes(it,...et)]}function $c512c27ab02ef895$var$composeContextScopes(...tt){const et=tt[0];if(tt.length===1)return et;const nt=()=>{const rt=tt.map(it=>({useScope:it(),scopeName:it.scopeName}));return function(ot){const at=rt.reduce((st,{useScope:lt,scopeName:ct})=>{const ht=lt(ot)[`__scope${ct}`];return{...st,...ht}},{});return reactExports.useMemo(()=>({[`__scope${et.scopeName}`]:at}),[at])}};return nt.scopeName=et.scopeName,nt}function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt){const et=reactExports.useRef(tt);return reactExports.useEffect(()=>{et.current=tt}),reactExports.useMemo(()=>(...nt)=>{var rt;return(rt=et.current)===null||rt===void 0?void 0:rt.call(et,...nt)},[])}function $addc16e1bbe58fd0$export$3a72a57244d6e765(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt);reactExports.useEffect(()=>{const rt=it=>{it.key==="Escape"&&nt(it)};return et.addEventListener("keydown",rt),()=>et.removeEventListener("keydown",rt)},[nt,et])}const $5cb92bef7577960e$var$CONTEXT_UPDATE="dismissableLayer.update",$5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",$5cb92bef7577960e$var$FOCUS_OUTSIDE="dismissableLayer.focusOutside";let $5cb92bef7577960e$var$originalBodyPointerEvents;const $5cb92bef7577960e$var$DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$5cb92bef7577960e$export$177fb62ff3ec1f22=reactExports.forwardRef((tt,et)=>{var nt;const{disableOutsidePointerEvents:rt=!1,onEscapeKeyDown:it,onPointerDownOutside:ot,onFocusOutside:at,onInteractOutside:st,onDismiss:lt,...ct}=tt,ut=reactExports.useContext($5cb92bef7577960e$var$DismissableLayerContext),[ht,dt]=reactExports.useState(null),pt=(nt=ht==null?void 0:ht.ownerDocument)!==null&&nt!==void 0?nt:globalThis==null?void 0:globalThis.document,[,mt]=reactExports.useState({}),gt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,Et=>dt(Et)),yt=Array.from(ut.layers),[bt]=[...ut.layersWithOutsidePointerEventsDisabled].slice(-1),wt=yt.indexOf(bt),xt=ht?yt.indexOf(ht):-1,kt=ut.layersWithOutsidePointerEventsDisabled.size>0,St=xt>=wt,Tt=$5cb92bef7577960e$var$usePointerDownOutside(Et=>{const Ct=Et.target,Lt=[...ut.branches].some(jt=>jt.contains(Ct));!St||Lt||(ot==null||ot(Et),st==null||st(Et),Et.defaultPrevented||lt==null||lt())},pt),At=$5cb92bef7577960e$var$useFocusOutside(Et=>{const Ct=Et.target;[...ut.branches].some(jt=>jt.contains(Ct))||(at==null||at(Et),st==null||st(Et),Et.defaultPrevented||lt==null||lt())},pt);return $addc16e1bbe58fd0$export$3a72a57244d6e765(Et=>{xt===ut.layers.size-1&&(it==null||it(Et),!Et.defaultPrevented&<&&(Et.preventDefault(),lt()))},pt),reactExports.useEffect(()=>{if(ht)return rt&&(ut.layersWithOutsidePointerEventsDisabled.size===0&&($5cb92bef7577960e$var$originalBodyPointerEvents=pt.body.style.pointerEvents,pt.body.style.pointerEvents="none"),ut.layersWithOutsidePointerEventsDisabled.add(ht)),ut.layers.add(ht),$5cb92bef7577960e$var$dispatchUpdate(),()=>{rt&&ut.layersWithOutsidePointerEventsDisabled.size===1&&(pt.body.style.pointerEvents=$5cb92bef7577960e$var$originalBodyPointerEvents)}},[ht,pt,rt,ut]),reactExports.useEffect(()=>()=>{ht&&(ut.layers.delete(ht),ut.layersWithOutsidePointerEventsDisabled.delete(ht),$5cb92bef7577960e$var$dispatchUpdate())},[ht,ut]),reactExports.useEffect(()=>{const Et=()=>mt({});return document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Et),()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Et)},[]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},ct,{ref:gt,style:{pointerEvents:kt?St?"auto":"none":void 0,...tt.style},onFocusCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocusCapture,At.onFocusCapture),onBlurCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlurCapture,At.onBlurCapture),onPointerDownCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDownCapture,Tt.onPointerDownCapture)}))});function $5cb92bef7577960e$var$usePointerDownOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),rt=reactExports.useRef(!1),it=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ot=st=>{if(st.target&&!rt.current){let ut=function(){$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE,nt,ct,{discrete:!0})};var lt=ut;const ct={originalEvent:st};st.pointerType==="touch"?(et.removeEventListener("click",it.current),it.current=ut,et.addEventListener("click",it.current,{once:!0})):ut()}else et.removeEventListener("click",it.current);rt.current=!1},at=window.setTimeout(()=>{et.addEventListener("pointerdown",ot)},0);return()=>{window.clearTimeout(at),et.removeEventListener("pointerdown",ot),et.removeEventListener("click",it.current)}},[et,nt]),{onPointerDownCapture:()=>rt.current=!0}}function $5cb92bef7577960e$var$useFocusOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),rt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const it=ot=>{ot.target&&!rt.current&&$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE,nt,{originalEvent:ot},{discrete:!1})};return et.addEventListener("focusin",it),()=>et.removeEventListener("focusin",it)},[et,nt]),{onFocusCapture:()=>rt.current=!0,onBlurCapture:()=>rt.current=!1}}function $5cb92bef7577960e$var$dispatchUpdate(){const tt=new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);document.dispatchEvent(tt)}function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(tt,et,nt,{discrete:rt}){const it=nt.originalEvent.target,ot=new CustomEvent(tt,{bubbles:!1,cancelable:!0,detail:nt});et&&it.addEventListener(tt,et,{once:!0}),rt?$8927f6f2acc4f386$export$6d1a0317bde7de7f(it,ot):it.dispatchEvent(ot)}const $9f79659886946c16$export$e5c5a5f917a5871c=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{},$1746a345f3d73bb7$var$useReactId=React$2["useId".toString()]||(()=>{});let $1746a345f3d73bb7$var$count=0;function $1746a345f3d73bb7$export$f680877a34711e37(tt){const[et,nt]=reactExports.useState($1746a345f3d73bb7$var$useReactId());return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{tt||nt(rt=>rt??String($1746a345f3d73bb7$var$count++))},[tt]),tt||(et?`radix-${et}`:"")}const sides=["top","right","bottom","left"],min$4=Math.min,max$5=Math.max,round$4=Math.round,floor=Math.floor,createCoords=tt=>({x:tt,y:tt}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$8(tt,et,nt){return max$5(tt,min$4(et,nt))}function evaluate$1(tt,et){return typeof tt=="function"?tt(et):tt}function getSide(tt){return tt.split("-")[0]}function getAlignment(tt){return tt.split("-")[1]}function getOppositeAxis(tt){return tt==="x"?"y":"x"}function getAxisLength(tt){return tt==="y"?"height":"width"}function getSideAxis(tt){return["top","bottom"].includes(getSide(tt))?"y":"x"}function getAlignmentAxis(tt){return getOppositeAxis(getSideAxis(tt))}function getAlignmentSides(tt,et,nt){nt===void 0&&(nt=!1);const rt=getAlignment(tt),it=getAlignmentAxis(tt),ot=getAxisLength(it);let at=it==="x"?rt===(nt?"end":"start")?"right":"left":rt==="start"?"bottom":"top";return et.reference[ot]>et.floating[ot]&&(at=getOppositePlacement$1(at)),[at,getOppositePlacement$1(at)]}function getExpandedPlacements(tt){const et=getOppositePlacement$1(tt);return[getOppositeAlignmentPlacement(tt),et,getOppositeAlignmentPlacement(et)]}function getOppositeAlignmentPlacement(tt){return tt.replace(/start|end/g,et=>oppositeAlignmentMap[et])}function getSideList(tt,et,nt){const rt=["left","right"],it=["right","left"],ot=["top","bottom"],at=["bottom","top"];switch(tt){case"top":case"bottom":return nt?et?it:rt:et?rt:it;case"left":case"right":return et?ot:at;default:return[]}}function getOppositeAxisPlacements(tt,et,nt,rt){const it=getAlignment(tt);let ot=getSideList(getSide(tt),nt==="start",rt);return it&&(ot=ot.map(at=>at+"-"+it),et&&(ot=ot.concat(ot.map(getOppositeAlignmentPlacement)))),ot}function getOppositePlacement$1(tt){return tt.replace(/left|right|bottom|top/g,et=>oppositeSideMap[et])}function expandPaddingObject(tt){return{top:0,right:0,bottom:0,left:0,...tt}}function getPaddingObject(tt){return typeof tt!="number"?expandPaddingObject(tt):{top:tt,right:tt,bottom:tt,left:tt}}function rectToClientRect$1(tt){return{...tt,top:tt.y,left:tt.x,right:tt.x+tt.width,bottom:tt.y+tt.height}}function computeCoordsFromPlacement(tt,et,nt){let{reference:rt,floating:it}=tt;const ot=getSideAxis(et),at=getAlignmentAxis(et),st=getAxisLength(at),lt=getSide(et),ct=ot==="y",ut=rt.x+rt.width/2-it.width/2,ht=rt.y+rt.height/2-it.height/2,dt=rt[st]/2-it[st]/2;let pt;switch(lt){case"top":pt={x:ut,y:rt.y-it.height};break;case"bottom":pt={x:ut,y:rt.y+rt.height};break;case"right":pt={x:rt.x+rt.width,y:ht};break;case"left":pt={x:rt.x-it.width,y:ht};break;default:pt={x:rt.x,y:rt.y}}switch(getAlignment(et)){case"start":pt[at]-=dt*(nt&&ct?-1:1);break;case"end":pt[at]+=dt*(nt&&ct?-1:1);break}return pt}const computePosition$1=async(tt,et,nt)=>{const{placement:rt="bottom",strategy:it="absolute",middleware:ot=[],platform:at}=nt,st=ot.filter(Boolean),lt=await(at.isRTL==null?void 0:at.isRTL(et));let ct=await at.getElementRects({reference:tt,floating:et,strategy:it}),{x:ut,y:ht}=computeCoordsFromPlacement(ct,rt,lt),dt=rt,pt={},mt=0;for(let gt=0;gt({name:"arrow",options:tt,async fn(et){const{x:nt,y:rt,placement:it,rects:ot,platform:at,elements:st,middlewareData:lt}=et,{element:ct,padding:ut=0}=evaluate$1(tt,et)||{};if(ct==null)return{};const ht=getPaddingObject(ut),dt={x:nt,y:rt},pt=getAlignmentAxis(it),mt=getAxisLength(pt),gt=await at.getDimensions(ct),yt=pt==="y",bt=yt?"top":"left",wt=yt?"bottom":"right",xt=yt?"clientHeight":"clientWidth",kt=ot.reference[mt]+ot.reference[pt]-dt[pt]-ot.floating[mt],St=dt[pt]-ot.reference[pt],Tt=await(at.getOffsetParent==null?void 0:at.getOffsetParent(ct));let At=Tt?Tt[xt]:0;(!At||!await(at.isElement==null?void 0:at.isElement(Tt)))&&(At=st.floating[xt]||ot.floating[mt]);const Et=kt/2-St/2,Ct=At/2-gt[mt]/2-1,Lt=min$4(ht[bt],Ct),jt=min$4(ht[wt],Ct),Rt=Lt,$t=At-gt[mt]-jt,vt=At/2-gt[mt]/2+Et,It=clamp$8(Rt,vt,$t),Ot=!lt.arrow&&getAlignment(it)!=null&&vt!=It&&ot.reference[mt]/2-(vtRt<=0)){var Ct,Lt;const Rt=(((Ct=ot.flip)==null?void 0:Ct.index)||0)+1,$t=St[Rt];if($t)return{data:{index:Rt,overflows:Et},reset:{placement:$t}};let vt=(Lt=Et.filter(It=>It.overflows[0]<=0).sort((It,Ot)=>It.overflows[1]-Ot.overflows[1])[0])==null?void 0:Lt.placement;if(!vt)switch(pt){case"bestFit":{var jt;const It=(jt=Et.map(Ot=>[Ot.placement,Ot.overflows.filter(Wt=>Wt>0).reduce((Wt,zt)=>Wt+zt,0)]).sort((Ot,Wt)=>Ot[1]-Wt[1])[0])==null?void 0:jt[0];It&&(vt=It);break}case"initialPlacement":vt=st;break}if(it!==vt)return{reset:{placement:vt}}}return{}}}};function getSideOffsets$1(tt,et){return{top:tt.top-et.height,right:tt.right-et.width,bottom:tt.bottom-et.height,left:tt.left-et.width}}function isAnySideFullyClipped$1(tt){return sides.some(et=>tt[et]>=0)}const hide$2=function(tt){return tt===void 0&&(tt={}),{name:"hide",options:tt,async fn(et){const{rects:nt}=et,{strategy:rt="referenceHidden",...it}=evaluate$1(tt,et);switch(rt){case"referenceHidden":{const ot=await detectOverflow$1(et,{...it,elementContext:"reference"}),at=getSideOffsets$1(ot,nt.reference);return{data:{referenceHiddenOffsets:at,referenceHidden:isAnySideFullyClipped$1(at)}}}case"escaped":{const ot=await detectOverflow$1(et,{...it,altBoundary:!0}),at=getSideOffsets$1(ot,nt.floating);return{data:{escapedOffsets:at,escaped:isAnySideFullyClipped$1(at)}}}default:return{}}}}};async function convertValueToCoords(tt,et){const{placement:nt,platform:rt,elements:it}=tt,ot=await(rt.isRTL==null?void 0:rt.isRTL(it.floating)),at=getSide(nt),st=getAlignment(nt),lt=getSideAxis(nt)==="y",ct=["left","top"].includes(at)?-1:1,ut=ot&<?-1:1,ht=evaluate$1(et,tt);let{mainAxis:dt,crossAxis:pt,alignmentAxis:mt}=typeof ht=="number"?{mainAxis:ht,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...ht};return st&&typeof mt=="number"&&(pt=st==="end"?mt*-1:mt),lt?{x:pt*ut,y:dt*ct}:{x:dt*ct,y:pt*ut}}const offset$3=function(tt){return tt===void 0&&(tt=0),{name:"offset",options:tt,async fn(et){const{x:nt,y:rt}=et,it=await convertValueToCoords(et,tt);return{x:nt+it.x,y:rt+it.y,data:it}}}},shift=function(tt){return tt===void 0&&(tt={}),{name:"shift",options:tt,async fn(et){const{x:nt,y:rt,placement:it}=et,{mainAxis:ot=!0,crossAxis:at=!1,limiter:st={fn:yt=>{let{x:bt,y:wt}=yt;return{x:bt,y:wt}}},...lt}=evaluate$1(tt,et),ct={x:nt,y:rt},ut=await detectOverflow$1(et,lt),ht=getSideAxis(getSide(it)),dt=getOppositeAxis(ht);let pt=ct[dt],mt=ct[ht];if(ot){const yt=dt==="y"?"top":"left",bt=dt==="y"?"bottom":"right",wt=pt+ut[yt],xt=pt-ut[bt];pt=clamp$8(wt,pt,xt)}if(at){const yt=ht==="y"?"top":"left",bt=ht==="y"?"bottom":"right",wt=mt+ut[yt],xt=mt-ut[bt];mt=clamp$8(wt,mt,xt)}const gt=st.fn({...et,[dt]:pt,[ht]:mt});return{...gt,data:{x:gt.x-nt,y:gt.y-rt}}}}},limitShift=function(tt){return tt===void 0&&(tt={}),{options:tt,fn(et){const{x:nt,y:rt,placement:it,rects:ot,middlewareData:at}=et,{offset:st=0,mainAxis:lt=!0,crossAxis:ct=!0}=evaluate$1(tt,et),ut={x:nt,y:rt},ht=getSideAxis(it),dt=getOppositeAxis(ht);let pt=ut[dt],mt=ut[ht];const gt=evaluate$1(st,et),yt=typeof gt=="number"?{mainAxis:gt,crossAxis:0}:{mainAxis:0,crossAxis:0,...gt};if(lt){const xt=dt==="y"?"height":"width",kt=ot.reference[dt]-ot.floating[xt]+yt.mainAxis,St=ot.reference[dt]+ot.reference[xt]-yt.mainAxis;ptSt&&(pt=St)}if(ct){var bt,wt;const xt=dt==="y"?"width":"height",kt=["top","left"].includes(getSide(it)),St=ot.reference[ht]-ot.floating[xt]+(kt&&((bt=at.offset)==null?void 0:bt[ht])||0)+(kt?0:yt.crossAxis),Tt=ot.reference[ht]+ot.reference[xt]+(kt?0:((wt=at.offset)==null?void 0:wt[ht])||0)-(kt?yt.crossAxis:0);mtTt&&(mt=Tt)}return{[dt]:pt,[ht]:mt}}}},size=function(tt){return tt===void 0&&(tt={}),{name:"size",options:tt,async fn(et){const{placement:nt,rects:rt,platform:it,elements:ot}=et,{apply:at=()=>{},...st}=evaluate$1(tt,et),lt=await detectOverflow$1(et,st),ct=getSide(nt),ut=getAlignment(nt),ht=getSideAxis(nt)==="y",{width:dt,height:pt}=rt.floating;let mt,gt;ct==="top"||ct==="bottom"?(mt=ct,gt=ut===(await(it.isRTL==null?void 0:it.isRTL(ot.floating))?"start":"end")?"left":"right"):(gt=ct,mt=ut==="end"?"top":"bottom");const yt=pt-lt[mt],bt=dt-lt[gt],wt=!et.middlewareData.shift;let xt=yt,kt=bt;if(ht){const Tt=dt-lt.left-lt.right;kt=ut||wt?min$4(bt,Tt):Tt}else{const Tt=pt-lt.top-lt.bottom;xt=ut||wt?min$4(yt,Tt):Tt}if(wt&&!ut){const Tt=max$5(lt.left,0),At=max$5(lt.right,0),Et=max$5(lt.top,0),Ct=max$5(lt.bottom,0);ht?kt=dt-2*(Tt!==0||At!==0?Tt+At:max$5(lt.left,lt.right)):xt=pt-2*(Et!==0||Ct!==0?Et+Ct:max$5(lt.top,lt.bottom))}await at({...et,availableWidth:kt,availableHeight:xt});const St=await it.getDimensions(ot.floating);return dt!==St.width||pt!==St.height?{reset:{rects:!0}}:{}}}};function getNodeName$1(tt){return isNode(tt)?(tt.nodeName||"").toLowerCase():"#document"}function getWindow$1(tt){var et;return(tt==null||(et=tt.ownerDocument)==null?void 0:et.defaultView)||window}function getDocumentElement$1(tt){var et;return(et=(isNode(tt)?tt.ownerDocument:tt.document)||window.document)==null?void 0:et.documentElement}function isNode(tt){return tt instanceof Node||tt instanceof getWindow$1(tt).Node}function isElement$1(tt){return tt instanceof Element||tt instanceof getWindow$1(tt).Element}function isHTMLElement$3(tt){return tt instanceof HTMLElement||tt instanceof getWindow$1(tt).HTMLElement}function isShadowRoot$1(tt){return typeof ShadowRoot>"u"?!1:tt instanceof ShadowRoot||tt instanceof getWindow$1(tt).ShadowRoot}function isOverflowElement(tt){const{overflow:et,overflowX:nt,overflowY:rt,display:it}=getComputedStyle$2(tt);return/auto|scroll|overlay|hidden|clip/.test(et+rt+nt)&&!["inline","contents"].includes(it)}function isTableElement$1(tt){return["table","td","th"].includes(getNodeName$1(tt))}function isContainingBlock(tt){const et=isWebKit(),nt=getComputedStyle$2(tt);return nt.transform!=="none"||nt.perspective!=="none"||(nt.containerType?nt.containerType!=="normal":!1)||!et&&(nt.backdropFilter?nt.backdropFilter!=="none":!1)||!et&&(nt.filter?nt.filter!=="none":!1)||["transform","perspective","filter"].some(rt=>(nt.willChange||"").includes(rt))||["paint","layout","strict","content"].some(rt=>(nt.contain||"").includes(rt))}function getContainingBlock$1(tt){let et=getParentNode$1(tt);for(;isHTMLElement$3(et)&&!isLastTraversableNode(et);){if(isContainingBlock(et))return et;et=getParentNode$1(et)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(tt){return["html","body","#document"].includes(getNodeName$1(tt))}function getComputedStyle$2(tt){return getWindow$1(tt).getComputedStyle(tt)}function getNodeScroll$1(tt){return isElement$1(tt)?{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}:{scrollLeft:tt.pageXOffset,scrollTop:tt.pageYOffset}}function getParentNode$1(tt){if(getNodeName$1(tt)==="html")return tt;const et=tt.assignedSlot||tt.parentNode||isShadowRoot$1(tt)&&tt.host||getDocumentElement$1(tt);return isShadowRoot$1(et)?et.host:et}function getNearestOverflowAncestor(tt){const et=getParentNode$1(tt);return isLastTraversableNode(et)?tt.ownerDocument?tt.ownerDocument.body:tt.body:isHTMLElement$3(et)&&isOverflowElement(et)?et:getNearestOverflowAncestor(et)}function getOverflowAncestors(tt,et,nt){var rt;et===void 0&&(et=[]),nt===void 0&&(nt=!0);const it=getNearestOverflowAncestor(tt),ot=it===((rt=tt.ownerDocument)==null?void 0:rt.body),at=getWindow$1(it);return ot?et.concat(at,at.visualViewport||[],isOverflowElement(it)?it:[],at.frameElement&&nt?getOverflowAncestors(at.frameElement):[]):et.concat(it,getOverflowAncestors(it,[],nt))}function getCssDimensions(tt){const et=getComputedStyle$2(tt);let nt=parseFloat(et.width)||0,rt=parseFloat(et.height)||0;const it=isHTMLElement$3(tt),ot=it?tt.offsetWidth:nt,at=it?tt.offsetHeight:rt,st=round$4(nt)!==ot||round$4(rt)!==at;return st&&(nt=ot,rt=at),{width:nt,height:rt,$:st}}function unwrapElement(tt){return isElement$1(tt)?tt:tt.contextElement}function getScale$1(tt){const et=unwrapElement(tt);if(!isHTMLElement$3(et))return createCoords(1);const nt=et.getBoundingClientRect(),{width:rt,height:it,$:ot}=getCssDimensions(et);let at=(ot?round$4(nt.width):nt.width)/rt,st=(ot?round$4(nt.height):nt.height)/it;return(!at||!Number.isFinite(at))&&(at=1),(!st||!Number.isFinite(st))&&(st=1),{x:at,y:st}}const noOffsets=createCoords(0);function getVisualOffsets(tt){const et=getWindow$1(tt);return!isWebKit()||!et.visualViewport?noOffsets:{x:et.visualViewport.offsetLeft,y:et.visualViewport.offsetTop}}function shouldAddVisualOffsets(tt,et,nt){return et===void 0&&(et=!1),!nt||et&&nt!==getWindow$1(tt)?!1:et}function getBoundingClientRect$1(tt,et,nt,rt){et===void 0&&(et=!1),nt===void 0&&(nt=!1);const it=tt.getBoundingClientRect(),ot=unwrapElement(tt);let at=createCoords(1);et&&(rt?isElement$1(rt)&&(at=getScale$1(rt)):at=getScale$1(tt));const st=shouldAddVisualOffsets(ot,nt,rt)?getVisualOffsets(ot):createCoords(0);let lt=(it.left+st.x)/at.x,ct=(it.top+st.y)/at.y,ut=it.width/at.x,ht=it.height/at.y;if(ot){const dt=getWindow$1(ot),pt=rt&&isElement$1(rt)?getWindow$1(rt):rt;let mt=dt.frameElement;for(;mt&&rt&&pt!==dt;){const gt=getScale$1(mt),yt=mt.getBoundingClientRect(),bt=getComputedStyle$2(mt),wt=yt.left+(mt.clientLeft+parseFloat(bt.paddingLeft))*gt.x,xt=yt.top+(mt.clientTop+parseFloat(bt.paddingTop))*gt.y;lt*=gt.x,ct*=gt.y,ut*=gt.x,ht*=gt.y,lt+=wt,ct+=xt,mt=getWindow$1(mt).frameElement}}return rectToClientRect$1({width:ut,height:ht,x:lt,y:ct})}function convertOffsetParentRelativeRectToViewportRelativeRect(tt){let{rect:et,offsetParent:nt,strategy:rt}=tt;const it=isHTMLElement$3(nt),ot=getDocumentElement$1(nt);if(nt===ot)return et;let at={scrollLeft:0,scrollTop:0},st=createCoords(1);const lt=createCoords(0);if((it||!it&&rt!=="fixed")&&((getNodeName$1(nt)!=="body"||isOverflowElement(ot))&&(at=getNodeScroll$1(nt)),isHTMLElement$3(nt))){const ct=getBoundingClientRect$1(nt);st=getScale$1(nt),lt.x=ct.x+nt.clientLeft,lt.y=ct.y+nt.clientTop}return{width:et.width*st.x,height:et.height*st.y,x:et.x*st.x-at.scrollLeft*st.x+lt.x,y:et.y*st.y-at.scrollTop*st.y+lt.y}}function getClientRects(tt){return Array.from(tt.getClientRects())}function getWindowScrollBarX$1(tt){return getBoundingClientRect$1(getDocumentElement$1(tt)).left+getNodeScroll$1(tt).scrollLeft}function getDocumentRect$1(tt){const et=getDocumentElement$1(tt),nt=getNodeScroll$1(tt),rt=tt.ownerDocument.body,it=max$5(et.scrollWidth,et.clientWidth,rt.scrollWidth,rt.clientWidth),ot=max$5(et.scrollHeight,et.clientHeight,rt.scrollHeight,rt.clientHeight);let at=-nt.scrollLeft+getWindowScrollBarX$1(tt);const st=-nt.scrollTop;return getComputedStyle$2(rt).direction==="rtl"&&(at+=max$5(et.clientWidth,rt.clientWidth)-it),{width:it,height:ot,x:at,y:st}}function getViewportRect$1(tt,et){const nt=getWindow$1(tt),rt=getDocumentElement$1(tt),it=nt.visualViewport;let ot=rt.clientWidth,at=rt.clientHeight,st=0,lt=0;if(it){ot=it.width,at=it.height;const ct=isWebKit();(!ct||ct&&et==="fixed")&&(st=it.offsetLeft,lt=it.offsetTop)}return{width:ot,height:at,x:st,y:lt}}function getInnerBoundingClientRect$1(tt,et){const nt=getBoundingClientRect$1(tt,!0,et==="fixed"),rt=nt.top+tt.clientTop,it=nt.left+tt.clientLeft,ot=isHTMLElement$3(tt)?getScale$1(tt):createCoords(1),at=tt.clientWidth*ot.x,st=tt.clientHeight*ot.y,lt=it*ot.x,ct=rt*ot.y;return{width:at,height:st,x:lt,y:ct}}function getClientRectFromClippingAncestor(tt,et,nt){let rt;if(et==="viewport")rt=getViewportRect$1(tt,nt);else if(et==="document")rt=getDocumentRect$1(getDocumentElement$1(tt));else if(isElement$1(et))rt=getInnerBoundingClientRect$1(et,nt);else{const it=getVisualOffsets(tt);rt={...et,x:et.x-it.x,y:et.y-it.y}}return rectToClientRect$1(rt)}function hasFixedPositionAncestor(tt,et){const nt=getParentNode$1(tt);return nt===et||!isElement$1(nt)||isLastTraversableNode(nt)?!1:getComputedStyle$2(nt).position==="fixed"||hasFixedPositionAncestor(nt,et)}function getClippingElementAncestors(tt,et){const nt=et.get(tt);if(nt)return nt;let rt=getOverflowAncestors(tt,[],!1).filter(st=>isElement$1(st)&&getNodeName$1(st)!=="body"),it=null;const ot=getComputedStyle$2(tt).position==="fixed";let at=ot?getParentNode$1(tt):tt;for(;isElement$1(at)&&!isLastTraversableNode(at);){const st=getComputedStyle$2(at),lt=isContainingBlock(at);!lt&&st.position==="fixed"&&(it=null),(ot?!lt&&!it:!lt&&st.position==="static"&&!!it&&["absolute","fixed"].includes(it.position)||isOverflowElement(at)&&!lt&&hasFixedPositionAncestor(tt,at))?rt=rt.filter(ut=>ut!==at):it=st,at=getParentNode$1(at)}return et.set(tt,rt),rt}function getClippingRect$1(tt){let{element:et,boundary:nt,rootBoundary:rt,strategy:it}=tt;const at=[...nt==="clippingAncestors"?getClippingElementAncestors(et,this._c):[].concat(nt),rt],st=at[0],lt=at.reduce((ct,ut)=>{const ht=getClientRectFromClippingAncestor(et,ut,it);return ct.top=max$5(ht.top,ct.top),ct.right=min$4(ht.right,ct.right),ct.bottom=min$4(ht.bottom,ct.bottom),ct.left=max$5(ht.left,ct.left),ct},getClientRectFromClippingAncestor(et,st,it));return{width:lt.right-lt.left,height:lt.bottom-lt.top,x:lt.left,y:lt.top}}function getDimensions$1(tt){return getCssDimensions(tt)}function getRectRelativeToOffsetParent(tt,et,nt){const rt=isHTMLElement$3(et),it=getDocumentElement$1(et),ot=nt==="fixed",at=getBoundingClientRect$1(tt,!0,ot,et);let st={scrollLeft:0,scrollTop:0};const lt=createCoords(0);if(rt||!rt&&!ot)if((getNodeName$1(et)!=="body"||isOverflowElement(it))&&(st=getNodeScroll$1(et)),rt){const ct=getBoundingClientRect$1(et,!0,ot,et);lt.x=ct.x+et.clientLeft,lt.y=ct.y+et.clientTop}else it&&(lt.x=getWindowScrollBarX$1(it));return{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function getTrueOffsetParent$1(tt,et){return!isHTMLElement$3(tt)||getComputedStyle$2(tt).position==="fixed"?null:et?et(tt):tt.offsetParent}function getOffsetParent$1(tt,et){const nt=getWindow$1(tt);if(!isHTMLElement$3(tt))return nt;let rt=getTrueOffsetParent$1(tt,et);for(;rt&&isTableElement$1(rt)&&getComputedStyle$2(rt).position==="static";)rt=getTrueOffsetParent$1(rt,et);return rt&&(getNodeName$1(rt)==="html"||getNodeName$1(rt)==="body"&&getComputedStyle$2(rt).position==="static"&&!isContainingBlock(rt))?nt:rt||getContainingBlock$1(tt)||nt}const getElementRects=async function(tt){let{reference:et,floating:nt,strategy:rt}=tt;const it=this.getOffsetParent||getOffsetParent$1,ot=this.getDimensions;return{reference:getRectRelativeToOffsetParent(et,await it(nt),rt),floating:{x:0,y:0,...await ot(nt)}}};function isRTL(tt){return getComputedStyle$2(tt).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement$1,getClippingRect:getClippingRect$1,getOffsetParent:getOffsetParent$1,getElementRects,getClientRects,getDimensions:getDimensions$1,getScale:getScale$1,isElement:isElement$1,isRTL};function observeMove(tt,et){let nt=null,rt;const it=getDocumentElement$1(tt);function ot(){clearTimeout(rt),nt&&nt.disconnect(),nt=null}function at(st,lt){st===void 0&&(st=!1),lt===void 0&&(lt=1),ot();const{left:ct,top:ut,width:ht,height:dt}=tt.getBoundingClientRect();if(st||et(),!ht||!dt)return;const pt=floor(ut),mt=floor(it.clientWidth-(ct+ht)),gt=floor(it.clientHeight-(ut+dt)),yt=floor(ct),wt={rootMargin:-pt+"px "+-mt+"px "+-gt+"px "+-yt+"px",threshold:max$5(0,min$4(1,lt))||1};let xt=!0;function kt(St){const Tt=St[0].intersectionRatio;if(Tt!==lt){if(!xt)return at();Tt?at(!1,Tt):rt=setTimeout(()=>{at(!1,1e-7)},100)}xt=!1}try{nt=new IntersectionObserver(kt,{...wt,root:it.ownerDocument})}catch{nt=new IntersectionObserver(kt,wt)}nt.observe(tt)}return at(!0),ot}function autoUpdate(tt,et,nt,rt){rt===void 0&&(rt={});const{ancestorScroll:it=!0,ancestorResize:ot=!0,elementResize:at=typeof ResizeObserver=="function",layoutShift:st=typeof IntersectionObserver=="function",animationFrame:lt=!1}=rt,ct=unwrapElement(tt),ut=it||ot?[...ct?getOverflowAncestors(ct):[],...getOverflowAncestors(et)]:[];ut.forEach(bt=>{it&&bt.addEventListener("scroll",nt,{passive:!0}),ot&&bt.addEventListener("resize",nt)});const ht=ct&&st?observeMove(ct,nt):null;let dt=-1,pt=null;at&&(pt=new ResizeObserver(bt=>{let[wt]=bt;wt&&wt.target===ct&&pt&&(pt.unobserve(et),cancelAnimationFrame(dt),dt=requestAnimationFrame(()=>{pt&&pt.observe(et)})),nt()}),ct&&!lt&&pt.observe(ct),pt.observe(et));let mt,gt=lt?getBoundingClientRect$1(tt):null;lt&&yt();function yt(){const bt=getBoundingClientRect$1(tt);gt&&(bt.x!==gt.x||bt.y!==gt.y||bt.width!==gt.width||bt.height!==gt.height)&&nt(),gt=bt,mt=requestAnimationFrame(yt)}return nt(),()=>{ut.forEach(bt=>{it&&bt.removeEventListener("scroll",nt),ot&&bt.removeEventListener("resize",nt)}),ht&&ht(),pt&&pt.disconnect(),pt=null,lt&&cancelAnimationFrame(mt)}}const computePosition=(tt,et,nt)=>{const rt=new Map,it={platform,...nt},ot={...it.platform,_c:rt};return computePosition$1(tt,et,{...it,platform:ot})},arrow$2=tt=>{function et(nt){return{}.hasOwnProperty.call(nt,"current")}return{name:"arrow",options:tt,fn(nt){const{element:rt,padding:it}=typeof tt=="function"?tt(nt):tt;return rt&&et(rt)?rt.current!=null?arrow$3({element:rt.current,padding:it}).fn(nt):{}:rt?arrow$3({element:rt,padding:it}).fn(nt):{}}}};var index$2=typeof document<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function deepEqual$3(tt,et){if(tt===et)return!0;if(typeof tt!=typeof et)return!1;if(typeof tt=="function"&&tt.toString()===et.toString())return!0;let nt,rt,it;if(tt&&et&&typeof tt=="object"){if(Array.isArray(tt)){if(nt=tt.length,nt!=et.length)return!1;for(rt=nt;rt--!==0;)if(!deepEqual$3(tt[rt],et[rt]))return!1;return!0}if(it=Object.keys(tt),nt=it.length,nt!==Object.keys(et).length)return!1;for(rt=nt;rt--!==0;)if(!{}.hasOwnProperty.call(et,it[rt]))return!1;for(rt=nt;rt--!==0;){const ot=it[rt];if(!(ot==="_owner"&&tt.$$typeof)&&!deepEqual$3(tt[ot],et[ot]))return!1}return!0}return tt!==tt&&et!==et}function getDPR(tt){return typeof window>"u"?1:(tt.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(tt,et){const nt=getDPR(tt);return Math.round(et*nt)/nt}function useLatestRef(tt){const et=reactExports.useRef(tt);return index$2(()=>{et.current=tt}),et}function useFloating(tt){tt===void 0&&(tt={});const{placement:et="bottom",strategy:nt="absolute",middleware:rt=[],platform:it,elements:{reference:ot,floating:at}={},transform:st=!0,whileElementsMounted:lt,open:ct}=tt,[ut,ht]=reactExports.useState({x:0,y:0,strategy:nt,placement:et,middlewareData:{},isPositioned:!1}),[dt,pt]=reactExports.useState(rt);deepEqual$3(dt,rt)||pt(rt);const[mt,gt]=reactExports.useState(null),[yt,bt]=reactExports.useState(null),wt=reactExports.useCallback(Ot=>{Ot!=Tt.current&&(Tt.current=Ot,gt(Ot))},[gt]),xt=reactExports.useCallback(Ot=>{Ot!==At.current&&(At.current=Ot,bt(Ot))},[bt]),kt=ot||mt,St=at||yt,Tt=reactExports.useRef(null),At=reactExports.useRef(null),Et=reactExports.useRef(ut),Ct=useLatestRef(lt),Lt=useLatestRef(it),jt=reactExports.useCallback(()=>{if(!Tt.current||!At.current)return;const Ot={placement:et,strategy:nt,middleware:dt};Lt.current&&(Ot.platform=Lt.current),computePosition(Tt.current,At.current,Ot).then(Wt=>{const zt={...Wt,isPositioned:!0};Rt.current&&!deepEqual$3(Et.current,zt)&&(Et.current=zt,reactDomExports.flushSync(()=>{ht(zt)}))})},[dt,et,nt,Lt]);index$2(()=>{ct===!1&&Et.current.isPositioned&&(Et.current.isPositioned=!1,ht(Ot=>({...Ot,isPositioned:!1})))},[ct]);const Rt=reactExports.useRef(!1);index$2(()=>(Rt.current=!0,()=>{Rt.current=!1}),[]),index$2(()=>{if(kt&&(Tt.current=kt),St&&(At.current=St),kt&&St){if(Ct.current)return Ct.current(kt,St,jt);jt()}},[kt,St,jt,Ct]);const $t=reactExports.useMemo(()=>({reference:Tt,floating:At,setReference:wt,setFloating:xt}),[wt,xt]),vt=reactExports.useMemo(()=>({reference:kt,floating:St}),[kt,St]),It=reactExports.useMemo(()=>{const Ot={position:nt,left:0,top:0};if(!vt.floating)return Ot;const Wt=roundByDPR(vt.floating,ut.x),zt=roundByDPR(vt.floating,ut.y);return st?{...Ot,transform:"translate("+Wt+"px, "+zt+"px)",...getDPR(vt.floating)>=1.5&&{willChange:"transform"}}:{position:nt,left:Wt,top:zt}},[nt,st,vt.floating,ut.x,ut.y]);return reactExports.useMemo(()=>({...ut,update:jt,refs:$t,elements:vt,floatingStyles:It}),[ut,jt,$t,vt,It])}const $7e8f5cd07187803e$export$21b07c8f274aebd5=reactExports.forwardRef((tt,et)=>{const{children:nt,width:rt=10,height:it=5,...ot}=tt;return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg,_extends$u({},ot,{ref:et,width:rt,height:it,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),tt.asChild?nt:reactExports.createElement("polygon",{points:"0,0 30,0 15,10"}))}),$7e8f5cd07187803e$export$be92b6f5f03c0fe9=$7e8f5cd07187803e$export$21b07c8f274aebd5;function $db6c3485150b8e66$export$1ab7ae714698c4b8(tt){const[et,nt]=reactExports.useState(void 0);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(tt){nt({width:tt.offsetWidth,height:tt.offsetHeight});const rt=new ResizeObserver(it=>{if(!Array.isArray(it)||!it.length)return;const ot=it[0];let at,st;if("borderBoxSize"in ot){const lt=ot.borderBoxSize,ct=Array.isArray(lt)?lt[0]:lt;at=ct.inlineSize,st=ct.blockSize}else at=tt.offsetWidth,st=tt.offsetHeight;nt({width:at,height:st})});return rt.observe(tt,{box:"border-box"}),()=>rt.unobserve(tt)}else nt(void 0)},[tt]),et}const $cf1ac5d9fe0e8206$var$POPPER_NAME="Popper",[$cf1ac5d9fe0e8206$var$createPopperContext,$cf1ac5d9fe0e8206$export$722aac194ae923]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME),[$cf1ac5d9fe0e8206$var$PopperProvider,$cf1ac5d9fe0e8206$var$usePopperContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME),$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9=tt=>{const{__scopePopper:et,children:nt}=tt,[rt,it]=reactExports.useState(null);return reactExports.createElement($cf1ac5d9fe0e8206$var$PopperProvider,{scope:et,anchor:rt,onAnchorChange:it},nt)},$cf1ac5d9fe0e8206$var$ANCHOR_NAME="PopperAnchor",$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d=reactExports.forwardRef((tt,et)=>{const{__scopePopper:nt,virtualRef:rt,...it}=tt,ot=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME,nt),at=reactExports.useRef(null),st=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,at);return reactExports.useEffect(()=>{ot.onAnchorChange((rt==null?void 0:rt.current)||at.current)}),rt?null:reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},it,{ref:st}))}),$cf1ac5d9fe0e8206$var$CONTENT_NAME="PopperContent",[$cf1ac5d9fe0e8206$var$PopperContentProvider,$cf1ac5d9fe0e8206$var$useContentContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME),$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc=reactExports.forwardRef((tt,et)=>{var nt,rt,it,ot,at,st,lt,ct;const{__scopePopper:ut,side:ht="bottom",sideOffset:dt=0,align:pt="center",alignOffset:mt=0,arrowPadding:gt=0,avoidCollisions:yt=!0,collisionBoundary:bt=[],collisionPadding:wt=0,sticky:xt="partial",hideWhenDetached:kt=!1,updatePositionStrategy:St="optimized",onPlaced:Tt,...At}=tt,Et=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME,ut),[Ct,Lt]=reactExports.useState(null),jt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,$n=>Lt($n)),[Rt,$t]=reactExports.useState(null),vt=$db6c3485150b8e66$export$1ab7ae714698c4b8(Rt),It=(nt=vt==null?void 0:vt.width)!==null&&nt!==void 0?nt:0,Ot=(rt=vt==null?void 0:vt.height)!==null&&rt!==void 0?rt:0,Wt=ht+(pt!=="center"?"-"+pt:""),zt=typeof wt=="number"?wt:{top:0,right:0,bottom:0,left:0,...wt},Ft=Array.isArray(bt)?bt:[bt],Nt=Ft.length>0,Ut={padding:zt,boundary:Ft.filter($cf1ac5d9fe0e8206$var$isNotNull),altBoundary:Nt},{refs:Pt,floatingStyles:Ht,placement:Qt,isPositioned:an,middlewareData:Yt}=useFloating({strategy:"fixed",placement:Wt,whileElementsMounted:(...$n)=>autoUpdate(...$n,{animationFrame:St==="always"}),elements:{reference:Et.anchor},middleware:[offset$3({mainAxis:dt+Ot,alignmentAxis:mt}),yt&&shift({mainAxis:!0,crossAxis:!1,limiter:xt==="partial"?limitShift():void 0,...Ut}),yt&&flip$2({...Ut}),size({...Ut,apply:({elements:$n,rects:Nn,availableWidth:En,availableHeight:sn})=>{const{width:pn,height:Tn}=Nn.reference,In=$n.floating.style;In.setProperty("--radix-popper-available-width",`${En}px`),In.setProperty("--radix-popper-available-height",`${sn}px`),In.setProperty("--radix-popper-anchor-width",`${pn}px`),In.setProperty("--radix-popper-anchor-height",`${Tn}px`)}}),Rt&&arrow$2({element:Rt,padding:gt}),$cf1ac5d9fe0e8206$var$transformOrigin({arrowWidth:It,arrowHeight:Ot}),kt&&hide$2({strategy:"referenceHidden",...Ut})]}),[nn,tn]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(Qt),dn=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Tt);$9f79659886946c16$export$e5c5a5f917a5871c(()=>{an&&(dn==null||dn())},[an,dn]);const wn=(it=Yt.arrow)===null||it===void 0?void 0:it.x,rn=(ot=Yt.arrow)===null||ot===void 0?void 0:ot.y,Zt=((at=Yt.arrow)===null||at===void 0?void 0:at.centerOffset)!==0,[vn,Cn]=reactExports.useState();return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{Ct&&Cn(window.getComputedStyle(Ct).zIndex)},[Ct]),reactExports.createElement("div",{ref:Pt.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ht,transform:an?Ht.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:vn,"--radix-popper-transform-origin":[(st=Yt.transformOrigin)===null||st===void 0?void 0:st.x,(lt=Yt.transformOrigin)===null||lt===void 0?void 0:lt.y].join(" ")},dir:tt.dir},reactExports.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider,{scope:ut,placedSide:nn,onArrowChange:$t,arrowX:wn,arrowY:rn,shouldHideArrow:Zt},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({"data-side":nn,"data-align":tn},At,{ref:jt,style:{...At.style,animation:an?void 0:"none",opacity:(ct=Yt.hide)!==null&&ct!==void 0&&ct.referenceHidden?0:void 0}}))))}),$cf1ac5d9fe0e8206$var$ARROW_NAME="PopperArrow",$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0=reactExports.forwardRef(function(et,nt){const{__scopePopper:rt,...it}=et,ot=$cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME,rt),at=$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[ot.placedSide];return reactExports.createElement("span",{ref:ot.onArrowChange,style:{position:"absolute",left:ot.arrowX,top:ot.arrowY,[at]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[ot.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[ot.placedSide],visibility:ot.shouldHideArrow?"hidden":void 0}},reactExports.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9,_extends$u({},it,{ref:nt,style:{...it.style,display:"block"}})))});function $cf1ac5d9fe0e8206$var$isNotNull(tt){return tt!==null}const $cf1ac5d9fe0e8206$var$transformOrigin=tt=>({name:"transformOrigin",options:tt,fn(et){var nt,rt,it,ot,at;const{placement:st,rects:lt,middlewareData:ct}=et,ht=((nt=ct.arrow)===null||nt===void 0?void 0:nt.centerOffset)!==0,dt=ht?0:tt.arrowWidth,pt=ht?0:tt.arrowHeight,[mt,gt]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(st),yt={start:"0%",center:"50%",end:"100%"}[gt],bt=((rt=(it=ct.arrow)===null||it===void 0?void 0:it.x)!==null&&rt!==void 0?rt:0)+dt/2,wt=((ot=(at=ct.arrow)===null||at===void 0?void 0:at.y)!==null&&ot!==void 0?ot:0)+pt/2;let xt="",kt="";return mt==="bottom"?(xt=ht?yt:`${bt}px`,kt=`${-pt}px`):mt==="top"?(xt=ht?yt:`${bt}px`,kt=`${lt.floating.height+pt}px`):mt==="right"?(xt=`${-pt}px`,kt=ht?yt:`${wt}px`):mt==="left"&&(xt=`${lt.floating.width+pt}px`,kt=ht?yt:`${wt}px`),{data:{x:xt,y:kt}}}});function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(tt){const[et,nt="center"]=tt.split("-");return[et,nt]}const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9=$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9,$cf1ac5d9fe0e8206$export$b688253958b8dfe7=$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d,$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2=$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc,$cf1ac5d9fe0e8206$export$21b07c8f274aebd5=$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;function $fe963b355347cc68$export$3e6543de14f8614f(tt,et){return reactExports.useReducer((nt,rt)=>{const it=et[nt][rt];return it??nt},tt)}const $921a889cee6df7e8$export$99c2b779aa4e8b8b=tt=>{const{present:et,children:nt}=tt,rt=$921a889cee6df7e8$var$usePresence(et),it=typeof nt=="function"?nt({present:rt.isPresent}):reactExports.Children.only(nt),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(rt.ref,it.ref);return typeof nt=="function"||rt.isPresent?reactExports.cloneElement(it,{ref:ot}):null};$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName="Presence";function $921a889cee6df7e8$var$usePresence(tt){const[et,nt]=reactExports.useState(),rt=reactExports.useRef({}),it=reactExports.useRef(tt),ot=reactExports.useRef("none"),at=tt?"mounted":"unmounted",[st,lt]=$fe963b355347cc68$export$3e6543de14f8614f(at,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const ct=$921a889cee6df7e8$var$getAnimationName(rt.current);ot.current=st==="mounted"?ct:"none"},[st]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const ct=rt.current,ut=it.current;if(ut!==tt){const dt=ot.current,pt=$921a889cee6df7e8$var$getAnimationName(ct);tt?lt("MOUNT"):pt==="none"||(ct==null?void 0:ct.display)==="none"?lt("UNMOUNT"):lt(ut&&dt!==pt?"ANIMATION_OUT":"UNMOUNT"),it.current=tt}},[tt,lt]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(et){const ct=ht=>{const pt=$921a889cee6df7e8$var$getAnimationName(rt.current).includes(ht.animationName);ht.target===et&&pt&&reactDomExports.flushSync(()=>lt("ANIMATION_END"))},ut=ht=>{ht.target===et&&(ot.current=$921a889cee6df7e8$var$getAnimationName(rt.current))};return et.addEventListener("animationstart",ut),et.addEventListener("animationcancel",ct),et.addEventListener("animationend",ct),()=>{et.removeEventListener("animationstart",ut),et.removeEventListener("animationcancel",ct),et.removeEventListener("animationend",ct)}}else lt("ANIMATION_END")},[et,lt]),{isPresent:["mounted","unmountSuspended"].includes(st),ref:reactExports.useCallback(ct=>{ct&&(rt.current=getComputedStyle(ct)),nt(ct)},[])}}function $921a889cee6df7e8$var$getAnimationName(tt){return(tt==null?void 0:tt.animationName)||"none"}function $71cd76cc60e0454e$export$6f32135080cb4c3({prop:tt,defaultProp:et,onChange:nt=()=>{}}){const[rt,it]=$71cd76cc60e0454e$var$useUncontrolledState({defaultProp:et,onChange:nt}),ot=tt!==void 0,at=ot?tt:rt,st=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(nt),lt=reactExports.useCallback(ct=>{if(ot){const ht=typeof ct=="function"?ct(tt):ct;ht!==tt&&st(ht)}else it(ct)},[ot,tt,it,st]);return[at,lt]}function $71cd76cc60e0454e$var$useUncontrolledState({defaultProp:tt,onChange:et}){const nt=reactExports.useState(tt),[rt]=nt,it=reactExports.useRef(rt),ot=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(et);return reactExports.useEffect(()=>{it.current!==rt&&(ot(rt),it.current=rt)},[rt,it,ot]),nt}const $ea1ef594cf570d83$export$439d29a4e110a164=reactExports.forwardRef((tt,et)=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$u({},tt,{ref:et,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...tt.style}}))),$ea1ef594cf570d83$export$be92b6f5f03c0fe9=$ea1ef594cf570d83$export$439d29a4e110a164,[$a093c7e1ec25a057$var$createTooltipContext,$a093c7e1ec25a057$export$1c540a2224f0d865]=$c512c27ab02ef895$export$50c7b4e9d9f19c1("Tooltip",[$cf1ac5d9fe0e8206$export$722aac194ae923]),$a093c7e1ec25a057$var$usePopperScope=$cf1ac5d9fe0e8206$export$722aac194ae923(),$a093c7e1ec25a057$var$PROVIDER_NAME="TooltipProvider",$a093c7e1ec25a057$var$TOOLTIP_OPEN="tooltip.open",[$a093c7e1ec25a057$var$TooltipProviderContextProvider,$a093c7e1ec25a057$var$useTooltipProviderContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PROVIDER_NAME),$a093c7e1ec25a057$var$TOOLTIP_NAME="Tooltip",[$a093c7e1ec25a057$var$TooltipContextProvider,$a093c7e1ec25a057$var$useTooltipContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME),$a093c7e1ec25a057$export$28c660c63b792dea=tt=>{const{__scopeTooltip:et,children:nt,open:rt,defaultOpen:it=!1,onOpenChange:ot,disableHoverableContent:at,delayDuration:st}=tt,lt=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TOOLTIP_NAME,tt.__scopeTooltip),ct=$a093c7e1ec25a057$var$usePopperScope(et),[ut,ht]=reactExports.useState(null),dt=$1746a345f3d73bb7$export$f680877a34711e37(),pt=reactExports.useRef(0),mt=at??lt.disableHoverableContent,gt=st??lt.delayDuration,yt=reactExports.useRef(!1),[bt=!1,wt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:rt,defaultProp:it,onChange:At=>{At?(lt.onOpen(),document.dispatchEvent(new CustomEvent($a093c7e1ec25a057$var$TOOLTIP_OPEN))):lt.onClose(),ot==null||ot(At)}}),xt=reactExports.useMemo(()=>bt?yt.current?"delayed-open":"instant-open":"closed",[bt]),kt=reactExports.useCallback(()=>{window.clearTimeout(pt.current),yt.current=!1,wt(!0)},[wt]),St=reactExports.useCallback(()=>{window.clearTimeout(pt.current),wt(!1)},[wt]),Tt=reactExports.useCallback(()=>{window.clearTimeout(pt.current),pt.current=window.setTimeout(()=>{yt.current=!0,wt(!0)},gt)},[gt,wt]);return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),reactExports.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9,ct,reactExports.createElement($a093c7e1ec25a057$var$TooltipContextProvider,{scope:et,contentId:dt,open:bt,stateAttribute:xt,trigger:ut,onTriggerChange:ht,onTriggerEnter:reactExports.useCallback(()=>{lt.isOpenDelayed?Tt():kt()},[lt.isOpenDelayed,Tt,kt]),onTriggerLeave:reactExports.useCallback(()=>{mt?St():window.clearTimeout(pt.current)},[St,mt]),onOpen:kt,onClose:St,disableHoverableContent:mt},nt))},$a093c7e1ec25a057$var$TRIGGER_NAME="TooltipTrigger",$a093c7e1ec25a057$export$8c610744efcf8a1d=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...rt}=tt,it=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),ot=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),at=$a093c7e1ec25a057$var$usePopperScope(nt),st=reactExports.useRef(null),lt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,st,it.onTriggerChange),ct=reactExports.useRef(!1),ut=reactExports.useRef(!1),ht=reactExports.useCallback(()=>ct.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",ht),[ht]),reactExports.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7,_extends$u({asChild:!0},at),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$u({"aria-describedby":it.open?it.contentId:void 0,"data-state":it.stateAttribute},rt,{ref:lt,onPointerMove:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerMove,dt=>{dt.pointerType!=="touch"&&!ut.current&&!ot.isPointerInTransitRef.current&&(it.onTriggerEnter(),ut.current=!0)}),onPointerLeave:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerLeave,()=>{it.onTriggerLeave(),ut.current=!1}),onPointerDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDown,()=>{ct.current=!0,document.addEventListener("pointerup",ht,{once:!0})}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocus,()=>{ct.current||it.onOpen()}),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlur,it.onClose),onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onClick,it.onClose)})))}),$a093c7e1ec25a057$var$PORTAL_NAME="TooltipPortal",[$a093c7e1ec25a057$var$PortalProvider,$a093c7e1ec25a057$var$usePortalContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME,{forceMount:void 0}),$a093c7e1ec25a057$var$CONTENT_NAME="TooltipContent",$a093c7e1ec25a057$export$e9003e2be37ec060=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),{forceMount:rt=nt.forceMount,side:it="top",...ot}=tt,at=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:rt||at.open},at.disableHoverableContent?reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$u({side:it},ot,{ref:et})):reactExports.createElement($a093c7e1ec25a057$var$TooltipContentHoverable,_extends$u({side:it},ot,{ref:et})))}),$a093c7e1ec25a057$var$TooltipContentHoverable=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),rt=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),it=reactExports.useRef(null),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,it),[at,st]=reactExports.useState(null),{trigger:lt,onClose:ct}=nt,ut=it.current,{onPointerInTransitChange:ht}=rt,dt=reactExports.useCallback(()=>{st(null),ht(!1)},[ht]),pt=reactExports.useCallback((mt,gt)=>{const yt=mt.currentTarget,bt={x:mt.clientX,y:mt.clientY},wt=$a093c7e1ec25a057$var$getExitSideFromRect(bt,yt.getBoundingClientRect()),xt=$a093c7e1ec25a057$var$getPaddedExitPoints(bt,wt),kt=$a093c7e1ec25a057$var$getPointsFromRect(gt.getBoundingClientRect()),St=$a093c7e1ec25a057$var$getHull([...xt,...kt]);st(St),ht(!0)},[ht]);return reactExports.useEffect(()=>()=>dt(),[dt]),reactExports.useEffect(()=>{if(lt&&ut){const mt=yt=>pt(yt,ut),gt=yt=>pt(yt,lt);return lt.addEventListener("pointerleave",mt),ut.addEventListener("pointerleave",gt),()=>{lt.removeEventListener("pointerleave",mt),ut.removeEventListener("pointerleave",gt)}}},[lt,ut,pt,dt]),reactExports.useEffect(()=>{if(at){const mt=gt=>{const yt=gt.target,bt={x:gt.clientX,y:gt.clientY},wt=(lt==null?void 0:lt.contains(yt))||(ut==null?void 0:ut.contains(yt)),xt=!$a093c7e1ec25a057$var$isPointInPolygon(bt,at);wt?dt():xt&&(dt(),ct())};return document.addEventListener("pointermove",mt),()=>document.removeEventListener("pointermove",mt)}},[lt,ut,at,ct,dt]),reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$u({},tt,{ref:ot}))}),[$a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,$a093c7e1ec25a057$var$useVisuallyHiddenContentContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME,{isInside:!1}),$a093c7e1ec25a057$var$TooltipContentImpl=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,children:rt,"aria-label":it,onEscapeKeyDown:ot,onPointerDownOutside:at,...st}=tt,lt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,nt),ct=$a093c7e1ec25a057$var$usePopperScope(nt),{onClose:ut}=lt;return reactExports.useEffect(()=>(document.addEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut),()=>document.removeEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut)),[ut]),reactExports.useEffect(()=>{if(lt.trigger){const ht=dt=>{const pt=dt.target;pt!=null&&pt.contains(lt.trigger)&&ut()};return window.addEventListener("scroll",ht,{capture:!0}),()=>window.removeEventListener("scroll",ht,{capture:!0})}},[lt.trigger,ut]),reactExports.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:ot,onPointerDownOutside:at,onFocusOutside:ht=>ht.preventDefault(),onDismiss:ut},reactExports.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2,_extends$u({"data-state":lt.stateAttribute},ct,st,{ref:et,style:{...st.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),reactExports.createElement($5e63c961fc1ce211$export$d9f1ccf0bdb05d45,null,rt),reactExports.createElement($a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,{scope:nt,isInside:!0},reactExports.createElement($ea1ef594cf570d83$export$be92b6f5f03c0fe9,{id:lt.contentId,role:"tooltip"},it||rt))))}),$a093c7e1ec25a057$var$ARROW_NAME="TooltipArrow",$a093c7e1ec25a057$export$c27ee0ad710f7559=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...rt}=tt,it=$a093c7e1ec25a057$var$usePopperScope(nt);return $a093c7e1ec25a057$var$useVisuallyHiddenContentContext($a093c7e1ec25a057$var$ARROW_NAME,nt).isInside?null:reactExports.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5,_extends$u({},it,rt,{ref:et}))});function $a093c7e1ec25a057$var$getExitSideFromRect(tt,et){const nt=Math.abs(et.top-tt.y),rt=Math.abs(et.bottom-tt.y),it=Math.abs(et.right-tt.x),ot=Math.abs(et.left-tt.x);switch(Math.min(nt,rt,it,ot)){case ot:return"left";case it:return"right";case nt:return"top";case rt:return"bottom";default:throw new Error("unreachable")}}function $a093c7e1ec25a057$var$getPaddedExitPoints(tt,et,nt=5){const rt=[];switch(et){case"top":rt.push({x:tt.x-nt,y:tt.y+nt},{x:tt.x+nt,y:tt.y+nt});break;case"bottom":rt.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y-nt});break;case"left":rt.push({x:tt.x+nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y+nt});break;case"right":rt.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x-nt,y:tt.y+nt});break}return rt}function $a093c7e1ec25a057$var$getPointsFromRect(tt){const{top:et,right:nt,bottom:rt,left:it}=tt;return[{x:it,y:et},{x:nt,y:et},{x:nt,y:rt},{x:it,y:rt}]}function $a093c7e1ec25a057$var$isPointInPolygon(tt,et){const{x:nt,y:rt}=tt;let it=!1;for(let ot=0,at=et.length-1;otrt!=ut>rt&&nt<(ct-st)*(rt-lt)/(ut-lt)+st&&(it=!it)}return it}function $a093c7e1ec25a057$var$getHull(tt){const et=tt.slice();return et.sort((nt,rt)=>nt.xrt.x?1:nt.yrt.y?1:0),$a093c7e1ec25a057$var$getHullPresorted(et)}function $a093c7e1ec25a057$var$getHullPresorted(tt){if(tt.length<=1)return tt.slice();const et=[];for(let rt=0;rt=2;){const ot=et[et.length-1],at=et[et.length-2];if((ot.x-at.x)*(it.y-at.y)>=(ot.y-at.y)*(it.x-at.x))et.pop();else break}et.push(it)}et.pop();const nt=[];for(let rt=tt.length-1;rt>=0;rt--){const it=tt[rt];for(;nt.length>=2;){const ot=nt[nt.length-1],at=nt[nt.length-2];if((ot.x-at.x)*(it.y-at.y)>=(ot.y-at.y)*(it.x-at.x))nt.pop();else break}nt.push(it)}return nt.pop(),et.length===1&&nt.length===1&&et[0].x===nt[0].x&&et[0].y===nt[0].y?et:et.concat(nt)}const $a093c7e1ec25a057$export$be92b6f5f03c0fe9=$a093c7e1ec25a057$export$28c660c63b792dea,$a093c7e1ec25a057$export$41fb9f06171c75f4=$a093c7e1ec25a057$export$8c610744efcf8a1d,$a093c7e1ec25a057$export$7c6e2c02157bb7d2=$a093c7e1ec25a057$export$e9003e2be37ec060,$a093c7e1ec25a057$export$21b07c8f274aebd5=$a093c7e1ec25a057$export$c27ee0ad710f7559;function _objectWithoutPropertiesLoose$o(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}function _objectWithoutProperties$l(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$o(tt,et),rt,it;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(it=0;it=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}let LevaErrors;(function(tt){tt[tt.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",tt[tt.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",tt[tt.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",tt[tt.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",tt[tt.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",tt[tt.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",tt[tt.THEME_ERROR=6]="THEME_ERROR",tt[tt.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",tt[tt.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",tt[tt.EMPTY_KEY=9]="EMPTY_KEY"})(LevaErrors||(LevaErrors={}));const ErrorList={[LevaErrors.UNSUPPORTED_INPUT]:(tt,et)=>[`An input with type \`${tt}\` input was found at path \`${et}\` but it's not supported yet.`],[LevaErrors.NO_COMPONENT_FOR_TYPE]:(tt,et)=>[`Type \`${tt}\` found at path \`${et}\` can't be displayed in panel because no component supports it yet.`],[LevaErrors.UNKNOWN_INPUT]:(tt,et)=>[`input at path \`${tt}\` is not recognized.`,et],[LevaErrors.DUPLICATE_KEYS]:(tt,et,nt)=>[`Key \`${tt}\` of path \`${et}\` already exists at path \`${nt}\`. Even nested keys need to be unique. Rename one of the keys.`],[LevaErrors.ALREADY_REGISTERED_TYPE]:tt=>[`Type ${tt} has already been registered. You can't register a component with the same type.`],[LevaErrors.CLIPBOARD_ERROR]:tt=>["Error copying the value",tt],[LevaErrors.THEME_ERROR]:(tt,et)=>[`Error accessing the theme \`${tt}.${et}\` value.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error getting the value at path \`${tt}\`. There is probably an error in your \`render\` function.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error accessing the value at path \`${tt}\``],[LevaErrors.INPUT_TYPE_OVERRIDE]:(tt,et,nt)=>[`Input at path \`${tt}\` already exists with type: \`${et}\`. Its type cannot be overridden with type \`${nt}\`.`],[LevaErrors.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function _log(tt,et,...nt){const[rt,...it]=ErrorList[et](...nt);console[tt]("LEVA: "+rt,...it)}const warn$3=_log.bind(null,"warn"),log$2=_log.bind(null,"log"),_excluded$a$1=["value"],_excluded2$4$1=["schema"],_excluded3$1$1=["value"],Schemas=[],Plugins={};function getValueType(tt){let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$a$1);for(let rt of Schemas){const it=rt(et,nt);if(it)return it}}function register(tt,et){let{schema:nt}=et,rt=_objectWithoutProperties$l(et,_excluded2$4$1);if(tt in Plugins){warn$3(LevaErrors.ALREADY_REGISTERED_TYPE,tt);return}Schemas.push((it,ot)=>nt(it,ot)&&tt),Plugins[tt]=rt}function createInternalPlugin(tt){return tt}function normalize$3$1(tt,et,nt,rt){const{normalize:it}=Plugins[tt];if(it)return it(et,nt,rt);if(typeof et!="object"||!("value"in et))return{value:et};const{value:ot}=et,at=_objectWithoutProperties$l(et,_excluded3$1$1);return{value:ot,settings:at}}function sanitize$4(tt,et,nt,rt,it,ot){const{sanitize:at}=Plugins[tt];return at?at(et,nt,rt,it,ot):et}function format$2$1(tt,et,nt){const{format:rt}=Plugins[tt];return rt?rt(et,nt):et}function _defineProperty$F(tt,et,nt){return et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$E(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);et&&(rt=rt.filter(function(it){return Object.getOwnPropertyDescriptor(tt,it).enumerable})),nt.push.apply(nt,rt)}return nt}function _objectSpread2$1(tt){for(var et=1;ettt>nt?nt:tt{if(tt===""||typeof tt=="number")return tt;try{const et=evaluate(tt);if(!isNaN(et))return et}catch{}return parseFloat(tt)},log10=Math.log(10);function getStep(tt){let et=Math.abs(+String(tt).replace(".",""));if(et===0)return .01;for(;et!==0&&et%10===0;)et/=10;const nt=Math.floor(Math.log(et)/log10)+1,rt=Math.floor(Math.log10(Math.abs(tt))),it=Math.pow(10,rt-nt);return Math.max(it,.001)}const range$8=(tt,et,nt)=>nt===et?0:(clamp$7(tt,et,nt)-et)/(nt-et),invertedRange=(tt,et,nt)=>tt*(nt-et)+et,getUid=()=>"_"+Math.random().toString(36).substr(2,9),parens=/\(([0-9+\-*/^ .]+)\)/,exp$1=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,mul=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,div=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,add$5=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,sub=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function evaluate(tt){if(isNaN(Number(tt)))if(parens.test(tt)){const et=tt.replace(parens,(nt,rt)=>String(evaluate(rt)));return evaluate(et)}else if(exp$1.test(tt)){const et=tt.replace(exp$1,(nt,rt,it)=>String(Math.pow(Number(rt),Number(it))));return evaluate(et)}else if(mul.test(tt)){const et=tt.replace(mul,(nt,rt,it)=>String(Number(rt)*Number(it)));return evaluate(et)}else if(div.test(tt)){const et=tt.replace(div,(nt,rt,it)=>{if(it!=0)return String(Number(rt)/Number(it));throw new Error("Division by zero")});return evaluate(et)}else if(add$5.test(tt)){const et=tt.replace(add$5,(nt,rt,it)=>String(Number(rt)+Number(it)));return evaluate(et)}else if(sub.test(tt)){const et=tt.replace(sub,(nt,rt,it)=>String(Number(rt)-Number(it)));return evaluate(et)}else return Number(tt);return Number(tt)}function pick$1(tt,et){return et.reduce((nt,rt)=>(tt&&tt.hasOwnProperty(rt)&&(nt[rt]=tt[rt]),nt),{})}function omit$1(tt,et){const nt=_objectSpread2$1({},tt);return et.forEach(rt=>rt in tt&&delete nt[rt]),nt}function mapArrayToKeys(tt,et){return tt.reduce((nt,rt,it)=>Object.assign(nt,{[et[it]]:rt}),{})}function isObject$o(tt){return Object.prototype.toString.call(tt)==="[object Object]"}const isEmptyObject$1=tt=>isObject$o(tt)&&Object.keys(tt).length===0;let SpecialInputs;(function(tt){tt.BUTTON="BUTTON",tt.BUTTON_GROUP="BUTTON_GROUP",tt.MONITOR="MONITOR",tt.FOLDER="FOLDER"})(SpecialInputs||(SpecialInputs={}));let LevaInputs;(function(tt){tt.SELECT="SELECT",tt.IMAGE="IMAGE",tt.NUMBER="NUMBER",tt.COLOR="COLOR",tt.STRING="STRING",tt.BOOLEAN="BOOLEAN",tt.INTERVAL="INTERVAL",tt.VECTOR3D="VECTOR3D",tt.VECTOR2D="VECTOR2D"})(LevaInputs||(LevaInputs={}));const _excluded$9$1=["type","__customInput"],_excluded2$3$1=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],_excluded3$6=["type"];function parseOptions(tt,et,nt={},rt){var it,ot;if(typeof tt!="object"||Array.isArray(tt))return{type:rt,input:tt,options:_objectSpread2$1({key:et,label:et,optional:!1,disabled:!1,order:0},nt)};if("__customInput"in tt){const{type:St,__customInput:Tt}=tt,At=_objectWithoutProperties$l(tt,_excluded$9$1);return parseOptions(Tt,et,At,St)}const{render:at,label:st,optional:lt,order:ct=0,disabled:ut,hint:ht,onChange:dt,onEditStart:pt,onEditEnd:mt,transient:gt}=tt,yt=_objectWithoutProperties$l(tt,_excluded2$3$1),bt=_objectSpread2$1({render:at,key:et,label:st??et,hint:ht,transient:gt??!!dt,onEditStart:pt,onEditEnd:mt,disabled:ut,optional:lt,order:ct},nt);let{type:wt}=yt,xt=_objectWithoutProperties$l(yt,_excluded3$6);if(wt=rt??wt,wt in SpecialInputs)return{type:wt,input:xt,options:bt};let kt;return rt&&isObject$o(xt)&&"value"in xt?kt=xt.value:kt=isEmptyObject$1(xt)?void 0:xt,{type:wt,input:kt,options:_objectSpread2$1(_objectSpread2$1({},bt),{},{onChange:dt,optional:(it=bt.optional)!==null&&it!==void 0?it:!1,disabled:(ot=bt.disabled)!==null&&ot!==void 0?ot:!1})}}function normalizeInput(tt,et,nt,rt){const it=parseOptions(tt,et),{type:ot,input:at,options:st}=it;if(ot)return ot in SpecialInputs?it:{type:ot,input:normalize$3$1(ot,at,nt,rt),options:st};let lt=getValueType(at);return lt?{type:lt,input:normalize$3$1(lt,at,nt,rt),options:st}:(lt=getValueType({value:at}),lt?{type:lt,input:normalize$3$1(lt,{value:at},nt,rt),options:st}:!1)}function updateInput(tt,et,nt,rt,it){const{value:ot,type:at,settings:st}=tt;tt.value=sanitizeValue({type:at,value:ot,settings:st},et,nt,rt),tt.fromPanel=it}const ValueError=function(et,nt,rt){this.type="LEVA_ERROR",this.message="LEVA: "+et,this.previousValue=nt,this.error=rt};function sanitizeValue({type:tt,value:et,settings:nt},rt,it,ot){const at=tt!=="SELECT"&&typeof rt=="function"?rt(et):rt;let st;try{st=sanitize$4(tt,at,nt,et,it,ot)}catch(lt){throw new ValueError(`The value \`${rt}\` did not result in a correct value.`,et,lt)}return dequal(st,et)?et:st}const debounce$6=(tt,et,nt=!1)=>{let rt=0;return function(){const it=arguments,ot=nt&&!rt,at=()=>tt.apply(this,it);window.clearTimeout(rt),rt=window.setTimeout(at,et),ot&&at()}},multiplyStep=tt=>tt.shiftKey?5:tt.altKey?1/5:1;function render(tt,et){const nt=console.error;console.error=()=>{},ReactDOM.render(tt,et),console.error=nt}const _excluded$8$1=["value"],_excluded2$2$1=["min","max"],schema$3=tt=>{if(typeof tt=="number")return!0;if(typeof tt=="string"){const et=parseFloat(tt);return isNaN(et)?!1:tt.substring((""+et).length).trim().length<4}return!1},sanitize$3=(tt,{min:et=-1/0,max:nt=1/0,suffix:rt})=>{const it=parseFloat(tt);if(tt===""||isNaN(it))throw Error("Invalid number");const ot=clamp$7(it,et,nt);return rt?ot+rt:ot},format$1$2=(tt,{pad:et=0,suffix:nt})=>{const rt=parseFloat(tt).toFixed(et);return nt?rt+nt:rt},normalize$2$2=tt=>{let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$8$1);const{min:rt=-1/0,max:it=1/0}=nt,ot=_objectWithoutProperties$l(nt,_excluded2$2$1);let at=parseFloat(et);const st=typeof et=="string"?et.substring((""+at).length):void 0;at=clamp$7(at,rt,it);let lt=nt.step;lt||(Number.isFinite(rt)?Number.isFinite(it)?lt=+(Math.abs(it-rt)/100).toPrecision(1):lt=+(Math.abs(at-rt)/100).toPrecision(1):Number.isFinite(it)&&(lt=+(Math.abs(it-at)/100).toPrecision(1)));const ct=lt?getStep(lt)*10:getStep(at);lt=lt||ct/10;const ut=Math.round(clamp$7(Math.log10(1/ct),0,2));return{value:st?at+st:at,settings:_objectSpread2$1({initialValue:at,step:lt,pad:ut,min:rt,max:it,suffix:st},ot)}},sanitizeStep$1=(tt,{step:et,initialValue:nt})=>{const rt=Math.round((tt-nt)/et);return nt+rt*et};var props$3$1=Object.freeze({__proto__:null,schema:schema$3,sanitize:sanitize$3,format:format$1$2,normalize:normalize$2$2,sanitizeStep:sanitizeStep$1});function _extends$t(){return _extends$t=Object.assign?Object.assign.bind():function(tt){for(var et=1;et({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function createStateClass(tt,et){const[nt,rt]=tt.split(" "),it={};return nt!=="none"&&(it.boxShadow=`${et.inset?"inset ":""}0 0 0 $borderWidths${[et.key]} $colors${nt!=="default"&&nt||et.borderColor}`),rt&&(it.backgroundColor=rt),it}const utils$r={$inputStyle:()=>tt=>createStateClass(tt,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>tt=>createStateClass(tt,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>tt=>createStateClass(tt,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>tt=>createStateClass(tt,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:styled$5,css:css$1,createTheme:createTheme$2,globalCss,keyframes:keyframes$1}=q$7({prefix:"leva",theme:getDefaultTheme(),utils:_objectSpread2$1(_objectSpread2$1({},utils$r),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:tt=>({"&:focus":utils$r.$focusStyle()(tt)}),$focusWithin:tt=>({"&:focus-within":utils$r.$focusStyle()(tt)}),$hover:tt=>({"&:hover":utils$r.$hoverStyle()(tt)}),$active:tt=>({"&:active":utils$r.$activeStyle()(tt)})})}),globalStyles=globalCss({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function mergeTheme(tt){const et=getDefaultTheme();if(!tt)return{theme:et,className:""};Object.keys(tt).forEach(rt=>{Object.assign(et[rt],tt[rt])});const nt=createTheme$2(et);return{theme:et,className:nt.className}}function useTh(tt,et){const{theme:nt}=reactExports.useContext(ThemeContext$3);if(!(tt in nt)||!(et in nt[tt]))return warn$3(LevaErrors.THEME_ERROR,tt,et),"";let rt=et;for(;;){let it=nt[tt][rt];if(typeof it=="string"&&it.charAt(0)==="$")rt=it.substr(1);else return it}}const StyledInput$2=styled$5("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),InnerLabel=styled$5("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${StyledInput$2}`]:{paddingLeft:0}}),InnerNumberLabel=styled$5(InnerLabel,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),InputContainer=styled$5("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),_excluded$7$2=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],_excluded2$1$2=["onUpdate"];function ValueInput(tt){let{innerLabel:et,value:nt,onUpdate:rt,onChange:it,onKeyDown:ot,type:at,id:st,inputType:lt="text",rows:ct=0}=tt,ut=_objectWithoutProperties$l(tt,_excluded$7$2);const{id:ht,emitOnEditStart:dt,emitOnEditEnd:pt,disabled:mt}=useInputContext(),gt=st||ht,yt=reactExports.useRef(null),bt=ct>0,wt=bt?"textarea":"input",xt=reactExports.useCallback(Tt=>At=>{const Et=At.currentTarget.value;Tt(Et)},[]);React$1.useEffect(()=>{const Tt=yt.current,At=xt(Et=>{rt(Et),pt()});return Tt==null||Tt.addEventListener("blur",At),()=>Tt==null?void 0:Tt.removeEventListener("blur",At)},[xt,rt,pt]);const kt=reactExports.useCallback(Tt=>{Tt.key==="Enter"&&xt(rt)(Tt)},[xt,rt]),St=Object.assign({as:wt},bt?{rows:ct}:{},ut);return React$1.createElement(InputContainer,{textArea:bt},et&&typeof et=="string"?React$1.createElement(InnerLabel,null,et):et,React$1.createElement(StyledInput$2,_extends$t({levaType:at,ref:yt,id:gt,type:lt,autoComplete:"off",spellCheck:"false",value:nt,onChange:xt(it),onFocus:()=>dt(),onKeyPress:kt,onKeyDown:ot,disabled:mt},St)))}function NumberInput(tt){let{onUpdate:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded2$1$2);const rt=reactExports.useCallback(ot=>et(parseNumber(ot)),[et]),it=reactExports.useCallback(ot=>{const at=ot.key==="ArrowUp"?1:ot.key==="ArrowDown"?-1:0;if(at){ot.preventDefault();const st=ot.altKey?.1:ot.shiftKey?10:1;et(lt=>parseFloat(lt)+at*st)}},[et]);return React$1.createElement(ValueInput,_extends$t({},nt,{onUpdate:rt,onKeyDown:it,type:"number"}))}const StyledFolder=styled$5("div",{}),StyledWrapper=styled$5("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),StyledTitle=styled$5("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & > svg`]:{opacity:1}}),StyledContent=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${StyledFolder}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),StyledRow=styled$5("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${StyledContent} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),StyledInputRow=styled$5(StyledRow,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),CopyLabelContainer=styled$5("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),StyledOptionalToggle=styled$5("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),StyledLabel=styled$5("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),StyledInputWrapper$1=styled$5("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${StyledLabel}`]:{pointerEvents:"auto"}}}}}),Overlay$1=styled$5("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),StyledToolTipContent=styled$5("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),ToolTipArrow=styled$5($a093c7e1ec25a057$export$21b07c8f274aebd5,{fill:"$toolTipBackground"});function Portal$1({children:tt}){const{className:et}=reactExports.useContext(ThemeContext$3);return React$1.createElement($f1701beae083dbae$export$be92b6f5f03c0fe9,{className:et},tt)}const _excluded$6$2=["align"];function OptionalToggle(){const{id:tt,disable:et,disabled:nt}=useInputContext();return React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledOptionalToggle,{id:tt+"__disable",type:"checkbox",checked:!nt,onChange:()=>et(!nt)}),React$1.createElement("label",{htmlFor:tt+"__disable"}))}function RawLabel(tt){const{id:et,optional:nt,hint:rt}=useInputContext(),it=tt.htmlFor||(et?{htmlFor:et}:null),ot=!rt&&typeof tt.children=="string"?{title:tt.children}:null;return React$1.createElement(React$1.Fragment,null,nt&&React$1.createElement(OptionalToggle,null),rt!==void 0?React$1.createElement($a093c7e1ec25a057$export$be92b6f5f03c0fe9,null,React$1.createElement($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0},React$1.createElement(StyledLabel,_extends$t({},it,tt))),React$1.createElement($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{side:"top",sideOffset:2},React$1.createElement(StyledToolTipContent,null,rt,React$1.createElement(ToolTipArrow,null)))):React$1.createElement(StyledLabel,_extends$t({},it,ot,tt)))}function Label$2(tt){let{align:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$6$2);const{value:rt,label:it,key:ot,disabled:at}=useInputContext(),{hideCopyButton:st}=usePanelSettingsContext(),lt=!st&&ot!==void 0,[ct,ut]=reactExports.useState(!1),ht=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[ot]:rt??""})),ut(!0)}catch{warn$3(LevaErrors.CLIPBOARD_ERROR,{[ot]:rt})}};return React$1.createElement(CopyLabelContainer,{align:et,onPointerLeave:()=>ut(!1)},React$1.createElement(RawLabel,nt),lt&&!at&&React$1.createElement("div",{title:`Click to copy ${typeof it=="string"?it:ot} value`},ct?React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):React$1.createElement("svg",{onClick:ht,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),React$1.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const _excluded$5$2=["toggled"],Svg$1=styled$5("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Chevron(tt){let{toggled:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$5$2);return React$1.createElement(Svg$1,_extends$t({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${et?0:-90}deg)`}},nt),React$1.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const _excluded$4$2=["input"];function Row(tt){let{input:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$4$2);return et?React$1.createElement(StyledInputRow,nt):React$1.createElement(StyledRow,nt)}function useInputSetters({value:tt,type:et,settings:nt,setValue:rt}){const[it,ot]=reactExports.useState(format$2$1(et,tt,nt)),at=reactExports.useRef(tt),st=reactExports.useRef(nt);st.current=nt;const lt=reactExports.useCallback(ut=>ot(format$2$1(et,ut,st.current)),[et]),ct=reactExports.useCallback(ut=>{try{rt(ut)}catch(ht){const{type:dt,previousValue:pt}=ht;if(dt!=="LEVA_ERROR")throw ht;lt(pt)}},[lt,rt]);return reactExports.useEffect(()=>{dequal(tt,at.current)||lt(tt),at.current=tt},[tt,lt]),{displayValue:it,onChange:ot,onUpdate:ct}}function useDrag$1(tt,et){const{emitOnEditStart:nt,emitOnEditEnd:rt}=useInputContext();return useDrag$2(it=>{it.first&&(document.body.classList.add("leva__panel__dragged"),nt==null||nt());const ot=tt(it);return it.last&&(document.body.classList.remove("leva__panel__dragged"),rt==null||rt()),ot},et)}function useCanvas2d(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),rt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const it=debounce$6(()=>{et.current.width=et.current.offsetWidth*window.devicePixelRatio,et.current.height=et.current.offsetHeight*window.devicePixelRatio,tt(et.current,nt.current)},250);return window.addEventListener("resize",it),rt.current||(it(),rt.current=!0),()=>window.removeEventListener("resize",it)},[tt]),reactExports.useEffect(()=>{nt.current=et.current.getContext("2d")},[]),[et,nt]}function useTransform(){const tt=reactExports.useRef(null),et=reactExports.useRef({x:0,y:0}),nt=reactExports.useCallback(rt=>{Object.assign(et.current,rt),tt.current&&(tt.current.style.transform=`translate3d(${et.current.x}px, ${et.current.y}px, 0)`)},[]);return[tt,nt]}const _excluded$3$2=["__refCount"],getInputAtPath=(tt,et)=>{if(!tt[et])return null;const nt=tt[et];return _objectWithoutProperties$l(nt,_excluded$3$2)};function useInput(tt){const et=useStoreContext(),[nt,rt]=reactExports.useState(getInputAtPath(et.getData(),tt)),it=reactExports.useCallback(ct=>et.setValueAtPath(tt,ct,!0),[tt,et]),ot=reactExports.useCallback(ct=>et.setSettingsAtPath(tt,ct),[tt,et]),at=reactExports.useCallback(ct=>et.disableInputAtPath(tt,ct),[tt,et]),st=reactExports.useCallback(()=>et.emitOnEditStart(tt),[tt,et]),lt=reactExports.useCallback(()=>et.emitOnEditEnd(tt),[tt,et]);return reactExports.useEffect(()=>{rt(getInputAtPath(et.getData(),tt));const ct=et.useStore.subscribe(ut=>getInputAtPath(ut.data,tt),rt,{equalityFn:shallow$2});return()=>ct()},[et,tt]),[nt,{set:it,setSettings:ot,disable:at,storeId:et.storeId,emitOnEditStart:st,emitOnEditEnd:lt}]}const RangeGrid=styled$5("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Range=styled$5("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Scrubber=styled$5("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),RangeWrapper=styled$5("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),Indicator=styled$5("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function RangeSlider({value:tt,min:et,max:nt,onDrag:rt,step:it,initialValue:ot}){const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(0),ct=useTh("sizes","scrubberWidth"),ut=useDrag$1(({event:dt,first:pt,xy:[mt],movement:[gt],memo:yt})=>{if(pt){const{width:wt,left:xt}=at.current.getBoundingClientRect();lt.current=wt-parseFloat(ct),yt=(dt==null?void 0:dt.target)===st.current?tt:invertedRange((mt-xt)/wt,et,nt)}const bt=yt+invertedRange(gt/lt.current,0,nt-et);return rt(sanitizeStep$1(bt,{step:it,initialValue:ot})),yt}),ht=range$8(tt,et,nt);return React$1.createElement(RangeWrapper,_extends$t({ref:at},ut()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:0,right:`${(1-ht)*100}%`}})),React$1.createElement(Scrubber,{ref:st,style:{left:`calc(${ht} * (100% - ${ct}))`}}))}const DraggableLabel=React$1.memo(({label:tt,onUpdate:et,step:nt,innerLabelTrim:rt})=>{const[it,ot]=reactExports.useState(!1),at=useDrag$1(({active:st,delta:[lt],event:ct,memo:ut=0})=>(ot(st),ut+=lt/2,Math.abs(ut)>=1&&(et(ht=>parseFloat(ht)+Math.floor(ut)*nt*multiplyStep(ct)),ut=0),ut));return React$1.createElement(InnerNumberLabel,_extends$t({dragging:it,title:tt.length>1?tt:""},at()),tt.slice(0,rt))});function Number$1({label:tt,id:et,displayValue:nt,onUpdate:rt,onChange:it,settings:ot,innerLabelTrim:at=1}){const st=at>0&&React$1.createElement(DraggableLabel,{label:tt,step:ot.step,onUpdate:rt,innerLabelTrim:at});return React$1.createElement(NumberInput,{id:et,value:String(nt),onUpdate:rt,onChange:it,innerLabel:st})}function NumberComponent(){const tt=useInputContext(),{label:et,value:nt,onUpdate:rt,settings:it,id:ot}=tt,{min:at,max:st}=it,lt=st!==1/0&&at!==-1/0;return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,et),React$1.createElement(RangeGrid,{hasRange:lt},lt&&React$1.createElement(RangeSlider,_extends$t({value:parseFloat(nt),onDrag:rt},it)),React$1.createElement(Number$1,_extends$t({},tt,{id:ot,label:"value",innerLabelTrim:lt?0:1}))))}const{sanitizeStep}=props$3$1,rest=_objectWithoutProperties$l(props$3$1,["sanitizeStep"]);var number$6=_objectSpread2$1({component:NumberComponent},rest);const schema$2$1=(tt,et)=>v8n().schema({options:v8n().passesAnyOf(v8n().object(),v8n().array())}).test(et),sanitize$2$1=(tt,{values:et})=>{if(et.indexOf(tt)<0)throw Error("Selected value doesn't match Select options");return tt},format$3=(tt,{values:et})=>et.indexOf(tt),normalize$1$2=tt=>{let{value:et,options:nt}=tt,rt,it;return Array.isArray(nt)?(it=nt,rt=nt.map(ot=>String(ot))):(it=Object.values(nt),rt=Object.keys(nt)),"value"in tt?it.includes(et)||(rt.unshift(String(et)),it.unshift(et)):et=it[0],Object.values(nt).includes(et)||(nt[String(et)]=et),{value:et,settings:{keys:rt,values:it}}};var props$2$1=Object.freeze({__proto__:null,schema:schema$2$1,sanitize:sanitize$2$1,format:format$3,normalize:normalize$1$2});const SelectContainer=styled$5("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),NativeSelect=styled$5("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),PresentationalSelect=styled$5("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${NativeSelect}:focus + &`]:{$focusStyle:""},[`${NativeSelect}:hover + &`]:{$hoverStyle:""}});function Select$4({displayValue:tt,value:et,onUpdate:nt,id:rt,settings:it,disabled:ot}){const{keys:at,values:st}=it,lt=reactExports.useRef();return et===st[tt]&&(lt.current=at[tt]),React$1.createElement(SelectContainer,null,React$1.createElement(NativeSelect,{id:rt,value:tt,onChange:ct=>nt(st[Number(ct.currentTarget.value)]),disabled:ot},at.map((ct,ut)=>React$1.createElement("option",{key:ct,value:ut},ct))),React$1.createElement(PresentationalSelect,null,lt.current),React$1.createElement(Chevron,{toggled:!0}))}function SelectComponent(){const{label:tt,value:et,displayValue:nt,onUpdate:rt,id:it,disabled:ot,settings:at}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Select$4,{id:it,value:et,displayValue:nt,onUpdate:rt,settings:at,disabled:ot}))}var select$1=_objectSpread2$1({component:SelectComponent},props$2$1);const schema$1$1=tt=>v8n().string().test(tt),sanitize$1$1=tt=>{if(typeof tt!="string")throw Error("Invalid string");return tt},normalize$5=({value:tt,editable:et=!0,rows:nt=!1})=>({value:tt,settings:{editable:et,rows:typeof nt=="number"?nt:nt?5:0}});var props$1$1=Object.freeze({__proto__:null,schema:schema$1$1,sanitize:sanitize$1$1,normalize:normalize$5});const _excluded$2$2=["displayValue","onUpdate","onChange","editable"],NonEditableString=styled$5("div",{whiteSpace:"pre-wrap"});function String$1(tt){let{displayValue:et,onUpdate:nt,onChange:rt,editable:it=!0}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$2);return it?React$1.createElement(ValueInput,_extends$t({value:et,onUpdate:nt,onChange:rt},ot)):React$1.createElement(NonEditableString,null,et)}function StringComponent(){const{label:tt,settings:et,displayValue:nt,onUpdate:rt,onChange:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(String$1,_extends$t({displayValue:nt,onUpdate:rt,onChange:it},et)))}var string$1=_objectSpread2$1({component:StringComponent},props$1$1);const schema$4=tt=>v8n().boolean().test(tt),sanitize$5=tt=>{if(typeof tt!="boolean")throw Error("Invalid boolean");return tt};var props$4=Object.freeze({__proto__:null,schema:schema$4,sanitize:sanitize$5});const StyledInputWrapper=styled$5("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Boolean$1({value:tt,onUpdate:et,id:nt,disabled:rt}){return React$1.createElement(StyledInputWrapper,null,React$1.createElement("input",{id:nt,type:"checkbox",checked:tt,onChange:it=>et(it.currentTarget.checked),disabled:rt}),React$1.createElement("label",{htmlFor:nt},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},React$1.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function BooleanComponent(){const{label:tt,value:et,onUpdate:nt,disabled:rt,id:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Boolean$1,{value:et,onUpdate:nt,id:it,disabled:rt}))}var boolean=_objectSpread2$1({component:BooleanComponent},props$4);const _excluded$1$4=["locked"];function Coordinate({value:tt,id:et,valueKey:nt,settings:rt,onUpdate:it,innerLabelTrim:ot}){const at=reactExports.useRef(tt[nt]);at.current=tt[nt];const st=reactExports.useCallback(ct=>it({[nt]:sanitizeValue({type:"NUMBER",value:at.current,settings:rt},ct)}),[it,rt,nt]),lt=useInputSetters({type:"NUMBER",value:tt[nt],settings:rt,setValue:st});return React$1.createElement(Number$1,{id:et,label:nt,value:tt[nt],displayValue:lt.displayValue,onUpdate:lt.onUpdate,onChange:lt.onChange,settings:rt,innerLabelTrim:ot})}const Container$2=styled$5("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function Lock(tt){let{locked:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$4);return React$1.createElement("svg",_extends$t({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nt),et?React$1.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):React$1.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Vector({value:tt,onUpdate:et,settings:nt,innerLabelTrim:rt}){const{id:it,setSettings:ot}=useInputContext(),{lock:at,locked:st}=nt;return React$1.createElement(Container$2,{withLock:at},at&&React$1.createElement(Lock,{locked:st,onClick:()=>ot({locked:!st})}),Object.keys(tt).map((lt,ct)=>React$1.createElement(Coordinate,{id:ct===0?it:`${it}.${lt}`,key:lt,valueKey:lt,value:tt,settings:nt[lt],onUpdate:et,innerLabelTrim:rt})))}const normalizeKeyedNumberSettings=(tt,et)=>{const nt={};let rt=0,it=1/0;Object.entries(tt).forEach(([ot,at])=>{nt[ot]=normalize$2$2(_objectSpread2$1({value:at},et[ot])).settings,rt=Math.max(rt,nt[ot].step),it=Math.min(it,nt[ot].pad)});for(let ot in nt){const{step:at,min:st,max:lt}=et[ot]||{};!isFinite(at)&&(!isFinite(st)||!isFinite(lt))&&(nt[ot].step=rt,nt[ot].pad=it)}return nt},_excluded$1J=["lock"],_excluded2$j=["value"];function getVectorSchema(tt){const et=v8n().array().length(tt).every.number(),nt=rt=>{if(!rt||typeof rt!="object")return!1;const it=Object.values(rt);return it.length===tt&&it.every(ot=>isFinite(ot))};return rt=>et.test(rt)||nt(rt)}function getVectorType(tt){return Array.isArray(tt)?"array":"object"}function convert$6(tt,et,nt){return getVectorType(tt)===et?tt:et==="array"?Object.values(tt):mapArrayToKeys(tt,nt)}const sanitizeVector=(tt,et,nt)=>{const rt=convert$6(tt,"object",et.keys);for(let at in rt)rt[at]=sanitize$3(rt[at],et[at]);const it=Object.keys(rt);let ot={};if(it.length===et.keys.length)ot=rt;else{const at=convert$6(nt,"object",et.keys);if(it.length===1&&et.locked){const st=it[0],lt=rt[st],ct=at[st],ut=ct!==0?lt/ct:1;for(let ht in at)ht===st?ot[st]=lt:ot[ht]=at[ht]*ut}else ot=_objectSpread2$1(_objectSpread2$1({},at),rt)}return convert$6(ot,et.format,et.keys)},formatVector=(tt,et)=>convert$6(tt,"object",et.keys),isNumberSettings=tt=>!!tt&&("step"in tt||"min"in tt||"max"in tt);function normalizeVector(tt,et,nt=[]){const{lock:rt=!1}=et,it=_objectWithoutProperties$l(et,_excluded$1J),ot=Array.isArray(tt)?"array":"object",at=ot==="object"?Object.keys(tt):nt,st=convert$6(tt,"object",at),lt=isNumberSettings(it)?at.reduce((ut,ht)=>Object.assign(ut,{[ht]:it}),{}):it,ct=normalizeKeyedNumberSettings(st,lt);return{value:ot==="array"?tt:st,settings:_objectSpread2$1(_objectSpread2$1({},ct),{},{format:ot,keys:at,lock:rt,locked:!1})}}function getVectorPlugin(tt){return{schema:getVectorSchema(tt.length),normalize:et=>{let{value:nt}=et,rt=_objectWithoutProperties$l(et,_excluded2$j);return normalizeVector(nt,rt,tt)},format:(et,nt)=>formatVector(et,nt),sanitize:(et,nt,rt)=>sanitizeVector(et,nt,rt)}}var r$b={grad:.9,turn:360,rad:360/(2*Math.PI)},t$6=function(tt){return typeof tt=="string"?tt.length>0:typeof tt=="number"},n$6=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt+0},e$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt>et?tt:et},u$5=function(tt){return(tt=isFinite(tt)?tt%360:0)>0?tt:tt+360},a$3=function(tt){return{r:e$5(tt.r,0,255),g:e$5(tt.g,0,255),b:e$5(tt.b,0,255),a:e$5(tt.a)}},o$1=function(tt){return{r:n$6(tt.r),g:n$6(tt.g),b:n$6(tt.b),a:n$6(tt.a,3)}},i$6=/^#([0-9a-f]{3,8})$/i,s$4=function(tt){var et=tt.toString(16);return et.length<2?"0"+et:et},h$9=function(tt){var et=tt.r,nt=tt.g,rt=tt.b,it=tt.a,ot=Math.max(et,nt,rt),at=ot-Math.min(et,nt,rt),st=at?ot===et?(nt-rt)/at:ot===nt?2+(rt-et)/at:4+(et-nt)/at:0;return{h:60*(st<0?st+6:st),s:ot?at/ot*100:0,v:ot/255*100,a:it}},b$6=function(tt){var et=tt.h,nt=tt.s,rt=tt.v,it=tt.a;et=et/360*6,nt/=100,rt/=100;var ot=Math.floor(et),at=rt*(1-nt),st=rt*(1-(et-ot)*nt),lt=rt*(1-(1-et+ot)*nt),ct=ot%6;return{r:255*[rt,st,at,at,lt,rt][ct],g:255*[lt,rt,rt,st,at,at][ct],b:255*[at,at,lt,rt,rt,st][ct],a:it}},g$8=function(tt){return{h:u$5(tt.h),s:e$5(tt.s,0,100),l:e$5(tt.l,0,100),a:e$5(tt.a)}},d$5=function(tt){return{h:n$6(tt.h),s:n$6(tt.s),l:n$6(tt.l),a:n$6(tt.a,3)}},f$7=function(tt){return b$6((nt=(et=tt).s,{h:et.h,s:(nt*=((rt=et.l)<50?rt:100-rt)/100)>0?2*nt/(rt+nt)*100:0,v:rt+nt,a:et.a}));var et,nt,rt},c$7=function(tt){return{h:(et=h$9(tt)).h,s:(it=(200-(nt=et.s))*(rt=et.v)/100)>0&&it<200?nt*rt/100/(it<=100?it:200-it)*100:0,l:it/2,a:et.a};var et,nt,rt,it},l$5=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p$7=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v$7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m$7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y$7={string:[[function(tt){var et=i$6.exec(tt);return et?(tt=et[1]).length<=4?{r:parseInt(tt[0]+tt[0],16),g:parseInt(tt[1]+tt[1],16),b:parseInt(tt[2]+tt[2],16),a:tt.length===4?n$6(parseInt(tt[3]+tt[3],16)/255,2):1}:tt.length===6||tt.length===8?{r:parseInt(tt.substr(0,2),16),g:parseInt(tt.substr(2,2),16),b:parseInt(tt.substr(4,2),16),a:tt.length===8?n$6(parseInt(tt.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(tt){var et=v$7.exec(tt)||m$7.exec(tt);return et?et[2]!==et[4]||et[4]!==et[6]?null:a$3({r:Number(et[1])/(et[2]?100/255:1),g:Number(et[3])/(et[4]?100/255:1),b:Number(et[5])/(et[6]?100/255:1),a:et[7]===void 0?1:Number(et[7])/(et[8]?100:1)}):null},"rgb"],[function(tt){var et=l$5.exec(tt)||p$7.exec(tt);if(!et)return null;var nt,rt,it=g$8({h:(nt=et[1],rt=et[2],rt===void 0&&(rt="deg"),Number(nt)*(r$b[rt]||1)),s:Number(et[3]),l:Number(et[4]),a:et[5]===void 0?1:Number(et[5])/(et[6]?100:1)});return f$7(it)},"hsl"]],object:[[function(tt){var et=tt.r,nt=tt.g,rt=tt.b,it=tt.a,ot=it===void 0?1:it;return t$6(et)&&t$6(nt)&&t$6(rt)?a$3({r:Number(et),g:Number(nt),b:Number(rt),a:Number(ot)}):null},"rgb"],[function(tt){var et=tt.h,nt=tt.s,rt=tt.l,it=tt.a,ot=it===void 0?1:it;if(!t$6(et)||!t$6(nt)||!t$6(rt))return null;var at=g$8({h:Number(et),s:Number(nt),l:Number(rt),a:Number(ot)});return f$7(at)},"hsl"],[function(tt){var et=tt.h,nt=tt.s,rt=tt.v,it=tt.a,ot=it===void 0?1:it;if(!t$6(et)||!t$6(nt)||!t$6(rt))return null;var at=function(st){return{h:u$5(st.h),s:e$5(st.s,0,100),v:e$5(st.v,0,100),a:e$5(st.a)}}({h:Number(et),s:Number(nt),v:Number(rt),a:Number(ot)});return b$6(at)},"hsv"]]},N$1=function(tt,et){for(var nt=0;nt=.5},tt.prototype.toHex=function(){return et=o$1(this.rgba),nt=et.r,rt=et.g,it=et.b,at=(ot=et.a)<1?s$4(n$6(255*ot)):"","#"+s$4(nt)+s$4(rt)+s$4(it)+at;var et,nt,rt,it,ot,at},tt.prototype.toRgb=function(){return o$1(this.rgba)},tt.prototype.toRgbString=function(){return et=o$1(this.rgba),nt=et.r,rt=et.g,it=et.b,(ot=et.a)<1?"rgba("+nt+", "+rt+", "+it+", "+ot+")":"rgb("+nt+", "+rt+", "+it+")";var et,nt,rt,it,ot},tt.prototype.toHsl=function(){return d$5(c$7(this.rgba))},tt.prototype.toHslString=function(){return et=d$5(c$7(this.rgba)),nt=et.h,rt=et.s,it=et.l,(ot=et.a)<1?"hsla("+nt+", "+rt+"%, "+it+"%, "+ot+")":"hsl("+nt+", "+rt+"%, "+it+"%)";var et,nt,rt,it,ot},tt.prototype.toHsv=function(){return et=h$9(this.rgba),{h:n$6(et.h),s:n$6(et.s),v:n$6(et.v),a:n$6(et.a,3)};var et},tt.prototype.invert=function(){return w$5({r:255-(et=this.rgba).r,g:255-et.g,b:255-et.b,a:et.a});var et},tt.prototype.saturate=function(et){return et===void 0&&(et=.1),w$5(M$1(this.rgba,et))},tt.prototype.desaturate=function(et){return et===void 0&&(et=.1),w$5(M$1(this.rgba,-et))},tt.prototype.grayscale=function(){return w$5(M$1(this.rgba,-1))},tt.prototype.lighten=function(et){return et===void 0&&(et=.1),w$5($$2(this.rgba,et))},tt.prototype.darken=function(et){return et===void 0&&(et=.1),w$5($$2(this.rgba,-et))},tt.prototype.rotate=function(et){return et===void 0&&(et=15),this.hue(this.hue()+et)},tt.prototype.alpha=function(et){return typeof et=="number"?w$5({r:(nt=this.rgba).r,g:nt.g,b:nt.b,a:et}):n$6(this.rgba.a,3);var nt},tt.prototype.hue=function(et){var nt=c$7(this.rgba);return typeof et=="number"?w$5({h:et,s:nt.s,l:nt.l,a:nt.a}):n$6(nt.h)},tt.prototype.isEqual=function(et){return this.toHex()===w$5(et).toHex()},tt}(),w$5=function(tt){return tt instanceof j$1?tt:new j$1(tt)},S$2=[],k$8=function(tt){tt.forEach(function(et){S$2.indexOf(et)<0&&(et(j$1,y$7),S$2.push(et))})};function namesPlugin(tt,et){var nt={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},rt={};for(var it in nt)rt[nt[it]]=it;var ot={};tt.prototype.toName=function(at){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var st,lt,ct=rt[this.toHex()];if(ct)return ct;if(at!=null&&at.closest){var ut=this.toRgb(),ht=1/0,dt="black";if(!ot.length)for(var pt in nt)ot[pt]=new tt(nt[pt]).toRgb();for(var mt in nt){var gt=(st=ut,lt=ot[mt],Math.pow(st.r-lt.r,2)+Math.pow(st.g-lt.g,2)+Math.pow(st.b-lt.b,2));gt=0||(it[nt]=tt[nt]);return it}function i$5(tt){var et=reactExports.useRef(tt),nt=reactExports.useRef(function(rt){et.current&&et.current(rt)});return et.current=tt,nt.current}var s$3=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt0:yt.buttons>0)&&it.current?ot(d$4(it.current,yt,st.current)):gt(!1)},mt=function(){return gt(!1)};function gt(yt){var bt=lt.current,wt=v$6(it.current),xt=yt?wt.addEventListener:wt.removeEventListener;xt(bt?"touchmove":"mousemove",pt),xt(bt?"touchend":"mouseup",mt)}return[function(yt){var bt=yt.nativeEvent,wt=it.current;if(wt&&(h$8(bt),!function(kt,St){return St&&!f$6(kt)}(bt,lt.current)&&wt)){if(f$6(bt)){lt.current=!0;var xt=bt.changedTouches||[];xt.length&&(st.current=xt[0].identifier)}wt.focus(),ot(d$4(wt,bt,st.current)),gt(!0)}},function(yt){var bt=yt.which||yt.keyCode;bt<37||bt>40||(yt.preventDefault(),at({left:bt===39?.05:bt===37?-.05:0,top:bt===40?.05:bt===38?-.05:0}))},gt]},[at,ot]),ut=ct[0],ht=ct[1],dt=ct[2];return reactExports.useEffect(function(){return dt},[dt]),React$1.createElement("div",u$4({},rt,{onTouchStart:ut,onMouseDown:ut,className:"react-colorful__interactive",ref:it,onKeyDown:ht,tabIndex:0,role:"slider"}))}),g$7=function(tt){return tt.filter(Boolean).join(" ")},p$6=function(tt){var et=tt.color,nt=tt.left,rt=tt.top,it=rt===void 0?.5:rt,ot=g$7(["react-colorful__pointer",tt.className]);return React$1.createElement("div",{className:ot,style:{top:100*it+"%",left:100*nt+"%"}},React$1.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:et}}))},b$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt},y$6=function(tt){var et=tt.s,nt=tt.v,rt=tt.a,it=(200-et)*nt/100;return{h:b$5(tt.h),s:b$5(it>0&&it<200?et*nt/100/(it<=100?it:200-it)*100:0),l:b$5(it/2),a:b$5(rt,2)}},q$6=function(tt){var et=y$6(tt);return"hsl("+et.h+", "+et.s+"%, "+et.l+"%)"},k$7=function(tt){var et=y$6(tt);return"hsla("+et.h+", "+et.s+"%, "+et.l+"%, "+et.a+")"},I$1=function(tt){var et=tt.h,nt=tt.s,rt=tt.v,it=tt.a;et=et/360*6,nt/=100,rt/=100;var ot=Math.floor(et),at=rt*(1-nt),st=rt*(1-(et-ot)*nt),lt=rt*(1-(1-et+ot)*nt),ct=ot%6;return{r:b$5(255*[rt,st,at,at,lt,rt][ct]),g:b$5(255*[lt,rt,rt,st,at,at][ct]),b:b$5(255*[at,at,lt,rt,rt,st][ct]),a:b$5(it,2)}},L$1=function(tt){var et=tt.r,nt=tt.g,rt=tt.b,it=tt.a,ot=Math.max(et,nt,rt),at=ot-Math.min(et,nt,rt),st=at?ot===et?(nt-rt)/at:ot===nt?2+(rt-et)/at:4+(et-nt)/at:0;return{h:b$5(60*(st<0?st+6:st)),s:b$5(ot?at/ot*100:0),v:b$5(ot/255*100),a:it}},S$1=React$1.memo(function(tt){var et=tt.hue,nt=tt.onChange,rt=g$7(["react-colorful__hue",tt.className]);return React$1.createElement("div",{className:rt},React$1.createElement(m$6,{onMove:function(it){nt({h:360*it.left})},onKey:function(it){nt({h:s$3(et+360*it.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$5(et),"aria-valuemax":"360","aria-valuemin":"0"},React$1.createElement(p$6,{className:"react-colorful__hue-pointer",left:et/360,color:q$6({h:et,s:100,v:100,a:1})})))}),T$1=React$1.memo(function(tt){var et=tt.hsva,nt=tt.onChange,rt={backgroundColor:q$6({h:et.h,s:100,v:100,a:1})};return React$1.createElement("div",{className:"react-colorful__saturation",style:rt},React$1.createElement(m$6,{onMove:function(it){nt({s:100*it.left,v:100-100*it.top})},onKey:function(it){nt({s:s$3(et.s+100*it.left,0,100),v:s$3(et.v-100*it.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$5(et.s)+"%, Brightness "+b$5(et.v)+"%"},React$1.createElement(p$6,{className:"react-colorful__saturation-pointer",top:1-et.v/100,left:et.s/100,color:q$6(et)})))}),F$1=function(tt,et){if(tt===et)return!0;for(var nt in tt)if(tt[nt]!==et[nt])return!1;return!0};function Y$1(tt,et,nt){var rt=i$5(nt),it=reactExports.useState(function(){return tt.toHsva(et)}),ot=it[0],at=it[1],st=reactExports.useRef({color:et,hsva:ot});reactExports.useEffect(function(){if(!tt.equal(et,st.current.color)){var ct=tt.toHsva(et);st.current={hsva:ct,color:et},at(ct)}},[et,tt]),reactExports.useEffect(function(){var ct;F$1(ot,st.current.hsva)||tt.equal(ct=tt.fromHsva(ot),st.current.color)||(st.current={hsva:ot,color:ct},rt(ct))},[ot,tt,rt]);var lt=reactExports.useCallback(function(ct){at(function(ut){return Object.assign({},ut,ct)})},[]);return[ot,lt]}var V$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$1=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$1=new Map,Q$1=function(tt){V$1(function(){var et=tt.current?tt.current.ownerDocument:document;if(et!==void 0&&!J$1.has(et)){var nt=et.createElement("style");nt.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$1.set(et,nt);var rt=$$1();rt&&nt.setAttribute("nonce",rt),et.head.appendChild(nt)}},[])},U$1=function(tt){var et=tt.className,nt=tt.colorModel,rt=tt.color,it=rt===void 0?nt.defaultColor:rt,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,it,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut,className:"react-colorful__last-control"}))},ee$1=function(tt){var et=tt.className,nt=tt.hsva,rt=tt.onChange,it={backgroundImage:"linear-gradient(90deg, "+k$7(Object.assign({},nt,{a:0}))+", "+k$7(Object.assign({},nt,{a:1}))+")"},ot=g$7(["react-colorful__alpha",et]),at=b$5(100*nt.a);return React$1.createElement("div",{className:ot},React$1.createElement("div",{className:"react-colorful__alpha-gradient",style:it}),React$1.createElement(m$6,{onMove:function(st){rt({a:st.left})},onKey:function(st){rt({a:s$3(nt.a+st.left)})},"aria-label":"Alpha","aria-valuetext":at+"%","aria-valuenow":at,"aria-valuemin":"0","aria-valuemax":"100"},React$1.createElement(p$6,{className:"react-colorful__alpha-pointer",left:nt.a,color:k$7(nt)})))},re$3=function(tt){var et=tt.className,nt=tt.colorModel,rt=tt.color,it=rt===void 0?nt.defaultColor:rt,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,it,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut}),React$1.createElement(ee$1,{hsva:ct,onChange:ut,className:"react-colorful__last-control"}))},xe$1={defaultColor:{r:0,g:0,b:0,a:1},toHsva:L$1,fromHsva:I$1,equal:F$1},Ce=function(tt){return React$1.createElement(re$3,u$4({},tt,{colorModel:xe$1}))},Me$1={defaultColor:{r:0,g:0,b:0},toHsva:function(tt){return L$1({r:tt.r,g:tt.g,b:tt.b,a:1})},fromHsva:function(tt){return{r:(et=I$1(tt)).r,g:et.g,b:et.b};var et},equal:F$1},Ne$1=function(tt){return React$1.createElement(U$1,u$4({},tt,{colorModel:Me$1}))},propTypes$1={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function tt(rt,it,ot,at,st,lt){if(lt!==ReactPropTypesSecret){var ct=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw ct.name="Invariant Violation",ct}}tt.isRequired=tt;function et(){return tt}var nt={array:tt,bigint:tt,bool:tt,func:tt,number:tt,object:tt,string:tt,symbol:tt,any:tt,arrayOf:et,element:tt,elementType:tt,instanceOf:et,node:tt,objectOf:et,oneOf:et,oneOfType:et,shape:et,exact:et,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return nt.PropTypes=nt,nt};propTypes$1.exports=factoryWithThrowingShims();var propTypesExports=propTypes$1.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function __decorate(tt,et,nt,rt){var it=arguments.length,ot=it<3?et:rt===null?rt=Object.getOwnPropertyDescriptor(et,nt):rt,at;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ot=Reflect.decorate(tt,et,nt,rt);else for(var st=tt.length-1;st>=0;st--)(at=tt[st])&&(ot=(it<3?at(ot):it>3?at(et,nt,ot):at(et,nt))||ot);return it>3&&ot&&Object.defineProperty(et,nt,ot),ot}function __awaiter(tt,et,nt,rt){function it(ot){return ot instanceof nt?ot:new nt(function(at){at(ot)})}return new(nt||(nt=Promise))(function(ot,at){function st(ut){try{ct(rt.next(ut))}catch(ht){at(ht)}}function lt(ut){try{ct(rt.throw(ut))}catch(ht){at(ht)}}function ct(ut){ut.done?ot(ut.value):it(ut.value).then(st,lt)}ct((rt=rt.apply(tt,et||[])).next())})}function __generator(tt,et){var nt={label:0,sent:function(){if(ot[0]&1)throw ot[1];return ot[1]},trys:[],ops:[]},rt,it,ot,at;return at={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(at[Symbol.iterator]=function(){return this}),at;function st(ct){return function(ut){return lt([ct,ut])}}function lt(ct){if(rt)throw new TypeError("Generator is already executing.");for(;at&&(at=0,ct[0]&&(nt=0)),nt;)try{if(rt=1,it&&(ot=ct[0]&2?it.return:ct[0]?it.throw||((ot=it.return)&&ot.call(it),0):it.next)&&!(ot=ot.call(it,ct[1])).done)return ot;switch(it=0,ot&&(ct=[ct[0]&2,ot.value]),ct[0]){case 0:case 1:ot=ct;break;case 4:return nt.label++,{value:ct[1],done:!1};case 5:nt.label++,it=ct[1],ct=[0];continue;case 7:ct=nt.ops.pop(),nt.trys.pop();continue;default:if(ot=nt.trys,!(ot=ot.length>0&&ot[ot.length-1])&&(ct[0]===6||ct[0]===2)){nt=0;continue}if(ct[0]===3&&(!ot||ct[1]>ot[0]&&ct[1]0)&&!(it=rt.next()).done;)ot.push(it.value)}catch(st){at={error:st}}finally{try{it&&!it.done&&(nt=rt.return)&&nt.call(rt)}finally{if(at)throw at.error}}return ot}function __spread(){for(var tt=[],et=0;et0?rt:tt.name,writable:!1,configurable:!1,enumerable:!0})}return nt}function withMimeType(tt){var et=tt.name,nt=et&&et.lastIndexOf(".")!==-1;if(nt&&!tt.type){var rt=et.split(".").pop().toLowerCase(),it=COMMON_MIME_TYPES.get(rt);it&&Object.defineProperty(tt,"type",{value:it,writable:!1,configurable:!1,enumerable:!0})}return tt}var FILES_TO_IGNORE=[".DS_Store","Thumbs.db"];function fromEvent(tt){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(et){return isObject$n(tt)&&isDataTransfer(tt)?[2,getDataTransferFiles(tt.dataTransfer,tt.type)]:isChangeEvt(tt)?[2,getInputFiles(tt)]:Array.isArray(tt)&&tt.every(function(nt){return"getFile"in nt&&typeof nt.getFile=="function"})?[2,getFsHandleFiles(tt)]:[2,[]]})})}function isDataTransfer(tt){return isObject$n(tt.dataTransfer)}function isChangeEvt(tt){return isObject$n(tt)&&isObject$n(tt.target)}function isObject$n(tt){return typeof tt=="object"&&tt!==null}function getInputFiles(tt){return fromList(tt.target.files).map(function(et){return toFileWithPath(et)})}function getFsHandleFiles(tt){return __awaiter(this,void 0,void 0,function(){var et;return __generator(this,function(nt){switch(nt.label){case 0:return[4,Promise.all(tt.map(function(rt){return rt.getFile()}))];case 1:return et=nt.sent(),[2,et.map(function(rt){return toFileWithPath(rt)})]}})})}function getDataTransferFiles(tt,et){return __awaiter(this,void 0,void 0,function(){var nt,rt;return __generator(this,function(it){switch(it.label){case 0:return tt===null?[2,[]]:tt.items?(nt=fromList(tt.items).filter(function(ot){return ot.kind==="file"}),et!=="drop"?[2,nt]:[4,Promise.all(nt.map(toFilePromises))]):[3,2];case 1:return rt=it.sent(),[2,noIgnoredFiles(flatten$1(rt))];case 2:return[2,noIgnoredFiles(fromList(tt.files).map(function(ot){return toFileWithPath(ot)}))]}})})}function noIgnoredFiles(tt){return tt.filter(function(et){return FILES_TO_IGNORE.indexOf(et.name)===-1})}function fromList(tt){if(tt===null)return[];for(var et=[],nt=0;nttt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);ntnt)return[!1,getTooLargeRejectionErr(nt)];if(tt.sizent)return[!1,getTooLargeRejectionErr(nt)]}return[!0,null]}function isDefined$1(tt){return tt!=null}function allFilesAccepted(tt){var et=tt.files,nt=tt.accept,rt=tt.minSize,it=tt.maxSize,ot=tt.multiple,at=tt.maxFiles;return!ot&&et.length>1||ot&&at>=1&&et.length>at?!1:et.every(function(st){var lt=fileAccepted(st,nt),ct=_slicedToArray$e(lt,1),ut=ct[0],ht=fileMatchSize(st,rt,it),dt=_slicedToArray$e(ht,1),pt=dt[0];return ut&&pt})}function isPropagationStopped(tt){return typeof tt.isPropagationStopped=="function"?tt.isPropagationStopped():typeof tt.cancelBubble<"u"?tt.cancelBubble:!1}function isEvtWithFiles(tt){return tt.dataTransfer?Array.prototype.some.call(tt.dataTransfer.types,function(et){return et==="Files"||et==="application/x-moz-file"}):!!tt.target&&!!tt.target.files}function onDocumentDragOver(tt){tt.preventDefault()}function isIe(tt){return tt.indexOf("MSIE")!==-1||tt.indexOf("Trident/")!==-1}function isEdge$1(tt){return tt.indexOf("Edge/")!==-1}function isIeOrEdge(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return isIe(tt)||isEdge$1(tt)}function composeEventHandlers(){for(var tt=arguments.length,et=new Array(tt),nt=0;nt1?it-1:0),at=1;attt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}function _objectWithoutPropertiesLoose$n(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}var Dropzone=reactExports.forwardRef(function(tt,et){var nt=tt.children,rt=_objectWithoutProperties$k(tt,_excluded$1I),it=useDropzone(rt),ot=it.open,at=_objectWithoutProperties$k(it,_excluded2$i);return reactExports.useImperativeHandle(et,function(){return{open:ot}},[ot]),React$1.createElement(reactExports.Fragment,null,nt(_objectSpread$A(_objectSpread$A({},at),{},{open:ot})))});Dropzone.displayName="Dropzone";var defaultProps$7={disabled:!1,getFilesFromEvent:fromEvent,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};Dropzone.defaultProps=defaultProps$7;Dropzone.propTypes={children:PropTypes.func,accept:PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),multiple:PropTypes.bool,preventDropOnDocument:PropTypes.bool,noClick:PropTypes.bool,noKeyboard:PropTypes.bool,noDrag:PropTypes.bool,noDragEventsBubbling:PropTypes.bool,minSize:PropTypes.number,maxSize:PropTypes.number,maxFiles:PropTypes.number,disabled:PropTypes.bool,getFilesFromEvent:PropTypes.func,onFileDialogCancel:PropTypes.func,onFileDialogOpen:PropTypes.func,useFsAccessApi:PropTypes.bool,onDragEnter:PropTypes.func,onDragLeave:PropTypes.func,onDragOver:PropTypes.func,onDrop:PropTypes.func,onDropAccepted:PropTypes.func,onDropRejected:PropTypes.func,validator:PropTypes.func};var initialState$1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function useDropzone(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=_objectSpread$A(_objectSpread$A({},defaultProps$7),tt),nt=et.accept,rt=et.disabled,it=et.getFilesFromEvent,ot=et.maxSize,at=et.minSize,st=et.multiple,lt=et.maxFiles,ct=et.onDragEnter,ut=et.onDragLeave,ht=et.onDragOver,dt=et.onDrop,pt=et.onDropAccepted,mt=et.onDropRejected,gt=et.onFileDialogCancel,yt=et.onFileDialogOpen,bt=et.useFsAccessApi,wt=et.preventDropOnDocument,xt=et.noClick,kt=et.noKeyboard,St=et.noDrag,Tt=et.noDragEventsBubbling,At=et.validator,Et=reactExports.useMemo(function(){return typeof yt=="function"?yt:noop$a},[yt]),Ct=reactExports.useMemo(function(){return typeof gt=="function"?gt:noop$a},[gt]),Lt=reactExports.useRef(null),jt=reactExports.useRef(null),Rt=reactExports.useReducer(reducer,initialState$1),$t=_slicedToArray$d(Rt,2),vt=$t[0],It=$t[1],Ot=vt.isFocused,Wt=vt.isFileDialogActive,zt=vt.draggedFiles,Ft=reactExports.useRef(typeof window<"u"&&window.isSecureContext&&bt&&canUseFileSystemAccessAPI()),Nt=function(){!Ft.current&&Wt&&setTimeout(function(){if(jt.current){var fn=jt.current.files;fn.length||(It({type:"closeDialog"}),Ct())}},300)};reactExports.useEffect(function(){return window.addEventListener("focus",Nt,!1),function(){window.removeEventListener("focus",Nt,!1)}},[jt,Wt,Ct,Ft]);var Ut=reactExports.useRef([]),Pt=function(fn){Lt.current&&Lt.current.contains(fn.target)||(fn.preventDefault(),Ut.current=[])};reactExports.useEffect(function(){return wt&&(document.addEventListener("dragover",onDocumentDragOver,!1),document.addEventListener("drop",Pt,!1)),function(){wt&&(document.removeEventListener("dragover",onDocumentDragOver),document.removeEventListener("drop",Pt))}},[Lt,wt]);var Ht=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn),Ut.current=[].concat(_toConsumableArray$d(Ut.current),[hn.target]),isEvtWithFiles(hn)&&Promise.resolve(it(hn)).then(function(fn){isPropagationStopped(hn)&&!Tt||(It({draggedFiles:fn,isDragActive:!0,type:"setDraggedFiles"}),ct&&ct(hn))})},[it,ct,Tt]),Qt=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn);var fn=isEvtWithFiles(hn);if(fn&&hn.dataTransfer)try{hn.dataTransfer.dropEffect="copy"}catch{}return fn&&ht&&ht(hn),!1},[ht,Tt]),an=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn);var fn=Ut.current.filter(function(jn){return Lt.current&&Lt.current.contains(jn)}),xn=fn.indexOf(hn.target);xn!==-1&&fn.splice(xn,1),Ut.current=fn,!(fn.length>0)&&(It({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),isEvtWithFiles(hn)&&ut&&ut(hn))},[Lt,ut,Tt]),Yt=reactExports.useCallback(function(hn,fn){var xn=[],jn=[];hn.forEach(function(cn){var Xt=fileAccepted(cn,nt),Kt=_slicedToArray$d(Xt,2),kn=Kt[0],Mn=Kt[1],On=fileMatchSize(cn,at,ot),Bn=_slicedToArray$d(On,2),Xn=Bn[0],Vn=Bn[1],Gn=At?At(cn):null;if(kn&&Xn&&!Gn)xn.push(cn);else{var zn=[Mn,Vn];Gn&&(zn=zn.concat(Gn)),jn.push({file:cn,errors:zn.filter(function(Zn){return Zn})})}}),(!st&&xn.length>1||st&<>=1&&xn.length>lt)&&(xn.forEach(function(cn){jn.push({file:cn,errors:[TOO_MANY_FILES_REJECTION]})}),xn.splice(0)),It({acceptedFiles:xn,fileRejections:jn,type:"setFiles"}),dt&&dt(xn,jn,fn),jn.length>0&&mt&&mt(jn,fn),xn.length>0&&pt&&pt(xn,fn)},[It,st,nt,at,ot,lt,dt,pt,mt,At]),nn=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn),Ut.current=[],isEvtWithFiles(hn)&&Promise.resolve(it(hn)).then(function(fn){isPropagationStopped(hn)&&!Tt||Yt(fn,hn)}),It({type:"reset"})},[it,Yt,Tt]),tn=reactExports.useCallback(function(){if(Ft.current){It({type:"openDialog"}),Et();var hn={multiple:st,types:filePickerOptionsTypes(nt)};window.showOpenFilePicker(hn).then(function(fn){return it(fn)}).then(function(fn){Yt(fn,null),It({type:"closeDialog"})}).catch(function(fn){isAbort(fn)?(Ct(fn),It({type:"closeDialog"})):isSecurityError(fn)&&(Ft.current=!1,jt.current&&(jt.current.value=null,jt.current.click()))});return}jt.current&&(It({type:"openDialog"}),Et(),jt.current.value=null,jt.current.click())},[It,Et,Ct,bt,Yt,nt,st]),dn=reactExports.useCallback(function(hn){!Lt.current||!Lt.current.isEqualNode(hn.target)||(hn.key===" "||hn.key==="Enter"||hn.keyCode===32||hn.keyCode===13)&&(hn.preventDefault(),tn())},[Lt,tn]),wn=reactExports.useCallback(function(){It({type:"focus"})},[]),rn=reactExports.useCallback(function(){It({type:"blur"})},[]),Jt=reactExports.useCallback(function(){xt||(isIeOrEdge()?setTimeout(tn,0):tn())},[xt,tn]),vn=function(fn){return rt?null:fn},Cn=function(fn){return kt?null:vn(fn)},$n=function(fn){return St?null:vn(fn)},Nn=function(fn){Tt&&fn.stopPropagation()},En=reactExports.useMemo(function(){return function(){var hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fn=hn.refKey,xn=fn===void 0?"ref":fn,jn=hn.role,cn=hn.onKeyDown,Xt=hn.onFocus,Kt=hn.onBlur,kn=hn.onClick,Mn=hn.onDragEnter,On=hn.onDragOver,Bn=hn.onDragLeave,Xn=hn.onDrop,Vn=_objectWithoutProperties$k(hn,_excluded3$5);return _objectSpread$A(_objectSpread$A(_defineProperty$D({onKeyDown:Cn(composeEventHandlers(cn,dn)),onFocus:Cn(composeEventHandlers(Xt,wn)),onBlur:Cn(composeEventHandlers(Kt,rn)),onClick:vn(composeEventHandlers(kn,Jt)),onDragEnter:$n(composeEventHandlers(Mn,Ht)),onDragOver:$n(composeEventHandlers(On,Qt)),onDragLeave:$n(composeEventHandlers(Bn,an)),onDrop:$n(composeEventHandlers(Xn,nn)),role:typeof jn=="string"&&jn!==""?jn:"button"},xn,Lt),!rt&&!kt?{tabIndex:0}:{}),Vn)}},[Lt,dn,wn,rn,Jt,Ht,Qt,an,nn,kt,St,rt]),sn=reactExports.useCallback(function(hn){hn.stopPropagation()},[]),pn=reactExports.useMemo(function(){return function(){var hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fn=hn.refKey,xn=fn===void 0?"ref":fn,jn=hn.onChange,cn=hn.onClick,Xt=_objectWithoutProperties$k(hn,_excluded4),Kt=_defineProperty$D({accept:nt,multiple:st,type:"file",style:{display:"none"},onChange:vn(composeEventHandlers(jn,nn)),onClick:vn(composeEventHandlers(cn,sn)),tabIndex:-1},xn,jt);return _objectSpread$A(_objectSpread$A({},Kt),Xt)}},[jt,nt,st,nn,rt]),Tn=zt.length,In=Tn>0&&allFilesAccepted({files:zt,accept:nt,minSize:at,maxSize:ot,multiple:st,maxFiles:lt}),yn=Tn>0&&!In;return _objectSpread$A(_objectSpread$A({},vt),{},{isDragAccept:In,isDragReject:yn,isFocused:Ot&&!rt,getRootProps:En,getInputProps:pn,rootRef:Lt,inputRef:jt,open:vn(tn)})}function reducer(tt,et){switch(et.type){case"focus":return _objectSpread$A(_objectSpread$A({},tt),{},{isFocused:!0});case"blur":return _objectSpread$A(_objectSpread$A({},tt),{},{isFocused:!1});case"openDialog":return _objectSpread$A(_objectSpread$A({},initialState$1),{},{isFileDialogActive:!0});case"closeDialog":return _objectSpread$A(_objectSpread$A({},tt),{},{isFileDialogActive:!1});case"setDraggedFiles":var nt=et.isDragActive,rt=et.draggedFiles;return _objectSpread$A(_objectSpread$A({},tt),{},{draggedFiles:rt,isDragActive:nt});case"setFiles":return _objectSpread$A(_objectSpread$A({},tt),{},{acceptedFiles:et.acceptedFiles,fileRejections:et.fileRejections});case"reset":return _objectSpread$A({},initialState$1);default:return tt}}function noop$a(){}function createStore$4(tt){let et;const nt=new Set,rt=(ct,ut)=>{const ht=typeof ct=="function"?ct(et):ct;if(ht!==et){const dt=et;et=ut?ht:Object.assign({},et,ht),nt.forEach(pt=>pt(et,dt))}},it=()=>et,ot=(ct,ut=it,ht=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let dt=ut(et);function pt(){const mt=ut(et);if(!ht(dt,mt)){const gt=dt;ct(dt=mt,gt)}}return nt.add(pt),()=>nt.delete(pt)},lt={setState:rt,getState:it,subscribe:(ct,ut,ht)=>ut||ht?ot(ct,ut,ht):(nt.add(ct),()=>nt.delete(ct)),destroy:()=>nt.clear()};return et=tt(rt,it,lt),lt}const isSSR$3=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),useIsomorphicLayoutEffect$3=isSSR$3?reactExports.useEffect:reactExports.useLayoutEffect;function create$4(tt){const et=typeof tt=="function"?createStore$4(tt):tt,nt=(rt=et.getState,it=Object.is)=>{const[,ot]=reactExports.useReducer(yt=>yt+1,0),at=et.getState(),st=reactExports.useRef(at),lt=reactExports.useRef(rt),ct=reactExports.useRef(it),ut=reactExports.useRef(!1),ht=reactExports.useRef();ht.current===void 0&&(ht.current=rt(at));let dt,pt=!1;(st.current!==at||lt.current!==rt||ct.current!==it||ut.current)&&(dt=rt(at),pt=!it(ht.current,dt)),useIsomorphicLayoutEffect$3(()=>{pt&&(ht.current=dt),st.current=at,lt.current=rt,ct.current=it,ut.current=!1});const mt=reactExports.useRef(at);useIsomorphicLayoutEffect$3(()=>{const yt=()=>{try{const wt=et.getState(),xt=lt.current(wt);ct.current(ht.current,xt)||(st.current=wt,ht.current=xt,ot())}catch{ut.current=!0,ot()}},bt=et.subscribe(yt);return et.getState()!==mt.current&&yt(),bt},[]);const gt=pt?dt:ht.current;return reactExports.useDebugValue(gt),gt};return Object.assign(nt,et),nt[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const rt=[nt,et];return{next(){const it=rt.length<=0;return{value:rt.shift(),done:it}}}},nt}const subscribeWithSelector=tt=>(et,nt,rt)=>{const it=rt.subscribe;return rt.subscribe=(at,st,lt)=>{let ct=at;if(st){const ut=(lt==null?void 0:lt.equalityFn)||Object.is;let ht=at(rt.getState());ct=dt=>{const pt=at(dt);if(!ut(ht,pt)){const mt=ht;st(ht=pt,mt)}},lt!=null&<.fireImmediately&&st(ht,ht)}return it(ct)},tt(et,nt,rt)};/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$o(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$o(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$o(tt,et)}}function _arrayLikeToArray$o(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}function _objectWithoutPropertiesLoose$n(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}var Dropzone=reactExports.forwardRef(function(tt,et){var nt=tt.children,rt=_objectWithoutProperties$k(tt,_excluded$1I),it=useDropzone(rt),ot=it.open,at=_objectWithoutProperties$k(it,_excluded2$i);return reactExports.useImperativeHandle(et,function(){return{open:ot}},[ot]),React$1.createElement(reactExports.Fragment,null,nt(_objectSpread$A(_objectSpread$A({},at),{},{open:ot})))});Dropzone.displayName="Dropzone";var defaultProps$7={disabled:!1,getFilesFromEvent:fromEvent,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};Dropzone.defaultProps=defaultProps$7;Dropzone.propTypes={children:PropTypes.func,accept:PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),multiple:PropTypes.bool,preventDropOnDocument:PropTypes.bool,noClick:PropTypes.bool,noKeyboard:PropTypes.bool,noDrag:PropTypes.bool,noDragEventsBubbling:PropTypes.bool,minSize:PropTypes.number,maxSize:PropTypes.number,maxFiles:PropTypes.number,disabled:PropTypes.bool,getFilesFromEvent:PropTypes.func,onFileDialogCancel:PropTypes.func,onFileDialogOpen:PropTypes.func,useFsAccessApi:PropTypes.bool,onDragEnter:PropTypes.func,onDragLeave:PropTypes.func,onDragOver:PropTypes.func,onDrop:PropTypes.func,onDropAccepted:PropTypes.func,onDropRejected:PropTypes.func,validator:PropTypes.func};var initialState$1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function useDropzone(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=_objectSpread$A(_objectSpread$A({},defaultProps$7),tt),nt=et.accept,rt=et.disabled,it=et.getFilesFromEvent,ot=et.maxSize,at=et.minSize,st=et.multiple,lt=et.maxFiles,ct=et.onDragEnter,ut=et.onDragLeave,ht=et.onDragOver,dt=et.onDrop,pt=et.onDropAccepted,mt=et.onDropRejected,gt=et.onFileDialogCancel,yt=et.onFileDialogOpen,bt=et.useFsAccessApi,wt=et.preventDropOnDocument,xt=et.noClick,kt=et.noKeyboard,St=et.noDrag,Tt=et.noDragEventsBubbling,At=et.validator,Et=reactExports.useMemo(function(){return typeof yt=="function"?yt:noop$a},[yt]),Ct=reactExports.useMemo(function(){return typeof gt=="function"?gt:noop$a},[gt]),Lt=reactExports.useRef(null),jt=reactExports.useRef(null),Rt=reactExports.useReducer(reducer,initialState$1),$t=_slicedToArray$d(Rt,2),vt=$t[0],It=$t[1],Ot=vt.isFocused,Wt=vt.isFileDialogActive,zt=vt.draggedFiles,Ft=reactExports.useRef(typeof window<"u"&&window.isSecureContext&&bt&&canUseFileSystemAccessAPI()),Nt=function(){!Ft.current&&Wt&&setTimeout(function(){if(jt.current){var fn=jt.current.files;fn.length||(It({type:"closeDialog"}),Ct())}},300)};reactExports.useEffect(function(){return window.addEventListener("focus",Nt,!1),function(){window.removeEventListener("focus",Nt,!1)}},[jt,Wt,Ct,Ft]);var Ut=reactExports.useRef([]),Pt=function(fn){Lt.current&&Lt.current.contains(fn.target)||(fn.preventDefault(),Ut.current=[])};reactExports.useEffect(function(){return wt&&(document.addEventListener("dragover",onDocumentDragOver,!1),document.addEventListener("drop",Pt,!1)),function(){wt&&(document.removeEventListener("dragover",onDocumentDragOver),document.removeEventListener("drop",Pt))}},[Lt,wt]);var Ht=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn),Ut.current=[].concat(_toConsumableArray$d(Ut.current),[hn.target]),isEvtWithFiles(hn)&&Promise.resolve(it(hn)).then(function(fn){isPropagationStopped(hn)&&!Tt||(It({draggedFiles:fn,isDragActive:!0,type:"setDraggedFiles"}),ct&&ct(hn))})},[it,ct,Tt]),Qt=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn);var fn=isEvtWithFiles(hn);if(fn&&hn.dataTransfer)try{hn.dataTransfer.dropEffect="copy"}catch{}return fn&&ht&&ht(hn),!1},[ht,Tt]),an=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn);var fn=Ut.current.filter(function(jn){return Lt.current&&Lt.current.contains(jn)}),xn=fn.indexOf(hn.target);xn!==-1&&fn.splice(xn,1),Ut.current=fn,!(fn.length>0)&&(It({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),isEvtWithFiles(hn)&&ut&&ut(hn))},[Lt,ut,Tt]),Yt=reactExports.useCallback(function(hn,fn){var xn=[],jn=[];hn.forEach(function(cn){var Xt=fileAccepted(cn,nt),Kt=_slicedToArray$d(Xt,2),kn=Kt[0],Mn=Kt[1],On=fileMatchSize(cn,at,ot),Bn=_slicedToArray$d(On,2),Xn=Bn[0],Vn=Bn[1],Gn=At?At(cn):null;if(kn&&Xn&&!Gn)xn.push(cn);else{var zn=[Mn,Vn];Gn&&(zn=zn.concat(Gn)),jn.push({file:cn,errors:zn.filter(function(Jn){return Jn})})}}),(!st&&xn.length>1||st&<>=1&&xn.length>lt)&&(xn.forEach(function(cn){jn.push({file:cn,errors:[TOO_MANY_FILES_REJECTION]})}),xn.splice(0)),It({acceptedFiles:xn,fileRejections:jn,type:"setFiles"}),dt&&dt(xn,jn,fn),jn.length>0&&mt&&mt(jn,fn),xn.length>0&&pt&&pt(xn,fn)},[It,st,nt,at,ot,lt,dt,pt,mt,At]),nn=reactExports.useCallback(function(hn){hn.preventDefault(),hn.persist(),Nn(hn),Ut.current=[],isEvtWithFiles(hn)&&Promise.resolve(it(hn)).then(function(fn){isPropagationStopped(hn)&&!Tt||Yt(fn,hn)}),It({type:"reset"})},[it,Yt,Tt]),tn=reactExports.useCallback(function(){if(Ft.current){It({type:"openDialog"}),Et();var hn={multiple:st,types:filePickerOptionsTypes(nt)};window.showOpenFilePicker(hn).then(function(fn){return it(fn)}).then(function(fn){Yt(fn,null),It({type:"closeDialog"})}).catch(function(fn){isAbort(fn)?(Ct(fn),It({type:"closeDialog"})):isSecurityError(fn)&&(Ft.current=!1,jt.current&&(jt.current.value=null,jt.current.click()))});return}jt.current&&(It({type:"openDialog"}),Et(),jt.current.value=null,jt.current.click())},[It,Et,Ct,bt,Yt,nt,st]),dn=reactExports.useCallback(function(hn){!Lt.current||!Lt.current.isEqualNode(hn.target)||(hn.key===" "||hn.key==="Enter"||hn.keyCode===32||hn.keyCode===13)&&(hn.preventDefault(),tn())},[Lt,tn]),wn=reactExports.useCallback(function(){It({type:"focus"})},[]),rn=reactExports.useCallback(function(){It({type:"blur"})},[]),Zt=reactExports.useCallback(function(){xt||(isIeOrEdge()?setTimeout(tn,0):tn())},[xt,tn]),vn=function(fn){return rt?null:fn},Cn=function(fn){return kt?null:vn(fn)},$n=function(fn){return St?null:vn(fn)},Nn=function(fn){Tt&&fn.stopPropagation()},En=reactExports.useMemo(function(){return function(){var hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fn=hn.refKey,xn=fn===void 0?"ref":fn,jn=hn.role,cn=hn.onKeyDown,Xt=hn.onFocus,Kt=hn.onBlur,kn=hn.onClick,Mn=hn.onDragEnter,On=hn.onDragOver,Bn=hn.onDragLeave,Xn=hn.onDrop,Vn=_objectWithoutProperties$k(hn,_excluded3$5);return _objectSpread$A(_objectSpread$A(_defineProperty$D({onKeyDown:Cn(composeEventHandlers(cn,dn)),onFocus:Cn(composeEventHandlers(Xt,wn)),onBlur:Cn(composeEventHandlers(Kt,rn)),onClick:vn(composeEventHandlers(kn,Zt)),onDragEnter:$n(composeEventHandlers(Mn,Ht)),onDragOver:$n(composeEventHandlers(On,Qt)),onDragLeave:$n(composeEventHandlers(Bn,an)),onDrop:$n(composeEventHandlers(Xn,nn)),role:typeof jn=="string"&&jn!==""?jn:"button"},xn,Lt),!rt&&!kt?{tabIndex:0}:{}),Vn)}},[Lt,dn,wn,rn,Zt,Ht,Qt,an,nn,kt,St,rt]),sn=reactExports.useCallback(function(hn){hn.stopPropagation()},[]),pn=reactExports.useMemo(function(){return function(){var hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fn=hn.refKey,xn=fn===void 0?"ref":fn,jn=hn.onChange,cn=hn.onClick,Xt=_objectWithoutProperties$k(hn,_excluded4),Kt=_defineProperty$D({accept:nt,multiple:st,type:"file",style:{display:"none"},onChange:vn(composeEventHandlers(jn,nn)),onClick:vn(composeEventHandlers(cn,sn)),tabIndex:-1},xn,jt);return _objectSpread$A(_objectSpread$A({},Kt),Xt)}},[jt,nt,st,nn,rt]),Tn=zt.length,In=Tn>0&&allFilesAccepted({files:zt,accept:nt,minSize:at,maxSize:ot,multiple:st,maxFiles:lt}),yn=Tn>0&&!In;return _objectSpread$A(_objectSpread$A({},vt),{},{isDragAccept:In,isDragReject:yn,isFocused:Ot&&!rt,getRootProps:En,getInputProps:pn,rootRef:Lt,inputRef:jt,open:vn(tn)})}function reducer(tt,et){switch(et.type){case"focus":return _objectSpread$A(_objectSpread$A({},tt),{},{isFocused:!0});case"blur":return _objectSpread$A(_objectSpread$A({},tt),{},{isFocused:!1});case"openDialog":return _objectSpread$A(_objectSpread$A({},initialState$1),{},{isFileDialogActive:!0});case"closeDialog":return _objectSpread$A(_objectSpread$A({},tt),{},{isFileDialogActive:!1});case"setDraggedFiles":var nt=et.isDragActive,rt=et.draggedFiles;return _objectSpread$A(_objectSpread$A({},tt),{},{draggedFiles:rt,isDragActive:nt});case"setFiles":return _objectSpread$A(_objectSpread$A({},tt),{},{acceptedFiles:et.acceptedFiles,fileRejections:et.fileRejections});case"reset":return _objectSpread$A({},initialState$1);default:return tt}}function noop$a(){}function createStore$4(tt){let et;const nt=new Set,rt=(ct,ut)=>{const ht=typeof ct=="function"?ct(et):ct;if(ht!==et){const dt=et;et=ut?ht:Object.assign({},et,ht),nt.forEach(pt=>pt(et,dt))}},it=()=>et,ot=(ct,ut=it,ht=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let dt=ut(et);function pt(){const mt=ut(et);if(!ht(dt,mt)){const gt=dt;ct(dt=mt,gt)}}return nt.add(pt),()=>nt.delete(pt)},lt={setState:rt,getState:it,subscribe:(ct,ut,ht)=>ut||ht?ot(ct,ut,ht):(nt.add(ct),()=>nt.delete(ct)),destroy:()=>nt.clear()};return et=tt(rt,it,lt),lt}const isSSR$3=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),useIsomorphicLayoutEffect$3=isSSR$3?reactExports.useEffect:reactExports.useLayoutEffect;function create$4(tt){const et=typeof tt=="function"?createStore$4(tt):tt,nt=(rt=et.getState,it=Object.is)=>{const[,ot]=reactExports.useReducer(yt=>yt+1,0),at=et.getState(),st=reactExports.useRef(at),lt=reactExports.useRef(rt),ct=reactExports.useRef(it),ut=reactExports.useRef(!1),ht=reactExports.useRef();ht.current===void 0&&(ht.current=rt(at));let dt,pt=!1;(st.current!==at||lt.current!==rt||ct.current!==it||ut.current)&&(dt=rt(at),pt=!it(ht.current,dt)),useIsomorphicLayoutEffect$3(()=>{pt&&(ht.current=dt),st.current=at,lt.current=rt,ct.current=it,ut.current=!1});const mt=reactExports.useRef(at);useIsomorphicLayoutEffect$3(()=>{const yt=()=>{try{const wt=et.getState(),xt=lt.current(wt);ct.current(ht.current,xt)||(st.current=wt,ht.current=xt,ot())}catch{ut.current=!0,ot()}},bt=et.subscribe(yt);return et.getState()!==mt.current&&yt(),bt},[]);const gt=pt?dt:ht.current;return reactExports.useDebugValue(gt),gt};return Object.assign(nt,et),nt[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const rt=[nt,et];return{next(){const it=rt.length<=0;return{value:rt.shift(),done:it}}}},nt}const subscribeWithSelector=tt=>(et,nt,rt)=>{const it=rt.subscribe;return rt.subscribe=(at,st,lt)=>{let ct=at;if(st){const ut=(lt==null?void 0:lt.equalityFn)||Object.is;let ht=at(rt.getState());ct=dt=>{const pt=at(dt);if(!ut(ht,pt)){const mt=ht;st(ht=pt,mt)}},lt!=null&<.fireImmediately&&st(ht,ht)}return it(ct)},tt(et,nt,rt)};/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. @@ -95,7 +95,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. - */var split=splitString,extend$3=extendShallow,isPlainObject$3=isPlainObject$5,isObject$h=isExtendable,setValue=function(tt,et,nt){if(!isObject$h(tt)||(Array.isArray(et)&&(et=[].concat.apply([],et).join(".")),typeof et!="string"))return tt;for(var rt=split(et,{sep:".",brackets:!0}).filter(isValidKey),it=rt.length,ot=-1,at=tt;++ottt.filter(Boolean).join(".");function getKeyPath(tt){const et=tt.split(".");return[et.pop(),et.join(".")||void 0]}function getValuesForPaths(tt,et){return Object.entries(pick$1(tt,et)).reduce((nt,[,{value:rt,disabled:it,key:ot}])=>(nt[ot]=it?void 0:rt,nt),{})}function useCompareMemoize(tt,et){const nt=reactExports.useRef();return(et?dequal:shallow$2)(tt,nt.current)||(nt.current=tt),nt.current}function useDeepMemo(tt,et){return reactExports.useMemo(tt,useCompareMemoize(et,!0))}function useToggle(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),rt=reactExports.useRef(!0);return reactExports.useLayoutEffect(()=>{tt||(et.current.style.height="0px",et.current.style.overflow="hidden")},[]),reactExports.useEffect(()=>{if(rt.current){rt.current=!1;return}let it;const ot=et.current,at=()=>{tt&&(ot.style.removeProperty("height"),ot.style.removeProperty("overflow"),nt.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};ot.addEventListener("transitionend",at,{once:!0});const{height:st}=nt.current.getBoundingClientRect();return ot.style.height=st+"px",tt||(ot.style.overflow="hidden",it=window.setTimeout(()=>ot.style.height="0px",50)),()=>{ot.removeEventListener("transitionend",at),clearTimeout(it)}},[tt]),{wrapperRef:et,contentRef:nt}}const useVisiblePaths=tt=>{const[et,nt]=reactExports.useState(tt.getVisiblePaths());return reactExports.useEffect(()=>{nt(tt.getVisiblePaths());const rt=tt.useStore.subscribe(tt.getVisiblePaths,nt,{equalityFn:shallow$2});return()=>rt()},[tt]),et};function useValuesForPath(tt,et,nt){return tt.useStore(it=>{const ot=_objectSpread2$1(_objectSpread2$1({},nt),it.data);return getValuesForPaths(ot,et)},shallow$2)}function usePopin(tt=3){const et=reactExports.useRef(null),nt=reactExports.useRef(null),[rt,it]=reactExports.useState(!1),ot=reactExports.useCallback(()=>it(!0),[]),at=reactExports.useCallback(()=>it(!1),[]);return reactExports.useLayoutEffect(()=>{if(rt){const{bottom:st,top:lt,left:ct}=et.current.getBoundingClientRect(),{height:ut}=nt.current.getBoundingClientRect(),ht=st+ut>window.innerHeight-40?"up":"down";nt.current.style.position="fixed",nt.current.style.zIndex="10000",nt.current.style.left=ct+"px",ht==="down"?nt.current.style.top=st+tt+"px":nt.current.style.bottom=window.innerHeight-lt+tt+"px"}},[tt,rt]),{popinRef:et,wrapperRef:nt,shown:rt,show:ot,hide:at}}k$8([namesPlugin]);const convertMap={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};v8n.extend({color:()=>tt=>w$5(tt).isValid()});const schema$2=tt=>v8n().color().test(tt);function convert$5(tt,{format:et,hasAlpha:nt,isString:rt}){const it=convertMap[et]+(rt&&et!=="hex"?"String":""),ot=tt[it]();return typeof ot=="object"&&!nt?omit$1(ot,["a"]):ot}const sanitize$2=(tt,et)=>{const nt=w$5(tt);if(!nt.isValid())throw Error("Invalid color");return convert$5(nt,et)},format$1$1=(tt,et)=>convert$5(w$5(tt),_objectSpread2$1(_objectSpread2$1({},et),{},{isString:!0,format:"hex"})),normalize$3=({value:tt})=>{const et=I$2(tt),nt=et==="name"?"hex":et,rt=typeof tt=="object"?"a"in tt:et==="hex"&&tt.length===8||/^(rgba)|(hsla)|(hsva)/.test(tt),it={format:nt,hasAlpha:rt,isString:typeof tt=="string"};return{value:sanitize$2(tt,it),settings:it}};var props$2=Object.freeze({__proto__:null,schema:schema$2,sanitize:sanitize$2,format:format$1$1,normalize:normalize$3});const ColorPreview=styled$5("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),PickerContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),PickerWrapper=styled$5("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function convertToRgb(tt,et){return et!=="rgb"?w$5(tt).toRgb():tt}function Color$2({value:tt,displayValue:et,settings:nt,onUpdate:rt}){const{emitOnEditStart:it,emitOnEditEnd:ot}=useInputContext(),{format:at,hasAlpha:st}=nt,{popinRef:lt,wrapperRef:ct,shown:ut,show:ht,hide:dt}=usePopin(),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState(()=>convertToRgb(tt,at)),yt=st?Ce:Ne$1,bt=()=>{gt(convertToRgb(tt,at)),ht(),it()},wt=()=>{dt(),ot(),window.clearTimeout(pt.current)},xt=()=>{pt.current=window.setTimeout(wt,500)};return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(ColorPreview,{ref:lt,active:ut,onClick:()=>bt(),style:{color:et}}),ut&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:wt}),React$1.createElement(PickerWrapper,{ref:ct,onMouseEnter:()=>window.clearTimeout(pt.current),onMouseLeave:kt=>kt.buttons===0&&xt()},React$1.createElement(yt,{color:mt,onChange:rt}))))}function ColorComponent(){const{value:tt,displayValue:et,label:nt,onChange:rt,onUpdate:it,settings:ot}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,nt),React$1.createElement(PickerContainer,null,React$1.createElement(Color$2,{value:tt,displayValue:et,onChange:rt,onUpdate:it,settings:ot}),React$1.createElement(ValueInput,{value:et,onChange:rt,onUpdate:it})))}var color$3=_objectSpread2$1({component:ColorComponent},props$2);function Vector3dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Vector,{value:et,settings:rt,onUpdate:nt}))}var vector3d=_objectSpread2$1({component:Vector3dComponent},getVectorPlugin(["x","y","z"]));const JoystickTrigger=styled$5("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),JoystickPlayground=styled$5("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function Joystick({value:tt,settings:et,onUpdate:nt}){const rt=reactExports.useRef(),it=reactExports.useRef(0),ot=reactExports.useRef(0),at=reactExports.useRef(1),[st,lt]=reactExports.useState(!1),[ct,ut]=reactExports.useState(!1),[ht,dt]=useTransform(),pt=reactExports.useRef(null),mt=reactExports.useRef(null);reactExports.useLayoutEffect(()=>{if(st){const{top:Rt,left:$t,width:vt,height:It}=pt.current.getBoundingClientRect();mt.current.style.left=$t+vt/2+"px",mt.current.style.top=Rt+It/2+"px"}},[st]);const{keys:[gt,yt],joystick:bt}=et,wt=bt==="invertY"?1:-1,{[gt]:{step:xt},[yt]:{step:kt}}=et,St=useTh("sizes","joystickWidth"),Tt=useTh("sizes","joystickHeight"),At=parseFloat(St)*.8/2,Et=parseFloat(Tt)*.8/2,Ct=reactExports.useCallback(()=>{rt.current||(ut(!0),it.current&&dt({x:it.current*At}),ot.current&&dt({y:ot.current*-Et}),rt.current=window.setInterval(()=>{nt(Rt=>{const $t=xt*it.current*at.current,vt=wt*kt*ot.current*at.current;return Array.isArray(Rt)?{[gt]:Rt[0]+$t,[yt]:Rt[1]+vt}:{[gt]:Rt[gt]+$t,[yt]:Rt[yt]+vt}})},16))},[At,Et,nt,dt,xt,kt,gt,yt,wt]),Lt=reactExports.useCallback(()=>{window.clearTimeout(rt.current),rt.current=void 0,ut(!1)},[]);reactExports.useEffect(()=>{function Rt($t){at.current=multiplyStep($t)}return window.addEventListener("keydown",Rt),window.addEventListener("keyup",Rt),()=>{window.clearTimeout(rt.current),window.removeEventListener("keydown",Rt),window.removeEventListener("keyup",Rt)}},[]);const jt=useDrag$1(({first:Rt,active:$t,delta:[vt,It],movement:[Ot,Wt]})=>{Rt&<(!0);const zt=clamp$7(Ot,-At,At),Ft=clamp$7(Wt,-Et,Et);it.current=Math.abs(Ot)>Math.abs(zt)?Math.sign(Ot-zt):0,ot.current=Math.abs(Wt)>Math.abs(Ft)?Math.sign(Ft-Wt):0;let Nt=tt[gt],Ut=tt[yt];$t?(it.current||(Nt+=vt*xt*at.current,dt({x:zt})),ot.current||(Ut-=wt*It*kt*at.current,dt({y:Ft})),it.current||ot.current?Ct():Lt(),nt({[gt]:Nt,[yt]:Ut})):(lt(!1),it.current=0,ot.current=0,dt({x:0,y:0}),Lt())});return React$1.createElement(JoystickTrigger,_extends$t({ref:pt},jt()),st&&React$1.createElement(Portal$1,null,React$1.createElement(JoystickPlayground,{ref:mt,isOutOfBounds:ct},React$1.createElement("div",null),React$1.createElement("span",{ref:ht}))))}const Container$1=styled$5("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function Vector2dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container$1,{withJoystick:!!rt.joystick},rt.joystick&&React$1.createElement(Joystick,{value:et,settings:rt,onUpdate:nt}),React$1.createElement(Vector,{value:et,settings:rt,onUpdate:nt})))}const _excluded$7$1=["joystick"],plugin=getVectorPlugin(["x","y"]),normalize$2$1=tt=>{let{joystick:et=!0}=tt,nt=_objectWithoutProperties$l(tt,_excluded$7$1);const{value:rt,settings:it}=plugin.normalize(nt);return{value:rt,settings:_objectSpread2$1(_objectSpread2$1({},it),{},{joystick:et})}};var vector2d=_objectSpread2$1(_objectSpread2$1({component:Vector2dComponent},plugin),{},{normalize:normalize$2$1});const sanitize$1=tt=>{if(tt!==void 0){if(tt instanceof File)try{return URL.createObjectURL(tt)}catch{return}if(typeof tt=="string"&&tt.indexOf("blob:")===0)return tt;throw Error("Invalid image format [undefined | blob | File].")}},schema$1=(tt,et)=>typeof et=="object"&&"image"in et,normalize$1$1=({image:tt})=>({value:tt});var props$1=Object.freeze({__proto__:null,sanitize:sanitize$1,schema:schema$1,normalize:normalize$1$1});const ImageContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),DropZone=styled$5("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),ImagePreview=styled$5("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),ImageLargePreview=styled$5("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),Instructions=styled$5("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),Remove=styled$5("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function ImageComponent(){const{label:tt,value:et,onUpdate:nt,disabled:rt}=useInputContext(),{popinRef:it,wrapperRef:ot,shown:at,show:st,hide:lt}=usePopin(),ct=reactExports.useCallback(mt=>{mt.length&&nt(mt[0])},[nt]),ut=reactExports.useCallback(mt=>{mt.stopPropagation(),nt(void 0)},[nt]),{getRootProps:ht,getInputProps:dt,isDragAccept:pt}=useDropzone({maxFiles:1,accept:"image/*",onDrop:ct,disabled:rt});return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(ImageContainer,null,React$1.createElement(ImagePreview,{ref:it,hasImage:!!et,onPointerDown:()=>!!et&&st(),onPointerUp:lt,style:{backgroundImage:et?`url(${et})`:"none"}}),at&&!!et&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:lt,style:{cursor:"pointer"}}),React$1.createElement(ImageLargePreview,{ref:ot,style:{backgroundImage:`url(${et})`}})),React$1.createElement(DropZone,ht({isDragAccept:pt}),React$1.createElement("input",dt()),React$1.createElement(Instructions,null,pt?"drop image":"click or drop")),React$1.createElement(Remove,{onClick:ut,disabled:!et})))}var image=_objectSpread2$1({component:ImageComponent},props$1);const number$5=v8n().number(),schema=(tt,et)=>v8n().array().length(2).every.number().test(tt)&&v8n().schema({min:number$5,max:number$5}).test(et),format$2=tt=>({min:tt[0],max:tt[1]}),sanitize=(tt,{bounds:[et,nt]},rt)=>{const it=Array.isArray(tt)?format$2(tt):tt,ot={min:rt[0],max:rt[1]},{min:at,max:st}=_objectSpread2$1(_objectSpread2$1({},ot),it);return[clamp$7(Number(at),et,Math.max(et,st)),clamp$7(Number(st),Math.min(nt,at),nt)]},normalize$4=({value:tt,min:et,max:nt})=>{const rt={min:et,max:nt},it=normalizeKeyedNumberSettings(format$2(tt),{min:rt,max:rt}),ot=[et,nt],at=_objectSpread2$1(_objectSpread2$1({},it),{},{bounds:ot});return{value:sanitize(format$2(tt),at,tt),settings:at}};var props$3=Object.freeze({__proto__:null,schema,format:format$2,sanitize,normalize:normalize$4});const _excluded$6$1=["value","bounds","onDrag"],_excluded2$1$1=["bounds"],Container=styled$5("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function IntervalSlider(tt){let{value:et,bounds:[nt,rt],onDrag:it}=tt,ot=_objectWithoutProperties$l(tt,_excluded$6$1);const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(null),ct=reactExports.useRef(0),ut=useTh("sizes","scrubberWidth"),ht=useDrag$1(({event:mt,first:gt,xy:[yt],movement:[bt],memo:wt={}})=>{if(gt){const{width:kt,left:St}=at.current.getBoundingClientRect();ct.current=kt-parseFloat(ut);const Tt=(mt==null?void 0:mt.target)===st.current||(mt==null?void 0:mt.target)===lt.current;wt.pos=invertedRange((yt-St)/kt,nt,rt);const At=Math.abs(wt.pos-et.min)-Math.abs(wt.pos-et.max);wt.key=At<0||At===0&&wt.pos<=et.min?"min":"max",Tt&&(wt.pos=et[wt.key])}const xt=wt.pos+invertedRange(bt/ct.current,0,rt-nt);return it({[wt.key]:sanitizeStep(xt,ot[wt.key])}),wt}),dt=`calc(${range$8(et.min,nt,rt)} * (100% - ${ut} - 8px) + 4px)`,pt=`calc(${1-range$8(et.max,nt,rt)} * (100% - ${ut} - 8px) + 4px)`;return React$1.createElement(RangeWrapper,_extends$t({ref:at},ht()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:dt,right:pt}})),React$1.createElement(Scrubber,{position:"left",ref:st,style:{left:dt}}),React$1.createElement(Scrubber,{position:"right",ref:lt,style:{right:pt}}))}function IntervalComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:rt}=useInputContext(),it=_objectWithoutProperties$l(rt,_excluded2$1$1);return React$1.createElement(React$1.Fragment,null,React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container,null,React$1.createElement(IntervalSlider,_extends$t({value:et},rt,{onDrag:nt})),React$1.createElement(Vector,{value:et,settings:it,onUpdate:nt,innerLabelTrim:0}))))}var interval$1=_objectSpread2$1({component:IntervalComponent},props$3);const createEventEmitter=()=>{const tt=new Map;return{on:(et,nt)=>{let rt=tt.get(et);rt===void 0&&(rt=new Set,tt.set(et,rt)),rt.add(nt)},off:(et,nt)=>{const rt=tt.get(et);rt!==void 0&&(rt.delete(nt),rt.size===0&&tt.delete(et))},emit:(et,...nt)=>{const rt=tt.get(et);if(rt!==void 0)for(const it of rt)it(...nt)}}},_excluded$5$1=["type","value"],_excluded2$h=["onChange","transient","onEditStart","onEditEnd"],Store=function(){const et=create$4(subscribeWithSelector(()=>({data:{}}))),nt=createEventEmitter();this.storeId=getUid(),this.useStore=et;const rt={},it=new Set;this.getVisiblePaths=()=>{const at=this.getData(),st=Object.keys(at),lt=[];Object.entries(rt).forEach(([ut,ht])=>{ht.render&&st.some(dt=>dt.indexOf(ut)===0)&&!ht.render(this.get)&<.push(ut+".")});const ct=[];return it.forEach(ut=>{ut in at&&at[ut].__refCount>0&<.every(ht=>ut.indexOf(ht)===-1)&&(!at[ut].render||at[ut].render(this.get))&&ct.push(ut)}),ct},this.setOrderedPaths=at=>{at.forEach(st=>it.add(st))},this.orderPaths=at=>(this.setOrderedPaths(at),at),this.disposePaths=at=>{et.setState(st=>{const lt=st.data;return at.forEach(ct=>{if(ct in lt){const ut=lt[ct];ut.__refCount--,ut.__refCount===0&&ut.type in SpecialInputs&&delete lt[ct]}}),{data:lt}})},this.dispose=()=>{et.setState(()=>({data:{}}))},this.getFolderSettings=at=>rt[at]||{},this.getData=()=>et.getState().data,this.addData=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{let dt=ct[ut];if(dt){const{type:pt,value:mt}=ht,gt=_objectWithoutProperties$l(ht,_excluded$5$1);pt!==dt.type?warn$3(LevaErrors.INPUT_TYPE_OVERRIDE,pt):((dt.__refCount===0||st)&&Object.assign(dt,gt),dt.__refCount++)}else ct[ut]=_objectSpread2$1(_objectSpread2$1({},ht),{},{__refCount:1})}),{data:ct}})},this.setValueAtPath=(at,st,lt)=>{et.setState(ct=>{const ut=ct.data;return updateInput(ut[at],st,at,this,lt),{data:ut}})},this.setSettingsAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].settings=_objectSpread2$1(_objectSpread2$1({},ct[at].settings),st),{data:ct}})},this.disableInputAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].disabled=st,{data:ct}})},this.set=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{try{updateInput(ct[ut],ht,void 0,void 0,st)}catch{}}),{data:ct}})},this.getInput=at=>{try{return this.getData()[at]}catch{warn$3(LevaErrors.PATH_DOESNT_EXIST,at)}},this.get=at=>{var st;return(st=this.getInput(at))===null||st===void 0?void 0:st.value},this.emitOnEditStart=at=>{nt.emit(`onEditStart:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.emitOnEditEnd=at=>{nt.emit(`onEditEnd:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.subscribeToEditStart=(at,st)=>{const lt=`onEditStart:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)},this.subscribeToEditEnd=(at,st)=>{const lt=`onEditEnd:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)};const ot=(at,st,lt)=>{const ct={};return Object.entries(at).forEach(([ut,ht])=>{if(ut==="")return warn$3(LevaErrors.EMPTY_KEY);let dt=join(st,ut);if(ht.type===SpecialInputs.FOLDER){const pt=ot(ht.schema,dt,lt);Object.assign(ct,pt),dt in rt||(rt[dt]=ht.settings)}else if(ut in lt)warn$3(LevaErrors.DUPLICATE_KEYS,ut,dt,lt[ut].path);else{const pt=normalizeInput(ht,ut,dt,ct);if(pt){const{type:mt,options:gt,input:yt}=pt,{onChange:bt,transient:wt,onEditStart:xt,onEditEnd:kt}=gt,St=_objectWithoutProperties$l(gt,_excluded2$h);ct[dt]=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({type:mt},St),yt),{},{fromPanel:!0}),lt[ut]={path:dt,onChange:bt,transient:wt,onEditStart:xt,onEditEnd:kt}}else warn$3(LevaErrors.UNKNOWN_INPUT,dt,ht)}}),ct};this.getDataFromSchema=at=>{const st={};return[ot(at,"",st),st]}},levaStore=new Store,defaultSettings$2={collapsed:!1};function folder(tt,et){return{type:SpecialInputs.FOLDER,schema:tt,settings:_objectSpread2$1(_objectSpread2$1({},defaultSettings$2),et)}}const isInput=tt=>"__levaInput"in tt,buildTree=(tt,et)=>{const nt={},rt=et?et.toLowerCase():null;return tt.forEach(it=>{const[ot,at]=getKeyPath(it);(!rt||ot.toLowerCase().indexOf(rt)>-1)&&merge$2(nt,at,{[ot]:{__levaInput:!0,path:it}})}),nt},_excluded$4$1=["type","label","path","valueKey","value","settings","setValue","disabled"];function ControlInput(tt){let{type:et,label:nt,path:rt,valueKey:it,value:ot,settings:at,setValue:st,disabled:lt}=tt,ct=_objectWithoutProperties$l(tt,_excluded$4$1);const{displayValue:ut,onChange:ht,onUpdate:dt}=useInputSetters({type:et,value:ot,settings:at,setValue:st}),pt=Plugins[et].component;return pt?React$1.createElement(InputContext.Provider,{value:_objectSpread2$1({key:it,path:rt,id:""+rt,label:nt,displayValue:ut,value:ot,onChange:ht,onUpdate:dt,settings:at,setValue:st,disabled:lt},ct)},React$1.createElement(StyledInputWrapper$1,{disabled:lt},React$1.createElement(pt,null))):(warn$3(LevaErrors.NO_COMPONENT_FOR_TYPE,et,rt),null)}const StyledButton$5=styled$5("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function Button$3({onClick:tt,settings:et,label:nt}){const rt=useStoreContext();return React$1.createElement(Row,null,React$1.createElement(StyledButton$5,{disabled:et.disabled,onClick:()=>tt(rt.get)},nt))}const StyledButtonGroup=styled$5("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),StyledButtonGroupButton=styled$5("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),getOpts=({label:tt,opts:et})=>{let nt=typeof tt=="string"&&tt.trim()===""?null:tt,rt=et;return typeof et.opts=="object"&&(rt.label!==void 0&&(nt=et.label),rt=et.opts),{label:nt,opts:rt}};function ButtonGroup(tt){const{label:et,opts:nt}=getOpts(tt),rt=useStoreContext();return React$1.createElement(Row,{input:!!et},et&&React$1.createElement(Label$2,null,et),React$1.createElement(StyledButtonGroup,null,Object.entries(nt).map(([it,ot])=>React$1.createElement(StyledButtonGroupButton,{key:it,onClick:()=>ot(rt.get)},it))))}const Canvas$2=styled$5("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),POINTS=100;function push(tt,et){tt.push(et),tt.length>POINTS&&tt.shift()}const MonitorCanvas=reactExports.forwardRef(function({initialValue:tt},et){const nt=useTh("colors","highlight3"),rt=useTh("colors","elevation2"),it=useTh("colors","highlight1"),[ot,at]=reactExports.useMemo(()=>[w$5(it).alpha(.4).toRgbString(),w$5(it).alpha(.1).toRgbString()],[it]),st=reactExports.useRef([tt]),lt=reactExports.useRef(tt),ct=reactExports.useRef(tt),ut=reactExports.useRef(),ht=reactExports.useCallback((mt,gt)=>{if(!mt)return;const{width:yt,height:bt}=mt,wt=new Path2D,xt=yt/POINTS,kt=bt*.05;for(let At=0;At({frame:mt=>{(lt.current===void 0||mtct.current)&&(ct.current=mt),push(st.current,mt),ut.current=requestAnimationFrame(()=>ht(dt.current,pt.current))}}),[dt,pt,ht]),reactExports.useEffect(()=>()=>cancelAnimationFrame(ut.current),[]),React$1.createElement(Canvas$2,{ref:dt})}),parse$2=tt=>Number.isFinite(tt)?tt.toPrecision(2):tt.toString(),MonitorLog=reactExports.forwardRef(function({initialValue:tt},et){const[nt,rt]=reactExports.useState(parse$2(tt));return reactExports.useImperativeHandle(et,()=>({frame:it=>rt(parse$2(it))}),[]),React$1.createElement("div",null,nt)});function getValue$4(tt){return typeof tt=="function"?tt():tt.current}function Monitor({label:tt,objectOrFn:et,settings:nt}){const rt=reactExports.useRef(),it=reactExports.useRef(getValue$4(et));return reactExports.useEffect(()=>{const ot=window.setInterval(()=>{var at;document.hidden||(at=rt.current)===null||at===void 0||at.frame(getValue$4(et))},nt.interval);return()=>window.clearInterval(ot)},[et,nt.interval]),React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,{align:"top"},tt),nt.graph?React$1.createElement(MonitorCanvas,{ref:rt,initialValue:it.current}):React$1.createElement(MonitorLog,{ref:rt,initialValue:it.current}))}const _excluded$3$1=["type","label","key"],specialComponents={[SpecialInputs.BUTTON]:Button$3,[SpecialInputs.BUTTON_GROUP]:ButtonGroup,[SpecialInputs.MONITOR]:Monitor},Control=React$1.memo(({path:tt})=>{const[et,{set:nt,setSettings:rt,disable:it,storeId:ot,emitOnEditStart:at,emitOnEditEnd:st}]=useInput(tt);if(!et)return null;const{type:lt,label:ct,key:ut}=et,ht=_objectWithoutProperties$l(et,_excluded$3$1);if(lt in SpecialInputs){const dt=specialComponents[lt];return React$1.createElement(dt,_extends$t({label:ct,path:tt},ht))}return lt in Plugins?React$1.createElement(ControlInput,_extends$t({key:ot+tt,type:lt,label:ct,storeId:ot,path:tt,valueKey:ut,setValue:nt,setSettings:rt,disable:it,emitOnEditStart:at,emitOnEditEnd:st},ht)):(log$2(LevaErrors.UNSUPPORTED_INPUT,lt,tt),null)});function FolderTitle({toggle:tt,toggled:et,name:nt}){return React$1.createElement(StyledTitle,{onClick:()=>tt()},React$1.createElement(Chevron,{toggled:et}),React$1.createElement("div",null,nt))}const Folder=({name:tt,path:et,tree:nt})=>{const rt=useStoreContext(),it=join(et,tt),{collapsed:ot,color:at}=rt.getFolderSettings(it),[st,lt]=reactExports.useState(!ot),ct=reactExports.useRef(null),ut=useTh("colors","folderWidgetColor"),ht=useTh("colors","folderTextColor");return reactExports.useLayoutEffect(()=>{ct.current.style.setProperty("--leva-colors-folderWidgetColor",at||ut),ct.current.style.setProperty("--leva-colors-folderTextColor",at||ht)},[at,ut,ht]),React$1.createElement(StyledFolder,{ref:ct},React$1.createElement(FolderTitle,{name:tt,toggled:st,toggle:()=>lt(dt=>!dt)}),React$1.createElement(TreeWrapper,{parent:it,tree:nt,toggled:st}))},TreeWrapper=React$1.memo(({isRoot:tt=!1,fill:et=!1,flat:nt=!1,parent:rt,tree:it,toggled:ot})=>{const{wrapperRef:at,contentRef:st}=useToggle(ot),lt=useStoreContext(),ct=([ht,dt])=>{var pt;return(isInput(dt)?(pt=lt.getInput(dt.path))===null||pt===void 0?void 0:pt.order:lt.getFolderSettings(join(rt,ht)).order)||0},ut=Object.entries(it).sort((ht,dt)=>ct(ht)-ct(dt));return React$1.createElement(StyledWrapper,{ref:at,isRoot:tt,fill:et,flat:nt},React$1.createElement(StyledContent,{ref:st,isRoot:tt,toggled:ot},ut.map(([ht,dt])=>isInput(dt)?React$1.createElement(Control,{key:dt.path,valueKey:dt.valueKey,path:dt.path}):React$1.createElement(Folder,{key:ht,name:ht,path:rt,tree:dt}))))}),StyledRoot=styled$5("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${StyledInputRow}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),iconWidth=40,Icon=styled$5("i",{$flexCenter:"",width:iconWidth,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),StyledTitleWithFilter=styled$5("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),FilterWrapper=styled$5("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${Icon}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),StyledFilterInput=styled$5("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),TitleContainer=styled$5("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:iconWidth}}}}),FilterInput=React$1.forwardRef(({setFilter:tt,toggle:et},nt)=>{const[rt,it]=reactExports.useState(""),ot=reactExports.useMemo(()=>debounce$6(tt,250),[tt]),at=()=>{tt(""),it("")},st=lt=>{const ct=lt.currentTarget.value;et(!0),it(ct)};return reactExports.useEffect(()=>{ot(rt)},[rt,ot]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledFilterInput,{ref:nt,value:rt,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:lt=>lt.stopPropagation(),onChange:st}),React$1.createElement(Icon,{onClick:()=>at(),style:{visibility:rt?"visible":"hidden"}},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function TitleWithFilter({setFilter:tt,onDrag:et,onDragStart:nt,onDragEnd:rt,toggle:it,toggled:ot,title:at,drag:st,filterEnabled:lt,from:ct}){const[ut,ht]=reactExports.useState(!1),dt=reactExports.useRef(null);reactExports.useEffect(()=>{var mt,gt;ut?(mt=dt.current)===null||mt===void 0||mt.focus():(gt=dt.current)===null||gt===void 0||gt.blur()},[ut]);const pt=useDrag$1(({offset:[mt,gt],first:yt,last:bt})=>{et({x:mt,y:gt}),yt&&nt({x:mt,y:gt}),bt&&rt({x:mt,y:gt})},{filterTaps:!0,from:({offset:[mt,gt]})=>[(ct==null?void 0:ct.x)||mt,(ct==null?void 0:ct.y)||gt]});return reactExports.useEffect(()=>{const mt=gt=>{gt.key==="L"&>.shiftKey&>.metaKey&&ht(yt=>!yt)};return window.addEventListener("keydown",mt),()=>window.removeEventListener("keydown",mt)},[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledTitleWithFilter,{mode:st?"drag":void 0},React$1.createElement(Icon,{active:!ot,onClick:()=>it()},React$1.createElement(Chevron,{toggled:ot,width:12,height:8})),React$1.createElement(TitleContainer,_extends$t({},st?pt():{},{drag:st,filterEnabled:lt}),at===void 0&&st?React$1.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},React$1.createElement("circle",{cx:"2",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"2",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"12",r:"2"})):at),lt&&React$1.createElement(Icon,{active:ut,onClick:()=>ht(mt=>!mt)},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},React$1.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),React$1.createElement(FilterWrapper,{toggled:ut},React$1.createElement(FilterInput,{ref:dt,setFilter:tt,toggle:it})))}const _excluded$2$1=["store","hidden","theme","collapsed"];function LevaRoot(tt){let{store:et,hidden:nt=!1,theme:rt,collapsed:it=!1}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$1);const at=useDeepMemo(()=>mergeTheme(rt),[rt]),[st,lt]=reactExports.useState(!it),ct=typeof it=="object"?!it.collapsed:st,ut=reactExports.useMemo(()=>typeof it=="object"?ht=>{typeof ht=="function"?it.onChange(!ht(!it.collapsed)):it.onChange(!ht)}:lt,[it]);return!et||nt?null:React$1.createElement(ThemeContext$3.Provider,{value:at},React$1.createElement(LevaCore,_extends$t({store:et},ot,{toggled:ct,setToggle:ut,rootClass:at.className})))}const LevaCore=React$1.memo(({store:tt,rootClass:et,fill:nt=!1,flat:rt=!1,neverHide:it=!1,oneLineLabels:ot=!1,titleBar:at={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:st=!1,toggled:lt,setToggle:ct})=>{var ut,ht;const dt=useVisiblePaths(tt),[pt,mt]=reactExports.useState(""),gt=reactExports.useMemo(()=>buildTree(dt,pt),[dt,pt]),[yt,bt]=useTransform(),wt=it||dt.length>0,xt=typeof at=="object"&&at.title||void 0,kt=typeof at=="object"&&(ut=at.drag)!==null&&ut!==void 0?ut:!0,St=typeof at=="object"&&(ht=at.filter)!==null&&ht!==void 0?ht:!0,Tt=typeof at=="object"&&at.position||void 0,At=typeof at=="object"&&at.onDrag||void 0,Et=typeof at=="object"&&at.onDragStart||void 0,Ct=typeof at=="object"&&at.onDragEnd||void 0;return React$1.useEffect(()=>{bt({x:Tt==null?void 0:Tt.x,y:Tt==null?void 0:Tt.y})},[Tt,bt]),globalStyles(),React$1.createElement(PanelSettingsContext.Provider,{value:{hideCopyButton:st}},React$1.createElement(StyledRoot,{ref:yt,className:et,fill:nt,flat:rt,oneLineLabels:ot,hideTitleBar:!at,style:{display:wt?"block":"none"}},at&&React$1.createElement(TitleWithFilter,{onDrag:Lt=>{bt(Lt),At==null||At(Lt)},onDragStart:Lt=>Et==null?void 0:Et(Lt),onDragEnd:Lt=>Ct==null?void 0:Ct(Lt),setFilter:mt,toggle:Lt=>ct(jt=>Lt??!jt),toggled:lt,title:xt,drag:kt,filterEnabled:St,from:Tt}),wt&&React$1.createElement(StoreContext$1.Provider,{value:tt},React$1.createElement(TreeWrapper,{isRoot:!0,fill:nt,flat:rt,tree:gt,toggled:lt}))))}),_excluded$1$3=["isRoot"];let rootInitialized=!1,rootEl=null;function Leva(tt){let{isRoot:et=!1}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$3);return reactExports.useEffect(()=>(rootInitialized=!0,!et&&rootEl&&(rootEl.remove(),rootEl=null),()=>{et||(rootInitialized=!1)}),[et]),React$1.createElement(LevaRoot,_extends$t({store:levaStore},nt))}function useRenderRoot(tt){reactExports.useEffect(()=>{tt&&!rootInitialized&&(rootEl||(rootEl=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(rootEl),render(React$1.createElement(Leva,{isRoot:!0}),rootEl))),rootInitialized=!0)},[tt])}function parseArgs(tt,et,nt,rt,it){let ot,at,st,lt,ct;return typeof tt=="string"?(at=tt,ot=et,Array.isArray(nt)?ct=nt:nt&&("store"in nt?(lt=nt,ct=rt):(st=nt,Array.isArray(rt)?ct=rt:(lt=rt,ct=it)))):(ot=tt,Array.isArray(et)?ct=et:(lt=et,ct=nt)),{schema:ot,folderName:at,folderSettings:st,hookSettings:lt,deps:ct||[]}}function useControls(tt,et,nt,rt,it){const{folderName:ot,schema:at,folderSettings:st,hookSettings:lt,deps:ct}=parseArgs(tt,et,nt,rt,it),ut=typeof at=="function",ht=reactExports.useRef(!1),dt=reactExports.useRef(!0),pt=useDeepMemo(()=>{ht.current=!0;const jt=typeof at=="function"?at():at;return ot?{[ot]:folder(jt,st)}:jt},ct),mt=!(lt!=null&<.store);useRenderRoot(mt);const[gt]=reactExports.useState(()=>(lt==null?void 0:lt.store)||levaStore),[yt,bt]=reactExports.useMemo(()=>gt.getDataFromSchema(pt),[gt,pt]),[wt,xt,kt,St,Tt]=reactExports.useMemo(()=>{const jt=[],Rt=[],$t={},vt={},It={};return Object.values(bt).forEach(({path:Ot,onChange:Wt,onEditStart:zt,onEditEnd:Ft,transient:Nt})=>{jt.push(Ot),Wt?($t[Ot]=Wt,Nt||Rt.push(Ot)):Rt.push(Ot),zt&&(vt[Ot]=zt),Ft&&(It[Ot]=Ft)}),[jt,Rt,$t,vt,It]},[bt]),At=reactExports.useMemo(()=>gt.orderPaths(wt),[wt,gt]),Et=useValuesForPath(gt,xt,yt),Ct=reactExports.useCallback(jt=>{const Rt=Object.entries(jt).reduce(($t,[vt,It])=>Object.assign($t,{[bt[vt].path]:It}),{});gt.set(Rt,!1)},[gt,bt]),Lt=reactExports.useCallback(jt=>gt.get(bt[jt].path),[gt,bt]);return reactExports.useEffect(()=>{const jt=!dt.current&&ht.current;return gt.addData(yt,jt),dt.current=!1,ht.current=!1,()=>gt.disposePaths(At)},[gt,At,yt]),reactExports.useEffect(()=>{const jt=[];return Object.entries(kt).forEach(([Rt,$t])=>{$t(gt.get(Rt),Rt,_objectSpread2$1({initial:!0,get:gt.get},gt.getInput(Rt)));const vt=gt.useStore.subscribe(It=>{const Ot=It.data[Rt];return[Ot.disabled?void 0:Ot.value,Ot]},([It,Ot])=>$t(It,Rt,_objectSpread2$1({initial:!1,get:gt.get},Ot)),{equalityFn:shallow$2});jt.push(vt)}),()=>jt.forEach(Rt=>Rt())},[gt,kt]),reactExports.useEffect(()=>{const jt=[];return Object.entries(St).forEach(([Rt,$t])=>jt.push(gt.subscribeToEditStart(Rt,$t))),Object.entries(Tt).forEach(([Rt,$t])=>jt.push(gt.subscribeToEditEnd(Rt,$t))),()=>jt.forEach(Rt=>Rt())},[St,Tt,gt]),ut?[Et,Ct,Lt]:Et}register(LevaInputs.SELECT,select$1);register(LevaInputs.IMAGE,image);register(LevaInputs.NUMBER,number$6);register(LevaInputs.COLOR,color$3);register(LevaInputs.STRING,string$1);register(LevaInputs.BOOLEAN,boolean);register(LevaInputs.INTERVAL,interval$1);register(LevaInputs.VECTOR3D,vector3d);register(LevaInputs.VECTOR2D,vector2d);var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject$f=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject$f(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject$2=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject$f(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const nt=Array.isArray(tt);if(tt instanceof Date)et=new Date(tt);else if(tt instanceof Set)et=new Set(tt);else if(!(isWeb&&(tt instanceof Blob||tt instanceof FileList))&&(nt||isObject$f(tt)))if(et=nt?[]:{},!nt&&!isPlainObject$2(tt))et=tt;else for(const rt in tt)tt.hasOwnProperty(rt)&&(et[rt]=cloneObject(tt[rt]));else return tt;return et}var compact=tt=>Array.isArray(tt)?tt.filter(Boolean):[],isUndefined$1=tt=>tt===void 0,get$5=(tt,et,nt)=>{if(!et||!isObject$f(tt))return nt;const rt=compact(et.split(/[,[\].]+?/)).reduce((it,ot)=>isNullOrUndefined(it)?it:it[ot],tt);return isUndefined$1(rt)||rt===tt?isUndefined$1(tt[et])?nt:tt[et]:rt},isBoolean$2=tt=>typeof tt=="boolean";const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$1.createContext(null),useFormContext=()=>React$1.useContext(HookFormContext),FormProvider=tt=>{const{children:et,...nt}=tt;return React$1.createElement(HookFormContext.Provider,{value:nt},et)};var getProxyFormState=(tt,et,nt,rt=!0)=>{const it={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(it,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!rt||VALIDATION_MODE.all),nt&&(nt[at]=!0),tt[at]}});return it},isEmptyObject=tt=>isObject$f(tt)&&!Object.keys(tt).length,shouldRenderFormState=(tt,et,nt,rt)=>{nt(tt);const{name:it,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!rt||VALIDATION_MODE.all))},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],shouldSubscribeByName=(tt,et,nt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(rt=>rt&&(nt?rt===et:rt.startsWith(et)||et.startsWith(rt)));function useSubscribe(tt){const et=React$1.useRef(tt);et.current=tt,React$1.useEffect(()=>{const nt=!tt.disabled&&et.current.subject&&et.current.subject.subscribe({next:et.current.next});return()=>{nt&&nt.unsubscribe()}},[tt.disabled])}function useFormState(tt){const et=useFormContext(),{control:nt=et.control,disabled:rt,name:it,exact:ot}=tt||{},[at,st]=React$1.useState(nt._formState),lt=React$1.useRef(!0),ct=React$1.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),ut=React$1.useRef(it);return ut.current=it,useSubscribe({disabled:rt,next:ht=>lt.current&&shouldSubscribeByName(ut.current,ht.name,ot)&&shouldRenderFormState(ht,ct.current,nt._updateFormState)&&st({...nt._formState,...ht}),subject:nt._subjects.state}),React$1.useEffect(()=>(lt.current=!0,ct.current.isValid&&nt._updateValid(!0),()=>{lt.current=!1}),[nt]),getProxyFormState(at,nt,ct.current,!1)}var isString$3=tt=>typeof tt=="string",generateWatchOutput=(tt,et,nt,rt,it)=>isString$3(tt)?(rt&&et.watch.add(tt),get$5(nt,tt,it)):Array.isArray(tt)?tt.map(ot=>(rt&&et.watch.add(ot),get$5(nt,ot))):(rt&&(et.watchAll=!0),nt);function useWatch(tt){const et=useFormContext(),{control:nt=et.control,name:rt,defaultValue:it,disabled:ot,exact:at}=tt||{},st=React$1.useRef(rt);st.current=rt,useSubscribe({disabled:ot,subject:nt._subjects.values,next:ut=>{shouldSubscribeByName(st.current,ut.name,at)&&ct(cloneObject(generateWatchOutput(st.current,nt._names,ut.values||nt._formValues,!1,it)))}});const[lt,ct]=React$1.useState(nt._getWatch(rt,it));return React$1.useEffect(()=>nt._removeUnmounted()),lt}var isKey$4=tt=>/^\w*$/.test(tt),stringToPath$3=tt=>compact(tt.replace(/["|']|\]/g,"").split(/\.|\[/));function set$3(tt,et,nt){let rt=-1;const it=isKey$4(et)?[et]:stringToPath$3(et),ot=it.length,at=ot-1;for(;++rt{const ut=it._options.shouldUnregister||ot,ht=(dt,pt)=>{const mt=get$5(it._fields,dt);mt&&(mt._f.mount=pt)};if(ht(nt,!0),ut){const dt=cloneObject(get$5(it._options.defaultValues,nt));set$3(it._defaultValues,nt,dt),isUndefined$1(get$5(it._formValues,nt))&&set$3(it._formValues,nt,dt)}return()=>{(at?ut&&!it._state.action:ut)?it.unregister(nt):ht(nt,!1)}},[nt,it,at,ot]),React$1.useEffect(()=>{get$5(it._fields,nt)&&it._updateDisabledField({disabled:rt,fields:it._fields,name:nt})},[rt,nt,it]),{field:{name:nt,value:st,...isBoolean$2(rt)?{disabled:rt}:{},onChange:React$1.useCallback(ut=>ct.current.onChange({target:{value:getEventValue(ut),name:nt},type:EVENTS.CHANGE}),[nt]),onBlur:React$1.useCallback(()=>ct.current.onBlur({target:{value:get$5(it._formValues,nt),name:nt},type:EVENTS.BLUR}),[nt,it]),ref:ut=>{const ht=get$5(it._fields,nt);ht&&ut&&(ht._f.ref={focus:()=>ut.focus(),select:()=>ut.select(),setCustomValidity:dt=>ut.setCustomValidity(dt),reportValidity:()=>ut.reportValidity()})}},formState:lt,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$5(lt.errors,nt)},isDirty:{enumerable:!0,get:()=>!!get$5(lt.dirtyFields,nt)},isTouched:{enumerable:!0,get:()=>!!get$5(lt.touchedFields,nt)},error:{enumerable:!0,get:()=>get$5(lt.errors,nt)}})}}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,nt,rt,it)=>et?{...nt[tt],types:{...nt[tt]&&nt[tt].types?nt[tt].types:{},[rt]:it||!0}}:{};const focusFieldBy=(tt,et,nt)=>{for(const rt of nt||Object.keys(tt)){const it=get$5(tt,rt);if(it){const{_f:ot,...at}=it;if(ot&&et(ot.name)){if(ot.ref.focus){ot.ref.focus();break}else if(ot.refs&&ot.refs[0].focus){ot.refs[0].focus();break}}else isObject$f(at)&&focusFieldBy(at,et)}}};var getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched}),isWatched=(tt,et,nt)=>!nt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(rt=>tt.startsWith(rt)&&/^\.\w+/.test(tt.slice(rt.length)))),updateFieldArrayRootError=(tt,et,nt)=>{const rt=compact(get$5(tt,nt));return set$3(rt,"root",et[nt]),set$3(tt,nt,rt),tt},isFileInput=tt=>tt.type==="file",isFunction$6=tt=>typeof tt=="function",isHTMLElement$2=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMessage=tt=>isString$3(tt),isRadioInput=tt=>tt.type==="radio",isRegex=tt=>tt instanceof RegExp;const defaultResult$1={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(nt=>nt&&nt.checked&&!nt.disabled).map(nt=>nt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined$1(tt[0].attributes.value)?isUndefined$1(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult$1}return defaultResult$1};const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,nt)=>nt&&nt.checked&&!nt.disabled?{isValid:!0,value:nt.value}:et,defaultReturn):defaultReturn;function getValidateError(tt,et,nt="validate"){if(isMessage(tt)||Array.isArray(tt)&&tt.every(isMessage)||isBoolean$2(tt)&&!tt)return{type:nt,message:isMessage(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject$f(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,nt,rt,it)=>{const{ref:ot,refs:at,required:st,maxLength:lt,minLength:ct,min:ut,max:ht,pattern:dt,validate:pt,name:mt,valueAsNumber:gt,mount:yt,disabled:bt}=tt._f,wt=get$5(et,mt);if(!yt||bt)return{};const xt=at?at[0]:ot,kt=Rt=>{rt&&xt.reportValidity&&(xt.setCustomValidity(isBoolean$2(Rt)?"":Rt||""),xt.reportValidity())},St={},Tt=isRadioInput(ot),At=isCheckBoxInput(ot),Et=Tt||At,Ct=(gt||isFileInput(ot))&&isUndefined$1(ot.value)&&isUndefined$1(wt)||isHTMLElement$2(ot)&&ot.value===""||wt===""||Array.isArray(wt)&&!wt.length,Lt=appendErrors.bind(null,mt,nt,St),jt=(Rt,$t,vt,It=INPUT_VALIDATION_RULES.maxLength,Ot=INPUT_VALIDATION_RULES.minLength)=>{const Wt=Rt?$t:vt;St[mt]={type:Rt?It:Ot,message:Wt,ref:ot,...Lt(Rt?It:Ot,Wt)}};if(it?!Array.isArray(wt)||!wt.length:st&&(!Et&&(Ct||isNullOrUndefined(wt))||isBoolean$2(wt)&&!wt||At&&!getCheckboxValue(at).isValid||Tt&&!getRadioValue(at).isValid)){const{value:Rt,message:$t}=isMessage(st)?{value:!!st,message:st}:getValueAndMessage(st);if(Rt&&(St[mt]={type:INPUT_VALIDATION_RULES.required,message:$t,ref:xt,...Lt(INPUT_VALIDATION_RULES.required,$t)},!nt))return kt($t),St}if(!Ct&&(!isNullOrUndefined(ut)||!isNullOrUndefined(ht))){let Rt,$t;const vt=getValueAndMessage(ht),It=getValueAndMessage(ut);if(!isNullOrUndefined(wt)&&!isNaN(wt)){const Ot=ot.valueAsNumber||wt&&+wt;isNullOrUndefined(vt.value)||(Rt=Ot>vt.value),isNullOrUndefined(It.value)||($t=Otnew Date(new Date().toDateString()+" "+Nt),zt=ot.type=="time",Ft=ot.type=="week";isString$3(vt.value)&&wt&&(Rt=zt?Wt(wt)>Wt(vt.value):Ft?wt>vt.value:Ot>new Date(vt.value)),isString$3(It.value)&&wt&&($t=zt?Wt(wt)+Rt.value,It=!isNullOrUndefined($t.value)&&wt.length<+$t.value;if((vt||It)&&(jt(vt,Rt.message,$t.message),!nt))return kt(St[mt].message),St}if(dt&&!Ct&&isString$3(wt)){const{value:Rt,message:$t}=getValueAndMessage(dt);if(isRegex(Rt)&&!wt.match(Rt)&&(St[mt]={type:INPUT_VALIDATION_RULES.pattern,message:$t,ref:ot,...Lt(INPUT_VALIDATION_RULES.pattern,$t)},!nt))return kt($t),St}if(pt){if(isFunction$6(pt)){const Rt=await pt(wt,et),$t=getValidateError(Rt,xt);if($t&&(St[mt]={...$t,...Lt(INPUT_VALIDATION_RULES.validate,$t.message)},!nt))return kt($t.message),St}else if(isObject$f(pt)){let Rt={};for(const $t in pt){if(!isEmptyObject(Rt)&&!nt)break;const vt=getValidateError(await pt[$t](wt,et),xt,$t);vt&&(Rt={...vt,...Lt($t,vt.message)},kt(vt.message),nt&&(St[mt]=Rt))}if(!isEmptyObject(Rt)&&(St[mt]={ref:xt,...Rt},!nt))return St}}return kt(!0),St};function baseGet$4(tt,et){const nt=et.slice(0,-1).length;let rt=0;for(;rt{for(const ot of tt)ot.next&&ot.next(it)},subscribe:it=>(tt.push(it),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==it)}}),unsubscribe:()=>{tt=[]}}}var isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual$2(tt,et){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const nt=Object.keys(tt),rt=Object.keys(et);if(nt.length!==rt.length)return!1;for(const it of nt){const ot=tt[it];if(!rt.includes(it))return!1;if(it!=="ref"){const at=et[it];if(isDateObject(ot)&&isDateObject(at)||isObject$f(ot)&&isObject$f(at)||Array.isArray(ot)&&Array.isArray(at)?!deepEqual$2(ot,at):ot!==at)return!1}}return!0}var isMultipleSelect=tt=>tt.type==="select-multiple",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement$2(tt)&&tt.isConnected,objectHasFunction=tt=>{for(const et in tt)if(isFunction$6(tt[et]))return!0;return!1};function markFieldsDirty(tt,et={}){const nt=Array.isArray(tt);if(isObject$f(tt)||nt)for(const rt in tt)Array.isArray(tt[rt])||isObject$f(tt[rt])&&!objectHasFunction(tt[rt])?(et[rt]=Array.isArray(tt[rt])?[]:{},markFieldsDirty(tt[rt],et[rt])):isNullOrUndefined(tt[rt])||(et[rt]=!0);return et}function getDirtyFieldsFromDefaultValues(tt,et,nt){const rt=Array.isArray(tt);if(isObject$f(tt)||rt)for(const it in tt)Array.isArray(tt[it])||isObject$f(tt[it])&&!objectHasFunction(tt[it])?isUndefined$1(et)||isPrimitive(nt[it])?nt[it]=Array.isArray(tt[it])?markFieldsDirty(tt[it],[]):{...markFieldsDirty(tt[it])}:getDirtyFieldsFromDefaultValues(tt[it],isNullOrUndefined(et)?{}:et[it],nt[it]):nt[it]=!deepEqual$2(tt[it],et[it]);return nt}var getDirtyFields=(tt,et)=>getDirtyFieldsFromDefaultValues(tt,et,markFieldsDirty(et)),getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:nt,setValueAs:rt})=>isUndefined$1(tt)?tt:et?tt===""?NaN:tt&&+tt:nt&&isString$3(tt)?new Date(tt):rt?rt(tt):tt;function getFieldValue(tt){const et=tt.ref;if(!(tt.refs?tt.refs.every(nt=>nt.disabled):et.disabled))return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:nt})=>nt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined$1(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,nt,rt)=>{const it={};for(const ot of tt){const at=get$5(et,ot);at&&set$3(it,ot,at._f)}return{criteriaMode:nt,names:[...tt],fields:it,shouldUseNativeValidation:rt}},getRuleValue=tt=>isUndefined$1(tt)?tt:isRegex(tt)?tt.source:isObject$f(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt,hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate);function schemaErrorLookup(tt,et,nt){const rt=get$5(tt,nt);if(rt||isKey$4(nt))return{error:rt,name:nt};const it=nt.split(".");for(;it.length;){const ot=it.join("."),at=get$5(et,ot),st=get$5(tt,ot);if(at&&!Array.isArray(at)&&nt!==ot)return{name:nt};if(st&&st.type)return{name:ot,error:st};it.pop()}return{name:nt}}var skipValidation=(tt,et,nt,rt,it)=>it.isOnAll?!1:!nt&&it.isOnTouch?!(et||tt):(nt?rt.isOnBlur:it.isOnBlur)?!tt:(nt?rt.isOnChange:it.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact(get$5(tt,et)).length&&unset(tt,et);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={},et){let nt={...defaultOptions,...tt},rt={submitCount:0,isDirty:!1,isLoading:isFunction$6(nt.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},it={},ot=isObject$f(nt.defaultValues)||isObject$f(nt.values)?cloneObject(nt.defaultValues||nt.values)||{}:{},at=nt.shouldUnregister?{}:cloneObject(ot),st={action:!1,mount:!1,watch:!1},lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set},ct,ut=0;const ht={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},dt={values:createSubject(),array:createSubject(),state:createSubject()},pt=tt.resetOptions&&tt.resetOptions.keepDirtyValues,mt=getValidationModes(nt.mode),gt=getValidationModes(nt.reValidateMode),yt=nt.criteriaMode===VALIDATION_MODE.all,bt=En=>sn=>{clearTimeout(ut),ut=setTimeout(En,sn)},wt=async En=>{if(ht.isValid||En){const sn=nt.resolver?isEmptyObject((await Ct()).errors):await jt(it,!0);sn!==rt.isValid&&dt.state.next({isValid:sn})}},xt=En=>ht.isValidating&&dt.state.next({isValidating:En}),kt=(En,sn=[],pn,Tn,In=!0,yn=!0)=>{if(Tn&&pn){if(st.action=!0,yn&&Array.isArray(get$5(it,En))){const hn=pn(get$5(it,En),Tn.argA,Tn.argB);In&&set$3(it,En,hn)}if(yn&&Array.isArray(get$5(rt.errors,En))){const hn=pn(get$5(rt.errors,En),Tn.argA,Tn.argB);In&&set$3(rt.errors,En,hn),unsetEmptyArray(rt.errors,En)}if(ht.touchedFields&&yn&&Array.isArray(get$5(rt.touchedFields,En))){const hn=pn(get$5(rt.touchedFields,En),Tn.argA,Tn.argB);In&&set$3(rt.touchedFields,En,hn)}ht.dirtyFields&&(rt.dirtyFields=getDirtyFields(ot,at)),dt.state.next({name:En,isDirty:$t(En,sn),dirtyFields:rt.dirtyFields,errors:rt.errors,isValid:rt.isValid})}else set$3(at,En,sn)},St=(En,sn)=>{set$3(rt.errors,En,sn),dt.state.next({errors:rt.errors})},Tt=(En,sn,pn,Tn)=>{const In=get$5(it,En);if(In){const yn=get$5(at,En,isUndefined$1(pn)?get$5(ot,En):pn);isUndefined$1(yn)||Tn&&Tn.defaultChecked||sn?set$3(at,En,sn?yn:getFieldValue(In._f)):Ot(En,yn),st.mount&&wt()}},At=(En,sn,pn,Tn,In)=>{let yn=!1,hn=!1;const fn={name:En};if(!pn||Tn){ht.isDirty&&(hn=rt.isDirty,rt.isDirty=fn.isDirty=$t(),yn=hn!==fn.isDirty);const xn=deepEqual$2(get$5(ot,En),sn);hn=get$5(rt.dirtyFields,En),xn?unset(rt.dirtyFields,En):set$3(rt.dirtyFields,En,!0),fn.dirtyFields=rt.dirtyFields,yn=yn||ht.dirtyFields&&hn!==!xn}if(pn){const xn=get$5(rt.touchedFields,En);xn||(set$3(rt.touchedFields,En,pn),fn.touchedFields=rt.touchedFields,yn=yn||ht.touchedFields&&xn!==pn)}return yn&&In&&dt.state.next(fn),yn?fn:{}},Et=(En,sn,pn,Tn)=>{const In=get$5(rt.errors,En),yn=ht.isValid&&isBoolean$2(sn)&&rt.isValid!==sn;if(tt.delayError&&pn?(ct=bt(()=>St(En,pn)),ct(tt.delayError)):(clearTimeout(ut),ct=null,pn?set$3(rt.errors,En,pn):unset(rt.errors,En)),(pn?!deepEqual$2(In,pn):In)||!isEmptyObject(Tn)||yn){const hn={...Tn,...yn&&isBoolean$2(sn)?{isValid:sn}:{},errors:rt.errors,name:En};rt={...rt,...hn},dt.state.next(hn)}xt(!1)},Ct=async En=>nt.resolver(at,nt.context,getResolverOptions(En||lt.mount,it,nt.criteriaMode,nt.shouldUseNativeValidation)),Lt=async En=>{const{errors:sn}=await Ct(En);if(En)for(const pn of En){const Tn=get$5(sn,pn);Tn?set$3(rt.errors,pn,Tn):unset(rt.errors,pn)}else rt.errors=sn;return sn},jt=async(En,sn,pn={valid:!0})=>{for(const Tn in En){const In=En[Tn];if(In){const{_f:yn,...hn}=In;if(yn){const fn=lt.array.has(yn.name),xn=await validateField(In,at,yt,nt.shouldUseNativeValidation&&!sn,fn);if(xn[yn.name]&&(pn.valid=!1,sn))break;!sn&&(get$5(xn,yn.name)?fn?updateFieldArrayRootError(rt.errors,xn,yn.name):set$3(rt.errors,yn.name,xn[yn.name]):unset(rt.errors,yn.name))}hn&&await jt(hn,sn,pn)}}return pn.valid},Rt=()=>{for(const En of lt.unMount){const sn=get$5(it,En);sn&&(sn._f.refs?sn._f.refs.every(pn=>!live(pn)):!live(sn._f.ref))&&Yt(En)}lt.unMount=new Set},$t=(En,sn)=>(En&&sn&&set$3(at,En,sn),!deepEqual$2(Ut(),ot)),vt=(En,sn,pn)=>generateWatchOutput(En,lt,{...st.mount?at:isUndefined$1(sn)?ot:isString$3(En)?{[En]:sn}:sn},pn,sn),It=En=>compact(get$5(st.mount?at:ot,En,tt.shouldUnregister?get$5(ot,En,[]):[])),Ot=(En,sn,pn={})=>{const Tn=get$5(it,En);let In=sn;if(Tn){const yn=Tn._f;yn&&(!yn.disabled&&set$3(at,En,getFieldValueAs(sn,yn)),In=isHTMLElement$2(yn.ref)&&isNullOrUndefined(sn)?"":sn,isMultipleSelect(yn.ref)?[...yn.ref.options].forEach(hn=>hn.selected=In.includes(hn.value)):yn.refs?isCheckBoxInput(yn.ref)?yn.refs.length>1?yn.refs.forEach(hn=>(!hn.defaultChecked||!hn.disabled)&&(hn.checked=Array.isArray(In)?!!In.find(fn=>fn===hn.value):In===hn.value)):yn.refs[0]&&(yn.refs[0].checked=!!In):yn.refs.forEach(hn=>hn.checked=hn.value===In):isFileInput(yn.ref)?yn.ref.value="":(yn.ref.value=In,yn.ref.type||dt.values.next({name:En,values:{...at}})))}(pn.shouldDirty||pn.shouldTouch)&&At(En,In,pn.shouldTouch,pn.shouldDirty,!0),pn.shouldValidate&&Nt(En)},Wt=(En,sn,pn)=>{for(const Tn in sn){const In=sn[Tn],yn=`${En}.${Tn}`,hn=get$5(it,yn);(lt.array.has(En)||!isPrimitive(In)||hn&&!hn._f)&&!isDateObject(In)?Wt(yn,In,pn):Ot(yn,In,pn)}},zt=(En,sn,pn={})=>{const Tn=get$5(it,En),In=lt.array.has(En),yn=cloneObject(sn);set$3(at,En,yn),In?(dt.array.next({name:En,values:{...at}}),(ht.isDirty||ht.dirtyFields)&&pn.shouldDirty&&dt.state.next({name:En,dirtyFields:getDirtyFields(ot,at),isDirty:$t(En,yn)})):Tn&&!Tn._f&&!isNullOrUndefined(yn)?Wt(En,yn,pn):Ot(En,yn,pn),isWatched(En,lt)&&dt.state.next({...rt}),dt.values.next({name:En,values:{...at}}),!st.mount&&et()},Ft=async En=>{const sn=En.target;let pn=sn.name,Tn=!0;const In=get$5(it,pn),yn=()=>sn.type?getFieldValue(In._f):getEventValue(En);if(In){let hn,fn;const xn=yn(),jn=En.type===EVENTS.BLUR||En.type===EVENTS.FOCUS_OUT,cn=!hasValidation(In._f)&&!nt.resolver&&!get$5(rt.errors,pn)&&!In._f.deps||skipValidation(jn,get$5(rt.touchedFields,pn),rt.isSubmitted,gt,mt),Xt=isWatched(pn,lt,jn);set$3(at,pn,xn),jn?(In._f.onBlur&&In._f.onBlur(En),ct&&ct(0)):In._f.onChange&&In._f.onChange(En);const Kt=At(pn,xn,jn,!1),kn=!isEmptyObject(Kt)||Xt;if(!jn&&dt.values.next({name:pn,type:En.type,values:{...at}}),cn)return ht.isValid&&wt(),kn&&dt.state.next({name:pn,...Xt?{}:Kt});if(!jn&&Xt&&dt.state.next({...rt}),xt(!0),nt.resolver){const{errors:Mn}=await Ct([pn]),On=schemaErrorLookup(rt.errors,it,pn),Bn=schemaErrorLookup(Mn,it,On.name||pn);hn=Bn.error,pn=Bn.name,fn=isEmptyObject(Mn)}else hn=(await validateField(In,at,yt,nt.shouldUseNativeValidation))[pn],Tn=Number.isNaN(xn)||xn===get$5(at,pn,xn),Tn&&(hn?fn=!1:ht.isValid&&(fn=await jt(it,!0)));Tn&&(In._f.deps&&Nt(In._f.deps),Et(pn,fn,hn,Kt))}},Nt=async(En,sn={})=>{let pn,Tn;const In=convertToArrayPayload(En);if(xt(!0),nt.resolver){const yn=await Lt(isUndefined$1(En)?En:In);pn=isEmptyObject(yn),Tn=En?!In.some(hn=>get$5(yn,hn)):pn}else En?(Tn=(await Promise.all(In.map(async yn=>{const hn=get$5(it,yn);return await jt(hn&&hn._f?{[yn]:hn}:hn)}))).every(Boolean),!(!Tn&&!rt.isValid)&&wt()):Tn=pn=await jt(it);return dt.state.next({...!isString$3(En)||ht.isValid&&pn!==rt.isValid?{}:{name:En},...nt.resolver||!En?{isValid:pn}:{},errors:rt.errors,isValidating:!1}),sn.shouldFocus&&!Tn&&focusFieldBy(it,yn=>yn&&get$5(rt.errors,yn),En?In:lt.mount),Tn},Ut=En=>{const sn={...ot,...st.mount?at:{}};return isUndefined$1(En)?sn:isString$3(En)?get$5(sn,En):En.map(pn=>get$5(sn,pn))},Pt=(En,sn)=>({invalid:!!get$5((sn||rt).errors,En),isDirty:!!get$5((sn||rt).dirtyFields,En),isTouched:!!get$5((sn||rt).touchedFields,En),error:get$5((sn||rt).errors,En)}),Ht=En=>{En&&convertToArrayPayload(En).forEach(sn=>unset(rt.errors,sn)),dt.state.next({errors:En?rt.errors:{}})},Qt=(En,sn,pn)=>{const Tn=(get$5(it,En,{_f:{}})._f||{}).ref;set$3(rt.errors,En,{...sn,ref:Tn}),dt.state.next({name:En,errors:rt.errors,isValid:!1}),pn&&pn.shouldFocus&&Tn&&Tn.focus&&Tn.focus()},an=(En,sn)=>isFunction$6(En)?dt.values.subscribe({next:pn=>En(vt(void 0,sn),pn)}):vt(En,sn,!0),Yt=(En,sn={})=>{for(const pn of En?convertToArrayPayload(En):lt.mount)lt.mount.delete(pn),lt.array.delete(pn),sn.keepValue||(unset(it,pn),unset(at,pn)),!sn.keepError&&unset(rt.errors,pn),!sn.keepDirty&&unset(rt.dirtyFields,pn),!sn.keepTouched&&unset(rt.touchedFields,pn),!nt.shouldUnregister&&!sn.keepDefaultValue&&unset(ot,pn);dt.values.next({values:{...at}}),dt.state.next({...rt,...sn.keepDirty?{isDirty:$t()}:{}}),!sn.keepIsValid&&wt()},nn=({disabled:En,name:sn,field:pn,fields:Tn})=>{if(isBoolean$2(En)){const In=En?void 0:get$5(at,sn,getFieldValue(pn?pn._f:get$5(Tn,sn)._f));set$3(at,sn,In),At(sn,In,!1,!1,!0)}},tn=(En,sn={})=>{let pn=get$5(it,En);const Tn=isBoolean$2(sn.disabled);return set$3(it,En,{...pn||{},_f:{...pn&&pn._f?pn._f:{ref:{name:En}},name:En,mount:!0,...sn}}),lt.mount.add(En),pn?nn({field:pn,disabled:sn.disabled,name:En}):Tt(En,!0,sn.value),{...Tn?{disabled:sn.disabled}:{},...nt.progressive?{required:!!sn.required,min:getRuleValue(sn.min),max:getRuleValue(sn.max),minLength:getRuleValue(sn.minLength),maxLength:getRuleValue(sn.maxLength),pattern:getRuleValue(sn.pattern)}:{},name:En,onChange:Ft,onBlur:Ft,ref:In=>{if(In){tn(En,sn),pn=get$5(it,En);const yn=isUndefined$1(In.value)&&In.querySelectorAll&&In.querySelectorAll("input,select,textarea")[0]||In,hn=isRadioOrCheckbox(yn),fn=pn._f.refs||[];if(hn?fn.find(xn=>xn===yn):yn===pn._f.ref)return;set$3(it,En,{_f:{...pn._f,...hn?{refs:[...fn.filter(live),yn,...Array.isArray(get$5(ot,En))?[{}]:[]],ref:{type:yn.type,name:En}}:{ref:yn}}}),Tt(En,!1,void 0,yn)}else pn=get$5(it,En,{}),pn._f&&(pn._f.mount=!1),(nt.shouldUnregister||sn.shouldUnregister)&&!(isNameInFieldArray(lt.array,En)&&st.action)&<.unMount.add(En)}}},dn=()=>nt.shouldFocusError&&focusFieldBy(it,En=>En&&get$5(rt.errors,En),lt.mount),wn=(En,sn)=>async pn=>{pn&&(pn.preventDefault&&pn.preventDefault(),pn.persist&&pn.persist());let Tn=cloneObject(at);if(dt.state.next({isSubmitting:!0}),nt.resolver){const{errors:In,values:yn}=await Ct();rt.errors=In,Tn=yn}else await jt(it);unset(rt.errors,"root"),isEmptyObject(rt.errors)?(dt.state.next({errors:{}}),await En(Tn,pn)):(sn&&await sn({...rt.errors},pn),dn(),setTimeout(dn)),dt.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(rt.errors),submitCount:rt.submitCount+1,errors:rt.errors})},rn=(En,sn={})=>{get$5(it,En)&&(isUndefined$1(sn.defaultValue)?zt(En,get$5(ot,En)):(zt(En,sn.defaultValue),set$3(ot,En,sn.defaultValue)),sn.keepTouched||unset(rt.touchedFields,En),sn.keepDirty||(unset(rt.dirtyFields,En),rt.isDirty=sn.defaultValue?$t(En,get$5(ot,En)):$t()),sn.keepError||(unset(rt.errors,En),ht.isValid&&wt()),dt.state.next({...rt}))},Jt=(En,sn={})=>{const pn=En?cloneObject(En):ot,Tn=cloneObject(pn),In=En&&!isEmptyObject(En)?Tn:ot;if(sn.keepDefaultValues||(ot=pn),!sn.keepValues){if(sn.keepDirtyValues||pt)for(const yn of lt.mount)get$5(rt.dirtyFields,yn)?set$3(In,yn,get$5(at,yn)):zt(yn,get$5(In,yn));else{if(isWeb&&isUndefined$1(En))for(const yn of lt.mount){const hn=get$5(it,yn);if(hn&&hn._f){const fn=Array.isArray(hn._f.refs)?hn._f.refs[0]:hn._f.ref;if(isHTMLElement$2(fn)){const xn=fn.closest("form");if(xn){xn.reset();break}}}}it={}}at=tt.shouldUnregister?sn.keepDefaultValues?cloneObject(ot):{}:cloneObject(In),dt.array.next({values:{...In}}),dt.values.next({values:{...In}})}lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!st.mount&&et(),st.mount=!ht.isValid||!!sn.keepIsValid,st.watch=!!tt.shouldUnregister,dt.state.next({submitCount:sn.keepSubmitCount?rt.submitCount:0,isDirty:sn.keepDirty?rt.isDirty:!!(sn.keepDefaultValues&&!deepEqual$2(En,ot)),isSubmitted:sn.keepIsSubmitted?rt.isSubmitted:!1,dirtyFields:sn.keepDirtyValues?rt.dirtyFields:sn.keepDefaultValues&&En?getDirtyFields(ot,En):{},touchedFields:sn.keepTouched?rt.touchedFields:{},errors:sn.keepErrors?rt.errors:{},isSubmitSuccessful:sn.keepIsSubmitSuccessful?rt.isSubmitSuccessful:!1,isSubmitting:!1})},vn=(En,sn)=>Jt(isFunction$6(En)?En(at):En,sn);return{control:{register:tn,unregister:Yt,getFieldState:Pt,handleSubmit:wn,setError:Qt,_executeSchema:Ct,_getWatch:vt,_getDirty:$t,_updateValid:wt,_removeUnmounted:Rt,_updateFieldArray:kt,_updateDisabledField:nn,_getFieldArray:It,_reset:Jt,_resetDefaultValues:()=>isFunction$6(nt.defaultValues)&&nt.defaultValues().then(En=>{vn(En,nt.resetOptions),dt.state.next({isLoading:!1})}),_updateFormState:En=>{rt={...rt,...En}},_subjects:dt,_proxyFormState:ht,get _fields(){return it},get _formValues(){return at},get _state(){return st},set _state(En){st=En},get _defaultValues(){return ot},get _names(){return lt},set _names(En){lt=En},get _formState(){return rt},set _formState(En){rt=En},get _options(){return nt},set _options(En){nt={...nt,...En}}},trigger:Nt,register:tn,handleSubmit:wn,watch:an,setValue:zt,getValues:Ut,reset:vn,resetField:rn,clearErrors:Ht,unregister:Yt,setError:Qt,setFocus:(En,sn={})=>{const pn=get$5(it,En),Tn=pn&&pn._f;if(Tn){const In=Tn.refs?Tn.refs[0]:Tn.ref;In.focus&&(In.focus(),sn.shouldSelect&&In.select())}},getFieldState:Pt}}function useForm(tt={}){const et=React$1.useRef(),nt=React$1.useRef(),[rt,it]=React$1.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$6(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:isFunction$6(tt.defaultValues)?void 0:tt.defaultValues});et.current||(et.current={...createFormControl(tt,()=>it(at=>({...at}))),formState:rt});const ot=et.current.control;return ot._options=tt,useSubscribe({subject:ot._subjects.state,next:at=>{shouldRenderFormState(at,ot._proxyFormState,ot._updateFormState,!0)&&it({...ot._formState})}}),React$1.useEffect(()=>{tt.values&&!deepEqual$2(tt.values,nt.current)?(ot._reset(tt.values,ot._options.resetOptions),nt.current=tt.values):ot._resetDefaultValues()},[tt.values,ot]),React$1.useEffect(()=>{ot._state.mount||(ot._updateValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),et.current.formState=getProxyFormState(rt,ot),et.current}const ReactToastify="";var dist$3={exports:{}},lib$3={},postMessage$2={};Object.defineProperty(postMessage$2,"__esModule",{value:!0});postMessage$2.removeEventer=postMessage$2.addEventer=postMessage$2.postMessage=void 0;function postMessage$1(tt){var et=window;if(et.sendToElectron)return et.sendToElectron("sphinx-bridge",tt);et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?et.ReactNativeWebView.postMessage(JSON.stringify(tt)):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.webkit.messageHandlers.sphinx.postMessage(tt):et.Android?et.Android.receiveMessage(JSON.stringify(tt)):et.parent.postMessage(tt,"*")}postMessage$2.postMessage=postMessage$1;function addEventer(tt){var et=window;if(et.sendToElectron){et.EE&&et.EE.once("sphinx-bridge",tt);return}else et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.addEventListener("message",function(nt){var rt={};try{rt=JSON.parse(nt.data)}catch{}tt({data:rt})}):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.sphinxMessage=function(nt){var rt={};try{rt=JSON.parse(nt)}catch{}tt({data:rt})}:et.Android?et.sphinxMessage=function(nt){var rt={};try{rt=JSON.parse(nt)}catch{}tt({data:rt})}:et.addEventListener("message",tt)}postMessage$2.addEventer=addEventer;function removeEventer(tt){var et=window;et.sendToElectron||(et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.removeEventListener("message",tt):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx||et.Android?et.sphinxMessage=null:et.removeEventListener("message",tt))}postMessage$2.removeEventer=removeEventer;(function(tt){var et=commonjsGlobal&&commonjsGlobal.__assign||function(){return et=Object.assign||function(lt){for(var ct,ut=1,ht=arguments.length;ut0&&pt[pt.length-1])&&(bt[0]===6||bt[0]===2)){ut=0;continue}if(bt[0]===3&&(!pt||bt[1]>pt[0]&&bt[1] ENABLE!"),this.isEnabled)return[2,{budget:this.budget,pubkey:this.pubkey,application:at}];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.AUTHORIZE)];case 2:return ut=pt.sent(),ht=ut.budget||ut.budget===0,ht&&ut.pubkey?(this.isEnabled=!0,this.budget=ut.budget,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[3,4];case 4:return[2,null]}})})},lt.prototype.authorize=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt,mt,gt;return rt(this,function(yt){switch(yt.label){case 0:ht&&(this.logging=!0),this.logging&&console.log("=> AUTHORIZE!"),yt.label=1;case 1:return yt.trys.push([1,3,,4]),dt=ut||!1,[4,this.postMsg(ot.AUTHORIZE,{challenge:ct,noBudget:dt})];case 2:return pt=yt.sent(),mt=pt.budget||pt.budget===0,(dt||mt)&&pt.pubkey?(this.isEnabled=!0,this.budget=pt.budget||0,this.pubkey=pt.pubkey,[2,pt]):[3,4];case 3:return gt=yt.sent(),this.logging&&console.log(gt),[3,4];case 4:return[2,null]}})})},lt.prototype.topup=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return rt(this,function(dt){switch(dt.label){case 0:this.logging&&console.log("=> TOP UP"),dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.AUTHORIZE)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut&&ct.pubkey?(this.budget=ct.budget,this.pubkey=ct.pubkey,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[3,4];case 4:return[2,null]}})})},lt.prototype.keysend=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt,pt;return rt(this,function(mt){switch(mt.label){case 0:if(this.logging&&console.log("=> KEYSEND"),!this.isEnabled)return[2,null];if(!ct||!ut)return[2,null];if(ct.length!==66)return[2,null];if(ut<1)return[2,null];if(ut>this.budget)return[2,null];mt.label=1;case 1:return mt.trys.push([1,3,,4]),ht={dest:ct,amt:ut},[4,this.postMsg(ot.KEYSEND,ht)];case 2:return dt=mt.sent(),dt&&dt.success&&(this.budget=this.budget-ut,dt.budget=this.budget),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,null];case 4:return[2]}})})},lt.prototype.updated=function(){return nt(this,void 0,void 0,function(){var ct,ut;return rt(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> UDPATED"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATED)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.sendPayment=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SEND PAYMENT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.PAYMENT,{paymentRequest:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.saveLsat=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt;return rt(this,function(mt){switch(mt.label){case 0:this.logging&&console.log("=> SAVE LSAT"),mt.label=1;case 1:return mt.trys.push([1,3,,4]),[4,this.postMsg(ot.LSAT,{paymentRequest:ct,macaroon:ut,issuer:ht})];case 2:return dt=mt.sent(),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,pt];case 4:return[2]}})})},lt.prototype.getLsat=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> GET LSAT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.GETLSAT,{issuer:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,ht];case 4:return[2]}})})},lt.prototype.updateLsat=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return rt(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> UPDATE LSAT"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATELSAT,{identifier:ct,status:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,dt];case 4:return[2]}})})},lt.prototype.makeInvoice=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return rt(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> MAKE INVOICE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.INVOICE,{amt:ct,memo:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.signMessage=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SIGN MESSAGE"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{message:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.verifyMessage=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return rt(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> VERIFY MESSAGE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{signature:ct,message:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.reload=function(ct){return nt(this,void 0,void 0,function(){var ut,ht,dt;return rt(this,function(pt){switch(pt.label){case 0:this.logging&&console.log("=> RELOAD"),pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.RELOAD,{password:ct})];case 2:return ut=pt.sent(),ht=ut.budget||ut.budget===0,ht&&ut.pubkey?(this.isEnabled=!0,this.budget=ut.budget,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[3,4];case 4:return[2,null]}})})},lt.prototype.saveGraphData=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SAVEDATA"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SAVEDATA,{data:{type:ct.type,metaData:ct.metaData}})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.getPersonData=function(){return nt(this,void 0,void 0,function(){var ct,ut;return rt(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> GETPERSONDATA"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.GETPERSONDATA)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.getBudget=function(){return nt(this,void 0,void 0,function(){var ct,ut;return rt(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> GETBUDGET"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.GETBUDGET)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.postMsg=function(ct,ut){var ht=this;return ht.active&&Promise.reject(new Error("User is busy")),ht.active=ct,new Promise(function(dt,pt){it.postMessage(et({application:at,type:ct},ut||{}));function mt(gt){!gt.data||gt.data.application!==at||(gt.data.error?(ht.active=null,pt(gt.data.error)):(ht.active=null,dt(gt.data)),it.removeEventer(mt))}it.addEventer(mt)})},lt}();tt.default=st})(lib$3);var dist$2=dist$3.exports;Object.defineProperty(dist$2,"__esModule",{value:!0});var lib_1=lib$3,sphinx=new lib_1.default;dist$3.exports=sphinx;var distExports$1=dist$3.exports,reactIs$3={exports:{}},reactIs_production_min$2={};/** + */var split=splitString,extend$3=extendShallow,isPlainObject$3=isPlainObject$5,isObject$h=isExtendable,setValue=function(tt,et,nt){if(!isObject$h(tt)||(Array.isArray(et)&&(et=[].concat.apply([],et).join(".")),typeof et!="string"))return tt;for(var rt=split(et,{sep:".",brackets:!0}).filter(isValidKey),it=rt.length,ot=-1,at=tt;++ottt.filter(Boolean).join(".");function getKeyPath(tt){const et=tt.split(".");return[et.pop(),et.join(".")||void 0]}function getValuesForPaths(tt,et){return Object.entries(pick$1(tt,et)).reduce((nt,[,{value:rt,disabled:it,key:ot}])=>(nt[ot]=it?void 0:rt,nt),{})}function useCompareMemoize(tt,et){const nt=reactExports.useRef();return(et?dequal:shallow$2)(tt,nt.current)||(nt.current=tt),nt.current}function useDeepMemo(tt,et){return reactExports.useMemo(tt,useCompareMemoize(et,!0))}function useToggle(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),rt=reactExports.useRef(!0);return reactExports.useLayoutEffect(()=>{tt||(et.current.style.height="0px",et.current.style.overflow="hidden")},[]),reactExports.useEffect(()=>{if(rt.current){rt.current=!1;return}let it;const ot=et.current,at=()=>{tt&&(ot.style.removeProperty("height"),ot.style.removeProperty("overflow"),nt.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};ot.addEventListener("transitionend",at,{once:!0});const{height:st}=nt.current.getBoundingClientRect();return ot.style.height=st+"px",tt||(ot.style.overflow="hidden",it=window.setTimeout(()=>ot.style.height="0px",50)),()=>{ot.removeEventListener("transitionend",at),clearTimeout(it)}},[tt]),{wrapperRef:et,contentRef:nt}}const useVisiblePaths=tt=>{const[et,nt]=reactExports.useState(tt.getVisiblePaths());return reactExports.useEffect(()=>{nt(tt.getVisiblePaths());const rt=tt.useStore.subscribe(tt.getVisiblePaths,nt,{equalityFn:shallow$2});return()=>rt()},[tt]),et};function useValuesForPath(tt,et,nt){return tt.useStore(it=>{const ot=_objectSpread2$1(_objectSpread2$1({},nt),it.data);return getValuesForPaths(ot,et)},shallow$2)}function usePopin(tt=3){const et=reactExports.useRef(null),nt=reactExports.useRef(null),[rt,it]=reactExports.useState(!1),ot=reactExports.useCallback(()=>it(!0),[]),at=reactExports.useCallback(()=>it(!1),[]);return reactExports.useLayoutEffect(()=>{if(rt){const{bottom:st,top:lt,left:ct}=et.current.getBoundingClientRect(),{height:ut}=nt.current.getBoundingClientRect(),ht=st+ut>window.innerHeight-40?"up":"down";nt.current.style.position="fixed",nt.current.style.zIndex="10000",nt.current.style.left=ct+"px",ht==="down"?nt.current.style.top=st+tt+"px":nt.current.style.bottom=window.innerHeight-lt+tt+"px"}},[tt,rt]),{popinRef:et,wrapperRef:nt,shown:rt,show:ot,hide:at}}k$8([namesPlugin]);const convertMap={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};v8n.extend({color:()=>tt=>w$5(tt).isValid()});const schema$2=tt=>v8n().color().test(tt);function convert$5(tt,{format:et,hasAlpha:nt,isString:rt}){const it=convertMap[et]+(rt&&et!=="hex"?"String":""),ot=tt[it]();return typeof ot=="object"&&!nt?omit$1(ot,["a"]):ot}const sanitize$2=(tt,et)=>{const nt=w$5(tt);if(!nt.isValid())throw Error("Invalid color");return convert$5(nt,et)},format$1$1=(tt,et)=>convert$5(w$5(tt),_objectSpread2$1(_objectSpread2$1({},et),{},{isString:!0,format:"hex"})),normalize$3=({value:tt})=>{const et=I$2(tt),nt=et==="name"?"hex":et,rt=typeof tt=="object"?"a"in tt:et==="hex"&&tt.length===8||/^(rgba)|(hsla)|(hsva)/.test(tt),it={format:nt,hasAlpha:rt,isString:typeof tt=="string"};return{value:sanitize$2(tt,it),settings:it}};var props$2=Object.freeze({__proto__:null,schema:schema$2,sanitize:sanitize$2,format:format$1$1,normalize:normalize$3});const ColorPreview=styled$5("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),PickerContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),PickerWrapper=styled$5("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function convertToRgb(tt,et){return et!=="rgb"?w$5(tt).toRgb():tt}function Color$2({value:tt,displayValue:et,settings:nt,onUpdate:rt}){const{emitOnEditStart:it,emitOnEditEnd:ot}=useInputContext(),{format:at,hasAlpha:st}=nt,{popinRef:lt,wrapperRef:ct,shown:ut,show:ht,hide:dt}=usePopin(),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState(()=>convertToRgb(tt,at)),yt=st?Ce:Ne$1,bt=()=>{gt(convertToRgb(tt,at)),ht(),it()},wt=()=>{dt(),ot(),window.clearTimeout(pt.current)},xt=()=>{pt.current=window.setTimeout(wt,500)};return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(ColorPreview,{ref:lt,active:ut,onClick:()=>bt(),style:{color:et}}),ut&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:wt}),React$1.createElement(PickerWrapper,{ref:ct,onMouseEnter:()=>window.clearTimeout(pt.current),onMouseLeave:kt=>kt.buttons===0&&xt()},React$1.createElement(yt,{color:mt,onChange:rt}))))}function ColorComponent(){const{value:tt,displayValue:et,label:nt,onChange:rt,onUpdate:it,settings:ot}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,nt),React$1.createElement(PickerContainer,null,React$1.createElement(Color$2,{value:tt,displayValue:et,onChange:rt,onUpdate:it,settings:ot}),React$1.createElement(ValueInput,{value:et,onChange:rt,onUpdate:it})))}var color$3=_objectSpread2$1({component:ColorComponent},props$2);function Vector3dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Vector,{value:et,settings:rt,onUpdate:nt}))}var vector3d=_objectSpread2$1({component:Vector3dComponent},getVectorPlugin(["x","y","z"]));const JoystickTrigger=styled$5("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),JoystickPlayground=styled$5("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function Joystick({value:tt,settings:et,onUpdate:nt}){const rt=reactExports.useRef(),it=reactExports.useRef(0),ot=reactExports.useRef(0),at=reactExports.useRef(1),[st,lt]=reactExports.useState(!1),[ct,ut]=reactExports.useState(!1),[ht,dt]=useTransform(),pt=reactExports.useRef(null),mt=reactExports.useRef(null);reactExports.useLayoutEffect(()=>{if(st){const{top:Rt,left:$t,width:vt,height:It}=pt.current.getBoundingClientRect();mt.current.style.left=$t+vt/2+"px",mt.current.style.top=Rt+It/2+"px"}},[st]);const{keys:[gt,yt],joystick:bt}=et,wt=bt==="invertY"?1:-1,{[gt]:{step:xt},[yt]:{step:kt}}=et,St=useTh("sizes","joystickWidth"),Tt=useTh("sizes","joystickHeight"),At=parseFloat(St)*.8/2,Et=parseFloat(Tt)*.8/2,Ct=reactExports.useCallback(()=>{rt.current||(ut(!0),it.current&&dt({x:it.current*At}),ot.current&&dt({y:ot.current*-Et}),rt.current=window.setInterval(()=>{nt(Rt=>{const $t=xt*it.current*at.current,vt=wt*kt*ot.current*at.current;return Array.isArray(Rt)?{[gt]:Rt[0]+$t,[yt]:Rt[1]+vt}:{[gt]:Rt[gt]+$t,[yt]:Rt[yt]+vt}})},16))},[At,Et,nt,dt,xt,kt,gt,yt,wt]),Lt=reactExports.useCallback(()=>{window.clearTimeout(rt.current),rt.current=void 0,ut(!1)},[]);reactExports.useEffect(()=>{function Rt($t){at.current=multiplyStep($t)}return window.addEventListener("keydown",Rt),window.addEventListener("keyup",Rt),()=>{window.clearTimeout(rt.current),window.removeEventListener("keydown",Rt),window.removeEventListener("keyup",Rt)}},[]);const jt=useDrag$1(({first:Rt,active:$t,delta:[vt,It],movement:[Ot,Wt]})=>{Rt&<(!0);const zt=clamp$7(Ot,-At,At),Ft=clamp$7(Wt,-Et,Et);it.current=Math.abs(Ot)>Math.abs(zt)?Math.sign(Ot-zt):0,ot.current=Math.abs(Wt)>Math.abs(Ft)?Math.sign(Ft-Wt):0;let Nt=tt[gt],Ut=tt[yt];$t?(it.current||(Nt+=vt*xt*at.current,dt({x:zt})),ot.current||(Ut-=wt*It*kt*at.current,dt({y:Ft})),it.current||ot.current?Ct():Lt(),nt({[gt]:Nt,[yt]:Ut})):(lt(!1),it.current=0,ot.current=0,dt({x:0,y:0}),Lt())});return React$1.createElement(JoystickTrigger,_extends$t({ref:pt},jt()),st&&React$1.createElement(Portal$1,null,React$1.createElement(JoystickPlayground,{ref:mt,isOutOfBounds:ct},React$1.createElement("div",null),React$1.createElement("span",{ref:ht}))))}const Container$1=styled$5("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function Vector2dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container$1,{withJoystick:!!rt.joystick},rt.joystick&&React$1.createElement(Joystick,{value:et,settings:rt,onUpdate:nt}),React$1.createElement(Vector,{value:et,settings:rt,onUpdate:nt})))}const _excluded$7$1=["joystick"],plugin=getVectorPlugin(["x","y"]),normalize$2$1=tt=>{let{joystick:et=!0}=tt,nt=_objectWithoutProperties$l(tt,_excluded$7$1);const{value:rt,settings:it}=plugin.normalize(nt);return{value:rt,settings:_objectSpread2$1(_objectSpread2$1({},it),{},{joystick:et})}};var vector2d=_objectSpread2$1(_objectSpread2$1({component:Vector2dComponent},plugin),{},{normalize:normalize$2$1});const sanitize$1=tt=>{if(tt!==void 0){if(tt instanceof File)try{return URL.createObjectURL(tt)}catch{return}if(typeof tt=="string"&&tt.indexOf("blob:")===0)return tt;throw Error("Invalid image format [undefined | blob | File].")}},schema$1=(tt,et)=>typeof et=="object"&&"image"in et,normalize$1$1=({image:tt})=>({value:tt});var props$1=Object.freeze({__proto__:null,sanitize:sanitize$1,schema:schema$1,normalize:normalize$1$1});const ImageContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),DropZone=styled$5("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),ImagePreview=styled$5("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),ImageLargePreview=styled$5("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),Instructions=styled$5("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),Remove=styled$5("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function ImageComponent(){const{label:tt,value:et,onUpdate:nt,disabled:rt}=useInputContext(),{popinRef:it,wrapperRef:ot,shown:at,show:st,hide:lt}=usePopin(),ct=reactExports.useCallback(mt=>{mt.length&&nt(mt[0])},[nt]),ut=reactExports.useCallback(mt=>{mt.stopPropagation(),nt(void 0)},[nt]),{getRootProps:ht,getInputProps:dt,isDragAccept:pt}=useDropzone({maxFiles:1,accept:"image/*",onDrop:ct,disabled:rt});return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(ImageContainer,null,React$1.createElement(ImagePreview,{ref:it,hasImage:!!et,onPointerDown:()=>!!et&&st(),onPointerUp:lt,style:{backgroundImage:et?`url(${et})`:"none"}}),at&&!!et&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:lt,style:{cursor:"pointer"}}),React$1.createElement(ImageLargePreview,{ref:ot,style:{backgroundImage:`url(${et})`}})),React$1.createElement(DropZone,ht({isDragAccept:pt}),React$1.createElement("input",dt()),React$1.createElement(Instructions,null,pt?"drop image":"click or drop")),React$1.createElement(Remove,{onClick:ut,disabled:!et})))}var image=_objectSpread2$1({component:ImageComponent},props$1);const number$5=v8n().number(),schema=(tt,et)=>v8n().array().length(2).every.number().test(tt)&&v8n().schema({min:number$5,max:number$5}).test(et),format$2=tt=>({min:tt[0],max:tt[1]}),sanitize=(tt,{bounds:[et,nt]},rt)=>{const it=Array.isArray(tt)?format$2(tt):tt,ot={min:rt[0],max:rt[1]},{min:at,max:st}=_objectSpread2$1(_objectSpread2$1({},ot),it);return[clamp$7(Number(at),et,Math.max(et,st)),clamp$7(Number(st),Math.min(nt,at),nt)]},normalize$4=({value:tt,min:et,max:nt})=>{const rt={min:et,max:nt},it=normalizeKeyedNumberSettings(format$2(tt),{min:rt,max:rt}),ot=[et,nt],at=_objectSpread2$1(_objectSpread2$1({},it),{},{bounds:ot});return{value:sanitize(format$2(tt),at,tt),settings:at}};var props$3=Object.freeze({__proto__:null,schema,format:format$2,sanitize,normalize:normalize$4});const _excluded$6$1=["value","bounds","onDrag"],_excluded2$1$1=["bounds"],Container=styled$5("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function IntervalSlider(tt){let{value:et,bounds:[nt,rt],onDrag:it}=tt,ot=_objectWithoutProperties$l(tt,_excluded$6$1);const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(null),ct=reactExports.useRef(0),ut=useTh("sizes","scrubberWidth"),ht=useDrag$1(({event:mt,first:gt,xy:[yt],movement:[bt],memo:wt={}})=>{if(gt){const{width:kt,left:St}=at.current.getBoundingClientRect();ct.current=kt-parseFloat(ut);const Tt=(mt==null?void 0:mt.target)===st.current||(mt==null?void 0:mt.target)===lt.current;wt.pos=invertedRange((yt-St)/kt,nt,rt);const At=Math.abs(wt.pos-et.min)-Math.abs(wt.pos-et.max);wt.key=At<0||At===0&&wt.pos<=et.min?"min":"max",Tt&&(wt.pos=et[wt.key])}const xt=wt.pos+invertedRange(bt/ct.current,0,rt-nt);return it({[wt.key]:sanitizeStep(xt,ot[wt.key])}),wt}),dt=`calc(${range$8(et.min,nt,rt)} * (100% - ${ut} - 8px) + 4px)`,pt=`calc(${1-range$8(et.max,nt,rt)} * (100% - ${ut} - 8px) + 4px)`;return React$1.createElement(RangeWrapper,_extends$t({ref:at},ht()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:dt,right:pt}})),React$1.createElement(Scrubber,{position:"left",ref:st,style:{left:dt}}),React$1.createElement(Scrubber,{position:"right",ref:lt,style:{right:pt}}))}function IntervalComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:rt}=useInputContext(),it=_objectWithoutProperties$l(rt,_excluded2$1$1);return React$1.createElement(React$1.Fragment,null,React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container,null,React$1.createElement(IntervalSlider,_extends$t({value:et},rt,{onDrag:nt})),React$1.createElement(Vector,{value:et,settings:it,onUpdate:nt,innerLabelTrim:0}))))}var interval$1=_objectSpread2$1({component:IntervalComponent},props$3);const createEventEmitter=()=>{const tt=new Map;return{on:(et,nt)=>{let rt=tt.get(et);rt===void 0&&(rt=new Set,tt.set(et,rt)),rt.add(nt)},off:(et,nt)=>{const rt=tt.get(et);rt!==void 0&&(rt.delete(nt),rt.size===0&&tt.delete(et))},emit:(et,...nt)=>{const rt=tt.get(et);if(rt!==void 0)for(const it of rt)it(...nt)}}},_excluded$5$1=["type","value"],_excluded2$h=["onChange","transient","onEditStart","onEditEnd"],Store=function(){const et=create$4(subscribeWithSelector(()=>({data:{}}))),nt=createEventEmitter();this.storeId=getUid(),this.useStore=et;const rt={},it=new Set;this.getVisiblePaths=()=>{const at=this.getData(),st=Object.keys(at),lt=[];Object.entries(rt).forEach(([ut,ht])=>{ht.render&&st.some(dt=>dt.indexOf(ut)===0)&&!ht.render(this.get)&<.push(ut+".")});const ct=[];return it.forEach(ut=>{ut in at&&at[ut].__refCount>0&<.every(ht=>ut.indexOf(ht)===-1)&&(!at[ut].render||at[ut].render(this.get))&&ct.push(ut)}),ct},this.setOrderedPaths=at=>{at.forEach(st=>it.add(st))},this.orderPaths=at=>(this.setOrderedPaths(at),at),this.disposePaths=at=>{et.setState(st=>{const lt=st.data;return at.forEach(ct=>{if(ct in lt){const ut=lt[ct];ut.__refCount--,ut.__refCount===0&&ut.type in SpecialInputs&&delete lt[ct]}}),{data:lt}})},this.dispose=()=>{et.setState(()=>({data:{}}))},this.getFolderSettings=at=>rt[at]||{},this.getData=()=>et.getState().data,this.addData=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{let dt=ct[ut];if(dt){const{type:pt,value:mt}=ht,gt=_objectWithoutProperties$l(ht,_excluded$5$1);pt!==dt.type?warn$3(LevaErrors.INPUT_TYPE_OVERRIDE,pt):((dt.__refCount===0||st)&&Object.assign(dt,gt),dt.__refCount++)}else ct[ut]=_objectSpread2$1(_objectSpread2$1({},ht),{},{__refCount:1})}),{data:ct}})},this.setValueAtPath=(at,st,lt)=>{et.setState(ct=>{const ut=ct.data;return updateInput(ut[at],st,at,this,lt),{data:ut}})},this.setSettingsAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].settings=_objectSpread2$1(_objectSpread2$1({},ct[at].settings),st),{data:ct}})},this.disableInputAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].disabled=st,{data:ct}})},this.set=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{try{updateInput(ct[ut],ht,void 0,void 0,st)}catch{}}),{data:ct}})},this.getInput=at=>{try{return this.getData()[at]}catch{warn$3(LevaErrors.PATH_DOESNT_EXIST,at)}},this.get=at=>{var st;return(st=this.getInput(at))===null||st===void 0?void 0:st.value},this.emitOnEditStart=at=>{nt.emit(`onEditStart:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.emitOnEditEnd=at=>{nt.emit(`onEditEnd:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.subscribeToEditStart=(at,st)=>{const lt=`onEditStart:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)},this.subscribeToEditEnd=(at,st)=>{const lt=`onEditEnd:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)};const ot=(at,st,lt)=>{const ct={};return Object.entries(at).forEach(([ut,ht])=>{if(ut==="")return warn$3(LevaErrors.EMPTY_KEY);let dt=join(st,ut);if(ht.type===SpecialInputs.FOLDER){const pt=ot(ht.schema,dt,lt);Object.assign(ct,pt),dt in rt||(rt[dt]=ht.settings)}else if(ut in lt)warn$3(LevaErrors.DUPLICATE_KEYS,ut,dt,lt[ut].path);else{const pt=normalizeInput(ht,ut,dt,ct);if(pt){const{type:mt,options:gt,input:yt}=pt,{onChange:bt,transient:wt,onEditStart:xt,onEditEnd:kt}=gt,St=_objectWithoutProperties$l(gt,_excluded2$h);ct[dt]=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({type:mt},St),yt),{},{fromPanel:!0}),lt[ut]={path:dt,onChange:bt,transient:wt,onEditStart:xt,onEditEnd:kt}}else warn$3(LevaErrors.UNKNOWN_INPUT,dt,ht)}}),ct};this.getDataFromSchema=at=>{const st={};return[ot(at,"",st),st]}},levaStore=new Store,defaultSettings$2={collapsed:!1};function folder(tt,et){return{type:SpecialInputs.FOLDER,schema:tt,settings:_objectSpread2$1(_objectSpread2$1({},defaultSettings$2),et)}}const isInput=tt=>"__levaInput"in tt,buildTree=(tt,et)=>{const nt={},rt=et?et.toLowerCase():null;return tt.forEach(it=>{const[ot,at]=getKeyPath(it);(!rt||ot.toLowerCase().indexOf(rt)>-1)&&merge$2(nt,at,{[ot]:{__levaInput:!0,path:it}})}),nt},_excluded$4$1=["type","label","path","valueKey","value","settings","setValue","disabled"];function ControlInput(tt){let{type:et,label:nt,path:rt,valueKey:it,value:ot,settings:at,setValue:st,disabled:lt}=tt,ct=_objectWithoutProperties$l(tt,_excluded$4$1);const{displayValue:ut,onChange:ht,onUpdate:dt}=useInputSetters({type:et,value:ot,settings:at,setValue:st}),pt=Plugins[et].component;return pt?React$1.createElement(InputContext.Provider,{value:_objectSpread2$1({key:it,path:rt,id:""+rt,label:nt,displayValue:ut,value:ot,onChange:ht,onUpdate:dt,settings:at,setValue:st,disabled:lt},ct)},React$1.createElement(StyledInputWrapper$1,{disabled:lt},React$1.createElement(pt,null))):(warn$3(LevaErrors.NO_COMPONENT_FOR_TYPE,et,rt),null)}const StyledButton$6=styled$5("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function Button$3({onClick:tt,settings:et,label:nt}){const rt=useStoreContext();return React$1.createElement(Row,null,React$1.createElement(StyledButton$6,{disabled:et.disabled,onClick:()=>tt(rt.get)},nt))}const StyledButtonGroup=styled$5("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),StyledButtonGroupButton=styled$5("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),getOpts=({label:tt,opts:et})=>{let nt=typeof tt=="string"&&tt.trim()===""?null:tt,rt=et;return typeof et.opts=="object"&&(rt.label!==void 0&&(nt=et.label),rt=et.opts),{label:nt,opts:rt}};function ButtonGroup(tt){const{label:et,opts:nt}=getOpts(tt),rt=useStoreContext();return React$1.createElement(Row,{input:!!et},et&&React$1.createElement(Label$2,null,et),React$1.createElement(StyledButtonGroup,null,Object.entries(nt).map(([it,ot])=>React$1.createElement(StyledButtonGroupButton,{key:it,onClick:()=>ot(rt.get)},it))))}const Canvas$2=styled$5("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),POINTS=100;function push(tt,et){tt.push(et),tt.length>POINTS&&tt.shift()}const MonitorCanvas=reactExports.forwardRef(function({initialValue:tt},et){const nt=useTh("colors","highlight3"),rt=useTh("colors","elevation2"),it=useTh("colors","highlight1"),[ot,at]=reactExports.useMemo(()=>[w$5(it).alpha(.4).toRgbString(),w$5(it).alpha(.1).toRgbString()],[it]),st=reactExports.useRef([tt]),lt=reactExports.useRef(tt),ct=reactExports.useRef(tt),ut=reactExports.useRef(),ht=reactExports.useCallback((mt,gt)=>{if(!mt)return;const{width:yt,height:bt}=mt,wt=new Path2D,xt=yt/POINTS,kt=bt*.05;for(let At=0;At({frame:mt=>{(lt.current===void 0||mtct.current)&&(ct.current=mt),push(st.current,mt),ut.current=requestAnimationFrame(()=>ht(dt.current,pt.current))}}),[dt,pt,ht]),reactExports.useEffect(()=>()=>cancelAnimationFrame(ut.current),[]),React$1.createElement(Canvas$2,{ref:dt})}),parse$2=tt=>Number.isFinite(tt)?tt.toPrecision(2):tt.toString(),MonitorLog=reactExports.forwardRef(function({initialValue:tt},et){const[nt,rt]=reactExports.useState(parse$2(tt));return reactExports.useImperativeHandle(et,()=>({frame:it=>rt(parse$2(it))}),[]),React$1.createElement("div",null,nt)});function getValue$4(tt){return typeof tt=="function"?tt():tt.current}function Monitor({label:tt,objectOrFn:et,settings:nt}){const rt=reactExports.useRef(),it=reactExports.useRef(getValue$4(et));return reactExports.useEffect(()=>{const ot=window.setInterval(()=>{var at;document.hidden||(at=rt.current)===null||at===void 0||at.frame(getValue$4(et))},nt.interval);return()=>window.clearInterval(ot)},[et,nt.interval]),React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,{align:"top"},tt),nt.graph?React$1.createElement(MonitorCanvas,{ref:rt,initialValue:it.current}):React$1.createElement(MonitorLog,{ref:rt,initialValue:it.current}))}const _excluded$3$1=["type","label","key"],specialComponents={[SpecialInputs.BUTTON]:Button$3,[SpecialInputs.BUTTON_GROUP]:ButtonGroup,[SpecialInputs.MONITOR]:Monitor},Control=React$1.memo(({path:tt})=>{const[et,{set:nt,setSettings:rt,disable:it,storeId:ot,emitOnEditStart:at,emitOnEditEnd:st}]=useInput(tt);if(!et)return null;const{type:lt,label:ct,key:ut}=et,ht=_objectWithoutProperties$l(et,_excluded$3$1);if(lt in SpecialInputs){const dt=specialComponents[lt];return React$1.createElement(dt,_extends$t({label:ct,path:tt},ht))}return lt in Plugins?React$1.createElement(ControlInput,_extends$t({key:ot+tt,type:lt,label:ct,storeId:ot,path:tt,valueKey:ut,setValue:nt,setSettings:rt,disable:it,emitOnEditStart:at,emitOnEditEnd:st},ht)):(log$2(LevaErrors.UNSUPPORTED_INPUT,lt,tt),null)});function FolderTitle({toggle:tt,toggled:et,name:nt}){return React$1.createElement(StyledTitle,{onClick:()=>tt()},React$1.createElement(Chevron,{toggled:et}),React$1.createElement("div",null,nt))}const Folder=({name:tt,path:et,tree:nt})=>{const rt=useStoreContext(),it=join(et,tt),{collapsed:ot,color:at}=rt.getFolderSettings(it),[st,lt]=reactExports.useState(!ot),ct=reactExports.useRef(null),ut=useTh("colors","folderWidgetColor"),ht=useTh("colors","folderTextColor");return reactExports.useLayoutEffect(()=>{ct.current.style.setProperty("--leva-colors-folderWidgetColor",at||ut),ct.current.style.setProperty("--leva-colors-folderTextColor",at||ht)},[at,ut,ht]),React$1.createElement(StyledFolder,{ref:ct},React$1.createElement(FolderTitle,{name:tt,toggled:st,toggle:()=>lt(dt=>!dt)}),React$1.createElement(TreeWrapper,{parent:it,tree:nt,toggled:st}))},TreeWrapper=React$1.memo(({isRoot:tt=!1,fill:et=!1,flat:nt=!1,parent:rt,tree:it,toggled:ot})=>{const{wrapperRef:at,contentRef:st}=useToggle(ot),lt=useStoreContext(),ct=([ht,dt])=>{var pt;return(isInput(dt)?(pt=lt.getInput(dt.path))===null||pt===void 0?void 0:pt.order:lt.getFolderSettings(join(rt,ht)).order)||0},ut=Object.entries(it).sort((ht,dt)=>ct(ht)-ct(dt));return React$1.createElement(StyledWrapper,{ref:at,isRoot:tt,fill:et,flat:nt},React$1.createElement(StyledContent,{ref:st,isRoot:tt,toggled:ot},ut.map(([ht,dt])=>isInput(dt)?React$1.createElement(Control,{key:dt.path,valueKey:dt.valueKey,path:dt.path}):React$1.createElement(Folder,{key:ht,name:ht,path:rt,tree:dt}))))}),StyledRoot=styled$5("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${StyledInputRow}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),iconWidth=40,Icon=styled$5("i",{$flexCenter:"",width:iconWidth,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),StyledTitleWithFilter=styled$5("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),FilterWrapper=styled$5("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${Icon}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),StyledFilterInput=styled$5("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),TitleContainer=styled$5("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:iconWidth}}}}),FilterInput=React$1.forwardRef(({setFilter:tt,toggle:et},nt)=>{const[rt,it]=reactExports.useState(""),ot=reactExports.useMemo(()=>debounce$6(tt,250),[tt]),at=()=>{tt(""),it("")},st=lt=>{const ct=lt.currentTarget.value;et(!0),it(ct)};return reactExports.useEffect(()=>{ot(rt)},[rt,ot]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledFilterInput,{ref:nt,value:rt,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:lt=>lt.stopPropagation(),onChange:st}),React$1.createElement(Icon,{onClick:()=>at(),style:{visibility:rt?"visible":"hidden"}},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function TitleWithFilter({setFilter:tt,onDrag:et,onDragStart:nt,onDragEnd:rt,toggle:it,toggled:ot,title:at,drag:st,filterEnabled:lt,from:ct}){const[ut,ht]=reactExports.useState(!1),dt=reactExports.useRef(null);reactExports.useEffect(()=>{var mt,gt;ut?(mt=dt.current)===null||mt===void 0||mt.focus():(gt=dt.current)===null||gt===void 0||gt.blur()},[ut]);const pt=useDrag$1(({offset:[mt,gt],first:yt,last:bt})=>{et({x:mt,y:gt}),yt&&nt({x:mt,y:gt}),bt&&rt({x:mt,y:gt})},{filterTaps:!0,from:({offset:[mt,gt]})=>[(ct==null?void 0:ct.x)||mt,(ct==null?void 0:ct.y)||gt]});return reactExports.useEffect(()=>{const mt=gt=>{gt.key==="L"&>.shiftKey&>.metaKey&&ht(yt=>!yt)};return window.addEventListener("keydown",mt),()=>window.removeEventListener("keydown",mt)},[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledTitleWithFilter,{mode:st?"drag":void 0},React$1.createElement(Icon,{active:!ot,onClick:()=>it()},React$1.createElement(Chevron,{toggled:ot,width:12,height:8})),React$1.createElement(TitleContainer,_extends$t({},st?pt():{},{drag:st,filterEnabled:lt}),at===void 0&&st?React$1.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},React$1.createElement("circle",{cx:"2",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"2",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"12",r:"2"})):at),lt&&React$1.createElement(Icon,{active:ut,onClick:()=>ht(mt=>!mt)},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},React$1.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),React$1.createElement(FilterWrapper,{toggled:ut},React$1.createElement(FilterInput,{ref:dt,setFilter:tt,toggle:it})))}const _excluded$2$1=["store","hidden","theme","collapsed"];function LevaRoot(tt){let{store:et,hidden:nt=!1,theme:rt,collapsed:it=!1}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$1);const at=useDeepMemo(()=>mergeTheme(rt),[rt]),[st,lt]=reactExports.useState(!it),ct=typeof it=="object"?!it.collapsed:st,ut=reactExports.useMemo(()=>typeof it=="object"?ht=>{typeof ht=="function"?it.onChange(!ht(!it.collapsed)):it.onChange(!ht)}:lt,[it]);return!et||nt?null:React$1.createElement(ThemeContext$3.Provider,{value:at},React$1.createElement(LevaCore,_extends$t({store:et},ot,{toggled:ct,setToggle:ut,rootClass:at.className})))}const LevaCore=React$1.memo(({store:tt,rootClass:et,fill:nt=!1,flat:rt=!1,neverHide:it=!1,oneLineLabels:ot=!1,titleBar:at={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:st=!1,toggled:lt,setToggle:ct})=>{var ut,ht;const dt=useVisiblePaths(tt),[pt,mt]=reactExports.useState(""),gt=reactExports.useMemo(()=>buildTree(dt,pt),[dt,pt]),[yt,bt]=useTransform(),wt=it||dt.length>0,xt=typeof at=="object"&&at.title||void 0,kt=typeof at=="object"&&(ut=at.drag)!==null&&ut!==void 0?ut:!0,St=typeof at=="object"&&(ht=at.filter)!==null&&ht!==void 0?ht:!0,Tt=typeof at=="object"&&at.position||void 0,At=typeof at=="object"&&at.onDrag||void 0,Et=typeof at=="object"&&at.onDragStart||void 0,Ct=typeof at=="object"&&at.onDragEnd||void 0;return React$1.useEffect(()=>{bt({x:Tt==null?void 0:Tt.x,y:Tt==null?void 0:Tt.y})},[Tt,bt]),globalStyles(),React$1.createElement(PanelSettingsContext.Provider,{value:{hideCopyButton:st}},React$1.createElement(StyledRoot,{ref:yt,className:et,fill:nt,flat:rt,oneLineLabels:ot,hideTitleBar:!at,style:{display:wt?"block":"none"}},at&&React$1.createElement(TitleWithFilter,{onDrag:Lt=>{bt(Lt),At==null||At(Lt)},onDragStart:Lt=>Et==null?void 0:Et(Lt),onDragEnd:Lt=>Ct==null?void 0:Ct(Lt),setFilter:mt,toggle:Lt=>ct(jt=>Lt??!jt),toggled:lt,title:xt,drag:kt,filterEnabled:St,from:Tt}),wt&&React$1.createElement(StoreContext$1.Provider,{value:tt},React$1.createElement(TreeWrapper,{isRoot:!0,fill:nt,flat:rt,tree:gt,toggled:lt}))))}),_excluded$1$3=["isRoot"];let rootInitialized=!1,rootEl=null;function Leva(tt){let{isRoot:et=!1}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$3);return reactExports.useEffect(()=>(rootInitialized=!0,!et&&rootEl&&(rootEl.remove(),rootEl=null),()=>{et||(rootInitialized=!1)}),[et]),React$1.createElement(LevaRoot,_extends$t({store:levaStore},nt))}function useRenderRoot(tt){reactExports.useEffect(()=>{tt&&!rootInitialized&&(rootEl||(rootEl=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(rootEl),render(React$1.createElement(Leva,{isRoot:!0}),rootEl))),rootInitialized=!0)},[tt])}function parseArgs(tt,et,nt,rt,it){let ot,at,st,lt,ct;return typeof tt=="string"?(at=tt,ot=et,Array.isArray(nt)?ct=nt:nt&&("store"in nt?(lt=nt,ct=rt):(st=nt,Array.isArray(rt)?ct=rt:(lt=rt,ct=it)))):(ot=tt,Array.isArray(et)?ct=et:(lt=et,ct=nt)),{schema:ot,folderName:at,folderSettings:st,hookSettings:lt,deps:ct||[]}}function useControls(tt,et,nt,rt,it){const{folderName:ot,schema:at,folderSettings:st,hookSettings:lt,deps:ct}=parseArgs(tt,et,nt,rt,it),ut=typeof at=="function",ht=reactExports.useRef(!1),dt=reactExports.useRef(!0),pt=useDeepMemo(()=>{ht.current=!0;const jt=typeof at=="function"?at():at;return ot?{[ot]:folder(jt,st)}:jt},ct),mt=!(lt!=null&<.store);useRenderRoot(mt);const[gt]=reactExports.useState(()=>(lt==null?void 0:lt.store)||levaStore),[yt,bt]=reactExports.useMemo(()=>gt.getDataFromSchema(pt),[gt,pt]),[wt,xt,kt,St,Tt]=reactExports.useMemo(()=>{const jt=[],Rt=[],$t={},vt={},It={};return Object.values(bt).forEach(({path:Ot,onChange:Wt,onEditStart:zt,onEditEnd:Ft,transient:Nt})=>{jt.push(Ot),Wt?($t[Ot]=Wt,Nt||Rt.push(Ot)):Rt.push(Ot),zt&&(vt[Ot]=zt),Ft&&(It[Ot]=Ft)}),[jt,Rt,$t,vt,It]},[bt]),At=reactExports.useMemo(()=>gt.orderPaths(wt),[wt,gt]),Et=useValuesForPath(gt,xt,yt),Ct=reactExports.useCallback(jt=>{const Rt=Object.entries(jt).reduce(($t,[vt,It])=>Object.assign($t,{[bt[vt].path]:It}),{});gt.set(Rt,!1)},[gt,bt]),Lt=reactExports.useCallback(jt=>gt.get(bt[jt].path),[gt,bt]);return reactExports.useEffect(()=>{const jt=!dt.current&&ht.current;return gt.addData(yt,jt),dt.current=!1,ht.current=!1,()=>gt.disposePaths(At)},[gt,At,yt]),reactExports.useEffect(()=>{const jt=[];return Object.entries(kt).forEach(([Rt,$t])=>{$t(gt.get(Rt),Rt,_objectSpread2$1({initial:!0,get:gt.get},gt.getInput(Rt)));const vt=gt.useStore.subscribe(It=>{const Ot=It.data[Rt];return[Ot.disabled?void 0:Ot.value,Ot]},([It,Ot])=>$t(It,Rt,_objectSpread2$1({initial:!1,get:gt.get},Ot)),{equalityFn:shallow$2});jt.push(vt)}),()=>jt.forEach(Rt=>Rt())},[gt,kt]),reactExports.useEffect(()=>{const jt=[];return Object.entries(St).forEach(([Rt,$t])=>jt.push(gt.subscribeToEditStart(Rt,$t))),Object.entries(Tt).forEach(([Rt,$t])=>jt.push(gt.subscribeToEditEnd(Rt,$t))),()=>jt.forEach(Rt=>Rt())},[St,Tt,gt]),ut?[Et,Ct,Lt]:Et}register(LevaInputs.SELECT,select$1);register(LevaInputs.IMAGE,image);register(LevaInputs.NUMBER,number$6);register(LevaInputs.COLOR,color$3);register(LevaInputs.STRING,string$1);register(LevaInputs.BOOLEAN,boolean);register(LevaInputs.INTERVAL,interval$1);register(LevaInputs.VECTOR3D,vector3d);register(LevaInputs.VECTOR2D,vector2d);var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject$f=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject$f(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject$2=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject$f(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const nt=Array.isArray(tt);if(tt instanceof Date)et=new Date(tt);else if(tt instanceof Set)et=new Set(tt);else if(!(isWeb&&(tt instanceof Blob||tt instanceof FileList))&&(nt||isObject$f(tt)))if(et=nt?[]:{},!nt&&!isPlainObject$2(tt))et=tt;else for(const rt in tt)tt.hasOwnProperty(rt)&&(et[rt]=cloneObject(tt[rt]));else return tt;return et}var compact=tt=>Array.isArray(tt)?tt.filter(Boolean):[],isUndefined$1=tt=>tt===void 0,get$5=(tt,et,nt)=>{if(!et||!isObject$f(tt))return nt;const rt=compact(et.split(/[,[\].]+?/)).reduce((it,ot)=>isNullOrUndefined(it)?it:it[ot],tt);return isUndefined$1(rt)||rt===tt?isUndefined$1(tt[et])?nt:tt[et]:rt},isBoolean$2=tt=>typeof tt=="boolean";const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$1.createContext(null),useFormContext=()=>React$1.useContext(HookFormContext),FormProvider=tt=>{const{children:et,...nt}=tt;return React$1.createElement(HookFormContext.Provider,{value:nt},et)};var getProxyFormState=(tt,et,nt,rt=!0)=>{const it={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(it,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!rt||VALIDATION_MODE.all),nt&&(nt[at]=!0),tt[at]}});return it},isEmptyObject=tt=>isObject$f(tt)&&!Object.keys(tt).length,shouldRenderFormState=(tt,et,nt,rt)=>{nt(tt);const{name:it,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!rt||VALIDATION_MODE.all))},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],shouldSubscribeByName=(tt,et,nt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(rt=>rt&&(nt?rt===et:rt.startsWith(et)||et.startsWith(rt)));function useSubscribe(tt){const et=React$1.useRef(tt);et.current=tt,React$1.useEffect(()=>{const nt=!tt.disabled&&et.current.subject&&et.current.subject.subscribe({next:et.current.next});return()=>{nt&&nt.unsubscribe()}},[tt.disabled])}function useFormState(tt){const et=useFormContext(),{control:nt=et.control,disabled:rt,name:it,exact:ot}=tt||{},[at,st]=React$1.useState(nt._formState),lt=React$1.useRef(!0),ct=React$1.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),ut=React$1.useRef(it);return ut.current=it,useSubscribe({disabled:rt,next:ht=>lt.current&&shouldSubscribeByName(ut.current,ht.name,ot)&&shouldRenderFormState(ht,ct.current,nt._updateFormState)&&st({...nt._formState,...ht}),subject:nt._subjects.state}),React$1.useEffect(()=>(lt.current=!0,ct.current.isValid&&nt._updateValid(!0),()=>{lt.current=!1}),[nt]),getProxyFormState(at,nt,ct.current,!1)}var isString$3=tt=>typeof tt=="string",generateWatchOutput=(tt,et,nt,rt,it)=>isString$3(tt)?(rt&&et.watch.add(tt),get$5(nt,tt,it)):Array.isArray(tt)?tt.map(ot=>(rt&&et.watch.add(ot),get$5(nt,ot))):(rt&&(et.watchAll=!0),nt);function useWatch(tt){const et=useFormContext(),{control:nt=et.control,name:rt,defaultValue:it,disabled:ot,exact:at}=tt||{},st=React$1.useRef(rt);st.current=rt,useSubscribe({disabled:ot,subject:nt._subjects.values,next:ut=>{shouldSubscribeByName(st.current,ut.name,at)&&ct(cloneObject(generateWatchOutput(st.current,nt._names,ut.values||nt._formValues,!1,it)))}});const[lt,ct]=React$1.useState(nt._getWatch(rt,it));return React$1.useEffect(()=>nt._removeUnmounted()),lt}var isKey$4=tt=>/^\w*$/.test(tt),stringToPath$3=tt=>compact(tt.replace(/["|']|\]/g,"").split(/\.|\[/));function set$3(tt,et,nt){let rt=-1;const it=isKey$4(et)?[et]:stringToPath$3(et),ot=it.length,at=ot-1;for(;++rt{const ut=it._options.shouldUnregister||ot,ht=(dt,pt)=>{const mt=get$5(it._fields,dt);mt&&(mt._f.mount=pt)};if(ht(nt,!0),ut){const dt=cloneObject(get$5(it._options.defaultValues,nt));set$3(it._defaultValues,nt,dt),isUndefined$1(get$5(it._formValues,nt))&&set$3(it._formValues,nt,dt)}return()=>{(at?ut&&!it._state.action:ut)?it.unregister(nt):ht(nt,!1)}},[nt,it,at,ot]),React$1.useEffect(()=>{get$5(it._fields,nt)&&it._updateDisabledField({disabled:rt,fields:it._fields,name:nt})},[rt,nt,it]),{field:{name:nt,value:st,...isBoolean$2(rt)?{disabled:rt}:{},onChange:React$1.useCallback(ut=>ct.current.onChange({target:{value:getEventValue(ut),name:nt},type:EVENTS.CHANGE}),[nt]),onBlur:React$1.useCallback(()=>ct.current.onBlur({target:{value:get$5(it._formValues,nt),name:nt},type:EVENTS.BLUR}),[nt,it]),ref:ut=>{const ht=get$5(it._fields,nt);ht&&ut&&(ht._f.ref={focus:()=>ut.focus(),select:()=>ut.select(),setCustomValidity:dt=>ut.setCustomValidity(dt),reportValidity:()=>ut.reportValidity()})}},formState:lt,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$5(lt.errors,nt)},isDirty:{enumerable:!0,get:()=>!!get$5(lt.dirtyFields,nt)},isTouched:{enumerable:!0,get:()=>!!get$5(lt.touchedFields,nt)},error:{enumerable:!0,get:()=>get$5(lt.errors,nt)}})}}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,nt,rt,it)=>et?{...nt[tt],types:{...nt[tt]&&nt[tt].types?nt[tt].types:{},[rt]:it||!0}}:{};const focusFieldBy=(tt,et,nt)=>{for(const rt of nt||Object.keys(tt)){const it=get$5(tt,rt);if(it){const{_f:ot,...at}=it;if(ot&&et(ot.name)){if(ot.ref.focus){ot.ref.focus();break}else if(ot.refs&&ot.refs[0].focus){ot.refs[0].focus();break}}else isObject$f(at)&&focusFieldBy(at,et)}}};var getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched}),isWatched=(tt,et,nt)=>!nt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(rt=>tt.startsWith(rt)&&/^\.\w+/.test(tt.slice(rt.length)))),updateFieldArrayRootError=(tt,et,nt)=>{const rt=compact(get$5(tt,nt));return set$3(rt,"root",et[nt]),set$3(tt,nt,rt),tt},isFileInput=tt=>tt.type==="file",isFunction$6=tt=>typeof tt=="function",isHTMLElement$2=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMessage=tt=>isString$3(tt),isRadioInput=tt=>tt.type==="radio",isRegex=tt=>tt instanceof RegExp;const defaultResult$1={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(nt=>nt&&nt.checked&&!nt.disabled).map(nt=>nt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined$1(tt[0].attributes.value)?isUndefined$1(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult$1}return defaultResult$1};const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,nt)=>nt&&nt.checked&&!nt.disabled?{isValid:!0,value:nt.value}:et,defaultReturn):defaultReturn;function getValidateError(tt,et,nt="validate"){if(isMessage(tt)||Array.isArray(tt)&&tt.every(isMessage)||isBoolean$2(tt)&&!tt)return{type:nt,message:isMessage(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject$f(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,nt,rt,it)=>{const{ref:ot,refs:at,required:st,maxLength:lt,minLength:ct,min:ut,max:ht,pattern:dt,validate:pt,name:mt,valueAsNumber:gt,mount:yt,disabled:bt}=tt._f,wt=get$5(et,mt);if(!yt||bt)return{};const xt=at?at[0]:ot,kt=Rt=>{rt&&xt.reportValidity&&(xt.setCustomValidity(isBoolean$2(Rt)?"":Rt||""),xt.reportValidity())},St={},Tt=isRadioInput(ot),At=isCheckBoxInput(ot),Et=Tt||At,Ct=(gt||isFileInput(ot))&&isUndefined$1(ot.value)&&isUndefined$1(wt)||isHTMLElement$2(ot)&&ot.value===""||wt===""||Array.isArray(wt)&&!wt.length,Lt=appendErrors.bind(null,mt,nt,St),jt=(Rt,$t,vt,It=INPUT_VALIDATION_RULES.maxLength,Ot=INPUT_VALIDATION_RULES.minLength)=>{const Wt=Rt?$t:vt;St[mt]={type:Rt?It:Ot,message:Wt,ref:ot,...Lt(Rt?It:Ot,Wt)}};if(it?!Array.isArray(wt)||!wt.length:st&&(!Et&&(Ct||isNullOrUndefined(wt))||isBoolean$2(wt)&&!wt||At&&!getCheckboxValue(at).isValid||Tt&&!getRadioValue(at).isValid)){const{value:Rt,message:$t}=isMessage(st)?{value:!!st,message:st}:getValueAndMessage(st);if(Rt&&(St[mt]={type:INPUT_VALIDATION_RULES.required,message:$t,ref:xt,...Lt(INPUT_VALIDATION_RULES.required,$t)},!nt))return kt($t),St}if(!Ct&&(!isNullOrUndefined(ut)||!isNullOrUndefined(ht))){let Rt,$t;const vt=getValueAndMessage(ht),It=getValueAndMessage(ut);if(!isNullOrUndefined(wt)&&!isNaN(wt)){const Ot=ot.valueAsNumber||wt&&+wt;isNullOrUndefined(vt.value)||(Rt=Ot>vt.value),isNullOrUndefined(It.value)||($t=Otnew Date(new Date().toDateString()+" "+Nt),zt=ot.type=="time",Ft=ot.type=="week";isString$3(vt.value)&&wt&&(Rt=zt?Wt(wt)>Wt(vt.value):Ft?wt>vt.value:Ot>new Date(vt.value)),isString$3(It.value)&&wt&&($t=zt?Wt(wt)+Rt.value,It=!isNullOrUndefined($t.value)&&wt.length<+$t.value;if((vt||It)&&(jt(vt,Rt.message,$t.message),!nt))return kt(St[mt].message),St}if(dt&&!Ct&&isString$3(wt)){const{value:Rt,message:$t}=getValueAndMessage(dt);if(isRegex(Rt)&&!wt.match(Rt)&&(St[mt]={type:INPUT_VALIDATION_RULES.pattern,message:$t,ref:ot,...Lt(INPUT_VALIDATION_RULES.pattern,$t)},!nt))return kt($t),St}if(pt){if(isFunction$6(pt)){const Rt=await pt(wt,et),$t=getValidateError(Rt,xt);if($t&&(St[mt]={...$t,...Lt(INPUT_VALIDATION_RULES.validate,$t.message)},!nt))return kt($t.message),St}else if(isObject$f(pt)){let Rt={};for(const $t in pt){if(!isEmptyObject(Rt)&&!nt)break;const vt=getValidateError(await pt[$t](wt,et),xt,$t);vt&&(Rt={...vt,...Lt($t,vt.message)},kt(vt.message),nt&&(St[mt]=Rt))}if(!isEmptyObject(Rt)&&(St[mt]={ref:xt,...Rt},!nt))return St}}return kt(!0),St};function baseGet$4(tt,et){const nt=et.slice(0,-1).length;let rt=0;for(;rt{for(const ot of tt)ot.next&&ot.next(it)},subscribe:it=>(tt.push(it),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==it)}}),unsubscribe:()=>{tt=[]}}}var isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual$2(tt,et){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const nt=Object.keys(tt),rt=Object.keys(et);if(nt.length!==rt.length)return!1;for(const it of nt){const ot=tt[it];if(!rt.includes(it))return!1;if(it!=="ref"){const at=et[it];if(isDateObject(ot)&&isDateObject(at)||isObject$f(ot)&&isObject$f(at)||Array.isArray(ot)&&Array.isArray(at)?!deepEqual$2(ot,at):ot!==at)return!1}}return!0}var isMultipleSelect=tt=>tt.type==="select-multiple",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement$2(tt)&&tt.isConnected,objectHasFunction=tt=>{for(const et in tt)if(isFunction$6(tt[et]))return!0;return!1};function markFieldsDirty(tt,et={}){const nt=Array.isArray(tt);if(isObject$f(tt)||nt)for(const rt in tt)Array.isArray(tt[rt])||isObject$f(tt[rt])&&!objectHasFunction(tt[rt])?(et[rt]=Array.isArray(tt[rt])?[]:{},markFieldsDirty(tt[rt],et[rt])):isNullOrUndefined(tt[rt])||(et[rt]=!0);return et}function getDirtyFieldsFromDefaultValues(tt,et,nt){const rt=Array.isArray(tt);if(isObject$f(tt)||rt)for(const it in tt)Array.isArray(tt[it])||isObject$f(tt[it])&&!objectHasFunction(tt[it])?isUndefined$1(et)||isPrimitive(nt[it])?nt[it]=Array.isArray(tt[it])?markFieldsDirty(tt[it],[]):{...markFieldsDirty(tt[it])}:getDirtyFieldsFromDefaultValues(tt[it],isNullOrUndefined(et)?{}:et[it],nt[it]):nt[it]=!deepEqual$2(tt[it],et[it]);return nt}var getDirtyFields=(tt,et)=>getDirtyFieldsFromDefaultValues(tt,et,markFieldsDirty(et)),getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:nt,setValueAs:rt})=>isUndefined$1(tt)?tt:et?tt===""?NaN:tt&&+tt:nt&&isString$3(tt)?new Date(tt):rt?rt(tt):tt;function getFieldValue(tt){const et=tt.ref;if(!(tt.refs?tt.refs.every(nt=>nt.disabled):et.disabled))return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:nt})=>nt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined$1(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,nt,rt)=>{const it={};for(const ot of tt){const at=get$5(et,ot);at&&set$3(it,ot,at._f)}return{criteriaMode:nt,names:[...tt],fields:it,shouldUseNativeValidation:rt}},getRuleValue=tt=>isUndefined$1(tt)?tt:isRegex(tt)?tt.source:isObject$f(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt,hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate);function schemaErrorLookup(tt,et,nt){const rt=get$5(tt,nt);if(rt||isKey$4(nt))return{error:rt,name:nt};const it=nt.split(".");for(;it.length;){const ot=it.join("."),at=get$5(et,ot),st=get$5(tt,ot);if(at&&!Array.isArray(at)&&nt!==ot)return{name:nt};if(st&&st.type)return{name:ot,error:st};it.pop()}return{name:nt}}var skipValidation=(tt,et,nt,rt,it)=>it.isOnAll?!1:!nt&&it.isOnTouch?!(et||tt):(nt?rt.isOnBlur:it.isOnBlur)?!tt:(nt?rt.isOnChange:it.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact(get$5(tt,et)).length&&unset(tt,et);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={},et){let nt={...defaultOptions,...tt},rt={submitCount:0,isDirty:!1,isLoading:isFunction$6(nt.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},it={},ot=isObject$f(nt.defaultValues)||isObject$f(nt.values)?cloneObject(nt.defaultValues||nt.values)||{}:{},at=nt.shouldUnregister?{}:cloneObject(ot),st={action:!1,mount:!1,watch:!1},lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set},ct,ut=0;const ht={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},dt={values:createSubject(),array:createSubject(),state:createSubject()},pt=tt.resetOptions&&tt.resetOptions.keepDirtyValues,mt=getValidationModes(nt.mode),gt=getValidationModes(nt.reValidateMode),yt=nt.criteriaMode===VALIDATION_MODE.all,bt=En=>sn=>{clearTimeout(ut),ut=setTimeout(En,sn)},wt=async En=>{if(ht.isValid||En){const sn=nt.resolver?isEmptyObject((await Ct()).errors):await jt(it,!0);sn!==rt.isValid&&dt.state.next({isValid:sn})}},xt=En=>ht.isValidating&&dt.state.next({isValidating:En}),kt=(En,sn=[],pn,Tn,In=!0,yn=!0)=>{if(Tn&&pn){if(st.action=!0,yn&&Array.isArray(get$5(it,En))){const hn=pn(get$5(it,En),Tn.argA,Tn.argB);In&&set$3(it,En,hn)}if(yn&&Array.isArray(get$5(rt.errors,En))){const hn=pn(get$5(rt.errors,En),Tn.argA,Tn.argB);In&&set$3(rt.errors,En,hn),unsetEmptyArray(rt.errors,En)}if(ht.touchedFields&&yn&&Array.isArray(get$5(rt.touchedFields,En))){const hn=pn(get$5(rt.touchedFields,En),Tn.argA,Tn.argB);In&&set$3(rt.touchedFields,En,hn)}ht.dirtyFields&&(rt.dirtyFields=getDirtyFields(ot,at)),dt.state.next({name:En,isDirty:$t(En,sn),dirtyFields:rt.dirtyFields,errors:rt.errors,isValid:rt.isValid})}else set$3(at,En,sn)},St=(En,sn)=>{set$3(rt.errors,En,sn),dt.state.next({errors:rt.errors})},Tt=(En,sn,pn,Tn)=>{const In=get$5(it,En);if(In){const yn=get$5(at,En,isUndefined$1(pn)?get$5(ot,En):pn);isUndefined$1(yn)||Tn&&Tn.defaultChecked||sn?set$3(at,En,sn?yn:getFieldValue(In._f)):Ot(En,yn),st.mount&&wt()}},At=(En,sn,pn,Tn,In)=>{let yn=!1,hn=!1;const fn={name:En};if(!pn||Tn){ht.isDirty&&(hn=rt.isDirty,rt.isDirty=fn.isDirty=$t(),yn=hn!==fn.isDirty);const xn=deepEqual$2(get$5(ot,En),sn);hn=get$5(rt.dirtyFields,En),xn?unset(rt.dirtyFields,En):set$3(rt.dirtyFields,En,!0),fn.dirtyFields=rt.dirtyFields,yn=yn||ht.dirtyFields&&hn!==!xn}if(pn){const xn=get$5(rt.touchedFields,En);xn||(set$3(rt.touchedFields,En,pn),fn.touchedFields=rt.touchedFields,yn=yn||ht.touchedFields&&xn!==pn)}return yn&&In&&dt.state.next(fn),yn?fn:{}},Et=(En,sn,pn,Tn)=>{const In=get$5(rt.errors,En),yn=ht.isValid&&isBoolean$2(sn)&&rt.isValid!==sn;if(tt.delayError&&pn?(ct=bt(()=>St(En,pn)),ct(tt.delayError)):(clearTimeout(ut),ct=null,pn?set$3(rt.errors,En,pn):unset(rt.errors,En)),(pn?!deepEqual$2(In,pn):In)||!isEmptyObject(Tn)||yn){const hn={...Tn,...yn&&isBoolean$2(sn)?{isValid:sn}:{},errors:rt.errors,name:En};rt={...rt,...hn},dt.state.next(hn)}xt(!1)},Ct=async En=>nt.resolver(at,nt.context,getResolverOptions(En||lt.mount,it,nt.criteriaMode,nt.shouldUseNativeValidation)),Lt=async En=>{const{errors:sn}=await Ct(En);if(En)for(const pn of En){const Tn=get$5(sn,pn);Tn?set$3(rt.errors,pn,Tn):unset(rt.errors,pn)}else rt.errors=sn;return sn},jt=async(En,sn,pn={valid:!0})=>{for(const Tn in En){const In=En[Tn];if(In){const{_f:yn,...hn}=In;if(yn){const fn=lt.array.has(yn.name),xn=await validateField(In,at,yt,nt.shouldUseNativeValidation&&!sn,fn);if(xn[yn.name]&&(pn.valid=!1,sn))break;!sn&&(get$5(xn,yn.name)?fn?updateFieldArrayRootError(rt.errors,xn,yn.name):set$3(rt.errors,yn.name,xn[yn.name]):unset(rt.errors,yn.name))}hn&&await jt(hn,sn,pn)}}return pn.valid},Rt=()=>{for(const En of lt.unMount){const sn=get$5(it,En);sn&&(sn._f.refs?sn._f.refs.every(pn=>!live(pn)):!live(sn._f.ref))&&Yt(En)}lt.unMount=new Set},$t=(En,sn)=>(En&&sn&&set$3(at,En,sn),!deepEqual$2(Ut(),ot)),vt=(En,sn,pn)=>generateWatchOutput(En,lt,{...st.mount?at:isUndefined$1(sn)?ot:isString$3(En)?{[En]:sn}:sn},pn,sn),It=En=>compact(get$5(st.mount?at:ot,En,tt.shouldUnregister?get$5(ot,En,[]):[])),Ot=(En,sn,pn={})=>{const Tn=get$5(it,En);let In=sn;if(Tn){const yn=Tn._f;yn&&(!yn.disabled&&set$3(at,En,getFieldValueAs(sn,yn)),In=isHTMLElement$2(yn.ref)&&isNullOrUndefined(sn)?"":sn,isMultipleSelect(yn.ref)?[...yn.ref.options].forEach(hn=>hn.selected=In.includes(hn.value)):yn.refs?isCheckBoxInput(yn.ref)?yn.refs.length>1?yn.refs.forEach(hn=>(!hn.defaultChecked||!hn.disabled)&&(hn.checked=Array.isArray(In)?!!In.find(fn=>fn===hn.value):In===hn.value)):yn.refs[0]&&(yn.refs[0].checked=!!In):yn.refs.forEach(hn=>hn.checked=hn.value===In):isFileInput(yn.ref)?yn.ref.value="":(yn.ref.value=In,yn.ref.type||dt.values.next({name:En,values:{...at}})))}(pn.shouldDirty||pn.shouldTouch)&&At(En,In,pn.shouldTouch,pn.shouldDirty,!0),pn.shouldValidate&&Nt(En)},Wt=(En,sn,pn)=>{for(const Tn in sn){const In=sn[Tn],yn=`${En}.${Tn}`,hn=get$5(it,yn);(lt.array.has(En)||!isPrimitive(In)||hn&&!hn._f)&&!isDateObject(In)?Wt(yn,In,pn):Ot(yn,In,pn)}},zt=(En,sn,pn={})=>{const Tn=get$5(it,En),In=lt.array.has(En),yn=cloneObject(sn);set$3(at,En,yn),In?(dt.array.next({name:En,values:{...at}}),(ht.isDirty||ht.dirtyFields)&&pn.shouldDirty&&dt.state.next({name:En,dirtyFields:getDirtyFields(ot,at),isDirty:$t(En,yn)})):Tn&&!Tn._f&&!isNullOrUndefined(yn)?Wt(En,yn,pn):Ot(En,yn,pn),isWatched(En,lt)&&dt.state.next({...rt}),dt.values.next({name:En,values:{...at}}),!st.mount&&et()},Ft=async En=>{const sn=En.target;let pn=sn.name,Tn=!0;const In=get$5(it,pn),yn=()=>sn.type?getFieldValue(In._f):getEventValue(En);if(In){let hn,fn;const xn=yn(),jn=En.type===EVENTS.BLUR||En.type===EVENTS.FOCUS_OUT,cn=!hasValidation(In._f)&&!nt.resolver&&!get$5(rt.errors,pn)&&!In._f.deps||skipValidation(jn,get$5(rt.touchedFields,pn),rt.isSubmitted,gt,mt),Xt=isWatched(pn,lt,jn);set$3(at,pn,xn),jn?(In._f.onBlur&&In._f.onBlur(En),ct&&ct(0)):In._f.onChange&&In._f.onChange(En);const Kt=At(pn,xn,jn,!1),kn=!isEmptyObject(Kt)||Xt;if(!jn&&dt.values.next({name:pn,type:En.type,values:{...at}}),cn)return ht.isValid&&wt(),kn&&dt.state.next({name:pn,...Xt?{}:Kt});if(!jn&&Xt&&dt.state.next({...rt}),xt(!0),nt.resolver){const{errors:Mn}=await Ct([pn]),On=schemaErrorLookup(rt.errors,it,pn),Bn=schemaErrorLookup(Mn,it,On.name||pn);hn=Bn.error,pn=Bn.name,fn=isEmptyObject(Mn)}else hn=(await validateField(In,at,yt,nt.shouldUseNativeValidation))[pn],Tn=Number.isNaN(xn)||xn===get$5(at,pn,xn),Tn&&(hn?fn=!1:ht.isValid&&(fn=await jt(it,!0)));Tn&&(In._f.deps&&Nt(In._f.deps),Et(pn,fn,hn,Kt))}},Nt=async(En,sn={})=>{let pn,Tn;const In=convertToArrayPayload(En);if(xt(!0),nt.resolver){const yn=await Lt(isUndefined$1(En)?En:In);pn=isEmptyObject(yn),Tn=En?!In.some(hn=>get$5(yn,hn)):pn}else En?(Tn=(await Promise.all(In.map(async yn=>{const hn=get$5(it,yn);return await jt(hn&&hn._f?{[yn]:hn}:hn)}))).every(Boolean),!(!Tn&&!rt.isValid)&&wt()):Tn=pn=await jt(it);return dt.state.next({...!isString$3(En)||ht.isValid&&pn!==rt.isValid?{}:{name:En},...nt.resolver||!En?{isValid:pn}:{},errors:rt.errors,isValidating:!1}),sn.shouldFocus&&!Tn&&focusFieldBy(it,yn=>yn&&get$5(rt.errors,yn),En?In:lt.mount),Tn},Ut=En=>{const sn={...ot,...st.mount?at:{}};return isUndefined$1(En)?sn:isString$3(En)?get$5(sn,En):En.map(pn=>get$5(sn,pn))},Pt=(En,sn)=>({invalid:!!get$5((sn||rt).errors,En),isDirty:!!get$5((sn||rt).dirtyFields,En),isTouched:!!get$5((sn||rt).touchedFields,En),error:get$5((sn||rt).errors,En)}),Ht=En=>{En&&convertToArrayPayload(En).forEach(sn=>unset(rt.errors,sn)),dt.state.next({errors:En?rt.errors:{}})},Qt=(En,sn,pn)=>{const Tn=(get$5(it,En,{_f:{}})._f||{}).ref;set$3(rt.errors,En,{...sn,ref:Tn}),dt.state.next({name:En,errors:rt.errors,isValid:!1}),pn&&pn.shouldFocus&&Tn&&Tn.focus&&Tn.focus()},an=(En,sn)=>isFunction$6(En)?dt.values.subscribe({next:pn=>En(vt(void 0,sn),pn)}):vt(En,sn,!0),Yt=(En,sn={})=>{for(const pn of En?convertToArrayPayload(En):lt.mount)lt.mount.delete(pn),lt.array.delete(pn),sn.keepValue||(unset(it,pn),unset(at,pn)),!sn.keepError&&unset(rt.errors,pn),!sn.keepDirty&&unset(rt.dirtyFields,pn),!sn.keepTouched&&unset(rt.touchedFields,pn),!nt.shouldUnregister&&!sn.keepDefaultValue&&unset(ot,pn);dt.values.next({values:{...at}}),dt.state.next({...rt,...sn.keepDirty?{isDirty:$t()}:{}}),!sn.keepIsValid&&wt()},nn=({disabled:En,name:sn,field:pn,fields:Tn})=>{if(isBoolean$2(En)){const In=En?void 0:get$5(at,sn,getFieldValue(pn?pn._f:get$5(Tn,sn)._f));set$3(at,sn,In),At(sn,In,!1,!1,!0)}},tn=(En,sn={})=>{let pn=get$5(it,En);const Tn=isBoolean$2(sn.disabled);return set$3(it,En,{...pn||{},_f:{...pn&&pn._f?pn._f:{ref:{name:En}},name:En,mount:!0,...sn}}),lt.mount.add(En),pn?nn({field:pn,disabled:sn.disabled,name:En}):Tt(En,!0,sn.value),{...Tn?{disabled:sn.disabled}:{},...nt.progressive?{required:!!sn.required,min:getRuleValue(sn.min),max:getRuleValue(sn.max),minLength:getRuleValue(sn.minLength),maxLength:getRuleValue(sn.maxLength),pattern:getRuleValue(sn.pattern)}:{},name:En,onChange:Ft,onBlur:Ft,ref:In=>{if(In){tn(En,sn),pn=get$5(it,En);const yn=isUndefined$1(In.value)&&In.querySelectorAll&&In.querySelectorAll("input,select,textarea")[0]||In,hn=isRadioOrCheckbox(yn),fn=pn._f.refs||[];if(hn?fn.find(xn=>xn===yn):yn===pn._f.ref)return;set$3(it,En,{_f:{...pn._f,...hn?{refs:[...fn.filter(live),yn,...Array.isArray(get$5(ot,En))?[{}]:[]],ref:{type:yn.type,name:En}}:{ref:yn}}}),Tt(En,!1,void 0,yn)}else pn=get$5(it,En,{}),pn._f&&(pn._f.mount=!1),(nt.shouldUnregister||sn.shouldUnregister)&&!(isNameInFieldArray(lt.array,En)&&st.action)&<.unMount.add(En)}}},dn=()=>nt.shouldFocusError&&focusFieldBy(it,En=>En&&get$5(rt.errors,En),lt.mount),wn=(En,sn)=>async pn=>{pn&&(pn.preventDefault&&pn.preventDefault(),pn.persist&&pn.persist());let Tn=cloneObject(at);if(dt.state.next({isSubmitting:!0}),nt.resolver){const{errors:In,values:yn}=await Ct();rt.errors=In,Tn=yn}else await jt(it);unset(rt.errors,"root"),isEmptyObject(rt.errors)?(dt.state.next({errors:{}}),await En(Tn,pn)):(sn&&await sn({...rt.errors},pn),dn(),setTimeout(dn)),dt.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(rt.errors),submitCount:rt.submitCount+1,errors:rt.errors})},rn=(En,sn={})=>{get$5(it,En)&&(isUndefined$1(sn.defaultValue)?zt(En,get$5(ot,En)):(zt(En,sn.defaultValue),set$3(ot,En,sn.defaultValue)),sn.keepTouched||unset(rt.touchedFields,En),sn.keepDirty||(unset(rt.dirtyFields,En),rt.isDirty=sn.defaultValue?$t(En,get$5(ot,En)):$t()),sn.keepError||(unset(rt.errors,En),ht.isValid&&wt()),dt.state.next({...rt}))},Zt=(En,sn={})=>{const pn=En?cloneObject(En):ot,Tn=cloneObject(pn),In=En&&!isEmptyObject(En)?Tn:ot;if(sn.keepDefaultValues||(ot=pn),!sn.keepValues){if(sn.keepDirtyValues||pt)for(const yn of lt.mount)get$5(rt.dirtyFields,yn)?set$3(In,yn,get$5(at,yn)):zt(yn,get$5(In,yn));else{if(isWeb&&isUndefined$1(En))for(const yn of lt.mount){const hn=get$5(it,yn);if(hn&&hn._f){const fn=Array.isArray(hn._f.refs)?hn._f.refs[0]:hn._f.ref;if(isHTMLElement$2(fn)){const xn=fn.closest("form");if(xn){xn.reset();break}}}}it={}}at=tt.shouldUnregister?sn.keepDefaultValues?cloneObject(ot):{}:cloneObject(In),dt.array.next({values:{...In}}),dt.values.next({values:{...In}})}lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!st.mount&&et(),st.mount=!ht.isValid||!!sn.keepIsValid,st.watch=!!tt.shouldUnregister,dt.state.next({submitCount:sn.keepSubmitCount?rt.submitCount:0,isDirty:sn.keepDirty?rt.isDirty:!!(sn.keepDefaultValues&&!deepEqual$2(En,ot)),isSubmitted:sn.keepIsSubmitted?rt.isSubmitted:!1,dirtyFields:sn.keepDirtyValues?rt.dirtyFields:sn.keepDefaultValues&&En?getDirtyFields(ot,En):{},touchedFields:sn.keepTouched?rt.touchedFields:{},errors:sn.keepErrors?rt.errors:{},isSubmitSuccessful:sn.keepIsSubmitSuccessful?rt.isSubmitSuccessful:!1,isSubmitting:!1})},vn=(En,sn)=>Zt(isFunction$6(En)?En(at):En,sn);return{control:{register:tn,unregister:Yt,getFieldState:Pt,handleSubmit:wn,setError:Qt,_executeSchema:Ct,_getWatch:vt,_getDirty:$t,_updateValid:wt,_removeUnmounted:Rt,_updateFieldArray:kt,_updateDisabledField:nn,_getFieldArray:It,_reset:Zt,_resetDefaultValues:()=>isFunction$6(nt.defaultValues)&&nt.defaultValues().then(En=>{vn(En,nt.resetOptions),dt.state.next({isLoading:!1})}),_updateFormState:En=>{rt={...rt,...En}},_subjects:dt,_proxyFormState:ht,get _fields(){return it},get _formValues(){return at},get _state(){return st},set _state(En){st=En},get _defaultValues(){return ot},get _names(){return lt},set _names(En){lt=En},get _formState(){return rt},set _formState(En){rt=En},get _options(){return nt},set _options(En){nt={...nt,...En}}},trigger:Nt,register:tn,handleSubmit:wn,watch:an,setValue:zt,getValues:Ut,reset:vn,resetField:rn,clearErrors:Ht,unregister:Yt,setError:Qt,setFocus:(En,sn={})=>{const pn=get$5(it,En),Tn=pn&&pn._f;if(Tn){const In=Tn.refs?Tn.refs[0]:Tn.ref;In.focus&&(In.focus(),sn.shouldSelect&&In.select())}},getFieldState:Pt}}function useForm(tt={}){const et=React$1.useRef(),nt=React$1.useRef(),[rt,it]=React$1.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$6(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:isFunction$6(tt.defaultValues)?void 0:tt.defaultValues});et.current||(et.current={...createFormControl(tt,()=>it(at=>({...at}))),formState:rt});const ot=et.current.control;return ot._options=tt,useSubscribe({subject:ot._subjects.state,next:at=>{shouldRenderFormState(at,ot._proxyFormState,ot._updateFormState,!0)&&it({...ot._formState})}}),React$1.useEffect(()=>{tt.values&&!deepEqual$2(tt.values,nt.current)?(ot._reset(tt.values,ot._options.resetOptions),nt.current=tt.values):ot._resetDefaultValues()},[tt.values,ot]),React$1.useEffect(()=>{ot._state.mount||(ot._updateValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),et.current.formState=getProxyFormState(rt,ot),et.current}const ReactToastify="";var dist$3={exports:{}},lib$3={},postMessage$2={};Object.defineProperty(postMessage$2,"__esModule",{value:!0});postMessage$2.removeEventer=postMessage$2.addEventer=postMessage$2.postMessage=void 0;function postMessage$1(tt){var et=window;if(et.sendToElectron)return et.sendToElectron("sphinx-bridge",tt);et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?et.ReactNativeWebView.postMessage(JSON.stringify(tt)):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.webkit.messageHandlers.sphinx.postMessage(tt):et.Android?et.Android.receiveMessage(JSON.stringify(tt)):et.parent.postMessage(tt,"*")}postMessage$2.postMessage=postMessage$1;function addEventer(tt){var et=window;if(et.sendToElectron){et.EE&&et.EE.once("sphinx-bridge",tt);return}else et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.addEventListener("message",function(nt){var rt={};try{rt=JSON.parse(nt.data)}catch{}tt({data:rt})}):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.sphinxMessage=function(nt){var rt={};try{rt=JSON.parse(nt)}catch{}tt({data:rt})}:et.Android?et.sphinxMessage=function(nt){var rt={};try{rt=JSON.parse(nt)}catch{}tt({data:rt})}:et.addEventListener("message",tt)}postMessage$2.addEventer=addEventer;function removeEventer(tt){var et=window;et.sendToElectron||(et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.removeEventListener("message",tt):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx||et.Android?et.sphinxMessage=null:et.removeEventListener("message",tt))}postMessage$2.removeEventer=removeEventer;(function(tt){var et=commonjsGlobal&&commonjsGlobal.__assign||function(){return et=Object.assign||function(lt){for(var ct,ut=1,ht=arguments.length;ut0&&pt[pt.length-1])&&(bt[0]===6||bt[0]===2)){ut=0;continue}if(bt[0]===3&&(!pt||bt[1]>pt[0]&&bt[1] ENABLE!"),this.isEnabled)return[2,{budget:this.budget,pubkey:this.pubkey,application:at}];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.AUTHORIZE)];case 2:return ut=pt.sent(),ht=ut.budget||ut.budget===0,ht&&ut.pubkey?(this.isEnabled=!0,this.budget=ut.budget,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[3,4];case 4:return[2,null]}})})},lt.prototype.authorize=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt,mt,gt;return rt(this,function(yt){switch(yt.label){case 0:ht&&(this.logging=!0),this.logging&&console.log("=> AUTHORIZE!"),yt.label=1;case 1:return yt.trys.push([1,3,,4]),dt=ut||!1,[4,this.postMsg(ot.AUTHORIZE,{challenge:ct,noBudget:dt})];case 2:return pt=yt.sent(),mt=pt.budget||pt.budget===0,(dt||mt)&&pt.pubkey?(this.isEnabled=!0,this.budget=pt.budget||0,this.pubkey=pt.pubkey,[2,pt]):[3,4];case 3:return gt=yt.sent(),this.logging&&console.log(gt),[3,4];case 4:return[2,null]}})})},lt.prototype.topup=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return rt(this,function(dt){switch(dt.label){case 0:this.logging&&console.log("=> TOP UP"),dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.AUTHORIZE)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut&&ct.pubkey?(this.budget=ct.budget,this.pubkey=ct.pubkey,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[3,4];case 4:return[2,null]}})})},lt.prototype.keysend=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt,pt;return rt(this,function(mt){switch(mt.label){case 0:if(this.logging&&console.log("=> KEYSEND"),!this.isEnabled)return[2,null];if(!ct||!ut)return[2,null];if(ct.length!==66)return[2,null];if(ut<1)return[2,null];if(ut>this.budget)return[2,null];mt.label=1;case 1:return mt.trys.push([1,3,,4]),ht={dest:ct,amt:ut},[4,this.postMsg(ot.KEYSEND,ht)];case 2:return dt=mt.sent(),dt&&dt.success&&(this.budget=this.budget-ut,dt.budget=this.budget),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,null];case 4:return[2]}})})},lt.prototype.updated=function(){return nt(this,void 0,void 0,function(){var ct,ut;return rt(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> UDPATED"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATED)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.sendPayment=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SEND PAYMENT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.PAYMENT,{paymentRequest:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.saveLsat=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt;return rt(this,function(mt){switch(mt.label){case 0:this.logging&&console.log("=> SAVE LSAT"),mt.label=1;case 1:return mt.trys.push([1,3,,4]),[4,this.postMsg(ot.LSAT,{paymentRequest:ct,macaroon:ut,issuer:ht})];case 2:return dt=mt.sent(),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,pt];case 4:return[2]}})})},lt.prototype.getLsat=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> GET LSAT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.GETLSAT,{issuer:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,ht];case 4:return[2]}})})},lt.prototype.updateLsat=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return rt(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> UPDATE LSAT"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATELSAT,{identifier:ct,status:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,dt];case 4:return[2]}})})},lt.prototype.makeInvoice=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return rt(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> MAKE INVOICE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.INVOICE,{amt:ct,memo:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.signMessage=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SIGN MESSAGE"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{message:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.verifyMessage=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return rt(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> VERIFY MESSAGE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{signature:ct,message:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.reload=function(ct){return nt(this,void 0,void 0,function(){var ut,ht,dt;return rt(this,function(pt){switch(pt.label){case 0:this.logging&&console.log("=> RELOAD"),pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.RELOAD,{password:ct})];case 2:return ut=pt.sent(),ht=ut.budget||ut.budget===0,ht&&ut.pubkey?(this.isEnabled=!0,this.budget=ut.budget,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[3,4];case 4:return[2,null]}})})},lt.prototype.saveGraphData=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return rt(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SAVEDATA"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SAVEDATA,{data:{type:ct.type,metaData:ct.metaData}})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.getPersonData=function(){return nt(this,void 0,void 0,function(){var ct,ut;return rt(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> GETPERSONDATA"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.GETPERSONDATA)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.getBudget=function(){return nt(this,void 0,void 0,function(){var ct,ut;return rt(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> GETBUDGET"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.GETBUDGET)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.postMsg=function(ct,ut){var ht=this;return ht.active&&Promise.reject(new Error("User is busy")),ht.active=ct,new Promise(function(dt,pt){it.postMessage(et({application:at,type:ct},ut||{}));function mt(gt){!gt.data||gt.data.application!==at||(gt.data.error?(ht.active=null,pt(gt.data.error)):(ht.active=null,dt(gt.data)),it.removeEventer(mt))}it.addEventer(mt)})},lt}();tt.default=st})(lib$3);var dist$2=dist$3.exports;Object.defineProperty(dist$2,"__esModule",{value:!0});var lib_1=lib$3,sphinx=new lib_1.default;dist$3.exports=sphinx;var distExports$1=dist$3.exports,reactIs$3={exports:{}},reactIs_production_min$2={};/** * @license React * react-is.production.min.js * @@ -103,7 +103,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var b$4=Symbol.for("react.element"),c$5=Symbol.for("react.portal"),d$3=Symbol.for("react.fragment"),e$4=Symbol.for("react.strict_mode"),f$5=Symbol.for("react.profiler"),g$6=Symbol.for("react.provider"),h$7=Symbol.for("react.context"),k$6=Symbol.for("react.server_context"),l$4=Symbol.for("react.forward_ref"),m$5=Symbol.for("react.suspense"),n$5=Symbol.for("react.suspense_list"),p$5=Symbol.for("react.memo"),q$5=Symbol.for("react.lazy"),t$5=Symbol.for("react.offscreen"),u$3;u$3=Symbol.for("react.module.reference");function v$5(tt){if(typeof tt=="object"&&tt!==null){var et=tt.$$typeof;switch(et){case b$4:switch(tt=tt.type,tt){case d$3:case f$5:case e$4:case m$5:case n$5:return tt;default:switch(tt=tt&&tt.$$typeof,tt){case k$6:case h$7:case l$4:case q$5:case p$5:case g$6:return tt;default:return et}}case c$5:return et}}}reactIs_production_min$2.ContextConsumer=h$7;reactIs_production_min$2.ContextProvider=g$6;reactIs_production_min$2.Element=b$4;reactIs_production_min$2.ForwardRef=l$4;reactIs_production_min$2.Fragment=d$3;reactIs_production_min$2.Lazy=q$5;reactIs_production_min$2.Memo=p$5;reactIs_production_min$2.Portal=c$5;reactIs_production_min$2.Profiler=f$5;reactIs_production_min$2.StrictMode=e$4;reactIs_production_min$2.Suspense=m$5;reactIs_production_min$2.SuspenseList=n$5;reactIs_production_min$2.isAsyncMode=function(){return!1};reactIs_production_min$2.isConcurrentMode=function(){return!1};reactIs_production_min$2.isContextConsumer=function(tt){return v$5(tt)===h$7};reactIs_production_min$2.isContextProvider=function(tt){return v$5(tt)===g$6};reactIs_production_min$2.isElement=function(tt){return typeof tt=="object"&&tt!==null&&tt.$$typeof===b$4};reactIs_production_min$2.isForwardRef=function(tt){return v$5(tt)===l$4};reactIs_production_min$2.isFragment=function(tt){return v$5(tt)===d$3};reactIs_production_min$2.isLazy=function(tt){return v$5(tt)===q$5};reactIs_production_min$2.isMemo=function(tt){return v$5(tt)===p$5};reactIs_production_min$2.isPortal=function(tt){return v$5(tt)===c$5};reactIs_production_min$2.isProfiler=function(tt){return v$5(tt)===f$5};reactIs_production_min$2.isStrictMode=function(tt){return v$5(tt)===e$4};reactIs_production_min$2.isSuspense=function(tt){return v$5(tt)===m$5};reactIs_production_min$2.isSuspenseList=function(tt){return v$5(tt)===n$5};reactIs_production_min$2.isValidElementType=function(tt){return typeof tt=="string"||typeof tt=="function"||tt===d$3||tt===f$5||tt===e$4||tt===m$5||tt===n$5||tt===t$5||typeof tt=="object"&&tt!==null&&(tt.$$typeof===q$5||tt.$$typeof===p$5||tt.$$typeof===g$6||tt.$$typeof===h$7||tt.$$typeof===l$4||tt.$$typeof===u$3||tt.getModuleId!==void 0)};reactIs_production_min$2.typeOf=v$5;reactIs$3.exports=reactIs_production_min$2;var reactIsExports$2=reactIs$3.exports;function stylis_min(tt){function et(Pt,Ht,Qt,an,Yt){for(var nn=0,tn=0,dn=0,wn=0,rn,Jt,vn=0,Cn=0,$n,Nn=$n=rn=0,En=0,sn=0,pn=0,Tn=0,In=Qt.length,yn=In-1,hn,fn="",xn="",jn="",cn="",Xt;Enrn)&&(Tn=(fn=fn.replace(" ",":")).length),0an&&(an=(Ht=Ht.trim()).charCodeAt(0)),an){case 38:return Ht.replace(bt,"$1"+Pt.trim());case 58:return Pt.trim()+Ht.replace(bt,"$1"+Pt.trim());default:if(0<1*Qt&&0tn.charCodeAt(8))break;case 115:Yt=Yt.replace(tn,"-webkit-"+tn)+";"+Yt;break;case 207:case 102:Yt=Yt.replace(tn,"-webkit-"+(102Qt.charCodeAt(0)&&(Qt=Qt.trim()),Ut=Qt,Qt=[Ut],0rn)&&(Tn=(fn=fn.replace(" ",":")).length),0an&&(an=(Ht=Ht.trim()).charCodeAt(0)),an){case 38:return Ht.replace(bt,"$1"+Pt.trim());case 58:return Pt.trim()+Ht.replace(bt,"$1"+Pt.trim());default:if(0<1*Qt&&0tn.charCodeAt(8))break;case 115:Yt=Yt.replace(tn,"-webkit-"+tn)+";"+Yt;break;case 207:case 102:Yt=Yt.replace(tn,"-webkit-"+(102Qt.charCodeAt(0)&&(Qt=Qt.trim()),Ut=Qt,Qt=[Ut],01?et-1:0),rt=1;rt0?" Args: "+nt.join(", "):""))}var j=function(){function tt(nt){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=nt}var et=tt.prototype;return et.indexOfGroup=function(nt){for(var rt=0,it=0;it=this.groupSizes.length){for(var it=this.groupSizes,ot=it.length,at=ot;nt>=at;)(at<<=1)<0&&D(16,""+nt);this.groupSizes=new Uint32Array(at),this.groupSizes.set(it),this.length=at;for(var st=ot;st=this.length||this.groupSizes[nt]===0)return rt;for(var it=this.groupSizes[nt],ot=this.indexOfGroup(nt),at=ot+it,st=ot;st=k$4&&(k$4=et+1),T.set(tt,et),x$5.set(et,tt)},M="style["+N+'][data-styled-version="5.3.11"]',G$1=new RegExp("^"+N+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),L=function(tt,et,nt){for(var rt,it=nt.split(","),ot=0,at=it.length;ot=0;ct--){var ut=lt[ct];if(ut&&ut.nodeType===1&&ut.hasAttribute(N))return ut}}(nt),ot=it!==void 0?it.nextSibling:null;rt.setAttribute(N,"active"),rt.setAttribute("data-styled-version","5.3.11");var at=Y();return at&&rt.setAttribute("nonce",at),nt.insertBefore(rt,ot),rt},H=function(){function tt(nt){var rt=this.element=q$3(nt);rt.appendChild(document.createTextNode("")),this.sheet=function(it){if(it.sheet)return it.sheet;for(var ot=document.styleSheets,at=0,st=ot.length;at=0){var it=document.createTextNode(rt),ot=this.nodes[nt];return this.element.insertBefore(it,ot||null),this.length++,!0}return!1},et.deleteRule=function(nt){this.element.removeChild(this.nodes[nt]),this.length--},et.getRule=function(nt){return nt0&&(ht+=dt+",")}),ot+=""+ct+ut+'{content:"'+ht+`"}/*!sc*/ -`}}}return ot}(this)},tt}(),Z=/(a)(d)/gi,K$5=function(tt){return String.fromCharCode(tt+(tt>25?39:97))};function Q(tt){var et,nt="";for(et=Math.abs(tt);et>52;et=et/52|0)nt=K$5(et%52)+nt;return(K$5(et%52)+nt).replace(Z,"$1-$2")}var ee=function(tt,et){for(var nt=et.length;nt;)tt=33*tt^et.charCodeAt(--nt);return tt},te=function(tt){return ee(5381,tt)};function ne(tt){for(var et=0;et>>0);if(!nt.hasNameForId(it,st)){var lt=rt(at,"."+st,void 0,it);nt.insertRules(it,st,lt)}ot.push(st),this.staticRulesId=st}else{for(var ct=this.rules.length,ut=ee(this.baseHash,rt.hash),ht="",dt=0;dt>>0);if(!nt.hasNameForId(it,yt)){var bt=rt(ht,"."+yt,void 0,it);nt.insertRules(it,yt,bt)}ot.push(yt)}}return ot.join(" ")},tt}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(tt){var et,nt,rt,it,ot=tt===void 0?w$3:tt,at=ot.options,st=at===void 0?w$3:at,lt=ot.plugins,ct=lt===void 0?S:lt,ut=new stylis_min(st),ht=[],dt=function(gt){function yt(bt){if(bt)try{gt(bt+"}")}catch{}}return function(bt,wt,xt,kt,St,Tt,At,Et,Ct,Lt){switch(bt){case 1:if(Ct===0&&wt.charCodeAt(0)===64)return gt(wt+";"),"";break;case 2:if(Et===0)return wt+"/*|*/";break;case 3:switch(Et){case 102:case 112:return gt(xt[0]+wt),"";default:return wt+(Lt===0?"/*|*/":"")}case-2:wt.split("/*|*/}").forEach(yt)}}}(function(gt){ht.push(gt)}),pt=function(gt,yt,bt){return yt===0&&ie.indexOf(bt[nt.length])!==-1||bt.match(it)?gt:"."+et};function mt(gt,yt,bt,wt){wt===void 0&&(wt="&");var xt=gt.replace(se,""),kt=yt&&bt?bt+" "+yt+" { "+xt+" }":xt;return et=wt,nt=yt,rt=new RegExp("\\"+nt+"\\b","g"),it=new RegExp("(\\"+nt+"\\b){2,}"),ut(bt||!yt?"":yt,kt)}return ut.use([].concat(ct,[function(gt,yt,bt){gt===2&&bt.length&&bt[0].lastIndexOf(nt)>0&&(bt[0]=bt[0].replace(rt,pt))},dt,function(gt){if(gt===-2){var yt=ht;return ht=[],yt}}])),mt.hash=ct.length?ct.reduce(function(gt,yt){return yt.name||D(15),ee(gt,yt.name)},5381).toString():"",mt}var ce=React$1.createContext();ce.Consumer;var le=React$1.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return reactExports.useContext(ce)||de}function fe(){return reactExports.useContext(le)||he}var ye=function(){function tt(et,nt){var rt=this;this.inject=function(it,ot){ot===void 0&&(ot=he);var at=rt.name+ot.hash;it.hasNameForId(rt.id,at)||it.insertRules(rt.id,at,ot(rt.rules,at,"@keyframes"))},this.toString=function(){return D(12,String(rt.name))},this.name=et,this.id="sc-keyframes-"+et,this.rules=nt}return tt.prototype.getName=function(et){return et===void 0&&(et=he),this.name+et.hash},tt}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(tt){return"-"+tt.toLowerCase()};function Ee(tt){return ve.test(tt)?tt.replace(ge,we).replace(Se,"-ms-"):tt}var be=function(tt){return tt==null||tt===!1||tt===""};function _e(tt,et,nt,rt){if(Array.isArray(tt)){for(var it,ot=[],at=0,st=tt.length;at1?et-1:0),rt=1;rt?@[\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(tt){return tt.replace(Re,"-").replace(De,"")}var Te=function(tt){return Q(te(tt)>>>0)};function xe(tt){return typeof tt=="string"&&!0}var ke=function(tt){return typeof tt=="function"||typeof tt=="object"&&tt!==null&&!Array.isArray(tt)},Ve=function(tt){return tt!=="__proto__"&&tt!=="constructor"&&tt!=="prototype"};function Be(tt,et,nt){var rt=tt[nt];ke(et)&&ke(rt)?ze(rt,et):tt[nt]=et}function ze(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),rt=1;rt=0||(Lt[Et]=Tt[Et]);return Lt}(et,["componentId"]),St=xt&&xt+"-"+(xe(wt)?wt:je(b$2(wt)));return Ye(wt,y$4({},kt,{attrs:dt,componentId:St}),nt)},Object.defineProperty(mt,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(wt){this._foldedDefaultProps=rt?ze({},tt.defaultProps,wt):wt}}),Object.defineProperty(mt,"toString",{value:function(){return"."+mt.styledComponentId}}),it&&hoistNonReactStatics$1(mt,tt,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),mt}var qe=function(tt){return function et(nt,rt,it){if(it===void 0&&(it=w$3),!reactIsExports$2.isValidElementType(rt))return D(1,String(rt));var ot=function(){return nt(rt,it,Ae.apply(void 0,arguments))};return ot.withConfig=function(at){return et(nt,rt,y$4({},it,{},at))},ot.attrs=function(at){return et(nt,rt,y$4({},it,{attrs:Array.prototype.concat(it.attrs,at).filter(Boolean)}))},ot}(Ye,tt)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(tt){qe[tt]=qe(tt)});var He=function(){function tt(nt,rt){this.rules=nt,this.componentId=rt,this.isStatic=ne(nt),X.registerId(this.componentId+1)}var et=tt.prototype;return et.createStyles=function(nt,rt,it,ot){var at=ot(_e(this.rules,rt,it,ot).join(""),""),st=this.componentId+nt;it.insertRules(st,st,at)},et.removeStyles=function(nt,rt){rt.clearRules(this.componentId+nt)},et.renderStyles=function(nt,rt,it,ot){nt>2&&X.registerId(this.componentId+nt),this.removeStyles(nt,it),this.createStyles(nt,rt,it,ot)},tt}();function $e(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),rt=1;rt1?et-1:0),rt=1;rt25?39:97))};function Q(tt){var et,nt="";for(et=Math.abs(tt);et>52;et=et/52|0)nt=K$5(et%52)+nt;return(K$5(et%52)+nt).replace(Z,"$1-$2")}var ee=function(tt,et){for(var nt=et.length;nt;)tt=33*tt^et.charCodeAt(--nt);return tt},te=function(tt){return ee(5381,tt)};function ne(tt){for(var et=0;et>>0);if(!nt.hasNameForId(it,st)){var lt=rt(at,"."+st,void 0,it);nt.insertRules(it,st,lt)}ot.push(st),this.staticRulesId=st}else{for(var ct=this.rules.length,ut=ee(this.baseHash,rt.hash),ht="",dt=0;dt>>0);if(!nt.hasNameForId(it,yt)){var bt=rt(ht,"."+yt,void 0,it);nt.insertRules(it,yt,bt)}ot.push(yt)}}return ot.join(" ")},tt}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(tt){var et,nt,rt,it,ot=tt===void 0?w$3:tt,at=ot.options,st=at===void 0?w$3:at,lt=ot.plugins,ct=lt===void 0?S:lt,ut=new stylis_min(st),ht=[],dt=function(gt){function yt(bt){if(bt)try{gt(bt+"}")}catch{}}return function(bt,wt,xt,kt,St,Tt,At,Et,Ct,Lt){switch(bt){case 1:if(Ct===0&&wt.charCodeAt(0)===64)return gt(wt+";"),"";break;case 2:if(Et===0)return wt+"/*|*/";break;case 3:switch(Et){case 102:case 112:return gt(xt[0]+wt),"";default:return wt+(Lt===0?"/*|*/":"")}case-2:wt.split("/*|*/}").forEach(yt)}}}(function(gt){ht.push(gt)}),pt=function(gt,yt,bt){return yt===0&&ie.indexOf(bt[nt.length])!==-1||bt.match(it)?gt:"."+et};function mt(gt,yt,bt,wt){wt===void 0&&(wt="&");var xt=gt.replace(se,""),kt=yt&&bt?bt+" "+yt+" { "+xt+" }":xt;return et=wt,nt=yt,rt=new RegExp("\\"+nt+"\\b","g"),it=new RegExp("(\\"+nt+"\\b){2,}"),ut(bt||!yt?"":yt,kt)}return ut.use([].concat(ct,[function(gt,yt,bt){gt===2&&bt.length&&bt[0].lastIndexOf(nt)>0&&(bt[0]=bt[0].replace(rt,pt))},dt,function(gt){if(gt===-2){var yt=ht;return ht=[],yt}}])),mt.hash=ct.length?ct.reduce(function(gt,yt){return yt.name||D(15),ee(gt,yt.name)},5381).toString():"",mt}var ce=React$1.createContext();ce.Consumer;var le=React$1.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return reactExports.useContext(ce)||de}function fe(){return reactExports.useContext(le)||he}var ye=function(){function tt(et,nt){var rt=this;this.inject=function(it,ot){ot===void 0&&(ot=he);var at=rt.name+ot.hash;it.hasNameForId(rt.id,at)||it.insertRules(rt.id,at,ot(rt.rules,at,"@keyframes"))},this.toString=function(){return D(12,String(rt.name))},this.name=et,this.id="sc-keyframes-"+et,this.rules=nt}return tt.prototype.getName=function(et){return et===void 0&&(et=he),this.name+et.hash},tt}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(tt){return"-"+tt.toLowerCase()};function Ee(tt){return ve.test(tt)?tt.replace(ge,we).replace(Se,"-ms-"):tt}var be=function(tt){return tt==null||tt===!1||tt===""};function _e(tt,et,nt,rt){if(Array.isArray(tt)){for(var it,ot=[],at=0,st=tt.length;at1?et-1:0),rt=1;rt?@[\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(tt){return tt.replace(Re,"-").replace(De,"")}var Te=function(tt){return Q(te(tt)>>>0)};function xe(tt){return typeof tt=="string"&&!0}var ke=function(tt){return typeof tt=="function"||typeof tt=="object"&&tt!==null&&!Array.isArray(tt)},Ve=function(tt){return tt!=="__proto__"&&tt!=="constructor"&&tt!=="prototype"};function Be(tt,et,nt){var rt=tt[nt];ke(et)&&ke(rt)?ze(rt,et):tt[nt]=et}function ze(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),rt=1;rt=0||(Lt[Et]=Tt[Et]);return Lt}(et,["componentId"]),St=xt&&xt+"-"+(xe(wt)?wt:je(b$2(wt)));return Ye(wt,y$4({},kt,{attrs:dt,componentId:St}),nt)},Object.defineProperty(mt,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(wt){this._foldedDefaultProps=rt?ze({},tt.defaultProps,wt):wt}}),Object.defineProperty(mt,"toString",{value:function(){return"."+mt.styledComponentId}}),it&&hoistNonReactStatics$1(mt,tt,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),mt}var qe=function(tt){return function et(nt,rt,it){if(it===void 0&&(it=w$3),!reactIsExports$2.isValidElementType(rt))return D(1,String(rt));var ot=function(){return nt(rt,it,Ae.apply(void 0,arguments))};return ot.withConfig=function(at){return et(nt,rt,y$4({},it,{},at))},ot.attrs=function(at){return et(nt,rt,y$4({},it,{attrs:Array.prototype.concat(it.attrs,at).filter(Boolean)}))},ot}(Ye,tt)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(tt){qe[tt]=qe(tt)});var He=function(){function tt(nt,rt){this.rules=nt,this.componentId=rt,this.isStatic=ne(nt),X.registerId(this.componentId+1)}var et=tt.prototype;return et.createStyles=function(nt,rt,it,ot){var at=ot(_e(this.rules,rt,it,ot).join(""),""),st=this.componentId+nt;it.insertRules(st,st,at)},et.removeStyles=function(nt,rt){rt.clearRules(this.componentId+nt)},et.renderStyles=function(nt,rt,it,ot){nt>2&&X.registerId(this.componentId+nt),this.removeStyles(nt,it),this.createStyles(nt,rt,it,ot)},tt}();function $e(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),rt=1;rt1?et-1:0),rt=1;rttt&&`background-color: ${colors[tt]};`} `,switchProp$3=(tt,et)=>{switch(tt){case"borderColor":return`border-color: ${et};`;case"borderRadius":return`border-radius: ${et}px;`;case"borderRadiusBottomLeft":return`border-bottom-left-radius: ${et}px;`;case"borderRadiusBottomRight":return`border-bottom-right-radius: ${et}px;`;case"borderRadiusTopLeft":return`border-top-left-radius: ${et}px;`;case"borderRadiusTopRight":return`border-top-right-radius: ${et}px;`;case"borderSize":return` border-style: solid; @@ -3113,7 +3113,7 @@ void main() { #include #include #include -}`,ShaderChunk={alphamap_fragment,alphamap_pars_fragment,alphatest_fragment,alphatest_pars_fragment,aomap_fragment,aomap_pars_fragment,begin_vertex,beginnormal_vertex,bsdfs,iridescence_fragment,bumpmap_pars_fragment,clipping_planes_fragment,clipping_planes_pars_fragment,clipping_planes_pars_vertex,clipping_planes_vertex,color_fragment,color_pars_fragment,color_pars_vertex,color_vertex,common:common$8,cube_uv_reflection_fragment,defaultnormal_vertex,displacementmap_pars_vertex,displacementmap_vertex,emissivemap_fragment,emissivemap_pars_fragment,encodings_fragment,encodings_pars_fragment,envmap_fragment,envmap_common_pars_fragment,envmap_pars_fragment,envmap_pars_vertex,envmap_physical_pars_fragment,envmap_vertex,fog_vertex,fog_pars_vertex,fog_fragment,fog_pars_fragment,gradientmap_pars_fragment,lightmap_fragment,lightmap_pars_fragment,lights_lambert_vertex,lights_pars_begin,lights_toon_fragment,lights_toon_pars_fragment,lights_phong_fragment,lights_phong_pars_fragment,lights_physical_fragment,lights_physical_pars_fragment,lights_fragment_begin,lights_fragment_maps,lights_fragment_end,logdepthbuf_fragment,logdepthbuf_pars_fragment,logdepthbuf_pars_vertex,logdepthbuf_vertex,map_fragment,map_pars_fragment,map_particle_fragment,map_particle_pars_fragment,metalnessmap_fragment,metalnessmap_pars_fragment,morphcolor_vertex,morphnormal_vertex,morphtarget_pars_vertex,morphtarget_vertex,normal_fragment_begin,normal_fragment_maps,normal_pars_fragment,normal_pars_vertex,normal_vertex,normalmap_pars_fragment,clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps,clearcoat_pars_fragment,iridescence_pars_fragment,output_fragment,packing,premultiplied_alpha_fragment,project_vertex,dithering_fragment,dithering_pars_fragment,roughnessmap_fragment,roughnessmap_pars_fragment,shadowmap_pars_fragment,shadowmap_pars_vertex,shadowmap_vertex,shadowmask_pars_fragment,skinbase_vertex,skinning_pars_vertex,skinning_vertex,skinnormal_vertex,specularmap_fragment,specularmap_pars_fragment,tonemapping_fragment,tonemapping_pars_fragment,transmission_fragment,transmission_pars_fragment,uv_pars_fragment,uv_pars_vertex,uv_vertex,uv2_pars_fragment,uv2_pars_vertex,uv2_vertex,worldpos_vertex,background_vert:vertex$g,background_frag:fragment$g,cube_vert:vertex$f,cube_frag:fragment$f,depth_vert:vertex$e,depth_frag:fragment$e,distanceRGBA_vert:vertex$d,distanceRGBA_frag:fragment$d,equirect_vert:vertex$c,equirect_frag:fragment$c,linedashed_vert:vertex$b,linedashed_frag:fragment$b,meshbasic_vert:vertex$a,meshbasic_frag:fragment$a,meshlambert_vert:vertex$9,meshlambert_frag:fragment$9,meshmatcap_vert:vertex$8,meshmatcap_frag:fragment$8,meshnormal_vert:vertex$7,meshnormal_frag:fragment$7,meshphong_vert:vertex$6,meshphong_frag:fragment$6,meshphysical_vert:vertex$5,meshphysical_frag:fragment$5,meshtoon_vert:vertex$4,meshtoon_frag:fragment$4,points_vert:vertex$3,points_frag:fragment$3,shadow_vert:vertex$2,shadow_frag:fragment$2,sprite_vert:vertex$1,sprite_frag:fragment$1},UniformsLib={common:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Matrix3},uv2Transform:{value:new Matrix3},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color$1(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},specular:{value:new Color$1(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},cube:{uniforms:mergeUniforms([UniformsLib.envmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color$1(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Color$1(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Color$1(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Color$1(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};function WebGLBackground(tt,et,nt,rt,it,ot){const at=new Color$1(0);let st=it===!0?0:1,lt,ct,ut=null,ht=0,dt=null;function pt(gt,yt){let bt=!1,wt=yt.isScene===!0?yt.background:null;wt&&wt.isTexture&&(wt=et.get(wt));const xt=tt.xr,kt=xt.getSession&&xt.getSession();kt&&kt.environmentBlendMode==="additive"&&(wt=null),wt===null?mt(at,st):wt&&wt.isColor&&(mt(wt,1),bt=!0),(tt.autoClear||bt)&&tt.clear(tt.autoClearColor,tt.autoClearDepth,tt.autoClearStencil),wt&&(wt.isCubeTexture||wt.mapping===CubeUVReflectionMapping)?(ct===void 0&&(ct=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.cube.uniforms),vertexShader:ShaderLib.cube.vertexShader,fragmentShader:ShaderLib.cube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1})),ct.geometry.deleteAttribute("normal"),ct.geometry.deleteAttribute("uv"),ct.onBeforeRender=function(St,Tt,At){this.matrixWorld.copyPosition(At.matrixWorld)},Object.defineProperty(ct.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),rt.update(ct)),ct.material.uniforms.envMap.value=wt,ct.material.uniforms.flipEnvMap.value=wt.isCubeTexture&&wt.isRenderTargetTexture===!1?-1:1,(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(ct.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),ct.layers.enableAll(),gt.unshift(ct,ct.geometry,ct.material,0,0,null)):wt&&wt.isTexture&&(lt===void 0&&(lt=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),lt.geometry.deleteAttribute("normal"),Object.defineProperty(lt.material,"map",{get:function(){return this.uniforms.t2D.value}}),rt.update(lt)),lt.material.uniforms.t2D.value=wt,wt.matrixAutoUpdate===!0&&wt.updateMatrix(),lt.material.uniforms.uvTransform.value.copy(wt.matrix),(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(lt.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),lt.layers.enableAll(),gt.unshift(lt,lt.geometry,lt.material,0,0,null))}function mt(gt,yt){nt.buffers.color.setClear(gt.r,gt.g,gt.b,yt,ot)}return{getClearColor:function(){return at},setClearColor:function(gt,yt=1){at.set(gt),st=yt,mt(at,st)},getClearAlpha:function(){return st},setClearAlpha:function(gt){st=gt,mt(at,st)},render:pt}}function WebGLBindingStates(tt,et,nt,rt){const it=tt.getParameter(34921),ot=rt.isWebGL2?null:et.get("OES_vertex_array_object"),at=rt.isWebGL2||ot!==null,st={},lt=yt(null);let ct=lt,ut=!1;function ht(vt,It,Ot,Wt,zt){let Ft=!1;if(at){const Nt=gt(Wt,Ot,It);ct!==Nt&&(ct=Nt,pt(ct.object)),Ft=bt(vt,Wt,Ot,zt),Ft&&wt(vt,Wt,Ot,zt)}else{const Nt=It.wireframe===!0;(ct.geometry!==Wt.id||ct.program!==Ot.id||ct.wireframe!==Nt)&&(ct.geometry=Wt.id,ct.program=Ot.id,ct.wireframe=Nt,Ft=!0)}zt!==null&&nt.update(zt,34963),(Ft||ut)&&(ut=!1,Et(vt,It,Ot,Wt),zt!==null&&tt.bindBuffer(34963,nt.get(zt).buffer))}function dt(){return rt.isWebGL2?tt.createVertexArray():ot.createVertexArrayOES()}function pt(vt){return rt.isWebGL2?tt.bindVertexArray(vt):ot.bindVertexArrayOES(vt)}function mt(vt){return rt.isWebGL2?tt.deleteVertexArray(vt):ot.deleteVertexArrayOES(vt)}function gt(vt,It,Ot){const Wt=Ot.wireframe===!0;let zt=st[vt.id];zt===void 0&&(zt={},st[vt.id]=zt);let Ft=zt[It.id];Ft===void 0&&(Ft={},zt[It.id]=Ft);let Nt=Ft[Wt];return Nt===void 0&&(Nt=yt(dt()),Ft[Wt]=Nt),Nt}function yt(vt){const It=[],Ot=[],Wt=[];for(let zt=0;zt=0){const Qt=zt[Pt];let an=Ft[Pt];if(an===void 0&&(Pt==="instanceMatrix"&&vt.instanceMatrix&&(an=vt.instanceMatrix),Pt==="instanceColor"&&vt.instanceColor&&(an=vt.instanceColor)),Qt===void 0||Qt.attribute!==an||an&&Qt.data!==an.data)return!0;Nt++}return ct.attributesNum!==Nt||ct.index!==Wt}function wt(vt,It,Ot,Wt){const zt={},Ft=It.attributes;let Nt=0;const Ut=Ot.getAttributes();for(const Pt in Ut)if(Ut[Pt].location>=0){let Qt=Ft[Pt];Qt===void 0&&(Pt==="instanceMatrix"&&vt.instanceMatrix&&(Qt=vt.instanceMatrix),Pt==="instanceColor"&&vt.instanceColor&&(Qt=vt.instanceColor));const an={};an.attribute=Qt,Qt&&Qt.data&&(an.data=Qt.data),zt[Pt]=an,Nt++}ct.attributes=zt,ct.attributesNum=Nt,ct.index=Wt}function xt(){const vt=ct.newAttributes;for(let It=0,Ot=vt.length;It=0){let Ht=zt[Ut];if(Ht===void 0&&(Ut==="instanceMatrix"&&vt.instanceMatrix&&(Ht=vt.instanceMatrix),Ut==="instanceColor"&&vt.instanceColor&&(Ht=vt.instanceColor)),Ht!==void 0){const Qt=Ht.normalized,an=Ht.itemSize,Yt=nt.get(Ht);if(Yt===void 0)continue;const nn=Yt.buffer,tn=Yt.type,dn=Yt.bytesPerElement;if(Ht.isInterleavedBufferAttribute){const wn=Ht.data,rn=wn.stride,Jt=Ht.offset;if(wn.isInstancedInterleavedBuffer){for(let vn=0;vn0&&tt.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";At="mediump"}return At==="mediump"&&tt.getShaderPrecisionFormat(35633,36337).precision>0&&tt.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const at=typeof WebGL2RenderingContext<"u"&&tt instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&tt instanceof WebGL2ComputeRenderingContext;let st=nt.precision!==void 0?nt.precision:"highp";const lt=ot(st);lt!==st&&(console.warn("THREE.WebGLRenderer:",st,"not supported, using",lt,"instead."),st=lt);const ct=at||et.has("WEBGL_draw_buffers"),ut=nt.logarithmicDepthBuffer===!0,ht=tt.getParameter(34930),dt=tt.getParameter(35660),pt=tt.getParameter(3379),mt=tt.getParameter(34076),gt=tt.getParameter(34921),yt=tt.getParameter(36347),bt=tt.getParameter(36348),wt=tt.getParameter(36349),xt=dt>0,kt=at||et.has("OES_texture_float"),St=xt&&kt,Tt=at?tt.getParameter(36183):0;return{isWebGL2:at,drawBuffers:ct,getMaxAnisotropy:it,getMaxPrecision:ot,precision:st,logarithmicDepthBuffer:ut,maxTextures:ht,maxVertexTextures:dt,maxTextureSize:pt,maxCubemapSize:mt,maxAttributes:gt,maxVertexUniforms:yt,maxVaryings:bt,maxFragmentUniforms:wt,vertexTextures:xt,floatFragmentTextures:kt,floatVertexTextures:St,maxSamples:Tt}}function WebGLClipping(tt){const et=this;let nt=null,rt=0,it=!1,ot=!1;const at=new Plane,st=new Matrix3,lt={value:null,needsUpdate:!1};this.uniform=lt,this.numPlanes=0,this.numIntersection=0,this.init=function(ht,dt,pt){const mt=ht.length!==0||dt||rt!==0||it;return it=dt,nt=ut(ht,pt,0),rt=ht.length,mt},this.beginShadows=function(){ot=!0,ut(null)},this.endShadows=function(){ot=!1,ct()},this.setState=function(ht,dt,pt){const mt=ht.clippingPlanes,gt=ht.clipIntersection,yt=ht.clipShadows,bt=tt.get(ht);if(!it||mt===null||mt.length===0||ot&&!yt)ot?ut(null):ct();else{const wt=ot?0:rt,xt=wt*4;let kt=bt.clippingState||null;lt.value=kt,kt=ut(mt,dt,xt,pt);for(let St=0;St!==xt;++St)kt[St]=nt[St];bt.clippingState=kt,this.numIntersection=gt?this.numPlanes:0,this.numPlanes+=wt}};function ct(){lt.value!==nt&&(lt.value=nt,lt.needsUpdate=rt>0),et.numPlanes=rt,et.numIntersection=0}function ut(ht,dt,pt,mt){const gt=ht!==null?ht.length:0;let yt=null;if(gt!==0){if(yt=lt.value,mt!==!0||yt===null){const bt=pt+gt*4,wt=dt.matrixWorldInverse;st.getNormalMatrix(wt),(yt===null||yt.length0){const ct=new WebGLCubeRenderTarget(lt.height/2);return ct.fromEquirectangularTexture(tt,at),et.set(at,ct),at.addEventListener("dispose",it),nt(ct.texture,at.mapping)}else return null}}return at}function it(at){const st=at.target;st.removeEventListener("dispose",it);const lt=et.get(st);lt!==void 0&&(et.delete(st),lt.dispose())}function ot(){et=new WeakMap}return{get:rt,dispose:ot}}class OrthographicCamera extends Camera{constructor(et=-1,nt=1,rt=1,it=-1,ot=.1,at=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=et,this.right=nt,this.top=rt,this.bottom=it,this.near=ot,this.far=at,this.updateProjectionMatrix()}copy(et,nt){return super.copy(et,nt),this.left=et.left,this.right=et.right,this.top=et.top,this.bottom=et.bottom,this.near=et.near,this.far=et.far,this.zoom=et.zoom,this.view=et.view===null?null:Object.assign({},et.view),this}setViewOffset(et,nt,rt,it,ot,at){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=et,this.view.fullHeight=nt,this.view.offsetX=rt,this.view.offsetY=it,this.view.width=ot,this.view.height=at,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const et=(this.right-this.left)/(2*this.zoom),nt=(this.top-this.bottom)/(2*this.zoom),rt=(this.right+this.left)/2,it=(this.top+this.bottom)/2;let ot=rt-et,at=rt+et,st=it+nt,lt=it-nt;if(this.view!==null&&this.view.enabled){const ct=(this.right-this.left)/this.view.fullWidth/this.zoom,ut=(this.top-this.bottom)/this.view.fullHeight/this.zoom;ot+=ct*this.view.offsetX,at=ot+ct*this.view.width,st-=ut*this.view.offsetY,lt=st-ut*this.view.height}this.projectionMatrix.makeOrthographic(ot,at,st,lt,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(et){const nt=super.toJSON(et);return nt.object.zoom=this.zoom,nt.object.left=this.left,nt.object.right=this.right,nt.object.top=this.top,nt.object.bottom=this.bottom,nt.object.near=this.near,nt.object.far=this.far,this.view!==null&&(nt.object.view=Object.assign({},this.view)),nt}}const LOD_MIN=4,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],MAX_SAMPLES=20,_flatCamera=new OrthographicCamera,_clearColor=new Color$1;let _oldTarget=null;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,PHI,INV_PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(INV_PHI,0,PHI),new Vector3(-INV_PHI,0,PHI),new Vector3(PHI,INV_PHI,0),new Vector3(-PHI,INV_PHI,0)];class PMREMGenerator{constructor(et){this._renderer=et,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(et,nt=0,rt=.1,it=100){_oldTarget=this._renderer.getRenderTarget(),this._setSize(256);const ot=this._allocateTargets();return ot.depthBuffer=!0,this._sceneToCubeUV(et,rt,it,ot),nt>0&&this._blur(ot,0,0,nt),this._applyPMREM(ot),this._cleanup(ot),ot}fromEquirectangular(et,nt=null){return this._fromTexture(et,nt)}fromCubemap(et,nt=null){return this._fromTexture(et,nt)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(et){this._lodMax=Math.floor(Math.log2(et)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let et=0;et2?xt:0,xt,xt),ut.setRenderTarget(it),gt&&ut.render(mt,st),ut.render(et,st)}mt.geometry.dispose(),mt.material.dispose(),ut.toneMapping=dt,ut.autoClear=ht,et.background=yt}_textureToCubeUV(et,nt){const rt=this._renderer,it=et.mapping===CubeReflectionMapping||et.mapping===CubeRefractionMapping;it?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=et.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());const ot=it?this._cubemapMaterial:this._equirectMaterial,at=new Mesh(this._lodPlanes[0],ot),st=ot.uniforms;st.envMap.value=et;const lt=this._cubeSize;_setViewport(nt,0,0,3*lt,2*lt),rt.setRenderTarget(nt),rt.render(at,_flatCamera)}_applyPMREM(et){const nt=this._renderer,rt=nt.autoClear;nt.autoClear=!1;for(let it=1;itMAX_SAMPLES&&console.warn(`sigmaRadians, ${ot}, is too large and will clip, as it requested ${yt} samples when the maximum is set to ${MAX_SAMPLES}`);const bt=[];let wt=0;for(let At=0;Atxt-LOD_MIN?it-xt+LOD_MIN:0),Tt=4*(this._cubeSize-kt);_setViewport(nt,St,Tt,3*kt,2*kt),lt.setRenderTarget(nt),lt.render(ht,_flatCamera)}}function _createPlanes(tt){const et=[],nt=[],rt=[];let it=tt;const ot=tt-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let at=0;attt-LOD_MIN?lt=EXTRA_LOD_SIGMA[at-tt+LOD_MIN-1]:at===0&&(lt=0),rt.push(lt);const ct=1/(st-2),ut=-ct,ht=1+ct,dt=[ut,ut,ht,ut,ht,ht,ut,ut,ht,ht,ut,ht],pt=6,mt=6,gt=3,yt=2,bt=1,wt=new Float32Array(gt*mt*pt),xt=new Float32Array(yt*mt*pt),kt=new Float32Array(bt*mt*pt);for(let Tt=0;Tt2?0:-1,Ct=[At,Et,0,At+2/3,Et,0,At+2/3,Et+1,0,At,Et,0,At+2/3,Et+1,0,At,Et+1,0];wt.set(Ct,gt*mt*Tt),xt.set(dt,yt*mt*Tt);const Lt=[Tt,Tt,Tt,Tt,Tt,Tt];kt.set(Lt,bt*mt*Tt)}const St=new BufferGeometry;St.setAttribute("position",new BufferAttribute(wt,gt)),St.setAttribute("uv",new BufferAttribute(xt,yt)),St.setAttribute("faceIndex",new BufferAttribute(kt,bt)),et.push(St),it>LOD_MIN&&it--}return{lodPlanes:et,sizeLods:nt,sigmas:rt}}function _createRenderTarget(tt,et,nt){const rt=new WebGLRenderTarget(tt,et,nt);return rt.texture.mapping=CubeUVReflectionMapping,rt.texture.name="PMREM.cubeUv",rt.scissorTest=!0,rt}function _setViewport(tt,et,nt,rt,it){tt.viewport.set(et,nt,rt,it),tt.scissor.set(et,nt,rt,it)}function _getBlurShader(tt,et,nt){const rt=new Float32Array(MAX_SAMPLES),it=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:MAX_SAMPLES,CUBEUV_TEXEL_WIDTH:1/et,CUBEUV_TEXEL_HEIGHT:1/nt,CUBEUV_MAX_MIP:`${tt}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:rt},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:it}},vertexShader:_getCommonVertexShader(),fragmentShader:` +}`,ShaderChunk={alphamap_fragment,alphamap_pars_fragment,alphatest_fragment,alphatest_pars_fragment,aomap_fragment,aomap_pars_fragment,begin_vertex,beginnormal_vertex,bsdfs,iridescence_fragment,bumpmap_pars_fragment,clipping_planes_fragment,clipping_planes_pars_fragment,clipping_planes_pars_vertex,clipping_planes_vertex,color_fragment,color_pars_fragment,color_pars_vertex,color_vertex,common:common$8,cube_uv_reflection_fragment,defaultnormal_vertex,displacementmap_pars_vertex,displacementmap_vertex,emissivemap_fragment,emissivemap_pars_fragment,encodings_fragment,encodings_pars_fragment,envmap_fragment,envmap_common_pars_fragment,envmap_pars_fragment,envmap_pars_vertex,envmap_physical_pars_fragment,envmap_vertex,fog_vertex,fog_pars_vertex,fog_fragment,fog_pars_fragment,gradientmap_pars_fragment,lightmap_fragment,lightmap_pars_fragment,lights_lambert_vertex,lights_pars_begin,lights_toon_fragment,lights_toon_pars_fragment,lights_phong_fragment,lights_phong_pars_fragment,lights_physical_fragment,lights_physical_pars_fragment,lights_fragment_begin,lights_fragment_maps,lights_fragment_end,logdepthbuf_fragment,logdepthbuf_pars_fragment,logdepthbuf_pars_vertex,logdepthbuf_vertex,map_fragment,map_pars_fragment,map_particle_fragment,map_particle_pars_fragment,metalnessmap_fragment,metalnessmap_pars_fragment,morphcolor_vertex,morphnormal_vertex,morphtarget_pars_vertex,morphtarget_vertex,normal_fragment_begin,normal_fragment_maps,normal_pars_fragment,normal_pars_vertex,normal_vertex,normalmap_pars_fragment,clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps,clearcoat_pars_fragment,iridescence_pars_fragment,output_fragment,packing,premultiplied_alpha_fragment,project_vertex,dithering_fragment,dithering_pars_fragment,roughnessmap_fragment,roughnessmap_pars_fragment,shadowmap_pars_fragment,shadowmap_pars_vertex,shadowmap_vertex,shadowmask_pars_fragment,skinbase_vertex,skinning_pars_vertex,skinning_vertex,skinnormal_vertex,specularmap_fragment,specularmap_pars_fragment,tonemapping_fragment,tonemapping_pars_fragment,transmission_fragment,transmission_pars_fragment,uv_pars_fragment,uv_pars_vertex,uv_vertex,uv2_pars_fragment,uv2_pars_vertex,uv2_vertex,worldpos_vertex,background_vert:vertex$g,background_frag:fragment$g,cube_vert:vertex$f,cube_frag:fragment$f,depth_vert:vertex$e,depth_frag:fragment$e,distanceRGBA_vert:vertex$d,distanceRGBA_frag:fragment$d,equirect_vert:vertex$c,equirect_frag:fragment$c,linedashed_vert:vertex$b,linedashed_frag:fragment$b,meshbasic_vert:vertex$a,meshbasic_frag:fragment$a,meshlambert_vert:vertex$9,meshlambert_frag:fragment$9,meshmatcap_vert:vertex$8,meshmatcap_frag:fragment$8,meshnormal_vert:vertex$7,meshnormal_frag:fragment$7,meshphong_vert:vertex$6,meshphong_frag:fragment$6,meshphysical_vert:vertex$5,meshphysical_frag:fragment$5,meshtoon_vert:vertex$4,meshtoon_frag:fragment$4,points_vert:vertex$3,points_frag:fragment$3,shadow_vert:vertex$2,shadow_frag:fragment$2,sprite_vert:vertex$1,sprite_frag:fragment$1},UniformsLib={common:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Matrix3},uv2Transform:{value:new Matrix3},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color$1(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},specular:{value:new Color$1(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},cube:{uniforms:mergeUniforms([UniformsLib.envmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color$1(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Color$1(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Color$1(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Color$1(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};function WebGLBackground(tt,et,nt,rt,it,ot){const at=new Color$1(0);let st=it===!0?0:1,lt,ct,ut=null,ht=0,dt=null;function pt(gt,yt){let bt=!1,wt=yt.isScene===!0?yt.background:null;wt&&wt.isTexture&&(wt=et.get(wt));const xt=tt.xr,kt=xt.getSession&&xt.getSession();kt&&kt.environmentBlendMode==="additive"&&(wt=null),wt===null?mt(at,st):wt&&wt.isColor&&(mt(wt,1),bt=!0),(tt.autoClear||bt)&&tt.clear(tt.autoClearColor,tt.autoClearDepth,tt.autoClearStencil),wt&&(wt.isCubeTexture||wt.mapping===CubeUVReflectionMapping)?(ct===void 0&&(ct=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.cube.uniforms),vertexShader:ShaderLib.cube.vertexShader,fragmentShader:ShaderLib.cube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1})),ct.geometry.deleteAttribute("normal"),ct.geometry.deleteAttribute("uv"),ct.onBeforeRender=function(St,Tt,At){this.matrixWorld.copyPosition(At.matrixWorld)},Object.defineProperty(ct.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),rt.update(ct)),ct.material.uniforms.envMap.value=wt,ct.material.uniforms.flipEnvMap.value=wt.isCubeTexture&&wt.isRenderTargetTexture===!1?-1:1,(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(ct.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),ct.layers.enableAll(),gt.unshift(ct,ct.geometry,ct.material,0,0,null)):wt&&wt.isTexture&&(lt===void 0&&(lt=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),lt.geometry.deleteAttribute("normal"),Object.defineProperty(lt.material,"map",{get:function(){return this.uniforms.t2D.value}}),rt.update(lt)),lt.material.uniforms.t2D.value=wt,wt.matrixAutoUpdate===!0&&wt.updateMatrix(),lt.material.uniforms.uvTransform.value.copy(wt.matrix),(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(lt.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),lt.layers.enableAll(),gt.unshift(lt,lt.geometry,lt.material,0,0,null))}function mt(gt,yt){nt.buffers.color.setClear(gt.r,gt.g,gt.b,yt,ot)}return{getClearColor:function(){return at},setClearColor:function(gt,yt=1){at.set(gt),st=yt,mt(at,st)},getClearAlpha:function(){return st},setClearAlpha:function(gt){st=gt,mt(at,st)},render:pt}}function WebGLBindingStates(tt,et,nt,rt){const it=tt.getParameter(34921),ot=rt.isWebGL2?null:et.get("OES_vertex_array_object"),at=rt.isWebGL2||ot!==null,st={},lt=yt(null);let ct=lt,ut=!1;function ht(vt,It,Ot,Wt,zt){let Ft=!1;if(at){const Nt=gt(Wt,Ot,It);ct!==Nt&&(ct=Nt,pt(ct.object)),Ft=bt(vt,Wt,Ot,zt),Ft&&wt(vt,Wt,Ot,zt)}else{const Nt=It.wireframe===!0;(ct.geometry!==Wt.id||ct.program!==Ot.id||ct.wireframe!==Nt)&&(ct.geometry=Wt.id,ct.program=Ot.id,ct.wireframe=Nt,Ft=!0)}zt!==null&&nt.update(zt,34963),(Ft||ut)&&(ut=!1,Et(vt,It,Ot,Wt),zt!==null&&tt.bindBuffer(34963,nt.get(zt).buffer))}function dt(){return rt.isWebGL2?tt.createVertexArray():ot.createVertexArrayOES()}function pt(vt){return rt.isWebGL2?tt.bindVertexArray(vt):ot.bindVertexArrayOES(vt)}function mt(vt){return rt.isWebGL2?tt.deleteVertexArray(vt):ot.deleteVertexArrayOES(vt)}function gt(vt,It,Ot){const Wt=Ot.wireframe===!0;let zt=st[vt.id];zt===void 0&&(zt={},st[vt.id]=zt);let Ft=zt[It.id];Ft===void 0&&(Ft={},zt[It.id]=Ft);let Nt=Ft[Wt];return Nt===void 0&&(Nt=yt(dt()),Ft[Wt]=Nt),Nt}function yt(vt){const It=[],Ot=[],Wt=[];for(let zt=0;zt=0){const Qt=zt[Pt];let an=Ft[Pt];if(an===void 0&&(Pt==="instanceMatrix"&&vt.instanceMatrix&&(an=vt.instanceMatrix),Pt==="instanceColor"&&vt.instanceColor&&(an=vt.instanceColor)),Qt===void 0||Qt.attribute!==an||an&&Qt.data!==an.data)return!0;Nt++}return ct.attributesNum!==Nt||ct.index!==Wt}function wt(vt,It,Ot,Wt){const zt={},Ft=It.attributes;let Nt=0;const Ut=Ot.getAttributes();for(const Pt in Ut)if(Ut[Pt].location>=0){let Qt=Ft[Pt];Qt===void 0&&(Pt==="instanceMatrix"&&vt.instanceMatrix&&(Qt=vt.instanceMatrix),Pt==="instanceColor"&&vt.instanceColor&&(Qt=vt.instanceColor));const an={};an.attribute=Qt,Qt&&Qt.data&&(an.data=Qt.data),zt[Pt]=an,Nt++}ct.attributes=zt,ct.attributesNum=Nt,ct.index=Wt}function xt(){const vt=ct.newAttributes;for(let It=0,Ot=vt.length;It=0){let Ht=zt[Ut];if(Ht===void 0&&(Ut==="instanceMatrix"&&vt.instanceMatrix&&(Ht=vt.instanceMatrix),Ut==="instanceColor"&&vt.instanceColor&&(Ht=vt.instanceColor)),Ht!==void 0){const Qt=Ht.normalized,an=Ht.itemSize,Yt=nt.get(Ht);if(Yt===void 0)continue;const nn=Yt.buffer,tn=Yt.type,dn=Yt.bytesPerElement;if(Ht.isInterleavedBufferAttribute){const wn=Ht.data,rn=wn.stride,Zt=Ht.offset;if(wn.isInstancedInterleavedBuffer){for(let vn=0;vn0&&tt.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";At="mediump"}return At==="mediump"&&tt.getShaderPrecisionFormat(35633,36337).precision>0&&tt.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const at=typeof WebGL2RenderingContext<"u"&&tt instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&tt instanceof WebGL2ComputeRenderingContext;let st=nt.precision!==void 0?nt.precision:"highp";const lt=ot(st);lt!==st&&(console.warn("THREE.WebGLRenderer:",st,"not supported, using",lt,"instead."),st=lt);const ct=at||et.has("WEBGL_draw_buffers"),ut=nt.logarithmicDepthBuffer===!0,ht=tt.getParameter(34930),dt=tt.getParameter(35660),pt=tt.getParameter(3379),mt=tt.getParameter(34076),gt=tt.getParameter(34921),yt=tt.getParameter(36347),bt=tt.getParameter(36348),wt=tt.getParameter(36349),xt=dt>0,kt=at||et.has("OES_texture_float"),St=xt&&kt,Tt=at?tt.getParameter(36183):0;return{isWebGL2:at,drawBuffers:ct,getMaxAnisotropy:it,getMaxPrecision:ot,precision:st,logarithmicDepthBuffer:ut,maxTextures:ht,maxVertexTextures:dt,maxTextureSize:pt,maxCubemapSize:mt,maxAttributes:gt,maxVertexUniforms:yt,maxVaryings:bt,maxFragmentUniforms:wt,vertexTextures:xt,floatFragmentTextures:kt,floatVertexTextures:St,maxSamples:Tt}}function WebGLClipping(tt){const et=this;let nt=null,rt=0,it=!1,ot=!1;const at=new Plane,st=new Matrix3,lt={value:null,needsUpdate:!1};this.uniform=lt,this.numPlanes=0,this.numIntersection=0,this.init=function(ht,dt,pt){const mt=ht.length!==0||dt||rt!==0||it;return it=dt,nt=ut(ht,pt,0),rt=ht.length,mt},this.beginShadows=function(){ot=!0,ut(null)},this.endShadows=function(){ot=!1,ct()},this.setState=function(ht,dt,pt){const mt=ht.clippingPlanes,gt=ht.clipIntersection,yt=ht.clipShadows,bt=tt.get(ht);if(!it||mt===null||mt.length===0||ot&&!yt)ot?ut(null):ct();else{const wt=ot?0:rt,xt=wt*4;let kt=bt.clippingState||null;lt.value=kt,kt=ut(mt,dt,xt,pt);for(let St=0;St!==xt;++St)kt[St]=nt[St];bt.clippingState=kt,this.numIntersection=gt?this.numPlanes:0,this.numPlanes+=wt}};function ct(){lt.value!==nt&&(lt.value=nt,lt.needsUpdate=rt>0),et.numPlanes=rt,et.numIntersection=0}function ut(ht,dt,pt,mt){const gt=ht!==null?ht.length:0;let yt=null;if(gt!==0){if(yt=lt.value,mt!==!0||yt===null){const bt=pt+gt*4,wt=dt.matrixWorldInverse;st.getNormalMatrix(wt),(yt===null||yt.length0){const ct=new WebGLCubeRenderTarget(lt.height/2);return ct.fromEquirectangularTexture(tt,at),et.set(at,ct),at.addEventListener("dispose",it),nt(ct.texture,at.mapping)}else return null}}return at}function it(at){const st=at.target;st.removeEventListener("dispose",it);const lt=et.get(st);lt!==void 0&&(et.delete(st),lt.dispose())}function ot(){et=new WeakMap}return{get:rt,dispose:ot}}class OrthographicCamera extends Camera{constructor(et=-1,nt=1,rt=1,it=-1,ot=.1,at=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=et,this.right=nt,this.top=rt,this.bottom=it,this.near=ot,this.far=at,this.updateProjectionMatrix()}copy(et,nt){return super.copy(et,nt),this.left=et.left,this.right=et.right,this.top=et.top,this.bottom=et.bottom,this.near=et.near,this.far=et.far,this.zoom=et.zoom,this.view=et.view===null?null:Object.assign({},et.view),this}setViewOffset(et,nt,rt,it,ot,at){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=et,this.view.fullHeight=nt,this.view.offsetX=rt,this.view.offsetY=it,this.view.width=ot,this.view.height=at,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const et=(this.right-this.left)/(2*this.zoom),nt=(this.top-this.bottom)/(2*this.zoom),rt=(this.right+this.left)/2,it=(this.top+this.bottom)/2;let ot=rt-et,at=rt+et,st=it+nt,lt=it-nt;if(this.view!==null&&this.view.enabled){const ct=(this.right-this.left)/this.view.fullWidth/this.zoom,ut=(this.top-this.bottom)/this.view.fullHeight/this.zoom;ot+=ct*this.view.offsetX,at=ot+ct*this.view.width,st-=ut*this.view.offsetY,lt=st-ut*this.view.height}this.projectionMatrix.makeOrthographic(ot,at,st,lt,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(et){const nt=super.toJSON(et);return nt.object.zoom=this.zoom,nt.object.left=this.left,nt.object.right=this.right,nt.object.top=this.top,nt.object.bottom=this.bottom,nt.object.near=this.near,nt.object.far=this.far,this.view!==null&&(nt.object.view=Object.assign({},this.view)),nt}}const LOD_MIN=4,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],MAX_SAMPLES=20,_flatCamera=new OrthographicCamera,_clearColor=new Color$1;let _oldTarget=null;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,PHI,INV_PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(INV_PHI,0,PHI),new Vector3(-INV_PHI,0,PHI),new Vector3(PHI,INV_PHI,0),new Vector3(-PHI,INV_PHI,0)];class PMREMGenerator{constructor(et){this._renderer=et,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(et,nt=0,rt=.1,it=100){_oldTarget=this._renderer.getRenderTarget(),this._setSize(256);const ot=this._allocateTargets();return ot.depthBuffer=!0,this._sceneToCubeUV(et,rt,it,ot),nt>0&&this._blur(ot,0,0,nt),this._applyPMREM(ot),this._cleanup(ot),ot}fromEquirectangular(et,nt=null){return this._fromTexture(et,nt)}fromCubemap(et,nt=null){return this._fromTexture(et,nt)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(et){this._lodMax=Math.floor(Math.log2(et)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let et=0;et2?xt:0,xt,xt),ut.setRenderTarget(it),gt&&ut.render(mt,st),ut.render(et,st)}mt.geometry.dispose(),mt.material.dispose(),ut.toneMapping=dt,ut.autoClear=ht,et.background=yt}_textureToCubeUV(et,nt){const rt=this._renderer,it=et.mapping===CubeReflectionMapping||et.mapping===CubeRefractionMapping;it?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=et.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());const ot=it?this._cubemapMaterial:this._equirectMaterial,at=new Mesh(this._lodPlanes[0],ot),st=ot.uniforms;st.envMap.value=et;const lt=this._cubeSize;_setViewport(nt,0,0,3*lt,2*lt),rt.setRenderTarget(nt),rt.render(at,_flatCamera)}_applyPMREM(et){const nt=this._renderer,rt=nt.autoClear;nt.autoClear=!1;for(let it=1;itMAX_SAMPLES&&console.warn(`sigmaRadians, ${ot}, is too large and will clip, as it requested ${yt} samples when the maximum is set to ${MAX_SAMPLES}`);const bt=[];let wt=0;for(let At=0;Atxt-LOD_MIN?it-xt+LOD_MIN:0),Tt=4*(this._cubeSize-kt);_setViewport(nt,St,Tt,3*kt,2*kt),lt.setRenderTarget(nt),lt.render(ht,_flatCamera)}}function _createPlanes(tt){const et=[],nt=[],rt=[];let it=tt;const ot=tt-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let at=0;attt-LOD_MIN?lt=EXTRA_LOD_SIGMA[at-tt+LOD_MIN-1]:at===0&&(lt=0),rt.push(lt);const ct=1/(st-2),ut=-ct,ht=1+ct,dt=[ut,ut,ht,ut,ht,ht,ut,ut,ht,ht,ut,ht],pt=6,mt=6,gt=3,yt=2,bt=1,wt=new Float32Array(gt*mt*pt),xt=new Float32Array(yt*mt*pt),kt=new Float32Array(bt*mt*pt);for(let Tt=0;Tt2?0:-1,Ct=[At,Et,0,At+2/3,Et,0,At+2/3,Et+1,0,At,Et,0,At+2/3,Et+1,0,At,Et+1,0];wt.set(Ct,gt*mt*Tt),xt.set(dt,yt*mt*Tt);const Lt=[Tt,Tt,Tt,Tt,Tt,Tt];kt.set(Lt,bt*mt*Tt)}const St=new BufferGeometry;St.setAttribute("position",new BufferAttribute(wt,gt)),St.setAttribute("uv",new BufferAttribute(xt,yt)),St.setAttribute("faceIndex",new BufferAttribute(kt,bt)),et.push(St),it>LOD_MIN&&it--}return{lodPlanes:et,sizeLods:nt,sigmas:rt}}function _createRenderTarget(tt,et,nt){const rt=new WebGLRenderTarget(tt,et,nt);return rt.texture.mapping=CubeUVReflectionMapping,rt.texture.name="PMREM.cubeUv",rt.scissorTest=!0,rt}function _setViewport(tt,et,nt,rt,it){tt.viewport.set(et,nt,rt,it),tt.scissor.set(et,nt,rt,it)}function _getBlurShader(tt,et,nt){const rt=new Float32Array(MAX_SAMPLES),it=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:MAX_SAMPLES,CUBEUV_TEXEL_WIDTH:1/et,CUBEUV_TEXEL_HEIGHT:1/nt,CUBEUV_MAX_MIP:`${tt}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:rt},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:it}},vertexShader:_getCommonVertexShader(),fragmentShader:` precision mediump float; precision mediump int; @@ -3321,7 +3321,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function WebGLShadowMap(tt,et,nt){let rt=new Frustum;const it=new Vector2,ot=new Vector2,at=new Vector4,st=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),lt=new MeshDistanceMaterial,ct={},ut=nt.maxTextureSize,ht={0:BackSide,1:FrontSide,2:DoubleSide},dt=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vertex,fragmentShader:fragment}),pt=dt.clone();pt.defines.HORIZONTAL_PASS=1;const mt=new BufferGeometry;mt.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const gt=new Mesh(mt,dt),yt=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap,this.render=function(kt,St,Tt){if(yt.enabled===!1||yt.autoUpdate===!1&&yt.needsUpdate===!1||kt.length===0)return;const At=tt.getRenderTarget(),Et=tt.getActiveCubeFace(),Ct=tt.getActiveMipmapLevel(),Lt=tt.state;Lt.setBlending(NoBlending),Lt.buffers.color.setClear(1,1,1,1),Lt.buffers.depth.setTest(!0),Lt.setScissorTest(!1);for(let jt=0,Rt=kt.length;jtut||it.y>ut)&&(it.x>ut&&(ot.x=Math.floor(ut/It.x),it.x=ot.x*It.x,vt.mapSize.x=ot.x),it.y>ut&&(ot.y=Math.floor(ut/It.y),it.y=ot.y*It.y,vt.mapSize.y=ot.y)),vt.map===null){const Wt=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};vt.map=new WebGLRenderTarget(it.x,it.y,Wt),vt.map.texture.name=$t.name+".shadowMap",vt.camera.updateProjectionMatrix()}tt.setRenderTarget(vt.map),tt.clear();const Ot=vt.getViewportCount();for(let Wt=0;Wt0){const Rt=Lt.uuid,$t=St.uuid;let vt=ct[Rt];vt===void 0&&(vt={},ct[Rt]=vt);let It=vt[$t];It===void 0&&(It=Lt.clone(),vt[$t]=It),Lt=It}return Lt.visible=St.visible,Lt.wireframe=St.wireframe,Ct===VSMShadowMap?Lt.side=St.shadowSide!==null?St.shadowSide:St.side:Lt.side=St.shadowSide!==null?St.shadowSide:ht[St.side],Lt.alphaMap=St.alphaMap,Lt.alphaTest=St.alphaTest,Lt.clipShadows=St.clipShadows,Lt.clippingPlanes=St.clippingPlanes,Lt.clipIntersection=St.clipIntersection,Lt.displacementMap=St.displacementMap,Lt.displacementScale=St.displacementScale,Lt.displacementBias=St.displacementBias,Lt.wireframeLinewidth=St.wireframeLinewidth,Lt.linewidth=St.linewidth,Tt.isPointLight===!0&&Lt.isMeshDistanceMaterial===!0&&(Lt.referencePosition.setFromMatrixPosition(Tt.matrixWorld),Lt.nearDistance=At,Lt.farDistance=Et),Lt}function xt(kt,St,Tt,At,Et){if(kt.visible===!1)return;if(kt.layers.test(St.layers)&&(kt.isMesh||kt.isLine||kt.isPoints)&&(kt.castShadow||kt.receiveShadow&&Et===VSMShadowMap)&&(!kt.frustumCulled||rt.intersectsObject(kt))){kt.modelViewMatrix.multiplyMatrices(Tt.matrixWorldInverse,kt.matrixWorld);const jt=et.update(kt),Rt=kt.material;if(Array.isArray(Rt)){const $t=jt.groups;for(let vt=0,It=$t.length;vt=1):zt.indexOf("OpenGL ES")!==-1&&(Wt=parseFloat(/^OpenGL ES (\d)/.exec(zt)[1]),Ot=Wt>=2);let Ft=null,Nt={};const Ut=tt.getParameter(3088),Pt=tt.getParameter(2978),Ht=new Vector4().fromArray(Ut),Qt=new Vector4().fromArray(Pt);function an(zn,Zn,Wn){const fr=new Uint8Array(4),ur=tt.createTexture();tt.bindTexture(zn,ur),tt.texParameteri(zn,10241,9728),tt.texParameteri(zn,10240,9728);for(let wr=0;wrxn||yn.height>xn)&&(jn=xn/Math.max(yn.width,yn.height)),jn<1||hn===!0)if(typeof HTMLImageElement<"u"&&yn instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&yn instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&yn instanceof ImageBitmap){const cn=hn?floorPowerOfTwo:Math.floor,Xt=cn(jn*yn.width),Kt=cn(jn*yn.height);gt===void 0&&(gt=wt(Xt,Kt));const kn=fn?wt(Xt,Kt):gt;return kn.width=Xt,kn.height=Kt,kn.getContext("2d").drawImage(yn,0,0,Xt,Kt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+yn.width+"x"+yn.height+") to ("+Xt+"x"+Kt+")."),kn}else return"data"in yn&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+yn.width+"x"+yn.height+")."),yn;return yn}function kt(yn){return isPowerOfTwo(yn.width)&&isPowerOfTwo(yn.height)}function St(yn){return st?!1:yn.wrapS!==ClampToEdgeWrapping||yn.wrapT!==ClampToEdgeWrapping||yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter}function Tt(yn,hn){return yn.generateMipmaps&&hn&&yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter}function At(yn){tt.generateMipmap(yn)}function Et(yn,hn,fn,xn,jn=!1){if(st===!1)return hn;if(yn!==null){if(tt[yn]!==void 0)return tt[yn];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+yn+"'")}let cn=hn;return hn===6403&&(fn===5126&&(cn=33326),fn===5131&&(cn=33325),fn===5121&&(cn=33321)),hn===33319&&(fn===5126&&(cn=33328),fn===5131&&(cn=33327),fn===5121&&(cn=33323)),hn===6408&&(fn===5126&&(cn=34836),fn===5131&&(cn=34842),fn===5121&&(cn=xn===sRGBEncoding&&jn===!1?35907:32856),fn===32819&&(cn=32854),fn===32820&&(cn=32855)),(cn===33325||cn===33326||cn===33327||cn===33328||cn===34842||cn===34836)&&et.get("EXT_color_buffer_float"),cn}function Ct(yn,hn,fn){return Tt(yn,fn)===!0||yn.isFramebufferTexture&&yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter?Math.log2(Math.max(hn.width,hn.height))+1:yn.mipmaps!==void 0&&yn.mipmaps.length>0?yn.mipmaps.length:yn.isCompressedTexture&&Array.isArray(yn.image)?hn.mipmaps.length:1}function Lt(yn){return yn===NearestFilter||yn===NearestMipmapNearestFilter||yn===NearestMipmapLinearFilter?9728:9729}function jt(yn){const hn=yn.target;hn.removeEventListener("dispose",jt),$t(hn),hn.isVideoTexture&&mt.delete(hn)}function Rt(yn){const hn=yn.target;hn.removeEventListener("dispose",Rt),It(hn)}function $t(yn){const hn=rt.get(yn);if(hn.__webglInit===void 0)return;const fn=yn.source,xn=yt.get(fn);if(xn){const jn=xn[hn.__cacheKey];jn.usedTimes--,jn.usedTimes===0&&vt(yn),Object.keys(xn).length===0&&yt.delete(fn)}rt.remove(yn)}function vt(yn){const hn=rt.get(yn);tt.deleteTexture(hn.__webglTexture);const fn=yn.source,xn=yt.get(fn);delete xn[hn.__cacheKey],at.memory.textures--}function It(yn){const hn=yn.texture,fn=rt.get(yn),xn=rt.get(hn);if(xn.__webglTexture!==void 0&&(tt.deleteTexture(xn.__webglTexture),at.memory.textures--),yn.depthTexture&&yn.depthTexture.dispose(),yn.isWebGLCubeRenderTarget)for(let jn=0;jn<6;jn++)tt.deleteFramebuffer(fn.__webglFramebuffer[jn]),fn.__webglDepthbuffer&&tt.deleteRenderbuffer(fn.__webglDepthbuffer[jn]);else{if(tt.deleteFramebuffer(fn.__webglFramebuffer),fn.__webglDepthbuffer&&tt.deleteRenderbuffer(fn.__webglDepthbuffer),fn.__webglMultisampledFramebuffer&&tt.deleteFramebuffer(fn.__webglMultisampledFramebuffer),fn.__webglColorRenderbuffer)for(let jn=0;jn=lt&&console.warn("THREE.WebGLTextures: Trying to use "+yn+" texture units while this GPU supports only "+lt),Ot+=1,yn}function Ft(yn){const hn=[];return hn.push(yn.wrapS),hn.push(yn.wrapT),hn.push(yn.magFilter),hn.push(yn.minFilter),hn.push(yn.anisotropy),hn.push(yn.internalFormat),hn.push(yn.format),hn.push(yn.type),hn.push(yn.generateMipmaps),hn.push(yn.premultiplyAlpha),hn.push(yn.flipY),hn.push(yn.unpackAlignment),hn.push(yn.encoding),hn.join()}function Nt(yn,hn){const fn=rt.get(yn);if(yn.isVideoTexture&&Tn(yn),yn.isRenderTargetTexture===!1&&yn.version>0&&fn.__version!==yn.version){const xn=yn.image;if(xn===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(xn.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{tn(fn,yn,hn);return}}nt.activeTexture(33984+hn),nt.bindTexture(3553,fn.__webglTexture)}function Ut(yn,hn){const fn=rt.get(yn);if(yn.version>0&&fn.__version!==yn.version){tn(fn,yn,hn);return}nt.activeTexture(33984+hn),nt.bindTexture(35866,fn.__webglTexture)}function Pt(yn,hn){const fn=rt.get(yn);if(yn.version>0&&fn.__version!==yn.version){tn(fn,yn,hn);return}nt.activeTexture(33984+hn),nt.bindTexture(32879,fn.__webglTexture)}function Ht(yn,hn){const fn=rt.get(yn);if(yn.version>0&&fn.__version!==yn.version){dn(fn,yn,hn);return}nt.activeTexture(33984+hn),nt.bindTexture(34067,fn.__webglTexture)}const Qt={[RepeatWrapping]:10497,[ClampToEdgeWrapping]:33071,[MirroredRepeatWrapping]:33648},an={[NearestFilter]:9728,[NearestMipmapNearestFilter]:9984,[NearestMipmapLinearFilter]:9986,[LinearFilter]:9729,[LinearMipmapNearestFilter]:9985,[LinearMipmapLinearFilter]:9987};function Yt(yn,hn,fn){if(fn?(tt.texParameteri(yn,10242,Qt[hn.wrapS]),tt.texParameteri(yn,10243,Qt[hn.wrapT]),(yn===32879||yn===35866)&&tt.texParameteri(yn,32882,Qt[hn.wrapR]),tt.texParameteri(yn,10240,an[hn.magFilter]),tt.texParameteri(yn,10241,an[hn.minFilter])):(tt.texParameteri(yn,10242,33071),tt.texParameteri(yn,10243,33071),(yn===32879||yn===35866)&&tt.texParameteri(yn,32882,33071),(hn.wrapS!==ClampToEdgeWrapping||hn.wrapT!==ClampToEdgeWrapping)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),tt.texParameteri(yn,10240,Lt(hn.magFilter)),tt.texParameteri(yn,10241,Lt(hn.minFilter)),hn.minFilter!==NearestFilter&&hn.minFilter!==LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),et.has("EXT_texture_filter_anisotropic")===!0){const xn=et.get("EXT_texture_filter_anisotropic");if(hn.type===FloatType&&et.has("OES_texture_float_linear")===!1||st===!1&&hn.type===HalfFloatType&&et.has("OES_texture_half_float_linear")===!1)return;(hn.anisotropy>1||rt.get(hn).__currentAnisotropy)&&(tt.texParameterf(yn,xn.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(hn.anisotropy,it.getMaxAnisotropy())),rt.get(hn).__currentAnisotropy=hn.anisotropy)}}function nn(yn,hn){let fn=!1;yn.__webglInit===void 0&&(yn.__webglInit=!0,hn.addEventListener("dispose",jt));const xn=hn.source;let jn=yt.get(xn);jn===void 0&&(jn={},yt.set(xn,jn));const cn=Ft(hn);if(cn!==yn.__cacheKey){jn[cn]===void 0&&(jn[cn]={texture:tt.createTexture(),usedTimes:0},at.memory.textures++,fn=!0),jn[cn].usedTimes++;const Xt=jn[yn.__cacheKey];Xt!==void 0&&(jn[yn.__cacheKey].usedTimes--,Xt.usedTimes===0&&vt(hn)),yn.__cacheKey=cn,yn.__webglTexture=jn[cn].texture}return fn}function tn(yn,hn,fn){let xn=3553;hn.isDataArrayTexture&&(xn=35866),hn.isData3DTexture&&(xn=32879);const jn=nn(yn,hn),cn=hn.source;if(nt.activeTexture(33984+fn),nt.bindTexture(xn,yn.__webglTexture),cn.version!==cn.__currentVersion||jn===!0){tt.pixelStorei(37440,hn.flipY),tt.pixelStorei(37441,hn.premultiplyAlpha),tt.pixelStorei(3317,hn.unpackAlignment),tt.pixelStorei(37443,0);const Xt=St(hn)&&kt(hn.image)===!1;let Kt=xt(hn.image,Xt,!1,ut);Kt=In(hn,Kt);const kn=kt(Kt)||st,Mn=ot.convert(hn.format,hn.encoding);let On=ot.convert(hn.type),Bn=Et(hn.internalFormat,Mn,On,hn.encoding,hn.isVideoTexture);Yt(xn,hn,kn);let Xn;const Vn=hn.mipmaps,Gn=st&&hn.isVideoTexture!==!0,zn=cn.__currentVersion===void 0||jn===!0,Zn=Ct(hn,Kt,kn);if(hn.isDepthTexture)Bn=6402,st?hn.type===FloatType?Bn=36012:hn.type===UnsignedIntType?Bn=33190:hn.type===UnsignedInt248Type?Bn=35056:Bn=33189:hn.type===FloatType&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),hn.format===DepthFormat&&Bn===6402&&hn.type!==UnsignedShortType&&hn.type!==UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),hn.type=UnsignedIntType,On=ot.convert(hn.type)),hn.format===DepthStencilFormat&&Bn===6402&&(Bn=34041,hn.type!==UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),hn.type=UnsignedInt248Type,On=ot.convert(hn.type))),zn&&(Gn?nt.texStorage2D(3553,1,Bn,Kt.width,Kt.height):nt.texImage2D(3553,0,Bn,Kt.width,Kt.height,0,Mn,On,null));else if(hn.isDataTexture)if(Vn.length>0&&kn){Gn&&zn&&nt.texStorage2D(3553,Zn,Bn,Vn[0].width,Vn[0].height);for(let Wn=0,fr=Vn.length;Wn>=1,fr>>=1}}else if(Vn.length>0&&kn){Gn&&zn&&nt.texStorage2D(3553,Zn,Bn,Vn[0].width,Vn[0].height);for(let Wn=0,fr=Vn.length;Wn0&&zn++,nt.texStorage2D(34067,zn,Xn,Kt[0].width,Kt[0].height));for(let Wn=0;Wn<6;Wn++)if(Xt){Vn?nt.texSubImage2D(34069+Wn,0,0,0,Kt[Wn].width,Kt[Wn].height,On,Bn,Kt[Wn].data):nt.texImage2D(34069+Wn,0,Xn,Kt[Wn].width,Kt[Wn].height,0,On,Bn,Kt[Wn].data);for(let fr=0;fr0&&pn(yn)===!1){const Kt=cn?hn:[hn];fn.__webglMultisampledFramebuffer=tt.createFramebuffer(),fn.__webglColorRenderbuffer=[],nt.bindFramebuffer(36160,fn.__webglMultisampledFramebuffer);for(let kn=0;kn0&&pn(yn)===!1){const hn=yn.isWebGLMultipleRenderTargets?yn.texture:[yn.texture],fn=yn.width,xn=yn.height;let jn=16384;const cn=[],Xt=yn.stencilBuffer?33306:36096,Kt=rt.get(yn),kn=yn.isWebGLMultipleRenderTargets===!0;if(kn)for(let Mn=0;Mn0&&et.has("WEBGL_multisampled_render_to_texture")===!0&&hn.__useRenderToTexture!==!1}function Tn(yn){const hn=at.render.frame;mt.get(yn)!==hn&&(mt.set(yn,hn),yn.update())}function In(yn,hn){const fn=yn.encoding,xn=yn.format,jn=yn.type;return yn.isCompressedTexture===!0||yn.isVideoTexture===!0||yn.format===_SRGBAFormat||fn!==LinearEncoding&&(fn===sRGBEncoding?st===!1?et.has("EXT_sRGB")===!0&&xn===RGBAFormat?(yn.format=_SRGBAFormat,yn.minFilter=LinearFilter,yn.generateMipmaps=!1):hn=ImageUtils.sRGBToLinear(hn):(xn!==RGBAFormat||jn!==UnsignedByteType)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",fn)),hn}this.allocateTextureUnit=zt,this.resetTextureUnits=Wt,this.setTexture2D=Nt,this.setTexture2DArray=Ut,this.setTexture3D=Pt,this.setTextureCube=Ht,this.rebindTextures=Cn,this.setupRenderTarget=$n,this.updateRenderTargetMipmap=Nn,this.updateMultisampleRenderTarget=En,this.setupDepthRenderbuffer=vn,this.setupFrameBufferTexture=wn,this.useMultisampledRTT=pn}function WebGLUtils(tt,et,nt){const rt=nt.isWebGL2;function it(ot,at=null){let st;if(ot===UnsignedByteType)return 5121;if(ot===UnsignedShort4444Type)return 32819;if(ot===UnsignedShort5551Type)return 32820;if(ot===ByteType)return 5120;if(ot===ShortType)return 5122;if(ot===UnsignedShortType)return 5123;if(ot===IntType)return 5124;if(ot===UnsignedIntType)return 5125;if(ot===FloatType)return 5126;if(ot===HalfFloatType)return rt?5131:(st=et.get("OES_texture_half_float"),st!==null?st.HALF_FLOAT_OES:null);if(ot===AlphaFormat)return 6406;if(ot===RGBAFormat)return 6408;if(ot===LuminanceFormat)return 6409;if(ot===LuminanceAlphaFormat)return 6410;if(ot===DepthFormat)return 6402;if(ot===DepthStencilFormat)return 34041;if(ot===RedFormat)return 6403;if(ot===RGBFormat)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(ot===_SRGBAFormat)return st=et.get("EXT_sRGB"),st!==null?st.SRGB_ALPHA_EXT:null;if(ot===RedIntegerFormat)return 36244;if(ot===RGFormat)return 33319;if(ot===RGIntegerFormat)return 33320;if(ot===RGBAIntegerFormat)return 36249;if(ot===RGB_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT3_Format||ot===RGBA_S3TC_DXT5_Format)if(at===sRGBEncoding)if(st=et.get("WEBGL_compressed_texture_s3tc_srgb"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(st=et.get("WEBGL_compressed_texture_s3tc"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_RGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(ot===RGB_PVRTC_4BPPV1_Format||ot===RGB_PVRTC_2BPPV1_Format||ot===RGBA_PVRTC_4BPPV1_Format||ot===RGBA_PVRTC_2BPPV1_Format)if(st=et.get("WEBGL_compressed_texture_pvrtc"),st!==null){if(ot===RGB_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(ot===RGB_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(ot===RGBA_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(ot===RGBA_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(ot===RGB_ETC1_Format)return st=et.get("WEBGL_compressed_texture_etc1"),st!==null?st.COMPRESSED_RGB_ETC1_WEBGL:null;if(ot===RGB_ETC2_Format||ot===RGBA_ETC2_EAC_Format)if(st=et.get("WEBGL_compressed_texture_etc"),st!==null){if(ot===RGB_ETC2_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ETC2:st.COMPRESSED_RGB8_ETC2;if(ot===RGBA_ETC2_EAC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:st.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(ot===RGBA_ASTC_4x4_Format||ot===RGBA_ASTC_5x4_Format||ot===RGBA_ASTC_5x5_Format||ot===RGBA_ASTC_6x5_Format||ot===RGBA_ASTC_6x6_Format||ot===RGBA_ASTC_8x5_Format||ot===RGBA_ASTC_8x6_Format||ot===RGBA_ASTC_8x8_Format||ot===RGBA_ASTC_10x5_Format||ot===RGBA_ASTC_10x6_Format||ot===RGBA_ASTC_10x8_Format||ot===RGBA_ASTC_10x10_Format||ot===RGBA_ASTC_12x10_Format||ot===RGBA_ASTC_12x12_Format)if(st=et.get("WEBGL_compressed_texture_astc"),st!==null){if(ot===RGBA_ASTC_4x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:st.COMPRESSED_RGBA_ASTC_4x4_KHR;if(ot===RGBA_ASTC_5x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:st.COMPRESSED_RGBA_ASTC_5x4_KHR;if(ot===RGBA_ASTC_5x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:st.COMPRESSED_RGBA_ASTC_5x5_KHR;if(ot===RGBA_ASTC_6x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:st.COMPRESSED_RGBA_ASTC_6x5_KHR;if(ot===RGBA_ASTC_6x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:st.COMPRESSED_RGBA_ASTC_6x6_KHR;if(ot===RGBA_ASTC_8x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:st.COMPRESSED_RGBA_ASTC_8x5_KHR;if(ot===RGBA_ASTC_8x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:st.COMPRESSED_RGBA_ASTC_8x6_KHR;if(ot===RGBA_ASTC_8x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:st.COMPRESSED_RGBA_ASTC_8x8_KHR;if(ot===RGBA_ASTC_10x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:st.COMPRESSED_RGBA_ASTC_10x5_KHR;if(ot===RGBA_ASTC_10x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:st.COMPRESSED_RGBA_ASTC_10x6_KHR;if(ot===RGBA_ASTC_10x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:st.COMPRESSED_RGBA_ASTC_10x8_KHR;if(ot===RGBA_ASTC_10x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:st.COMPRESSED_RGBA_ASTC_10x10_KHR;if(ot===RGBA_ASTC_12x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:st.COMPRESSED_RGBA_ASTC_12x10_KHR;if(ot===RGBA_ASTC_12x12_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:st.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(ot===RGBA_BPTC_Format)if(st=et.get("EXT_texture_compression_bptc"),st!==null){if(ot===RGBA_BPTC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:st.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return ot===UnsignedInt248Type?rt?34042:(st=et.get("WEBGL_depth_texture"),st!==null?st.UNSIGNED_INT_24_8_WEBGL:null):tt[ot]!==void 0?tt[ot]:null}return{convert:it}}class ArrayCamera extends PerspectiveCamera{constructor(et=[]){super(),this.isArrayCamera=!0,this.cameras=et}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _moveEvent={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(et){return this._targetRay!==null&&this._targetRay.dispatchEvent(et),this._grip!==null&&this._grip.dispatchEvent(et),this._hand!==null&&this._hand.dispatchEvent(et),this}disconnect(et){return this.dispatchEvent({type:"disconnected",data:et}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(et,nt,rt){let it=null,ot=null,at=null;const st=this._targetRay,lt=this._grip,ct=this._hand;if(et&&nt.session.visibilityState!=="visible-blurred"){if(ct&&et.hand){at=!0;for(const gt of et.hand.values()){const yt=nt.getJointPose(gt,rt);if(ct.joints[gt.jointName]===void 0){const wt=new Group;wt.matrixAutoUpdate=!1,wt.visible=!1,ct.joints[gt.jointName]=wt,ct.add(wt)}const bt=ct.joints[gt.jointName];yt!==null&&(bt.matrix.fromArray(yt.transform.matrix),bt.matrix.decompose(bt.position,bt.rotation,bt.scale),bt.jointRadius=yt.radius),bt.visible=yt!==null}const ut=ct.joints["index-finger-tip"],ht=ct.joints["thumb-tip"],dt=ut.position.distanceTo(ht.position),pt=.02,mt=.005;ct.inputState.pinching&&dt>pt+mt?(ct.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:et.handedness,target:this})):!ct.inputState.pinching&&dt<=pt-mt&&(ct.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:et.handedness,target:this}))}else lt!==null&&et.gripSpace&&(ot=nt.getPose(et.gripSpace,rt),ot!==null&&(lt.matrix.fromArray(ot.transform.matrix),lt.matrix.decompose(lt.position,lt.rotation,lt.scale),ot.linearVelocity?(lt.hasLinearVelocity=!0,lt.linearVelocity.copy(ot.linearVelocity)):lt.hasLinearVelocity=!1,ot.angularVelocity?(lt.hasAngularVelocity=!0,lt.angularVelocity.copy(ot.angularVelocity)):lt.hasAngularVelocity=!1));st!==null&&(it=nt.getPose(et.targetRaySpace,rt),it===null&&ot!==null&&(it=ot),it!==null&&(st.matrix.fromArray(it.transform.matrix),st.matrix.decompose(st.position,st.rotation,st.scale),it.linearVelocity?(st.hasLinearVelocity=!0,st.linearVelocity.copy(it.linearVelocity)):st.hasLinearVelocity=!1,it.angularVelocity?(st.hasAngularVelocity=!0,st.angularVelocity.copy(it.angularVelocity)):st.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return st!==null&&(st.visible=it!==null),lt!==null&&(lt.visible=ot!==null),ct!==null&&(ct.visible=at!==null),this}}class DepthTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct,ut){if(ut=ut!==void 0?ut:DepthFormat,ut!==DepthFormat&&ut!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");rt===void 0&&ut===DepthFormat&&(rt=UnsignedIntType),rt===void 0&&ut===DepthStencilFormat&&(rt=UnsignedInt248Type),super(null,it,ot,at,st,lt,ut,rt,ct),this.isDepthTexture=!0,this.image={width:et,height:nt},this.magFilter=st!==void 0?st:NearestFilter,this.minFilter=lt!==void 0?lt:NearestFilter,this.flipY=!1,this.generateMipmaps=!1}}class WebXRManager extends EventDispatcher$1{constructor(et,nt){super();const rt=this;let it=null,ot=1,at=null,st="local-floor",lt=null,ct=null,ut=null,ht=null,dt=null,pt=null;const mt=nt.getContextAttributes();let gt=null,yt=null;const bt=[],wt=[],xt=new PerspectiveCamera;xt.layers.enable(1),xt.viewport=new Vector4;const kt=new PerspectiveCamera;kt.layers.enable(2),kt.viewport=new Vector4;const St=[xt,kt],Tt=new ArrayCamera;Tt.layers.enable(1),Tt.layers.enable(2);let At=null,Et=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Ft){let Nt=bt[Ft];return Nt===void 0&&(Nt=new WebXRController,bt[Ft]=Nt),Nt.getTargetRaySpace()},this.getControllerGrip=function(Ft){let Nt=bt[Ft];return Nt===void 0&&(Nt=new WebXRController,bt[Ft]=Nt),Nt.getGripSpace()},this.getHand=function(Ft){let Nt=bt[Ft];return Nt===void 0&&(Nt=new WebXRController,bt[Ft]=Nt),Nt.getHandSpace()};function Ct(Ft){const Nt=wt.indexOf(Ft.inputSource);if(Nt===-1)return;const Ut=bt[Nt];Ut!==void 0&&Ut.dispatchEvent({type:Ft.type,data:Ft.inputSource})}function Lt(){it.removeEventListener("select",Ct),it.removeEventListener("selectstart",Ct),it.removeEventListener("selectend",Ct),it.removeEventListener("squeeze",Ct),it.removeEventListener("squeezestart",Ct),it.removeEventListener("squeezeend",Ct),it.removeEventListener("end",Lt),it.removeEventListener("inputsourceschange",jt);for(let Ft=0;Ft=0&&(wt[Pt]=null,bt[Pt].dispatchEvent({type:"disconnected",data:Ut}))}for(let Nt=0;Nt=wt.length){wt.push(Ut),Pt=Qt;break}else if(wt[Qt]===null){wt[Qt]=Ut,Pt=Qt;break}if(Pt===-1)break}const Ht=bt[Pt];Ht&&Ht.dispatchEvent({type:"connected",data:Ut})}}const Rt=new Vector3,$t=new Vector3;function vt(Ft,Nt,Ut){Rt.setFromMatrixPosition(Nt.matrixWorld),$t.setFromMatrixPosition(Ut.matrixWorld);const Pt=Rt.distanceTo($t),Ht=Nt.projectionMatrix.elements,Qt=Ut.projectionMatrix.elements,an=Ht[14]/(Ht[10]-1),Yt=Ht[14]/(Ht[10]+1),nn=(Ht[9]+1)/Ht[5],tn=(Ht[9]-1)/Ht[5],dn=(Ht[8]-1)/Ht[0],wn=(Qt[8]+1)/Qt[0],rn=an*dn,Jt=an*wn,vn=Pt/(-dn+wn),Cn=vn*-dn;Nt.matrixWorld.decompose(Ft.position,Ft.quaternion,Ft.scale),Ft.translateX(Cn),Ft.translateZ(vn),Ft.matrixWorld.compose(Ft.position,Ft.quaternion,Ft.scale),Ft.matrixWorldInverse.copy(Ft.matrixWorld).invert();const $n=an+vn,Nn=Yt+vn,En=rn-Cn,sn=Jt+(Pt-Cn),pn=nn*Yt/Nn*$n,Tn=tn*Yt/Nn*$n;Ft.projectionMatrix.makePerspective(En,sn,pn,Tn,$n,Nn)}function It(Ft,Nt){Nt===null?Ft.matrixWorld.copy(Ft.matrix):Ft.matrixWorld.multiplyMatrices(Nt.matrixWorld,Ft.matrix),Ft.matrixWorldInverse.copy(Ft.matrixWorld).invert()}this.updateCamera=function(Ft){if(it===null)return;Tt.near=kt.near=xt.near=Ft.near,Tt.far=kt.far=xt.far=Ft.far,(At!==Tt.near||Et!==Tt.far)&&(it.updateRenderState({depthNear:Tt.near,depthFar:Tt.far}),At=Tt.near,Et=Tt.far);const Nt=Ft.parent,Ut=Tt.cameras;It(Tt,Nt);for(let Ht=0;Ht0&&(gt.alphaTest.value=yt.alphaTest);const bt=et.get(yt).envMap;if(bt&&(gt.envMap.value=bt,gt.flipEnvMap.value=bt.isCubeTexture&&bt.isRenderTargetTexture===!1?-1:1,gt.reflectivity.value=yt.reflectivity,gt.ior.value=yt.ior,gt.refractionRatio.value=yt.refractionRatio),yt.lightMap){gt.lightMap.value=yt.lightMap;const kt=tt.physicallyCorrectLights!==!0?Math.PI:1;gt.lightMapIntensity.value=yt.lightMapIntensity*kt}yt.aoMap&&(gt.aoMap.value=yt.aoMap,gt.aoMapIntensity.value=yt.aoMapIntensity);let wt;yt.map?wt=yt.map:yt.specularMap?wt=yt.specularMap:yt.displacementMap?wt=yt.displacementMap:yt.normalMap?wt=yt.normalMap:yt.bumpMap?wt=yt.bumpMap:yt.roughnessMap?wt=yt.roughnessMap:yt.metalnessMap?wt=yt.metalnessMap:yt.alphaMap?wt=yt.alphaMap:yt.emissiveMap?wt=yt.emissiveMap:yt.clearcoatMap?wt=yt.clearcoatMap:yt.clearcoatNormalMap?wt=yt.clearcoatNormalMap:yt.clearcoatRoughnessMap?wt=yt.clearcoatRoughnessMap:yt.iridescenceMap?wt=yt.iridescenceMap:yt.iridescenceThicknessMap?wt=yt.iridescenceThicknessMap:yt.specularIntensityMap?wt=yt.specularIntensityMap:yt.specularColorMap?wt=yt.specularColorMap:yt.transmissionMap?wt=yt.transmissionMap:yt.thicknessMap?wt=yt.thicknessMap:yt.sheenColorMap?wt=yt.sheenColorMap:yt.sheenRoughnessMap&&(wt=yt.sheenRoughnessMap),wt!==void 0&&(wt.isWebGLRenderTarget&&(wt=wt.texture),wt.matrixAutoUpdate===!0&&wt.updateMatrix(),gt.uvTransform.value.copy(wt.matrix));let xt;yt.aoMap?xt=yt.aoMap:yt.lightMap&&(xt=yt.lightMap),xt!==void 0&&(xt.isWebGLRenderTarget&&(xt=xt.texture),xt.matrixAutoUpdate===!0&&xt.updateMatrix(),gt.uv2Transform.value.copy(xt.matrix))}function ot(gt,yt){gt.diffuse.value.copy(yt.color),gt.opacity.value=yt.opacity}function at(gt,yt){gt.dashSize.value=yt.dashSize,gt.totalSize.value=yt.dashSize+yt.gapSize,gt.scale.value=yt.scale}function st(gt,yt,bt,wt){gt.diffuse.value.copy(yt.color),gt.opacity.value=yt.opacity,gt.size.value=yt.size*bt,gt.scale.value=wt*.5,yt.map&&(gt.map.value=yt.map),yt.alphaMap&&(gt.alphaMap.value=yt.alphaMap),yt.alphaTest>0&&(gt.alphaTest.value=yt.alphaTest);let xt;yt.map?xt=yt.map:yt.alphaMap&&(xt=yt.alphaMap),xt!==void 0&&(xt.matrixAutoUpdate===!0&&xt.updateMatrix(),gt.uvTransform.value.copy(xt.matrix))}function lt(gt,yt){gt.diffuse.value.copy(yt.color),gt.opacity.value=yt.opacity,gt.rotation.value=yt.rotation,yt.map&&(gt.map.value=yt.map),yt.alphaMap&&(gt.alphaMap.value=yt.alphaMap),yt.alphaTest>0&&(gt.alphaTest.value=yt.alphaTest);let bt;yt.map?bt=yt.map:yt.alphaMap&&(bt=yt.alphaMap),bt!==void 0&&(bt.matrixAutoUpdate===!0&&bt.updateMatrix(),gt.uvTransform.value.copy(bt.matrix))}function ct(gt,yt){gt.specular.value.copy(yt.specular),gt.shininess.value=Math.max(yt.shininess,1e-4)}function ut(gt,yt){yt.gradientMap&&(gt.gradientMap.value=yt.gradientMap)}function ht(gt,yt){gt.roughness.value=yt.roughness,gt.metalness.value=yt.metalness,yt.roughnessMap&&(gt.roughnessMap.value=yt.roughnessMap),yt.metalnessMap&&(gt.metalnessMap.value=yt.metalnessMap),et.get(yt).envMap&&(gt.envMapIntensity.value=yt.envMapIntensity)}function dt(gt,yt,bt){gt.ior.value=yt.ior,yt.sheen>0&&(gt.sheenColor.value.copy(yt.sheenColor).multiplyScalar(yt.sheen),gt.sheenRoughness.value=yt.sheenRoughness,yt.sheenColorMap&&(gt.sheenColorMap.value=yt.sheenColorMap),yt.sheenRoughnessMap&&(gt.sheenRoughnessMap.value=yt.sheenRoughnessMap)),yt.clearcoat>0&&(gt.clearcoat.value=yt.clearcoat,gt.clearcoatRoughness.value=yt.clearcoatRoughness,yt.clearcoatMap&&(gt.clearcoatMap.value=yt.clearcoatMap),yt.clearcoatRoughnessMap&&(gt.clearcoatRoughnessMap.value=yt.clearcoatRoughnessMap),yt.clearcoatNormalMap&&(gt.clearcoatNormalScale.value.copy(yt.clearcoatNormalScale),gt.clearcoatNormalMap.value=yt.clearcoatNormalMap,yt.side===BackSide&>.clearcoatNormalScale.value.negate())),yt.iridescence>0&&(gt.iridescence.value=yt.iridescence,gt.iridescenceIOR.value=yt.iridescenceIOR,gt.iridescenceThicknessMinimum.value=yt.iridescenceThicknessRange[0],gt.iridescenceThicknessMaximum.value=yt.iridescenceThicknessRange[1],yt.iridescenceMap&&(gt.iridescenceMap.value=yt.iridescenceMap),yt.iridescenceThicknessMap&&(gt.iridescenceThicknessMap.value=yt.iridescenceThicknessMap)),yt.transmission>0&&(gt.transmission.value=yt.transmission,gt.transmissionSamplerMap.value=bt.texture,gt.transmissionSamplerSize.value.set(bt.width,bt.height),yt.transmissionMap&&(gt.transmissionMap.value=yt.transmissionMap),gt.thickness.value=yt.thickness,yt.thicknessMap&&(gt.thicknessMap.value=yt.thicknessMap),gt.attenuationDistance.value=yt.attenuationDistance,gt.attenuationColor.value.copy(yt.attenuationColor)),gt.specularIntensity.value=yt.specularIntensity,gt.specularColor.value.copy(yt.specularColor),yt.specularIntensityMap&&(gt.specularIntensityMap.value=yt.specularIntensityMap),yt.specularColorMap&&(gt.specularColorMap.value=yt.specularColorMap)}function pt(gt,yt){yt.matcap&&(gt.matcap.value=yt.matcap)}function mt(gt,yt){gt.referencePosition.value.copy(yt.referencePosition),gt.nearDistance.value=yt.nearDistance,gt.farDistance.value=yt.farDistance}return{refreshFogUniforms:nt,refreshMaterialUniforms:rt}}function WebGLUniformsGroups(tt,et,nt,rt){let it={},ot={},at=[];const st=nt.isWebGL2?tt.getParameter(35375):0;function lt(wt,xt){const kt=xt.program;rt.uniformBlockBinding(wt,kt)}function ct(wt,xt){let kt=it[wt.id];kt===void 0&&(mt(wt),kt=ut(wt),it[wt.id]=kt,wt.addEventListener("dispose",yt));const St=xt.program;rt.updateUBOMapping(wt,St);const Tt=et.render.frame;ot[wt.id]!==Tt&&(dt(wt),ot[wt.id]=Tt)}function ut(wt){const xt=ht();wt.__bindingPointIndex=xt;const kt=tt.createBuffer(),St=wt.__size,Tt=wt.usage;return tt.bindBuffer(35345,kt),tt.bufferData(35345,St,Tt),tt.bindBuffer(35345,null),tt.bindBufferBase(35345,xt,kt),kt}function ht(){for(let wt=0;wt0){Tt=kt%St;const jt=St-Tt;Tt!==0&&jt-Lt.boundary<0&&(kt+=St-Tt,Ct.__offset=kt)}kt+=Lt.storage}return Tt=kt%St,Tt>0&&(kt+=St-Tt),wt.__size=kt,wt.__cache={},this}function gt(wt){const xt=wt.value,kt={boundary:0,storage:0};return typeof xt=="number"?(kt.boundary=4,kt.storage=4):xt.isVector2?(kt.boundary=8,kt.storage=8):xt.isVector3||xt.isColor?(kt.boundary=16,kt.storage=12):xt.isVector4?(kt.boundary=16,kt.storage=16):xt.isMatrix3?(kt.boundary=48,kt.storage=48):xt.isMatrix4?(kt.boundary=64,kt.storage=64):xt.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",xt),kt}function yt(wt){const xt=wt.target;xt.removeEventListener("dispose",yt);const kt=at.indexOf(xt.__bindingPointIndex);at.splice(kt,1),tt.deleteBuffer(it[xt.id]),delete it[xt.id],delete ot[xt.id]}function bt(){for(const wt in it)tt.deleteBuffer(it[wt]);at=[],it={},ot={}}return{bind:lt,update:ct,dispose:bt}}function createCanvasElement(){const tt=createElementNS("canvas");return tt.style.display="block",tt}function WebGLRenderer(tt={}){this.isWebGLRenderer=!0;const et=tt.canvas!==void 0?tt.canvas:createCanvasElement(),nt=tt.context!==void 0?tt.context:null,rt=tt.depth!==void 0?tt.depth:!0,it=tt.stencil!==void 0?tt.stencil:!0,ot=tt.antialias!==void 0?tt.antialias:!1,at=tt.premultipliedAlpha!==void 0?tt.premultipliedAlpha:!0,st=tt.preserveDrawingBuffer!==void 0?tt.preserveDrawingBuffer:!1,lt=tt.powerPreference!==void 0?tt.powerPreference:"default",ct=tt.failIfMajorPerformanceCaveat!==void 0?tt.failIfMajorPerformanceCaveat:!1;let ut;nt!==null?ut=nt.getContextAttributes().alpha:ut=tt.alpha!==void 0?tt.alpha:!1;let ht=null,dt=null;const pt=[],mt=[];this.domElement=et,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=LinearEncoding,this.physicallyCorrectLights=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const gt=this;let yt=!1,bt=0,wt=0,xt=null,kt=-1,St=null;const Tt=new Vector4,At=new Vector4;let Et=null,Ct=et.width,Lt=et.height,jt=1,Rt=null,$t=null;const vt=new Vector4(0,0,Ct,Lt),It=new Vector4(0,0,Ct,Lt);let Ot=!1;const Wt=new Frustum;let zt=!1,Ft=!1,Nt=null;const Ut=new Matrix4,Pt=new Vector2,Ht=new Vector3,Qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function an(){return xt===null?jt:1}let Yt=nt;function nn(un,Zt){for(let Sn=0;Sn0?dt=mt[mt.length-1]:dt=null,pt.pop(),pt.length>0?ht=pt[pt.length-1]:ht=null};function Ir(un,Zt,Sn,Dn){if(un.visible===!1)return;if(un.layers.test(Zt.layers)){if(un.isGroup)Sn=un.renderOrder;else if(un.isLOD)un.autoUpdate===!0&&un.update(Zt);else if(un.isLight)dt.pushLight(un),un.castShadow&&dt.pushShadow(un);else if(un.isSprite){if(!un.frustumCulled||Wt.intersectsSprite(un)){Dn&&Ht.setFromMatrixPosition(un.matrixWorld).applyMatrix4(Ut);const tr=sn.update(un),ar=un.material;ar.visible&&ht.push(un,tr,ar,Sn,Ht.z,null)}}else if((un.isMesh||un.isLine||un.isPoints)&&(un.isSkinnedMesh&&un.skeleton.frame!==rn.render.frame&&(un.skeleton.update(),un.skeleton.frame=rn.render.frame),!un.frustumCulled||Wt.intersectsObject(un))){Dn&&Ht.setFromMatrixPosition(un.matrixWorld).applyMatrix4(Ut);const tr=sn.update(un),ar=un.material;if(Array.isArray(ar)){const lr=tr.groups;for(let Vr=0,vr=lr.length;Vr0&&Or(Fn,Zt,Sn),Dn&&wn.viewport(Tt.copy(Dn)),Fn.length>0&&Lr(Fn,Zt,Sn),Yn.length>0&&Lr(Yn,Zt,Sn),tr.length>0&&Lr(tr,Zt,Sn),wn.buffers.depth.setTest(!0),wn.buffers.depth.setMask(!0),wn.buffers.color.setMask(!0),wn.setPolygonOffset(!1)}function Or(un,Zt,Sn){const Dn=dn.isWebGL2;Nt===null&&(Nt=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:tn.has("EXT_color_buffer_half_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:Dn&&ot===!0?4:0})),gt.getDrawingBufferSize(Pt),Dn?Nt.setSize(Pt.x,Pt.y):Nt.setSize(floorPowerOfTwo(Pt.x),floorPowerOfTwo(Pt.y));const Fn=gt.getRenderTarget();gt.setRenderTarget(Nt),gt.clear();const Yn=gt.toneMapping;gt.toneMapping=NoToneMapping,Lr(un,Zt,Sn),gt.toneMapping=Yn,vn.updateMultisampleRenderTarget(Nt),vn.updateRenderTargetMipmap(Nt),gt.setRenderTarget(Fn)}function Lr(un,Zt,Sn){const Dn=Zt.isScene===!0?Zt.overrideMaterial:null;for(let Fn=0,Yn=un.length;Fn0&&vn.useMultisampledRTT(un)===!1?Fn=Jt.get(un).__webglMultisampledFramebuffer:Fn=Vr,Tt.copy(un.viewport),At.copy(un.scissor),Et=un.scissorTest}else Tt.copy(vt).multiplyScalar(jt).floor(),At.copy(It).multiplyScalar(jt).floor(),Et=Ot;if(wn.bindFramebuffer(36160,Fn)&&dn.drawBuffers&&Dn&&wn.drawBuffers(un,Fn),wn.viewport(Tt),wn.scissor(At),wn.setScissorTest(Et),Yn){const lr=Jt.get(un.texture);Yt.framebufferTexture2D(36160,36064,34069+Zt,lr.__webglTexture,Sn)}else if(tr){const lr=Jt.get(un.texture),Vr=Zt||0;Yt.framebufferTextureLayer(36160,36064,lr.__webglTexture,Sn||0,Vr)}kt=-1},this.readRenderTargetPixels=function(un,Zt,Sn,Dn,Fn,Yn,tr){if(!(un&&un.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ar=Jt.get(un).__webglFramebuffer;if(un.isWebGLCubeRenderTarget&&tr!==void 0&&(ar=ar[tr]),ar){wn.bindFramebuffer(36160,ar);try{const lr=un.texture,Vr=lr.format,vr=lr.type;if(Vr!==RGBAFormat&&Kt.convert(Vr)!==Yt.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Nr=vr===HalfFloatType&&(tn.has("EXT_color_buffer_half_float")||dn.isWebGL2&&tn.has("EXT_color_buffer_float"));if(vr!==UnsignedByteType&&Kt.convert(vr)!==Yt.getParameter(35738)&&!(vr===FloatType&&(dn.isWebGL2||tn.has("OES_texture_float")||tn.has("WEBGL_color_buffer_float")))&&!Nr){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Zt>=0&&Zt<=un.width-Dn&&Sn>=0&&Sn<=un.height-Fn&&Yt.readPixels(Zt,Sn,Dn,Fn,Kt.convert(Vr),Kt.convert(vr),Yn)}finally{const lr=xt!==null?Jt.get(xt).__webglFramebuffer:null;wn.bindFramebuffer(36160,lr)}}},this.copyFramebufferToTexture=function(un,Zt,Sn=0){const Dn=Math.pow(2,-Sn),Fn=Math.floor(Zt.image.width*Dn),Yn=Math.floor(Zt.image.height*Dn);vn.setTexture2D(Zt,0),Yt.copyTexSubImage2D(3553,Sn,0,0,un.x,un.y,Fn,Yn),wn.unbindTexture()},this.copyTextureToTexture=function(un,Zt,Sn,Dn=0){const Fn=Zt.image.width,Yn=Zt.image.height,tr=Kt.convert(Sn.format),ar=Kt.convert(Sn.type);vn.setTexture2D(Sn,0),Yt.pixelStorei(37440,Sn.flipY),Yt.pixelStorei(37441,Sn.premultiplyAlpha),Yt.pixelStorei(3317,Sn.unpackAlignment),Zt.isDataTexture?Yt.texSubImage2D(3553,Dn,un.x,un.y,Fn,Yn,tr,ar,Zt.image.data):Zt.isCompressedTexture?Yt.compressedTexSubImage2D(3553,Dn,un.x,un.y,Zt.mipmaps[0].width,Zt.mipmaps[0].height,tr,Zt.mipmaps[0].data):Yt.texSubImage2D(3553,Dn,un.x,un.y,tr,ar,Zt.image),Dn===0&&Sn.generateMipmaps&&Yt.generateMipmap(3553),wn.unbindTexture()},this.copyTextureToTexture3D=function(un,Zt,Sn,Dn,Fn=0){if(gt.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Yn=un.max.x-un.min.x+1,tr=un.max.y-un.min.y+1,ar=un.max.z-un.min.z+1,lr=Kt.convert(Dn.format),Vr=Kt.convert(Dn.type);let vr;if(Dn.isData3DTexture)vn.setTexture3D(Dn,0),vr=32879;else if(Dn.isDataArrayTexture)vn.setTexture2DArray(Dn,0),vr=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Yt.pixelStorei(37440,Dn.flipY),Yt.pixelStorei(37441,Dn.premultiplyAlpha),Yt.pixelStorei(3317,Dn.unpackAlignment);const Nr=Yt.getParameter(3314),Hr=Yt.getParameter(32878),eo=Yt.getParameter(3316),Zr=Yt.getParameter(3315),Jr=Yt.getParameter(32877),br=Sn.isCompressedTexture?Sn.mipmaps[0]:Sn.image;Yt.pixelStorei(3314,br.width),Yt.pixelStorei(32878,br.height),Yt.pixelStorei(3316,un.min.x),Yt.pixelStorei(3315,un.min.y),Yt.pixelStorei(32877,un.min.z),Sn.isDataTexture||Sn.isData3DTexture?Yt.texSubImage3D(vr,Fn,Zt.x,Zt.y,Zt.z,Yn,tr,ar,lr,Vr,br.data):Sn.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Yt.compressedTexSubImage3D(vr,Fn,Zt.x,Zt.y,Zt.z,Yn,tr,ar,lr,br.data)):Yt.texSubImage3D(vr,Fn,Zt.x,Zt.y,Zt.z,Yn,tr,ar,lr,Vr,br),Yt.pixelStorei(3314,Nr),Yt.pixelStorei(32878,Hr),Yt.pixelStorei(3316,eo),Yt.pixelStorei(3315,Zr),Yt.pixelStorei(32877,Jr),Fn===0&&Dn.generateMipmaps&&Yt.generateMipmap(vr),wn.unbindTexture()},this.initTexture=function(un){un.isCubeTexture?vn.setTextureCube(un,0):un.isData3DTexture?vn.setTexture3D(un,0):un.isDataArrayTexture?vn.setTexture2DArray(un,0):vn.setTexture2D(un,0),wn.unbindTexture()},this.resetState=function(){bt=0,wt=0,xt=null,wn.reset(),kn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class WebGL1Renderer extends WebGLRenderer{}WebGL1Renderer.prototype.isWebGL1Renderer=!0;class FogExp2{constructor(et,nt=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color$1(et),this.density=nt}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Fog{constructor(et,nt=1,rt=1e3){this.isFog=!0,this.name="",this.color=new Color$1(et),this.near=nt,this.far=rt}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(et,nt){return super.copy(et,nt),et.background!==null&&(this.background=et.background.clone()),et.environment!==null&&(this.environment=et.environment.clone()),et.fog!==null&&(this.fog=et.fog.clone()),et.overrideMaterial!==null&&(this.overrideMaterial=et.overrideMaterial.clone()),this.autoUpdate=et.autoUpdate,this.matrixAutoUpdate=et.matrixAutoUpdate,this}toJSON(et){const nt=super.toJSON(et);return this.fog!==null&&(nt.object.fog=this.fog.toJSON()),nt}}class InterleavedBuffer{constructor(et,nt){this.isInterleavedBuffer=!0,this.array=et,this.stride=nt,this.count=et!==void 0?et.length/nt:0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID$1()}onUploadCallback(){}set needsUpdate(et){et===!0&&this.version++}setUsage(et){return this.usage=et,this}copy(et){return this.array=new et.array.constructor(et.array),this.count=et.count,this.stride=et.stride,this.usage=et.usage,this}copyAt(et,nt,rt){et*=this.stride,rt*=nt.stride;for(let it=0,ot=this.stride;itet.far||nt.push({distance:lt,point:_intersectPoint.clone(),uv:Triangle.getUV(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(et,nt){return super.copy(et,nt),et.center!==void 0&&this.center.copy(et.center),this.material=et.material,this}}function transformVertex(tt,et,nt,rt,it,ot){_alignedPosition.subVectors(tt,nt).addScalar(.5).multiply(rt),it!==void 0?(_rotatedPosition.x=ot*_alignedPosition.x-it*_alignedPosition.y,_rotatedPosition.y=it*_alignedPosition.x+ot*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),tt.copy(et),tt.x+=_rotatedPosition.x,tt.y+=_rotatedPosition.y,tt.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(et){super.copy(et,!1);const nt=et.levels;for(let rt=0,it=nt.length;rt0){let rt,it;for(rt=1,it=nt.length;rt0){_v1$2.setFromMatrixPosition(this.matrixWorld);const it=et.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(it).raycast(et,nt)}}update(et){const nt=this.levels;if(nt.length>1){_v1$2.setFromMatrixPosition(et.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const rt=_v1$2.distanceTo(_v2$1)/et.zoom;nt[0].object.visible=!0;let it,ot;for(it=1,ot=nt.length;it=nt[it].distance;it++)nt[it-1].object.visible=!1,nt[it].object.visible=!0;for(this._currentLevel=it-1;itlt)continue;dt.applyMatrix4(this.matrixWorld);const Et=et.ray.origin.distanceTo(dt);Etet.far||nt.push({distance:Et,point:ht.clone().applyMatrix4(this.matrixWorld),index:xt,face:null,faceIndex:null,object:this})}}else{const bt=Math.max(0,at.start),wt=Math.min(yt.count,at.start+at.count);for(let xt=bt,kt=wt-1;xtlt)continue;dt.applyMatrix4(this.matrixWorld);const Tt=et.ray.origin.distanceTo(dt);Ttet.far||nt.push({distance:Tt,point:ht.clone().applyMatrix4(this.matrixWorld),index:xt,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const nt=this.geometry.morphAttributes,rt=Object.keys(nt);if(rt.length>0){const it=nt[rt[0]];if(it!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=it.length;ot0){const it=nt[rt[0]];if(it!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=it.length;otit.far)return;ot.push({distance:ct,distanceToRay:Math.sqrt(st),point:lt,index:et,face:null,object:at})}}class VideoTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct){super(et,nt,rt,it,ot,at,st,lt,ct),this.isVideoTexture=!0,this.minFilter=at!==void 0?at:LinearFilter,this.magFilter=ot!==void 0?ot:LinearFilter,this.generateMipmaps=!1;const ut=this;function ht(){ut.needsUpdate=!0,et.requestVideoFrameCallback(ht)}"requestVideoFrameCallback"in et&&et.requestVideoFrameCallback(ht)}clone(){return new this.constructor(this.image).copy(this)}update(){const et=this.image;"requestVideoFrameCallback"in et===!1&&et.readyState>=et.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(et,nt,rt){super({width:et,height:nt}),this.isFramebufferTexture=!0,this.format=rt,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt){super(null,at,st,lt,ct,ut,it,ot,ht,dt),this.isCompressedTexture=!0,this.image={width:nt,height:rt},this.mipmaps=et,this.flipY=!1,this.generateMipmaps=!1}}class CanvasTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct){super(et,nt,rt,it,ot,at,st,lt,ct),this.isCanvasTexture=!0,this.needsUpdate=!0}}let Curve$1=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(et,nt){const rt=this.getUtoTmapping(et);return this.getPoint(rt,nt)}getPoints(et=5){const nt=[];for(let rt=0;rt<=et;rt++)nt.push(this.getPoint(rt/et));return nt}getSpacedPoints(et=5){const nt=[];for(let rt=0;rt<=et;rt++)nt.push(this.getPointAt(rt/et));return nt}getLength(){const et=this.getLengths();return et[et.length-1]}getLengths(et=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===et+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const nt=[];let rt,it=this.getPoint(0),ot=0;nt.push(0);for(let at=1;at<=et;at++)rt=this.getPoint(at/et),ot+=rt.distanceTo(it),nt.push(ot),it=rt;return this.cacheArcLengths=nt,nt}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(et,nt){const rt=this.getLengths();let it=0;const ot=rt.length;let at;nt?at=nt:at=et*rt[ot-1];let st=0,lt=ot-1,ct;for(;st<=lt;)if(it=Math.floor(st+(lt-st)/2),ct=rt[it]-at,ct<0)st=it+1;else if(ct>0)lt=it-1;else{lt=it;break}if(it=lt,rt[it]===at)return it/(ot-1);const ut=rt[it],dt=rt[it+1]-ut,pt=(at-ut)/dt;return(it+pt)/(ot-1)}getTangent(et,nt){let it=et-1e-4,ot=et+1e-4;it<0&&(it=0),ot>1&&(ot=1);const at=this.getPoint(it),st=this.getPoint(ot),lt=nt||(at.isVector2?new Vector2:new Vector3);return lt.copy(st).sub(at).normalize(),lt}getTangentAt(et,nt){const rt=this.getUtoTmapping(et);return this.getTangent(rt,nt)}computeFrenetFrames(et,nt){const rt=new Vector3,it=[],ot=[],at=[],st=new Vector3,lt=new Matrix4;for(let pt=0;pt<=et;pt++){const mt=pt/et;it[pt]=this.getTangentAt(mt,new Vector3)}ot[0]=new Vector3,at[0]=new Vector3;let ct=Number.MAX_VALUE;const ut=Math.abs(it[0].x),ht=Math.abs(it[0].y),dt=Math.abs(it[0].z);ut<=ct&&(ct=ut,rt.set(1,0,0)),ht<=ct&&(ct=ht,rt.set(0,1,0)),dt<=ct&&rt.set(0,0,1),st.crossVectors(it[0],rt).normalize(),ot[0].crossVectors(it[0],st),at[0].crossVectors(it[0],ot[0]);for(let pt=1;pt<=et;pt++){if(ot[pt]=ot[pt-1].clone(),at[pt]=at[pt-1].clone(),st.crossVectors(it[pt-1],it[pt]),st.length()>Number.EPSILON){st.normalize();const mt=Math.acos(clamp$6(it[pt-1].dot(it[pt]),-1,1));ot[pt].applyMatrix4(lt.makeRotationAxis(st,mt))}at[pt].crossVectors(it[pt],ot[pt])}if(nt===!0){let pt=Math.acos(clamp$6(ot[0].dot(ot[et]),-1,1));pt/=et,it[0].dot(st.crossVectors(ot[0],ot[et]))>0&&(pt=-pt);for(let mt=1;mt<=et;mt++)ot[mt].applyMatrix4(lt.makeRotationAxis(it[mt],pt*mt)),at[mt].crossVectors(it[mt],ot[mt])}return{tangents:it,normals:ot,binormals:at}}clone(){return new this.constructor().copy(this)}copy(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}toJSON(){const et={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return et.arcLengthDivisions=this.arcLengthDivisions,et.type=this.type,et}fromJSON(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}};class EllipseCurve extends Curve$1{constructor(et=0,nt=0,rt=1,it=1,ot=0,at=Math.PI*2,st=!1,lt=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=et,this.aY=nt,this.xRadius=rt,this.yRadius=it,this.aStartAngle=ot,this.aEndAngle=at,this.aClockwise=st,this.aRotation=lt}getPoint(et,nt){const rt=nt||new Vector2,it=Math.PI*2;let ot=this.aEndAngle-this.aStartAngle;const at=Math.abs(ot)it;)ot-=it;ot0?0:(Math.floor(Math.abs(st)/ot)+1)*ot:lt===0&&st===ot-1&&(st=ot-2,lt=1);let ct,ut;this.closed||st>0?ct=it[(st-1)%ot]:(tmp.subVectors(it[0],it[1]).add(it[0]),ct=tmp);const ht=it[st%ot],dt=it[(st+1)%ot];if(this.closed||st+2it.length-2?it.length-1:at+1],ht=it[at>it.length-3?it.length-1:at+2];return rt.set(CatmullRom(st,lt.x,ct.x,ut.x,ht.x),CatmullRom(st,lt.y,ct.y,ut.y,ht.y)),rt}copy(et){super.copy(et),this.points=[];for(let nt=0,rt=et.points.length;nt=rt){const at=it[ot]-rt,st=this.curves[ot],lt=st.getLength(),ct=lt===0?0:1-at/lt;return st.getPointAt(ct,nt)}ot++}return null}getLength(){const et=this.getCurveLengths();return et[et.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const et=[];let nt=0;for(let rt=0,it=this.curves.length;rt1&&!nt[nt.length-1].equals(nt[0])&&nt.push(nt[0]),nt}copy(et){super.copy(et),this.curves=[];for(let nt=0,rt=et.curves.length;nt0){const ht=ct.getPoint(0);ht.equals(this.currentPoint)||this.lineTo(ht.x,ht.y)}this.curves.push(ct);const ut=ct.getPoint(1);return this.currentPoint.copy(ut),this}copy(et){return super.copy(et),this.currentPoint.copy(et.currentPoint),this}toJSON(){const et=super.toJSON();return et.currentPoint=this.currentPoint.toArray(),et}fromJSON(et){return super.fromJSON(et),this.currentPoint.fromArray(et.currentPoint),this}};class LatheGeometry extends BufferGeometry{constructor(et=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],nt=12,rt=0,it=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:et,segments:nt,phiStart:rt,phiLength:it},nt=Math.floor(nt),it=clamp$6(it,0,Math.PI*2);const ot=[],at=[],st=[],lt=[],ct=[],ut=1/nt,ht=new Vector3,dt=new Vector2,pt=new Vector3,mt=new Vector3,gt=new Vector3;let yt=0,bt=0;for(let wt=0;wt<=et.length-1;wt++)switch(wt){case 0:yt=et[wt+1].x-et[wt].x,bt=et[wt+1].y-et[wt].y,pt.x=bt*1,pt.y=-yt,pt.z=bt*0,gt.copy(pt),pt.normalize(),lt.push(pt.x,pt.y,pt.z);break;case et.length-1:lt.push(gt.x,gt.y,gt.z);break;default:yt=et[wt+1].x-et[wt].x,bt=et[wt+1].y-et[wt].y,pt.x=bt*1,pt.y=-yt,pt.z=bt*0,mt.copy(pt),pt.x+=gt.x,pt.y+=gt.y,pt.z+=gt.z,pt.normalize(),lt.push(pt.x,pt.y,pt.z),gt.copy(mt)}for(let wt=0;wt<=nt;wt++){const xt=rt+wt*ut*it,kt=Math.sin(xt),St=Math.cos(xt);for(let Tt=0;Tt<=et.length-1;Tt++){ht.x=et[Tt].x*kt,ht.y=et[Tt].y,ht.z=et[Tt].x*St,at.push(ht.x,ht.y,ht.z),dt.x=wt/nt,dt.y=Tt/(et.length-1),st.push(dt.x,dt.y);const At=lt[3*Tt+0]*kt,Et=lt[3*Tt+1],Ct=lt[3*Tt+0]*St;ct.push(At,Et,Ct)}}for(let wt=0;wt0&&xt(!0),nt>0&&xt(!1)),this.setIndex(ut),this.setAttribute("position",new Float32BufferAttribute(ht,3)),this.setAttribute("normal",new Float32BufferAttribute(dt,3)),this.setAttribute("uv",new Float32BufferAttribute(pt,2));function wt(){const kt=new Vector3,St=new Vector3;let Tt=0;const At=(nt-et)/rt;for(let Et=0;Et<=ot;Et++){const Ct=[],Lt=Et/ot,jt=Lt*(nt-et)+et;for(let Rt=0;Rt<=it;Rt++){const $t=Rt/it,vt=$t*lt+st,It=Math.sin(vt),Ot=Math.cos(vt);St.x=jt*It,St.y=-Lt*rt+yt,St.z=jt*Ot,ht.push(St.x,St.y,St.z),kt.set(It,At,Ot).normalize(),dt.push(kt.x,kt.y,kt.z),pt.push($t,1-Lt),Ct.push(mt++)}gt.push(Ct)}for(let Et=0;Et.9&&At<.1&&(xt<.2&&(at[wt+0]+=1),kt<.2&&(at[wt+2]+=1),St<.2&&(at[wt+4]+=1))}}function dt(wt){ot.push(wt.x,wt.y,wt.z)}function pt(wt,xt){const kt=wt*3;xt.x=et[kt+0],xt.y=et[kt+1],xt.z=et[kt+2]}function mt(){const wt=new Vector3,xt=new Vector3,kt=new Vector3,St=new Vector3,Tt=new Vector2,At=new Vector2,Et=new Vector2;for(let Ct=0,Lt=0;Ct80*nt){st=ct=tt[0],lt=ut=tt[1];for(let mt=nt;mtct&&(ct=ht),dt>ut&&(ut=dt);pt=Math.max(ct-st,ut-lt),pt=pt!==0?1/pt:0}return earcutLinked(ot,at,nt,st,lt,pt),at}};function linkedList(tt,et,nt,rt,it){let ot,at;if(it===signedArea(tt,et,nt,rt)>0)for(ot=et;ot=et;ot-=rt)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);let nt=tt,rt;do if(rt=!1,!nt.steiner&&(equals(nt,nt.next)||area(nt.prev,nt,nt.next)===0)){if(removeNode(nt),nt=et=nt.prev,nt===nt.next)break;rt=!0}else nt=nt.next;while(rt||nt!==et);return et}function earcutLinked(tt,et,nt,rt,it,ot,at){if(!tt)return;!at&&ot&&indexCurve(tt,rt,it,ot);let st=tt,lt,ct;for(;tt.prev!==tt.next;){if(lt=tt.prev,ct=tt.next,ot?isEarHashed(tt,rt,it,ot):isEar(tt)){et.push(lt.i/nt),et.push(tt.i/nt),et.push(ct.i/nt),removeNode(tt),tt=ct.next,st=ct.next;continue}if(tt=ct,tt===st){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,nt),earcutLinked(tt,et,nt,rt,it,ot,2)):at===2&&splitEarcut(tt,et,nt,rt,it,ot):earcutLinked(filterPoints(tt),et,nt,rt,it,ot,1);break}}}function isEar(tt){const et=tt.prev,nt=tt,rt=tt.next;if(area(et,nt,rt)>=0)return!1;let it=tt.next.next;for(;it!==tt.prev;){if(pointInTriangle(et.x,et.y,nt.x,nt.y,rt.x,rt.y,it.x,it.y)&&area(it.prev,it,it.next)>=0)return!1;it=it.next}return!0}function isEarHashed(tt,et,nt,rt){const it=tt.prev,ot=tt,at=tt.next;if(area(it,ot,at)>=0)return!1;const st=it.xot.x?it.x>at.x?it.x:at.x:ot.x>at.x?ot.x:at.x,ut=it.y>ot.y?it.y>at.y?it.y:at.y:ot.y>at.y?ot.y:at.y,ht=zOrder(st,lt,et,nt,rt),dt=zOrder(ct,ut,et,nt,rt);let pt=tt.prevZ,mt=tt.nextZ;for(;pt&&pt.z>=ht&&mt&&mt.z<=dt;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0||(pt=pt.prevZ,mt!==tt.prev&&mt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0))return!1;mt=mt.nextZ}for(;pt&&pt.z>=ht;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0)return!1;pt=pt.prevZ}for(;mt&&mt.z<=dt;){if(mt!==tt.prev&&mt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0)return!1;mt=mt.nextZ}return!0}function cureLocalIntersections(tt,et,nt){let rt=tt;do{const it=rt.prev,ot=rt.next.next;!equals(it,ot)&&intersects(it,rt,rt.next,ot)&&locallyInside(it,ot)&&locallyInside(ot,it)&&(et.push(it.i/nt),et.push(rt.i/nt),et.push(ot.i/nt),removeNode(rt),removeNode(rt.next),rt=tt=ot),rt=rt.next}while(rt!==tt);return filterPoints(rt)}function splitEarcut(tt,et,nt,rt,it,ot){let at=tt;do{let st=at.next.next;for(;st!==at.prev;){if(at.i!==st.i&&isValidDiagonal(at,st)){let lt=splitPolygon(at,st);at=filterPoints(at,at.next),lt=filterPoints(lt,lt.next),earcutLinked(at,et,nt,rt,it,ot),earcutLinked(lt,et,nt,rt,it,ot);return}st=st.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,nt,rt){const it=[];let ot,at,st,lt,ct;for(ot=0,at=et.length;ot=nt.next.y&&nt.next.y!==nt.y){const dt=nt.x+(it-nt.y)*(nt.next.x-nt.x)/(nt.next.y-nt.y);if(dt<=rt&&dt>ot){if(ot=dt,dt===rt){if(it===nt.y)return nt;if(it===nt.next.y)return nt.next}at=nt.x=nt.x&&nt.x>=lt&&rt!==nt.x&&pointInTriangle(itat.x||nt.x===at.x&§orContainsSector(at,nt)))&&(at=nt,ut=ht)),nt=nt.next;while(nt!==st);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,nt,rt){let it=tt;do it.z===null&&(it.z=zOrder(it.x,it.y,et,nt,rt)),it.prevZ=it.prev,it.nextZ=it.next,it=it.next;while(it!==tt);it.prevZ.nextZ=null,it.prevZ=null,sortLinked(it)}function sortLinked(tt){let et,nt,rt,it,ot,at,st,lt,ct=1;do{for(nt=tt,tt=null,ot=null,at=0;nt;){for(at++,rt=nt,st=0,et=0;et0||lt>0&&rt;)st!==0&&(lt===0||!rt||nt.z<=rt.z)?(it=nt,nt=nt.nextZ,st--):(it=rt,rt=rt.nextZ,lt--),ot?ot.nextZ=it:tt=it,it.prevZ=ot,ot=it;nt=rt}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,nt,rt,it){return tt=32767*(tt-nt)*it,et=32767*(et-rt)*it,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){let et=tt,nt=tt;do(et.x=0&&(tt-at)*(rt-st)-(nt-at)*(et-st)>=0&&(nt-at)*(ot-st)-(it-at)*(rt-st)>=0}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,nt){return(et.y-tt.y)*(nt.x-et.x)-(et.x-tt.x)*(nt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,nt,rt){const it=sign$4(area(tt,et,nt)),ot=sign$4(area(tt,et,rt)),at=sign$4(area(nt,rt,tt)),st=sign$4(area(nt,rt,et));return!!(it!==ot&&at!==st||it===0&&onSegment(tt,nt,et)||ot===0&&onSegment(tt,rt,et)||at===0&&onSegment(nt,tt,rt)||st===0&&onSegment(nt,et,rt))}function onSegment(tt,et,nt){return et.x<=Math.max(tt.x,nt.x)&&et.x>=Math.min(tt.x,nt.x)&&et.y<=Math.max(tt.y,nt.y)&&et.y>=Math.min(tt.y,nt.y)}function sign$4(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){let nt=tt;do{if(nt.i!==tt.i&&nt.next.i!==tt.i&&nt.i!==et.i&&nt.next.i!==et.i&&intersects(nt,nt.next,tt,et))return!0;nt=nt.next}while(nt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){let nt=tt,rt=!1;const it=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do nt.y>ot!=nt.next.y>ot&&nt.next.y!==nt.y&&it<(nt.next.x-nt.x)*(ot-nt.y)/(nt.next.y-nt.y)+nt.x&&(rt=!rt),nt=nt.next;while(nt!==tt);return rt}function splitPolygon(tt,et){const nt=new Node$4(tt.i,tt.x,tt.y),rt=new Node$4(et.i,et.x,et.y),it=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,nt.next=it,it.prev=nt,rt.next=nt,nt.prev=rt,ot.next=rt,rt.prev=ot,rt}function insertNode(tt,et,nt,rt){const it=new Node$4(tt,et,nt);return rt?(it.next=rt.next,it.prev=rt,rt.next.prev=it,rt.next=it):(it.prev=it,it.next=it),it}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$4(tt,et,nt){this.i=tt,this.x=et,this.y=nt,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(tt,et,nt,rt){let it=0;for(let ot=et,at=nt-rt;ot2&&tt[et-1].equals(tt[0])&&tt.pop()}function addContour(tt,et){for(let nt=0;ntNumber.EPSILON){const fn=Math.sqrt(yn),xn=Math.sqrt(Tn*Tn+In*In),jn=vn.x-pn/fn,cn=vn.y+sn/fn,Xt=Cn.x-In/xn,Kt=Cn.y+Tn/xn,kn=((Xt-jn)*In-(Kt-cn)*Tn)/(sn*In-pn*Tn);$n=jn+sn*kn-Jt.x,Nn=cn+pn*kn-Jt.y;const Mn=$n*$n+Nn*Nn;if(Mn<=2)return new Vector2($n,Nn);En=Math.sqrt(Mn/2)}else{let fn=!1;sn>Number.EPSILON?Tn>Number.EPSILON&&(fn=!0):sn<-Number.EPSILON?Tn<-Number.EPSILON&&(fn=!0):Math.sign(pn)===Math.sign(In)&&(fn=!0),fn?($n=-pn,Nn=sn,En=Math.sqrt(yn)):($n=sn,Nn=pn,En=Math.sqrt(yn/2))}return new Vector2($n/En,Nn/En)}const Ft=[];for(let Jt=0,vn=vt.length,Cn=vn-1,$n=Jt+1;Jt=0;Jt--){const vn=Jt/yt,Cn=pt*Math.cos(vn*Math.PI/2),$n=mt*Math.sin(vn*Math.PI/2)+gt;for(let Nn=0,En=vt.length;Nn=0;){const $n=Cn;let Nn=Cn-1;Nn<0&&(Nn=Jt.length-1);for(let En=0,sn=ut+yt*2;En0)&&pt.push(xt,kt,Tt),(bt!==rt-1||lt0!=et>0&&this.version++,this._sheen=et}get clearcoat(){return this._clearcoat}set clearcoat(et){this._clearcoat>0!=et>0&&this.version++,this._clearcoat=et}get iridescence(){return this._iridescence}set iridescence(et){this._iridescence>0!=et>0&&this.version++,this._iridescence=et}get transmission(){return this._transmission}set transmission(et){this._transmission>0!=et>0&&this.version++,this._transmission=et}copy(et){return super.copy(et),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=et.clearcoat,this.clearcoatMap=et.clearcoatMap,this.clearcoatRoughness=et.clearcoatRoughness,this.clearcoatRoughnessMap=et.clearcoatRoughnessMap,this.clearcoatNormalMap=et.clearcoatNormalMap,this.clearcoatNormalScale.copy(et.clearcoatNormalScale),this.ior=et.ior,this.iridescence=et.iridescence,this.iridescenceMap=et.iridescenceMap,this.iridescenceIOR=et.iridescenceIOR,this.iridescenceThicknessRange=[...et.iridescenceThicknessRange],this.iridescenceThicknessMap=et.iridescenceThicknessMap,this.sheen=et.sheen,this.sheenColor.copy(et.sheenColor),this.sheenColorMap=et.sheenColorMap,this.sheenRoughness=et.sheenRoughness,this.sheenRoughnessMap=et.sheenRoughnessMap,this.transmission=et.transmission,this.transmissionMap=et.transmissionMap,this.thickness=et.thickness,this.thicknessMap=et.thicknessMap,this.attenuationDistance=et.attenuationDistance,this.attenuationColor.copy(et.attenuationColor),this.specularIntensity=et.specularIntensity,this.specularIntensityMap=et.specularIntensityMap,this.specularColor.copy(et.specularColor),this.specularColorMap=et.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(et){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color$1(16777215),this.specular=new Color$1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.specular.copy(et.specular),this.shininess=et.shininess,this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.flatShading=et.flatShading,this.fog=et.fog,this}}class MeshToonMaterial extends Material{constructor(et){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color$1(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.gradientMap=et.gradientMap,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshNormalMaterial extends Material{constructor(et){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(et)}copy(et){return super.copy(et),this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.flatShading=et.flatShading,this}}class MeshLambertMaterial extends Material{constructor(et){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshMatcapMaterial extends Material{constructor(et){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color$1(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.defines={MATCAP:""},this.color.copy(et.color),this.matcap=et.matcap,this.map=et.map,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.flatShading=et.flatShading,this.fog=et.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(et){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(et)}copy(et){return super.copy(et),this.scale=et.scale,this.dashSize=et.dashSize,this.gapSize=et.gapSize,this}}function arraySlice(tt,et,nt){return isTypedArray$5(tt)?new tt.constructor(tt.subarray(et,nt!==void 0?nt:tt.length)):tt.slice(et,nt)}function convertArray(tt,et,nt){return!tt||!nt&&tt.constructor===et?tt:typeof et.BYTES_PER_ELEMENT=="number"?new et(tt):Array.prototype.slice.call(tt)}function isTypedArray$5(tt){return ArrayBuffer.isView(tt)&&!(tt instanceof DataView)}function getKeyframeOrder(tt){function et(it,ot){return tt[it]-tt[ot]}const nt=tt.length,rt=new Array(nt);for(let it=0;it!==nt;++it)rt[it]=it;return rt.sort(et),rt}function sortedArray(tt,et,nt){const rt=tt.length,it=new tt.constructor(rt);for(let ot=0,at=0;at!==rt;++ot){const st=nt[ot]*et;for(let lt=0;lt!==et;++lt)it[at++]=tt[st+lt]}return it}function flattenJSON(tt,et,nt,rt){let it=1,ot=tt[0];for(;ot!==void 0&&ot[rt]===void 0;)ot=tt[it++];if(ot===void 0)return;let at=ot[rt];if(at!==void 0)if(Array.isArray(at))do at=ot[rt],at!==void 0&&(et.push(ot.time),nt.push.apply(nt,at)),ot=tt[it++];while(ot!==void 0);else if(at.toArray!==void 0)do at=ot[rt],at!==void 0&&(et.push(ot.time),at.toArray(nt,nt.length)),ot=tt[it++];while(ot!==void 0);else do at=ot[rt],at!==void 0&&(et.push(ot.time),nt.push(at)),ot=tt[it++];while(ot!==void 0)}function subclip(tt,et,nt,rt,it=30){const ot=tt.clone();ot.name=et;const at=[];for(let lt=0;lt=rt)){ht.push(ct.times[pt]);for(let gt=0;gtot.tracks[lt].times[0]&&(st=ot.tracks[lt].times[0]);for(let lt=0;lt=st.times[mt]){const bt=mt*ht+ut,wt=bt+ht-ut;gt=arraySlice(st.values,bt,wt)}else{const bt=st.createInterpolant(),wt=ut,xt=ht-ut;bt.evaluate(ot),gt=arraySlice(bt.resultBuffer,wt,xt)}lt==="quaternion"&&new Quaternion().fromArray(gt).normalize().conjugate().toArray(gt);const yt=ct.times.length;for(let bt=0;bt=ot)){const st=nt[1];et=ot)break t}at=rt,rt=0;break n}break e}for(;rt>>1;etnt;)--at;if(++at,ot!==0||at!==it){ot>=at&&(at=Math.max(at,1),ot=at-1);const st=this.getValueSize();this.times=arraySlice(rt,ot,at),this.values=arraySlice(this.values,ot*st,at*st)}return this}validate(){let et=!0;const nt=this.getValueSize();nt-Math.floor(nt)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),et=!1);const rt=this.times,it=this.values,ot=rt.length;ot===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),et=!1);let at=null;for(let st=0;st!==ot;st++){const lt=rt[st];if(typeof lt=="number"&&isNaN(lt)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,st,lt),et=!1;break}if(at!==null&&at>lt){console.error("THREE.KeyframeTrack: Out of order keys.",this,st,lt,at),et=!1;break}at=lt}if(it!==void 0&&isTypedArray$5(it))for(let st=0,lt=it.length;st!==lt;++st){const ct=it[st];if(isNaN(ct)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,st,ct),et=!1;break}}return et}optimize(){const et=arraySlice(this.times),nt=arraySlice(this.values),rt=this.getValueSize(),it=this.getInterpolation()===InterpolateSmooth,ot=et.length-1;let at=1;for(let st=1;st0){et[at]=et[ot];for(let st=ot*rt,lt=at*rt,ct=0;ct!==rt;++ct)nt[lt+ct]=nt[st+ct];++at}return at!==et.length?(this.times=arraySlice(et,0,at),this.values=arraySlice(nt,0,at*rt)):(this.times=et,this.values=nt),this}clone(){const et=arraySlice(this.times,0),nt=arraySlice(this.values,0),rt=this.constructor,it=new rt(this.name,et,nt);return it.createInterpolant=this.createInterpolant,it}}KeyframeTrack.prototype.TimeBufferType=Float32Array;KeyframeTrack.prototype.ValueBufferType=Float32Array;KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool";BooleanKeyframeTrack.prototype.ValueBufferType=Array;BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(et,nt,rt,it){super(et,nt,rt,it)}interpolate_(et,nt,rt,it){const ot=this.resultBuffer,at=this.sampleValues,st=this.valueSize,lt=(rt-nt)/(it-nt);let ct=et*st;for(let ut=ct+st;ct!==ut;ct+=4)Quaternion.slerpFlat(ot,0,at,ct-st,at,ct,lt);return ot}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(et){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),et)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion";QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string";StringKeyframeTrack.prototype.ValueBufferType=Array;StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(et,nt=-1,rt,it=NormalAnimationBlendMode){this.name=et,this.tracks=rt,this.duration=nt,this.blendMode=it,this.uuid=generateUUID$1(),this.duration<0&&this.resetDuration()}static parse(et){const nt=[],rt=et.tracks,it=1/(et.fps||1);for(let at=0,st=rt.length;at!==st;++at)nt.push(parseKeyframeTrack(rt[at]).scale(it));const ot=new this(et.name,et.duration,nt,et.blendMode);return ot.uuid=et.uuid,ot}static toJSON(et){const nt=[],rt=et.tracks,it={name:et.name,duration:et.duration,tracks:nt,uuid:et.uuid,blendMode:et.blendMode};for(let ot=0,at=rt.length;ot!==at;++ot)nt.push(KeyframeTrack.toJSON(rt[ot]));return it}static CreateFromMorphTargetSequence(et,nt,rt,it){const ot=nt.length,at=[];for(let st=0;st1){const ht=ut[1];let dt=it[ht];dt||(it[ht]=dt=[]),dt.push(ct)}}const at=[];for(const st in it)at.push(this.CreateFromMorphTargetSequence(st,it[st],nt,rt));return at}static parseAnimation(et,nt){if(!et)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const rt=function(ht,dt,pt,mt,gt){if(pt.length!==0){const yt=[],bt=[];flattenJSON(pt,yt,bt,mt),yt.length!==0&>.push(new ht(dt,yt,bt))}},it=[],ot=et.name||"default",at=et.fps||30,st=et.blendMode;let lt=et.length||-1;const ct=et.hierarchy||[];for(let ht=0;ht{nt&&nt(ot),this.manager.itemEnd(et)},0),ot;if(loading[et]!==void 0){loading[et].push({onLoad:nt,onProgress:rt,onError:it});return}loading[et]=[],loading[et].push({onLoad:nt,onProgress:rt,onError:it});const at=new Request(et,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),st=this.mimeType,lt=this.responseType;fetch(at).then(ct=>{if(ct.status===200||ct.status===0){if(ct.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||ct.body===void 0||ct.body.getReader===void 0)return ct;const ut=loading[et],ht=ct.body.getReader(),dt=ct.headers.get("Content-Length"),pt=dt?parseInt(dt):0,mt=pt!==0;let gt=0;const yt=new ReadableStream({start(bt){wt();function wt(){ht.read().then(({done:xt,value:kt})=>{if(xt)bt.close();else{gt+=kt.byteLength;const St=new ProgressEvent("progress",{lengthComputable:mt,loaded:gt,total:pt});for(let Tt=0,At=ut.length;Tt{switch(lt){case"arraybuffer":return ct.arrayBuffer();case"blob":return ct.blob();case"document":return ct.text().then(ut=>new DOMParser().parseFromString(ut,st));case"json":return ct.json();default:if(st===void 0)return ct.text();{const ht=/charset="?([^;"\s]*)"?/i.exec(st),dt=ht&&ht[1]?ht[1].toLowerCase():void 0,pt=new TextDecoder(dt);return ct.arrayBuffer().then(mt=>pt.decode(mt))}}}).then(ct=>{Cache.add(et,ct);const ut=loading[et];delete loading[et];for(let ht=0,dt=ut.length;ht{const ut=loading[et];if(ut===void 0)throw this.manager.itemError(et),ct;delete loading[et];for(let ht=0,dt=ut.length;ht{this.manager.itemEnd(et)}),this.manager.itemStart(et)}setResponseType(et){return this.responseType=et,this}setMimeType(et){return this.mimeType=et,this}}class AnimationLoader extends Loader$2{constructor(et){super(et)}load(et,nt,rt,it){const ot=this,at=new FileLoader(this.manager);at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{nt(ot.parse(JSON.parse(st)))}catch(lt){it?it(lt):console.error(lt),ot.manager.itemError(et)}},rt,it)}parse(et){const nt=[];for(let rt=0;rt0:it.vertexColors=et.vertexColors),et.uniforms!==void 0)for(const ot in et.uniforms){const at=et.uniforms[ot];switch(it.uniforms[ot]={},at.type){case"t":it.uniforms[ot].value=rt(at.value);break;case"c":it.uniforms[ot].value=new Color$1().setHex(at.value);break;case"v2":it.uniforms[ot].value=new Vector2().fromArray(at.value);break;case"v3":it.uniforms[ot].value=new Vector3().fromArray(at.value);break;case"v4":it.uniforms[ot].value=new Vector4().fromArray(at.value);break;case"m3":it.uniforms[ot].value=new Matrix3().fromArray(at.value);break;case"m4":it.uniforms[ot].value=new Matrix4().fromArray(at.value);break;default:it.uniforms[ot].value=at.value}}if(et.defines!==void 0&&(it.defines=et.defines),et.vertexShader!==void 0&&(it.vertexShader=et.vertexShader),et.fragmentShader!==void 0&&(it.fragmentShader=et.fragmentShader),et.extensions!==void 0)for(const ot in et.extensions)it.extensions[ot]=et.extensions[ot];if(et.shading!==void 0&&(it.flatShading=et.shading===1),et.size!==void 0&&(it.size=et.size),et.sizeAttenuation!==void 0&&(it.sizeAttenuation=et.sizeAttenuation),et.map!==void 0&&(it.map=rt(et.map)),et.matcap!==void 0&&(it.matcap=rt(et.matcap)),et.alphaMap!==void 0&&(it.alphaMap=rt(et.alphaMap)),et.bumpMap!==void 0&&(it.bumpMap=rt(et.bumpMap)),et.bumpScale!==void 0&&(it.bumpScale=et.bumpScale),et.normalMap!==void 0&&(it.normalMap=rt(et.normalMap)),et.normalMapType!==void 0&&(it.normalMapType=et.normalMapType),et.normalScale!==void 0){let ot=et.normalScale;Array.isArray(ot)===!1&&(ot=[ot,ot]),it.normalScale=new Vector2().fromArray(ot)}return et.displacementMap!==void 0&&(it.displacementMap=rt(et.displacementMap)),et.displacementScale!==void 0&&(it.displacementScale=et.displacementScale),et.displacementBias!==void 0&&(it.displacementBias=et.displacementBias),et.roughnessMap!==void 0&&(it.roughnessMap=rt(et.roughnessMap)),et.metalnessMap!==void 0&&(it.metalnessMap=rt(et.metalnessMap)),et.emissiveMap!==void 0&&(it.emissiveMap=rt(et.emissiveMap)),et.emissiveIntensity!==void 0&&(it.emissiveIntensity=et.emissiveIntensity),et.specularMap!==void 0&&(it.specularMap=rt(et.specularMap)),et.specularIntensityMap!==void 0&&(it.specularIntensityMap=rt(et.specularIntensityMap)),et.specularColorMap!==void 0&&(it.specularColorMap=rt(et.specularColorMap)),et.envMap!==void 0&&(it.envMap=rt(et.envMap)),et.envMapIntensity!==void 0&&(it.envMapIntensity=et.envMapIntensity),et.reflectivity!==void 0&&(it.reflectivity=et.reflectivity),et.refractionRatio!==void 0&&(it.refractionRatio=et.refractionRatio),et.lightMap!==void 0&&(it.lightMap=rt(et.lightMap)),et.lightMapIntensity!==void 0&&(it.lightMapIntensity=et.lightMapIntensity),et.aoMap!==void 0&&(it.aoMap=rt(et.aoMap)),et.aoMapIntensity!==void 0&&(it.aoMapIntensity=et.aoMapIntensity),et.gradientMap!==void 0&&(it.gradientMap=rt(et.gradientMap)),et.clearcoatMap!==void 0&&(it.clearcoatMap=rt(et.clearcoatMap)),et.clearcoatRoughnessMap!==void 0&&(it.clearcoatRoughnessMap=rt(et.clearcoatRoughnessMap)),et.clearcoatNormalMap!==void 0&&(it.clearcoatNormalMap=rt(et.clearcoatNormalMap)),et.clearcoatNormalScale!==void 0&&(it.clearcoatNormalScale=new Vector2().fromArray(et.clearcoatNormalScale)),et.iridescenceMap!==void 0&&(it.iridescenceMap=rt(et.iridescenceMap)),et.iridescenceThicknessMap!==void 0&&(it.iridescenceThicknessMap=rt(et.iridescenceThicknessMap)),et.transmissionMap!==void 0&&(it.transmissionMap=rt(et.transmissionMap)),et.thicknessMap!==void 0&&(it.thicknessMap=rt(et.thicknessMap)),et.sheenColorMap!==void 0&&(it.sheenColorMap=rt(et.sheenColorMap)),et.sheenRoughnessMap!==void 0&&(it.sheenRoughnessMap=rt(et.sheenRoughnessMap)),it}setTextures(et){return this.textures=et,this}static createMaterialFromType(et){const nt={ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material};return new nt[et]}}class LoaderUtils{static decodeText(et){if(typeof TextDecoder<"u")return new TextDecoder().decode(et);let nt="";for(let rt=0,it=et.length;rt0){const lt=new LoadingManager(nt);ot=new ImageLoader(lt),ot.setCrossOrigin(this.crossOrigin);for(let ct=0,ut=et.length;ct0){it=new ImageLoader(this.manager),it.setCrossOrigin(this.crossOrigin);for(let at=0,st=et.length;at"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(et){return this.options=et,this}load(et,nt,rt,it){et===void 0&&(et=""),this.path!==void 0&&(et=this.path+et),et=this.manager.resolveURL(et);const ot=this,at=Cache.get(et);if(at!==void 0)return ot.manager.itemStart(et),setTimeout(function(){nt&&nt(at),ot.manager.itemEnd(et)},0),at;const st={};st.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",st.headers=this.requestHeader,fetch(et,st).then(function(lt){return lt.blob()}).then(function(lt){return createImageBitmap(lt,Object.assign(ot.options,{colorSpaceConversion:"none"}))}).then(function(lt){Cache.add(et,lt),nt&&nt(lt),ot.manager.itemEnd(et)}).catch(function(lt){it&&it(lt),ot.manager.itemError(et),ot.manager.itemEnd(et)}),ot.manager.itemStart(et)}}let _context$1;const AudioContext={getContext:function(){return _context$1===void 0&&(_context$1=new(window.AudioContext||window.webkitAudioContext)),_context$1},setContext:function(tt){_context$1=tt}};class AudioLoader extends Loader$2{constructor(et){super(et)}load(et,nt,rt,it){const ot=this,at=new FileLoader(this.manager);at.setResponseType("arraybuffer"),at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{const lt=st.slice(0);AudioContext.getContext().decodeAudioData(lt,function(ut){nt(ut)})}catch(lt){it?it(lt):console.error(lt),ot.manager.itemError(et)}},rt,it)}}class HemisphereLightProbe extends LightProbe{constructor(et,nt,rt=1){super(void 0,rt),this.isHemisphereLightProbe=!0;const it=new Color$1().set(et),ot=new Color$1().set(nt),at=new Vector3(it.r,it.g,it.b),st=new Vector3(ot.r,ot.g,ot.b),lt=Math.sqrt(Math.PI),ct=lt*Math.sqrt(.75);this.sh.coefficients[0].copy(at).add(st).multiplyScalar(lt),this.sh.coefficients[1].copy(at).sub(st).multiplyScalar(ct)}}class AmbientLightProbe extends LightProbe{constructor(et,nt=1){super(void 0,nt),this.isAmbientLightProbe=!0;const rt=new Color$1().set(et);this.sh.coefficients[0].set(rt.r,rt.g,rt.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const _eyeRight=new Matrix4,_eyeLeft=new Matrix4,_projectionMatrix=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(et){const nt=this._cache;if(nt.focus!==et.focus||nt.fov!==et.fov||nt.aspect!==et.aspect*this.aspect||nt.near!==et.near||nt.far!==et.far||nt.zoom!==et.zoom||nt.eyeSep!==this.eyeSep){nt.focus=et.focus,nt.fov=et.fov,nt.aspect=et.aspect*this.aspect,nt.near=et.near,nt.far=et.far,nt.zoom=et.zoom,nt.eyeSep=this.eyeSep,_projectionMatrix.copy(et.projectionMatrix);const it=nt.eyeSep/2,ot=it*nt.near/nt.focus,at=nt.near*Math.tan(DEG2RAD$1*nt.fov*.5)/nt.zoom;let st,lt;_eyeLeft.elements[12]=-it,_eyeRight.elements[12]=it,st=-at*nt.aspect+ot,lt=at*nt.aspect+ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraL.projectionMatrix.copy(_projectionMatrix),st=-at*nt.aspect-ot,lt=at*nt.aspect-ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraR.projectionMatrix.copy(_projectionMatrix)}this.cameraL.matrixWorld.copy(et.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(et.matrixWorld).multiply(_eyeRight)}}let Clock$1=class{constructor(et=!0){this.autoStart=et,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now$5(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let et=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const nt=now$5();et=(nt-this.oldTime)/1e3,this.oldTime=nt,this.elapsedTime+=et}return et}};function now$5(){return(typeof performance>"u"?Date:performance).now()}const _position$1=new Vector3,_quaternion$1=new Quaternion,_scale$1=new Vector3,_orientation$1=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock$1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(et){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=et,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(et){return this.gain.gain.setTargetAtTime(et,this.context.currentTime,.01),this}updateMatrixWorld(et){super.updateMatrixWorld(et);const nt=this.context.listener,rt=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1),_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1),nt.positionX){const it=this.context.currentTime+this.timeDelta;nt.positionX.linearRampToValueAtTime(_position$1.x,it),nt.positionY.linearRampToValueAtTime(_position$1.y,it),nt.positionZ.linearRampToValueAtTime(_position$1.z,it),nt.forwardX.linearRampToValueAtTime(_orientation$1.x,it),nt.forwardY.linearRampToValueAtTime(_orientation$1.y,it),nt.forwardZ.linearRampToValueAtTime(_orientation$1.z,it),nt.upX.linearRampToValueAtTime(rt.x,it),nt.upY.linearRampToValueAtTime(rt.y,it),nt.upZ.linearRampToValueAtTime(rt.z,it)}else nt.setPosition(_position$1.x,_position$1.y,_position$1.z),nt.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,rt.x,rt.y,rt.z)}}let Audio$1=class extends Object3D{constructor(et){super(),this.type="Audio",this.listener=et,this.context=et.context,this.gain=this.context.createGain(),this.gain.connect(et.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(et){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=et,this.connect(),this}setMediaElementSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(et),this.connect(),this}setMediaStreamSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(et),this.connect(),this}setBuffer(et){return this.buffer=et,this.sourceType="buffer",this.autoplay&&this.play(),this}play(et=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+et;const nt=this.context.createBufferSource();return nt.buffer=this.buffer,nt.loop=this.loop,nt.loopStart=this.loopStart,nt.loopEnd=this.loopEnd,nt.onended=this.onEnded.bind(this),nt.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=nt,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let et=1,nt=this.filters.length;et0){this.source.disconnect(this.filters[0]);for(let et=1,nt=this.filters.length;et0&&this._mixBufferRegionAdditive(rt,it,this._addIndex*nt,1,nt);for(let lt=nt,ct=nt+nt;lt!==ct;++lt)if(rt[lt]!==rt[lt+nt]){st.setValue(rt,it);break}}saveOriginalState(){const et=this.binding,nt=this.buffer,rt=this.valueSize,it=rt*this._origIndex;et.getValue(nt,it);for(let ot=rt,at=it;ot!==at;++ot)nt[ot]=nt[it+ot%rt];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const et=this.valueSize*3;this.binding.setValue(this.buffer,et)}_setAdditiveIdentityNumeric(){const et=this._addIndex*this.valueSize,nt=et+this.valueSize;for(let rt=et;rt=.5)for(let at=0;at!==ot;++at)et[nt+at]=et[rt+at]}_slerp(et,nt,rt,it){Quaternion.slerpFlat(et,nt,et,nt,et,rt,it)}_slerpAdditive(et,nt,rt,it,ot){const at=this._workIndex*ot;Quaternion.multiplyQuaternionsFlat(et,at,et,nt,et,rt),Quaternion.slerpFlat(et,nt,et,nt,et,at,it)}_lerp(et,nt,rt,it,ot){const at=1-it;for(let st=0;st!==ot;++st){const lt=nt+st;et[lt]=et[lt]*at+et[rt+st]*it}}_lerpAdditive(et,nt,rt,it,ot){for(let at=0;at!==ot;++at){const st=nt+at;et[st]=et[st]+et[rt+at]*it}}}const _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones"];class Composite{constructor(et,nt,rt){const it=rt||PropertyBinding.parseTrackName(nt);this._targetGroup=et,this._bindings=et.subscribe_(nt,it)}getValue(et,nt){this.bind();const rt=this._targetGroup.nCachedObjects_,it=this._bindings[rt];it!==void 0&&it.getValue(et,nt)}setValue(et,nt){const rt=this._bindings;for(let it=this._targetGroup.nCachedObjects_,ot=rt.length;it!==ot;++it)rt[it].setValue(et,nt)}bind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,rt=et.length;nt!==rt;++nt)et[nt].bind()}unbind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,rt=et.length;nt!==rt;++nt)et[nt].unbind()}}class PropertyBinding{constructor(et,nt,rt){this.path=nt,this.parsedPath=rt||PropertyBinding.parseTrackName(nt),this.node=PropertyBinding.findNode(et,this.parsedPath.nodeName)||et,this.rootNode=et,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(et,nt,rt){return et&&et.isAnimationObjectGroup?new PropertyBinding.Composite(et,nt,rt):new PropertyBinding(et,nt,rt)}static sanitizeNodeName(et){return et.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(et){const nt=_trackRe.exec(et);if(nt===null)throw new Error("PropertyBinding: Cannot parse trackName: "+et);const rt={nodeName:nt[2],objectName:nt[3],objectIndex:nt[4],propertyName:nt[5],propertyIndex:nt[6]},it=rt.nodeName&&rt.nodeName.lastIndexOf(".");if(it!==void 0&&it!==-1){const ot=rt.nodeName.substring(it+1);_supportedObjectNames.indexOf(ot)!==-1&&(rt.nodeName=rt.nodeName.substring(0,it),rt.objectName=ot)}if(rt.propertyName===null||rt.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+et);return rt}static findNode(et,nt){if(nt===void 0||nt===""||nt==="."||nt===-1||nt===et.name||nt===et.uuid)return et;if(et.skeleton){const rt=et.skeleton.getBoneByName(nt);if(rt!==void 0)return rt}if(et.children){const rt=function(ot){for(let at=0;at=ot){const ht=ot++,dt=et[ht];nt[dt.uuid]=ut,et[ut]=dt,nt[ct]=ht,et[ht]=lt;for(let pt=0,mt=it;pt!==mt;++pt){const gt=rt[pt],yt=gt[ht],bt=gt[ut];gt[ut]=yt,gt[ht]=bt}}}this.nCachedObjects_=ot}uncache(){const et=this._objects,nt=this._indicesByUUID,rt=this._bindings,it=rt.length;let ot=this.nCachedObjects_,at=et.length;for(let st=0,lt=arguments.length;st!==lt;++st){const ct=arguments[st],ut=ct.uuid,ht=nt[ut];if(ht!==void 0)if(delete nt[ut],ht0&&(nt[pt.uuid]=ht),et[ht]=pt,et.pop();for(let mt=0,gt=it;mt!==gt;++mt){const yt=rt[mt];yt[ht]=yt[dt],yt.pop()}}}this.nCachedObjects_=ot}subscribe_(et,nt){const rt=this._bindingsIndicesByPath;let it=rt[et];const ot=this._bindings;if(it!==void 0)return ot[it];const at=this._paths,st=this._parsedPaths,lt=this._objects,ct=lt.length,ut=this.nCachedObjects_,ht=new Array(ct);it=ot.length,rt[et]=it,at.push(et),st.push(nt),ot.push(ht);for(let dt=ut,pt=lt.length;dt!==pt;++dt){const mt=lt[dt];ht[dt]=new PropertyBinding(mt,et,nt)}return ht}unsubscribe_(et){const nt=this._bindingsIndicesByPath,rt=nt[et];if(rt!==void 0){const it=this._paths,ot=this._parsedPaths,at=this._bindings,st=at.length-1,lt=at[st],ct=et[st];nt[ct]=rt,at[rt]=lt,at.pop(),ot[rt]=ot[st],ot.pop(),it[rt]=it[st],it.pop()}}}class AnimationAction{constructor(et,nt,rt=null,it=nt.blendMode){this._mixer=et,this._clip=nt,this._localRoot=rt,this.blendMode=it;const ot=nt.tracks,at=ot.length,st=new Array(at),lt={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let ct=0;ct!==at;++ct){const ut=ot[ct].createInterpolant(null);st[ct]=ut,ut.settings=lt}this._interpolantSettings=lt,this._interpolants=st,this._propertyBindings=new Array(at),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(et){return this._startTime=et,this}setLoop(et,nt){return this.loop=et,this.repetitions=nt,this}setEffectiveWeight(et){return this.weight=et,this._effectiveWeight=this.enabled?et:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(et){return this._scheduleFading(et,0,1)}fadeOut(et){return this._scheduleFading(et,1,0)}crossFadeFrom(et,nt,rt){if(et.fadeOut(nt),this.fadeIn(nt),rt){const it=this._clip.duration,ot=et._clip.duration,at=ot/it,st=it/ot;et.warp(1,at,nt),this.warp(st,1,nt)}return this}crossFadeTo(et,nt,rt){return et.crossFadeFrom(this,nt,rt)}stopFading(){const et=this._weightInterpolant;return et!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}setEffectiveTimeScale(et){return this.timeScale=et,this._effectiveTimeScale=this.paused?0:et,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(et){return this.timeScale=this._clip.duration/et,this.stopWarping()}syncWith(et){return this.time=et.time,this.timeScale=et.timeScale,this.stopWarping()}halt(et){return this.warp(this._effectiveTimeScale,0,et)}warp(et,nt,rt){const it=this._mixer,ot=it.time,at=this.timeScale;let st=this._timeScaleInterpolant;st===null&&(st=it._lendControlInterpolant(),this._timeScaleInterpolant=st);const lt=st.parameterPositions,ct=st.sampleValues;return lt[0]=ot,lt[1]=ot+rt,ct[0]=et/at,ct[1]=nt/at,this}stopWarping(){const et=this._timeScaleInterpolant;return et!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(et,nt,rt,it){if(!this.enabled){this._updateWeight(et);return}const ot=this._startTime;if(ot!==null){const lt=(et-ot)*rt;if(lt<0||rt===0)return;this._startTime=null,nt=rt*lt}nt*=this._updateTimeScale(et);const at=this._updateTime(nt),st=this._updateWeight(et);if(st>0){const lt=this._interpolants,ct=this._propertyBindings;switch(this.blendMode){case AdditiveAnimationBlendMode:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulateAdditive(st);break;case NormalAnimationBlendMode:default:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulate(it,st)}}}_updateWeight(et){let nt=0;if(this.enabled){nt=this.weight;const rt=this._weightInterpolant;if(rt!==null){const it=rt.evaluate(et)[0];nt*=it,et>rt.parameterPositions[1]&&(this.stopFading(),it===0&&(this.enabled=!1))}}return this._effectiveWeight=nt,nt}_updateTimeScale(et){let nt=0;if(!this.paused){nt=this.timeScale;const rt=this._timeScaleInterpolant;if(rt!==null){const it=rt.evaluate(et)[0];nt*=it,et>rt.parameterPositions[1]&&(this.stopWarping(),nt===0?this.paused=!0:this.timeScale=nt)}}return this._effectiveTimeScale=nt,nt}_updateTime(et){const nt=this._clip.duration,rt=this.loop;let it=this.time+et,ot=this._loopCount;const at=rt===LoopPingPong;if(et===0)return ot===-1?it:at&&(ot&1)===1?nt-it:it;if(rt===LoopOnce){ot===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(it>=nt)it=nt;else if(it<0)it=0;else{this.time=it;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=it,this._mixer.dispatchEvent({type:"finished",action:this,direction:et<0?-1:1})}}else{if(ot===-1&&(et>=0?(ot=0,this._setEndings(!0,this.repetitions===0,at)):this._setEndings(this.repetitions===0,!0,at)),it>=nt||it<0){const st=Math.floor(it/nt);it-=nt*st,ot+=Math.abs(st);const lt=this.repetitions-ot;if(lt<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,it=et>0?nt:0,this.time=it,this._mixer.dispatchEvent({type:"finished",action:this,direction:et>0?1:-1});else{if(lt===1){const ct=et<0;this._setEndings(ct,!ct,at)}else this._setEndings(!1,!1,at);this._loopCount=ot,this.time=it,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:st})}}else this.time=it;if(at&&(ot&1)===1)return nt-it}return it}_setEndings(et,nt,rt){const it=this._interpolantSettings;rt?(it.endingStart=ZeroSlopeEnding,it.endingEnd=ZeroSlopeEnding):(et?it.endingStart=this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:it.endingStart=WrapAroundEnding,nt?it.endingEnd=this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:it.endingEnd=WrapAroundEnding)}_scheduleFading(et,nt,rt){const it=this._mixer,ot=it.time;let at=this._weightInterpolant;at===null&&(at=it._lendControlInterpolant(),this._weightInterpolant=at);const st=at.parameterPositions,lt=at.sampleValues;return st[0]=ot,lt[0]=nt,st[1]=ot+et,lt[1]=rt,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher$1{constructor(et){super(),this._root=et,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(et,nt){const rt=et._localRoot||this._root,it=et._clip.tracks,ot=it.length,at=et._propertyBindings,st=et._interpolants,lt=rt.uuid,ct=this._bindingsByRootAndName;let ut=ct[lt];ut===void 0&&(ut={},ct[lt]=ut);for(let ht=0;ht!==ot;++ht){const dt=it[ht],pt=dt.name;let mt=ut[pt];if(mt!==void 0)++mt.referenceCount,at[ht]=mt;else{if(mt=at[ht],mt!==void 0){mt._cacheIndex===null&&(++mt.referenceCount,this._addInactiveBinding(mt,lt,pt));continue}const gt=nt&&nt._propertyBindings[ht].binding.parsedPath;mt=new PropertyMixer(PropertyBinding.create(rt,pt,gt),dt.ValueTypeName,dt.getValueSize()),++mt.referenceCount,this._addInactiveBinding(mt,lt,pt),at[ht]=mt}st[ht].resultBuffer=mt.buffer}}_activateAction(et){if(!this._isActiveAction(et)){if(et._cacheIndex===null){const rt=(et._localRoot||this._root).uuid,it=et._clip.uuid,ot=this._actionsByClip[it];this._bindAction(et,ot&&ot.knownActions[0]),this._addInactiveAction(et,it,rt)}const nt=et._propertyBindings;for(let rt=0,it=nt.length;rt!==it;++rt){const ot=nt[rt];ot.useCount++===0&&(this._lendBinding(ot),ot.saveOriginalState())}this._lendAction(et)}}_deactivateAction(et){if(this._isActiveAction(et)){const nt=et._propertyBindings;for(let rt=0,it=nt.length;rt!==it;++rt){const ot=nt[rt];--ot.useCount===0&&(ot.restoreOriginalState(),this._takeBackBinding(ot))}this._takeBackAction(et)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const et=this;this.stats={actions:{get total(){return et._actions.length},get inUse(){return et._nActiveActions}},bindings:{get total(){return et._bindings.length},get inUse(){return et._nActiveBindings}},controlInterpolants:{get total(){return et._controlInterpolants.length},get inUse(){return et._nActiveControlInterpolants}}}}_isActiveAction(et){const nt=et._cacheIndex;return nt!==null&&nt=0;--rt)et[rt].stop();return this}update(et){et*=this.timeScale;const nt=this._actions,rt=this._nActiveActions,it=this.time+=et,ot=Math.sign(et),at=this._accuIndex^=1;for(let ct=0;ct!==rt;++ct)nt[ct]._update(it,et,ot,at);const st=this._bindings,lt=this._nActiveBindings;for(let ct=0;ct!==lt;++ct)st[ct].apply(at);return this}setTime(et){this.time=0;for(let nt=0;ntthis.max.x||et.ythis.max.y)}containsBox(et){return this.min.x<=et.min.x&&et.max.x<=this.max.x&&this.min.y<=et.min.y&&et.max.y<=this.max.y}getParameter(et,nt){return nt.set((et.x-this.min.x)/(this.max.x-this.min.x),(et.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(et){return!(et.max.xthis.max.x||et.max.ythis.max.y)}clampPoint(et,nt){return nt.copy(et).clamp(this.min,this.max)}distanceToPoint(et){return _vector$4.copy(et).clamp(this.min,this.max).sub(et).length()}intersect(et){return this.min.max(et.min),this.max.min(et.max),this}union(et){return this.min.min(et.min),this.max.max(et.max),this}translate(et){return this.min.add(et),this.max.add(et),this}equals(et){return et.min.equals(this.min)&&et.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(et=new Vector3,nt=new Vector3){this.start=et,this.end=nt}set(et,nt){return this.start.copy(et),this.end.copy(nt),this}copy(et){return this.start.copy(et.start),this.end.copy(et.end),this}getCenter(et){return et.addVectors(this.start,this.end).multiplyScalar(.5)}delta(et){return et.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(et,nt){return this.delta(nt).multiplyScalar(et).add(this.start)}closestPointToPointParameter(et,nt){_startP.subVectors(et,this.start),_startEnd.subVectors(this.end,this.start);const rt=_startEnd.dot(_startEnd);let ot=_startEnd.dot(_startP)/rt;return nt&&(ot=clamp$6(ot,0,1)),ot}closestPointToPoint(et,nt,rt){const it=this.closestPointToPointParameter(et,nt);return this.delta(rt).multiplyScalar(it).add(this.start)}applyMatrix4(et){return this.start.applyMatrix4(et),this.end.applyMatrix4(et),this}equals(et){return et.start.equals(this.start)&&et.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(et,nt){super(),this.light=et,this.light.updateMatrixWorld(),this.matrix=et.matrixWorld,this.matrixAutoUpdate=!1,this.color=nt;const rt=new BufferGeometry,it=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let at=0,st=1,lt=32;at.99999)this.quaternion.set(0,0,0,1);else if(et.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(et.z,0,-et.x).normalize();const nt=Math.acos(et.y);this.quaternion.setFromAxisAngle(_axis,nt)}}setLength(et,nt=et*.2,rt=nt*.2){this.line.scale.set(1,Math.max(1e-4,et-nt),1),this.line.updateMatrix(),this.cone.scale.set(rt,nt,rt),this.cone.position.y=et,this.cone.updateMatrix()}setColor(et){this.line.material.color.set(et),this.cone.material.color.set(et)}copy(et){return super.copy(et,!1),this.line.copy(et.line),this.cone.copy(et.cone),this}}class AxesHelper extends LineSegments{constructor(et=1){const nt=[0,0,0,et,0,0,0,0,0,0,et,0,0,0,0,0,0,et],rt=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],it=new BufferGeometry;it.setAttribute("position",new Float32BufferAttribute(nt,3)),it.setAttribute("color",new Float32BufferAttribute(rt,3));const ot=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(it,ot),this.type="AxesHelper"}setColors(et,nt,rt){const it=new Color$1,ot=this.geometry.attributes.color.array;return it.set(et),it.toArray(ot,0),it.toArray(ot,3),it.set(nt),it.toArray(ot,6),it.toArray(ot,9),it.set(rt),it.toArray(ot,12),it.toArray(ot,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color$1,this.subPaths=[],this.currentPath=null}moveTo(et,nt){return this.currentPath=new Path$1,this.subPaths.push(this.currentPath),this.currentPath.moveTo(et,nt),this}lineTo(et,nt){return this.currentPath.lineTo(et,nt),this}quadraticCurveTo(et,nt,rt,it){return this.currentPath.quadraticCurveTo(et,nt,rt,it),this}bezierCurveTo(et,nt,rt,it,ot,at){return this.currentPath.bezierCurveTo(et,nt,rt,it,ot,at),this}splineThru(et){return this.currentPath.splineThru(et),this}toShapes(et,nt){function rt(wt){const xt=[];for(let kt=0,St=wt.length;ktNumber.EPSILON){if(jt<0&&(Et=xt[At],Lt=-Lt,Ct=xt[Tt],jt=-jt),wt.yCt.y)continue;if(wt.y===Et.y){if(wt.x===Et.x)return!0}else{const Rt=jt*(wt.x-Et.x)-Lt*(wt.y-Et.y);if(Rt===0)return!0;if(Rt<0)continue;St=!St}}else{if(wt.y!==Et.y)continue;if(Ct.x<=wt.x&&wt.x<=Et.x||Et.x<=wt.x&&wt.x<=Ct.x)return!0}}return St}const ot=ShapeUtils.isClockWise,at=this.subPaths;if(at.length===0)return[];if(nt===!0)return rt(at);let st,lt,ct;const ut=[];if(at.length===1)return lt=at[0],ct=new Shape$1,ct.curves=lt.curves,ut.push(ct),ut;let ht=!ot(at[0].getPoints());ht=et?!ht:ht;const dt=[],pt=[];let mt=[],gt=0,yt;pt[gt]=void 0,mt[gt]=[];for(let wt=0,xt=at.length;wt1){let wt=!1,xt=0;for(let kt=0,St=pt.length;kt0&&wt===!1&&(mt=dt)}let bt;for(let wt=0,xt=pt.length;wt>-ct-14,rt[lt|256]=1024>>-ct-14|32768,it[lt]=-ct-1,it[lt|256]=-ct-1):ct<=15?(rt[lt]=ct+15<<10,rt[lt|256]=ct+15<<10|32768,it[lt]=13,it[lt|256]=13):ct<128?(rt[lt]=31744,rt[lt|256]=64512,it[lt]=24,it[lt|256]=24):(rt[lt]=31744,rt[lt|256]=64512,it[lt]=13,it[lt|256]=13)}const ot=new Uint32Array(2048),at=new Uint32Array(64),st=new Uint32Array(64);for(let lt=1;lt<1024;++lt){let ct=lt<<13,ut=0;for(;!(ct&8388608);)ct<<=1,ut-=8388608;ct&=-8388609,ut+=947912704,ot[lt]=ct|ut}for(let lt=1024;lt<2048;++lt)ot[lt]=939524096+(lt-1024<<13);for(let lt=1;lt<31;++lt)at[lt]=lt<<23;at[31]=1199570944,at[32]=2147483648;for(let lt=33;lt<63;++lt)at[lt]=2147483648+(lt-32<<23);at[63]=3347054592;for(let lt=1;lt<64;++lt)lt!==32&&(st[lt]=1024);return{floatView:et,uint32View:nt,baseTable:rt,shiftTable:it,mantissaTable:ot,exponentTable:at,offsetTable:st}}function toHalfFloat(tt){Math.abs(tt)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),tt=clamp$6(tt,-65504,65504),_tables.floatView[0]=tt;const et=_tables.uint32View[0],nt=et>>23&511;return _tables.baseTable[nt]+((et&8388607)>>_tables.shiftTable[nt])}function fromHalfFloat(tt){const et=tt>>10;return _tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[et]+(tt&1023)]+_tables.exponentTable[et],_tables.floatView[0]}var DataUtils=Object.freeze({__proto__:null,toHalfFloat,fromHalfFloat});class ParametricGeometry extends BufferGeometry{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class TextGeometry extends BufferGeometry{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function FontLoader(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function Font(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function ImmediateRenderObject(){console.error("THREE.ImmediateRenderObject has been removed.")}class WebGLMultisampleRenderTarget extends WebGLRenderTarget{constructor(et,nt,rt){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(et,nt,rt),this.samples=4}}class DataTexture2DArray extends DataArrayTexture{constructor(et,nt,rt,it){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(et,nt,rt,it)}}class DataTexture3D extends Data3DTexture{constructor(et,nt,rt,it){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(et,nt,rt,it)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);const THREE$1=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping,AddEquation,AddOperation,AdditiveAnimationBlendMode,AdditiveBlending,AlphaFormat,AlwaysDepth,AlwaysStencilFunc,AmbientLight,AmbientLightProbe,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrayCamera,ArrowHelper,Audio:Audio$1,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BackSide,BasicDepthPacking,BasicShadowMap,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxBufferGeometry:BoxGeometry,BoxGeometry,BoxHelper,BufferAttribute,BufferGeometry,BufferGeometryLoader,ByteType,Cache,Camera,CameraHelper,CanvasTexture,CapsuleBufferGeometry:CapsuleGeometry,CapsuleGeometry,CatmullRomCurve3,CineonToneMapping,CircleBufferGeometry:CircleGeometry,CircleGeometry,ClampToEdgeWrapping,Clock:Clock$1,Color:Color$1,ColorKeyframeTrack,ColorManagement,CompressedTexture,CompressedTextureLoader,ConeBufferGeometry:ConeGeometry,ConeGeometry,CubeCamera,CubeReflectionMapping,CubeRefractionMapping,CubeTexture,CubeTextureLoader,CubeUVReflectionMapping,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceBack,CullFaceFront,CullFaceFrontBack,CullFaceNone,Curve:Curve$1,CurvePath,CustomBlending,CustomToneMapping,CylinderBufferGeometry:CylinderGeometry,CylinderGeometry,Cylindrical,Data3DTexture,DataArrayTexture,DataTexture,DataTexture2DArray,DataTexture3D,DataTextureLoader,DataUtils,DecrementStencilOp,DecrementWrapStencilOp,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DepthTexture,DirectionalLight,DirectionalLightHelper,DiscreteInterpolant,DodecahedronBufferGeometry:DodecahedronGeometry,DodecahedronGeometry,DoubleSide,DstAlphaFactor,DstColorFactor,DynamicCopyUsage,DynamicDrawUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,EqualDepth,EqualStencilFunc,EquirectangularReflectionMapping,EquirectangularRefractionMapping,Euler,EventDispatcher:EventDispatcher$1,ExtrudeBufferGeometry:ExtrudeGeometry,ExtrudeGeometry,FileLoader,FlatShading,Float16BufferAttribute,Float32BufferAttribute,Float64BufferAttribute,FloatType,Fog,FogExp2,Font,FontLoader,FramebufferTexture,FrontSide,Frustum,GLBufferAttribute,GLSL1,GLSL3,GreaterDepth,GreaterEqualDepth,GreaterEqualStencilFunc,GreaterStencilFunc,GridHelper,Group,HalfFloatType,HemisphereLight,HemisphereLightHelper,HemisphereLightProbe,IcosahedronBufferGeometry:IcosahedronGeometry,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,ImmediateRenderObject,IncrementStencilOp,IncrementWrapStencilOp,InstancedBufferAttribute,InstancedBufferGeometry,InstancedInterleavedBuffer,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,IntType,InterleavedBuffer,InterleavedBufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InvertStencilOp,KeepStencilOp,KeyframeTrack,LOD,LatheBufferGeometry:LatheGeometry,LatheGeometry,Layers,LessDepth,LessEqualDepth,LessEqualStencilFunc,LessStencilFunc,Light,LightProbe,Line:Line$2,Line3,LineBasicMaterial,LineCurve,LineCurve3,LineDashedMaterial,LineLoop,LineSegments,LinearEncoding,LinearFilter,LinearInterpolant,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,LinearSRGBColorSpace:LinearSRGBColorSpace$1,LinearToneMapping,Loader:Loader$2,LoaderUtils,LoadingManager,LoopOnce,LoopPingPong,LoopRepeat,LuminanceAlphaFormat,LuminanceFormat,MOUSE,Material,MaterialLoader,MathUtils,Matrix3,Matrix4,MaxEquation,Mesh,MeshBasicMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshLambertMaterial,MeshMatcapMaterial,MeshNormalMaterial,MeshPhongMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshToonMaterial,MinEquation,MirroredRepeatWrapping,MixOperation,MultiplyBlending,MultiplyOperation,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,NeverDepth,NeverStencilFunc,NoBlending,NoColorSpace:NoColorSpace$1,NoToneMapping,NormalAnimationBlendMode,NormalBlending,NotEqualDepth,NotEqualStencilFunc,NumberKeyframeTrack,Object3D,ObjectLoader,ObjectSpaceNormalMap,OctahedronBufferGeometry:OctahedronGeometry,OctahedronGeometry,OneFactor,OneMinusDstAlphaFactor,OneMinusDstColorFactor,OneMinusSrcAlphaFactor,OneMinusSrcColorFactor,OrthographicCamera,PCFShadowMap,PCFSoftShadowMap,PMREMGenerator,ParametricGeometry,Path:Path$1,PerspectiveCamera,Plane,PlaneBufferGeometry:PlaneGeometry,PlaneGeometry,PlaneHelper,PointLight,PointLightHelper,Points,PointsMaterial,PolarGridHelper,PolyhedronBufferGeometry:PolyhedronGeometry,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,Quaternion,QuaternionKeyframeTrack,QuaternionLinearInterpolant,REVISION,RGBADepthPacking,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,RawShaderMaterial,Ray,Raycaster,RectAreaLight,RedFormat,RedIntegerFormat,ReinhardToneMapping,RepeatWrapping,ReplaceStencilOp,ReverseSubtractEquation,RingBufferGeometry:RingGeometry,RingGeometry,SRGBColorSpace:SRGBColorSpace$1,Scene,ShaderChunk,ShaderLib,ShaderMaterial,ShadowMaterial,Shape:Shape$1,ShapeBufferGeometry:ShapeGeometry,ShapeGeometry,ShapePath,ShapeUtils,ShortType,Skeleton:Skeleton$2,SkeletonHelper,SkinnedMesh,SmoothShading,Source:Source$1,Sphere,SphereBufferGeometry:SphereGeometry,SphereGeometry,Spherical,SphericalHarmonics3,SplineCurve,SpotLight,SpotLightHelper,Sprite,SpriteMaterial,SrcAlphaFactor,SrcAlphaSaturateFactor,SrcColorFactor,StaticCopyUsage,StaticDrawUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,SubtractEquation,SubtractiveBlending,TOUCH,TangentSpaceNormalMap,TetrahedronBufferGeometry:TetrahedronGeometry,TetrahedronGeometry,TextGeometry,Texture,TextureLoader,TorusBufferGeometry:TorusGeometry,TorusGeometry,TorusKnotBufferGeometry:TorusKnotGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeBufferGeometry:TubeGeometry,TubeGeometry,UVMapping,Uint16BufferAttribute,Uint32BufferAttribute,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,UniformsLib,UniformsUtils,UnsignedByteType,UnsignedInt248Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VSMShadowMap,Vector2,Vector3,Vector4,VectorKeyframeTrack,VideoTexture,WebGL1Renderer,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLCubeRenderTarget,WebGLMultipleRenderTargets,WebGLMultisampleRenderTarget,WebGLRenderTarget,WebGLRenderer,WebGLUtils,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroFactor,ZeroSlopeEnding,ZeroStencilOp,_SRGBAFormat,sRGBEncoding},Symbol.toStringTag,{value:"Module"})),createStoreImpl=tt=>{let et;const nt=new Set,rt=(lt,ct)=>{const ut=typeof lt=="function"?lt(et):lt;if(!Object.is(ut,et)){const ht=et;et=ct??typeof ut!="object"?ut:Object.assign({},et,ut),nt.forEach(dt=>dt(et,ht))}},it=()=>et,st={setState:rt,getState:it,subscribe:lt=>(nt.add(lt),()=>nt.delete(lt)),destroy:()=>{nt.clear()}};return et=tt(rt,it,st),st},createStore$3=tt=>tt?createStoreImpl(tt):createStoreImpl;var withSelector={exports:{}},withSelector_production_min={},shim$2={exports:{}},useSyncExternalStoreShim_production_min={};/** +}`;function WebGLShadowMap(tt,et,nt){let rt=new Frustum;const it=new Vector2,ot=new Vector2,at=new Vector4,st=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),lt=new MeshDistanceMaterial,ct={},ut=nt.maxTextureSize,ht={0:BackSide,1:FrontSide,2:DoubleSide},dt=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vertex,fragmentShader:fragment}),pt=dt.clone();pt.defines.HORIZONTAL_PASS=1;const mt=new BufferGeometry;mt.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const gt=new Mesh(mt,dt),yt=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap,this.render=function(kt,St,Tt){if(yt.enabled===!1||yt.autoUpdate===!1&&yt.needsUpdate===!1||kt.length===0)return;const At=tt.getRenderTarget(),Et=tt.getActiveCubeFace(),Ct=tt.getActiveMipmapLevel(),Lt=tt.state;Lt.setBlending(NoBlending),Lt.buffers.color.setClear(1,1,1,1),Lt.buffers.depth.setTest(!0),Lt.setScissorTest(!1);for(let jt=0,Rt=kt.length;jtut||it.y>ut)&&(it.x>ut&&(ot.x=Math.floor(ut/It.x),it.x=ot.x*It.x,vt.mapSize.x=ot.x),it.y>ut&&(ot.y=Math.floor(ut/It.y),it.y=ot.y*It.y,vt.mapSize.y=ot.y)),vt.map===null){const Wt=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};vt.map=new WebGLRenderTarget(it.x,it.y,Wt),vt.map.texture.name=$t.name+".shadowMap",vt.camera.updateProjectionMatrix()}tt.setRenderTarget(vt.map),tt.clear();const Ot=vt.getViewportCount();for(let Wt=0;Wt0){const Rt=Lt.uuid,$t=St.uuid;let vt=ct[Rt];vt===void 0&&(vt={},ct[Rt]=vt);let It=vt[$t];It===void 0&&(It=Lt.clone(),vt[$t]=It),Lt=It}return Lt.visible=St.visible,Lt.wireframe=St.wireframe,Ct===VSMShadowMap?Lt.side=St.shadowSide!==null?St.shadowSide:St.side:Lt.side=St.shadowSide!==null?St.shadowSide:ht[St.side],Lt.alphaMap=St.alphaMap,Lt.alphaTest=St.alphaTest,Lt.clipShadows=St.clipShadows,Lt.clippingPlanes=St.clippingPlanes,Lt.clipIntersection=St.clipIntersection,Lt.displacementMap=St.displacementMap,Lt.displacementScale=St.displacementScale,Lt.displacementBias=St.displacementBias,Lt.wireframeLinewidth=St.wireframeLinewidth,Lt.linewidth=St.linewidth,Tt.isPointLight===!0&&Lt.isMeshDistanceMaterial===!0&&(Lt.referencePosition.setFromMatrixPosition(Tt.matrixWorld),Lt.nearDistance=At,Lt.farDistance=Et),Lt}function xt(kt,St,Tt,At,Et){if(kt.visible===!1)return;if(kt.layers.test(St.layers)&&(kt.isMesh||kt.isLine||kt.isPoints)&&(kt.castShadow||kt.receiveShadow&&Et===VSMShadowMap)&&(!kt.frustumCulled||rt.intersectsObject(kt))){kt.modelViewMatrix.multiplyMatrices(Tt.matrixWorldInverse,kt.matrixWorld);const jt=et.update(kt),Rt=kt.material;if(Array.isArray(Rt)){const $t=jt.groups;for(let vt=0,It=$t.length;vt=1):zt.indexOf("OpenGL ES")!==-1&&(Wt=parseFloat(/^OpenGL ES (\d)/.exec(zt)[1]),Ot=Wt>=2);let Ft=null,Nt={};const Ut=tt.getParameter(3088),Pt=tt.getParameter(2978),Ht=new Vector4().fromArray(Ut),Qt=new Vector4().fromArray(Pt);function an(zn,Jn,Wn){const fr=new Uint8Array(4),ur=tt.createTexture();tt.bindTexture(zn,ur),tt.texParameteri(zn,10241,9728),tt.texParameteri(zn,10240,9728);for(let wr=0;wrxn||yn.height>xn)&&(jn=xn/Math.max(yn.width,yn.height)),jn<1||hn===!0)if(typeof HTMLImageElement<"u"&&yn instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&yn instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&yn instanceof ImageBitmap){const cn=hn?floorPowerOfTwo:Math.floor,Xt=cn(jn*yn.width),Kt=cn(jn*yn.height);gt===void 0&&(gt=wt(Xt,Kt));const kn=fn?wt(Xt,Kt):gt;return kn.width=Xt,kn.height=Kt,kn.getContext("2d").drawImage(yn,0,0,Xt,Kt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+yn.width+"x"+yn.height+") to ("+Xt+"x"+Kt+")."),kn}else return"data"in yn&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+yn.width+"x"+yn.height+")."),yn;return yn}function kt(yn){return isPowerOfTwo(yn.width)&&isPowerOfTwo(yn.height)}function St(yn){return st?!1:yn.wrapS!==ClampToEdgeWrapping||yn.wrapT!==ClampToEdgeWrapping||yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter}function Tt(yn,hn){return yn.generateMipmaps&&hn&&yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter}function At(yn){tt.generateMipmap(yn)}function Et(yn,hn,fn,xn,jn=!1){if(st===!1)return hn;if(yn!==null){if(tt[yn]!==void 0)return tt[yn];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+yn+"'")}let cn=hn;return hn===6403&&(fn===5126&&(cn=33326),fn===5131&&(cn=33325),fn===5121&&(cn=33321)),hn===33319&&(fn===5126&&(cn=33328),fn===5131&&(cn=33327),fn===5121&&(cn=33323)),hn===6408&&(fn===5126&&(cn=34836),fn===5131&&(cn=34842),fn===5121&&(cn=xn===sRGBEncoding&&jn===!1?35907:32856),fn===32819&&(cn=32854),fn===32820&&(cn=32855)),(cn===33325||cn===33326||cn===33327||cn===33328||cn===34842||cn===34836)&&et.get("EXT_color_buffer_float"),cn}function Ct(yn,hn,fn){return Tt(yn,fn)===!0||yn.isFramebufferTexture&&yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter?Math.log2(Math.max(hn.width,hn.height))+1:yn.mipmaps!==void 0&&yn.mipmaps.length>0?yn.mipmaps.length:yn.isCompressedTexture&&Array.isArray(yn.image)?hn.mipmaps.length:1}function Lt(yn){return yn===NearestFilter||yn===NearestMipmapNearestFilter||yn===NearestMipmapLinearFilter?9728:9729}function jt(yn){const hn=yn.target;hn.removeEventListener("dispose",jt),$t(hn),hn.isVideoTexture&&mt.delete(hn)}function Rt(yn){const hn=yn.target;hn.removeEventListener("dispose",Rt),It(hn)}function $t(yn){const hn=rt.get(yn);if(hn.__webglInit===void 0)return;const fn=yn.source,xn=yt.get(fn);if(xn){const jn=xn[hn.__cacheKey];jn.usedTimes--,jn.usedTimes===0&&vt(yn),Object.keys(xn).length===0&&yt.delete(fn)}rt.remove(yn)}function vt(yn){const hn=rt.get(yn);tt.deleteTexture(hn.__webglTexture);const fn=yn.source,xn=yt.get(fn);delete xn[hn.__cacheKey],at.memory.textures--}function It(yn){const hn=yn.texture,fn=rt.get(yn),xn=rt.get(hn);if(xn.__webglTexture!==void 0&&(tt.deleteTexture(xn.__webglTexture),at.memory.textures--),yn.depthTexture&&yn.depthTexture.dispose(),yn.isWebGLCubeRenderTarget)for(let jn=0;jn<6;jn++)tt.deleteFramebuffer(fn.__webglFramebuffer[jn]),fn.__webglDepthbuffer&&tt.deleteRenderbuffer(fn.__webglDepthbuffer[jn]);else{if(tt.deleteFramebuffer(fn.__webglFramebuffer),fn.__webglDepthbuffer&&tt.deleteRenderbuffer(fn.__webglDepthbuffer),fn.__webglMultisampledFramebuffer&&tt.deleteFramebuffer(fn.__webglMultisampledFramebuffer),fn.__webglColorRenderbuffer)for(let jn=0;jn=lt&&console.warn("THREE.WebGLTextures: Trying to use "+yn+" texture units while this GPU supports only "+lt),Ot+=1,yn}function Ft(yn){const hn=[];return hn.push(yn.wrapS),hn.push(yn.wrapT),hn.push(yn.magFilter),hn.push(yn.minFilter),hn.push(yn.anisotropy),hn.push(yn.internalFormat),hn.push(yn.format),hn.push(yn.type),hn.push(yn.generateMipmaps),hn.push(yn.premultiplyAlpha),hn.push(yn.flipY),hn.push(yn.unpackAlignment),hn.push(yn.encoding),hn.join()}function Nt(yn,hn){const fn=rt.get(yn);if(yn.isVideoTexture&&Tn(yn),yn.isRenderTargetTexture===!1&&yn.version>0&&fn.__version!==yn.version){const xn=yn.image;if(xn===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(xn.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{tn(fn,yn,hn);return}}nt.activeTexture(33984+hn),nt.bindTexture(3553,fn.__webglTexture)}function Ut(yn,hn){const fn=rt.get(yn);if(yn.version>0&&fn.__version!==yn.version){tn(fn,yn,hn);return}nt.activeTexture(33984+hn),nt.bindTexture(35866,fn.__webglTexture)}function Pt(yn,hn){const fn=rt.get(yn);if(yn.version>0&&fn.__version!==yn.version){tn(fn,yn,hn);return}nt.activeTexture(33984+hn),nt.bindTexture(32879,fn.__webglTexture)}function Ht(yn,hn){const fn=rt.get(yn);if(yn.version>0&&fn.__version!==yn.version){dn(fn,yn,hn);return}nt.activeTexture(33984+hn),nt.bindTexture(34067,fn.__webglTexture)}const Qt={[RepeatWrapping]:10497,[ClampToEdgeWrapping]:33071,[MirroredRepeatWrapping]:33648},an={[NearestFilter]:9728,[NearestMipmapNearestFilter]:9984,[NearestMipmapLinearFilter]:9986,[LinearFilter]:9729,[LinearMipmapNearestFilter]:9985,[LinearMipmapLinearFilter]:9987};function Yt(yn,hn,fn){if(fn?(tt.texParameteri(yn,10242,Qt[hn.wrapS]),tt.texParameteri(yn,10243,Qt[hn.wrapT]),(yn===32879||yn===35866)&&tt.texParameteri(yn,32882,Qt[hn.wrapR]),tt.texParameteri(yn,10240,an[hn.magFilter]),tt.texParameteri(yn,10241,an[hn.minFilter])):(tt.texParameteri(yn,10242,33071),tt.texParameteri(yn,10243,33071),(yn===32879||yn===35866)&&tt.texParameteri(yn,32882,33071),(hn.wrapS!==ClampToEdgeWrapping||hn.wrapT!==ClampToEdgeWrapping)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),tt.texParameteri(yn,10240,Lt(hn.magFilter)),tt.texParameteri(yn,10241,Lt(hn.minFilter)),hn.minFilter!==NearestFilter&&hn.minFilter!==LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),et.has("EXT_texture_filter_anisotropic")===!0){const xn=et.get("EXT_texture_filter_anisotropic");if(hn.type===FloatType&&et.has("OES_texture_float_linear")===!1||st===!1&&hn.type===HalfFloatType&&et.has("OES_texture_half_float_linear")===!1)return;(hn.anisotropy>1||rt.get(hn).__currentAnisotropy)&&(tt.texParameterf(yn,xn.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(hn.anisotropy,it.getMaxAnisotropy())),rt.get(hn).__currentAnisotropy=hn.anisotropy)}}function nn(yn,hn){let fn=!1;yn.__webglInit===void 0&&(yn.__webglInit=!0,hn.addEventListener("dispose",jt));const xn=hn.source;let jn=yt.get(xn);jn===void 0&&(jn={},yt.set(xn,jn));const cn=Ft(hn);if(cn!==yn.__cacheKey){jn[cn]===void 0&&(jn[cn]={texture:tt.createTexture(),usedTimes:0},at.memory.textures++,fn=!0),jn[cn].usedTimes++;const Xt=jn[yn.__cacheKey];Xt!==void 0&&(jn[yn.__cacheKey].usedTimes--,Xt.usedTimes===0&&vt(hn)),yn.__cacheKey=cn,yn.__webglTexture=jn[cn].texture}return fn}function tn(yn,hn,fn){let xn=3553;hn.isDataArrayTexture&&(xn=35866),hn.isData3DTexture&&(xn=32879);const jn=nn(yn,hn),cn=hn.source;if(nt.activeTexture(33984+fn),nt.bindTexture(xn,yn.__webglTexture),cn.version!==cn.__currentVersion||jn===!0){tt.pixelStorei(37440,hn.flipY),tt.pixelStorei(37441,hn.premultiplyAlpha),tt.pixelStorei(3317,hn.unpackAlignment),tt.pixelStorei(37443,0);const Xt=St(hn)&&kt(hn.image)===!1;let Kt=xt(hn.image,Xt,!1,ut);Kt=In(hn,Kt);const kn=kt(Kt)||st,Mn=ot.convert(hn.format,hn.encoding);let On=ot.convert(hn.type),Bn=Et(hn.internalFormat,Mn,On,hn.encoding,hn.isVideoTexture);Yt(xn,hn,kn);let Xn;const Vn=hn.mipmaps,Gn=st&&hn.isVideoTexture!==!0,zn=cn.__currentVersion===void 0||jn===!0,Jn=Ct(hn,Kt,kn);if(hn.isDepthTexture)Bn=6402,st?hn.type===FloatType?Bn=36012:hn.type===UnsignedIntType?Bn=33190:hn.type===UnsignedInt248Type?Bn=35056:Bn=33189:hn.type===FloatType&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),hn.format===DepthFormat&&Bn===6402&&hn.type!==UnsignedShortType&&hn.type!==UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),hn.type=UnsignedIntType,On=ot.convert(hn.type)),hn.format===DepthStencilFormat&&Bn===6402&&(Bn=34041,hn.type!==UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),hn.type=UnsignedInt248Type,On=ot.convert(hn.type))),zn&&(Gn?nt.texStorage2D(3553,1,Bn,Kt.width,Kt.height):nt.texImage2D(3553,0,Bn,Kt.width,Kt.height,0,Mn,On,null));else if(hn.isDataTexture)if(Vn.length>0&&kn){Gn&&zn&&nt.texStorage2D(3553,Jn,Bn,Vn[0].width,Vn[0].height);for(let Wn=0,fr=Vn.length;Wn>=1,fr>>=1}}else if(Vn.length>0&&kn){Gn&&zn&&nt.texStorage2D(3553,Jn,Bn,Vn[0].width,Vn[0].height);for(let Wn=0,fr=Vn.length;Wn0&&zn++,nt.texStorage2D(34067,zn,Xn,Kt[0].width,Kt[0].height));for(let Wn=0;Wn<6;Wn++)if(Xt){Vn?nt.texSubImage2D(34069+Wn,0,0,0,Kt[Wn].width,Kt[Wn].height,On,Bn,Kt[Wn].data):nt.texImage2D(34069+Wn,0,Xn,Kt[Wn].width,Kt[Wn].height,0,On,Bn,Kt[Wn].data);for(let fr=0;fr0&&pn(yn)===!1){const Kt=cn?hn:[hn];fn.__webglMultisampledFramebuffer=tt.createFramebuffer(),fn.__webglColorRenderbuffer=[],nt.bindFramebuffer(36160,fn.__webglMultisampledFramebuffer);for(let kn=0;kn0&&pn(yn)===!1){const hn=yn.isWebGLMultipleRenderTargets?yn.texture:[yn.texture],fn=yn.width,xn=yn.height;let jn=16384;const cn=[],Xt=yn.stencilBuffer?33306:36096,Kt=rt.get(yn),kn=yn.isWebGLMultipleRenderTargets===!0;if(kn)for(let Mn=0;Mn0&&et.has("WEBGL_multisampled_render_to_texture")===!0&&hn.__useRenderToTexture!==!1}function Tn(yn){const hn=at.render.frame;mt.get(yn)!==hn&&(mt.set(yn,hn),yn.update())}function In(yn,hn){const fn=yn.encoding,xn=yn.format,jn=yn.type;return yn.isCompressedTexture===!0||yn.isVideoTexture===!0||yn.format===_SRGBAFormat||fn!==LinearEncoding&&(fn===sRGBEncoding?st===!1?et.has("EXT_sRGB")===!0&&xn===RGBAFormat?(yn.format=_SRGBAFormat,yn.minFilter=LinearFilter,yn.generateMipmaps=!1):hn=ImageUtils.sRGBToLinear(hn):(xn!==RGBAFormat||jn!==UnsignedByteType)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",fn)),hn}this.allocateTextureUnit=zt,this.resetTextureUnits=Wt,this.setTexture2D=Nt,this.setTexture2DArray=Ut,this.setTexture3D=Pt,this.setTextureCube=Ht,this.rebindTextures=Cn,this.setupRenderTarget=$n,this.updateRenderTargetMipmap=Nn,this.updateMultisampleRenderTarget=En,this.setupDepthRenderbuffer=vn,this.setupFrameBufferTexture=wn,this.useMultisampledRTT=pn}function WebGLUtils(tt,et,nt){const rt=nt.isWebGL2;function it(ot,at=null){let st;if(ot===UnsignedByteType)return 5121;if(ot===UnsignedShort4444Type)return 32819;if(ot===UnsignedShort5551Type)return 32820;if(ot===ByteType)return 5120;if(ot===ShortType)return 5122;if(ot===UnsignedShortType)return 5123;if(ot===IntType)return 5124;if(ot===UnsignedIntType)return 5125;if(ot===FloatType)return 5126;if(ot===HalfFloatType)return rt?5131:(st=et.get("OES_texture_half_float"),st!==null?st.HALF_FLOAT_OES:null);if(ot===AlphaFormat)return 6406;if(ot===RGBAFormat)return 6408;if(ot===LuminanceFormat)return 6409;if(ot===LuminanceAlphaFormat)return 6410;if(ot===DepthFormat)return 6402;if(ot===DepthStencilFormat)return 34041;if(ot===RedFormat)return 6403;if(ot===RGBFormat)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(ot===_SRGBAFormat)return st=et.get("EXT_sRGB"),st!==null?st.SRGB_ALPHA_EXT:null;if(ot===RedIntegerFormat)return 36244;if(ot===RGFormat)return 33319;if(ot===RGIntegerFormat)return 33320;if(ot===RGBAIntegerFormat)return 36249;if(ot===RGB_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT3_Format||ot===RGBA_S3TC_DXT5_Format)if(at===sRGBEncoding)if(st=et.get("WEBGL_compressed_texture_s3tc_srgb"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(st=et.get("WEBGL_compressed_texture_s3tc"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_RGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(ot===RGB_PVRTC_4BPPV1_Format||ot===RGB_PVRTC_2BPPV1_Format||ot===RGBA_PVRTC_4BPPV1_Format||ot===RGBA_PVRTC_2BPPV1_Format)if(st=et.get("WEBGL_compressed_texture_pvrtc"),st!==null){if(ot===RGB_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(ot===RGB_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(ot===RGBA_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(ot===RGBA_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(ot===RGB_ETC1_Format)return st=et.get("WEBGL_compressed_texture_etc1"),st!==null?st.COMPRESSED_RGB_ETC1_WEBGL:null;if(ot===RGB_ETC2_Format||ot===RGBA_ETC2_EAC_Format)if(st=et.get("WEBGL_compressed_texture_etc"),st!==null){if(ot===RGB_ETC2_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ETC2:st.COMPRESSED_RGB8_ETC2;if(ot===RGBA_ETC2_EAC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:st.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(ot===RGBA_ASTC_4x4_Format||ot===RGBA_ASTC_5x4_Format||ot===RGBA_ASTC_5x5_Format||ot===RGBA_ASTC_6x5_Format||ot===RGBA_ASTC_6x6_Format||ot===RGBA_ASTC_8x5_Format||ot===RGBA_ASTC_8x6_Format||ot===RGBA_ASTC_8x8_Format||ot===RGBA_ASTC_10x5_Format||ot===RGBA_ASTC_10x6_Format||ot===RGBA_ASTC_10x8_Format||ot===RGBA_ASTC_10x10_Format||ot===RGBA_ASTC_12x10_Format||ot===RGBA_ASTC_12x12_Format)if(st=et.get("WEBGL_compressed_texture_astc"),st!==null){if(ot===RGBA_ASTC_4x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:st.COMPRESSED_RGBA_ASTC_4x4_KHR;if(ot===RGBA_ASTC_5x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:st.COMPRESSED_RGBA_ASTC_5x4_KHR;if(ot===RGBA_ASTC_5x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:st.COMPRESSED_RGBA_ASTC_5x5_KHR;if(ot===RGBA_ASTC_6x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:st.COMPRESSED_RGBA_ASTC_6x5_KHR;if(ot===RGBA_ASTC_6x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:st.COMPRESSED_RGBA_ASTC_6x6_KHR;if(ot===RGBA_ASTC_8x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:st.COMPRESSED_RGBA_ASTC_8x5_KHR;if(ot===RGBA_ASTC_8x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:st.COMPRESSED_RGBA_ASTC_8x6_KHR;if(ot===RGBA_ASTC_8x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:st.COMPRESSED_RGBA_ASTC_8x8_KHR;if(ot===RGBA_ASTC_10x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:st.COMPRESSED_RGBA_ASTC_10x5_KHR;if(ot===RGBA_ASTC_10x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:st.COMPRESSED_RGBA_ASTC_10x6_KHR;if(ot===RGBA_ASTC_10x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:st.COMPRESSED_RGBA_ASTC_10x8_KHR;if(ot===RGBA_ASTC_10x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:st.COMPRESSED_RGBA_ASTC_10x10_KHR;if(ot===RGBA_ASTC_12x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:st.COMPRESSED_RGBA_ASTC_12x10_KHR;if(ot===RGBA_ASTC_12x12_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:st.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(ot===RGBA_BPTC_Format)if(st=et.get("EXT_texture_compression_bptc"),st!==null){if(ot===RGBA_BPTC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:st.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return ot===UnsignedInt248Type?rt?34042:(st=et.get("WEBGL_depth_texture"),st!==null?st.UNSIGNED_INT_24_8_WEBGL:null):tt[ot]!==void 0?tt[ot]:null}return{convert:it}}class ArrayCamera extends PerspectiveCamera{constructor(et=[]){super(),this.isArrayCamera=!0,this.cameras=et}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _moveEvent={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(et){return this._targetRay!==null&&this._targetRay.dispatchEvent(et),this._grip!==null&&this._grip.dispatchEvent(et),this._hand!==null&&this._hand.dispatchEvent(et),this}disconnect(et){return this.dispatchEvent({type:"disconnected",data:et}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(et,nt,rt){let it=null,ot=null,at=null;const st=this._targetRay,lt=this._grip,ct=this._hand;if(et&&nt.session.visibilityState!=="visible-blurred"){if(ct&&et.hand){at=!0;for(const gt of et.hand.values()){const yt=nt.getJointPose(gt,rt);if(ct.joints[gt.jointName]===void 0){const wt=new Group;wt.matrixAutoUpdate=!1,wt.visible=!1,ct.joints[gt.jointName]=wt,ct.add(wt)}const bt=ct.joints[gt.jointName];yt!==null&&(bt.matrix.fromArray(yt.transform.matrix),bt.matrix.decompose(bt.position,bt.rotation,bt.scale),bt.jointRadius=yt.radius),bt.visible=yt!==null}const ut=ct.joints["index-finger-tip"],ht=ct.joints["thumb-tip"],dt=ut.position.distanceTo(ht.position),pt=.02,mt=.005;ct.inputState.pinching&&dt>pt+mt?(ct.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:et.handedness,target:this})):!ct.inputState.pinching&&dt<=pt-mt&&(ct.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:et.handedness,target:this}))}else lt!==null&&et.gripSpace&&(ot=nt.getPose(et.gripSpace,rt),ot!==null&&(lt.matrix.fromArray(ot.transform.matrix),lt.matrix.decompose(lt.position,lt.rotation,lt.scale),ot.linearVelocity?(lt.hasLinearVelocity=!0,lt.linearVelocity.copy(ot.linearVelocity)):lt.hasLinearVelocity=!1,ot.angularVelocity?(lt.hasAngularVelocity=!0,lt.angularVelocity.copy(ot.angularVelocity)):lt.hasAngularVelocity=!1));st!==null&&(it=nt.getPose(et.targetRaySpace,rt),it===null&&ot!==null&&(it=ot),it!==null&&(st.matrix.fromArray(it.transform.matrix),st.matrix.decompose(st.position,st.rotation,st.scale),it.linearVelocity?(st.hasLinearVelocity=!0,st.linearVelocity.copy(it.linearVelocity)):st.hasLinearVelocity=!1,it.angularVelocity?(st.hasAngularVelocity=!0,st.angularVelocity.copy(it.angularVelocity)):st.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return st!==null&&(st.visible=it!==null),lt!==null&&(lt.visible=ot!==null),ct!==null&&(ct.visible=at!==null),this}}class DepthTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct,ut){if(ut=ut!==void 0?ut:DepthFormat,ut!==DepthFormat&&ut!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");rt===void 0&&ut===DepthFormat&&(rt=UnsignedIntType),rt===void 0&&ut===DepthStencilFormat&&(rt=UnsignedInt248Type),super(null,it,ot,at,st,lt,ut,rt,ct),this.isDepthTexture=!0,this.image={width:et,height:nt},this.magFilter=st!==void 0?st:NearestFilter,this.minFilter=lt!==void 0?lt:NearestFilter,this.flipY=!1,this.generateMipmaps=!1}}class WebXRManager extends EventDispatcher$1{constructor(et,nt){super();const rt=this;let it=null,ot=1,at=null,st="local-floor",lt=null,ct=null,ut=null,ht=null,dt=null,pt=null;const mt=nt.getContextAttributes();let gt=null,yt=null;const bt=[],wt=[],xt=new PerspectiveCamera;xt.layers.enable(1),xt.viewport=new Vector4;const kt=new PerspectiveCamera;kt.layers.enable(2),kt.viewport=new Vector4;const St=[xt,kt],Tt=new ArrayCamera;Tt.layers.enable(1),Tt.layers.enable(2);let At=null,Et=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Ft){let Nt=bt[Ft];return Nt===void 0&&(Nt=new WebXRController,bt[Ft]=Nt),Nt.getTargetRaySpace()},this.getControllerGrip=function(Ft){let Nt=bt[Ft];return Nt===void 0&&(Nt=new WebXRController,bt[Ft]=Nt),Nt.getGripSpace()},this.getHand=function(Ft){let Nt=bt[Ft];return Nt===void 0&&(Nt=new WebXRController,bt[Ft]=Nt),Nt.getHandSpace()};function Ct(Ft){const Nt=wt.indexOf(Ft.inputSource);if(Nt===-1)return;const Ut=bt[Nt];Ut!==void 0&&Ut.dispatchEvent({type:Ft.type,data:Ft.inputSource})}function Lt(){it.removeEventListener("select",Ct),it.removeEventListener("selectstart",Ct),it.removeEventListener("selectend",Ct),it.removeEventListener("squeeze",Ct),it.removeEventListener("squeezestart",Ct),it.removeEventListener("squeezeend",Ct),it.removeEventListener("end",Lt),it.removeEventListener("inputsourceschange",jt);for(let Ft=0;Ft=0&&(wt[Pt]=null,bt[Pt].dispatchEvent({type:"disconnected",data:Ut}))}for(let Nt=0;Nt=wt.length){wt.push(Ut),Pt=Qt;break}else if(wt[Qt]===null){wt[Qt]=Ut,Pt=Qt;break}if(Pt===-1)break}const Ht=bt[Pt];Ht&&Ht.dispatchEvent({type:"connected",data:Ut})}}const Rt=new Vector3,$t=new Vector3;function vt(Ft,Nt,Ut){Rt.setFromMatrixPosition(Nt.matrixWorld),$t.setFromMatrixPosition(Ut.matrixWorld);const Pt=Rt.distanceTo($t),Ht=Nt.projectionMatrix.elements,Qt=Ut.projectionMatrix.elements,an=Ht[14]/(Ht[10]-1),Yt=Ht[14]/(Ht[10]+1),nn=(Ht[9]+1)/Ht[5],tn=(Ht[9]-1)/Ht[5],dn=(Ht[8]-1)/Ht[0],wn=(Qt[8]+1)/Qt[0],rn=an*dn,Zt=an*wn,vn=Pt/(-dn+wn),Cn=vn*-dn;Nt.matrixWorld.decompose(Ft.position,Ft.quaternion,Ft.scale),Ft.translateX(Cn),Ft.translateZ(vn),Ft.matrixWorld.compose(Ft.position,Ft.quaternion,Ft.scale),Ft.matrixWorldInverse.copy(Ft.matrixWorld).invert();const $n=an+vn,Nn=Yt+vn,En=rn-Cn,sn=Zt+(Pt-Cn),pn=nn*Yt/Nn*$n,Tn=tn*Yt/Nn*$n;Ft.projectionMatrix.makePerspective(En,sn,pn,Tn,$n,Nn)}function It(Ft,Nt){Nt===null?Ft.matrixWorld.copy(Ft.matrix):Ft.matrixWorld.multiplyMatrices(Nt.matrixWorld,Ft.matrix),Ft.matrixWorldInverse.copy(Ft.matrixWorld).invert()}this.updateCamera=function(Ft){if(it===null)return;Tt.near=kt.near=xt.near=Ft.near,Tt.far=kt.far=xt.far=Ft.far,(At!==Tt.near||Et!==Tt.far)&&(it.updateRenderState({depthNear:Tt.near,depthFar:Tt.far}),At=Tt.near,Et=Tt.far);const Nt=Ft.parent,Ut=Tt.cameras;It(Tt,Nt);for(let Ht=0;Ht0&&(gt.alphaTest.value=yt.alphaTest);const bt=et.get(yt).envMap;if(bt&&(gt.envMap.value=bt,gt.flipEnvMap.value=bt.isCubeTexture&&bt.isRenderTargetTexture===!1?-1:1,gt.reflectivity.value=yt.reflectivity,gt.ior.value=yt.ior,gt.refractionRatio.value=yt.refractionRatio),yt.lightMap){gt.lightMap.value=yt.lightMap;const kt=tt.physicallyCorrectLights!==!0?Math.PI:1;gt.lightMapIntensity.value=yt.lightMapIntensity*kt}yt.aoMap&&(gt.aoMap.value=yt.aoMap,gt.aoMapIntensity.value=yt.aoMapIntensity);let wt;yt.map?wt=yt.map:yt.specularMap?wt=yt.specularMap:yt.displacementMap?wt=yt.displacementMap:yt.normalMap?wt=yt.normalMap:yt.bumpMap?wt=yt.bumpMap:yt.roughnessMap?wt=yt.roughnessMap:yt.metalnessMap?wt=yt.metalnessMap:yt.alphaMap?wt=yt.alphaMap:yt.emissiveMap?wt=yt.emissiveMap:yt.clearcoatMap?wt=yt.clearcoatMap:yt.clearcoatNormalMap?wt=yt.clearcoatNormalMap:yt.clearcoatRoughnessMap?wt=yt.clearcoatRoughnessMap:yt.iridescenceMap?wt=yt.iridescenceMap:yt.iridescenceThicknessMap?wt=yt.iridescenceThicknessMap:yt.specularIntensityMap?wt=yt.specularIntensityMap:yt.specularColorMap?wt=yt.specularColorMap:yt.transmissionMap?wt=yt.transmissionMap:yt.thicknessMap?wt=yt.thicknessMap:yt.sheenColorMap?wt=yt.sheenColorMap:yt.sheenRoughnessMap&&(wt=yt.sheenRoughnessMap),wt!==void 0&&(wt.isWebGLRenderTarget&&(wt=wt.texture),wt.matrixAutoUpdate===!0&&wt.updateMatrix(),gt.uvTransform.value.copy(wt.matrix));let xt;yt.aoMap?xt=yt.aoMap:yt.lightMap&&(xt=yt.lightMap),xt!==void 0&&(xt.isWebGLRenderTarget&&(xt=xt.texture),xt.matrixAutoUpdate===!0&&xt.updateMatrix(),gt.uv2Transform.value.copy(xt.matrix))}function ot(gt,yt){gt.diffuse.value.copy(yt.color),gt.opacity.value=yt.opacity}function at(gt,yt){gt.dashSize.value=yt.dashSize,gt.totalSize.value=yt.dashSize+yt.gapSize,gt.scale.value=yt.scale}function st(gt,yt,bt,wt){gt.diffuse.value.copy(yt.color),gt.opacity.value=yt.opacity,gt.size.value=yt.size*bt,gt.scale.value=wt*.5,yt.map&&(gt.map.value=yt.map),yt.alphaMap&&(gt.alphaMap.value=yt.alphaMap),yt.alphaTest>0&&(gt.alphaTest.value=yt.alphaTest);let xt;yt.map?xt=yt.map:yt.alphaMap&&(xt=yt.alphaMap),xt!==void 0&&(xt.matrixAutoUpdate===!0&&xt.updateMatrix(),gt.uvTransform.value.copy(xt.matrix))}function lt(gt,yt){gt.diffuse.value.copy(yt.color),gt.opacity.value=yt.opacity,gt.rotation.value=yt.rotation,yt.map&&(gt.map.value=yt.map),yt.alphaMap&&(gt.alphaMap.value=yt.alphaMap),yt.alphaTest>0&&(gt.alphaTest.value=yt.alphaTest);let bt;yt.map?bt=yt.map:yt.alphaMap&&(bt=yt.alphaMap),bt!==void 0&&(bt.matrixAutoUpdate===!0&&bt.updateMatrix(),gt.uvTransform.value.copy(bt.matrix))}function ct(gt,yt){gt.specular.value.copy(yt.specular),gt.shininess.value=Math.max(yt.shininess,1e-4)}function ut(gt,yt){yt.gradientMap&&(gt.gradientMap.value=yt.gradientMap)}function ht(gt,yt){gt.roughness.value=yt.roughness,gt.metalness.value=yt.metalness,yt.roughnessMap&&(gt.roughnessMap.value=yt.roughnessMap),yt.metalnessMap&&(gt.metalnessMap.value=yt.metalnessMap),et.get(yt).envMap&&(gt.envMapIntensity.value=yt.envMapIntensity)}function dt(gt,yt,bt){gt.ior.value=yt.ior,yt.sheen>0&&(gt.sheenColor.value.copy(yt.sheenColor).multiplyScalar(yt.sheen),gt.sheenRoughness.value=yt.sheenRoughness,yt.sheenColorMap&&(gt.sheenColorMap.value=yt.sheenColorMap),yt.sheenRoughnessMap&&(gt.sheenRoughnessMap.value=yt.sheenRoughnessMap)),yt.clearcoat>0&&(gt.clearcoat.value=yt.clearcoat,gt.clearcoatRoughness.value=yt.clearcoatRoughness,yt.clearcoatMap&&(gt.clearcoatMap.value=yt.clearcoatMap),yt.clearcoatRoughnessMap&&(gt.clearcoatRoughnessMap.value=yt.clearcoatRoughnessMap),yt.clearcoatNormalMap&&(gt.clearcoatNormalScale.value.copy(yt.clearcoatNormalScale),gt.clearcoatNormalMap.value=yt.clearcoatNormalMap,yt.side===BackSide&>.clearcoatNormalScale.value.negate())),yt.iridescence>0&&(gt.iridescence.value=yt.iridescence,gt.iridescenceIOR.value=yt.iridescenceIOR,gt.iridescenceThicknessMinimum.value=yt.iridescenceThicknessRange[0],gt.iridescenceThicknessMaximum.value=yt.iridescenceThicknessRange[1],yt.iridescenceMap&&(gt.iridescenceMap.value=yt.iridescenceMap),yt.iridescenceThicknessMap&&(gt.iridescenceThicknessMap.value=yt.iridescenceThicknessMap)),yt.transmission>0&&(gt.transmission.value=yt.transmission,gt.transmissionSamplerMap.value=bt.texture,gt.transmissionSamplerSize.value.set(bt.width,bt.height),yt.transmissionMap&&(gt.transmissionMap.value=yt.transmissionMap),gt.thickness.value=yt.thickness,yt.thicknessMap&&(gt.thicknessMap.value=yt.thicknessMap),gt.attenuationDistance.value=yt.attenuationDistance,gt.attenuationColor.value.copy(yt.attenuationColor)),gt.specularIntensity.value=yt.specularIntensity,gt.specularColor.value.copy(yt.specularColor),yt.specularIntensityMap&&(gt.specularIntensityMap.value=yt.specularIntensityMap),yt.specularColorMap&&(gt.specularColorMap.value=yt.specularColorMap)}function pt(gt,yt){yt.matcap&&(gt.matcap.value=yt.matcap)}function mt(gt,yt){gt.referencePosition.value.copy(yt.referencePosition),gt.nearDistance.value=yt.nearDistance,gt.farDistance.value=yt.farDistance}return{refreshFogUniforms:nt,refreshMaterialUniforms:rt}}function WebGLUniformsGroups(tt,et,nt,rt){let it={},ot={},at=[];const st=nt.isWebGL2?tt.getParameter(35375):0;function lt(wt,xt){const kt=xt.program;rt.uniformBlockBinding(wt,kt)}function ct(wt,xt){let kt=it[wt.id];kt===void 0&&(mt(wt),kt=ut(wt),it[wt.id]=kt,wt.addEventListener("dispose",yt));const St=xt.program;rt.updateUBOMapping(wt,St);const Tt=et.render.frame;ot[wt.id]!==Tt&&(dt(wt),ot[wt.id]=Tt)}function ut(wt){const xt=ht();wt.__bindingPointIndex=xt;const kt=tt.createBuffer(),St=wt.__size,Tt=wt.usage;return tt.bindBuffer(35345,kt),tt.bufferData(35345,St,Tt),tt.bindBuffer(35345,null),tt.bindBufferBase(35345,xt,kt),kt}function ht(){for(let wt=0;wt0){Tt=kt%St;const jt=St-Tt;Tt!==0&&jt-Lt.boundary<0&&(kt+=St-Tt,Ct.__offset=kt)}kt+=Lt.storage}return Tt=kt%St,Tt>0&&(kt+=St-Tt),wt.__size=kt,wt.__cache={},this}function gt(wt){const xt=wt.value,kt={boundary:0,storage:0};return typeof xt=="number"?(kt.boundary=4,kt.storage=4):xt.isVector2?(kt.boundary=8,kt.storage=8):xt.isVector3||xt.isColor?(kt.boundary=16,kt.storage=12):xt.isVector4?(kt.boundary=16,kt.storage=16):xt.isMatrix3?(kt.boundary=48,kt.storage=48):xt.isMatrix4?(kt.boundary=64,kt.storage=64):xt.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",xt),kt}function yt(wt){const xt=wt.target;xt.removeEventListener("dispose",yt);const kt=at.indexOf(xt.__bindingPointIndex);at.splice(kt,1),tt.deleteBuffer(it[xt.id]),delete it[xt.id],delete ot[xt.id]}function bt(){for(const wt in it)tt.deleteBuffer(it[wt]);at=[],it={},ot={}}return{bind:lt,update:ct,dispose:bt}}function createCanvasElement(){const tt=createElementNS("canvas");return tt.style.display="block",tt}function WebGLRenderer(tt={}){this.isWebGLRenderer=!0;const et=tt.canvas!==void 0?tt.canvas:createCanvasElement(),nt=tt.context!==void 0?tt.context:null,rt=tt.depth!==void 0?tt.depth:!0,it=tt.stencil!==void 0?tt.stencil:!0,ot=tt.antialias!==void 0?tt.antialias:!1,at=tt.premultipliedAlpha!==void 0?tt.premultipliedAlpha:!0,st=tt.preserveDrawingBuffer!==void 0?tt.preserveDrawingBuffer:!1,lt=tt.powerPreference!==void 0?tt.powerPreference:"default",ct=tt.failIfMajorPerformanceCaveat!==void 0?tt.failIfMajorPerformanceCaveat:!1;let ut;nt!==null?ut=nt.getContextAttributes().alpha:ut=tt.alpha!==void 0?tt.alpha:!1;let ht=null,dt=null;const pt=[],mt=[];this.domElement=et,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=LinearEncoding,this.physicallyCorrectLights=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const gt=this;let yt=!1,bt=0,wt=0,xt=null,kt=-1,St=null;const Tt=new Vector4,At=new Vector4;let Et=null,Ct=et.width,Lt=et.height,jt=1,Rt=null,$t=null;const vt=new Vector4(0,0,Ct,Lt),It=new Vector4(0,0,Ct,Lt);let Ot=!1;const Wt=new Frustum;let zt=!1,Ft=!1,Nt=null;const Ut=new Matrix4,Pt=new Vector2,Ht=new Vector3,Qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function an(){return xt===null?jt:1}let Yt=nt;function nn(un,Jt){for(let Sn=0;Sn0?dt=mt[mt.length-1]:dt=null,pt.pop(),pt.length>0?ht=pt[pt.length-1]:ht=null};function Ir(un,Jt,Sn,Dn){if(un.visible===!1)return;if(un.layers.test(Jt.layers)){if(un.isGroup)Sn=un.renderOrder;else if(un.isLOD)un.autoUpdate===!0&&un.update(Jt);else if(un.isLight)dt.pushLight(un),un.castShadow&&dt.pushShadow(un);else if(un.isSprite){if(!un.frustumCulled||Wt.intersectsSprite(un)){Dn&&Ht.setFromMatrixPosition(un.matrixWorld).applyMatrix4(Ut);const tr=sn.update(un),ar=un.material;ar.visible&&ht.push(un,tr,ar,Sn,Ht.z,null)}}else if((un.isMesh||un.isLine||un.isPoints)&&(un.isSkinnedMesh&&un.skeleton.frame!==rn.render.frame&&(un.skeleton.update(),un.skeleton.frame=rn.render.frame),!un.frustumCulled||Wt.intersectsObject(un))){Dn&&Ht.setFromMatrixPosition(un.matrixWorld).applyMatrix4(Ut);const tr=sn.update(un),ar=un.material;if(Array.isArray(ar)){const lr=tr.groups;for(let Vr=0,vr=lr.length;Vr0&&Or(Fn,Jt,Sn),Dn&&wn.viewport(Tt.copy(Dn)),Fn.length>0&&Lr(Fn,Jt,Sn),Yn.length>0&&Lr(Yn,Jt,Sn),tr.length>0&&Lr(tr,Jt,Sn),wn.buffers.depth.setTest(!0),wn.buffers.depth.setMask(!0),wn.buffers.color.setMask(!0),wn.setPolygonOffset(!1)}function Or(un,Jt,Sn){const Dn=dn.isWebGL2;Nt===null&&(Nt=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:tn.has("EXT_color_buffer_half_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:Dn&&ot===!0?4:0})),gt.getDrawingBufferSize(Pt),Dn?Nt.setSize(Pt.x,Pt.y):Nt.setSize(floorPowerOfTwo(Pt.x),floorPowerOfTwo(Pt.y));const Fn=gt.getRenderTarget();gt.setRenderTarget(Nt),gt.clear();const Yn=gt.toneMapping;gt.toneMapping=NoToneMapping,Lr(un,Jt,Sn),gt.toneMapping=Yn,vn.updateMultisampleRenderTarget(Nt),vn.updateRenderTargetMipmap(Nt),gt.setRenderTarget(Fn)}function Lr(un,Jt,Sn){const Dn=Jt.isScene===!0?Jt.overrideMaterial:null;for(let Fn=0,Yn=un.length;Fn0&&vn.useMultisampledRTT(un)===!1?Fn=Zt.get(un).__webglMultisampledFramebuffer:Fn=Vr,Tt.copy(un.viewport),At.copy(un.scissor),Et=un.scissorTest}else Tt.copy(vt).multiplyScalar(jt).floor(),At.copy(It).multiplyScalar(jt).floor(),Et=Ot;if(wn.bindFramebuffer(36160,Fn)&&dn.drawBuffers&&Dn&&wn.drawBuffers(un,Fn),wn.viewport(Tt),wn.scissor(At),wn.setScissorTest(Et),Yn){const lr=Zt.get(un.texture);Yt.framebufferTexture2D(36160,36064,34069+Jt,lr.__webglTexture,Sn)}else if(tr){const lr=Zt.get(un.texture),Vr=Jt||0;Yt.framebufferTextureLayer(36160,36064,lr.__webglTexture,Sn||0,Vr)}kt=-1},this.readRenderTargetPixels=function(un,Jt,Sn,Dn,Fn,Yn,tr){if(!(un&&un.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ar=Zt.get(un).__webglFramebuffer;if(un.isWebGLCubeRenderTarget&&tr!==void 0&&(ar=ar[tr]),ar){wn.bindFramebuffer(36160,ar);try{const lr=un.texture,Vr=lr.format,vr=lr.type;if(Vr!==RGBAFormat&&Kt.convert(Vr)!==Yt.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Nr=vr===HalfFloatType&&(tn.has("EXT_color_buffer_half_float")||dn.isWebGL2&&tn.has("EXT_color_buffer_float"));if(vr!==UnsignedByteType&&Kt.convert(vr)!==Yt.getParameter(35738)&&!(vr===FloatType&&(dn.isWebGL2||tn.has("OES_texture_float")||tn.has("WEBGL_color_buffer_float")))&&!Nr){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Jt>=0&&Jt<=un.width-Dn&&Sn>=0&&Sn<=un.height-Fn&&Yt.readPixels(Jt,Sn,Dn,Fn,Kt.convert(Vr),Kt.convert(vr),Yn)}finally{const lr=xt!==null?Zt.get(xt).__webglFramebuffer:null;wn.bindFramebuffer(36160,lr)}}},this.copyFramebufferToTexture=function(un,Jt,Sn=0){const Dn=Math.pow(2,-Sn),Fn=Math.floor(Jt.image.width*Dn),Yn=Math.floor(Jt.image.height*Dn);vn.setTexture2D(Jt,0),Yt.copyTexSubImage2D(3553,Sn,0,0,un.x,un.y,Fn,Yn),wn.unbindTexture()},this.copyTextureToTexture=function(un,Jt,Sn,Dn=0){const Fn=Jt.image.width,Yn=Jt.image.height,tr=Kt.convert(Sn.format),ar=Kt.convert(Sn.type);vn.setTexture2D(Sn,0),Yt.pixelStorei(37440,Sn.flipY),Yt.pixelStorei(37441,Sn.premultiplyAlpha),Yt.pixelStorei(3317,Sn.unpackAlignment),Jt.isDataTexture?Yt.texSubImage2D(3553,Dn,un.x,un.y,Fn,Yn,tr,ar,Jt.image.data):Jt.isCompressedTexture?Yt.compressedTexSubImage2D(3553,Dn,un.x,un.y,Jt.mipmaps[0].width,Jt.mipmaps[0].height,tr,Jt.mipmaps[0].data):Yt.texSubImage2D(3553,Dn,un.x,un.y,tr,ar,Jt.image),Dn===0&&Sn.generateMipmaps&&Yt.generateMipmap(3553),wn.unbindTexture()},this.copyTextureToTexture3D=function(un,Jt,Sn,Dn,Fn=0){if(gt.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Yn=un.max.x-un.min.x+1,tr=un.max.y-un.min.y+1,ar=un.max.z-un.min.z+1,lr=Kt.convert(Dn.format),Vr=Kt.convert(Dn.type);let vr;if(Dn.isData3DTexture)vn.setTexture3D(Dn,0),vr=32879;else if(Dn.isDataArrayTexture)vn.setTexture2DArray(Dn,0),vr=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Yt.pixelStorei(37440,Dn.flipY),Yt.pixelStorei(37441,Dn.premultiplyAlpha),Yt.pixelStorei(3317,Dn.unpackAlignment);const Nr=Yt.getParameter(3314),Hr=Yt.getParameter(32878),eo=Yt.getParameter(3316),Jr=Yt.getParameter(3315),Zr=Yt.getParameter(32877),br=Sn.isCompressedTexture?Sn.mipmaps[0]:Sn.image;Yt.pixelStorei(3314,br.width),Yt.pixelStorei(32878,br.height),Yt.pixelStorei(3316,un.min.x),Yt.pixelStorei(3315,un.min.y),Yt.pixelStorei(32877,un.min.z),Sn.isDataTexture||Sn.isData3DTexture?Yt.texSubImage3D(vr,Fn,Jt.x,Jt.y,Jt.z,Yn,tr,ar,lr,Vr,br.data):Sn.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Yt.compressedTexSubImage3D(vr,Fn,Jt.x,Jt.y,Jt.z,Yn,tr,ar,lr,br.data)):Yt.texSubImage3D(vr,Fn,Jt.x,Jt.y,Jt.z,Yn,tr,ar,lr,Vr,br),Yt.pixelStorei(3314,Nr),Yt.pixelStorei(32878,Hr),Yt.pixelStorei(3316,eo),Yt.pixelStorei(3315,Jr),Yt.pixelStorei(32877,Zr),Fn===0&&Dn.generateMipmaps&&Yt.generateMipmap(vr),wn.unbindTexture()},this.initTexture=function(un){un.isCubeTexture?vn.setTextureCube(un,0):un.isData3DTexture?vn.setTexture3D(un,0):un.isDataArrayTexture?vn.setTexture2DArray(un,0):vn.setTexture2D(un,0),wn.unbindTexture()},this.resetState=function(){bt=0,wt=0,xt=null,wn.reset(),kn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class WebGL1Renderer extends WebGLRenderer{}WebGL1Renderer.prototype.isWebGL1Renderer=!0;class FogExp2{constructor(et,nt=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color$1(et),this.density=nt}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Fog{constructor(et,nt=1,rt=1e3){this.isFog=!0,this.name="",this.color=new Color$1(et),this.near=nt,this.far=rt}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(et,nt){return super.copy(et,nt),et.background!==null&&(this.background=et.background.clone()),et.environment!==null&&(this.environment=et.environment.clone()),et.fog!==null&&(this.fog=et.fog.clone()),et.overrideMaterial!==null&&(this.overrideMaterial=et.overrideMaterial.clone()),this.autoUpdate=et.autoUpdate,this.matrixAutoUpdate=et.matrixAutoUpdate,this}toJSON(et){const nt=super.toJSON(et);return this.fog!==null&&(nt.object.fog=this.fog.toJSON()),nt}}class InterleavedBuffer{constructor(et,nt){this.isInterleavedBuffer=!0,this.array=et,this.stride=nt,this.count=et!==void 0?et.length/nt:0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID$1()}onUploadCallback(){}set needsUpdate(et){et===!0&&this.version++}setUsage(et){return this.usage=et,this}copy(et){return this.array=new et.array.constructor(et.array),this.count=et.count,this.stride=et.stride,this.usage=et.usage,this}copyAt(et,nt,rt){et*=this.stride,rt*=nt.stride;for(let it=0,ot=this.stride;itet.far||nt.push({distance:lt,point:_intersectPoint.clone(),uv:Triangle.getUV(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(et,nt){return super.copy(et,nt),et.center!==void 0&&this.center.copy(et.center),this.material=et.material,this}}function transformVertex(tt,et,nt,rt,it,ot){_alignedPosition.subVectors(tt,nt).addScalar(.5).multiply(rt),it!==void 0?(_rotatedPosition.x=ot*_alignedPosition.x-it*_alignedPosition.y,_rotatedPosition.y=it*_alignedPosition.x+ot*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),tt.copy(et),tt.x+=_rotatedPosition.x,tt.y+=_rotatedPosition.y,tt.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(et){super.copy(et,!1);const nt=et.levels;for(let rt=0,it=nt.length;rt0){let rt,it;for(rt=1,it=nt.length;rt0){_v1$2.setFromMatrixPosition(this.matrixWorld);const it=et.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(it).raycast(et,nt)}}update(et){const nt=this.levels;if(nt.length>1){_v1$2.setFromMatrixPosition(et.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const rt=_v1$2.distanceTo(_v2$1)/et.zoom;nt[0].object.visible=!0;let it,ot;for(it=1,ot=nt.length;it=nt[it].distance;it++)nt[it-1].object.visible=!1,nt[it].object.visible=!0;for(this._currentLevel=it-1;itlt)continue;dt.applyMatrix4(this.matrixWorld);const Et=et.ray.origin.distanceTo(dt);Etet.far||nt.push({distance:Et,point:ht.clone().applyMatrix4(this.matrixWorld),index:xt,face:null,faceIndex:null,object:this})}}else{const bt=Math.max(0,at.start),wt=Math.min(yt.count,at.start+at.count);for(let xt=bt,kt=wt-1;xtlt)continue;dt.applyMatrix4(this.matrixWorld);const Tt=et.ray.origin.distanceTo(dt);Ttet.far||nt.push({distance:Tt,point:ht.clone().applyMatrix4(this.matrixWorld),index:xt,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const nt=this.geometry.morphAttributes,rt=Object.keys(nt);if(rt.length>0){const it=nt[rt[0]];if(it!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=it.length;ot0){const it=nt[rt[0]];if(it!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=it.length;otit.far)return;ot.push({distance:ct,distanceToRay:Math.sqrt(st),point:lt,index:et,face:null,object:at})}}class VideoTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct){super(et,nt,rt,it,ot,at,st,lt,ct),this.isVideoTexture=!0,this.minFilter=at!==void 0?at:LinearFilter,this.magFilter=ot!==void 0?ot:LinearFilter,this.generateMipmaps=!1;const ut=this;function ht(){ut.needsUpdate=!0,et.requestVideoFrameCallback(ht)}"requestVideoFrameCallback"in et&&et.requestVideoFrameCallback(ht)}clone(){return new this.constructor(this.image).copy(this)}update(){const et=this.image;"requestVideoFrameCallback"in et===!1&&et.readyState>=et.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(et,nt,rt){super({width:et,height:nt}),this.isFramebufferTexture=!0,this.format=rt,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt){super(null,at,st,lt,ct,ut,it,ot,ht,dt),this.isCompressedTexture=!0,this.image={width:nt,height:rt},this.mipmaps=et,this.flipY=!1,this.generateMipmaps=!1}}class CanvasTexture extends Texture{constructor(et,nt,rt,it,ot,at,st,lt,ct){super(et,nt,rt,it,ot,at,st,lt,ct),this.isCanvasTexture=!0,this.needsUpdate=!0}}let Curve$1=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(et,nt){const rt=this.getUtoTmapping(et);return this.getPoint(rt,nt)}getPoints(et=5){const nt=[];for(let rt=0;rt<=et;rt++)nt.push(this.getPoint(rt/et));return nt}getSpacedPoints(et=5){const nt=[];for(let rt=0;rt<=et;rt++)nt.push(this.getPointAt(rt/et));return nt}getLength(){const et=this.getLengths();return et[et.length-1]}getLengths(et=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===et+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const nt=[];let rt,it=this.getPoint(0),ot=0;nt.push(0);for(let at=1;at<=et;at++)rt=this.getPoint(at/et),ot+=rt.distanceTo(it),nt.push(ot),it=rt;return this.cacheArcLengths=nt,nt}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(et,nt){const rt=this.getLengths();let it=0;const ot=rt.length;let at;nt?at=nt:at=et*rt[ot-1];let st=0,lt=ot-1,ct;for(;st<=lt;)if(it=Math.floor(st+(lt-st)/2),ct=rt[it]-at,ct<0)st=it+1;else if(ct>0)lt=it-1;else{lt=it;break}if(it=lt,rt[it]===at)return it/(ot-1);const ut=rt[it],dt=rt[it+1]-ut,pt=(at-ut)/dt;return(it+pt)/(ot-1)}getTangent(et,nt){let it=et-1e-4,ot=et+1e-4;it<0&&(it=0),ot>1&&(ot=1);const at=this.getPoint(it),st=this.getPoint(ot),lt=nt||(at.isVector2?new Vector2:new Vector3);return lt.copy(st).sub(at).normalize(),lt}getTangentAt(et,nt){const rt=this.getUtoTmapping(et);return this.getTangent(rt,nt)}computeFrenetFrames(et,nt){const rt=new Vector3,it=[],ot=[],at=[],st=new Vector3,lt=new Matrix4;for(let pt=0;pt<=et;pt++){const mt=pt/et;it[pt]=this.getTangentAt(mt,new Vector3)}ot[0]=new Vector3,at[0]=new Vector3;let ct=Number.MAX_VALUE;const ut=Math.abs(it[0].x),ht=Math.abs(it[0].y),dt=Math.abs(it[0].z);ut<=ct&&(ct=ut,rt.set(1,0,0)),ht<=ct&&(ct=ht,rt.set(0,1,0)),dt<=ct&&rt.set(0,0,1),st.crossVectors(it[0],rt).normalize(),ot[0].crossVectors(it[0],st),at[0].crossVectors(it[0],ot[0]);for(let pt=1;pt<=et;pt++){if(ot[pt]=ot[pt-1].clone(),at[pt]=at[pt-1].clone(),st.crossVectors(it[pt-1],it[pt]),st.length()>Number.EPSILON){st.normalize();const mt=Math.acos(clamp$6(it[pt-1].dot(it[pt]),-1,1));ot[pt].applyMatrix4(lt.makeRotationAxis(st,mt))}at[pt].crossVectors(it[pt],ot[pt])}if(nt===!0){let pt=Math.acos(clamp$6(ot[0].dot(ot[et]),-1,1));pt/=et,it[0].dot(st.crossVectors(ot[0],ot[et]))>0&&(pt=-pt);for(let mt=1;mt<=et;mt++)ot[mt].applyMatrix4(lt.makeRotationAxis(it[mt],pt*mt)),at[mt].crossVectors(it[mt],ot[mt])}return{tangents:it,normals:ot,binormals:at}}clone(){return new this.constructor().copy(this)}copy(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}toJSON(){const et={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return et.arcLengthDivisions=this.arcLengthDivisions,et.type=this.type,et}fromJSON(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}};class EllipseCurve extends Curve$1{constructor(et=0,nt=0,rt=1,it=1,ot=0,at=Math.PI*2,st=!1,lt=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=et,this.aY=nt,this.xRadius=rt,this.yRadius=it,this.aStartAngle=ot,this.aEndAngle=at,this.aClockwise=st,this.aRotation=lt}getPoint(et,nt){const rt=nt||new Vector2,it=Math.PI*2;let ot=this.aEndAngle-this.aStartAngle;const at=Math.abs(ot)it;)ot-=it;ot0?0:(Math.floor(Math.abs(st)/ot)+1)*ot:lt===0&&st===ot-1&&(st=ot-2,lt=1);let ct,ut;this.closed||st>0?ct=it[(st-1)%ot]:(tmp.subVectors(it[0],it[1]).add(it[0]),ct=tmp);const ht=it[st%ot],dt=it[(st+1)%ot];if(this.closed||st+2it.length-2?it.length-1:at+1],ht=it[at>it.length-3?it.length-1:at+2];return rt.set(CatmullRom(st,lt.x,ct.x,ut.x,ht.x),CatmullRom(st,lt.y,ct.y,ut.y,ht.y)),rt}copy(et){super.copy(et),this.points=[];for(let nt=0,rt=et.points.length;nt=rt){const at=it[ot]-rt,st=this.curves[ot],lt=st.getLength(),ct=lt===0?0:1-at/lt;return st.getPointAt(ct,nt)}ot++}return null}getLength(){const et=this.getCurveLengths();return et[et.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const et=[];let nt=0;for(let rt=0,it=this.curves.length;rt1&&!nt[nt.length-1].equals(nt[0])&&nt.push(nt[0]),nt}copy(et){super.copy(et),this.curves=[];for(let nt=0,rt=et.curves.length;nt0){const ht=ct.getPoint(0);ht.equals(this.currentPoint)||this.lineTo(ht.x,ht.y)}this.curves.push(ct);const ut=ct.getPoint(1);return this.currentPoint.copy(ut),this}copy(et){return super.copy(et),this.currentPoint.copy(et.currentPoint),this}toJSON(){const et=super.toJSON();return et.currentPoint=this.currentPoint.toArray(),et}fromJSON(et){return super.fromJSON(et),this.currentPoint.fromArray(et.currentPoint),this}};class LatheGeometry extends BufferGeometry{constructor(et=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],nt=12,rt=0,it=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:et,segments:nt,phiStart:rt,phiLength:it},nt=Math.floor(nt),it=clamp$6(it,0,Math.PI*2);const ot=[],at=[],st=[],lt=[],ct=[],ut=1/nt,ht=new Vector3,dt=new Vector2,pt=new Vector3,mt=new Vector3,gt=new Vector3;let yt=0,bt=0;for(let wt=0;wt<=et.length-1;wt++)switch(wt){case 0:yt=et[wt+1].x-et[wt].x,bt=et[wt+1].y-et[wt].y,pt.x=bt*1,pt.y=-yt,pt.z=bt*0,gt.copy(pt),pt.normalize(),lt.push(pt.x,pt.y,pt.z);break;case et.length-1:lt.push(gt.x,gt.y,gt.z);break;default:yt=et[wt+1].x-et[wt].x,bt=et[wt+1].y-et[wt].y,pt.x=bt*1,pt.y=-yt,pt.z=bt*0,mt.copy(pt),pt.x+=gt.x,pt.y+=gt.y,pt.z+=gt.z,pt.normalize(),lt.push(pt.x,pt.y,pt.z),gt.copy(mt)}for(let wt=0;wt<=nt;wt++){const xt=rt+wt*ut*it,kt=Math.sin(xt),St=Math.cos(xt);for(let Tt=0;Tt<=et.length-1;Tt++){ht.x=et[Tt].x*kt,ht.y=et[Tt].y,ht.z=et[Tt].x*St,at.push(ht.x,ht.y,ht.z),dt.x=wt/nt,dt.y=Tt/(et.length-1),st.push(dt.x,dt.y);const At=lt[3*Tt+0]*kt,Et=lt[3*Tt+1],Ct=lt[3*Tt+0]*St;ct.push(At,Et,Ct)}}for(let wt=0;wt0&&xt(!0),nt>0&&xt(!1)),this.setIndex(ut),this.setAttribute("position",new Float32BufferAttribute(ht,3)),this.setAttribute("normal",new Float32BufferAttribute(dt,3)),this.setAttribute("uv",new Float32BufferAttribute(pt,2));function wt(){const kt=new Vector3,St=new Vector3;let Tt=0;const At=(nt-et)/rt;for(let Et=0;Et<=ot;Et++){const Ct=[],Lt=Et/ot,jt=Lt*(nt-et)+et;for(let Rt=0;Rt<=it;Rt++){const $t=Rt/it,vt=$t*lt+st,It=Math.sin(vt),Ot=Math.cos(vt);St.x=jt*It,St.y=-Lt*rt+yt,St.z=jt*Ot,ht.push(St.x,St.y,St.z),kt.set(It,At,Ot).normalize(),dt.push(kt.x,kt.y,kt.z),pt.push($t,1-Lt),Ct.push(mt++)}gt.push(Ct)}for(let Et=0;Et.9&&At<.1&&(xt<.2&&(at[wt+0]+=1),kt<.2&&(at[wt+2]+=1),St<.2&&(at[wt+4]+=1))}}function dt(wt){ot.push(wt.x,wt.y,wt.z)}function pt(wt,xt){const kt=wt*3;xt.x=et[kt+0],xt.y=et[kt+1],xt.z=et[kt+2]}function mt(){const wt=new Vector3,xt=new Vector3,kt=new Vector3,St=new Vector3,Tt=new Vector2,At=new Vector2,Et=new Vector2;for(let Ct=0,Lt=0;Ct80*nt){st=ct=tt[0],lt=ut=tt[1];for(let mt=nt;mtct&&(ct=ht),dt>ut&&(ut=dt);pt=Math.max(ct-st,ut-lt),pt=pt!==0?1/pt:0}return earcutLinked(ot,at,nt,st,lt,pt),at}};function linkedList(tt,et,nt,rt,it){let ot,at;if(it===signedArea(tt,et,nt,rt)>0)for(ot=et;ot=et;ot-=rt)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);let nt=tt,rt;do if(rt=!1,!nt.steiner&&(equals(nt,nt.next)||area(nt.prev,nt,nt.next)===0)){if(removeNode(nt),nt=et=nt.prev,nt===nt.next)break;rt=!0}else nt=nt.next;while(rt||nt!==et);return et}function earcutLinked(tt,et,nt,rt,it,ot,at){if(!tt)return;!at&&ot&&indexCurve(tt,rt,it,ot);let st=tt,lt,ct;for(;tt.prev!==tt.next;){if(lt=tt.prev,ct=tt.next,ot?isEarHashed(tt,rt,it,ot):isEar(tt)){et.push(lt.i/nt),et.push(tt.i/nt),et.push(ct.i/nt),removeNode(tt),tt=ct.next,st=ct.next;continue}if(tt=ct,tt===st){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,nt),earcutLinked(tt,et,nt,rt,it,ot,2)):at===2&&splitEarcut(tt,et,nt,rt,it,ot):earcutLinked(filterPoints(tt),et,nt,rt,it,ot,1);break}}}function isEar(tt){const et=tt.prev,nt=tt,rt=tt.next;if(area(et,nt,rt)>=0)return!1;let it=tt.next.next;for(;it!==tt.prev;){if(pointInTriangle(et.x,et.y,nt.x,nt.y,rt.x,rt.y,it.x,it.y)&&area(it.prev,it,it.next)>=0)return!1;it=it.next}return!0}function isEarHashed(tt,et,nt,rt){const it=tt.prev,ot=tt,at=tt.next;if(area(it,ot,at)>=0)return!1;const st=it.xot.x?it.x>at.x?it.x:at.x:ot.x>at.x?ot.x:at.x,ut=it.y>ot.y?it.y>at.y?it.y:at.y:ot.y>at.y?ot.y:at.y,ht=zOrder(st,lt,et,nt,rt),dt=zOrder(ct,ut,et,nt,rt);let pt=tt.prevZ,mt=tt.nextZ;for(;pt&&pt.z>=ht&&mt&&mt.z<=dt;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0||(pt=pt.prevZ,mt!==tt.prev&&mt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0))return!1;mt=mt.nextZ}for(;pt&&pt.z>=ht;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0)return!1;pt=pt.prevZ}for(;mt&&mt.z<=dt;){if(mt!==tt.prev&&mt!==tt.next&&pointInTriangle(it.x,it.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0)return!1;mt=mt.nextZ}return!0}function cureLocalIntersections(tt,et,nt){let rt=tt;do{const it=rt.prev,ot=rt.next.next;!equals(it,ot)&&intersects(it,rt,rt.next,ot)&&locallyInside(it,ot)&&locallyInside(ot,it)&&(et.push(it.i/nt),et.push(rt.i/nt),et.push(ot.i/nt),removeNode(rt),removeNode(rt.next),rt=tt=ot),rt=rt.next}while(rt!==tt);return filterPoints(rt)}function splitEarcut(tt,et,nt,rt,it,ot){let at=tt;do{let st=at.next.next;for(;st!==at.prev;){if(at.i!==st.i&&isValidDiagonal(at,st)){let lt=splitPolygon(at,st);at=filterPoints(at,at.next),lt=filterPoints(lt,lt.next),earcutLinked(at,et,nt,rt,it,ot),earcutLinked(lt,et,nt,rt,it,ot);return}st=st.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,nt,rt){const it=[];let ot,at,st,lt,ct;for(ot=0,at=et.length;ot=nt.next.y&&nt.next.y!==nt.y){const dt=nt.x+(it-nt.y)*(nt.next.x-nt.x)/(nt.next.y-nt.y);if(dt<=rt&&dt>ot){if(ot=dt,dt===rt){if(it===nt.y)return nt;if(it===nt.next.y)return nt.next}at=nt.x=nt.x&&nt.x>=lt&&rt!==nt.x&&pointInTriangle(itat.x||nt.x===at.x&§orContainsSector(at,nt)))&&(at=nt,ut=ht)),nt=nt.next;while(nt!==st);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,nt,rt){let it=tt;do it.z===null&&(it.z=zOrder(it.x,it.y,et,nt,rt)),it.prevZ=it.prev,it.nextZ=it.next,it=it.next;while(it!==tt);it.prevZ.nextZ=null,it.prevZ=null,sortLinked(it)}function sortLinked(tt){let et,nt,rt,it,ot,at,st,lt,ct=1;do{for(nt=tt,tt=null,ot=null,at=0;nt;){for(at++,rt=nt,st=0,et=0;et0||lt>0&&rt;)st!==0&&(lt===0||!rt||nt.z<=rt.z)?(it=nt,nt=nt.nextZ,st--):(it=rt,rt=rt.nextZ,lt--),ot?ot.nextZ=it:tt=it,it.prevZ=ot,ot=it;nt=rt}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,nt,rt,it){return tt=32767*(tt-nt)*it,et=32767*(et-rt)*it,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){let et=tt,nt=tt;do(et.x=0&&(tt-at)*(rt-st)-(nt-at)*(et-st)>=0&&(nt-at)*(ot-st)-(it-at)*(rt-st)>=0}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,nt){return(et.y-tt.y)*(nt.x-et.x)-(et.x-tt.x)*(nt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,nt,rt){const it=sign$4(area(tt,et,nt)),ot=sign$4(area(tt,et,rt)),at=sign$4(area(nt,rt,tt)),st=sign$4(area(nt,rt,et));return!!(it!==ot&&at!==st||it===0&&onSegment(tt,nt,et)||ot===0&&onSegment(tt,rt,et)||at===0&&onSegment(nt,tt,rt)||st===0&&onSegment(nt,et,rt))}function onSegment(tt,et,nt){return et.x<=Math.max(tt.x,nt.x)&&et.x>=Math.min(tt.x,nt.x)&&et.y<=Math.max(tt.y,nt.y)&&et.y>=Math.min(tt.y,nt.y)}function sign$4(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){let nt=tt;do{if(nt.i!==tt.i&&nt.next.i!==tt.i&&nt.i!==et.i&&nt.next.i!==et.i&&intersects(nt,nt.next,tt,et))return!0;nt=nt.next}while(nt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){let nt=tt,rt=!1;const it=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do nt.y>ot!=nt.next.y>ot&&nt.next.y!==nt.y&&it<(nt.next.x-nt.x)*(ot-nt.y)/(nt.next.y-nt.y)+nt.x&&(rt=!rt),nt=nt.next;while(nt!==tt);return rt}function splitPolygon(tt,et){const nt=new Node$4(tt.i,tt.x,tt.y),rt=new Node$4(et.i,et.x,et.y),it=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,nt.next=it,it.prev=nt,rt.next=nt,nt.prev=rt,ot.next=rt,rt.prev=ot,rt}function insertNode(tt,et,nt,rt){const it=new Node$4(tt,et,nt);return rt?(it.next=rt.next,it.prev=rt,rt.next.prev=it,rt.next=it):(it.prev=it,it.next=it),it}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$4(tt,et,nt){this.i=tt,this.x=et,this.y=nt,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(tt,et,nt,rt){let it=0;for(let ot=et,at=nt-rt;ot2&&tt[et-1].equals(tt[0])&&tt.pop()}function addContour(tt,et){for(let nt=0;ntNumber.EPSILON){const fn=Math.sqrt(yn),xn=Math.sqrt(Tn*Tn+In*In),jn=vn.x-pn/fn,cn=vn.y+sn/fn,Xt=Cn.x-In/xn,Kt=Cn.y+Tn/xn,kn=((Xt-jn)*In-(Kt-cn)*Tn)/(sn*In-pn*Tn);$n=jn+sn*kn-Zt.x,Nn=cn+pn*kn-Zt.y;const Mn=$n*$n+Nn*Nn;if(Mn<=2)return new Vector2($n,Nn);En=Math.sqrt(Mn/2)}else{let fn=!1;sn>Number.EPSILON?Tn>Number.EPSILON&&(fn=!0):sn<-Number.EPSILON?Tn<-Number.EPSILON&&(fn=!0):Math.sign(pn)===Math.sign(In)&&(fn=!0),fn?($n=-pn,Nn=sn,En=Math.sqrt(yn)):($n=sn,Nn=pn,En=Math.sqrt(yn/2))}return new Vector2($n/En,Nn/En)}const Ft=[];for(let Zt=0,vn=vt.length,Cn=vn-1,$n=Zt+1;Zt=0;Zt--){const vn=Zt/yt,Cn=pt*Math.cos(vn*Math.PI/2),$n=mt*Math.sin(vn*Math.PI/2)+gt;for(let Nn=0,En=vt.length;Nn=0;){const $n=Cn;let Nn=Cn-1;Nn<0&&(Nn=Zt.length-1);for(let En=0,sn=ut+yt*2;En0)&&pt.push(xt,kt,Tt),(bt!==rt-1||lt0!=et>0&&this.version++,this._sheen=et}get clearcoat(){return this._clearcoat}set clearcoat(et){this._clearcoat>0!=et>0&&this.version++,this._clearcoat=et}get iridescence(){return this._iridescence}set iridescence(et){this._iridescence>0!=et>0&&this.version++,this._iridescence=et}get transmission(){return this._transmission}set transmission(et){this._transmission>0!=et>0&&this.version++,this._transmission=et}copy(et){return super.copy(et),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=et.clearcoat,this.clearcoatMap=et.clearcoatMap,this.clearcoatRoughness=et.clearcoatRoughness,this.clearcoatRoughnessMap=et.clearcoatRoughnessMap,this.clearcoatNormalMap=et.clearcoatNormalMap,this.clearcoatNormalScale.copy(et.clearcoatNormalScale),this.ior=et.ior,this.iridescence=et.iridescence,this.iridescenceMap=et.iridescenceMap,this.iridescenceIOR=et.iridescenceIOR,this.iridescenceThicknessRange=[...et.iridescenceThicknessRange],this.iridescenceThicknessMap=et.iridescenceThicknessMap,this.sheen=et.sheen,this.sheenColor.copy(et.sheenColor),this.sheenColorMap=et.sheenColorMap,this.sheenRoughness=et.sheenRoughness,this.sheenRoughnessMap=et.sheenRoughnessMap,this.transmission=et.transmission,this.transmissionMap=et.transmissionMap,this.thickness=et.thickness,this.thicknessMap=et.thicknessMap,this.attenuationDistance=et.attenuationDistance,this.attenuationColor.copy(et.attenuationColor),this.specularIntensity=et.specularIntensity,this.specularIntensityMap=et.specularIntensityMap,this.specularColor.copy(et.specularColor),this.specularColorMap=et.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(et){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color$1(16777215),this.specular=new Color$1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.specular.copy(et.specular),this.shininess=et.shininess,this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.flatShading=et.flatShading,this.fog=et.fog,this}}class MeshToonMaterial extends Material{constructor(et){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color$1(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.gradientMap=et.gradientMap,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshNormalMaterial extends Material{constructor(et){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(et)}copy(et){return super.copy(et),this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.flatShading=et.flatShading,this}}class MeshLambertMaterial extends Material{constructor(et){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshMatcapMaterial extends Material{constructor(et){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color$1(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.defines={MATCAP:""},this.color.copy(et.color),this.matcap=et.matcap,this.map=et.map,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.flatShading=et.flatShading,this.fog=et.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(et){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(et)}copy(et){return super.copy(et),this.scale=et.scale,this.dashSize=et.dashSize,this.gapSize=et.gapSize,this}}function arraySlice(tt,et,nt){return isTypedArray$5(tt)?new tt.constructor(tt.subarray(et,nt!==void 0?nt:tt.length)):tt.slice(et,nt)}function convertArray(tt,et,nt){return!tt||!nt&&tt.constructor===et?tt:typeof et.BYTES_PER_ELEMENT=="number"?new et(tt):Array.prototype.slice.call(tt)}function isTypedArray$5(tt){return ArrayBuffer.isView(tt)&&!(tt instanceof DataView)}function getKeyframeOrder(tt){function et(it,ot){return tt[it]-tt[ot]}const nt=tt.length,rt=new Array(nt);for(let it=0;it!==nt;++it)rt[it]=it;return rt.sort(et),rt}function sortedArray(tt,et,nt){const rt=tt.length,it=new tt.constructor(rt);for(let ot=0,at=0;at!==rt;++ot){const st=nt[ot]*et;for(let lt=0;lt!==et;++lt)it[at++]=tt[st+lt]}return it}function flattenJSON(tt,et,nt,rt){let it=1,ot=tt[0];for(;ot!==void 0&&ot[rt]===void 0;)ot=tt[it++];if(ot===void 0)return;let at=ot[rt];if(at!==void 0)if(Array.isArray(at))do at=ot[rt],at!==void 0&&(et.push(ot.time),nt.push.apply(nt,at)),ot=tt[it++];while(ot!==void 0);else if(at.toArray!==void 0)do at=ot[rt],at!==void 0&&(et.push(ot.time),at.toArray(nt,nt.length)),ot=tt[it++];while(ot!==void 0);else do at=ot[rt],at!==void 0&&(et.push(ot.time),nt.push(at)),ot=tt[it++];while(ot!==void 0)}function subclip(tt,et,nt,rt,it=30){const ot=tt.clone();ot.name=et;const at=[];for(let lt=0;lt=rt)){ht.push(ct.times[pt]);for(let gt=0;gtot.tracks[lt].times[0]&&(st=ot.tracks[lt].times[0]);for(let lt=0;lt=st.times[mt]){const bt=mt*ht+ut,wt=bt+ht-ut;gt=arraySlice(st.values,bt,wt)}else{const bt=st.createInterpolant(),wt=ut,xt=ht-ut;bt.evaluate(ot),gt=arraySlice(bt.resultBuffer,wt,xt)}lt==="quaternion"&&new Quaternion().fromArray(gt).normalize().conjugate().toArray(gt);const yt=ct.times.length;for(let bt=0;bt=ot)){const st=nt[1];et=ot)break t}at=rt,rt=0;break n}break e}for(;rt>>1;etnt;)--at;if(++at,ot!==0||at!==it){ot>=at&&(at=Math.max(at,1),ot=at-1);const st=this.getValueSize();this.times=arraySlice(rt,ot,at),this.values=arraySlice(this.values,ot*st,at*st)}return this}validate(){let et=!0;const nt=this.getValueSize();nt-Math.floor(nt)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),et=!1);const rt=this.times,it=this.values,ot=rt.length;ot===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),et=!1);let at=null;for(let st=0;st!==ot;st++){const lt=rt[st];if(typeof lt=="number"&&isNaN(lt)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,st,lt),et=!1;break}if(at!==null&&at>lt){console.error("THREE.KeyframeTrack: Out of order keys.",this,st,lt,at),et=!1;break}at=lt}if(it!==void 0&&isTypedArray$5(it))for(let st=0,lt=it.length;st!==lt;++st){const ct=it[st];if(isNaN(ct)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,st,ct),et=!1;break}}return et}optimize(){const et=arraySlice(this.times),nt=arraySlice(this.values),rt=this.getValueSize(),it=this.getInterpolation()===InterpolateSmooth,ot=et.length-1;let at=1;for(let st=1;st0){et[at]=et[ot];for(let st=ot*rt,lt=at*rt,ct=0;ct!==rt;++ct)nt[lt+ct]=nt[st+ct];++at}return at!==et.length?(this.times=arraySlice(et,0,at),this.values=arraySlice(nt,0,at*rt)):(this.times=et,this.values=nt),this}clone(){const et=arraySlice(this.times,0),nt=arraySlice(this.values,0),rt=this.constructor,it=new rt(this.name,et,nt);return it.createInterpolant=this.createInterpolant,it}}KeyframeTrack.prototype.TimeBufferType=Float32Array;KeyframeTrack.prototype.ValueBufferType=Float32Array;KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool";BooleanKeyframeTrack.prototype.ValueBufferType=Array;BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(et,nt,rt,it){super(et,nt,rt,it)}interpolate_(et,nt,rt,it){const ot=this.resultBuffer,at=this.sampleValues,st=this.valueSize,lt=(rt-nt)/(it-nt);let ct=et*st;for(let ut=ct+st;ct!==ut;ct+=4)Quaternion.slerpFlat(ot,0,at,ct-st,at,ct,lt);return ot}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(et){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),et)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion";QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string";StringKeyframeTrack.prototype.ValueBufferType=Array;StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(et,nt=-1,rt,it=NormalAnimationBlendMode){this.name=et,this.tracks=rt,this.duration=nt,this.blendMode=it,this.uuid=generateUUID$1(),this.duration<0&&this.resetDuration()}static parse(et){const nt=[],rt=et.tracks,it=1/(et.fps||1);for(let at=0,st=rt.length;at!==st;++at)nt.push(parseKeyframeTrack(rt[at]).scale(it));const ot=new this(et.name,et.duration,nt,et.blendMode);return ot.uuid=et.uuid,ot}static toJSON(et){const nt=[],rt=et.tracks,it={name:et.name,duration:et.duration,tracks:nt,uuid:et.uuid,blendMode:et.blendMode};for(let ot=0,at=rt.length;ot!==at;++ot)nt.push(KeyframeTrack.toJSON(rt[ot]));return it}static CreateFromMorphTargetSequence(et,nt,rt,it){const ot=nt.length,at=[];for(let st=0;st1){const ht=ut[1];let dt=it[ht];dt||(it[ht]=dt=[]),dt.push(ct)}}const at=[];for(const st in it)at.push(this.CreateFromMorphTargetSequence(st,it[st],nt,rt));return at}static parseAnimation(et,nt){if(!et)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const rt=function(ht,dt,pt,mt,gt){if(pt.length!==0){const yt=[],bt=[];flattenJSON(pt,yt,bt,mt),yt.length!==0&>.push(new ht(dt,yt,bt))}},it=[],ot=et.name||"default",at=et.fps||30,st=et.blendMode;let lt=et.length||-1;const ct=et.hierarchy||[];for(let ht=0;ht{nt&&nt(ot),this.manager.itemEnd(et)},0),ot;if(loading[et]!==void 0){loading[et].push({onLoad:nt,onProgress:rt,onError:it});return}loading[et]=[],loading[et].push({onLoad:nt,onProgress:rt,onError:it});const at=new Request(et,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),st=this.mimeType,lt=this.responseType;fetch(at).then(ct=>{if(ct.status===200||ct.status===0){if(ct.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||ct.body===void 0||ct.body.getReader===void 0)return ct;const ut=loading[et],ht=ct.body.getReader(),dt=ct.headers.get("Content-Length"),pt=dt?parseInt(dt):0,mt=pt!==0;let gt=0;const yt=new ReadableStream({start(bt){wt();function wt(){ht.read().then(({done:xt,value:kt})=>{if(xt)bt.close();else{gt+=kt.byteLength;const St=new ProgressEvent("progress",{lengthComputable:mt,loaded:gt,total:pt});for(let Tt=0,At=ut.length;Tt{switch(lt){case"arraybuffer":return ct.arrayBuffer();case"blob":return ct.blob();case"document":return ct.text().then(ut=>new DOMParser().parseFromString(ut,st));case"json":return ct.json();default:if(st===void 0)return ct.text();{const ht=/charset="?([^;"\s]*)"?/i.exec(st),dt=ht&&ht[1]?ht[1].toLowerCase():void 0,pt=new TextDecoder(dt);return ct.arrayBuffer().then(mt=>pt.decode(mt))}}}).then(ct=>{Cache.add(et,ct);const ut=loading[et];delete loading[et];for(let ht=0,dt=ut.length;ht{const ut=loading[et];if(ut===void 0)throw this.manager.itemError(et),ct;delete loading[et];for(let ht=0,dt=ut.length;ht{this.manager.itemEnd(et)}),this.manager.itemStart(et)}setResponseType(et){return this.responseType=et,this}setMimeType(et){return this.mimeType=et,this}}class AnimationLoader extends Loader$2{constructor(et){super(et)}load(et,nt,rt,it){const ot=this,at=new FileLoader(this.manager);at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{nt(ot.parse(JSON.parse(st)))}catch(lt){it?it(lt):console.error(lt),ot.manager.itemError(et)}},rt,it)}parse(et){const nt=[];for(let rt=0;rt0:it.vertexColors=et.vertexColors),et.uniforms!==void 0)for(const ot in et.uniforms){const at=et.uniforms[ot];switch(it.uniforms[ot]={},at.type){case"t":it.uniforms[ot].value=rt(at.value);break;case"c":it.uniforms[ot].value=new Color$1().setHex(at.value);break;case"v2":it.uniforms[ot].value=new Vector2().fromArray(at.value);break;case"v3":it.uniforms[ot].value=new Vector3().fromArray(at.value);break;case"v4":it.uniforms[ot].value=new Vector4().fromArray(at.value);break;case"m3":it.uniforms[ot].value=new Matrix3().fromArray(at.value);break;case"m4":it.uniforms[ot].value=new Matrix4().fromArray(at.value);break;default:it.uniforms[ot].value=at.value}}if(et.defines!==void 0&&(it.defines=et.defines),et.vertexShader!==void 0&&(it.vertexShader=et.vertexShader),et.fragmentShader!==void 0&&(it.fragmentShader=et.fragmentShader),et.extensions!==void 0)for(const ot in et.extensions)it.extensions[ot]=et.extensions[ot];if(et.shading!==void 0&&(it.flatShading=et.shading===1),et.size!==void 0&&(it.size=et.size),et.sizeAttenuation!==void 0&&(it.sizeAttenuation=et.sizeAttenuation),et.map!==void 0&&(it.map=rt(et.map)),et.matcap!==void 0&&(it.matcap=rt(et.matcap)),et.alphaMap!==void 0&&(it.alphaMap=rt(et.alphaMap)),et.bumpMap!==void 0&&(it.bumpMap=rt(et.bumpMap)),et.bumpScale!==void 0&&(it.bumpScale=et.bumpScale),et.normalMap!==void 0&&(it.normalMap=rt(et.normalMap)),et.normalMapType!==void 0&&(it.normalMapType=et.normalMapType),et.normalScale!==void 0){let ot=et.normalScale;Array.isArray(ot)===!1&&(ot=[ot,ot]),it.normalScale=new Vector2().fromArray(ot)}return et.displacementMap!==void 0&&(it.displacementMap=rt(et.displacementMap)),et.displacementScale!==void 0&&(it.displacementScale=et.displacementScale),et.displacementBias!==void 0&&(it.displacementBias=et.displacementBias),et.roughnessMap!==void 0&&(it.roughnessMap=rt(et.roughnessMap)),et.metalnessMap!==void 0&&(it.metalnessMap=rt(et.metalnessMap)),et.emissiveMap!==void 0&&(it.emissiveMap=rt(et.emissiveMap)),et.emissiveIntensity!==void 0&&(it.emissiveIntensity=et.emissiveIntensity),et.specularMap!==void 0&&(it.specularMap=rt(et.specularMap)),et.specularIntensityMap!==void 0&&(it.specularIntensityMap=rt(et.specularIntensityMap)),et.specularColorMap!==void 0&&(it.specularColorMap=rt(et.specularColorMap)),et.envMap!==void 0&&(it.envMap=rt(et.envMap)),et.envMapIntensity!==void 0&&(it.envMapIntensity=et.envMapIntensity),et.reflectivity!==void 0&&(it.reflectivity=et.reflectivity),et.refractionRatio!==void 0&&(it.refractionRatio=et.refractionRatio),et.lightMap!==void 0&&(it.lightMap=rt(et.lightMap)),et.lightMapIntensity!==void 0&&(it.lightMapIntensity=et.lightMapIntensity),et.aoMap!==void 0&&(it.aoMap=rt(et.aoMap)),et.aoMapIntensity!==void 0&&(it.aoMapIntensity=et.aoMapIntensity),et.gradientMap!==void 0&&(it.gradientMap=rt(et.gradientMap)),et.clearcoatMap!==void 0&&(it.clearcoatMap=rt(et.clearcoatMap)),et.clearcoatRoughnessMap!==void 0&&(it.clearcoatRoughnessMap=rt(et.clearcoatRoughnessMap)),et.clearcoatNormalMap!==void 0&&(it.clearcoatNormalMap=rt(et.clearcoatNormalMap)),et.clearcoatNormalScale!==void 0&&(it.clearcoatNormalScale=new Vector2().fromArray(et.clearcoatNormalScale)),et.iridescenceMap!==void 0&&(it.iridescenceMap=rt(et.iridescenceMap)),et.iridescenceThicknessMap!==void 0&&(it.iridescenceThicknessMap=rt(et.iridescenceThicknessMap)),et.transmissionMap!==void 0&&(it.transmissionMap=rt(et.transmissionMap)),et.thicknessMap!==void 0&&(it.thicknessMap=rt(et.thicknessMap)),et.sheenColorMap!==void 0&&(it.sheenColorMap=rt(et.sheenColorMap)),et.sheenRoughnessMap!==void 0&&(it.sheenRoughnessMap=rt(et.sheenRoughnessMap)),it}setTextures(et){return this.textures=et,this}static createMaterialFromType(et){const nt={ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material};return new nt[et]}}class LoaderUtils{static decodeText(et){if(typeof TextDecoder<"u")return new TextDecoder().decode(et);let nt="";for(let rt=0,it=et.length;rt0){const lt=new LoadingManager(nt);ot=new ImageLoader(lt),ot.setCrossOrigin(this.crossOrigin);for(let ct=0,ut=et.length;ct0){it=new ImageLoader(this.manager),it.setCrossOrigin(this.crossOrigin);for(let at=0,st=et.length;at"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(et){return this.options=et,this}load(et,nt,rt,it){et===void 0&&(et=""),this.path!==void 0&&(et=this.path+et),et=this.manager.resolveURL(et);const ot=this,at=Cache.get(et);if(at!==void 0)return ot.manager.itemStart(et),setTimeout(function(){nt&&nt(at),ot.manager.itemEnd(et)},0),at;const st={};st.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",st.headers=this.requestHeader,fetch(et,st).then(function(lt){return lt.blob()}).then(function(lt){return createImageBitmap(lt,Object.assign(ot.options,{colorSpaceConversion:"none"}))}).then(function(lt){Cache.add(et,lt),nt&&nt(lt),ot.manager.itemEnd(et)}).catch(function(lt){it&&it(lt),ot.manager.itemError(et),ot.manager.itemEnd(et)}),ot.manager.itemStart(et)}}let _context$1;const AudioContext={getContext:function(){return _context$1===void 0&&(_context$1=new(window.AudioContext||window.webkitAudioContext)),_context$1},setContext:function(tt){_context$1=tt}};class AudioLoader extends Loader$2{constructor(et){super(et)}load(et,nt,rt,it){const ot=this,at=new FileLoader(this.manager);at.setResponseType("arraybuffer"),at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{const lt=st.slice(0);AudioContext.getContext().decodeAudioData(lt,function(ut){nt(ut)})}catch(lt){it?it(lt):console.error(lt),ot.manager.itemError(et)}},rt,it)}}class HemisphereLightProbe extends LightProbe{constructor(et,nt,rt=1){super(void 0,rt),this.isHemisphereLightProbe=!0;const it=new Color$1().set(et),ot=new Color$1().set(nt),at=new Vector3(it.r,it.g,it.b),st=new Vector3(ot.r,ot.g,ot.b),lt=Math.sqrt(Math.PI),ct=lt*Math.sqrt(.75);this.sh.coefficients[0].copy(at).add(st).multiplyScalar(lt),this.sh.coefficients[1].copy(at).sub(st).multiplyScalar(ct)}}class AmbientLightProbe extends LightProbe{constructor(et,nt=1){super(void 0,nt),this.isAmbientLightProbe=!0;const rt=new Color$1().set(et);this.sh.coefficients[0].set(rt.r,rt.g,rt.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const _eyeRight=new Matrix4,_eyeLeft=new Matrix4,_projectionMatrix=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(et){const nt=this._cache;if(nt.focus!==et.focus||nt.fov!==et.fov||nt.aspect!==et.aspect*this.aspect||nt.near!==et.near||nt.far!==et.far||nt.zoom!==et.zoom||nt.eyeSep!==this.eyeSep){nt.focus=et.focus,nt.fov=et.fov,nt.aspect=et.aspect*this.aspect,nt.near=et.near,nt.far=et.far,nt.zoom=et.zoom,nt.eyeSep=this.eyeSep,_projectionMatrix.copy(et.projectionMatrix);const it=nt.eyeSep/2,ot=it*nt.near/nt.focus,at=nt.near*Math.tan(DEG2RAD$1*nt.fov*.5)/nt.zoom;let st,lt;_eyeLeft.elements[12]=-it,_eyeRight.elements[12]=it,st=-at*nt.aspect+ot,lt=at*nt.aspect+ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraL.projectionMatrix.copy(_projectionMatrix),st=-at*nt.aspect-ot,lt=at*nt.aspect-ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraR.projectionMatrix.copy(_projectionMatrix)}this.cameraL.matrixWorld.copy(et.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(et.matrixWorld).multiply(_eyeRight)}}let Clock$1=class{constructor(et=!0){this.autoStart=et,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now$5(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let et=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const nt=now$5();et=(nt-this.oldTime)/1e3,this.oldTime=nt,this.elapsedTime+=et}return et}};function now$5(){return(typeof performance>"u"?Date:performance).now()}const _position$1=new Vector3,_quaternion$1=new Quaternion,_scale$1=new Vector3,_orientation$1=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock$1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(et){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=et,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(et){return this.gain.gain.setTargetAtTime(et,this.context.currentTime,.01),this}updateMatrixWorld(et){super.updateMatrixWorld(et);const nt=this.context.listener,rt=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1),_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1),nt.positionX){const it=this.context.currentTime+this.timeDelta;nt.positionX.linearRampToValueAtTime(_position$1.x,it),nt.positionY.linearRampToValueAtTime(_position$1.y,it),nt.positionZ.linearRampToValueAtTime(_position$1.z,it),nt.forwardX.linearRampToValueAtTime(_orientation$1.x,it),nt.forwardY.linearRampToValueAtTime(_orientation$1.y,it),nt.forwardZ.linearRampToValueAtTime(_orientation$1.z,it),nt.upX.linearRampToValueAtTime(rt.x,it),nt.upY.linearRampToValueAtTime(rt.y,it),nt.upZ.linearRampToValueAtTime(rt.z,it)}else nt.setPosition(_position$1.x,_position$1.y,_position$1.z),nt.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,rt.x,rt.y,rt.z)}}let Audio$1=class extends Object3D{constructor(et){super(),this.type="Audio",this.listener=et,this.context=et.context,this.gain=this.context.createGain(),this.gain.connect(et.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(et){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=et,this.connect(),this}setMediaElementSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(et),this.connect(),this}setMediaStreamSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(et),this.connect(),this}setBuffer(et){return this.buffer=et,this.sourceType="buffer",this.autoplay&&this.play(),this}play(et=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+et;const nt=this.context.createBufferSource();return nt.buffer=this.buffer,nt.loop=this.loop,nt.loopStart=this.loopStart,nt.loopEnd=this.loopEnd,nt.onended=this.onEnded.bind(this),nt.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=nt,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let et=1,nt=this.filters.length;et0){this.source.disconnect(this.filters[0]);for(let et=1,nt=this.filters.length;et0&&this._mixBufferRegionAdditive(rt,it,this._addIndex*nt,1,nt);for(let lt=nt,ct=nt+nt;lt!==ct;++lt)if(rt[lt]!==rt[lt+nt]){st.setValue(rt,it);break}}saveOriginalState(){const et=this.binding,nt=this.buffer,rt=this.valueSize,it=rt*this._origIndex;et.getValue(nt,it);for(let ot=rt,at=it;ot!==at;++ot)nt[ot]=nt[it+ot%rt];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const et=this.valueSize*3;this.binding.setValue(this.buffer,et)}_setAdditiveIdentityNumeric(){const et=this._addIndex*this.valueSize,nt=et+this.valueSize;for(let rt=et;rt=.5)for(let at=0;at!==ot;++at)et[nt+at]=et[rt+at]}_slerp(et,nt,rt,it){Quaternion.slerpFlat(et,nt,et,nt,et,rt,it)}_slerpAdditive(et,nt,rt,it,ot){const at=this._workIndex*ot;Quaternion.multiplyQuaternionsFlat(et,at,et,nt,et,rt),Quaternion.slerpFlat(et,nt,et,nt,et,at,it)}_lerp(et,nt,rt,it,ot){const at=1-it;for(let st=0;st!==ot;++st){const lt=nt+st;et[lt]=et[lt]*at+et[rt+st]*it}}_lerpAdditive(et,nt,rt,it,ot){for(let at=0;at!==ot;++at){const st=nt+at;et[st]=et[st]+et[rt+at]*it}}}const _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones"];class Composite{constructor(et,nt,rt){const it=rt||PropertyBinding.parseTrackName(nt);this._targetGroup=et,this._bindings=et.subscribe_(nt,it)}getValue(et,nt){this.bind();const rt=this._targetGroup.nCachedObjects_,it=this._bindings[rt];it!==void 0&&it.getValue(et,nt)}setValue(et,nt){const rt=this._bindings;for(let it=this._targetGroup.nCachedObjects_,ot=rt.length;it!==ot;++it)rt[it].setValue(et,nt)}bind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,rt=et.length;nt!==rt;++nt)et[nt].bind()}unbind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,rt=et.length;nt!==rt;++nt)et[nt].unbind()}}class PropertyBinding{constructor(et,nt,rt){this.path=nt,this.parsedPath=rt||PropertyBinding.parseTrackName(nt),this.node=PropertyBinding.findNode(et,this.parsedPath.nodeName)||et,this.rootNode=et,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(et,nt,rt){return et&&et.isAnimationObjectGroup?new PropertyBinding.Composite(et,nt,rt):new PropertyBinding(et,nt,rt)}static sanitizeNodeName(et){return et.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(et){const nt=_trackRe.exec(et);if(nt===null)throw new Error("PropertyBinding: Cannot parse trackName: "+et);const rt={nodeName:nt[2],objectName:nt[3],objectIndex:nt[4],propertyName:nt[5],propertyIndex:nt[6]},it=rt.nodeName&&rt.nodeName.lastIndexOf(".");if(it!==void 0&&it!==-1){const ot=rt.nodeName.substring(it+1);_supportedObjectNames.indexOf(ot)!==-1&&(rt.nodeName=rt.nodeName.substring(0,it),rt.objectName=ot)}if(rt.propertyName===null||rt.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+et);return rt}static findNode(et,nt){if(nt===void 0||nt===""||nt==="."||nt===-1||nt===et.name||nt===et.uuid)return et;if(et.skeleton){const rt=et.skeleton.getBoneByName(nt);if(rt!==void 0)return rt}if(et.children){const rt=function(ot){for(let at=0;at=ot){const ht=ot++,dt=et[ht];nt[dt.uuid]=ut,et[ut]=dt,nt[ct]=ht,et[ht]=lt;for(let pt=0,mt=it;pt!==mt;++pt){const gt=rt[pt],yt=gt[ht],bt=gt[ut];gt[ut]=yt,gt[ht]=bt}}}this.nCachedObjects_=ot}uncache(){const et=this._objects,nt=this._indicesByUUID,rt=this._bindings,it=rt.length;let ot=this.nCachedObjects_,at=et.length;for(let st=0,lt=arguments.length;st!==lt;++st){const ct=arguments[st],ut=ct.uuid,ht=nt[ut];if(ht!==void 0)if(delete nt[ut],ht0&&(nt[pt.uuid]=ht),et[ht]=pt,et.pop();for(let mt=0,gt=it;mt!==gt;++mt){const yt=rt[mt];yt[ht]=yt[dt],yt.pop()}}}this.nCachedObjects_=ot}subscribe_(et,nt){const rt=this._bindingsIndicesByPath;let it=rt[et];const ot=this._bindings;if(it!==void 0)return ot[it];const at=this._paths,st=this._parsedPaths,lt=this._objects,ct=lt.length,ut=this.nCachedObjects_,ht=new Array(ct);it=ot.length,rt[et]=it,at.push(et),st.push(nt),ot.push(ht);for(let dt=ut,pt=lt.length;dt!==pt;++dt){const mt=lt[dt];ht[dt]=new PropertyBinding(mt,et,nt)}return ht}unsubscribe_(et){const nt=this._bindingsIndicesByPath,rt=nt[et];if(rt!==void 0){const it=this._paths,ot=this._parsedPaths,at=this._bindings,st=at.length-1,lt=at[st],ct=et[st];nt[ct]=rt,at[rt]=lt,at.pop(),ot[rt]=ot[st],ot.pop(),it[rt]=it[st],it.pop()}}}class AnimationAction{constructor(et,nt,rt=null,it=nt.blendMode){this._mixer=et,this._clip=nt,this._localRoot=rt,this.blendMode=it;const ot=nt.tracks,at=ot.length,st=new Array(at),lt={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let ct=0;ct!==at;++ct){const ut=ot[ct].createInterpolant(null);st[ct]=ut,ut.settings=lt}this._interpolantSettings=lt,this._interpolants=st,this._propertyBindings=new Array(at),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(et){return this._startTime=et,this}setLoop(et,nt){return this.loop=et,this.repetitions=nt,this}setEffectiveWeight(et){return this.weight=et,this._effectiveWeight=this.enabled?et:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(et){return this._scheduleFading(et,0,1)}fadeOut(et){return this._scheduleFading(et,1,0)}crossFadeFrom(et,nt,rt){if(et.fadeOut(nt),this.fadeIn(nt),rt){const it=this._clip.duration,ot=et._clip.duration,at=ot/it,st=it/ot;et.warp(1,at,nt),this.warp(st,1,nt)}return this}crossFadeTo(et,nt,rt){return et.crossFadeFrom(this,nt,rt)}stopFading(){const et=this._weightInterpolant;return et!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}setEffectiveTimeScale(et){return this.timeScale=et,this._effectiveTimeScale=this.paused?0:et,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(et){return this.timeScale=this._clip.duration/et,this.stopWarping()}syncWith(et){return this.time=et.time,this.timeScale=et.timeScale,this.stopWarping()}halt(et){return this.warp(this._effectiveTimeScale,0,et)}warp(et,nt,rt){const it=this._mixer,ot=it.time,at=this.timeScale;let st=this._timeScaleInterpolant;st===null&&(st=it._lendControlInterpolant(),this._timeScaleInterpolant=st);const lt=st.parameterPositions,ct=st.sampleValues;return lt[0]=ot,lt[1]=ot+rt,ct[0]=et/at,ct[1]=nt/at,this}stopWarping(){const et=this._timeScaleInterpolant;return et!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(et,nt,rt,it){if(!this.enabled){this._updateWeight(et);return}const ot=this._startTime;if(ot!==null){const lt=(et-ot)*rt;if(lt<0||rt===0)return;this._startTime=null,nt=rt*lt}nt*=this._updateTimeScale(et);const at=this._updateTime(nt),st=this._updateWeight(et);if(st>0){const lt=this._interpolants,ct=this._propertyBindings;switch(this.blendMode){case AdditiveAnimationBlendMode:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulateAdditive(st);break;case NormalAnimationBlendMode:default:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulate(it,st)}}}_updateWeight(et){let nt=0;if(this.enabled){nt=this.weight;const rt=this._weightInterpolant;if(rt!==null){const it=rt.evaluate(et)[0];nt*=it,et>rt.parameterPositions[1]&&(this.stopFading(),it===0&&(this.enabled=!1))}}return this._effectiveWeight=nt,nt}_updateTimeScale(et){let nt=0;if(!this.paused){nt=this.timeScale;const rt=this._timeScaleInterpolant;if(rt!==null){const it=rt.evaluate(et)[0];nt*=it,et>rt.parameterPositions[1]&&(this.stopWarping(),nt===0?this.paused=!0:this.timeScale=nt)}}return this._effectiveTimeScale=nt,nt}_updateTime(et){const nt=this._clip.duration,rt=this.loop;let it=this.time+et,ot=this._loopCount;const at=rt===LoopPingPong;if(et===0)return ot===-1?it:at&&(ot&1)===1?nt-it:it;if(rt===LoopOnce){ot===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(it>=nt)it=nt;else if(it<0)it=0;else{this.time=it;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=it,this._mixer.dispatchEvent({type:"finished",action:this,direction:et<0?-1:1})}}else{if(ot===-1&&(et>=0?(ot=0,this._setEndings(!0,this.repetitions===0,at)):this._setEndings(this.repetitions===0,!0,at)),it>=nt||it<0){const st=Math.floor(it/nt);it-=nt*st,ot+=Math.abs(st);const lt=this.repetitions-ot;if(lt<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,it=et>0?nt:0,this.time=it,this._mixer.dispatchEvent({type:"finished",action:this,direction:et>0?1:-1});else{if(lt===1){const ct=et<0;this._setEndings(ct,!ct,at)}else this._setEndings(!1,!1,at);this._loopCount=ot,this.time=it,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:st})}}else this.time=it;if(at&&(ot&1)===1)return nt-it}return it}_setEndings(et,nt,rt){const it=this._interpolantSettings;rt?(it.endingStart=ZeroSlopeEnding,it.endingEnd=ZeroSlopeEnding):(et?it.endingStart=this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:it.endingStart=WrapAroundEnding,nt?it.endingEnd=this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:it.endingEnd=WrapAroundEnding)}_scheduleFading(et,nt,rt){const it=this._mixer,ot=it.time;let at=this._weightInterpolant;at===null&&(at=it._lendControlInterpolant(),this._weightInterpolant=at);const st=at.parameterPositions,lt=at.sampleValues;return st[0]=ot,lt[0]=nt,st[1]=ot+et,lt[1]=rt,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher$1{constructor(et){super(),this._root=et,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(et,nt){const rt=et._localRoot||this._root,it=et._clip.tracks,ot=it.length,at=et._propertyBindings,st=et._interpolants,lt=rt.uuid,ct=this._bindingsByRootAndName;let ut=ct[lt];ut===void 0&&(ut={},ct[lt]=ut);for(let ht=0;ht!==ot;++ht){const dt=it[ht],pt=dt.name;let mt=ut[pt];if(mt!==void 0)++mt.referenceCount,at[ht]=mt;else{if(mt=at[ht],mt!==void 0){mt._cacheIndex===null&&(++mt.referenceCount,this._addInactiveBinding(mt,lt,pt));continue}const gt=nt&&nt._propertyBindings[ht].binding.parsedPath;mt=new PropertyMixer(PropertyBinding.create(rt,pt,gt),dt.ValueTypeName,dt.getValueSize()),++mt.referenceCount,this._addInactiveBinding(mt,lt,pt),at[ht]=mt}st[ht].resultBuffer=mt.buffer}}_activateAction(et){if(!this._isActiveAction(et)){if(et._cacheIndex===null){const rt=(et._localRoot||this._root).uuid,it=et._clip.uuid,ot=this._actionsByClip[it];this._bindAction(et,ot&&ot.knownActions[0]),this._addInactiveAction(et,it,rt)}const nt=et._propertyBindings;for(let rt=0,it=nt.length;rt!==it;++rt){const ot=nt[rt];ot.useCount++===0&&(this._lendBinding(ot),ot.saveOriginalState())}this._lendAction(et)}}_deactivateAction(et){if(this._isActiveAction(et)){const nt=et._propertyBindings;for(let rt=0,it=nt.length;rt!==it;++rt){const ot=nt[rt];--ot.useCount===0&&(ot.restoreOriginalState(),this._takeBackBinding(ot))}this._takeBackAction(et)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const et=this;this.stats={actions:{get total(){return et._actions.length},get inUse(){return et._nActiveActions}},bindings:{get total(){return et._bindings.length},get inUse(){return et._nActiveBindings}},controlInterpolants:{get total(){return et._controlInterpolants.length},get inUse(){return et._nActiveControlInterpolants}}}}_isActiveAction(et){const nt=et._cacheIndex;return nt!==null&&nt=0;--rt)et[rt].stop();return this}update(et){et*=this.timeScale;const nt=this._actions,rt=this._nActiveActions,it=this.time+=et,ot=Math.sign(et),at=this._accuIndex^=1;for(let ct=0;ct!==rt;++ct)nt[ct]._update(it,et,ot,at);const st=this._bindings,lt=this._nActiveBindings;for(let ct=0;ct!==lt;++ct)st[ct].apply(at);return this}setTime(et){this.time=0;for(let nt=0;ntthis.max.x||et.ythis.max.y)}containsBox(et){return this.min.x<=et.min.x&&et.max.x<=this.max.x&&this.min.y<=et.min.y&&et.max.y<=this.max.y}getParameter(et,nt){return nt.set((et.x-this.min.x)/(this.max.x-this.min.x),(et.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(et){return!(et.max.xthis.max.x||et.max.ythis.max.y)}clampPoint(et,nt){return nt.copy(et).clamp(this.min,this.max)}distanceToPoint(et){return _vector$4.copy(et).clamp(this.min,this.max).sub(et).length()}intersect(et){return this.min.max(et.min),this.max.min(et.max),this}union(et){return this.min.min(et.min),this.max.max(et.max),this}translate(et){return this.min.add(et),this.max.add(et),this}equals(et){return et.min.equals(this.min)&&et.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(et=new Vector3,nt=new Vector3){this.start=et,this.end=nt}set(et,nt){return this.start.copy(et),this.end.copy(nt),this}copy(et){return this.start.copy(et.start),this.end.copy(et.end),this}getCenter(et){return et.addVectors(this.start,this.end).multiplyScalar(.5)}delta(et){return et.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(et,nt){return this.delta(nt).multiplyScalar(et).add(this.start)}closestPointToPointParameter(et,nt){_startP.subVectors(et,this.start),_startEnd.subVectors(this.end,this.start);const rt=_startEnd.dot(_startEnd);let ot=_startEnd.dot(_startP)/rt;return nt&&(ot=clamp$6(ot,0,1)),ot}closestPointToPoint(et,nt,rt){const it=this.closestPointToPointParameter(et,nt);return this.delta(rt).multiplyScalar(it).add(this.start)}applyMatrix4(et){return this.start.applyMatrix4(et),this.end.applyMatrix4(et),this}equals(et){return et.start.equals(this.start)&&et.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(et,nt){super(),this.light=et,this.light.updateMatrixWorld(),this.matrix=et.matrixWorld,this.matrixAutoUpdate=!1,this.color=nt;const rt=new BufferGeometry,it=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let at=0,st=1,lt=32;at.99999)this.quaternion.set(0,0,0,1);else if(et.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(et.z,0,-et.x).normalize();const nt=Math.acos(et.y);this.quaternion.setFromAxisAngle(_axis,nt)}}setLength(et,nt=et*.2,rt=nt*.2){this.line.scale.set(1,Math.max(1e-4,et-nt),1),this.line.updateMatrix(),this.cone.scale.set(rt,nt,rt),this.cone.position.y=et,this.cone.updateMatrix()}setColor(et){this.line.material.color.set(et),this.cone.material.color.set(et)}copy(et){return super.copy(et,!1),this.line.copy(et.line),this.cone.copy(et.cone),this}}class AxesHelper extends LineSegments{constructor(et=1){const nt=[0,0,0,et,0,0,0,0,0,0,et,0,0,0,0,0,0,et],rt=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],it=new BufferGeometry;it.setAttribute("position",new Float32BufferAttribute(nt,3)),it.setAttribute("color",new Float32BufferAttribute(rt,3));const ot=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(it,ot),this.type="AxesHelper"}setColors(et,nt,rt){const it=new Color$1,ot=this.geometry.attributes.color.array;return it.set(et),it.toArray(ot,0),it.toArray(ot,3),it.set(nt),it.toArray(ot,6),it.toArray(ot,9),it.set(rt),it.toArray(ot,12),it.toArray(ot,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color$1,this.subPaths=[],this.currentPath=null}moveTo(et,nt){return this.currentPath=new Path$1,this.subPaths.push(this.currentPath),this.currentPath.moveTo(et,nt),this}lineTo(et,nt){return this.currentPath.lineTo(et,nt),this}quadraticCurveTo(et,nt,rt,it){return this.currentPath.quadraticCurveTo(et,nt,rt,it),this}bezierCurveTo(et,nt,rt,it,ot,at){return this.currentPath.bezierCurveTo(et,nt,rt,it,ot,at),this}splineThru(et){return this.currentPath.splineThru(et),this}toShapes(et,nt){function rt(wt){const xt=[];for(let kt=0,St=wt.length;ktNumber.EPSILON){if(jt<0&&(Et=xt[At],Lt=-Lt,Ct=xt[Tt],jt=-jt),wt.yCt.y)continue;if(wt.y===Et.y){if(wt.x===Et.x)return!0}else{const Rt=jt*(wt.x-Et.x)-Lt*(wt.y-Et.y);if(Rt===0)return!0;if(Rt<0)continue;St=!St}}else{if(wt.y!==Et.y)continue;if(Ct.x<=wt.x&&wt.x<=Et.x||Et.x<=wt.x&&wt.x<=Ct.x)return!0}}return St}const ot=ShapeUtils.isClockWise,at=this.subPaths;if(at.length===0)return[];if(nt===!0)return rt(at);let st,lt,ct;const ut=[];if(at.length===1)return lt=at[0],ct=new Shape$1,ct.curves=lt.curves,ut.push(ct),ut;let ht=!ot(at[0].getPoints());ht=et?!ht:ht;const dt=[],pt=[];let mt=[],gt=0,yt;pt[gt]=void 0,mt[gt]=[];for(let wt=0,xt=at.length;wt1){let wt=!1,xt=0;for(let kt=0,St=pt.length;kt0&&wt===!1&&(mt=dt)}let bt;for(let wt=0,xt=pt.length;wt>-ct-14,rt[lt|256]=1024>>-ct-14|32768,it[lt]=-ct-1,it[lt|256]=-ct-1):ct<=15?(rt[lt]=ct+15<<10,rt[lt|256]=ct+15<<10|32768,it[lt]=13,it[lt|256]=13):ct<128?(rt[lt]=31744,rt[lt|256]=64512,it[lt]=24,it[lt|256]=24):(rt[lt]=31744,rt[lt|256]=64512,it[lt]=13,it[lt|256]=13)}const ot=new Uint32Array(2048),at=new Uint32Array(64),st=new Uint32Array(64);for(let lt=1;lt<1024;++lt){let ct=lt<<13,ut=0;for(;!(ct&8388608);)ct<<=1,ut-=8388608;ct&=-8388609,ut+=947912704,ot[lt]=ct|ut}for(let lt=1024;lt<2048;++lt)ot[lt]=939524096+(lt-1024<<13);for(let lt=1;lt<31;++lt)at[lt]=lt<<23;at[31]=1199570944,at[32]=2147483648;for(let lt=33;lt<63;++lt)at[lt]=2147483648+(lt-32<<23);at[63]=3347054592;for(let lt=1;lt<64;++lt)lt!==32&&(st[lt]=1024);return{floatView:et,uint32View:nt,baseTable:rt,shiftTable:it,mantissaTable:ot,exponentTable:at,offsetTable:st}}function toHalfFloat(tt){Math.abs(tt)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),tt=clamp$6(tt,-65504,65504),_tables.floatView[0]=tt;const et=_tables.uint32View[0],nt=et>>23&511;return _tables.baseTable[nt]+((et&8388607)>>_tables.shiftTable[nt])}function fromHalfFloat(tt){const et=tt>>10;return _tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[et]+(tt&1023)]+_tables.exponentTable[et],_tables.floatView[0]}var DataUtils=Object.freeze({__proto__:null,toHalfFloat,fromHalfFloat});class ParametricGeometry extends BufferGeometry{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class TextGeometry extends BufferGeometry{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function FontLoader(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function Font(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function ImmediateRenderObject(){console.error("THREE.ImmediateRenderObject has been removed.")}class WebGLMultisampleRenderTarget extends WebGLRenderTarget{constructor(et,nt,rt){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(et,nt,rt),this.samples=4}}class DataTexture2DArray extends DataArrayTexture{constructor(et,nt,rt,it){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(et,nt,rt,it)}}class DataTexture3D extends Data3DTexture{constructor(et,nt,rt,it){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(et,nt,rt,it)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);const THREE$1=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping,AddEquation,AddOperation,AdditiveAnimationBlendMode,AdditiveBlending,AlphaFormat,AlwaysDepth,AlwaysStencilFunc,AmbientLight,AmbientLightProbe,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrayCamera,ArrowHelper,Audio:Audio$1,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BackSide,BasicDepthPacking,BasicShadowMap,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxBufferGeometry:BoxGeometry,BoxGeometry,BoxHelper,BufferAttribute,BufferGeometry,BufferGeometryLoader,ByteType,Cache,Camera,CameraHelper,CanvasTexture,CapsuleBufferGeometry:CapsuleGeometry,CapsuleGeometry,CatmullRomCurve3,CineonToneMapping,CircleBufferGeometry:CircleGeometry,CircleGeometry,ClampToEdgeWrapping,Clock:Clock$1,Color:Color$1,ColorKeyframeTrack,ColorManagement,CompressedTexture,CompressedTextureLoader,ConeBufferGeometry:ConeGeometry,ConeGeometry,CubeCamera,CubeReflectionMapping,CubeRefractionMapping,CubeTexture,CubeTextureLoader,CubeUVReflectionMapping,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceBack,CullFaceFront,CullFaceFrontBack,CullFaceNone,Curve:Curve$1,CurvePath,CustomBlending,CustomToneMapping,CylinderBufferGeometry:CylinderGeometry,CylinderGeometry,Cylindrical,Data3DTexture,DataArrayTexture,DataTexture,DataTexture2DArray,DataTexture3D,DataTextureLoader,DataUtils,DecrementStencilOp,DecrementWrapStencilOp,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DepthTexture,DirectionalLight,DirectionalLightHelper,DiscreteInterpolant,DodecahedronBufferGeometry:DodecahedronGeometry,DodecahedronGeometry,DoubleSide,DstAlphaFactor,DstColorFactor,DynamicCopyUsage,DynamicDrawUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,EqualDepth,EqualStencilFunc,EquirectangularReflectionMapping,EquirectangularRefractionMapping,Euler,EventDispatcher:EventDispatcher$1,ExtrudeBufferGeometry:ExtrudeGeometry,ExtrudeGeometry,FileLoader,FlatShading,Float16BufferAttribute,Float32BufferAttribute,Float64BufferAttribute,FloatType,Fog,FogExp2,Font,FontLoader,FramebufferTexture,FrontSide,Frustum,GLBufferAttribute,GLSL1,GLSL3,GreaterDepth,GreaterEqualDepth,GreaterEqualStencilFunc,GreaterStencilFunc,GridHelper,Group,HalfFloatType,HemisphereLight,HemisphereLightHelper,HemisphereLightProbe,IcosahedronBufferGeometry:IcosahedronGeometry,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,ImmediateRenderObject,IncrementStencilOp,IncrementWrapStencilOp,InstancedBufferAttribute,InstancedBufferGeometry,InstancedInterleavedBuffer,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,IntType,InterleavedBuffer,InterleavedBufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InvertStencilOp,KeepStencilOp,KeyframeTrack,LOD,LatheBufferGeometry:LatheGeometry,LatheGeometry,Layers,LessDepth,LessEqualDepth,LessEqualStencilFunc,LessStencilFunc,Light,LightProbe,Line:Line$2,Line3,LineBasicMaterial,LineCurve,LineCurve3,LineDashedMaterial,LineLoop,LineSegments,LinearEncoding,LinearFilter,LinearInterpolant,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,LinearSRGBColorSpace:LinearSRGBColorSpace$1,LinearToneMapping,Loader:Loader$2,LoaderUtils,LoadingManager,LoopOnce,LoopPingPong,LoopRepeat,LuminanceAlphaFormat,LuminanceFormat,MOUSE,Material,MaterialLoader,MathUtils,Matrix3,Matrix4,MaxEquation,Mesh,MeshBasicMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshLambertMaterial,MeshMatcapMaterial,MeshNormalMaterial,MeshPhongMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshToonMaterial,MinEquation,MirroredRepeatWrapping,MixOperation,MultiplyBlending,MultiplyOperation,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,NeverDepth,NeverStencilFunc,NoBlending,NoColorSpace:NoColorSpace$1,NoToneMapping,NormalAnimationBlendMode,NormalBlending,NotEqualDepth,NotEqualStencilFunc,NumberKeyframeTrack,Object3D,ObjectLoader,ObjectSpaceNormalMap,OctahedronBufferGeometry:OctahedronGeometry,OctahedronGeometry,OneFactor,OneMinusDstAlphaFactor,OneMinusDstColorFactor,OneMinusSrcAlphaFactor,OneMinusSrcColorFactor,OrthographicCamera,PCFShadowMap,PCFSoftShadowMap,PMREMGenerator,ParametricGeometry,Path:Path$1,PerspectiveCamera,Plane,PlaneBufferGeometry:PlaneGeometry,PlaneGeometry,PlaneHelper,PointLight,PointLightHelper,Points,PointsMaterial,PolarGridHelper,PolyhedronBufferGeometry:PolyhedronGeometry,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,Quaternion,QuaternionKeyframeTrack,QuaternionLinearInterpolant,REVISION,RGBADepthPacking,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,RawShaderMaterial,Ray,Raycaster,RectAreaLight,RedFormat,RedIntegerFormat,ReinhardToneMapping,RepeatWrapping,ReplaceStencilOp,ReverseSubtractEquation,RingBufferGeometry:RingGeometry,RingGeometry,SRGBColorSpace:SRGBColorSpace$1,Scene,ShaderChunk,ShaderLib,ShaderMaterial,ShadowMaterial,Shape:Shape$1,ShapeBufferGeometry:ShapeGeometry,ShapeGeometry,ShapePath,ShapeUtils,ShortType,Skeleton:Skeleton$2,SkeletonHelper,SkinnedMesh,SmoothShading,Source:Source$1,Sphere,SphereBufferGeometry:SphereGeometry,SphereGeometry,Spherical,SphericalHarmonics3,SplineCurve,SpotLight,SpotLightHelper,Sprite,SpriteMaterial,SrcAlphaFactor,SrcAlphaSaturateFactor,SrcColorFactor,StaticCopyUsage,StaticDrawUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,SubtractEquation,SubtractiveBlending,TOUCH,TangentSpaceNormalMap,TetrahedronBufferGeometry:TetrahedronGeometry,TetrahedronGeometry,TextGeometry,Texture,TextureLoader,TorusBufferGeometry:TorusGeometry,TorusGeometry,TorusKnotBufferGeometry:TorusKnotGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeBufferGeometry:TubeGeometry,TubeGeometry,UVMapping,Uint16BufferAttribute,Uint32BufferAttribute,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,UniformsLib,UniformsUtils,UnsignedByteType,UnsignedInt248Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VSMShadowMap,Vector2,Vector3,Vector4,VectorKeyframeTrack,VideoTexture,WebGL1Renderer,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLCubeRenderTarget,WebGLMultipleRenderTargets,WebGLMultisampleRenderTarget,WebGLRenderTarget,WebGLRenderer,WebGLUtils,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroFactor,ZeroSlopeEnding,ZeroStencilOp,_SRGBAFormat,sRGBEncoding},Symbol.toStringTag,{value:"Module"})),createStoreImpl=tt=>{let et;const nt=new Set,rt=(lt,ct)=>{const ut=typeof lt=="function"?lt(et):lt;if(!Object.is(ut,et)){const ht=et;et=ct??typeof ut!="object"?ut:Object.assign({},et,ut),nt.forEach(dt=>dt(et,ht))}},it=()=>et,st={setState:rt,getState:it,subscribe:lt=>(nt.add(lt),()=>nt.delete(lt)),destroy:()=>{nt.clear()}};return et=tt(rt,it,st),st},createStore$3=tt=>tt?createStoreImpl(tt):createStoreImpl;var withSelector={exports:{}},withSelector_production_min={},shim$2={exports:{}},useSyncExternalStoreShim_production_min={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -3346,7 +3346,7 @@ var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}func [`+ot+"] ";for(at in arguments[0])hasOwnProp(arguments[0],at)&&(it+=at+": "+arguments[0][at]+", ");it=it.slice(0,-2)}else it=arguments[ot];rt.push(it)}warn$2(tt+` Arguments: `+Array.prototype.slice.call(rt).join("")+` `+new Error().stack),nt=!1}return et.apply(this,arguments)},et)}var deprecations={};function deprecateSimple(tt,et){hooks.deprecationHandler!=null&&hooks.deprecationHandler(tt,et),deprecations[tt]||(warn$2(et),deprecations[tt]=!0)}hooks.suppressDeprecationWarnings=!1;hooks.deprecationHandler=null;function isFunction$5(tt){return typeof Function<"u"&&tt instanceof Function||Object.prototype.toString.call(tt)==="[object Function]"}function set$2(tt){var et,nt;for(nt in tt)hasOwnProp(tt,nt)&&(et=tt[nt],isFunction$5(et)?this[nt]=et:this["_"+nt]=et);this._config=tt,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(tt,et){var nt=extend$2({},tt),rt;for(rt in et)hasOwnProp(et,rt)&&(isObject$e(tt[rt])&&isObject$e(et[rt])?(nt[rt]={},extend$2(nt[rt],tt[rt]),extend$2(nt[rt],et[rt])):et[rt]!=null?nt[rt]=et[rt]:delete nt[rt]);for(rt in tt)hasOwnProp(tt,rt)&&!hasOwnProp(et,rt)&&isObject$e(tt[rt])&&(nt[rt]=extend$2({},nt[rt]));return nt}function Locale(tt){tt!=null&&this.set(tt)}var keys$9;Object.keys?keys$9=Object.keys:keys$9=function(tt){var et,nt=[];for(et in tt)hasOwnProp(tt,et)&&nt.push(et);return nt};var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar$1(tt,et,nt){var rt=this._calendar[tt]||this._calendar.sameElse;return isFunction$5(rt)?rt.call(et,nt):rt}function zeroFill(tt,et,nt){var rt=""+Math.abs(tt),it=et-rt.length,ot=tt>=0;return(ot?nt?"+":"":"-")+Math.pow(10,Math.max(0,it)).toString().substr(1)+rt}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(tt,et,nt,rt){var it=rt;typeof rt=="string"&&(it=function(){return this[rt]()}),tt&&(formatTokenFunctions[tt]=it),et&&(formatTokenFunctions[et[0]]=function(){return zeroFill(it.apply(this,arguments),et[1],et[2])}),nt&&(formatTokenFunctions[nt]=function(){return this.localeData().ordinal(it.apply(this,arguments),tt)})}function removeFormattingTokens(tt){return tt.match(/\[[\s\S]/)?tt.replace(/^\[|\]$/g,""):tt.replace(/\\/g,"")}function makeFormatFunction(tt){var et=tt.match(formattingTokens),nt,rt;for(nt=0,rt=et.length;nt=0&&localFormattingTokens.test(tt);)tt=tt.replace(localFormattingTokens,rt),localFormattingTokens.lastIndex=0,nt-=1;return tt}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(tt){var et=this._longDateFormat[tt],nt=this._longDateFormat[tt.toUpperCase()];return et||!nt?et:(this._longDateFormat[tt]=nt.match(formattingTokens).map(function(rt){return rt==="MMMM"||rt==="MM"||rt==="DD"||rt==="dddd"?rt.slice(1):rt}).join(""),this._longDateFormat[tt])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal$1(tt){return this._ordinal.replace("%d",tt)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(tt,et,nt,rt){var it=this._relativeTime[nt];return isFunction$5(it)?it(tt,et,nt,rt):it.replace(/%d/i,tt)}function pastFuture(tt,et){var nt=this._relativeTime[tt>0?"future":"past"];return isFunction$5(nt)?nt(et):nt.replace(/%s/i,et)}var aliases$1={};function addUnitAlias(tt,et){var nt=tt.toLowerCase();aliases$1[nt]=aliases$1[nt+"s"]=aliases$1[et]=tt}function normalizeUnits(tt){return typeof tt=="string"?aliases$1[tt]||aliases$1[tt.toLowerCase()]:void 0}function normalizeObjectUnits(tt){var et={},nt,rt;for(rt in tt)hasOwnProp(tt,rt)&&(nt=normalizeUnits(rt),nt&&(et[nt]=tt[rt]));return et}var priorities={};function addUnitPriority(tt,et){priorities[tt]=et}function getPrioritizedUnits(tt){var et=[],nt;for(nt in tt)hasOwnProp(tt,nt)&&et.push({unit:nt,priority:priorities[nt]});return et.sort(function(rt,it){return rt.priority-it.priority}),et}function isLeapYear(tt){return tt%4===0&&tt%100!==0||tt%400===0}function absFloor(tt){return tt<0?Math.ceil(tt)||0:Math.floor(tt)}function toInt(tt){var et=+tt,nt=0;return et!==0&&isFinite(et)&&(nt=absFloor(et)),nt}function makeGetSet(tt,et){return function(nt){return nt!=null?(set$1$1(this,tt,nt),hooks.updateOffset(this,et),this):get$4(this,tt)}}function get$4(tt,et){return tt.isValid()?tt._d["get"+(tt._isUTC?"UTC":"")+et]():NaN}function set$1$1(tt,et,nt){tt.isValid()&&!isNaN(nt)&&(et==="FullYear"&&isLeapYear(tt.year())&&tt.month()===1&&tt.date()===29?(nt=toInt(nt),tt._d["set"+(tt._isUTC?"UTC":"")+et](nt,tt.month(),daysInMonth(nt,tt.month()))):tt._d["set"+(tt._isUTC?"UTC":"")+et](nt))}function stringGet(tt){return tt=normalizeUnits(tt),isFunction$5(this[tt])?this[tt]():this}function stringSet(tt,et){if(typeof tt=="object"){tt=normalizeObjectUnits(tt);var nt=getPrioritizedUnits(tt),rt,it=nt.length;for(rt=0;rt68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function createDate(tt,et,nt,rt,it,ot,at){var st;return tt<100&&tt>=0?(st=new Date(tt+400,et,nt,rt,it,ot,at),isFinite(st.getFullYear())&&st.setFullYear(tt)):st=new Date(tt,et,nt,rt,it,ot,at),st}function createUTCDate(tt){var et,nt;return tt<100&&tt>=0?(nt=Array.prototype.slice.call(arguments),nt[0]=tt+400,et=new Date(Date.UTC.apply(null,nt)),isFinite(et.getUTCFullYear())&&et.setUTCFullYear(tt)):et=new Date(Date.UTC.apply(null,arguments)),et}function firstWeekOffset(tt,et,nt){var rt=7+et-nt,it=(7+createUTCDate(tt,0,rt).getUTCDay()-et)%7;return-it+rt-1}function dayOfYearFromWeeks(tt,et,nt,rt,it){var ot=(7+nt-rt)%7,at=firstWeekOffset(tt,rt,it),st=1+7*(et-1)+ot+at,lt,ct;return st<=0?(lt=tt-1,ct=daysInYear(lt)+st):st>daysInYear(tt)?(lt=tt+1,ct=st-daysInYear(tt)):(lt=tt,ct=st),{year:lt,dayOfYear:ct}}function weekOfYear(tt,et,nt){var rt=firstWeekOffset(tt.year(),et,nt),it=Math.floor((tt.dayOfYear()-rt-1)/7)+1,ot,at;return it<1?(at=tt.year()-1,ot=it+weeksInYear(at,et,nt)):it>weeksInYear(tt.year(),et,nt)?(ot=it-weeksInYear(tt.year(),et,nt),at=tt.year()+1):(at=tt.year(),ot=it),{week:ot,year:at}}function weeksInYear(tt,et,nt){var rt=firstWeekOffset(tt,et,nt),it=firstWeekOffset(tt+1,et,nt);return(daysInYear(tt)-rt+it)/7}addFormatToken("w",["ww",2],"wo","week");addFormatToken("W",["WW",2],"Wo","isoWeek");addUnitAlias("week","w");addUnitAlias("isoWeek","W");addUnitPriority("week",5);addUnitPriority("isoWeek",5);addRegexToken("w",match1to2);addRegexToken("ww",match1to2,match2);addRegexToken("W",match1to2);addRegexToken("WW",match1to2,match2);addWeekParseToken(["w","ww","W","WW"],function(tt,et,nt,rt){et[rt.substr(0,1)]=toInt(tt)});function localeWeek(tt){return weekOfYear(tt,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(tt){var et=this.localeData().week(this);return tt==null?et:this.add((tt-et)*7,"d")}function getSetISOWeek(tt){var et=weekOfYear(this,1,4).week;return tt==null?et:this.add((tt-et)*7,"d")}addFormatToken("d",0,"do","day");addFormatToken("dd",0,0,function(tt){return this.localeData().weekdaysMin(this,tt)});addFormatToken("ddd",0,0,function(tt){return this.localeData().weekdaysShort(this,tt)});addFormatToken("dddd",0,0,function(tt){return this.localeData().weekdays(this,tt)});addFormatToken("e",0,0,"weekday");addFormatToken("E",0,0,"isoWeekday");addUnitAlias("day","d");addUnitAlias("weekday","e");addUnitAlias("isoWeekday","E");addUnitPriority("day",11);addUnitPriority("weekday",11);addUnitPriority("isoWeekday",11);addRegexToken("d",match1to2);addRegexToken("e",match1to2);addRegexToken("E",match1to2);addRegexToken("dd",function(tt,et){return et.weekdaysMinRegex(tt)});addRegexToken("ddd",function(tt,et){return et.weekdaysShortRegex(tt)});addRegexToken("dddd",function(tt,et){return et.weekdaysRegex(tt)});addWeekParseToken(["dd","ddd","dddd"],function(tt,et,nt,rt){var it=nt._locale.weekdaysParse(tt,rt,nt._strict);it!=null?et.d=it:getParsingFlags(nt).invalidWeekday=tt});addWeekParseToken(["d","e","E"],function(tt,et,nt,rt){et[rt]=toInt(tt)});function parseWeekday(tt,et){return typeof tt!="string"?tt:isNaN(tt)?(tt=et.weekdaysParse(tt),typeof tt=="number"?tt:null):parseInt(tt,10)}function parseIsoWeekday(tt,et){return typeof tt=="string"?et.weekdaysParse(tt)%7||7:isNaN(tt)?null:tt}function shiftWeekdays(tt,et){return tt.slice(et,7).concat(tt.slice(0,et))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(tt,et){var nt=isArray$j(this._weekdays)?this._weekdays:this._weekdays[tt&&tt!==!0&&this._weekdays.isFormat.test(et)?"format":"standalone"];return tt===!0?shiftWeekdays(nt,this._week.dow):tt?nt[tt.day()]:nt}function localeWeekdaysShort(tt){return tt===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):tt?this._weekdaysShort[tt.day()]:this._weekdaysShort}function localeWeekdaysMin(tt){return tt===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):tt?this._weekdaysMin[tt.day()]:this._weekdaysMin}function handleStrictParse$1(tt,et,nt){var rt,it,ot,at=tt.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],rt=0;rt<7;++rt)ot=createUTC([2e3,1]).day(rt),this._minWeekdaysParse[rt]=this.weekdaysMin(ot,"").toLocaleLowerCase(),this._shortWeekdaysParse[rt]=this.weekdaysShort(ot,"").toLocaleLowerCase(),this._weekdaysParse[rt]=this.weekdays(ot,"").toLocaleLowerCase();return nt?et==="dddd"?(it=indexOf.call(this._weekdaysParse,at),it!==-1?it:null):et==="ddd"?(it=indexOf.call(this._shortWeekdaysParse,at),it!==-1?it:null):(it=indexOf.call(this._minWeekdaysParse,at),it!==-1?it:null):et==="dddd"?(it=indexOf.call(this._weekdaysParse,at),it!==-1||(it=indexOf.call(this._shortWeekdaysParse,at),it!==-1)?it:(it=indexOf.call(this._minWeekdaysParse,at),it!==-1?it:null)):et==="ddd"?(it=indexOf.call(this._shortWeekdaysParse,at),it!==-1||(it=indexOf.call(this._weekdaysParse,at),it!==-1)?it:(it=indexOf.call(this._minWeekdaysParse,at),it!==-1?it:null)):(it=indexOf.call(this._minWeekdaysParse,at),it!==-1||(it=indexOf.call(this._weekdaysParse,at),it!==-1)?it:(it=indexOf.call(this._shortWeekdaysParse,at),it!==-1?it:null))}function localeWeekdaysParse(tt,et,nt){var rt,it,ot;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,tt,et,nt);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),rt=0;rt<7;rt++){if(it=createUTC([2e3,1]).day(rt),nt&&!this._fullWeekdaysParse[rt]&&(this._fullWeekdaysParse[rt]=new RegExp("^"+this.weekdays(it,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[rt]=new RegExp("^"+this.weekdaysShort(it,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[rt]=new RegExp("^"+this.weekdaysMin(it,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[rt]||(ot="^"+this.weekdays(it,"")+"|^"+this.weekdaysShort(it,"")+"|^"+this.weekdaysMin(it,""),this._weekdaysParse[rt]=new RegExp(ot.replace(".",""),"i")),nt&&et==="dddd"&&this._fullWeekdaysParse[rt].test(tt))return rt;if(nt&&et==="ddd"&&this._shortWeekdaysParse[rt].test(tt))return rt;if(nt&&et==="dd"&&this._minWeekdaysParse[rt].test(tt))return rt;if(!nt&&this._weekdaysParse[rt].test(tt))return rt}}function getSetDayOfWeek(tt){if(!this.isValid())return tt!=null?this:NaN;var et=this._isUTC?this._d.getUTCDay():this._d.getDay();return tt!=null?(tt=parseWeekday(tt,this.localeData()),this.add(tt-et,"d")):et}function getSetLocaleDayOfWeek(tt){if(!this.isValid())return tt!=null?this:NaN;var et=(this.day()+7-this.localeData()._week.dow)%7;return tt==null?et:this.add(tt-et,"d")}function getSetISODayOfWeek(tt){if(!this.isValid())return tt!=null?this:NaN;if(tt!=null){var et=parseIsoWeekday(tt,this.localeData());return this.day(this.day()%7?et:et-7)}else return this.day()||7}function weekdaysRegex(tt){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),tt?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&tt?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(tt){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),tt?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&tt?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(tt){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),tt?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&tt?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function tt(ut,ht){return ht.length-ut.length}var et=[],nt=[],rt=[],it=[],ot,at,st,lt,ct;for(ot=0;ot<7;ot++)at=createUTC([2e3,1]).day(ot),st=regexEscape(this.weekdaysMin(at,"")),lt=regexEscape(this.weekdaysShort(at,"")),ct=regexEscape(this.weekdays(at,"")),et.push(st),nt.push(lt),rt.push(ct),it.push(st),it.push(lt),it.push(ct);et.sort(tt),nt.sort(tt),rt.sort(tt),it.sort(tt),this._weekdaysRegex=new RegExp("^("+it.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+rt.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+nt.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+et.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour");addFormatToken("h",["hh",2],0,hFormat);addFormatToken("k",["kk",2],0,kFormat);addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)});addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)});addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(tt,et){addFormatToken(tt,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),et)})}meridiem("a",!0);meridiem("A",!1);addUnitAlias("hour","h");addUnitPriority("hour",13);function matchMeridiem(tt,et){return et._meridiemParse}addRegexToken("a",matchMeridiem);addRegexToken("A",matchMeridiem);addRegexToken("H",match1to2);addRegexToken("h",match1to2);addRegexToken("k",match1to2);addRegexToken("HH",match1to2,match2);addRegexToken("hh",match1to2,match2);addRegexToken("kk",match1to2,match2);addRegexToken("hmm",match3to4);addRegexToken("hmmss",match5to6);addRegexToken("Hmm",match3to4);addRegexToken("Hmmss",match5to6);addParseToken(["H","HH"],HOUR);addParseToken(["k","kk"],function(tt,et,nt){var rt=toInt(tt);et[HOUR]=rt===24?0:rt});addParseToken(["a","A"],function(tt,et,nt){nt._isPm=nt._locale.isPM(tt),nt._meridiem=tt});addParseToken(["h","hh"],function(tt,et,nt){et[HOUR]=toInt(tt),getParsingFlags(nt).bigHour=!0});addParseToken("hmm",function(tt,et,nt){var rt=tt.length-2;et[HOUR]=toInt(tt.substr(0,rt)),et[MINUTE]=toInt(tt.substr(rt)),getParsingFlags(nt).bigHour=!0});addParseToken("hmmss",function(tt,et,nt){var rt=tt.length-4,it=tt.length-2;et[HOUR]=toInt(tt.substr(0,rt)),et[MINUTE]=toInt(tt.substr(rt,2)),et[SECOND]=toInt(tt.substr(it)),getParsingFlags(nt).bigHour=!0});addParseToken("Hmm",function(tt,et,nt){var rt=tt.length-2;et[HOUR]=toInt(tt.substr(0,rt)),et[MINUTE]=toInt(tt.substr(rt))});addParseToken("Hmmss",function(tt,et,nt){var rt=tt.length-4,it=tt.length-2;et[HOUR]=toInt(tt.substr(0,rt)),et[MINUTE]=toInt(tt.substr(rt,2)),et[SECOND]=toInt(tt.substr(it))});function localeIsPM(tt){return(tt+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(tt,et,nt){return tt>11?nt?"pm":"PM":nt?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(tt,et){var nt,rt=Math.min(tt.length,et.length);for(nt=0;nt0;){if(it=loadLocale(ot.slice(0,nt).join("-")),it)return it;if(rt&&rt.length>=nt&&commonPrefix(ot,rt)>=nt-1)break;nt--}et++}return globalLocale}function isLocaleNameSane(tt){return tt.match("^[^/\\\\]*$")!=null}function loadLocale(tt){var et=null,nt;if(locales[tt]===void 0&&typeof module<"u"&&module&&module.exports&&isLocaleNameSane(tt))try{et=globalLocale._abbr,nt=require,nt("./locale/"+tt),getSetGlobalLocale(et)}catch{locales[tt]=null}return locales[tt]}function getSetGlobalLocale(tt,et){var nt;return tt&&(isUndefined(et)?nt=getLocale(tt):nt=defineLocale(tt,et),nt?globalLocale=nt:typeof console<"u"&&console.warn&&console.warn("Locale "+tt+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(tt,et){if(et!==null){var nt,rt=baseConfig;if(et.abbr=tt,locales[tt]!=null)deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),rt=locales[tt]._config;else if(et.parentLocale!=null)if(locales[et.parentLocale]!=null)rt=locales[et.parentLocale]._config;else if(nt=loadLocale(et.parentLocale),nt!=null)rt=nt._config;else return localeFamilies[et.parentLocale]||(localeFamilies[et.parentLocale]=[]),localeFamilies[et.parentLocale].push({name:tt,config:et}),null;return locales[tt]=new Locale(mergeConfigs(rt,et)),localeFamilies[tt]&&localeFamilies[tt].forEach(function(it){defineLocale(it.name,it.config)}),getSetGlobalLocale(tt),locales[tt]}else return delete locales[tt],null}function updateLocale(tt,et){if(et!=null){var nt,rt,it=baseConfig;locales[tt]!=null&&locales[tt].parentLocale!=null?locales[tt].set(mergeConfigs(locales[tt]._config,et)):(rt=loadLocale(tt),rt!=null&&(it=rt._config),et=mergeConfigs(it,et),rt==null&&(et.abbr=tt),nt=new Locale(et),nt.parentLocale=locales[tt],locales[tt]=nt),getSetGlobalLocale(tt)}else locales[tt]!=null&&(locales[tt].parentLocale!=null?(locales[tt]=locales[tt].parentLocale,tt===getSetGlobalLocale()&&getSetGlobalLocale(tt)):locales[tt]!=null&&delete locales[tt]);return locales[tt]}function getLocale(tt){var et;if(tt&&tt._locale&&tt._locale._abbr&&(tt=tt._locale._abbr),!tt)return globalLocale;if(!isArray$j(tt)){if(et=loadLocale(tt),et)return et;tt=[tt]}return chooseLocale(tt)}function listLocales(){return keys$9(locales)}function checkOverflow(tt){var et,nt=tt._a;return nt&&getParsingFlags(tt).overflow===-2&&(et=nt[MONTH]<0||nt[MONTH]>11?MONTH:nt[DATE$1]<1||nt[DATE$1]>daysInMonth(nt[YEAR],nt[MONTH])?DATE$1:nt[HOUR]<0||nt[HOUR]>24||nt[HOUR]===24&&(nt[MINUTE]!==0||nt[SECOND]!==0||nt[MILLISECOND]!==0)?HOUR:nt[MINUTE]<0||nt[MINUTE]>59?MINUTE:nt[SECOND]<0||nt[SECOND]>59?SECOND:nt[MILLISECOND]<0||nt[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(tt)._overflowDayOfYear&&(etDATE$1)&&(et=DATE$1),getParsingFlags(tt)._overflowWeeks&&et===-1&&(et=WEEK),getParsingFlags(tt)._overflowWeekday&&et===-1&&(et=WEEKDAY),getParsingFlags(tt).overflow=et),tt}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(tt){var et,nt,rt=tt._i,it=extendedIsoRegex.exec(rt)||basicIsoRegex.exec(rt),ot,at,st,lt,ct=isoDates.length,ut=isoTimes.length;if(it){for(getParsingFlags(tt).iso=!0,et=0,nt=ct;etdaysInYear(at)||tt._dayOfYear===0)&&(getParsingFlags(tt)._overflowDayOfYear=!0),nt=createUTCDate(at,0,tt._dayOfYear),tt._a[MONTH]=nt.getUTCMonth(),tt._a[DATE$1]=nt.getUTCDate()),et=0;et<3&&tt._a[et]==null;++et)tt._a[et]=rt[et]=it[et];for(;et<7;et++)tt._a[et]=rt[et]=tt._a[et]==null?et===2?1:0:tt._a[et];tt._a[HOUR]===24&&tt._a[MINUTE]===0&&tt._a[SECOND]===0&&tt._a[MILLISECOND]===0&&(tt._nextDay=!0,tt._a[HOUR]=0),tt._d=(tt._useUTC?createUTCDate:createDate).apply(null,rt),ot=tt._useUTC?tt._d.getUTCDay():tt._d.getDay(),tt._tzm!=null&&tt._d.setUTCMinutes(tt._d.getUTCMinutes()-tt._tzm),tt._nextDay&&(tt._a[HOUR]=24),tt._w&&typeof tt._w.d<"u"&&tt._w.d!==ot&&(getParsingFlags(tt).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(tt){var et,nt,rt,it,ot,at,st,lt,ct;et=tt._w,et.GG!=null||et.W!=null||et.E!=null?(ot=1,at=4,nt=defaults$2(et.GG,tt._a[YEAR],weekOfYear(createLocal(),1,4).year),rt=defaults$2(et.W,1),it=defaults$2(et.E,1),(it<1||it>7)&&(lt=!0)):(ot=tt._locale._week.dow,at=tt._locale._week.doy,ct=weekOfYear(createLocal(),ot,at),nt=defaults$2(et.gg,tt._a[YEAR],ct.year),rt=defaults$2(et.w,ct.week),et.d!=null?(it=et.d,(it<0||it>6)&&(lt=!0)):et.e!=null?(it=et.e+ot,(et.e<0||et.e>6)&&(lt=!0)):it=ot),rt<1||rt>weeksInYear(nt,ot,at)?getParsingFlags(tt)._overflowWeeks=!0:lt!=null?getParsingFlags(tt)._overflowWeekday=!0:(st=dayOfYearFromWeeks(nt,rt,it,ot,at),tt._a[YEAR]=st.year,tt._dayOfYear=st.dayOfYear)}hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(tt){if(tt._f===hooks.ISO_8601){configFromISO(tt);return}if(tt._f===hooks.RFC_2822){configFromRFC2822(tt);return}tt._a=[],getParsingFlags(tt).empty=!0;var et=""+tt._i,nt,rt,it,ot,at,st=et.length,lt=0,ct,ut;for(it=expandFormat(tt._f,tt._locale).match(formattingTokens)||[],ut=it.length,nt=0;nt0&&getParsingFlags(tt).unusedInput.push(at),et=et.slice(et.indexOf(rt)+rt.length),lt+=rt.length),formatTokenFunctions[ot]?(rt?getParsingFlags(tt).empty=!1:getParsingFlags(tt).unusedTokens.push(ot),addTimeToArrayFromToken(ot,rt,tt)):tt._strict&&!rt&&getParsingFlags(tt).unusedTokens.push(ot);getParsingFlags(tt).charsLeftOver=st-lt,et.length>0&&getParsingFlags(tt).unusedInput.push(et),tt._a[HOUR]<=12&&getParsingFlags(tt).bigHour===!0&&tt._a[HOUR]>0&&(getParsingFlags(tt).bigHour=void 0),getParsingFlags(tt).parsedDateParts=tt._a.slice(0),getParsingFlags(tt).meridiem=tt._meridiem,tt._a[HOUR]=meridiemFixWrap(tt._locale,tt._a[HOUR],tt._meridiem),ct=getParsingFlags(tt).era,ct!==null&&(tt._a[YEAR]=tt._locale.erasConvertYear(ct,tt._a[YEAR])),configFromArray(tt),checkOverflow(tt)}function meridiemFixWrap(tt,et,nt){var rt;return nt==null?et:tt.meridiemHour!=null?tt.meridiemHour(et,nt):(tt.isPM!=null&&(rt=tt.isPM(nt),rt&&et<12&&(et+=12),!rt&&et===12&&(et=0)),et)}function configFromStringAndArray(tt){var et,nt,rt,it,ot,at,st=!1,lt=tt._f.length;if(lt===0){getParsingFlags(tt).invalidFormat=!0,tt._d=new Date(NaN);return}for(it=0;itthis?this:tt:createInvalid()});function pickBy(tt,et){var nt,rt;if(et.length===1&&isArray$j(et[0])&&(et=et[0]),!et.length)return createLocal();for(nt=et[0],rt=1;rtthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var tt={},et;return copyConfig(tt,this),tt=prepareConfig(tt),tt._a?(et=tt._isUTC?createUTC(tt._a):createLocal(tt._a),this._isDSTShifted=this.isValid()&&compareArrays(tt._a,et.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(tt,et){var nt=tt,rt=null,it,ot,at;return isDuration(tt)?nt={ms:tt._milliseconds,d:tt._days,M:tt._months}:isNumber$5(tt)||!isNaN(+tt)?(nt={},et?nt[et]=+tt:nt.milliseconds=+tt):(rt=aspNetRegex.exec(tt))?(it=rt[1]==="-"?-1:1,nt={y:0,d:toInt(rt[DATE$1])*it,h:toInt(rt[HOUR])*it,m:toInt(rt[MINUTE])*it,s:toInt(rt[SECOND])*it,ms:toInt(absRound(rt[MILLISECOND]*1e3))*it}):(rt=isoRegex.exec(tt))?(it=rt[1]==="-"?-1:1,nt={y:parseIso(rt[2],it),M:parseIso(rt[3],it),w:parseIso(rt[4],it),d:parseIso(rt[5],it),h:parseIso(rt[6],it),m:parseIso(rt[7],it),s:parseIso(rt[8],it)}):nt==null?nt={}:typeof nt=="object"&&("from"in nt||"to"in nt)&&(at=momentsDifference(createLocal(nt.from),createLocal(nt.to)),nt={},nt.ms=at.milliseconds,nt.M=at.months),ot=new Duration(nt),isDuration(tt)&&hasOwnProp(tt,"_locale")&&(ot._locale=tt._locale),isDuration(tt)&&hasOwnProp(tt,"_isValid")&&(ot._isValid=tt._isValid),ot}createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(tt,et){var nt=tt&&parseFloat(tt.replace(",","."));return(isNaN(nt)?0:nt)*et}function positiveMomentsDifference(tt,et){var nt={};return nt.months=et.month()-tt.month()+(et.year()-tt.year())*12,tt.clone().add(nt.months,"M").isAfter(et)&&--nt.months,nt.milliseconds=+et-+tt.clone().add(nt.months,"M"),nt}function momentsDifference(tt,et){var nt;return tt.isValid()&&et.isValid()?(et=cloneWithOffset(et,tt),tt.isBefore(et)?nt=positiveMomentsDifference(tt,et):(nt=positiveMomentsDifference(et,tt),nt.milliseconds=-nt.milliseconds,nt.months=-nt.months),nt):{milliseconds:0,months:0}}function createAdder(tt,et){return function(nt,rt){var it,ot;return rt!==null&&!isNaN(+rt)&&(deprecateSimple(et,"moment()."+et+"(period, number) is deprecated. Please use moment()."+et+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),ot=nt,nt=rt,rt=ot),it=createDuration(nt,rt),addSubtract(this,it,tt),this}}function addSubtract(tt,et,nt,rt){var it=et._milliseconds,ot=absRound(et._days),at=absRound(et._months);tt.isValid()&&(rt=rt??!0,at&&setMonth(tt,get$4(tt,"Month")+at*nt),ot&&set$1$1(tt,"Date",get$4(tt,"Date")+ot*nt),it&&tt._d.setTime(tt._d.valueOf()+it*nt),rt&&hooks.updateOffset(tt,ot||at))}var add$4=createAdder(1,"add"),subtract$1=createAdder(-1,"subtract");function isString$2(tt){return typeof tt=="string"||tt instanceof String}function isMomentInput(tt){return isMoment(tt)||isDate$1(tt)||isString$2(tt)||isNumber$5(tt)||isNumberOrStringArray(tt)||isMomentInputObject(tt)||tt===null||tt===void 0}function isMomentInputObject(tt){var et=isObject$e(tt)&&!isObjectEmpty$1(tt),nt=!1,rt=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],it,ot,at=rt.length;for(it=0;itnt.valueOf():nt.valueOf()9999?formatMoment(nt,et?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction$5(Date.prototype.toISOString)?et?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(nt,"Z")):formatMoment(nt,et?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var tt="moment",et="",nt,rt,it,ot;return this.isLocal()||(tt=this.utcOffset()===0?"moment.utc":"moment.parseZone",et="Z"),nt="["+tt+'("]',rt=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",it="-MM-DD[T]HH:mm:ss.SSS",ot=et+'[")]',this.format(nt+rt+it+ot)}function format$1(tt){tt||(tt=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var et=formatMoment(this,tt);return this.localeData().postformat(et)}function from$1(tt,et){return this.isValid()&&(isMoment(tt)&&tt.isValid()||createLocal(tt).isValid())?createDuration({to:this,from:tt}).locale(this.locale()).humanize(!et):this.localeData().invalidDate()}function fromNow(tt){return this.from(createLocal(),tt)}function to(tt,et){return this.isValid()&&(isMoment(tt)&&tt.isValid()||createLocal(tt).isValid())?createDuration({from:this,to:tt}).locale(this.locale()).humanize(!et):this.localeData().invalidDate()}function toNow(tt){return this.to(createLocal(),tt)}function locale$2(tt){var et;return tt===void 0?this._locale._abbr:(et=getLocale(tt),et!=null&&(this._locale=et),this)}var lang=deprecate$1("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(tt){return tt===void 0?this.localeData():this.locale(tt)});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(tt,et){return(tt%et+et)%et}function localStartOfDate(tt,et,nt){return tt<100&&tt>=0?new Date(tt+400,et,nt)-MS_PER_400_YEARS:new Date(tt,et,nt).valueOf()}function utcStartOfDate(tt,et,nt){return tt<100&&tt>=0?Date.UTC(tt+400,et,nt)-MS_PER_400_YEARS:Date.UTC(tt,et,nt)}function startOf(tt){var et,nt;if(tt=normalizeUnits(tt),tt===void 0||tt==="millisecond"||!this.isValid())return this;switch(nt=this._isUTC?utcStartOfDate:localStartOfDate,tt){case"year":et=nt(this.year(),0,1);break;case"quarter":et=nt(this.year(),this.month()-this.month()%3,1);break;case"month":et=nt(this.year(),this.month(),1);break;case"week":et=nt(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":et=nt(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":et=nt(this.year(),this.month(),this.date());break;case"hour":et=this._d.valueOf(),et-=mod$1(et+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":et=this._d.valueOf(),et-=mod$1(et,MS_PER_MINUTE);break;case"second":et=this._d.valueOf(),et-=mod$1(et,MS_PER_SECOND);break}return this._d.setTime(et),hooks.updateOffset(this,!0),this}function endOf(tt){var et,nt;if(tt=normalizeUnits(tt),tt===void 0||tt==="millisecond"||!this.isValid())return this;switch(nt=this._isUTC?utcStartOfDate:localStartOfDate,tt){case"year":et=nt(this.year()+1,0,1)-1;break;case"quarter":et=nt(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":et=nt(this.year(),this.month()+1,1)-1;break;case"week":et=nt(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":et=nt(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":et=nt(this.year(),this.month(),this.date()+1)-1;break;case"hour":et=this._d.valueOf(),et+=MS_PER_HOUR-mod$1(et+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":et=this._d.valueOf(),et+=MS_PER_MINUTE-mod$1(et,MS_PER_MINUTE)-1;break;case"second":et=this._d.valueOf(),et+=MS_PER_SECOND-mod$1(et,MS_PER_SECOND)-1;break}return this._d.setTime(et),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray$5(){var tt=this;return[tt.year(),tt.month(),tt.date(),tt.hour(),tt.minute(),tt.second(),tt.millisecond()]}function toObject$1(){var tt=this;return{years:tt.year(),months:tt.month(),date:tt.date(),hours:tt.hours(),minutes:tt.minutes(),seconds:tt.seconds(),milliseconds:tt.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend$2({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr");addFormatToken("NN",0,0,"eraAbbr");addFormatToken("NNN",0,0,"eraAbbr");addFormatToken("NNNN",0,0,"eraName");addFormatToken("NNNNN",0,0,"eraNarrow");addFormatToken("y",["y",1],"yo","eraYear");addFormatToken("y",["yy",2],0,"eraYear");addFormatToken("y",["yyy",3],0,"eraYear");addFormatToken("y",["yyyy",4],0,"eraYear");addRegexToken("N",matchEraAbbr);addRegexToken("NN",matchEraAbbr);addRegexToken("NNN",matchEraAbbr);addRegexToken("NNNN",matchEraName);addRegexToken("NNNNN",matchEraNarrow);addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(tt,et,nt,rt){var it=nt._locale.erasParse(tt,rt,nt._strict);it?getParsingFlags(nt).era=it:getParsingFlags(nt).invalidEra=tt});addRegexToken("y",matchUnsigned);addRegexToken("yy",matchUnsigned);addRegexToken("yyy",matchUnsigned);addRegexToken("yyyy",matchUnsigned);addRegexToken("yo",matchEraYearOrdinal);addParseToken(["y","yy","yyy","yyyy"],YEAR);addParseToken(["yo"],function(tt,et,nt,rt){var it;nt._locale._eraYearOrdinalRegex&&(it=tt.match(nt._locale._eraYearOrdinalRegex)),nt._locale.eraYearOrdinalParse?et[YEAR]=nt._locale.eraYearOrdinalParse(tt,it):et[YEAR]=parseInt(tt,10)});function localeEras(tt,et){var nt,rt,it,ot=this._eras||getLocale("en")._eras;for(nt=0,rt=ot.length;nt=0)return ot[rt]}function localeErasConvertYear(tt,et){var nt=tt.since<=tt.until?1:-1;return et===void 0?hooks(tt.since).year():hooks(tt.since).year()+(et-tt.offset)*nt}function getEraName(){var tt,et,nt,rt=this.localeData().eras();for(tt=0,et=rt.length;ttot&&(et=ot),setWeekAll.call(this,tt,et,nt,rt,it))}function setWeekAll(tt,et,nt,rt,it){var ot=dayOfYearFromWeeks(tt,et,nt,rt,it),at=createUTCDate(ot.year,0,ot.dayOfYear);return this.year(at.getUTCFullYear()),this.month(at.getUTCMonth()),this.date(at.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter");addUnitAlias("quarter","Q");addUnitPriority("quarter",7);addRegexToken("Q",match1);addParseToken("Q",function(tt,et){et[MONTH]=(toInt(tt)-1)*3});function getSetQuarter(tt){return tt==null?Math.ceil((this.month()+1)/3):this.month((tt-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date");addUnitAlias("date","D");addUnitPriority("date",9);addRegexToken("D",match1to2);addRegexToken("DD",match1to2,match2);addRegexToken("Do",function(tt,et){return tt?et._dayOfMonthOrdinalParse||et._ordinalParse:et._dayOfMonthOrdinalParseLenient});addParseToken(["D","DD"],DATE$1);addParseToken("Do",function(tt,et){et[DATE$1]=toInt(tt.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear");addUnitAlias("dayOfYear","DDD");addUnitPriority("dayOfYear",4);addRegexToken("DDD",match1to3);addRegexToken("DDDD",match3);addParseToken(["DDD","DDDD"],function(tt,et,nt){nt._dayOfYear=toInt(tt)});function getSetDayOfYear(tt){var et=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return tt==null?et:this.add(tt-et,"d")}addFormatToken("m",["mm",2],0,"minute");addUnitAlias("minute","m");addUnitPriority("minute",14);addRegexToken("m",match1to2);addRegexToken("mm",match1to2,match2);addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second");addUnitAlias("second","s");addUnitPriority("second",15);addRegexToken("s",match1to2);addRegexToken("ss",match1to2,match2);addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)});addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)});addFormatToken(0,["SSS",3],0,"millisecond");addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10});addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100});addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});addUnitAlias("millisecond","ms");addUnitPriority("millisecond",16);addRegexToken("S",match1to3,match1);addRegexToken("SS",match1to3,match2);addRegexToken("SSS",match1to3,match3);var token$1,getSetMillisecond;for(token$1="SSSS";token$1.length<=9;token$1+="S")addRegexToken(token$1,matchUnsigned);function parseMs(tt,et){et[MILLISECOND]=toInt(("0."+tt)*1e3)}for(token$1="S";token$1.length<=9;token$1+="S")addParseToken(token$1,parseMs);getSetMillisecond=makeGetSet("Milliseconds",!1);addFormatToken("z",0,0,"zoneAbbr");addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto$1=Moment.prototype;proto$1.add=add$4;proto$1.calendar=calendar$1$1;proto$1.clone=clone$1;proto$1.diff=diff;proto$1.endOf=endOf;proto$1.format=format$1;proto$1.from=from$1;proto$1.fromNow=fromNow;proto$1.to=to;proto$1.toNow=toNow;proto$1.get=stringGet;proto$1.invalidAt=invalidAt;proto$1.isAfter=isAfter;proto$1.isBefore=isBefore;proto$1.isBetween=isBetween;proto$1.isSame=isSame;proto$1.isSameOrAfter=isSameOrAfter;proto$1.isSameOrBefore=isSameOrBefore;proto$1.isValid=isValid$2;proto$1.lang=lang;proto$1.locale=locale$2;proto$1.localeData=localeData;proto$1.max=prototypeMax;proto$1.min=prototypeMin;proto$1.parsingFlags=parsingFlags;proto$1.set=stringSet;proto$1.startOf=startOf;proto$1.subtract=subtract$1;proto$1.toArray=toArray$5;proto$1.toObject=toObject$1;proto$1.toDate=toDate;proto$1.toISOString=toISOString;proto$1.inspect=inspect;typeof Symbol<"u"&&Symbol.for!=null&&(proto$1[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});proto$1.toJSON=toJSON;proto$1.toString=toString$6;proto$1.unix=unix;proto$1.valueOf=valueOf;proto$1.creationData=creationData;proto$1.eraName=getEraName;proto$1.eraNarrow=getEraNarrow;proto$1.eraAbbr=getEraAbbr;proto$1.eraYear=getEraYear;proto$1.year=getSetYear;proto$1.isLeapYear=getIsLeapYear;proto$1.weekYear=getSetWeekYear;proto$1.isoWeekYear=getSetISOWeekYear;proto$1.quarter=proto$1.quarters=getSetQuarter;proto$1.month=getSetMonth;proto$1.daysInMonth=getDaysInMonth;proto$1.week=proto$1.weeks=getSetWeek;proto$1.isoWeek=proto$1.isoWeeks=getSetISOWeek;proto$1.weeksInYear=getWeeksInYear;proto$1.weeksInWeekYear=getWeeksInWeekYear;proto$1.isoWeeksInYear=getISOWeeksInYear;proto$1.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear;proto$1.date=getSetDayOfMonth;proto$1.day=proto$1.days=getSetDayOfWeek;proto$1.weekday=getSetLocaleDayOfWeek;proto$1.isoWeekday=getSetISODayOfWeek;proto$1.dayOfYear=getSetDayOfYear;proto$1.hour=proto$1.hours=getSetHour;proto$1.minute=proto$1.minutes=getSetMinute;proto$1.second=proto$1.seconds=getSetSecond;proto$1.millisecond=proto$1.milliseconds=getSetMillisecond;proto$1.utcOffset=getSetOffset;proto$1.utc=setOffsetToUTC;proto$1.local=setOffsetToLocal;proto$1.parseZone=setOffsetToParsedOffset;proto$1.hasAlignedHourOffset=hasAlignedHourOffset;proto$1.isDST=isDaylightSavingTime;proto$1.isLocal=isLocal;proto$1.isUtcOffset=isUtcOffset;proto$1.isUtc=isUtc;proto$1.isUTC=isUtc;proto$1.zoneAbbr=getZoneAbbr;proto$1.zoneName=getZoneName;proto$1.dates=deprecate$1("dates accessor is deprecated. Use date instead.",getSetDayOfMonth);proto$1.months=deprecate$1("months accessor is deprecated. Use month instead",getSetMonth);proto$1.years=deprecate$1("years accessor is deprecated. Use year instead",getSetYear);proto$1.zone=deprecate$1("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone);proto$1.isDSTShifted=deprecate$1("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(tt){return createLocal(tt*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(tt){return tt}var proto$1$1=Locale.prototype;proto$1$1.calendar=calendar$1;proto$1$1.longDateFormat=longDateFormat;proto$1$1.invalidDate=invalidDate;proto$1$1.ordinal=ordinal$1;proto$1$1.preparse=preParsePostFormat;proto$1$1.postformat=preParsePostFormat;proto$1$1.relativeTime=relativeTime;proto$1$1.pastFuture=pastFuture;proto$1$1.set=set$2;proto$1$1.eras=localeEras;proto$1$1.erasParse=localeErasParse;proto$1$1.erasConvertYear=localeErasConvertYear;proto$1$1.erasAbbrRegex=erasAbbrRegex;proto$1$1.erasNameRegex=erasNameRegex;proto$1$1.erasNarrowRegex=erasNarrowRegex;proto$1$1.months=localeMonths;proto$1$1.monthsShort=localeMonthsShort;proto$1$1.monthsParse=localeMonthsParse;proto$1$1.monthsRegex=monthsRegex;proto$1$1.monthsShortRegex=monthsShortRegex;proto$1$1.week=localeWeek;proto$1$1.firstDayOfYear=localeFirstDayOfYear;proto$1$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1$1.weekdays=localeWeekdays;proto$1$1.weekdaysMin=localeWeekdaysMin;proto$1$1.weekdaysShort=localeWeekdaysShort;proto$1$1.weekdaysParse=localeWeekdaysParse;proto$1$1.weekdaysRegex=weekdaysRegex;proto$1$1.weekdaysShortRegex=weekdaysShortRegex;proto$1$1.weekdaysMinRegex=weekdaysMinRegex;proto$1$1.isPM=localeIsPM;proto$1$1.meridiem=localeMeridiem;function get$1$1(tt,et,nt,rt){var it=getLocale(),ot=createUTC().set(rt,et);return it[nt](ot,tt)}function listMonthsImpl(tt,et,nt){if(isNumber$5(tt)&&(et=tt,tt=void 0),tt=tt||"",et!=null)return get$1$1(tt,et,nt,"month");var rt,it=[];for(rt=0;rt<12;rt++)it[rt]=get$1$1(tt,rt,nt,"month");return it}function listWeekdaysImpl(tt,et,nt,rt){typeof tt=="boolean"?(isNumber$5(et)&&(nt=et,et=void 0),et=et||""):(et=tt,nt=et,tt=!1,isNumber$5(et)&&(nt=et,et=void 0),et=et||"");var it=getLocale(),ot=tt?it._week.dow:0,at,st=[];if(nt!=null)return get$1$1(et,(nt+ot)%7,rt,"day");for(at=0;at<7;at++)st[at]=get$1$1(et,(at+ot)%7,rt,"day");return st}function listMonths(tt,et){return listMonthsImpl(tt,et,"months")}function listMonthsShort(tt,et){return listMonthsImpl(tt,et,"monthsShort")}function listWeekdays(tt,et,nt){return listWeekdaysImpl(tt,et,nt,"weekdays")}function listWeekdaysShort(tt,et,nt){return listWeekdaysImpl(tt,et,nt,"weekdaysShort")}function listWeekdaysMin(tt,et,nt){return listWeekdaysImpl(tt,et,nt,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(tt){var et=tt%10,nt=toInt(tt%100/10)===1?"th":et===1?"st":et===2?"nd":et===3?"rd":"th";return tt+nt}});hooks.lang=deprecate$1("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale);hooks.langData=deprecate$1("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs$1(){var tt=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),tt.milliseconds=mathAbs(tt.milliseconds),tt.seconds=mathAbs(tt.seconds),tt.minutes=mathAbs(tt.minutes),tt.hours=mathAbs(tt.hours),tt.months=mathAbs(tt.months),tt.years=mathAbs(tt.years),this}function addSubtract$1(tt,et,nt,rt){var it=createDuration(et,nt);return tt._milliseconds+=rt*it._milliseconds,tt._days+=rt*it._days,tt._months+=rt*it._months,tt._bubble()}function add$1$1(tt,et){return addSubtract$1(this,tt,et,1)}function subtract$1$1(tt,et){return addSubtract$1(this,tt,et,-1)}function absCeil(tt){return tt<0?Math.floor(tt):Math.ceil(tt)}function bubble(){var tt=this._milliseconds,et=this._days,nt=this._months,rt=this._data,it,ot,at,st,lt;return tt>=0&&et>=0&&nt>=0||tt<=0&&et<=0&&nt<=0||(tt+=absCeil(monthsToDays(nt)+et)*864e5,et=0,nt=0),rt.milliseconds=tt%1e3,it=absFloor(tt/1e3),rt.seconds=it%60,ot=absFloor(it/60),rt.minutes=ot%60,at=absFloor(ot/60),rt.hours=at%24,et+=absFloor(at/24),lt=absFloor(daysToMonths(et)),nt+=lt,et-=absCeil(monthsToDays(lt)),st=absFloor(nt/12),nt%=12,rt.days=et,rt.months=nt,rt.years=st,this}function daysToMonths(tt){return tt*4800/146097}function monthsToDays(tt){return tt*146097/4800}function as(tt){if(!this.isValid())return NaN;var et,nt,rt=this._milliseconds;if(tt=normalizeUnits(tt),tt==="month"||tt==="quarter"||tt==="year")switch(et=this._days+rt/864e5,nt=this._months+daysToMonths(et),tt){case"month":return nt;case"quarter":return nt/3;case"year":return nt/12}else switch(et=this._days+Math.round(monthsToDays(this._months)),tt){case"week":return et/7+rt/6048e5;case"day":return et+rt/864e5;case"hour":return et*24+rt/36e5;case"minute":return et*1440+rt/6e4;case"second":return et*86400+rt/1e3;case"millisecond":return Math.floor(et*864e5)+rt;default:throw new Error("Unknown unit "+tt)}}function valueOf$1(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+toInt(this._months/12)*31536e6:NaN}function makeAs(tt){return function(){return this.as(tt)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y");function clone$1$1(){return createDuration(this)}function get$2$1(tt){return tt=normalizeUnits(tt),this.isValid()?this[tt+"s"]():NaN}function makeGetter(tt){return function(){return this.isValid()?this._data[tt]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round$3=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(tt,et,nt,rt,it){return it.relativeTime(et||1,!!nt,tt,rt)}function relativeTime$1(tt,et,nt,rt){var it=createDuration(tt).abs(),ot=round$3(it.as("s")),at=round$3(it.as("m")),st=round$3(it.as("h")),lt=round$3(it.as("d")),ct=round$3(it.as("M")),ut=round$3(it.as("w")),ht=round$3(it.as("y")),dt=ot<=nt.ss&&["s",ot]||ot0,dt[4]=rt,substituteTimeAgo.apply(null,dt)}function getSetRelativeTimeRounding(tt){return tt===void 0?round$3:typeof tt=="function"?(round$3=tt,!0):!1}function getSetRelativeTimeThreshold(tt,et){return thresholds[tt]===void 0?!1:et===void 0?thresholds[tt]:(thresholds[tt]=et,tt==="s"&&(thresholds.ss=et-1),!0)}function humanize(tt,et){if(!this.isValid())return this.localeData().invalidDate();var nt=!1,rt=thresholds,it,ot;return typeof tt=="object"&&(et=tt,tt=!1),typeof tt=="boolean"&&(nt=tt),typeof et=="object"&&(rt=Object.assign({},thresholds,et),et.s!=null&&et.ss==null&&(rt.ss=et.s-1)),it=this.localeData(),ot=relativeTime$1(this,!nt,rt,it),nt&&(ot=it.pastFuture(+this,ot)),it.postformat(ot)}var abs$1$1=Math.abs;function sign$3(tt){return(tt>0)-(tt<0)||+tt}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var tt=abs$1$1(this._milliseconds)/1e3,et=abs$1$1(this._days),nt=abs$1$1(this._months),rt,it,ot,at,st=this.asSeconds(),lt,ct,ut,ht;return st?(rt=absFloor(tt/60),it=absFloor(rt/60),tt%=60,rt%=60,ot=absFloor(nt/12),nt%=12,at=tt?tt.toFixed(3).replace(/\.?0+$/,""):"",lt=st<0?"-":"",ct=sign$3(this._months)!==sign$3(st)?"-":"",ut=sign$3(this._days)!==sign$3(st)?"-":"",ht=sign$3(this._milliseconds)!==sign$3(st)?"-":"",lt+"P"+(ot?ct+ot+"Y":"")+(nt?ct+nt+"M":"")+(et?ut+et+"D":"")+(it||rt||tt?"T":"")+(it?ht+it+"H":"")+(rt?ht+rt+"M":"")+(tt?ht+at+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1;proto$2.abs=abs$1;proto$2.add=add$1$1;proto$2.subtract=subtract$1$1;proto$2.as=as;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asQuarters=asQuarters;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1$1;proto$2.get=get$2$1;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale$2;proto$2.localeData=localeData;proto$2.toIsoString=deprecate$1("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1);proto$2.lang=lang;addFormatToken("X",0,0,"unix");addFormatToken("x",0,0,"valueOf");addRegexToken("x",matchSigned);addRegexToken("X",matchTimestamp);addParseToken("X",function(tt,et,nt){nt._d=new Date(parseFloat(tt)*1e3)});addParseToken("x",function(tt,et,nt){nt._d=new Date(toInt(tt))});//! moment.js -hooks.version="2.29.4";setHookCallback(createLocal);hooks.fn=proto$1;hooks.min=min$3;hooks.max=max$4;hooks.now=now$4;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate$1;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto$1;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const{origin:origin$1,host}=window.location;hooks.relativeTimeThreshold("h",24);hooks.updateLocale("en",{relativeTime:{s:tt=>`${tt} ${tt>1?"seconds":"second"}`,m:"1 minute",h:tt=>`${tt} ${tt>1?"hours":"hour"}`,d:"1 day",M:"1 month"}});const isDevelopment=origin$1==="http://localhost:3000"||origin$1==="http://localhost:3001"||origin$1==="https://sphinx-jarvis-david.sphinx1.repl.co",getUrlFormEnv=()=>({}).VITE_APP_API_URL,API_URL=getUrlFormEnv()||apiUrlFromSwarmHost()||"https://knowledge-graph.sphinx.chat",isChileGraph=API_URL.includes("boltwall");function apiUrlFromSwarmHost(){if(host.includes("swarm")&&host.startsWith("nav")){const tt=host.split(".");return tt[0]="boltwall",`https://${tt.join(".")}`}}const AWS_IMAGE_BUCKET_URL="https://stakwork-uploads.s3.amazonaws.com/",CLOUDFRONT_IMAGE_BUCKET_URL="https://d1gd7b7slyku8k.cloudfront.net/",GRAPH_FOG_COLOR="blue",GRAPH_GROUND_COLOR=13421772,GRAPH_LIGHT_INTENSITY=.8,BOOST_SUCCESS="Boosted successfully",BOOST_ERROR_BUDGET="Boost failed, insufficient budget",NODE_ADD_SUCCESS="Submitted!",NODE_ADD_ERROR="Submission failed, please try again.",NODE_RELATIVE_HIGHLIGHT_COLORS={children:{nodeColor:"green",segmentColor:4063109},guests:{nodeColor:"purple",segmentColor:14504191},topics:{nodeColor:"purple",segmentColor:5273842},pathway:{nodeColor:"#ffffff",segmentColor:16777215}},LINK="link",TWITTER_HANDLE="twitter_handle",GITHUB_REPOSITORY="github_repository",YOUTUBE_CHANNEL="youtube_channel",WEB_PAGE="web_page",RSS="rss",TWITTER_SOURCE="tweet",TOPIC="topic",DOCUMENT="document",isE2E=!!{}.VITE_APP_IS_E2E,requiredRule$1={required:{message:"The field is required",value:!0}};var dist$1={},identifier$1={},assert$p={exports:{}},errors$3={},util={},types$7={},shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var et={},nt=Symbol("test"),rt=Object(nt);if(typeof nt=="string"||Object.prototype.toString.call(nt)!=="[object Symbol]"||Object.prototype.toString.call(rt)!=="[object Symbol]")return!1;var it=42;et[nt]=it;for(nt in et)return!1;if(typeof Object.keys=="function"&&Object.keys(et).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(et).length!==0)return!1;var ot=Object.getOwnPropertySymbols(et);if(ot.length!==1||ot[0]!==nt||!Object.prototype.propertyIsEnumerable.call(et,nt))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var at=Object.getOwnPropertyDescriptor(et,nt);if(at.value!==it||at.enumerable!==!0)return!1}return!0},hasSymbols$3=shams$1,shams=function(){return hasSymbols$3()&&!!Symbol.toStringTag},origSymbol=typeof Symbol<"u"&&Symbol,hasSymbolSham=shams$1,hasSymbols$2=function(){return typeof origSymbol!="function"||typeof Symbol!="function"||typeof origSymbol("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hasSymbolSham()},test={foo:{}},$Object=Object,hasProto$1=function(){return{__proto__:test}.foo===test.foo&&!({__proto__:null}instanceof $Object)},ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr$4=Object.prototype.toString,max$3=Math.max,funcType="[object Function]",concatty=function(et,nt){for(var rt=[],it=0;it"u"||!getProto$1?undefined$1:getProto$1(Uint8Array),INTRINSICS={"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(getProto$1([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols$1?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto$1)try{null.error}catch(tt){var errorProto=getProto$1(getProto$1(tt));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function tt(et){var nt;if(et==="%AsyncFunction%")nt=getEvalledConstructor("async function () {}");else if(et==="%GeneratorFunction%")nt=getEvalledConstructor("function* () {}");else if(et==="%AsyncGeneratorFunction%")nt=getEvalledConstructor("async function* () {}");else if(et==="%AsyncGenerator%"){var rt=tt("%AsyncGeneratorFunction%");rt&&(nt=rt.prototype)}else if(et==="%AsyncIteratorPrototype%"){var it=tt("%AsyncGenerator%");it&&getProto$1&&(nt=getProto$1(it.prototype))}return INTRINSICS[et]=nt,nt},LEGACY_ALIASES={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn$1=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName$1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar$1=/\\(\\)?/g,stringToPath$2=function(et){var nt=$strSlice(et,0,1),rt=$strSlice(et,-1);if(nt==="%"&&rt!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(rt==="%"&&nt!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var it=[];return $replace(et,rePropName$1,function(ot,at,st,lt){it[it.length]=st?$replace(lt,reEscapeChar$1,"$1"):at||ot}),it},getBaseIntrinsic=function(et,nt){var rt=et,it;if(hasOwn$1(LEGACY_ALIASES,rt)&&(it=LEGACY_ALIASES[rt],rt="%"+it[0]+"%"),hasOwn$1(INTRINSICS,rt)){var ot=INTRINSICS[rt];if(ot===needsEval&&(ot=doEval(rt)),typeof ot>"u"&&!nt)throw new $TypeError$2("intrinsic "+et+" exists, but is not available. Please file an issue!");return{alias:it,name:rt,value:ot}}throw new $SyntaxError$1("intrinsic "+et+" does not exist!")},getIntrinsic=function(et,nt){if(typeof et!="string"||et.length===0)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof nt!="boolean")throw new $TypeError$2('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,et)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var rt=stringToPath$2(et),it=rt.length>0?rt[0]:"",ot=getBaseIntrinsic("%"+it+"%",nt),at=ot.name,st=ot.value,lt=!1,ct=ot.alias;ct&&(it=ct[0],$spliceApply(rt,$concat([0,1],ct)));for(var ut=1,ht=!0;ut=rt.length){var gt=$gOPD$1(st,dt);ht=!!gt,ht&&"get"in gt&&!("originalValue"in gt.get)?st=gt.get:st=st[dt]}else ht=hasOwn$1(st,dt),st=st[dt];ht&&!lt&&(INTRINSICS[at]=st)}}return st},callBind$2={exports:{}},GetIntrinsic$4=getIntrinsic,$defineProperty$1=GetIntrinsic$4("%Object.defineProperty%",!0),hasPropertyDescriptors$1=function(){if($defineProperty$1)try{return $defineProperty$1({},"a",{value:1}),!0}catch{return!1}return!1};hasPropertyDescriptors$1.hasArrayLengthDefineBug=function(){if(!hasPropertyDescriptors$1())return null;try{return $defineProperty$1([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors$1,GetIntrinsic$3=getIntrinsic,$gOPD=GetIntrinsic$3("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd$1=$gOPD,hasPropertyDescriptors=hasPropertyDescriptors_1(),GetIntrinsic$2=getIntrinsic,$defineProperty=hasPropertyDescriptors&&GetIntrinsic$2("%Object.defineProperty%",!0);if($defineProperty)try{$defineProperty({},"a",{value:1})}catch{$defineProperty=!1}var $SyntaxError=GetIntrinsic$2("%SyntaxError%"),$TypeError$1=GetIntrinsic$2("%TypeError%"),gopd=gopd$1,defineDataProperty=function(et,nt,rt){if(!et||typeof et!="object"&&typeof et!="function")throw new $TypeError$1("`obj` must be an object or a function`");if(typeof nt!="string"&&typeof nt!="symbol")throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$1("`loose`, if provided, must be a boolean");var it=arguments.length>3?arguments[3]:null,ot=arguments.length>4?arguments[4]:null,at=arguments.length>5?arguments[5]:null,st=arguments.length>6?arguments[6]:!1,lt=!!gopd&&gopd(et,nt);if($defineProperty)$defineProperty(et,nt,{configurable:at===null&<?lt.configurable:!at,enumerable:it===null&<?lt.enumerable:!it,value:rt,writable:ot===null&<?lt.writable:!ot});else if(st||!it&&!ot&&!at)et[nt]=rt;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},GetIntrinsic$1=getIntrinsic,define$1=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD$1=gopd$1,$TypeError=GetIntrinsic$1("%TypeError%"),$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(et,nt){if(typeof et!="function")throw new $TypeError("`fn` is not a function");if(typeof nt!="number"||nt<0||nt>4294967295||$floor(nt)!==nt)throw new $TypeError("`length` must be a positive 32-bit integer");var rt=arguments.length>2&&!!arguments[2],it=!0,ot=!0;if("length"in et&&gOPD$1){var at=gOPD$1(et,"length");at&&!at.configurable&&(it=!1),at&&!at.writable&&(ot=!1)}return(it||ot||!rt)&&(hasDescriptors?define$1(et,"length",nt,!0,!0):define$1(et,"length",nt)),et};(function(tt){var et=functionBind,nt=getIntrinsic,rt=setFunctionLength,it=nt("%TypeError%"),ot=nt("%Function.prototype.apply%"),at=nt("%Function.prototype.call%"),st=nt("%Reflect.apply%",!0)||et.call(at,ot),lt=nt("%Object.defineProperty%",!0),ct=nt("%Math.max%");if(lt)try{lt({},"a",{value:1})}catch{lt=null}tt.exports=function(dt){if(typeof dt!="function")throw new it("a function is required");var pt=st(et,at,arguments);return rt(pt,1+ct(0,dt.length-(arguments.length-1)),!0)};var ut=function(){return st(et,ot,arguments)};lt?lt(tt.exports,"apply",{value:ut}):tt.exports.apply=ut})(callBind$2);var callBindExports=callBind$2.exports,GetIntrinsic=getIntrinsic,callBind$1=callBindExports,$indexOf$1=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$3=function(et,nt){var rt=GetIntrinsic(et,!!nt);return typeof rt=="function"&&$indexOf$1(et,".prototype.")>-1?callBind$1(rt):rt},hasToStringTag$3=shams(),callBound$2=callBound$3,$toString$1=callBound$2("Object.prototype.toString"),isStandardArguments=function(et){return hasToStringTag$3&&et&&typeof et=="object"&&Symbol.toStringTag in et?!1:$toString$1(et)==="[object Arguments]"},isLegacyArguments=function(et){return isStandardArguments(et)?!0:et!==null&&typeof et=="object"&&typeof et.length=="number"&&et.length>=0&&$toString$1(et)!=="[object Array]"&&$toString$1(et.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments$5=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$3=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$2=shams(),getProto=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$2)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(et){if(typeof et!="function")return!1;if(isFnRegex.test(fnToStr$1.call(et)))return!0;if(!hasToStringTag$2){var nt=toStr$3.call(et);return nt==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var rt=getGeneratorFunc();GeneratorFunction=rt?getProto(rt):!1}return getProto(et)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(tt){tt!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(et){try{var nt=fnToStr.call(et);return constructorRegex.test(nt)}catch{return!1}},tryFunctionObject=function(et){try{return isES6ClassFn(et)?!1:(fnToStr.call(et),!0)}catch{return!1}},toStr$2=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$1=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all=document.all;toStr$2.call(all)===toStr$2.call(document.all)&&(isDDA=function(et){if((isIE68||!et)&&(typeof et>"u"||typeof et=="object"))try{var nt=toStr$2.call(et);return(nt===ddaClass||nt===ddaClass2||nt===ddaClass3||nt===objectClass)&&et("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;try{reflectApply(et,null,badArrayLike)}catch(nt){if(nt!==isCallableMarker)return!1}return!isES6ClassFn(et)&&tryFunctionObject(et)}:function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;if(hasToStringTag$1)return tryFunctionObject(et);if(isES6ClassFn(et))return!1;var nt=toStr$2.call(et);return nt!==fnClass&&nt!==genClass&&!/^\[object HTML/.test(nt)?!1:tryFunctionObject(et)},isCallable=isCallable$1,toStr$1=Object.prototype.toString,hasOwnProperty$e=Object.prototype.hasOwnProperty,forEachArray=function(et,nt,rt){for(var it=0,ot=et.length;it=3&&(it=rt),toStr$1.call(et)==="[object Array]"?forEachArray(et,nt,it):typeof et=="string"?forEachString(et,nt,it):forEachObject(et,nt,it)},forEach_1=forEach$1,possibleNames=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g$3=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$1=function(){for(var et=[],nt=0;nt"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound$1("String.prototype.slice"),getPrototypeOf=Object.getPrototypeOf,$indexOf=callBound$1("Array.prototype.indexOf",!0)||function(et,nt){for(var rt=0;rt-1?nt:nt!=="Object"?!1:trySlices(et)}return gOPD?tryTypedArrays(et):null},whichTypedArray=whichTypedArray$1,isTypedArray$4=function(et){return!!whichTypedArray(et)};(function(tt){var et=isArguments$5,nt=isGeneratorFunction,rt=whichTypedArray$1,it=isTypedArray$4;function ot(pn){return pn.call.bind(pn)}var at=typeof BigInt<"u",st=typeof Symbol<"u",lt=ot(Object.prototype.toString),ct=ot(Number.prototype.valueOf),ut=ot(String.prototype.valueOf),ht=ot(Boolean.prototype.valueOf);if(at)var dt=ot(BigInt.prototype.valueOf);if(st)var pt=ot(Symbol.prototype.valueOf);function mt(pn,Tn){if(typeof pn!="object")return!1;try{return Tn(pn),!0}catch{return!1}}tt.isArgumentsObject=et,tt.isGeneratorFunction=nt,tt.isTypedArray=it;function gt(pn){return typeof Promise<"u"&&pn instanceof Promise||pn!==null&&typeof pn=="object"&&typeof pn.then=="function"&&typeof pn.catch=="function"}tt.isPromise=gt;function yt(pn){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(pn):it(pn)||Ht(pn)}tt.isArrayBufferView=yt;function bt(pn){return rt(pn)==="Uint8Array"}tt.isUint8Array=bt;function wt(pn){return rt(pn)==="Uint8ClampedArray"}tt.isUint8ClampedArray=wt;function xt(pn){return rt(pn)==="Uint16Array"}tt.isUint16Array=xt;function kt(pn){return rt(pn)==="Uint32Array"}tt.isUint32Array=kt;function St(pn){return rt(pn)==="Int8Array"}tt.isInt8Array=St;function Tt(pn){return rt(pn)==="Int16Array"}tt.isInt16Array=Tt;function At(pn){return rt(pn)==="Int32Array"}tt.isInt32Array=At;function Et(pn){return rt(pn)==="Float32Array"}tt.isFloat32Array=Et;function Ct(pn){return rt(pn)==="Float64Array"}tt.isFloat64Array=Ct;function Lt(pn){return rt(pn)==="BigInt64Array"}tt.isBigInt64Array=Lt;function jt(pn){return rt(pn)==="BigUint64Array"}tt.isBigUint64Array=jt;function Rt(pn){return lt(pn)==="[object Map]"}Rt.working=typeof Map<"u"&&Rt(new Map);function $t(pn){return typeof Map>"u"?!1:Rt.working?Rt(pn):pn instanceof Map}tt.isMap=$t;function vt(pn){return lt(pn)==="[object Set]"}vt.working=typeof Set<"u"&&vt(new Set);function It(pn){return typeof Set>"u"?!1:vt.working?vt(pn):pn instanceof Set}tt.isSet=It;function Ot(pn){return lt(pn)==="[object WeakMap]"}Ot.working=typeof WeakMap<"u"&&Ot(new WeakMap);function Wt(pn){return typeof WeakMap>"u"?!1:Ot.working?Ot(pn):pn instanceof WeakMap}tt.isWeakMap=Wt;function zt(pn){return lt(pn)==="[object WeakSet]"}zt.working=typeof WeakSet<"u"&&zt(new WeakSet);function Ft(pn){return zt(pn)}tt.isWeakSet=Ft;function Nt(pn){return lt(pn)==="[object ArrayBuffer]"}Nt.working=typeof ArrayBuffer<"u"&&Nt(new ArrayBuffer);function Ut(pn){return typeof ArrayBuffer>"u"?!1:Nt.working?Nt(pn):pn instanceof ArrayBuffer}tt.isArrayBuffer=Ut;function Pt(pn){return lt(pn)==="[object DataView]"}Pt.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Pt(new DataView(new ArrayBuffer(1),0,1));function Ht(pn){return typeof DataView>"u"?!1:Pt.working?Pt(pn):pn instanceof DataView}tt.isDataView=Ht;var Qt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function an(pn){return lt(pn)==="[object SharedArrayBuffer]"}function Yt(pn){return typeof Qt>"u"?!1:(typeof an.working>"u"&&(an.working=an(new Qt)),an.working?an(pn):pn instanceof Qt)}tt.isSharedArrayBuffer=Yt;function nn(pn){return lt(pn)==="[object AsyncFunction]"}tt.isAsyncFunction=nn;function tn(pn){return lt(pn)==="[object Map Iterator]"}tt.isMapIterator=tn;function dn(pn){return lt(pn)==="[object Set Iterator]"}tt.isSetIterator=dn;function wn(pn){return lt(pn)==="[object Generator]"}tt.isGeneratorObject=wn;function rn(pn){return lt(pn)==="[object WebAssembly.Module]"}tt.isWebAssemblyCompiledModule=rn;function Jt(pn){return mt(pn,ct)}tt.isNumberObject=Jt;function vn(pn){return mt(pn,ut)}tt.isStringObject=vn;function Cn(pn){return mt(pn,ht)}tt.isBooleanObject=Cn;function $n(pn){return at&&mt(pn,dt)}tt.isBigIntObject=$n;function Nn(pn){return st&&mt(pn,pt)}tt.isSymbolObject=Nn;function En(pn){return Jt(pn)||vn(pn)||Cn(pn)||$n(pn)||Nn(pn)}tt.isBoxedPrimitive=En;function sn(pn){return typeof Uint8Array<"u"&&(Ut(pn)||Yt(pn))}tt.isAnyArrayBuffer=sn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(pn){Object.defineProperty(tt,pn,{enumerable:!1,value:function(){throw new Error(pn+" is not supported in userland")}})})})(types$7);var isBufferBrowser=function(et){return et&&typeof et=="object"&&typeof et.copy=="function"&&typeof et.fill=="function"&&typeof et.readUInt8=="function"},inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(et,nt){nt&&(et.super_=nt,et.prototype=Object.create(nt.prototype,{constructor:{value:et,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(et,nt){if(nt){et.super_=nt;var rt=function(){};rt.prototype=nt.prototype,et.prototype=new rt,et.prototype.constructor=et}};var inherits_browserExports=inherits_browser.exports;(function(tt){var et=Object.getOwnPropertyDescriptors||function(Ht){for(var Qt=Object.keys(Ht),an={},Yt=0;Yt=Yt)return dn;switch(dn){case"%s":return String(an[Qt++]);case"%d":return Number(an[Qt++]);case"%j":try{return JSON.stringify(an[Qt++])}catch{return"[Circular]"}default:return dn}}),tn=an[Qt];Qt"u")return function(){return tt.deprecate(Pt,Ht).apply(this,arguments)};var Qt=!1;function an(){if(!Qt){if(process.throwDeprecation)throw new Error(Ht);process.traceDeprecation?console.trace(Ht):console.error(Ht),Qt=!0}return Pt.apply(this,arguments)}return an};var rt={},it=/^$/;if({}.NODE_DEBUG){var ot={}.NODE_DEBUG;ot=ot.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),it=new RegExp("^"+ot+"$","i")}tt.debuglog=function(Pt){if(Pt=Pt.toUpperCase(),!rt[Pt])if(it.test(Pt)){var Ht=process.pid;rt[Pt]=function(){var Qt=tt.format.apply(tt,arguments);console.error("%s %d: %s",Pt,Ht,Qt)}}else rt[Pt]=function(){};return rt[Pt]};function at(Pt,Ht){var Qt={seen:[],stylize:lt};return arguments.length>=3&&(Qt.depth=arguments[2]),arguments.length>=4&&(Qt.colors=arguments[3]),bt(Ht)?Qt.showHidden=Ht:Ht&&tt._extend(Qt,Ht),At(Qt.showHidden)&&(Qt.showHidden=!1),At(Qt.depth)&&(Qt.depth=2),At(Qt.colors)&&(Qt.colors=!1),At(Qt.customInspect)&&(Qt.customInspect=!0),Qt.colors&&(Qt.stylize=st),ut(Qt,Pt,Qt.depth)}tt.inspect=at,at.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},at.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function st(Pt,Ht){var Qt=at.styles[Ht];return Qt?"\x1B["+at.colors[Qt][0]+"m"+Pt+"\x1B["+at.colors[Qt][1]+"m":Pt}function lt(Pt,Ht){return Pt}function ct(Pt){var Ht={};return Pt.forEach(function(Qt,an){Ht[Qt]=!0}),Ht}function ut(Pt,Ht,Qt){if(Pt.customInspect&&Ht&&Rt(Ht.inspect)&&Ht.inspect!==tt.inspect&&!(Ht.constructor&&Ht.constructor.prototype===Ht)){var an=Ht.inspect(Qt,Pt);return St(an)||(an=ut(Pt,an,Qt)),an}var Yt=ht(Pt,Ht);if(Yt)return Yt;var nn=Object.keys(Ht),tn=ct(nn);if(Pt.showHidden&&(nn=Object.getOwnPropertyNames(Ht)),jt(Ht)&&(nn.indexOf("message")>=0||nn.indexOf("description")>=0))return dt(Ht);if(nn.length===0){if(Rt(Ht)){var dn=Ht.name?": "+Ht.name:"";return Pt.stylize("[Function"+dn+"]","special")}if(Et(Ht))return Pt.stylize(RegExp.prototype.toString.call(Ht),"regexp");if(Lt(Ht))return Pt.stylize(Date.prototype.toString.call(Ht),"date");if(jt(Ht))return dt(Ht)}var wn="",rn=!1,Jt=["{","}"];if(yt(Ht)&&(rn=!0,Jt=["[","]"]),Rt(Ht)){var vn=Ht.name?": "+Ht.name:"";wn=" [Function"+vn+"]"}if(Et(Ht)&&(wn=" "+RegExp.prototype.toString.call(Ht)),Lt(Ht)&&(wn=" "+Date.prototype.toUTCString.call(Ht)),jt(Ht)&&(wn=" "+dt(Ht)),nn.length===0&&(!rn||Ht.length==0))return Jt[0]+wn+Jt[1];if(Qt<0)return Et(Ht)?Pt.stylize(RegExp.prototype.toString.call(Ht),"regexp"):Pt.stylize("[Object]","special");Pt.seen.push(Ht);var Cn;return rn?Cn=pt(Pt,Ht,Qt,tn,nn):Cn=nn.map(function($n){return mt(Pt,Ht,Qt,tn,$n,rn)}),Pt.seen.pop(),gt(Cn,wn,Jt)}function ht(Pt,Ht){if(At(Ht))return Pt.stylize("undefined","undefined");if(St(Ht)){var Qt="'"+JSON.stringify(Ht).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Pt.stylize(Qt,"string")}if(kt(Ht))return Pt.stylize(""+Ht,"number");if(bt(Ht))return Pt.stylize(""+Ht,"boolean");if(wt(Ht))return Pt.stylize("null","null")}function dt(Pt){return"["+Error.prototype.toString.call(Pt)+"]"}function pt(Pt,Ht,Qt,an,Yt){for(var nn=[],tn=0,dn=Ht.length;tn`${tt} ${tt>1?"seconds":"second"}`,m:"1 minute",h:tt=>`${tt} ${tt>1?"hours":"hour"}`,d:"1 day",M:"1 month"}});const isDevelopment=origin$1==="http://localhost:3000"||origin$1==="http://localhost:3001"||origin$1==="https://sphinx-jarvis-david.sphinx1.repl.co",getUrlFormEnv=()=>({}).VITE_APP_API_URL,API_URL=getUrlFormEnv()||apiUrlFromSwarmHost()||"https://knowledge-graph.sphinx.chat",isChileGraph=API_URL.includes("boltwall");function apiUrlFromSwarmHost(){if(host.includes("swarm")&&host.startsWith("nav")){const tt=host.split(".");return tt[0]="boltwall",`https://${tt.join(".")}`}}const AWS_IMAGE_BUCKET_URL="https://stakwork-uploads.s3.amazonaws.com/",CLOUDFRONT_IMAGE_BUCKET_URL="https://d1gd7b7slyku8k.cloudfront.net/",GRAPH_FOG_COLOR="blue",GRAPH_GROUND_COLOR=13421772,GRAPH_LIGHT_INTENSITY=.8,BOOST_SUCCESS="Boosted successfully",BOOST_ERROR_BUDGET="Boost failed, insufficient budget",NODE_ADD_SUCCESS="Submitted!",NODE_ADD_ERROR="Submission failed, please try again.",NODE_RELATIVE_HIGHLIGHT_COLORS={children:{nodeColor:"green",segmentColor:4063109},guests:{nodeColor:"purple",segmentColor:14504191},topics:{nodeColor:"purple",segmentColor:5273842},pathway:{nodeColor:"#ffffff",segmentColor:16777215}},LINK="link",TWITTER_HANDLE="twitter_handle",GITHUB_REPOSITORY="github_repository",YOUTUBE_CHANNEL="youtube_channel",WEB_PAGE="web_page",RSS="rss",TWITTER_SOURCE="tweet",TOPIC="topic",DOCUMENT="document",isE2E=!!{}.VITE_APP_IS_E2E,requiredRule$1={required:{message:"The field is required",value:!0}};var dist$1={},identifier$1={},assert$p={exports:{}},errors$3={},util={},types$7={},shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var et={},nt=Symbol("test"),rt=Object(nt);if(typeof nt=="string"||Object.prototype.toString.call(nt)!=="[object Symbol]"||Object.prototype.toString.call(rt)!=="[object Symbol]")return!1;var it=42;et[nt]=it;for(nt in et)return!1;if(typeof Object.keys=="function"&&Object.keys(et).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(et).length!==0)return!1;var ot=Object.getOwnPropertySymbols(et);if(ot.length!==1||ot[0]!==nt||!Object.prototype.propertyIsEnumerable.call(et,nt))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var at=Object.getOwnPropertyDescriptor(et,nt);if(at.value!==it||at.enumerable!==!0)return!1}return!0},hasSymbols$3=shams$1,shams=function(){return hasSymbols$3()&&!!Symbol.toStringTag},origSymbol=typeof Symbol<"u"&&Symbol,hasSymbolSham=shams$1,hasSymbols$2=function(){return typeof origSymbol!="function"||typeof Symbol!="function"||typeof origSymbol("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hasSymbolSham()},test={foo:{}},$Object=Object,hasProto$1=function(){return{__proto__:test}.foo===test.foo&&!({__proto__:null}instanceof $Object)},ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr$4=Object.prototype.toString,max$3=Math.max,funcType="[object Function]",concatty=function(et,nt){for(var rt=[],it=0;it"u"||!getProto$1?undefined$1:getProto$1(Uint8Array),INTRINSICS={"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(getProto$1([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols$1?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto$1)try{null.error}catch(tt){var errorProto=getProto$1(getProto$1(tt));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function tt(et){var nt;if(et==="%AsyncFunction%")nt=getEvalledConstructor("async function () {}");else if(et==="%GeneratorFunction%")nt=getEvalledConstructor("function* () {}");else if(et==="%AsyncGeneratorFunction%")nt=getEvalledConstructor("async function* () {}");else if(et==="%AsyncGenerator%"){var rt=tt("%AsyncGeneratorFunction%");rt&&(nt=rt.prototype)}else if(et==="%AsyncIteratorPrototype%"){var it=tt("%AsyncGenerator%");it&&getProto$1&&(nt=getProto$1(it.prototype))}return INTRINSICS[et]=nt,nt},LEGACY_ALIASES={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn$1=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName$1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar$1=/\\(\\)?/g,stringToPath$2=function(et){var nt=$strSlice(et,0,1),rt=$strSlice(et,-1);if(nt==="%"&&rt!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(rt==="%"&&nt!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var it=[];return $replace(et,rePropName$1,function(ot,at,st,lt){it[it.length]=st?$replace(lt,reEscapeChar$1,"$1"):at||ot}),it},getBaseIntrinsic=function(et,nt){var rt=et,it;if(hasOwn$1(LEGACY_ALIASES,rt)&&(it=LEGACY_ALIASES[rt],rt="%"+it[0]+"%"),hasOwn$1(INTRINSICS,rt)){var ot=INTRINSICS[rt];if(ot===needsEval&&(ot=doEval(rt)),typeof ot>"u"&&!nt)throw new $TypeError$2("intrinsic "+et+" exists, but is not available. Please file an issue!");return{alias:it,name:rt,value:ot}}throw new $SyntaxError$1("intrinsic "+et+" does not exist!")},getIntrinsic=function(et,nt){if(typeof et!="string"||et.length===0)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof nt!="boolean")throw new $TypeError$2('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,et)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var rt=stringToPath$2(et),it=rt.length>0?rt[0]:"",ot=getBaseIntrinsic("%"+it+"%",nt),at=ot.name,st=ot.value,lt=!1,ct=ot.alias;ct&&(it=ct[0],$spliceApply(rt,$concat([0,1],ct)));for(var ut=1,ht=!0;ut=rt.length){var gt=$gOPD$1(st,dt);ht=!!gt,ht&&"get"in gt&&!("originalValue"in gt.get)?st=gt.get:st=st[dt]}else ht=hasOwn$1(st,dt),st=st[dt];ht&&!lt&&(INTRINSICS[at]=st)}}return st},callBind$2={exports:{}},GetIntrinsic$4=getIntrinsic,$defineProperty$1=GetIntrinsic$4("%Object.defineProperty%",!0),hasPropertyDescriptors$1=function(){if($defineProperty$1)try{return $defineProperty$1({},"a",{value:1}),!0}catch{return!1}return!1};hasPropertyDescriptors$1.hasArrayLengthDefineBug=function(){if(!hasPropertyDescriptors$1())return null;try{return $defineProperty$1([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors$1,GetIntrinsic$3=getIntrinsic,$gOPD=GetIntrinsic$3("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd$1=$gOPD,hasPropertyDescriptors=hasPropertyDescriptors_1(),GetIntrinsic$2=getIntrinsic,$defineProperty=hasPropertyDescriptors&&GetIntrinsic$2("%Object.defineProperty%",!0);if($defineProperty)try{$defineProperty({},"a",{value:1})}catch{$defineProperty=!1}var $SyntaxError=GetIntrinsic$2("%SyntaxError%"),$TypeError$1=GetIntrinsic$2("%TypeError%"),gopd=gopd$1,defineDataProperty=function(et,nt,rt){if(!et||typeof et!="object"&&typeof et!="function")throw new $TypeError$1("`obj` must be an object or a function`");if(typeof nt!="string"&&typeof nt!="symbol")throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$1("`loose`, if provided, must be a boolean");var it=arguments.length>3?arguments[3]:null,ot=arguments.length>4?arguments[4]:null,at=arguments.length>5?arguments[5]:null,st=arguments.length>6?arguments[6]:!1,lt=!!gopd&&gopd(et,nt);if($defineProperty)$defineProperty(et,nt,{configurable:at===null&<?lt.configurable:!at,enumerable:it===null&<?lt.enumerable:!it,value:rt,writable:ot===null&<?lt.writable:!ot});else if(st||!it&&!ot&&!at)et[nt]=rt;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},GetIntrinsic$1=getIntrinsic,define$1=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD$1=gopd$1,$TypeError=GetIntrinsic$1("%TypeError%"),$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(et,nt){if(typeof et!="function")throw new $TypeError("`fn` is not a function");if(typeof nt!="number"||nt<0||nt>4294967295||$floor(nt)!==nt)throw new $TypeError("`length` must be a positive 32-bit integer");var rt=arguments.length>2&&!!arguments[2],it=!0,ot=!0;if("length"in et&&gOPD$1){var at=gOPD$1(et,"length");at&&!at.configurable&&(it=!1),at&&!at.writable&&(ot=!1)}return(it||ot||!rt)&&(hasDescriptors?define$1(et,"length",nt,!0,!0):define$1(et,"length",nt)),et};(function(tt){var et=functionBind,nt=getIntrinsic,rt=setFunctionLength,it=nt("%TypeError%"),ot=nt("%Function.prototype.apply%"),at=nt("%Function.prototype.call%"),st=nt("%Reflect.apply%",!0)||et.call(at,ot),lt=nt("%Object.defineProperty%",!0),ct=nt("%Math.max%");if(lt)try{lt({},"a",{value:1})}catch{lt=null}tt.exports=function(dt){if(typeof dt!="function")throw new it("a function is required");var pt=st(et,at,arguments);return rt(pt,1+ct(0,dt.length-(arguments.length-1)),!0)};var ut=function(){return st(et,ot,arguments)};lt?lt(tt.exports,"apply",{value:ut}):tt.exports.apply=ut})(callBind$2);var callBindExports=callBind$2.exports,GetIntrinsic=getIntrinsic,callBind$1=callBindExports,$indexOf$1=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$3=function(et,nt){var rt=GetIntrinsic(et,!!nt);return typeof rt=="function"&&$indexOf$1(et,".prototype.")>-1?callBind$1(rt):rt},hasToStringTag$3=shams(),callBound$2=callBound$3,$toString$1=callBound$2("Object.prototype.toString"),isStandardArguments=function(et){return hasToStringTag$3&&et&&typeof et=="object"&&Symbol.toStringTag in et?!1:$toString$1(et)==="[object Arguments]"},isLegacyArguments=function(et){return isStandardArguments(et)?!0:et!==null&&typeof et=="object"&&typeof et.length=="number"&&et.length>=0&&$toString$1(et)!=="[object Array]"&&$toString$1(et.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments$5=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$3=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$2=shams(),getProto=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$2)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(et){if(typeof et!="function")return!1;if(isFnRegex.test(fnToStr$1.call(et)))return!0;if(!hasToStringTag$2){var nt=toStr$3.call(et);return nt==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var rt=getGeneratorFunc();GeneratorFunction=rt?getProto(rt):!1}return getProto(et)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(tt){tt!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(et){try{var nt=fnToStr.call(et);return constructorRegex.test(nt)}catch{return!1}},tryFunctionObject=function(et){try{return isES6ClassFn(et)?!1:(fnToStr.call(et),!0)}catch{return!1}},toStr$2=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$1=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all=document.all;toStr$2.call(all)===toStr$2.call(document.all)&&(isDDA=function(et){if((isIE68||!et)&&(typeof et>"u"||typeof et=="object"))try{var nt=toStr$2.call(et);return(nt===ddaClass||nt===ddaClass2||nt===ddaClass3||nt===objectClass)&&et("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;try{reflectApply(et,null,badArrayLike)}catch(nt){if(nt!==isCallableMarker)return!1}return!isES6ClassFn(et)&&tryFunctionObject(et)}:function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;if(hasToStringTag$1)return tryFunctionObject(et);if(isES6ClassFn(et))return!1;var nt=toStr$2.call(et);return nt!==fnClass&&nt!==genClass&&!/^\[object HTML/.test(nt)?!1:tryFunctionObject(et)},isCallable=isCallable$1,toStr$1=Object.prototype.toString,hasOwnProperty$e=Object.prototype.hasOwnProperty,forEachArray=function(et,nt,rt){for(var it=0,ot=et.length;it=3&&(it=rt),toStr$1.call(et)==="[object Array]"?forEachArray(et,nt,it):typeof et=="string"?forEachString(et,nt,it):forEachObject(et,nt,it)},forEach_1=forEach$1,possibleNames=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g$3=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$1=function(){for(var et=[],nt=0;nt"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound$1("String.prototype.slice"),getPrototypeOf=Object.getPrototypeOf,$indexOf=callBound$1("Array.prototype.indexOf",!0)||function(et,nt){for(var rt=0;rt-1?nt:nt!=="Object"?!1:trySlices(et)}return gOPD?tryTypedArrays(et):null},whichTypedArray=whichTypedArray$1,isTypedArray$4=function(et){return!!whichTypedArray(et)};(function(tt){var et=isArguments$5,nt=isGeneratorFunction,rt=whichTypedArray$1,it=isTypedArray$4;function ot(pn){return pn.call.bind(pn)}var at=typeof BigInt<"u",st=typeof Symbol<"u",lt=ot(Object.prototype.toString),ct=ot(Number.prototype.valueOf),ut=ot(String.prototype.valueOf),ht=ot(Boolean.prototype.valueOf);if(at)var dt=ot(BigInt.prototype.valueOf);if(st)var pt=ot(Symbol.prototype.valueOf);function mt(pn,Tn){if(typeof pn!="object")return!1;try{return Tn(pn),!0}catch{return!1}}tt.isArgumentsObject=et,tt.isGeneratorFunction=nt,tt.isTypedArray=it;function gt(pn){return typeof Promise<"u"&&pn instanceof Promise||pn!==null&&typeof pn=="object"&&typeof pn.then=="function"&&typeof pn.catch=="function"}tt.isPromise=gt;function yt(pn){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(pn):it(pn)||Ht(pn)}tt.isArrayBufferView=yt;function bt(pn){return rt(pn)==="Uint8Array"}tt.isUint8Array=bt;function wt(pn){return rt(pn)==="Uint8ClampedArray"}tt.isUint8ClampedArray=wt;function xt(pn){return rt(pn)==="Uint16Array"}tt.isUint16Array=xt;function kt(pn){return rt(pn)==="Uint32Array"}tt.isUint32Array=kt;function St(pn){return rt(pn)==="Int8Array"}tt.isInt8Array=St;function Tt(pn){return rt(pn)==="Int16Array"}tt.isInt16Array=Tt;function At(pn){return rt(pn)==="Int32Array"}tt.isInt32Array=At;function Et(pn){return rt(pn)==="Float32Array"}tt.isFloat32Array=Et;function Ct(pn){return rt(pn)==="Float64Array"}tt.isFloat64Array=Ct;function Lt(pn){return rt(pn)==="BigInt64Array"}tt.isBigInt64Array=Lt;function jt(pn){return rt(pn)==="BigUint64Array"}tt.isBigUint64Array=jt;function Rt(pn){return lt(pn)==="[object Map]"}Rt.working=typeof Map<"u"&&Rt(new Map);function $t(pn){return typeof Map>"u"?!1:Rt.working?Rt(pn):pn instanceof Map}tt.isMap=$t;function vt(pn){return lt(pn)==="[object Set]"}vt.working=typeof Set<"u"&&vt(new Set);function It(pn){return typeof Set>"u"?!1:vt.working?vt(pn):pn instanceof Set}tt.isSet=It;function Ot(pn){return lt(pn)==="[object WeakMap]"}Ot.working=typeof WeakMap<"u"&&Ot(new WeakMap);function Wt(pn){return typeof WeakMap>"u"?!1:Ot.working?Ot(pn):pn instanceof WeakMap}tt.isWeakMap=Wt;function zt(pn){return lt(pn)==="[object WeakSet]"}zt.working=typeof WeakSet<"u"&&zt(new WeakSet);function Ft(pn){return zt(pn)}tt.isWeakSet=Ft;function Nt(pn){return lt(pn)==="[object ArrayBuffer]"}Nt.working=typeof ArrayBuffer<"u"&&Nt(new ArrayBuffer);function Ut(pn){return typeof ArrayBuffer>"u"?!1:Nt.working?Nt(pn):pn instanceof ArrayBuffer}tt.isArrayBuffer=Ut;function Pt(pn){return lt(pn)==="[object DataView]"}Pt.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Pt(new DataView(new ArrayBuffer(1),0,1));function Ht(pn){return typeof DataView>"u"?!1:Pt.working?Pt(pn):pn instanceof DataView}tt.isDataView=Ht;var Qt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function an(pn){return lt(pn)==="[object SharedArrayBuffer]"}function Yt(pn){return typeof Qt>"u"?!1:(typeof an.working>"u"&&(an.working=an(new Qt)),an.working?an(pn):pn instanceof Qt)}tt.isSharedArrayBuffer=Yt;function nn(pn){return lt(pn)==="[object AsyncFunction]"}tt.isAsyncFunction=nn;function tn(pn){return lt(pn)==="[object Map Iterator]"}tt.isMapIterator=tn;function dn(pn){return lt(pn)==="[object Set Iterator]"}tt.isSetIterator=dn;function wn(pn){return lt(pn)==="[object Generator]"}tt.isGeneratorObject=wn;function rn(pn){return lt(pn)==="[object WebAssembly.Module]"}tt.isWebAssemblyCompiledModule=rn;function Zt(pn){return mt(pn,ct)}tt.isNumberObject=Zt;function vn(pn){return mt(pn,ut)}tt.isStringObject=vn;function Cn(pn){return mt(pn,ht)}tt.isBooleanObject=Cn;function $n(pn){return at&&mt(pn,dt)}tt.isBigIntObject=$n;function Nn(pn){return st&&mt(pn,pt)}tt.isSymbolObject=Nn;function En(pn){return Zt(pn)||vn(pn)||Cn(pn)||$n(pn)||Nn(pn)}tt.isBoxedPrimitive=En;function sn(pn){return typeof Uint8Array<"u"&&(Ut(pn)||Yt(pn))}tt.isAnyArrayBuffer=sn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(pn){Object.defineProperty(tt,pn,{enumerable:!1,value:function(){throw new Error(pn+" is not supported in userland")}})})})(types$7);var isBufferBrowser=function(et){return et&&typeof et=="object"&&typeof et.copy=="function"&&typeof et.fill=="function"&&typeof et.readUInt8=="function"},inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(et,nt){nt&&(et.super_=nt,et.prototype=Object.create(nt.prototype,{constructor:{value:et,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(et,nt){if(nt){et.super_=nt;var rt=function(){};rt.prototype=nt.prototype,et.prototype=new rt,et.prototype.constructor=et}};var inherits_browserExports=inherits_browser.exports;(function(tt){var et=Object.getOwnPropertyDescriptors||function(Ht){for(var Qt=Object.keys(Ht),an={},Yt=0;Yt=Yt)return dn;switch(dn){case"%s":return String(an[Qt++]);case"%d":return Number(an[Qt++]);case"%j":try{return JSON.stringify(an[Qt++])}catch{return"[Circular]"}default:return dn}}),tn=an[Qt];Qt"u")return function(){return tt.deprecate(Pt,Ht).apply(this,arguments)};var Qt=!1;function an(){if(!Qt){if(process.throwDeprecation)throw new Error(Ht);process.traceDeprecation?console.trace(Ht):console.error(Ht),Qt=!0}return Pt.apply(this,arguments)}return an};var rt={},it=/^$/;if({}.NODE_DEBUG){var ot={}.NODE_DEBUG;ot=ot.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),it=new RegExp("^"+ot+"$","i")}tt.debuglog=function(Pt){if(Pt=Pt.toUpperCase(),!rt[Pt])if(it.test(Pt)){var Ht=process.pid;rt[Pt]=function(){var Qt=tt.format.apply(tt,arguments);console.error("%s %d: %s",Pt,Ht,Qt)}}else rt[Pt]=function(){};return rt[Pt]};function at(Pt,Ht){var Qt={seen:[],stylize:lt};return arguments.length>=3&&(Qt.depth=arguments[2]),arguments.length>=4&&(Qt.colors=arguments[3]),bt(Ht)?Qt.showHidden=Ht:Ht&&tt._extend(Qt,Ht),At(Qt.showHidden)&&(Qt.showHidden=!1),At(Qt.depth)&&(Qt.depth=2),At(Qt.colors)&&(Qt.colors=!1),At(Qt.customInspect)&&(Qt.customInspect=!0),Qt.colors&&(Qt.stylize=st),ut(Qt,Pt,Qt.depth)}tt.inspect=at,at.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},at.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function st(Pt,Ht){var Qt=at.styles[Ht];return Qt?"\x1B["+at.colors[Qt][0]+"m"+Pt+"\x1B["+at.colors[Qt][1]+"m":Pt}function lt(Pt,Ht){return Pt}function ct(Pt){var Ht={};return Pt.forEach(function(Qt,an){Ht[Qt]=!0}),Ht}function ut(Pt,Ht,Qt){if(Pt.customInspect&&Ht&&Rt(Ht.inspect)&&Ht.inspect!==tt.inspect&&!(Ht.constructor&&Ht.constructor.prototype===Ht)){var an=Ht.inspect(Qt,Pt);return St(an)||(an=ut(Pt,an,Qt)),an}var Yt=ht(Pt,Ht);if(Yt)return Yt;var nn=Object.keys(Ht),tn=ct(nn);if(Pt.showHidden&&(nn=Object.getOwnPropertyNames(Ht)),jt(Ht)&&(nn.indexOf("message")>=0||nn.indexOf("description")>=0))return dt(Ht);if(nn.length===0){if(Rt(Ht)){var dn=Ht.name?": "+Ht.name:"";return Pt.stylize("[Function"+dn+"]","special")}if(Et(Ht))return Pt.stylize(RegExp.prototype.toString.call(Ht),"regexp");if(Lt(Ht))return Pt.stylize(Date.prototype.toString.call(Ht),"date");if(jt(Ht))return dt(Ht)}var wn="",rn=!1,Zt=["{","}"];if(yt(Ht)&&(rn=!0,Zt=["[","]"]),Rt(Ht)){var vn=Ht.name?": "+Ht.name:"";wn=" [Function"+vn+"]"}if(Et(Ht)&&(wn=" "+RegExp.prototype.toString.call(Ht)),Lt(Ht)&&(wn=" "+Date.prototype.toUTCString.call(Ht)),jt(Ht)&&(wn=" "+dt(Ht)),nn.length===0&&(!rn||Ht.length==0))return Zt[0]+wn+Zt[1];if(Qt<0)return Et(Ht)?Pt.stylize(RegExp.prototype.toString.call(Ht),"regexp"):Pt.stylize("[Object]","special");Pt.seen.push(Ht);var Cn;return rn?Cn=pt(Pt,Ht,Qt,tn,nn):Cn=nn.map(function($n){return mt(Pt,Ht,Qt,tn,$n,rn)}),Pt.seen.pop(),gt(Cn,wn,Zt)}function ht(Pt,Ht){if(At(Ht))return Pt.stylize("undefined","undefined");if(St(Ht)){var Qt="'"+JSON.stringify(Ht).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Pt.stylize(Qt,"string")}if(kt(Ht))return Pt.stylize(""+Ht,"number");if(bt(Ht))return Pt.stylize(""+Ht,"boolean");if(wt(Ht))return Pt.stylize("null","null")}function dt(Pt){return"["+Error.prototype.toString.call(Pt)+"]"}function pt(Pt,Ht,Qt,an,Yt){for(var nn=[],tn=0,dn=Ht.length;tn-1&&(nn?dn=dn.split(` `).map(function(rn){return" "+rn}).join(` `).slice(2):dn=` @@ -3357,10 +3357,10 @@ hooks.version="2.29.4";setHookCallback(createLocal);hooks.fn=proto$1;hooks.min=m `)+" "+Pt.join(`, `)+" "+Qt[1]:Qt[0]+Ht+" "+Pt.join(", ")+" "+Qt[1]}tt.types=types$7;function yt(Pt){return Array.isArray(Pt)}tt.isArray=yt;function bt(Pt){return typeof Pt=="boolean"}tt.isBoolean=bt;function wt(Pt){return Pt===null}tt.isNull=wt;function xt(Pt){return Pt==null}tt.isNullOrUndefined=xt;function kt(Pt){return typeof Pt=="number"}tt.isNumber=kt;function St(Pt){return typeof Pt=="string"}tt.isString=St;function Tt(Pt){return typeof Pt=="symbol"}tt.isSymbol=Tt;function At(Pt){return Pt===void 0}tt.isUndefined=At;function Et(Pt){return Ct(Pt)&&vt(Pt)==="[object RegExp]"}tt.isRegExp=Et,tt.types.isRegExp=Et;function Ct(Pt){return typeof Pt=="object"&&Pt!==null}tt.isObject=Ct;function Lt(Pt){return Ct(Pt)&&vt(Pt)==="[object Date]"}tt.isDate=Lt,tt.types.isDate=Lt;function jt(Pt){return Ct(Pt)&&(vt(Pt)==="[object Error]"||Pt instanceof Error)}tt.isError=jt,tt.types.isNativeError=jt;function Rt(Pt){return typeof Pt=="function"}tt.isFunction=Rt;function $t(Pt){return Pt===null||typeof Pt=="boolean"||typeof Pt=="number"||typeof Pt=="string"||typeof Pt=="symbol"||typeof Pt>"u"}tt.isPrimitive=$t,tt.isBuffer=isBufferBrowser;function vt(Pt){return Object.prototype.toString.call(Pt)}function It(Pt){return Pt<10?"0"+Pt.toString(10):Pt.toString(10)}var Ot=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Wt(){var Pt=new Date,Ht=[It(Pt.getHours()),It(Pt.getMinutes()),It(Pt.getSeconds())].join(":");return[Pt.getDate(),Ot[Pt.getMonth()],Ht].join(" ")}tt.log=function(){console.log("%s - %s",Wt(),tt.format.apply(tt,arguments))},tt.inherits=inherits_browserExports,tt._extend=function(Pt,Ht){if(!Ht||!Ct(Ht))return Pt;for(var Qt=Object.keys(Ht),an=Qt.length;an--;)Pt[Qt[an]]=Ht[Qt[an]];return Pt};function zt(Pt,Ht){return Object.prototype.hasOwnProperty.call(Pt,Ht)}var Ft=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;tt.promisify=function(Ht){if(typeof Ht!="function")throw new TypeError('The "original" argument must be of type Function');if(Ft&&Ht[Ft]){var Qt=Ht[Ft];if(typeof Qt!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Qt,Ft,{value:Qt,enumerable:!1,writable:!1,configurable:!0}),Qt}function Qt(){for(var an,Yt,nn=new Promise(function(wn,rn){an=wn,Yt=rn}),tn=[],dn=0;dn"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dt(St){return dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(At){return At.__proto__||Object.getPrototypeOf(At)},dt(St)}var pt={},mt,gt;function yt(St,Tt,At){At||(At=Error);function Et(Lt,jt,Rt){return typeof Tt=="string"?Tt:Tt(Lt,jt,Rt)}var Ct=function(Lt){at(Rt,Lt);var jt=lt(Rt);function Rt($t,vt,It){var Ot;return ot(this,Rt),Ot=jt.call(this,Et($t,vt,It)),Ot.code=St,Ot}return nt(Rt)}(At);pt[St]=Ct}function bt(St,Tt){if(Array.isArray(St)){var At=St.length;return St=St.map(function(Et){return String(Et)}),At>2?"one of ".concat(Tt," ").concat(St.slice(0,At-1).join(", "),", or ")+St[At-1]:At===2?"one of ".concat(Tt," ").concat(St[0]," or ").concat(St[1]):"of ".concat(Tt," ").concat(St[0])}else return"of ".concat(Tt," ").concat(String(St))}function wt(St,Tt,At){return St.substr(!At||At<0?0:+At,Tt.length)===Tt}function xt(St,Tt,At){return(At===void 0||At>St.length)&&(At=St.length),St.substring(At-Tt.length,At)===Tt}function kt(St,Tt,At){return typeof At!="number"&&(At=0),At+Tt.length>St.length?!1:St.indexOf(Tt,At)!==-1}return yt("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),yt("ERR_INVALID_ARG_TYPE",function(St,Tt,At){mt===void 0&&(mt=requireAssert()),mt(typeof St=="string","'name' must be a string");var Et;typeof Tt=="string"&&wt(Tt,"not ")?(Et="must not be",Tt=Tt.replace(/^not /,"")):Et="must be";var Ct;if(xt(St," argument"))Ct="The ".concat(St," ").concat(Et," ").concat(bt(Tt,"type"));else{var Lt=kt(St,".")?"property":"argument";Ct='The "'.concat(St,'" ').concat(Lt," ").concat(Et," ").concat(bt(Tt,"type"))}return Ct+=". Received type ".concat(tt(At)),Ct},TypeError),yt("ERR_INVALID_ARG_VALUE",function(St,Tt){var At=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";gt===void 0&&(gt=util);var Et=gt.inspect(Tt);return Et.length>128&&(Et="".concat(Et.slice(0,128),"...")),"The argument '".concat(St,"' ").concat(At,". Received ").concat(Et)},TypeError),yt("ERR_INVALID_RETURN_VALUE",function(St,Tt,At){var Et;return At&&At.constructor&&At.constructor.name?Et="instance of ".concat(At.constructor.name):Et="type ".concat(tt(At)),"Expected ".concat(St,' to be returned from the "').concat(Tt,'"')+" function but got ".concat(Et,".")},TypeError),yt("ERR_MISSING_ARGS",function(){for(var St=arguments.length,Tt=new Array(St),At=0;At0,"At least one arg needs to be specified");var Et="The ",Ct=Tt.length;switch(Tt=Tt.map(function(Lt){return'"'.concat(Lt,'"')}),Ct){case 1:Et+="".concat(Tt[0]," argument");break;case 2:Et+="".concat(Tt[0]," and ").concat(Tt[1]," arguments");break;default:Et+=Tt.slice(0,Ct-1).join(", "),Et+=", and ".concat(Tt[Ct-1]," arguments");break}return"".concat(Et," must be specified")},TypeError),errors$3.codes=pt,errors$3}var assertion_error,hasRequiredAssertion_error;function requireAssertion_error(){if(hasRequiredAssertion_error)return assertion_error;hasRequiredAssertion_error=1;function tt(Ft,Nt){var Ut=Object.keys(Ft);if(Object.getOwnPropertySymbols){var Pt=Object.getOwnPropertySymbols(Ft);Nt&&(Pt=Pt.filter(function(Ht){return Object.getOwnPropertyDescriptor(Ft,Ht).enumerable})),Ut.push.apply(Ut,Pt)}return Ut}function et(Ft){for(var Nt=1;Nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gt(Ft){return Function.toString.call(Ft).indexOf("[native code]")!==-1}function yt(Ft,Nt){return yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Pt,Ht){return Pt.__proto__=Ht,Pt},yt(Ft,Nt)}function bt(Ft){return bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ut){return Ut.__proto__||Object.getPrototypeOf(Ut)},bt(Ft)}function wt(Ft){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Nt){return typeof Nt}:function(Nt){return Nt&&typeof Symbol=="function"&&Nt.constructor===Symbol&&Nt!==Symbol.prototype?"symbol":typeof Nt},wt(Ft)}var xt=util,kt=xt.inspect,St=requireErrors(),Tt=St.codes.ERR_INVALID_ARG_TYPE;function At(Ft,Nt,Ut){return(Ut===void 0||Ut>Ft.length)&&(Ut=Ft.length),Ft.substring(Ut-Nt.length,Ut)===Nt}function Et(Ft,Nt){if(Nt=Math.floor(Nt),Ft.length==0||Nt==0)return"";var Ut=Ft.length*Nt;for(Nt=Math.floor(Math.log(Nt)/Math.log(2));Nt;)Ft+=Ft,Nt--;return Ft+=Ft.substring(0,Ut-Ft.length),Ft}var Ct="",Lt="",jt="",Rt="",$t={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},vt=10;function It(Ft){var Nt=Object.keys(Ft),Ut=Object.create(Object.getPrototypeOf(Ft));return Nt.forEach(function(Pt){Ut[Pt]=Ft[Pt]}),Object.defineProperty(Ut,"message",{value:Ft.message}),Ut}function Ot(Ft){return kt(Ft,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Wt(Ft,Nt,Ut){var Pt="",Ht="",Qt=0,an="",Yt=!1,nn=Ot(Ft),tn=nn.split(` `),dn=Ot(Nt).split(` -`),wn=0,rn="";if(Ut==="strictEqual"&&wt(Ft)==="object"&&wt(Nt)==="object"&&Ft!==null&&Nt!==null&&(Ut="strictEqualObject"),tn.length===1&&dn.length===1&&tn[0]!==dn[0]){var Jt=tn[0].length+dn[0].length;if(Jt<=vt){if((wt(Ft)!=="object"||Ft===null)&&(wt(Nt)!=="object"||Nt===null)&&(Ft!==0||Nt!==0))return"".concat($t[Ut],` +`),wn=0,rn="";if(Ut==="strictEqual"&&wt(Ft)==="object"&&wt(Nt)==="object"&&Ft!==null&&Nt!==null&&(Ut="strictEqualObject"),tn.length===1&&dn.length===1&&tn[0]!==dn[0]){var Zt=tn[0].length+dn[0].length;if(Zt<=vt){if((wt(Ft)!=="object"||Ft===null)&&(wt(Nt)!=="object"||Nt===null)&&(Ft!==0||Nt!==0))return"".concat($t[Ut],` `)+"".concat(tn[0]," !== ").concat(dn[0],` -`)}else if(Ut!=="strictEqualObject"){var vn=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(Jt2&&(rn=` +`)}else if(Ut!=="strictEqualObject"){var vn=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(Zt2&&(rn=` `.concat(Et(" ",wn),"^"),wn=0)}}}for(var Cn=tn[tn.length-1],$n=dn[dn.length-1];Cn===$n&&(wn++<2?an=` `.concat(Cn).concat(an):Pt=Cn,tn.pop(),dn.pop(),!(tn.length===0||dn.length===0));)Cn=tn[tn.length-1],$n=dn[dn.length-1];var Nn=Math.max(tn.length,dn.length);if(Nn===0){var En=nn.split(` `);if(En.length>30)for(En[26]="".concat(Ct,"...").concat(Rt);En.length>27;)En.pop();return"".concat($t.notIdentical,` @@ -3388,10 +3388,10 @@ hooks.version="2.29.4";setHookCallback(createLocal);hooks.fn=proto$1;hooks.min=m `).concat(Ht,` `).concat(Ct,"...").concat(Rt).concat(Pt,` `)+"".concat(Ct,"...").concat(Rt)}return"".concat(pn).concat(Yt?Tn:"",` -`).concat(Ht).concat(Pt).concat(an).concat(rn)}var zt=function(Ft,Nt){lt(Pt,Ft);var Ut=ct(Pt);function Pt(Ht){var Qt;if(rt(this,Pt),wt(Ht)!=="object"||Ht===null)throw new Tt("options","Object",Ht);var an=Ht.message,Yt=Ht.operator,nn=Ht.stackStartFn,tn=Ht.actual,dn=Ht.expected,wn=Error.stackTraceLimit;if(Error.stackTraceLimit=0,an!=null)Qt=Ut.call(this,String(an));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(Ct="\x1B[34m",Lt="\x1B[32m",Rt="\x1B[39m",jt="\x1B[31m"):(Ct="",Lt="",Rt="",jt="")),wt(tn)==="object"&&tn!==null&&wt(dn)==="object"&&dn!==null&&"stack"in tn&&tn instanceof Error&&"stack"in dn&&dn instanceof Error&&(tn=It(tn),dn=It(dn)),Yt==="deepStrictEqual"||Yt==="strictEqual")Qt=Ut.call(this,Wt(tn,dn,Yt));else if(Yt==="notDeepStrictEqual"||Yt==="notStrictEqual"){var rn=$t[Yt],Jt=Ot(tn).split(` -`);if(Yt==="notStrictEqual"&&wt(tn)==="object"&&tn!==null&&(rn=$t.notStrictEqualObject),Jt.length>30)for(Jt[26]="".concat(Ct,"...").concat(Rt);Jt.length>27;)Jt.pop();Jt.length===1?Qt=Ut.call(this,"".concat(rn," ").concat(Jt[0])):Qt=Ut.call(this,"".concat(rn,` +`).concat(Ht).concat(Pt).concat(an).concat(rn)}var zt=function(Ft,Nt){lt(Pt,Ft);var Ut=ct(Pt);function Pt(Ht){var Qt;if(rt(this,Pt),wt(Ht)!=="object"||Ht===null)throw new Tt("options","Object",Ht);var an=Ht.message,Yt=Ht.operator,nn=Ht.stackStartFn,tn=Ht.actual,dn=Ht.expected,wn=Error.stackTraceLimit;if(Error.stackTraceLimit=0,an!=null)Qt=Ut.call(this,String(an));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(Ct="\x1B[34m",Lt="\x1B[32m",Rt="\x1B[39m",jt="\x1B[31m"):(Ct="",Lt="",Rt="",jt="")),wt(tn)==="object"&&tn!==null&&wt(dn)==="object"&&dn!==null&&"stack"in tn&&tn instanceof Error&&"stack"in dn&&dn instanceof Error&&(tn=It(tn),dn=It(dn)),Yt==="deepStrictEqual"||Yt==="strictEqual")Qt=Ut.call(this,Wt(tn,dn,Yt));else if(Yt==="notDeepStrictEqual"||Yt==="notStrictEqual"){var rn=$t[Yt],Zt=Ot(tn).split(` +`);if(Yt==="notStrictEqual"&&wt(tn)==="object"&&tn!==null&&(rn=$t.notStrictEqualObject),Zt.length>30)for(Zt[26]="".concat(Ct,"...").concat(Rt);Zt.length>27;)Zt.pop();Zt.length===1?Qt=Ut.call(this,"".concat(rn," ").concat(Zt[0])):Qt=Ut.call(this,"".concat(rn,` -`).concat(Jt.join(` +`).concat(Zt.join(` `),` `))}else{var vn=Ot(tn),Cn="",$n=$t[Yt];Yt==="notDeepEqual"||Yt==="notEqual"?(vn="".concat($t[Yt],` @@ -3407,13 +3407,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * @author Feross Aboukhadijeh * @license MIT - */function Ft(fn,xn){if(fn===xn)return 0;for(var jn=fn.length,cn=xn.length,Xt=0,Kt=Math.min(jn,cn);Xt1?dn-1:0),rn=1;rn1?dn-1:0),rn=1;rn1?dn-1:0),rn=1;rn1?dn-1:0),rn=1;rn1?dn-1:0),rn=1;rn1?dn-1:0),rn=1;rn1?dn-1:0),rn=1;rn1?dn-1:0),rn=1;rn>>0===rt,"off","integer"),rt+et>nt.length)throw new EncodingError(rt,"Out of bounds read");return tt(nt,rt)}}function _readn(tt){return function(et,nt,rt){if(enforce$1(Buffer.isBuffer(et),"data","buffer"),enforce$1(nt>>>0===nt,"off","integer"),enforce$1(rt>>>0===rt,"len","integer"),nt+rt>et.length)throw new EncodingError(nt,"Out of bounds read");return tt(et,nt,rt)}}function _readvar(tt){return function(et,nt){return enforce$1(Buffer.isBuffer(et),"data","buffer"),enforce$1(nt>>>0===nt,"off","integer"),tt(et,nt)}}function _write(tt,et){return function(nt,rt,it){if(enforce$1(Buffer.isBuffer(nt),"data","buffer"),enforce$1(it>>>0===it,"off","integer"),it+et>nt.length)throw new EncodingError(it,"Out of bounds write");return tt(nt,rt,it)}}function _writen(tt){return function(et,nt,rt,it){if(enforce$1(Buffer.isBuffer(et),"data","buffer"),enforce$1(rt>>>0===rt,"off","integer"),enforce$1(it>>>0===it,"len","integer"),rt+it>et.length)throw new EncodingError(rt,"Out of bounds write");return tt(et,nt,rt,it)}}function _writecb(tt,et){return function(nt,rt,it){if(enforce$1(Buffer.isBuffer(nt),"data","buffer"),enforce$1(it>>>0===it,"off","integer"),it+et(rt)>nt.length)throw new EncodingError(it,"Out of bounds write");return tt(nt,rt,it)}}bufio.readU=_readn(encoding.readU);bufio.readBigU256=_read(encoding.readBigU256,32);bufio.readBigU128=_read(encoding.readBigU128,16);bufio.readBigU64=_read(encoding.readBigU64,8);bufio.readBigU56=_read(encoding.readBigU56,7);bufio.readU64=_read(encoding.readU64,8);bufio.readU56=_read(encoding.readU56,7);bufio.readU48=_read(encoding.readU48,6);bufio.readU40=_read(encoding.readU40,5);bufio.readU32=_read(encoding.readU32,4);bufio.readU24=_read(encoding.readU24,3);bufio.readU16=_read(encoding.readU16,2);bufio.readU8=_read(encoding.readU8,1);bufio.readUBE=_readn(encoding.readUBE);bufio.readBigU256BE=_read(encoding.readBigU256BE,32);bufio.readBigU128BE=_read(encoding.readBigU128BE,16);bufio.readBigU64BE=_read(encoding.readBigU64BE,8);bufio.readBigU56BE=_read(encoding.readBigU56BE,7);bufio.readU64BE=_read(encoding.readU64BE,8);bufio.readU56BE=_read(encoding.readU56BE,7);bufio.readU48BE=_read(encoding.readU48BE,6);bufio.readU40BE=_read(encoding.readU40BE,5);bufio.readU32BE=_read(encoding.readU32BE,4);bufio.readU24BE=_read(encoding.readU24BE,3);bufio.readU16BE=_read(encoding.readU16BE,2);bufio.readI=_readn(encoding.readI);bufio.readBigI64=_read(encoding.readBigI64,8);bufio.readBigI56=_read(encoding.readBigI56,7);bufio.readI64=_read(encoding.readI64,8);bufio.readI56=_read(encoding.readI56,7);bufio.readI48=_read(encoding.readI48,6);bufio.readI40=_read(encoding.readI40,5);bufio.readI32=_read(encoding.readI32,4);bufio.readI24=_read(encoding.readI24,3);bufio.readI16=_read(encoding.readI16,2);bufio.readI8=_read(encoding.readI8,1);bufio.readIBE=_readn(encoding.readIBE);bufio.readBigI64BE=_read(encoding.readBigI64BE,8);bufio.readBigI56BE=_read(encoding.readBigI56BE,7);bufio.readI64BE=_read(encoding.readI64BE,8);bufio.readI56BE=_read(encoding.readI56BE,7);bufio.readI48BE=_read(encoding.readI48BE,6);bufio.readI40BE=_read(encoding.readI40BE,5);bufio.readI32BE=_read(encoding.readI32BE,4);bufio.readI24BE=_read(encoding.readI24BE,3);bufio.readI16BE=_read(encoding.readI16BE,2);bufio.readFloat=_read(encoding.readFloat,4);bufio.readFloatBE=_read(encoding.readFloatBE,4);bufio.readDouble=_read(encoding.readDouble,8);bufio.readDoubleBE=_read(encoding.readDoubleBE,8);bufio.writeU=_writen(encoding.writeU);bufio.writeBigU256=_write(encoding.writeBigU256,32);bufio.writeBigU128=_write(encoding.writeBigU128,16);bufio.writeBigU64=_write(encoding.writeBigU64,8);bufio.writeBigU56=_write(encoding.writeBigU56,7);bufio.writeU64=_write(encoding.writeU64,8);bufio.writeU56=_write(encoding.writeU56,7);bufio.writeU48=_write(encoding.writeU48,6);bufio.writeU40=_write(encoding.writeU40,5);bufio.writeU32=_write(encoding.writeU32,4);bufio.writeU24=_write(encoding.writeU24,3);bufio.writeU16=_write(encoding.writeU16,2);bufio.writeU8=_write(encoding.writeU8,1);bufio.writeUBE=_writen(encoding.writeUBE);bufio.writeBigU256BE=_write(encoding.writeBigU256BE,32);bufio.writeBigU128BE=_write(encoding.writeBigU128BE,16);bufio.writeBigU64BE=_write(encoding.writeBigU64BE,8);bufio.writeBigU56BE=_write(encoding.writeBigU56BE,7);bufio.writeU64BE=_write(encoding.writeU64BE,8);bufio.writeU56BE=_write(encoding.writeU56BE,7);bufio.writeU48BE=_write(encoding.writeU48BE,6);bufio.writeU40BE=_write(encoding.writeU40BE,5);bufio.writeU32BE=_write(encoding.writeU32BE,4);bufio.writeU24BE=_write(encoding.writeU24BE,3);bufio.writeU16BE=_write(encoding.writeU16BE,2);bufio.writeI=_writen(encoding.writeI);bufio.writeBigI64=_write(encoding.writeBigI64,8);bufio.writeBigI56=_write(encoding.writeBigI56,7);bufio.writeI64=_write(encoding.writeI64,8);bufio.writeI56=_write(encoding.writeI56,7);bufio.writeI48=_write(encoding.writeI48,6);bufio.writeI40=_write(encoding.writeI40,5);bufio.writeI32=_write(encoding.writeI32,4);bufio.writeI24=_write(encoding.writeI24,3);bufio.writeI16=_write(encoding.writeI16,2);bufio.writeI8=_write(encoding.writeI8,1);bufio.writeIBE=_writen(encoding.writeIBE);bufio.writeBigI64BE=_write(encoding.writeBigI64BE,8);bufio.writeBigI56BE=_write(encoding.writeBigI56BE,7);bufio.writeI64BE=_write(encoding.writeI64BE,8);bufio.writeI56BE=_write(encoding.writeI56BE,7);bufio.writeI48BE=_write(encoding.writeI48BE,6);bufio.writeI40BE=_write(encoding.writeI40BE,5);bufio.writeI32BE=_write(encoding.writeI32BE,4);bufio.writeI24BE=_write(encoding.writeI24BE,3);bufio.writeI16BE=_write(encoding.writeI16BE,2);bufio.writeFloat=_write(encoding.writeFloat,4);bufio.writeFloatBE=_write(encoding.writeFloatBE,4);bufio.writeDouble=_write(encoding.writeDouble,8);bufio.writeDoubleBE=_write(encoding.writeDoubleBE,8);bufio.readVarint=_readvar(encoding.readVarint);bufio.writeVarint=_writecb(encoding.writeVarint,encoding.sizeVarint);bufio.sizeVarint=encoding.sizeVarint;bufio.readVarint2=_readvar(encoding.readVarint2);bufio.writeVarint2=_writecb(encoding.writeVarint2,encoding.sizeVarint2);bufio.sizeVarint2=encoding.sizeVarint2;bufio.sliceBytes=encoding.sliceBytes;bufio.readBytes=encoding.readBytes;bufio.writeBytes=encoding.writeBytes;bufio.readString=encoding.readString;bufio.writeString=encoding.writeString;bufio.realloc=encoding.realloc;bufio.copy=encoding.copy;bufio.concat=encoding.concat;bufio.sizeVarBytes=encoding.sizeVarBytes;bufio.sizeVarlen=encoding.sizeVarlen;bufio.sizeVarString=encoding.sizeVarString;var cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(tt,et){var nt=buffer$2,rt=nt.Buffer;function it(at,st){for(var lt in at)st[lt]=at[lt]}rt.from&&rt.alloc&&rt.allocUnsafe&&rt.allocUnsafeSlow?tt.exports=nt:(it(nt,et),et.Buffer=ot);function ot(at,st,lt){return rt(at,st,lt)}ot.prototype=Object.create(rt.prototype),it(rt,ot),ot.from=function(at,st,lt){if(typeof at=="number")throw new TypeError("Argument must not be a number");return rt(at,st,lt)},ot.alloc=function(at,st,lt){if(typeof at!="number")throw new TypeError("Argument must be a number");var ct=rt(at);return st!==void 0?typeof lt=="string"?ct.fill(st,lt):ct.fill(st):ct.fill(0),ct},ot.allocUnsafe=function(at){if(typeof at!="number")throw new TypeError("Argument must be a number");return rt(at)},ot.allocUnsafeSlow=function(at){if(typeof at!="number")throw new TypeError("Argument must be a number");return nt.SlowBuffer(at)}})(safeBuffer$1,safeBuffer$1.exports);var safeBufferExports=safeBuffer$1.exports,MAX_BYTES=65536,MAX_UINT32=4294967295;function oldBrowser$1(){throw new Error(`Secure random number generation is not supported by this browser. -Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$H=safeBufferExports.Buffer,crypto$4=commonjsGlobal.crypto||commonjsGlobal.msCrypto;crypto$4&&crypto$4.getRandomValues?browser$b.exports=randomBytes$2:browser$b.exports=oldBrowser$1;function randomBytes$2(tt,et){if(tt>MAX_UINT32)throw new RangeError("requested too many random bytes");var nt=Buffer$H.allocUnsafe(tt);if(tt>0)if(tt>MAX_BYTES)for(var rt=0;rt0&&(at=nt[0]),at instanceof Error)throw at;var st=new Error("Unhandled error."+(at?" ("+at.message+")":""));throw st.context=at,st}var lt=ot[et];if(lt===void 0)return!1;if(typeof lt=="function")ReflectApply(lt,this,nt);else for(var ct=lt.length,ut=arrayClone(lt,ct),rt=0;rt0&&at.length>it&&!at.warned){at.warned=!0;var st=new Error("Possible EventEmitter memory leak detected. "+at.length+" "+String(et)+" listeners added. Use emitter.setMaxListeners() to increase limit");st.name="MaxListenersExceededWarning",st.emitter=tt,st.type=et,st.count=at.length,ProcessEmitWarning(st)}return tt}EventEmitter$1.prototype.addListener=function(et,nt){return _addListener(this,et,nt,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function(et,nt){return _addListener(this,et,nt,!0)};function onceWrapper(){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 _onceWrap(tt,et,nt){var rt={fired:!1,wrapFn:void 0,target:tt,type:et,listener:nt},it=onceWrapper.bind(rt);return it.listener=nt,rt.wrapFn=it,it}EventEmitter$1.prototype.once=function(et,nt){return checkListener(nt),this.on(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.prependOnceListener=function(et,nt){return checkListener(nt),this.prependListener(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.removeListener=function(et,nt){var rt,it,ot,at,st;if(checkListener(nt),it=this._events,it===void 0)return this;if(rt=it[et],rt===void 0)return this;if(rt===nt||rt.listener===nt)--this._eventsCount===0?this._events=Object.create(null):(delete it[et],it.removeListener&&this.emit("removeListener",et,rt.listener||nt));else if(typeof rt!="function"){for(ot=-1,at=rt.length-1;at>=0;at--)if(rt[at]===nt||rt[at].listener===nt){st=rt[at].listener,ot=at;break}if(ot<0)return this;ot===0?rt.shift():spliceOne(rt,ot),rt.length===1&&(it[et]=rt[0]),it.removeListener!==void 0&&this.emit("removeListener",et,st||nt)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function(et){var nt,rt,it;if(rt=this._events,rt===void 0)return this;if(rt.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):rt[et]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete rt[et]),this;if(arguments.length===0){var ot=Object.keys(rt),at;for(it=0;it=0;it--)this.removeListener(et,nt[it]);return this};function _listeners$1(tt,et,nt){var rt=tt._events;if(rt===void 0)return[];var it=rt[et];return it===void 0?[]:typeof it=="function"?nt?[it.listener||it]:[it]:nt?unwrapListeners(it):arrayClone(it,it.length)}EventEmitter$1.prototype.listeners=function(et){return _listeners$1(this,et,!0)};EventEmitter$1.prototype.rawListeners=function(et){return _listeners$1(this,et,!1)};EventEmitter$1.listenerCount=function(tt,et){return typeof tt.listenerCount=="function"?tt.listenerCount(et):listenerCount.call(tt,et)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(tt){var et=this._events;if(et!==void 0){var nt=et[tt];if(typeof nt=="function")return 1;if(nt!==void 0)return nt.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(tt,et){for(var nt=new Array(et),rt=0;rt0?this.tail.next=bt:this.head=bt,this.tail=bt,++this.length}},{key:"unshift",value:function(yt){var bt={data:yt,next:this.head};this.length===0&&(this.tail=bt),this.head=bt,++this.length}},{key:"shift",value:function(){if(this.length!==0){var yt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,yt}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(yt){if(this.length===0)return"";for(var bt=this.head,wt=""+bt.data;bt=bt.next;)wt+=yt+bt.data;return wt}},{key:"concat",value:function(yt){if(this.length===0)return ct.alloc(0);for(var bt=ct.allocUnsafe(yt>>>0),wt=this.head,xt=0;wt;)pt(wt.data,bt,xt),xt+=wt.data.length,wt=wt.next;return bt}},{key:"consume",value:function(yt,bt){var wt;return ytkt.length?kt.length:yt;if(St===kt.length?xt+=kt:xt+=kt.slice(0,yt),yt-=St,yt===0){St===kt.length?(++wt,bt.next?this.head=bt.next:this.head=this.tail=null):(this.head=bt,bt.data=kt.slice(St));break}++wt}return this.length-=wt,xt}},{key:"_getBuffer",value:function(yt){var bt=ct.allocUnsafe(yt),wt=this.head,xt=1;for(wt.data.copy(bt),yt-=wt.data.length;wt=wt.next;){var kt=wt.data,St=yt>kt.length?kt.length:yt;if(kt.copy(bt,bt.length-yt,0,St),yt-=St,yt===0){St===kt.length?(++xt,wt.next?this.head=wt.next:this.head=this.tail=null):(this.head=wt,wt.data=kt.slice(St));break}++xt}return this.length-=xt,bt}},{key:dt,value:function(yt,bt){return ht(this,et(et({},bt),{},{depth:0,customInspect:!1}))}}]),mt}(),buffer_list}function destroy(tt,et){var nt=this,rt=this._readableState&&this._readableState.destroyed,it=this._writableState&&this._writableState.destroyed;return rt||it?(et?et(tt):tt&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(emitErrorNT,this,tt)):process.nextTick(emitErrorNT,this,tt)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(tt||null,function(ot){!et&&ot?nt._writableState?nt._writableState.errorEmitted?process.nextTick(emitCloseNT,nt):(nt._writableState.errorEmitted=!0,process.nextTick(emitErrorAndCloseNT,nt,ot)):process.nextTick(emitErrorAndCloseNT,nt,ot):et?(process.nextTick(emitCloseNT,nt),et(ot)):process.nextTick(emitCloseNT,nt)}),this)}function emitErrorAndCloseNT(tt,et){emitErrorNT(tt,et),emitCloseNT(tt)}function emitCloseNT(tt){tt._writableState&&!tt._writableState.emitClose||tt._readableState&&!tt._readableState.emitClose||tt.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(tt,et){tt.emit("error",et)}function errorOrDestroy(tt,et){var nt=tt._readableState,rt=tt._writableState;nt&&nt.autoDestroy||rt&&rt.autoDestroy?tt.destroy(et):tt.emit("error",et)}var destroy_1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose$2(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,tt.__proto__=et}var codes={};function createErrorType(tt,et,nt){nt||(nt=Error);function rt(ot,at,st){return typeof et=="string"?et:et(ot,at,st)}var it=function(ot){_inheritsLoose$2(at,ot);function at(st,lt,ct){return ot.call(this,rt(st,lt,ct))||this}return at}(nt);it.prototype.name=nt.name,it.prototype.code=tt,codes[tt]=it}function oneOf(tt,et){if(Array.isArray(tt)){var nt=tt.length;return tt=tt.map(function(rt){return String(rt)}),nt>2?"one of ".concat(et," ").concat(tt.slice(0,nt-1).join(", "),", or ")+tt[nt-1]:nt===2?"one of ".concat(et," ").concat(tt[0]," or ").concat(tt[1]):"of ".concat(et," ").concat(tt[0])}else return"of ".concat(et," ").concat(String(tt))}function startsWith(tt,et,nt){return tt.substr(!nt||nt<0?0:+nt,et.length)===et}function endsWith(tt,et,nt){return(nt===void 0||nt>tt.length)&&(nt=tt.length),tt.substring(nt-et.length,nt)===et}function includes(tt,et,nt){return typeof nt!="number"&&(nt=0),nt+et.length>tt.length?!1:tt.indexOf(et,nt)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(tt,et){return'The value "'+et+'" is invalid for option "'+tt+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(tt,et,nt){var rt;typeof et=="string"&&startsWith(et,"not ")?(rt="must not be",et=et.replace(/^not /,"")):rt="must be";var it;if(endsWith(tt," argument"))it="The ".concat(tt," ").concat(rt," ").concat(oneOf(et,"type"));else{var ot=includes(tt,".")?"property":"argument";it='The "'.concat(tt,'" ').concat(ot," ").concat(rt," ").concat(oneOf(et,"type"))}return it+=". Received type ".concat(typeof nt),it},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(tt){return"The "+tt+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(tt){return"Cannot call "+tt+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(tt){return"Unknown encoding: "+tt},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(tt,et,nt){return tt.highWaterMark!=null?tt.highWaterMark:et?tt[nt]:null}function getHighWaterMark(tt,et,nt,rt){var it=highWaterMarkFrom(et,rt,nt);if(it!=null){if(!(isFinite(it)&&Math.floor(it)===it)||it<0){var ot=rt?nt:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(ot,it)}return Math.floor(it)}return tt.objectMode?16:16*1024}var state={getHighWaterMark},browser$a=deprecate;function deprecate(tt,et){if(config$2("noDeprecation"))return tt;var nt=!1;function rt(){if(!nt){if(config$2("throwDeprecation"))throw new Error(et);config$2("traceDeprecation")?console.trace(et):console.warn(et),nt=!0}return tt.apply(this,arguments)}return rt}function config$2(tt){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var et=commonjsGlobal.localStorage[tt];return et==null?!1:String(et).toLowerCase()==="true"}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1,_stream_writable=Et;function tt(Yt){var nn=this;this.next=null,this.entry=null,this.finish=function(){an(nn,Yt)}}var et;Et.WritableState=Tt;var nt={deprecate:browser$a},rt=streamBrowser,it=buffer$2.Buffer,ot=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function at(Yt){return it.from(Yt)}function st(Yt){return it.isBuffer(Yt)||Yt instanceof ot}var lt=destroy_1,ct=state,ut=ct.getHighWaterMark,ht=errorsBrowser.codes,dt=ht.ERR_INVALID_ARG_TYPE,pt=ht.ERR_METHOD_NOT_IMPLEMENTED,mt=ht.ERR_MULTIPLE_CALLBACK,gt=ht.ERR_STREAM_CANNOT_PIPE,yt=ht.ERR_STREAM_DESTROYED,bt=ht.ERR_STREAM_NULL_VALUES,wt=ht.ERR_STREAM_WRITE_AFTER_END,xt=ht.ERR_UNKNOWN_ENCODING,kt=lt.errorOrDestroy;inherits_browserExports(Et,rt);function St(){}function Tt(Yt,nn,tn){et=et||require_stream_duplex(),Yt=Yt||{},typeof tn!="boolean"&&(tn=nn instanceof et),this.objectMode=!!Yt.objectMode,tn&&(this.objectMode=this.objectMode||!!Yt.writableObjectMode),this.highWaterMark=ut(this,Yt,"writableHighWaterMark",tn),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var dn=Yt.decodeStrings===!1;this.decodeStrings=!dn,this.defaultEncoding=Yt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(wn){Ot(nn,wn)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Yt.emitClose!==!1,this.autoDestroy=!!Yt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new tt(this)}Tt.prototype.getBuffer=function(){for(var nn=this.bufferedRequest,tn=[];nn;)tn.push(nn),nn=nn.next;return tn},function(){try{Object.defineProperty(Tt.prototype,"buffer",{get:nt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var At;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(At=Function.prototype[Symbol.hasInstance],Object.defineProperty(Et,Symbol.hasInstance,{value:function(nn){return At.call(this,nn)?!0:this!==Et?!1:nn&&nn._writableState instanceof Tt}})):At=function(nn){return nn instanceof this};function Et(Yt){et=et||require_stream_duplex();var nn=this instanceof et;if(!nn&&!At.call(Et,this))return new Et(Yt);this._writableState=new Tt(Yt,this,nn),this.writable=!0,Yt&&(typeof Yt.write=="function"&&(this._write=Yt.write),typeof Yt.writev=="function"&&(this._writev=Yt.writev),typeof Yt.destroy=="function"&&(this._destroy=Yt.destroy),typeof Yt.final=="function"&&(this._final=Yt.final)),rt.call(this)}Et.prototype.pipe=function(){kt(this,new gt)};function Ct(Yt,nn){var tn=new wt;kt(Yt,tn),process.nextTick(nn,tn)}function Lt(Yt,nn,tn,dn){var wn;return tn===null?wn=new bt:typeof tn!="string"&&!nn.objectMode&&(wn=new dt("chunk",["string","Buffer"],tn)),wn?(kt(Yt,wn),process.nextTick(dn,wn),!1):!0}Et.prototype.write=function(Yt,nn,tn){var dn=this._writableState,wn=!1,rn=!dn.objectMode&&st(Yt);return rn&&!it.isBuffer(Yt)&&(Yt=at(Yt)),typeof nn=="function"&&(tn=nn,nn=null),rn?nn="buffer":nn||(nn=dn.defaultEncoding),typeof tn!="function"&&(tn=St),dn.ending?Ct(this,tn):(rn||Lt(this,dn,Yt,tn))&&(dn.pendingcb++,wn=Rt(this,dn,rn,Yt,nn,tn)),wn},Et.prototype.cork=function(){this._writableState.corked++},Et.prototype.uncork=function(){var Yt=this._writableState;Yt.corked&&(Yt.corked--,!Yt.writing&&!Yt.corked&&!Yt.bufferProcessing&&Yt.bufferedRequest&&Ft(this,Yt))},Et.prototype.setDefaultEncoding=function(nn){if(typeof nn=="string"&&(nn=nn.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((nn+"").toLowerCase())>-1))throw new xt(nn);return this._writableState.defaultEncoding=nn,this},Object.defineProperty(Et.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function jt(Yt,nn,tn){return!Yt.objectMode&&Yt.decodeStrings!==!1&&typeof nn=="string"&&(nn=it.from(nn,tn)),nn}Object.defineProperty(Et.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Rt(Yt,nn,tn,dn,wn,rn){if(!tn){var Jt=jt(nn,dn,wn);dn!==Jt&&(tn=!0,wn="buffer",dn=Jt)}var vn=nn.objectMode?1:dn.length;nn.length+=vn;var Cn=nn.length>5===6?2:tt>>4===14?3:tt>>3===30?4:tt>>6===2?-1:-2}function utf8CheckIncomplete(tt,et,nt){var rt=et.length-1;if(rt=0?(it>0&&(tt.lastNeed=it-1),it):--rt=0?(it>0&&(tt.lastNeed=it-2),it):--rt=0?(it>0&&(it===2?it=0:tt.lastNeed=it-3),it):0))}function utf8CheckExtraBytes(tt,et,nt){if((et[0]&192)!==128)return tt.lastNeed=0,"�";if(tt.lastNeed>1&&et.length>1){if((et[1]&192)!==128)return tt.lastNeed=1,"�";if(tt.lastNeed>2&&et.length>2&&(et[2]&192)!==128)return tt.lastNeed=2,"�"}}function utf8FillLast(tt){var et=this.lastTotal-this.lastNeed,nt=utf8CheckExtraBytes(this,tt);if(nt!==void 0)return nt;if(this.lastNeed<=tt.length)return tt.copy(this.lastChar,et,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);tt.copy(this.lastChar,et,0,tt.length),this.lastNeed-=tt.length}function utf8Text(tt,et){var nt=utf8CheckIncomplete(this,tt,et);if(!this.lastNeed)return tt.toString("utf8",et);this.lastTotal=nt;var rt=tt.length-(nt-this.lastNeed);return tt.copy(this.lastChar,0,rt),tt.toString("utf8",et,rt)}function utf8End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+"�":et}function utf16Text(tt,et){if((tt.length-et)%2===0){var nt=tt.toString("utf16le",et);if(nt){var rt=nt.charCodeAt(nt.length-1);if(rt>=55296&&rt<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1],nt.slice(0,-1)}return nt}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=tt[tt.length-1],tt.toString("utf16le",et,tt.length-1)}function utf16End(tt){var et=tt&&tt.length?this.write(tt):"";if(this.lastNeed){var nt=this.lastTotal-this.lastNeed;return et+this.lastChar.toString("utf16le",0,nt)}return et}function base64Text(tt,et){var nt=(tt.length-et)%3;return nt===0?tt.toString("base64",et):(this.lastNeed=3-nt,this.lastTotal=3,nt===1?this.lastChar[0]=tt[tt.length-1]:(this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1]),tt.toString("base64",et,tt.length-nt))}function base64End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+this.lastChar.toString("base64",0,3-this.lastNeed):et}function simpleWrite(tt){return tt.toString(this.encoding)}function simpleEnd(tt){return tt&&tt.length?this.write(tt):""}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(tt){var et=!1;return function(){if(!et){et=!0;for(var nt=arguments.length,rt=new Array(nt),it=0;it0)if(typeof Jt!="string"&&!Nn.objectMode&&Object.getPrototypeOf(Jt)!==rt.prototype&&(Jt=ot(Jt)),Cn)Nn.endEmitted?St(rn,new bt):jt(rn,Nn,Jt,!0);else if(Nn.ended)St(rn,new gt);else{if(Nn.destroyed)return!1;Nn.reading=!1,Nn.decoder&&!vn?(Jt=Nn.decoder.write(Jt),Nn.objectMode||Jt.length!==0?jt(rn,Nn,Jt,!1):Ft(rn,Nn)):jt(rn,Nn,Jt,!1)}else Cn||(Nn.reading=!1,Ft(rn,Nn))}return!Nn.ended&&(Nn.length=$t?rn=$t:(rn--,rn|=rn>>>1,rn|=rn>>>2,rn|=rn>>>4,rn|=rn>>>8,rn|=rn>>>16,rn++),rn}function It(rn,Jt){return rn<=0||Jt.length===0&&Jt.ended?0:Jt.objectMode?1:rn!==rn?Jt.flowing&&Jt.length?Jt.buffer.head.data.length:Jt.length:(rn>Jt.highWaterMark&&(Jt.highWaterMark=vt(rn)),rn<=Jt.length?rn:Jt.ended?Jt.length:(Jt.needReadable=!0,0))}Ct.prototype.read=function(rn){lt("read",rn),rn=parseInt(rn,10);var Jt=this._readableState,vn=rn;if(rn!==0&&(Jt.emittedReadable=!1),rn===0&&Jt.needReadable&&((Jt.highWaterMark!==0?Jt.length>=Jt.highWaterMark:Jt.length>0)||Jt.ended))return lt("read: emitReadable",Jt.length,Jt.ended),Jt.length===0&&Jt.ended?tn(this):Wt(this),null;if(rn=It(rn,Jt),rn===0&&Jt.ended)return Jt.length===0&&tn(this),null;var Cn=Jt.needReadable;lt("need readable",Cn),(Jt.length===0||Jt.length-rn0?$n=nn(rn,Jt):$n=null,$n===null?(Jt.needReadable=Jt.length<=Jt.highWaterMark,rn=0):(Jt.length-=rn,Jt.awaitDrain=0),Jt.length===0&&(Jt.ended||(Jt.needReadable=!0),vn!==rn&&Jt.ended&&tn(this)),$n!==null&&this.emit("data",$n),$n};function Ot(rn,Jt){if(lt("onEofChunk"),!Jt.ended){if(Jt.decoder){var vn=Jt.decoder.end();vn&&vn.length&&(Jt.buffer.push(vn),Jt.length+=Jt.objectMode?1:vn.length)}Jt.ended=!0,Jt.sync?Wt(rn):(Jt.needReadable=!1,Jt.emittedReadable||(Jt.emittedReadable=!0,zt(rn)))}}function Wt(rn){var Jt=rn._readableState;lt("emitReadable",Jt.needReadable,Jt.emittedReadable),Jt.needReadable=!1,Jt.emittedReadable||(lt("emitReadable",Jt.flowing),Jt.emittedReadable=!0,process.nextTick(zt,rn))}function zt(rn){var Jt=rn._readableState;lt("emitReadable_",Jt.destroyed,Jt.length,Jt.ended),!Jt.destroyed&&(Jt.length||Jt.ended)&&(rn.emit("readable"),Jt.emittedReadable=!1),Jt.needReadable=!Jt.flowing&&!Jt.ended&&Jt.length<=Jt.highWaterMark,Yt(rn)}function Ft(rn,Jt){Jt.readingMore||(Jt.readingMore=!0,process.nextTick(Nt,rn,Jt))}function Nt(rn,Jt){for(;!Jt.reading&&!Jt.ended&&(Jt.length1&&wn(Cn.pipes,rn)!==-1)&&!Tn&&(lt("false write response, pause",Cn.awaitDrain),Cn.awaitDrain++),vn.pause())}function hn(cn){lt("onerror",cn),jn(),rn.removeListener("error",hn),et(rn,"error")===0&&St(rn,cn)}At(rn,"error",hn);function fn(){rn.removeListener("finish",xn),jn()}rn.once("close",fn);function xn(){lt("onfinish"),rn.removeListener("close",fn),jn()}rn.once("finish",xn);function jn(){lt("unpipe"),vn.unpipe(rn)}return rn.emit("pipe",vn),Cn.flowing||(lt("pipe resume"),vn.resume()),rn};function Ut(rn){return function(){var vn=rn._readableState;lt("pipeOnDrain",vn.awaitDrain),vn.awaitDrain&&vn.awaitDrain--,vn.awaitDrain===0&&et(rn,"data")&&(vn.flowing=!0,Yt(rn))}}Ct.prototype.unpipe=function(rn){var Jt=this._readableState,vn={hasUnpiped:!1};if(Jt.pipesCount===0)return this;if(Jt.pipesCount===1)return rn&&rn!==Jt.pipes?this:(rn||(rn=Jt.pipes),Jt.pipes=null,Jt.pipesCount=0,Jt.flowing=!1,rn&&rn.emit("unpipe",this,vn),this);if(!rn){var Cn=Jt.pipes,$n=Jt.pipesCount;Jt.pipes=null,Jt.pipesCount=0,Jt.flowing=!1;for(var Nn=0;Nn<$n;Nn++)Cn[Nn].emit("unpipe",this,{hasUnpiped:!1});return this}var En=wn(Jt.pipes,rn);return En===-1?this:(Jt.pipes.splice(En,1),Jt.pipesCount-=1,Jt.pipesCount===1&&(Jt.pipes=Jt.pipes[0]),rn.emit("unpipe",this,vn),this)},Ct.prototype.on=function(rn,Jt){var vn=nt.prototype.on.call(this,rn,Jt),Cn=this._readableState;return rn==="data"?(Cn.readableListening=this.listenerCount("readable")>0,Cn.flowing!==!1&&this.resume()):rn==="readable"&&!Cn.endEmitted&&!Cn.readableListening&&(Cn.readableListening=Cn.needReadable=!0,Cn.flowing=!1,Cn.emittedReadable=!1,lt("on readable",Cn.length,Cn.reading),Cn.length?Wt(this):Cn.reading||process.nextTick(Ht,this)),vn},Ct.prototype.addListener=Ct.prototype.on,Ct.prototype.removeListener=function(rn,Jt){var vn=nt.prototype.removeListener.call(this,rn,Jt);return rn==="readable"&&process.nextTick(Pt,this),vn},Ct.prototype.removeAllListeners=function(rn){var Jt=nt.prototype.removeAllListeners.apply(this,arguments);return(rn==="readable"||rn===void 0)&&process.nextTick(Pt,this),Jt};function Pt(rn){var Jt=rn._readableState;Jt.readableListening=rn.listenerCount("readable")>0,Jt.resumeScheduled&&!Jt.paused?Jt.flowing=!0:rn.listenerCount("data")>0&&rn.resume()}function Ht(rn){lt("readable nexttick read 0"),rn.read(0)}Ct.prototype.resume=function(){var rn=this._readableState;return rn.flowing||(lt("resume"),rn.flowing=!rn.readableListening,Qt(this,rn)),rn.paused=!1,this};function Qt(rn,Jt){Jt.resumeScheduled||(Jt.resumeScheduled=!0,process.nextTick(an,rn,Jt))}function an(rn,Jt){lt("resume",Jt.reading),Jt.reading||rn.read(0),Jt.resumeScheduled=!1,rn.emit("resume"),Yt(rn),Jt.flowing&&!Jt.reading&&rn.read(0)}Ct.prototype.pause=function(){return lt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(lt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Yt(rn){var Jt=rn._readableState;for(lt("flow",Jt.flowing);Jt.flowing&&rn.read()!==null;);}Ct.prototype.wrap=function(rn){var Jt=this,vn=this._readableState,Cn=!1;rn.on("end",function(){if(lt("wrapped end"),vn.decoder&&!vn.ended){var En=vn.decoder.end();En&&En.length&&Jt.push(En)}Jt.push(null)}),rn.on("data",function(En){if(lt("wrapped data"),vn.decoder&&(En=vn.decoder.write(En)),!(vn.objectMode&&En==null)&&!(!vn.objectMode&&(!En||!En.length))){var sn=Jt.push(En);sn||(Cn=!0,rn.pause())}});for(var $n in rn)this[$n]===void 0&&typeof rn[$n]=="function"&&(this[$n]=function(sn){return function(){return rn[sn].apply(rn,arguments)}}($n));for(var Nn=0;Nn=Jt.length?(Jt.decoder?vn=Jt.buffer.join(""):Jt.buffer.length===1?vn=Jt.buffer.first():vn=Jt.buffer.concat(Jt.length),Jt.buffer.clear()):vn=Jt.buffer.consume(rn,Jt.decoder),vn}function tn(rn){var Jt=rn._readableState;lt("endReadable",Jt.endEmitted),Jt.endEmitted||(Jt.ended=!0,process.nextTick(dn,Jt,rn))}function dn(rn,Jt){if(lt("endReadableNT",rn.endEmitted,rn.length),!rn.endEmitted&&rn.length===0&&(rn.endEmitted=!0,Jt.readable=!1,Jt.emit("end"),rn.autoDestroy)){var vn=Jt._writableState;(!vn||vn.autoDestroy&&vn.finished)&&Jt.destroy()}}typeof Symbol=="function"&&(Ct.from=function(rn,Jt){return kt===void 0&&(kt=requireFromBrowser()),kt(Ct,rn,Jt)});function wn(rn,Jt){for(var vn=0,Cn=rn.length;vn0;return destroyer(at,lt,ct,function(ut){it||(it=ut),ut&&ot.forEach(call),!lt&&(ot.forEach(call),rt(it))})});return et.reduce(pipe$1)}var pipeline_1=pipeline;(function(tt,et){et=tt.exports=require_stream_readable(),et.Stream=et,et.Readable=et,et.Writable=require_stream_writable(),et.Duplex=require_stream_duplex(),et.Transform=_stream_transform,et.PassThrough=_stream_passthrough,et.finished=endOfStream,et.pipeline=pipeline_1})(readableBrowser,readableBrowser.exports);var readableBrowserExports=readableBrowser.exports,Buffer$F=safeBufferExports.Buffer,Transform$6=readableBrowserExports.Transform,inherits$v=inherits_browserExports;function throwIfNotStringOrBuffer(tt,et){if(!Buffer$F.isBuffer(tt)&&typeof tt!="string")throw new TypeError(et+" must be a string or a buffer")}function HashBase$2(tt){Transform$6.call(this),this._block=Buffer$F.allocUnsafe(tt),this._blockSize=tt,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$v(HashBase$2,Transform$6);HashBase$2.prototype._transform=function(tt,et,nt){var rt=null;try{this.update(tt,et)}catch(it){rt=it}nt(rt)};HashBase$2.prototype._flush=function(tt){var et=null;try{this.push(this.digest())}catch(nt){et=nt}tt(et)};HashBase$2.prototype.update=function(tt,et){if(throwIfNotStringOrBuffer(tt,"Data"),this._finalized)throw new Error("Digest already called");Buffer$F.isBuffer(tt)||(tt=Buffer$F.from(tt,et));for(var nt=this._block,rt=0;this._blockOffset+tt.length-rt>=this._blockSize;){for(var it=this._blockOffset;it0;++ot)this._length[ot]+=at,at=this._length[ot]/4294967296|0,at>0&&(this._length[ot]-=4294967296*at);return this};HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")};HashBase$2.prototype.digest=function(tt){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var et=this._digest();tt!==void 0&&(et=et.toString(tt)),this._block.fill(0),this._blockOffset=0;for(var nt=0;nt<4;++nt)this._length[nt]=0;return et};HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$u=inherits_browserExports,HashBase$1=hashBase,Buffer$E=safeBufferExports.Buffer,ARRAY16$1=new Array(16);function MD5$3(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$u(MD5$3,HashBase$1);MD5$3.prototype._update=function(){for(var tt=ARRAY16$1,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);var nt=this._a,rt=this._b,it=this._c,ot=this._d;nt=fnF(nt,rt,it,ot,tt[0],3614090360,7),ot=fnF(ot,nt,rt,it,tt[1],3905402710,12),it=fnF(it,ot,nt,rt,tt[2],606105819,17),rt=fnF(rt,it,ot,nt,tt[3],3250441966,22),nt=fnF(nt,rt,it,ot,tt[4],4118548399,7),ot=fnF(ot,nt,rt,it,tt[5],1200080426,12),it=fnF(it,ot,nt,rt,tt[6],2821735955,17),rt=fnF(rt,it,ot,nt,tt[7],4249261313,22),nt=fnF(nt,rt,it,ot,tt[8],1770035416,7),ot=fnF(ot,nt,rt,it,tt[9],2336552879,12),it=fnF(it,ot,nt,rt,tt[10],4294925233,17),rt=fnF(rt,it,ot,nt,tt[11],2304563134,22),nt=fnF(nt,rt,it,ot,tt[12],1804603682,7),ot=fnF(ot,nt,rt,it,tt[13],4254626195,12),it=fnF(it,ot,nt,rt,tt[14],2792965006,17),rt=fnF(rt,it,ot,nt,tt[15],1236535329,22),nt=fnG(nt,rt,it,ot,tt[1],4129170786,5),ot=fnG(ot,nt,rt,it,tt[6],3225465664,9),it=fnG(it,ot,nt,rt,tt[11],643717713,14),rt=fnG(rt,it,ot,nt,tt[0],3921069994,20),nt=fnG(nt,rt,it,ot,tt[5],3593408605,5),ot=fnG(ot,nt,rt,it,tt[10],38016083,9),it=fnG(it,ot,nt,rt,tt[15],3634488961,14),rt=fnG(rt,it,ot,nt,tt[4],3889429448,20),nt=fnG(nt,rt,it,ot,tt[9],568446438,5),ot=fnG(ot,nt,rt,it,tt[14],3275163606,9),it=fnG(it,ot,nt,rt,tt[3],4107603335,14),rt=fnG(rt,it,ot,nt,tt[8],1163531501,20),nt=fnG(nt,rt,it,ot,tt[13],2850285829,5),ot=fnG(ot,nt,rt,it,tt[2],4243563512,9),it=fnG(it,ot,nt,rt,tt[7],1735328473,14),rt=fnG(rt,it,ot,nt,tt[12],2368359562,20),nt=fnH(nt,rt,it,ot,tt[5],4294588738,4),ot=fnH(ot,nt,rt,it,tt[8],2272392833,11),it=fnH(it,ot,nt,rt,tt[11],1839030562,16),rt=fnH(rt,it,ot,nt,tt[14],4259657740,23),nt=fnH(nt,rt,it,ot,tt[1],2763975236,4),ot=fnH(ot,nt,rt,it,tt[4],1272893353,11),it=fnH(it,ot,nt,rt,tt[7],4139469664,16),rt=fnH(rt,it,ot,nt,tt[10],3200236656,23),nt=fnH(nt,rt,it,ot,tt[13],681279174,4),ot=fnH(ot,nt,rt,it,tt[0],3936430074,11),it=fnH(it,ot,nt,rt,tt[3],3572445317,16),rt=fnH(rt,it,ot,nt,tt[6],76029189,23),nt=fnH(nt,rt,it,ot,tt[9],3654602809,4),ot=fnH(ot,nt,rt,it,tt[12],3873151461,11),it=fnH(it,ot,nt,rt,tt[15],530742520,16),rt=fnH(rt,it,ot,nt,tt[2],3299628645,23),nt=fnI(nt,rt,it,ot,tt[0],4096336452,6),ot=fnI(ot,nt,rt,it,tt[7],1126891415,10),it=fnI(it,ot,nt,rt,tt[14],2878612391,15),rt=fnI(rt,it,ot,nt,tt[5],4237533241,21),nt=fnI(nt,rt,it,ot,tt[12],1700485571,6),ot=fnI(ot,nt,rt,it,tt[3],2399980690,10),it=fnI(it,ot,nt,rt,tt[10],4293915773,15),rt=fnI(rt,it,ot,nt,tt[1],2240044497,21),nt=fnI(nt,rt,it,ot,tt[8],1873313359,6),ot=fnI(ot,nt,rt,it,tt[15],4264355552,10),it=fnI(it,ot,nt,rt,tt[6],2734768916,15),rt=fnI(rt,it,ot,nt,tt[13],1309151649,21),nt=fnI(nt,rt,it,ot,tt[4],4149444226,6),ot=fnI(ot,nt,rt,it,tt[11],3174756917,10),it=fnI(it,ot,nt,rt,tt[2],718787259,15),rt=fnI(rt,it,ot,nt,tt[9],3951481745,21),this._a=this._a+nt|0,this._b=this._b+rt|0,this._c=this._c+it|0,this._d=this._d+ot|0};MD5$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$E.allocUnsafe(16);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt};function rotl$3(tt,et){return tt<>>32-et}function fnF(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(et&nt|~et&rt)+it+ot|0,at)+et|0}function fnG(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(et&rt|nt&~rt)+it+ot|0,at)+et|0}function fnH(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(et^nt^rt)+it+ot|0,at)+et|0}function fnI(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(nt^(et|~rt))+it+ot|0,at)+et|0}var md5_js=MD5$3,Buffer$D=buffer$2.Buffer,inherits$t=inherits_browserExports,HashBase=hashBase,ARRAY16=new Array(16),zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$t(RIPEMD160$5,HashBase);RIPEMD160$5.prototype._update=function(){for(var tt=ARRAY16,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);for(var nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=this._a|0,lt=this._b|0,ct=this._c|0,ut=this._d|0,ht=this._e|0,dt=0;dt<80;dt+=1){var pt,mt;dt<16?(pt=fn1(nt,rt,it,ot,at,tt[zl[dt]],hl[0],sl[dt]),mt=fn5(st,lt,ct,ut,ht,tt[zr[dt]],hr[0],sr[dt])):dt<32?(pt=fn2(nt,rt,it,ot,at,tt[zl[dt]],hl[1],sl[dt]),mt=fn4(st,lt,ct,ut,ht,tt[zr[dt]],hr[1],sr[dt])):dt<48?(pt=fn3(nt,rt,it,ot,at,tt[zl[dt]],hl[2],sl[dt]),mt=fn3(st,lt,ct,ut,ht,tt[zr[dt]],hr[2],sr[dt])):dt<64?(pt=fn4(nt,rt,it,ot,at,tt[zl[dt]],hl[3],sl[dt]),mt=fn2(st,lt,ct,ut,ht,tt[zr[dt]],hr[3],sr[dt])):(pt=fn5(nt,rt,it,ot,at,tt[zl[dt]],hl[4],sl[dt]),mt=fn1(st,lt,ct,ut,ht,tt[zr[dt]],hr[4],sr[dt])),nt=at,at=ot,ot=rotl$2(it,10),it=rt,rt=pt,st=ht,ht=ut,ut=rotl$2(ct,10),ct=lt,lt=mt}var gt=this._b+it+ut|0;this._b=this._c+ot+ht|0,this._c=this._d+at+st|0,this._d=this._e+nt+lt|0,this._e=this._a+rt+ct|0,this._a=gt};RIPEMD160$5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$D.alloc?Buffer$D.alloc(20):new Buffer$D(20);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt.writeInt32LE(this._e,16),tt};function rotl$2(tt,et){return tt<>>32-et}function fn1(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et^nt^rt)+ot+at|0,st)+it|0}function fn2(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et&nt|~et&rt)+ot+at|0,st)+it|0}function fn3(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+((et|~nt)^rt)+ot+at|0,st)+it|0}function fn4(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et&rt|nt&~rt)+ot+at|0,st)+it|0}function fn5(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et^(nt|~rt))+ot+at|0,st)+it|0}var ripemd160$1=RIPEMD160$5,sha_js={exports:{}},Buffer$C=safeBufferExports.Buffer;function Hash$9(tt,et){this._block=Buffer$C.alloc(tt),this._finalSize=et,this._blockSize=tt,this._len=0}Hash$9.prototype.update=function(tt,et){typeof tt=="string"&&(et=et||"utf8",tt=Buffer$C.from(tt,et));for(var nt=this._block,rt=this._blockSize,it=tt.length,ot=this._len,at=0;at=this._finalSize&&(this._update(this._block),this._block.fill(0));var nt=this._len*8;if(nt<=4294967295)this._block.writeUInt32BE(nt,this._blockSize-4);else{var rt=(nt&4294967295)>>>0,it=(nt-rt)/4294967296;this._block.writeUInt32BE(it,this._blockSize-8),this._block.writeUInt32BE(rt,this._blockSize-4)}this._update(this._block);var ot=this._hash();return tt?ot.toString(tt):ot};Hash$9.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$7=Hash$9,inherits$s=inherits_browserExports,Hash$8=hash$7,Buffer$B=safeBufferExports.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$8.call(this,64,56)}inherits$s(Sha,Hash$8);Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(tt){return tt<<5|tt>>>27}function rotl30$1(tt){return tt<<30|tt>>>2}function ft$1(tt,et,nt,rt){return tt===0?et&nt|~et&rt:tt===2?et&nt|et&rt|nt&rt:et^nt^rt}Sha.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=et[st-3]^et[st-8]^et[st-14]^et[st-16];for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5$1(nt)+ft$1(ct,rt,it,ot)+at+et[lt]+K$4[ct]|0;at=ot,ot=it,it=rotl30$1(rt),rt=nt,nt=ut}this._a=nt+this._a|0,this._b=rt+this._b|0,this._c=it+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha.prototype._hash=function(){var tt=Buffer$B.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha$4=Sha,inherits$r=inherits_browserExports,Hash$7=hash$7,Buffer$A=safeBufferExports.Buffer,K$3=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$7.call(this,64,56)}inherits$r(Sha1,Hash$7);Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(tt){return tt<<1|tt>>>31}function rotl5(tt){return tt<<5|tt>>>27}function rotl30(tt){return tt<<30|tt>>>2}function ft(tt,et,nt,rt){return tt===0?et&nt|~et&rt:tt===2?et&nt|et&rt|nt&rt:et^nt^rt}Sha1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=rotl1(et[st-3]^et[st-8]^et[st-14]^et[st-16]);for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5(nt)+ft(ct,rt,it,ot)+at+et[lt]+K$3[ct]|0;at=ot,ot=it,it=rotl30(rt),rt=nt,nt=ut}this._a=nt+this._a|0,this._b=rt+this._b|0,this._c=it+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha1.prototype._hash=function(){var tt=Buffer$A.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha1$1=Sha1,inherits$q=inherits_browserExports,Hash$6=hash$7,Buffer$z=safeBufferExports.Buffer,K$2=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$6.call(this,64,56)}inherits$q(Sha256$1,Hash$6);Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(tt,et,nt){return nt^tt&(et^nt)}function maj$1(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0$1(tt){return(tt>>>2|tt<<30)^(tt>>>13|tt<<19)^(tt>>>22|tt<<10)}function sigma1$1(tt){return(tt>>>6|tt<<26)^(tt>>>11|tt<<21)^(tt>>>25|tt<<7)}function gamma0(tt){return(tt>>>7|tt<<25)^(tt>>>18|tt<<14)^tt>>>3}function gamma1(tt){return(tt>>>17|tt<<15)^(tt>>>19|tt<<13)^tt>>>10}Sha256$1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=this._f|0,lt=this._g|0,ct=this._h|0,ut=0;ut<16;++ut)et[ut]=tt.readInt32BE(ut*4);for(;ut<64;++ut)et[ut]=gamma1(et[ut-2])+et[ut-7]+gamma0(et[ut-15])+et[ut-16]|0;for(var ht=0;ht<64;++ht){var dt=ct+sigma1$1(at)+ch(at,st,lt)+K$2[ht]+et[ht]|0,pt=sigma0$1(nt)+maj$1(nt,rt,it)|0;ct=lt,lt=st,st=at,at=ot+dt|0,ot=it,it=rt,rt=nt,nt=dt+pt|0}this._a=nt+this._a|0,this._b=rt+this._b|0,this._c=it+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0,this._f=st+this._f|0,this._g=lt+this._g|0,this._h=ct+this._h|0};Sha256$1.prototype._hash=function(){var tt=Buffer$z.allocUnsafe(32);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt.writeInt32BE(this._h,28),tt};var sha256$4=Sha256$1,inherits$p=inherits_browserExports,Sha256=sha256$4,Hash$5=hash$7,Buffer$y=safeBufferExports.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$5.call(this,64,56)}inherits$p(Sha224,Sha256);Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Sha224.prototype._hash=function(){var tt=Buffer$y.allocUnsafe(28);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt};var sha224$1=Sha224,inherits$o=inherits_browserExports,Hash$4=hash$7,Buffer$x=safeBufferExports.Buffer,K$1=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$4.call(this,128,112)}inherits$o(Sha512,Hash$4);Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(tt,et,nt){return nt^tt&(et^nt)}function maj(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0(tt,et){return(tt>>>28|et<<4)^(et>>>2|tt<<30)^(et>>>7|tt<<25)}function sigma1(tt,et){return(tt>>>14|et<<18)^(tt>>>18|et<<14)^(et>>>9|tt<<23)}function Gamma0(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^tt>>>7}function Gamma0l(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^(tt>>>7|et<<25)}function Gamma1(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^tt>>>6}function Gamma1l(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^(tt>>>6|et<<26)}function getCarry(tt,et){return tt>>>0>>0?1:0}Sha512.prototype._update=function(tt){for(var et=this._w,nt=this._ah|0,rt=this._bh|0,it=this._ch|0,ot=this._dh|0,at=this._eh|0,st=this._fh|0,lt=this._gh|0,ct=this._hh|0,ut=this._al|0,ht=this._bl|0,dt=this._cl|0,pt=this._dl|0,mt=this._el|0,gt=this._fl|0,yt=this._gl|0,bt=this._hl|0,wt=0;wt<32;wt+=2)et[wt]=tt.readInt32BE(wt*4),et[wt+1]=tt.readInt32BE(wt*4+4);for(;wt<160;wt+=2){var xt=et[wt-30],kt=et[wt-15*2+1],St=Gamma0(xt,kt),Tt=Gamma0l(kt,xt);xt=et[wt-2*2],kt=et[wt-2*2+1];var At=Gamma1(xt,kt),Et=Gamma1l(kt,xt),Ct=et[wt-7*2],Lt=et[wt-7*2+1],jt=et[wt-16*2],Rt=et[wt-16*2+1],$t=Tt+Lt|0,vt=St+Ct+getCarry($t,Tt)|0;$t=$t+Et|0,vt=vt+At+getCarry($t,Et)|0,$t=$t+Rt|0,vt=vt+jt+getCarry($t,Rt)|0,et[wt]=vt,et[wt+1]=$t}for(var It=0;It<160;It+=2){vt=et[It],$t=et[It+1];var Ot=maj(nt,rt,it),Wt=maj(ut,ht,dt),zt=sigma0(nt,ut),Ft=sigma0(ut,nt),Nt=sigma1(at,mt),Ut=sigma1(mt,at),Pt=K$1[It],Ht=K$1[It+1],Qt=Ch(at,st,lt),an=Ch(mt,gt,yt),Yt=bt+Ut|0,nn=ct+Nt+getCarry(Yt,bt)|0;Yt=Yt+an|0,nn=nn+Qt+getCarry(Yt,an)|0,Yt=Yt+Ht|0,nn=nn+Pt+getCarry(Yt,Ht)|0,Yt=Yt+$t|0,nn=nn+vt+getCarry(Yt,$t)|0;var tn=Ft+Wt|0,dn=zt+Ot+getCarry(tn,Ft)|0;ct=lt,bt=yt,lt=st,yt=gt,st=at,gt=mt,mt=pt+Yt|0,at=ot+nn+getCarry(mt,pt)|0,ot=it,pt=dt,it=rt,dt=ht,rt=nt,ht=ut,ut=Yt+tn|0,nt=nn+dn+getCarry(ut,Yt)|0}this._al=this._al+ut|0,this._bl=this._bl+ht|0,this._cl=this._cl+dt|0,this._dl=this._dl+pt|0,this._el=this._el+mt|0,this._fl=this._fl+gt|0,this._gl=this._gl+yt|0,this._hl=this._hl+bt|0,this._ah=this._ah+nt+getCarry(this._al,ut)|0,this._bh=this._bh+rt+getCarry(this._bl,ht)|0,this._ch=this._ch+it+getCarry(this._cl,dt)|0,this._dh=this._dh+ot+getCarry(this._dl,pt)|0,this._eh=this._eh+at+getCarry(this._el,mt)|0,this._fh=this._fh+st+getCarry(this._fl,gt)|0,this._gh=this._gh+lt+getCarry(this._gl,yt)|0,this._hh=this._hh+ct+getCarry(this._hl,bt)|0};Sha512.prototype._hash=function(){var tt=Buffer$x.allocUnsafe(64);function et(nt,rt,it){tt.writeInt32BE(nt,it),tt.writeInt32BE(rt,it+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),et(this._gh,this._gl,48),et(this._hh,this._hl,56),tt};var sha512$1=Sha512,inherits$n=inherits_browserExports,SHA512$2=sha512$1,Hash$3=hash$7,Buffer$w=safeBufferExports.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$3.call(this,128,112)}inherits$n(Sha384,SHA512$2);Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Sha384.prototype._hash=function(){var tt=Buffer$w.allocUnsafe(48);function et(nt,rt,it){tt.writeInt32BE(nt,it),tt.writeInt32BE(rt,it+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),tt};var sha384$1=Sha384,exports=sha_js.exports=function(et){et=et.toLowerCase();var nt=exports[et];if(!nt)throw new Error(et+" is not supported (we accept pull requests)");return new nt};exports.sha=sha$4;exports.sha1=sha1$1;exports.sha224=sha224$1;exports.sha256=sha256$4;exports.sha384=sha384$1;exports.sha512=sha512$1;var sha_jsExports=sha_js.exports,streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$m=inherits_browserExports;inherits$m(Stream,EE);Stream.Readable=require_stream_readable();Stream.Writable=require_stream_writable();Stream.Duplex=require_stream_duplex();Stream.Transform=_stream_transform;Stream.PassThrough=_stream_passthrough;Stream.finished=endOfStream;Stream.pipeline=pipeline_1;Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(tt,et){var nt=this;function rt(ut){tt.writable&&tt.write(ut)===!1&&nt.pause&&nt.pause()}nt.on("data",rt);function it(){nt.readable&&nt.resume&&nt.resume()}tt.on("drain",it),!tt._isStdio&&(!et||et.end!==!1)&&(nt.on("end",at),nt.on("close",st));var ot=!1;function at(){ot||(ot=!0,tt.end())}function st(){ot||(ot=!0,typeof tt.destroy=="function"&&tt.destroy())}function lt(ut){if(ct(),EE.listenerCount(this,"error")===0)throw ut}nt.on("error",lt),tt.on("error",lt);function ct(){nt.removeListener("data",rt),tt.removeListener("drain",it),nt.removeListener("end",at),nt.removeListener("close",st),nt.removeListener("error",lt),tt.removeListener("error",lt),nt.removeListener("end",ct),nt.removeListener("close",ct),tt.removeListener("close",ct)}return nt.on("end",ct),nt.on("close",ct),tt.on("close",ct),tt.emit("pipe",nt),tt};var Buffer$v=safeBufferExports.Buffer,Transform$5=streamBrowserify.Transform,StringDecoder=string_decoder.StringDecoder,inherits$l=inherits_browserExports;function CipherBase$1(tt){Transform$5.call(this),this.hashMode=typeof tt=="string",this.hashMode?this[tt]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$l(CipherBase$1,Transform$5);CipherBase$1.prototype.update=function(tt,et,nt){typeof tt=="string"&&(tt=Buffer$v.from(tt,et));var rt=this._update(tt);return this.hashMode?this:(nt&&(rt=this._toString(rt,nt)),rt)};CipherBase$1.prototype.setAutoPadding=function(){};CipherBase$1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};CipherBase$1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};CipherBase$1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};CipherBase$1.prototype._transform=function(tt,et,nt){var rt;try{this.hashMode?this._update(tt):this.push(this._update(tt))}catch(it){rt=it}finally{nt(rt)}};CipherBase$1.prototype._flush=function(tt){var et;try{this.push(this.__final())}catch(nt){et=nt}tt(et)};CipherBase$1.prototype._finalOrDigest=function(tt){var et=this.__final()||Buffer$v.alloc(0);return tt&&(et=this._toString(et,tt,!0)),et};CipherBase$1.prototype._toString=function(tt,et,nt){if(this._decoder||(this._decoder=new StringDecoder(et),this._encoding=et),this._encoding!==et)throw new Error("can't switch encodings");var rt=this._decoder.write(tt);return nt&&(rt+=this._decoder.end()),rt};var cipherBase=CipherBase$1,inherits$k=inherits_browserExports,MD5$2=md5_js,RIPEMD160$4=ripemd160$1,sha$3=sha_jsExports,Base$5=cipherBase;function Hash$2(tt){Base$5.call(this,"digest"),this._hash=tt}inherits$k(Hash$2,Base$5);Hash$2.prototype._update=function(tt){this._hash.update(tt)};Hash$2.prototype._final=function(){return this._hash.digest()};var browser$9=function(et){return et=et.toLowerCase(),et==="md5"?new MD5$2:et==="rmd160"||et==="ripemd160"?new RIPEMD160$4:new Hash$2(sha$3(et))},inherits$j=inherits_browserExports,Buffer$u=safeBufferExports.Buffer,Base$4=cipherBase,ZEROS$2=Buffer$u.alloc(128),blocksize=64;function Hmac$3(tt,et){Base$4.call(this,"digest"),typeof et=="string"&&(et=Buffer$u.from(et)),this._alg=tt,this._key=et,et.length>blocksize?et=tt(et):et.lengthnt){var rt=tt==="rmd160"?new RIPEMD160$3:sha$2(tt);et=rt.update(et).digest()}else et.lengthMAX_ALLOC||et!==et)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$s=safeBufferExports.Buffer,toBuffer$3=function(tt,et,nt){if(Buffer$s.isBuffer(tt))return tt;if(typeof tt=="string")return Buffer$s.from(tt,et);if(ArrayBuffer.isView(tt))return Buffer$s.from(tt.buffer);throw new TypeError(nt+" must be a string, a Buffer, a typed array or a DataView")},md5=md5$2,RIPEMD160$2=ripemd160$1,sha$1=sha_jsExports,Buffer$r=safeBufferExports.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$2=toBuffer$3,ZEROS=Buffer$r.alloc(128),sizes={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$1(tt,et,nt){var rt=getDigest(tt),it=tt==="sha512"||tt==="sha384"?128:64;et.length>it?et=rt(et):et.length>>0};utils$q.writeUInt32BE=function(et,nt,rt){et[0+rt]=nt>>>24,et[1+rt]=nt>>>16&255,et[2+rt]=nt>>>8&255,et[3+rt]=nt&255};utils$q.ip=function(et,nt,rt,it){for(var ot=0,at=0,st=6;st>=0;st-=2){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>>lt+st&1}for(var st=6;st>=0;st-=2){for(var lt=1;lt<=25;lt+=8)at<<=1,at|=nt>>>lt+st&1;for(var lt=1;lt<=25;lt+=8)at<<=1,at|=et>>>lt+st&1}rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.rip=function(et,nt,rt,it){for(var ot=0,at=0,st=0;st<4;st++)for(var lt=24;lt>=0;lt-=8)ot<<=1,ot|=nt>>>lt+st&1,ot<<=1,ot|=et>>>lt+st&1;for(var st=4;st<8;st++)for(var lt=24;lt>=0;lt-=8)at<<=1,at|=nt>>>lt+st&1,at<<=1,at|=et>>>lt+st&1;rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.pc1=function(et,nt,rt,it){for(var ot=0,at=0,st=7;st>=5;st--){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var st=1;st<=3;st++){for(var lt=0;lt<=24;lt+=8)at<<=1,at|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1;rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.r28shl=function(et,nt){return et<>>28-nt};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$q.pc2=function(et,nt,rt,it){for(var ot=0,at=0,st=pc2table.length>>>1,lt=0;lt>>pc2table[lt]&1;for(var lt=st;lt>>pc2table[lt]&1;rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.expand=function(et,nt,rt){var it=0,ot=0;it=(et&1)<<5|et>>>27;for(var at=23;at>=15;at-=4)it<<=6,it|=et>>>at&63;for(var at=11;at>=3;at-=4)ot|=et>>>at&63,ot<<=6;ot|=(et&31)<<1|et>>>31,nt[rt+0]=it>>>0,nt[rt+1]=ot>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$q.substitute=function(et,nt){for(var rt=0,it=0;it<4;it++){var ot=et>>>18-it*6&63,at=sTable[it*64+ot];rt<<=4,rt|=at}for(var it=0;it<4;it++){var ot=nt>>>18-it*6&63,at=sTable[4*64+it*64+ot];rt<<=4,rt|=at}return rt>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];utils$q.permute=function(et){for(var nt=0,rt=0;rt>>permuteTable[rt]&1;return nt>>>0};utils$q.padSplit=function(et,nt,rt){for(var it=et.toString(2);it.length0;it--)nt+=this._buffer(et,nt),rt+=this._flushBuffer(ot,rt);return nt+=this._buffer(et,nt),ot};Cipher$3.prototype.final=function(et){var nt;et&&(nt=this.update(et));var rt;return this.type==="encrypt"?rt=this._finalEncrypt():rt=this._finalDecrypt(),nt?nt.concat(rt):rt};Cipher$3.prototype._pad=function(et,nt){if(nt===0)return!1;for(;nt>>1];rt=utils$p.r28shl(rt,at),it=utils$p.r28shl(it,at),utils$p.pc2(rt,it,et.keys,ot)}};DES$3.prototype._update=function(et,nt,rt,it){var ot=this._desState,at=utils$p.readUInt32BE(et,nt),st=utils$p.readUInt32BE(et,nt+4);utils$p.ip(at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],this.type==="encrypt"?this._encrypt(ot,at,st,ot.tmp,0):this._decrypt(ot,at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],utils$p.writeUInt32BE(rt,at,it),utils$p.writeUInt32BE(rt,st,it+4)};DES$3.prototype._pad=function(et,nt){if(this.padding===!1)return!1;for(var rt=et.length-nt,it=nt;it>>0,at=pt}utils$p.rip(st,at,it,ot)};DES$3.prototype._decrypt=function(et,nt,rt,it,ot){for(var at=rt,st=nt,lt=et.keys.length-2;lt>=0;lt-=2){var ct=et.keys[lt],ut=et.keys[lt+1];utils$p.expand(at,et.tmp,0),ct^=et.tmp[0],ut^=et.tmp[1];var ht=utils$p.substitute(ct,ut),dt=utils$p.permute(ht),pt=at;at=(st^dt)>>>0,st=pt}utils$p.rip(at,st,it,ot)};var cbc$1={},assert$l=minimalisticAssert,inherits$g=inherits_browserExports,proto={};function CBCState(tt){assert$l.equal(tt.length,8,"Invalid IV length"),this.iv=new Array(8);for(var et=0;et>it%8,tt._prev=shiftIn(tt._prev,nt?st:lt);return at}function shiftIn(tt,et){var nt=tt.length,rt=-1,it=Buffer$m.allocUnsafe(tt.length);for(tt=Buffer$m.concat([tt,Buffer$m.from([et])]);++rt>7;return it}cfb1.encrypt=function(tt,et,nt){for(var rt=et.length,it=Buffer$m.allocUnsafe(rt),ot=-1;++ot>>24]^at[ut>>>16&255]^st[ht>>>8&255]^lt[dt&255]^et[bt++],mt=ot[ut>>>24]^at[ht>>>16&255]^st[dt>>>8&255]^lt[ct&255]^et[bt++],gt=ot[ht>>>24]^at[dt>>>16&255]^st[ct>>>8&255]^lt[ut&255]^et[bt++],yt=ot[dt>>>24]^at[ct>>>16&255]^st[ut>>>8&255]^lt[ht&255]^et[bt++],ct=pt,ut=mt,ht=gt,dt=yt;return pt=(rt[ct>>>24]<<24|rt[ut>>>16&255]<<16|rt[ht>>>8&255]<<8|rt[dt&255])^et[bt++],mt=(rt[ut>>>24]<<24|rt[ht>>>16&255]<<16|rt[dt>>>8&255]<<8|rt[ct&255])^et[bt++],gt=(rt[ht>>>24]<<24|rt[dt>>>16&255]<<16|rt[ct>>>8&255]<<8|rt[ut&255])^et[bt++],yt=(rt[dt>>>24]<<24|rt[ct>>>16&255]<<16|rt[ut>>>8&255]<<8|rt[ht&255])^et[bt++],pt=pt>>>0,mt=mt>>>0,gt=gt>>>0,yt=yt>>>0,[pt,mt,gt,yt]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var tt=new Array(256),et=0;et<256;et++)et<128?tt[et]=et<<1:tt[et]=et<<1^283;for(var nt=[],rt=[],it=[[],[],[],[]],ot=[[],[],[],[]],at=0,st=0,lt=0;lt<256;++lt){var ct=st^st<<1^st<<2^st<<3^st<<4;ct=ct>>>8^ct&255^99,nt[at]=ct,rt[ct]=at;var ut=tt[at],ht=tt[ut],dt=tt[ht],pt=tt[ct]*257^ct*16843008;it[0][at]=pt<<24|pt>>>8,it[1][at]=pt<<16|pt>>>16,it[2][at]=pt<<8|pt>>>24,it[3][at]=pt,pt=dt*16843009^ht*65537^ut*257^at*16843008,ot[0][ct]=pt<<24|pt>>>8,ot[1][ct]=pt<<16|pt>>>16,ot[2][ct]=pt<<8|pt>>>24,ot[3][ct]=pt,at===0?at=st=1:(at=ut^tt[tt[tt[dt^ut]]],st^=tt[tt[st]])}return{SBOX:nt,INV_SBOX:rt,SUB_MIX:it,INV_SUB_MIX:ot}}();function AES(tt){this._key=asUInt32Array(tt),this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){for(var tt=this._key,et=tt.length,nt=et+6,rt=(nt+1)*4,it=[],ot=0;ot>>24,at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255],at^=RCON[ot/et|0]<<24):et>6&&ot%et===4&&(at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255]),it[ot]=it[ot-et]^at}for(var st=[],lt=0;lt>>24]]^G.INV_SUB_MIX[1][G.SBOX[ut>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[ut>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[ut&255]]}this._nRounds=nt,this._keySchedule=it,this._invKeySchedule=st};AES.prototype.encryptBlockRaw=function(tt){return tt=asUInt32Array(tt),cryptBlock(tt,this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(tt){var et=this.encryptBlockRaw(tt),nt=Buffer$k.allocUnsafe(16);return nt.writeUInt32BE(et[0],0),nt.writeUInt32BE(et[1],4),nt.writeUInt32BE(et[2],8),nt.writeUInt32BE(et[3],12),nt};AES.prototype.decryptBlock=function(tt){tt=asUInt32Array(tt);var et=tt[1];tt[1]=tt[3],tt[3]=et;var nt=cryptBlock(tt,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),rt=Buffer$k.allocUnsafe(16);return rt.writeUInt32BE(nt[0],0),rt.writeUInt32BE(nt[3],4),rt.writeUInt32BE(nt[2],8),rt.writeUInt32BE(nt[1],12),rt};AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)};aes$5.AES=AES;var Buffer$j=safeBufferExports.Buffer,ZEROES=Buffer$j.alloc(16,0);function toArray$4(tt){return[tt.readUInt32BE(0),tt.readUInt32BE(4),tt.readUInt32BE(8),tt.readUInt32BE(12)]}function fromArray(tt){var et=Buffer$j.allocUnsafe(16);return et.writeUInt32BE(tt[0]>>>0,0),et.writeUInt32BE(tt[1]>>>0,4),et.writeUInt32BE(tt[2]>>>0,8),et.writeUInt32BE(tt[3]>>>0,12),et}function GHASH$1(tt){this.h=tt,this.state=Buffer$j.alloc(16,0),this.cache=Buffer$j.allocUnsafe(0)}GHASH$1.prototype.ghash=function(tt){for(var et=-1;++et0;nt--)tt[nt]=tt[nt]>>>1|(tt[nt-1]&1)<<31;tt[0]=tt[0]>>>1,it&&(tt[0]=tt[0]^225<<24)}this.state=fromArray(et)};GHASH$1.prototype.update=function(tt){this.cache=Buffer$j.concat([this.cache,tt]);for(var et;this.cache.length>=16;)et=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(et)};GHASH$1.prototype.final=function(tt,et){return this.cache.length&&this.ghash(Buffer$j.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,tt,0,et])),this.state};var ghash=GHASH$1,aes$4=aes$5,Buffer$i=safeBufferExports.Buffer,Transform$4=cipherBase,inherits$d=inherits_browserExports,GHASH=ghash,xor$3=bufferXor,incr32=incr32_1;function xorTest(tt,et){var nt=0;tt.length!==et.length&&nt++;for(var rt=Math.min(tt.length,et.length),it=0;it0||rt>0;){var lt=new MD5;lt.update(st),lt.update(tt),et&<.update(et),st=lt.digest();var ct=0;if(it>0){var ut=ot.length-it;ct=Math.min(it,st.length),st.copy(ot,ut,0,ct),it-=ct}if(ct0){var ht=at.length-rt,dt=Math.min(rt,st.length-ct);st.copy(at,ht,ct,ct+dt),rt-=dt}}return st.fill(0),{key:ot,iv:at}}var evp_bytestokey=EVP_BytesToKey,MODES$1=modes_1,AuthCipher$1=authCipher,Buffer$f=safeBufferExports.Buffer,StreamCipher$1=streamCipher,Transform$2=cipherBase,aes$2=aes$5,ebtk$2=evp_bytestokey,inherits$b=inherits_browserExports;function Cipher(tt,et,nt){Transform$2.call(this),this._cache=new Splitter$1,this._cipher=new aes$2.AES(et),this._prev=Buffer$f.from(nt),this._mode=tt,this._autopadding=!0}inherits$b(Cipher,Transform$2);Cipher.prototype._update=function(tt){this._cache.add(tt);for(var et,nt,rt=[];et=this._cache.get();)nt=this._mode.encrypt(this,et),rt.push(nt);return Buffer$f.concat(rt)};var PADDING=Buffer$f.alloc(16,16);Cipher.prototype._final=function(){var tt=this._cache.flush();if(this._autopadding)return tt=this._mode.encrypt(this,tt),this._cipher.scrub(),tt;if(!tt.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")};Cipher.prototype.setAutoPadding=function(tt){return this._autopadding=!!tt,this};function Splitter$1(){this.cache=Buffer$f.allocUnsafe(0)}Splitter$1.prototype.add=function(tt){this.cache=Buffer$f.concat([this.cache,tt])};Splitter$1.prototype.get=function(){if(this.cache.length>15){var tt=this.cache.slice(0,16);return this.cache=this.cache.slice(16),tt}return null};Splitter$1.prototype.flush=function(){for(var tt=16-this.cache.length,et=Buffer$f.allocUnsafe(tt),nt=-1;++nt16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et}else if(this.cache.length>=16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et;return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(tt){var et=tt[15];if(et<1||et>16)throw new Error("unable to decrypt data");for(var nt=-1;++nt0?Rt:$t},ot.min=function(Rt,$t){return Rt.cmp($t)<0?Rt:$t},ot.prototype._init=function(Rt,$t,vt){if(typeof Rt=="number")return this._initNumber(Rt,$t,vt);if(typeof Rt=="object")return this._initArray(Rt,$t,vt);$t==="hex"&&($t=16),rt($t===($t|0)&&$t>=2&&$t<=36),Rt=Rt.toString().replace(/\s+/g,"");var It=0;Rt[0]==="-"&&(It++,this.negative=1),It=0;It-=3)Wt=Rt[It]|Rt[It-1]<<8|Rt[It-2]<<16,this.words[Ot]|=Wt<>>26-zt&67108863,zt+=24,zt>=26&&(zt-=26,Ot++);else if(vt==="le")for(It=0,Ot=0;It>>26-zt&67108863,zt+=24,zt>=26&&(zt-=26,Ot++);return this.strip()};function st(jt,Rt){var $t=jt.charCodeAt(Rt);return $t>=65&&$t<=70?$t-55:$t>=97&&$t<=102?$t-87:$t-48&15}function lt(jt,Rt,$t){var vt=st(jt,$t);return $t-1>=Rt&&(vt|=st(jt,$t-1)<<4),vt}ot.prototype._parseHex=function(Rt,$t,vt){this.length=Math.ceil((Rt.length-$t)/6),this.words=new Array(this.length);for(var It=0;It=$t;It-=2)zt=lt(Rt,$t,It)<=18?(Ot-=18,Wt+=1,this.words[Wt]|=zt>>>26):Ot+=8;else{var Ft=Rt.length-$t;for(It=Ft%2===0?$t+1:$t;It=18?(Ot-=18,Wt+=1,this.words[Wt]|=zt>>>26):Ot+=8}this.strip()};function ct(jt,Rt,$t,vt){for(var It=0,Ot=Math.min(jt.length,$t),Wt=Rt;Wt=49?It+=zt-49+10:zt>=17?It+=zt-17+10:It+=zt}return It}ot.prototype._parseBase=function(Rt,$t,vt){this.words=[0],this.length=1;for(var It=0,Ot=1;Ot<=67108863;Ot*=$t)It++;It--,Ot=Ot/$t|0;for(var Wt=Rt.length-vt,zt=Wt%It,Ft=Math.min(Wt,Wt-zt)+vt,Nt=0,Ut=vt;Ut1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},ot.prototype.inspect=function(){return(this.red?""};var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],dt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(Rt,$t){Rt=Rt||10,$t=$t|0||1;var vt;if(Rt===16||Rt==="hex"){vt="";for(var It=0,Ot=0,Wt=0;Wt>>24-It&16777215,Ot!==0||Wt!==this.length-1?vt=ut[6-Ft.length]+Ft+vt:vt=Ft+vt,It+=2,It>=26&&(It-=26,Wt--)}for(Ot!==0&&(vt=Ot.toString(16)+vt);vt.length%$t!==0;)vt="0"+vt;return this.negative!==0&&(vt="-"+vt),vt}if(Rt===(Rt|0)&&Rt>=2&&Rt<=36){var Nt=ht[Rt],Ut=dt[Rt];vt="";var Pt=this.clone();for(Pt.negative=0;!Pt.isZero();){var Ht=Pt.modn(Ut).toString(Rt);Pt=Pt.idivn(Ut),Pt.isZero()?vt=Ht+vt:vt=ut[Nt-Ht.length]+Ht+vt}for(this.isZero()&&(vt="0"+vt);vt.length%$t!==0;)vt="0"+vt;return this.negative!==0&&(vt="-"+vt),vt}rt(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var Rt=this.words[0];return this.length===2?Rt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Rt+=4503599627370496+this.words[1]*67108864:this.length>2&&rt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Rt:Rt},ot.prototype.toJSON=function(){return this.toString(16)},ot.prototype.toBuffer=function(Rt,$t){return rt(typeof at<"u"),this.toArrayLike(at,Rt,$t)},ot.prototype.toArray=function(Rt,$t){return this.toArrayLike(Array,Rt,$t)},ot.prototype.toArrayLike=function(Rt,$t,vt){var It=this.byteLength(),Ot=vt||Math.max(1,It);rt(It<=Ot,"byte array longer than desired length"),rt(Ot>0,"Requested array length <= 0"),this.strip();var Wt=$t==="le",zt=new Rt(Ot),Ft,Nt,Ut=this.clone();if(Wt){for(Nt=0;!Ut.isZero();Nt++)Ft=Ut.andln(255),Ut.iushrn(8),zt[Nt]=Ft;for(;Nt=4096&&(vt+=13,$t>>>=13),$t>=64&&(vt+=7,$t>>>=7),$t>=8&&(vt+=4,$t>>>=4),$t>=2&&(vt+=2,$t>>>=2),vt+$t},ot.prototype._zeroBits=function(Rt){if(Rt===0)return 26;var $t=Rt,vt=0;return $t&8191||(vt+=13,$t>>>=13),$t&127||(vt+=7,$t>>>=7),$t&15||(vt+=4,$t>>>=4),$t&3||(vt+=2,$t>>>=2),$t&1||vt++,vt},ot.prototype.bitLength=function(){var Rt=this.words[this.length-1],$t=this._countBits(Rt);return(this.length-1)*26+$t};function pt(jt){for(var Rt=new Array(jt.bitLength()),$t=0;$t>>It}return Rt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Rt=0,$t=0;$tRt.length?this.clone().ior(Rt):Rt.clone().ior(this)},ot.prototype.uor=function(Rt){return this.length>Rt.length?this.clone().iuor(Rt):Rt.clone().iuor(this)},ot.prototype.iuand=function(Rt){var $t;this.length>Rt.length?$t=Rt:$t=this;for(var vt=0;vt<$t.length;vt++)this.words[vt]=this.words[vt]&Rt.words[vt];return this.length=$t.length,this.strip()},ot.prototype.iand=function(Rt){return rt((this.negative|Rt.negative)===0),this.iuand(Rt)},ot.prototype.and=function(Rt){return this.length>Rt.length?this.clone().iand(Rt):Rt.clone().iand(this)},ot.prototype.uand=function(Rt){return this.length>Rt.length?this.clone().iuand(Rt):Rt.clone().iuand(this)},ot.prototype.iuxor=function(Rt){var $t,vt;this.length>Rt.length?($t=this,vt=Rt):($t=Rt,vt=this);for(var It=0;ItRt.length?this.clone().ixor(Rt):Rt.clone().ixor(this)},ot.prototype.uxor=function(Rt){return this.length>Rt.length?this.clone().iuxor(Rt):Rt.clone().iuxor(this)},ot.prototype.inotn=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Math.ceil(Rt/26)|0,vt=Rt%26;this._expand($t),vt>0&&$t--;for(var It=0;It<$t;It++)this.words[It]=~this.words[It]&67108863;return vt>0&&(this.words[It]=~this.words[It]&67108863>>26-vt),this.strip()},ot.prototype.notn=function(Rt){return this.clone().inotn(Rt)},ot.prototype.setn=function(Rt,$t){rt(typeof Rt=="number"&&Rt>=0);var vt=Rt/26|0,It=Rt%26;return this._expand(vt+1),$t?this.words[vt]=this.words[vt]|1<Rt.length?(vt=this,It=Rt):(vt=Rt,It=this);for(var Ot=0,Wt=0;Wt>>26;for(;Ot!==0&&Wt>>26;if(this.length=vt.length,Ot!==0)this.words[this.length]=Ot,this.length++;else if(vt!==this)for(;WtRt.length?this.clone().iadd(Rt):Rt.clone().iadd(this)},ot.prototype.isub=function(Rt){if(Rt.negative!==0){Rt.negative=0;var $t=this.iadd(Rt);return Rt.negative=1,$t._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Rt),this.negative=1,this._normSign();var vt=this.cmp(Rt);if(vt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var It,Ot;vt>0?(It=this,Ot=Rt):(It=Rt,Ot=this);for(var Wt=0,zt=0;zt>26,this.words[zt]=$t&67108863;for(;Wt!==0&&zt>26,this.words[zt]=$t&67108863;if(Wt===0&&zt>>26,Pt=Ft&67108863,Ht=Math.min(Nt,Rt.length-1),Qt=Math.max(0,Nt-jt.length+1);Qt<=Ht;Qt++){var an=Nt-Qt|0;It=jt.words[an]|0,Ot=Rt.words[Qt]|0,Wt=It*Ot+Pt,Ut+=Wt/67108864|0,Pt=Wt&67108863}$t.words[Nt]=Pt|0,Ft=Ut|0}return Ft!==0?$t.words[Nt]=Ft|0:$t.length--,$t.strip()}var gt=function(Rt,$t,vt){var It=Rt.words,Ot=$t.words,Wt=vt.words,zt=0,Ft,Nt,Ut,Pt=It[0]|0,Ht=Pt&8191,Qt=Pt>>>13,an=It[1]|0,Yt=an&8191,nn=an>>>13,tn=It[2]|0,dn=tn&8191,wn=tn>>>13,rn=It[3]|0,Jt=rn&8191,vn=rn>>>13,Cn=It[4]|0,$n=Cn&8191,Nn=Cn>>>13,En=It[5]|0,sn=En&8191,pn=En>>>13,Tn=It[6]|0,In=Tn&8191,yn=Tn>>>13,hn=It[7]|0,fn=hn&8191,xn=hn>>>13,jn=It[8]|0,cn=jn&8191,Xt=jn>>>13,Kt=It[9]|0,kn=Kt&8191,Mn=Kt>>>13,On=Ot[0]|0,Bn=On&8191,Xn=On>>>13,Vn=Ot[1]|0,Gn=Vn&8191,zn=Vn>>>13,Zn=Ot[2]|0,Wn=Zn&8191,fr=Zn>>>13,ur=Ot[3]|0,wr=ur&8191,Xr=ur>>>13,Er=Ot[4]|0,Ir=Er&8191,Gr=Er>>>13,Or=Ot[5]|0,Lr=Or&8191,oo=Or>>>13,qr=Ot[6]|0,jr=qr&8191,mo=qr>>>13,_n=Ot[7]|0,Pn=_n&8191,un=_n>>>13,Zt=Ot[8]|0,Sn=Zt&8191,Dn=Zt>>>13,Fn=Ot[9]|0,Yn=Fn&8191,tr=Fn>>>13;vt.negative=Rt.negative^$t.negative,vt.length=19,Ft=Math.imul(Ht,Bn),Nt=Math.imul(Ht,Xn),Nt=Nt+Math.imul(Qt,Bn)|0,Ut=Math.imul(Qt,Xn);var ar=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(ar>>>26)|0,ar&=67108863,Ft=Math.imul(Yt,Bn),Nt=Math.imul(Yt,Xn),Nt=Nt+Math.imul(nn,Bn)|0,Ut=Math.imul(nn,Xn),Ft=Ft+Math.imul(Ht,Gn)|0,Nt=Nt+Math.imul(Ht,zn)|0,Nt=Nt+Math.imul(Qt,Gn)|0,Ut=Ut+Math.imul(Qt,zn)|0;var lr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(lr>>>26)|0,lr&=67108863,Ft=Math.imul(dn,Bn),Nt=Math.imul(dn,Xn),Nt=Nt+Math.imul(wn,Bn)|0,Ut=Math.imul(wn,Xn),Ft=Ft+Math.imul(Yt,Gn)|0,Nt=Nt+Math.imul(Yt,zn)|0,Nt=Nt+Math.imul(nn,Gn)|0,Ut=Ut+Math.imul(nn,zn)|0,Ft=Ft+Math.imul(Ht,Wn)|0,Nt=Nt+Math.imul(Ht,fr)|0,Nt=Nt+Math.imul(Qt,Wn)|0,Ut=Ut+Math.imul(Qt,fr)|0;var Vr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Ft=Math.imul(Jt,Bn),Nt=Math.imul(Jt,Xn),Nt=Nt+Math.imul(vn,Bn)|0,Ut=Math.imul(vn,Xn),Ft=Ft+Math.imul(dn,Gn)|0,Nt=Nt+Math.imul(dn,zn)|0,Nt=Nt+Math.imul(wn,Gn)|0,Ut=Ut+Math.imul(wn,zn)|0,Ft=Ft+Math.imul(Yt,Wn)|0,Nt=Nt+Math.imul(Yt,fr)|0,Nt=Nt+Math.imul(nn,Wn)|0,Ut=Ut+Math.imul(nn,fr)|0,Ft=Ft+Math.imul(Ht,wr)|0,Nt=Nt+Math.imul(Ht,Xr)|0,Nt=Nt+Math.imul(Qt,wr)|0,Ut=Ut+Math.imul(Qt,Xr)|0;var vr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(vr>>>26)|0,vr&=67108863,Ft=Math.imul($n,Bn),Nt=Math.imul($n,Xn),Nt=Nt+Math.imul(Nn,Bn)|0,Ut=Math.imul(Nn,Xn),Ft=Ft+Math.imul(Jt,Gn)|0,Nt=Nt+Math.imul(Jt,zn)|0,Nt=Nt+Math.imul(vn,Gn)|0,Ut=Ut+Math.imul(vn,zn)|0,Ft=Ft+Math.imul(dn,Wn)|0,Nt=Nt+Math.imul(dn,fr)|0,Nt=Nt+Math.imul(wn,Wn)|0,Ut=Ut+Math.imul(wn,fr)|0,Ft=Ft+Math.imul(Yt,wr)|0,Nt=Nt+Math.imul(Yt,Xr)|0,Nt=Nt+Math.imul(nn,wr)|0,Ut=Ut+Math.imul(nn,Xr)|0,Ft=Ft+Math.imul(Ht,Ir)|0,Nt=Nt+Math.imul(Ht,Gr)|0,Nt=Nt+Math.imul(Qt,Ir)|0,Ut=Ut+Math.imul(Qt,Gr)|0;var Nr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Ft=Math.imul(sn,Bn),Nt=Math.imul(sn,Xn),Nt=Nt+Math.imul(pn,Bn)|0,Ut=Math.imul(pn,Xn),Ft=Ft+Math.imul($n,Gn)|0,Nt=Nt+Math.imul($n,zn)|0,Nt=Nt+Math.imul(Nn,Gn)|0,Ut=Ut+Math.imul(Nn,zn)|0,Ft=Ft+Math.imul(Jt,Wn)|0,Nt=Nt+Math.imul(Jt,fr)|0,Nt=Nt+Math.imul(vn,Wn)|0,Ut=Ut+Math.imul(vn,fr)|0,Ft=Ft+Math.imul(dn,wr)|0,Nt=Nt+Math.imul(dn,Xr)|0,Nt=Nt+Math.imul(wn,wr)|0,Ut=Ut+Math.imul(wn,Xr)|0,Ft=Ft+Math.imul(Yt,Ir)|0,Nt=Nt+Math.imul(Yt,Gr)|0,Nt=Nt+Math.imul(nn,Ir)|0,Ut=Ut+Math.imul(nn,Gr)|0,Ft=Ft+Math.imul(Ht,Lr)|0,Nt=Nt+Math.imul(Ht,oo)|0,Nt=Nt+Math.imul(Qt,Lr)|0,Ut=Ut+Math.imul(Qt,oo)|0;var Hr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Ft=Math.imul(In,Bn),Nt=Math.imul(In,Xn),Nt=Nt+Math.imul(yn,Bn)|0,Ut=Math.imul(yn,Xn),Ft=Ft+Math.imul(sn,Gn)|0,Nt=Nt+Math.imul(sn,zn)|0,Nt=Nt+Math.imul(pn,Gn)|0,Ut=Ut+Math.imul(pn,zn)|0,Ft=Ft+Math.imul($n,Wn)|0,Nt=Nt+Math.imul($n,fr)|0,Nt=Nt+Math.imul(Nn,Wn)|0,Ut=Ut+Math.imul(Nn,fr)|0,Ft=Ft+Math.imul(Jt,wr)|0,Nt=Nt+Math.imul(Jt,Xr)|0,Nt=Nt+Math.imul(vn,wr)|0,Ut=Ut+Math.imul(vn,Xr)|0,Ft=Ft+Math.imul(dn,Ir)|0,Nt=Nt+Math.imul(dn,Gr)|0,Nt=Nt+Math.imul(wn,Ir)|0,Ut=Ut+Math.imul(wn,Gr)|0,Ft=Ft+Math.imul(Yt,Lr)|0,Nt=Nt+Math.imul(Yt,oo)|0,Nt=Nt+Math.imul(nn,Lr)|0,Ut=Ut+Math.imul(nn,oo)|0,Ft=Ft+Math.imul(Ht,jr)|0,Nt=Nt+Math.imul(Ht,mo)|0,Nt=Nt+Math.imul(Qt,jr)|0,Ut=Ut+Math.imul(Qt,mo)|0;var eo=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ft=Math.imul(fn,Bn),Nt=Math.imul(fn,Xn),Nt=Nt+Math.imul(xn,Bn)|0,Ut=Math.imul(xn,Xn),Ft=Ft+Math.imul(In,Gn)|0,Nt=Nt+Math.imul(In,zn)|0,Nt=Nt+Math.imul(yn,Gn)|0,Ut=Ut+Math.imul(yn,zn)|0,Ft=Ft+Math.imul(sn,Wn)|0,Nt=Nt+Math.imul(sn,fr)|0,Nt=Nt+Math.imul(pn,Wn)|0,Ut=Ut+Math.imul(pn,fr)|0,Ft=Ft+Math.imul($n,wr)|0,Nt=Nt+Math.imul($n,Xr)|0,Nt=Nt+Math.imul(Nn,wr)|0,Ut=Ut+Math.imul(Nn,Xr)|0,Ft=Ft+Math.imul(Jt,Ir)|0,Nt=Nt+Math.imul(Jt,Gr)|0,Nt=Nt+Math.imul(vn,Ir)|0,Ut=Ut+Math.imul(vn,Gr)|0,Ft=Ft+Math.imul(dn,Lr)|0,Nt=Nt+Math.imul(dn,oo)|0,Nt=Nt+Math.imul(wn,Lr)|0,Ut=Ut+Math.imul(wn,oo)|0,Ft=Ft+Math.imul(Yt,jr)|0,Nt=Nt+Math.imul(Yt,mo)|0,Nt=Nt+Math.imul(nn,jr)|0,Ut=Ut+Math.imul(nn,mo)|0,Ft=Ft+Math.imul(Ht,Pn)|0,Nt=Nt+Math.imul(Ht,un)|0,Nt=Nt+Math.imul(Qt,Pn)|0,Ut=Ut+Math.imul(Qt,un)|0;var Zr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,Ft=Math.imul(cn,Bn),Nt=Math.imul(cn,Xn),Nt=Nt+Math.imul(Xt,Bn)|0,Ut=Math.imul(Xt,Xn),Ft=Ft+Math.imul(fn,Gn)|0,Nt=Nt+Math.imul(fn,zn)|0,Nt=Nt+Math.imul(xn,Gn)|0,Ut=Ut+Math.imul(xn,zn)|0,Ft=Ft+Math.imul(In,Wn)|0,Nt=Nt+Math.imul(In,fr)|0,Nt=Nt+Math.imul(yn,Wn)|0,Ut=Ut+Math.imul(yn,fr)|0,Ft=Ft+Math.imul(sn,wr)|0,Nt=Nt+Math.imul(sn,Xr)|0,Nt=Nt+Math.imul(pn,wr)|0,Ut=Ut+Math.imul(pn,Xr)|0,Ft=Ft+Math.imul($n,Ir)|0,Nt=Nt+Math.imul($n,Gr)|0,Nt=Nt+Math.imul(Nn,Ir)|0,Ut=Ut+Math.imul(Nn,Gr)|0,Ft=Ft+Math.imul(Jt,Lr)|0,Nt=Nt+Math.imul(Jt,oo)|0,Nt=Nt+Math.imul(vn,Lr)|0,Ut=Ut+Math.imul(vn,oo)|0,Ft=Ft+Math.imul(dn,jr)|0,Nt=Nt+Math.imul(dn,mo)|0,Nt=Nt+Math.imul(wn,jr)|0,Ut=Ut+Math.imul(wn,mo)|0,Ft=Ft+Math.imul(Yt,Pn)|0,Nt=Nt+Math.imul(Yt,un)|0,Nt=Nt+Math.imul(nn,Pn)|0,Ut=Ut+Math.imul(nn,un)|0,Ft=Ft+Math.imul(Ht,Sn)|0,Nt=Nt+Math.imul(Ht,Dn)|0,Nt=Nt+Math.imul(Qt,Sn)|0,Ut=Ut+Math.imul(Qt,Dn)|0;var Jr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Ft=Math.imul(kn,Bn),Nt=Math.imul(kn,Xn),Nt=Nt+Math.imul(Mn,Bn)|0,Ut=Math.imul(Mn,Xn),Ft=Ft+Math.imul(cn,Gn)|0,Nt=Nt+Math.imul(cn,zn)|0,Nt=Nt+Math.imul(Xt,Gn)|0,Ut=Ut+Math.imul(Xt,zn)|0,Ft=Ft+Math.imul(fn,Wn)|0,Nt=Nt+Math.imul(fn,fr)|0,Nt=Nt+Math.imul(xn,Wn)|0,Ut=Ut+Math.imul(xn,fr)|0,Ft=Ft+Math.imul(In,wr)|0,Nt=Nt+Math.imul(In,Xr)|0,Nt=Nt+Math.imul(yn,wr)|0,Ut=Ut+Math.imul(yn,Xr)|0,Ft=Ft+Math.imul(sn,Ir)|0,Nt=Nt+Math.imul(sn,Gr)|0,Nt=Nt+Math.imul(pn,Ir)|0,Ut=Ut+Math.imul(pn,Gr)|0,Ft=Ft+Math.imul($n,Lr)|0,Nt=Nt+Math.imul($n,oo)|0,Nt=Nt+Math.imul(Nn,Lr)|0,Ut=Ut+Math.imul(Nn,oo)|0,Ft=Ft+Math.imul(Jt,jr)|0,Nt=Nt+Math.imul(Jt,mo)|0,Nt=Nt+Math.imul(vn,jr)|0,Ut=Ut+Math.imul(vn,mo)|0,Ft=Ft+Math.imul(dn,Pn)|0,Nt=Nt+Math.imul(dn,un)|0,Nt=Nt+Math.imul(wn,Pn)|0,Ut=Ut+Math.imul(wn,un)|0,Ft=Ft+Math.imul(Yt,Sn)|0,Nt=Nt+Math.imul(Yt,Dn)|0,Nt=Nt+Math.imul(nn,Sn)|0,Ut=Ut+Math.imul(nn,Dn)|0,Ft=Ft+Math.imul(Ht,Yn)|0,Nt=Nt+Math.imul(Ht,tr)|0,Nt=Nt+Math.imul(Qt,Yn)|0,Ut=Ut+Math.imul(Qt,tr)|0;var br=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(br>>>26)|0,br&=67108863,Ft=Math.imul(kn,Gn),Nt=Math.imul(kn,zn),Nt=Nt+Math.imul(Mn,Gn)|0,Ut=Math.imul(Mn,zn),Ft=Ft+Math.imul(cn,Wn)|0,Nt=Nt+Math.imul(cn,fr)|0,Nt=Nt+Math.imul(Xt,Wn)|0,Ut=Ut+Math.imul(Xt,fr)|0,Ft=Ft+Math.imul(fn,wr)|0,Nt=Nt+Math.imul(fn,Xr)|0,Nt=Nt+Math.imul(xn,wr)|0,Ut=Ut+Math.imul(xn,Xr)|0,Ft=Ft+Math.imul(In,Ir)|0,Nt=Nt+Math.imul(In,Gr)|0,Nt=Nt+Math.imul(yn,Ir)|0,Ut=Ut+Math.imul(yn,Gr)|0,Ft=Ft+Math.imul(sn,Lr)|0,Nt=Nt+Math.imul(sn,oo)|0,Nt=Nt+Math.imul(pn,Lr)|0,Ut=Ut+Math.imul(pn,oo)|0,Ft=Ft+Math.imul($n,jr)|0,Nt=Nt+Math.imul($n,mo)|0,Nt=Nt+Math.imul(Nn,jr)|0,Ut=Ut+Math.imul(Nn,mo)|0,Ft=Ft+Math.imul(Jt,Pn)|0,Nt=Nt+Math.imul(Jt,un)|0,Nt=Nt+Math.imul(vn,Pn)|0,Ut=Ut+Math.imul(vn,un)|0,Ft=Ft+Math.imul(dn,Sn)|0,Nt=Nt+Math.imul(dn,Dn)|0,Nt=Nt+Math.imul(wn,Sn)|0,Ut=Ut+Math.imul(wn,Dn)|0,Ft=Ft+Math.imul(Yt,Yn)|0,Nt=Nt+Math.imul(Yt,tr)|0,Nt=Nt+Math.imul(nn,Yn)|0,Ut=Ut+Math.imul(nn,tr)|0;var Pr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Ft=Math.imul(kn,Wn),Nt=Math.imul(kn,fr),Nt=Nt+Math.imul(Mn,Wn)|0,Ut=Math.imul(Mn,fr),Ft=Ft+Math.imul(cn,wr)|0,Nt=Nt+Math.imul(cn,Xr)|0,Nt=Nt+Math.imul(Xt,wr)|0,Ut=Ut+Math.imul(Xt,Xr)|0,Ft=Ft+Math.imul(fn,Ir)|0,Nt=Nt+Math.imul(fn,Gr)|0,Nt=Nt+Math.imul(xn,Ir)|0,Ut=Ut+Math.imul(xn,Gr)|0,Ft=Ft+Math.imul(In,Lr)|0,Nt=Nt+Math.imul(In,oo)|0,Nt=Nt+Math.imul(yn,Lr)|0,Ut=Ut+Math.imul(yn,oo)|0,Ft=Ft+Math.imul(sn,jr)|0,Nt=Nt+Math.imul(sn,mo)|0,Nt=Nt+Math.imul(pn,jr)|0,Ut=Ut+Math.imul(pn,mo)|0,Ft=Ft+Math.imul($n,Pn)|0,Nt=Nt+Math.imul($n,un)|0,Nt=Nt+Math.imul(Nn,Pn)|0,Ut=Ut+Math.imul(Nn,un)|0,Ft=Ft+Math.imul(Jt,Sn)|0,Nt=Nt+Math.imul(Jt,Dn)|0,Nt=Nt+Math.imul(vn,Sn)|0,Ut=Ut+Math.imul(vn,Dn)|0,Ft=Ft+Math.imul(dn,Yn)|0,Nt=Nt+Math.imul(dn,tr)|0,Nt=Nt+Math.imul(wn,Yn)|0,Ut=Ut+Math.imul(wn,tr)|0;var Fr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Ft=Math.imul(kn,wr),Nt=Math.imul(kn,Xr),Nt=Nt+Math.imul(Mn,wr)|0,Ut=Math.imul(Mn,Xr),Ft=Ft+Math.imul(cn,Ir)|0,Nt=Nt+Math.imul(cn,Gr)|0,Nt=Nt+Math.imul(Xt,Ir)|0,Ut=Ut+Math.imul(Xt,Gr)|0,Ft=Ft+Math.imul(fn,Lr)|0,Nt=Nt+Math.imul(fn,oo)|0,Nt=Nt+Math.imul(xn,Lr)|0,Ut=Ut+Math.imul(xn,oo)|0,Ft=Ft+Math.imul(In,jr)|0,Nt=Nt+Math.imul(In,mo)|0,Nt=Nt+Math.imul(yn,jr)|0,Ut=Ut+Math.imul(yn,mo)|0,Ft=Ft+Math.imul(sn,Pn)|0,Nt=Nt+Math.imul(sn,un)|0,Nt=Nt+Math.imul(pn,Pn)|0,Ut=Ut+Math.imul(pn,un)|0,Ft=Ft+Math.imul($n,Sn)|0,Nt=Nt+Math.imul($n,Dn)|0,Nt=Nt+Math.imul(Nn,Sn)|0,Ut=Ut+Math.imul(Nn,Dn)|0,Ft=Ft+Math.imul(Jt,Yn)|0,Nt=Nt+Math.imul(Jt,tr)|0,Nt=Nt+Math.imul(vn,Yn)|0,Ut=Ut+Math.imul(vn,tr)|0;var Mr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,Ft=Math.imul(kn,Ir),Nt=Math.imul(kn,Gr),Nt=Nt+Math.imul(Mn,Ir)|0,Ut=Math.imul(Mn,Gr),Ft=Ft+Math.imul(cn,Lr)|0,Nt=Nt+Math.imul(cn,oo)|0,Nt=Nt+Math.imul(Xt,Lr)|0,Ut=Ut+Math.imul(Xt,oo)|0,Ft=Ft+Math.imul(fn,jr)|0,Nt=Nt+Math.imul(fn,mo)|0,Nt=Nt+Math.imul(xn,jr)|0,Ut=Ut+Math.imul(xn,mo)|0,Ft=Ft+Math.imul(In,Pn)|0,Nt=Nt+Math.imul(In,un)|0,Nt=Nt+Math.imul(yn,Pn)|0,Ut=Ut+Math.imul(yn,un)|0,Ft=Ft+Math.imul(sn,Sn)|0,Nt=Nt+Math.imul(sn,Dn)|0,Nt=Nt+Math.imul(pn,Sn)|0,Ut=Ut+Math.imul(pn,Dn)|0,Ft=Ft+Math.imul($n,Yn)|0,Nt=Nt+Math.imul($n,tr)|0,Nt=Nt+Math.imul(Nn,Yn)|0,Ut=Ut+Math.imul(Nn,tr)|0;var Cr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Ft=Math.imul(kn,Lr),Nt=Math.imul(kn,oo),Nt=Nt+Math.imul(Mn,Lr)|0,Ut=Math.imul(Mn,oo),Ft=Ft+Math.imul(cn,jr)|0,Nt=Nt+Math.imul(cn,mo)|0,Nt=Nt+Math.imul(Xt,jr)|0,Ut=Ut+Math.imul(Xt,mo)|0,Ft=Ft+Math.imul(fn,Pn)|0,Nt=Nt+Math.imul(fn,un)|0,Nt=Nt+Math.imul(xn,Pn)|0,Ut=Ut+Math.imul(xn,un)|0,Ft=Ft+Math.imul(In,Sn)|0,Nt=Nt+Math.imul(In,Dn)|0,Nt=Nt+Math.imul(yn,Sn)|0,Ut=Ut+Math.imul(yn,Dn)|0,Ft=Ft+Math.imul(sn,Yn)|0,Nt=Nt+Math.imul(sn,tr)|0,Nt=Nt+Math.imul(pn,Yn)|0,Ut=Ut+Math.imul(pn,tr)|0;var Dr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Ft=Math.imul(kn,jr),Nt=Math.imul(kn,mo),Nt=Nt+Math.imul(Mn,jr)|0,Ut=Math.imul(Mn,mo),Ft=Ft+Math.imul(cn,Pn)|0,Nt=Nt+Math.imul(cn,un)|0,Nt=Nt+Math.imul(Xt,Pn)|0,Ut=Ut+Math.imul(Xt,un)|0,Ft=Ft+Math.imul(fn,Sn)|0,Nt=Nt+Math.imul(fn,Dn)|0,Nt=Nt+Math.imul(xn,Sn)|0,Ut=Ut+Math.imul(xn,Dn)|0,Ft=Ft+Math.imul(In,Yn)|0,Nt=Nt+Math.imul(In,tr)|0,Nt=Nt+Math.imul(yn,Yn)|0,Ut=Ut+Math.imul(yn,tr)|0;var Ur=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,Ft=Math.imul(kn,Pn),Nt=Math.imul(kn,un),Nt=Nt+Math.imul(Mn,Pn)|0,Ut=Math.imul(Mn,un),Ft=Ft+Math.imul(cn,Sn)|0,Nt=Nt+Math.imul(cn,Dn)|0,Nt=Nt+Math.imul(Xt,Sn)|0,Ut=Ut+Math.imul(Xt,Dn)|0,Ft=Ft+Math.imul(fn,Yn)|0,Nt=Nt+Math.imul(fn,tr)|0,Nt=Nt+Math.imul(xn,Yn)|0,Ut=Ut+Math.imul(xn,tr)|0;var Rr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,Ft=Math.imul(kn,Sn),Nt=Math.imul(kn,Dn),Nt=Nt+Math.imul(Mn,Sn)|0,Ut=Math.imul(Mn,Dn),Ft=Ft+Math.imul(cn,Yn)|0,Nt=Nt+Math.imul(cn,tr)|0,Nt=Nt+Math.imul(Xt,Yn)|0,Ut=Ut+Math.imul(Xt,tr)|0;var er=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(er>>>26)|0,er&=67108863,Ft=Math.imul(kn,Yn),Nt=Math.imul(kn,tr),Nt=Nt+Math.imul(Mn,Yn)|0,Ut=Math.imul(Mn,tr);var rr=(zt+Ft|0)+((Nt&8191)<<13)|0;return zt=(Ut+(Nt>>>13)|0)+(rr>>>26)|0,rr&=67108863,Wt[0]=ar,Wt[1]=lr,Wt[2]=Vr,Wt[3]=vr,Wt[4]=Nr,Wt[5]=Hr,Wt[6]=eo,Wt[7]=Zr,Wt[8]=Jr,Wt[9]=br,Wt[10]=Pr,Wt[11]=Fr,Wt[12]=Mr,Wt[13]=Cr,Wt[14]=Dr,Wt[15]=Ur,Wt[16]=Rr,Wt[17]=er,Wt[18]=rr,zt!==0&&(Wt[19]=zt,vt.length++),vt};Math.imul||(gt=mt);function yt(jt,Rt,$t){$t.negative=Rt.negative^jt.negative,$t.length=jt.length+Rt.length;for(var vt=0,It=0,Ot=0;Ot<$t.length-1;Ot++){var Wt=It;It=0;for(var zt=vt&67108863,Ft=Math.min(Ot,Rt.length-1),Nt=Math.max(0,Ot-jt.length+1);Nt<=Ft;Nt++){var Ut=Ot-Nt,Pt=jt.words[Ut]|0,Ht=Rt.words[Nt]|0,Qt=Pt*Ht,an=Qt&67108863;Wt=Wt+(Qt/67108864|0)|0,an=an+zt|0,zt=an&67108863,Wt=Wt+(an>>>26)|0,It+=Wt>>>26,Wt&=67108863}$t.words[Ot]=zt,vt=Wt,Wt=It}return vt!==0?$t.words[Ot]=vt:$t.length--,$t.strip()}function bt(jt,Rt,$t){var vt=new wt;return vt.mulp(jt,Rt,$t)}ot.prototype.mulTo=function(Rt,$t){var vt,It=this.length+Rt.length;return this.length===10&&Rt.length===10?vt=gt(this,Rt,$t):It<63?vt=mt(this,Rt,$t):It<1024?vt=yt(this,Rt,$t):vt=bt(this,Rt,$t),vt};function wt(jt,Rt){this.x=jt,this.y=Rt}wt.prototype.makeRBT=function(Rt){for(var $t=new Array(Rt),vt=ot.prototype._countBits(Rt)-1,It=0;It>=1;return It},wt.prototype.permute=function(Rt,$t,vt,It,Ot,Wt){for(var zt=0;zt>>1)Ot++;return 1<>>13,vt[2*Wt+1]=Ot&8191,Ot=Ot>>>13;for(Wt=2*$t;Wt>=26,$t+=It/67108864|0,$t+=Ot>>>26,this.words[vt]=Ot&67108863}return $t!==0&&(this.words[vt]=$t,this.length++),this},ot.prototype.muln=function(Rt){return this.clone().imuln(Rt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(Rt){var $t=pt(Rt);if($t.length===0)return new ot(1);for(var vt=this,It=0;It<$t.length&&$t[It]===0;It++,vt=vt.sqr());if(++It<$t.length)for(var Ot=vt.sqr();It<$t.length;It++,Ot=Ot.sqr())$t[It]!==0&&(vt=vt.mul(Ot));return vt},ot.prototype.iushln=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Rt%26,vt=(Rt-$t)/26,It=67108863>>>26-$t<<26-$t,Ot;if($t!==0){var Wt=0;for(Ot=0;Ot>>26-$t}Wt&&(this.words[Ot]=Wt,this.length++)}if(vt!==0){for(Ot=this.length-1;Ot>=0;Ot--)this.words[Ot+vt]=this.words[Ot];for(Ot=0;Ot=0);var It;$t?It=($t-$t%26)/26:It=0;var Ot=Rt%26,Wt=Math.min((Rt-Ot)/26,this.length),zt=67108863^67108863>>>Ot<Wt)for(this.length-=Wt,Nt=0;Nt=0&&(Ut!==0||Nt>=It);Nt--){var Pt=this.words[Nt]|0;this.words[Nt]=Ut<<26-Ot|Pt>>>Ot,Ut=Pt&zt}return Ft&&Ut!==0&&(Ft.words[Ft.length++]=Ut),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},ot.prototype.ishrn=function(Rt,$t,vt){return rt(this.negative===0),this.iushrn(Rt,$t,vt)},ot.prototype.shln=function(Rt){return this.clone().ishln(Rt)},ot.prototype.ushln=function(Rt){return this.clone().iushln(Rt)},ot.prototype.shrn=function(Rt){return this.clone().ishrn(Rt)},ot.prototype.ushrn=function(Rt){return this.clone().iushrn(Rt)},ot.prototype.testn=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Rt%26,vt=(Rt-$t)/26,It=1<<$t;if(this.length<=vt)return!1;var Ot=this.words[vt];return!!(Ot&It)},ot.prototype.imaskn=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Rt%26,vt=(Rt-$t)/26;if(rt(this.negative===0,"imaskn works only with positive numbers"),this.length<=vt)return this;if($t!==0&&vt++,this.length=Math.min(vt,this.length),$t!==0){var It=67108863^67108863>>>$t<<$t;this.words[this.length-1]&=It}return this.strip()},ot.prototype.maskn=function(Rt){return this.clone().imaskn(Rt)},ot.prototype.iaddn=function(Rt){return rt(typeof Rt=="number"),rt(Rt<67108864),Rt<0?this.isubn(-Rt):this.negative!==0?this.length===1&&(this.words[0]|0)=67108864;$t++)this.words[$t]-=67108864,$t===this.length-1?this.words[$t+1]=1:this.words[$t+1]++;return this.length=Math.max(this.length,$t+1),this},ot.prototype.isubn=function(Rt){if(rt(typeof Rt=="number"),rt(Rt<67108864),Rt<0)return this.iaddn(-Rt);if(this.negative!==0)return this.negative=0,this.iaddn(Rt),this.negative=1,this;if(this.words[0]-=Rt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var $t=0;$t>26)-(Ft/67108864|0),this.words[Ot+vt]=Wt&67108863}for(;Ot>26,this.words[Ot+vt]=Wt&67108863;if(zt===0)return this.strip();for(rt(zt===-1),zt=0,Ot=0;Ot>26,this.words[Ot]=Wt&67108863;return this.negative=1,this.strip()},ot.prototype._wordDiv=function(Rt,$t){var vt=this.length-Rt.length,It=this.clone(),Ot=Rt,Wt=Ot.words[Ot.length-1]|0,zt=this._countBits(Wt);vt=26-zt,vt!==0&&(Ot=Ot.ushln(vt),It.iushln(vt),Wt=Ot.words[Ot.length-1]|0);var Ft=It.length-Ot.length,Nt;if($t!=="mod"){Nt=new ot(null),Nt.length=Ft+1,Nt.words=new Array(Nt.length);for(var Ut=0;Ut=0;Ht--){var Qt=(It.words[Ot.length+Ht]|0)*67108864+(It.words[Ot.length+Ht-1]|0);for(Qt=Math.min(Qt/Wt|0,67108863),It._ishlnsubmul(Ot,Qt,Ht);It.negative!==0;)Qt--,It.negative=0,It._ishlnsubmul(Ot,1,Ht),It.isZero()||(It.negative^=1);Nt&&(Nt.words[Ht]=Qt)}return Nt&&Nt.strip(),It.strip(),$t!=="div"&&vt!==0&&It.iushrn(vt),{div:Nt||null,mod:It}},ot.prototype.divmod=function(Rt,$t,vt){if(rt(!Rt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var It,Ot,Wt;return this.negative!==0&&Rt.negative===0?(Wt=this.neg().divmod(Rt,$t),$t!=="mod"&&(It=Wt.div.neg()),$t!=="div"&&(Ot=Wt.mod.neg(),vt&&Ot.negative!==0&&Ot.iadd(Rt)),{div:It,mod:Ot}):this.negative===0&&Rt.negative!==0?(Wt=this.divmod(Rt.neg(),$t),$t!=="mod"&&(It=Wt.div.neg()),{div:It,mod:Wt.mod}):this.negative&Rt.negative?(Wt=this.neg().divmod(Rt.neg(),$t),$t!=="div"&&(Ot=Wt.mod.neg(),vt&&Ot.negative!==0&&Ot.isub(Rt)),{div:Wt.div,mod:Ot}):Rt.length>this.length||this.cmp(Rt)<0?{div:new ot(0),mod:this}:Rt.length===1?$t==="div"?{div:this.divn(Rt.words[0]),mod:null}:$t==="mod"?{div:null,mod:new ot(this.modn(Rt.words[0]))}:{div:this.divn(Rt.words[0]),mod:new ot(this.modn(Rt.words[0]))}:this._wordDiv(Rt,$t)},ot.prototype.div=function(Rt){return this.divmod(Rt,"div",!1).div},ot.prototype.mod=function(Rt){return this.divmod(Rt,"mod",!1).mod},ot.prototype.umod=function(Rt){return this.divmod(Rt,"mod",!0).mod},ot.prototype.divRound=function(Rt){var $t=this.divmod(Rt);if($t.mod.isZero())return $t.div;var vt=$t.div.negative!==0?$t.mod.isub(Rt):$t.mod,It=Rt.ushrn(1),Ot=Rt.andln(1),Wt=vt.cmp(It);return Wt<0||Ot===1&&Wt===0?$t.div:$t.div.negative!==0?$t.div.isubn(1):$t.div.iaddn(1)},ot.prototype.modn=function(Rt){rt(Rt<=67108863);for(var $t=(1<<26)%Rt,vt=0,It=this.length-1;It>=0;It--)vt=($t*vt+(this.words[It]|0))%Rt;return vt},ot.prototype.idivn=function(Rt){rt(Rt<=67108863);for(var $t=0,vt=this.length-1;vt>=0;vt--){var It=(this.words[vt]|0)+$t*67108864;this.words[vt]=It/Rt|0,$t=It%Rt}return this.strip()},ot.prototype.divn=function(Rt){return this.clone().idivn(Rt)},ot.prototype.egcd=function(Rt){rt(Rt.negative===0),rt(!Rt.isZero());var $t=this,vt=Rt.clone();$t.negative!==0?$t=$t.umod(Rt):$t=$t.clone();for(var It=new ot(1),Ot=new ot(0),Wt=new ot(0),zt=new ot(1),Ft=0;$t.isEven()&&vt.isEven();)$t.iushrn(1),vt.iushrn(1),++Ft;for(var Nt=vt.clone(),Ut=$t.clone();!$t.isZero();){for(var Pt=0,Ht=1;!($t.words[0]&Ht)&&Pt<26;++Pt,Ht<<=1);if(Pt>0)for($t.iushrn(Pt);Pt-- >0;)(It.isOdd()||Ot.isOdd())&&(It.iadd(Nt),Ot.isub(Ut)),It.iushrn(1),Ot.iushrn(1);for(var Qt=0,an=1;!(vt.words[0]&an)&&Qt<26;++Qt,an<<=1);if(Qt>0)for(vt.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||zt.isOdd())&&(Wt.iadd(Nt),zt.isub(Ut)),Wt.iushrn(1),zt.iushrn(1);$t.cmp(vt)>=0?($t.isub(vt),It.isub(Wt),Ot.isub(zt)):(vt.isub($t),Wt.isub(It),zt.isub(Ot))}return{a:Wt,b:zt,gcd:vt.iushln(Ft)}},ot.prototype._invmp=function(Rt){rt(Rt.negative===0),rt(!Rt.isZero());var $t=this,vt=Rt.clone();$t.negative!==0?$t=$t.umod(Rt):$t=$t.clone();for(var It=new ot(1),Ot=new ot(0),Wt=vt.clone();$t.cmpn(1)>0&&vt.cmpn(1)>0;){for(var zt=0,Ft=1;!($t.words[0]&Ft)&&zt<26;++zt,Ft<<=1);if(zt>0)for($t.iushrn(zt);zt-- >0;)It.isOdd()&&It.iadd(Wt),It.iushrn(1);for(var Nt=0,Ut=1;!(vt.words[0]&Ut)&&Nt<26;++Nt,Ut<<=1);if(Nt>0)for(vt.iushrn(Nt);Nt-- >0;)Ot.isOdd()&&Ot.iadd(Wt),Ot.iushrn(1);$t.cmp(vt)>=0?($t.isub(vt),It.isub(Ot)):(vt.isub($t),Ot.isub(It))}var Pt;return $t.cmpn(1)===0?Pt=It:Pt=Ot,Pt.cmpn(0)<0&&Pt.iadd(Rt),Pt},ot.prototype.gcd=function(Rt){if(this.isZero())return Rt.abs();if(Rt.isZero())return this.abs();var $t=this.clone(),vt=Rt.clone();$t.negative=0,vt.negative=0;for(var It=0;$t.isEven()&&vt.isEven();It++)$t.iushrn(1),vt.iushrn(1);do{for(;$t.isEven();)$t.iushrn(1);for(;vt.isEven();)vt.iushrn(1);var Ot=$t.cmp(vt);if(Ot<0){var Wt=$t;$t=vt,vt=Wt}else if(Ot===0||vt.cmpn(1)===0)break;$t.isub(vt)}while(!0);return vt.iushln(It)},ot.prototype.invm=function(Rt){return this.egcd(Rt).a.umod(Rt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(Rt){return this.words[0]&Rt},ot.prototype.bincn=function(Rt){rt(typeof Rt=="number");var $t=Rt%26,vt=(Rt-$t)/26,It=1<<$t;if(this.length<=vt)return this._expand(vt+1),this.words[vt]|=It,this;for(var Ot=It,Wt=vt;Ot!==0&&Wt>>26,zt&=67108863,this.words[Wt]=zt}return Ot!==0&&(this.words[Wt]=Ot,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(Rt){var $t=Rt<0;if(this.negative!==0&&!$t)return-1;if(this.negative===0&&$t)return 1;this.strip();var vt;if(this.length>1)vt=1;else{$t&&(Rt=-Rt),rt(Rt<=67108863,"Number is too big");var It=this.words[0]|0;vt=It===Rt?0:ItRt.length)return 1;if(this.length=0;vt--){var It=this.words[vt]|0,Ot=Rt.words[vt]|0;if(It!==Ot){ItOt&&($t=1);break}}return $t},ot.prototype.gtn=function(Rt){return this.cmpn(Rt)===1},ot.prototype.gt=function(Rt){return this.cmp(Rt)===1},ot.prototype.gten=function(Rt){return this.cmpn(Rt)>=0},ot.prototype.gte=function(Rt){return this.cmp(Rt)>=0},ot.prototype.ltn=function(Rt){return this.cmpn(Rt)===-1},ot.prototype.lt=function(Rt){return this.cmp(Rt)===-1},ot.prototype.lten=function(Rt){return this.cmpn(Rt)<=0},ot.prototype.lte=function(Rt){return this.cmp(Rt)<=0},ot.prototype.eqn=function(Rt){return this.cmpn(Rt)===0},ot.prototype.eq=function(Rt){return this.cmp(Rt)===0},ot.red=function(Rt){return new Ct(Rt)},ot.prototype.toRed=function(Rt){return rt(!this.red,"Already a number in reduction context"),rt(this.negative===0,"red works only with positives"),Rt.convertTo(this)._forceRed(Rt)},ot.prototype.fromRed=function(){return rt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(Rt){return this.red=Rt,this},ot.prototype.forceRed=function(Rt){return rt(!this.red,"Already a number in reduction context"),this._forceRed(Rt)},ot.prototype.redAdd=function(Rt){return rt(this.red,"redAdd works only with red numbers"),this.red.add(this,Rt)},ot.prototype.redIAdd=function(Rt){return rt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Rt)},ot.prototype.redSub=function(Rt){return rt(this.red,"redSub works only with red numbers"),this.red.sub(this,Rt)},ot.prototype.redISub=function(Rt){return rt(this.red,"redISub works only with red numbers"),this.red.isub(this,Rt)},ot.prototype.redShl=function(Rt){return rt(this.red,"redShl works only with red numbers"),this.red.shl(this,Rt)},ot.prototype.redMul=function(Rt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Rt),this.red.mul(this,Rt)},ot.prototype.redIMul=function(Rt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Rt),this.red.imul(this,Rt)},ot.prototype.redSqr=function(){return rt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return rt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return rt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return rt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return rt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(Rt){return rt(this.red&&!Rt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Rt)};var xt={k256:null,p224:null,p192:null,p25519:null};function kt(jt,Rt){this.name=jt,this.p=new ot(Rt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}kt.prototype._tmp=function(){var Rt=new ot(null);return Rt.words=new Array(Math.ceil(this.n/13)),Rt},kt.prototype.ireduce=function(Rt){var $t=Rt,vt;do this.split($t,this.tmp),$t=this.imulK($t),$t=$t.iadd(this.tmp),vt=$t.bitLength();while(vt>this.n);var It=vt0?$t.isub(this.p):$t.strip!==void 0?$t.strip():$t._strip(),$t},kt.prototype.split=function(Rt,$t){Rt.iushrn(this.n,0,$t)},kt.prototype.imulK=function(Rt){return Rt.imul(this.k)};function St(){kt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}it(St,kt),St.prototype.split=function(Rt,$t){for(var vt=4194303,It=Math.min(Rt.length,9),Ot=0;Ot>>22,Wt=zt}Wt>>>=22,Rt.words[Ot-10]=Wt,Wt===0&&Rt.length>10?Rt.length-=10:Rt.length-=9},St.prototype.imulK=function(Rt){Rt.words[Rt.length]=0,Rt.words[Rt.length+1]=0,Rt.length+=2;for(var $t=0,vt=0;vt>>=26,Rt.words[vt]=Ot,$t=It}return $t!==0&&(Rt.words[Rt.length++]=$t),Rt},ot._prime=function(Rt){if(xt[Rt])return xt[Rt];var $t;if(Rt==="k256")$t=new St;else if(Rt==="p224")$t=new Tt;else if(Rt==="p192")$t=new At;else if(Rt==="p25519")$t=new Et;else throw new Error("Unknown prime "+Rt);return xt[Rt]=$t,$t};function Ct(jt){if(typeof jt=="string"){var Rt=ot._prime(jt);this.m=Rt.p,this.prime=Rt}else rt(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}Ct.prototype._verify1=function(Rt){rt(Rt.negative===0,"red works only with positives"),rt(Rt.red,"red works only with red numbers")},Ct.prototype._verify2=function(Rt,$t){rt((Rt.negative|$t.negative)===0,"red works only with positives"),rt(Rt.red&&Rt.red===$t.red,"red works only with red numbers")},Ct.prototype.imod=function(Rt){return this.prime?this.prime.ireduce(Rt)._forceRed(this):Rt.umod(this.m)._forceRed(this)},Ct.prototype.neg=function(Rt){return Rt.isZero()?Rt.clone():this.m.sub(Rt)._forceRed(this)},Ct.prototype.add=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.add($t);return vt.cmp(this.m)>=0&&vt.isub(this.m),vt._forceRed(this)},Ct.prototype.iadd=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.iadd($t);return vt.cmp(this.m)>=0&&vt.isub(this.m),vt},Ct.prototype.sub=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.sub($t);return vt.cmpn(0)<0&&vt.iadd(this.m),vt._forceRed(this)},Ct.prototype.isub=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.isub($t);return vt.cmpn(0)<0&&vt.iadd(this.m),vt},Ct.prototype.shl=function(Rt,$t){return this._verify1(Rt),this.imod(Rt.ushln($t))},Ct.prototype.imul=function(Rt,$t){return this._verify2(Rt,$t),this.imod(Rt.imul($t))},Ct.prototype.mul=function(Rt,$t){return this._verify2(Rt,$t),this.imod(Rt.mul($t))},Ct.prototype.isqr=function(Rt){return this.imul(Rt,Rt.clone())},Ct.prototype.sqr=function(Rt){return this.mul(Rt,Rt)},Ct.prototype.sqrt=function(Rt){if(Rt.isZero())return Rt.clone();var $t=this.m.andln(3);if(rt($t%2===1),$t===3){var vt=this.m.add(new ot(1)).iushrn(2);return this.pow(Rt,vt)}for(var It=this.m.subn(1),Ot=0;!It.isZero()&&It.andln(1)===0;)Ot++,It.iushrn(1);rt(!It.isZero());var Wt=new ot(1).toRed(this),zt=Wt.redNeg(),Ft=this.m.subn(1).iushrn(1),Nt=this.m.bitLength();for(Nt=new ot(2*Nt*Nt).toRed(this);this.pow(Nt,Ft).cmp(zt)!==0;)Nt.redIAdd(zt);for(var Ut=this.pow(Nt,It),Pt=this.pow(Rt,It.addn(1).iushrn(1)),Ht=this.pow(Rt,It),Qt=Ot;Ht.cmp(Wt)!==0;){for(var an=Ht,Yt=0;an.cmp(Wt)!==0;Yt++)an=an.redSqr();rt(Yt=0;Ot--){for(var Ut=$t.words[Ot],Pt=Nt-1;Pt>=0;Pt--){var Ht=Ut>>Pt&1;if(Wt!==It[0]&&(Wt=this.sqr(Wt)),Ht===0&&zt===0){Ft=0;continue}zt<<=1,zt|=Ht,Ft++,!(Ft!==vt&&(Ot!==0||Pt!==0))&&(Wt=this.mul(Wt,It[zt]),Ft=0,zt=0)}Nt=26}return Wt},Ct.prototype.convertTo=function(Rt){var $t=Rt.umod(this.m);return $t===Rt?$t.clone():$t},Ct.prototype.convertFrom=function(Rt){var $t=Rt.clone();return $t.red=null,$t},ot.mont=function(Rt){return new Lt(Rt)};function Lt(jt){Ct.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it(Lt,Ct),Lt.prototype.convertTo=function(Rt){return this.imod(Rt.ushln(this.shift))},Lt.prototype.convertFrom=function(Rt){var $t=this.imod(Rt.mul(this.rinv));return $t.red=null,$t},Lt.prototype.imul=function(Rt,$t){if(Rt.isZero()||$t.isZero())return Rt.words[0]=0,Rt.length=1,Rt;var vt=Rt.imul($t),It=vt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ot=vt.isub(It).iushrn(this.shift),Wt=Ot;return Ot.cmp(this.m)>=0?Wt=Ot.isub(this.m):Ot.cmpn(0)<0&&(Wt=Ot.iadd(this.m)),Wt._forceRed(this)},Lt.prototype.mul=function(Rt,$t){if(Rt.isZero()||$t.isZero())return new ot(0)._forceRed(this);var vt=Rt.mul($t),It=vt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ot=vt.isub(It).iushrn(this.shift),Wt=Ot;return Ot.cmp(this.m)>=0?Wt=Ot.isub(this.m):Ot.cmpn(0)<0&&(Wt=Ot.iadd(this.m)),Wt._forceRed(this)},Lt.prototype.invm=function(Rt){var $t=this.imod(Rt._invmp(this.m).mul(this.r2));return $t._forceRed(this)}})(tt,commonjsGlobal)})(bn$2);var bnExports$2=bn$2.exports,brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var tt;brorand.exports=function(it){return tt||(tt=new et(null)),tt.generate(it)};function et(rt){this.rand=rt}if(brorand.exports.Rand=et,et.prototype.generate=function(it){return this._rand(it)},et.prototype._rand=function(it){if(this.rand.getBytes)return this.rand.getBytes(it);for(var ot=new Uint8Array(it),at=0;at=0);return st},nt.prototype._randrange=function(it,ot){var at=ot.sub(it);return it.add(this._randbelow(at))},nt.prototype.test=function(it,ot,at){var st=it.bitLength(),lt=tt.mont(it),ct=new tt(1).toRed(lt);ot||(ot=Math.max(1,st/48|0));for(var ut=it.subn(1),ht=0;!ut.testn(ht);ht++);for(var dt=it.shrn(ht),pt=ut.toRed(lt),mt=!0;ot>0;ot--){var gt=this._randrange(new tt(2),ut);at&&at(gt);var yt=gt.toRed(lt).redPow(dt);if(!(yt.cmp(ct)===0||yt.cmp(pt)===0)){for(var bt=1;bt0;ot--){var pt=this._randrange(new tt(2),ct),mt=it.gcd(pt);if(mt.cmpn(1)!==0)return mt;var gt=pt.toRed(st).redPow(ht);if(!(gt.cmp(lt)===0||gt.cmp(dt)===0)){for(var yt=1;ytbt;)xt.ishrn(1);if(xt.isEven()&&xt.iadd(ot),xt.testn(1)||xt.iadd(at),wt.cmp(at)){if(!wt.cmp(st))for(;xt.mod(lt).cmp(ct);)xt.iadd(ht)}else for(;xt.mod(nt).cmp(ut);)xt.iadd(ht);if(kt=xt.shrn(1),mt(kt)&&mt(xt)&>(kt)&>(xt)&&it.test(kt)&&it.test(xt))return xt}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var tt=bnExports$2,et=requireMr(),nt=new et,rt=new tt(24),it=new tt(11),ot=new tt(10),at=new tt(3),st=new tt(7),lt=requireGeneratePrime(),ct=browserExports;dh=mt;function ut(yt,bt){return bt=bt||"utf8",Buffer.isBuffer(yt)||(yt=new Buffer(yt,bt)),this._pub=new tt(yt),this}function ht(yt,bt){return bt=bt||"utf8",Buffer.isBuffer(yt)||(yt=new Buffer(yt,bt)),this._priv=new tt(yt),this}var dt={};function pt(yt,bt){var wt=bt.toString("hex"),xt=[wt,yt.toString(16)].join("_");if(xt in dt)return dt[xt];var kt=0;if(yt.isEven()||!lt.simpleSieve||!lt.fermatTest(yt)||!nt.test(yt))return kt+=1,wt==="02"||wt==="05"?kt+=8:kt+=4,dt[xt]=kt,kt;nt.test(yt.shrn(1))||(kt+=2);var St;switch(wt){case"02":yt.mod(rt).cmp(it)&&(kt+=8);break;case"05":St=yt.mod(ot),St.cmp(at)&&St.cmp(st)&&(kt+=8);break;default:kt+=4}return dt[xt]=kt,kt}function mt(yt,bt,wt){this.setGenerator(bt),this.__prime=new tt(yt),this._prime=tt.mont(this.__prime),this._primeLen=yt.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,wt?(this.setPublicKey=ut,this.setPrivateKey=ht):this._primeCode=8}Object.defineProperty(mt.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=pt(this.__prime,this.__gen)),this._primeCode}}),mt.prototype.generateKeys=function(){return this._priv||(this._priv=new tt(ct(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},mt.prototype.computeSecret=function(yt){yt=new tt(yt),yt=yt.toRed(this._prime);var bt=yt.redPow(this._priv).fromRed(),wt=new Buffer(bt.toArray()),xt=this.getPrime();if(wt.length0?vt:It},ot.min=function(vt,It){return vt.cmp(It)<0?vt:It},ot.prototype._init=function(vt,It,Ot){if(typeof vt=="number")return this._initNumber(vt,It,Ot);if(typeof vt=="object")return this._initArray(vt,It,Ot);It==="hex"&&(It=16),rt(It===(It|0)&&It>=2&&It<=36),vt=vt.toString().replace(/\s+/g,"");var Wt=0;vt[0]==="-"&&(Wt++,this.negative=1),Wt=0;Wt-=3)Ft=vt[Wt]|vt[Wt-1]<<8|vt[Wt-2]<<16,this.words[zt]|=Ft<>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);else if(Ot==="le")for(Wt=0,zt=0;Wt>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);return this._strip()};function st($t,vt){var It=$t.charCodeAt(vt);if(It>=48&&It<=57)return It-48;if(It>=65&&It<=70)return It-55;if(It>=97&&It<=102)return It-87;rt(!1,"Invalid character in "+$t)}function lt($t,vt,It){var Ot=st($t,It);return It-1>=vt&&(Ot|=st($t,It-1)<<4),Ot}ot.prototype._parseHex=function(vt,It,Ot){this.length=Math.ceil((vt.length-It)/6),this.words=new Array(this.length);for(var Wt=0;Wt=It;Wt-=2)Nt=lt(vt,It,Wt)<=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8;else{var Ut=vt.length-It;for(Wt=Ut%2===0?It+1:It;Wt=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8}this._strip()};function ct($t,vt,It,Ot){for(var Wt=0,zt=0,Ft=Math.min($t.length,It),Nt=vt;Nt=49?zt=Ut-49+10:Ut>=17?zt=Ut-17+10:zt=Ut,rt(Ut>=0&&zt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(vt,It){vt=vt||10,It=It|0||1;var Ot;if(vt===16||vt==="hex"){Ot="";for(var Wt=0,zt=0,Ft=0;Ft>>24-Wt&16777215,Wt+=2,Wt>=26&&(Wt-=26,Ft--),zt!==0||Ft!==this.length-1?Ot=dt[6-Ut.length]+Ut+Ot:Ot=Ut+Ot}for(zt!==0&&(Ot=zt.toString(16)+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}if(vt===(vt|0)&&vt>=2&&vt<=36){var Pt=pt[vt],Ht=mt[vt];Ot="";var Qt=this.clone();for(Qt.negative=0;!Qt.isZero();){var an=Qt.modrn(Ht).toString(vt);Qt=Qt.idivn(Ht),Qt.isZero()?Ot=an+Ot:Ot=dt[Pt-an.length]+an+Ot}for(this.isZero()&&(Ot="0"+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}rt(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var vt=this.words[0];return this.length===2?vt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?vt+=4503599627370496+this.words[1]*67108864:this.length>2&&rt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-vt:vt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(vt,It){return this.toArrayLike(at,vt,It)}),ot.prototype.toArray=function(vt,It){return this.toArrayLike(Array,vt,It)};var gt=function(vt,It){return vt.allocUnsafe?vt.allocUnsafe(It):new vt(It)};ot.prototype.toArrayLike=function(vt,It,Ot){this._strip();var Wt=this.byteLength(),zt=Ot||Math.max(1,Wt);rt(Wt<=zt,"byte array longer than desired length"),rt(zt>0,"Requested array length <= 0");var Ft=gt(vt,zt),Nt=It==="le"?"LE":"BE";return this["_toArrayLike"+Nt](Ft,Wt),Ft},ot.prototype._toArrayLikeLE=function(vt,It){for(var Ot=0,Wt=0,zt=0,Ft=0;zt>8&255),Ot>16&255),Ft===6?(Ot>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot=0&&(vt[Ot--]=Nt>>8&255),Ot>=0&&(vt[Ot--]=Nt>>16&255),Ft===6?(Ot>=0&&(vt[Ot--]=Nt>>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot>=0)for(vt[Ot--]=Wt;Ot>=0;)vt[Ot--]=0},Math.clz32?ot.prototype._countBits=function(vt){return 32-Math.clz32(vt)}:ot.prototype._countBits=function(vt){var It=vt,Ot=0;return It>=4096&&(Ot+=13,It>>>=13),It>=64&&(Ot+=7,It>>>=7),It>=8&&(Ot+=4,It>>>=4),It>=2&&(Ot+=2,It>>>=2),Ot+It},ot.prototype._zeroBits=function(vt){if(vt===0)return 26;var It=vt,Ot=0;return It&8191||(Ot+=13,It>>>=13),It&127||(Ot+=7,It>>>=7),It&15||(Ot+=4,It>>>=4),It&3||(Ot+=2,It>>>=2),It&1||Ot++,Ot},ot.prototype.bitLength=function(){var vt=this.words[this.length-1],It=this._countBits(vt);return(this.length-1)*26+It};function yt($t){for(var vt=new Array($t.bitLength()),It=0;It>>Wt&1}return vt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var vt=0,It=0;Itvt.length?this.clone().ior(vt):vt.clone().ior(this)},ot.prototype.uor=function(vt){return this.length>vt.length?this.clone().iuor(vt):vt.clone().iuor(this)},ot.prototype.iuand=function(vt){var It;this.length>vt.length?It=vt:It=this;for(var Ot=0;Otvt.length?this.clone().iand(vt):vt.clone().iand(this)},ot.prototype.uand=function(vt){return this.length>vt.length?this.clone().iuand(vt):vt.clone().iuand(this)},ot.prototype.iuxor=function(vt){var It,Ot;this.length>vt.length?(It=this,Ot=vt):(It=vt,Ot=this);for(var Wt=0;Wtvt.length?this.clone().ixor(vt):vt.clone().ixor(this)},ot.prototype.uxor=function(vt){return this.length>vt.length?this.clone().iuxor(vt):vt.clone().iuxor(this)},ot.prototype.inotn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=Math.ceil(vt/26)|0,Ot=vt%26;this._expand(It),Ot>0&&It--;for(var Wt=0;Wt0&&(this.words[Wt]=~this.words[Wt]&67108863>>26-Ot),this._strip()},ot.prototype.notn=function(vt){return this.clone().inotn(vt)},ot.prototype.setn=function(vt,It){rt(typeof vt=="number"&&vt>=0);var Ot=vt/26|0,Wt=vt%26;return this._expand(Ot+1),It?this.words[Ot]=this.words[Ot]|1<vt.length?(Ot=this,Wt=vt):(Ot=vt,Wt=this);for(var zt=0,Ft=0;Ft>>26;for(;zt!==0&&Ft>>26;if(this.length=Ot.length,zt!==0)this.words[this.length]=zt,this.length++;else if(Ot!==this)for(;Ftvt.length?this.clone().iadd(vt):vt.clone().iadd(this)},ot.prototype.isub=function(vt){if(vt.negative!==0){vt.negative=0;var It=this.iadd(vt);return vt.negative=1,It._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(vt),this.negative=1,this._normSign();var Ot=this.cmp(vt);if(Ot===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Wt,zt;Ot>0?(Wt=this,zt=vt):(Wt=vt,zt=this);for(var Ft=0,Nt=0;Nt>26,this.words[Nt]=It&67108863;for(;Ft!==0&&Nt>26,this.words[Nt]=It&67108863;if(Ft===0&&Nt>>26,Qt=Ut&67108863,an=Math.min(Pt,vt.length-1),Yt=Math.max(0,Pt-$t.length+1);Yt<=an;Yt++){var nn=Pt-Yt|0;Wt=$t.words[nn]|0,zt=vt.words[Yt]|0,Ft=Wt*zt+Qt,Ht+=Ft/67108864|0,Qt=Ft&67108863}It.words[Pt]=Qt|0,Ut=Ht|0}return Ut!==0?It.words[Pt]=Ut|0:It.length--,It._strip()}var wt=function(vt,It,Ot){var Wt=vt.words,zt=It.words,Ft=Ot.words,Nt=0,Ut,Pt,Ht,Qt=Wt[0]|0,an=Qt&8191,Yt=Qt>>>13,nn=Wt[1]|0,tn=nn&8191,dn=nn>>>13,wn=Wt[2]|0,rn=wn&8191,Jt=wn>>>13,vn=Wt[3]|0,Cn=vn&8191,$n=vn>>>13,Nn=Wt[4]|0,En=Nn&8191,sn=Nn>>>13,pn=Wt[5]|0,Tn=pn&8191,In=pn>>>13,yn=Wt[6]|0,hn=yn&8191,fn=yn>>>13,xn=Wt[7]|0,jn=xn&8191,cn=xn>>>13,Xt=Wt[8]|0,Kt=Xt&8191,kn=Xt>>>13,Mn=Wt[9]|0,On=Mn&8191,Bn=Mn>>>13,Xn=zt[0]|0,Vn=Xn&8191,Gn=Xn>>>13,zn=zt[1]|0,Zn=zn&8191,Wn=zn>>>13,fr=zt[2]|0,ur=fr&8191,wr=fr>>>13,Xr=zt[3]|0,Er=Xr&8191,Ir=Xr>>>13,Gr=zt[4]|0,Or=Gr&8191,Lr=Gr>>>13,oo=zt[5]|0,qr=oo&8191,jr=oo>>>13,mo=zt[6]|0,_n=mo&8191,Pn=mo>>>13,un=zt[7]|0,Zt=un&8191,Sn=un>>>13,Dn=zt[8]|0,Fn=Dn&8191,Yn=Dn>>>13,tr=zt[9]|0,ar=tr&8191,lr=tr>>>13;Ot.negative=vt.negative^It.negative,Ot.length=19,Ut=Math.imul(an,Vn),Pt=Math.imul(an,Gn),Pt=Pt+Math.imul(Yt,Vn)|0,Ht=Math.imul(Yt,Gn);var Vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Ut=Math.imul(tn,Vn),Pt=Math.imul(tn,Gn),Pt=Pt+Math.imul(dn,Vn)|0,Ht=Math.imul(dn,Gn),Ut=Ut+Math.imul(an,Zn)|0,Pt=Pt+Math.imul(an,Wn)|0,Pt=Pt+Math.imul(Yt,Zn)|0,Ht=Ht+Math.imul(Yt,Wn)|0;var vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(vr>>>26)|0,vr&=67108863,Ut=Math.imul(rn,Vn),Pt=Math.imul(rn,Gn),Pt=Pt+Math.imul(Jt,Vn)|0,Ht=Math.imul(Jt,Gn),Ut=Ut+Math.imul(tn,Zn)|0,Pt=Pt+Math.imul(tn,Wn)|0,Pt=Pt+Math.imul(dn,Zn)|0,Ht=Ht+Math.imul(dn,Wn)|0,Ut=Ut+Math.imul(an,ur)|0,Pt=Pt+Math.imul(an,wr)|0,Pt=Pt+Math.imul(Yt,ur)|0,Ht=Ht+Math.imul(Yt,wr)|0;var Nr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Ut=Math.imul(Cn,Vn),Pt=Math.imul(Cn,Gn),Pt=Pt+Math.imul($n,Vn)|0,Ht=Math.imul($n,Gn),Ut=Ut+Math.imul(rn,Zn)|0,Pt=Pt+Math.imul(rn,Wn)|0,Pt=Pt+Math.imul(Jt,Zn)|0,Ht=Ht+Math.imul(Jt,Wn)|0,Ut=Ut+Math.imul(tn,ur)|0,Pt=Pt+Math.imul(tn,wr)|0,Pt=Pt+Math.imul(dn,ur)|0,Ht=Ht+Math.imul(dn,wr)|0,Ut=Ut+Math.imul(an,Er)|0,Pt=Pt+Math.imul(an,Ir)|0,Pt=Pt+Math.imul(Yt,Er)|0,Ht=Ht+Math.imul(Yt,Ir)|0;var Hr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Ut=Math.imul(En,Vn),Pt=Math.imul(En,Gn),Pt=Pt+Math.imul(sn,Vn)|0,Ht=Math.imul(sn,Gn),Ut=Ut+Math.imul(Cn,Zn)|0,Pt=Pt+Math.imul(Cn,Wn)|0,Pt=Pt+Math.imul($n,Zn)|0,Ht=Ht+Math.imul($n,Wn)|0,Ut=Ut+Math.imul(rn,ur)|0,Pt=Pt+Math.imul(rn,wr)|0,Pt=Pt+Math.imul(Jt,ur)|0,Ht=Ht+Math.imul(Jt,wr)|0,Ut=Ut+Math.imul(tn,Er)|0,Pt=Pt+Math.imul(tn,Ir)|0,Pt=Pt+Math.imul(dn,Er)|0,Ht=Ht+Math.imul(dn,Ir)|0,Ut=Ut+Math.imul(an,Or)|0,Pt=Pt+Math.imul(an,Lr)|0,Pt=Pt+Math.imul(Yt,Or)|0,Ht=Ht+Math.imul(Yt,Lr)|0;var eo=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ut=Math.imul(Tn,Vn),Pt=Math.imul(Tn,Gn),Pt=Pt+Math.imul(In,Vn)|0,Ht=Math.imul(In,Gn),Ut=Ut+Math.imul(En,Zn)|0,Pt=Pt+Math.imul(En,Wn)|0,Pt=Pt+Math.imul(sn,Zn)|0,Ht=Ht+Math.imul(sn,Wn)|0,Ut=Ut+Math.imul(Cn,ur)|0,Pt=Pt+Math.imul(Cn,wr)|0,Pt=Pt+Math.imul($n,ur)|0,Ht=Ht+Math.imul($n,wr)|0,Ut=Ut+Math.imul(rn,Er)|0,Pt=Pt+Math.imul(rn,Ir)|0,Pt=Pt+Math.imul(Jt,Er)|0,Ht=Ht+Math.imul(Jt,Ir)|0,Ut=Ut+Math.imul(tn,Or)|0,Pt=Pt+Math.imul(tn,Lr)|0,Pt=Pt+Math.imul(dn,Or)|0,Ht=Ht+Math.imul(dn,Lr)|0,Ut=Ut+Math.imul(an,qr)|0,Pt=Pt+Math.imul(an,jr)|0,Pt=Pt+Math.imul(Yt,qr)|0,Ht=Ht+Math.imul(Yt,jr)|0;var Zr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,Ut=Math.imul(hn,Vn),Pt=Math.imul(hn,Gn),Pt=Pt+Math.imul(fn,Vn)|0,Ht=Math.imul(fn,Gn),Ut=Ut+Math.imul(Tn,Zn)|0,Pt=Pt+Math.imul(Tn,Wn)|0,Pt=Pt+Math.imul(In,Zn)|0,Ht=Ht+Math.imul(In,Wn)|0,Ut=Ut+Math.imul(En,ur)|0,Pt=Pt+Math.imul(En,wr)|0,Pt=Pt+Math.imul(sn,ur)|0,Ht=Ht+Math.imul(sn,wr)|0,Ut=Ut+Math.imul(Cn,Er)|0,Pt=Pt+Math.imul(Cn,Ir)|0,Pt=Pt+Math.imul($n,Er)|0,Ht=Ht+Math.imul($n,Ir)|0,Ut=Ut+Math.imul(rn,Or)|0,Pt=Pt+Math.imul(rn,Lr)|0,Pt=Pt+Math.imul(Jt,Or)|0,Ht=Ht+Math.imul(Jt,Lr)|0,Ut=Ut+Math.imul(tn,qr)|0,Pt=Pt+Math.imul(tn,jr)|0,Pt=Pt+Math.imul(dn,qr)|0,Ht=Ht+Math.imul(dn,jr)|0,Ut=Ut+Math.imul(an,_n)|0,Pt=Pt+Math.imul(an,Pn)|0,Pt=Pt+Math.imul(Yt,_n)|0,Ht=Ht+Math.imul(Yt,Pn)|0;var Jr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Ut=Math.imul(jn,Vn),Pt=Math.imul(jn,Gn),Pt=Pt+Math.imul(cn,Vn)|0,Ht=Math.imul(cn,Gn),Ut=Ut+Math.imul(hn,Zn)|0,Pt=Pt+Math.imul(hn,Wn)|0,Pt=Pt+Math.imul(fn,Zn)|0,Ht=Ht+Math.imul(fn,Wn)|0,Ut=Ut+Math.imul(Tn,ur)|0,Pt=Pt+Math.imul(Tn,wr)|0,Pt=Pt+Math.imul(In,ur)|0,Ht=Ht+Math.imul(In,wr)|0,Ut=Ut+Math.imul(En,Er)|0,Pt=Pt+Math.imul(En,Ir)|0,Pt=Pt+Math.imul(sn,Er)|0,Ht=Ht+Math.imul(sn,Ir)|0,Ut=Ut+Math.imul(Cn,Or)|0,Pt=Pt+Math.imul(Cn,Lr)|0,Pt=Pt+Math.imul($n,Or)|0,Ht=Ht+Math.imul($n,Lr)|0,Ut=Ut+Math.imul(rn,qr)|0,Pt=Pt+Math.imul(rn,jr)|0,Pt=Pt+Math.imul(Jt,qr)|0,Ht=Ht+Math.imul(Jt,jr)|0,Ut=Ut+Math.imul(tn,_n)|0,Pt=Pt+Math.imul(tn,Pn)|0,Pt=Pt+Math.imul(dn,_n)|0,Ht=Ht+Math.imul(dn,Pn)|0,Ut=Ut+Math.imul(an,Zt)|0,Pt=Pt+Math.imul(an,Sn)|0,Pt=Pt+Math.imul(Yt,Zt)|0,Ht=Ht+Math.imul(Yt,Sn)|0;var br=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(br>>>26)|0,br&=67108863,Ut=Math.imul(Kt,Vn),Pt=Math.imul(Kt,Gn),Pt=Pt+Math.imul(kn,Vn)|0,Ht=Math.imul(kn,Gn),Ut=Ut+Math.imul(jn,Zn)|0,Pt=Pt+Math.imul(jn,Wn)|0,Pt=Pt+Math.imul(cn,Zn)|0,Ht=Ht+Math.imul(cn,Wn)|0,Ut=Ut+Math.imul(hn,ur)|0,Pt=Pt+Math.imul(hn,wr)|0,Pt=Pt+Math.imul(fn,ur)|0,Ht=Ht+Math.imul(fn,wr)|0,Ut=Ut+Math.imul(Tn,Er)|0,Pt=Pt+Math.imul(Tn,Ir)|0,Pt=Pt+Math.imul(In,Er)|0,Ht=Ht+Math.imul(In,Ir)|0,Ut=Ut+Math.imul(En,Or)|0,Pt=Pt+Math.imul(En,Lr)|0,Pt=Pt+Math.imul(sn,Or)|0,Ht=Ht+Math.imul(sn,Lr)|0,Ut=Ut+Math.imul(Cn,qr)|0,Pt=Pt+Math.imul(Cn,jr)|0,Pt=Pt+Math.imul($n,qr)|0,Ht=Ht+Math.imul($n,jr)|0,Ut=Ut+Math.imul(rn,_n)|0,Pt=Pt+Math.imul(rn,Pn)|0,Pt=Pt+Math.imul(Jt,_n)|0,Ht=Ht+Math.imul(Jt,Pn)|0,Ut=Ut+Math.imul(tn,Zt)|0,Pt=Pt+Math.imul(tn,Sn)|0,Pt=Pt+Math.imul(dn,Zt)|0,Ht=Ht+Math.imul(dn,Sn)|0,Ut=Ut+Math.imul(an,Fn)|0,Pt=Pt+Math.imul(an,Yn)|0,Pt=Pt+Math.imul(Yt,Fn)|0,Ht=Ht+Math.imul(Yt,Yn)|0;var Pr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Ut=Math.imul(On,Vn),Pt=Math.imul(On,Gn),Pt=Pt+Math.imul(Bn,Vn)|0,Ht=Math.imul(Bn,Gn),Ut=Ut+Math.imul(Kt,Zn)|0,Pt=Pt+Math.imul(Kt,Wn)|0,Pt=Pt+Math.imul(kn,Zn)|0,Ht=Ht+Math.imul(kn,Wn)|0,Ut=Ut+Math.imul(jn,ur)|0,Pt=Pt+Math.imul(jn,wr)|0,Pt=Pt+Math.imul(cn,ur)|0,Ht=Ht+Math.imul(cn,wr)|0,Ut=Ut+Math.imul(hn,Er)|0,Pt=Pt+Math.imul(hn,Ir)|0,Pt=Pt+Math.imul(fn,Er)|0,Ht=Ht+Math.imul(fn,Ir)|0,Ut=Ut+Math.imul(Tn,Or)|0,Pt=Pt+Math.imul(Tn,Lr)|0,Pt=Pt+Math.imul(In,Or)|0,Ht=Ht+Math.imul(In,Lr)|0,Ut=Ut+Math.imul(En,qr)|0,Pt=Pt+Math.imul(En,jr)|0,Pt=Pt+Math.imul(sn,qr)|0,Ht=Ht+Math.imul(sn,jr)|0,Ut=Ut+Math.imul(Cn,_n)|0,Pt=Pt+Math.imul(Cn,Pn)|0,Pt=Pt+Math.imul($n,_n)|0,Ht=Ht+Math.imul($n,Pn)|0,Ut=Ut+Math.imul(rn,Zt)|0,Pt=Pt+Math.imul(rn,Sn)|0,Pt=Pt+Math.imul(Jt,Zt)|0,Ht=Ht+Math.imul(Jt,Sn)|0,Ut=Ut+Math.imul(tn,Fn)|0,Pt=Pt+Math.imul(tn,Yn)|0,Pt=Pt+Math.imul(dn,Fn)|0,Ht=Ht+Math.imul(dn,Yn)|0,Ut=Ut+Math.imul(an,ar)|0,Pt=Pt+Math.imul(an,lr)|0,Pt=Pt+Math.imul(Yt,ar)|0,Ht=Ht+Math.imul(Yt,lr)|0;var Fr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Ut=Math.imul(On,Zn),Pt=Math.imul(On,Wn),Pt=Pt+Math.imul(Bn,Zn)|0,Ht=Math.imul(Bn,Wn),Ut=Ut+Math.imul(Kt,ur)|0,Pt=Pt+Math.imul(Kt,wr)|0,Pt=Pt+Math.imul(kn,ur)|0,Ht=Ht+Math.imul(kn,wr)|0,Ut=Ut+Math.imul(jn,Er)|0,Pt=Pt+Math.imul(jn,Ir)|0,Pt=Pt+Math.imul(cn,Er)|0,Ht=Ht+Math.imul(cn,Ir)|0,Ut=Ut+Math.imul(hn,Or)|0,Pt=Pt+Math.imul(hn,Lr)|0,Pt=Pt+Math.imul(fn,Or)|0,Ht=Ht+Math.imul(fn,Lr)|0,Ut=Ut+Math.imul(Tn,qr)|0,Pt=Pt+Math.imul(Tn,jr)|0,Pt=Pt+Math.imul(In,qr)|0,Ht=Ht+Math.imul(In,jr)|0,Ut=Ut+Math.imul(En,_n)|0,Pt=Pt+Math.imul(En,Pn)|0,Pt=Pt+Math.imul(sn,_n)|0,Ht=Ht+Math.imul(sn,Pn)|0,Ut=Ut+Math.imul(Cn,Zt)|0,Pt=Pt+Math.imul(Cn,Sn)|0,Pt=Pt+Math.imul($n,Zt)|0,Ht=Ht+Math.imul($n,Sn)|0,Ut=Ut+Math.imul(rn,Fn)|0,Pt=Pt+Math.imul(rn,Yn)|0,Pt=Pt+Math.imul(Jt,Fn)|0,Ht=Ht+Math.imul(Jt,Yn)|0,Ut=Ut+Math.imul(tn,ar)|0,Pt=Pt+Math.imul(tn,lr)|0,Pt=Pt+Math.imul(dn,ar)|0,Ht=Ht+Math.imul(dn,lr)|0;var Mr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,Ut=Math.imul(On,ur),Pt=Math.imul(On,wr),Pt=Pt+Math.imul(Bn,ur)|0,Ht=Math.imul(Bn,wr),Ut=Ut+Math.imul(Kt,Er)|0,Pt=Pt+Math.imul(Kt,Ir)|0,Pt=Pt+Math.imul(kn,Er)|0,Ht=Ht+Math.imul(kn,Ir)|0,Ut=Ut+Math.imul(jn,Or)|0,Pt=Pt+Math.imul(jn,Lr)|0,Pt=Pt+Math.imul(cn,Or)|0,Ht=Ht+Math.imul(cn,Lr)|0,Ut=Ut+Math.imul(hn,qr)|0,Pt=Pt+Math.imul(hn,jr)|0,Pt=Pt+Math.imul(fn,qr)|0,Ht=Ht+Math.imul(fn,jr)|0,Ut=Ut+Math.imul(Tn,_n)|0,Pt=Pt+Math.imul(Tn,Pn)|0,Pt=Pt+Math.imul(In,_n)|0,Ht=Ht+Math.imul(In,Pn)|0,Ut=Ut+Math.imul(En,Zt)|0,Pt=Pt+Math.imul(En,Sn)|0,Pt=Pt+Math.imul(sn,Zt)|0,Ht=Ht+Math.imul(sn,Sn)|0,Ut=Ut+Math.imul(Cn,Fn)|0,Pt=Pt+Math.imul(Cn,Yn)|0,Pt=Pt+Math.imul($n,Fn)|0,Ht=Ht+Math.imul($n,Yn)|0,Ut=Ut+Math.imul(rn,ar)|0,Pt=Pt+Math.imul(rn,lr)|0,Pt=Pt+Math.imul(Jt,ar)|0,Ht=Ht+Math.imul(Jt,lr)|0;var Cr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Ut=Math.imul(On,Er),Pt=Math.imul(On,Ir),Pt=Pt+Math.imul(Bn,Er)|0,Ht=Math.imul(Bn,Ir),Ut=Ut+Math.imul(Kt,Or)|0,Pt=Pt+Math.imul(Kt,Lr)|0,Pt=Pt+Math.imul(kn,Or)|0,Ht=Ht+Math.imul(kn,Lr)|0,Ut=Ut+Math.imul(jn,qr)|0,Pt=Pt+Math.imul(jn,jr)|0,Pt=Pt+Math.imul(cn,qr)|0,Ht=Ht+Math.imul(cn,jr)|0,Ut=Ut+Math.imul(hn,_n)|0,Pt=Pt+Math.imul(hn,Pn)|0,Pt=Pt+Math.imul(fn,_n)|0,Ht=Ht+Math.imul(fn,Pn)|0,Ut=Ut+Math.imul(Tn,Zt)|0,Pt=Pt+Math.imul(Tn,Sn)|0,Pt=Pt+Math.imul(In,Zt)|0,Ht=Ht+Math.imul(In,Sn)|0,Ut=Ut+Math.imul(En,Fn)|0,Pt=Pt+Math.imul(En,Yn)|0,Pt=Pt+Math.imul(sn,Fn)|0,Ht=Ht+Math.imul(sn,Yn)|0,Ut=Ut+Math.imul(Cn,ar)|0,Pt=Pt+Math.imul(Cn,lr)|0,Pt=Pt+Math.imul($n,ar)|0,Ht=Ht+Math.imul($n,lr)|0;var Dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Ut=Math.imul(On,Or),Pt=Math.imul(On,Lr),Pt=Pt+Math.imul(Bn,Or)|0,Ht=Math.imul(Bn,Lr),Ut=Ut+Math.imul(Kt,qr)|0,Pt=Pt+Math.imul(Kt,jr)|0,Pt=Pt+Math.imul(kn,qr)|0,Ht=Ht+Math.imul(kn,jr)|0,Ut=Ut+Math.imul(jn,_n)|0,Pt=Pt+Math.imul(jn,Pn)|0,Pt=Pt+Math.imul(cn,_n)|0,Ht=Ht+Math.imul(cn,Pn)|0,Ut=Ut+Math.imul(hn,Zt)|0,Pt=Pt+Math.imul(hn,Sn)|0,Pt=Pt+Math.imul(fn,Zt)|0,Ht=Ht+Math.imul(fn,Sn)|0,Ut=Ut+Math.imul(Tn,Fn)|0,Pt=Pt+Math.imul(Tn,Yn)|0,Pt=Pt+Math.imul(In,Fn)|0,Ht=Ht+Math.imul(In,Yn)|0,Ut=Ut+Math.imul(En,ar)|0,Pt=Pt+Math.imul(En,lr)|0,Pt=Pt+Math.imul(sn,ar)|0,Ht=Ht+Math.imul(sn,lr)|0;var Ur=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,Ut=Math.imul(On,qr),Pt=Math.imul(On,jr),Pt=Pt+Math.imul(Bn,qr)|0,Ht=Math.imul(Bn,jr),Ut=Ut+Math.imul(Kt,_n)|0,Pt=Pt+Math.imul(Kt,Pn)|0,Pt=Pt+Math.imul(kn,_n)|0,Ht=Ht+Math.imul(kn,Pn)|0,Ut=Ut+Math.imul(jn,Zt)|0,Pt=Pt+Math.imul(jn,Sn)|0,Pt=Pt+Math.imul(cn,Zt)|0,Ht=Ht+Math.imul(cn,Sn)|0,Ut=Ut+Math.imul(hn,Fn)|0,Pt=Pt+Math.imul(hn,Yn)|0,Pt=Pt+Math.imul(fn,Fn)|0,Ht=Ht+Math.imul(fn,Yn)|0,Ut=Ut+Math.imul(Tn,ar)|0,Pt=Pt+Math.imul(Tn,lr)|0,Pt=Pt+Math.imul(In,ar)|0,Ht=Ht+Math.imul(In,lr)|0;var Rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,Ut=Math.imul(On,_n),Pt=Math.imul(On,Pn),Pt=Pt+Math.imul(Bn,_n)|0,Ht=Math.imul(Bn,Pn),Ut=Ut+Math.imul(Kt,Zt)|0,Pt=Pt+Math.imul(Kt,Sn)|0,Pt=Pt+Math.imul(kn,Zt)|0,Ht=Ht+Math.imul(kn,Sn)|0,Ut=Ut+Math.imul(jn,Fn)|0,Pt=Pt+Math.imul(jn,Yn)|0,Pt=Pt+Math.imul(cn,Fn)|0,Ht=Ht+Math.imul(cn,Yn)|0,Ut=Ut+Math.imul(hn,ar)|0,Pt=Pt+Math.imul(hn,lr)|0,Pt=Pt+Math.imul(fn,ar)|0,Ht=Ht+Math.imul(fn,lr)|0;var er=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(er>>>26)|0,er&=67108863,Ut=Math.imul(On,Zt),Pt=Math.imul(On,Sn),Pt=Pt+Math.imul(Bn,Zt)|0,Ht=Math.imul(Bn,Sn),Ut=Ut+Math.imul(Kt,Fn)|0,Pt=Pt+Math.imul(Kt,Yn)|0,Pt=Pt+Math.imul(kn,Fn)|0,Ht=Ht+Math.imul(kn,Yn)|0,Ut=Ut+Math.imul(jn,ar)|0,Pt=Pt+Math.imul(jn,lr)|0,Pt=Pt+Math.imul(cn,ar)|0,Ht=Ht+Math.imul(cn,lr)|0;var rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(rr>>>26)|0,rr&=67108863,Ut=Math.imul(On,Fn),Pt=Math.imul(On,Yn),Pt=Pt+Math.imul(Bn,Fn)|0,Ht=Math.imul(Bn,Yn),Ut=Ut+Math.imul(Kt,ar)|0,Pt=Pt+Math.imul(Kt,lr)|0,Pt=Pt+Math.imul(kn,ar)|0,Ht=Ht+Math.imul(kn,lr)|0;var xr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Ut=Math.imul(On,ar),Pt=Math.imul(On,lr),Pt=Pt+Math.imul(Bn,ar)|0,Ht=Math.imul(Bn,lr);var dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;return Nt=(Ht+(Pt>>>13)|0)+(dr>>>26)|0,dr&=67108863,Ft[0]=Vr,Ft[1]=vr,Ft[2]=Nr,Ft[3]=Hr,Ft[4]=eo,Ft[5]=Zr,Ft[6]=Jr,Ft[7]=br,Ft[8]=Pr,Ft[9]=Fr,Ft[10]=Mr,Ft[11]=Cr,Ft[12]=Dr,Ft[13]=Ur,Ft[14]=Rr,Ft[15]=er,Ft[16]=rr,Ft[17]=xr,Ft[18]=dr,Nt!==0&&(Ft[19]=Nt,Ot.length++),Ot};Math.imul||(wt=bt);function xt($t,vt,It){It.negative=vt.negative^$t.negative,It.length=$t.length+vt.length;for(var Ot=0,Wt=0,zt=0;zt>>26)|0,Wt+=Ft>>>26,Ft&=67108863}It.words[zt]=Nt,Ot=Ft,Ft=Wt}return Ot!==0?It.words[zt]=Ot:It.length--,It._strip()}function kt($t,vt,It){return xt($t,vt,It)}ot.prototype.mulTo=function(vt,It){var Ot,Wt=this.length+vt.length;return this.length===10&&vt.length===10?Ot=wt(this,vt,It):Wt<63?Ot=bt(this,vt,It):Wt<1024?Ot=xt(this,vt,It):Ot=kt(this,vt,It),Ot},ot.prototype.mul=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),this.mulTo(vt,It)},ot.prototype.mulf=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),kt(this,vt,It)},ot.prototype.imul=function(vt){return this.clone().mulTo(vt,this)},ot.prototype.imuln=function(vt){var It=vt<0;It&&(vt=-vt),rt(typeof vt=="number"),rt(vt<67108864);for(var Ot=0,Wt=0;Wt>=26,Ot+=zt/67108864|0,Ot+=Ft>>>26,this.words[Wt]=Ft&67108863}return Ot!==0&&(this.words[Wt]=Ot,this.length++),It?this.ineg():this},ot.prototype.muln=function(vt){return this.clone().imuln(vt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(vt){var It=yt(vt);if(It.length===0)return new ot(1);for(var Ot=this,Wt=0;Wt=0);var It=vt%26,Ot=(vt-It)/26,Wt=67108863>>>26-It<<26-It,zt;if(It!==0){var Ft=0;for(zt=0;zt>>26-It}Ft&&(this.words[zt]=Ft,this.length++)}if(Ot!==0){for(zt=this.length-1;zt>=0;zt--)this.words[zt+Ot]=this.words[zt];for(zt=0;zt=0);var Wt;It?Wt=(It-It%26)/26:Wt=0;var zt=vt%26,Ft=Math.min((vt-zt)/26,this.length),Nt=67108863^67108863>>>zt<Ft)for(this.length-=Ft,Pt=0;Pt=0&&(Ht!==0||Pt>=Wt);Pt--){var Qt=this.words[Pt]|0;this.words[Pt]=Ht<<26-zt|Qt>>>zt,Ht=Qt&Nt}return Ut&&Ht!==0&&(Ut.words[Ut.length++]=Ht),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(vt,It,Ot){return rt(this.negative===0),this.iushrn(vt,It,Ot)},ot.prototype.shln=function(vt){return this.clone().ishln(vt)},ot.prototype.ushln=function(vt){return this.clone().iushln(vt)},ot.prototype.shrn=function(vt){return this.clone().ishrn(vt)},ot.prototype.ushrn=function(vt){return this.clone().iushrn(vt)},ot.prototype.testn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=vt%26,Ot=(vt-It)/26,Wt=1<=0);var It=vt%26,Ot=(vt-It)/26;if(rt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ot)return this;if(It!==0&&Ot++,this.length=Math.min(Ot,this.length),It!==0){var Wt=67108863^67108863>>>It<=67108864;It++)this.words[It]-=67108864,It===this.length-1?this.words[It+1]=1:this.words[It+1]++;return this.length=Math.max(this.length,It+1),this},ot.prototype.isubn=function(vt){if(rt(typeof vt=="number"),rt(vt<67108864),vt<0)return this.iaddn(-vt);if(this.negative!==0)return this.negative=0,this.iaddn(vt),this.negative=1,this;if(this.words[0]-=vt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var It=0;It>26)-(Ut/67108864|0),this.words[zt+Ot]=Ft&67108863}for(;zt>26,this.words[zt+Ot]=Ft&67108863;if(Nt===0)return this._strip();for(rt(Nt===-1),Nt=0,zt=0;zt>26,this.words[zt]=Ft&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(vt,It){var Ot=this.length-vt.length,Wt=this.clone(),zt=vt,Ft=zt.words[zt.length-1]|0,Nt=this._countBits(Ft);Ot=26-Nt,Ot!==0&&(zt=zt.ushln(Ot),Wt.iushln(Ot),Ft=zt.words[zt.length-1]|0);var Ut=Wt.length-zt.length,Pt;if(It!=="mod"){Pt=new ot(null),Pt.length=Ut+1,Pt.words=new Array(Pt.length);for(var Ht=0;Ht=0;an--){var Yt=(Wt.words[zt.length+an]|0)*67108864+(Wt.words[zt.length+an-1]|0);for(Yt=Math.min(Yt/Ft|0,67108863),Wt._ishlnsubmul(zt,Yt,an);Wt.negative!==0;)Yt--,Wt.negative=0,Wt._ishlnsubmul(zt,1,an),Wt.isZero()||(Wt.negative^=1);Pt&&(Pt.words[an]=Yt)}return Pt&&Pt._strip(),Wt._strip(),It!=="div"&&Ot!==0&&Wt.iushrn(Ot),{div:Pt||null,mod:Wt}},ot.prototype.divmod=function(vt,It,Ot){if(rt(!vt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Wt,zt,Ft;return this.negative!==0&&vt.negative===0?(Ft=this.neg().divmod(vt,It),It!=="mod"&&(Wt=Ft.div.neg()),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.iadd(vt)),{div:Wt,mod:zt}):this.negative===0&&vt.negative!==0?(Ft=this.divmod(vt.neg(),It),It!=="mod"&&(Wt=Ft.div.neg()),{div:Wt,mod:Ft.mod}):this.negative&vt.negative?(Ft=this.neg().divmod(vt.neg(),It),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.isub(vt)),{div:Ft.div,mod:zt}):vt.length>this.length||this.cmp(vt)<0?{div:new ot(0),mod:this}:vt.length===1?It==="div"?{div:this.divn(vt.words[0]),mod:null}:It==="mod"?{div:null,mod:new ot(this.modrn(vt.words[0]))}:{div:this.divn(vt.words[0]),mod:new ot(this.modrn(vt.words[0]))}:this._wordDiv(vt,It)},ot.prototype.div=function(vt){return this.divmod(vt,"div",!1).div},ot.prototype.mod=function(vt){return this.divmod(vt,"mod",!1).mod},ot.prototype.umod=function(vt){return this.divmod(vt,"mod",!0).mod},ot.prototype.divRound=function(vt){var It=this.divmod(vt);if(It.mod.isZero())return It.div;var Ot=It.div.negative!==0?It.mod.isub(vt):It.mod,Wt=vt.ushrn(1),zt=vt.andln(1),Ft=Ot.cmp(Wt);return Ft<0||zt===1&&Ft===0?It.div:It.div.negative!==0?It.div.isubn(1):It.div.iaddn(1)},ot.prototype.modrn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=(1<<26)%vt,Wt=0,zt=this.length-1;zt>=0;zt--)Wt=(Ot*Wt+(this.words[zt]|0))%vt;return It?-Wt:Wt},ot.prototype.modn=function(vt){return this.modrn(vt)},ot.prototype.idivn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=0,Wt=this.length-1;Wt>=0;Wt--){var zt=(this.words[Wt]|0)+Ot*67108864;this.words[Wt]=zt/vt|0,Ot=zt%vt}return this._strip(),It?this.ineg():this},ot.prototype.divn=function(vt){return this.clone().idivn(vt)},ot.prototype.egcd=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=new ot(0),Nt=new ot(1),Ut=0;It.isEven()&&Ot.isEven();)It.iushrn(1),Ot.iushrn(1),++Ut;for(var Pt=Ot.clone(),Ht=It.clone();!It.isZero();){for(var Qt=0,an=1;!(It.words[0]&an)&&Qt<26;++Qt,an<<=1);if(Qt>0)for(It.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||zt.isOdd())&&(Wt.iadd(Pt),zt.isub(Ht)),Wt.iushrn(1),zt.iushrn(1);for(var Yt=0,nn=1;!(Ot.words[0]&nn)&&Yt<26;++Yt,nn<<=1);if(Yt>0)for(Ot.iushrn(Yt);Yt-- >0;)(Ft.isOdd()||Nt.isOdd())&&(Ft.iadd(Pt),Nt.isub(Ht)),Ft.iushrn(1),Nt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(Ft),zt.isub(Nt)):(Ot.isub(It),Ft.isub(Wt),Nt.isub(zt))}return{a:Ft,b:Nt,gcd:Ot.iushln(Ut)}},ot.prototype._invmp=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=Ot.clone();It.cmpn(1)>0&&Ot.cmpn(1)>0;){for(var Nt=0,Ut=1;!(It.words[0]&Ut)&&Nt<26;++Nt,Ut<<=1);if(Nt>0)for(It.iushrn(Nt);Nt-- >0;)Wt.isOdd()&&Wt.iadd(Ft),Wt.iushrn(1);for(var Pt=0,Ht=1;!(Ot.words[0]&Ht)&&Pt<26;++Pt,Ht<<=1);if(Pt>0)for(Ot.iushrn(Pt);Pt-- >0;)zt.isOdd()&&zt.iadd(Ft),zt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(zt)):(Ot.isub(It),zt.isub(Wt))}var Qt;return It.cmpn(1)===0?Qt=Wt:Qt=zt,Qt.cmpn(0)<0&&Qt.iadd(vt),Qt},ot.prototype.gcd=function(vt){if(this.isZero())return vt.abs();if(vt.isZero())return this.abs();var It=this.clone(),Ot=vt.clone();It.negative=0,Ot.negative=0;for(var Wt=0;It.isEven()&&Ot.isEven();Wt++)It.iushrn(1),Ot.iushrn(1);do{for(;It.isEven();)It.iushrn(1);for(;Ot.isEven();)Ot.iushrn(1);var zt=It.cmp(Ot);if(zt<0){var Ft=It;It=Ot,Ot=Ft}else if(zt===0||Ot.cmpn(1)===0)break;It.isub(Ot)}while(!0);return Ot.iushln(Wt)},ot.prototype.invm=function(vt){return this.egcd(vt).a.umod(vt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(vt){return this.words[0]&vt},ot.prototype.bincn=function(vt){rt(typeof vt=="number");var It=vt%26,Ot=(vt-It)/26,Wt=1<>>26,Nt&=67108863,this.words[Ft]=Nt}return zt!==0&&(this.words[Ft]=zt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(vt){var It=vt<0;if(this.negative!==0&&!It)return-1;if(this.negative===0&&It)return 1;this._strip();var Ot;if(this.length>1)Ot=1;else{It&&(vt=-vt),rt(vt<=67108863,"Number is too big");var Wt=this.words[0]|0;Ot=Wt===vt?0:Wtvt.length)return 1;if(this.length=0;Ot--){var Wt=this.words[Ot]|0,zt=vt.words[Ot]|0;if(Wt!==zt){Wtzt&&(It=1);break}}return It},ot.prototype.gtn=function(vt){return this.cmpn(vt)===1},ot.prototype.gt=function(vt){return this.cmp(vt)===1},ot.prototype.gten=function(vt){return this.cmpn(vt)>=0},ot.prototype.gte=function(vt){return this.cmp(vt)>=0},ot.prototype.ltn=function(vt){return this.cmpn(vt)===-1},ot.prototype.lt=function(vt){return this.cmp(vt)===-1},ot.prototype.lten=function(vt){return this.cmpn(vt)<=0},ot.prototype.lte=function(vt){return this.cmp(vt)<=0},ot.prototype.eqn=function(vt){return this.cmpn(vt)===0},ot.prototype.eq=function(vt){return this.cmp(vt)===0},ot.red=function(vt){return new jt(vt)},ot.prototype.toRed=function(vt){return rt(!this.red,"Already a number in reduction context"),rt(this.negative===0,"red works only with positives"),vt.convertTo(this)._forceRed(vt)},ot.prototype.fromRed=function(){return rt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(vt){return this.red=vt,this},ot.prototype.forceRed=function(vt){return rt(!this.red,"Already a number in reduction context"),this._forceRed(vt)},ot.prototype.redAdd=function(vt){return rt(this.red,"redAdd works only with red numbers"),this.red.add(this,vt)},ot.prototype.redIAdd=function(vt){return rt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,vt)},ot.prototype.redSub=function(vt){return rt(this.red,"redSub works only with red numbers"),this.red.sub(this,vt)},ot.prototype.redISub=function(vt){return rt(this.red,"redISub works only with red numbers"),this.red.isub(this,vt)},ot.prototype.redShl=function(vt){return rt(this.red,"redShl works only with red numbers"),this.red.shl(this,vt)},ot.prototype.redMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.mul(this,vt)},ot.prototype.redIMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.imul(this,vt)},ot.prototype.redSqr=function(){return rt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return rt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return rt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return rt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return rt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(vt){return rt(this.red&&!vt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,vt)};var St={k256:null,p224:null,p192:null,p25519:null};function Tt($t,vt){this.name=$t,this.p=new ot(vt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tt.prototype._tmp=function(){var vt=new ot(null);return vt.words=new Array(Math.ceil(this.n/13)),vt},Tt.prototype.ireduce=function(vt){var It=vt,Ot;do this.split(It,this.tmp),It=this.imulK(It),It=It.iadd(this.tmp),Ot=It.bitLength();while(Ot>this.n);var Wt=Ot0?It.isub(this.p):It.strip!==void 0?It.strip():It._strip(),It},Tt.prototype.split=function(vt,It){vt.iushrn(this.n,0,It)},Tt.prototype.imulK=function(vt){return vt.imul(this.k)};function At(){Tt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}it(At,Tt),At.prototype.split=function(vt,It){for(var Ot=4194303,Wt=Math.min(vt.length,9),zt=0;zt>>22,Ft=Nt}Ft>>>=22,vt.words[zt-10]=Ft,Ft===0&&vt.length>10?vt.length-=10:vt.length-=9},At.prototype.imulK=function(vt){vt.words[vt.length]=0,vt.words[vt.length+1]=0,vt.length+=2;for(var It=0,Ot=0;Ot>>=26,vt.words[Ot]=zt,It=Wt}return It!==0&&(vt.words[vt.length++]=It),vt},ot._prime=function(vt){if(St[vt])return St[vt];var It;if(vt==="k256")It=new At;else if(vt==="p224")It=new Et;else if(vt==="p192")It=new Ct;else if(vt==="p25519")It=new Lt;else throw new Error("Unknown prime "+vt);return St[vt]=It,It};function jt($t){if(typeof $t=="string"){var vt=ot._prime($t);this.m=vt.p,this.prime=vt}else rt($t.gtn(1),"modulus must be greater than 1"),this.m=$t,this.prime=null}jt.prototype._verify1=function(vt){rt(vt.negative===0,"red works only with positives"),rt(vt.red,"red works only with red numbers")},jt.prototype._verify2=function(vt,It){rt((vt.negative|It.negative)===0,"red works only with positives"),rt(vt.red&&vt.red===It.red,"red works only with red numbers")},jt.prototype.imod=function(vt){return this.prime?this.prime.ireduce(vt)._forceRed(this):(ut(vt,vt.umod(this.m)._forceRed(this)),vt)},jt.prototype.neg=function(vt){return vt.isZero()?vt.clone():this.m.sub(vt)._forceRed(this)},jt.prototype.add=function(vt,It){this._verify2(vt,It);var Ot=vt.add(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot._forceRed(this)},jt.prototype.iadd=function(vt,It){this._verify2(vt,It);var Ot=vt.iadd(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot},jt.prototype.sub=function(vt,It){this._verify2(vt,It);var Ot=vt.sub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot._forceRed(this)},jt.prototype.isub=function(vt,It){this._verify2(vt,It);var Ot=vt.isub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot},jt.prototype.shl=function(vt,It){return this._verify1(vt),this.imod(vt.ushln(It))},jt.prototype.imul=function(vt,It){return this._verify2(vt,It),this.imod(vt.imul(It))},jt.prototype.mul=function(vt,It){return this._verify2(vt,It),this.imod(vt.mul(It))},jt.prototype.isqr=function(vt){return this.imul(vt,vt.clone())},jt.prototype.sqr=function(vt){return this.mul(vt,vt)},jt.prototype.sqrt=function(vt){if(vt.isZero())return vt.clone();var It=this.m.andln(3);if(rt(It%2===1),It===3){var Ot=this.m.add(new ot(1)).iushrn(2);return this.pow(vt,Ot)}for(var Wt=this.m.subn(1),zt=0;!Wt.isZero()&&Wt.andln(1)===0;)zt++,Wt.iushrn(1);rt(!Wt.isZero());var Ft=new ot(1).toRed(this),Nt=Ft.redNeg(),Ut=this.m.subn(1).iushrn(1),Pt=this.m.bitLength();for(Pt=new ot(2*Pt*Pt).toRed(this);this.pow(Pt,Ut).cmp(Nt)!==0;)Pt.redIAdd(Nt);for(var Ht=this.pow(Pt,Wt),Qt=this.pow(vt,Wt.addn(1).iushrn(1)),an=this.pow(vt,Wt),Yt=zt;an.cmp(Ft)!==0;){for(var nn=an,tn=0;nn.cmp(Ft)!==0;tn++)nn=nn.redSqr();rt(tn=0;zt--){for(var Ht=It.words[zt],Qt=Pt-1;Qt>=0;Qt--){var an=Ht>>Qt&1;if(Ft!==Wt[0]&&(Ft=this.sqr(Ft)),an===0&&Nt===0){Ut=0;continue}Nt<<=1,Nt|=an,Ut++,!(Ut!==Ot&&(zt!==0||Qt!==0))&&(Ft=this.mul(Ft,Wt[Nt]),Ut=0,Nt=0)}Pt=26}return Ft},jt.prototype.convertTo=function(vt){var It=vt.umod(this.m);return It===vt?It.clone():It},jt.prototype.convertFrom=function(vt){var It=vt.clone();return It.red=null,It},ot.mont=function(vt){return new Rt(vt)};function Rt($t){jt.call(this,$t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it(Rt,jt),Rt.prototype.convertTo=function(vt){return this.imod(vt.ushln(this.shift))},Rt.prototype.convertFrom=function(vt){var It=this.imod(vt.mul(this.rinv));return It.red=null,It},Rt.prototype.imul=function(vt,It){if(vt.isZero()||It.isZero())return vt.words[0]=0,vt.length=1,vt;var Ot=vt.imul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.mul=function(vt,It){if(vt.isZero()||It.isZero())return new ot(0)._forceRed(this);var Ot=vt.mul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.invm=function(vt){var It=this.imod(vt._invmp(this.m).mul(this.r2));return It._forceRed(this)}})(tt,commonjsGlobal)})(bn$1);var bnExports$1=bn$1.exports,BN$c=bnExports$1,randomBytes$1=browserExports;function blind(tt){var et=getr(tt),nt=et.toRed(BN$c.mont(tt.modulus)).redPow(new BN$c(tt.publicExponent)).fromRed();return{blinder:nt,unblinder:et.invm(tt.modulus)}}function getr(tt){var et=tt.modulus.byteLength(),nt;do nt=new BN$c(randomBytes$1(et));while(nt.cmp(tt.modulus)>=0||!nt.umod(tt.prime1)||!nt.umod(tt.prime2));return nt}function crt$2(tt,et){var nt=blind(et),rt=et.modulus.byteLength(),it=new BN$c(tt).mul(nt.blinder).umod(et.modulus),ot=it.toRed(BN$c.mont(et.prime1)),at=it.toRed(BN$c.mont(et.prime2)),st=et.coefficient,lt=et.prime1,ct=et.prime2,ut=ot.redPow(et.exponent1).fromRed(),ht=at.redPow(et.exponent2).fromRed(),dt=ut.isub(ht).imul(st).umod(lt).imul(ct);return ht.iadd(dt).imul(nt.unblinder).umod(et.modulus).toArrayLike(Buffer,"be",rt)}crt$2.getr=getr;var browserifyRsa=crt$2,elliptic$2={};const name="elliptic",version$2="6.5.4",description="EC cryptography",main$1="lib/elliptic.js",files=["lib"],scripts={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository={type:"git",url:"git@github.com:indutny/elliptic"},keywords=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny ",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0={name,version:version$2,description,main:main$1,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$o={},utils$n={};(function(tt){var et=tt;function nt(ot,at){if(Array.isArray(ot))return ot.slice();if(!ot)return[];var st=[];if(typeof ot!="string"){for(var lt=0;lt>8,ht=ct&255;ut?st.push(ut,ht):st.push(ht)}return st}et.toArray=nt;function rt(ot){return ot.length===1?"0"+ot:ot}et.zero2=rt;function it(ot){for(var at="",st=0;st(mt>>1)-1?bt=(mt>>1)-wt:bt=wt,gt.isubn(bt)):bt=0,pt[yt]=bt,gt.iushrn(1)}return pt}et.getNAF=ot;function at(ut,ht){var dt=[[],[]];ut=ut.clone(),ht=ht.clone();for(var pt=0,mt=0,gt;ut.cmpn(-pt)>0||ht.cmpn(-mt)>0;){var yt=ut.andln(3)+pt&3,bt=ht.andln(3)+mt&3;yt===3&&(yt=-1),bt===3&&(bt=-1);var wt;yt&1?(gt=ut.andln(7)+pt&7,(gt===3||gt===5)&&bt===2?wt=-yt:wt=yt):wt=0,dt[0].push(wt);var xt;bt&1?(gt=ht.andln(7)+mt&7,(gt===3||gt===5)&&yt===2?xt=-bt:xt=bt):xt=0,dt[1].push(xt),2*pt===wt+1&&(pt=1-pt),2*mt===xt+1&&(mt=1-mt),ut.iushrn(1),ht.iushrn(1)}return dt}et.getJSF=at;function st(ut,ht,dt){var pt="_"+ht;ut.prototype[ht]=function(){return this[pt]!==void 0?this[pt]:this[pt]=dt.call(this)}}et.cachedProperty=st;function lt(ut){return typeof ut=="string"?et.toArray(ut,"hex"):ut}et.parseBytes=lt;function ct(ut){return new nt(ut,"hex","le")}et.intFromLE=ct})(utils$o);var curve={},BN$b=bnExports$2,utils$m=utils$o,getNAF=utils$m.getNAF,getJSF=utils$m.getJSF,assert$j=utils$m.assert;function BaseCurve(tt,et){this.type=tt,this.p=new BN$b(et.p,16),this.red=et.prime?BN$b.red(et.prime):BN$b.mont(this.p),this.zero=new BN$b(0).toRed(this.red),this.one=new BN$b(1).toRed(this.red),this.two=new BN$b(2).toRed(this.red),this.n=et.n&&new BN$b(et.n,16),this.g=et.g&&this.pointFromJSON(et.g,et.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var nt=this.n&&this.p.div(this.n);!nt||nt.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$3=BaseCurve;BaseCurve.prototype.point=function(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function(et,nt){assert$j(et.precomputed);var rt=et._getDoubles(),it=getNAF(nt,1,this._bitLength),ot=(1<=st;ct--)lt=(lt<<1)+it[ct];at.push(lt)}for(var ut=this.jpoint(null,null,null),ht=this.jpoint(null,null,null),dt=ot;dt>0;dt--){for(st=0;st=0;lt--){for(var ct=0;lt>=0&&at[lt]===0;lt--)ct++;if(lt>=0&&ct++,st=st.dblp(ct),lt<0)break;var ut=at[lt];assert$j(ut!==0),et.type==="affine"?ut>0?st=st.mixedAdd(ot[ut-1>>1]):st=st.mixedAdd(ot[-ut-1>>1].neg()):ut>0?st=st.add(ot[ut-1>>1]):st=st.add(ot[-ut-1>>1].neg())}return et.type==="affine"?st.toP():st};BaseCurve.prototype._wnafMulAdd=function(et,nt,rt,it,ot){var at=this._wnafT1,st=this._wnafT2,lt=this._wnafT3,ct=0,ut,ht,dt;for(ut=0;ut=1;ut-=2){var mt=ut-1,gt=ut;if(at[mt]!==1||at[gt]!==1){lt[mt]=getNAF(rt[mt],at[mt],this._bitLength),lt[gt]=getNAF(rt[gt],at[gt],this._bitLength),ct=Math.max(lt[mt].length,ct),ct=Math.max(lt[gt].length,ct);continue}var yt=[nt[mt],null,null,nt[gt]];nt[mt].y.cmp(nt[gt].y)===0?(yt[1]=nt[mt].add(nt[gt]),yt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg())):nt[mt].y.cmp(nt[gt].y.redNeg())===0?(yt[1]=nt[mt].toJ().mixedAdd(nt[gt]),yt[2]=nt[mt].add(nt[gt].neg())):(yt[1]=nt[mt].toJ().mixedAdd(nt[gt]),yt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg()));var bt=[-3,-1,-5,-7,0,7,5,1,3],wt=getJSF(rt[mt],rt[gt]);for(ct=Math.max(wt[0].length,ct),lt[mt]=new Array(ct),lt[gt]=new Array(ct),ht=0;ht=0;ut--){for(var At=0;ut>=0;){var Et=!0;for(ht=0;ht=0&&At++,St=St.dblp(At),ut<0)break;for(ht=0;ht0?dt=st[ht][Ct-1>>1]:Ct<0&&(dt=st[ht][-Ct-1>>1].neg()),dt.type==="affine"?St=St.mixedAdd(dt):St=St.add(dt))}}for(ut=0;ut=Math.ceil((et.bitLength()+1)/nt.step):!1};BasePoint.prototype._getDoubles=function(et,nt){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var rt=[this],it=this,ot=0;ot=0&&(pt=ct,mt=ut),ht.negative&&(ht=ht.neg(),dt=dt.neg()),pt.negative&&(pt=pt.neg(),mt=mt.neg()),[{a:ht,b:dt},{a:pt,b:mt}]};ShortCurve.prototype._endoSplit=function(et){var nt=this.endo.basis,rt=nt[0],it=nt[1],ot=it.b.mul(et).divRound(this.n),at=rt.b.neg().mul(et).divRound(this.n),st=ot.mul(rt.a),lt=at.mul(it.a),ct=ot.mul(rt.b),ut=at.mul(it.b),ht=et.sub(st).sub(lt),dt=ct.add(ut).neg();return{k1:ht,k2:dt}};ShortCurve.prototype.pointFromX=function(et,nt){et=new BN$a(et,16),et.red||(et=et.toRed(this.red));var rt=et.redSqr().redMul(et).redIAdd(et.redMul(this.a)).redIAdd(this.b),it=rt.redSqrt();if(it.redSqr().redSub(rt).cmp(this.zero)!==0)throw new Error("invalid point");var ot=it.fromRed().isOdd();return(nt&&!ot||!nt&&ot)&&(it=it.redNeg()),this.point(et,it)};ShortCurve.prototype.validate=function(et){if(et.inf)return!0;var nt=et.x,rt=et.y,it=this.a.redMul(nt),ot=nt.redSqr().redMul(nt).redIAdd(it).redIAdd(this.b);return rt.redSqr().redISub(ot).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function(et,nt,rt){for(var it=this._endoWnafT1,ot=this._endoWnafT2,at=0;at":""};Point$2.prototype.isInfinity=function(){return this.inf};Point$2.prototype.add=function(et){if(this.inf)return et;if(et.inf)return this;if(this.eq(et))return this.dbl();if(this.neg().eq(et))return this.curve.point(null,null);if(this.x.cmp(et.x)===0)return this.curve.point(null,null);var nt=this.y.redSub(et.y);nt.cmpn(0)!==0&&(nt=nt.redMul(this.x.redSub(et.x).redInvm()));var rt=nt.redSqr().redISub(this.x).redISub(et.x),it=nt.redMul(this.x.redSub(rt)).redISub(this.y);return this.curve.point(rt,it)};Point$2.prototype.dbl=function(){if(this.inf)return this;var et=this.y.redAdd(this.y);if(et.cmpn(0)===0)return this.curve.point(null,null);var nt=this.curve.a,rt=this.x.redSqr(),it=et.redInvm(),ot=rt.redAdd(rt).redIAdd(rt).redIAdd(nt).redMul(it),at=ot.redSqr().redISub(this.x.redAdd(this.x)),st=ot.redMul(this.x.redSub(at)).redISub(this.y);return this.curve.point(at,st)};Point$2.prototype.getX=function(){return this.x.fromRed()};Point$2.prototype.getY=function(){return this.y.fromRed()};Point$2.prototype.mul=function(et){return et=new BN$a(et,16),this.isInfinity()?this:this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve.endo?this.curve._endoWnafMulAdd([this],[et]):this.curve._wnafMul(this,et)};Point$2.prototype.mulAdd=function(et,nt,rt){var it=[this,nt],ot=[et,rt];return this.curve.endo?this.curve._endoWnafMulAdd(it,ot):this.curve._wnafMulAdd(1,it,ot,2)};Point$2.prototype.jmulAdd=function(et,nt,rt){var it=[this,nt],ot=[et,rt];return this.curve.endo?this.curve._endoWnafMulAdd(it,ot,!0):this.curve._wnafMulAdd(1,it,ot,2,!0)};Point$2.prototype.eq=function(et){return this===et||this.inf===et.inf&&(this.inf||this.x.cmp(et.x)===0&&this.y.cmp(et.y)===0)};Point$2.prototype.neg=function(et){if(this.inf)return this;var nt=this.curve.point(this.x,this.y.redNeg());if(et&&this.precomputed){var rt=this.precomputed,it=function(ot){return ot.neg()};nt.precomputed={naf:rt.naf&&{wnd:rt.naf.wnd,points:rt.naf.points.map(it)},doubles:rt.doubles&&{step:rt.doubles.step,points:rt.doubles.points.map(it)}}}return nt};Point$2.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var et=this.curve.jpoint(this.x,this.y,this.curve.one);return et};function JPoint(tt,et,nt,rt){Base$2.BasePoint.call(this,tt,"jacobian"),et===null&&nt===null&&rt===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$a(0)):(this.x=new BN$a(et,16),this.y=new BN$a(nt,16),this.z=new BN$a(rt,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$9(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function(et,nt,rt){return new JPoint(this,et,nt,rt)};JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var et=this.z.redInvm(),nt=et.redSqr(),rt=this.x.redMul(nt),it=this.y.redMul(nt).redMul(et);return this.curve.point(rt,it)};JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function(et){if(this.isInfinity())return et;if(et.isInfinity())return this;var nt=et.z.redSqr(),rt=this.z.redSqr(),it=this.x.redMul(nt),ot=et.x.redMul(rt),at=this.y.redMul(nt.redMul(et.z)),st=et.y.redMul(rt.redMul(this.z)),lt=it.redSub(ot),ct=at.redSub(st);if(lt.cmpn(0)===0)return ct.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ut=lt.redSqr(),ht=ut.redMul(lt),dt=it.redMul(ut),pt=ct.redSqr().redIAdd(ht).redISub(dt).redISub(dt),mt=ct.redMul(dt.redISub(pt)).redISub(at.redMul(ht)),gt=this.z.redMul(et.z).redMul(lt);return this.curve.jpoint(pt,mt,gt)};JPoint.prototype.mixedAdd=function(et){if(this.isInfinity())return et.toJ();if(et.isInfinity())return this;var nt=this.z.redSqr(),rt=this.x,it=et.x.redMul(nt),ot=this.y,at=et.y.redMul(nt).redMul(this.z),st=rt.redSub(it),lt=ot.redSub(at);if(st.cmpn(0)===0)return lt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ct=st.redSqr(),ut=ct.redMul(st),ht=rt.redMul(ct),dt=lt.redSqr().redIAdd(ut).redISub(ht).redISub(ht),pt=lt.redMul(ht.redISub(dt)).redISub(ot.redMul(ut)),mt=this.z.redMul(st);return this.curve.jpoint(dt,pt,mt)};JPoint.prototype.dblp=function(et){if(et===0)return this;if(this.isInfinity())return this;if(!et)return this.dbl();var nt;if(this.curve.zeroA||this.curve.threeA){var rt=this;for(nt=0;nt=0)return!1;if(rt.redIAdd(ot),this.x.cmp(rt)===0)return!0}};JPoint.prototype.inspect=function(){return this.isInfinity()?"":""};JPoint.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var BN$9=bnExports$2,inherits$8=inherits_browserExports,Base$1=base$3,utils$k=utils$o;function MontCurve(tt){Base$1.call(this,"mont",tt),this.a=new BN$9(tt.a,16).toRed(this.red),this.b=new BN$9(tt.b,16).toRed(this.red),this.i4=new BN$9(4).toRed(this.red).redInvm(),this.two=new BN$9(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$8(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function(et){var nt=et.normalize().x,rt=nt.redSqr(),it=rt.redMul(nt).redAdd(rt.redMul(this.a)).redAdd(nt),ot=it.redSqrt();return ot.redSqr().cmp(it)===0};function Point$1(tt,et,nt){Base$1.BasePoint.call(this,tt,"projective"),et===null&&nt===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$9(et,16),this.z=new BN$9(nt,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$8(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function(et,nt){return this.point(utils$k.toArray(et,nt),1)};MontCurve.prototype.point=function(et,nt){return new Point$1(this,et,nt)};MontCurve.prototype.pointFromJSON=function(et){return Point$1.fromJSON(this,et)};Point$1.prototype.precompute=function(){};Point$1.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function(et,nt){return new Point$1(et,nt[0],nt[1]||et.one)};Point$1.prototype.inspect=function(){return this.isInfinity()?"":""};Point$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function(){var et=this.x.redAdd(this.z),nt=et.redSqr(),rt=this.x.redSub(this.z),it=rt.redSqr(),ot=nt.redSub(it),at=nt.redMul(it),st=ot.redMul(it.redAdd(this.curve.a24.redMul(ot)));return this.curve.point(at,st)};Point$1.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function(et,nt){var rt=this.x.redAdd(this.z),it=this.x.redSub(this.z),ot=et.x.redAdd(et.z),at=et.x.redSub(et.z),st=at.redMul(rt),lt=ot.redMul(it),ct=nt.z.redMul(st.redAdd(lt).redSqr()),ut=nt.x.redMul(st.redISub(lt).redSqr());return this.curve.point(ct,ut)};Point$1.prototype.mul=function(et){for(var nt=et.clone(),rt=this,it=this.curve.point(null,null),ot=this,at=[];nt.cmpn(0)!==0;nt.iushrn(1))at.push(nt.andln(1));for(var st=at.length-1;st>=0;st--)at[st]===0?(rt=rt.diffAdd(it,ot),it=it.dbl()):(it=rt.diffAdd(it,ot),rt=rt.dbl());return it};Point$1.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function(et){return this.getX().cmp(et.getX())===0};Point$1.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var utils$j=utils$o,BN$8=bnExports$2,inherits$7=inherits_browserExports,Base=base$3,assert$h=utils$j.assert;function EdwardsCurve(tt){this.twisted=(tt.a|0)!==1,this.mOneA=this.twisted&&(tt.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",tt),this.a=new BN$8(tt.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$8(tt.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$8(tt.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$h(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(tt.c|0)===1}inherits$7(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function(et){return this.mOneA?et.redNeg():this.a.redMul(et)};EdwardsCurve.prototype._mulC=function(et){return this.oneC?et:this.c.redMul(et)};EdwardsCurve.prototype.jpoint=function(et,nt,rt,it){return this.point(et,nt,rt,it)};EdwardsCurve.prototype.pointFromX=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var rt=et.redSqr(),it=this.c2.redSub(this.a.redMul(rt)),ot=this.one.redSub(this.c2.redMul(this.d).redMul(rt)),at=it.redMul(ot.redInvm()),st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");var lt=st.fromRed().isOdd();return(nt&&!lt||!nt&<)&&(st=st.redNeg()),this.point(et,st)};EdwardsCurve.prototype.pointFromY=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var rt=et.redSqr(),it=rt.redSub(this.c2),ot=rt.redMul(this.d).redMul(this.c2).redSub(this.a),at=it.redMul(ot.redInvm());if(at.cmp(this.zero)===0){if(nt)throw new Error("invalid point");return this.point(this.zero,et)}var st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");return st.fromRed().isOdd()!==nt&&(st=st.redNeg()),this.point(st,et)};EdwardsCurve.prototype.validate=function(et){if(et.isInfinity())return!0;et.normalize();var nt=et.x.redSqr(),rt=et.y.redSqr(),it=nt.redMul(this.a).redAdd(rt),ot=this.c2.redMul(this.one.redAdd(this.d.redMul(nt).redMul(rt)));return it.cmp(ot)===0};function Point(tt,et,nt,rt,it){Base.BasePoint.call(this,tt,"projective"),et===null&&nt===null&&rt===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$8(et,16),this.y=new BN$8(nt,16),this.z=rt?new BN$8(rt,16):this.curve.one,this.t=it&&new BN$8(it,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits$7(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function(et){return Point.fromJSON(this,et)};EdwardsCurve.prototype.point=function(et,nt,rt,it){return new Point(this,et,nt,rt,it)};Point.fromJSON=function(et,nt){return new Point(et,nt[0],nt[1],nt[2])};Point.prototype.inspect=function(){return this.isInfinity()?"":""};Point.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function(){var et=this.x.redSqr(),nt=this.y.redSqr(),rt=this.z.redSqr();rt=rt.redIAdd(rt);var it=this.curve._mulA(et),ot=this.x.redAdd(this.y).redSqr().redISub(et).redISub(nt),at=it.redAdd(nt),st=at.redSub(rt),lt=it.redSub(nt),ct=ot.redMul(st),ut=at.redMul(lt),ht=ot.redMul(lt),dt=st.redMul(at);return this.curve.point(ct,ut,dt,ht)};Point.prototype._projDbl=function(){var et=this.x.redAdd(this.y).redSqr(),nt=this.x.redSqr(),rt=this.y.redSqr(),it,ot,at,st,lt,ct;if(this.curve.twisted){st=this.curve._mulA(nt);var ut=st.redAdd(rt);this.zOne?(it=et.redSub(nt).redSub(rt).redMul(ut.redSub(this.curve.two)),ot=ut.redMul(st.redSub(rt)),at=ut.redSqr().redSub(ut).redSub(ut)):(lt=this.z.redSqr(),ct=ut.redSub(lt).redISub(lt),it=et.redSub(nt).redISub(rt).redMul(ct),ot=ut.redMul(st.redSub(rt)),at=ut.redMul(ct))}else st=nt.redAdd(rt),lt=this.curve._mulC(this.z).redSqr(),ct=st.redSub(lt).redSub(lt),it=this.curve._mulC(et.redISub(st)).redMul(ct),ot=this.curve._mulC(st).redMul(nt.redISub(rt)),at=st.redMul(ct);return this.curve.point(it,ot,at)};Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function(et){var nt=this.y.redSub(this.x).redMul(et.y.redSub(et.x)),rt=this.y.redAdd(this.x).redMul(et.y.redAdd(et.x)),it=this.t.redMul(this.curve.dd).redMul(et.t),ot=this.z.redMul(et.z.redAdd(et.z)),at=rt.redSub(nt),st=ot.redSub(it),lt=ot.redAdd(it),ct=rt.redAdd(nt),ut=at.redMul(st),ht=lt.redMul(ct),dt=at.redMul(ct),pt=st.redMul(lt);return this.curve.point(ut,ht,pt,dt)};Point.prototype._projAdd=function(et){var nt=this.z.redMul(et.z),rt=nt.redSqr(),it=this.x.redMul(et.x),ot=this.y.redMul(et.y),at=this.curve.d.redMul(it).redMul(ot),st=rt.redSub(at),lt=rt.redAdd(at),ct=this.x.redAdd(this.y).redMul(et.x.redAdd(et.y)).redISub(it).redISub(ot),ut=nt.redMul(st).redMul(ct),ht,dt;return this.curve.twisted?(ht=nt.redMul(lt).redMul(ot.redSub(this.curve._mulA(it))),dt=st.redMul(lt)):(ht=nt.redMul(lt).redMul(ot.redSub(it)),dt=this.curve._mulC(st).redMul(lt)),this.curve.point(ut,ht,dt)};Point.prototype.add=function(et){return this.isInfinity()?et:et.isInfinity()?this:this.curve.extended?this._extAdd(et):this._projAdd(et)};Point.prototype.mul=function(et){return this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve._wnafMul(this,et)};Point.prototype.mulAdd=function(et,nt,rt){return this.curve._wnafMulAdd(1,[this,nt],[et,rt],2,!1)};Point.prototype.jmulAdd=function(et,nt,rt){return this.curve._wnafMulAdd(1,[this,nt],[et,rt],2,!0)};Point.prototype.normalize=function(){if(this.zOne)return this;var et=this.z.redInvm();return this.x=this.x.redMul(et),this.y=this.y.redMul(et),this.t&&(this.t=this.t.redMul(et)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function(et){return this===et||this.getX().cmp(et.getX())===0&&this.getY().cmp(et.getY())===0};Point.prototype.eqXToP=function(et){var nt=et.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(nt)===0)return!0;for(var rt=et.clone(),it=this.curve.redN.redMul(this.z);;){if(rt.iadd(this.curve.n),rt.cmp(this.curve.p)>=0)return!1;if(nt.redIAdd(it),this.x.cmp(nt)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(tt){var et=tt;et.base=base$3,et.short=short,et.mont=mont,et.edwards=edwards})(curve);var curves$1={},hash$6={},utils$i={},assert$g=minimalisticAssert,inherits$6=inherits_browserExports;utils$i.inherits=inherits$6;function isSurrogatePair(tt,et){return(tt.charCodeAt(et)&64512)!==55296||et<0||et+1>=tt.length?!1:(tt.charCodeAt(et+1)&64512)===56320}function toArray$3(tt,et){if(Array.isArray(tt))return tt.slice();if(!tt)return[];var nt=[];if(typeof tt=="string")if(et){if(et==="hex")for(tt=tt.replace(/[^a-z0-9]+/ig,""),tt.length%2!==0&&(tt="0"+tt),it=0;it>6|192,nt[rt++]=ot&63|128):isSurrogatePair(tt,it)?(ot=65536+((ot&1023)<<10)+(tt.charCodeAt(++it)&1023),nt[rt++]=ot>>18|240,nt[rt++]=ot>>12&63|128,nt[rt++]=ot>>6&63|128,nt[rt++]=ot&63|128):(nt[rt++]=ot>>12|224,nt[rt++]=ot>>6&63|128,nt[rt++]=ot&63|128)}else for(it=0;it>>24|tt>>>8&65280|tt<<8&16711680|(tt&255)<<24;return et>>>0}utils$i.htonl=htonl;function toHex32(tt,et){for(var nt="",rt=0;rt>>0}return ot}utils$i.join32=join32;function split32(tt,et){for(var nt=new Array(tt.length*4),rt=0,it=0;rt>>24,nt[it+1]=ot>>>16&255,nt[it+2]=ot>>>8&255,nt[it+3]=ot&255):(nt[it+3]=ot>>>24,nt[it+2]=ot>>>16&255,nt[it+1]=ot>>>8&255,nt[it]=ot&255)}return nt}utils$i.split32=split32;function rotr32$1(tt,et){return tt>>>et|tt<<32-et}utils$i.rotr32=rotr32$1;function rotl32$2(tt,et){return tt<>>32-et}utils$i.rotl32=rotl32$2;function sum32$3(tt,et){return tt+et>>>0}utils$i.sum32=sum32$3;function sum32_3$1(tt,et,nt){return tt+et+nt>>>0}utils$i.sum32_3=sum32_3$1;function sum32_4$2(tt,et,nt,rt){return tt+et+nt+rt>>>0}utils$i.sum32_4=sum32_4$2;function sum32_5$2(tt,et,nt,rt,it){return tt+et+nt+rt+it>>>0}utils$i.sum32_5=sum32_5$2;function sum64$1(tt,et,nt,rt){var it=tt[et],ot=tt[et+1],at=rt+ot>>>0,st=(at>>0,tt[et+1]=at}utils$i.sum64=sum64$1;function sum64_hi$1(tt,et,nt,rt){var it=et+rt>>>0,ot=(it>>0}utils$i.sum64_hi=sum64_hi$1;function sum64_lo$1(tt,et,nt,rt){var it=et+rt;return it>>>0}utils$i.sum64_lo=sum64_lo$1;function sum64_4_hi$1(tt,et,nt,rt,it,ot,at,st){var lt=0,ct=et;ct=ct+rt>>>0,lt+=ct>>0,lt+=ct>>0,lt+=ct>>0}utils$i.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(tt,et,nt,rt,it,ot,at,st){var lt=et+rt+ot+st;return lt>>>0}utils$i.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(tt,et,nt,rt,it,ot,at,st,lt,ct){var ut=0,ht=et;ht=ht+rt>>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0}utils$i.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(tt,et,nt,rt,it,ot,at,st,lt,ct){var ut=et+rt+ot+st+ct;return ut>>>0}utils$i.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(tt,et,nt){var rt=et<<32-nt|tt>>>nt;return rt>>>0}utils$i.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(tt,et,nt){var rt=tt<<32-nt|et>>>nt;return rt>>>0}utils$i.rotr64_lo=rotr64_lo$1;function shr64_hi$1(tt,et,nt){return tt>>>nt}utils$i.shr64_hi=shr64_hi$1;function shr64_lo$1(tt,et,nt){var rt=tt<<32-nt|et>>>nt;return rt>>>0}utils$i.shr64_lo=shr64_lo$1;var common$7={},utils$h=utils$i,assert$f=minimalisticAssert;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$7.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(et,nt){if(et=utils$h.toArray(et,nt),this.pending?this.pending=this.pending.concat(et):this.pending=et,this.pendingTotal+=et.length,this.pending.length>=this._delta8){et=this.pending;var rt=et.length%this._delta8;this.pending=et.slice(et.length-rt,et.length),this.pending.length===0&&(this.pending=null),et=utils$h.join32(et,0,et.length-rt,this.endian);for(var it=0;it>>24&255,it[ot++]=et>>>16&255,it[ot++]=et>>>8&255,it[ot++]=et&255}else for(it[ot++]=et&255,it[ot++]=et>>>8&255,it[ot++]=et>>>16&255,it[ot++]=et>>>24&255,it[ot++]=0,it[ot++]=0,it[ot++]=0,it[ot++]=0,at=8;at>>3}common$6.g0_256=g0_256$1;function g1_256$1(tt){return rotr32(tt,17)^rotr32(tt,19)^tt>>>10}common$6.g1_256=g1_256$1;var utils$f=utils$i,common$5=common$7,shaCommon$1=common$6,rotl32$1=utils$f.rotl32,sum32$2=utils$f.sum32,sum32_5$1=utils$f.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$5.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1$1(){if(!(this instanceof SHA1$1))return new SHA1$1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$f.inherits(SHA1$1,BlockHash$3);var _1=SHA1$1;SHA1$1.blockSize=512;SHA1$1.outSize=160;SHA1$1.hmacStrength=80;SHA1$1.padLength=64;SHA1$1.prototype._update=function(et,nt){for(var rt=this.W,it=0;it<16;it++)rt[it]=et[nt+it];for(;itthis.blockSize&&(et=new this.Hash().update(et).digest()),assert$c(et.length<=this.blockSize);for(var nt=et.length;nt=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(et,nt,rt)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(et,nt,rt){var it=et.concat(nt).concat(rt);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var ot=0;ot=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(et.concat(rt||[])),this._reseed=1};HmacDRBG.prototype.generate=function(et,nt,rt,it){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof nt!="string"&&(it=rt,rt=nt,nt=null),rt&&(rt=utils$8.toArray(rt,it||"hex"),this._update(rt));for(var ot=[];ot.length"};var BN$6=bnExports$2,utils$6=utils$o,assert$9=utils$6.assert;function Signature$2(tt,et){if(tt instanceof Signature$2)return tt;this._importDER(tt,et)||(assert$9(tt.r&&tt.s,"Signature without r or s"),this.r=new BN$6(tt.r,16),this.s=new BN$6(tt.s,16),tt.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=tt.recoveryParam)}var signature$1=Signature$2;function Position$1(){this.place=0}function getLength(tt,et){var nt=tt[et.place++];if(!(nt&128))return nt;var rt=nt&15;if(rt===0||rt>4)return!1;for(var it=0,ot=0,at=et.place;ot>>=0;return it<=127?!1:(et.place=at,it)}function rmPadding(tt){for(var et=0,nt=tt.length-1;!tt[et]&&!(tt[et+1]&128)&&et>>3);for(tt.push(nt|128);--nt;)tt.push(et>>>(nt<<3)&255);tt.push(et)}Signature$2.prototype.toDER=function(et){var nt=this.r.toArray(),rt=this.s.toArray();for(nt[0]&128&&(nt=[0].concat(nt)),rt[0]&128&&(rt=[0].concat(rt)),nt=rmPadding(nt),rt=rmPadding(rt);!rt[0]&&!(rt[1]&128);)rt=rt.slice(1);var it=[2];constructLength(it,nt.length),it=it.concat(nt),it.push(2),constructLength(it,rt.length);var ot=it.concat(rt),at=[48];return constructLength(at,ot.length),at=at.concat(ot),utils$6.encode(at,et)};var ec$1,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$1;hasRequiredEc=1;var tt=bnExports$2,et=hmacDrbg,nt=utils$o,rt=curves$1,it=requireBrorand(),ot=nt.assert,at=key$2,st=signature$1;function lt(ct){if(!(this instanceof lt))return new lt(ct);typeof ct=="string"&&(ot(Object.prototype.hasOwnProperty.call(rt,ct),"Unknown curve "+ct),ct=rt[ct]),ct instanceof rt.PresetCurve&&(ct={curve:ct}),this.curve=ct.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=ct.curve.g,this.g.precompute(ct.curve.n.bitLength()+1),this.hash=ct.hash||ct.curve.hash}return ec$1=lt,lt.prototype.keyPair=function(ut){return new at(this,ut)},lt.prototype.keyFromPrivate=function(ut,ht){return at.fromPrivate(this,ut,ht)},lt.prototype.keyFromPublic=function(ut,ht){return at.fromPublic(this,ut,ht)},lt.prototype.genKeyPair=function(ut){ut||(ut={});for(var ht=new et({hash:this.hash,pers:ut.pers,persEnc:ut.persEnc||"utf8",entropy:ut.entropy||it(this.hash.hmacStrength),entropyEnc:ut.entropy&&ut.entropyEnc||"utf8",nonce:this.n.toArray()}),dt=this.n.byteLength(),pt=this.n.sub(new tt(2));;){var mt=new tt(ht.generate(dt));if(!(mt.cmp(pt)>0))return mt.iaddn(1),this.keyFromPrivate(mt)}},lt.prototype._truncateToN=function(ut,ht){var dt=ut.byteLength()*8-this.n.bitLength();return dt>0&&(ut=ut.ushrn(dt)),!ht&&ut.cmp(this.n)>=0?ut.sub(this.n):ut},lt.prototype.sign=function(ut,ht,dt,pt){typeof dt=="object"&&(pt=dt,dt=null),pt||(pt={}),ht=this.keyFromPrivate(ht,dt),ut=this._truncateToN(new tt(ut,16));for(var mt=this.n.byteLength(),gt=ht.getPrivate().toArray("be",mt),yt=ut.toArray("be",mt),bt=new et({hash:this.hash,entropy:gt,nonce:yt,pers:pt.pers,persEnc:pt.persEnc||"utf8"}),wt=this.n.sub(new tt(1)),xt=0;;xt++){var kt=pt.k?pt.k(xt):new tt(bt.generate(this.n.byteLength()));if(kt=this._truncateToN(kt,!0),!(kt.cmpn(1)<=0||kt.cmp(wt)>=0)){var St=this.g.mul(kt);if(!St.isInfinity()){var Tt=St.getX(),At=Tt.umod(this.n);if(At.cmpn(0)!==0){var Et=kt.invm(this.n).mul(At.mul(ht.getPrivate()).iadd(ut));if(Et=Et.umod(this.n),Et.cmpn(0)!==0){var Ct=(St.getY().isOdd()?1:0)|(Tt.cmp(At)!==0?2:0);return pt.canonical&&Et.cmp(this.nh)>0&&(Et=this.n.sub(Et),Ct^=1),new st({r:At,s:Et,recoveryParam:Ct})}}}}}},lt.prototype.verify=function(ut,ht,dt,pt){ut=this._truncateToN(new tt(ut,16)),dt=this.keyFromPublic(dt,pt),ht=new st(ht,"hex");var mt=ht.r,gt=ht.s;if(mt.cmpn(1)<0||mt.cmp(this.n)>=0||gt.cmpn(1)<0||gt.cmp(this.n)>=0)return!1;var yt=gt.invm(this.n),bt=yt.mul(ut).umod(this.n),wt=yt.mul(mt).umod(this.n),xt;return this.curve._maxwellTrick?(xt=this.g.jmulAdd(bt,dt.getPublic(),wt),xt.isInfinity()?!1:xt.eqXToP(mt)):(xt=this.g.mulAdd(bt,dt.getPublic(),wt),xt.isInfinity()?!1:xt.getX().umod(this.n).cmp(mt)===0)},lt.prototype.recoverPubKey=function(ct,ut,ht,dt){ot((3&ht)===ht,"The recovery param is more than two bits"),ut=new st(ut,dt);var pt=this.n,mt=new tt(ct),gt=ut.r,yt=ut.s,bt=ht&1,wt=ht>>1;if(gt.cmp(this.curve.p.umod(this.curve.n))>=0&&wt)throw new Error("Unable to find sencond key candinate");wt?gt=this.curve.pointFromX(gt.add(this.curve.n),bt):gt=this.curve.pointFromX(gt,bt);var xt=ut.r.invm(pt),kt=pt.sub(mt).mul(xt).umod(pt),St=yt.mul(xt).umod(pt);return this.g.mulAdd(kt,gt,St)},lt.prototype.getKeyRecoveryParam=function(ct,ut,ht,dt){if(ut=new st(ut,dt),ut.recoveryParam!==null)return ut.recoveryParam;for(var pt=0;pt<4;pt++){var mt;try{mt=this.recoverPubKey(ct,ut,pt)}catch{continue}if(mt.eq(ht))return pt}throw new Error("Unable to find valid recovery factor")},ec$1}var utils$5=utils$o,assert$8=utils$5.assert,parseBytes$2=utils$5.parseBytes,cachedProperty$1=utils$5.cachedProperty;function KeyPair$1(tt,et){this.eddsa=tt,this._secret=parseBytes$2(et.secret),tt.isPoint(et.pub)?this._pub=et.pub:this._pubBytes=parseBytes$2(et.pub)}KeyPair$1.fromPublic=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{pub:nt})};KeyPair$1.fromSecret=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{secret:nt})};KeyPair$1.prototype.secret=function(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function(){var et=this.eddsa,nt=this.hash(),rt=et.encodingLength-1,it=nt.slice(0,et.encodingLength);return it[0]&=248,it[rt]&=127,it[rt]|=64,it});cachedProperty$1(KeyPair$1,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function(et){return assert$8(this._secret,"KeyPair can only verify"),this.eddsa.sign(et,this)};KeyPair$1.prototype.verify=function(et,nt){return this.eddsa.verify(et,nt,this)};KeyPair$1.prototype.getSecret=function(et){return assert$8(this._secret,"KeyPair is public only"),utils$5.encode(this.secret(),et)};KeyPair$1.prototype.getPublic=function(et){return utils$5.encode(this.pubBytes(),et)};var key$1=KeyPair$1,BN$5=bnExports$2,utils$4=utils$o,assert$7=utils$4.assert,cachedProperty=utils$4.cachedProperty,parseBytes$1=utils$4.parseBytes;function Signature$1(tt,et){this.eddsa=tt,typeof et!="object"&&(et=parseBytes$1(et)),Array.isArray(et)&&(et={R:et.slice(0,tt.encodingLength),S:et.slice(tt.encodingLength)}),assert$7(et.R&&et.S,"Signature without R or S"),tt.isPoint(et.R)&&(this._R=et.R),et.S instanceof BN$5&&(this._S=et.S),this._Rencoded=Array.isArray(et.R)?et.R:et.Rencoded,this._Sencoded=Array.isArray(et.S)?et.S:et.Sencoded}cachedProperty(Signature$1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Signature$1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Signature$1.prototype.toHex=function(){return utils$4.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash$4=hash$6,curves=curves$1,utils$3=utils$o,assert$6=utils$3.assert,parseBytes=utils$3.parseBytes,KeyPair=key$1,Signature=signature;function EDDSA(tt){if(assert$6(tt==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(tt);tt=curves[tt].curve,this.curve=tt,this.g=tt.g,this.g.precompute(tt.n.bitLength()+1),this.pointClass=tt.point().constructor,this.encodingLength=Math.ceil(tt.n.bitLength()/8),this.hash=hash$4.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function(et,nt){et=parseBytes(et);var rt=this.keyFromSecret(nt),it=this.hashInt(rt.messagePrefix(),et),ot=this.g.mul(it),at=this.encodePoint(ot),st=this.hashInt(at,rt.pubBytes(),et).mul(rt.priv()),lt=it.add(st).umod(this.curve.n);return this.makeSignature({R:ot,S:lt,Rencoded:at})};EDDSA.prototype.verify=function(et,nt,rt){et=parseBytes(et),nt=this.makeSignature(nt);var it=this.keyFromPublic(rt),ot=this.hashInt(nt.Rencoded(),it.pubBytes(),et),at=this.g.mul(nt.S()),st=nt.R().add(it.pub().mul(ot));return st.eq(at)};EDDSA.prototype.hashInt=function(){for(var et=this.hash(),nt=0;nt0?vt:It},ot.min=function(vt,It){return vt.cmp(It)<0?vt:It},ot.prototype._init=function(vt,It,Ot){if(typeof vt=="number")return this._initNumber(vt,It,Ot);if(typeof vt=="object")return this._initArray(vt,It,Ot);It==="hex"&&(It=16),rt(It===(It|0)&&It>=2&&It<=36),vt=vt.toString().replace(/\s+/g,"");var Wt=0;vt[0]==="-"&&(Wt++,this.negative=1),Wt=0;Wt-=3)Ft=vt[Wt]|vt[Wt-1]<<8|vt[Wt-2]<<16,this.words[zt]|=Ft<>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);else if(Ot==="le")for(Wt=0,zt=0;Wt>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);return this._strip()};function st($t,vt){var It=$t.charCodeAt(vt);if(It>=48&&It<=57)return It-48;if(It>=65&&It<=70)return It-55;if(It>=97&&It<=102)return It-87;rt(!1,"Invalid character in "+$t)}function lt($t,vt,It){var Ot=st($t,It);return It-1>=vt&&(Ot|=st($t,It-1)<<4),Ot}ot.prototype._parseHex=function(vt,It,Ot){this.length=Math.ceil((vt.length-It)/6),this.words=new Array(this.length);for(var Wt=0;Wt=It;Wt-=2)Nt=lt(vt,It,Wt)<=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8;else{var Ut=vt.length-It;for(Wt=Ut%2===0?It+1:It;Wt=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8}this._strip()};function ct($t,vt,It,Ot){for(var Wt=0,zt=0,Ft=Math.min($t.length,It),Nt=vt;Nt=49?zt=Ut-49+10:Ut>=17?zt=Ut-17+10:zt=Ut,rt(Ut>=0&&zt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(vt,It){vt=vt||10,It=It|0||1;var Ot;if(vt===16||vt==="hex"){Ot="";for(var Wt=0,zt=0,Ft=0;Ft>>24-Wt&16777215,Wt+=2,Wt>=26&&(Wt-=26,Ft--),zt!==0||Ft!==this.length-1?Ot=dt[6-Ut.length]+Ut+Ot:Ot=Ut+Ot}for(zt!==0&&(Ot=zt.toString(16)+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}if(vt===(vt|0)&&vt>=2&&vt<=36){var Pt=pt[vt],Ht=mt[vt];Ot="";var Qt=this.clone();for(Qt.negative=0;!Qt.isZero();){var an=Qt.modrn(Ht).toString(vt);Qt=Qt.idivn(Ht),Qt.isZero()?Ot=an+Ot:Ot=dt[Pt-an.length]+an+Ot}for(this.isZero()&&(Ot="0"+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}rt(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var vt=this.words[0];return this.length===2?vt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?vt+=4503599627370496+this.words[1]*67108864:this.length>2&&rt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-vt:vt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(vt,It){return this.toArrayLike(at,vt,It)}),ot.prototype.toArray=function(vt,It){return this.toArrayLike(Array,vt,It)};var gt=function(vt,It){return vt.allocUnsafe?vt.allocUnsafe(It):new vt(It)};ot.prototype.toArrayLike=function(vt,It,Ot){this._strip();var Wt=this.byteLength(),zt=Ot||Math.max(1,Wt);rt(Wt<=zt,"byte array longer than desired length"),rt(zt>0,"Requested array length <= 0");var Ft=gt(vt,zt),Nt=It==="le"?"LE":"BE";return this["_toArrayLike"+Nt](Ft,Wt),Ft},ot.prototype._toArrayLikeLE=function(vt,It){for(var Ot=0,Wt=0,zt=0,Ft=0;zt>8&255),Ot>16&255),Ft===6?(Ot>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot=0&&(vt[Ot--]=Nt>>8&255),Ot>=0&&(vt[Ot--]=Nt>>16&255),Ft===6?(Ot>=0&&(vt[Ot--]=Nt>>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot>=0)for(vt[Ot--]=Wt;Ot>=0;)vt[Ot--]=0},Math.clz32?ot.prototype._countBits=function(vt){return 32-Math.clz32(vt)}:ot.prototype._countBits=function(vt){var It=vt,Ot=0;return It>=4096&&(Ot+=13,It>>>=13),It>=64&&(Ot+=7,It>>>=7),It>=8&&(Ot+=4,It>>>=4),It>=2&&(Ot+=2,It>>>=2),Ot+It},ot.prototype._zeroBits=function(vt){if(vt===0)return 26;var It=vt,Ot=0;return It&8191||(Ot+=13,It>>>=13),It&127||(Ot+=7,It>>>=7),It&15||(Ot+=4,It>>>=4),It&3||(Ot+=2,It>>>=2),It&1||Ot++,Ot},ot.prototype.bitLength=function(){var vt=this.words[this.length-1],It=this._countBits(vt);return(this.length-1)*26+It};function yt($t){for(var vt=new Array($t.bitLength()),It=0;It>>Wt&1}return vt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var vt=0,It=0;Itvt.length?this.clone().ior(vt):vt.clone().ior(this)},ot.prototype.uor=function(vt){return this.length>vt.length?this.clone().iuor(vt):vt.clone().iuor(this)},ot.prototype.iuand=function(vt){var It;this.length>vt.length?It=vt:It=this;for(var Ot=0;Otvt.length?this.clone().iand(vt):vt.clone().iand(this)},ot.prototype.uand=function(vt){return this.length>vt.length?this.clone().iuand(vt):vt.clone().iuand(this)},ot.prototype.iuxor=function(vt){var It,Ot;this.length>vt.length?(It=this,Ot=vt):(It=vt,Ot=this);for(var Wt=0;Wtvt.length?this.clone().ixor(vt):vt.clone().ixor(this)},ot.prototype.uxor=function(vt){return this.length>vt.length?this.clone().iuxor(vt):vt.clone().iuxor(this)},ot.prototype.inotn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=Math.ceil(vt/26)|0,Ot=vt%26;this._expand(It),Ot>0&&It--;for(var Wt=0;Wt0&&(this.words[Wt]=~this.words[Wt]&67108863>>26-Ot),this._strip()},ot.prototype.notn=function(vt){return this.clone().inotn(vt)},ot.prototype.setn=function(vt,It){rt(typeof vt=="number"&&vt>=0);var Ot=vt/26|0,Wt=vt%26;return this._expand(Ot+1),It?this.words[Ot]=this.words[Ot]|1<vt.length?(Ot=this,Wt=vt):(Ot=vt,Wt=this);for(var zt=0,Ft=0;Ft>>26;for(;zt!==0&&Ft>>26;if(this.length=Ot.length,zt!==0)this.words[this.length]=zt,this.length++;else if(Ot!==this)for(;Ftvt.length?this.clone().iadd(vt):vt.clone().iadd(this)},ot.prototype.isub=function(vt){if(vt.negative!==0){vt.negative=0;var It=this.iadd(vt);return vt.negative=1,It._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(vt),this.negative=1,this._normSign();var Ot=this.cmp(vt);if(Ot===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Wt,zt;Ot>0?(Wt=this,zt=vt):(Wt=vt,zt=this);for(var Ft=0,Nt=0;Nt>26,this.words[Nt]=It&67108863;for(;Ft!==0&&Nt>26,this.words[Nt]=It&67108863;if(Ft===0&&Nt>>26,Qt=Ut&67108863,an=Math.min(Pt,vt.length-1),Yt=Math.max(0,Pt-$t.length+1);Yt<=an;Yt++){var nn=Pt-Yt|0;Wt=$t.words[nn]|0,zt=vt.words[Yt]|0,Ft=Wt*zt+Qt,Ht+=Ft/67108864|0,Qt=Ft&67108863}It.words[Pt]=Qt|0,Ut=Ht|0}return Ut!==0?It.words[Pt]=Ut|0:It.length--,It._strip()}var wt=function(vt,It,Ot){var Wt=vt.words,zt=It.words,Ft=Ot.words,Nt=0,Ut,Pt,Ht,Qt=Wt[0]|0,an=Qt&8191,Yt=Qt>>>13,nn=Wt[1]|0,tn=nn&8191,dn=nn>>>13,wn=Wt[2]|0,rn=wn&8191,Jt=wn>>>13,vn=Wt[3]|0,Cn=vn&8191,$n=vn>>>13,Nn=Wt[4]|0,En=Nn&8191,sn=Nn>>>13,pn=Wt[5]|0,Tn=pn&8191,In=pn>>>13,yn=Wt[6]|0,hn=yn&8191,fn=yn>>>13,xn=Wt[7]|0,jn=xn&8191,cn=xn>>>13,Xt=Wt[8]|0,Kt=Xt&8191,kn=Xt>>>13,Mn=Wt[9]|0,On=Mn&8191,Bn=Mn>>>13,Xn=zt[0]|0,Vn=Xn&8191,Gn=Xn>>>13,zn=zt[1]|0,Zn=zn&8191,Wn=zn>>>13,fr=zt[2]|0,ur=fr&8191,wr=fr>>>13,Xr=zt[3]|0,Er=Xr&8191,Ir=Xr>>>13,Gr=zt[4]|0,Or=Gr&8191,Lr=Gr>>>13,oo=zt[5]|0,qr=oo&8191,jr=oo>>>13,mo=zt[6]|0,_n=mo&8191,Pn=mo>>>13,un=zt[7]|0,Zt=un&8191,Sn=un>>>13,Dn=zt[8]|0,Fn=Dn&8191,Yn=Dn>>>13,tr=zt[9]|0,ar=tr&8191,lr=tr>>>13;Ot.negative=vt.negative^It.negative,Ot.length=19,Ut=Math.imul(an,Vn),Pt=Math.imul(an,Gn),Pt=Pt+Math.imul(Yt,Vn)|0,Ht=Math.imul(Yt,Gn);var Vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Ut=Math.imul(tn,Vn),Pt=Math.imul(tn,Gn),Pt=Pt+Math.imul(dn,Vn)|0,Ht=Math.imul(dn,Gn),Ut=Ut+Math.imul(an,Zn)|0,Pt=Pt+Math.imul(an,Wn)|0,Pt=Pt+Math.imul(Yt,Zn)|0,Ht=Ht+Math.imul(Yt,Wn)|0;var vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(vr>>>26)|0,vr&=67108863,Ut=Math.imul(rn,Vn),Pt=Math.imul(rn,Gn),Pt=Pt+Math.imul(Jt,Vn)|0,Ht=Math.imul(Jt,Gn),Ut=Ut+Math.imul(tn,Zn)|0,Pt=Pt+Math.imul(tn,Wn)|0,Pt=Pt+Math.imul(dn,Zn)|0,Ht=Ht+Math.imul(dn,Wn)|0,Ut=Ut+Math.imul(an,ur)|0,Pt=Pt+Math.imul(an,wr)|0,Pt=Pt+Math.imul(Yt,ur)|0,Ht=Ht+Math.imul(Yt,wr)|0;var Nr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Ut=Math.imul(Cn,Vn),Pt=Math.imul(Cn,Gn),Pt=Pt+Math.imul($n,Vn)|0,Ht=Math.imul($n,Gn),Ut=Ut+Math.imul(rn,Zn)|0,Pt=Pt+Math.imul(rn,Wn)|0,Pt=Pt+Math.imul(Jt,Zn)|0,Ht=Ht+Math.imul(Jt,Wn)|0,Ut=Ut+Math.imul(tn,ur)|0,Pt=Pt+Math.imul(tn,wr)|0,Pt=Pt+Math.imul(dn,ur)|0,Ht=Ht+Math.imul(dn,wr)|0,Ut=Ut+Math.imul(an,Er)|0,Pt=Pt+Math.imul(an,Ir)|0,Pt=Pt+Math.imul(Yt,Er)|0,Ht=Ht+Math.imul(Yt,Ir)|0;var Hr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Ut=Math.imul(En,Vn),Pt=Math.imul(En,Gn),Pt=Pt+Math.imul(sn,Vn)|0,Ht=Math.imul(sn,Gn),Ut=Ut+Math.imul(Cn,Zn)|0,Pt=Pt+Math.imul(Cn,Wn)|0,Pt=Pt+Math.imul($n,Zn)|0,Ht=Ht+Math.imul($n,Wn)|0,Ut=Ut+Math.imul(rn,ur)|0,Pt=Pt+Math.imul(rn,wr)|0,Pt=Pt+Math.imul(Jt,ur)|0,Ht=Ht+Math.imul(Jt,wr)|0,Ut=Ut+Math.imul(tn,Er)|0,Pt=Pt+Math.imul(tn,Ir)|0,Pt=Pt+Math.imul(dn,Er)|0,Ht=Ht+Math.imul(dn,Ir)|0,Ut=Ut+Math.imul(an,Or)|0,Pt=Pt+Math.imul(an,Lr)|0,Pt=Pt+Math.imul(Yt,Or)|0,Ht=Ht+Math.imul(Yt,Lr)|0;var eo=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ut=Math.imul(Tn,Vn),Pt=Math.imul(Tn,Gn),Pt=Pt+Math.imul(In,Vn)|0,Ht=Math.imul(In,Gn),Ut=Ut+Math.imul(En,Zn)|0,Pt=Pt+Math.imul(En,Wn)|0,Pt=Pt+Math.imul(sn,Zn)|0,Ht=Ht+Math.imul(sn,Wn)|0,Ut=Ut+Math.imul(Cn,ur)|0,Pt=Pt+Math.imul(Cn,wr)|0,Pt=Pt+Math.imul($n,ur)|0,Ht=Ht+Math.imul($n,wr)|0,Ut=Ut+Math.imul(rn,Er)|0,Pt=Pt+Math.imul(rn,Ir)|0,Pt=Pt+Math.imul(Jt,Er)|0,Ht=Ht+Math.imul(Jt,Ir)|0,Ut=Ut+Math.imul(tn,Or)|0,Pt=Pt+Math.imul(tn,Lr)|0,Pt=Pt+Math.imul(dn,Or)|0,Ht=Ht+Math.imul(dn,Lr)|0,Ut=Ut+Math.imul(an,qr)|0,Pt=Pt+Math.imul(an,jr)|0,Pt=Pt+Math.imul(Yt,qr)|0,Ht=Ht+Math.imul(Yt,jr)|0;var Zr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,Ut=Math.imul(hn,Vn),Pt=Math.imul(hn,Gn),Pt=Pt+Math.imul(fn,Vn)|0,Ht=Math.imul(fn,Gn),Ut=Ut+Math.imul(Tn,Zn)|0,Pt=Pt+Math.imul(Tn,Wn)|0,Pt=Pt+Math.imul(In,Zn)|0,Ht=Ht+Math.imul(In,Wn)|0,Ut=Ut+Math.imul(En,ur)|0,Pt=Pt+Math.imul(En,wr)|0,Pt=Pt+Math.imul(sn,ur)|0,Ht=Ht+Math.imul(sn,wr)|0,Ut=Ut+Math.imul(Cn,Er)|0,Pt=Pt+Math.imul(Cn,Ir)|0,Pt=Pt+Math.imul($n,Er)|0,Ht=Ht+Math.imul($n,Ir)|0,Ut=Ut+Math.imul(rn,Or)|0,Pt=Pt+Math.imul(rn,Lr)|0,Pt=Pt+Math.imul(Jt,Or)|0,Ht=Ht+Math.imul(Jt,Lr)|0,Ut=Ut+Math.imul(tn,qr)|0,Pt=Pt+Math.imul(tn,jr)|0,Pt=Pt+Math.imul(dn,qr)|0,Ht=Ht+Math.imul(dn,jr)|0,Ut=Ut+Math.imul(an,_n)|0,Pt=Pt+Math.imul(an,Pn)|0,Pt=Pt+Math.imul(Yt,_n)|0,Ht=Ht+Math.imul(Yt,Pn)|0;var Jr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Ut=Math.imul(jn,Vn),Pt=Math.imul(jn,Gn),Pt=Pt+Math.imul(cn,Vn)|0,Ht=Math.imul(cn,Gn),Ut=Ut+Math.imul(hn,Zn)|0,Pt=Pt+Math.imul(hn,Wn)|0,Pt=Pt+Math.imul(fn,Zn)|0,Ht=Ht+Math.imul(fn,Wn)|0,Ut=Ut+Math.imul(Tn,ur)|0,Pt=Pt+Math.imul(Tn,wr)|0,Pt=Pt+Math.imul(In,ur)|0,Ht=Ht+Math.imul(In,wr)|0,Ut=Ut+Math.imul(En,Er)|0,Pt=Pt+Math.imul(En,Ir)|0,Pt=Pt+Math.imul(sn,Er)|0,Ht=Ht+Math.imul(sn,Ir)|0,Ut=Ut+Math.imul(Cn,Or)|0,Pt=Pt+Math.imul(Cn,Lr)|0,Pt=Pt+Math.imul($n,Or)|0,Ht=Ht+Math.imul($n,Lr)|0,Ut=Ut+Math.imul(rn,qr)|0,Pt=Pt+Math.imul(rn,jr)|0,Pt=Pt+Math.imul(Jt,qr)|0,Ht=Ht+Math.imul(Jt,jr)|0,Ut=Ut+Math.imul(tn,_n)|0,Pt=Pt+Math.imul(tn,Pn)|0,Pt=Pt+Math.imul(dn,_n)|0,Ht=Ht+Math.imul(dn,Pn)|0,Ut=Ut+Math.imul(an,Zt)|0,Pt=Pt+Math.imul(an,Sn)|0,Pt=Pt+Math.imul(Yt,Zt)|0,Ht=Ht+Math.imul(Yt,Sn)|0;var br=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(br>>>26)|0,br&=67108863,Ut=Math.imul(Kt,Vn),Pt=Math.imul(Kt,Gn),Pt=Pt+Math.imul(kn,Vn)|0,Ht=Math.imul(kn,Gn),Ut=Ut+Math.imul(jn,Zn)|0,Pt=Pt+Math.imul(jn,Wn)|0,Pt=Pt+Math.imul(cn,Zn)|0,Ht=Ht+Math.imul(cn,Wn)|0,Ut=Ut+Math.imul(hn,ur)|0,Pt=Pt+Math.imul(hn,wr)|0,Pt=Pt+Math.imul(fn,ur)|0,Ht=Ht+Math.imul(fn,wr)|0,Ut=Ut+Math.imul(Tn,Er)|0,Pt=Pt+Math.imul(Tn,Ir)|0,Pt=Pt+Math.imul(In,Er)|0,Ht=Ht+Math.imul(In,Ir)|0,Ut=Ut+Math.imul(En,Or)|0,Pt=Pt+Math.imul(En,Lr)|0,Pt=Pt+Math.imul(sn,Or)|0,Ht=Ht+Math.imul(sn,Lr)|0,Ut=Ut+Math.imul(Cn,qr)|0,Pt=Pt+Math.imul(Cn,jr)|0,Pt=Pt+Math.imul($n,qr)|0,Ht=Ht+Math.imul($n,jr)|0,Ut=Ut+Math.imul(rn,_n)|0,Pt=Pt+Math.imul(rn,Pn)|0,Pt=Pt+Math.imul(Jt,_n)|0,Ht=Ht+Math.imul(Jt,Pn)|0,Ut=Ut+Math.imul(tn,Zt)|0,Pt=Pt+Math.imul(tn,Sn)|0,Pt=Pt+Math.imul(dn,Zt)|0,Ht=Ht+Math.imul(dn,Sn)|0,Ut=Ut+Math.imul(an,Fn)|0,Pt=Pt+Math.imul(an,Yn)|0,Pt=Pt+Math.imul(Yt,Fn)|0,Ht=Ht+Math.imul(Yt,Yn)|0;var Pr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Ut=Math.imul(On,Vn),Pt=Math.imul(On,Gn),Pt=Pt+Math.imul(Bn,Vn)|0,Ht=Math.imul(Bn,Gn),Ut=Ut+Math.imul(Kt,Zn)|0,Pt=Pt+Math.imul(Kt,Wn)|0,Pt=Pt+Math.imul(kn,Zn)|0,Ht=Ht+Math.imul(kn,Wn)|0,Ut=Ut+Math.imul(jn,ur)|0,Pt=Pt+Math.imul(jn,wr)|0,Pt=Pt+Math.imul(cn,ur)|0,Ht=Ht+Math.imul(cn,wr)|0,Ut=Ut+Math.imul(hn,Er)|0,Pt=Pt+Math.imul(hn,Ir)|0,Pt=Pt+Math.imul(fn,Er)|0,Ht=Ht+Math.imul(fn,Ir)|0,Ut=Ut+Math.imul(Tn,Or)|0,Pt=Pt+Math.imul(Tn,Lr)|0,Pt=Pt+Math.imul(In,Or)|0,Ht=Ht+Math.imul(In,Lr)|0,Ut=Ut+Math.imul(En,qr)|0,Pt=Pt+Math.imul(En,jr)|0,Pt=Pt+Math.imul(sn,qr)|0,Ht=Ht+Math.imul(sn,jr)|0,Ut=Ut+Math.imul(Cn,_n)|0,Pt=Pt+Math.imul(Cn,Pn)|0,Pt=Pt+Math.imul($n,_n)|0,Ht=Ht+Math.imul($n,Pn)|0,Ut=Ut+Math.imul(rn,Zt)|0,Pt=Pt+Math.imul(rn,Sn)|0,Pt=Pt+Math.imul(Jt,Zt)|0,Ht=Ht+Math.imul(Jt,Sn)|0,Ut=Ut+Math.imul(tn,Fn)|0,Pt=Pt+Math.imul(tn,Yn)|0,Pt=Pt+Math.imul(dn,Fn)|0,Ht=Ht+Math.imul(dn,Yn)|0,Ut=Ut+Math.imul(an,ar)|0,Pt=Pt+Math.imul(an,lr)|0,Pt=Pt+Math.imul(Yt,ar)|0,Ht=Ht+Math.imul(Yt,lr)|0;var Fr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Ut=Math.imul(On,Zn),Pt=Math.imul(On,Wn),Pt=Pt+Math.imul(Bn,Zn)|0,Ht=Math.imul(Bn,Wn),Ut=Ut+Math.imul(Kt,ur)|0,Pt=Pt+Math.imul(Kt,wr)|0,Pt=Pt+Math.imul(kn,ur)|0,Ht=Ht+Math.imul(kn,wr)|0,Ut=Ut+Math.imul(jn,Er)|0,Pt=Pt+Math.imul(jn,Ir)|0,Pt=Pt+Math.imul(cn,Er)|0,Ht=Ht+Math.imul(cn,Ir)|0,Ut=Ut+Math.imul(hn,Or)|0,Pt=Pt+Math.imul(hn,Lr)|0,Pt=Pt+Math.imul(fn,Or)|0,Ht=Ht+Math.imul(fn,Lr)|0,Ut=Ut+Math.imul(Tn,qr)|0,Pt=Pt+Math.imul(Tn,jr)|0,Pt=Pt+Math.imul(In,qr)|0,Ht=Ht+Math.imul(In,jr)|0,Ut=Ut+Math.imul(En,_n)|0,Pt=Pt+Math.imul(En,Pn)|0,Pt=Pt+Math.imul(sn,_n)|0,Ht=Ht+Math.imul(sn,Pn)|0,Ut=Ut+Math.imul(Cn,Zt)|0,Pt=Pt+Math.imul(Cn,Sn)|0,Pt=Pt+Math.imul($n,Zt)|0,Ht=Ht+Math.imul($n,Sn)|0,Ut=Ut+Math.imul(rn,Fn)|0,Pt=Pt+Math.imul(rn,Yn)|0,Pt=Pt+Math.imul(Jt,Fn)|0,Ht=Ht+Math.imul(Jt,Yn)|0,Ut=Ut+Math.imul(tn,ar)|0,Pt=Pt+Math.imul(tn,lr)|0,Pt=Pt+Math.imul(dn,ar)|0,Ht=Ht+Math.imul(dn,lr)|0;var Mr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,Ut=Math.imul(On,ur),Pt=Math.imul(On,wr),Pt=Pt+Math.imul(Bn,ur)|0,Ht=Math.imul(Bn,wr),Ut=Ut+Math.imul(Kt,Er)|0,Pt=Pt+Math.imul(Kt,Ir)|0,Pt=Pt+Math.imul(kn,Er)|0,Ht=Ht+Math.imul(kn,Ir)|0,Ut=Ut+Math.imul(jn,Or)|0,Pt=Pt+Math.imul(jn,Lr)|0,Pt=Pt+Math.imul(cn,Or)|0,Ht=Ht+Math.imul(cn,Lr)|0,Ut=Ut+Math.imul(hn,qr)|0,Pt=Pt+Math.imul(hn,jr)|0,Pt=Pt+Math.imul(fn,qr)|0,Ht=Ht+Math.imul(fn,jr)|0,Ut=Ut+Math.imul(Tn,_n)|0,Pt=Pt+Math.imul(Tn,Pn)|0,Pt=Pt+Math.imul(In,_n)|0,Ht=Ht+Math.imul(In,Pn)|0,Ut=Ut+Math.imul(En,Zt)|0,Pt=Pt+Math.imul(En,Sn)|0,Pt=Pt+Math.imul(sn,Zt)|0,Ht=Ht+Math.imul(sn,Sn)|0,Ut=Ut+Math.imul(Cn,Fn)|0,Pt=Pt+Math.imul(Cn,Yn)|0,Pt=Pt+Math.imul($n,Fn)|0,Ht=Ht+Math.imul($n,Yn)|0,Ut=Ut+Math.imul(rn,ar)|0,Pt=Pt+Math.imul(rn,lr)|0,Pt=Pt+Math.imul(Jt,ar)|0,Ht=Ht+Math.imul(Jt,lr)|0;var Cr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Ut=Math.imul(On,Er),Pt=Math.imul(On,Ir),Pt=Pt+Math.imul(Bn,Er)|0,Ht=Math.imul(Bn,Ir),Ut=Ut+Math.imul(Kt,Or)|0,Pt=Pt+Math.imul(Kt,Lr)|0,Pt=Pt+Math.imul(kn,Or)|0,Ht=Ht+Math.imul(kn,Lr)|0,Ut=Ut+Math.imul(jn,qr)|0,Pt=Pt+Math.imul(jn,jr)|0,Pt=Pt+Math.imul(cn,qr)|0,Ht=Ht+Math.imul(cn,jr)|0,Ut=Ut+Math.imul(hn,_n)|0,Pt=Pt+Math.imul(hn,Pn)|0,Pt=Pt+Math.imul(fn,_n)|0,Ht=Ht+Math.imul(fn,Pn)|0,Ut=Ut+Math.imul(Tn,Zt)|0,Pt=Pt+Math.imul(Tn,Sn)|0,Pt=Pt+Math.imul(In,Zt)|0,Ht=Ht+Math.imul(In,Sn)|0,Ut=Ut+Math.imul(En,Fn)|0,Pt=Pt+Math.imul(En,Yn)|0,Pt=Pt+Math.imul(sn,Fn)|0,Ht=Ht+Math.imul(sn,Yn)|0,Ut=Ut+Math.imul(Cn,ar)|0,Pt=Pt+Math.imul(Cn,lr)|0,Pt=Pt+Math.imul($n,ar)|0,Ht=Ht+Math.imul($n,lr)|0;var Dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Ut=Math.imul(On,Or),Pt=Math.imul(On,Lr),Pt=Pt+Math.imul(Bn,Or)|0,Ht=Math.imul(Bn,Lr),Ut=Ut+Math.imul(Kt,qr)|0,Pt=Pt+Math.imul(Kt,jr)|0,Pt=Pt+Math.imul(kn,qr)|0,Ht=Ht+Math.imul(kn,jr)|0,Ut=Ut+Math.imul(jn,_n)|0,Pt=Pt+Math.imul(jn,Pn)|0,Pt=Pt+Math.imul(cn,_n)|0,Ht=Ht+Math.imul(cn,Pn)|0,Ut=Ut+Math.imul(hn,Zt)|0,Pt=Pt+Math.imul(hn,Sn)|0,Pt=Pt+Math.imul(fn,Zt)|0,Ht=Ht+Math.imul(fn,Sn)|0,Ut=Ut+Math.imul(Tn,Fn)|0,Pt=Pt+Math.imul(Tn,Yn)|0,Pt=Pt+Math.imul(In,Fn)|0,Ht=Ht+Math.imul(In,Yn)|0,Ut=Ut+Math.imul(En,ar)|0,Pt=Pt+Math.imul(En,lr)|0,Pt=Pt+Math.imul(sn,ar)|0,Ht=Ht+Math.imul(sn,lr)|0;var Ur=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,Ut=Math.imul(On,qr),Pt=Math.imul(On,jr),Pt=Pt+Math.imul(Bn,qr)|0,Ht=Math.imul(Bn,jr),Ut=Ut+Math.imul(Kt,_n)|0,Pt=Pt+Math.imul(Kt,Pn)|0,Pt=Pt+Math.imul(kn,_n)|0,Ht=Ht+Math.imul(kn,Pn)|0,Ut=Ut+Math.imul(jn,Zt)|0,Pt=Pt+Math.imul(jn,Sn)|0,Pt=Pt+Math.imul(cn,Zt)|0,Ht=Ht+Math.imul(cn,Sn)|0,Ut=Ut+Math.imul(hn,Fn)|0,Pt=Pt+Math.imul(hn,Yn)|0,Pt=Pt+Math.imul(fn,Fn)|0,Ht=Ht+Math.imul(fn,Yn)|0,Ut=Ut+Math.imul(Tn,ar)|0,Pt=Pt+Math.imul(Tn,lr)|0,Pt=Pt+Math.imul(In,ar)|0,Ht=Ht+Math.imul(In,lr)|0;var Rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,Ut=Math.imul(On,_n),Pt=Math.imul(On,Pn),Pt=Pt+Math.imul(Bn,_n)|0,Ht=Math.imul(Bn,Pn),Ut=Ut+Math.imul(Kt,Zt)|0,Pt=Pt+Math.imul(Kt,Sn)|0,Pt=Pt+Math.imul(kn,Zt)|0,Ht=Ht+Math.imul(kn,Sn)|0,Ut=Ut+Math.imul(jn,Fn)|0,Pt=Pt+Math.imul(jn,Yn)|0,Pt=Pt+Math.imul(cn,Fn)|0,Ht=Ht+Math.imul(cn,Yn)|0,Ut=Ut+Math.imul(hn,ar)|0,Pt=Pt+Math.imul(hn,lr)|0,Pt=Pt+Math.imul(fn,ar)|0,Ht=Ht+Math.imul(fn,lr)|0;var er=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(er>>>26)|0,er&=67108863,Ut=Math.imul(On,Zt),Pt=Math.imul(On,Sn),Pt=Pt+Math.imul(Bn,Zt)|0,Ht=Math.imul(Bn,Sn),Ut=Ut+Math.imul(Kt,Fn)|0,Pt=Pt+Math.imul(Kt,Yn)|0,Pt=Pt+Math.imul(kn,Fn)|0,Ht=Ht+Math.imul(kn,Yn)|0,Ut=Ut+Math.imul(jn,ar)|0,Pt=Pt+Math.imul(jn,lr)|0,Pt=Pt+Math.imul(cn,ar)|0,Ht=Ht+Math.imul(cn,lr)|0;var rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(rr>>>26)|0,rr&=67108863,Ut=Math.imul(On,Fn),Pt=Math.imul(On,Yn),Pt=Pt+Math.imul(Bn,Fn)|0,Ht=Math.imul(Bn,Yn),Ut=Ut+Math.imul(Kt,ar)|0,Pt=Pt+Math.imul(Kt,lr)|0,Pt=Pt+Math.imul(kn,ar)|0,Ht=Ht+Math.imul(kn,lr)|0;var xr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Ut=Math.imul(On,ar),Pt=Math.imul(On,lr),Pt=Pt+Math.imul(Bn,ar)|0,Ht=Math.imul(Bn,lr);var dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;return Nt=(Ht+(Pt>>>13)|0)+(dr>>>26)|0,dr&=67108863,Ft[0]=Vr,Ft[1]=vr,Ft[2]=Nr,Ft[3]=Hr,Ft[4]=eo,Ft[5]=Zr,Ft[6]=Jr,Ft[7]=br,Ft[8]=Pr,Ft[9]=Fr,Ft[10]=Mr,Ft[11]=Cr,Ft[12]=Dr,Ft[13]=Ur,Ft[14]=Rr,Ft[15]=er,Ft[16]=rr,Ft[17]=xr,Ft[18]=dr,Nt!==0&&(Ft[19]=Nt,Ot.length++),Ot};Math.imul||(wt=bt);function xt($t,vt,It){It.negative=vt.negative^$t.negative,It.length=$t.length+vt.length;for(var Ot=0,Wt=0,zt=0;zt>>26)|0,Wt+=Ft>>>26,Ft&=67108863}It.words[zt]=Nt,Ot=Ft,Ft=Wt}return Ot!==0?It.words[zt]=Ot:It.length--,It._strip()}function kt($t,vt,It){return xt($t,vt,It)}ot.prototype.mulTo=function(vt,It){var Ot,Wt=this.length+vt.length;return this.length===10&&vt.length===10?Ot=wt(this,vt,It):Wt<63?Ot=bt(this,vt,It):Wt<1024?Ot=xt(this,vt,It):Ot=kt(this,vt,It),Ot},ot.prototype.mul=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),this.mulTo(vt,It)},ot.prototype.mulf=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),kt(this,vt,It)},ot.prototype.imul=function(vt){return this.clone().mulTo(vt,this)},ot.prototype.imuln=function(vt){var It=vt<0;It&&(vt=-vt),rt(typeof vt=="number"),rt(vt<67108864);for(var Ot=0,Wt=0;Wt>=26,Ot+=zt/67108864|0,Ot+=Ft>>>26,this.words[Wt]=Ft&67108863}return Ot!==0&&(this.words[Wt]=Ot,this.length++),It?this.ineg():this},ot.prototype.muln=function(vt){return this.clone().imuln(vt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(vt){var It=yt(vt);if(It.length===0)return new ot(1);for(var Ot=this,Wt=0;Wt=0);var It=vt%26,Ot=(vt-It)/26,Wt=67108863>>>26-It<<26-It,zt;if(It!==0){var Ft=0;for(zt=0;zt>>26-It}Ft&&(this.words[zt]=Ft,this.length++)}if(Ot!==0){for(zt=this.length-1;zt>=0;zt--)this.words[zt+Ot]=this.words[zt];for(zt=0;zt=0);var Wt;It?Wt=(It-It%26)/26:Wt=0;var zt=vt%26,Ft=Math.min((vt-zt)/26,this.length),Nt=67108863^67108863>>>zt<Ft)for(this.length-=Ft,Pt=0;Pt=0&&(Ht!==0||Pt>=Wt);Pt--){var Qt=this.words[Pt]|0;this.words[Pt]=Ht<<26-zt|Qt>>>zt,Ht=Qt&Nt}return Ut&&Ht!==0&&(Ut.words[Ut.length++]=Ht),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(vt,It,Ot){return rt(this.negative===0),this.iushrn(vt,It,Ot)},ot.prototype.shln=function(vt){return this.clone().ishln(vt)},ot.prototype.ushln=function(vt){return this.clone().iushln(vt)},ot.prototype.shrn=function(vt){return this.clone().ishrn(vt)},ot.prototype.ushrn=function(vt){return this.clone().iushrn(vt)},ot.prototype.testn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=vt%26,Ot=(vt-It)/26,Wt=1<=0);var It=vt%26,Ot=(vt-It)/26;if(rt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ot)return this;if(It!==0&&Ot++,this.length=Math.min(Ot,this.length),It!==0){var Wt=67108863^67108863>>>It<=67108864;It++)this.words[It]-=67108864,It===this.length-1?this.words[It+1]=1:this.words[It+1]++;return this.length=Math.max(this.length,It+1),this},ot.prototype.isubn=function(vt){if(rt(typeof vt=="number"),rt(vt<67108864),vt<0)return this.iaddn(-vt);if(this.negative!==0)return this.negative=0,this.iaddn(vt),this.negative=1,this;if(this.words[0]-=vt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var It=0;It>26)-(Ut/67108864|0),this.words[zt+Ot]=Ft&67108863}for(;zt>26,this.words[zt+Ot]=Ft&67108863;if(Nt===0)return this._strip();for(rt(Nt===-1),Nt=0,zt=0;zt>26,this.words[zt]=Ft&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(vt,It){var Ot=this.length-vt.length,Wt=this.clone(),zt=vt,Ft=zt.words[zt.length-1]|0,Nt=this._countBits(Ft);Ot=26-Nt,Ot!==0&&(zt=zt.ushln(Ot),Wt.iushln(Ot),Ft=zt.words[zt.length-1]|0);var Ut=Wt.length-zt.length,Pt;if(It!=="mod"){Pt=new ot(null),Pt.length=Ut+1,Pt.words=new Array(Pt.length);for(var Ht=0;Ht=0;an--){var Yt=(Wt.words[zt.length+an]|0)*67108864+(Wt.words[zt.length+an-1]|0);for(Yt=Math.min(Yt/Ft|0,67108863),Wt._ishlnsubmul(zt,Yt,an);Wt.negative!==0;)Yt--,Wt.negative=0,Wt._ishlnsubmul(zt,1,an),Wt.isZero()||(Wt.negative^=1);Pt&&(Pt.words[an]=Yt)}return Pt&&Pt._strip(),Wt._strip(),It!=="div"&&Ot!==0&&Wt.iushrn(Ot),{div:Pt||null,mod:Wt}},ot.prototype.divmod=function(vt,It,Ot){if(rt(!vt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Wt,zt,Ft;return this.negative!==0&&vt.negative===0?(Ft=this.neg().divmod(vt,It),It!=="mod"&&(Wt=Ft.div.neg()),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.iadd(vt)),{div:Wt,mod:zt}):this.negative===0&&vt.negative!==0?(Ft=this.divmod(vt.neg(),It),It!=="mod"&&(Wt=Ft.div.neg()),{div:Wt,mod:Ft.mod}):this.negative&vt.negative?(Ft=this.neg().divmod(vt.neg(),It),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.isub(vt)),{div:Ft.div,mod:zt}):vt.length>this.length||this.cmp(vt)<0?{div:new ot(0),mod:this}:vt.length===1?It==="div"?{div:this.divn(vt.words[0]),mod:null}:It==="mod"?{div:null,mod:new ot(this.modrn(vt.words[0]))}:{div:this.divn(vt.words[0]),mod:new ot(this.modrn(vt.words[0]))}:this._wordDiv(vt,It)},ot.prototype.div=function(vt){return this.divmod(vt,"div",!1).div},ot.prototype.mod=function(vt){return this.divmod(vt,"mod",!1).mod},ot.prototype.umod=function(vt){return this.divmod(vt,"mod",!0).mod},ot.prototype.divRound=function(vt){var It=this.divmod(vt);if(It.mod.isZero())return It.div;var Ot=It.div.negative!==0?It.mod.isub(vt):It.mod,Wt=vt.ushrn(1),zt=vt.andln(1),Ft=Ot.cmp(Wt);return Ft<0||zt===1&&Ft===0?It.div:It.div.negative!==0?It.div.isubn(1):It.div.iaddn(1)},ot.prototype.modrn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=(1<<26)%vt,Wt=0,zt=this.length-1;zt>=0;zt--)Wt=(Ot*Wt+(this.words[zt]|0))%vt;return It?-Wt:Wt},ot.prototype.modn=function(vt){return this.modrn(vt)},ot.prototype.idivn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=0,Wt=this.length-1;Wt>=0;Wt--){var zt=(this.words[Wt]|0)+Ot*67108864;this.words[Wt]=zt/vt|0,Ot=zt%vt}return this._strip(),It?this.ineg():this},ot.prototype.divn=function(vt){return this.clone().idivn(vt)},ot.prototype.egcd=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=new ot(0),Nt=new ot(1),Ut=0;It.isEven()&&Ot.isEven();)It.iushrn(1),Ot.iushrn(1),++Ut;for(var Pt=Ot.clone(),Ht=It.clone();!It.isZero();){for(var Qt=0,an=1;!(It.words[0]&an)&&Qt<26;++Qt,an<<=1);if(Qt>0)for(It.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||zt.isOdd())&&(Wt.iadd(Pt),zt.isub(Ht)),Wt.iushrn(1),zt.iushrn(1);for(var Yt=0,nn=1;!(Ot.words[0]&nn)&&Yt<26;++Yt,nn<<=1);if(Yt>0)for(Ot.iushrn(Yt);Yt-- >0;)(Ft.isOdd()||Nt.isOdd())&&(Ft.iadd(Pt),Nt.isub(Ht)),Ft.iushrn(1),Nt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(Ft),zt.isub(Nt)):(Ot.isub(It),Ft.isub(Wt),Nt.isub(zt))}return{a:Ft,b:Nt,gcd:Ot.iushln(Ut)}},ot.prototype._invmp=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=Ot.clone();It.cmpn(1)>0&&Ot.cmpn(1)>0;){for(var Nt=0,Ut=1;!(It.words[0]&Ut)&&Nt<26;++Nt,Ut<<=1);if(Nt>0)for(It.iushrn(Nt);Nt-- >0;)Wt.isOdd()&&Wt.iadd(Ft),Wt.iushrn(1);for(var Pt=0,Ht=1;!(Ot.words[0]&Ht)&&Pt<26;++Pt,Ht<<=1);if(Pt>0)for(Ot.iushrn(Pt);Pt-- >0;)zt.isOdd()&&zt.iadd(Ft),zt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(zt)):(Ot.isub(It),zt.isub(Wt))}var Qt;return It.cmpn(1)===0?Qt=Wt:Qt=zt,Qt.cmpn(0)<0&&Qt.iadd(vt),Qt},ot.prototype.gcd=function(vt){if(this.isZero())return vt.abs();if(vt.isZero())return this.abs();var It=this.clone(),Ot=vt.clone();It.negative=0,Ot.negative=0;for(var Wt=0;It.isEven()&&Ot.isEven();Wt++)It.iushrn(1),Ot.iushrn(1);do{for(;It.isEven();)It.iushrn(1);for(;Ot.isEven();)Ot.iushrn(1);var zt=It.cmp(Ot);if(zt<0){var Ft=It;It=Ot,Ot=Ft}else if(zt===0||Ot.cmpn(1)===0)break;It.isub(Ot)}while(!0);return Ot.iushln(Wt)},ot.prototype.invm=function(vt){return this.egcd(vt).a.umod(vt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(vt){return this.words[0]&vt},ot.prototype.bincn=function(vt){rt(typeof vt=="number");var It=vt%26,Ot=(vt-It)/26,Wt=1<>>26,Nt&=67108863,this.words[Ft]=Nt}return zt!==0&&(this.words[Ft]=zt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(vt){var It=vt<0;if(this.negative!==0&&!It)return-1;if(this.negative===0&&It)return 1;this._strip();var Ot;if(this.length>1)Ot=1;else{It&&(vt=-vt),rt(vt<=67108863,"Number is too big");var Wt=this.words[0]|0;Ot=Wt===vt?0:Wtvt.length)return 1;if(this.length=0;Ot--){var Wt=this.words[Ot]|0,zt=vt.words[Ot]|0;if(Wt!==zt){Wtzt&&(It=1);break}}return It},ot.prototype.gtn=function(vt){return this.cmpn(vt)===1},ot.prototype.gt=function(vt){return this.cmp(vt)===1},ot.prototype.gten=function(vt){return this.cmpn(vt)>=0},ot.prototype.gte=function(vt){return this.cmp(vt)>=0},ot.prototype.ltn=function(vt){return this.cmpn(vt)===-1},ot.prototype.lt=function(vt){return this.cmp(vt)===-1},ot.prototype.lten=function(vt){return this.cmpn(vt)<=0},ot.prototype.lte=function(vt){return this.cmp(vt)<=0},ot.prototype.eqn=function(vt){return this.cmpn(vt)===0},ot.prototype.eq=function(vt){return this.cmp(vt)===0},ot.red=function(vt){return new jt(vt)},ot.prototype.toRed=function(vt){return rt(!this.red,"Already a number in reduction context"),rt(this.negative===0,"red works only with positives"),vt.convertTo(this)._forceRed(vt)},ot.prototype.fromRed=function(){return rt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(vt){return this.red=vt,this},ot.prototype.forceRed=function(vt){return rt(!this.red,"Already a number in reduction context"),this._forceRed(vt)},ot.prototype.redAdd=function(vt){return rt(this.red,"redAdd works only with red numbers"),this.red.add(this,vt)},ot.prototype.redIAdd=function(vt){return rt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,vt)},ot.prototype.redSub=function(vt){return rt(this.red,"redSub works only with red numbers"),this.red.sub(this,vt)},ot.prototype.redISub=function(vt){return rt(this.red,"redISub works only with red numbers"),this.red.isub(this,vt)},ot.prototype.redShl=function(vt){return rt(this.red,"redShl works only with red numbers"),this.red.shl(this,vt)},ot.prototype.redMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.mul(this,vt)},ot.prototype.redIMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.imul(this,vt)},ot.prototype.redSqr=function(){return rt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return rt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return rt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return rt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return rt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(vt){return rt(this.red&&!vt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,vt)};var St={k256:null,p224:null,p192:null,p25519:null};function Tt($t,vt){this.name=$t,this.p=new ot(vt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tt.prototype._tmp=function(){var vt=new ot(null);return vt.words=new Array(Math.ceil(this.n/13)),vt},Tt.prototype.ireduce=function(vt){var It=vt,Ot;do this.split(It,this.tmp),It=this.imulK(It),It=It.iadd(this.tmp),Ot=It.bitLength();while(Ot>this.n);var Wt=Ot0?It.isub(this.p):It.strip!==void 0?It.strip():It._strip(),It},Tt.prototype.split=function(vt,It){vt.iushrn(this.n,0,It)},Tt.prototype.imulK=function(vt){return vt.imul(this.k)};function At(){Tt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}it(At,Tt),At.prototype.split=function(vt,It){for(var Ot=4194303,Wt=Math.min(vt.length,9),zt=0;zt>>22,Ft=Nt}Ft>>>=22,vt.words[zt-10]=Ft,Ft===0&&vt.length>10?vt.length-=10:vt.length-=9},At.prototype.imulK=function(vt){vt.words[vt.length]=0,vt.words[vt.length+1]=0,vt.length+=2;for(var It=0,Ot=0;Ot>>=26,vt.words[Ot]=zt,It=Wt}return It!==0&&(vt.words[vt.length++]=It),vt},ot._prime=function(vt){if(St[vt])return St[vt];var It;if(vt==="k256")It=new At;else if(vt==="p224")It=new Et;else if(vt==="p192")It=new Ct;else if(vt==="p25519")It=new Lt;else throw new Error("Unknown prime "+vt);return St[vt]=It,It};function jt($t){if(typeof $t=="string"){var vt=ot._prime($t);this.m=vt.p,this.prime=vt}else rt($t.gtn(1),"modulus must be greater than 1"),this.m=$t,this.prime=null}jt.prototype._verify1=function(vt){rt(vt.negative===0,"red works only with positives"),rt(vt.red,"red works only with red numbers")},jt.prototype._verify2=function(vt,It){rt((vt.negative|It.negative)===0,"red works only with positives"),rt(vt.red&&vt.red===It.red,"red works only with red numbers")},jt.prototype.imod=function(vt){return this.prime?this.prime.ireduce(vt)._forceRed(this):(ut(vt,vt.umod(this.m)._forceRed(this)),vt)},jt.prototype.neg=function(vt){return vt.isZero()?vt.clone():this.m.sub(vt)._forceRed(this)},jt.prototype.add=function(vt,It){this._verify2(vt,It);var Ot=vt.add(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot._forceRed(this)},jt.prototype.iadd=function(vt,It){this._verify2(vt,It);var Ot=vt.iadd(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot},jt.prototype.sub=function(vt,It){this._verify2(vt,It);var Ot=vt.sub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot._forceRed(this)},jt.prototype.isub=function(vt,It){this._verify2(vt,It);var Ot=vt.isub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot},jt.prototype.shl=function(vt,It){return this._verify1(vt),this.imod(vt.ushln(It))},jt.prototype.imul=function(vt,It){return this._verify2(vt,It),this.imod(vt.imul(It))},jt.prototype.mul=function(vt,It){return this._verify2(vt,It),this.imod(vt.mul(It))},jt.prototype.isqr=function(vt){return this.imul(vt,vt.clone())},jt.prototype.sqr=function(vt){return this.mul(vt,vt)},jt.prototype.sqrt=function(vt){if(vt.isZero())return vt.clone();var It=this.m.andln(3);if(rt(It%2===1),It===3){var Ot=this.m.add(new ot(1)).iushrn(2);return this.pow(vt,Ot)}for(var Wt=this.m.subn(1),zt=0;!Wt.isZero()&&Wt.andln(1)===0;)zt++,Wt.iushrn(1);rt(!Wt.isZero());var Ft=new ot(1).toRed(this),Nt=Ft.redNeg(),Ut=this.m.subn(1).iushrn(1),Pt=this.m.bitLength();for(Pt=new ot(2*Pt*Pt).toRed(this);this.pow(Pt,Ut).cmp(Nt)!==0;)Pt.redIAdd(Nt);for(var Ht=this.pow(Pt,Wt),Qt=this.pow(vt,Wt.addn(1).iushrn(1)),an=this.pow(vt,Wt),Yt=zt;an.cmp(Ft)!==0;){for(var nn=an,tn=0;nn.cmp(Ft)!==0;tn++)nn=nn.redSqr();rt(tn=0;zt--){for(var Ht=It.words[zt],Qt=Pt-1;Qt>=0;Qt--){var an=Ht>>Qt&1;if(Ft!==Wt[0]&&(Ft=this.sqr(Ft)),an===0&&Nt===0){Ut=0;continue}Nt<<=1,Nt|=an,Ut++,!(Ut!==Ot&&(zt!==0||Qt!==0))&&(Ft=this.mul(Ft,Wt[Nt]),Ut=0,Nt=0)}Pt=26}return Ft},jt.prototype.convertTo=function(vt){var It=vt.umod(this.m);return It===vt?It.clone():It},jt.prototype.convertFrom=function(vt){var It=vt.clone();return It.red=null,It},ot.mont=function(vt){return new Rt(vt)};function Rt($t){jt.call(this,$t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it(Rt,jt),Rt.prototype.convertTo=function(vt){return this.imod(vt.ushln(this.shift))},Rt.prototype.convertFrom=function(vt){var It=this.imod(vt.mul(this.rinv));return It.red=null,It},Rt.prototype.imul=function(vt,It){if(vt.isZero()||It.isZero())return vt.words[0]=0,vt.length=1,vt;var Ot=vt.imul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.mul=function(vt,It){if(vt.isZero()||It.isZero())return new ot(0)._forceRed(this);var Ot=vt.mul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.invm=function(vt){var It=this.imod(vt._invmp(this.m).mul(this.r2));return It._forceRed(this)}})(tt,commonjsGlobal)})(bn);var bnExports=bn.exports,asn1$3={},asn1$2={},api$1={},encoders={},buffer$1=buffer$2,Buffer$d=buffer$1.Buffer,safer={},key;for(key in buffer$1)buffer$1.hasOwnProperty(key)&&(key==="SlowBuffer"||key==="Buffer"||(safer[key]=buffer$1[key]));var Safer=safer.Buffer={};for(key in Buffer$d)Buffer$d.hasOwnProperty(key)&&(key==="allocUnsafe"||key==="allocUnsafeSlow"||(Safer[key]=Buffer$d[key]));safer.Buffer.prototype=Buffer$d.prototype;(!Safer.from||Safer.from===Uint8Array.from)&&(Safer.from=function(tt,et,nt){if(typeof tt=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof tt);if(tt&&typeof tt.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof tt);return Buffer$d(tt,et,nt)});Safer.alloc||(Safer.alloc=function(tt,et,nt){if(typeof tt!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof tt);if(tt<0||tt>=2*(1<<30))throw new RangeError('The value "'+tt+'" is invalid for option "size"');var rt=Buffer$d(tt);return!et||et.length===0?rt.fill(0):typeof nt=="string"?rt.fill(et,nt):rt.fill(et),rt});if(!safer.kStringMaxLength)try{safer.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}safer.constants||(safer.constants={MAX_LENGTH:safer.kMaxLength},safer.kStringMaxLength&&(safer.constants.MAX_STRING_LENGTH=safer.kStringMaxLength));var safer_1=safer,reporter={};const inherits$5=inherits_browserExports;function Reporter$2(tt){this._reporterState={obj:null,path:[],options:tt||{},errors:[]}}reporter.Reporter=Reporter$2;Reporter$2.prototype.isError=function(et){return et instanceof ReporterError};Reporter$2.prototype.save=function(){const et=this._reporterState;return{obj:et.obj,pathLen:et.path.length}};Reporter$2.prototype.restore=function(et){const nt=this._reporterState;nt.obj=et.obj,nt.path=nt.path.slice(0,et.pathLen)};Reporter$2.prototype.enterKey=function(et){return this._reporterState.path.push(et)};Reporter$2.prototype.exitKey=function(et){const nt=this._reporterState;nt.path=nt.path.slice(0,et-1)};Reporter$2.prototype.leaveKey=function(et,nt,rt){const it=this._reporterState;this.exitKey(et),it.obj!==null&&(it.obj[nt]=rt)};Reporter$2.prototype.path=function(){return this._reporterState.path.join("/")};Reporter$2.prototype.enterObject=function(){const et=this._reporterState,nt=et.obj;return et.obj={},nt};Reporter$2.prototype.leaveObject=function(et){const nt=this._reporterState,rt=nt.obj;return nt.obj=et,rt};Reporter$2.prototype.error=function(et){let nt;const rt=this._reporterState,it=et instanceof ReporterError;if(it?nt=et:nt=new ReporterError(rt.path.map(function(ot){return"["+JSON.stringify(ot)+"]"}).join(""),et.message||et,et.stack),!rt.options.partial)throw nt;return it||rt.errors.push(nt),nt};Reporter$2.prototype.wrapResult=function(et){const nt=this._reporterState;return nt.options.partial?{result:this.isError(et)?null:et,errors:nt.errors}:et};function ReporterError(tt,et){this.path=tt,this.rethrow(et)}inherits$5(ReporterError,Error);ReporterError.prototype.rethrow=function(et){if(this.message=et+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(nt){this.stack=nt.stack}return this};var buffer={};const inherits$4=inherits_browserExports,Reporter$1=reporter.Reporter,Buffer$c=safer_1.Buffer;function DecoderBuffer$2(tt,et){if(Reporter$1.call(this,et),!Buffer$c.isBuffer(tt)){this.error("Input not Buffer");return}this.base=tt,this.offset=0,this.length=tt.length}inherits$4(DecoderBuffer$2,Reporter$1);buffer.DecoderBuffer=DecoderBuffer$2;DecoderBuffer$2.isDecoderBuffer=function(et){return et instanceof DecoderBuffer$2?!0:typeof et=="object"&&Buffer$c.isBuffer(et.base)&&et.constructor.name==="DecoderBuffer"&&typeof et.offset=="number"&&typeof et.length=="number"&&typeof et.save=="function"&&typeof et.restore=="function"&&typeof et.isEmpty=="function"&&typeof et.readUInt8=="function"&&typeof et.skip=="function"&&typeof et.raw=="function"};DecoderBuffer$2.prototype.save=function(){return{offset:this.offset,reporter:Reporter$1.prototype.save.call(this)}};DecoderBuffer$2.prototype.restore=function(et){const nt=new DecoderBuffer$2(this.base);return nt.offset=et.offset,nt.length=this.offset,this.offset=et.offset,Reporter$1.prototype.restore.call(this,et.reporter),nt};DecoderBuffer$2.prototype.isEmpty=function(){return this.offset===this.length};DecoderBuffer$2.prototype.readUInt8=function(et){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(et||"DecoderBuffer overrun")};DecoderBuffer$2.prototype.skip=function(et,nt){if(!(this.offset+et<=this.length))return this.error(nt||"DecoderBuffer overrun");const rt=new DecoderBuffer$2(this.base);return rt._reporterState=this._reporterState,rt.offset=this.offset,rt.length=this.offset+et,this.offset+=et,rt};DecoderBuffer$2.prototype.raw=function(et){return this.base.slice(et?et.offset:this.offset,this.length)};function EncoderBuffer$1(tt,et){if(Array.isArray(tt))this.length=0,this.value=tt.map(function(nt){return EncoderBuffer$1.isEncoderBuffer(nt)||(nt=new EncoderBuffer$1(nt,et)),this.length+=nt.length,nt},this);else if(typeof tt=="number"){if(!(0<=tt&&tt<=255))return et.error("non-byte EncoderBuffer value");this.value=tt,this.length=1}else if(typeof tt=="string")this.value=tt,this.length=Buffer$c.byteLength(tt);else if(Buffer$c.isBuffer(tt))this.value=tt,this.length=tt.length;else return et.error("Unsupported type: "+typeof tt)}buffer.EncoderBuffer=EncoderBuffer$1;EncoderBuffer$1.isEncoderBuffer=function(et){return et instanceof EncoderBuffer$1?!0:typeof et=="object"&&et.constructor.name==="EncoderBuffer"&&typeof et.length=="number"&&typeof et.join=="function"};EncoderBuffer$1.prototype.join=function(et,nt){return et||(et=Buffer$c.alloc(this.length)),nt||(nt=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(rt){rt.join(et,nt),nt+=rt.length}):(typeof this.value=="number"?et[nt]=this.value:typeof this.value=="string"?et.write(this.value,nt):Buffer$c.isBuffer(this.value)&&this.value.copy(et,nt),nt+=this.length)),et};const Reporter=reporter.Reporter,EncoderBuffer=buffer.EncoderBuffer,DecoderBuffer$1=buffer.DecoderBuffer,assert$5=minimalisticAssert,tags$1=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags$1),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node$3(tt,et,nt){const rt={};this._baseState=rt,rt.name=nt,rt.enc=tt,rt.parent=et||null,rt.children=null,rt.tag=null,rt.args=null,rt.reverseArgs=null,rt.choice=null,rt.optional=!1,rt.any=!1,rt.obj=!1,rt.use=null,rt.useDecoder=null,rt.key=null,rt.default=null,rt.explicit=null,rt.implicit=null,rt.contains=null,rt.parent||(rt.children=[],this._wrap())}var node$2=Node$3;const stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node$3.prototype.clone=function(){const et=this._baseState,nt={};stateProps.forEach(function(it){nt[it]=et[it]});const rt=new this.constructor(nt.parent);return rt._baseState=nt,rt};Node$3.prototype._wrap=function(){const et=this._baseState;methods.forEach(function(nt){this[nt]=function(){const it=new this.constructor(this);return et.children.push(it),it[nt].apply(it,arguments)}},this)};Node$3.prototype._init=function(et){const nt=this._baseState;assert$5(nt.parent===null),et.call(this),nt.children=nt.children.filter(function(rt){return rt._baseState.parent===this},this),assert$5.equal(nt.children.length,1,"Root node can have only one child")};Node$3.prototype._useArgs=function(et){const nt=this._baseState,rt=et.filter(function(it){return it instanceof this.constructor},this);et=et.filter(function(it){return!(it instanceof this.constructor)},this),rt.length!==0&&(assert$5(nt.children===null),nt.children=rt,rt.forEach(function(it){it._baseState.parent=this},this)),et.length!==0&&(assert$5(nt.args===null),nt.args=et,nt.reverseArgs=et.map(function(it){if(typeof it!="object"||it.constructor!==Object)return it;const ot={};return Object.keys(it).forEach(function(at){at==(at|0)&&(at|=0);const st=it[at];ot[st]=at}),ot}))};overrided.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState;throw new Error(tt+" not implemented for encoding: "+nt.enc)}});tags$1.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState,rt=Array.prototype.slice.call(arguments);return assert$5(nt.tag===null),nt.tag=tt,this._useArgs(rt),this}});Node$3.prototype.use=function(et){assert$5(et);const nt=this._baseState;return assert$5(nt.use===null),nt.use=et,this};Node$3.prototype.optional=function(){const et=this._baseState;return et.optional=!0,this};Node$3.prototype.def=function(et){const nt=this._baseState;return assert$5(nt.default===null),nt.default=et,nt.optional=!0,this};Node$3.prototype.explicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.explicit=et,this};Node$3.prototype.implicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.implicit=et,this};Node$3.prototype.obj=function(){const et=this._baseState,nt=Array.prototype.slice.call(arguments);return et.obj=!0,nt.length!==0&&this._useArgs(nt),this};Node$3.prototype.key=function(et){const nt=this._baseState;return assert$5(nt.key===null),nt.key=et,this};Node$3.prototype.any=function(){const et=this._baseState;return et.any=!0,this};Node$3.prototype.choice=function(et){const nt=this._baseState;return assert$5(nt.choice===null),nt.choice=et,this._useArgs(Object.keys(et).map(function(rt){return et[rt]})),this};Node$3.prototype.contains=function(et){const nt=this._baseState;return assert$5(nt.use===null),nt.contains=et,this};Node$3.prototype._decode=function(et,nt){const rt=this._baseState;if(rt.parent===null)return et.wrapResult(rt.children[0]._decode(et,nt));let it=rt.default,ot=!0,at=null;if(rt.key!==null&&(at=et.enterKey(rt.key)),rt.optional){let lt=null;if(rt.explicit!==null?lt=rt.explicit:rt.implicit!==null?lt=rt.implicit:rt.tag!==null&&(lt=rt.tag),lt===null&&!rt.any){const ct=et.save();try{rt.choice===null?this._decodeGeneric(rt.tag,et,nt):this._decodeChoice(et,nt),ot=!0}catch{ot=!1}et.restore(ct)}else if(ot=this._peekTag(et,lt,rt.any),et.isError(ot))return ot}let st;if(rt.obj&&ot&&(st=et.enterObject()),ot){if(rt.explicit!==null){const ct=this._decodeTag(et,rt.explicit);if(et.isError(ct))return ct;et=ct}const lt=et.offset;if(rt.use===null&&rt.choice===null){let ct;rt.any&&(ct=et.save());const ut=this._decodeTag(et,rt.implicit!==null?rt.implicit:rt.tag,rt.any);if(et.isError(ut))return ut;rt.any?it=et.raw(ct):et=ut}if(nt&&nt.track&&rt.tag!==null&&nt.track(et.path(),lt,et.length,"tagged"),nt&&nt.track&&rt.tag!==null&&nt.track(et.path(),et.offset,et.length,"content"),rt.any||(rt.choice===null?it=this._decodeGeneric(rt.tag,et,nt):it=this._decodeChoice(et,nt)),et.isError(it))return it;if(!rt.any&&rt.choice===null&&rt.children!==null&&rt.children.forEach(function(ut){ut._decode(et,nt)}),rt.contains&&(rt.tag==="octstr"||rt.tag==="bitstr")){const ct=new DecoderBuffer$1(it);it=this._getUse(rt.contains,et._reporterState.obj)._decode(ct,nt)}}return rt.obj&&ot&&(it=et.leaveObject(st)),rt.key!==null&&(it!==null||ot===!0)?et.leaveKey(at,rt.key,it):at!==null&&et.exitKey(at),it};Node$3.prototype._decodeGeneric=function(et,nt,rt){const it=this._baseState;return et==="seq"||et==="set"?null:et==="seqof"||et==="setof"?this._decodeList(nt,et,it.args[0],rt):/str$/.test(et)?this._decodeStr(nt,et,rt):et==="objid"&&it.args?this._decodeObjid(nt,it.args[0],it.args[1],rt):et==="objid"?this._decodeObjid(nt,null,null,rt):et==="gentime"||et==="utctime"?this._decodeTime(nt,et,rt):et==="null_"?this._decodeNull(nt,rt):et==="bool"?this._decodeBool(nt,rt):et==="objDesc"?this._decodeStr(nt,et,rt):et==="int"||et==="enum"?this._decodeInt(nt,it.args&&it.args[0],rt):it.use!==null?this._getUse(it.use,nt._reporterState.obj)._decode(nt,rt):nt.error("unknown tag: "+et)};Node$3.prototype._getUse=function(et,nt){const rt=this._baseState;return rt.useDecoder=this._use(et,nt),assert$5(rt.useDecoder._baseState.parent===null),rt.useDecoder=rt.useDecoder._baseState.children[0],rt.implicit!==rt.useDecoder._baseState.implicit&&(rt.useDecoder=rt.useDecoder.clone(),rt.useDecoder._baseState.implicit=rt.implicit),rt.useDecoder};Node$3.prototype._decodeChoice=function(et,nt){const rt=this._baseState;let it=null,ot=!1;return Object.keys(rt.choice).some(function(at){const st=et.save(),lt=rt.choice[at];try{const ct=lt._decode(et,nt);if(et.isError(ct))return!1;it={type:at,value:ct},ot=!0}catch{return et.restore(st),!1}return!0},this),ot?it:et.error("Choice not matched")};Node$3.prototype._createEncoderBuffer=function(et){return new EncoderBuffer(et,this.reporter)};Node$3.prototype._encode=function(et,nt,rt){const it=this._baseState;if(it.default!==null&&it.default===et)return;const ot=this._encodeValue(et,nt,rt);if(ot!==void 0&&!this._skipDefault(ot,nt,rt))return ot};Node$3.prototype._encodeValue=function(et,nt,rt){const it=this._baseState;if(it.parent===null)return it.children[0]._encode(et,nt||new Reporter);let ot=null;if(this.reporter=nt,it.optional&&et===void 0)if(it.default!==null)et=it.default;else return;let at=null,st=!1;if(it.any)ot=this._createEncoderBuffer(et);else if(it.choice)ot=this._encodeChoice(et,nt);else if(it.contains)at=this._getUse(it.contains,rt)._encode(et,nt),st=!0;else if(it.children)at=it.children.map(function(lt){if(lt._baseState.tag==="null_")return lt._encode(null,nt,et);if(lt._baseState.key===null)return nt.error("Child should have a key");const ct=nt.enterKey(lt._baseState.key);if(typeof et!="object")return nt.error("Child expected, but input is not object");const ut=lt._encode(et[lt._baseState.key],nt,et);return nt.leaveKey(ct),ut},this).filter(function(lt){return lt}),at=this._createEncoderBuffer(at);else if(it.tag==="seqof"||it.tag==="setof"){if(!(it.args&&it.args.length===1))return nt.error("Too many args for : "+it.tag);if(!Array.isArray(et))return nt.error("seqof/setof, but data is not Array");const lt=this.clone();lt._baseState.implicit=null,at=this._createEncoderBuffer(et.map(function(ct){const ut=this._baseState;return this._getUse(ut.args[0],et)._encode(ct,nt)},lt))}else it.use!==null?ot=this._getUse(it.use,rt)._encode(et,nt):(at=this._encodePrimitive(it.tag,et),st=!0);if(!it.any&&it.choice===null){const lt=it.implicit!==null?it.implicit:it.tag,ct=it.implicit===null?"universal":"context";lt===null?it.use===null&&nt.error("Tag could be omitted only for .use()"):it.use===null&&(ot=this._encodeComposite(lt,st,ct,at))}return it.explicit!==null&&(ot=this._encodeComposite(it.explicit,!1,"context",ot)),ot};Node$3.prototype._encodeChoice=function(et,nt){const rt=this._baseState,it=rt.choice[et.type];return it||assert$5(!1,et.type+" not found in "+JSON.stringify(Object.keys(rt.choice))),it._encode(et.value,nt)};Node$3.prototype._encodePrimitive=function(et,nt){const rt=this._baseState;if(/str$/.test(et))return this._encodeStr(nt,et);if(et==="objid"&&rt.args)return this._encodeObjid(nt,rt.reverseArgs[0],rt.args[1]);if(et==="objid")return this._encodeObjid(nt,null,null);if(et==="gentime"||et==="utctime")return this._encodeTime(nt,et);if(et==="null_")return this._encodeNull();if(et==="int"||et==="enum")return this._encodeInt(nt,rt.args&&rt.reverseArgs[0]);if(et==="bool")return this._encodeBool(nt);if(et==="objDesc")return this._encodeStr(nt,et);throw new Error("Unsupported tag: "+et)};Node$3.prototype._isNumstr=function(et){return/^[0-9 ]*$/.test(et)};Node$3.prototype._isPrintstr=function(et){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(et)};var der$2={};(function(tt){function et(nt){const rt={};return Object.keys(nt).forEach(function(it){(it|0)==it&&(it=it|0);const ot=nt[it];rt[ot]=it}),rt}tt.tagClass={0:"universal",1:"application",2:"context",3:"private"},tt.tagClassByName=et(tt.tagClass),tt.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},tt.tagByName=et(tt.tag)})(der$2);const inherits$3=inherits_browserExports,Buffer$b=safer_1.Buffer,Node$2=node$2,der$1=der$2;function DEREncoder$1(tt){this.enc="der",this.name=tt.name,this.entity=tt,this.tree=new DERNode$1,this.tree._init(tt.body)}var der_1$1=DEREncoder$1;DEREncoder$1.prototype.encode=function(et,nt){return this.tree._encode(et,nt).join()};function DERNode$1(tt){Node$2.call(this,"der",tt)}inherits$3(DERNode$1,Node$2);DERNode$1.prototype._encodeComposite=function(et,nt,rt,it){const ot=encodeTag(et,nt,rt,this.reporter);if(it.length<128){const lt=Buffer$b.alloc(2);return lt[0]=ot,lt[1]=it.length,this._createEncoderBuffer([lt,it])}let at=1;for(let lt=it.length;lt>=256;lt>>=8)at++;const st=Buffer$b.alloc(1+1+at);st[0]=ot,st[1]=128|at;for(let lt=1+at,ct=it.length;ct>0;lt--,ct>>=8)st[lt]=ct&255;return this._createEncoderBuffer([st,it])};DERNode$1.prototype._encodeStr=function(et,nt){if(nt==="bitstr")return this._createEncoderBuffer([et.unused|0,et.data]);if(nt==="bmpstr"){const rt=Buffer$b.alloc(et.length*2);for(let it=0;it=40)return this.reporter.error("Second objid identifier OOB");et.splice(0,2,et[0]*40+et[1])}let it=0;for(let st=0;st=128;lt>>=7)it++}const ot=Buffer$b.alloc(it);let at=ot.length-1;for(let st=et.length-1;st>=0;st--){let lt=et[st];for(ot[at--]=lt&127;(lt>>=7)>0;)ot[at--]=128|lt&127}return this._createEncoderBuffer(ot)};function two(tt){return tt<10?"0"+tt:tt}DERNode$1.prototype._encodeTime=function(et,nt){let rt;const it=new Date(et);return nt==="gentime"?rt=[two(it.getUTCFullYear()),two(it.getUTCMonth()+1),two(it.getUTCDate()),two(it.getUTCHours()),two(it.getUTCMinutes()),two(it.getUTCSeconds()),"Z"].join(""):nt==="utctime"?rt=[two(it.getUTCFullYear()%100),two(it.getUTCMonth()+1),two(it.getUTCDate()),two(it.getUTCHours()),two(it.getUTCMinutes()),two(it.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+nt+" time is not supported yet"),this._encodeStr(rt,"octstr")};DERNode$1.prototype._encodeNull=function(){return this._createEncoderBuffer("")};DERNode$1.prototype._encodeInt=function(et,nt){if(typeof et=="string"){if(!nt)return this.reporter.error("String int or enum given, but no values map");if(!nt.hasOwnProperty(et))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(et));et=nt[et]}if(typeof et!="number"&&!Buffer$b.isBuffer(et)){const ot=et.toArray();!et.sign&&ot[0]&128&&ot.unshift(0),et=Buffer$b.from(ot)}if(Buffer$b.isBuffer(et)){let ot=et.length;et.length===0&&ot++;const at=Buffer$b.alloc(ot);return et.copy(at),et.length===0&&(at[0]=0),this._createEncoderBuffer(at)}if(et<128)return this._createEncoderBuffer(et);if(et<256)return this._createEncoderBuffer([0,et]);let rt=1;for(let ot=et;ot>=256;ot>>=8)rt++;const it=new Array(rt);for(let ot=it.length-1;ot>=0;ot--)it[ot]=et&255,et>>=8;return it[0]&128&&it.unshift(0),this._createEncoderBuffer(Buffer$b.from(it))};DERNode$1.prototype._encodeBool=function(et){return this._createEncoderBuffer(et?255:0)};DERNode$1.prototype._use=function(et,nt){return typeof et=="function"&&(et=et(nt)),et._getEncoder("der").tree};DERNode$1.prototype._skipDefault=function(et,nt,rt){const it=this._baseState;let ot;if(it.default===null)return!1;const at=et.join();if(it.defaultBuffer===void 0&&(it.defaultBuffer=this._encodeValue(it.default,nt,rt).join()),at.length!==it.defaultBuffer.length)return!1;for(ot=0;ot=31?rt.error("Multi-octet tag encoding unsupported"):(et||(it|=32),it|=der$1.tagClassByName[nt||"universal"]<<6,it)}const inherits$2=inherits_browserExports,DEREncoder=der_1$1;function PEMEncoder(tt){DEREncoder.call(this,tt),this.enc="pem"}inherits$2(PEMEncoder,DEREncoder);var pem$1=PEMEncoder;PEMEncoder.prototype.encode=function(et,nt){const it=DEREncoder.prototype.encode.call(this,et).toString("base64"),ot=["-----BEGIN "+nt.label+"-----"];for(let at=0;atMAX_UINT32)throw new RangeError("requested too many random bytes");var nt=Buffer$H.allocUnsafe(tt);if(tt>0)if(tt>MAX_BYTES)for(var rt=0;rt0&&(at=nt[0]),at instanceof Error)throw at;var st=new Error("Unhandled error."+(at?" ("+at.message+")":""));throw st.context=at,st}var lt=ot[et];if(lt===void 0)return!1;if(typeof lt=="function")ReflectApply(lt,this,nt);else for(var ct=lt.length,ut=arrayClone(lt,ct),rt=0;rt0&&at.length>it&&!at.warned){at.warned=!0;var st=new Error("Possible EventEmitter memory leak detected. "+at.length+" "+String(et)+" listeners added. Use emitter.setMaxListeners() to increase limit");st.name="MaxListenersExceededWarning",st.emitter=tt,st.type=et,st.count=at.length,ProcessEmitWarning(st)}return tt}EventEmitter$1.prototype.addListener=function(et,nt){return _addListener(this,et,nt,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function(et,nt){return _addListener(this,et,nt,!0)};function onceWrapper(){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 _onceWrap(tt,et,nt){var rt={fired:!1,wrapFn:void 0,target:tt,type:et,listener:nt},it=onceWrapper.bind(rt);return it.listener=nt,rt.wrapFn=it,it}EventEmitter$1.prototype.once=function(et,nt){return checkListener(nt),this.on(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.prependOnceListener=function(et,nt){return checkListener(nt),this.prependListener(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.removeListener=function(et,nt){var rt,it,ot,at,st;if(checkListener(nt),it=this._events,it===void 0)return this;if(rt=it[et],rt===void 0)return this;if(rt===nt||rt.listener===nt)--this._eventsCount===0?this._events=Object.create(null):(delete it[et],it.removeListener&&this.emit("removeListener",et,rt.listener||nt));else if(typeof rt!="function"){for(ot=-1,at=rt.length-1;at>=0;at--)if(rt[at]===nt||rt[at].listener===nt){st=rt[at].listener,ot=at;break}if(ot<0)return this;ot===0?rt.shift():spliceOne(rt,ot),rt.length===1&&(it[et]=rt[0]),it.removeListener!==void 0&&this.emit("removeListener",et,st||nt)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function(et){var nt,rt,it;if(rt=this._events,rt===void 0)return this;if(rt.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):rt[et]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete rt[et]),this;if(arguments.length===0){var ot=Object.keys(rt),at;for(it=0;it=0;it--)this.removeListener(et,nt[it]);return this};function _listeners$1(tt,et,nt){var rt=tt._events;if(rt===void 0)return[];var it=rt[et];return it===void 0?[]:typeof it=="function"?nt?[it.listener||it]:[it]:nt?unwrapListeners(it):arrayClone(it,it.length)}EventEmitter$1.prototype.listeners=function(et){return _listeners$1(this,et,!0)};EventEmitter$1.prototype.rawListeners=function(et){return _listeners$1(this,et,!1)};EventEmitter$1.listenerCount=function(tt,et){return typeof tt.listenerCount=="function"?tt.listenerCount(et):listenerCount.call(tt,et)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(tt){var et=this._events;if(et!==void 0){var nt=et[tt];if(typeof nt=="function")return 1;if(nt!==void 0)return nt.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(tt,et){for(var nt=new Array(et),rt=0;rt0?this.tail.next=bt:this.head=bt,this.tail=bt,++this.length}},{key:"unshift",value:function(yt){var bt={data:yt,next:this.head};this.length===0&&(this.tail=bt),this.head=bt,++this.length}},{key:"shift",value:function(){if(this.length!==0){var yt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,yt}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(yt){if(this.length===0)return"";for(var bt=this.head,wt=""+bt.data;bt=bt.next;)wt+=yt+bt.data;return wt}},{key:"concat",value:function(yt){if(this.length===0)return ct.alloc(0);for(var bt=ct.allocUnsafe(yt>>>0),wt=this.head,xt=0;wt;)pt(wt.data,bt,xt),xt+=wt.data.length,wt=wt.next;return bt}},{key:"consume",value:function(yt,bt){var wt;return ytkt.length?kt.length:yt;if(St===kt.length?xt+=kt:xt+=kt.slice(0,yt),yt-=St,yt===0){St===kt.length?(++wt,bt.next?this.head=bt.next:this.head=this.tail=null):(this.head=bt,bt.data=kt.slice(St));break}++wt}return this.length-=wt,xt}},{key:"_getBuffer",value:function(yt){var bt=ct.allocUnsafe(yt),wt=this.head,xt=1;for(wt.data.copy(bt),yt-=wt.data.length;wt=wt.next;){var kt=wt.data,St=yt>kt.length?kt.length:yt;if(kt.copy(bt,bt.length-yt,0,St),yt-=St,yt===0){St===kt.length?(++xt,wt.next?this.head=wt.next:this.head=this.tail=null):(this.head=wt,wt.data=kt.slice(St));break}++xt}return this.length-=xt,bt}},{key:dt,value:function(yt,bt){return ht(this,et(et({},bt),{},{depth:0,customInspect:!1}))}}]),mt}(),buffer_list}function destroy(tt,et){var nt=this,rt=this._readableState&&this._readableState.destroyed,it=this._writableState&&this._writableState.destroyed;return rt||it?(et?et(tt):tt&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(emitErrorNT,this,tt)):process.nextTick(emitErrorNT,this,tt)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(tt||null,function(ot){!et&&ot?nt._writableState?nt._writableState.errorEmitted?process.nextTick(emitCloseNT,nt):(nt._writableState.errorEmitted=!0,process.nextTick(emitErrorAndCloseNT,nt,ot)):process.nextTick(emitErrorAndCloseNT,nt,ot):et?(process.nextTick(emitCloseNT,nt),et(ot)):process.nextTick(emitCloseNT,nt)}),this)}function emitErrorAndCloseNT(tt,et){emitErrorNT(tt,et),emitCloseNT(tt)}function emitCloseNT(tt){tt._writableState&&!tt._writableState.emitClose||tt._readableState&&!tt._readableState.emitClose||tt.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(tt,et){tt.emit("error",et)}function errorOrDestroy(tt,et){var nt=tt._readableState,rt=tt._writableState;nt&&nt.autoDestroy||rt&&rt.autoDestroy?tt.destroy(et):tt.emit("error",et)}var destroy_1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose$2(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,tt.__proto__=et}var codes={};function createErrorType(tt,et,nt){nt||(nt=Error);function rt(ot,at,st){return typeof et=="string"?et:et(ot,at,st)}var it=function(ot){_inheritsLoose$2(at,ot);function at(st,lt,ct){return ot.call(this,rt(st,lt,ct))||this}return at}(nt);it.prototype.name=nt.name,it.prototype.code=tt,codes[tt]=it}function oneOf(tt,et){if(Array.isArray(tt)){var nt=tt.length;return tt=tt.map(function(rt){return String(rt)}),nt>2?"one of ".concat(et," ").concat(tt.slice(0,nt-1).join(", "),", or ")+tt[nt-1]:nt===2?"one of ".concat(et," ").concat(tt[0]," or ").concat(tt[1]):"of ".concat(et," ").concat(tt[0])}else return"of ".concat(et," ").concat(String(tt))}function startsWith(tt,et,nt){return tt.substr(!nt||nt<0?0:+nt,et.length)===et}function endsWith(tt,et,nt){return(nt===void 0||nt>tt.length)&&(nt=tt.length),tt.substring(nt-et.length,nt)===et}function includes(tt,et,nt){return typeof nt!="number"&&(nt=0),nt+et.length>tt.length?!1:tt.indexOf(et,nt)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(tt,et){return'The value "'+et+'" is invalid for option "'+tt+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(tt,et,nt){var rt;typeof et=="string"&&startsWith(et,"not ")?(rt="must not be",et=et.replace(/^not /,"")):rt="must be";var it;if(endsWith(tt," argument"))it="The ".concat(tt," ").concat(rt," ").concat(oneOf(et,"type"));else{var ot=includes(tt,".")?"property":"argument";it='The "'.concat(tt,'" ').concat(ot," ").concat(rt," ").concat(oneOf(et,"type"))}return it+=". Received type ".concat(typeof nt),it},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(tt){return"The "+tt+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(tt){return"Cannot call "+tt+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(tt){return"Unknown encoding: "+tt},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(tt,et,nt){return tt.highWaterMark!=null?tt.highWaterMark:et?tt[nt]:null}function getHighWaterMark(tt,et,nt,rt){var it=highWaterMarkFrom(et,rt,nt);if(it!=null){if(!(isFinite(it)&&Math.floor(it)===it)||it<0){var ot=rt?nt:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(ot,it)}return Math.floor(it)}return tt.objectMode?16:16*1024}var state={getHighWaterMark},browser$a=deprecate;function deprecate(tt,et){if(config$2("noDeprecation"))return tt;var nt=!1;function rt(){if(!nt){if(config$2("throwDeprecation"))throw new Error(et);config$2("traceDeprecation")?console.trace(et):console.warn(et),nt=!0}return tt.apply(this,arguments)}return rt}function config$2(tt){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var et=commonjsGlobal.localStorage[tt];return et==null?!1:String(et).toLowerCase()==="true"}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1,_stream_writable=Et;function tt(Yt){var nn=this;this.next=null,this.entry=null,this.finish=function(){an(nn,Yt)}}var et;Et.WritableState=Tt;var nt={deprecate:browser$a},rt=streamBrowser,it=buffer$2.Buffer,ot=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function at(Yt){return it.from(Yt)}function st(Yt){return it.isBuffer(Yt)||Yt instanceof ot}var lt=destroy_1,ct=state,ut=ct.getHighWaterMark,ht=errorsBrowser.codes,dt=ht.ERR_INVALID_ARG_TYPE,pt=ht.ERR_METHOD_NOT_IMPLEMENTED,mt=ht.ERR_MULTIPLE_CALLBACK,gt=ht.ERR_STREAM_CANNOT_PIPE,yt=ht.ERR_STREAM_DESTROYED,bt=ht.ERR_STREAM_NULL_VALUES,wt=ht.ERR_STREAM_WRITE_AFTER_END,xt=ht.ERR_UNKNOWN_ENCODING,kt=lt.errorOrDestroy;inherits_browserExports(Et,rt);function St(){}function Tt(Yt,nn,tn){et=et||require_stream_duplex(),Yt=Yt||{},typeof tn!="boolean"&&(tn=nn instanceof et),this.objectMode=!!Yt.objectMode,tn&&(this.objectMode=this.objectMode||!!Yt.writableObjectMode),this.highWaterMark=ut(this,Yt,"writableHighWaterMark",tn),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var dn=Yt.decodeStrings===!1;this.decodeStrings=!dn,this.defaultEncoding=Yt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(wn){Ot(nn,wn)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Yt.emitClose!==!1,this.autoDestroy=!!Yt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new tt(this)}Tt.prototype.getBuffer=function(){for(var nn=this.bufferedRequest,tn=[];nn;)tn.push(nn),nn=nn.next;return tn},function(){try{Object.defineProperty(Tt.prototype,"buffer",{get:nt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var At;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(At=Function.prototype[Symbol.hasInstance],Object.defineProperty(Et,Symbol.hasInstance,{value:function(nn){return At.call(this,nn)?!0:this!==Et?!1:nn&&nn._writableState instanceof Tt}})):At=function(nn){return nn instanceof this};function Et(Yt){et=et||require_stream_duplex();var nn=this instanceof et;if(!nn&&!At.call(Et,this))return new Et(Yt);this._writableState=new Tt(Yt,this,nn),this.writable=!0,Yt&&(typeof Yt.write=="function"&&(this._write=Yt.write),typeof Yt.writev=="function"&&(this._writev=Yt.writev),typeof Yt.destroy=="function"&&(this._destroy=Yt.destroy),typeof Yt.final=="function"&&(this._final=Yt.final)),rt.call(this)}Et.prototype.pipe=function(){kt(this,new gt)};function Ct(Yt,nn){var tn=new wt;kt(Yt,tn),process.nextTick(nn,tn)}function Lt(Yt,nn,tn,dn){var wn;return tn===null?wn=new bt:typeof tn!="string"&&!nn.objectMode&&(wn=new dt("chunk",["string","Buffer"],tn)),wn?(kt(Yt,wn),process.nextTick(dn,wn),!1):!0}Et.prototype.write=function(Yt,nn,tn){var dn=this._writableState,wn=!1,rn=!dn.objectMode&&st(Yt);return rn&&!it.isBuffer(Yt)&&(Yt=at(Yt)),typeof nn=="function"&&(tn=nn,nn=null),rn?nn="buffer":nn||(nn=dn.defaultEncoding),typeof tn!="function"&&(tn=St),dn.ending?Ct(this,tn):(rn||Lt(this,dn,Yt,tn))&&(dn.pendingcb++,wn=Rt(this,dn,rn,Yt,nn,tn)),wn},Et.prototype.cork=function(){this._writableState.corked++},Et.prototype.uncork=function(){var Yt=this._writableState;Yt.corked&&(Yt.corked--,!Yt.writing&&!Yt.corked&&!Yt.bufferProcessing&&Yt.bufferedRequest&&Ft(this,Yt))},Et.prototype.setDefaultEncoding=function(nn){if(typeof nn=="string"&&(nn=nn.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((nn+"").toLowerCase())>-1))throw new xt(nn);return this._writableState.defaultEncoding=nn,this},Object.defineProperty(Et.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function jt(Yt,nn,tn){return!Yt.objectMode&&Yt.decodeStrings!==!1&&typeof nn=="string"&&(nn=it.from(nn,tn)),nn}Object.defineProperty(Et.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Rt(Yt,nn,tn,dn,wn,rn){if(!tn){var Zt=jt(nn,dn,wn);dn!==Zt&&(tn=!0,wn="buffer",dn=Zt)}var vn=nn.objectMode?1:dn.length;nn.length+=vn;var Cn=nn.length>5===6?2:tt>>4===14?3:tt>>3===30?4:tt>>6===2?-1:-2}function utf8CheckIncomplete(tt,et,nt){var rt=et.length-1;if(rt=0?(it>0&&(tt.lastNeed=it-1),it):--rt=0?(it>0&&(tt.lastNeed=it-2),it):--rt=0?(it>0&&(it===2?it=0:tt.lastNeed=it-3),it):0))}function utf8CheckExtraBytes(tt,et,nt){if((et[0]&192)!==128)return tt.lastNeed=0,"�";if(tt.lastNeed>1&&et.length>1){if((et[1]&192)!==128)return tt.lastNeed=1,"�";if(tt.lastNeed>2&&et.length>2&&(et[2]&192)!==128)return tt.lastNeed=2,"�"}}function utf8FillLast(tt){var et=this.lastTotal-this.lastNeed,nt=utf8CheckExtraBytes(this,tt);if(nt!==void 0)return nt;if(this.lastNeed<=tt.length)return tt.copy(this.lastChar,et,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);tt.copy(this.lastChar,et,0,tt.length),this.lastNeed-=tt.length}function utf8Text(tt,et){var nt=utf8CheckIncomplete(this,tt,et);if(!this.lastNeed)return tt.toString("utf8",et);this.lastTotal=nt;var rt=tt.length-(nt-this.lastNeed);return tt.copy(this.lastChar,0,rt),tt.toString("utf8",et,rt)}function utf8End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+"�":et}function utf16Text(tt,et){if((tt.length-et)%2===0){var nt=tt.toString("utf16le",et);if(nt){var rt=nt.charCodeAt(nt.length-1);if(rt>=55296&&rt<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1],nt.slice(0,-1)}return nt}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=tt[tt.length-1],tt.toString("utf16le",et,tt.length-1)}function utf16End(tt){var et=tt&&tt.length?this.write(tt):"";if(this.lastNeed){var nt=this.lastTotal-this.lastNeed;return et+this.lastChar.toString("utf16le",0,nt)}return et}function base64Text(tt,et){var nt=(tt.length-et)%3;return nt===0?tt.toString("base64",et):(this.lastNeed=3-nt,this.lastTotal=3,nt===1?this.lastChar[0]=tt[tt.length-1]:(this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1]),tt.toString("base64",et,tt.length-nt))}function base64End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+this.lastChar.toString("base64",0,3-this.lastNeed):et}function simpleWrite(tt){return tt.toString(this.encoding)}function simpleEnd(tt){return tt&&tt.length?this.write(tt):""}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(tt){var et=!1;return function(){if(!et){et=!0;for(var nt=arguments.length,rt=new Array(nt),it=0;it0)if(typeof Zt!="string"&&!Nn.objectMode&&Object.getPrototypeOf(Zt)!==rt.prototype&&(Zt=ot(Zt)),Cn)Nn.endEmitted?St(rn,new bt):jt(rn,Nn,Zt,!0);else if(Nn.ended)St(rn,new gt);else{if(Nn.destroyed)return!1;Nn.reading=!1,Nn.decoder&&!vn?(Zt=Nn.decoder.write(Zt),Nn.objectMode||Zt.length!==0?jt(rn,Nn,Zt,!1):Ft(rn,Nn)):jt(rn,Nn,Zt,!1)}else Cn||(Nn.reading=!1,Ft(rn,Nn))}return!Nn.ended&&(Nn.length=$t?rn=$t:(rn--,rn|=rn>>>1,rn|=rn>>>2,rn|=rn>>>4,rn|=rn>>>8,rn|=rn>>>16,rn++),rn}function It(rn,Zt){return rn<=0||Zt.length===0&&Zt.ended?0:Zt.objectMode?1:rn!==rn?Zt.flowing&&Zt.length?Zt.buffer.head.data.length:Zt.length:(rn>Zt.highWaterMark&&(Zt.highWaterMark=vt(rn)),rn<=Zt.length?rn:Zt.ended?Zt.length:(Zt.needReadable=!0,0))}Ct.prototype.read=function(rn){lt("read",rn),rn=parseInt(rn,10);var Zt=this._readableState,vn=rn;if(rn!==0&&(Zt.emittedReadable=!1),rn===0&&Zt.needReadable&&((Zt.highWaterMark!==0?Zt.length>=Zt.highWaterMark:Zt.length>0)||Zt.ended))return lt("read: emitReadable",Zt.length,Zt.ended),Zt.length===0&&Zt.ended?tn(this):Wt(this),null;if(rn=It(rn,Zt),rn===0&&Zt.ended)return Zt.length===0&&tn(this),null;var Cn=Zt.needReadable;lt("need readable",Cn),(Zt.length===0||Zt.length-rn0?$n=nn(rn,Zt):$n=null,$n===null?(Zt.needReadable=Zt.length<=Zt.highWaterMark,rn=0):(Zt.length-=rn,Zt.awaitDrain=0),Zt.length===0&&(Zt.ended||(Zt.needReadable=!0),vn!==rn&&Zt.ended&&tn(this)),$n!==null&&this.emit("data",$n),$n};function Ot(rn,Zt){if(lt("onEofChunk"),!Zt.ended){if(Zt.decoder){var vn=Zt.decoder.end();vn&&vn.length&&(Zt.buffer.push(vn),Zt.length+=Zt.objectMode?1:vn.length)}Zt.ended=!0,Zt.sync?Wt(rn):(Zt.needReadable=!1,Zt.emittedReadable||(Zt.emittedReadable=!0,zt(rn)))}}function Wt(rn){var Zt=rn._readableState;lt("emitReadable",Zt.needReadable,Zt.emittedReadable),Zt.needReadable=!1,Zt.emittedReadable||(lt("emitReadable",Zt.flowing),Zt.emittedReadable=!0,process.nextTick(zt,rn))}function zt(rn){var Zt=rn._readableState;lt("emitReadable_",Zt.destroyed,Zt.length,Zt.ended),!Zt.destroyed&&(Zt.length||Zt.ended)&&(rn.emit("readable"),Zt.emittedReadable=!1),Zt.needReadable=!Zt.flowing&&!Zt.ended&&Zt.length<=Zt.highWaterMark,Yt(rn)}function Ft(rn,Zt){Zt.readingMore||(Zt.readingMore=!0,process.nextTick(Nt,rn,Zt))}function Nt(rn,Zt){for(;!Zt.reading&&!Zt.ended&&(Zt.length1&&wn(Cn.pipes,rn)!==-1)&&!Tn&&(lt("false write response, pause",Cn.awaitDrain),Cn.awaitDrain++),vn.pause())}function hn(cn){lt("onerror",cn),jn(),rn.removeListener("error",hn),et(rn,"error")===0&&St(rn,cn)}At(rn,"error",hn);function fn(){rn.removeListener("finish",xn),jn()}rn.once("close",fn);function xn(){lt("onfinish"),rn.removeListener("close",fn),jn()}rn.once("finish",xn);function jn(){lt("unpipe"),vn.unpipe(rn)}return rn.emit("pipe",vn),Cn.flowing||(lt("pipe resume"),vn.resume()),rn};function Ut(rn){return function(){var vn=rn._readableState;lt("pipeOnDrain",vn.awaitDrain),vn.awaitDrain&&vn.awaitDrain--,vn.awaitDrain===0&&et(rn,"data")&&(vn.flowing=!0,Yt(rn))}}Ct.prototype.unpipe=function(rn){var Zt=this._readableState,vn={hasUnpiped:!1};if(Zt.pipesCount===0)return this;if(Zt.pipesCount===1)return rn&&rn!==Zt.pipes?this:(rn||(rn=Zt.pipes),Zt.pipes=null,Zt.pipesCount=0,Zt.flowing=!1,rn&&rn.emit("unpipe",this,vn),this);if(!rn){var Cn=Zt.pipes,$n=Zt.pipesCount;Zt.pipes=null,Zt.pipesCount=0,Zt.flowing=!1;for(var Nn=0;Nn<$n;Nn++)Cn[Nn].emit("unpipe",this,{hasUnpiped:!1});return this}var En=wn(Zt.pipes,rn);return En===-1?this:(Zt.pipes.splice(En,1),Zt.pipesCount-=1,Zt.pipesCount===1&&(Zt.pipes=Zt.pipes[0]),rn.emit("unpipe",this,vn),this)},Ct.prototype.on=function(rn,Zt){var vn=nt.prototype.on.call(this,rn,Zt),Cn=this._readableState;return rn==="data"?(Cn.readableListening=this.listenerCount("readable")>0,Cn.flowing!==!1&&this.resume()):rn==="readable"&&!Cn.endEmitted&&!Cn.readableListening&&(Cn.readableListening=Cn.needReadable=!0,Cn.flowing=!1,Cn.emittedReadable=!1,lt("on readable",Cn.length,Cn.reading),Cn.length?Wt(this):Cn.reading||process.nextTick(Ht,this)),vn},Ct.prototype.addListener=Ct.prototype.on,Ct.prototype.removeListener=function(rn,Zt){var vn=nt.prototype.removeListener.call(this,rn,Zt);return rn==="readable"&&process.nextTick(Pt,this),vn},Ct.prototype.removeAllListeners=function(rn){var Zt=nt.prototype.removeAllListeners.apply(this,arguments);return(rn==="readable"||rn===void 0)&&process.nextTick(Pt,this),Zt};function Pt(rn){var Zt=rn._readableState;Zt.readableListening=rn.listenerCount("readable")>0,Zt.resumeScheduled&&!Zt.paused?Zt.flowing=!0:rn.listenerCount("data")>0&&rn.resume()}function Ht(rn){lt("readable nexttick read 0"),rn.read(0)}Ct.prototype.resume=function(){var rn=this._readableState;return rn.flowing||(lt("resume"),rn.flowing=!rn.readableListening,Qt(this,rn)),rn.paused=!1,this};function Qt(rn,Zt){Zt.resumeScheduled||(Zt.resumeScheduled=!0,process.nextTick(an,rn,Zt))}function an(rn,Zt){lt("resume",Zt.reading),Zt.reading||rn.read(0),Zt.resumeScheduled=!1,rn.emit("resume"),Yt(rn),Zt.flowing&&!Zt.reading&&rn.read(0)}Ct.prototype.pause=function(){return lt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(lt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Yt(rn){var Zt=rn._readableState;for(lt("flow",Zt.flowing);Zt.flowing&&rn.read()!==null;);}Ct.prototype.wrap=function(rn){var Zt=this,vn=this._readableState,Cn=!1;rn.on("end",function(){if(lt("wrapped end"),vn.decoder&&!vn.ended){var En=vn.decoder.end();En&&En.length&&Zt.push(En)}Zt.push(null)}),rn.on("data",function(En){if(lt("wrapped data"),vn.decoder&&(En=vn.decoder.write(En)),!(vn.objectMode&&En==null)&&!(!vn.objectMode&&(!En||!En.length))){var sn=Zt.push(En);sn||(Cn=!0,rn.pause())}});for(var $n in rn)this[$n]===void 0&&typeof rn[$n]=="function"&&(this[$n]=function(sn){return function(){return rn[sn].apply(rn,arguments)}}($n));for(var Nn=0;Nn=Zt.length?(Zt.decoder?vn=Zt.buffer.join(""):Zt.buffer.length===1?vn=Zt.buffer.first():vn=Zt.buffer.concat(Zt.length),Zt.buffer.clear()):vn=Zt.buffer.consume(rn,Zt.decoder),vn}function tn(rn){var Zt=rn._readableState;lt("endReadable",Zt.endEmitted),Zt.endEmitted||(Zt.ended=!0,process.nextTick(dn,Zt,rn))}function dn(rn,Zt){if(lt("endReadableNT",rn.endEmitted,rn.length),!rn.endEmitted&&rn.length===0&&(rn.endEmitted=!0,Zt.readable=!1,Zt.emit("end"),rn.autoDestroy)){var vn=Zt._writableState;(!vn||vn.autoDestroy&&vn.finished)&&Zt.destroy()}}typeof Symbol=="function"&&(Ct.from=function(rn,Zt){return kt===void 0&&(kt=requireFromBrowser()),kt(Ct,rn,Zt)});function wn(rn,Zt){for(var vn=0,Cn=rn.length;vn0;return destroyer(at,lt,ct,function(ut){it||(it=ut),ut&&ot.forEach(call),!lt&&(ot.forEach(call),rt(it))})});return et.reduce(pipe$1)}var pipeline_1=pipeline;(function(tt,et){et=tt.exports=require_stream_readable(),et.Stream=et,et.Readable=et,et.Writable=require_stream_writable(),et.Duplex=require_stream_duplex(),et.Transform=_stream_transform,et.PassThrough=_stream_passthrough,et.finished=endOfStream,et.pipeline=pipeline_1})(readableBrowser,readableBrowser.exports);var readableBrowserExports=readableBrowser.exports,Buffer$F=safeBufferExports.Buffer,Transform$6=readableBrowserExports.Transform,inherits$v=inherits_browserExports;function throwIfNotStringOrBuffer(tt,et){if(!Buffer$F.isBuffer(tt)&&typeof tt!="string")throw new TypeError(et+" must be a string or a buffer")}function HashBase$2(tt){Transform$6.call(this),this._block=Buffer$F.allocUnsafe(tt),this._blockSize=tt,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$v(HashBase$2,Transform$6);HashBase$2.prototype._transform=function(tt,et,nt){var rt=null;try{this.update(tt,et)}catch(it){rt=it}nt(rt)};HashBase$2.prototype._flush=function(tt){var et=null;try{this.push(this.digest())}catch(nt){et=nt}tt(et)};HashBase$2.prototype.update=function(tt,et){if(throwIfNotStringOrBuffer(tt,"Data"),this._finalized)throw new Error("Digest already called");Buffer$F.isBuffer(tt)||(tt=Buffer$F.from(tt,et));for(var nt=this._block,rt=0;this._blockOffset+tt.length-rt>=this._blockSize;){for(var it=this._blockOffset;it0;++ot)this._length[ot]+=at,at=this._length[ot]/4294967296|0,at>0&&(this._length[ot]-=4294967296*at);return this};HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")};HashBase$2.prototype.digest=function(tt){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var et=this._digest();tt!==void 0&&(et=et.toString(tt)),this._block.fill(0),this._blockOffset=0;for(var nt=0;nt<4;++nt)this._length[nt]=0;return et};HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$u=inherits_browserExports,HashBase$1=hashBase,Buffer$E=safeBufferExports.Buffer,ARRAY16$1=new Array(16);function MD5$3(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$u(MD5$3,HashBase$1);MD5$3.prototype._update=function(){for(var tt=ARRAY16$1,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);var nt=this._a,rt=this._b,it=this._c,ot=this._d;nt=fnF(nt,rt,it,ot,tt[0],3614090360,7),ot=fnF(ot,nt,rt,it,tt[1],3905402710,12),it=fnF(it,ot,nt,rt,tt[2],606105819,17),rt=fnF(rt,it,ot,nt,tt[3],3250441966,22),nt=fnF(nt,rt,it,ot,tt[4],4118548399,7),ot=fnF(ot,nt,rt,it,tt[5],1200080426,12),it=fnF(it,ot,nt,rt,tt[6],2821735955,17),rt=fnF(rt,it,ot,nt,tt[7],4249261313,22),nt=fnF(nt,rt,it,ot,tt[8],1770035416,7),ot=fnF(ot,nt,rt,it,tt[9],2336552879,12),it=fnF(it,ot,nt,rt,tt[10],4294925233,17),rt=fnF(rt,it,ot,nt,tt[11],2304563134,22),nt=fnF(nt,rt,it,ot,tt[12],1804603682,7),ot=fnF(ot,nt,rt,it,tt[13],4254626195,12),it=fnF(it,ot,nt,rt,tt[14],2792965006,17),rt=fnF(rt,it,ot,nt,tt[15],1236535329,22),nt=fnG(nt,rt,it,ot,tt[1],4129170786,5),ot=fnG(ot,nt,rt,it,tt[6],3225465664,9),it=fnG(it,ot,nt,rt,tt[11],643717713,14),rt=fnG(rt,it,ot,nt,tt[0],3921069994,20),nt=fnG(nt,rt,it,ot,tt[5],3593408605,5),ot=fnG(ot,nt,rt,it,tt[10],38016083,9),it=fnG(it,ot,nt,rt,tt[15],3634488961,14),rt=fnG(rt,it,ot,nt,tt[4],3889429448,20),nt=fnG(nt,rt,it,ot,tt[9],568446438,5),ot=fnG(ot,nt,rt,it,tt[14],3275163606,9),it=fnG(it,ot,nt,rt,tt[3],4107603335,14),rt=fnG(rt,it,ot,nt,tt[8],1163531501,20),nt=fnG(nt,rt,it,ot,tt[13],2850285829,5),ot=fnG(ot,nt,rt,it,tt[2],4243563512,9),it=fnG(it,ot,nt,rt,tt[7],1735328473,14),rt=fnG(rt,it,ot,nt,tt[12],2368359562,20),nt=fnH(nt,rt,it,ot,tt[5],4294588738,4),ot=fnH(ot,nt,rt,it,tt[8],2272392833,11),it=fnH(it,ot,nt,rt,tt[11],1839030562,16),rt=fnH(rt,it,ot,nt,tt[14],4259657740,23),nt=fnH(nt,rt,it,ot,tt[1],2763975236,4),ot=fnH(ot,nt,rt,it,tt[4],1272893353,11),it=fnH(it,ot,nt,rt,tt[7],4139469664,16),rt=fnH(rt,it,ot,nt,tt[10],3200236656,23),nt=fnH(nt,rt,it,ot,tt[13],681279174,4),ot=fnH(ot,nt,rt,it,tt[0],3936430074,11),it=fnH(it,ot,nt,rt,tt[3],3572445317,16),rt=fnH(rt,it,ot,nt,tt[6],76029189,23),nt=fnH(nt,rt,it,ot,tt[9],3654602809,4),ot=fnH(ot,nt,rt,it,tt[12],3873151461,11),it=fnH(it,ot,nt,rt,tt[15],530742520,16),rt=fnH(rt,it,ot,nt,tt[2],3299628645,23),nt=fnI(nt,rt,it,ot,tt[0],4096336452,6),ot=fnI(ot,nt,rt,it,tt[7],1126891415,10),it=fnI(it,ot,nt,rt,tt[14],2878612391,15),rt=fnI(rt,it,ot,nt,tt[5],4237533241,21),nt=fnI(nt,rt,it,ot,tt[12],1700485571,6),ot=fnI(ot,nt,rt,it,tt[3],2399980690,10),it=fnI(it,ot,nt,rt,tt[10],4293915773,15),rt=fnI(rt,it,ot,nt,tt[1],2240044497,21),nt=fnI(nt,rt,it,ot,tt[8],1873313359,6),ot=fnI(ot,nt,rt,it,tt[15],4264355552,10),it=fnI(it,ot,nt,rt,tt[6],2734768916,15),rt=fnI(rt,it,ot,nt,tt[13],1309151649,21),nt=fnI(nt,rt,it,ot,tt[4],4149444226,6),ot=fnI(ot,nt,rt,it,tt[11],3174756917,10),it=fnI(it,ot,nt,rt,tt[2],718787259,15),rt=fnI(rt,it,ot,nt,tt[9],3951481745,21),this._a=this._a+nt|0,this._b=this._b+rt|0,this._c=this._c+it|0,this._d=this._d+ot|0};MD5$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$E.allocUnsafe(16);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt};function rotl$3(tt,et){return tt<>>32-et}function fnF(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(et&nt|~et&rt)+it+ot|0,at)+et|0}function fnG(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(et&rt|nt&~rt)+it+ot|0,at)+et|0}function fnH(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(et^nt^rt)+it+ot|0,at)+et|0}function fnI(tt,et,nt,rt,it,ot,at){return rotl$3(tt+(nt^(et|~rt))+it+ot|0,at)+et|0}var md5_js=MD5$3,Buffer$D=buffer$2.Buffer,inherits$t=inherits_browserExports,HashBase=hashBase,ARRAY16=new Array(16),zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$t(RIPEMD160$5,HashBase);RIPEMD160$5.prototype._update=function(){for(var tt=ARRAY16,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);for(var nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=this._a|0,lt=this._b|0,ct=this._c|0,ut=this._d|0,ht=this._e|0,dt=0;dt<80;dt+=1){var pt,mt;dt<16?(pt=fn1(nt,rt,it,ot,at,tt[zl[dt]],hl[0],sl[dt]),mt=fn5(st,lt,ct,ut,ht,tt[zr[dt]],hr[0],sr[dt])):dt<32?(pt=fn2(nt,rt,it,ot,at,tt[zl[dt]],hl[1],sl[dt]),mt=fn4(st,lt,ct,ut,ht,tt[zr[dt]],hr[1],sr[dt])):dt<48?(pt=fn3(nt,rt,it,ot,at,tt[zl[dt]],hl[2],sl[dt]),mt=fn3(st,lt,ct,ut,ht,tt[zr[dt]],hr[2],sr[dt])):dt<64?(pt=fn4(nt,rt,it,ot,at,tt[zl[dt]],hl[3],sl[dt]),mt=fn2(st,lt,ct,ut,ht,tt[zr[dt]],hr[3],sr[dt])):(pt=fn5(nt,rt,it,ot,at,tt[zl[dt]],hl[4],sl[dt]),mt=fn1(st,lt,ct,ut,ht,tt[zr[dt]],hr[4],sr[dt])),nt=at,at=ot,ot=rotl$2(it,10),it=rt,rt=pt,st=ht,ht=ut,ut=rotl$2(ct,10),ct=lt,lt=mt}var gt=this._b+it+ut|0;this._b=this._c+ot+ht|0,this._c=this._d+at+st|0,this._d=this._e+nt+lt|0,this._e=this._a+rt+ct|0,this._a=gt};RIPEMD160$5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$D.alloc?Buffer$D.alloc(20):new Buffer$D(20);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt.writeInt32LE(this._e,16),tt};function rotl$2(tt,et){return tt<>>32-et}function fn1(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et^nt^rt)+ot+at|0,st)+it|0}function fn2(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et&nt|~et&rt)+ot+at|0,st)+it|0}function fn3(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+((et|~nt)^rt)+ot+at|0,st)+it|0}function fn4(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et&rt|nt&~rt)+ot+at|0,st)+it|0}function fn5(tt,et,nt,rt,it,ot,at,st){return rotl$2(tt+(et^(nt|~rt))+ot+at|0,st)+it|0}var ripemd160$1=RIPEMD160$5,sha_js={exports:{}},Buffer$C=safeBufferExports.Buffer;function Hash$9(tt,et){this._block=Buffer$C.alloc(tt),this._finalSize=et,this._blockSize=tt,this._len=0}Hash$9.prototype.update=function(tt,et){typeof tt=="string"&&(et=et||"utf8",tt=Buffer$C.from(tt,et));for(var nt=this._block,rt=this._blockSize,it=tt.length,ot=this._len,at=0;at=this._finalSize&&(this._update(this._block),this._block.fill(0));var nt=this._len*8;if(nt<=4294967295)this._block.writeUInt32BE(nt,this._blockSize-4);else{var rt=(nt&4294967295)>>>0,it=(nt-rt)/4294967296;this._block.writeUInt32BE(it,this._blockSize-8),this._block.writeUInt32BE(rt,this._blockSize-4)}this._update(this._block);var ot=this._hash();return tt?ot.toString(tt):ot};Hash$9.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$7=Hash$9,inherits$s=inherits_browserExports,Hash$8=hash$7,Buffer$B=safeBufferExports.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$8.call(this,64,56)}inherits$s(Sha,Hash$8);Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(tt){return tt<<5|tt>>>27}function rotl30$1(tt){return tt<<30|tt>>>2}function ft$1(tt,et,nt,rt){return tt===0?et&nt|~et&rt:tt===2?et&nt|et&rt|nt&rt:et^nt^rt}Sha.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=et[st-3]^et[st-8]^et[st-14]^et[st-16];for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5$1(nt)+ft$1(ct,rt,it,ot)+at+et[lt]+K$4[ct]|0;at=ot,ot=it,it=rotl30$1(rt),rt=nt,nt=ut}this._a=nt+this._a|0,this._b=rt+this._b|0,this._c=it+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha.prototype._hash=function(){var tt=Buffer$B.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha$4=Sha,inherits$r=inherits_browserExports,Hash$7=hash$7,Buffer$A=safeBufferExports.Buffer,K$3=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$7.call(this,64,56)}inherits$r(Sha1,Hash$7);Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(tt){return tt<<1|tt>>>31}function rotl5(tt){return tt<<5|tt>>>27}function rotl30(tt){return tt<<30|tt>>>2}function ft(tt,et,nt,rt){return tt===0?et&nt|~et&rt:tt===2?et&nt|et&rt|nt&rt:et^nt^rt}Sha1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=rotl1(et[st-3]^et[st-8]^et[st-14]^et[st-16]);for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5(nt)+ft(ct,rt,it,ot)+at+et[lt]+K$3[ct]|0;at=ot,ot=it,it=rotl30(rt),rt=nt,nt=ut}this._a=nt+this._a|0,this._b=rt+this._b|0,this._c=it+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha1.prototype._hash=function(){var tt=Buffer$A.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha1$1=Sha1,inherits$q=inherits_browserExports,Hash$6=hash$7,Buffer$z=safeBufferExports.Buffer,K$2=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$6.call(this,64,56)}inherits$q(Sha256$1,Hash$6);Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(tt,et,nt){return nt^tt&(et^nt)}function maj$1(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0$1(tt){return(tt>>>2|tt<<30)^(tt>>>13|tt<<19)^(tt>>>22|tt<<10)}function sigma1$1(tt){return(tt>>>6|tt<<26)^(tt>>>11|tt<<21)^(tt>>>25|tt<<7)}function gamma0(tt){return(tt>>>7|tt<<25)^(tt>>>18|tt<<14)^tt>>>3}function gamma1(tt){return(tt>>>17|tt<<15)^(tt>>>19|tt<<13)^tt>>>10}Sha256$1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,rt=this._b|0,it=this._c|0,ot=this._d|0,at=this._e|0,st=this._f|0,lt=this._g|0,ct=this._h|0,ut=0;ut<16;++ut)et[ut]=tt.readInt32BE(ut*4);for(;ut<64;++ut)et[ut]=gamma1(et[ut-2])+et[ut-7]+gamma0(et[ut-15])+et[ut-16]|0;for(var ht=0;ht<64;++ht){var dt=ct+sigma1$1(at)+ch(at,st,lt)+K$2[ht]+et[ht]|0,pt=sigma0$1(nt)+maj$1(nt,rt,it)|0;ct=lt,lt=st,st=at,at=ot+dt|0,ot=it,it=rt,rt=nt,nt=dt+pt|0}this._a=nt+this._a|0,this._b=rt+this._b|0,this._c=it+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0,this._f=st+this._f|0,this._g=lt+this._g|0,this._h=ct+this._h|0};Sha256$1.prototype._hash=function(){var tt=Buffer$z.allocUnsafe(32);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt.writeInt32BE(this._h,28),tt};var sha256$4=Sha256$1,inherits$p=inherits_browserExports,Sha256=sha256$4,Hash$5=hash$7,Buffer$y=safeBufferExports.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$5.call(this,64,56)}inherits$p(Sha224,Sha256);Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Sha224.prototype._hash=function(){var tt=Buffer$y.allocUnsafe(28);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt};var sha224$1=Sha224,inherits$o=inherits_browserExports,Hash$4=hash$7,Buffer$x=safeBufferExports.Buffer,K$1=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$4.call(this,128,112)}inherits$o(Sha512,Hash$4);Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(tt,et,nt){return nt^tt&(et^nt)}function maj(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0(tt,et){return(tt>>>28|et<<4)^(et>>>2|tt<<30)^(et>>>7|tt<<25)}function sigma1(tt,et){return(tt>>>14|et<<18)^(tt>>>18|et<<14)^(et>>>9|tt<<23)}function Gamma0(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^tt>>>7}function Gamma0l(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^(tt>>>7|et<<25)}function Gamma1(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^tt>>>6}function Gamma1l(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^(tt>>>6|et<<26)}function getCarry(tt,et){return tt>>>0>>0?1:0}Sha512.prototype._update=function(tt){for(var et=this._w,nt=this._ah|0,rt=this._bh|0,it=this._ch|0,ot=this._dh|0,at=this._eh|0,st=this._fh|0,lt=this._gh|0,ct=this._hh|0,ut=this._al|0,ht=this._bl|0,dt=this._cl|0,pt=this._dl|0,mt=this._el|0,gt=this._fl|0,yt=this._gl|0,bt=this._hl|0,wt=0;wt<32;wt+=2)et[wt]=tt.readInt32BE(wt*4),et[wt+1]=tt.readInt32BE(wt*4+4);for(;wt<160;wt+=2){var xt=et[wt-30],kt=et[wt-15*2+1],St=Gamma0(xt,kt),Tt=Gamma0l(kt,xt);xt=et[wt-2*2],kt=et[wt-2*2+1];var At=Gamma1(xt,kt),Et=Gamma1l(kt,xt),Ct=et[wt-7*2],Lt=et[wt-7*2+1],jt=et[wt-16*2],Rt=et[wt-16*2+1],$t=Tt+Lt|0,vt=St+Ct+getCarry($t,Tt)|0;$t=$t+Et|0,vt=vt+At+getCarry($t,Et)|0,$t=$t+Rt|0,vt=vt+jt+getCarry($t,Rt)|0,et[wt]=vt,et[wt+1]=$t}for(var It=0;It<160;It+=2){vt=et[It],$t=et[It+1];var Ot=maj(nt,rt,it),Wt=maj(ut,ht,dt),zt=sigma0(nt,ut),Ft=sigma0(ut,nt),Nt=sigma1(at,mt),Ut=sigma1(mt,at),Pt=K$1[It],Ht=K$1[It+1],Qt=Ch(at,st,lt),an=Ch(mt,gt,yt),Yt=bt+Ut|0,nn=ct+Nt+getCarry(Yt,bt)|0;Yt=Yt+an|0,nn=nn+Qt+getCarry(Yt,an)|0,Yt=Yt+Ht|0,nn=nn+Pt+getCarry(Yt,Ht)|0,Yt=Yt+$t|0,nn=nn+vt+getCarry(Yt,$t)|0;var tn=Ft+Wt|0,dn=zt+Ot+getCarry(tn,Ft)|0;ct=lt,bt=yt,lt=st,yt=gt,st=at,gt=mt,mt=pt+Yt|0,at=ot+nn+getCarry(mt,pt)|0,ot=it,pt=dt,it=rt,dt=ht,rt=nt,ht=ut,ut=Yt+tn|0,nt=nn+dn+getCarry(ut,Yt)|0}this._al=this._al+ut|0,this._bl=this._bl+ht|0,this._cl=this._cl+dt|0,this._dl=this._dl+pt|0,this._el=this._el+mt|0,this._fl=this._fl+gt|0,this._gl=this._gl+yt|0,this._hl=this._hl+bt|0,this._ah=this._ah+nt+getCarry(this._al,ut)|0,this._bh=this._bh+rt+getCarry(this._bl,ht)|0,this._ch=this._ch+it+getCarry(this._cl,dt)|0,this._dh=this._dh+ot+getCarry(this._dl,pt)|0,this._eh=this._eh+at+getCarry(this._el,mt)|0,this._fh=this._fh+st+getCarry(this._fl,gt)|0,this._gh=this._gh+lt+getCarry(this._gl,yt)|0,this._hh=this._hh+ct+getCarry(this._hl,bt)|0};Sha512.prototype._hash=function(){var tt=Buffer$x.allocUnsafe(64);function et(nt,rt,it){tt.writeInt32BE(nt,it),tt.writeInt32BE(rt,it+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),et(this._gh,this._gl,48),et(this._hh,this._hl,56),tt};var sha512$1=Sha512,inherits$n=inherits_browserExports,SHA512$2=sha512$1,Hash$3=hash$7,Buffer$w=safeBufferExports.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$3.call(this,128,112)}inherits$n(Sha384,SHA512$2);Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Sha384.prototype._hash=function(){var tt=Buffer$w.allocUnsafe(48);function et(nt,rt,it){tt.writeInt32BE(nt,it),tt.writeInt32BE(rt,it+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),tt};var sha384$1=Sha384,exports=sha_js.exports=function(et){et=et.toLowerCase();var nt=exports[et];if(!nt)throw new Error(et+" is not supported (we accept pull requests)");return new nt};exports.sha=sha$4;exports.sha1=sha1$1;exports.sha224=sha224$1;exports.sha256=sha256$4;exports.sha384=sha384$1;exports.sha512=sha512$1;var sha_jsExports=sha_js.exports,streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$m=inherits_browserExports;inherits$m(Stream,EE);Stream.Readable=require_stream_readable();Stream.Writable=require_stream_writable();Stream.Duplex=require_stream_duplex();Stream.Transform=_stream_transform;Stream.PassThrough=_stream_passthrough;Stream.finished=endOfStream;Stream.pipeline=pipeline_1;Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(tt,et){var nt=this;function rt(ut){tt.writable&&tt.write(ut)===!1&&nt.pause&&nt.pause()}nt.on("data",rt);function it(){nt.readable&&nt.resume&&nt.resume()}tt.on("drain",it),!tt._isStdio&&(!et||et.end!==!1)&&(nt.on("end",at),nt.on("close",st));var ot=!1;function at(){ot||(ot=!0,tt.end())}function st(){ot||(ot=!0,typeof tt.destroy=="function"&&tt.destroy())}function lt(ut){if(ct(),EE.listenerCount(this,"error")===0)throw ut}nt.on("error",lt),tt.on("error",lt);function ct(){nt.removeListener("data",rt),tt.removeListener("drain",it),nt.removeListener("end",at),nt.removeListener("close",st),nt.removeListener("error",lt),tt.removeListener("error",lt),nt.removeListener("end",ct),nt.removeListener("close",ct),tt.removeListener("close",ct)}return nt.on("end",ct),nt.on("close",ct),tt.on("close",ct),tt.emit("pipe",nt),tt};var Buffer$v=safeBufferExports.Buffer,Transform$5=streamBrowserify.Transform,StringDecoder=string_decoder.StringDecoder,inherits$l=inherits_browserExports;function CipherBase$1(tt){Transform$5.call(this),this.hashMode=typeof tt=="string",this.hashMode?this[tt]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$l(CipherBase$1,Transform$5);CipherBase$1.prototype.update=function(tt,et,nt){typeof tt=="string"&&(tt=Buffer$v.from(tt,et));var rt=this._update(tt);return this.hashMode?this:(nt&&(rt=this._toString(rt,nt)),rt)};CipherBase$1.prototype.setAutoPadding=function(){};CipherBase$1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};CipherBase$1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};CipherBase$1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};CipherBase$1.prototype._transform=function(tt,et,nt){var rt;try{this.hashMode?this._update(tt):this.push(this._update(tt))}catch(it){rt=it}finally{nt(rt)}};CipherBase$1.prototype._flush=function(tt){var et;try{this.push(this.__final())}catch(nt){et=nt}tt(et)};CipherBase$1.prototype._finalOrDigest=function(tt){var et=this.__final()||Buffer$v.alloc(0);return tt&&(et=this._toString(et,tt,!0)),et};CipherBase$1.prototype._toString=function(tt,et,nt){if(this._decoder||(this._decoder=new StringDecoder(et),this._encoding=et),this._encoding!==et)throw new Error("can't switch encodings");var rt=this._decoder.write(tt);return nt&&(rt+=this._decoder.end()),rt};var cipherBase=CipherBase$1,inherits$k=inherits_browserExports,MD5$2=md5_js,RIPEMD160$4=ripemd160$1,sha$3=sha_jsExports,Base$5=cipherBase;function Hash$2(tt){Base$5.call(this,"digest"),this._hash=tt}inherits$k(Hash$2,Base$5);Hash$2.prototype._update=function(tt){this._hash.update(tt)};Hash$2.prototype._final=function(){return this._hash.digest()};var browser$9=function(et){return et=et.toLowerCase(),et==="md5"?new MD5$2:et==="rmd160"||et==="ripemd160"?new RIPEMD160$4:new Hash$2(sha$3(et))},inherits$j=inherits_browserExports,Buffer$u=safeBufferExports.Buffer,Base$4=cipherBase,ZEROS$2=Buffer$u.alloc(128),blocksize=64;function Hmac$3(tt,et){Base$4.call(this,"digest"),typeof et=="string"&&(et=Buffer$u.from(et)),this._alg=tt,this._key=et,et.length>blocksize?et=tt(et):et.lengthnt){var rt=tt==="rmd160"?new RIPEMD160$3:sha$2(tt);et=rt.update(et).digest()}else et.lengthMAX_ALLOC||et!==et)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$s=safeBufferExports.Buffer,toBuffer$3=function(tt,et,nt){if(Buffer$s.isBuffer(tt))return tt;if(typeof tt=="string")return Buffer$s.from(tt,et);if(ArrayBuffer.isView(tt))return Buffer$s.from(tt.buffer);throw new TypeError(nt+" must be a string, a Buffer, a typed array or a DataView")},md5=md5$2,RIPEMD160$2=ripemd160$1,sha$1=sha_jsExports,Buffer$r=safeBufferExports.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$2=toBuffer$3,ZEROS=Buffer$r.alloc(128),sizes={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$1(tt,et,nt){var rt=getDigest(tt),it=tt==="sha512"||tt==="sha384"?128:64;et.length>it?et=rt(et):et.length>>0};utils$q.writeUInt32BE=function(et,nt,rt){et[0+rt]=nt>>>24,et[1+rt]=nt>>>16&255,et[2+rt]=nt>>>8&255,et[3+rt]=nt&255};utils$q.ip=function(et,nt,rt,it){for(var ot=0,at=0,st=6;st>=0;st-=2){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>>lt+st&1}for(var st=6;st>=0;st-=2){for(var lt=1;lt<=25;lt+=8)at<<=1,at|=nt>>>lt+st&1;for(var lt=1;lt<=25;lt+=8)at<<=1,at|=et>>>lt+st&1}rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.rip=function(et,nt,rt,it){for(var ot=0,at=0,st=0;st<4;st++)for(var lt=24;lt>=0;lt-=8)ot<<=1,ot|=nt>>>lt+st&1,ot<<=1,ot|=et>>>lt+st&1;for(var st=4;st<8;st++)for(var lt=24;lt>=0;lt-=8)at<<=1,at|=nt>>>lt+st&1,at<<=1,at|=et>>>lt+st&1;rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.pc1=function(et,nt,rt,it){for(var ot=0,at=0,st=7;st>=5;st--){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var st=1;st<=3;st++){for(var lt=0;lt<=24;lt+=8)at<<=1,at|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1;rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.r28shl=function(et,nt){return et<>>28-nt};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$q.pc2=function(et,nt,rt,it){for(var ot=0,at=0,st=pc2table.length>>>1,lt=0;lt>>pc2table[lt]&1;for(var lt=st;lt>>pc2table[lt]&1;rt[it+0]=ot>>>0,rt[it+1]=at>>>0};utils$q.expand=function(et,nt,rt){var it=0,ot=0;it=(et&1)<<5|et>>>27;for(var at=23;at>=15;at-=4)it<<=6,it|=et>>>at&63;for(var at=11;at>=3;at-=4)ot|=et>>>at&63,ot<<=6;ot|=(et&31)<<1|et>>>31,nt[rt+0]=it>>>0,nt[rt+1]=ot>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$q.substitute=function(et,nt){for(var rt=0,it=0;it<4;it++){var ot=et>>>18-it*6&63,at=sTable[it*64+ot];rt<<=4,rt|=at}for(var it=0;it<4;it++){var ot=nt>>>18-it*6&63,at=sTable[4*64+it*64+ot];rt<<=4,rt|=at}return rt>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];utils$q.permute=function(et){for(var nt=0,rt=0;rt>>permuteTable[rt]&1;return nt>>>0};utils$q.padSplit=function(et,nt,rt){for(var it=et.toString(2);it.length0;it--)nt+=this._buffer(et,nt),rt+=this._flushBuffer(ot,rt);return nt+=this._buffer(et,nt),ot};Cipher$3.prototype.final=function(et){var nt;et&&(nt=this.update(et));var rt;return this.type==="encrypt"?rt=this._finalEncrypt():rt=this._finalDecrypt(),nt?nt.concat(rt):rt};Cipher$3.prototype._pad=function(et,nt){if(nt===0)return!1;for(;nt>>1];rt=utils$p.r28shl(rt,at),it=utils$p.r28shl(it,at),utils$p.pc2(rt,it,et.keys,ot)}};DES$3.prototype._update=function(et,nt,rt,it){var ot=this._desState,at=utils$p.readUInt32BE(et,nt),st=utils$p.readUInt32BE(et,nt+4);utils$p.ip(at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],this.type==="encrypt"?this._encrypt(ot,at,st,ot.tmp,0):this._decrypt(ot,at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],utils$p.writeUInt32BE(rt,at,it),utils$p.writeUInt32BE(rt,st,it+4)};DES$3.prototype._pad=function(et,nt){if(this.padding===!1)return!1;for(var rt=et.length-nt,it=nt;it>>0,at=pt}utils$p.rip(st,at,it,ot)};DES$3.prototype._decrypt=function(et,nt,rt,it,ot){for(var at=rt,st=nt,lt=et.keys.length-2;lt>=0;lt-=2){var ct=et.keys[lt],ut=et.keys[lt+1];utils$p.expand(at,et.tmp,0),ct^=et.tmp[0],ut^=et.tmp[1];var ht=utils$p.substitute(ct,ut),dt=utils$p.permute(ht),pt=at;at=(st^dt)>>>0,st=pt}utils$p.rip(at,st,it,ot)};var cbc$1={},assert$l=minimalisticAssert,inherits$g=inherits_browserExports,proto={};function CBCState(tt){assert$l.equal(tt.length,8,"Invalid IV length"),this.iv=new Array(8);for(var et=0;et>it%8,tt._prev=shiftIn(tt._prev,nt?st:lt);return at}function shiftIn(tt,et){var nt=tt.length,rt=-1,it=Buffer$m.allocUnsafe(tt.length);for(tt=Buffer$m.concat([tt,Buffer$m.from([et])]);++rt>7;return it}cfb1.encrypt=function(tt,et,nt){for(var rt=et.length,it=Buffer$m.allocUnsafe(rt),ot=-1;++ot>>24]^at[ut>>>16&255]^st[ht>>>8&255]^lt[dt&255]^et[bt++],mt=ot[ut>>>24]^at[ht>>>16&255]^st[dt>>>8&255]^lt[ct&255]^et[bt++],gt=ot[ht>>>24]^at[dt>>>16&255]^st[ct>>>8&255]^lt[ut&255]^et[bt++],yt=ot[dt>>>24]^at[ct>>>16&255]^st[ut>>>8&255]^lt[ht&255]^et[bt++],ct=pt,ut=mt,ht=gt,dt=yt;return pt=(rt[ct>>>24]<<24|rt[ut>>>16&255]<<16|rt[ht>>>8&255]<<8|rt[dt&255])^et[bt++],mt=(rt[ut>>>24]<<24|rt[ht>>>16&255]<<16|rt[dt>>>8&255]<<8|rt[ct&255])^et[bt++],gt=(rt[ht>>>24]<<24|rt[dt>>>16&255]<<16|rt[ct>>>8&255]<<8|rt[ut&255])^et[bt++],yt=(rt[dt>>>24]<<24|rt[ct>>>16&255]<<16|rt[ut>>>8&255]<<8|rt[ht&255])^et[bt++],pt=pt>>>0,mt=mt>>>0,gt=gt>>>0,yt=yt>>>0,[pt,mt,gt,yt]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var tt=new Array(256),et=0;et<256;et++)et<128?tt[et]=et<<1:tt[et]=et<<1^283;for(var nt=[],rt=[],it=[[],[],[],[]],ot=[[],[],[],[]],at=0,st=0,lt=0;lt<256;++lt){var ct=st^st<<1^st<<2^st<<3^st<<4;ct=ct>>>8^ct&255^99,nt[at]=ct,rt[ct]=at;var ut=tt[at],ht=tt[ut],dt=tt[ht],pt=tt[ct]*257^ct*16843008;it[0][at]=pt<<24|pt>>>8,it[1][at]=pt<<16|pt>>>16,it[2][at]=pt<<8|pt>>>24,it[3][at]=pt,pt=dt*16843009^ht*65537^ut*257^at*16843008,ot[0][ct]=pt<<24|pt>>>8,ot[1][ct]=pt<<16|pt>>>16,ot[2][ct]=pt<<8|pt>>>24,ot[3][ct]=pt,at===0?at=st=1:(at=ut^tt[tt[tt[dt^ut]]],st^=tt[tt[st]])}return{SBOX:nt,INV_SBOX:rt,SUB_MIX:it,INV_SUB_MIX:ot}}();function AES(tt){this._key=asUInt32Array(tt),this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){for(var tt=this._key,et=tt.length,nt=et+6,rt=(nt+1)*4,it=[],ot=0;ot>>24,at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255],at^=RCON[ot/et|0]<<24):et>6&&ot%et===4&&(at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255]),it[ot]=it[ot-et]^at}for(var st=[],lt=0;lt>>24]]^G.INV_SUB_MIX[1][G.SBOX[ut>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[ut>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[ut&255]]}this._nRounds=nt,this._keySchedule=it,this._invKeySchedule=st};AES.prototype.encryptBlockRaw=function(tt){return tt=asUInt32Array(tt),cryptBlock(tt,this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(tt){var et=this.encryptBlockRaw(tt),nt=Buffer$k.allocUnsafe(16);return nt.writeUInt32BE(et[0],0),nt.writeUInt32BE(et[1],4),nt.writeUInt32BE(et[2],8),nt.writeUInt32BE(et[3],12),nt};AES.prototype.decryptBlock=function(tt){tt=asUInt32Array(tt);var et=tt[1];tt[1]=tt[3],tt[3]=et;var nt=cryptBlock(tt,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),rt=Buffer$k.allocUnsafe(16);return rt.writeUInt32BE(nt[0],0),rt.writeUInt32BE(nt[3],4),rt.writeUInt32BE(nt[2],8),rt.writeUInt32BE(nt[1],12),rt};AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)};aes$5.AES=AES;var Buffer$j=safeBufferExports.Buffer,ZEROES=Buffer$j.alloc(16,0);function toArray$4(tt){return[tt.readUInt32BE(0),tt.readUInt32BE(4),tt.readUInt32BE(8),tt.readUInt32BE(12)]}function fromArray(tt){var et=Buffer$j.allocUnsafe(16);return et.writeUInt32BE(tt[0]>>>0,0),et.writeUInt32BE(tt[1]>>>0,4),et.writeUInt32BE(tt[2]>>>0,8),et.writeUInt32BE(tt[3]>>>0,12),et}function GHASH$1(tt){this.h=tt,this.state=Buffer$j.alloc(16,0),this.cache=Buffer$j.allocUnsafe(0)}GHASH$1.prototype.ghash=function(tt){for(var et=-1;++et0;nt--)tt[nt]=tt[nt]>>>1|(tt[nt-1]&1)<<31;tt[0]=tt[0]>>>1,it&&(tt[0]=tt[0]^225<<24)}this.state=fromArray(et)};GHASH$1.prototype.update=function(tt){this.cache=Buffer$j.concat([this.cache,tt]);for(var et;this.cache.length>=16;)et=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(et)};GHASH$1.prototype.final=function(tt,et){return this.cache.length&&this.ghash(Buffer$j.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,tt,0,et])),this.state};var ghash=GHASH$1,aes$4=aes$5,Buffer$i=safeBufferExports.Buffer,Transform$4=cipherBase,inherits$d=inherits_browserExports,GHASH=ghash,xor$3=bufferXor,incr32=incr32_1;function xorTest(tt,et){var nt=0;tt.length!==et.length&&nt++;for(var rt=Math.min(tt.length,et.length),it=0;it0||rt>0;){var lt=new MD5;lt.update(st),lt.update(tt),et&<.update(et),st=lt.digest();var ct=0;if(it>0){var ut=ot.length-it;ct=Math.min(it,st.length),st.copy(ot,ut,0,ct),it-=ct}if(ct0){var ht=at.length-rt,dt=Math.min(rt,st.length-ct);st.copy(at,ht,ct,ct+dt),rt-=dt}}return st.fill(0),{key:ot,iv:at}}var evp_bytestokey=EVP_BytesToKey,MODES$1=modes_1,AuthCipher$1=authCipher,Buffer$f=safeBufferExports.Buffer,StreamCipher$1=streamCipher,Transform$2=cipherBase,aes$2=aes$5,ebtk$2=evp_bytestokey,inherits$b=inherits_browserExports;function Cipher(tt,et,nt){Transform$2.call(this),this._cache=new Splitter$1,this._cipher=new aes$2.AES(et),this._prev=Buffer$f.from(nt),this._mode=tt,this._autopadding=!0}inherits$b(Cipher,Transform$2);Cipher.prototype._update=function(tt){this._cache.add(tt);for(var et,nt,rt=[];et=this._cache.get();)nt=this._mode.encrypt(this,et),rt.push(nt);return Buffer$f.concat(rt)};var PADDING=Buffer$f.alloc(16,16);Cipher.prototype._final=function(){var tt=this._cache.flush();if(this._autopadding)return tt=this._mode.encrypt(this,tt),this._cipher.scrub(),tt;if(!tt.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")};Cipher.prototype.setAutoPadding=function(tt){return this._autopadding=!!tt,this};function Splitter$1(){this.cache=Buffer$f.allocUnsafe(0)}Splitter$1.prototype.add=function(tt){this.cache=Buffer$f.concat([this.cache,tt])};Splitter$1.prototype.get=function(){if(this.cache.length>15){var tt=this.cache.slice(0,16);return this.cache=this.cache.slice(16),tt}return null};Splitter$1.prototype.flush=function(){for(var tt=16-this.cache.length,et=Buffer$f.allocUnsafe(tt),nt=-1;++nt16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et}else if(this.cache.length>=16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et;return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(tt){var et=tt[15];if(et<1||et>16)throw new Error("unable to decrypt data");for(var nt=-1;++nt0?Rt:$t},ot.min=function(Rt,$t){return Rt.cmp($t)<0?Rt:$t},ot.prototype._init=function(Rt,$t,vt){if(typeof Rt=="number")return this._initNumber(Rt,$t,vt);if(typeof Rt=="object")return this._initArray(Rt,$t,vt);$t==="hex"&&($t=16),rt($t===($t|0)&&$t>=2&&$t<=36),Rt=Rt.toString().replace(/\s+/g,"");var It=0;Rt[0]==="-"&&(It++,this.negative=1),It=0;It-=3)Wt=Rt[It]|Rt[It-1]<<8|Rt[It-2]<<16,this.words[Ot]|=Wt<>>26-zt&67108863,zt+=24,zt>=26&&(zt-=26,Ot++);else if(vt==="le")for(It=0,Ot=0;It>>26-zt&67108863,zt+=24,zt>=26&&(zt-=26,Ot++);return this.strip()};function st(jt,Rt){var $t=jt.charCodeAt(Rt);return $t>=65&&$t<=70?$t-55:$t>=97&&$t<=102?$t-87:$t-48&15}function lt(jt,Rt,$t){var vt=st(jt,$t);return $t-1>=Rt&&(vt|=st(jt,$t-1)<<4),vt}ot.prototype._parseHex=function(Rt,$t,vt){this.length=Math.ceil((Rt.length-$t)/6),this.words=new Array(this.length);for(var It=0;It=$t;It-=2)zt=lt(Rt,$t,It)<=18?(Ot-=18,Wt+=1,this.words[Wt]|=zt>>>26):Ot+=8;else{var Ft=Rt.length-$t;for(It=Ft%2===0?$t+1:$t;It=18?(Ot-=18,Wt+=1,this.words[Wt]|=zt>>>26):Ot+=8}this.strip()};function ct(jt,Rt,$t,vt){for(var It=0,Ot=Math.min(jt.length,$t),Wt=Rt;Wt=49?It+=zt-49+10:zt>=17?It+=zt-17+10:It+=zt}return It}ot.prototype._parseBase=function(Rt,$t,vt){this.words=[0],this.length=1;for(var It=0,Ot=1;Ot<=67108863;Ot*=$t)It++;It--,Ot=Ot/$t|0;for(var Wt=Rt.length-vt,zt=Wt%It,Ft=Math.min(Wt,Wt-zt)+vt,Nt=0,Ut=vt;Ut1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},ot.prototype.inspect=function(){return(this.red?""};var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],dt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(Rt,$t){Rt=Rt||10,$t=$t|0||1;var vt;if(Rt===16||Rt==="hex"){vt="";for(var It=0,Ot=0,Wt=0;Wt>>24-It&16777215,Ot!==0||Wt!==this.length-1?vt=ut[6-Ft.length]+Ft+vt:vt=Ft+vt,It+=2,It>=26&&(It-=26,Wt--)}for(Ot!==0&&(vt=Ot.toString(16)+vt);vt.length%$t!==0;)vt="0"+vt;return this.negative!==0&&(vt="-"+vt),vt}if(Rt===(Rt|0)&&Rt>=2&&Rt<=36){var Nt=ht[Rt],Ut=dt[Rt];vt="";var Pt=this.clone();for(Pt.negative=0;!Pt.isZero();){var Ht=Pt.modn(Ut).toString(Rt);Pt=Pt.idivn(Ut),Pt.isZero()?vt=Ht+vt:vt=ut[Nt-Ht.length]+Ht+vt}for(this.isZero()&&(vt="0"+vt);vt.length%$t!==0;)vt="0"+vt;return this.negative!==0&&(vt="-"+vt),vt}rt(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var Rt=this.words[0];return this.length===2?Rt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Rt+=4503599627370496+this.words[1]*67108864:this.length>2&&rt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Rt:Rt},ot.prototype.toJSON=function(){return this.toString(16)},ot.prototype.toBuffer=function(Rt,$t){return rt(typeof at<"u"),this.toArrayLike(at,Rt,$t)},ot.prototype.toArray=function(Rt,$t){return this.toArrayLike(Array,Rt,$t)},ot.prototype.toArrayLike=function(Rt,$t,vt){var It=this.byteLength(),Ot=vt||Math.max(1,It);rt(It<=Ot,"byte array longer than desired length"),rt(Ot>0,"Requested array length <= 0"),this.strip();var Wt=$t==="le",zt=new Rt(Ot),Ft,Nt,Ut=this.clone();if(Wt){for(Nt=0;!Ut.isZero();Nt++)Ft=Ut.andln(255),Ut.iushrn(8),zt[Nt]=Ft;for(;Nt=4096&&(vt+=13,$t>>>=13),$t>=64&&(vt+=7,$t>>>=7),$t>=8&&(vt+=4,$t>>>=4),$t>=2&&(vt+=2,$t>>>=2),vt+$t},ot.prototype._zeroBits=function(Rt){if(Rt===0)return 26;var $t=Rt,vt=0;return $t&8191||(vt+=13,$t>>>=13),$t&127||(vt+=7,$t>>>=7),$t&15||(vt+=4,$t>>>=4),$t&3||(vt+=2,$t>>>=2),$t&1||vt++,vt},ot.prototype.bitLength=function(){var Rt=this.words[this.length-1],$t=this._countBits(Rt);return(this.length-1)*26+$t};function pt(jt){for(var Rt=new Array(jt.bitLength()),$t=0;$t>>It}return Rt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Rt=0,$t=0;$tRt.length?this.clone().ior(Rt):Rt.clone().ior(this)},ot.prototype.uor=function(Rt){return this.length>Rt.length?this.clone().iuor(Rt):Rt.clone().iuor(this)},ot.prototype.iuand=function(Rt){var $t;this.length>Rt.length?$t=Rt:$t=this;for(var vt=0;vt<$t.length;vt++)this.words[vt]=this.words[vt]&Rt.words[vt];return this.length=$t.length,this.strip()},ot.prototype.iand=function(Rt){return rt((this.negative|Rt.negative)===0),this.iuand(Rt)},ot.prototype.and=function(Rt){return this.length>Rt.length?this.clone().iand(Rt):Rt.clone().iand(this)},ot.prototype.uand=function(Rt){return this.length>Rt.length?this.clone().iuand(Rt):Rt.clone().iuand(this)},ot.prototype.iuxor=function(Rt){var $t,vt;this.length>Rt.length?($t=this,vt=Rt):($t=Rt,vt=this);for(var It=0;ItRt.length?this.clone().ixor(Rt):Rt.clone().ixor(this)},ot.prototype.uxor=function(Rt){return this.length>Rt.length?this.clone().iuxor(Rt):Rt.clone().iuxor(this)},ot.prototype.inotn=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Math.ceil(Rt/26)|0,vt=Rt%26;this._expand($t),vt>0&&$t--;for(var It=0;It<$t;It++)this.words[It]=~this.words[It]&67108863;return vt>0&&(this.words[It]=~this.words[It]&67108863>>26-vt),this.strip()},ot.prototype.notn=function(Rt){return this.clone().inotn(Rt)},ot.prototype.setn=function(Rt,$t){rt(typeof Rt=="number"&&Rt>=0);var vt=Rt/26|0,It=Rt%26;return this._expand(vt+1),$t?this.words[vt]=this.words[vt]|1<Rt.length?(vt=this,It=Rt):(vt=Rt,It=this);for(var Ot=0,Wt=0;Wt>>26;for(;Ot!==0&&Wt>>26;if(this.length=vt.length,Ot!==0)this.words[this.length]=Ot,this.length++;else if(vt!==this)for(;WtRt.length?this.clone().iadd(Rt):Rt.clone().iadd(this)},ot.prototype.isub=function(Rt){if(Rt.negative!==0){Rt.negative=0;var $t=this.iadd(Rt);return Rt.negative=1,$t._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Rt),this.negative=1,this._normSign();var vt=this.cmp(Rt);if(vt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var It,Ot;vt>0?(It=this,Ot=Rt):(It=Rt,Ot=this);for(var Wt=0,zt=0;zt>26,this.words[zt]=$t&67108863;for(;Wt!==0&&zt>26,this.words[zt]=$t&67108863;if(Wt===0&&zt>>26,Pt=Ft&67108863,Ht=Math.min(Nt,Rt.length-1),Qt=Math.max(0,Nt-jt.length+1);Qt<=Ht;Qt++){var an=Nt-Qt|0;It=jt.words[an]|0,Ot=Rt.words[Qt]|0,Wt=It*Ot+Pt,Ut+=Wt/67108864|0,Pt=Wt&67108863}$t.words[Nt]=Pt|0,Ft=Ut|0}return Ft!==0?$t.words[Nt]=Ft|0:$t.length--,$t.strip()}var gt=function(Rt,$t,vt){var It=Rt.words,Ot=$t.words,Wt=vt.words,zt=0,Ft,Nt,Ut,Pt=It[0]|0,Ht=Pt&8191,Qt=Pt>>>13,an=It[1]|0,Yt=an&8191,nn=an>>>13,tn=It[2]|0,dn=tn&8191,wn=tn>>>13,rn=It[3]|0,Zt=rn&8191,vn=rn>>>13,Cn=It[4]|0,$n=Cn&8191,Nn=Cn>>>13,En=It[5]|0,sn=En&8191,pn=En>>>13,Tn=It[6]|0,In=Tn&8191,yn=Tn>>>13,hn=It[7]|0,fn=hn&8191,xn=hn>>>13,jn=It[8]|0,cn=jn&8191,Xt=jn>>>13,Kt=It[9]|0,kn=Kt&8191,Mn=Kt>>>13,On=Ot[0]|0,Bn=On&8191,Xn=On>>>13,Vn=Ot[1]|0,Gn=Vn&8191,zn=Vn>>>13,Jn=Ot[2]|0,Wn=Jn&8191,fr=Jn>>>13,ur=Ot[3]|0,wr=ur&8191,Xr=ur>>>13,Er=Ot[4]|0,Ir=Er&8191,Gr=Er>>>13,Or=Ot[5]|0,Lr=Or&8191,oo=Or>>>13,qr=Ot[6]|0,jr=qr&8191,mo=qr>>>13,_n=Ot[7]|0,Pn=_n&8191,un=_n>>>13,Jt=Ot[8]|0,Sn=Jt&8191,Dn=Jt>>>13,Fn=Ot[9]|0,Yn=Fn&8191,tr=Fn>>>13;vt.negative=Rt.negative^$t.negative,vt.length=19,Ft=Math.imul(Ht,Bn),Nt=Math.imul(Ht,Xn),Nt=Nt+Math.imul(Qt,Bn)|0,Ut=Math.imul(Qt,Xn);var ar=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(ar>>>26)|0,ar&=67108863,Ft=Math.imul(Yt,Bn),Nt=Math.imul(Yt,Xn),Nt=Nt+Math.imul(nn,Bn)|0,Ut=Math.imul(nn,Xn),Ft=Ft+Math.imul(Ht,Gn)|0,Nt=Nt+Math.imul(Ht,zn)|0,Nt=Nt+Math.imul(Qt,Gn)|0,Ut=Ut+Math.imul(Qt,zn)|0;var lr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(lr>>>26)|0,lr&=67108863,Ft=Math.imul(dn,Bn),Nt=Math.imul(dn,Xn),Nt=Nt+Math.imul(wn,Bn)|0,Ut=Math.imul(wn,Xn),Ft=Ft+Math.imul(Yt,Gn)|0,Nt=Nt+Math.imul(Yt,zn)|0,Nt=Nt+Math.imul(nn,Gn)|0,Ut=Ut+Math.imul(nn,zn)|0,Ft=Ft+Math.imul(Ht,Wn)|0,Nt=Nt+Math.imul(Ht,fr)|0,Nt=Nt+Math.imul(Qt,Wn)|0,Ut=Ut+Math.imul(Qt,fr)|0;var Vr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Ft=Math.imul(Zt,Bn),Nt=Math.imul(Zt,Xn),Nt=Nt+Math.imul(vn,Bn)|0,Ut=Math.imul(vn,Xn),Ft=Ft+Math.imul(dn,Gn)|0,Nt=Nt+Math.imul(dn,zn)|0,Nt=Nt+Math.imul(wn,Gn)|0,Ut=Ut+Math.imul(wn,zn)|0,Ft=Ft+Math.imul(Yt,Wn)|0,Nt=Nt+Math.imul(Yt,fr)|0,Nt=Nt+Math.imul(nn,Wn)|0,Ut=Ut+Math.imul(nn,fr)|0,Ft=Ft+Math.imul(Ht,wr)|0,Nt=Nt+Math.imul(Ht,Xr)|0,Nt=Nt+Math.imul(Qt,wr)|0,Ut=Ut+Math.imul(Qt,Xr)|0;var vr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(vr>>>26)|0,vr&=67108863,Ft=Math.imul($n,Bn),Nt=Math.imul($n,Xn),Nt=Nt+Math.imul(Nn,Bn)|0,Ut=Math.imul(Nn,Xn),Ft=Ft+Math.imul(Zt,Gn)|0,Nt=Nt+Math.imul(Zt,zn)|0,Nt=Nt+Math.imul(vn,Gn)|0,Ut=Ut+Math.imul(vn,zn)|0,Ft=Ft+Math.imul(dn,Wn)|0,Nt=Nt+Math.imul(dn,fr)|0,Nt=Nt+Math.imul(wn,Wn)|0,Ut=Ut+Math.imul(wn,fr)|0,Ft=Ft+Math.imul(Yt,wr)|0,Nt=Nt+Math.imul(Yt,Xr)|0,Nt=Nt+Math.imul(nn,wr)|0,Ut=Ut+Math.imul(nn,Xr)|0,Ft=Ft+Math.imul(Ht,Ir)|0,Nt=Nt+Math.imul(Ht,Gr)|0,Nt=Nt+Math.imul(Qt,Ir)|0,Ut=Ut+Math.imul(Qt,Gr)|0;var Nr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Ft=Math.imul(sn,Bn),Nt=Math.imul(sn,Xn),Nt=Nt+Math.imul(pn,Bn)|0,Ut=Math.imul(pn,Xn),Ft=Ft+Math.imul($n,Gn)|0,Nt=Nt+Math.imul($n,zn)|0,Nt=Nt+Math.imul(Nn,Gn)|0,Ut=Ut+Math.imul(Nn,zn)|0,Ft=Ft+Math.imul(Zt,Wn)|0,Nt=Nt+Math.imul(Zt,fr)|0,Nt=Nt+Math.imul(vn,Wn)|0,Ut=Ut+Math.imul(vn,fr)|0,Ft=Ft+Math.imul(dn,wr)|0,Nt=Nt+Math.imul(dn,Xr)|0,Nt=Nt+Math.imul(wn,wr)|0,Ut=Ut+Math.imul(wn,Xr)|0,Ft=Ft+Math.imul(Yt,Ir)|0,Nt=Nt+Math.imul(Yt,Gr)|0,Nt=Nt+Math.imul(nn,Ir)|0,Ut=Ut+Math.imul(nn,Gr)|0,Ft=Ft+Math.imul(Ht,Lr)|0,Nt=Nt+Math.imul(Ht,oo)|0,Nt=Nt+Math.imul(Qt,Lr)|0,Ut=Ut+Math.imul(Qt,oo)|0;var Hr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Ft=Math.imul(In,Bn),Nt=Math.imul(In,Xn),Nt=Nt+Math.imul(yn,Bn)|0,Ut=Math.imul(yn,Xn),Ft=Ft+Math.imul(sn,Gn)|0,Nt=Nt+Math.imul(sn,zn)|0,Nt=Nt+Math.imul(pn,Gn)|0,Ut=Ut+Math.imul(pn,zn)|0,Ft=Ft+Math.imul($n,Wn)|0,Nt=Nt+Math.imul($n,fr)|0,Nt=Nt+Math.imul(Nn,Wn)|0,Ut=Ut+Math.imul(Nn,fr)|0,Ft=Ft+Math.imul(Zt,wr)|0,Nt=Nt+Math.imul(Zt,Xr)|0,Nt=Nt+Math.imul(vn,wr)|0,Ut=Ut+Math.imul(vn,Xr)|0,Ft=Ft+Math.imul(dn,Ir)|0,Nt=Nt+Math.imul(dn,Gr)|0,Nt=Nt+Math.imul(wn,Ir)|0,Ut=Ut+Math.imul(wn,Gr)|0,Ft=Ft+Math.imul(Yt,Lr)|0,Nt=Nt+Math.imul(Yt,oo)|0,Nt=Nt+Math.imul(nn,Lr)|0,Ut=Ut+Math.imul(nn,oo)|0,Ft=Ft+Math.imul(Ht,jr)|0,Nt=Nt+Math.imul(Ht,mo)|0,Nt=Nt+Math.imul(Qt,jr)|0,Ut=Ut+Math.imul(Qt,mo)|0;var eo=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ft=Math.imul(fn,Bn),Nt=Math.imul(fn,Xn),Nt=Nt+Math.imul(xn,Bn)|0,Ut=Math.imul(xn,Xn),Ft=Ft+Math.imul(In,Gn)|0,Nt=Nt+Math.imul(In,zn)|0,Nt=Nt+Math.imul(yn,Gn)|0,Ut=Ut+Math.imul(yn,zn)|0,Ft=Ft+Math.imul(sn,Wn)|0,Nt=Nt+Math.imul(sn,fr)|0,Nt=Nt+Math.imul(pn,Wn)|0,Ut=Ut+Math.imul(pn,fr)|0,Ft=Ft+Math.imul($n,wr)|0,Nt=Nt+Math.imul($n,Xr)|0,Nt=Nt+Math.imul(Nn,wr)|0,Ut=Ut+Math.imul(Nn,Xr)|0,Ft=Ft+Math.imul(Zt,Ir)|0,Nt=Nt+Math.imul(Zt,Gr)|0,Nt=Nt+Math.imul(vn,Ir)|0,Ut=Ut+Math.imul(vn,Gr)|0,Ft=Ft+Math.imul(dn,Lr)|0,Nt=Nt+Math.imul(dn,oo)|0,Nt=Nt+Math.imul(wn,Lr)|0,Ut=Ut+Math.imul(wn,oo)|0,Ft=Ft+Math.imul(Yt,jr)|0,Nt=Nt+Math.imul(Yt,mo)|0,Nt=Nt+Math.imul(nn,jr)|0,Ut=Ut+Math.imul(nn,mo)|0,Ft=Ft+Math.imul(Ht,Pn)|0,Nt=Nt+Math.imul(Ht,un)|0,Nt=Nt+Math.imul(Qt,Pn)|0,Ut=Ut+Math.imul(Qt,un)|0;var Jr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Ft=Math.imul(cn,Bn),Nt=Math.imul(cn,Xn),Nt=Nt+Math.imul(Xt,Bn)|0,Ut=Math.imul(Xt,Xn),Ft=Ft+Math.imul(fn,Gn)|0,Nt=Nt+Math.imul(fn,zn)|0,Nt=Nt+Math.imul(xn,Gn)|0,Ut=Ut+Math.imul(xn,zn)|0,Ft=Ft+Math.imul(In,Wn)|0,Nt=Nt+Math.imul(In,fr)|0,Nt=Nt+Math.imul(yn,Wn)|0,Ut=Ut+Math.imul(yn,fr)|0,Ft=Ft+Math.imul(sn,wr)|0,Nt=Nt+Math.imul(sn,Xr)|0,Nt=Nt+Math.imul(pn,wr)|0,Ut=Ut+Math.imul(pn,Xr)|0,Ft=Ft+Math.imul($n,Ir)|0,Nt=Nt+Math.imul($n,Gr)|0,Nt=Nt+Math.imul(Nn,Ir)|0,Ut=Ut+Math.imul(Nn,Gr)|0,Ft=Ft+Math.imul(Zt,Lr)|0,Nt=Nt+Math.imul(Zt,oo)|0,Nt=Nt+Math.imul(vn,Lr)|0,Ut=Ut+Math.imul(vn,oo)|0,Ft=Ft+Math.imul(dn,jr)|0,Nt=Nt+Math.imul(dn,mo)|0,Nt=Nt+Math.imul(wn,jr)|0,Ut=Ut+Math.imul(wn,mo)|0,Ft=Ft+Math.imul(Yt,Pn)|0,Nt=Nt+Math.imul(Yt,un)|0,Nt=Nt+Math.imul(nn,Pn)|0,Ut=Ut+Math.imul(nn,un)|0,Ft=Ft+Math.imul(Ht,Sn)|0,Nt=Nt+Math.imul(Ht,Dn)|0,Nt=Nt+Math.imul(Qt,Sn)|0,Ut=Ut+Math.imul(Qt,Dn)|0;var Zr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,Ft=Math.imul(kn,Bn),Nt=Math.imul(kn,Xn),Nt=Nt+Math.imul(Mn,Bn)|0,Ut=Math.imul(Mn,Xn),Ft=Ft+Math.imul(cn,Gn)|0,Nt=Nt+Math.imul(cn,zn)|0,Nt=Nt+Math.imul(Xt,Gn)|0,Ut=Ut+Math.imul(Xt,zn)|0,Ft=Ft+Math.imul(fn,Wn)|0,Nt=Nt+Math.imul(fn,fr)|0,Nt=Nt+Math.imul(xn,Wn)|0,Ut=Ut+Math.imul(xn,fr)|0,Ft=Ft+Math.imul(In,wr)|0,Nt=Nt+Math.imul(In,Xr)|0,Nt=Nt+Math.imul(yn,wr)|0,Ut=Ut+Math.imul(yn,Xr)|0,Ft=Ft+Math.imul(sn,Ir)|0,Nt=Nt+Math.imul(sn,Gr)|0,Nt=Nt+Math.imul(pn,Ir)|0,Ut=Ut+Math.imul(pn,Gr)|0,Ft=Ft+Math.imul($n,Lr)|0,Nt=Nt+Math.imul($n,oo)|0,Nt=Nt+Math.imul(Nn,Lr)|0,Ut=Ut+Math.imul(Nn,oo)|0,Ft=Ft+Math.imul(Zt,jr)|0,Nt=Nt+Math.imul(Zt,mo)|0,Nt=Nt+Math.imul(vn,jr)|0,Ut=Ut+Math.imul(vn,mo)|0,Ft=Ft+Math.imul(dn,Pn)|0,Nt=Nt+Math.imul(dn,un)|0,Nt=Nt+Math.imul(wn,Pn)|0,Ut=Ut+Math.imul(wn,un)|0,Ft=Ft+Math.imul(Yt,Sn)|0,Nt=Nt+Math.imul(Yt,Dn)|0,Nt=Nt+Math.imul(nn,Sn)|0,Ut=Ut+Math.imul(nn,Dn)|0,Ft=Ft+Math.imul(Ht,Yn)|0,Nt=Nt+Math.imul(Ht,tr)|0,Nt=Nt+Math.imul(Qt,Yn)|0,Ut=Ut+Math.imul(Qt,tr)|0;var br=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(br>>>26)|0,br&=67108863,Ft=Math.imul(kn,Gn),Nt=Math.imul(kn,zn),Nt=Nt+Math.imul(Mn,Gn)|0,Ut=Math.imul(Mn,zn),Ft=Ft+Math.imul(cn,Wn)|0,Nt=Nt+Math.imul(cn,fr)|0,Nt=Nt+Math.imul(Xt,Wn)|0,Ut=Ut+Math.imul(Xt,fr)|0,Ft=Ft+Math.imul(fn,wr)|0,Nt=Nt+Math.imul(fn,Xr)|0,Nt=Nt+Math.imul(xn,wr)|0,Ut=Ut+Math.imul(xn,Xr)|0,Ft=Ft+Math.imul(In,Ir)|0,Nt=Nt+Math.imul(In,Gr)|0,Nt=Nt+Math.imul(yn,Ir)|0,Ut=Ut+Math.imul(yn,Gr)|0,Ft=Ft+Math.imul(sn,Lr)|0,Nt=Nt+Math.imul(sn,oo)|0,Nt=Nt+Math.imul(pn,Lr)|0,Ut=Ut+Math.imul(pn,oo)|0,Ft=Ft+Math.imul($n,jr)|0,Nt=Nt+Math.imul($n,mo)|0,Nt=Nt+Math.imul(Nn,jr)|0,Ut=Ut+Math.imul(Nn,mo)|0,Ft=Ft+Math.imul(Zt,Pn)|0,Nt=Nt+Math.imul(Zt,un)|0,Nt=Nt+Math.imul(vn,Pn)|0,Ut=Ut+Math.imul(vn,un)|0,Ft=Ft+Math.imul(dn,Sn)|0,Nt=Nt+Math.imul(dn,Dn)|0,Nt=Nt+Math.imul(wn,Sn)|0,Ut=Ut+Math.imul(wn,Dn)|0,Ft=Ft+Math.imul(Yt,Yn)|0,Nt=Nt+Math.imul(Yt,tr)|0,Nt=Nt+Math.imul(nn,Yn)|0,Ut=Ut+Math.imul(nn,tr)|0;var Pr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Ft=Math.imul(kn,Wn),Nt=Math.imul(kn,fr),Nt=Nt+Math.imul(Mn,Wn)|0,Ut=Math.imul(Mn,fr),Ft=Ft+Math.imul(cn,wr)|0,Nt=Nt+Math.imul(cn,Xr)|0,Nt=Nt+Math.imul(Xt,wr)|0,Ut=Ut+Math.imul(Xt,Xr)|0,Ft=Ft+Math.imul(fn,Ir)|0,Nt=Nt+Math.imul(fn,Gr)|0,Nt=Nt+Math.imul(xn,Ir)|0,Ut=Ut+Math.imul(xn,Gr)|0,Ft=Ft+Math.imul(In,Lr)|0,Nt=Nt+Math.imul(In,oo)|0,Nt=Nt+Math.imul(yn,Lr)|0,Ut=Ut+Math.imul(yn,oo)|0,Ft=Ft+Math.imul(sn,jr)|0,Nt=Nt+Math.imul(sn,mo)|0,Nt=Nt+Math.imul(pn,jr)|0,Ut=Ut+Math.imul(pn,mo)|0,Ft=Ft+Math.imul($n,Pn)|0,Nt=Nt+Math.imul($n,un)|0,Nt=Nt+Math.imul(Nn,Pn)|0,Ut=Ut+Math.imul(Nn,un)|0,Ft=Ft+Math.imul(Zt,Sn)|0,Nt=Nt+Math.imul(Zt,Dn)|0,Nt=Nt+Math.imul(vn,Sn)|0,Ut=Ut+Math.imul(vn,Dn)|0,Ft=Ft+Math.imul(dn,Yn)|0,Nt=Nt+Math.imul(dn,tr)|0,Nt=Nt+Math.imul(wn,Yn)|0,Ut=Ut+Math.imul(wn,tr)|0;var Fr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Ft=Math.imul(kn,wr),Nt=Math.imul(kn,Xr),Nt=Nt+Math.imul(Mn,wr)|0,Ut=Math.imul(Mn,Xr),Ft=Ft+Math.imul(cn,Ir)|0,Nt=Nt+Math.imul(cn,Gr)|0,Nt=Nt+Math.imul(Xt,Ir)|0,Ut=Ut+Math.imul(Xt,Gr)|0,Ft=Ft+Math.imul(fn,Lr)|0,Nt=Nt+Math.imul(fn,oo)|0,Nt=Nt+Math.imul(xn,Lr)|0,Ut=Ut+Math.imul(xn,oo)|0,Ft=Ft+Math.imul(In,jr)|0,Nt=Nt+Math.imul(In,mo)|0,Nt=Nt+Math.imul(yn,jr)|0,Ut=Ut+Math.imul(yn,mo)|0,Ft=Ft+Math.imul(sn,Pn)|0,Nt=Nt+Math.imul(sn,un)|0,Nt=Nt+Math.imul(pn,Pn)|0,Ut=Ut+Math.imul(pn,un)|0,Ft=Ft+Math.imul($n,Sn)|0,Nt=Nt+Math.imul($n,Dn)|0,Nt=Nt+Math.imul(Nn,Sn)|0,Ut=Ut+Math.imul(Nn,Dn)|0,Ft=Ft+Math.imul(Zt,Yn)|0,Nt=Nt+Math.imul(Zt,tr)|0,Nt=Nt+Math.imul(vn,Yn)|0,Ut=Ut+Math.imul(vn,tr)|0;var Mr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,Ft=Math.imul(kn,Ir),Nt=Math.imul(kn,Gr),Nt=Nt+Math.imul(Mn,Ir)|0,Ut=Math.imul(Mn,Gr),Ft=Ft+Math.imul(cn,Lr)|0,Nt=Nt+Math.imul(cn,oo)|0,Nt=Nt+Math.imul(Xt,Lr)|0,Ut=Ut+Math.imul(Xt,oo)|0,Ft=Ft+Math.imul(fn,jr)|0,Nt=Nt+Math.imul(fn,mo)|0,Nt=Nt+Math.imul(xn,jr)|0,Ut=Ut+Math.imul(xn,mo)|0,Ft=Ft+Math.imul(In,Pn)|0,Nt=Nt+Math.imul(In,un)|0,Nt=Nt+Math.imul(yn,Pn)|0,Ut=Ut+Math.imul(yn,un)|0,Ft=Ft+Math.imul(sn,Sn)|0,Nt=Nt+Math.imul(sn,Dn)|0,Nt=Nt+Math.imul(pn,Sn)|0,Ut=Ut+Math.imul(pn,Dn)|0,Ft=Ft+Math.imul($n,Yn)|0,Nt=Nt+Math.imul($n,tr)|0,Nt=Nt+Math.imul(Nn,Yn)|0,Ut=Ut+Math.imul(Nn,tr)|0;var Cr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Ft=Math.imul(kn,Lr),Nt=Math.imul(kn,oo),Nt=Nt+Math.imul(Mn,Lr)|0,Ut=Math.imul(Mn,oo),Ft=Ft+Math.imul(cn,jr)|0,Nt=Nt+Math.imul(cn,mo)|0,Nt=Nt+Math.imul(Xt,jr)|0,Ut=Ut+Math.imul(Xt,mo)|0,Ft=Ft+Math.imul(fn,Pn)|0,Nt=Nt+Math.imul(fn,un)|0,Nt=Nt+Math.imul(xn,Pn)|0,Ut=Ut+Math.imul(xn,un)|0,Ft=Ft+Math.imul(In,Sn)|0,Nt=Nt+Math.imul(In,Dn)|0,Nt=Nt+Math.imul(yn,Sn)|0,Ut=Ut+Math.imul(yn,Dn)|0,Ft=Ft+Math.imul(sn,Yn)|0,Nt=Nt+Math.imul(sn,tr)|0,Nt=Nt+Math.imul(pn,Yn)|0,Ut=Ut+Math.imul(pn,tr)|0;var Dr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Ft=Math.imul(kn,jr),Nt=Math.imul(kn,mo),Nt=Nt+Math.imul(Mn,jr)|0,Ut=Math.imul(Mn,mo),Ft=Ft+Math.imul(cn,Pn)|0,Nt=Nt+Math.imul(cn,un)|0,Nt=Nt+Math.imul(Xt,Pn)|0,Ut=Ut+Math.imul(Xt,un)|0,Ft=Ft+Math.imul(fn,Sn)|0,Nt=Nt+Math.imul(fn,Dn)|0,Nt=Nt+Math.imul(xn,Sn)|0,Ut=Ut+Math.imul(xn,Dn)|0,Ft=Ft+Math.imul(In,Yn)|0,Nt=Nt+Math.imul(In,tr)|0,Nt=Nt+Math.imul(yn,Yn)|0,Ut=Ut+Math.imul(yn,tr)|0;var Ur=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,Ft=Math.imul(kn,Pn),Nt=Math.imul(kn,un),Nt=Nt+Math.imul(Mn,Pn)|0,Ut=Math.imul(Mn,un),Ft=Ft+Math.imul(cn,Sn)|0,Nt=Nt+Math.imul(cn,Dn)|0,Nt=Nt+Math.imul(Xt,Sn)|0,Ut=Ut+Math.imul(Xt,Dn)|0,Ft=Ft+Math.imul(fn,Yn)|0,Nt=Nt+Math.imul(fn,tr)|0,Nt=Nt+Math.imul(xn,Yn)|0,Ut=Ut+Math.imul(xn,tr)|0;var Rr=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,Ft=Math.imul(kn,Sn),Nt=Math.imul(kn,Dn),Nt=Nt+Math.imul(Mn,Sn)|0,Ut=Math.imul(Mn,Dn),Ft=Ft+Math.imul(cn,Yn)|0,Nt=Nt+Math.imul(cn,tr)|0,Nt=Nt+Math.imul(Xt,Yn)|0,Ut=Ut+Math.imul(Xt,tr)|0;var er=(zt+Ft|0)+((Nt&8191)<<13)|0;zt=(Ut+(Nt>>>13)|0)+(er>>>26)|0,er&=67108863,Ft=Math.imul(kn,Yn),Nt=Math.imul(kn,tr),Nt=Nt+Math.imul(Mn,Yn)|0,Ut=Math.imul(Mn,tr);var rr=(zt+Ft|0)+((Nt&8191)<<13)|0;return zt=(Ut+(Nt>>>13)|0)+(rr>>>26)|0,rr&=67108863,Wt[0]=ar,Wt[1]=lr,Wt[2]=Vr,Wt[3]=vr,Wt[4]=Nr,Wt[5]=Hr,Wt[6]=eo,Wt[7]=Jr,Wt[8]=Zr,Wt[9]=br,Wt[10]=Pr,Wt[11]=Fr,Wt[12]=Mr,Wt[13]=Cr,Wt[14]=Dr,Wt[15]=Ur,Wt[16]=Rr,Wt[17]=er,Wt[18]=rr,zt!==0&&(Wt[19]=zt,vt.length++),vt};Math.imul||(gt=mt);function yt(jt,Rt,$t){$t.negative=Rt.negative^jt.negative,$t.length=jt.length+Rt.length;for(var vt=0,It=0,Ot=0;Ot<$t.length-1;Ot++){var Wt=It;It=0;for(var zt=vt&67108863,Ft=Math.min(Ot,Rt.length-1),Nt=Math.max(0,Ot-jt.length+1);Nt<=Ft;Nt++){var Ut=Ot-Nt,Pt=jt.words[Ut]|0,Ht=Rt.words[Nt]|0,Qt=Pt*Ht,an=Qt&67108863;Wt=Wt+(Qt/67108864|0)|0,an=an+zt|0,zt=an&67108863,Wt=Wt+(an>>>26)|0,It+=Wt>>>26,Wt&=67108863}$t.words[Ot]=zt,vt=Wt,Wt=It}return vt!==0?$t.words[Ot]=vt:$t.length--,$t.strip()}function bt(jt,Rt,$t){var vt=new wt;return vt.mulp(jt,Rt,$t)}ot.prototype.mulTo=function(Rt,$t){var vt,It=this.length+Rt.length;return this.length===10&&Rt.length===10?vt=gt(this,Rt,$t):It<63?vt=mt(this,Rt,$t):It<1024?vt=yt(this,Rt,$t):vt=bt(this,Rt,$t),vt};function wt(jt,Rt){this.x=jt,this.y=Rt}wt.prototype.makeRBT=function(Rt){for(var $t=new Array(Rt),vt=ot.prototype._countBits(Rt)-1,It=0;It>=1;return It},wt.prototype.permute=function(Rt,$t,vt,It,Ot,Wt){for(var zt=0;zt>>1)Ot++;return 1<>>13,vt[2*Wt+1]=Ot&8191,Ot=Ot>>>13;for(Wt=2*$t;Wt>=26,$t+=It/67108864|0,$t+=Ot>>>26,this.words[vt]=Ot&67108863}return $t!==0&&(this.words[vt]=$t,this.length++),this},ot.prototype.muln=function(Rt){return this.clone().imuln(Rt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(Rt){var $t=pt(Rt);if($t.length===0)return new ot(1);for(var vt=this,It=0;It<$t.length&&$t[It]===0;It++,vt=vt.sqr());if(++It<$t.length)for(var Ot=vt.sqr();It<$t.length;It++,Ot=Ot.sqr())$t[It]!==0&&(vt=vt.mul(Ot));return vt},ot.prototype.iushln=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Rt%26,vt=(Rt-$t)/26,It=67108863>>>26-$t<<26-$t,Ot;if($t!==0){var Wt=0;for(Ot=0;Ot>>26-$t}Wt&&(this.words[Ot]=Wt,this.length++)}if(vt!==0){for(Ot=this.length-1;Ot>=0;Ot--)this.words[Ot+vt]=this.words[Ot];for(Ot=0;Ot=0);var It;$t?It=($t-$t%26)/26:It=0;var Ot=Rt%26,Wt=Math.min((Rt-Ot)/26,this.length),zt=67108863^67108863>>>Ot<Wt)for(this.length-=Wt,Nt=0;Nt=0&&(Ut!==0||Nt>=It);Nt--){var Pt=this.words[Nt]|0;this.words[Nt]=Ut<<26-Ot|Pt>>>Ot,Ut=Pt&zt}return Ft&&Ut!==0&&(Ft.words[Ft.length++]=Ut),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},ot.prototype.ishrn=function(Rt,$t,vt){return rt(this.negative===0),this.iushrn(Rt,$t,vt)},ot.prototype.shln=function(Rt){return this.clone().ishln(Rt)},ot.prototype.ushln=function(Rt){return this.clone().iushln(Rt)},ot.prototype.shrn=function(Rt){return this.clone().ishrn(Rt)},ot.prototype.ushrn=function(Rt){return this.clone().iushrn(Rt)},ot.prototype.testn=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Rt%26,vt=(Rt-$t)/26,It=1<<$t;if(this.length<=vt)return!1;var Ot=this.words[vt];return!!(Ot&It)},ot.prototype.imaskn=function(Rt){rt(typeof Rt=="number"&&Rt>=0);var $t=Rt%26,vt=(Rt-$t)/26;if(rt(this.negative===0,"imaskn works only with positive numbers"),this.length<=vt)return this;if($t!==0&&vt++,this.length=Math.min(vt,this.length),$t!==0){var It=67108863^67108863>>>$t<<$t;this.words[this.length-1]&=It}return this.strip()},ot.prototype.maskn=function(Rt){return this.clone().imaskn(Rt)},ot.prototype.iaddn=function(Rt){return rt(typeof Rt=="number"),rt(Rt<67108864),Rt<0?this.isubn(-Rt):this.negative!==0?this.length===1&&(this.words[0]|0)=67108864;$t++)this.words[$t]-=67108864,$t===this.length-1?this.words[$t+1]=1:this.words[$t+1]++;return this.length=Math.max(this.length,$t+1),this},ot.prototype.isubn=function(Rt){if(rt(typeof Rt=="number"),rt(Rt<67108864),Rt<0)return this.iaddn(-Rt);if(this.negative!==0)return this.negative=0,this.iaddn(Rt),this.negative=1,this;if(this.words[0]-=Rt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var $t=0;$t>26)-(Ft/67108864|0),this.words[Ot+vt]=Wt&67108863}for(;Ot>26,this.words[Ot+vt]=Wt&67108863;if(zt===0)return this.strip();for(rt(zt===-1),zt=0,Ot=0;Ot>26,this.words[Ot]=Wt&67108863;return this.negative=1,this.strip()},ot.prototype._wordDiv=function(Rt,$t){var vt=this.length-Rt.length,It=this.clone(),Ot=Rt,Wt=Ot.words[Ot.length-1]|0,zt=this._countBits(Wt);vt=26-zt,vt!==0&&(Ot=Ot.ushln(vt),It.iushln(vt),Wt=Ot.words[Ot.length-1]|0);var Ft=It.length-Ot.length,Nt;if($t!=="mod"){Nt=new ot(null),Nt.length=Ft+1,Nt.words=new Array(Nt.length);for(var Ut=0;Ut=0;Ht--){var Qt=(It.words[Ot.length+Ht]|0)*67108864+(It.words[Ot.length+Ht-1]|0);for(Qt=Math.min(Qt/Wt|0,67108863),It._ishlnsubmul(Ot,Qt,Ht);It.negative!==0;)Qt--,It.negative=0,It._ishlnsubmul(Ot,1,Ht),It.isZero()||(It.negative^=1);Nt&&(Nt.words[Ht]=Qt)}return Nt&&Nt.strip(),It.strip(),$t!=="div"&&vt!==0&&It.iushrn(vt),{div:Nt||null,mod:It}},ot.prototype.divmod=function(Rt,$t,vt){if(rt(!Rt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var It,Ot,Wt;return this.negative!==0&&Rt.negative===0?(Wt=this.neg().divmod(Rt,$t),$t!=="mod"&&(It=Wt.div.neg()),$t!=="div"&&(Ot=Wt.mod.neg(),vt&&Ot.negative!==0&&Ot.iadd(Rt)),{div:It,mod:Ot}):this.negative===0&&Rt.negative!==0?(Wt=this.divmod(Rt.neg(),$t),$t!=="mod"&&(It=Wt.div.neg()),{div:It,mod:Wt.mod}):this.negative&Rt.negative?(Wt=this.neg().divmod(Rt.neg(),$t),$t!=="div"&&(Ot=Wt.mod.neg(),vt&&Ot.negative!==0&&Ot.isub(Rt)),{div:Wt.div,mod:Ot}):Rt.length>this.length||this.cmp(Rt)<0?{div:new ot(0),mod:this}:Rt.length===1?$t==="div"?{div:this.divn(Rt.words[0]),mod:null}:$t==="mod"?{div:null,mod:new ot(this.modn(Rt.words[0]))}:{div:this.divn(Rt.words[0]),mod:new ot(this.modn(Rt.words[0]))}:this._wordDiv(Rt,$t)},ot.prototype.div=function(Rt){return this.divmod(Rt,"div",!1).div},ot.prototype.mod=function(Rt){return this.divmod(Rt,"mod",!1).mod},ot.prototype.umod=function(Rt){return this.divmod(Rt,"mod",!0).mod},ot.prototype.divRound=function(Rt){var $t=this.divmod(Rt);if($t.mod.isZero())return $t.div;var vt=$t.div.negative!==0?$t.mod.isub(Rt):$t.mod,It=Rt.ushrn(1),Ot=Rt.andln(1),Wt=vt.cmp(It);return Wt<0||Ot===1&&Wt===0?$t.div:$t.div.negative!==0?$t.div.isubn(1):$t.div.iaddn(1)},ot.prototype.modn=function(Rt){rt(Rt<=67108863);for(var $t=(1<<26)%Rt,vt=0,It=this.length-1;It>=0;It--)vt=($t*vt+(this.words[It]|0))%Rt;return vt},ot.prototype.idivn=function(Rt){rt(Rt<=67108863);for(var $t=0,vt=this.length-1;vt>=0;vt--){var It=(this.words[vt]|0)+$t*67108864;this.words[vt]=It/Rt|0,$t=It%Rt}return this.strip()},ot.prototype.divn=function(Rt){return this.clone().idivn(Rt)},ot.prototype.egcd=function(Rt){rt(Rt.negative===0),rt(!Rt.isZero());var $t=this,vt=Rt.clone();$t.negative!==0?$t=$t.umod(Rt):$t=$t.clone();for(var It=new ot(1),Ot=new ot(0),Wt=new ot(0),zt=new ot(1),Ft=0;$t.isEven()&&vt.isEven();)$t.iushrn(1),vt.iushrn(1),++Ft;for(var Nt=vt.clone(),Ut=$t.clone();!$t.isZero();){for(var Pt=0,Ht=1;!($t.words[0]&Ht)&&Pt<26;++Pt,Ht<<=1);if(Pt>0)for($t.iushrn(Pt);Pt-- >0;)(It.isOdd()||Ot.isOdd())&&(It.iadd(Nt),Ot.isub(Ut)),It.iushrn(1),Ot.iushrn(1);for(var Qt=0,an=1;!(vt.words[0]&an)&&Qt<26;++Qt,an<<=1);if(Qt>0)for(vt.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||zt.isOdd())&&(Wt.iadd(Nt),zt.isub(Ut)),Wt.iushrn(1),zt.iushrn(1);$t.cmp(vt)>=0?($t.isub(vt),It.isub(Wt),Ot.isub(zt)):(vt.isub($t),Wt.isub(It),zt.isub(Ot))}return{a:Wt,b:zt,gcd:vt.iushln(Ft)}},ot.prototype._invmp=function(Rt){rt(Rt.negative===0),rt(!Rt.isZero());var $t=this,vt=Rt.clone();$t.negative!==0?$t=$t.umod(Rt):$t=$t.clone();for(var It=new ot(1),Ot=new ot(0),Wt=vt.clone();$t.cmpn(1)>0&&vt.cmpn(1)>0;){for(var zt=0,Ft=1;!($t.words[0]&Ft)&&zt<26;++zt,Ft<<=1);if(zt>0)for($t.iushrn(zt);zt-- >0;)It.isOdd()&&It.iadd(Wt),It.iushrn(1);for(var Nt=0,Ut=1;!(vt.words[0]&Ut)&&Nt<26;++Nt,Ut<<=1);if(Nt>0)for(vt.iushrn(Nt);Nt-- >0;)Ot.isOdd()&&Ot.iadd(Wt),Ot.iushrn(1);$t.cmp(vt)>=0?($t.isub(vt),It.isub(Ot)):(vt.isub($t),Ot.isub(It))}var Pt;return $t.cmpn(1)===0?Pt=It:Pt=Ot,Pt.cmpn(0)<0&&Pt.iadd(Rt),Pt},ot.prototype.gcd=function(Rt){if(this.isZero())return Rt.abs();if(Rt.isZero())return this.abs();var $t=this.clone(),vt=Rt.clone();$t.negative=0,vt.negative=0;for(var It=0;$t.isEven()&&vt.isEven();It++)$t.iushrn(1),vt.iushrn(1);do{for(;$t.isEven();)$t.iushrn(1);for(;vt.isEven();)vt.iushrn(1);var Ot=$t.cmp(vt);if(Ot<0){var Wt=$t;$t=vt,vt=Wt}else if(Ot===0||vt.cmpn(1)===0)break;$t.isub(vt)}while(!0);return vt.iushln(It)},ot.prototype.invm=function(Rt){return this.egcd(Rt).a.umod(Rt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(Rt){return this.words[0]&Rt},ot.prototype.bincn=function(Rt){rt(typeof Rt=="number");var $t=Rt%26,vt=(Rt-$t)/26,It=1<<$t;if(this.length<=vt)return this._expand(vt+1),this.words[vt]|=It,this;for(var Ot=It,Wt=vt;Ot!==0&&Wt>>26,zt&=67108863,this.words[Wt]=zt}return Ot!==0&&(this.words[Wt]=Ot,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(Rt){var $t=Rt<0;if(this.negative!==0&&!$t)return-1;if(this.negative===0&&$t)return 1;this.strip();var vt;if(this.length>1)vt=1;else{$t&&(Rt=-Rt),rt(Rt<=67108863,"Number is too big");var It=this.words[0]|0;vt=It===Rt?0:ItRt.length)return 1;if(this.length=0;vt--){var It=this.words[vt]|0,Ot=Rt.words[vt]|0;if(It!==Ot){ItOt&&($t=1);break}}return $t},ot.prototype.gtn=function(Rt){return this.cmpn(Rt)===1},ot.prototype.gt=function(Rt){return this.cmp(Rt)===1},ot.prototype.gten=function(Rt){return this.cmpn(Rt)>=0},ot.prototype.gte=function(Rt){return this.cmp(Rt)>=0},ot.prototype.ltn=function(Rt){return this.cmpn(Rt)===-1},ot.prototype.lt=function(Rt){return this.cmp(Rt)===-1},ot.prototype.lten=function(Rt){return this.cmpn(Rt)<=0},ot.prototype.lte=function(Rt){return this.cmp(Rt)<=0},ot.prototype.eqn=function(Rt){return this.cmpn(Rt)===0},ot.prototype.eq=function(Rt){return this.cmp(Rt)===0},ot.red=function(Rt){return new Ct(Rt)},ot.prototype.toRed=function(Rt){return rt(!this.red,"Already a number in reduction context"),rt(this.negative===0,"red works only with positives"),Rt.convertTo(this)._forceRed(Rt)},ot.prototype.fromRed=function(){return rt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(Rt){return this.red=Rt,this},ot.prototype.forceRed=function(Rt){return rt(!this.red,"Already a number in reduction context"),this._forceRed(Rt)},ot.prototype.redAdd=function(Rt){return rt(this.red,"redAdd works only with red numbers"),this.red.add(this,Rt)},ot.prototype.redIAdd=function(Rt){return rt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Rt)},ot.prototype.redSub=function(Rt){return rt(this.red,"redSub works only with red numbers"),this.red.sub(this,Rt)},ot.prototype.redISub=function(Rt){return rt(this.red,"redISub works only with red numbers"),this.red.isub(this,Rt)},ot.prototype.redShl=function(Rt){return rt(this.red,"redShl works only with red numbers"),this.red.shl(this,Rt)},ot.prototype.redMul=function(Rt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Rt),this.red.mul(this,Rt)},ot.prototype.redIMul=function(Rt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Rt),this.red.imul(this,Rt)},ot.prototype.redSqr=function(){return rt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return rt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return rt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return rt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return rt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(Rt){return rt(this.red&&!Rt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Rt)};var xt={k256:null,p224:null,p192:null,p25519:null};function kt(jt,Rt){this.name=jt,this.p=new ot(Rt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}kt.prototype._tmp=function(){var Rt=new ot(null);return Rt.words=new Array(Math.ceil(this.n/13)),Rt},kt.prototype.ireduce=function(Rt){var $t=Rt,vt;do this.split($t,this.tmp),$t=this.imulK($t),$t=$t.iadd(this.tmp),vt=$t.bitLength();while(vt>this.n);var It=vt0?$t.isub(this.p):$t.strip!==void 0?$t.strip():$t._strip(),$t},kt.prototype.split=function(Rt,$t){Rt.iushrn(this.n,0,$t)},kt.prototype.imulK=function(Rt){return Rt.imul(this.k)};function St(){kt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}it(St,kt),St.prototype.split=function(Rt,$t){for(var vt=4194303,It=Math.min(Rt.length,9),Ot=0;Ot>>22,Wt=zt}Wt>>>=22,Rt.words[Ot-10]=Wt,Wt===0&&Rt.length>10?Rt.length-=10:Rt.length-=9},St.prototype.imulK=function(Rt){Rt.words[Rt.length]=0,Rt.words[Rt.length+1]=0,Rt.length+=2;for(var $t=0,vt=0;vt>>=26,Rt.words[vt]=Ot,$t=It}return $t!==0&&(Rt.words[Rt.length++]=$t),Rt},ot._prime=function(Rt){if(xt[Rt])return xt[Rt];var $t;if(Rt==="k256")$t=new St;else if(Rt==="p224")$t=new Tt;else if(Rt==="p192")$t=new At;else if(Rt==="p25519")$t=new Et;else throw new Error("Unknown prime "+Rt);return xt[Rt]=$t,$t};function Ct(jt){if(typeof jt=="string"){var Rt=ot._prime(jt);this.m=Rt.p,this.prime=Rt}else rt(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}Ct.prototype._verify1=function(Rt){rt(Rt.negative===0,"red works only with positives"),rt(Rt.red,"red works only with red numbers")},Ct.prototype._verify2=function(Rt,$t){rt((Rt.negative|$t.negative)===0,"red works only with positives"),rt(Rt.red&&Rt.red===$t.red,"red works only with red numbers")},Ct.prototype.imod=function(Rt){return this.prime?this.prime.ireduce(Rt)._forceRed(this):Rt.umod(this.m)._forceRed(this)},Ct.prototype.neg=function(Rt){return Rt.isZero()?Rt.clone():this.m.sub(Rt)._forceRed(this)},Ct.prototype.add=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.add($t);return vt.cmp(this.m)>=0&&vt.isub(this.m),vt._forceRed(this)},Ct.prototype.iadd=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.iadd($t);return vt.cmp(this.m)>=0&&vt.isub(this.m),vt},Ct.prototype.sub=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.sub($t);return vt.cmpn(0)<0&&vt.iadd(this.m),vt._forceRed(this)},Ct.prototype.isub=function(Rt,$t){this._verify2(Rt,$t);var vt=Rt.isub($t);return vt.cmpn(0)<0&&vt.iadd(this.m),vt},Ct.prototype.shl=function(Rt,$t){return this._verify1(Rt),this.imod(Rt.ushln($t))},Ct.prototype.imul=function(Rt,$t){return this._verify2(Rt,$t),this.imod(Rt.imul($t))},Ct.prototype.mul=function(Rt,$t){return this._verify2(Rt,$t),this.imod(Rt.mul($t))},Ct.prototype.isqr=function(Rt){return this.imul(Rt,Rt.clone())},Ct.prototype.sqr=function(Rt){return this.mul(Rt,Rt)},Ct.prototype.sqrt=function(Rt){if(Rt.isZero())return Rt.clone();var $t=this.m.andln(3);if(rt($t%2===1),$t===3){var vt=this.m.add(new ot(1)).iushrn(2);return this.pow(Rt,vt)}for(var It=this.m.subn(1),Ot=0;!It.isZero()&&It.andln(1)===0;)Ot++,It.iushrn(1);rt(!It.isZero());var Wt=new ot(1).toRed(this),zt=Wt.redNeg(),Ft=this.m.subn(1).iushrn(1),Nt=this.m.bitLength();for(Nt=new ot(2*Nt*Nt).toRed(this);this.pow(Nt,Ft).cmp(zt)!==0;)Nt.redIAdd(zt);for(var Ut=this.pow(Nt,It),Pt=this.pow(Rt,It.addn(1).iushrn(1)),Ht=this.pow(Rt,It),Qt=Ot;Ht.cmp(Wt)!==0;){for(var an=Ht,Yt=0;an.cmp(Wt)!==0;Yt++)an=an.redSqr();rt(Yt=0;Ot--){for(var Ut=$t.words[Ot],Pt=Nt-1;Pt>=0;Pt--){var Ht=Ut>>Pt&1;if(Wt!==It[0]&&(Wt=this.sqr(Wt)),Ht===0&&zt===0){Ft=0;continue}zt<<=1,zt|=Ht,Ft++,!(Ft!==vt&&(Ot!==0||Pt!==0))&&(Wt=this.mul(Wt,It[zt]),Ft=0,zt=0)}Nt=26}return Wt},Ct.prototype.convertTo=function(Rt){var $t=Rt.umod(this.m);return $t===Rt?$t.clone():$t},Ct.prototype.convertFrom=function(Rt){var $t=Rt.clone();return $t.red=null,$t},ot.mont=function(Rt){return new Lt(Rt)};function Lt(jt){Ct.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it(Lt,Ct),Lt.prototype.convertTo=function(Rt){return this.imod(Rt.ushln(this.shift))},Lt.prototype.convertFrom=function(Rt){var $t=this.imod(Rt.mul(this.rinv));return $t.red=null,$t},Lt.prototype.imul=function(Rt,$t){if(Rt.isZero()||$t.isZero())return Rt.words[0]=0,Rt.length=1,Rt;var vt=Rt.imul($t),It=vt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ot=vt.isub(It).iushrn(this.shift),Wt=Ot;return Ot.cmp(this.m)>=0?Wt=Ot.isub(this.m):Ot.cmpn(0)<0&&(Wt=Ot.iadd(this.m)),Wt._forceRed(this)},Lt.prototype.mul=function(Rt,$t){if(Rt.isZero()||$t.isZero())return new ot(0)._forceRed(this);var vt=Rt.mul($t),It=vt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ot=vt.isub(It).iushrn(this.shift),Wt=Ot;return Ot.cmp(this.m)>=0?Wt=Ot.isub(this.m):Ot.cmpn(0)<0&&(Wt=Ot.iadd(this.m)),Wt._forceRed(this)},Lt.prototype.invm=function(Rt){var $t=this.imod(Rt._invmp(this.m).mul(this.r2));return $t._forceRed(this)}})(tt,commonjsGlobal)})(bn$2);var bnExports$2=bn$2.exports,brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var tt;brorand.exports=function(it){return tt||(tt=new et(null)),tt.generate(it)};function et(rt){this.rand=rt}if(brorand.exports.Rand=et,et.prototype.generate=function(it){return this._rand(it)},et.prototype._rand=function(it){if(this.rand.getBytes)return this.rand.getBytes(it);for(var ot=new Uint8Array(it),at=0;at=0);return st},nt.prototype._randrange=function(it,ot){var at=ot.sub(it);return it.add(this._randbelow(at))},nt.prototype.test=function(it,ot,at){var st=it.bitLength(),lt=tt.mont(it),ct=new tt(1).toRed(lt);ot||(ot=Math.max(1,st/48|0));for(var ut=it.subn(1),ht=0;!ut.testn(ht);ht++);for(var dt=it.shrn(ht),pt=ut.toRed(lt),mt=!0;ot>0;ot--){var gt=this._randrange(new tt(2),ut);at&&at(gt);var yt=gt.toRed(lt).redPow(dt);if(!(yt.cmp(ct)===0||yt.cmp(pt)===0)){for(var bt=1;bt0;ot--){var pt=this._randrange(new tt(2),ct),mt=it.gcd(pt);if(mt.cmpn(1)!==0)return mt;var gt=pt.toRed(st).redPow(ht);if(!(gt.cmp(lt)===0||gt.cmp(dt)===0)){for(var yt=1;ytbt;)xt.ishrn(1);if(xt.isEven()&&xt.iadd(ot),xt.testn(1)||xt.iadd(at),wt.cmp(at)){if(!wt.cmp(st))for(;xt.mod(lt).cmp(ct);)xt.iadd(ht)}else for(;xt.mod(nt).cmp(ut);)xt.iadd(ht);if(kt=xt.shrn(1),mt(kt)&&mt(xt)&>(kt)&>(xt)&&it.test(kt)&&it.test(xt))return xt}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var tt=bnExports$2,et=requireMr(),nt=new et,rt=new tt(24),it=new tt(11),ot=new tt(10),at=new tt(3),st=new tt(7),lt=requireGeneratePrime(),ct=browserExports;dh=mt;function ut(yt,bt){return bt=bt||"utf8",Buffer.isBuffer(yt)||(yt=new Buffer(yt,bt)),this._pub=new tt(yt),this}function ht(yt,bt){return bt=bt||"utf8",Buffer.isBuffer(yt)||(yt=new Buffer(yt,bt)),this._priv=new tt(yt),this}var dt={};function pt(yt,bt){var wt=bt.toString("hex"),xt=[wt,yt.toString(16)].join("_");if(xt in dt)return dt[xt];var kt=0;if(yt.isEven()||!lt.simpleSieve||!lt.fermatTest(yt)||!nt.test(yt))return kt+=1,wt==="02"||wt==="05"?kt+=8:kt+=4,dt[xt]=kt,kt;nt.test(yt.shrn(1))||(kt+=2);var St;switch(wt){case"02":yt.mod(rt).cmp(it)&&(kt+=8);break;case"05":St=yt.mod(ot),St.cmp(at)&&St.cmp(st)&&(kt+=8);break;default:kt+=4}return dt[xt]=kt,kt}function mt(yt,bt,wt){this.setGenerator(bt),this.__prime=new tt(yt),this._prime=tt.mont(this.__prime),this._primeLen=yt.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,wt?(this.setPublicKey=ut,this.setPrivateKey=ht):this._primeCode=8}Object.defineProperty(mt.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=pt(this.__prime,this.__gen)),this._primeCode}}),mt.prototype.generateKeys=function(){return this._priv||(this._priv=new tt(ct(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},mt.prototype.computeSecret=function(yt){yt=new tt(yt),yt=yt.toRed(this._prime);var bt=yt.redPow(this._priv).fromRed(),wt=new Buffer(bt.toArray()),xt=this.getPrime();if(wt.length0?vt:It},ot.min=function(vt,It){return vt.cmp(It)<0?vt:It},ot.prototype._init=function(vt,It,Ot){if(typeof vt=="number")return this._initNumber(vt,It,Ot);if(typeof vt=="object")return this._initArray(vt,It,Ot);It==="hex"&&(It=16),rt(It===(It|0)&&It>=2&&It<=36),vt=vt.toString().replace(/\s+/g,"");var Wt=0;vt[0]==="-"&&(Wt++,this.negative=1),Wt=0;Wt-=3)Ft=vt[Wt]|vt[Wt-1]<<8|vt[Wt-2]<<16,this.words[zt]|=Ft<>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);else if(Ot==="le")for(Wt=0,zt=0;Wt>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);return this._strip()};function st($t,vt){var It=$t.charCodeAt(vt);if(It>=48&&It<=57)return It-48;if(It>=65&&It<=70)return It-55;if(It>=97&&It<=102)return It-87;rt(!1,"Invalid character in "+$t)}function lt($t,vt,It){var Ot=st($t,It);return It-1>=vt&&(Ot|=st($t,It-1)<<4),Ot}ot.prototype._parseHex=function(vt,It,Ot){this.length=Math.ceil((vt.length-It)/6),this.words=new Array(this.length);for(var Wt=0;Wt=It;Wt-=2)Nt=lt(vt,It,Wt)<=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8;else{var Ut=vt.length-It;for(Wt=Ut%2===0?It+1:It;Wt=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8}this._strip()};function ct($t,vt,It,Ot){for(var Wt=0,zt=0,Ft=Math.min($t.length,It),Nt=vt;Nt=49?zt=Ut-49+10:Ut>=17?zt=Ut-17+10:zt=Ut,rt(Ut>=0&&zt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(vt,It){vt=vt||10,It=It|0||1;var Ot;if(vt===16||vt==="hex"){Ot="";for(var Wt=0,zt=0,Ft=0;Ft>>24-Wt&16777215,Wt+=2,Wt>=26&&(Wt-=26,Ft--),zt!==0||Ft!==this.length-1?Ot=dt[6-Ut.length]+Ut+Ot:Ot=Ut+Ot}for(zt!==0&&(Ot=zt.toString(16)+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}if(vt===(vt|0)&&vt>=2&&vt<=36){var Pt=pt[vt],Ht=mt[vt];Ot="";var Qt=this.clone();for(Qt.negative=0;!Qt.isZero();){var an=Qt.modrn(Ht).toString(vt);Qt=Qt.idivn(Ht),Qt.isZero()?Ot=an+Ot:Ot=dt[Pt-an.length]+an+Ot}for(this.isZero()&&(Ot="0"+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}rt(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var vt=this.words[0];return this.length===2?vt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?vt+=4503599627370496+this.words[1]*67108864:this.length>2&&rt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-vt:vt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(vt,It){return this.toArrayLike(at,vt,It)}),ot.prototype.toArray=function(vt,It){return this.toArrayLike(Array,vt,It)};var gt=function(vt,It){return vt.allocUnsafe?vt.allocUnsafe(It):new vt(It)};ot.prototype.toArrayLike=function(vt,It,Ot){this._strip();var Wt=this.byteLength(),zt=Ot||Math.max(1,Wt);rt(Wt<=zt,"byte array longer than desired length"),rt(zt>0,"Requested array length <= 0");var Ft=gt(vt,zt),Nt=It==="le"?"LE":"BE";return this["_toArrayLike"+Nt](Ft,Wt),Ft},ot.prototype._toArrayLikeLE=function(vt,It){for(var Ot=0,Wt=0,zt=0,Ft=0;zt>8&255),Ot>16&255),Ft===6?(Ot>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot=0&&(vt[Ot--]=Nt>>8&255),Ot>=0&&(vt[Ot--]=Nt>>16&255),Ft===6?(Ot>=0&&(vt[Ot--]=Nt>>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot>=0)for(vt[Ot--]=Wt;Ot>=0;)vt[Ot--]=0},Math.clz32?ot.prototype._countBits=function(vt){return 32-Math.clz32(vt)}:ot.prototype._countBits=function(vt){var It=vt,Ot=0;return It>=4096&&(Ot+=13,It>>>=13),It>=64&&(Ot+=7,It>>>=7),It>=8&&(Ot+=4,It>>>=4),It>=2&&(Ot+=2,It>>>=2),Ot+It},ot.prototype._zeroBits=function(vt){if(vt===0)return 26;var It=vt,Ot=0;return It&8191||(Ot+=13,It>>>=13),It&127||(Ot+=7,It>>>=7),It&15||(Ot+=4,It>>>=4),It&3||(Ot+=2,It>>>=2),It&1||Ot++,Ot},ot.prototype.bitLength=function(){var vt=this.words[this.length-1],It=this._countBits(vt);return(this.length-1)*26+It};function yt($t){for(var vt=new Array($t.bitLength()),It=0;It>>Wt&1}return vt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var vt=0,It=0;Itvt.length?this.clone().ior(vt):vt.clone().ior(this)},ot.prototype.uor=function(vt){return this.length>vt.length?this.clone().iuor(vt):vt.clone().iuor(this)},ot.prototype.iuand=function(vt){var It;this.length>vt.length?It=vt:It=this;for(var Ot=0;Otvt.length?this.clone().iand(vt):vt.clone().iand(this)},ot.prototype.uand=function(vt){return this.length>vt.length?this.clone().iuand(vt):vt.clone().iuand(this)},ot.prototype.iuxor=function(vt){var It,Ot;this.length>vt.length?(It=this,Ot=vt):(It=vt,Ot=this);for(var Wt=0;Wtvt.length?this.clone().ixor(vt):vt.clone().ixor(this)},ot.prototype.uxor=function(vt){return this.length>vt.length?this.clone().iuxor(vt):vt.clone().iuxor(this)},ot.prototype.inotn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=Math.ceil(vt/26)|0,Ot=vt%26;this._expand(It),Ot>0&&It--;for(var Wt=0;Wt0&&(this.words[Wt]=~this.words[Wt]&67108863>>26-Ot),this._strip()},ot.prototype.notn=function(vt){return this.clone().inotn(vt)},ot.prototype.setn=function(vt,It){rt(typeof vt=="number"&&vt>=0);var Ot=vt/26|0,Wt=vt%26;return this._expand(Ot+1),It?this.words[Ot]=this.words[Ot]|1<vt.length?(Ot=this,Wt=vt):(Ot=vt,Wt=this);for(var zt=0,Ft=0;Ft>>26;for(;zt!==0&&Ft>>26;if(this.length=Ot.length,zt!==0)this.words[this.length]=zt,this.length++;else if(Ot!==this)for(;Ftvt.length?this.clone().iadd(vt):vt.clone().iadd(this)},ot.prototype.isub=function(vt){if(vt.negative!==0){vt.negative=0;var It=this.iadd(vt);return vt.negative=1,It._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(vt),this.negative=1,this._normSign();var Ot=this.cmp(vt);if(Ot===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Wt,zt;Ot>0?(Wt=this,zt=vt):(Wt=vt,zt=this);for(var Ft=0,Nt=0;Nt>26,this.words[Nt]=It&67108863;for(;Ft!==0&&Nt>26,this.words[Nt]=It&67108863;if(Ft===0&&Nt>>26,Qt=Ut&67108863,an=Math.min(Pt,vt.length-1),Yt=Math.max(0,Pt-$t.length+1);Yt<=an;Yt++){var nn=Pt-Yt|0;Wt=$t.words[nn]|0,zt=vt.words[Yt]|0,Ft=Wt*zt+Qt,Ht+=Ft/67108864|0,Qt=Ft&67108863}It.words[Pt]=Qt|0,Ut=Ht|0}return Ut!==0?It.words[Pt]=Ut|0:It.length--,It._strip()}var wt=function(vt,It,Ot){var Wt=vt.words,zt=It.words,Ft=Ot.words,Nt=0,Ut,Pt,Ht,Qt=Wt[0]|0,an=Qt&8191,Yt=Qt>>>13,nn=Wt[1]|0,tn=nn&8191,dn=nn>>>13,wn=Wt[2]|0,rn=wn&8191,Zt=wn>>>13,vn=Wt[3]|0,Cn=vn&8191,$n=vn>>>13,Nn=Wt[4]|0,En=Nn&8191,sn=Nn>>>13,pn=Wt[5]|0,Tn=pn&8191,In=pn>>>13,yn=Wt[6]|0,hn=yn&8191,fn=yn>>>13,xn=Wt[7]|0,jn=xn&8191,cn=xn>>>13,Xt=Wt[8]|0,Kt=Xt&8191,kn=Xt>>>13,Mn=Wt[9]|0,On=Mn&8191,Bn=Mn>>>13,Xn=zt[0]|0,Vn=Xn&8191,Gn=Xn>>>13,zn=zt[1]|0,Jn=zn&8191,Wn=zn>>>13,fr=zt[2]|0,ur=fr&8191,wr=fr>>>13,Xr=zt[3]|0,Er=Xr&8191,Ir=Xr>>>13,Gr=zt[4]|0,Or=Gr&8191,Lr=Gr>>>13,oo=zt[5]|0,qr=oo&8191,jr=oo>>>13,mo=zt[6]|0,_n=mo&8191,Pn=mo>>>13,un=zt[7]|0,Jt=un&8191,Sn=un>>>13,Dn=zt[8]|0,Fn=Dn&8191,Yn=Dn>>>13,tr=zt[9]|0,ar=tr&8191,lr=tr>>>13;Ot.negative=vt.negative^It.negative,Ot.length=19,Ut=Math.imul(an,Vn),Pt=Math.imul(an,Gn),Pt=Pt+Math.imul(Yt,Vn)|0,Ht=Math.imul(Yt,Gn);var Vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Ut=Math.imul(tn,Vn),Pt=Math.imul(tn,Gn),Pt=Pt+Math.imul(dn,Vn)|0,Ht=Math.imul(dn,Gn),Ut=Ut+Math.imul(an,Jn)|0,Pt=Pt+Math.imul(an,Wn)|0,Pt=Pt+Math.imul(Yt,Jn)|0,Ht=Ht+Math.imul(Yt,Wn)|0;var vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(vr>>>26)|0,vr&=67108863,Ut=Math.imul(rn,Vn),Pt=Math.imul(rn,Gn),Pt=Pt+Math.imul(Zt,Vn)|0,Ht=Math.imul(Zt,Gn),Ut=Ut+Math.imul(tn,Jn)|0,Pt=Pt+Math.imul(tn,Wn)|0,Pt=Pt+Math.imul(dn,Jn)|0,Ht=Ht+Math.imul(dn,Wn)|0,Ut=Ut+Math.imul(an,ur)|0,Pt=Pt+Math.imul(an,wr)|0,Pt=Pt+Math.imul(Yt,ur)|0,Ht=Ht+Math.imul(Yt,wr)|0;var Nr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Ut=Math.imul(Cn,Vn),Pt=Math.imul(Cn,Gn),Pt=Pt+Math.imul($n,Vn)|0,Ht=Math.imul($n,Gn),Ut=Ut+Math.imul(rn,Jn)|0,Pt=Pt+Math.imul(rn,Wn)|0,Pt=Pt+Math.imul(Zt,Jn)|0,Ht=Ht+Math.imul(Zt,Wn)|0,Ut=Ut+Math.imul(tn,ur)|0,Pt=Pt+Math.imul(tn,wr)|0,Pt=Pt+Math.imul(dn,ur)|0,Ht=Ht+Math.imul(dn,wr)|0,Ut=Ut+Math.imul(an,Er)|0,Pt=Pt+Math.imul(an,Ir)|0,Pt=Pt+Math.imul(Yt,Er)|0,Ht=Ht+Math.imul(Yt,Ir)|0;var Hr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Ut=Math.imul(En,Vn),Pt=Math.imul(En,Gn),Pt=Pt+Math.imul(sn,Vn)|0,Ht=Math.imul(sn,Gn),Ut=Ut+Math.imul(Cn,Jn)|0,Pt=Pt+Math.imul(Cn,Wn)|0,Pt=Pt+Math.imul($n,Jn)|0,Ht=Ht+Math.imul($n,Wn)|0,Ut=Ut+Math.imul(rn,ur)|0,Pt=Pt+Math.imul(rn,wr)|0,Pt=Pt+Math.imul(Zt,ur)|0,Ht=Ht+Math.imul(Zt,wr)|0,Ut=Ut+Math.imul(tn,Er)|0,Pt=Pt+Math.imul(tn,Ir)|0,Pt=Pt+Math.imul(dn,Er)|0,Ht=Ht+Math.imul(dn,Ir)|0,Ut=Ut+Math.imul(an,Or)|0,Pt=Pt+Math.imul(an,Lr)|0,Pt=Pt+Math.imul(Yt,Or)|0,Ht=Ht+Math.imul(Yt,Lr)|0;var eo=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ut=Math.imul(Tn,Vn),Pt=Math.imul(Tn,Gn),Pt=Pt+Math.imul(In,Vn)|0,Ht=Math.imul(In,Gn),Ut=Ut+Math.imul(En,Jn)|0,Pt=Pt+Math.imul(En,Wn)|0,Pt=Pt+Math.imul(sn,Jn)|0,Ht=Ht+Math.imul(sn,Wn)|0,Ut=Ut+Math.imul(Cn,ur)|0,Pt=Pt+Math.imul(Cn,wr)|0,Pt=Pt+Math.imul($n,ur)|0,Ht=Ht+Math.imul($n,wr)|0,Ut=Ut+Math.imul(rn,Er)|0,Pt=Pt+Math.imul(rn,Ir)|0,Pt=Pt+Math.imul(Zt,Er)|0,Ht=Ht+Math.imul(Zt,Ir)|0,Ut=Ut+Math.imul(tn,Or)|0,Pt=Pt+Math.imul(tn,Lr)|0,Pt=Pt+Math.imul(dn,Or)|0,Ht=Ht+Math.imul(dn,Lr)|0,Ut=Ut+Math.imul(an,qr)|0,Pt=Pt+Math.imul(an,jr)|0,Pt=Pt+Math.imul(Yt,qr)|0,Ht=Ht+Math.imul(Yt,jr)|0;var Jr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Ut=Math.imul(hn,Vn),Pt=Math.imul(hn,Gn),Pt=Pt+Math.imul(fn,Vn)|0,Ht=Math.imul(fn,Gn),Ut=Ut+Math.imul(Tn,Jn)|0,Pt=Pt+Math.imul(Tn,Wn)|0,Pt=Pt+Math.imul(In,Jn)|0,Ht=Ht+Math.imul(In,Wn)|0,Ut=Ut+Math.imul(En,ur)|0,Pt=Pt+Math.imul(En,wr)|0,Pt=Pt+Math.imul(sn,ur)|0,Ht=Ht+Math.imul(sn,wr)|0,Ut=Ut+Math.imul(Cn,Er)|0,Pt=Pt+Math.imul(Cn,Ir)|0,Pt=Pt+Math.imul($n,Er)|0,Ht=Ht+Math.imul($n,Ir)|0,Ut=Ut+Math.imul(rn,Or)|0,Pt=Pt+Math.imul(rn,Lr)|0,Pt=Pt+Math.imul(Zt,Or)|0,Ht=Ht+Math.imul(Zt,Lr)|0,Ut=Ut+Math.imul(tn,qr)|0,Pt=Pt+Math.imul(tn,jr)|0,Pt=Pt+Math.imul(dn,qr)|0,Ht=Ht+Math.imul(dn,jr)|0,Ut=Ut+Math.imul(an,_n)|0,Pt=Pt+Math.imul(an,Pn)|0,Pt=Pt+Math.imul(Yt,_n)|0,Ht=Ht+Math.imul(Yt,Pn)|0;var Zr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,Ut=Math.imul(jn,Vn),Pt=Math.imul(jn,Gn),Pt=Pt+Math.imul(cn,Vn)|0,Ht=Math.imul(cn,Gn),Ut=Ut+Math.imul(hn,Jn)|0,Pt=Pt+Math.imul(hn,Wn)|0,Pt=Pt+Math.imul(fn,Jn)|0,Ht=Ht+Math.imul(fn,Wn)|0,Ut=Ut+Math.imul(Tn,ur)|0,Pt=Pt+Math.imul(Tn,wr)|0,Pt=Pt+Math.imul(In,ur)|0,Ht=Ht+Math.imul(In,wr)|0,Ut=Ut+Math.imul(En,Er)|0,Pt=Pt+Math.imul(En,Ir)|0,Pt=Pt+Math.imul(sn,Er)|0,Ht=Ht+Math.imul(sn,Ir)|0,Ut=Ut+Math.imul(Cn,Or)|0,Pt=Pt+Math.imul(Cn,Lr)|0,Pt=Pt+Math.imul($n,Or)|0,Ht=Ht+Math.imul($n,Lr)|0,Ut=Ut+Math.imul(rn,qr)|0,Pt=Pt+Math.imul(rn,jr)|0,Pt=Pt+Math.imul(Zt,qr)|0,Ht=Ht+Math.imul(Zt,jr)|0,Ut=Ut+Math.imul(tn,_n)|0,Pt=Pt+Math.imul(tn,Pn)|0,Pt=Pt+Math.imul(dn,_n)|0,Ht=Ht+Math.imul(dn,Pn)|0,Ut=Ut+Math.imul(an,Jt)|0,Pt=Pt+Math.imul(an,Sn)|0,Pt=Pt+Math.imul(Yt,Jt)|0,Ht=Ht+Math.imul(Yt,Sn)|0;var br=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(br>>>26)|0,br&=67108863,Ut=Math.imul(Kt,Vn),Pt=Math.imul(Kt,Gn),Pt=Pt+Math.imul(kn,Vn)|0,Ht=Math.imul(kn,Gn),Ut=Ut+Math.imul(jn,Jn)|0,Pt=Pt+Math.imul(jn,Wn)|0,Pt=Pt+Math.imul(cn,Jn)|0,Ht=Ht+Math.imul(cn,Wn)|0,Ut=Ut+Math.imul(hn,ur)|0,Pt=Pt+Math.imul(hn,wr)|0,Pt=Pt+Math.imul(fn,ur)|0,Ht=Ht+Math.imul(fn,wr)|0,Ut=Ut+Math.imul(Tn,Er)|0,Pt=Pt+Math.imul(Tn,Ir)|0,Pt=Pt+Math.imul(In,Er)|0,Ht=Ht+Math.imul(In,Ir)|0,Ut=Ut+Math.imul(En,Or)|0,Pt=Pt+Math.imul(En,Lr)|0,Pt=Pt+Math.imul(sn,Or)|0,Ht=Ht+Math.imul(sn,Lr)|0,Ut=Ut+Math.imul(Cn,qr)|0,Pt=Pt+Math.imul(Cn,jr)|0,Pt=Pt+Math.imul($n,qr)|0,Ht=Ht+Math.imul($n,jr)|0,Ut=Ut+Math.imul(rn,_n)|0,Pt=Pt+Math.imul(rn,Pn)|0,Pt=Pt+Math.imul(Zt,_n)|0,Ht=Ht+Math.imul(Zt,Pn)|0,Ut=Ut+Math.imul(tn,Jt)|0,Pt=Pt+Math.imul(tn,Sn)|0,Pt=Pt+Math.imul(dn,Jt)|0,Ht=Ht+Math.imul(dn,Sn)|0,Ut=Ut+Math.imul(an,Fn)|0,Pt=Pt+Math.imul(an,Yn)|0,Pt=Pt+Math.imul(Yt,Fn)|0,Ht=Ht+Math.imul(Yt,Yn)|0;var Pr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Ut=Math.imul(On,Vn),Pt=Math.imul(On,Gn),Pt=Pt+Math.imul(Bn,Vn)|0,Ht=Math.imul(Bn,Gn),Ut=Ut+Math.imul(Kt,Jn)|0,Pt=Pt+Math.imul(Kt,Wn)|0,Pt=Pt+Math.imul(kn,Jn)|0,Ht=Ht+Math.imul(kn,Wn)|0,Ut=Ut+Math.imul(jn,ur)|0,Pt=Pt+Math.imul(jn,wr)|0,Pt=Pt+Math.imul(cn,ur)|0,Ht=Ht+Math.imul(cn,wr)|0,Ut=Ut+Math.imul(hn,Er)|0,Pt=Pt+Math.imul(hn,Ir)|0,Pt=Pt+Math.imul(fn,Er)|0,Ht=Ht+Math.imul(fn,Ir)|0,Ut=Ut+Math.imul(Tn,Or)|0,Pt=Pt+Math.imul(Tn,Lr)|0,Pt=Pt+Math.imul(In,Or)|0,Ht=Ht+Math.imul(In,Lr)|0,Ut=Ut+Math.imul(En,qr)|0,Pt=Pt+Math.imul(En,jr)|0,Pt=Pt+Math.imul(sn,qr)|0,Ht=Ht+Math.imul(sn,jr)|0,Ut=Ut+Math.imul(Cn,_n)|0,Pt=Pt+Math.imul(Cn,Pn)|0,Pt=Pt+Math.imul($n,_n)|0,Ht=Ht+Math.imul($n,Pn)|0,Ut=Ut+Math.imul(rn,Jt)|0,Pt=Pt+Math.imul(rn,Sn)|0,Pt=Pt+Math.imul(Zt,Jt)|0,Ht=Ht+Math.imul(Zt,Sn)|0,Ut=Ut+Math.imul(tn,Fn)|0,Pt=Pt+Math.imul(tn,Yn)|0,Pt=Pt+Math.imul(dn,Fn)|0,Ht=Ht+Math.imul(dn,Yn)|0,Ut=Ut+Math.imul(an,ar)|0,Pt=Pt+Math.imul(an,lr)|0,Pt=Pt+Math.imul(Yt,ar)|0,Ht=Ht+Math.imul(Yt,lr)|0;var Fr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Ut=Math.imul(On,Jn),Pt=Math.imul(On,Wn),Pt=Pt+Math.imul(Bn,Jn)|0,Ht=Math.imul(Bn,Wn),Ut=Ut+Math.imul(Kt,ur)|0,Pt=Pt+Math.imul(Kt,wr)|0,Pt=Pt+Math.imul(kn,ur)|0,Ht=Ht+Math.imul(kn,wr)|0,Ut=Ut+Math.imul(jn,Er)|0,Pt=Pt+Math.imul(jn,Ir)|0,Pt=Pt+Math.imul(cn,Er)|0,Ht=Ht+Math.imul(cn,Ir)|0,Ut=Ut+Math.imul(hn,Or)|0,Pt=Pt+Math.imul(hn,Lr)|0,Pt=Pt+Math.imul(fn,Or)|0,Ht=Ht+Math.imul(fn,Lr)|0,Ut=Ut+Math.imul(Tn,qr)|0,Pt=Pt+Math.imul(Tn,jr)|0,Pt=Pt+Math.imul(In,qr)|0,Ht=Ht+Math.imul(In,jr)|0,Ut=Ut+Math.imul(En,_n)|0,Pt=Pt+Math.imul(En,Pn)|0,Pt=Pt+Math.imul(sn,_n)|0,Ht=Ht+Math.imul(sn,Pn)|0,Ut=Ut+Math.imul(Cn,Jt)|0,Pt=Pt+Math.imul(Cn,Sn)|0,Pt=Pt+Math.imul($n,Jt)|0,Ht=Ht+Math.imul($n,Sn)|0,Ut=Ut+Math.imul(rn,Fn)|0,Pt=Pt+Math.imul(rn,Yn)|0,Pt=Pt+Math.imul(Zt,Fn)|0,Ht=Ht+Math.imul(Zt,Yn)|0,Ut=Ut+Math.imul(tn,ar)|0,Pt=Pt+Math.imul(tn,lr)|0,Pt=Pt+Math.imul(dn,ar)|0,Ht=Ht+Math.imul(dn,lr)|0;var Mr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,Ut=Math.imul(On,ur),Pt=Math.imul(On,wr),Pt=Pt+Math.imul(Bn,ur)|0,Ht=Math.imul(Bn,wr),Ut=Ut+Math.imul(Kt,Er)|0,Pt=Pt+Math.imul(Kt,Ir)|0,Pt=Pt+Math.imul(kn,Er)|0,Ht=Ht+Math.imul(kn,Ir)|0,Ut=Ut+Math.imul(jn,Or)|0,Pt=Pt+Math.imul(jn,Lr)|0,Pt=Pt+Math.imul(cn,Or)|0,Ht=Ht+Math.imul(cn,Lr)|0,Ut=Ut+Math.imul(hn,qr)|0,Pt=Pt+Math.imul(hn,jr)|0,Pt=Pt+Math.imul(fn,qr)|0,Ht=Ht+Math.imul(fn,jr)|0,Ut=Ut+Math.imul(Tn,_n)|0,Pt=Pt+Math.imul(Tn,Pn)|0,Pt=Pt+Math.imul(In,_n)|0,Ht=Ht+Math.imul(In,Pn)|0,Ut=Ut+Math.imul(En,Jt)|0,Pt=Pt+Math.imul(En,Sn)|0,Pt=Pt+Math.imul(sn,Jt)|0,Ht=Ht+Math.imul(sn,Sn)|0,Ut=Ut+Math.imul(Cn,Fn)|0,Pt=Pt+Math.imul(Cn,Yn)|0,Pt=Pt+Math.imul($n,Fn)|0,Ht=Ht+Math.imul($n,Yn)|0,Ut=Ut+Math.imul(rn,ar)|0,Pt=Pt+Math.imul(rn,lr)|0,Pt=Pt+Math.imul(Zt,ar)|0,Ht=Ht+Math.imul(Zt,lr)|0;var Cr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Ut=Math.imul(On,Er),Pt=Math.imul(On,Ir),Pt=Pt+Math.imul(Bn,Er)|0,Ht=Math.imul(Bn,Ir),Ut=Ut+Math.imul(Kt,Or)|0,Pt=Pt+Math.imul(Kt,Lr)|0,Pt=Pt+Math.imul(kn,Or)|0,Ht=Ht+Math.imul(kn,Lr)|0,Ut=Ut+Math.imul(jn,qr)|0,Pt=Pt+Math.imul(jn,jr)|0,Pt=Pt+Math.imul(cn,qr)|0,Ht=Ht+Math.imul(cn,jr)|0,Ut=Ut+Math.imul(hn,_n)|0,Pt=Pt+Math.imul(hn,Pn)|0,Pt=Pt+Math.imul(fn,_n)|0,Ht=Ht+Math.imul(fn,Pn)|0,Ut=Ut+Math.imul(Tn,Jt)|0,Pt=Pt+Math.imul(Tn,Sn)|0,Pt=Pt+Math.imul(In,Jt)|0,Ht=Ht+Math.imul(In,Sn)|0,Ut=Ut+Math.imul(En,Fn)|0,Pt=Pt+Math.imul(En,Yn)|0,Pt=Pt+Math.imul(sn,Fn)|0,Ht=Ht+Math.imul(sn,Yn)|0,Ut=Ut+Math.imul(Cn,ar)|0,Pt=Pt+Math.imul(Cn,lr)|0,Pt=Pt+Math.imul($n,ar)|0,Ht=Ht+Math.imul($n,lr)|0;var Dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Ut=Math.imul(On,Or),Pt=Math.imul(On,Lr),Pt=Pt+Math.imul(Bn,Or)|0,Ht=Math.imul(Bn,Lr),Ut=Ut+Math.imul(Kt,qr)|0,Pt=Pt+Math.imul(Kt,jr)|0,Pt=Pt+Math.imul(kn,qr)|0,Ht=Ht+Math.imul(kn,jr)|0,Ut=Ut+Math.imul(jn,_n)|0,Pt=Pt+Math.imul(jn,Pn)|0,Pt=Pt+Math.imul(cn,_n)|0,Ht=Ht+Math.imul(cn,Pn)|0,Ut=Ut+Math.imul(hn,Jt)|0,Pt=Pt+Math.imul(hn,Sn)|0,Pt=Pt+Math.imul(fn,Jt)|0,Ht=Ht+Math.imul(fn,Sn)|0,Ut=Ut+Math.imul(Tn,Fn)|0,Pt=Pt+Math.imul(Tn,Yn)|0,Pt=Pt+Math.imul(In,Fn)|0,Ht=Ht+Math.imul(In,Yn)|0,Ut=Ut+Math.imul(En,ar)|0,Pt=Pt+Math.imul(En,lr)|0,Pt=Pt+Math.imul(sn,ar)|0,Ht=Ht+Math.imul(sn,lr)|0;var Ur=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,Ut=Math.imul(On,qr),Pt=Math.imul(On,jr),Pt=Pt+Math.imul(Bn,qr)|0,Ht=Math.imul(Bn,jr),Ut=Ut+Math.imul(Kt,_n)|0,Pt=Pt+Math.imul(Kt,Pn)|0,Pt=Pt+Math.imul(kn,_n)|0,Ht=Ht+Math.imul(kn,Pn)|0,Ut=Ut+Math.imul(jn,Jt)|0,Pt=Pt+Math.imul(jn,Sn)|0,Pt=Pt+Math.imul(cn,Jt)|0,Ht=Ht+Math.imul(cn,Sn)|0,Ut=Ut+Math.imul(hn,Fn)|0,Pt=Pt+Math.imul(hn,Yn)|0,Pt=Pt+Math.imul(fn,Fn)|0,Ht=Ht+Math.imul(fn,Yn)|0,Ut=Ut+Math.imul(Tn,ar)|0,Pt=Pt+Math.imul(Tn,lr)|0,Pt=Pt+Math.imul(In,ar)|0,Ht=Ht+Math.imul(In,lr)|0;var Rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,Ut=Math.imul(On,_n),Pt=Math.imul(On,Pn),Pt=Pt+Math.imul(Bn,_n)|0,Ht=Math.imul(Bn,Pn),Ut=Ut+Math.imul(Kt,Jt)|0,Pt=Pt+Math.imul(Kt,Sn)|0,Pt=Pt+Math.imul(kn,Jt)|0,Ht=Ht+Math.imul(kn,Sn)|0,Ut=Ut+Math.imul(jn,Fn)|0,Pt=Pt+Math.imul(jn,Yn)|0,Pt=Pt+Math.imul(cn,Fn)|0,Ht=Ht+Math.imul(cn,Yn)|0,Ut=Ut+Math.imul(hn,ar)|0,Pt=Pt+Math.imul(hn,lr)|0,Pt=Pt+Math.imul(fn,ar)|0,Ht=Ht+Math.imul(fn,lr)|0;var er=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(er>>>26)|0,er&=67108863,Ut=Math.imul(On,Jt),Pt=Math.imul(On,Sn),Pt=Pt+Math.imul(Bn,Jt)|0,Ht=Math.imul(Bn,Sn),Ut=Ut+Math.imul(Kt,Fn)|0,Pt=Pt+Math.imul(Kt,Yn)|0,Pt=Pt+Math.imul(kn,Fn)|0,Ht=Ht+Math.imul(kn,Yn)|0,Ut=Ut+Math.imul(jn,ar)|0,Pt=Pt+Math.imul(jn,lr)|0,Pt=Pt+Math.imul(cn,ar)|0,Ht=Ht+Math.imul(cn,lr)|0;var rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(rr>>>26)|0,rr&=67108863,Ut=Math.imul(On,Fn),Pt=Math.imul(On,Yn),Pt=Pt+Math.imul(Bn,Fn)|0,Ht=Math.imul(Bn,Yn),Ut=Ut+Math.imul(Kt,ar)|0,Pt=Pt+Math.imul(Kt,lr)|0,Pt=Pt+Math.imul(kn,ar)|0,Ht=Ht+Math.imul(kn,lr)|0;var xr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Ut=Math.imul(On,ar),Pt=Math.imul(On,lr),Pt=Pt+Math.imul(Bn,ar)|0,Ht=Math.imul(Bn,lr);var dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;return Nt=(Ht+(Pt>>>13)|0)+(dr>>>26)|0,dr&=67108863,Ft[0]=Vr,Ft[1]=vr,Ft[2]=Nr,Ft[3]=Hr,Ft[4]=eo,Ft[5]=Jr,Ft[6]=Zr,Ft[7]=br,Ft[8]=Pr,Ft[9]=Fr,Ft[10]=Mr,Ft[11]=Cr,Ft[12]=Dr,Ft[13]=Ur,Ft[14]=Rr,Ft[15]=er,Ft[16]=rr,Ft[17]=xr,Ft[18]=dr,Nt!==0&&(Ft[19]=Nt,Ot.length++),Ot};Math.imul||(wt=bt);function xt($t,vt,It){It.negative=vt.negative^$t.negative,It.length=$t.length+vt.length;for(var Ot=0,Wt=0,zt=0;zt>>26)|0,Wt+=Ft>>>26,Ft&=67108863}It.words[zt]=Nt,Ot=Ft,Ft=Wt}return Ot!==0?It.words[zt]=Ot:It.length--,It._strip()}function kt($t,vt,It){return xt($t,vt,It)}ot.prototype.mulTo=function(vt,It){var Ot,Wt=this.length+vt.length;return this.length===10&&vt.length===10?Ot=wt(this,vt,It):Wt<63?Ot=bt(this,vt,It):Wt<1024?Ot=xt(this,vt,It):Ot=kt(this,vt,It),Ot},ot.prototype.mul=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),this.mulTo(vt,It)},ot.prototype.mulf=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),kt(this,vt,It)},ot.prototype.imul=function(vt){return this.clone().mulTo(vt,this)},ot.prototype.imuln=function(vt){var It=vt<0;It&&(vt=-vt),rt(typeof vt=="number"),rt(vt<67108864);for(var Ot=0,Wt=0;Wt>=26,Ot+=zt/67108864|0,Ot+=Ft>>>26,this.words[Wt]=Ft&67108863}return Ot!==0&&(this.words[Wt]=Ot,this.length++),It?this.ineg():this},ot.prototype.muln=function(vt){return this.clone().imuln(vt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(vt){var It=yt(vt);if(It.length===0)return new ot(1);for(var Ot=this,Wt=0;Wt=0);var It=vt%26,Ot=(vt-It)/26,Wt=67108863>>>26-It<<26-It,zt;if(It!==0){var Ft=0;for(zt=0;zt>>26-It}Ft&&(this.words[zt]=Ft,this.length++)}if(Ot!==0){for(zt=this.length-1;zt>=0;zt--)this.words[zt+Ot]=this.words[zt];for(zt=0;zt=0);var Wt;It?Wt=(It-It%26)/26:Wt=0;var zt=vt%26,Ft=Math.min((vt-zt)/26,this.length),Nt=67108863^67108863>>>zt<Ft)for(this.length-=Ft,Pt=0;Pt=0&&(Ht!==0||Pt>=Wt);Pt--){var Qt=this.words[Pt]|0;this.words[Pt]=Ht<<26-zt|Qt>>>zt,Ht=Qt&Nt}return Ut&&Ht!==0&&(Ut.words[Ut.length++]=Ht),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(vt,It,Ot){return rt(this.negative===0),this.iushrn(vt,It,Ot)},ot.prototype.shln=function(vt){return this.clone().ishln(vt)},ot.prototype.ushln=function(vt){return this.clone().iushln(vt)},ot.prototype.shrn=function(vt){return this.clone().ishrn(vt)},ot.prototype.ushrn=function(vt){return this.clone().iushrn(vt)},ot.prototype.testn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=vt%26,Ot=(vt-It)/26,Wt=1<=0);var It=vt%26,Ot=(vt-It)/26;if(rt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ot)return this;if(It!==0&&Ot++,this.length=Math.min(Ot,this.length),It!==0){var Wt=67108863^67108863>>>It<=67108864;It++)this.words[It]-=67108864,It===this.length-1?this.words[It+1]=1:this.words[It+1]++;return this.length=Math.max(this.length,It+1),this},ot.prototype.isubn=function(vt){if(rt(typeof vt=="number"),rt(vt<67108864),vt<0)return this.iaddn(-vt);if(this.negative!==0)return this.negative=0,this.iaddn(vt),this.negative=1,this;if(this.words[0]-=vt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var It=0;It>26)-(Ut/67108864|0),this.words[zt+Ot]=Ft&67108863}for(;zt>26,this.words[zt+Ot]=Ft&67108863;if(Nt===0)return this._strip();for(rt(Nt===-1),Nt=0,zt=0;zt>26,this.words[zt]=Ft&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(vt,It){var Ot=this.length-vt.length,Wt=this.clone(),zt=vt,Ft=zt.words[zt.length-1]|0,Nt=this._countBits(Ft);Ot=26-Nt,Ot!==0&&(zt=zt.ushln(Ot),Wt.iushln(Ot),Ft=zt.words[zt.length-1]|0);var Ut=Wt.length-zt.length,Pt;if(It!=="mod"){Pt=new ot(null),Pt.length=Ut+1,Pt.words=new Array(Pt.length);for(var Ht=0;Ht=0;an--){var Yt=(Wt.words[zt.length+an]|0)*67108864+(Wt.words[zt.length+an-1]|0);for(Yt=Math.min(Yt/Ft|0,67108863),Wt._ishlnsubmul(zt,Yt,an);Wt.negative!==0;)Yt--,Wt.negative=0,Wt._ishlnsubmul(zt,1,an),Wt.isZero()||(Wt.negative^=1);Pt&&(Pt.words[an]=Yt)}return Pt&&Pt._strip(),Wt._strip(),It!=="div"&&Ot!==0&&Wt.iushrn(Ot),{div:Pt||null,mod:Wt}},ot.prototype.divmod=function(vt,It,Ot){if(rt(!vt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Wt,zt,Ft;return this.negative!==0&&vt.negative===0?(Ft=this.neg().divmod(vt,It),It!=="mod"&&(Wt=Ft.div.neg()),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.iadd(vt)),{div:Wt,mod:zt}):this.negative===0&&vt.negative!==0?(Ft=this.divmod(vt.neg(),It),It!=="mod"&&(Wt=Ft.div.neg()),{div:Wt,mod:Ft.mod}):this.negative&vt.negative?(Ft=this.neg().divmod(vt.neg(),It),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.isub(vt)),{div:Ft.div,mod:zt}):vt.length>this.length||this.cmp(vt)<0?{div:new ot(0),mod:this}:vt.length===1?It==="div"?{div:this.divn(vt.words[0]),mod:null}:It==="mod"?{div:null,mod:new ot(this.modrn(vt.words[0]))}:{div:this.divn(vt.words[0]),mod:new ot(this.modrn(vt.words[0]))}:this._wordDiv(vt,It)},ot.prototype.div=function(vt){return this.divmod(vt,"div",!1).div},ot.prototype.mod=function(vt){return this.divmod(vt,"mod",!1).mod},ot.prototype.umod=function(vt){return this.divmod(vt,"mod",!0).mod},ot.prototype.divRound=function(vt){var It=this.divmod(vt);if(It.mod.isZero())return It.div;var Ot=It.div.negative!==0?It.mod.isub(vt):It.mod,Wt=vt.ushrn(1),zt=vt.andln(1),Ft=Ot.cmp(Wt);return Ft<0||zt===1&&Ft===0?It.div:It.div.negative!==0?It.div.isubn(1):It.div.iaddn(1)},ot.prototype.modrn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=(1<<26)%vt,Wt=0,zt=this.length-1;zt>=0;zt--)Wt=(Ot*Wt+(this.words[zt]|0))%vt;return It?-Wt:Wt},ot.prototype.modn=function(vt){return this.modrn(vt)},ot.prototype.idivn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=0,Wt=this.length-1;Wt>=0;Wt--){var zt=(this.words[Wt]|0)+Ot*67108864;this.words[Wt]=zt/vt|0,Ot=zt%vt}return this._strip(),It?this.ineg():this},ot.prototype.divn=function(vt){return this.clone().idivn(vt)},ot.prototype.egcd=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=new ot(0),Nt=new ot(1),Ut=0;It.isEven()&&Ot.isEven();)It.iushrn(1),Ot.iushrn(1),++Ut;for(var Pt=Ot.clone(),Ht=It.clone();!It.isZero();){for(var Qt=0,an=1;!(It.words[0]&an)&&Qt<26;++Qt,an<<=1);if(Qt>0)for(It.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||zt.isOdd())&&(Wt.iadd(Pt),zt.isub(Ht)),Wt.iushrn(1),zt.iushrn(1);for(var Yt=0,nn=1;!(Ot.words[0]&nn)&&Yt<26;++Yt,nn<<=1);if(Yt>0)for(Ot.iushrn(Yt);Yt-- >0;)(Ft.isOdd()||Nt.isOdd())&&(Ft.iadd(Pt),Nt.isub(Ht)),Ft.iushrn(1),Nt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(Ft),zt.isub(Nt)):(Ot.isub(It),Ft.isub(Wt),Nt.isub(zt))}return{a:Ft,b:Nt,gcd:Ot.iushln(Ut)}},ot.prototype._invmp=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=Ot.clone();It.cmpn(1)>0&&Ot.cmpn(1)>0;){for(var Nt=0,Ut=1;!(It.words[0]&Ut)&&Nt<26;++Nt,Ut<<=1);if(Nt>0)for(It.iushrn(Nt);Nt-- >0;)Wt.isOdd()&&Wt.iadd(Ft),Wt.iushrn(1);for(var Pt=0,Ht=1;!(Ot.words[0]&Ht)&&Pt<26;++Pt,Ht<<=1);if(Pt>0)for(Ot.iushrn(Pt);Pt-- >0;)zt.isOdd()&&zt.iadd(Ft),zt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(zt)):(Ot.isub(It),zt.isub(Wt))}var Qt;return It.cmpn(1)===0?Qt=Wt:Qt=zt,Qt.cmpn(0)<0&&Qt.iadd(vt),Qt},ot.prototype.gcd=function(vt){if(this.isZero())return vt.abs();if(vt.isZero())return this.abs();var It=this.clone(),Ot=vt.clone();It.negative=0,Ot.negative=0;for(var Wt=0;It.isEven()&&Ot.isEven();Wt++)It.iushrn(1),Ot.iushrn(1);do{for(;It.isEven();)It.iushrn(1);for(;Ot.isEven();)Ot.iushrn(1);var zt=It.cmp(Ot);if(zt<0){var Ft=It;It=Ot,Ot=Ft}else if(zt===0||Ot.cmpn(1)===0)break;It.isub(Ot)}while(!0);return Ot.iushln(Wt)},ot.prototype.invm=function(vt){return this.egcd(vt).a.umod(vt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(vt){return this.words[0]&vt},ot.prototype.bincn=function(vt){rt(typeof vt=="number");var It=vt%26,Ot=(vt-It)/26,Wt=1<>>26,Nt&=67108863,this.words[Ft]=Nt}return zt!==0&&(this.words[Ft]=zt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(vt){var It=vt<0;if(this.negative!==0&&!It)return-1;if(this.negative===0&&It)return 1;this._strip();var Ot;if(this.length>1)Ot=1;else{It&&(vt=-vt),rt(vt<=67108863,"Number is too big");var Wt=this.words[0]|0;Ot=Wt===vt?0:Wtvt.length)return 1;if(this.length=0;Ot--){var Wt=this.words[Ot]|0,zt=vt.words[Ot]|0;if(Wt!==zt){Wtzt&&(It=1);break}}return It},ot.prototype.gtn=function(vt){return this.cmpn(vt)===1},ot.prototype.gt=function(vt){return this.cmp(vt)===1},ot.prototype.gten=function(vt){return this.cmpn(vt)>=0},ot.prototype.gte=function(vt){return this.cmp(vt)>=0},ot.prototype.ltn=function(vt){return this.cmpn(vt)===-1},ot.prototype.lt=function(vt){return this.cmp(vt)===-1},ot.prototype.lten=function(vt){return this.cmpn(vt)<=0},ot.prototype.lte=function(vt){return this.cmp(vt)<=0},ot.prototype.eqn=function(vt){return this.cmpn(vt)===0},ot.prototype.eq=function(vt){return this.cmp(vt)===0},ot.red=function(vt){return new jt(vt)},ot.prototype.toRed=function(vt){return rt(!this.red,"Already a number in reduction context"),rt(this.negative===0,"red works only with positives"),vt.convertTo(this)._forceRed(vt)},ot.prototype.fromRed=function(){return rt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(vt){return this.red=vt,this},ot.prototype.forceRed=function(vt){return rt(!this.red,"Already a number in reduction context"),this._forceRed(vt)},ot.prototype.redAdd=function(vt){return rt(this.red,"redAdd works only with red numbers"),this.red.add(this,vt)},ot.prototype.redIAdd=function(vt){return rt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,vt)},ot.prototype.redSub=function(vt){return rt(this.red,"redSub works only with red numbers"),this.red.sub(this,vt)},ot.prototype.redISub=function(vt){return rt(this.red,"redISub works only with red numbers"),this.red.isub(this,vt)},ot.prototype.redShl=function(vt){return rt(this.red,"redShl works only with red numbers"),this.red.shl(this,vt)},ot.prototype.redMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.mul(this,vt)},ot.prototype.redIMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.imul(this,vt)},ot.prototype.redSqr=function(){return rt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return rt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return rt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return rt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return rt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(vt){return rt(this.red&&!vt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,vt)};var St={k256:null,p224:null,p192:null,p25519:null};function Tt($t,vt){this.name=$t,this.p=new ot(vt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tt.prototype._tmp=function(){var vt=new ot(null);return vt.words=new Array(Math.ceil(this.n/13)),vt},Tt.prototype.ireduce=function(vt){var It=vt,Ot;do this.split(It,this.tmp),It=this.imulK(It),It=It.iadd(this.tmp),Ot=It.bitLength();while(Ot>this.n);var Wt=Ot0?It.isub(this.p):It.strip!==void 0?It.strip():It._strip(),It},Tt.prototype.split=function(vt,It){vt.iushrn(this.n,0,It)},Tt.prototype.imulK=function(vt){return vt.imul(this.k)};function At(){Tt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}it(At,Tt),At.prototype.split=function(vt,It){for(var Ot=4194303,Wt=Math.min(vt.length,9),zt=0;zt>>22,Ft=Nt}Ft>>>=22,vt.words[zt-10]=Ft,Ft===0&&vt.length>10?vt.length-=10:vt.length-=9},At.prototype.imulK=function(vt){vt.words[vt.length]=0,vt.words[vt.length+1]=0,vt.length+=2;for(var It=0,Ot=0;Ot>>=26,vt.words[Ot]=zt,It=Wt}return It!==0&&(vt.words[vt.length++]=It),vt},ot._prime=function(vt){if(St[vt])return St[vt];var It;if(vt==="k256")It=new At;else if(vt==="p224")It=new Et;else if(vt==="p192")It=new Ct;else if(vt==="p25519")It=new Lt;else throw new Error("Unknown prime "+vt);return St[vt]=It,It};function jt($t){if(typeof $t=="string"){var vt=ot._prime($t);this.m=vt.p,this.prime=vt}else rt($t.gtn(1),"modulus must be greater than 1"),this.m=$t,this.prime=null}jt.prototype._verify1=function(vt){rt(vt.negative===0,"red works only with positives"),rt(vt.red,"red works only with red numbers")},jt.prototype._verify2=function(vt,It){rt((vt.negative|It.negative)===0,"red works only with positives"),rt(vt.red&&vt.red===It.red,"red works only with red numbers")},jt.prototype.imod=function(vt){return this.prime?this.prime.ireduce(vt)._forceRed(this):(ut(vt,vt.umod(this.m)._forceRed(this)),vt)},jt.prototype.neg=function(vt){return vt.isZero()?vt.clone():this.m.sub(vt)._forceRed(this)},jt.prototype.add=function(vt,It){this._verify2(vt,It);var Ot=vt.add(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot._forceRed(this)},jt.prototype.iadd=function(vt,It){this._verify2(vt,It);var Ot=vt.iadd(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot},jt.prototype.sub=function(vt,It){this._verify2(vt,It);var Ot=vt.sub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot._forceRed(this)},jt.prototype.isub=function(vt,It){this._verify2(vt,It);var Ot=vt.isub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot},jt.prototype.shl=function(vt,It){return this._verify1(vt),this.imod(vt.ushln(It))},jt.prototype.imul=function(vt,It){return this._verify2(vt,It),this.imod(vt.imul(It))},jt.prototype.mul=function(vt,It){return this._verify2(vt,It),this.imod(vt.mul(It))},jt.prototype.isqr=function(vt){return this.imul(vt,vt.clone())},jt.prototype.sqr=function(vt){return this.mul(vt,vt)},jt.prototype.sqrt=function(vt){if(vt.isZero())return vt.clone();var It=this.m.andln(3);if(rt(It%2===1),It===3){var Ot=this.m.add(new ot(1)).iushrn(2);return this.pow(vt,Ot)}for(var Wt=this.m.subn(1),zt=0;!Wt.isZero()&&Wt.andln(1)===0;)zt++,Wt.iushrn(1);rt(!Wt.isZero());var Ft=new ot(1).toRed(this),Nt=Ft.redNeg(),Ut=this.m.subn(1).iushrn(1),Pt=this.m.bitLength();for(Pt=new ot(2*Pt*Pt).toRed(this);this.pow(Pt,Ut).cmp(Nt)!==0;)Pt.redIAdd(Nt);for(var Ht=this.pow(Pt,Wt),Qt=this.pow(vt,Wt.addn(1).iushrn(1)),an=this.pow(vt,Wt),Yt=zt;an.cmp(Ft)!==0;){for(var nn=an,tn=0;nn.cmp(Ft)!==0;tn++)nn=nn.redSqr();rt(tn=0;zt--){for(var Ht=It.words[zt],Qt=Pt-1;Qt>=0;Qt--){var an=Ht>>Qt&1;if(Ft!==Wt[0]&&(Ft=this.sqr(Ft)),an===0&&Nt===0){Ut=0;continue}Nt<<=1,Nt|=an,Ut++,!(Ut!==Ot&&(zt!==0||Qt!==0))&&(Ft=this.mul(Ft,Wt[Nt]),Ut=0,Nt=0)}Pt=26}return Ft},jt.prototype.convertTo=function(vt){var It=vt.umod(this.m);return It===vt?It.clone():It},jt.prototype.convertFrom=function(vt){var It=vt.clone();return It.red=null,It},ot.mont=function(vt){return new Rt(vt)};function Rt($t){jt.call(this,$t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it(Rt,jt),Rt.prototype.convertTo=function(vt){return this.imod(vt.ushln(this.shift))},Rt.prototype.convertFrom=function(vt){var It=this.imod(vt.mul(this.rinv));return It.red=null,It},Rt.prototype.imul=function(vt,It){if(vt.isZero()||It.isZero())return vt.words[0]=0,vt.length=1,vt;var Ot=vt.imul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.mul=function(vt,It){if(vt.isZero()||It.isZero())return new ot(0)._forceRed(this);var Ot=vt.mul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.invm=function(vt){var It=this.imod(vt._invmp(this.m).mul(this.r2));return It._forceRed(this)}})(tt,commonjsGlobal)})(bn$1);var bnExports$1=bn$1.exports,BN$c=bnExports$1,randomBytes$1=browserExports;function blind(tt){var et=getr(tt),nt=et.toRed(BN$c.mont(tt.modulus)).redPow(new BN$c(tt.publicExponent)).fromRed();return{blinder:nt,unblinder:et.invm(tt.modulus)}}function getr(tt){var et=tt.modulus.byteLength(),nt;do nt=new BN$c(randomBytes$1(et));while(nt.cmp(tt.modulus)>=0||!nt.umod(tt.prime1)||!nt.umod(tt.prime2));return nt}function crt$2(tt,et){var nt=blind(et),rt=et.modulus.byteLength(),it=new BN$c(tt).mul(nt.blinder).umod(et.modulus),ot=it.toRed(BN$c.mont(et.prime1)),at=it.toRed(BN$c.mont(et.prime2)),st=et.coefficient,lt=et.prime1,ct=et.prime2,ut=ot.redPow(et.exponent1).fromRed(),ht=at.redPow(et.exponent2).fromRed(),dt=ut.isub(ht).imul(st).umod(lt).imul(ct);return ht.iadd(dt).imul(nt.unblinder).umod(et.modulus).toArrayLike(Buffer,"be",rt)}crt$2.getr=getr;var browserifyRsa=crt$2,elliptic$2={};const name="elliptic",version$2="6.5.4",description="EC cryptography",main$1="lib/elliptic.js",files=["lib"],scripts={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository={type:"git",url:"git@github.com:indutny/elliptic"},keywords=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny ",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0={name,version:version$2,description,main:main$1,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$o={},utils$n={};(function(tt){var et=tt;function nt(ot,at){if(Array.isArray(ot))return ot.slice();if(!ot)return[];var st=[];if(typeof ot!="string"){for(var lt=0;lt>8,ht=ct&255;ut?st.push(ut,ht):st.push(ht)}return st}et.toArray=nt;function rt(ot){return ot.length===1?"0"+ot:ot}et.zero2=rt;function it(ot){for(var at="",st=0;st(mt>>1)-1?bt=(mt>>1)-wt:bt=wt,gt.isubn(bt)):bt=0,pt[yt]=bt,gt.iushrn(1)}return pt}et.getNAF=ot;function at(ut,ht){var dt=[[],[]];ut=ut.clone(),ht=ht.clone();for(var pt=0,mt=0,gt;ut.cmpn(-pt)>0||ht.cmpn(-mt)>0;){var yt=ut.andln(3)+pt&3,bt=ht.andln(3)+mt&3;yt===3&&(yt=-1),bt===3&&(bt=-1);var wt;yt&1?(gt=ut.andln(7)+pt&7,(gt===3||gt===5)&&bt===2?wt=-yt:wt=yt):wt=0,dt[0].push(wt);var xt;bt&1?(gt=ht.andln(7)+mt&7,(gt===3||gt===5)&&yt===2?xt=-bt:xt=bt):xt=0,dt[1].push(xt),2*pt===wt+1&&(pt=1-pt),2*mt===xt+1&&(mt=1-mt),ut.iushrn(1),ht.iushrn(1)}return dt}et.getJSF=at;function st(ut,ht,dt){var pt="_"+ht;ut.prototype[ht]=function(){return this[pt]!==void 0?this[pt]:this[pt]=dt.call(this)}}et.cachedProperty=st;function lt(ut){return typeof ut=="string"?et.toArray(ut,"hex"):ut}et.parseBytes=lt;function ct(ut){return new nt(ut,"hex","le")}et.intFromLE=ct})(utils$o);var curve={},BN$b=bnExports$2,utils$m=utils$o,getNAF=utils$m.getNAF,getJSF=utils$m.getJSF,assert$j=utils$m.assert;function BaseCurve(tt,et){this.type=tt,this.p=new BN$b(et.p,16),this.red=et.prime?BN$b.red(et.prime):BN$b.mont(this.p),this.zero=new BN$b(0).toRed(this.red),this.one=new BN$b(1).toRed(this.red),this.two=new BN$b(2).toRed(this.red),this.n=et.n&&new BN$b(et.n,16),this.g=et.g&&this.pointFromJSON(et.g,et.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var nt=this.n&&this.p.div(this.n);!nt||nt.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$3=BaseCurve;BaseCurve.prototype.point=function(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function(et,nt){assert$j(et.precomputed);var rt=et._getDoubles(),it=getNAF(nt,1,this._bitLength),ot=(1<=st;ct--)lt=(lt<<1)+it[ct];at.push(lt)}for(var ut=this.jpoint(null,null,null),ht=this.jpoint(null,null,null),dt=ot;dt>0;dt--){for(st=0;st=0;lt--){for(var ct=0;lt>=0&&at[lt]===0;lt--)ct++;if(lt>=0&&ct++,st=st.dblp(ct),lt<0)break;var ut=at[lt];assert$j(ut!==0),et.type==="affine"?ut>0?st=st.mixedAdd(ot[ut-1>>1]):st=st.mixedAdd(ot[-ut-1>>1].neg()):ut>0?st=st.add(ot[ut-1>>1]):st=st.add(ot[-ut-1>>1].neg())}return et.type==="affine"?st.toP():st};BaseCurve.prototype._wnafMulAdd=function(et,nt,rt,it,ot){var at=this._wnafT1,st=this._wnafT2,lt=this._wnafT3,ct=0,ut,ht,dt;for(ut=0;ut=1;ut-=2){var mt=ut-1,gt=ut;if(at[mt]!==1||at[gt]!==1){lt[mt]=getNAF(rt[mt],at[mt],this._bitLength),lt[gt]=getNAF(rt[gt],at[gt],this._bitLength),ct=Math.max(lt[mt].length,ct),ct=Math.max(lt[gt].length,ct);continue}var yt=[nt[mt],null,null,nt[gt]];nt[mt].y.cmp(nt[gt].y)===0?(yt[1]=nt[mt].add(nt[gt]),yt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg())):nt[mt].y.cmp(nt[gt].y.redNeg())===0?(yt[1]=nt[mt].toJ().mixedAdd(nt[gt]),yt[2]=nt[mt].add(nt[gt].neg())):(yt[1]=nt[mt].toJ().mixedAdd(nt[gt]),yt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg()));var bt=[-3,-1,-5,-7,0,7,5,1,3],wt=getJSF(rt[mt],rt[gt]);for(ct=Math.max(wt[0].length,ct),lt[mt]=new Array(ct),lt[gt]=new Array(ct),ht=0;ht=0;ut--){for(var At=0;ut>=0;){var Et=!0;for(ht=0;ht=0&&At++,St=St.dblp(At),ut<0)break;for(ht=0;ht0?dt=st[ht][Ct-1>>1]:Ct<0&&(dt=st[ht][-Ct-1>>1].neg()),dt.type==="affine"?St=St.mixedAdd(dt):St=St.add(dt))}}for(ut=0;ut=Math.ceil((et.bitLength()+1)/nt.step):!1};BasePoint.prototype._getDoubles=function(et,nt){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var rt=[this],it=this,ot=0;ot=0&&(pt=ct,mt=ut),ht.negative&&(ht=ht.neg(),dt=dt.neg()),pt.negative&&(pt=pt.neg(),mt=mt.neg()),[{a:ht,b:dt},{a:pt,b:mt}]};ShortCurve.prototype._endoSplit=function(et){var nt=this.endo.basis,rt=nt[0],it=nt[1],ot=it.b.mul(et).divRound(this.n),at=rt.b.neg().mul(et).divRound(this.n),st=ot.mul(rt.a),lt=at.mul(it.a),ct=ot.mul(rt.b),ut=at.mul(it.b),ht=et.sub(st).sub(lt),dt=ct.add(ut).neg();return{k1:ht,k2:dt}};ShortCurve.prototype.pointFromX=function(et,nt){et=new BN$a(et,16),et.red||(et=et.toRed(this.red));var rt=et.redSqr().redMul(et).redIAdd(et.redMul(this.a)).redIAdd(this.b),it=rt.redSqrt();if(it.redSqr().redSub(rt).cmp(this.zero)!==0)throw new Error("invalid point");var ot=it.fromRed().isOdd();return(nt&&!ot||!nt&&ot)&&(it=it.redNeg()),this.point(et,it)};ShortCurve.prototype.validate=function(et){if(et.inf)return!0;var nt=et.x,rt=et.y,it=this.a.redMul(nt),ot=nt.redSqr().redMul(nt).redIAdd(it).redIAdd(this.b);return rt.redSqr().redISub(ot).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function(et,nt,rt){for(var it=this._endoWnafT1,ot=this._endoWnafT2,at=0;at":""};Point$2.prototype.isInfinity=function(){return this.inf};Point$2.prototype.add=function(et){if(this.inf)return et;if(et.inf)return this;if(this.eq(et))return this.dbl();if(this.neg().eq(et))return this.curve.point(null,null);if(this.x.cmp(et.x)===0)return this.curve.point(null,null);var nt=this.y.redSub(et.y);nt.cmpn(0)!==0&&(nt=nt.redMul(this.x.redSub(et.x).redInvm()));var rt=nt.redSqr().redISub(this.x).redISub(et.x),it=nt.redMul(this.x.redSub(rt)).redISub(this.y);return this.curve.point(rt,it)};Point$2.prototype.dbl=function(){if(this.inf)return this;var et=this.y.redAdd(this.y);if(et.cmpn(0)===0)return this.curve.point(null,null);var nt=this.curve.a,rt=this.x.redSqr(),it=et.redInvm(),ot=rt.redAdd(rt).redIAdd(rt).redIAdd(nt).redMul(it),at=ot.redSqr().redISub(this.x.redAdd(this.x)),st=ot.redMul(this.x.redSub(at)).redISub(this.y);return this.curve.point(at,st)};Point$2.prototype.getX=function(){return this.x.fromRed()};Point$2.prototype.getY=function(){return this.y.fromRed()};Point$2.prototype.mul=function(et){return et=new BN$a(et,16),this.isInfinity()?this:this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve.endo?this.curve._endoWnafMulAdd([this],[et]):this.curve._wnafMul(this,et)};Point$2.prototype.mulAdd=function(et,nt,rt){var it=[this,nt],ot=[et,rt];return this.curve.endo?this.curve._endoWnafMulAdd(it,ot):this.curve._wnafMulAdd(1,it,ot,2)};Point$2.prototype.jmulAdd=function(et,nt,rt){var it=[this,nt],ot=[et,rt];return this.curve.endo?this.curve._endoWnafMulAdd(it,ot,!0):this.curve._wnafMulAdd(1,it,ot,2,!0)};Point$2.prototype.eq=function(et){return this===et||this.inf===et.inf&&(this.inf||this.x.cmp(et.x)===0&&this.y.cmp(et.y)===0)};Point$2.prototype.neg=function(et){if(this.inf)return this;var nt=this.curve.point(this.x,this.y.redNeg());if(et&&this.precomputed){var rt=this.precomputed,it=function(ot){return ot.neg()};nt.precomputed={naf:rt.naf&&{wnd:rt.naf.wnd,points:rt.naf.points.map(it)},doubles:rt.doubles&&{step:rt.doubles.step,points:rt.doubles.points.map(it)}}}return nt};Point$2.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var et=this.curve.jpoint(this.x,this.y,this.curve.one);return et};function JPoint(tt,et,nt,rt){Base$2.BasePoint.call(this,tt,"jacobian"),et===null&&nt===null&&rt===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$a(0)):(this.x=new BN$a(et,16),this.y=new BN$a(nt,16),this.z=new BN$a(rt,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$9(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function(et,nt,rt){return new JPoint(this,et,nt,rt)};JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var et=this.z.redInvm(),nt=et.redSqr(),rt=this.x.redMul(nt),it=this.y.redMul(nt).redMul(et);return this.curve.point(rt,it)};JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function(et){if(this.isInfinity())return et;if(et.isInfinity())return this;var nt=et.z.redSqr(),rt=this.z.redSqr(),it=this.x.redMul(nt),ot=et.x.redMul(rt),at=this.y.redMul(nt.redMul(et.z)),st=et.y.redMul(rt.redMul(this.z)),lt=it.redSub(ot),ct=at.redSub(st);if(lt.cmpn(0)===0)return ct.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ut=lt.redSqr(),ht=ut.redMul(lt),dt=it.redMul(ut),pt=ct.redSqr().redIAdd(ht).redISub(dt).redISub(dt),mt=ct.redMul(dt.redISub(pt)).redISub(at.redMul(ht)),gt=this.z.redMul(et.z).redMul(lt);return this.curve.jpoint(pt,mt,gt)};JPoint.prototype.mixedAdd=function(et){if(this.isInfinity())return et.toJ();if(et.isInfinity())return this;var nt=this.z.redSqr(),rt=this.x,it=et.x.redMul(nt),ot=this.y,at=et.y.redMul(nt).redMul(this.z),st=rt.redSub(it),lt=ot.redSub(at);if(st.cmpn(0)===0)return lt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ct=st.redSqr(),ut=ct.redMul(st),ht=rt.redMul(ct),dt=lt.redSqr().redIAdd(ut).redISub(ht).redISub(ht),pt=lt.redMul(ht.redISub(dt)).redISub(ot.redMul(ut)),mt=this.z.redMul(st);return this.curve.jpoint(dt,pt,mt)};JPoint.prototype.dblp=function(et){if(et===0)return this;if(this.isInfinity())return this;if(!et)return this.dbl();var nt;if(this.curve.zeroA||this.curve.threeA){var rt=this;for(nt=0;nt=0)return!1;if(rt.redIAdd(ot),this.x.cmp(rt)===0)return!0}};JPoint.prototype.inspect=function(){return this.isInfinity()?"":""};JPoint.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var BN$9=bnExports$2,inherits$8=inherits_browserExports,Base$1=base$3,utils$k=utils$o;function MontCurve(tt){Base$1.call(this,"mont",tt),this.a=new BN$9(tt.a,16).toRed(this.red),this.b=new BN$9(tt.b,16).toRed(this.red),this.i4=new BN$9(4).toRed(this.red).redInvm(),this.two=new BN$9(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$8(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function(et){var nt=et.normalize().x,rt=nt.redSqr(),it=rt.redMul(nt).redAdd(rt.redMul(this.a)).redAdd(nt),ot=it.redSqrt();return ot.redSqr().cmp(it)===0};function Point$1(tt,et,nt){Base$1.BasePoint.call(this,tt,"projective"),et===null&&nt===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$9(et,16),this.z=new BN$9(nt,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$8(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function(et,nt){return this.point(utils$k.toArray(et,nt),1)};MontCurve.prototype.point=function(et,nt){return new Point$1(this,et,nt)};MontCurve.prototype.pointFromJSON=function(et){return Point$1.fromJSON(this,et)};Point$1.prototype.precompute=function(){};Point$1.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function(et,nt){return new Point$1(et,nt[0],nt[1]||et.one)};Point$1.prototype.inspect=function(){return this.isInfinity()?"":""};Point$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function(){var et=this.x.redAdd(this.z),nt=et.redSqr(),rt=this.x.redSub(this.z),it=rt.redSqr(),ot=nt.redSub(it),at=nt.redMul(it),st=ot.redMul(it.redAdd(this.curve.a24.redMul(ot)));return this.curve.point(at,st)};Point$1.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function(et,nt){var rt=this.x.redAdd(this.z),it=this.x.redSub(this.z),ot=et.x.redAdd(et.z),at=et.x.redSub(et.z),st=at.redMul(rt),lt=ot.redMul(it),ct=nt.z.redMul(st.redAdd(lt).redSqr()),ut=nt.x.redMul(st.redISub(lt).redSqr());return this.curve.point(ct,ut)};Point$1.prototype.mul=function(et){for(var nt=et.clone(),rt=this,it=this.curve.point(null,null),ot=this,at=[];nt.cmpn(0)!==0;nt.iushrn(1))at.push(nt.andln(1));for(var st=at.length-1;st>=0;st--)at[st]===0?(rt=rt.diffAdd(it,ot),it=it.dbl()):(it=rt.diffAdd(it,ot),rt=rt.dbl());return it};Point$1.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function(et){return this.getX().cmp(et.getX())===0};Point$1.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var utils$j=utils$o,BN$8=bnExports$2,inherits$7=inherits_browserExports,Base=base$3,assert$h=utils$j.assert;function EdwardsCurve(tt){this.twisted=(tt.a|0)!==1,this.mOneA=this.twisted&&(tt.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",tt),this.a=new BN$8(tt.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$8(tt.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$8(tt.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$h(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(tt.c|0)===1}inherits$7(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function(et){return this.mOneA?et.redNeg():this.a.redMul(et)};EdwardsCurve.prototype._mulC=function(et){return this.oneC?et:this.c.redMul(et)};EdwardsCurve.prototype.jpoint=function(et,nt,rt,it){return this.point(et,nt,rt,it)};EdwardsCurve.prototype.pointFromX=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var rt=et.redSqr(),it=this.c2.redSub(this.a.redMul(rt)),ot=this.one.redSub(this.c2.redMul(this.d).redMul(rt)),at=it.redMul(ot.redInvm()),st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");var lt=st.fromRed().isOdd();return(nt&&!lt||!nt&<)&&(st=st.redNeg()),this.point(et,st)};EdwardsCurve.prototype.pointFromY=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var rt=et.redSqr(),it=rt.redSub(this.c2),ot=rt.redMul(this.d).redMul(this.c2).redSub(this.a),at=it.redMul(ot.redInvm());if(at.cmp(this.zero)===0){if(nt)throw new Error("invalid point");return this.point(this.zero,et)}var st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");return st.fromRed().isOdd()!==nt&&(st=st.redNeg()),this.point(st,et)};EdwardsCurve.prototype.validate=function(et){if(et.isInfinity())return!0;et.normalize();var nt=et.x.redSqr(),rt=et.y.redSqr(),it=nt.redMul(this.a).redAdd(rt),ot=this.c2.redMul(this.one.redAdd(this.d.redMul(nt).redMul(rt)));return it.cmp(ot)===0};function Point(tt,et,nt,rt,it){Base.BasePoint.call(this,tt,"projective"),et===null&&nt===null&&rt===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$8(et,16),this.y=new BN$8(nt,16),this.z=rt?new BN$8(rt,16):this.curve.one,this.t=it&&new BN$8(it,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits$7(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function(et){return Point.fromJSON(this,et)};EdwardsCurve.prototype.point=function(et,nt,rt,it){return new Point(this,et,nt,rt,it)};Point.fromJSON=function(et,nt){return new Point(et,nt[0],nt[1],nt[2])};Point.prototype.inspect=function(){return this.isInfinity()?"":""};Point.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function(){var et=this.x.redSqr(),nt=this.y.redSqr(),rt=this.z.redSqr();rt=rt.redIAdd(rt);var it=this.curve._mulA(et),ot=this.x.redAdd(this.y).redSqr().redISub(et).redISub(nt),at=it.redAdd(nt),st=at.redSub(rt),lt=it.redSub(nt),ct=ot.redMul(st),ut=at.redMul(lt),ht=ot.redMul(lt),dt=st.redMul(at);return this.curve.point(ct,ut,dt,ht)};Point.prototype._projDbl=function(){var et=this.x.redAdd(this.y).redSqr(),nt=this.x.redSqr(),rt=this.y.redSqr(),it,ot,at,st,lt,ct;if(this.curve.twisted){st=this.curve._mulA(nt);var ut=st.redAdd(rt);this.zOne?(it=et.redSub(nt).redSub(rt).redMul(ut.redSub(this.curve.two)),ot=ut.redMul(st.redSub(rt)),at=ut.redSqr().redSub(ut).redSub(ut)):(lt=this.z.redSqr(),ct=ut.redSub(lt).redISub(lt),it=et.redSub(nt).redISub(rt).redMul(ct),ot=ut.redMul(st.redSub(rt)),at=ut.redMul(ct))}else st=nt.redAdd(rt),lt=this.curve._mulC(this.z).redSqr(),ct=st.redSub(lt).redSub(lt),it=this.curve._mulC(et.redISub(st)).redMul(ct),ot=this.curve._mulC(st).redMul(nt.redISub(rt)),at=st.redMul(ct);return this.curve.point(it,ot,at)};Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function(et){var nt=this.y.redSub(this.x).redMul(et.y.redSub(et.x)),rt=this.y.redAdd(this.x).redMul(et.y.redAdd(et.x)),it=this.t.redMul(this.curve.dd).redMul(et.t),ot=this.z.redMul(et.z.redAdd(et.z)),at=rt.redSub(nt),st=ot.redSub(it),lt=ot.redAdd(it),ct=rt.redAdd(nt),ut=at.redMul(st),ht=lt.redMul(ct),dt=at.redMul(ct),pt=st.redMul(lt);return this.curve.point(ut,ht,pt,dt)};Point.prototype._projAdd=function(et){var nt=this.z.redMul(et.z),rt=nt.redSqr(),it=this.x.redMul(et.x),ot=this.y.redMul(et.y),at=this.curve.d.redMul(it).redMul(ot),st=rt.redSub(at),lt=rt.redAdd(at),ct=this.x.redAdd(this.y).redMul(et.x.redAdd(et.y)).redISub(it).redISub(ot),ut=nt.redMul(st).redMul(ct),ht,dt;return this.curve.twisted?(ht=nt.redMul(lt).redMul(ot.redSub(this.curve._mulA(it))),dt=st.redMul(lt)):(ht=nt.redMul(lt).redMul(ot.redSub(it)),dt=this.curve._mulC(st).redMul(lt)),this.curve.point(ut,ht,dt)};Point.prototype.add=function(et){return this.isInfinity()?et:et.isInfinity()?this:this.curve.extended?this._extAdd(et):this._projAdd(et)};Point.prototype.mul=function(et){return this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve._wnafMul(this,et)};Point.prototype.mulAdd=function(et,nt,rt){return this.curve._wnafMulAdd(1,[this,nt],[et,rt],2,!1)};Point.prototype.jmulAdd=function(et,nt,rt){return this.curve._wnafMulAdd(1,[this,nt],[et,rt],2,!0)};Point.prototype.normalize=function(){if(this.zOne)return this;var et=this.z.redInvm();return this.x=this.x.redMul(et),this.y=this.y.redMul(et),this.t&&(this.t=this.t.redMul(et)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function(et){return this===et||this.getX().cmp(et.getX())===0&&this.getY().cmp(et.getY())===0};Point.prototype.eqXToP=function(et){var nt=et.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(nt)===0)return!0;for(var rt=et.clone(),it=this.curve.redN.redMul(this.z);;){if(rt.iadd(this.curve.n),rt.cmp(this.curve.p)>=0)return!1;if(nt.redIAdd(it),this.x.cmp(nt)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(tt){var et=tt;et.base=base$3,et.short=short,et.mont=mont,et.edwards=edwards})(curve);var curves$1={},hash$6={},utils$i={},assert$g=minimalisticAssert,inherits$6=inherits_browserExports;utils$i.inherits=inherits$6;function isSurrogatePair(tt,et){return(tt.charCodeAt(et)&64512)!==55296||et<0||et+1>=tt.length?!1:(tt.charCodeAt(et+1)&64512)===56320}function toArray$3(tt,et){if(Array.isArray(tt))return tt.slice();if(!tt)return[];var nt=[];if(typeof tt=="string")if(et){if(et==="hex")for(tt=tt.replace(/[^a-z0-9]+/ig,""),tt.length%2!==0&&(tt="0"+tt),it=0;it>6|192,nt[rt++]=ot&63|128):isSurrogatePair(tt,it)?(ot=65536+((ot&1023)<<10)+(tt.charCodeAt(++it)&1023),nt[rt++]=ot>>18|240,nt[rt++]=ot>>12&63|128,nt[rt++]=ot>>6&63|128,nt[rt++]=ot&63|128):(nt[rt++]=ot>>12|224,nt[rt++]=ot>>6&63|128,nt[rt++]=ot&63|128)}else for(it=0;it>>24|tt>>>8&65280|tt<<8&16711680|(tt&255)<<24;return et>>>0}utils$i.htonl=htonl;function toHex32(tt,et){for(var nt="",rt=0;rt>>0}return ot}utils$i.join32=join32;function split32(tt,et){for(var nt=new Array(tt.length*4),rt=0,it=0;rt>>24,nt[it+1]=ot>>>16&255,nt[it+2]=ot>>>8&255,nt[it+3]=ot&255):(nt[it+3]=ot>>>24,nt[it+2]=ot>>>16&255,nt[it+1]=ot>>>8&255,nt[it]=ot&255)}return nt}utils$i.split32=split32;function rotr32$1(tt,et){return tt>>>et|tt<<32-et}utils$i.rotr32=rotr32$1;function rotl32$2(tt,et){return tt<>>32-et}utils$i.rotl32=rotl32$2;function sum32$3(tt,et){return tt+et>>>0}utils$i.sum32=sum32$3;function sum32_3$1(tt,et,nt){return tt+et+nt>>>0}utils$i.sum32_3=sum32_3$1;function sum32_4$2(tt,et,nt,rt){return tt+et+nt+rt>>>0}utils$i.sum32_4=sum32_4$2;function sum32_5$2(tt,et,nt,rt,it){return tt+et+nt+rt+it>>>0}utils$i.sum32_5=sum32_5$2;function sum64$1(tt,et,nt,rt){var it=tt[et],ot=tt[et+1],at=rt+ot>>>0,st=(at>>0,tt[et+1]=at}utils$i.sum64=sum64$1;function sum64_hi$1(tt,et,nt,rt){var it=et+rt>>>0,ot=(it>>0}utils$i.sum64_hi=sum64_hi$1;function sum64_lo$1(tt,et,nt,rt){var it=et+rt;return it>>>0}utils$i.sum64_lo=sum64_lo$1;function sum64_4_hi$1(tt,et,nt,rt,it,ot,at,st){var lt=0,ct=et;ct=ct+rt>>>0,lt+=ct>>0,lt+=ct>>0,lt+=ct>>0}utils$i.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(tt,et,nt,rt,it,ot,at,st){var lt=et+rt+ot+st;return lt>>>0}utils$i.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(tt,et,nt,rt,it,ot,at,st,lt,ct){var ut=0,ht=et;ht=ht+rt>>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0}utils$i.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(tt,et,nt,rt,it,ot,at,st,lt,ct){var ut=et+rt+ot+st+ct;return ut>>>0}utils$i.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(tt,et,nt){var rt=et<<32-nt|tt>>>nt;return rt>>>0}utils$i.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(tt,et,nt){var rt=tt<<32-nt|et>>>nt;return rt>>>0}utils$i.rotr64_lo=rotr64_lo$1;function shr64_hi$1(tt,et,nt){return tt>>>nt}utils$i.shr64_hi=shr64_hi$1;function shr64_lo$1(tt,et,nt){var rt=tt<<32-nt|et>>>nt;return rt>>>0}utils$i.shr64_lo=shr64_lo$1;var common$7={},utils$h=utils$i,assert$f=minimalisticAssert;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$7.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(et,nt){if(et=utils$h.toArray(et,nt),this.pending?this.pending=this.pending.concat(et):this.pending=et,this.pendingTotal+=et.length,this.pending.length>=this._delta8){et=this.pending;var rt=et.length%this._delta8;this.pending=et.slice(et.length-rt,et.length),this.pending.length===0&&(this.pending=null),et=utils$h.join32(et,0,et.length-rt,this.endian);for(var it=0;it>>24&255,it[ot++]=et>>>16&255,it[ot++]=et>>>8&255,it[ot++]=et&255}else for(it[ot++]=et&255,it[ot++]=et>>>8&255,it[ot++]=et>>>16&255,it[ot++]=et>>>24&255,it[ot++]=0,it[ot++]=0,it[ot++]=0,it[ot++]=0,at=8;at>>3}common$6.g0_256=g0_256$1;function g1_256$1(tt){return rotr32(tt,17)^rotr32(tt,19)^tt>>>10}common$6.g1_256=g1_256$1;var utils$f=utils$i,common$5=common$7,shaCommon$1=common$6,rotl32$1=utils$f.rotl32,sum32$2=utils$f.sum32,sum32_5$1=utils$f.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$5.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1$1(){if(!(this instanceof SHA1$1))return new SHA1$1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$f.inherits(SHA1$1,BlockHash$3);var _1=SHA1$1;SHA1$1.blockSize=512;SHA1$1.outSize=160;SHA1$1.hmacStrength=80;SHA1$1.padLength=64;SHA1$1.prototype._update=function(et,nt){for(var rt=this.W,it=0;it<16;it++)rt[it]=et[nt+it];for(;itthis.blockSize&&(et=new this.Hash().update(et).digest()),assert$c(et.length<=this.blockSize);for(var nt=et.length;nt=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(et,nt,rt)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(et,nt,rt){var it=et.concat(nt).concat(rt);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var ot=0;ot=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(et.concat(rt||[])),this._reseed=1};HmacDRBG.prototype.generate=function(et,nt,rt,it){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof nt!="string"&&(it=rt,rt=nt,nt=null),rt&&(rt=utils$8.toArray(rt,it||"hex"),this._update(rt));for(var ot=[];ot.length"};var BN$6=bnExports$2,utils$6=utils$o,assert$9=utils$6.assert;function Signature$2(tt,et){if(tt instanceof Signature$2)return tt;this._importDER(tt,et)||(assert$9(tt.r&&tt.s,"Signature without r or s"),this.r=new BN$6(tt.r,16),this.s=new BN$6(tt.s,16),tt.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=tt.recoveryParam)}var signature$1=Signature$2;function Position$1(){this.place=0}function getLength(tt,et){var nt=tt[et.place++];if(!(nt&128))return nt;var rt=nt&15;if(rt===0||rt>4)return!1;for(var it=0,ot=0,at=et.place;ot>>=0;return it<=127?!1:(et.place=at,it)}function rmPadding(tt){for(var et=0,nt=tt.length-1;!tt[et]&&!(tt[et+1]&128)&&et>>3);for(tt.push(nt|128);--nt;)tt.push(et>>>(nt<<3)&255);tt.push(et)}Signature$2.prototype.toDER=function(et){var nt=this.r.toArray(),rt=this.s.toArray();for(nt[0]&128&&(nt=[0].concat(nt)),rt[0]&128&&(rt=[0].concat(rt)),nt=rmPadding(nt),rt=rmPadding(rt);!rt[0]&&!(rt[1]&128);)rt=rt.slice(1);var it=[2];constructLength(it,nt.length),it=it.concat(nt),it.push(2),constructLength(it,rt.length);var ot=it.concat(rt),at=[48];return constructLength(at,ot.length),at=at.concat(ot),utils$6.encode(at,et)};var ec$1,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$1;hasRequiredEc=1;var tt=bnExports$2,et=hmacDrbg,nt=utils$o,rt=curves$1,it=requireBrorand(),ot=nt.assert,at=key$2,st=signature$1;function lt(ct){if(!(this instanceof lt))return new lt(ct);typeof ct=="string"&&(ot(Object.prototype.hasOwnProperty.call(rt,ct),"Unknown curve "+ct),ct=rt[ct]),ct instanceof rt.PresetCurve&&(ct={curve:ct}),this.curve=ct.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=ct.curve.g,this.g.precompute(ct.curve.n.bitLength()+1),this.hash=ct.hash||ct.curve.hash}return ec$1=lt,lt.prototype.keyPair=function(ut){return new at(this,ut)},lt.prototype.keyFromPrivate=function(ut,ht){return at.fromPrivate(this,ut,ht)},lt.prototype.keyFromPublic=function(ut,ht){return at.fromPublic(this,ut,ht)},lt.prototype.genKeyPair=function(ut){ut||(ut={});for(var ht=new et({hash:this.hash,pers:ut.pers,persEnc:ut.persEnc||"utf8",entropy:ut.entropy||it(this.hash.hmacStrength),entropyEnc:ut.entropy&&ut.entropyEnc||"utf8",nonce:this.n.toArray()}),dt=this.n.byteLength(),pt=this.n.sub(new tt(2));;){var mt=new tt(ht.generate(dt));if(!(mt.cmp(pt)>0))return mt.iaddn(1),this.keyFromPrivate(mt)}},lt.prototype._truncateToN=function(ut,ht){var dt=ut.byteLength()*8-this.n.bitLength();return dt>0&&(ut=ut.ushrn(dt)),!ht&&ut.cmp(this.n)>=0?ut.sub(this.n):ut},lt.prototype.sign=function(ut,ht,dt,pt){typeof dt=="object"&&(pt=dt,dt=null),pt||(pt={}),ht=this.keyFromPrivate(ht,dt),ut=this._truncateToN(new tt(ut,16));for(var mt=this.n.byteLength(),gt=ht.getPrivate().toArray("be",mt),yt=ut.toArray("be",mt),bt=new et({hash:this.hash,entropy:gt,nonce:yt,pers:pt.pers,persEnc:pt.persEnc||"utf8"}),wt=this.n.sub(new tt(1)),xt=0;;xt++){var kt=pt.k?pt.k(xt):new tt(bt.generate(this.n.byteLength()));if(kt=this._truncateToN(kt,!0),!(kt.cmpn(1)<=0||kt.cmp(wt)>=0)){var St=this.g.mul(kt);if(!St.isInfinity()){var Tt=St.getX(),At=Tt.umod(this.n);if(At.cmpn(0)!==0){var Et=kt.invm(this.n).mul(At.mul(ht.getPrivate()).iadd(ut));if(Et=Et.umod(this.n),Et.cmpn(0)!==0){var Ct=(St.getY().isOdd()?1:0)|(Tt.cmp(At)!==0?2:0);return pt.canonical&&Et.cmp(this.nh)>0&&(Et=this.n.sub(Et),Ct^=1),new st({r:At,s:Et,recoveryParam:Ct})}}}}}},lt.prototype.verify=function(ut,ht,dt,pt){ut=this._truncateToN(new tt(ut,16)),dt=this.keyFromPublic(dt,pt),ht=new st(ht,"hex");var mt=ht.r,gt=ht.s;if(mt.cmpn(1)<0||mt.cmp(this.n)>=0||gt.cmpn(1)<0||gt.cmp(this.n)>=0)return!1;var yt=gt.invm(this.n),bt=yt.mul(ut).umod(this.n),wt=yt.mul(mt).umod(this.n),xt;return this.curve._maxwellTrick?(xt=this.g.jmulAdd(bt,dt.getPublic(),wt),xt.isInfinity()?!1:xt.eqXToP(mt)):(xt=this.g.mulAdd(bt,dt.getPublic(),wt),xt.isInfinity()?!1:xt.getX().umod(this.n).cmp(mt)===0)},lt.prototype.recoverPubKey=function(ct,ut,ht,dt){ot((3&ht)===ht,"The recovery param is more than two bits"),ut=new st(ut,dt);var pt=this.n,mt=new tt(ct),gt=ut.r,yt=ut.s,bt=ht&1,wt=ht>>1;if(gt.cmp(this.curve.p.umod(this.curve.n))>=0&&wt)throw new Error("Unable to find sencond key candinate");wt?gt=this.curve.pointFromX(gt.add(this.curve.n),bt):gt=this.curve.pointFromX(gt,bt);var xt=ut.r.invm(pt),kt=pt.sub(mt).mul(xt).umod(pt),St=yt.mul(xt).umod(pt);return this.g.mulAdd(kt,gt,St)},lt.prototype.getKeyRecoveryParam=function(ct,ut,ht,dt){if(ut=new st(ut,dt),ut.recoveryParam!==null)return ut.recoveryParam;for(var pt=0;pt<4;pt++){var mt;try{mt=this.recoverPubKey(ct,ut,pt)}catch{continue}if(mt.eq(ht))return pt}throw new Error("Unable to find valid recovery factor")},ec$1}var utils$5=utils$o,assert$8=utils$5.assert,parseBytes$2=utils$5.parseBytes,cachedProperty$1=utils$5.cachedProperty;function KeyPair$1(tt,et){this.eddsa=tt,this._secret=parseBytes$2(et.secret),tt.isPoint(et.pub)?this._pub=et.pub:this._pubBytes=parseBytes$2(et.pub)}KeyPair$1.fromPublic=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{pub:nt})};KeyPair$1.fromSecret=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{secret:nt})};KeyPair$1.prototype.secret=function(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function(){var et=this.eddsa,nt=this.hash(),rt=et.encodingLength-1,it=nt.slice(0,et.encodingLength);return it[0]&=248,it[rt]&=127,it[rt]|=64,it});cachedProperty$1(KeyPair$1,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function(et){return assert$8(this._secret,"KeyPair can only verify"),this.eddsa.sign(et,this)};KeyPair$1.prototype.verify=function(et,nt){return this.eddsa.verify(et,nt,this)};KeyPair$1.prototype.getSecret=function(et){return assert$8(this._secret,"KeyPair is public only"),utils$5.encode(this.secret(),et)};KeyPair$1.prototype.getPublic=function(et){return utils$5.encode(this.pubBytes(),et)};var key$1=KeyPair$1,BN$5=bnExports$2,utils$4=utils$o,assert$7=utils$4.assert,cachedProperty=utils$4.cachedProperty,parseBytes$1=utils$4.parseBytes;function Signature$1(tt,et){this.eddsa=tt,typeof et!="object"&&(et=parseBytes$1(et)),Array.isArray(et)&&(et={R:et.slice(0,tt.encodingLength),S:et.slice(tt.encodingLength)}),assert$7(et.R&&et.S,"Signature without R or S"),tt.isPoint(et.R)&&(this._R=et.R),et.S instanceof BN$5&&(this._S=et.S),this._Rencoded=Array.isArray(et.R)?et.R:et.Rencoded,this._Sencoded=Array.isArray(et.S)?et.S:et.Sencoded}cachedProperty(Signature$1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Signature$1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Signature$1.prototype.toHex=function(){return utils$4.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash$4=hash$6,curves=curves$1,utils$3=utils$o,assert$6=utils$3.assert,parseBytes=utils$3.parseBytes,KeyPair=key$1,Signature=signature;function EDDSA(tt){if(assert$6(tt==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(tt);tt=curves[tt].curve,this.curve=tt,this.g=tt.g,this.g.precompute(tt.n.bitLength()+1),this.pointClass=tt.point().constructor,this.encodingLength=Math.ceil(tt.n.bitLength()/8),this.hash=hash$4.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function(et,nt){et=parseBytes(et);var rt=this.keyFromSecret(nt),it=this.hashInt(rt.messagePrefix(),et),ot=this.g.mul(it),at=this.encodePoint(ot),st=this.hashInt(at,rt.pubBytes(),et).mul(rt.priv()),lt=it.add(st).umod(this.curve.n);return this.makeSignature({R:ot,S:lt,Rencoded:at})};EDDSA.prototype.verify=function(et,nt,rt){et=parseBytes(et),nt=this.makeSignature(nt);var it=this.keyFromPublic(rt),ot=this.hashInt(nt.Rencoded(),it.pubBytes(),et),at=this.g.mul(nt.S()),st=nt.R().add(it.pub().mul(ot));return st.eq(at)};EDDSA.prototype.hashInt=function(){for(var et=this.hash(),nt=0;nt0?vt:It},ot.min=function(vt,It){return vt.cmp(It)<0?vt:It},ot.prototype._init=function(vt,It,Ot){if(typeof vt=="number")return this._initNumber(vt,It,Ot);if(typeof vt=="object")return this._initArray(vt,It,Ot);It==="hex"&&(It=16),rt(It===(It|0)&&It>=2&&It<=36),vt=vt.toString().replace(/\s+/g,"");var Wt=0;vt[0]==="-"&&(Wt++,this.negative=1),Wt=0;Wt-=3)Ft=vt[Wt]|vt[Wt-1]<<8|vt[Wt-2]<<16,this.words[zt]|=Ft<>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);else if(Ot==="le")for(Wt=0,zt=0;Wt>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,zt++);return this._strip()};function st($t,vt){var It=$t.charCodeAt(vt);if(It>=48&&It<=57)return It-48;if(It>=65&&It<=70)return It-55;if(It>=97&&It<=102)return It-87;rt(!1,"Invalid character in "+$t)}function lt($t,vt,It){var Ot=st($t,It);return It-1>=vt&&(Ot|=st($t,It-1)<<4),Ot}ot.prototype._parseHex=function(vt,It,Ot){this.length=Math.ceil((vt.length-It)/6),this.words=new Array(this.length);for(var Wt=0;Wt=It;Wt-=2)Nt=lt(vt,It,Wt)<=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8;else{var Ut=vt.length-It;for(Wt=Ut%2===0?It+1:It;Wt=18?(zt-=18,Ft+=1,this.words[Ft]|=Nt>>>26):zt+=8}this._strip()};function ct($t,vt,It,Ot){for(var Wt=0,zt=0,Ft=Math.min($t.length,It),Nt=vt;Nt=49?zt=Ut-49+10:Ut>=17?zt=Ut-17+10:zt=Ut,rt(Ut>=0&&zt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(vt,It){vt=vt||10,It=It|0||1;var Ot;if(vt===16||vt==="hex"){Ot="";for(var Wt=0,zt=0,Ft=0;Ft>>24-Wt&16777215,Wt+=2,Wt>=26&&(Wt-=26,Ft--),zt!==0||Ft!==this.length-1?Ot=dt[6-Ut.length]+Ut+Ot:Ot=Ut+Ot}for(zt!==0&&(Ot=zt.toString(16)+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}if(vt===(vt|0)&&vt>=2&&vt<=36){var Pt=pt[vt],Ht=mt[vt];Ot="";var Qt=this.clone();for(Qt.negative=0;!Qt.isZero();){var an=Qt.modrn(Ht).toString(vt);Qt=Qt.idivn(Ht),Qt.isZero()?Ot=an+Ot:Ot=dt[Pt-an.length]+an+Ot}for(this.isZero()&&(Ot="0"+Ot);Ot.length%It!==0;)Ot="0"+Ot;return this.negative!==0&&(Ot="-"+Ot),Ot}rt(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var vt=this.words[0];return this.length===2?vt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?vt+=4503599627370496+this.words[1]*67108864:this.length>2&&rt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-vt:vt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(vt,It){return this.toArrayLike(at,vt,It)}),ot.prototype.toArray=function(vt,It){return this.toArrayLike(Array,vt,It)};var gt=function(vt,It){return vt.allocUnsafe?vt.allocUnsafe(It):new vt(It)};ot.prototype.toArrayLike=function(vt,It,Ot){this._strip();var Wt=this.byteLength(),zt=Ot||Math.max(1,Wt);rt(Wt<=zt,"byte array longer than desired length"),rt(zt>0,"Requested array length <= 0");var Ft=gt(vt,zt),Nt=It==="le"?"LE":"BE";return this["_toArrayLike"+Nt](Ft,Wt),Ft},ot.prototype._toArrayLikeLE=function(vt,It){for(var Ot=0,Wt=0,zt=0,Ft=0;zt>8&255),Ot>16&255),Ft===6?(Ot>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot=0&&(vt[Ot--]=Nt>>8&255),Ot>=0&&(vt[Ot--]=Nt>>16&255),Ft===6?(Ot>=0&&(vt[Ot--]=Nt>>24&255),Wt=0,Ft=0):(Wt=Nt>>>24,Ft+=2)}if(Ot>=0)for(vt[Ot--]=Wt;Ot>=0;)vt[Ot--]=0},Math.clz32?ot.prototype._countBits=function(vt){return 32-Math.clz32(vt)}:ot.prototype._countBits=function(vt){var It=vt,Ot=0;return It>=4096&&(Ot+=13,It>>>=13),It>=64&&(Ot+=7,It>>>=7),It>=8&&(Ot+=4,It>>>=4),It>=2&&(Ot+=2,It>>>=2),Ot+It},ot.prototype._zeroBits=function(vt){if(vt===0)return 26;var It=vt,Ot=0;return It&8191||(Ot+=13,It>>>=13),It&127||(Ot+=7,It>>>=7),It&15||(Ot+=4,It>>>=4),It&3||(Ot+=2,It>>>=2),It&1||Ot++,Ot},ot.prototype.bitLength=function(){var vt=this.words[this.length-1],It=this._countBits(vt);return(this.length-1)*26+It};function yt($t){for(var vt=new Array($t.bitLength()),It=0;It>>Wt&1}return vt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var vt=0,It=0;Itvt.length?this.clone().ior(vt):vt.clone().ior(this)},ot.prototype.uor=function(vt){return this.length>vt.length?this.clone().iuor(vt):vt.clone().iuor(this)},ot.prototype.iuand=function(vt){var It;this.length>vt.length?It=vt:It=this;for(var Ot=0;Otvt.length?this.clone().iand(vt):vt.clone().iand(this)},ot.prototype.uand=function(vt){return this.length>vt.length?this.clone().iuand(vt):vt.clone().iuand(this)},ot.prototype.iuxor=function(vt){var It,Ot;this.length>vt.length?(It=this,Ot=vt):(It=vt,Ot=this);for(var Wt=0;Wtvt.length?this.clone().ixor(vt):vt.clone().ixor(this)},ot.prototype.uxor=function(vt){return this.length>vt.length?this.clone().iuxor(vt):vt.clone().iuxor(this)},ot.prototype.inotn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=Math.ceil(vt/26)|0,Ot=vt%26;this._expand(It),Ot>0&&It--;for(var Wt=0;Wt0&&(this.words[Wt]=~this.words[Wt]&67108863>>26-Ot),this._strip()},ot.prototype.notn=function(vt){return this.clone().inotn(vt)},ot.prototype.setn=function(vt,It){rt(typeof vt=="number"&&vt>=0);var Ot=vt/26|0,Wt=vt%26;return this._expand(Ot+1),It?this.words[Ot]=this.words[Ot]|1<vt.length?(Ot=this,Wt=vt):(Ot=vt,Wt=this);for(var zt=0,Ft=0;Ft>>26;for(;zt!==0&&Ft>>26;if(this.length=Ot.length,zt!==0)this.words[this.length]=zt,this.length++;else if(Ot!==this)for(;Ftvt.length?this.clone().iadd(vt):vt.clone().iadd(this)},ot.prototype.isub=function(vt){if(vt.negative!==0){vt.negative=0;var It=this.iadd(vt);return vt.negative=1,It._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(vt),this.negative=1,this._normSign();var Ot=this.cmp(vt);if(Ot===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Wt,zt;Ot>0?(Wt=this,zt=vt):(Wt=vt,zt=this);for(var Ft=0,Nt=0;Nt>26,this.words[Nt]=It&67108863;for(;Ft!==0&&Nt>26,this.words[Nt]=It&67108863;if(Ft===0&&Nt>>26,Qt=Ut&67108863,an=Math.min(Pt,vt.length-1),Yt=Math.max(0,Pt-$t.length+1);Yt<=an;Yt++){var nn=Pt-Yt|0;Wt=$t.words[nn]|0,zt=vt.words[Yt]|0,Ft=Wt*zt+Qt,Ht+=Ft/67108864|0,Qt=Ft&67108863}It.words[Pt]=Qt|0,Ut=Ht|0}return Ut!==0?It.words[Pt]=Ut|0:It.length--,It._strip()}var wt=function(vt,It,Ot){var Wt=vt.words,zt=It.words,Ft=Ot.words,Nt=0,Ut,Pt,Ht,Qt=Wt[0]|0,an=Qt&8191,Yt=Qt>>>13,nn=Wt[1]|0,tn=nn&8191,dn=nn>>>13,wn=Wt[2]|0,rn=wn&8191,Zt=wn>>>13,vn=Wt[3]|0,Cn=vn&8191,$n=vn>>>13,Nn=Wt[4]|0,En=Nn&8191,sn=Nn>>>13,pn=Wt[5]|0,Tn=pn&8191,In=pn>>>13,yn=Wt[6]|0,hn=yn&8191,fn=yn>>>13,xn=Wt[7]|0,jn=xn&8191,cn=xn>>>13,Xt=Wt[8]|0,Kt=Xt&8191,kn=Xt>>>13,Mn=Wt[9]|0,On=Mn&8191,Bn=Mn>>>13,Xn=zt[0]|0,Vn=Xn&8191,Gn=Xn>>>13,zn=zt[1]|0,Jn=zn&8191,Wn=zn>>>13,fr=zt[2]|0,ur=fr&8191,wr=fr>>>13,Xr=zt[3]|0,Er=Xr&8191,Ir=Xr>>>13,Gr=zt[4]|0,Or=Gr&8191,Lr=Gr>>>13,oo=zt[5]|0,qr=oo&8191,jr=oo>>>13,mo=zt[6]|0,_n=mo&8191,Pn=mo>>>13,un=zt[7]|0,Jt=un&8191,Sn=un>>>13,Dn=zt[8]|0,Fn=Dn&8191,Yn=Dn>>>13,tr=zt[9]|0,ar=tr&8191,lr=tr>>>13;Ot.negative=vt.negative^It.negative,Ot.length=19,Ut=Math.imul(an,Vn),Pt=Math.imul(an,Gn),Pt=Pt+Math.imul(Yt,Vn)|0,Ht=Math.imul(Yt,Gn);var Vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Ut=Math.imul(tn,Vn),Pt=Math.imul(tn,Gn),Pt=Pt+Math.imul(dn,Vn)|0,Ht=Math.imul(dn,Gn),Ut=Ut+Math.imul(an,Jn)|0,Pt=Pt+Math.imul(an,Wn)|0,Pt=Pt+Math.imul(Yt,Jn)|0,Ht=Ht+Math.imul(Yt,Wn)|0;var vr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(vr>>>26)|0,vr&=67108863,Ut=Math.imul(rn,Vn),Pt=Math.imul(rn,Gn),Pt=Pt+Math.imul(Zt,Vn)|0,Ht=Math.imul(Zt,Gn),Ut=Ut+Math.imul(tn,Jn)|0,Pt=Pt+Math.imul(tn,Wn)|0,Pt=Pt+Math.imul(dn,Jn)|0,Ht=Ht+Math.imul(dn,Wn)|0,Ut=Ut+Math.imul(an,ur)|0,Pt=Pt+Math.imul(an,wr)|0,Pt=Pt+Math.imul(Yt,ur)|0,Ht=Ht+Math.imul(Yt,wr)|0;var Nr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Ut=Math.imul(Cn,Vn),Pt=Math.imul(Cn,Gn),Pt=Pt+Math.imul($n,Vn)|0,Ht=Math.imul($n,Gn),Ut=Ut+Math.imul(rn,Jn)|0,Pt=Pt+Math.imul(rn,Wn)|0,Pt=Pt+Math.imul(Zt,Jn)|0,Ht=Ht+Math.imul(Zt,Wn)|0,Ut=Ut+Math.imul(tn,ur)|0,Pt=Pt+Math.imul(tn,wr)|0,Pt=Pt+Math.imul(dn,ur)|0,Ht=Ht+Math.imul(dn,wr)|0,Ut=Ut+Math.imul(an,Er)|0,Pt=Pt+Math.imul(an,Ir)|0,Pt=Pt+Math.imul(Yt,Er)|0,Ht=Ht+Math.imul(Yt,Ir)|0;var Hr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Ut=Math.imul(En,Vn),Pt=Math.imul(En,Gn),Pt=Pt+Math.imul(sn,Vn)|0,Ht=Math.imul(sn,Gn),Ut=Ut+Math.imul(Cn,Jn)|0,Pt=Pt+Math.imul(Cn,Wn)|0,Pt=Pt+Math.imul($n,Jn)|0,Ht=Ht+Math.imul($n,Wn)|0,Ut=Ut+Math.imul(rn,ur)|0,Pt=Pt+Math.imul(rn,wr)|0,Pt=Pt+Math.imul(Zt,ur)|0,Ht=Ht+Math.imul(Zt,wr)|0,Ut=Ut+Math.imul(tn,Er)|0,Pt=Pt+Math.imul(tn,Ir)|0,Pt=Pt+Math.imul(dn,Er)|0,Ht=Ht+Math.imul(dn,Ir)|0,Ut=Ut+Math.imul(an,Or)|0,Pt=Pt+Math.imul(an,Lr)|0,Pt=Pt+Math.imul(Yt,Or)|0,Ht=Ht+Math.imul(Yt,Lr)|0;var eo=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(eo>>>26)|0,eo&=67108863,Ut=Math.imul(Tn,Vn),Pt=Math.imul(Tn,Gn),Pt=Pt+Math.imul(In,Vn)|0,Ht=Math.imul(In,Gn),Ut=Ut+Math.imul(En,Jn)|0,Pt=Pt+Math.imul(En,Wn)|0,Pt=Pt+Math.imul(sn,Jn)|0,Ht=Ht+Math.imul(sn,Wn)|0,Ut=Ut+Math.imul(Cn,ur)|0,Pt=Pt+Math.imul(Cn,wr)|0,Pt=Pt+Math.imul($n,ur)|0,Ht=Ht+Math.imul($n,wr)|0,Ut=Ut+Math.imul(rn,Er)|0,Pt=Pt+Math.imul(rn,Ir)|0,Pt=Pt+Math.imul(Zt,Er)|0,Ht=Ht+Math.imul(Zt,Ir)|0,Ut=Ut+Math.imul(tn,Or)|0,Pt=Pt+Math.imul(tn,Lr)|0,Pt=Pt+Math.imul(dn,Or)|0,Ht=Ht+Math.imul(dn,Lr)|0,Ut=Ut+Math.imul(an,qr)|0,Pt=Pt+Math.imul(an,jr)|0,Pt=Pt+Math.imul(Yt,qr)|0,Ht=Ht+Math.imul(Yt,jr)|0;var Jr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Ut=Math.imul(hn,Vn),Pt=Math.imul(hn,Gn),Pt=Pt+Math.imul(fn,Vn)|0,Ht=Math.imul(fn,Gn),Ut=Ut+Math.imul(Tn,Jn)|0,Pt=Pt+Math.imul(Tn,Wn)|0,Pt=Pt+Math.imul(In,Jn)|0,Ht=Ht+Math.imul(In,Wn)|0,Ut=Ut+Math.imul(En,ur)|0,Pt=Pt+Math.imul(En,wr)|0,Pt=Pt+Math.imul(sn,ur)|0,Ht=Ht+Math.imul(sn,wr)|0,Ut=Ut+Math.imul(Cn,Er)|0,Pt=Pt+Math.imul(Cn,Ir)|0,Pt=Pt+Math.imul($n,Er)|0,Ht=Ht+Math.imul($n,Ir)|0,Ut=Ut+Math.imul(rn,Or)|0,Pt=Pt+Math.imul(rn,Lr)|0,Pt=Pt+Math.imul(Zt,Or)|0,Ht=Ht+Math.imul(Zt,Lr)|0,Ut=Ut+Math.imul(tn,qr)|0,Pt=Pt+Math.imul(tn,jr)|0,Pt=Pt+Math.imul(dn,qr)|0,Ht=Ht+Math.imul(dn,jr)|0,Ut=Ut+Math.imul(an,_n)|0,Pt=Pt+Math.imul(an,Pn)|0,Pt=Pt+Math.imul(Yt,_n)|0,Ht=Ht+Math.imul(Yt,Pn)|0;var Zr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,Ut=Math.imul(jn,Vn),Pt=Math.imul(jn,Gn),Pt=Pt+Math.imul(cn,Vn)|0,Ht=Math.imul(cn,Gn),Ut=Ut+Math.imul(hn,Jn)|0,Pt=Pt+Math.imul(hn,Wn)|0,Pt=Pt+Math.imul(fn,Jn)|0,Ht=Ht+Math.imul(fn,Wn)|0,Ut=Ut+Math.imul(Tn,ur)|0,Pt=Pt+Math.imul(Tn,wr)|0,Pt=Pt+Math.imul(In,ur)|0,Ht=Ht+Math.imul(In,wr)|0,Ut=Ut+Math.imul(En,Er)|0,Pt=Pt+Math.imul(En,Ir)|0,Pt=Pt+Math.imul(sn,Er)|0,Ht=Ht+Math.imul(sn,Ir)|0,Ut=Ut+Math.imul(Cn,Or)|0,Pt=Pt+Math.imul(Cn,Lr)|0,Pt=Pt+Math.imul($n,Or)|0,Ht=Ht+Math.imul($n,Lr)|0,Ut=Ut+Math.imul(rn,qr)|0,Pt=Pt+Math.imul(rn,jr)|0,Pt=Pt+Math.imul(Zt,qr)|0,Ht=Ht+Math.imul(Zt,jr)|0,Ut=Ut+Math.imul(tn,_n)|0,Pt=Pt+Math.imul(tn,Pn)|0,Pt=Pt+Math.imul(dn,_n)|0,Ht=Ht+Math.imul(dn,Pn)|0,Ut=Ut+Math.imul(an,Jt)|0,Pt=Pt+Math.imul(an,Sn)|0,Pt=Pt+Math.imul(Yt,Jt)|0,Ht=Ht+Math.imul(Yt,Sn)|0;var br=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(br>>>26)|0,br&=67108863,Ut=Math.imul(Kt,Vn),Pt=Math.imul(Kt,Gn),Pt=Pt+Math.imul(kn,Vn)|0,Ht=Math.imul(kn,Gn),Ut=Ut+Math.imul(jn,Jn)|0,Pt=Pt+Math.imul(jn,Wn)|0,Pt=Pt+Math.imul(cn,Jn)|0,Ht=Ht+Math.imul(cn,Wn)|0,Ut=Ut+Math.imul(hn,ur)|0,Pt=Pt+Math.imul(hn,wr)|0,Pt=Pt+Math.imul(fn,ur)|0,Ht=Ht+Math.imul(fn,wr)|0,Ut=Ut+Math.imul(Tn,Er)|0,Pt=Pt+Math.imul(Tn,Ir)|0,Pt=Pt+Math.imul(In,Er)|0,Ht=Ht+Math.imul(In,Ir)|0,Ut=Ut+Math.imul(En,Or)|0,Pt=Pt+Math.imul(En,Lr)|0,Pt=Pt+Math.imul(sn,Or)|0,Ht=Ht+Math.imul(sn,Lr)|0,Ut=Ut+Math.imul(Cn,qr)|0,Pt=Pt+Math.imul(Cn,jr)|0,Pt=Pt+Math.imul($n,qr)|0,Ht=Ht+Math.imul($n,jr)|0,Ut=Ut+Math.imul(rn,_n)|0,Pt=Pt+Math.imul(rn,Pn)|0,Pt=Pt+Math.imul(Zt,_n)|0,Ht=Ht+Math.imul(Zt,Pn)|0,Ut=Ut+Math.imul(tn,Jt)|0,Pt=Pt+Math.imul(tn,Sn)|0,Pt=Pt+Math.imul(dn,Jt)|0,Ht=Ht+Math.imul(dn,Sn)|0,Ut=Ut+Math.imul(an,Fn)|0,Pt=Pt+Math.imul(an,Yn)|0,Pt=Pt+Math.imul(Yt,Fn)|0,Ht=Ht+Math.imul(Yt,Yn)|0;var Pr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Ut=Math.imul(On,Vn),Pt=Math.imul(On,Gn),Pt=Pt+Math.imul(Bn,Vn)|0,Ht=Math.imul(Bn,Gn),Ut=Ut+Math.imul(Kt,Jn)|0,Pt=Pt+Math.imul(Kt,Wn)|0,Pt=Pt+Math.imul(kn,Jn)|0,Ht=Ht+Math.imul(kn,Wn)|0,Ut=Ut+Math.imul(jn,ur)|0,Pt=Pt+Math.imul(jn,wr)|0,Pt=Pt+Math.imul(cn,ur)|0,Ht=Ht+Math.imul(cn,wr)|0,Ut=Ut+Math.imul(hn,Er)|0,Pt=Pt+Math.imul(hn,Ir)|0,Pt=Pt+Math.imul(fn,Er)|0,Ht=Ht+Math.imul(fn,Ir)|0,Ut=Ut+Math.imul(Tn,Or)|0,Pt=Pt+Math.imul(Tn,Lr)|0,Pt=Pt+Math.imul(In,Or)|0,Ht=Ht+Math.imul(In,Lr)|0,Ut=Ut+Math.imul(En,qr)|0,Pt=Pt+Math.imul(En,jr)|0,Pt=Pt+Math.imul(sn,qr)|0,Ht=Ht+Math.imul(sn,jr)|0,Ut=Ut+Math.imul(Cn,_n)|0,Pt=Pt+Math.imul(Cn,Pn)|0,Pt=Pt+Math.imul($n,_n)|0,Ht=Ht+Math.imul($n,Pn)|0,Ut=Ut+Math.imul(rn,Jt)|0,Pt=Pt+Math.imul(rn,Sn)|0,Pt=Pt+Math.imul(Zt,Jt)|0,Ht=Ht+Math.imul(Zt,Sn)|0,Ut=Ut+Math.imul(tn,Fn)|0,Pt=Pt+Math.imul(tn,Yn)|0,Pt=Pt+Math.imul(dn,Fn)|0,Ht=Ht+Math.imul(dn,Yn)|0,Ut=Ut+Math.imul(an,ar)|0,Pt=Pt+Math.imul(an,lr)|0,Pt=Pt+Math.imul(Yt,ar)|0,Ht=Ht+Math.imul(Yt,lr)|0;var Fr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Ut=Math.imul(On,Jn),Pt=Math.imul(On,Wn),Pt=Pt+Math.imul(Bn,Jn)|0,Ht=Math.imul(Bn,Wn),Ut=Ut+Math.imul(Kt,ur)|0,Pt=Pt+Math.imul(Kt,wr)|0,Pt=Pt+Math.imul(kn,ur)|0,Ht=Ht+Math.imul(kn,wr)|0,Ut=Ut+Math.imul(jn,Er)|0,Pt=Pt+Math.imul(jn,Ir)|0,Pt=Pt+Math.imul(cn,Er)|0,Ht=Ht+Math.imul(cn,Ir)|0,Ut=Ut+Math.imul(hn,Or)|0,Pt=Pt+Math.imul(hn,Lr)|0,Pt=Pt+Math.imul(fn,Or)|0,Ht=Ht+Math.imul(fn,Lr)|0,Ut=Ut+Math.imul(Tn,qr)|0,Pt=Pt+Math.imul(Tn,jr)|0,Pt=Pt+Math.imul(In,qr)|0,Ht=Ht+Math.imul(In,jr)|0,Ut=Ut+Math.imul(En,_n)|0,Pt=Pt+Math.imul(En,Pn)|0,Pt=Pt+Math.imul(sn,_n)|0,Ht=Ht+Math.imul(sn,Pn)|0,Ut=Ut+Math.imul(Cn,Jt)|0,Pt=Pt+Math.imul(Cn,Sn)|0,Pt=Pt+Math.imul($n,Jt)|0,Ht=Ht+Math.imul($n,Sn)|0,Ut=Ut+Math.imul(rn,Fn)|0,Pt=Pt+Math.imul(rn,Yn)|0,Pt=Pt+Math.imul(Zt,Fn)|0,Ht=Ht+Math.imul(Zt,Yn)|0,Ut=Ut+Math.imul(tn,ar)|0,Pt=Pt+Math.imul(tn,lr)|0,Pt=Pt+Math.imul(dn,ar)|0,Ht=Ht+Math.imul(dn,lr)|0;var Mr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,Ut=Math.imul(On,ur),Pt=Math.imul(On,wr),Pt=Pt+Math.imul(Bn,ur)|0,Ht=Math.imul(Bn,wr),Ut=Ut+Math.imul(Kt,Er)|0,Pt=Pt+Math.imul(Kt,Ir)|0,Pt=Pt+Math.imul(kn,Er)|0,Ht=Ht+Math.imul(kn,Ir)|0,Ut=Ut+Math.imul(jn,Or)|0,Pt=Pt+Math.imul(jn,Lr)|0,Pt=Pt+Math.imul(cn,Or)|0,Ht=Ht+Math.imul(cn,Lr)|0,Ut=Ut+Math.imul(hn,qr)|0,Pt=Pt+Math.imul(hn,jr)|0,Pt=Pt+Math.imul(fn,qr)|0,Ht=Ht+Math.imul(fn,jr)|0,Ut=Ut+Math.imul(Tn,_n)|0,Pt=Pt+Math.imul(Tn,Pn)|0,Pt=Pt+Math.imul(In,_n)|0,Ht=Ht+Math.imul(In,Pn)|0,Ut=Ut+Math.imul(En,Jt)|0,Pt=Pt+Math.imul(En,Sn)|0,Pt=Pt+Math.imul(sn,Jt)|0,Ht=Ht+Math.imul(sn,Sn)|0,Ut=Ut+Math.imul(Cn,Fn)|0,Pt=Pt+Math.imul(Cn,Yn)|0,Pt=Pt+Math.imul($n,Fn)|0,Ht=Ht+Math.imul($n,Yn)|0,Ut=Ut+Math.imul(rn,ar)|0,Pt=Pt+Math.imul(rn,lr)|0,Pt=Pt+Math.imul(Zt,ar)|0,Ht=Ht+Math.imul(Zt,lr)|0;var Cr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Ut=Math.imul(On,Er),Pt=Math.imul(On,Ir),Pt=Pt+Math.imul(Bn,Er)|0,Ht=Math.imul(Bn,Ir),Ut=Ut+Math.imul(Kt,Or)|0,Pt=Pt+Math.imul(Kt,Lr)|0,Pt=Pt+Math.imul(kn,Or)|0,Ht=Ht+Math.imul(kn,Lr)|0,Ut=Ut+Math.imul(jn,qr)|0,Pt=Pt+Math.imul(jn,jr)|0,Pt=Pt+Math.imul(cn,qr)|0,Ht=Ht+Math.imul(cn,jr)|0,Ut=Ut+Math.imul(hn,_n)|0,Pt=Pt+Math.imul(hn,Pn)|0,Pt=Pt+Math.imul(fn,_n)|0,Ht=Ht+Math.imul(fn,Pn)|0,Ut=Ut+Math.imul(Tn,Jt)|0,Pt=Pt+Math.imul(Tn,Sn)|0,Pt=Pt+Math.imul(In,Jt)|0,Ht=Ht+Math.imul(In,Sn)|0,Ut=Ut+Math.imul(En,Fn)|0,Pt=Pt+Math.imul(En,Yn)|0,Pt=Pt+Math.imul(sn,Fn)|0,Ht=Ht+Math.imul(sn,Yn)|0,Ut=Ut+Math.imul(Cn,ar)|0,Pt=Pt+Math.imul(Cn,lr)|0,Pt=Pt+Math.imul($n,ar)|0,Ht=Ht+Math.imul($n,lr)|0;var Dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Ut=Math.imul(On,Or),Pt=Math.imul(On,Lr),Pt=Pt+Math.imul(Bn,Or)|0,Ht=Math.imul(Bn,Lr),Ut=Ut+Math.imul(Kt,qr)|0,Pt=Pt+Math.imul(Kt,jr)|0,Pt=Pt+Math.imul(kn,qr)|0,Ht=Ht+Math.imul(kn,jr)|0,Ut=Ut+Math.imul(jn,_n)|0,Pt=Pt+Math.imul(jn,Pn)|0,Pt=Pt+Math.imul(cn,_n)|0,Ht=Ht+Math.imul(cn,Pn)|0,Ut=Ut+Math.imul(hn,Jt)|0,Pt=Pt+Math.imul(hn,Sn)|0,Pt=Pt+Math.imul(fn,Jt)|0,Ht=Ht+Math.imul(fn,Sn)|0,Ut=Ut+Math.imul(Tn,Fn)|0,Pt=Pt+Math.imul(Tn,Yn)|0,Pt=Pt+Math.imul(In,Fn)|0,Ht=Ht+Math.imul(In,Yn)|0,Ut=Ut+Math.imul(En,ar)|0,Pt=Pt+Math.imul(En,lr)|0,Pt=Pt+Math.imul(sn,ar)|0,Ht=Ht+Math.imul(sn,lr)|0;var Ur=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,Ut=Math.imul(On,qr),Pt=Math.imul(On,jr),Pt=Pt+Math.imul(Bn,qr)|0,Ht=Math.imul(Bn,jr),Ut=Ut+Math.imul(Kt,_n)|0,Pt=Pt+Math.imul(Kt,Pn)|0,Pt=Pt+Math.imul(kn,_n)|0,Ht=Ht+Math.imul(kn,Pn)|0,Ut=Ut+Math.imul(jn,Jt)|0,Pt=Pt+Math.imul(jn,Sn)|0,Pt=Pt+Math.imul(cn,Jt)|0,Ht=Ht+Math.imul(cn,Sn)|0,Ut=Ut+Math.imul(hn,Fn)|0,Pt=Pt+Math.imul(hn,Yn)|0,Pt=Pt+Math.imul(fn,Fn)|0,Ht=Ht+Math.imul(fn,Yn)|0,Ut=Ut+Math.imul(Tn,ar)|0,Pt=Pt+Math.imul(Tn,lr)|0,Pt=Pt+Math.imul(In,ar)|0,Ht=Ht+Math.imul(In,lr)|0;var Rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,Ut=Math.imul(On,_n),Pt=Math.imul(On,Pn),Pt=Pt+Math.imul(Bn,_n)|0,Ht=Math.imul(Bn,Pn),Ut=Ut+Math.imul(Kt,Jt)|0,Pt=Pt+Math.imul(Kt,Sn)|0,Pt=Pt+Math.imul(kn,Jt)|0,Ht=Ht+Math.imul(kn,Sn)|0,Ut=Ut+Math.imul(jn,Fn)|0,Pt=Pt+Math.imul(jn,Yn)|0,Pt=Pt+Math.imul(cn,Fn)|0,Ht=Ht+Math.imul(cn,Yn)|0,Ut=Ut+Math.imul(hn,ar)|0,Pt=Pt+Math.imul(hn,lr)|0,Pt=Pt+Math.imul(fn,ar)|0,Ht=Ht+Math.imul(fn,lr)|0;var er=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(er>>>26)|0,er&=67108863,Ut=Math.imul(On,Jt),Pt=Math.imul(On,Sn),Pt=Pt+Math.imul(Bn,Jt)|0,Ht=Math.imul(Bn,Sn),Ut=Ut+Math.imul(Kt,Fn)|0,Pt=Pt+Math.imul(Kt,Yn)|0,Pt=Pt+Math.imul(kn,Fn)|0,Ht=Ht+Math.imul(kn,Yn)|0,Ut=Ut+Math.imul(jn,ar)|0,Pt=Pt+Math.imul(jn,lr)|0,Pt=Pt+Math.imul(cn,ar)|0,Ht=Ht+Math.imul(cn,lr)|0;var rr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(rr>>>26)|0,rr&=67108863,Ut=Math.imul(On,Fn),Pt=Math.imul(On,Yn),Pt=Pt+Math.imul(Bn,Fn)|0,Ht=Math.imul(Bn,Yn),Ut=Ut+Math.imul(Kt,ar)|0,Pt=Pt+Math.imul(Kt,lr)|0,Pt=Pt+Math.imul(kn,ar)|0,Ht=Ht+Math.imul(kn,lr)|0;var xr=(Nt+Ut|0)+((Pt&8191)<<13)|0;Nt=(Ht+(Pt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Ut=Math.imul(On,ar),Pt=Math.imul(On,lr),Pt=Pt+Math.imul(Bn,ar)|0,Ht=Math.imul(Bn,lr);var dr=(Nt+Ut|0)+((Pt&8191)<<13)|0;return Nt=(Ht+(Pt>>>13)|0)+(dr>>>26)|0,dr&=67108863,Ft[0]=Vr,Ft[1]=vr,Ft[2]=Nr,Ft[3]=Hr,Ft[4]=eo,Ft[5]=Jr,Ft[6]=Zr,Ft[7]=br,Ft[8]=Pr,Ft[9]=Fr,Ft[10]=Mr,Ft[11]=Cr,Ft[12]=Dr,Ft[13]=Ur,Ft[14]=Rr,Ft[15]=er,Ft[16]=rr,Ft[17]=xr,Ft[18]=dr,Nt!==0&&(Ft[19]=Nt,Ot.length++),Ot};Math.imul||(wt=bt);function xt($t,vt,It){It.negative=vt.negative^$t.negative,It.length=$t.length+vt.length;for(var Ot=0,Wt=0,zt=0;zt>>26)|0,Wt+=Ft>>>26,Ft&=67108863}It.words[zt]=Nt,Ot=Ft,Ft=Wt}return Ot!==0?It.words[zt]=Ot:It.length--,It._strip()}function kt($t,vt,It){return xt($t,vt,It)}ot.prototype.mulTo=function(vt,It){var Ot,Wt=this.length+vt.length;return this.length===10&&vt.length===10?Ot=wt(this,vt,It):Wt<63?Ot=bt(this,vt,It):Wt<1024?Ot=xt(this,vt,It):Ot=kt(this,vt,It),Ot},ot.prototype.mul=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),this.mulTo(vt,It)},ot.prototype.mulf=function(vt){var It=new ot(null);return It.words=new Array(this.length+vt.length),kt(this,vt,It)},ot.prototype.imul=function(vt){return this.clone().mulTo(vt,this)},ot.prototype.imuln=function(vt){var It=vt<0;It&&(vt=-vt),rt(typeof vt=="number"),rt(vt<67108864);for(var Ot=0,Wt=0;Wt>=26,Ot+=zt/67108864|0,Ot+=Ft>>>26,this.words[Wt]=Ft&67108863}return Ot!==0&&(this.words[Wt]=Ot,this.length++),It?this.ineg():this},ot.prototype.muln=function(vt){return this.clone().imuln(vt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(vt){var It=yt(vt);if(It.length===0)return new ot(1);for(var Ot=this,Wt=0;Wt=0);var It=vt%26,Ot=(vt-It)/26,Wt=67108863>>>26-It<<26-It,zt;if(It!==0){var Ft=0;for(zt=0;zt>>26-It}Ft&&(this.words[zt]=Ft,this.length++)}if(Ot!==0){for(zt=this.length-1;zt>=0;zt--)this.words[zt+Ot]=this.words[zt];for(zt=0;zt=0);var Wt;It?Wt=(It-It%26)/26:Wt=0;var zt=vt%26,Ft=Math.min((vt-zt)/26,this.length),Nt=67108863^67108863>>>zt<Ft)for(this.length-=Ft,Pt=0;Pt=0&&(Ht!==0||Pt>=Wt);Pt--){var Qt=this.words[Pt]|0;this.words[Pt]=Ht<<26-zt|Qt>>>zt,Ht=Qt&Nt}return Ut&&Ht!==0&&(Ut.words[Ut.length++]=Ht),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(vt,It,Ot){return rt(this.negative===0),this.iushrn(vt,It,Ot)},ot.prototype.shln=function(vt){return this.clone().ishln(vt)},ot.prototype.ushln=function(vt){return this.clone().iushln(vt)},ot.prototype.shrn=function(vt){return this.clone().ishrn(vt)},ot.prototype.ushrn=function(vt){return this.clone().iushrn(vt)},ot.prototype.testn=function(vt){rt(typeof vt=="number"&&vt>=0);var It=vt%26,Ot=(vt-It)/26,Wt=1<=0);var It=vt%26,Ot=(vt-It)/26;if(rt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ot)return this;if(It!==0&&Ot++,this.length=Math.min(Ot,this.length),It!==0){var Wt=67108863^67108863>>>It<=67108864;It++)this.words[It]-=67108864,It===this.length-1?this.words[It+1]=1:this.words[It+1]++;return this.length=Math.max(this.length,It+1),this},ot.prototype.isubn=function(vt){if(rt(typeof vt=="number"),rt(vt<67108864),vt<0)return this.iaddn(-vt);if(this.negative!==0)return this.negative=0,this.iaddn(vt),this.negative=1,this;if(this.words[0]-=vt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var It=0;It>26)-(Ut/67108864|0),this.words[zt+Ot]=Ft&67108863}for(;zt>26,this.words[zt+Ot]=Ft&67108863;if(Nt===0)return this._strip();for(rt(Nt===-1),Nt=0,zt=0;zt>26,this.words[zt]=Ft&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(vt,It){var Ot=this.length-vt.length,Wt=this.clone(),zt=vt,Ft=zt.words[zt.length-1]|0,Nt=this._countBits(Ft);Ot=26-Nt,Ot!==0&&(zt=zt.ushln(Ot),Wt.iushln(Ot),Ft=zt.words[zt.length-1]|0);var Ut=Wt.length-zt.length,Pt;if(It!=="mod"){Pt=new ot(null),Pt.length=Ut+1,Pt.words=new Array(Pt.length);for(var Ht=0;Ht=0;an--){var Yt=(Wt.words[zt.length+an]|0)*67108864+(Wt.words[zt.length+an-1]|0);for(Yt=Math.min(Yt/Ft|0,67108863),Wt._ishlnsubmul(zt,Yt,an);Wt.negative!==0;)Yt--,Wt.negative=0,Wt._ishlnsubmul(zt,1,an),Wt.isZero()||(Wt.negative^=1);Pt&&(Pt.words[an]=Yt)}return Pt&&Pt._strip(),Wt._strip(),It!=="div"&&Ot!==0&&Wt.iushrn(Ot),{div:Pt||null,mod:Wt}},ot.prototype.divmod=function(vt,It,Ot){if(rt(!vt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Wt,zt,Ft;return this.negative!==0&&vt.negative===0?(Ft=this.neg().divmod(vt,It),It!=="mod"&&(Wt=Ft.div.neg()),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.iadd(vt)),{div:Wt,mod:zt}):this.negative===0&&vt.negative!==0?(Ft=this.divmod(vt.neg(),It),It!=="mod"&&(Wt=Ft.div.neg()),{div:Wt,mod:Ft.mod}):this.negative&vt.negative?(Ft=this.neg().divmod(vt.neg(),It),It!=="div"&&(zt=Ft.mod.neg(),Ot&&zt.negative!==0&&zt.isub(vt)),{div:Ft.div,mod:zt}):vt.length>this.length||this.cmp(vt)<0?{div:new ot(0),mod:this}:vt.length===1?It==="div"?{div:this.divn(vt.words[0]),mod:null}:It==="mod"?{div:null,mod:new ot(this.modrn(vt.words[0]))}:{div:this.divn(vt.words[0]),mod:new ot(this.modrn(vt.words[0]))}:this._wordDiv(vt,It)},ot.prototype.div=function(vt){return this.divmod(vt,"div",!1).div},ot.prototype.mod=function(vt){return this.divmod(vt,"mod",!1).mod},ot.prototype.umod=function(vt){return this.divmod(vt,"mod",!0).mod},ot.prototype.divRound=function(vt){var It=this.divmod(vt);if(It.mod.isZero())return It.div;var Ot=It.div.negative!==0?It.mod.isub(vt):It.mod,Wt=vt.ushrn(1),zt=vt.andln(1),Ft=Ot.cmp(Wt);return Ft<0||zt===1&&Ft===0?It.div:It.div.negative!==0?It.div.isubn(1):It.div.iaddn(1)},ot.prototype.modrn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=(1<<26)%vt,Wt=0,zt=this.length-1;zt>=0;zt--)Wt=(Ot*Wt+(this.words[zt]|0))%vt;return It?-Wt:Wt},ot.prototype.modn=function(vt){return this.modrn(vt)},ot.prototype.idivn=function(vt){var It=vt<0;It&&(vt=-vt),rt(vt<=67108863);for(var Ot=0,Wt=this.length-1;Wt>=0;Wt--){var zt=(this.words[Wt]|0)+Ot*67108864;this.words[Wt]=zt/vt|0,Ot=zt%vt}return this._strip(),It?this.ineg():this},ot.prototype.divn=function(vt){return this.clone().idivn(vt)},ot.prototype.egcd=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=new ot(0),Nt=new ot(1),Ut=0;It.isEven()&&Ot.isEven();)It.iushrn(1),Ot.iushrn(1),++Ut;for(var Pt=Ot.clone(),Ht=It.clone();!It.isZero();){for(var Qt=0,an=1;!(It.words[0]&an)&&Qt<26;++Qt,an<<=1);if(Qt>0)for(It.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||zt.isOdd())&&(Wt.iadd(Pt),zt.isub(Ht)),Wt.iushrn(1),zt.iushrn(1);for(var Yt=0,nn=1;!(Ot.words[0]&nn)&&Yt<26;++Yt,nn<<=1);if(Yt>0)for(Ot.iushrn(Yt);Yt-- >0;)(Ft.isOdd()||Nt.isOdd())&&(Ft.iadd(Pt),Nt.isub(Ht)),Ft.iushrn(1),Nt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(Ft),zt.isub(Nt)):(Ot.isub(It),Ft.isub(Wt),Nt.isub(zt))}return{a:Ft,b:Nt,gcd:Ot.iushln(Ut)}},ot.prototype._invmp=function(vt){rt(vt.negative===0),rt(!vt.isZero());var It=this,Ot=vt.clone();It.negative!==0?It=It.umod(vt):It=It.clone();for(var Wt=new ot(1),zt=new ot(0),Ft=Ot.clone();It.cmpn(1)>0&&Ot.cmpn(1)>0;){for(var Nt=0,Ut=1;!(It.words[0]&Ut)&&Nt<26;++Nt,Ut<<=1);if(Nt>0)for(It.iushrn(Nt);Nt-- >0;)Wt.isOdd()&&Wt.iadd(Ft),Wt.iushrn(1);for(var Pt=0,Ht=1;!(Ot.words[0]&Ht)&&Pt<26;++Pt,Ht<<=1);if(Pt>0)for(Ot.iushrn(Pt);Pt-- >0;)zt.isOdd()&&zt.iadd(Ft),zt.iushrn(1);It.cmp(Ot)>=0?(It.isub(Ot),Wt.isub(zt)):(Ot.isub(It),zt.isub(Wt))}var Qt;return It.cmpn(1)===0?Qt=Wt:Qt=zt,Qt.cmpn(0)<0&&Qt.iadd(vt),Qt},ot.prototype.gcd=function(vt){if(this.isZero())return vt.abs();if(vt.isZero())return this.abs();var It=this.clone(),Ot=vt.clone();It.negative=0,Ot.negative=0;for(var Wt=0;It.isEven()&&Ot.isEven();Wt++)It.iushrn(1),Ot.iushrn(1);do{for(;It.isEven();)It.iushrn(1);for(;Ot.isEven();)Ot.iushrn(1);var zt=It.cmp(Ot);if(zt<0){var Ft=It;It=Ot,Ot=Ft}else if(zt===0||Ot.cmpn(1)===0)break;It.isub(Ot)}while(!0);return Ot.iushln(Wt)},ot.prototype.invm=function(vt){return this.egcd(vt).a.umod(vt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(vt){return this.words[0]&vt},ot.prototype.bincn=function(vt){rt(typeof vt=="number");var It=vt%26,Ot=(vt-It)/26,Wt=1<>>26,Nt&=67108863,this.words[Ft]=Nt}return zt!==0&&(this.words[Ft]=zt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(vt){var It=vt<0;if(this.negative!==0&&!It)return-1;if(this.negative===0&&It)return 1;this._strip();var Ot;if(this.length>1)Ot=1;else{It&&(vt=-vt),rt(vt<=67108863,"Number is too big");var Wt=this.words[0]|0;Ot=Wt===vt?0:Wtvt.length)return 1;if(this.length=0;Ot--){var Wt=this.words[Ot]|0,zt=vt.words[Ot]|0;if(Wt!==zt){Wtzt&&(It=1);break}}return It},ot.prototype.gtn=function(vt){return this.cmpn(vt)===1},ot.prototype.gt=function(vt){return this.cmp(vt)===1},ot.prototype.gten=function(vt){return this.cmpn(vt)>=0},ot.prototype.gte=function(vt){return this.cmp(vt)>=0},ot.prototype.ltn=function(vt){return this.cmpn(vt)===-1},ot.prototype.lt=function(vt){return this.cmp(vt)===-1},ot.prototype.lten=function(vt){return this.cmpn(vt)<=0},ot.prototype.lte=function(vt){return this.cmp(vt)<=0},ot.prototype.eqn=function(vt){return this.cmpn(vt)===0},ot.prototype.eq=function(vt){return this.cmp(vt)===0},ot.red=function(vt){return new jt(vt)},ot.prototype.toRed=function(vt){return rt(!this.red,"Already a number in reduction context"),rt(this.negative===0,"red works only with positives"),vt.convertTo(this)._forceRed(vt)},ot.prototype.fromRed=function(){return rt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(vt){return this.red=vt,this},ot.prototype.forceRed=function(vt){return rt(!this.red,"Already a number in reduction context"),this._forceRed(vt)},ot.prototype.redAdd=function(vt){return rt(this.red,"redAdd works only with red numbers"),this.red.add(this,vt)},ot.prototype.redIAdd=function(vt){return rt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,vt)},ot.prototype.redSub=function(vt){return rt(this.red,"redSub works only with red numbers"),this.red.sub(this,vt)},ot.prototype.redISub=function(vt){return rt(this.red,"redISub works only with red numbers"),this.red.isub(this,vt)},ot.prototype.redShl=function(vt){return rt(this.red,"redShl works only with red numbers"),this.red.shl(this,vt)},ot.prototype.redMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.mul(this,vt)},ot.prototype.redIMul=function(vt){return rt(this.red,"redMul works only with red numbers"),this.red._verify2(this,vt),this.red.imul(this,vt)},ot.prototype.redSqr=function(){return rt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return rt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return rt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return rt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return rt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(vt){return rt(this.red&&!vt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,vt)};var St={k256:null,p224:null,p192:null,p25519:null};function Tt($t,vt){this.name=$t,this.p=new ot(vt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tt.prototype._tmp=function(){var vt=new ot(null);return vt.words=new Array(Math.ceil(this.n/13)),vt},Tt.prototype.ireduce=function(vt){var It=vt,Ot;do this.split(It,this.tmp),It=this.imulK(It),It=It.iadd(this.tmp),Ot=It.bitLength();while(Ot>this.n);var Wt=Ot0?It.isub(this.p):It.strip!==void 0?It.strip():It._strip(),It},Tt.prototype.split=function(vt,It){vt.iushrn(this.n,0,It)},Tt.prototype.imulK=function(vt){return vt.imul(this.k)};function At(){Tt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}it(At,Tt),At.prototype.split=function(vt,It){for(var Ot=4194303,Wt=Math.min(vt.length,9),zt=0;zt>>22,Ft=Nt}Ft>>>=22,vt.words[zt-10]=Ft,Ft===0&&vt.length>10?vt.length-=10:vt.length-=9},At.prototype.imulK=function(vt){vt.words[vt.length]=0,vt.words[vt.length+1]=0,vt.length+=2;for(var It=0,Ot=0;Ot>>=26,vt.words[Ot]=zt,It=Wt}return It!==0&&(vt.words[vt.length++]=It),vt},ot._prime=function(vt){if(St[vt])return St[vt];var It;if(vt==="k256")It=new At;else if(vt==="p224")It=new Et;else if(vt==="p192")It=new Ct;else if(vt==="p25519")It=new Lt;else throw new Error("Unknown prime "+vt);return St[vt]=It,It};function jt($t){if(typeof $t=="string"){var vt=ot._prime($t);this.m=vt.p,this.prime=vt}else rt($t.gtn(1),"modulus must be greater than 1"),this.m=$t,this.prime=null}jt.prototype._verify1=function(vt){rt(vt.negative===0,"red works only with positives"),rt(vt.red,"red works only with red numbers")},jt.prototype._verify2=function(vt,It){rt((vt.negative|It.negative)===0,"red works only with positives"),rt(vt.red&&vt.red===It.red,"red works only with red numbers")},jt.prototype.imod=function(vt){return this.prime?this.prime.ireduce(vt)._forceRed(this):(ut(vt,vt.umod(this.m)._forceRed(this)),vt)},jt.prototype.neg=function(vt){return vt.isZero()?vt.clone():this.m.sub(vt)._forceRed(this)},jt.prototype.add=function(vt,It){this._verify2(vt,It);var Ot=vt.add(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot._forceRed(this)},jt.prototype.iadd=function(vt,It){this._verify2(vt,It);var Ot=vt.iadd(It);return Ot.cmp(this.m)>=0&&Ot.isub(this.m),Ot},jt.prototype.sub=function(vt,It){this._verify2(vt,It);var Ot=vt.sub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot._forceRed(this)},jt.prototype.isub=function(vt,It){this._verify2(vt,It);var Ot=vt.isub(It);return Ot.cmpn(0)<0&&Ot.iadd(this.m),Ot},jt.prototype.shl=function(vt,It){return this._verify1(vt),this.imod(vt.ushln(It))},jt.prototype.imul=function(vt,It){return this._verify2(vt,It),this.imod(vt.imul(It))},jt.prototype.mul=function(vt,It){return this._verify2(vt,It),this.imod(vt.mul(It))},jt.prototype.isqr=function(vt){return this.imul(vt,vt.clone())},jt.prototype.sqr=function(vt){return this.mul(vt,vt)},jt.prototype.sqrt=function(vt){if(vt.isZero())return vt.clone();var It=this.m.andln(3);if(rt(It%2===1),It===3){var Ot=this.m.add(new ot(1)).iushrn(2);return this.pow(vt,Ot)}for(var Wt=this.m.subn(1),zt=0;!Wt.isZero()&&Wt.andln(1)===0;)zt++,Wt.iushrn(1);rt(!Wt.isZero());var Ft=new ot(1).toRed(this),Nt=Ft.redNeg(),Ut=this.m.subn(1).iushrn(1),Pt=this.m.bitLength();for(Pt=new ot(2*Pt*Pt).toRed(this);this.pow(Pt,Ut).cmp(Nt)!==0;)Pt.redIAdd(Nt);for(var Ht=this.pow(Pt,Wt),Qt=this.pow(vt,Wt.addn(1).iushrn(1)),an=this.pow(vt,Wt),Yt=zt;an.cmp(Ft)!==0;){for(var nn=an,tn=0;nn.cmp(Ft)!==0;tn++)nn=nn.redSqr();rt(tn=0;zt--){for(var Ht=It.words[zt],Qt=Pt-1;Qt>=0;Qt--){var an=Ht>>Qt&1;if(Ft!==Wt[0]&&(Ft=this.sqr(Ft)),an===0&&Nt===0){Ut=0;continue}Nt<<=1,Nt|=an,Ut++,!(Ut!==Ot&&(zt!==0||Qt!==0))&&(Ft=this.mul(Ft,Wt[Nt]),Ut=0,Nt=0)}Pt=26}return Ft},jt.prototype.convertTo=function(vt){var It=vt.umod(this.m);return It===vt?It.clone():It},jt.prototype.convertFrom=function(vt){var It=vt.clone();return It.red=null,It},ot.mont=function(vt){return new Rt(vt)};function Rt($t){jt.call(this,$t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it(Rt,jt),Rt.prototype.convertTo=function(vt){return this.imod(vt.ushln(this.shift))},Rt.prototype.convertFrom=function(vt){var It=this.imod(vt.mul(this.rinv));return It.red=null,It},Rt.prototype.imul=function(vt,It){if(vt.isZero()||It.isZero())return vt.words[0]=0,vt.length=1,vt;var Ot=vt.imul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.mul=function(vt,It){if(vt.isZero()||It.isZero())return new ot(0)._forceRed(this);var Ot=vt.mul(It),Wt=Ot.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),zt=Ot.isub(Wt).iushrn(this.shift),Ft=zt;return zt.cmp(this.m)>=0?Ft=zt.isub(this.m):zt.cmpn(0)<0&&(Ft=zt.iadd(this.m)),Ft._forceRed(this)},Rt.prototype.invm=function(vt){var It=this.imod(vt._invmp(this.m).mul(this.r2));return It._forceRed(this)}})(tt,commonjsGlobal)})(bn);var bnExports=bn.exports,asn1$3={},asn1$2={},api$1={},encoders={},buffer$1=buffer$2,Buffer$d=buffer$1.Buffer,safer={},key;for(key in buffer$1)buffer$1.hasOwnProperty(key)&&(key==="SlowBuffer"||key==="Buffer"||(safer[key]=buffer$1[key]));var Safer=safer.Buffer={};for(key in Buffer$d)Buffer$d.hasOwnProperty(key)&&(key==="allocUnsafe"||key==="allocUnsafeSlow"||(Safer[key]=Buffer$d[key]));safer.Buffer.prototype=Buffer$d.prototype;(!Safer.from||Safer.from===Uint8Array.from)&&(Safer.from=function(tt,et,nt){if(typeof tt=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof tt);if(tt&&typeof tt.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof tt);return Buffer$d(tt,et,nt)});Safer.alloc||(Safer.alloc=function(tt,et,nt){if(typeof tt!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof tt);if(tt<0||tt>=2*(1<<30))throw new RangeError('The value "'+tt+'" is invalid for option "size"');var rt=Buffer$d(tt);return!et||et.length===0?rt.fill(0):typeof nt=="string"?rt.fill(et,nt):rt.fill(et),rt});if(!safer.kStringMaxLength)try{safer.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}safer.constants||(safer.constants={MAX_LENGTH:safer.kMaxLength},safer.kStringMaxLength&&(safer.constants.MAX_STRING_LENGTH=safer.kStringMaxLength));var safer_1=safer,reporter={};const inherits$5=inherits_browserExports;function Reporter$2(tt){this._reporterState={obj:null,path:[],options:tt||{},errors:[]}}reporter.Reporter=Reporter$2;Reporter$2.prototype.isError=function(et){return et instanceof ReporterError};Reporter$2.prototype.save=function(){const et=this._reporterState;return{obj:et.obj,pathLen:et.path.length}};Reporter$2.prototype.restore=function(et){const nt=this._reporterState;nt.obj=et.obj,nt.path=nt.path.slice(0,et.pathLen)};Reporter$2.prototype.enterKey=function(et){return this._reporterState.path.push(et)};Reporter$2.prototype.exitKey=function(et){const nt=this._reporterState;nt.path=nt.path.slice(0,et-1)};Reporter$2.prototype.leaveKey=function(et,nt,rt){const it=this._reporterState;this.exitKey(et),it.obj!==null&&(it.obj[nt]=rt)};Reporter$2.prototype.path=function(){return this._reporterState.path.join("/")};Reporter$2.prototype.enterObject=function(){const et=this._reporterState,nt=et.obj;return et.obj={},nt};Reporter$2.prototype.leaveObject=function(et){const nt=this._reporterState,rt=nt.obj;return nt.obj=et,rt};Reporter$2.prototype.error=function(et){let nt;const rt=this._reporterState,it=et instanceof ReporterError;if(it?nt=et:nt=new ReporterError(rt.path.map(function(ot){return"["+JSON.stringify(ot)+"]"}).join(""),et.message||et,et.stack),!rt.options.partial)throw nt;return it||rt.errors.push(nt),nt};Reporter$2.prototype.wrapResult=function(et){const nt=this._reporterState;return nt.options.partial?{result:this.isError(et)?null:et,errors:nt.errors}:et};function ReporterError(tt,et){this.path=tt,this.rethrow(et)}inherits$5(ReporterError,Error);ReporterError.prototype.rethrow=function(et){if(this.message=et+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(nt){this.stack=nt.stack}return this};var buffer={};const inherits$4=inherits_browserExports,Reporter$1=reporter.Reporter,Buffer$c=safer_1.Buffer;function DecoderBuffer$2(tt,et){if(Reporter$1.call(this,et),!Buffer$c.isBuffer(tt)){this.error("Input not Buffer");return}this.base=tt,this.offset=0,this.length=tt.length}inherits$4(DecoderBuffer$2,Reporter$1);buffer.DecoderBuffer=DecoderBuffer$2;DecoderBuffer$2.isDecoderBuffer=function(et){return et instanceof DecoderBuffer$2?!0:typeof et=="object"&&Buffer$c.isBuffer(et.base)&&et.constructor.name==="DecoderBuffer"&&typeof et.offset=="number"&&typeof et.length=="number"&&typeof et.save=="function"&&typeof et.restore=="function"&&typeof et.isEmpty=="function"&&typeof et.readUInt8=="function"&&typeof et.skip=="function"&&typeof et.raw=="function"};DecoderBuffer$2.prototype.save=function(){return{offset:this.offset,reporter:Reporter$1.prototype.save.call(this)}};DecoderBuffer$2.prototype.restore=function(et){const nt=new DecoderBuffer$2(this.base);return nt.offset=et.offset,nt.length=this.offset,this.offset=et.offset,Reporter$1.prototype.restore.call(this,et.reporter),nt};DecoderBuffer$2.prototype.isEmpty=function(){return this.offset===this.length};DecoderBuffer$2.prototype.readUInt8=function(et){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(et||"DecoderBuffer overrun")};DecoderBuffer$2.prototype.skip=function(et,nt){if(!(this.offset+et<=this.length))return this.error(nt||"DecoderBuffer overrun");const rt=new DecoderBuffer$2(this.base);return rt._reporterState=this._reporterState,rt.offset=this.offset,rt.length=this.offset+et,this.offset+=et,rt};DecoderBuffer$2.prototype.raw=function(et){return this.base.slice(et?et.offset:this.offset,this.length)};function EncoderBuffer$1(tt,et){if(Array.isArray(tt))this.length=0,this.value=tt.map(function(nt){return EncoderBuffer$1.isEncoderBuffer(nt)||(nt=new EncoderBuffer$1(nt,et)),this.length+=nt.length,nt},this);else if(typeof tt=="number"){if(!(0<=tt&&tt<=255))return et.error("non-byte EncoderBuffer value");this.value=tt,this.length=1}else if(typeof tt=="string")this.value=tt,this.length=Buffer$c.byteLength(tt);else if(Buffer$c.isBuffer(tt))this.value=tt,this.length=tt.length;else return et.error("Unsupported type: "+typeof tt)}buffer.EncoderBuffer=EncoderBuffer$1;EncoderBuffer$1.isEncoderBuffer=function(et){return et instanceof EncoderBuffer$1?!0:typeof et=="object"&&et.constructor.name==="EncoderBuffer"&&typeof et.length=="number"&&typeof et.join=="function"};EncoderBuffer$1.prototype.join=function(et,nt){return et||(et=Buffer$c.alloc(this.length)),nt||(nt=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(rt){rt.join(et,nt),nt+=rt.length}):(typeof this.value=="number"?et[nt]=this.value:typeof this.value=="string"?et.write(this.value,nt):Buffer$c.isBuffer(this.value)&&this.value.copy(et,nt),nt+=this.length)),et};const Reporter=reporter.Reporter,EncoderBuffer=buffer.EncoderBuffer,DecoderBuffer$1=buffer.DecoderBuffer,assert$5=minimalisticAssert,tags$1=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags$1),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node$3(tt,et,nt){const rt={};this._baseState=rt,rt.name=nt,rt.enc=tt,rt.parent=et||null,rt.children=null,rt.tag=null,rt.args=null,rt.reverseArgs=null,rt.choice=null,rt.optional=!1,rt.any=!1,rt.obj=!1,rt.use=null,rt.useDecoder=null,rt.key=null,rt.default=null,rt.explicit=null,rt.implicit=null,rt.contains=null,rt.parent||(rt.children=[],this._wrap())}var node$2=Node$3;const stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node$3.prototype.clone=function(){const et=this._baseState,nt={};stateProps.forEach(function(it){nt[it]=et[it]});const rt=new this.constructor(nt.parent);return rt._baseState=nt,rt};Node$3.prototype._wrap=function(){const et=this._baseState;methods.forEach(function(nt){this[nt]=function(){const it=new this.constructor(this);return et.children.push(it),it[nt].apply(it,arguments)}},this)};Node$3.prototype._init=function(et){const nt=this._baseState;assert$5(nt.parent===null),et.call(this),nt.children=nt.children.filter(function(rt){return rt._baseState.parent===this},this),assert$5.equal(nt.children.length,1,"Root node can have only one child")};Node$3.prototype._useArgs=function(et){const nt=this._baseState,rt=et.filter(function(it){return it instanceof this.constructor},this);et=et.filter(function(it){return!(it instanceof this.constructor)},this),rt.length!==0&&(assert$5(nt.children===null),nt.children=rt,rt.forEach(function(it){it._baseState.parent=this},this)),et.length!==0&&(assert$5(nt.args===null),nt.args=et,nt.reverseArgs=et.map(function(it){if(typeof it!="object"||it.constructor!==Object)return it;const ot={};return Object.keys(it).forEach(function(at){at==(at|0)&&(at|=0);const st=it[at];ot[st]=at}),ot}))};overrided.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState;throw new Error(tt+" not implemented for encoding: "+nt.enc)}});tags$1.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState,rt=Array.prototype.slice.call(arguments);return assert$5(nt.tag===null),nt.tag=tt,this._useArgs(rt),this}});Node$3.prototype.use=function(et){assert$5(et);const nt=this._baseState;return assert$5(nt.use===null),nt.use=et,this};Node$3.prototype.optional=function(){const et=this._baseState;return et.optional=!0,this};Node$3.prototype.def=function(et){const nt=this._baseState;return assert$5(nt.default===null),nt.default=et,nt.optional=!0,this};Node$3.prototype.explicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.explicit=et,this};Node$3.prototype.implicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.implicit=et,this};Node$3.prototype.obj=function(){const et=this._baseState,nt=Array.prototype.slice.call(arguments);return et.obj=!0,nt.length!==0&&this._useArgs(nt),this};Node$3.prototype.key=function(et){const nt=this._baseState;return assert$5(nt.key===null),nt.key=et,this};Node$3.prototype.any=function(){const et=this._baseState;return et.any=!0,this};Node$3.prototype.choice=function(et){const nt=this._baseState;return assert$5(nt.choice===null),nt.choice=et,this._useArgs(Object.keys(et).map(function(rt){return et[rt]})),this};Node$3.prototype.contains=function(et){const nt=this._baseState;return assert$5(nt.use===null),nt.contains=et,this};Node$3.prototype._decode=function(et,nt){const rt=this._baseState;if(rt.parent===null)return et.wrapResult(rt.children[0]._decode(et,nt));let it=rt.default,ot=!0,at=null;if(rt.key!==null&&(at=et.enterKey(rt.key)),rt.optional){let lt=null;if(rt.explicit!==null?lt=rt.explicit:rt.implicit!==null?lt=rt.implicit:rt.tag!==null&&(lt=rt.tag),lt===null&&!rt.any){const ct=et.save();try{rt.choice===null?this._decodeGeneric(rt.tag,et,nt):this._decodeChoice(et,nt),ot=!0}catch{ot=!1}et.restore(ct)}else if(ot=this._peekTag(et,lt,rt.any),et.isError(ot))return ot}let st;if(rt.obj&&ot&&(st=et.enterObject()),ot){if(rt.explicit!==null){const ct=this._decodeTag(et,rt.explicit);if(et.isError(ct))return ct;et=ct}const lt=et.offset;if(rt.use===null&&rt.choice===null){let ct;rt.any&&(ct=et.save());const ut=this._decodeTag(et,rt.implicit!==null?rt.implicit:rt.tag,rt.any);if(et.isError(ut))return ut;rt.any?it=et.raw(ct):et=ut}if(nt&&nt.track&&rt.tag!==null&&nt.track(et.path(),lt,et.length,"tagged"),nt&&nt.track&&rt.tag!==null&&nt.track(et.path(),et.offset,et.length,"content"),rt.any||(rt.choice===null?it=this._decodeGeneric(rt.tag,et,nt):it=this._decodeChoice(et,nt)),et.isError(it))return it;if(!rt.any&&rt.choice===null&&rt.children!==null&&rt.children.forEach(function(ut){ut._decode(et,nt)}),rt.contains&&(rt.tag==="octstr"||rt.tag==="bitstr")){const ct=new DecoderBuffer$1(it);it=this._getUse(rt.contains,et._reporterState.obj)._decode(ct,nt)}}return rt.obj&&ot&&(it=et.leaveObject(st)),rt.key!==null&&(it!==null||ot===!0)?et.leaveKey(at,rt.key,it):at!==null&&et.exitKey(at),it};Node$3.prototype._decodeGeneric=function(et,nt,rt){const it=this._baseState;return et==="seq"||et==="set"?null:et==="seqof"||et==="setof"?this._decodeList(nt,et,it.args[0],rt):/str$/.test(et)?this._decodeStr(nt,et,rt):et==="objid"&&it.args?this._decodeObjid(nt,it.args[0],it.args[1],rt):et==="objid"?this._decodeObjid(nt,null,null,rt):et==="gentime"||et==="utctime"?this._decodeTime(nt,et,rt):et==="null_"?this._decodeNull(nt,rt):et==="bool"?this._decodeBool(nt,rt):et==="objDesc"?this._decodeStr(nt,et,rt):et==="int"||et==="enum"?this._decodeInt(nt,it.args&&it.args[0],rt):it.use!==null?this._getUse(it.use,nt._reporterState.obj)._decode(nt,rt):nt.error("unknown tag: "+et)};Node$3.prototype._getUse=function(et,nt){const rt=this._baseState;return rt.useDecoder=this._use(et,nt),assert$5(rt.useDecoder._baseState.parent===null),rt.useDecoder=rt.useDecoder._baseState.children[0],rt.implicit!==rt.useDecoder._baseState.implicit&&(rt.useDecoder=rt.useDecoder.clone(),rt.useDecoder._baseState.implicit=rt.implicit),rt.useDecoder};Node$3.prototype._decodeChoice=function(et,nt){const rt=this._baseState;let it=null,ot=!1;return Object.keys(rt.choice).some(function(at){const st=et.save(),lt=rt.choice[at];try{const ct=lt._decode(et,nt);if(et.isError(ct))return!1;it={type:at,value:ct},ot=!0}catch{return et.restore(st),!1}return!0},this),ot?it:et.error("Choice not matched")};Node$3.prototype._createEncoderBuffer=function(et){return new EncoderBuffer(et,this.reporter)};Node$3.prototype._encode=function(et,nt,rt){const it=this._baseState;if(it.default!==null&&it.default===et)return;const ot=this._encodeValue(et,nt,rt);if(ot!==void 0&&!this._skipDefault(ot,nt,rt))return ot};Node$3.prototype._encodeValue=function(et,nt,rt){const it=this._baseState;if(it.parent===null)return it.children[0]._encode(et,nt||new Reporter);let ot=null;if(this.reporter=nt,it.optional&&et===void 0)if(it.default!==null)et=it.default;else return;let at=null,st=!1;if(it.any)ot=this._createEncoderBuffer(et);else if(it.choice)ot=this._encodeChoice(et,nt);else if(it.contains)at=this._getUse(it.contains,rt)._encode(et,nt),st=!0;else if(it.children)at=it.children.map(function(lt){if(lt._baseState.tag==="null_")return lt._encode(null,nt,et);if(lt._baseState.key===null)return nt.error("Child should have a key");const ct=nt.enterKey(lt._baseState.key);if(typeof et!="object")return nt.error("Child expected, but input is not object");const ut=lt._encode(et[lt._baseState.key],nt,et);return nt.leaveKey(ct),ut},this).filter(function(lt){return lt}),at=this._createEncoderBuffer(at);else if(it.tag==="seqof"||it.tag==="setof"){if(!(it.args&&it.args.length===1))return nt.error("Too many args for : "+it.tag);if(!Array.isArray(et))return nt.error("seqof/setof, but data is not Array");const lt=this.clone();lt._baseState.implicit=null,at=this._createEncoderBuffer(et.map(function(ct){const ut=this._baseState;return this._getUse(ut.args[0],et)._encode(ct,nt)},lt))}else it.use!==null?ot=this._getUse(it.use,rt)._encode(et,nt):(at=this._encodePrimitive(it.tag,et),st=!0);if(!it.any&&it.choice===null){const lt=it.implicit!==null?it.implicit:it.tag,ct=it.implicit===null?"universal":"context";lt===null?it.use===null&&nt.error("Tag could be omitted only for .use()"):it.use===null&&(ot=this._encodeComposite(lt,st,ct,at))}return it.explicit!==null&&(ot=this._encodeComposite(it.explicit,!1,"context",ot)),ot};Node$3.prototype._encodeChoice=function(et,nt){const rt=this._baseState,it=rt.choice[et.type];return it||assert$5(!1,et.type+" not found in "+JSON.stringify(Object.keys(rt.choice))),it._encode(et.value,nt)};Node$3.prototype._encodePrimitive=function(et,nt){const rt=this._baseState;if(/str$/.test(et))return this._encodeStr(nt,et);if(et==="objid"&&rt.args)return this._encodeObjid(nt,rt.reverseArgs[0],rt.args[1]);if(et==="objid")return this._encodeObjid(nt,null,null);if(et==="gentime"||et==="utctime")return this._encodeTime(nt,et);if(et==="null_")return this._encodeNull();if(et==="int"||et==="enum")return this._encodeInt(nt,rt.args&&rt.reverseArgs[0]);if(et==="bool")return this._encodeBool(nt);if(et==="objDesc")return this._encodeStr(nt,et);throw new Error("Unsupported tag: "+et)};Node$3.prototype._isNumstr=function(et){return/^[0-9 ]*$/.test(et)};Node$3.prototype._isPrintstr=function(et){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(et)};var der$2={};(function(tt){function et(nt){const rt={};return Object.keys(nt).forEach(function(it){(it|0)==it&&(it=it|0);const ot=nt[it];rt[ot]=it}),rt}tt.tagClass={0:"universal",1:"application",2:"context",3:"private"},tt.tagClassByName=et(tt.tagClass),tt.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},tt.tagByName=et(tt.tag)})(der$2);const inherits$3=inherits_browserExports,Buffer$b=safer_1.Buffer,Node$2=node$2,der$1=der$2;function DEREncoder$1(tt){this.enc="der",this.name=tt.name,this.entity=tt,this.tree=new DERNode$1,this.tree._init(tt.body)}var der_1$1=DEREncoder$1;DEREncoder$1.prototype.encode=function(et,nt){return this.tree._encode(et,nt).join()};function DERNode$1(tt){Node$2.call(this,"der",tt)}inherits$3(DERNode$1,Node$2);DERNode$1.prototype._encodeComposite=function(et,nt,rt,it){const ot=encodeTag(et,nt,rt,this.reporter);if(it.length<128){const lt=Buffer$b.alloc(2);return lt[0]=ot,lt[1]=it.length,this._createEncoderBuffer([lt,it])}let at=1;for(let lt=it.length;lt>=256;lt>>=8)at++;const st=Buffer$b.alloc(1+1+at);st[0]=ot,st[1]=128|at;for(let lt=1+at,ct=it.length;ct>0;lt--,ct>>=8)st[lt]=ct&255;return this._createEncoderBuffer([st,it])};DERNode$1.prototype._encodeStr=function(et,nt){if(nt==="bitstr")return this._createEncoderBuffer([et.unused|0,et.data]);if(nt==="bmpstr"){const rt=Buffer$b.alloc(et.length*2);for(let it=0;it=40)return this.reporter.error("Second objid identifier OOB");et.splice(0,2,et[0]*40+et[1])}let it=0;for(let st=0;st=128;lt>>=7)it++}const ot=Buffer$b.alloc(it);let at=ot.length-1;for(let st=et.length-1;st>=0;st--){let lt=et[st];for(ot[at--]=lt&127;(lt>>=7)>0;)ot[at--]=128|lt&127}return this._createEncoderBuffer(ot)};function two(tt){return tt<10?"0"+tt:tt}DERNode$1.prototype._encodeTime=function(et,nt){let rt;const it=new Date(et);return nt==="gentime"?rt=[two(it.getUTCFullYear()),two(it.getUTCMonth()+1),two(it.getUTCDate()),two(it.getUTCHours()),two(it.getUTCMinutes()),two(it.getUTCSeconds()),"Z"].join(""):nt==="utctime"?rt=[two(it.getUTCFullYear()%100),two(it.getUTCMonth()+1),two(it.getUTCDate()),two(it.getUTCHours()),two(it.getUTCMinutes()),two(it.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+nt+" time is not supported yet"),this._encodeStr(rt,"octstr")};DERNode$1.prototype._encodeNull=function(){return this._createEncoderBuffer("")};DERNode$1.prototype._encodeInt=function(et,nt){if(typeof et=="string"){if(!nt)return this.reporter.error("String int or enum given, but no values map");if(!nt.hasOwnProperty(et))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(et));et=nt[et]}if(typeof et!="number"&&!Buffer$b.isBuffer(et)){const ot=et.toArray();!et.sign&&ot[0]&128&&ot.unshift(0),et=Buffer$b.from(ot)}if(Buffer$b.isBuffer(et)){let ot=et.length;et.length===0&&ot++;const at=Buffer$b.alloc(ot);return et.copy(at),et.length===0&&(at[0]=0),this._createEncoderBuffer(at)}if(et<128)return this._createEncoderBuffer(et);if(et<256)return this._createEncoderBuffer([0,et]);let rt=1;for(let ot=et;ot>=256;ot>>=8)rt++;const it=new Array(rt);for(let ot=it.length-1;ot>=0;ot--)it[ot]=et&255,et>>=8;return it[0]&128&&it.unshift(0),this._createEncoderBuffer(Buffer$b.from(it))};DERNode$1.prototype._encodeBool=function(et){return this._createEncoderBuffer(et?255:0)};DERNode$1.prototype._use=function(et,nt){return typeof et=="function"&&(et=et(nt)),et._getEncoder("der").tree};DERNode$1.prototype._skipDefault=function(et,nt,rt){const it=this._baseState;let ot;if(it.default===null)return!1;const at=et.join();if(it.defaultBuffer===void 0&&(it.defaultBuffer=this._encodeValue(it.default,nt,rt).join()),at.length!==it.defaultBuffer.length)return!1;for(ot=0;ot=31?rt.error("Multi-octet tag encoding unsupported"):(et||(it|=32),it|=der$1.tagClassByName[nt||"universal"]<<6,it)}const inherits$2=inherits_browserExports,DEREncoder=der_1$1;function PEMEncoder(tt){DEREncoder.call(this,tt),this.enc="pem"}inherits$2(PEMEncoder,DEREncoder);var pem$1=PEMEncoder;PEMEncoder.prototype.encode=function(et,nt){const it=DEREncoder.prototype.encode.call(this,et).toString("base64"),ot=["-----BEGIN "+nt.label+"-----"];for(let at=0;at>6],it=(nt&32)===0;if((nt&31)===31){let at=nt;for(nt=0;(at&128)===128;){if(at=tt.readUInt8(et),tt.isError(at))return at;nt<<=7,nt|=at&127}}else nt&=31;const ot=der.tag[nt];return{cls:rt,primitive:it,tag:nt,tagStr:ot}}function derDecodeLen(tt,et,nt){let rt=tt.readUInt8(nt);if(tt.isError(rt))return rt;if(!et&&rt===128)return null;if(!(rt&128))return rt;const it=rt&127;if(it>4)return tt.error("length octect is too long");rt=0;for(let ot=0;ot0&&xt.ishrn(kt),xt}function mt(bt,wt){bt=pt(bt,wt),bt=bt.mod(wt);var xt=tt.from(bt.toArray());if(xt.length=0)throw new Error("invalid sig")}return verify_1=ot,verify_1}var browser$3,hasRequiredBrowser$1;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$3;hasRequiredBrowser$1=1;var tt=safeBufferExports.Buffer,et=browser$9,nt=readableBrowserExports,rt=inherits_browserExports,it=requireSign(),ot=requireVerify(),at=require$$6;Object.keys(at).forEach(function(ht){at[ht].id=tt.from(at[ht].id,"hex"),at[ht.toLowerCase()]=at[ht]});function st(ht){nt.Writable.call(this);var dt=at[ht];if(!dt)throw new Error("Unknown message digest");this._hashType=dt.hash,this._hash=et(dt.hash),this._tag=dt.id,this._signType=dt.sign}rt(st,nt.Writable),st.prototype._write=function(dt,pt,mt){this._hash.update(dt),mt()},st.prototype.update=function(dt,pt){return this._hash.update(typeof dt=="string"?tt.from(dt,pt):dt),this},st.prototype.sign=function(dt,pt){this.end();var mt=this._hash.digest(),gt=it(mt,dt,this._hashType,this._signType,this._tag);return pt?gt.toString(pt):gt};function lt(ht){nt.Writable.call(this);var dt=at[ht];if(!dt)throw new Error("Unknown message digest");this._hash=et(dt.hash),this._tag=dt.id,this._signType=dt.sign}rt(lt,nt.Writable),lt.prototype._write=function(dt,pt,mt){this._hash.update(dt),mt()},lt.prototype.update=function(dt,pt){return this._hash.update(typeof dt=="string"?tt.from(dt,pt):dt),this},lt.prototype.verify=function(dt,pt,mt){var gt=typeof pt=="string"?tt.from(pt,mt):pt;this.end();var yt=this._hash.digest();return ot(gt,yt,dt,this._signType,this._tag)};function ct(ht){return new st(ht)}function ut(ht){return new lt(ht)}return browser$3={Sign:ct,Verify:ut,createSign:ct,createVerify:ut},browser$3}var browser$2,hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser$2;hasRequiredBrowser=1;var tt=requireElliptic(),et=bnExports$2;browser$2=function(at){return new rt(at)};var nt={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};nt.p224=nt.secp224r1,nt.p256=nt.secp256r1=nt.prime256v1,nt.p192=nt.secp192r1=nt.prime192v1,nt.p384=nt.secp384r1,nt.p521=nt.secp521r1;function rt(ot){this.curveType=nt[ot],this.curveType||(this.curveType={name:ot}),this.curve=new tt.ec(this.curveType.name),this.keys=void 0}rt.prototype.generateKeys=function(ot,at){return this.keys=this.curve.genKeyPair(),this.getPublicKey(ot,at)},rt.prototype.computeSecret=function(ot,at,st){at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at));var lt=this.curve.keyFromPublic(ot).getPublic(),ct=lt.mul(this.keys.getPrivate()).getX();return it(ct,st,this.curveType.byteLength)},rt.prototype.getPublicKey=function(ot,at){var st=this.keys.getPublic(at==="compressed",!0);return at==="hybrid"&&(st[st.length-1]%2?st[0]=7:st[0]=6),it(st,ot)},rt.prototype.getPrivateKey=function(ot){return it(this.keys.getPrivate(),ot)},rt.prototype.setPublicKey=function(ot,at){return at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at)),this.keys._importPublic(ot),this},rt.prototype.setPrivateKey=function(ot,at){at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at));var st=new et(ot);return st=st.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(st),this};function it(ot,at,st){Array.isArray(ot)||(ot=ot.toArray());var lt=new Buffer(ot);if(st&<.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return rt?crt$1(at,ot):withPublic$1(at,ot)};function oaep$1(tt,et){var nt=tt.modulus.byteLength(),rt=et.length,it=createHash$2("sha1").update(Buffer$5.alloc(0)).digest(),ot=it.length,at=2*ot;if(rt>nt-at-2)throw new Error("message too long");var st=Buffer$5.alloc(nt-rt-at-2),lt=nt-ot-1,ct=randomBytes(ot),ut=xor$1(Buffer$5.concat([it,st,Buffer$5.alloc(1,1),et],lt),mgf$1(ct,lt)),ht=xor$1(ct,mgf$1(ut,ot));return new BN$3(Buffer$5.concat([Buffer$5.alloc(1),ht,ut],nt))}function pkcs1$1(tt,et,nt){var rt=et.length,it=tt.modulus.byteLength();if(rt>it-11)throw new Error("message too long");var ot;return nt?ot=Buffer$5.alloc(it-rt-3,255):ot=nonZero(it-rt-3),new BN$3(Buffer$5.concat([Buffer$5.from([0,nt?1:2]),ot,Buffer$5.alloc(1),et],it))}function nonZero(tt){for(var et=Buffer$5.allocUnsafe(tt),nt=0,rt=randomBytes(tt*2),it=0,ot;ntat||new BN$2(nt).cmp(ot.modulus)>=0)throw new Error("decryption error");var st;rt?st=withPublic(new BN$2(nt),ot):st=crt(nt,ot);var lt=Buffer$4.alloc(at-st.length);if(st=Buffer$4.concat([lt,st],at),it===4)return oaep(ot,st);if(it===1)return pkcs1(ot,st,rt);if(it===3)return st;throw new Error("unknown padding")};function oaep(tt,et){var nt=tt.modulus.byteLength(),rt=createHash$1("sha1").update(Buffer$4.alloc(0)).digest(),it=rt.length;if(et[0]!==0)throw new Error("decryption error");var ot=et.slice(1,it+1),at=et.slice(it+1),st=xor(ot,mgf(at,it)),lt=xor(at,mgf(st,nt-it-1));if(compare$1(rt,lt.slice(0,it)))throw new Error("decryption error");for(var ct=it;lt[ct]===0;)ct++;if(lt[ct++]!==1)throw new Error("decryption error");return lt.slice(ct)}function pkcs1(tt,et,nt){for(var rt=et.slice(0,2),it=2,ot=0;et[it++]!==0;)if(it>=et.length){ot++;break}var at=et.slice(2,it-1);if((rt.toString("hex")!=="0002"&&!nt||rt.toString("hex")!=="0001"&&nt)&&ot++,at.length<8&&ot++,ot)throw new Error("decryption error");return et.slice(it)}function compare$1(tt,et){tt=Buffer$4.from(tt),et=Buffer$4.from(et);var nt=0,rt=tt.length;tt.length!==et.length&&(nt++,rt=Math.min(tt.length,et.length));for(var it=-1;++itkMaxUint32||tt<0)throw new TypeError("offset must be a uint32");if(tt>kBufferMaxLength||tt>et)throw new RangeError("offset out of range")}function assertSize(tt,et,nt){if(typeof tt!="number"||tt!==tt)throw new TypeError("size must be a number");if(tt>kMaxUint32||tt<0)throw new TypeError("size must be a uint32");if(tt+et>nt||tt>kBufferMaxLength)throw new RangeError("buffer too small")}crypto$3&&crypto$3.getRandomValues||!process.browser?(browser.randomFill=randomFill,browser.randomFillSync=randomFillSync):(browser.randomFill=oldBrowser,browser.randomFillSync=oldBrowser);function randomFill(tt,et,nt,rt){if(!Buffer$3.isBuffer(tt)&&!(tt instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof et=="function")rt=et,et=0,nt=tt.length;else if(typeof nt=="function")rt=nt,nt=tt.length-et;else if(typeof rt!="function")throw new TypeError('"cb" argument must be a function');return assertOffset(et,tt.length),assertSize(nt,et,tt.length),actualFill(tt,et,nt,rt)}function actualFill(tt,et,nt,rt){if(process.browser){var it=tt.buffer,ot=new Uint8Array(it,et,nt);if(crypto$3.getRandomValues(ot),rt){process.nextTick(function(){rt(null,tt)});return}return tt}if(rt){randombytes(nt,function(st,lt){if(st)return rt(st);lt.copy(tt,et),rt(null,tt)});return}var at=randombytes(nt);return at.copy(tt,et),tt}function randomFillSync(tt,et,nt){if(typeof et>"u"&&(et=0),!Buffer$3.isBuffer(tt)&&!(tt instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return assertOffset(et,tt.length),nt===void 0&&(nt=tt.length-et),assertSize(nt,et,tt.length),actualFill(tt,et,nt)}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=browserExports,cryptoBrowserify.createHash=cryptoBrowserify.Hash=browser$9,cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=browser$8;var tt=algos,et=Object.keys(tt),nt=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(et);cryptoBrowserify.getHashes=function(){return nt};var rt=browser$7;cryptoBrowserify.pbkdf2=rt.pbkdf2,cryptoBrowserify.pbkdf2Sync=rt.pbkdf2Sync;var it=browser$6;cryptoBrowserify.Cipher=it.Cipher,cryptoBrowserify.createCipher=it.createCipher,cryptoBrowserify.Cipheriv=it.Cipheriv,cryptoBrowserify.createCipheriv=it.createCipheriv,cryptoBrowserify.Decipher=it.Decipher,cryptoBrowserify.createDecipher=it.createDecipher,cryptoBrowserify.Decipheriv=it.Decipheriv,cryptoBrowserify.createDecipheriv=it.createDecipheriv,cryptoBrowserify.getCiphers=it.getCiphers,cryptoBrowserify.listCiphers=it.listCiphers;var ot=requireBrowser$2();cryptoBrowserify.DiffieHellmanGroup=ot.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=ot.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=ot.getDiffieHellman,cryptoBrowserify.createDiffieHellman=ot.createDiffieHellman,cryptoBrowserify.DiffieHellman=ot.DiffieHellman;var at=requireBrowser$1();cryptoBrowserify.createSign=at.createSign,cryptoBrowserify.Sign=at.Sign,cryptoBrowserify.createVerify=at.createVerify,cryptoBrowserify.Verify=at.Verify,cryptoBrowserify.createECDH=requireBrowser();var st=browser$1;cryptoBrowserify.publicEncrypt=st.publicEncrypt,cryptoBrowserify.privateEncrypt=st.privateEncrypt,cryptoBrowserify.publicDecrypt=st.publicDecrypt,cryptoBrowserify.privateDecrypt=st.privateDecrypt;var lt=browser;return cryptoBrowserify.randomFill=lt.randomFill,cryptoBrowserify.randomFillSync=lt.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` -`))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var rngBrowser={exports:{}},getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);rngBrowser.exports=function(){for(var et=0,nt;et<16;et++)et&3||(nt=Math.random()*4294967296),rnds[et]=nt>>>((et&3)<<3)&255;return rnds}}var rngBrowserExports=rngBrowser.exports,byteToHex=[];for(var i$4=0;i$4<256;++i$4)byteToHex[i$4]=(i$4+256).toString(16).substr(1);function bytesToUuid$1(tt,et){var nt=et||0,rt=byteToHex;return[rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]]].join("")}var bytesToUuid_1=bytesToUuid$1,rng=rngBrowserExports,bytesToUuid=bytesToUuid_1;function v4(tt,et,nt){var rt=et&&nt||0;typeof tt=="string"&&(et=tt==="binary"?new Array(16):null,tt=null),tt=tt||{};var it=tt.random||(tt.rng||rng)();if(it[6]=it[6]&15|64,it[8]=it[8]&63|128,et)for(var ot=0;ot<16;++ot)et[rt+ot]=it[ot];return et||bytesToUuid(it)}var v4_1=v4,macaroon$1={},sjcl={exports:{}};(function(tt){var et={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(mt){this.toString=function(){return"CORRUPT: "+this.message},this.message=mt},invalid:function(mt){this.toString=function(){return"INVALID: "+this.message},this.message=mt},bug:function(mt){this.toString=function(){return"BUG: "+this.message},this.message=mt},notReady:function(mt){this.toString=function(){return"NOT READY: "+this.message},this.message=mt}}};et.cipher.aes=function(mt){this.s[0][0][0]||this.O();var gt,yt,bt,wt,xt=this.s[0][4],kt=this.s[1];gt=mt.length;var St=1;if(gt!==4&>!==6&>!==8)throw new et.exception.invalid("invalid aes key size");for(this.b=[bt=mt.slice(0),wt=[]],mt=gt;mt<4*gt+28;mt++)yt=bt[mt-1],(mt%gt===0||gt===8&&mt%gt===4)&&(yt=xt[yt>>>24]<<24^xt[yt>>16&255]<<16^xt[yt>>8&255]<<8^xt[yt&255],mt%gt===0&&(yt=yt<<8^yt>>>24^St<<24,St=St<<1^283*(St>>7))),bt[mt]=bt[mt-gt]^yt;for(gt=0;mt;gt++,mt--)yt=bt[gt&3?mt:mt-4],wt[gt]=4>=mt||4>gt?yt:kt[0][xt[yt>>>24]]^kt[1][xt[yt>>16&255]]^kt[2][xt[yt>>8&255]]^kt[3][xt[yt&255]]},et.cipher.aes.prototype={encrypt:function(mt){return nt(this,mt,0)},decrypt:function(mt){return nt(this,mt,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var mt=this.s[0],gt=this.s[1],yt=mt[4],bt=gt[4],wt,xt,kt,St=[],Tt=[],At,Et,Ct,Lt;for(wt=0;256>wt;wt++)Tt[(St[wt]=wt<<1^283*(wt>>7))^wt]=wt;for(xt=kt=0;!yt[xt];xt^=At||1,kt=Tt[kt]||1)for(Ct=kt^kt<<1^kt<<2^kt<<3^kt<<4,Ct=Ct>>8^Ct&255^99,yt[xt]=Ct,bt[Ct]=xt,Et=St[wt=St[At=St[xt]]],Lt=16843009*Et^65537*wt^257*At^16843008*xt,Et=257*St[Ct]^16843008*Ct,wt=0;4>wt;wt++)mt[wt][xt]=Et=Et<<24^Et>>>8,gt[wt][Ct]=Lt=Lt<<24^Lt>>>8;for(wt=0;5>wt;wt++)mt[wt]=mt[wt].slice(0),gt[wt]=gt[wt].slice(0)}};function nt(mt,gt,yt){if(gt.length!==4)throw new et.exception.invalid("invalid aes block size");var bt=mt.b[yt],wt=gt[0]^bt[0],xt=gt[yt?3:1]^bt[1],kt=gt[2]^bt[2];gt=gt[yt?1:3]^bt[3];var St,Tt,At,Et=bt.length/4-2,Ct,Lt=4,jt=[0,0,0,0];St=mt.s[yt],mt=St[0];var Rt=St[1],$t=St[2],vt=St[3],It=St[4];for(Ct=0;Ct>>24]^Rt[xt>>16&255]^$t[kt>>8&255]^vt[gt&255]^bt[Lt],Tt=mt[xt>>>24]^Rt[kt>>16&255]^$t[gt>>8&255]^vt[wt&255]^bt[Lt+1],At=mt[kt>>>24]^Rt[gt>>16&255]^$t[wt>>8&255]^vt[xt&255]^bt[Lt+2],gt=mt[gt>>>24]^Rt[wt>>16&255]^$t[xt>>8&255]^vt[kt&255]^bt[Lt+3],Lt+=4,wt=St,xt=Tt,kt=At;for(Ct=0;4>Ct;Ct++)jt[yt?3&-Ct:Ct]=It[wt>>>24]<<24^It[xt>>16&255]<<16^It[kt>>8&255]<<8^It[gt&255]^bt[Lt++],St=wt,wt=xt,xt=kt,kt=gt,gt=St;return jt}et.bitArray={bitSlice:function(mt,gt,yt){return mt=et.bitArray.$(mt.slice(gt/32),32-(gt&31)).slice(1),yt===void 0?mt:et.bitArray.clamp(mt,yt-gt)},extract:function(mt,gt,yt){var bt=Math.floor(-gt-yt&31);return((gt+yt-1^gt)&-32?mt[gt/32|0]<<32-bt^mt[gt/32+1|0]>>>bt:mt[gt/32|0]>>>bt)&(1<>gt-1,1)),mt},partial:function(mt,gt,yt){return mt===32?gt:(yt?gt|0:gt<<32-mt)+1099511627776*mt},getPartial:function(mt){return Math.round(mt/1099511627776)||32},equal:function(mt,gt){if(et.bitArray.bitLength(mt)!==et.bitArray.bitLength(gt))return!1;var yt=0,bt;for(bt=0;bt>>gt),yt=mt[wt]<<32-gt;return wt=mt.length?mt[mt.length-1]:0,mt=et.bitArray.getPartial(wt),bt.push(et.bitArray.partial(gt+mt&31,32>>24|yt>>>8&65280|(yt&65280)<<8|yt<<24;return mt}},et.codec.utf8String={fromBits:function(mt){var gt="",yt=et.bitArray.bitLength(mt),bt,wt;for(bt=0;bt>>8>>>8>>>8),wt<<=8;return decodeURIComponent(escape(gt))},toBits:function(mt){mt=unescape(encodeURIComponent(mt));var gt=[],yt,bt=0;for(yt=0;yt>>kt)>>>wt),ktEt){if(!gt)try{return et.codec.base32hex.toBits(mt)}catch{}throw new et.exception.invalid("this isn't "+Ct+"!")}St>wt?(St-=wt,xt.push(At^Et>>>St),At=Et<>>wt)>>>26),6>wt?(kt=mt[yt]<<6-wt,wt+=26,yt++):(kt<<=6,wt-=6);for(;bt.length&3&&!gt;)bt+="=";return bt},toBits:function(mt,gt){mt=mt.replace(/\s|=/g,"");var yt=[],bt,wt=0,xt=et.codec.base64.B,kt=0,St;for(gt&&(xt=xt.substr(0,62)+"-_"),bt=0;btSt)throw new et.exception.invalid("this isn't base64!");26>>wt),kt=St<<32-wt):(wt+=6,kt^=St<<32-wt)}return wt&56&&yt.push(et.bitArray.partial(wt&56,kt,1)),yt}},et.codec.base64url={fromBits:function(mt){return et.codec.base64.fromBits(mt,1,1)},toBits:function(mt){return et.codec.base64.toBits(mt,1)}},et.hash.sha256=function(mt){this.b[0]||this.O(),mt?(this.F=mt.F.slice(0),this.A=mt.A.slice(0),this.l=mt.l):this.reset()},et.hash.sha256.hash=function(mt){return new et.hash.sha256().update(mt).finalize()},et.hash.sha256.prototype={blockSize:512,reset:function(){return this.F=this.Y.slice(0),this.A=[],this.l=0,this},update:function(mt){typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt));var gt,yt=this.A=et.bitArray.concat(this.A,mt);if(gt=this.l,mt=this.l=gt+et.bitArray.bitLength(mt),9007199254740991gt;yt++){for(wt=!0,bt=2;bt*bt<=yt;bt++)if(yt%bt===0){wt=!1;break}wt&&(8>gt&&(this.Y[gt]=mt(Math.pow(yt,.5))),this.b[gt]=mt(Math.pow(yt,1/3)),gt++)}}};function rt(mt,gt){var yt,bt,wt,xt=mt.F,kt=mt.b,St=xt[0],Tt=xt[1],At=xt[2],Et=xt[3],Ct=xt[4],Lt=xt[5],jt=xt[6],Rt=xt[7];for(yt=0;64>yt;yt++)16>yt?bt=gt[yt]:(bt=gt[yt+1&15],wt=gt[yt+14&15],bt=gt[yt&15]=(bt>>>7^bt>>>18^bt>>>3^bt<<25^bt<<14)+(wt>>>17^wt>>>19^wt>>>10^wt<<15^wt<<13)+gt[yt&15]+gt[yt+9&15]|0),bt=bt+Rt+(Ct>>>6^Ct>>>11^Ct>>>25^Ct<<26^Ct<<21^Ct<<7)+(jt^Ct&(Lt^jt))+kt[yt],Rt=jt,jt=Lt,Lt=Ct,Ct=Et+bt|0,Et=At,At=Tt,Tt=St,St=bt+(Tt&At^Et&(Tt^At))+(Tt>>>2^Tt>>>13^Tt>>>22^Tt<<30^Tt<<19^Tt<<10)|0;xt[0]=xt[0]+St|0,xt[1]=xt[1]+Tt|0,xt[2]=xt[2]+At|0,xt[3]=xt[3]+Et|0,xt[4]=xt[4]+Ct|0,xt[5]=xt[5]+Lt|0,xt[6]=xt[6]+jt|0,xt[7]=xt[7]+Rt|0}et.mode.ccm={name:"ccm",G:[],listenProgress:function(mt){et.mode.ccm.G.push(mt)},unListenProgress:function(mt){mt=et.mode.ccm.G.indexOf(mt),-1Tt)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(xt=2;4>xt&&At>>>8*xt;xt++);return xt<15-Tt&&(xt=15-Tt),yt=St.clamp(yt,8*(15-xt)),gt=et.mode.ccm.V(mt,gt,yt,bt,wt,xt),kt=et.mode.ccm.C(mt,kt,yt,gt,wt,xt),St.concat(kt.data,kt.tag)},decrypt:function(mt,gt,yt,bt,wt){wt=wt||64,bt=bt||[];var xt=et.bitArray,kt=xt.bitLength(yt)/8,At=xt.bitLength(gt),St=xt.clamp(gt,At-wt),Tt=xt.bitSlice(gt,At-wt),At=(At-wt)/8;if(7>kt)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(gt=2;4>gt&&At>>>8*gt;gt++);if(gt<15-kt&&(gt=15-kt),yt=xt.clamp(yt,8*(15-gt)),St=et.mode.ccm.C(mt,St,yt,Tt,wt,gt),mt=et.mode.ccm.V(mt,St.data,yt,bt,wt,gt),!xt.equal(St.tag,mt))throw new et.exception.corrupt("ccm: tag doesn't match");return St.data},na:function(mt,gt,yt,bt,wt,xt){var kt=[],St=et.bitArray,Tt=St.i;if(bt=[St.partial(8,(gt.length?64:0)|bt-2<<2|xt-1)],bt=St.concat(bt,yt),bt[3]|=wt,bt=mt.encrypt(bt),gt.length)for(yt=St.bitLength(gt)/8,65279>=yt?kt=[St.partial(16,yt)]:4294967295>=yt&&(kt=St.concat([St.partial(16,65534)],[yt])),kt=St.concat(kt,gt),gt=0;gtwt||16Et&&(et.mode.ccm.fa(kt/Tt),Et+=Ct),yt[3]++,wt=mt.encrypt(yt),gt[kt]^=wt[0],gt[kt+1]^=wt[1],gt[kt+2]^=wt[2],gt[kt+3]^=wt[3];return{tag:bt,data:St.clamp(gt,At)}}},et.mode.ocb2={name:"ocb2",encrypt:function(mt,gt,yt,bt,wt,xt){if(et.bitArray.bitLength(yt)!==128)throw new et.exception.invalid("ocb iv must be 128 bits");var kt,St=et.mode.ocb2.S,Tt=et.bitArray,At=Tt.i,Et=[0,0,0,0];yt=St(mt.encrypt(yt));var Ct,Lt=[];for(bt=bt||[],wt=wt||64,kt=0;kt+4wt.bitLength(yt)&&(St=xt(St,bt(St)),yt=wt.concat(yt,[-2147483648,0,0,0])),kt=xt(kt,yt),mt.encrypt(xt(bt(xt(St,bt(St))),kt))},S:function(mt){return[mt[0]<<1^mt[1]>>>31,mt[1]<<1^mt[2]>>>31,mt[2]<<1^mt[3]>>>31,mt[3]<<1^135*(mt[0]>>>31)]}},et.mode.gcm={name:"gcm",encrypt:function(mt,gt,yt,bt,wt){var xt=gt.slice(0);return gt=et.bitArray,bt=bt||[],mt=et.mode.gcm.C(!0,mt,xt,bt,yt,wt||128),gt.concat(mt.data,mt.tag)},decrypt:function(mt,gt,yt,bt,wt){var xt=gt.slice(0),kt=et.bitArray,St=kt.bitLength(xt);if(wt=wt||128,bt=bt||[],wt<=St?(gt=kt.bitSlice(xt,St-wt),xt=kt.bitSlice(xt,0,St-wt)):(gt=xt,xt=[]),mt=et.mode.gcm.C(!1,mt,xt,bt,yt,wt),!kt.equal(mt.tag,gt))throw new et.exception.corrupt("gcm: tag doesn't match");return mt.data},ka:function(mt,gt){var yt,bt,wt,xt,kt,St=et.bitArray.i;for(wt=[0,0,0,0],xt=gt.slice(0),yt=0;128>yt;yt++){for((bt=(mt[Math.floor(yt/32)]&1<<31-yt%32)!==0)&&(wt=St(wt,xt)),kt=(xt[3]&1)!==0,bt=3;0>>1|(xt[bt-1]&1)<<31;xt[0]>>>=1,kt&&(xt[0]^=-520093696)}return wt},j:function(mt,gt,yt){var bt,wt=yt.length;for(gt=gt.slice(0),bt=0;btwt&&(mt=gt.hash(mt)),bt=0;btbt||0>yt)throw new et.exception.invalid("invalid params to pbkdf2");typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt)),typeof gt=="string"&&(gt=et.codec.utf8String.toBits(gt)),wt=wt||et.misc.hmac,mt=new wt(mt);var xt,kt,St,Tt,At=[],Et=et.bitArray;for(Tt=1;32*At.length<(bt||1);Tt++){for(wt=xt=mt.encrypt(Et.concat(gt,[Tt])),kt=1;ktkt;kt++)wt.push(4294967296*Math.random()|0);for(kt=0;kt=1<this.o&&(this.o=xt),this.P++,this.b=et.hash.sha256.hash(this.b.concat(wt)),this.L=new et.cipher.aes(this.b),bt=0;4>bt&&(this.h[bt]=this.h[bt]+1|0,!this.h[bt]);bt++);}for(bt=0;bt>>1;this.c[kt].update([bt,this.N++,2,gt,xt,mt.length].concat(mt))}break;case"string":gt===void 0&&(gt=mt.length),this.c[kt].update([bt,this.N++,3,gt,xt,mt.length]),this.c[kt].update(mt);break;default:Tt=1}if(Tt)throw new et.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[kt]+=gt,this.f+=gt,St===this.u&&(this.isReady()!==this.u&&it("seeded",Math.max(this.o,this.f)),it("progress",this.getProgress()))},isReady:function(mt){return mt=this.T[mt!==void 0?mt:this.M],this.o&&this.o>=mt?this.m[0]>this.ba&&new Date().valueOf()>this.Z?this.J|this.I:this.I:this.f>=mt?this.J|this.u:this.u},getProgress:function(mt){return mt=this.T[mt||this.M],this.o>=mt||this.f>mt?1:this.f/mt},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:lt(this,this.ma),mouseCollector:lt(this,this.oa),keyboardCollector:lt(this,this.la),accelerometerCollector:lt(this,this.ea),touchCollector:lt(this,this.qa)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector);else throw new et.exception.bug("can't attach event");this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(mt,gt){this.K[mt][this.ga++]=gt},removeEventListener:function(mt,gt){var yt,bt,wt=this.K[mt],xt=[];for(bt in wt)wt.hasOwnProperty(bt)&&wt[bt]===gt&&xt.push(bt);for(yt=0;ytgt&&(mt.h[gt]=mt.h[gt]+1|0,!mt.h[gt]);gt++);return mt.L.encrypt(mt.h)}function lt(mt,gt){return function(){gt.apply(mt,arguments)}}et.random=new et.prng(6);e:try{var ct,ut,ht,dt;if(dt=tt.exports){var pt;try{pt=requireCryptoBrowserify()}catch{pt=null}dt=ut=pt}if(dt&&ut.randomBytes)ct=ut.randomBytes(128),ct=new Uint32Array(new Uint8Array(ct).buffer),et.random.addEntropy(ct,1024,"crypto['randomBytes']");else if(typeof window<"u"&&typeof Uint32Array<"u"){if(ht=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(ht);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(ht);else break e;et.random.addEntropy(ht,1024,"crypto['getRandomValues']")}}catch(mt){typeof window<"u"&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(mt))}et.json={defaults:{v:1,iter:1e4,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(mt,gt,yt,bt){yt=yt||{},bt=bt||{};var wt=et.json,xt=wt.g({iv:et.random.randomWords(4,0)},wt.defaults),kt;if(wt.g(xt,yt),yt=xt.adata,typeof xt.salt=="string"&&(xt.salt=et.codec.base64.toBits(xt.salt)),typeof xt.iv=="string"&&(xt.iv=et.codec.base64.toBits(xt.iv)),!et.mode[xt.mode]||!et.cipher[xt.cipher]||typeof mt=="string"&&100>=xt.iter||xt.ts!==64&&xt.ts!==96&&xt.ts!==128||xt.ks!==128&&xt.ks!==192&&xt.ks!==256||2>xt.iv.length||4=gt.iter||gt.ts!==64&>.ts!==96&>.ts!==128||gt.ks!==128&>.ks!==192&>.ks!==256||!gt.iv||2>gt.iv.length||4>24&255,_n[Pn+1]=un>>16&255,_n[Pn+2]=un>>8&255,_n[Pn+3]=un&255,_n[Pn+4]=Zt>>24&255,_n[Pn+5]=Zt>>16&255,_n[Pn+6]=Zt>>8&255,_n[Pn+7]=Zt&255}function gt(_n,Pn,un,Zt,Sn){var Dn,Fn=0;for(Dn=0;Dn>>8)-1}function yt(_n,Pn,un,Zt){return gt(_n,Pn,un,Zt,16)}function bt(_n,Pn,un,Zt){return gt(_n,Pn,un,Zt,32)}function wt(_n,Pn,un,Zt){for(var Sn=Zt[0]&255|(Zt[1]&255)<<8|(Zt[2]&255)<<16|(Zt[3]&255)<<24,Dn=un[0]&255|(un[1]&255)<<8|(un[2]&255)<<16|(un[3]&255)<<24,Fn=un[4]&255|(un[5]&255)<<8|(un[6]&255)<<16|(un[7]&255)<<24,Yn=un[8]&255|(un[9]&255)<<8|(un[10]&255)<<16|(un[11]&255)<<24,tr=un[12]&255|(un[13]&255)<<8|(un[14]&255)<<16|(un[15]&255)<<24,ar=Zt[4]&255|(Zt[5]&255)<<8|(Zt[6]&255)<<16|(Zt[7]&255)<<24,lr=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,vr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,Nr=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Zt[8]&255|(Zt[9]&255)<<8|(Zt[10]&255)<<16|(Zt[11]&255)<<24,eo=un[16]&255|(un[17]&255)<<8|(un[18]&255)<<16|(un[19]&255)<<24,Zr=un[20]&255|(un[21]&255)<<8|(un[22]&255)<<16|(un[23]&255)<<24,Jr=un[24]&255|(un[25]&255)<<8|(un[26]&255)<<16|(un[27]&255)<<24,br=un[28]&255|(un[29]&255)<<8|(un[30]&255)<<16|(un[31]&255)<<24,Pr=Zt[12]&255|(Zt[13]&255)<<8|(Zt[14]&255)<<16|(Zt[15]&255)<<24,Fr=Sn,Mr=Dn,Cr=Fn,Dr=Yn,Ur=tr,Rr=ar,er=lr,rr=Vr,xr=vr,dr=Nr,yr=Hr,$r=eo,no=Zr,ao=Jr,ho=br,fo=Pr,qn,wo=0;wo<20;wo+=2)qn=Fr+no|0,Ur^=qn<<7|qn>>>32-7,qn=Ur+Fr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Ur|0,no^=qn<<13|qn>>>32-13,qn=no+xr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Mr|0,dr^=qn<<7|qn>>>32-7,qn=dr+Rr|0,ao^=qn<<9|qn>>>32-9,qn=ao+dr|0,Mr^=qn<<13|qn>>>32-13,qn=Mr+ao|0,Rr^=qn<<18|qn>>>32-18,qn=yr+er|0,ho^=qn<<7|qn>>>32-7,qn=ho+yr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+ho|0,er^=qn<<13|qn>>>32-13,qn=er+Cr|0,yr^=qn<<18|qn>>>32-18,qn=fo+$r|0,Dr^=qn<<7|qn>>>32-7,qn=Dr+fo|0,rr^=qn<<9|qn>>>32-9,qn=rr+Dr|0,$r^=qn<<13|qn>>>32-13,qn=$r+rr|0,fo^=qn<<18|qn>>>32-18,qn=Fr+Dr|0,Mr^=qn<<7|qn>>>32-7,qn=Mr+Fr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+Mr|0,Dr^=qn<<13|qn>>>32-13,qn=Dr+Cr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Ur|0,er^=qn<<7|qn>>>32-7,qn=er+Rr|0,rr^=qn<<9|qn>>>32-9,qn=rr+er|0,Ur^=qn<<13|qn>>>32-13,qn=Ur+rr|0,Rr^=qn<<18|qn>>>32-18,qn=yr+dr|0,$r^=qn<<7|qn>>>32-7,qn=$r+yr|0,xr^=qn<<9|qn>>>32-9,qn=xr+$r|0,dr^=qn<<13|qn>>>32-13,qn=dr+xr|0,yr^=qn<<18|qn>>>32-18,qn=fo+ho|0,no^=qn<<7|qn>>>32-7,qn=no+fo|0,ao^=qn<<9|qn>>>32-9,qn=ao+no|0,ho^=qn<<13|qn>>>32-13,qn=ho+ao|0,fo^=qn<<18|qn>>>32-18;Fr=Fr+Sn|0,Mr=Mr+Dn|0,Cr=Cr+Fn|0,Dr=Dr+Yn|0,Ur=Ur+tr|0,Rr=Rr+ar|0,er=er+lr|0,rr=rr+Vr|0,xr=xr+vr|0,dr=dr+Nr|0,yr=yr+Hr|0,$r=$r+eo|0,no=no+Zr|0,ao=ao+Jr|0,ho=ho+br|0,fo=fo+Pr|0,_n[0]=Fr>>>0&255,_n[1]=Fr>>>8&255,_n[2]=Fr>>>16&255,_n[3]=Fr>>>24&255,_n[4]=Mr>>>0&255,_n[5]=Mr>>>8&255,_n[6]=Mr>>>16&255,_n[7]=Mr>>>24&255,_n[8]=Cr>>>0&255,_n[9]=Cr>>>8&255,_n[10]=Cr>>>16&255,_n[11]=Cr>>>24&255,_n[12]=Dr>>>0&255,_n[13]=Dr>>>8&255,_n[14]=Dr>>>16&255,_n[15]=Dr>>>24&255,_n[16]=Ur>>>0&255,_n[17]=Ur>>>8&255,_n[18]=Ur>>>16&255,_n[19]=Ur>>>24&255,_n[20]=Rr>>>0&255,_n[21]=Rr>>>8&255,_n[22]=Rr>>>16&255,_n[23]=Rr>>>24&255,_n[24]=er>>>0&255,_n[25]=er>>>8&255,_n[26]=er>>>16&255,_n[27]=er>>>24&255,_n[28]=rr>>>0&255,_n[29]=rr>>>8&255,_n[30]=rr>>>16&255,_n[31]=rr>>>24&255,_n[32]=xr>>>0&255,_n[33]=xr>>>8&255,_n[34]=xr>>>16&255,_n[35]=xr>>>24&255,_n[36]=dr>>>0&255,_n[37]=dr>>>8&255,_n[38]=dr>>>16&255,_n[39]=dr>>>24&255,_n[40]=yr>>>0&255,_n[41]=yr>>>8&255,_n[42]=yr>>>16&255,_n[43]=yr>>>24&255,_n[44]=$r>>>0&255,_n[45]=$r>>>8&255,_n[46]=$r>>>16&255,_n[47]=$r>>>24&255,_n[48]=no>>>0&255,_n[49]=no>>>8&255,_n[50]=no>>>16&255,_n[51]=no>>>24&255,_n[52]=ao>>>0&255,_n[53]=ao>>>8&255,_n[54]=ao>>>16&255,_n[55]=ao>>>24&255,_n[56]=ho>>>0&255,_n[57]=ho>>>8&255,_n[58]=ho>>>16&255,_n[59]=ho>>>24&255,_n[60]=fo>>>0&255,_n[61]=fo>>>8&255,_n[62]=fo>>>16&255,_n[63]=fo>>>24&255}function xt(_n,Pn,un,Zt){for(var Sn=Zt[0]&255|(Zt[1]&255)<<8|(Zt[2]&255)<<16|(Zt[3]&255)<<24,Dn=un[0]&255|(un[1]&255)<<8|(un[2]&255)<<16|(un[3]&255)<<24,Fn=un[4]&255|(un[5]&255)<<8|(un[6]&255)<<16|(un[7]&255)<<24,Yn=un[8]&255|(un[9]&255)<<8|(un[10]&255)<<16|(un[11]&255)<<24,tr=un[12]&255|(un[13]&255)<<8|(un[14]&255)<<16|(un[15]&255)<<24,ar=Zt[4]&255|(Zt[5]&255)<<8|(Zt[6]&255)<<16|(Zt[7]&255)<<24,lr=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,vr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,Nr=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Zt[8]&255|(Zt[9]&255)<<8|(Zt[10]&255)<<16|(Zt[11]&255)<<24,eo=un[16]&255|(un[17]&255)<<8|(un[18]&255)<<16|(un[19]&255)<<24,Zr=un[20]&255|(un[21]&255)<<8|(un[22]&255)<<16|(un[23]&255)<<24,Jr=un[24]&255|(un[25]&255)<<8|(un[26]&255)<<16|(un[27]&255)<<24,br=un[28]&255|(un[29]&255)<<8|(un[30]&255)<<16|(un[31]&255)<<24,Pr=Zt[12]&255|(Zt[13]&255)<<8|(Zt[14]&255)<<16|(Zt[15]&255)<<24,Fr=Sn,Mr=Dn,Cr=Fn,Dr=Yn,Ur=tr,Rr=ar,er=lr,rr=Vr,xr=vr,dr=Nr,yr=Hr,$r=eo,no=Zr,ao=Jr,ho=br,fo=Pr,qn,wo=0;wo<20;wo+=2)qn=Fr+no|0,Ur^=qn<<7|qn>>>32-7,qn=Ur+Fr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Ur|0,no^=qn<<13|qn>>>32-13,qn=no+xr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Mr|0,dr^=qn<<7|qn>>>32-7,qn=dr+Rr|0,ao^=qn<<9|qn>>>32-9,qn=ao+dr|0,Mr^=qn<<13|qn>>>32-13,qn=Mr+ao|0,Rr^=qn<<18|qn>>>32-18,qn=yr+er|0,ho^=qn<<7|qn>>>32-7,qn=ho+yr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+ho|0,er^=qn<<13|qn>>>32-13,qn=er+Cr|0,yr^=qn<<18|qn>>>32-18,qn=fo+$r|0,Dr^=qn<<7|qn>>>32-7,qn=Dr+fo|0,rr^=qn<<9|qn>>>32-9,qn=rr+Dr|0,$r^=qn<<13|qn>>>32-13,qn=$r+rr|0,fo^=qn<<18|qn>>>32-18,qn=Fr+Dr|0,Mr^=qn<<7|qn>>>32-7,qn=Mr+Fr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+Mr|0,Dr^=qn<<13|qn>>>32-13,qn=Dr+Cr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Ur|0,er^=qn<<7|qn>>>32-7,qn=er+Rr|0,rr^=qn<<9|qn>>>32-9,qn=rr+er|0,Ur^=qn<<13|qn>>>32-13,qn=Ur+rr|0,Rr^=qn<<18|qn>>>32-18,qn=yr+dr|0,$r^=qn<<7|qn>>>32-7,qn=$r+yr|0,xr^=qn<<9|qn>>>32-9,qn=xr+$r|0,dr^=qn<<13|qn>>>32-13,qn=dr+xr|0,yr^=qn<<18|qn>>>32-18,qn=fo+ho|0,no^=qn<<7|qn>>>32-7,qn=no+fo|0,ao^=qn<<9|qn>>>32-9,qn=ao+no|0,ho^=qn<<13|qn>>>32-13,qn=ho+ao|0,fo^=qn<<18|qn>>>32-18;_n[0]=Fr>>>0&255,_n[1]=Fr>>>8&255,_n[2]=Fr>>>16&255,_n[3]=Fr>>>24&255,_n[4]=Rr>>>0&255,_n[5]=Rr>>>8&255,_n[6]=Rr>>>16&255,_n[7]=Rr>>>24&255,_n[8]=yr>>>0&255,_n[9]=yr>>>8&255,_n[10]=yr>>>16&255,_n[11]=yr>>>24&255,_n[12]=fo>>>0&255,_n[13]=fo>>>8&255,_n[14]=fo>>>16&255,_n[15]=fo>>>24&255,_n[16]=er>>>0&255,_n[17]=er>>>8&255,_n[18]=er>>>16&255,_n[19]=er>>>24&255,_n[20]=rr>>>0&255,_n[21]=rr>>>8&255,_n[22]=rr>>>16&255,_n[23]=rr>>>24&255,_n[24]=xr>>>0&255,_n[25]=xr>>>8&255,_n[26]=xr>>>16&255,_n[27]=xr>>>24&255,_n[28]=dr>>>0&255,_n[29]=dr>>>8&255,_n[30]=dr>>>16&255,_n[31]=dr>>>24&255}function kt(_n,Pn,un,Zt){wt(_n,Pn,un,Zt)}function St(_n,Pn,un,Zt){xt(_n,Pn,un,Zt)}var Tt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function At(_n,Pn,un,Zt,Sn,Dn,Fn){var Yn=new Uint8Array(16),tr=new Uint8Array(64),ar,lr;for(lr=0;lr<16;lr++)Yn[lr]=0;for(lr=0;lr<8;lr++)Yn[lr]=Dn[lr];for(;Sn>=64;){for(kt(tr,Yn,Fn,Tt),lr=0;lr<64;lr++)_n[Pn+lr]=un[Zt+lr]^tr[lr];for(ar=1,lr=8;lr<16;lr++)ar=ar+(Yn[lr]&255)|0,Yn[lr]=ar&255,ar>>>=8;Sn-=64,Pn+=64,Zt+=64}if(Sn>0)for(kt(tr,Yn,Fn,Tt),lr=0;lr=64;){for(kt(Fn,Dn,Sn,Tt),tr=0;tr<64;tr++)_n[Pn+tr]=Fn[tr];for(Yn=1,tr=8;tr<16;tr++)Yn=Yn+(Dn[tr]&255)|0,Dn[tr]=Yn&255,Yn>>>=8;un-=64,Pn+=64}if(un>0)for(kt(Fn,Dn,Sn,Tt),tr=0;tr>>13|un<<3)&8191,Zt=_n[4]&255|(_n[5]&255)<<8,this.r[2]=(un>>>10|Zt<<6)&7939,Sn=_n[6]&255|(_n[7]&255)<<8,this.r[3]=(Zt>>>7|Sn<<9)&8191,Dn=_n[8]&255|(_n[9]&255)<<8,this.r[4]=(Sn>>>4|Dn<<12)&255,this.r[5]=Dn>>>1&8190,Fn=_n[10]&255|(_n[11]&255)<<8,this.r[6]=(Dn>>>14|Fn<<2)&8191,Yn=_n[12]&255|(_n[13]&255)<<8,this.r[7]=(Fn>>>11|Yn<<5)&8065,tr=_n[14]&255|(_n[15]&255)<<8,this.r[8]=(Yn>>>8|tr<<8)&8191,this.r[9]=tr>>>5&127,this.pad[0]=_n[16]&255|(_n[17]&255)<<8,this.pad[1]=_n[18]&255|(_n[19]&255)<<8,this.pad[2]=_n[20]&255|(_n[21]&255)<<8,this.pad[3]=_n[22]&255|(_n[23]&255)<<8,this.pad[4]=_n[24]&255|(_n[25]&255)<<8,this.pad[5]=_n[26]&255|(_n[27]&255)<<8,this.pad[6]=_n[28]&255|(_n[29]&255)<<8,this.pad[7]=_n[30]&255|(_n[31]&255)<<8};jt.prototype.blocks=function(_n,Pn,un){for(var Zt=this.fin?0:2048,Sn,Dn,Fn,Yn,tr,ar,lr,Vr,vr,Nr,Hr,eo,Zr,Jr,br,Pr,Fr,Mr,Cr,Dr=this.h[0],Ur=this.h[1],Rr=this.h[2],er=this.h[3],rr=this.h[4],xr=this.h[5],dr=this.h[6],yr=this.h[7],$r=this.h[8],no=this.h[9],ao=this.r[0],ho=this.r[1],fo=this.r[2],qn=this.r[3],wo=this.r[4],vo=this.r[5],_o=this.r[6],yo=this.r[7],Ao=this.r[8],Mo=this.r[9];un>=16;)Sn=_n[Pn+0]&255|(_n[Pn+1]&255)<<8,Dr+=Sn&8191,Dn=_n[Pn+2]&255|(_n[Pn+3]&255)<<8,Ur+=(Sn>>>13|Dn<<3)&8191,Fn=_n[Pn+4]&255|(_n[Pn+5]&255)<<8,Rr+=(Dn>>>10|Fn<<6)&8191,Yn=_n[Pn+6]&255|(_n[Pn+7]&255)<<8,er+=(Fn>>>7|Yn<<9)&8191,tr=_n[Pn+8]&255|(_n[Pn+9]&255)<<8,rr+=(Yn>>>4|tr<<12)&8191,xr+=tr>>>1&8191,ar=_n[Pn+10]&255|(_n[Pn+11]&255)<<8,dr+=(tr>>>14|ar<<2)&8191,lr=_n[Pn+12]&255|(_n[Pn+13]&255)<<8,yr+=(ar>>>11|lr<<5)&8191,Vr=_n[Pn+14]&255|(_n[Pn+15]&255)<<8,$r+=(lr>>>8|Vr<<8)&8191,no+=Vr>>>5|Zt,vr=0,Nr=vr,Nr+=Dr*ao,Nr+=Ur*(5*Mo),Nr+=Rr*(5*Ao),Nr+=er*(5*yo),Nr+=rr*(5*_o),vr=Nr>>>13,Nr&=8191,Nr+=xr*(5*vo),Nr+=dr*(5*wo),Nr+=yr*(5*qn),Nr+=$r*(5*fo),Nr+=no*(5*ho),vr+=Nr>>>13,Nr&=8191,Hr=vr,Hr+=Dr*ho,Hr+=Ur*ao,Hr+=Rr*(5*Mo),Hr+=er*(5*Ao),Hr+=rr*(5*yo),vr=Hr>>>13,Hr&=8191,Hr+=xr*(5*_o),Hr+=dr*(5*vo),Hr+=yr*(5*wo),Hr+=$r*(5*qn),Hr+=no*(5*fo),vr+=Hr>>>13,Hr&=8191,eo=vr,eo+=Dr*fo,eo+=Ur*ho,eo+=Rr*ao,eo+=er*(5*Mo),eo+=rr*(5*Ao),vr=eo>>>13,eo&=8191,eo+=xr*(5*yo),eo+=dr*(5*_o),eo+=yr*(5*vo),eo+=$r*(5*wo),eo+=no*(5*qn),vr+=eo>>>13,eo&=8191,Zr=vr,Zr+=Dr*qn,Zr+=Ur*fo,Zr+=Rr*ho,Zr+=er*ao,Zr+=rr*(5*Mo),vr=Zr>>>13,Zr&=8191,Zr+=xr*(5*Ao),Zr+=dr*(5*yo),Zr+=yr*(5*_o),Zr+=$r*(5*vo),Zr+=no*(5*wo),vr+=Zr>>>13,Zr&=8191,Jr=vr,Jr+=Dr*wo,Jr+=Ur*qn,Jr+=Rr*fo,Jr+=er*ho,Jr+=rr*ao,vr=Jr>>>13,Jr&=8191,Jr+=xr*(5*Mo),Jr+=dr*(5*Ao),Jr+=yr*(5*yo),Jr+=$r*(5*_o),Jr+=no*(5*vo),vr+=Jr>>>13,Jr&=8191,br=vr,br+=Dr*vo,br+=Ur*wo,br+=Rr*qn,br+=er*fo,br+=rr*ho,vr=br>>>13,br&=8191,br+=xr*ao,br+=dr*(5*Mo),br+=yr*(5*Ao),br+=$r*(5*yo),br+=no*(5*_o),vr+=br>>>13,br&=8191,Pr=vr,Pr+=Dr*_o,Pr+=Ur*vo,Pr+=Rr*wo,Pr+=er*qn,Pr+=rr*fo,vr=Pr>>>13,Pr&=8191,Pr+=xr*ho,Pr+=dr*ao,Pr+=yr*(5*Mo),Pr+=$r*(5*Ao),Pr+=no*(5*yo),vr+=Pr>>>13,Pr&=8191,Fr=vr,Fr+=Dr*yo,Fr+=Ur*_o,Fr+=Rr*vo,Fr+=er*wo,Fr+=rr*qn,vr=Fr>>>13,Fr&=8191,Fr+=xr*fo,Fr+=dr*ho,Fr+=yr*ao,Fr+=$r*(5*Mo),Fr+=no*(5*Ao),vr+=Fr>>>13,Fr&=8191,Mr=vr,Mr+=Dr*Ao,Mr+=Ur*yo,Mr+=Rr*_o,Mr+=er*vo,Mr+=rr*wo,vr=Mr>>>13,Mr&=8191,Mr+=xr*qn,Mr+=dr*fo,Mr+=yr*ho,Mr+=$r*ao,Mr+=no*(5*Mo),vr+=Mr>>>13,Mr&=8191,Cr=vr,Cr+=Dr*Mo,Cr+=Ur*Ao,Cr+=Rr*yo,Cr+=er*_o,Cr+=rr*vo,vr=Cr>>>13,Cr&=8191,Cr+=xr*wo,Cr+=dr*qn,Cr+=yr*fo,Cr+=$r*ho,Cr+=no*ao,vr+=Cr>>>13,Cr&=8191,vr=(vr<<2)+vr|0,vr=vr+Nr|0,Nr=vr&8191,vr=vr>>>13,Hr+=vr,Dr=Nr,Ur=Hr,Rr=eo,er=Zr,rr=Jr,xr=br,dr=Pr,yr=Fr,$r=Mr,no=Cr,Pn+=16,un-=16;this.h[0]=Dr,this.h[1]=Ur,this.h[2]=Rr,this.h[3]=er,this.h[4]=rr,this.h[5]=xr,this.h[6]=dr,this.h[7]=yr,this.h[8]=$r,this.h[9]=no},jt.prototype.finish=function(_n,Pn){var un=new Uint16Array(10),Zt,Sn,Dn,Fn;if(this.leftover){for(Fn=this.leftover,this.buffer[Fn++]=1;Fn<16;Fn++)this.buffer[Fn]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(Zt=this.h[1]>>>13,this.h[1]&=8191,Fn=2;Fn<10;Fn++)this.h[Fn]+=Zt,Zt=this.h[Fn]>>>13,this.h[Fn]&=8191;for(this.h[0]+=Zt*5,Zt=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=Zt,Zt=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=Zt,un[0]=this.h[0]+5,Zt=un[0]>>>13,un[0]&=8191,Fn=1;Fn<10;Fn++)un[Fn]=this.h[Fn]+Zt,Zt=un[Fn]>>>13,un[Fn]&=8191;for(un[9]-=8192,Sn=(Zt^1)-1,Fn=0;Fn<10;Fn++)un[Fn]&=Sn;for(Sn=~Sn,Fn=0;Fn<10;Fn++)this.h[Fn]=this.h[Fn]&Sn|un[Fn];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Dn=this.h[0]+this.pad[0],this.h[0]=Dn&65535,Fn=1;Fn<8;Fn++)Dn=(this.h[Fn]+this.pad[Fn]|0)+(Dn>>>16)|0,this.h[Fn]=Dn&65535;_n[Pn+0]=this.h[0]>>>0&255,_n[Pn+1]=this.h[0]>>>8&255,_n[Pn+2]=this.h[1]>>>0&255,_n[Pn+3]=this.h[1]>>>8&255,_n[Pn+4]=this.h[2]>>>0&255,_n[Pn+5]=this.h[2]>>>8&255,_n[Pn+6]=this.h[3]>>>0&255,_n[Pn+7]=this.h[3]>>>8&255,_n[Pn+8]=this.h[4]>>>0&255,_n[Pn+9]=this.h[4]>>>8&255,_n[Pn+10]=this.h[5]>>>0&255,_n[Pn+11]=this.h[5]>>>8&255,_n[Pn+12]=this.h[6]>>>0&255,_n[Pn+13]=this.h[6]>>>8&255,_n[Pn+14]=this.h[7]>>>0&255,_n[Pn+15]=this.h[7]>>>8&255},jt.prototype.update=function(_n,Pn,un){var Zt,Sn;if(this.leftover){for(Sn=16-this.leftover,Sn>un&&(Sn=un),Zt=0;Zt=16&&(Sn=un-un%16,this.blocks(_n,Pn,Sn),Pn+=Sn,un-=Sn),un){for(Zt=0;Zt>16&1),Dn[un-1]&=65535;Dn[15]=Fn[15]-32767-(Dn[14]>>16&1),Sn=Dn[15]>>16&1,Dn[14]&=65535,zt(Fn,Dn,1-Sn)}for(un=0;un<16;un++)_n[2*un]=Fn[un]&255,_n[2*un+1]=Fn[un]>>8}function Nt(_n,Pn){var un=new Uint8Array(32),Zt=new Uint8Array(32);return Ft(un,_n),Ft(Zt,Pn),bt(un,0,Zt,0)}function Ut(_n){var Pn=new Uint8Array(32);return Ft(Pn,_n),Pn[0]&1}function Pt(_n,Pn){var un;for(un=0;un<16;un++)_n[un]=Pn[2*un]+(Pn[2*un+1]<<8);_n[15]&=32767}function Ht(_n,Pn,un){for(var Zt=0;Zt<16;Zt++)_n[Zt]=Pn[Zt]+un[Zt]}function Qt(_n,Pn,un){for(var Zt=0;Zt<16;Zt++)_n[Zt]=Pn[Zt]-un[Zt]}function an(_n,Pn,un){var Zt,Sn,Dn=0,Fn=0,Yn=0,tr=0,ar=0,lr=0,Vr=0,vr=0,Nr=0,Hr=0,eo=0,Zr=0,Jr=0,br=0,Pr=0,Fr=0,Mr=0,Cr=0,Dr=0,Ur=0,Rr=0,er=0,rr=0,xr=0,dr=0,yr=0,$r=0,no=0,ao=0,ho=0,fo=0,qn=un[0],wo=un[1],vo=un[2],_o=un[3],yo=un[4],Ao=un[5],Mo=un[6],zo=un[7],Co=un[8],Lo=un[9],Ho=un[10],Ko=un[11],na=un[12],Qo=un[13],xa=un[14],Xo=un[15];Zt=Pn[0],Dn+=Zt*qn,Fn+=Zt*wo,Yn+=Zt*vo,tr+=Zt*_o,ar+=Zt*yo,lr+=Zt*Ao,Vr+=Zt*Mo,vr+=Zt*zo,Nr+=Zt*Co,Hr+=Zt*Lo,eo+=Zt*Ho,Zr+=Zt*Ko,Jr+=Zt*na,br+=Zt*Qo,Pr+=Zt*xa,Fr+=Zt*Xo,Zt=Pn[1],Fn+=Zt*qn,Yn+=Zt*wo,tr+=Zt*vo,ar+=Zt*_o,lr+=Zt*yo,Vr+=Zt*Ao,vr+=Zt*Mo,Nr+=Zt*zo,Hr+=Zt*Co,eo+=Zt*Lo,Zr+=Zt*Ho,Jr+=Zt*Ko,br+=Zt*na,Pr+=Zt*Qo,Fr+=Zt*xa,Mr+=Zt*Xo,Zt=Pn[2],Yn+=Zt*qn,tr+=Zt*wo,ar+=Zt*vo,lr+=Zt*_o,Vr+=Zt*yo,vr+=Zt*Ao,Nr+=Zt*Mo,Hr+=Zt*zo,eo+=Zt*Co,Zr+=Zt*Lo,Jr+=Zt*Ho,br+=Zt*Ko,Pr+=Zt*na,Fr+=Zt*Qo,Mr+=Zt*xa,Cr+=Zt*Xo,Zt=Pn[3],tr+=Zt*qn,ar+=Zt*wo,lr+=Zt*vo,Vr+=Zt*_o,vr+=Zt*yo,Nr+=Zt*Ao,Hr+=Zt*Mo,eo+=Zt*zo,Zr+=Zt*Co,Jr+=Zt*Lo,br+=Zt*Ho,Pr+=Zt*Ko,Fr+=Zt*na,Mr+=Zt*Qo,Cr+=Zt*xa,Dr+=Zt*Xo,Zt=Pn[4],ar+=Zt*qn,lr+=Zt*wo,Vr+=Zt*vo,vr+=Zt*_o,Nr+=Zt*yo,Hr+=Zt*Ao,eo+=Zt*Mo,Zr+=Zt*zo,Jr+=Zt*Co,br+=Zt*Lo,Pr+=Zt*Ho,Fr+=Zt*Ko,Mr+=Zt*na,Cr+=Zt*Qo,Dr+=Zt*xa,Ur+=Zt*Xo,Zt=Pn[5],lr+=Zt*qn,Vr+=Zt*wo,vr+=Zt*vo,Nr+=Zt*_o,Hr+=Zt*yo,eo+=Zt*Ao,Zr+=Zt*Mo,Jr+=Zt*zo,br+=Zt*Co,Pr+=Zt*Lo,Fr+=Zt*Ho,Mr+=Zt*Ko,Cr+=Zt*na,Dr+=Zt*Qo,Ur+=Zt*xa,Rr+=Zt*Xo,Zt=Pn[6],Vr+=Zt*qn,vr+=Zt*wo,Nr+=Zt*vo,Hr+=Zt*_o,eo+=Zt*yo,Zr+=Zt*Ao,Jr+=Zt*Mo,br+=Zt*zo,Pr+=Zt*Co,Fr+=Zt*Lo,Mr+=Zt*Ho,Cr+=Zt*Ko,Dr+=Zt*na,Ur+=Zt*Qo,Rr+=Zt*xa,er+=Zt*Xo,Zt=Pn[7],vr+=Zt*qn,Nr+=Zt*wo,Hr+=Zt*vo,eo+=Zt*_o,Zr+=Zt*yo,Jr+=Zt*Ao,br+=Zt*Mo,Pr+=Zt*zo,Fr+=Zt*Co,Mr+=Zt*Lo,Cr+=Zt*Ho,Dr+=Zt*Ko,Ur+=Zt*na,Rr+=Zt*Qo,er+=Zt*xa,rr+=Zt*Xo,Zt=Pn[8],Nr+=Zt*qn,Hr+=Zt*wo,eo+=Zt*vo,Zr+=Zt*_o,Jr+=Zt*yo,br+=Zt*Ao,Pr+=Zt*Mo,Fr+=Zt*zo,Mr+=Zt*Co,Cr+=Zt*Lo,Dr+=Zt*Ho,Ur+=Zt*Ko,Rr+=Zt*na,er+=Zt*Qo,rr+=Zt*xa,xr+=Zt*Xo,Zt=Pn[9],Hr+=Zt*qn,eo+=Zt*wo,Zr+=Zt*vo,Jr+=Zt*_o,br+=Zt*yo,Pr+=Zt*Ao,Fr+=Zt*Mo,Mr+=Zt*zo,Cr+=Zt*Co,Dr+=Zt*Lo,Ur+=Zt*Ho,Rr+=Zt*Ko,er+=Zt*na,rr+=Zt*Qo,xr+=Zt*xa,dr+=Zt*Xo,Zt=Pn[10],eo+=Zt*qn,Zr+=Zt*wo,Jr+=Zt*vo,br+=Zt*_o,Pr+=Zt*yo,Fr+=Zt*Ao,Mr+=Zt*Mo,Cr+=Zt*zo,Dr+=Zt*Co,Ur+=Zt*Lo,Rr+=Zt*Ho,er+=Zt*Ko,rr+=Zt*na,xr+=Zt*Qo,dr+=Zt*xa,yr+=Zt*Xo,Zt=Pn[11],Zr+=Zt*qn,Jr+=Zt*wo,br+=Zt*vo,Pr+=Zt*_o,Fr+=Zt*yo,Mr+=Zt*Ao,Cr+=Zt*Mo,Dr+=Zt*zo,Ur+=Zt*Co,Rr+=Zt*Lo,er+=Zt*Ho,rr+=Zt*Ko,xr+=Zt*na,dr+=Zt*Qo,yr+=Zt*xa,$r+=Zt*Xo,Zt=Pn[12],Jr+=Zt*qn,br+=Zt*wo,Pr+=Zt*vo,Fr+=Zt*_o,Mr+=Zt*yo,Cr+=Zt*Ao,Dr+=Zt*Mo,Ur+=Zt*zo,Rr+=Zt*Co,er+=Zt*Lo,rr+=Zt*Ho,xr+=Zt*Ko,dr+=Zt*na,yr+=Zt*Qo,$r+=Zt*xa,no+=Zt*Xo,Zt=Pn[13],br+=Zt*qn,Pr+=Zt*wo,Fr+=Zt*vo,Mr+=Zt*_o,Cr+=Zt*yo,Dr+=Zt*Ao,Ur+=Zt*Mo,Rr+=Zt*zo,er+=Zt*Co,rr+=Zt*Lo,xr+=Zt*Ho,dr+=Zt*Ko,yr+=Zt*na,$r+=Zt*Qo,no+=Zt*xa,ao+=Zt*Xo,Zt=Pn[14],Pr+=Zt*qn,Fr+=Zt*wo,Mr+=Zt*vo,Cr+=Zt*_o,Dr+=Zt*yo,Ur+=Zt*Ao,Rr+=Zt*Mo,er+=Zt*zo,rr+=Zt*Co,xr+=Zt*Lo,dr+=Zt*Ho,yr+=Zt*Ko,$r+=Zt*na,no+=Zt*Qo,ao+=Zt*xa,ho+=Zt*Xo,Zt=Pn[15],Fr+=Zt*qn,Mr+=Zt*wo,Cr+=Zt*vo,Dr+=Zt*_o,Ur+=Zt*yo,Rr+=Zt*Ao,er+=Zt*Mo,rr+=Zt*zo,xr+=Zt*Co,dr+=Zt*Lo,yr+=Zt*Ho,$r+=Zt*Ko,no+=Zt*na,ao+=Zt*Qo,ho+=Zt*xa,fo+=Zt*Xo,Dn+=38*Mr,Fn+=38*Cr,Yn+=38*Dr,tr+=38*Ur,ar+=38*Rr,lr+=38*er,Vr+=38*rr,vr+=38*xr,Nr+=38*dr,Hr+=38*yr,eo+=38*$r,Zr+=38*no,Jr+=38*ao,br+=38*ho,Pr+=38*fo,Sn=1,Zt=Dn+Sn+65535,Sn=Math.floor(Zt/65536),Dn=Zt-Sn*65536,Zt=Fn+Sn+65535,Sn=Math.floor(Zt/65536),Fn=Zt-Sn*65536,Zt=Yn+Sn+65535,Sn=Math.floor(Zt/65536),Yn=Zt-Sn*65536,Zt=tr+Sn+65535,Sn=Math.floor(Zt/65536),tr=Zt-Sn*65536,Zt=ar+Sn+65535,Sn=Math.floor(Zt/65536),ar=Zt-Sn*65536,Zt=lr+Sn+65535,Sn=Math.floor(Zt/65536),lr=Zt-Sn*65536,Zt=Vr+Sn+65535,Sn=Math.floor(Zt/65536),Vr=Zt-Sn*65536,Zt=vr+Sn+65535,Sn=Math.floor(Zt/65536),vr=Zt-Sn*65536,Zt=Nr+Sn+65535,Sn=Math.floor(Zt/65536),Nr=Zt-Sn*65536,Zt=Hr+Sn+65535,Sn=Math.floor(Zt/65536),Hr=Zt-Sn*65536,Zt=eo+Sn+65535,Sn=Math.floor(Zt/65536),eo=Zt-Sn*65536,Zt=Zr+Sn+65535,Sn=Math.floor(Zt/65536),Zr=Zt-Sn*65536,Zt=Jr+Sn+65535,Sn=Math.floor(Zt/65536),Jr=Zt-Sn*65536,Zt=br+Sn+65535,Sn=Math.floor(Zt/65536),br=Zt-Sn*65536,Zt=Pr+Sn+65535,Sn=Math.floor(Zt/65536),Pr=Zt-Sn*65536,Zt=Fr+Sn+65535,Sn=Math.floor(Zt/65536),Fr=Zt-Sn*65536,Dn+=Sn-1+37*(Sn-1),Sn=1,Zt=Dn+Sn+65535,Sn=Math.floor(Zt/65536),Dn=Zt-Sn*65536,Zt=Fn+Sn+65535,Sn=Math.floor(Zt/65536),Fn=Zt-Sn*65536,Zt=Yn+Sn+65535,Sn=Math.floor(Zt/65536),Yn=Zt-Sn*65536,Zt=tr+Sn+65535,Sn=Math.floor(Zt/65536),tr=Zt-Sn*65536,Zt=ar+Sn+65535,Sn=Math.floor(Zt/65536),ar=Zt-Sn*65536,Zt=lr+Sn+65535,Sn=Math.floor(Zt/65536),lr=Zt-Sn*65536,Zt=Vr+Sn+65535,Sn=Math.floor(Zt/65536),Vr=Zt-Sn*65536,Zt=vr+Sn+65535,Sn=Math.floor(Zt/65536),vr=Zt-Sn*65536,Zt=Nr+Sn+65535,Sn=Math.floor(Zt/65536),Nr=Zt-Sn*65536,Zt=Hr+Sn+65535,Sn=Math.floor(Zt/65536),Hr=Zt-Sn*65536,Zt=eo+Sn+65535,Sn=Math.floor(Zt/65536),eo=Zt-Sn*65536,Zt=Zr+Sn+65535,Sn=Math.floor(Zt/65536),Zr=Zt-Sn*65536,Zt=Jr+Sn+65535,Sn=Math.floor(Zt/65536),Jr=Zt-Sn*65536,Zt=br+Sn+65535,Sn=Math.floor(Zt/65536),br=Zt-Sn*65536,Zt=Pr+Sn+65535,Sn=Math.floor(Zt/65536),Pr=Zt-Sn*65536,Zt=Fr+Sn+65535,Sn=Math.floor(Zt/65536),Fr=Zt-Sn*65536,Dn+=Sn-1+37*(Sn-1),_n[0]=Dn,_n[1]=Fn,_n[2]=Yn,_n[3]=tr,_n[4]=ar,_n[5]=lr,_n[6]=Vr,_n[7]=vr,_n[8]=Nr,_n[9]=Hr,_n[10]=eo,_n[11]=Zr,_n[12]=Jr,_n[13]=br,_n[14]=Pr,_n[15]=Fr}function Yt(_n,Pn){an(_n,Pn,Pn)}function nn(_n,Pn){var un=nt(),Zt;for(Zt=0;Zt<16;Zt++)un[Zt]=Pn[Zt];for(Zt=253;Zt>=0;Zt--)Yt(un,un),Zt!==2&&Zt!==4&&an(un,un,Pn);for(Zt=0;Zt<16;Zt++)_n[Zt]=un[Zt]}function tn(_n,Pn){var un=nt(),Zt;for(Zt=0;Zt<16;Zt++)un[Zt]=Pn[Zt];for(Zt=250;Zt>=0;Zt--)Yt(un,un),Zt!==1&&an(un,un,Pn);for(Zt=0;Zt<16;Zt++)_n[Zt]=un[Zt]}function dn(_n,Pn,un){var Zt=new Uint8Array(32),Sn=new Float64Array(80),Dn,Fn,Yn=nt(),tr=nt(),ar=nt(),lr=nt(),Vr=nt(),vr=nt();for(Fn=0;Fn<31;Fn++)Zt[Fn]=Pn[Fn];for(Zt[31]=Pn[31]&127|64,Zt[0]&=248,Pt(Sn,un),Fn=0;Fn<16;Fn++)tr[Fn]=Sn[Fn],lr[Fn]=Yn[Fn]=ar[Fn]=0;for(Yn[0]=lr[0]=1,Fn=254;Fn>=0;--Fn)Dn=Zt[Fn>>>3]>>>(Fn&7)&1,zt(Yn,tr,Dn),zt(ar,lr,Dn),Ht(Vr,Yn,ar),Qt(Yn,Yn,ar),Ht(ar,tr,lr),Qt(tr,tr,lr),Yt(lr,Vr),Yt(vr,Yn),an(Yn,ar,Yn),an(ar,tr,Vr),Ht(Vr,Yn,ar),Qt(Yn,Yn,ar),Yt(tr,Yn),Qt(ar,lr,vr),an(Yn,ar,lt),Ht(Yn,Yn,lr),an(ar,ar,Yn),an(Yn,lr,vr),an(lr,tr,Sn),Yt(tr,Vr),zt(Yn,tr,Dn),zt(ar,lr,Dn);for(Fn=0;Fn<16;Fn++)Sn[Fn+16]=Yn[Fn],Sn[Fn+32]=ar[Fn],Sn[Fn+48]=tr[Fn],Sn[Fn+64]=lr[Fn];var Nr=Sn.subarray(32),Hr=Sn.subarray(16);return nn(Nr,Nr),an(Hr,Hr,Nr),Ft(_n,Hr),0}function wn(_n,Pn){return dn(_n,Pn,ot)}function rn(_n,Pn){return rt(Pn,32),wn(_n,Pn)}function Jt(_n,Pn,un){var Zt=new Uint8Array(32);return dn(Zt,un,Pn),St(_n,it,Zt,Tt)}var vn=vt,Cn=It;function $n(_n,Pn,un,Zt,Sn,Dn){var Fn=new Uint8Array(32);return Jt(Fn,Sn,Dn),vn(_n,Pn,un,Zt,Fn)}function Nn(_n,Pn,un,Zt,Sn,Dn){var Fn=new Uint8Array(32);return Jt(Fn,Sn,Dn),Cn(_n,Pn,un,Zt,Fn)}var En=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function sn(_n,Pn,un,Zt){for(var Sn=new Int32Array(16),Dn=new Int32Array(16),Fn,Yn,tr,ar,lr,Vr,vr,Nr,Hr,eo,Zr,Jr,br,Pr,Fr,Mr,Cr,Dr,Ur,Rr,er,rr,xr,dr,yr,$r,no=_n[0],ao=_n[1],ho=_n[2],fo=_n[3],qn=_n[4],wo=_n[5],vo=_n[6],_o=_n[7],yo=Pn[0],Ao=Pn[1],Mo=Pn[2],zo=Pn[3],Co=Pn[4],Lo=Pn[5],Ho=Pn[6],Ko=Pn[7],na=0;Zt>=128;){for(Ur=0;Ur<16;Ur++)Rr=8*Ur+na,Sn[Ur]=un[Rr+0]<<24|un[Rr+1]<<16|un[Rr+2]<<8|un[Rr+3],Dn[Ur]=un[Rr+4]<<24|un[Rr+5]<<16|un[Rr+6]<<8|un[Rr+7];for(Ur=0;Ur<80;Ur++)if(Fn=no,Yn=ao,tr=ho,ar=fo,lr=qn,Vr=wo,vr=vo,Nr=_o,Hr=yo,eo=Ao,Zr=Mo,Jr=zo,br=Co,Pr=Lo,Fr=Ho,Mr=Ko,er=_o,rr=Ko,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=(qn>>>14|Co<<32-14)^(qn>>>18|Co<<32-18)^(Co>>>41-32|qn<<32-(41-32)),rr=(Co>>>14|qn<<32-14)^(Co>>>18|qn<<32-18)^(qn>>>41-32|Co<<32-(41-32)),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=qn&wo^~qn&vo,rr=Co&Lo^~Co&Ho,xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=En[Ur*2],rr=En[Ur*2+1],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=Sn[Ur%16],rr=Dn[Ur%16],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,Cr=yr&65535|$r<<16,Dr=xr&65535|dr<<16,er=Cr,rr=Dr,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=(no>>>28|yo<<32-28)^(yo>>>34-32|no<<32-(34-32))^(yo>>>39-32|no<<32-(39-32)),rr=(yo>>>28|no<<32-28)^(no>>>34-32|yo<<32-(34-32))^(no>>>39-32|yo<<32-(39-32)),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=no&ao^no&ho^ao&ho,rr=yo&Ao^yo&Mo^Ao&Mo,xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,Nr=yr&65535|$r<<16,Mr=xr&65535|dr<<16,er=ar,rr=Jr,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=Cr,rr=Dr,xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,ar=yr&65535|$r<<16,Jr=xr&65535|dr<<16,ao=Fn,ho=Yn,fo=tr,qn=ar,wo=lr,vo=Vr,_o=vr,no=Nr,Ao=Hr,Mo=eo,zo=Zr,Co=Jr,Lo=br,Ho=Pr,Ko=Fr,yo=Mr,Ur%16===15)for(Rr=0;Rr<16;Rr++)er=Sn[Rr],rr=Dn[Rr],xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=Sn[(Rr+9)%16],rr=Dn[(Rr+9)%16],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,Cr=Sn[(Rr+1)%16],Dr=Dn[(Rr+1)%16],er=(Cr>>>1|Dr<<32-1)^(Cr>>>8|Dr<<32-8)^Cr>>>7,rr=(Dr>>>1|Cr<<32-1)^(Dr>>>8|Cr<<32-8)^(Dr>>>7|Cr<<32-7),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,Cr=Sn[(Rr+14)%16],Dr=Dn[(Rr+14)%16],er=(Cr>>>19|Dr<<32-19)^(Dr>>>61-32|Cr<<32-(61-32))^Cr>>>6,rr=(Dr>>>19|Cr<<32-19)^(Cr>>>61-32|Dr<<32-(61-32))^(Dr>>>6|Cr<<32-6),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,Sn[Rr]=yr&65535|$r<<16,Dn[Rr]=xr&65535|dr<<16;er=no,rr=yo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[0],rr=Pn[0],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[0]=no=yr&65535|$r<<16,Pn[0]=yo=xr&65535|dr<<16,er=ao,rr=Ao,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[1],rr=Pn[1],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[1]=ao=yr&65535|$r<<16,Pn[1]=Ao=xr&65535|dr<<16,er=ho,rr=Mo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[2],rr=Pn[2],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[2]=ho=yr&65535|$r<<16,Pn[2]=Mo=xr&65535|dr<<16,er=fo,rr=zo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[3],rr=Pn[3],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[3]=fo=yr&65535|$r<<16,Pn[3]=zo=xr&65535|dr<<16,er=qn,rr=Co,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[4],rr=Pn[4],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[4]=qn=yr&65535|$r<<16,Pn[4]=Co=xr&65535|dr<<16,er=wo,rr=Lo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[5],rr=Pn[5],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[5]=wo=yr&65535|$r<<16,Pn[5]=Lo=xr&65535|dr<<16,er=vo,rr=Ho,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[6],rr=Pn[6],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[6]=vo=yr&65535|$r<<16,Pn[6]=Ho=xr&65535|dr<<16,er=_o,rr=Ko,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[7],rr=Pn[7],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[7]=_o=yr&65535|$r<<16,Pn[7]=Ko=xr&65535|dr<<16,na+=128,Zt-=128}return Zt}function pn(_n,Pn,un){var Zt=new Int32Array(8),Sn=new Int32Array(8),Dn=new Uint8Array(256),Fn,Yn=un;for(Zt[0]=1779033703,Zt[1]=3144134277,Zt[2]=1013904242,Zt[3]=2773480762,Zt[4]=1359893119,Zt[5]=2600822924,Zt[6]=528734635,Zt[7]=1541459225,Sn[0]=4089235720,Sn[1]=2227873595,Sn[2]=4271175723,Sn[3]=1595750129,Sn[4]=2917565137,Sn[5]=725511199,Sn[6]=4215389547,Sn[7]=327033209,sn(Zt,Sn,Pn,un),un%=128,Fn=0;Fn=0;--Sn)Zt=un[Sn/8|0]>>(Sn&7)&1,In(_n,Pn,Zt),Tn(Pn,_n),Tn(_n,_n),In(_n,Pn,Zt)}function fn(_n,Pn){var un=[nt(),nt(),nt(),nt()];Ot(un[0],ht),Ot(un[1],dt),Ot(un[2],st),an(un[3],ht,dt),hn(_n,un,Pn)}function xn(_n,Pn,un){var Zt=new Uint8Array(64),Sn=[nt(),nt(),nt(),nt()],Dn;for(un||rt(Pn,32),pn(Zt,Pn,32),Zt[0]&=248,Zt[31]&=127,Zt[31]|=64,fn(Sn,Zt),yn(_n,Sn),Dn=0;Dn<32;Dn++)Pn[Dn+32]=_n[Dn];return 0}var jn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function cn(_n,Pn){var un,Zt,Sn,Dn;for(Zt=63;Zt>=32;--Zt){for(un=0,Sn=Zt-32,Dn=Zt-12;Sn>4)*jn[Sn],un=Pn[Sn]>>8,Pn[Sn]&=255;for(Sn=0;Sn<32;Sn++)Pn[Sn]-=un*jn[Sn];for(Zt=0;Zt<32;Zt++)Pn[Zt+1]+=Pn[Zt]>>8,_n[Zt]=Pn[Zt]&255}function Xt(_n){var Pn=new Float64Array(64),un;for(un=0;un<64;un++)Pn[un]=_n[un];for(un=0;un<64;un++)_n[un]=0;cn(_n,Pn)}function Kt(_n,Pn,un,Zt){var Sn=new Uint8Array(64),Dn=new Uint8Array(64),Fn=new Uint8Array(64),Yn,tr,ar=new Float64Array(64),lr=[nt(),nt(),nt(),nt()];pn(Sn,Zt,32),Sn[0]&=248,Sn[31]&=127,Sn[31]|=64;var Vr=un+64;for(Yn=0;Yn>7&&Qt(_n[0],at,_n[0]),an(_n[3],_n[0],_n[1]),0)}function Mn(_n,Pn,un,Zt){var Sn,Dn=new Uint8Array(32),Fn=new Uint8Array(64),Yn=[nt(),nt(),nt(),nt()],tr=[nt(),nt(),nt(),nt()];if(un<64||kn(tr,Zt))return-1;for(Sn=0;Sn=0},et.sign.keyPair=function(){var _n=new Uint8Array(Ir),Pn=new Uint8Array(Gr);return xn(_n,Pn),{publicKey:_n,secretKey:Pn}},et.sign.keyPair.fromSecretKey=function(_n){if(jr(_n),_n.length!==Gr)throw new Error("bad secret key size");for(var Pn=new Uint8Array(Ir),un=0;un"u"?typeof Buffer.from<"u"?(et.encodeBase64=function(rt){return Buffer.from(rt).toString("base64")},et.decodeBase64=function(rt){return nt(rt),new Uint8Array(Array.prototype.slice.call(Buffer.from(rt,"base64"),0))}):(et.encodeBase64=function(rt){return new Buffer(rt).toString("base64")},et.decodeBase64=function(rt){return nt(rt),new Uint8Array(Array.prototype.slice.call(new Buffer(rt,"base64"),0))}):(et.encodeBase64=function(rt){var it,ot=[],at=rt.length;for(it=0;itgt||pn<0)throw new RangeError(`varint ${pn} out of range`);this._grow(this._length+wt);let Tn=this._length;for(;pn>=128;)this._buf[Tn++]=pn&255|128,pn>>>=7;this._buf[Tn++]=pn|0,this._length=Tn}get bytes(){return this._buf.subarray(0,this._length)}_grow(pn){const Tn=this._buf.length;if(pn<=Tn)return;const In=Tn*2,yn=pn>In?pn:In,hn=new Uint8Array(yn);hn.set(this._buf.subarray(0,this._length)),this._buf=hn}}const wt=5;class xt{constructor(pn){this._buf=pn,this._index=0}readByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index++]}peekByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index]}readN(pn){if(this.lengthwt||fn===wt&&hn>1)throw new RangeError("Overflow error decoding varint");return(Tn|hn<>>0}Tn|=(hn&127)<sn!=null,St=sn=>kt(sn)?st.encode(sn):sn,Tt=sn=>kt(sn)?lt.decode(sn):sn,At=sn=>nt.default.codec.utf8String.fromBits(sn);tt.base64ToBytes=function(sn){return sn=sn.replace(/-/g,"+").replace(/_/g,"/"),sn.length%4!==0&&!sn.match(/=$/)&&(sn+="=".repeat(4-sn.length%4)),it.default.decodeBase64(sn)},tt.bytesToBase64=function(sn){return it.default.encodeBase64(sn).replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")};const Et=function(sn){return nt.default.codec.base64.toBits(it.default.encodeBase64(sn))},Ct=function(sn){return it.default.decodeBase64(nt.default.codec.base64.fromBits(sn))},Lt=function(sn){const pn=new Uint8Array(Math.ceil(sn.length/2));for(let Tn=0;Tnkt(sn)?Rt(sn,pn):"",vt=function(sn,pn){if(sn instanceof Uint8Array)return sn;if(typeof sn=="string")return St(sn);throw new TypeError(`${pn} has the wrong type; want string or Uint8Array, got ${typeof sn}.`)},It=new Uint8Array,Ot=function(sn,pn){const Tn=sn.readByte();if(Tn!==pn)throw new Error(`Unexpected field type, got ${Tn} want ${pn}`);return Tn===ut?It:sn.readN(sn.readUvarint())},Wt=function(sn,pn,Tn){sn.appendByte(pn),pn!==ut&&(sn.appendUvarint(Tn.length),sn.appendBytes(Tn))},zt=function(sn,pn){return sn.peekByte()!==pn?null:Ot(sn,pn)},Ft=function(sn,pn,Tn){jt(Tn)?sn[pn]=Tt(Tn):sn[pn+"64"]=tt.bytesToBase64(Tn)},Nt=function(sn,pn){const Tn=new nt.default.misc.hmac(sn,nt.default.hash.sha256);return Tn.update(pn),Tn.digest()},Ut=function(sn,pn,Tn){const In=Nt(sn,pn),yn=Nt(sn,Tn);return Nt(sn,nt.default.bitArray.concat(In,yn))},Pt=Et(St("macaroons-key-generator")),Ht=function(sn){return Nt(Pt,sn)},Qt=function(){return rt.default.randomBytes(ct)},an=function(sn,pn){const Tn=Ct(sn),In=Ct(pn),yn=Qt(),hn=rt.default.secretbox(In,yn,Tn),fn=new Uint8Array(yn.length+hn.length);return fn.set(yn,0),fn.set(hn,yn.length),Et(fn)},Yt=function(sn,pn){const Tn=Ct(sn),In=Ct(pn),yn=In.slice(0,ct),hn=In.slice(ct);let fn=rt.default.secretbox.open(hn,yn,Tn);if(!fn)throw new Error("decryption failed");return Et(fn)},nn=Et(St("\0".repeat(32))),tn=function(sn,pn){return nt.default.bitArray.equal(sn,pn)?sn:Ut(nn,sn,pn)};class dn{constructor(pn){if(!pn)return;let{version:Tn,identifierBytes:In,locationStr:yn,caveats:hn,signatureBytes:fn}=pn;if(Tn!==1&&Tn!==2)throw new Error(`Unexpected version ${Tn}`);if(this._version=Tn,this._locationStr=yn,In=vt(In,"Identifier"),Tn===1&&!jt(In))throw new Error("Version 1 macaroon identifier must be well-formed UTF-8");this._identifierBits=In&&Et(In),this._signatureBits=fn&&Et(vt(fn,"Signature")),this._caveats=hn?hn.map(xn=>{const jn=vt(xn.identifierBytes,"Caveat identifier");if(Tn===1&&!jt(jn))throw new Error("Version 1 caveat identifier must be well-formed UTF-8");return{_locationStr:$t(xn.locationStr),_identifierBits:Et(jn),_vidBits:xn.vidBytes&&Et(vt(xn.vidBytes,"Verification ID"))}}):[]}get caveats(){return this._caveats.map(pn=>kt(pn._vidBits)?{identifier:Ct(pn._identifierBits),location:pn._locationStr,vid:Ct(pn._vidBits)}:{identifier:Ct(pn._identifierBits)})}get location(){return this._locationStr}get identifier(){return Ct(this._identifierBits)}get signature(){return Ct(this._signatureBits)}addThirdPartyCaveat(pn,Tn,In){const yn={_identifierBits:Et(vt(Tn,"Caveat id")),_vidBits:an(this._signatureBits,Ht(Et(vt(pn,"Caveat root key")))),_locationStr:$t(In)};this._signatureBits=Ut(this._signatureBits,yn._vidBits,yn._identifierBits),this._caveats.push(yn)}addFirstPartyCaveat(pn){const Tn=Et(vt(pn,"Condition"));this._caveats.push({_identifierBits:Tn}),this._signatureBits=Nt(this._signatureBits,Tn)}bindToRoot(pn){const Tn=Et(vt(pn,"Primary macaroon signature"));this._signatureBits=tn(Tn,this._signatureBits)}clone(){const pn=new dn;return pn._version=this._version,pn._signatureBits=this._signatureBits,pn._identifierBits=this._identifierBits,pn._locationStr=this._locationStr,pn._caveats=this._caveats.slice(),pn}verify(pn,Tn,In=[]){const yn=Ht(Et(vt(pn,"Root key"))),hn=In.map(fn=>0);this._verify(this._signatureBits,yn,Tn,In,hn),In.forEach((fn,xn)=>{if(hn[xn]===0)throw new Error(`discharge macaroon ${yt(fn.identifier)} was not used`);if(hn[xn]!==1)throw new Error(`discharge macaroon ${yt(fn.identifier)} was used more than once`)})}_verify(pn,Tn,In,yn,hn){let fn=Nt(Tn,this._identifierBits);this._caveats.forEach(jn=>{if(jn._vidBits){const cn=Yt(fn,jn._vidBits);let Xt=!1,Kt,kn;for(Kt=0;Kt1)throw new Error(`discharge macaroon ${yt(kn.identifier)} was used more than once`);kn._verify(pn,cn,In,yn,hn);break}if(!Xt)throw new Error(`cannot find discharge macaroon for caveat ${yt(jn._identifierBits)}`);fn=Ut(fn,jn._vidBits,jn._identifierBits)}else{const cn=At(jn._identifierBits),Xt=In(cn);if(Xt)throw new Error(`caveat check failed (${cn}): ${Xt}`);fn=Nt(fn,jn._identifierBits)}});const xn=tn(pn,fn);if(!nt.default.bitArray.equal(xn,this._signatureBits))throw new Error("signature mismatch after caveat verification")}exportJSON(){switch(this._version){case 1:return this._exportAsJSONObjectV1();case 2:return this._exportAsJSONObjectV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}_exportAsJSONObjectV1(){const pn={identifier:At(this._identifierBits),signature:nt.default.codec.hex.fromBits(this._signatureBits)};return this._locationStr&&(pn.location=this._locationStr),this._caveats.length>0&&(pn.caveats=this._caveats.map(Tn=>{const In={cid:At(Tn._identifierBits)};return Tn._vidBits&&(In.vid=nt.default.codec.base64.fromBits(Tn._vidBits,!0,!0),In.cl=Tn._locationStr),In})),pn}_exportAsJSONObjectV2(){const pn={v:2};return Ft(pn,"s",Ct(this._signatureBits)),Ft(pn,"i",Ct(this._identifierBits)),this._locationStr&&(pn.l=this._locationStr),this._caveats&&this._caveats.length>0&&(pn.c=this._caveats.map(Tn=>{const In={};return Ft(In,"i",Ct(Tn._identifierBits)),Tn._vidBits&&(Ft(In,"v",Ct(Tn._vidBits)),In.l=Tn._locationStr),In})),pn}_exportBinaryV1(){throw new Error("V1 binary export not supported")}_exportBinaryV2(){const pn=new bt(200);return pn.appendByte(2),this._locationStr&&Wt(pn,ht,St(this._locationStr)),Wt(pn,dt,Ct(this._identifierBits)),Wt(pn,ut),this._caveats.forEach(function(Tn){Tn._locationStr&&Wt(pn,ht,St(Tn._locationStr)),Wt(pn,dt,Ct(Tn._identifierBits)),Tn._vidBits&&Wt(pn,pt,Ct(Tn._vidBits)),Wt(pn,ut)}),Wt(pn,ut),Wt(pn,mt,Ct(this._signatureBits)),pn.bytes}exportBinary(){switch(this._version){case 1:return this._exportBinaryV1();case 2:return this._exportBinaryV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}}tt.importMacaroon=function(sn){if(typeof sn=="string"&&(sn=tt.base64ToBytes(sn)),sn instanceof Uint8Array){const pn=new xt(sn),Tn=En(pn);if(pn.length!==0)throw new TypeError("extra data found at end of serialized macaroon");return Tn}if(Array.isArray(sn))throw new TypeError("cannot import an array of macaroons as a single macaroon");return wn(sn)},tt.importMacaroons=function(sn){if(typeof sn=="string"&&(sn=tt.base64ToBytes(sn)),sn instanceof Uint8Array){if(sn.length===0)throw new TypeError("empty macaroon data");const pn=new xt(sn),Tn=[];do Tn.push(En(pn));while(pn.length>0);return Tn}return Array.isArray(sn)?sn.map(pn=>wn(pn)):[wn(sn)]};const wn=function(sn){return rn(sn)?Jt(sn):vn(sn)};function rn(sn){return kt(sn.signature)}const Jt=function(sn){const pn=sn.caveats&&sn.caveats.map(Tn=>{const In={identifierBytes:St(Rt(Tn.cid,"Caveat id")),locationStr:$t(Tn.cl,"Caveat location")};return Tn.vid&&(In.vidBytes=tt.base64ToBytes(Rt(Tn.vid,"Caveat verification id"))),In});return new dn({version:1,locationStr:$t(sn.location,"Macaroon location"),identifierBytes:St(Rt(sn.identifier,"Macaroon identifier")),caveats:pn,signatureBytes:Lt(sn.signature)})},vn=function(sn){if(sn.v!==2&&sn.v!==void 0)throw new Error(`Unsupported macaroon version ${sn.v}`);const pn={version:2,signatureBytes:Cn(sn,"s",!0),locationStr:Tt(Cn(sn,"l",!1)),identifierBytes:Cn(sn,"i",!0)};if(sn.c){if(!Array.isArray(sn.c))throw new Error("caveats field does not hold an array");pn.caveats=sn.c.map(Tn=>({identifierBytes:Cn(Tn,"i",!0),locationStr:Tt(Cn(Tn,"l")),vidBytes:Cn(Tn,"v",!1)}))}return new dn(pn)};function Cn(sn,pn,Tn){if(sn.hasOwnProperty(pn))return St(sn[pn]);const In=pn+"64";if(sn.hasOwnProperty(In))return tt.base64ToBytes(sn[In]);if(Tn)throw new Error("Expected key: "+pn);return null}const $n=function(sn){const pn=sn.readByte();if(pn!==2)throw new Error(`Only version 2 is supported, found version ${pn}`);const Tn=Tt(zt(sn,ht)),In=Ot(sn,dt),yn=[];for(Ot(sn,ut);!zt(sn,ut);){const fn={locationStr:Tt(zt(sn,ht)),identifierBytes:Ot(sn,dt),vidBytes:zt(sn,pt)};Ot(sn,ut),yn.push(fn)}const hn=Ot(sn,mt);if(sn.length!==0)throw new Error("unexpected extra data at end of macaroon");return new dn({version:pn,locationStr:Tn,identifierBytes:In,signatureBytes:hn,caveats:yn})},Nn=function(sn){return 48<=sn&&sn<=58||97<=sn&&sn<=102},En=function(sn){if(sn.length===0)throw new Error("Empty macaroon data");const pn=sn.peekByte();if(pn===2)return $n(sn);throw Nn(pn)?new Error("Version 1 binary format not supported"):new Error("Cannot determine data format of binary-encoded macaroon")};tt.newMacaroon=function({identifier:sn,location:pn,rootKey:Tn,version:In}){const yn=vt(sn,"Macaroon identifier"),hn=vt(Tn,"Macaroon root key");return new dn({version:In===void 0?2:In,identifierBytes:yn,locationStr:$t(pn,"Macaroon location"),signatureBytes:Ct(Nt(Ht(Et(hn)),Et(yn)))})},tt.dischargeMacaroon=function(sn,pn,Tn,In){const yn=sn.signature,hn=[sn];let fn=0,xn=!1;const jn=sn.location,cn=kn=>{xn||(kn.bindToRoot(yn),hn.push(kn),fn--,Kt(kn))},Xt=kn=>{xn||(In(kn),xn=!0)},Kt=kn=>{let Mn,On;for(On=0;Ontt.LATEST_VERSION)throw new ut(mt.version);if(mt.version&&(this.version=mt.version),ot(typeof this.version=="number","Identifier version must be a number"),ot(mt.paymentHash.length===32,`Expected 32-byte hash, instead got ${mt.paymentHash.length}`),this.paymentHash=mt.paymentHash,mt.tokenId)this.tokenId=mt.tokenId;else{const gt=(0,lt.default)();this.tokenId=st.default.createHash("sha256").update(Buffer.from(gt)).digest()}return ot(this.tokenId.length===tt.TOKEN_ID_SIZE,"Token Id of unexpected size"),this}toString(){return this.toHex()}static fromString(mt){try{return new this().fromHex(mt)}catch{return new this().fromBase64(mt)}}write(mt){switch(mt.writeU16BE(this.version),this.version){case 0:return mt.writeHash(this.paymentHash),ot(Buffer.isBuffer(this.tokenId)&&this.tokenId.length===tt.TOKEN_ID_SIZE,`Token ID must be ${tt.TOKEN_ID_SIZE}-byte hash`),mt.writeBytes(this.tokenId),this;default:throw new ut(this.version)}}read(mt){switch(this.version=mt.readU16BE(),this.version){case 0:return this.paymentHash=mt.readHash(),this.tokenId=mt.readBytes(tt.TOKEN_ID_SIZE),this;default:throw new ut(this.version)}}}tt.Identifier=ht;const dt=pt=>{const mt=ct.importMacaroon(pt);let gt=mt._exportAsJSONObjectV2().i;if(gt==null&&(gt=mt._exportAsJSONObjectV2().i64,gt==null))throw new Error("Problem parsing macaroon identifier");return gt};tt.decodeIdentifierFromMacaroon=dt})(identifier$1);var caveat={};/*! +`))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var rngBrowser={exports:{}},getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);rngBrowser.exports=function(){for(var et=0,nt;et<16;et++)et&3||(nt=Math.random()*4294967296),rnds[et]=nt>>>((et&3)<<3)&255;return rnds}}var rngBrowserExports=rngBrowser.exports,byteToHex=[];for(var i$4=0;i$4<256;++i$4)byteToHex[i$4]=(i$4+256).toString(16).substr(1);function bytesToUuid$1(tt,et){var nt=et||0,rt=byteToHex;return[rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],"-",rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]],rt[tt[nt++]]].join("")}var bytesToUuid_1=bytesToUuid$1,rng=rngBrowserExports,bytesToUuid=bytesToUuid_1;function v4(tt,et,nt){var rt=et&&nt||0;typeof tt=="string"&&(et=tt==="binary"?new Array(16):null,tt=null),tt=tt||{};var it=tt.random||(tt.rng||rng)();if(it[6]=it[6]&15|64,it[8]=it[8]&63|128,et)for(var ot=0;ot<16;++ot)et[rt+ot]=it[ot];return et||bytesToUuid(it)}var v4_1=v4,macaroon$1={},sjcl={exports:{}};(function(tt){var et={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(mt){this.toString=function(){return"CORRUPT: "+this.message},this.message=mt},invalid:function(mt){this.toString=function(){return"INVALID: "+this.message},this.message=mt},bug:function(mt){this.toString=function(){return"BUG: "+this.message},this.message=mt},notReady:function(mt){this.toString=function(){return"NOT READY: "+this.message},this.message=mt}}};et.cipher.aes=function(mt){this.s[0][0][0]||this.O();var gt,yt,bt,wt,xt=this.s[0][4],kt=this.s[1];gt=mt.length;var St=1;if(gt!==4&>!==6&>!==8)throw new et.exception.invalid("invalid aes key size");for(this.b=[bt=mt.slice(0),wt=[]],mt=gt;mt<4*gt+28;mt++)yt=bt[mt-1],(mt%gt===0||gt===8&&mt%gt===4)&&(yt=xt[yt>>>24]<<24^xt[yt>>16&255]<<16^xt[yt>>8&255]<<8^xt[yt&255],mt%gt===0&&(yt=yt<<8^yt>>>24^St<<24,St=St<<1^283*(St>>7))),bt[mt]=bt[mt-gt]^yt;for(gt=0;mt;gt++,mt--)yt=bt[gt&3?mt:mt-4],wt[gt]=4>=mt||4>gt?yt:kt[0][xt[yt>>>24]]^kt[1][xt[yt>>16&255]]^kt[2][xt[yt>>8&255]]^kt[3][xt[yt&255]]},et.cipher.aes.prototype={encrypt:function(mt){return nt(this,mt,0)},decrypt:function(mt){return nt(this,mt,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var mt=this.s[0],gt=this.s[1],yt=mt[4],bt=gt[4],wt,xt,kt,St=[],Tt=[],At,Et,Ct,Lt;for(wt=0;256>wt;wt++)Tt[(St[wt]=wt<<1^283*(wt>>7))^wt]=wt;for(xt=kt=0;!yt[xt];xt^=At||1,kt=Tt[kt]||1)for(Ct=kt^kt<<1^kt<<2^kt<<3^kt<<4,Ct=Ct>>8^Ct&255^99,yt[xt]=Ct,bt[Ct]=xt,Et=St[wt=St[At=St[xt]]],Lt=16843009*Et^65537*wt^257*At^16843008*xt,Et=257*St[Ct]^16843008*Ct,wt=0;4>wt;wt++)mt[wt][xt]=Et=Et<<24^Et>>>8,gt[wt][Ct]=Lt=Lt<<24^Lt>>>8;for(wt=0;5>wt;wt++)mt[wt]=mt[wt].slice(0),gt[wt]=gt[wt].slice(0)}};function nt(mt,gt,yt){if(gt.length!==4)throw new et.exception.invalid("invalid aes block size");var bt=mt.b[yt],wt=gt[0]^bt[0],xt=gt[yt?3:1]^bt[1],kt=gt[2]^bt[2];gt=gt[yt?1:3]^bt[3];var St,Tt,At,Et=bt.length/4-2,Ct,Lt=4,jt=[0,0,0,0];St=mt.s[yt],mt=St[0];var Rt=St[1],$t=St[2],vt=St[3],It=St[4];for(Ct=0;Ct>>24]^Rt[xt>>16&255]^$t[kt>>8&255]^vt[gt&255]^bt[Lt],Tt=mt[xt>>>24]^Rt[kt>>16&255]^$t[gt>>8&255]^vt[wt&255]^bt[Lt+1],At=mt[kt>>>24]^Rt[gt>>16&255]^$t[wt>>8&255]^vt[xt&255]^bt[Lt+2],gt=mt[gt>>>24]^Rt[wt>>16&255]^$t[xt>>8&255]^vt[kt&255]^bt[Lt+3],Lt+=4,wt=St,xt=Tt,kt=At;for(Ct=0;4>Ct;Ct++)jt[yt?3&-Ct:Ct]=It[wt>>>24]<<24^It[xt>>16&255]<<16^It[kt>>8&255]<<8^It[gt&255]^bt[Lt++],St=wt,wt=xt,xt=kt,kt=gt,gt=St;return jt}et.bitArray={bitSlice:function(mt,gt,yt){return mt=et.bitArray.$(mt.slice(gt/32),32-(gt&31)).slice(1),yt===void 0?mt:et.bitArray.clamp(mt,yt-gt)},extract:function(mt,gt,yt){var bt=Math.floor(-gt-yt&31);return((gt+yt-1^gt)&-32?mt[gt/32|0]<<32-bt^mt[gt/32+1|0]>>>bt:mt[gt/32|0]>>>bt)&(1<>gt-1,1)),mt},partial:function(mt,gt,yt){return mt===32?gt:(yt?gt|0:gt<<32-mt)+1099511627776*mt},getPartial:function(mt){return Math.round(mt/1099511627776)||32},equal:function(mt,gt){if(et.bitArray.bitLength(mt)!==et.bitArray.bitLength(gt))return!1;var yt=0,bt;for(bt=0;bt>>gt),yt=mt[wt]<<32-gt;return wt=mt.length?mt[mt.length-1]:0,mt=et.bitArray.getPartial(wt),bt.push(et.bitArray.partial(gt+mt&31,32>>24|yt>>>8&65280|(yt&65280)<<8|yt<<24;return mt}},et.codec.utf8String={fromBits:function(mt){var gt="",yt=et.bitArray.bitLength(mt),bt,wt;for(bt=0;bt>>8>>>8>>>8),wt<<=8;return decodeURIComponent(escape(gt))},toBits:function(mt){mt=unescape(encodeURIComponent(mt));var gt=[],yt,bt=0;for(yt=0;yt>>kt)>>>wt),ktEt){if(!gt)try{return et.codec.base32hex.toBits(mt)}catch{}throw new et.exception.invalid("this isn't "+Ct+"!")}St>wt?(St-=wt,xt.push(At^Et>>>St),At=Et<>>wt)>>>26),6>wt?(kt=mt[yt]<<6-wt,wt+=26,yt++):(kt<<=6,wt-=6);for(;bt.length&3&&!gt;)bt+="=";return bt},toBits:function(mt,gt){mt=mt.replace(/\s|=/g,"");var yt=[],bt,wt=0,xt=et.codec.base64.B,kt=0,St;for(gt&&(xt=xt.substr(0,62)+"-_"),bt=0;btSt)throw new et.exception.invalid("this isn't base64!");26>>wt),kt=St<<32-wt):(wt+=6,kt^=St<<32-wt)}return wt&56&&yt.push(et.bitArray.partial(wt&56,kt,1)),yt}},et.codec.base64url={fromBits:function(mt){return et.codec.base64.fromBits(mt,1,1)},toBits:function(mt){return et.codec.base64.toBits(mt,1)}},et.hash.sha256=function(mt){this.b[0]||this.O(),mt?(this.F=mt.F.slice(0),this.A=mt.A.slice(0),this.l=mt.l):this.reset()},et.hash.sha256.hash=function(mt){return new et.hash.sha256().update(mt).finalize()},et.hash.sha256.prototype={blockSize:512,reset:function(){return this.F=this.Y.slice(0),this.A=[],this.l=0,this},update:function(mt){typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt));var gt,yt=this.A=et.bitArray.concat(this.A,mt);if(gt=this.l,mt=this.l=gt+et.bitArray.bitLength(mt),9007199254740991gt;yt++){for(wt=!0,bt=2;bt*bt<=yt;bt++)if(yt%bt===0){wt=!1;break}wt&&(8>gt&&(this.Y[gt]=mt(Math.pow(yt,.5))),this.b[gt]=mt(Math.pow(yt,1/3)),gt++)}}};function rt(mt,gt){var yt,bt,wt,xt=mt.F,kt=mt.b,St=xt[0],Tt=xt[1],At=xt[2],Et=xt[3],Ct=xt[4],Lt=xt[5],jt=xt[6],Rt=xt[7];for(yt=0;64>yt;yt++)16>yt?bt=gt[yt]:(bt=gt[yt+1&15],wt=gt[yt+14&15],bt=gt[yt&15]=(bt>>>7^bt>>>18^bt>>>3^bt<<25^bt<<14)+(wt>>>17^wt>>>19^wt>>>10^wt<<15^wt<<13)+gt[yt&15]+gt[yt+9&15]|0),bt=bt+Rt+(Ct>>>6^Ct>>>11^Ct>>>25^Ct<<26^Ct<<21^Ct<<7)+(jt^Ct&(Lt^jt))+kt[yt],Rt=jt,jt=Lt,Lt=Ct,Ct=Et+bt|0,Et=At,At=Tt,Tt=St,St=bt+(Tt&At^Et&(Tt^At))+(Tt>>>2^Tt>>>13^Tt>>>22^Tt<<30^Tt<<19^Tt<<10)|0;xt[0]=xt[0]+St|0,xt[1]=xt[1]+Tt|0,xt[2]=xt[2]+At|0,xt[3]=xt[3]+Et|0,xt[4]=xt[4]+Ct|0,xt[5]=xt[5]+Lt|0,xt[6]=xt[6]+jt|0,xt[7]=xt[7]+Rt|0}et.mode.ccm={name:"ccm",G:[],listenProgress:function(mt){et.mode.ccm.G.push(mt)},unListenProgress:function(mt){mt=et.mode.ccm.G.indexOf(mt),-1Tt)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(xt=2;4>xt&&At>>>8*xt;xt++);return xt<15-Tt&&(xt=15-Tt),yt=St.clamp(yt,8*(15-xt)),gt=et.mode.ccm.V(mt,gt,yt,bt,wt,xt),kt=et.mode.ccm.C(mt,kt,yt,gt,wt,xt),St.concat(kt.data,kt.tag)},decrypt:function(mt,gt,yt,bt,wt){wt=wt||64,bt=bt||[];var xt=et.bitArray,kt=xt.bitLength(yt)/8,At=xt.bitLength(gt),St=xt.clamp(gt,At-wt),Tt=xt.bitSlice(gt,At-wt),At=(At-wt)/8;if(7>kt)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(gt=2;4>gt&&At>>>8*gt;gt++);if(gt<15-kt&&(gt=15-kt),yt=xt.clamp(yt,8*(15-gt)),St=et.mode.ccm.C(mt,St,yt,Tt,wt,gt),mt=et.mode.ccm.V(mt,St.data,yt,bt,wt,gt),!xt.equal(St.tag,mt))throw new et.exception.corrupt("ccm: tag doesn't match");return St.data},na:function(mt,gt,yt,bt,wt,xt){var kt=[],St=et.bitArray,Tt=St.i;if(bt=[St.partial(8,(gt.length?64:0)|bt-2<<2|xt-1)],bt=St.concat(bt,yt),bt[3]|=wt,bt=mt.encrypt(bt),gt.length)for(yt=St.bitLength(gt)/8,65279>=yt?kt=[St.partial(16,yt)]:4294967295>=yt&&(kt=St.concat([St.partial(16,65534)],[yt])),kt=St.concat(kt,gt),gt=0;gtwt||16Et&&(et.mode.ccm.fa(kt/Tt),Et+=Ct),yt[3]++,wt=mt.encrypt(yt),gt[kt]^=wt[0],gt[kt+1]^=wt[1],gt[kt+2]^=wt[2],gt[kt+3]^=wt[3];return{tag:bt,data:St.clamp(gt,At)}}},et.mode.ocb2={name:"ocb2",encrypt:function(mt,gt,yt,bt,wt,xt){if(et.bitArray.bitLength(yt)!==128)throw new et.exception.invalid("ocb iv must be 128 bits");var kt,St=et.mode.ocb2.S,Tt=et.bitArray,At=Tt.i,Et=[0,0,0,0];yt=St(mt.encrypt(yt));var Ct,Lt=[];for(bt=bt||[],wt=wt||64,kt=0;kt+4wt.bitLength(yt)&&(St=xt(St,bt(St)),yt=wt.concat(yt,[-2147483648,0,0,0])),kt=xt(kt,yt),mt.encrypt(xt(bt(xt(St,bt(St))),kt))},S:function(mt){return[mt[0]<<1^mt[1]>>>31,mt[1]<<1^mt[2]>>>31,mt[2]<<1^mt[3]>>>31,mt[3]<<1^135*(mt[0]>>>31)]}},et.mode.gcm={name:"gcm",encrypt:function(mt,gt,yt,bt,wt){var xt=gt.slice(0);return gt=et.bitArray,bt=bt||[],mt=et.mode.gcm.C(!0,mt,xt,bt,yt,wt||128),gt.concat(mt.data,mt.tag)},decrypt:function(mt,gt,yt,bt,wt){var xt=gt.slice(0),kt=et.bitArray,St=kt.bitLength(xt);if(wt=wt||128,bt=bt||[],wt<=St?(gt=kt.bitSlice(xt,St-wt),xt=kt.bitSlice(xt,0,St-wt)):(gt=xt,xt=[]),mt=et.mode.gcm.C(!1,mt,xt,bt,yt,wt),!kt.equal(mt.tag,gt))throw new et.exception.corrupt("gcm: tag doesn't match");return mt.data},ka:function(mt,gt){var yt,bt,wt,xt,kt,St=et.bitArray.i;for(wt=[0,0,0,0],xt=gt.slice(0),yt=0;128>yt;yt++){for((bt=(mt[Math.floor(yt/32)]&1<<31-yt%32)!==0)&&(wt=St(wt,xt)),kt=(xt[3]&1)!==0,bt=3;0>>1|(xt[bt-1]&1)<<31;xt[0]>>>=1,kt&&(xt[0]^=-520093696)}return wt},j:function(mt,gt,yt){var bt,wt=yt.length;for(gt=gt.slice(0),bt=0;btwt&&(mt=gt.hash(mt)),bt=0;btbt||0>yt)throw new et.exception.invalid("invalid params to pbkdf2");typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt)),typeof gt=="string"&&(gt=et.codec.utf8String.toBits(gt)),wt=wt||et.misc.hmac,mt=new wt(mt);var xt,kt,St,Tt,At=[],Et=et.bitArray;for(Tt=1;32*At.length<(bt||1);Tt++){for(wt=xt=mt.encrypt(Et.concat(gt,[Tt])),kt=1;ktkt;kt++)wt.push(4294967296*Math.random()|0);for(kt=0;kt=1<this.o&&(this.o=xt),this.P++,this.b=et.hash.sha256.hash(this.b.concat(wt)),this.L=new et.cipher.aes(this.b),bt=0;4>bt&&(this.h[bt]=this.h[bt]+1|0,!this.h[bt]);bt++);}for(bt=0;bt>>1;this.c[kt].update([bt,this.N++,2,gt,xt,mt.length].concat(mt))}break;case"string":gt===void 0&&(gt=mt.length),this.c[kt].update([bt,this.N++,3,gt,xt,mt.length]),this.c[kt].update(mt);break;default:Tt=1}if(Tt)throw new et.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[kt]+=gt,this.f+=gt,St===this.u&&(this.isReady()!==this.u&&it("seeded",Math.max(this.o,this.f)),it("progress",this.getProgress()))},isReady:function(mt){return mt=this.T[mt!==void 0?mt:this.M],this.o&&this.o>=mt?this.m[0]>this.ba&&new Date().valueOf()>this.Z?this.J|this.I:this.I:this.f>=mt?this.J|this.u:this.u},getProgress:function(mt){return mt=this.T[mt||this.M],this.o>=mt||this.f>mt?1:this.f/mt},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:lt(this,this.ma),mouseCollector:lt(this,this.oa),keyboardCollector:lt(this,this.la),accelerometerCollector:lt(this,this.ea),touchCollector:lt(this,this.qa)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector);else throw new et.exception.bug("can't attach event");this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(mt,gt){this.K[mt][this.ga++]=gt},removeEventListener:function(mt,gt){var yt,bt,wt=this.K[mt],xt=[];for(bt in wt)wt.hasOwnProperty(bt)&&wt[bt]===gt&&xt.push(bt);for(yt=0;ytgt&&(mt.h[gt]=mt.h[gt]+1|0,!mt.h[gt]);gt++);return mt.L.encrypt(mt.h)}function lt(mt,gt){return function(){gt.apply(mt,arguments)}}et.random=new et.prng(6);e:try{var ct,ut,ht,dt;if(dt=tt.exports){var pt;try{pt=requireCryptoBrowserify()}catch{pt=null}dt=ut=pt}if(dt&&ut.randomBytes)ct=ut.randomBytes(128),ct=new Uint32Array(new Uint8Array(ct).buffer),et.random.addEntropy(ct,1024,"crypto['randomBytes']");else if(typeof window<"u"&&typeof Uint32Array<"u"){if(ht=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(ht);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(ht);else break e;et.random.addEntropy(ht,1024,"crypto['getRandomValues']")}}catch(mt){typeof window<"u"&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(mt))}et.json={defaults:{v:1,iter:1e4,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(mt,gt,yt,bt){yt=yt||{},bt=bt||{};var wt=et.json,xt=wt.g({iv:et.random.randomWords(4,0)},wt.defaults),kt;if(wt.g(xt,yt),yt=xt.adata,typeof xt.salt=="string"&&(xt.salt=et.codec.base64.toBits(xt.salt)),typeof xt.iv=="string"&&(xt.iv=et.codec.base64.toBits(xt.iv)),!et.mode[xt.mode]||!et.cipher[xt.cipher]||typeof mt=="string"&&100>=xt.iter||xt.ts!==64&&xt.ts!==96&&xt.ts!==128||xt.ks!==128&&xt.ks!==192&&xt.ks!==256||2>xt.iv.length||4=gt.iter||gt.ts!==64&>.ts!==96&>.ts!==128||gt.ks!==128&>.ks!==192&>.ks!==256||!gt.iv||2>gt.iv.length||4>24&255,_n[Pn+1]=un>>16&255,_n[Pn+2]=un>>8&255,_n[Pn+3]=un&255,_n[Pn+4]=Jt>>24&255,_n[Pn+5]=Jt>>16&255,_n[Pn+6]=Jt>>8&255,_n[Pn+7]=Jt&255}function gt(_n,Pn,un,Jt,Sn){var Dn,Fn=0;for(Dn=0;Dn>>8)-1}function yt(_n,Pn,un,Jt){return gt(_n,Pn,un,Jt,16)}function bt(_n,Pn,un,Jt){return gt(_n,Pn,un,Jt,32)}function wt(_n,Pn,un,Jt){for(var Sn=Jt[0]&255|(Jt[1]&255)<<8|(Jt[2]&255)<<16|(Jt[3]&255)<<24,Dn=un[0]&255|(un[1]&255)<<8|(un[2]&255)<<16|(un[3]&255)<<24,Fn=un[4]&255|(un[5]&255)<<8|(un[6]&255)<<16|(un[7]&255)<<24,Yn=un[8]&255|(un[9]&255)<<8|(un[10]&255)<<16|(un[11]&255)<<24,tr=un[12]&255|(un[13]&255)<<8|(un[14]&255)<<16|(un[15]&255)<<24,ar=Jt[4]&255|(Jt[5]&255)<<8|(Jt[6]&255)<<16|(Jt[7]&255)<<24,lr=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,vr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,Nr=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Jt[8]&255|(Jt[9]&255)<<8|(Jt[10]&255)<<16|(Jt[11]&255)<<24,eo=un[16]&255|(un[17]&255)<<8|(un[18]&255)<<16|(un[19]&255)<<24,Jr=un[20]&255|(un[21]&255)<<8|(un[22]&255)<<16|(un[23]&255)<<24,Zr=un[24]&255|(un[25]&255)<<8|(un[26]&255)<<16|(un[27]&255)<<24,br=un[28]&255|(un[29]&255)<<8|(un[30]&255)<<16|(un[31]&255)<<24,Pr=Jt[12]&255|(Jt[13]&255)<<8|(Jt[14]&255)<<16|(Jt[15]&255)<<24,Fr=Sn,Mr=Dn,Cr=Fn,Dr=Yn,Ur=tr,Rr=ar,er=lr,rr=Vr,xr=vr,dr=Nr,yr=Hr,$r=eo,no=Jr,ao=Zr,ho=br,fo=Pr,qn,wo=0;wo<20;wo+=2)qn=Fr+no|0,Ur^=qn<<7|qn>>>32-7,qn=Ur+Fr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Ur|0,no^=qn<<13|qn>>>32-13,qn=no+xr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Mr|0,dr^=qn<<7|qn>>>32-7,qn=dr+Rr|0,ao^=qn<<9|qn>>>32-9,qn=ao+dr|0,Mr^=qn<<13|qn>>>32-13,qn=Mr+ao|0,Rr^=qn<<18|qn>>>32-18,qn=yr+er|0,ho^=qn<<7|qn>>>32-7,qn=ho+yr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+ho|0,er^=qn<<13|qn>>>32-13,qn=er+Cr|0,yr^=qn<<18|qn>>>32-18,qn=fo+$r|0,Dr^=qn<<7|qn>>>32-7,qn=Dr+fo|0,rr^=qn<<9|qn>>>32-9,qn=rr+Dr|0,$r^=qn<<13|qn>>>32-13,qn=$r+rr|0,fo^=qn<<18|qn>>>32-18,qn=Fr+Dr|0,Mr^=qn<<7|qn>>>32-7,qn=Mr+Fr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+Mr|0,Dr^=qn<<13|qn>>>32-13,qn=Dr+Cr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Ur|0,er^=qn<<7|qn>>>32-7,qn=er+Rr|0,rr^=qn<<9|qn>>>32-9,qn=rr+er|0,Ur^=qn<<13|qn>>>32-13,qn=Ur+rr|0,Rr^=qn<<18|qn>>>32-18,qn=yr+dr|0,$r^=qn<<7|qn>>>32-7,qn=$r+yr|0,xr^=qn<<9|qn>>>32-9,qn=xr+$r|0,dr^=qn<<13|qn>>>32-13,qn=dr+xr|0,yr^=qn<<18|qn>>>32-18,qn=fo+ho|0,no^=qn<<7|qn>>>32-7,qn=no+fo|0,ao^=qn<<9|qn>>>32-9,qn=ao+no|0,ho^=qn<<13|qn>>>32-13,qn=ho+ao|0,fo^=qn<<18|qn>>>32-18;Fr=Fr+Sn|0,Mr=Mr+Dn|0,Cr=Cr+Fn|0,Dr=Dr+Yn|0,Ur=Ur+tr|0,Rr=Rr+ar|0,er=er+lr|0,rr=rr+Vr|0,xr=xr+vr|0,dr=dr+Nr|0,yr=yr+Hr|0,$r=$r+eo|0,no=no+Jr|0,ao=ao+Zr|0,ho=ho+br|0,fo=fo+Pr|0,_n[0]=Fr>>>0&255,_n[1]=Fr>>>8&255,_n[2]=Fr>>>16&255,_n[3]=Fr>>>24&255,_n[4]=Mr>>>0&255,_n[5]=Mr>>>8&255,_n[6]=Mr>>>16&255,_n[7]=Mr>>>24&255,_n[8]=Cr>>>0&255,_n[9]=Cr>>>8&255,_n[10]=Cr>>>16&255,_n[11]=Cr>>>24&255,_n[12]=Dr>>>0&255,_n[13]=Dr>>>8&255,_n[14]=Dr>>>16&255,_n[15]=Dr>>>24&255,_n[16]=Ur>>>0&255,_n[17]=Ur>>>8&255,_n[18]=Ur>>>16&255,_n[19]=Ur>>>24&255,_n[20]=Rr>>>0&255,_n[21]=Rr>>>8&255,_n[22]=Rr>>>16&255,_n[23]=Rr>>>24&255,_n[24]=er>>>0&255,_n[25]=er>>>8&255,_n[26]=er>>>16&255,_n[27]=er>>>24&255,_n[28]=rr>>>0&255,_n[29]=rr>>>8&255,_n[30]=rr>>>16&255,_n[31]=rr>>>24&255,_n[32]=xr>>>0&255,_n[33]=xr>>>8&255,_n[34]=xr>>>16&255,_n[35]=xr>>>24&255,_n[36]=dr>>>0&255,_n[37]=dr>>>8&255,_n[38]=dr>>>16&255,_n[39]=dr>>>24&255,_n[40]=yr>>>0&255,_n[41]=yr>>>8&255,_n[42]=yr>>>16&255,_n[43]=yr>>>24&255,_n[44]=$r>>>0&255,_n[45]=$r>>>8&255,_n[46]=$r>>>16&255,_n[47]=$r>>>24&255,_n[48]=no>>>0&255,_n[49]=no>>>8&255,_n[50]=no>>>16&255,_n[51]=no>>>24&255,_n[52]=ao>>>0&255,_n[53]=ao>>>8&255,_n[54]=ao>>>16&255,_n[55]=ao>>>24&255,_n[56]=ho>>>0&255,_n[57]=ho>>>8&255,_n[58]=ho>>>16&255,_n[59]=ho>>>24&255,_n[60]=fo>>>0&255,_n[61]=fo>>>8&255,_n[62]=fo>>>16&255,_n[63]=fo>>>24&255}function xt(_n,Pn,un,Jt){for(var Sn=Jt[0]&255|(Jt[1]&255)<<8|(Jt[2]&255)<<16|(Jt[3]&255)<<24,Dn=un[0]&255|(un[1]&255)<<8|(un[2]&255)<<16|(un[3]&255)<<24,Fn=un[4]&255|(un[5]&255)<<8|(un[6]&255)<<16|(un[7]&255)<<24,Yn=un[8]&255|(un[9]&255)<<8|(un[10]&255)<<16|(un[11]&255)<<24,tr=un[12]&255|(un[13]&255)<<8|(un[14]&255)<<16|(un[15]&255)<<24,ar=Jt[4]&255|(Jt[5]&255)<<8|(Jt[6]&255)<<16|(Jt[7]&255)<<24,lr=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,vr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,Nr=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Jt[8]&255|(Jt[9]&255)<<8|(Jt[10]&255)<<16|(Jt[11]&255)<<24,eo=un[16]&255|(un[17]&255)<<8|(un[18]&255)<<16|(un[19]&255)<<24,Jr=un[20]&255|(un[21]&255)<<8|(un[22]&255)<<16|(un[23]&255)<<24,Zr=un[24]&255|(un[25]&255)<<8|(un[26]&255)<<16|(un[27]&255)<<24,br=un[28]&255|(un[29]&255)<<8|(un[30]&255)<<16|(un[31]&255)<<24,Pr=Jt[12]&255|(Jt[13]&255)<<8|(Jt[14]&255)<<16|(Jt[15]&255)<<24,Fr=Sn,Mr=Dn,Cr=Fn,Dr=Yn,Ur=tr,Rr=ar,er=lr,rr=Vr,xr=vr,dr=Nr,yr=Hr,$r=eo,no=Jr,ao=Zr,ho=br,fo=Pr,qn,wo=0;wo<20;wo+=2)qn=Fr+no|0,Ur^=qn<<7|qn>>>32-7,qn=Ur+Fr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Ur|0,no^=qn<<13|qn>>>32-13,qn=no+xr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Mr|0,dr^=qn<<7|qn>>>32-7,qn=dr+Rr|0,ao^=qn<<9|qn>>>32-9,qn=ao+dr|0,Mr^=qn<<13|qn>>>32-13,qn=Mr+ao|0,Rr^=qn<<18|qn>>>32-18,qn=yr+er|0,ho^=qn<<7|qn>>>32-7,qn=ho+yr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+ho|0,er^=qn<<13|qn>>>32-13,qn=er+Cr|0,yr^=qn<<18|qn>>>32-18,qn=fo+$r|0,Dr^=qn<<7|qn>>>32-7,qn=Dr+fo|0,rr^=qn<<9|qn>>>32-9,qn=rr+Dr|0,$r^=qn<<13|qn>>>32-13,qn=$r+rr|0,fo^=qn<<18|qn>>>32-18,qn=Fr+Dr|0,Mr^=qn<<7|qn>>>32-7,qn=Mr+Fr|0,Cr^=qn<<9|qn>>>32-9,qn=Cr+Mr|0,Dr^=qn<<13|qn>>>32-13,qn=Dr+Cr|0,Fr^=qn<<18|qn>>>32-18,qn=Rr+Ur|0,er^=qn<<7|qn>>>32-7,qn=er+Rr|0,rr^=qn<<9|qn>>>32-9,qn=rr+er|0,Ur^=qn<<13|qn>>>32-13,qn=Ur+rr|0,Rr^=qn<<18|qn>>>32-18,qn=yr+dr|0,$r^=qn<<7|qn>>>32-7,qn=$r+yr|0,xr^=qn<<9|qn>>>32-9,qn=xr+$r|0,dr^=qn<<13|qn>>>32-13,qn=dr+xr|0,yr^=qn<<18|qn>>>32-18,qn=fo+ho|0,no^=qn<<7|qn>>>32-7,qn=no+fo|0,ao^=qn<<9|qn>>>32-9,qn=ao+no|0,ho^=qn<<13|qn>>>32-13,qn=ho+ao|0,fo^=qn<<18|qn>>>32-18;_n[0]=Fr>>>0&255,_n[1]=Fr>>>8&255,_n[2]=Fr>>>16&255,_n[3]=Fr>>>24&255,_n[4]=Rr>>>0&255,_n[5]=Rr>>>8&255,_n[6]=Rr>>>16&255,_n[7]=Rr>>>24&255,_n[8]=yr>>>0&255,_n[9]=yr>>>8&255,_n[10]=yr>>>16&255,_n[11]=yr>>>24&255,_n[12]=fo>>>0&255,_n[13]=fo>>>8&255,_n[14]=fo>>>16&255,_n[15]=fo>>>24&255,_n[16]=er>>>0&255,_n[17]=er>>>8&255,_n[18]=er>>>16&255,_n[19]=er>>>24&255,_n[20]=rr>>>0&255,_n[21]=rr>>>8&255,_n[22]=rr>>>16&255,_n[23]=rr>>>24&255,_n[24]=xr>>>0&255,_n[25]=xr>>>8&255,_n[26]=xr>>>16&255,_n[27]=xr>>>24&255,_n[28]=dr>>>0&255,_n[29]=dr>>>8&255,_n[30]=dr>>>16&255,_n[31]=dr>>>24&255}function kt(_n,Pn,un,Jt){wt(_n,Pn,un,Jt)}function St(_n,Pn,un,Jt){xt(_n,Pn,un,Jt)}var Tt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function At(_n,Pn,un,Jt,Sn,Dn,Fn){var Yn=new Uint8Array(16),tr=new Uint8Array(64),ar,lr;for(lr=0;lr<16;lr++)Yn[lr]=0;for(lr=0;lr<8;lr++)Yn[lr]=Dn[lr];for(;Sn>=64;){for(kt(tr,Yn,Fn,Tt),lr=0;lr<64;lr++)_n[Pn+lr]=un[Jt+lr]^tr[lr];for(ar=1,lr=8;lr<16;lr++)ar=ar+(Yn[lr]&255)|0,Yn[lr]=ar&255,ar>>>=8;Sn-=64,Pn+=64,Jt+=64}if(Sn>0)for(kt(tr,Yn,Fn,Tt),lr=0;lr=64;){for(kt(Fn,Dn,Sn,Tt),tr=0;tr<64;tr++)_n[Pn+tr]=Fn[tr];for(Yn=1,tr=8;tr<16;tr++)Yn=Yn+(Dn[tr]&255)|0,Dn[tr]=Yn&255,Yn>>>=8;un-=64,Pn+=64}if(un>0)for(kt(Fn,Dn,Sn,Tt),tr=0;tr>>13|un<<3)&8191,Jt=_n[4]&255|(_n[5]&255)<<8,this.r[2]=(un>>>10|Jt<<6)&7939,Sn=_n[6]&255|(_n[7]&255)<<8,this.r[3]=(Jt>>>7|Sn<<9)&8191,Dn=_n[8]&255|(_n[9]&255)<<8,this.r[4]=(Sn>>>4|Dn<<12)&255,this.r[5]=Dn>>>1&8190,Fn=_n[10]&255|(_n[11]&255)<<8,this.r[6]=(Dn>>>14|Fn<<2)&8191,Yn=_n[12]&255|(_n[13]&255)<<8,this.r[7]=(Fn>>>11|Yn<<5)&8065,tr=_n[14]&255|(_n[15]&255)<<8,this.r[8]=(Yn>>>8|tr<<8)&8191,this.r[9]=tr>>>5&127,this.pad[0]=_n[16]&255|(_n[17]&255)<<8,this.pad[1]=_n[18]&255|(_n[19]&255)<<8,this.pad[2]=_n[20]&255|(_n[21]&255)<<8,this.pad[3]=_n[22]&255|(_n[23]&255)<<8,this.pad[4]=_n[24]&255|(_n[25]&255)<<8,this.pad[5]=_n[26]&255|(_n[27]&255)<<8,this.pad[6]=_n[28]&255|(_n[29]&255)<<8,this.pad[7]=_n[30]&255|(_n[31]&255)<<8};jt.prototype.blocks=function(_n,Pn,un){for(var Jt=this.fin?0:2048,Sn,Dn,Fn,Yn,tr,ar,lr,Vr,vr,Nr,Hr,eo,Jr,Zr,br,Pr,Fr,Mr,Cr,Dr=this.h[0],Ur=this.h[1],Rr=this.h[2],er=this.h[3],rr=this.h[4],xr=this.h[5],dr=this.h[6],yr=this.h[7],$r=this.h[8],no=this.h[9],ao=this.r[0],ho=this.r[1],fo=this.r[2],qn=this.r[3],wo=this.r[4],vo=this.r[5],_o=this.r[6],yo=this.r[7],Ao=this.r[8],Mo=this.r[9];un>=16;)Sn=_n[Pn+0]&255|(_n[Pn+1]&255)<<8,Dr+=Sn&8191,Dn=_n[Pn+2]&255|(_n[Pn+3]&255)<<8,Ur+=(Sn>>>13|Dn<<3)&8191,Fn=_n[Pn+4]&255|(_n[Pn+5]&255)<<8,Rr+=(Dn>>>10|Fn<<6)&8191,Yn=_n[Pn+6]&255|(_n[Pn+7]&255)<<8,er+=(Fn>>>7|Yn<<9)&8191,tr=_n[Pn+8]&255|(_n[Pn+9]&255)<<8,rr+=(Yn>>>4|tr<<12)&8191,xr+=tr>>>1&8191,ar=_n[Pn+10]&255|(_n[Pn+11]&255)<<8,dr+=(tr>>>14|ar<<2)&8191,lr=_n[Pn+12]&255|(_n[Pn+13]&255)<<8,yr+=(ar>>>11|lr<<5)&8191,Vr=_n[Pn+14]&255|(_n[Pn+15]&255)<<8,$r+=(lr>>>8|Vr<<8)&8191,no+=Vr>>>5|Jt,vr=0,Nr=vr,Nr+=Dr*ao,Nr+=Ur*(5*Mo),Nr+=Rr*(5*Ao),Nr+=er*(5*yo),Nr+=rr*(5*_o),vr=Nr>>>13,Nr&=8191,Nr+=xr*(5*vo),Nr+=dr*(5*wo),Nr+=yr*(5*qn),Nr+=$r*(5*fo),Nr+=no*(5*ho),vr+=Nr>>>13,Nr&=8191,Hr=vr,Hr+=Dr*ho,Hr+=Ur*ao,Hr+=Rr*(5*Mo),Hr+=er*(5*Ao),Hr+=rr*(5*yo),vr=Hr>>>13,Hr&=8191,Hr+=xr*(5*_o),Hr+=dr*(5*vo),Hr+=yr*(5*wo),Hr+=$r*(5*qn),Hr+=no*(5*fo),vr+=Hr>>>13,Hr&=8191,eo=vr,eo+=Dr*fo,eo+=Ur*ho,eo+=Rr*ao,eo+=er*(5*Mo),eo+=rr*(5*Ao),vr=eo>>>13,eo&=8191,eo+=xr*(5*yo),eo+=dr*(5*_o),eo+=yr*(5*vo),eo+=$r*(5*wo),eo+=no*(5*qn),vr+=eo>>>13,eo&=8191,Jr=vr,Jr+=Dr*qn,Jr+=Ur*fo,Jr+=Rr*ho,Jr+=er*ao,Jr+=rr*(5*Mo),vr=Jr>>>13,Jr&=8191,Jr+=xr*(5*Ao),Jr+=dr*(5*yo),Jr+=yr*(5*_o),Jr+=$r*(5*vo),Jr+=no*(5*wo),vr+=Jr>>>13,Jr&=8191,Zr=vr,Zr+=Dr*wo,Zr+=Ur*qn,Zr+=Rr*fo,Zr+=er*ho,Zr+=rr*ao,vr=Zr>>>13,Zr&=8191,Zr+=xr*(5*Mo),Zr+=dr*(5*Ao),Zr+=yr*(5*yo),Zr+=$r*(5*_o),Zr+=no*(5*vo),vr+=Zr>>>13,Zr&=8191,br=vr,br+=Dr*vo,br+=Ur*wo,br+=Rr*qn,br+=er*fo,br+=rr*ho,vr=br>>>13,br&=8191,br+=xr*ao,br+=dr*(5*Mo),br+=yr*(5*Ao),br+=$r*(5*yo),br+=no*(5*_o),vr+=br>>>13,br&=8191,Pr=vr,Pr+=Dr*_o,Pr+=Ur*vo,Pr+=Rr*wo,Pr+=er*qn,Pr+=rr*fo,vr=Pr>>>13,Pr&=8191,Pr+=xr*ho,Pr+=dr*ao,Pr+=yr*(5*Mo),Pr+=$r*(5*Ao),Pr+=no*(5*yo),vr+=Pr>>>13,Pr&=8191,Fr=vr,Fr+=Dr*yo,Fr+=Ur*_o,Fr+=Rr*vo,Fr+=er*wo,Fr+=rr*qn,vr=Fr>>>13,Fr&=8191,Fr+=xr*fo,Fr+=dr*ho,Fr+=yr*ao,Fr+=$r*(5*Mo),Fr+=no*(5*Ao),vr+=Fr>>>13,Fr&=8191,Mr=vr,Mr+=Dr*Ao,Mr+=Ur*yo,Mr+=Rr*_o,Mr+=er*vo,Mr+=rr*wo,vr=Mr>>>13,Mr&=8191,Mr+=xr*qn,Mr+=dr*fo,Mr+=yr*ho,Mr+=$r*ao,Mr+=no*(5*Mo),vr+=Mr>>>13,Mr&=8191,Cr=vr,Cr+=Dr*Mo,Cr+=Ur*Ao,Cr+=Rr*yo,Cr+=er*_o,Cr+=rr*vo,vr=Cr>>>13,Cr&=8191,Cr+=xr*wo,Cr+=dr*qn,Cr+=yr*fo,Cr+=$r*ho,Cr+=no*ao,vr+=Cr>>>13,Cr&=8191,vr=(vr<<2)+vr|0,vr=vr+Nr|0,Nr=vr&8191,vr=vr>>>13,Hr+=vr,Dr=Nr,Ur=Hr,Rr=eo,er=Jr,rr=Zr,xr=br,dr=Pr,yr=Fr,$r=Mr,no=Cr,Pn+=16,un-=16;this.h[0]=Dr,this.h[1]=Ur,this.h[2]=Rr,this.h[3]=er,this.h[4]=rr,this.h[5]=xr,this.h[6]=dr,this.h[7]=yr,this.h[8]=$r,this.h[9]=no},jt.prototype.finish=function(_n,Pn){var un=new Uint16Array(10),Jt,Sn,Dn,Fn;if(this.leftover){for(Fn=this.leftover,this.buffer[Fn++]=1;Fn<16;Fn++)this.buffer[Fn]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(Jt=this.h[1]>>>13,this.h[1]&=8191,Fn=2;Fn<10;Fn++)this.h[Fn]+=Jt,Jt=this.h[Fn]>>>13,this.h[Fn]&=8191;for(this.h[0]+=Jt*5,Jt=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=Jt,Jt=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=Jt,un[0]=this.h[0]+5,Jt=un[0]>>>13,un[0]&=8191,Fn=1;Fn<10;Fn++)un[Fn]=this.h[Fn]+Jt,Jt=un[Fn]>>>13,un[Fn]&=8191;for(un[9]-=8192,Sn=(Jt^1)-1,Fn=0;Fn<10;Fn++)un[Fn]&=Sn;for(Sn=~Sn,Fn=0;Fn<10;Fn++)this.h[Fn]=this.h[Fn]&Sn|un[Fn];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Dn=this.h[0]+this.pad[0],this.h[0]=Dn&65535,Fn=1;Fn<8;Fn++)Dn=(this.h[Fn]+this.pad[Fn]|0)+(Dn>>>16)|0,this.h[Fn]=Dn&65535;_n[Pn+0]=this.h[0]>>>0&255,_n[Pn+1]=this.h[0]>>>8&255,_n[Pn+2]=this.h[1]>>>0&255,_n[Pn+3]=this.h[1]>>>8&255,_n[Pn+4]=this.h[2]>>>0&255,_n[Pn+5]=this.h[2]>>>8&255,_n[Pn+6]=this.h[3]>>>0&255,_n[Pn+7]=this.h[3]>>>8&255,_n[Pn+8]=this.h[4]>>>0&255,_n[Pn+9]=this.h[4]>>>8&255,_n[Pn+10]=this.h[5]>>>0&255,_n[Pn+11]=this.h[5]>>>8&255,_n[Pn+12]=this.h[6]>>>0&255,_n[Pn+13]=this.h[6]>>>8&255,_n[Pn+14]=this.h[7]>>>0&255,_n[Pn+15]=this.h[7]>>>8&255},jt.prototype.update=function(_n,Pn,un){var Jt,Sn;if(this.leftover){for(Sn=16-this.leftover,Sn>un&&(Sn=un),Jt=0;Jt=16&&(Sn=un-un%16,this.blocks(_n,Pn,Sn),Pn+=Sn,un-=Sn),un){for(Jt=0;Jt>16&1),Dn[un-1]&=65535;Dn[15]=Fn[15]-32767-(Dn[14]>>16&1),Sn=Dn[15]>>16&1,Dn[14]&=65535,zt(Fn,Dn,1-Sn)}for(un=0;un<16;un++)_n[2*un]=Fn[un]&255,_n[2*un+1]=Fn[un]>>8}function Nt(_n,Pn){var un=new Uint8Array(32),Jt=new Uint8Array(32);return Ft(un,_n),Ft(Jt,Pn),bt(un,0,Jt,0)}function Ut(_n){var Pn=new Uint8Array(32);return Ft(Pn,_n),Pn[0]&1}function Pt(_n,Pn){var un;for(un=0;un<16;un++)_n[un]=Pn[2*un]+(Pn[2*un+1]<<8);_n[15]&=32767}function Ht(_n,Pn,un){for(var Jt=0;Jt<16;Jt++)_n[Jt]=Pn[Jt]+un[Jt]}function Qt(_n,Pn,un){for(var Jt=0;Jt<16;Jt++)_n[Jt]=Pn[Jt]-un[Jt]}function an(_n,Pn,un){var Jt,Sn,Dn=0,Fn=0,Yn=0,tr=0,ar=0,lr=0,Vr=0,vr=0,Nr=0,Hr=0,eo=0,Jr=0,Zr=0,br=0,Pr=0,Fr=0,Mr=0,Cr=0,Dr=0,Ur=0,Rr=0,er=0,rr=0,xr=0,dr=0,yr=0,$r=0,no=0,ao=0,ho=0,fo=0,qn=un[0],wo=un[1],vo=un[2],_o=un[3],yo=un[4],Ao=un[5],Mo=un[6],zo=un[7],Co=un[8],Lo=un[9],Ho=un[10],Ko=un[11],na=un[12],Qo=un[13],xa=un[14],Xo=un[15];Jt=Pn[0],Dn+=Jt*qn,Fn+=Jt*wo,Yn+=Jt*vo,tr+=Jt*_o,ar+=Jt*yo,lr+=Jt*Ao,Vr+=Jt*Mo,vr+=Jt*zo,Nr+=Jt*Co,Hr+=Jt*Lo,eo+=Jt*Ho,Jr+=Jt*Ko,Zr+=Jt*na,br+=Jt*Qo,Pr+=Jt*xa,Fr+=Jt*Xo,Jt=Pn[1],Fn+=Jt*qn,Yn+=Jt*wo,tr+=Jt*vo,ar+=Jt*_o,lr+=Jt*yo,Vr+=Jt*Ao,vr+=Jt*Mo,Nr+=Jt*zo,Hr+=Jt*Co,eo+=Jt*Lo,Jr+=Jt*Ho,Zr+=Jt*Ko,br+=Jt*na,Pr+=Jt*Qo,Fr+=Jt*xa,Mr+=Jt*Xo,Jt=Pn[2],Yn+=Jt*qn,tr+=Jt*wo,ar+=Jt*vo,lr+=Jt*_o,Vr+=Jt*yo,vr+=Jt*Ao,Nr+=Jt*Mo,Hr+=Jt*zo,eo+=Jt*Co,Jr+=Jt*Lo,Zr+=Jt*Ho,br+=Jt*Ko,Pr+=Jt*na,Fr+=Jt*Qo,Mr+=Jt*xa,Cr+=Jt*Xo,Jt=Pn[3],tr+=Jt*qn,ar+=Jt*wo,lr+=Jt*vo,Vr+=Jt*_o,vr+=Jt*yo,Nr+=Jt*Ao,Hr+=Jt*Mo,eo+=Jt*zo,Jr+=Jt*Co,Zr+=Jt*Lo,br+=Jt*Ho,Pr+=Jt*Ko,Fr+=Jt*na,Mr+=Jt*Qo,Cr+=Jt*xa,Dr+=Jt*Xo,Jt=Pn[4],ar+=Jt*qn,lr+=Jt*wo,Vr+=Jt*vo,vr+=Jt*_o,Nr+=Jt*yo,Hr+=Jt*Ao,eo+=Jt*Mo,Jr+=Jt*zo,Zr+=Jt*Co,br+=Jt*Lo,Pr+=Jt*Ho,Fr+=Jt*Ko,Mr+=Jt*na,Cr+=Jt*Qo,Dr+=Jt*xa,Ur+=Jt*Xo,Jt=Pn[5],lr+=Jt*qn,Vr+=Jt*wo,vr+=Jt*vo,Nr+=Jt*_o,Hr+=Jt*yo,eo+=Jt*Ao,Jr+=Jt*Mo,Zr+=Jt*zo,br+=Jt*Co,Pr+=Jt*Lo,Fr+=Jt*Ho,Mr+=Jt*Ko,Cr+=Jt*na,Dr+=Jt*Qo,Ur+=Jt*xa,Rr+=Jt*Xo,Jt=Pn[6],Vr+=Jt*qn,vr+=Jt*wo,Nr+=Jt*vo,Hr+=Jt*_o,eo+=Jt*yo,Jr+=Jt*Ao,Zr+=Jt*Mo,br+=Jt*zo,Pr+=Jt*Co,Fr+=Jt*Lo,Mr+=Jt*Ho,Cr+=Jt*Ko,Dr+=Jt*na,Ur+=Jt*Qo,Rr+=Jt*xa,er+=Jt*Xo,Jt=Pn[7],vr+=Jt*qn,Nr+=Jt*wo,Hr+=Jt*vo,eo+=Jt*_o,Jr+=Jt*yo,Zr+=Jt*Ao,br+=Jt*Mo,Pr+=Jt*zo,Fr+=Jt*Co,Mr+=Jt*Lo,Cr+=Jt*Ho,Dr+=Jt*Ko,Ur+=Jt*na,Rr+=Jt*Qo,er+=Jt*xa,rr+=Jt*Xo,Jt=Pn[8],Nr+=Jt*qn,Hr+=Jt*wo,eo+=Jt*vo,Jr+=Jt*_o,Zr+=Jt*yo,br+=Jt*Ao,Pr+=Jt*Mo,Fr+=Jt*zo,Mr+=Jt*Co,Cr+=Jt*Lo,Dr+=Jt*Ho,Ur+=Jt*Ko,Rr+=Jt*na,er+=Jt*Qo,rr+=Jt*xa,xr+=Jt*Xo,Jt=Pn[9],Hr+=Jt*qn,eo+=Jt*wo,Jr+=Jt*vo,Zr+=Jt*_o,br+=Jt*yo,Pr+=Jt*Ao,Fr+=Jt*Mo,Mr+=Jt*zo,Cr+=Jt*Co,Dr+=Jt*Lo,Ur+=Jt*Ho,Rr+=Jt*Ko,er+=Jt*na,rr+=Jt*Qo,xr+=Jt*xa,dr+=Jt*Xo,Jt=Pn[10],eo+=Jt*qn,Jr+=Jt*wo,Zr+=Jt*vo,br+=Jt*_o,Pr+=Jt*yo,Fr+=Jt*Ao,Mr+=Jt*Mo,Cr+=Jt*zo,Dr+=Jt*Co,Ur+=Jt*Lo,Rr+=Jt*Ho,er+=Jt*Ko,rr+=Jt*na,xr+=Jt*Qo,dr+=Jt*xa,yr+=Jt*Xo,Jt=Pn[11],Jr+=Jt*qn,Zr+=Jt*wo,br+=Jt*vo,Pr+=Jt*_o,Fr+=Jt*yo,Mr+=Jt*Ao,Cr+=Jt*Mo,Dr+=Jt*zo,Ur+=Jt*Co,Rr+=Jt*Lo,er+=Jt*Ho,rr+=Jt*Ko,xr+=Jt*na,dr+=Jt*Qo,yr+=Jt*xa,$r+=Jt*Xo,Jt=Pn[12],Zr+=Jt*qn,br+=Jt*wo,Pr+=Jt*vo,Fr+=Jt*_o,Mr+=Jt*yo,Cr+=Jt*Ao,Dr+=Jt*Mo,Ur+=Jt*zo,Rr+=Jt*Co,er+=Jt*Lo,rr+=Jt*Ho,xr+=Jt*Ko,dr+=Jt*na,yr+=Jt*Qo,$r+=Jt*xa,no+=Jt*Xo,Jt=Pn[13],br+=Jt*qn,Pr+=Jt*wo,Fr+=Jt*vo,Mr+=Jt*_o,Cr+=Jt*yo,Dr+=Jt*Ao,Ur+=Jt*Mo,Rr+=Jt*zo,er+=Jt*Co,rr+=Jt*Lo,xr+=Jt*Ho,dr+=Jt*Ko,yr+=Jt*na,$r+=Jt*Qo,no+=Jt*xa,ao+=Jt*Xo,Jt=Pn[14],Pr+=Jt*qn,Fr+=Jt*wo,Mr+=Jt*vo,Cr+=Jt*_o,Dr+=Jt*yo,Ur+=Jt*Ao,Rr+=Jt*Mo,er+=Jt*zo,rr+=Jt*Co,xr+=Jt*Lo,dr+=Jt*Ho,yr+=Jt*Ko,$r+=Jt*na,no+=Jt*Qo,ao+=Jt*xa,ho+=Jt*Xo,Jt=Pn[15],Fr+=Jt*qn,Mr+=Jt*wo,Cr+=Jt*vo,Dr+=Jt*_o,Ur+=Jt*yo,Rr+=Jt*Ao,er+=Jt*Mo,rr+=Jt*zo,xr+=Jt*Co,dr+=Jt*Lo,yr+=Jt*Ho,$r+=Jt*Ko,no+=Jt*na,ao+=Jt*Qo,ho+=Jt*xa,fo+=Jt*Xo,Dn+=38*Mr,Fn+=38*Cr,Yn+=38*Dr,tr+=38*Ur,ar+=38*Rr,lr+=38*er,Vr+=38*rr,vr+=38*xr,Nr+=38*dr,Hr+=38*yr,eo+=38*$r,Jr+=38*no,Zr+=38*ao,br+=38*ho,Pr+=38*fo,Sn=1,Jt=Dn+Sn+65535,Sn=Math.floor(Jt/65536),Dn=Jt-Sn*65536,Jt=Fn+Sn+65535,Sn=Math.floor(Jt/65536),Fn=Jt-Sn*65536,Jt=Yn+Sn+65535,Sn=Math.floor(Jt/65536),Yn=Jt-Sn*65536,Jt=tr+Sn+65535,Sn=Math.floor(Jt/65536),tr=Jt-Sn*65536,Jt=ar+Sn+65535,Sn=Math.floor(Jt/65536),ar=Jt-Sn*65536,Jt=lr+Sn+65535,Sn=Math.floor(Jt/65536),lr=Jt-Sn*65536,Jt=Vr+Sn+65535,Sn=Math.floor(Jt/65536),Vr=Jt-Sn*65536,Jt=vr+Sn+65535,Sn=Math.floor(Jt/65536),vr=Jt-Sn*65536,Jt=Nr+Sn+65535,Sn=Math.floor(Jt/65536),Nr=Jt-Sn*65536,Jt=Hr+Sn+65535,Sn=Math.floor(Jt/65536),Hr=Jt-Sn*65536,Jt=eo+Sn+65535,Sn=Math.floor(Jt/65536),eo=Jt-Sn*65536,Jt=Jr+Sn+65535,Sn=Math.floor(Jt/65536),Jr=Jt-Sn*65536,Jt=Zr+Sn+65535,Sn=Math.floor(Jt/65536),Zr=Jt-Sn*65536,Jt=br+Sn+65535,Sn=Math.floor(Jt/65536),br=Jt-Sn*65536,Jt=Pr+Sn+65535,Sn=Math.floor(Jt/65536),Pr=Jt-Sn*65536,Jt=Fr+Sn+65535,Sn=Math.floor(Jt/65536),Fr=Jt-Sn*65536,Dn+=Sn-1+37*(Sn-1),Sn=1,Jt=Dn+Sn+65535,Sn=Math.floor(Jt/65536),Dn=Jt-Sn*65536,Jt=Fn+Sn+65535,Sn=Math.floor(Jt/65536),Fn=Jt-Sn*65536,Jt=Yn+Sn+65535,Sn=Math.floor(Jt/65536),Yn=Jt-Sn*65536,Jt=tr+Sn+65535,Sn=Math.floor(Jt/65536),tr=Jt-Sn*65536,Jt=ar+Sn+65535,Sn=Math.floor(Jt/65536),ar=Jt-Sn*65536,Jt=lr+Sn+65535,Sn=Math.floor(Jt/65536),lr=Jt-Sn*65536,Jt=Vr+Sn+65535,Sn=Math.floor(Jt/65536),Vr=Jt-Sn*65536,Jt=vr+Sn+65535,Sn=Math.floor(Jt/65536),vr=Jt-Sn*65536,Jt=Nr+Sn+65535,Sn=Math.floor(Jt/65536),Nr=Jt-Sn*65536,Jt=Hr+Sn+65535,Sn=Math.floor(Jt/65536),Hr=Jt-Sn*65536,Jt=eo+Sn+65535,Sn=Math.floor(Jt/65536),eo=Jt-Sn*65536,Jt=Jr+Sn+65535,Sn=Math.floor(Jt/65536),Jr=Jt-Sn*65536,Jt=Zr+Sn+65535,Sn=Math.floor(Jt/65536),Zr=Jt-Sn*65536,Jt=br+Sn+65535,Sn=Math.floor(Jt/65536),br=Jt-Sn*65536,Jt=Pr+Sn+65535,Sn=Math.floor(Jt/65536),Pr=Jt-Sn*65536,Jt=Fr+Sn+65535,Sn=Math.floor(Jt/65536),Fr=Jt-Sn*65536,Dn+=Sn-1+37*(Sn-1),_n[0]=Dn,_n[1]=Fn,_n[2]=Yn,_n[3]=tr,_n[4]=ar,_n[5]=lr,_n[6]=Vr,_n[7]=vr,_n[8]=Nr,_n[9]=Hr,_n[10]=eo,_n[11]=Jr,_n[12]=Zr,_n[13]=br,_n[14]=Pr,_n[15]=Fr}function Yt(_n,Pn){an(_n,Pn,Pn)}function nn(_n,Pn){var un=nt(),Jt;for(Jt=0;Jt<16;Jt++)un[Jt]=Pn[Jt];for(Jt=253;Jt>=0;Jt--)Yt(un,un),Jt!==2&&Jt!==4&&an(un,un,Pn);for(Jt=0;Jt<16;Jt++)_n[Jt]=un[Jt]}function tn(_n,Pn){var un=nt(),Jt;for(Jt=0;Jt<16;Jt++)un[Jt]=Pn[Jt];for(Jt=250;Jt>=0;Jt--)Yt(un,un),Jt!==1&&an(un,un,Pn);for(Jt=0;Jt<16;Jt++)_n[Jt]=un[Jt]}function dn(_n,Pn,un){var Jt=new Uint8Array(32),Sn=new Float64Array(80),Dn,Fn,Yn=nt(),tr=nt(),ar=nt(),lr=nt(),Vr=nt(),vr=nt();for(Fn=0;Fn<31;Fn++)Jt[Fn]=Pn[Fn];for(Jt[31]=Pn[31]&127|64,Jt[0]&=248,Pt(Sn,un),Fn=0;Fn<16;Fn++)tr[Fn]=Sn[Fn],lr[Fn]=Yn[Fn]=ar[Fn]=0;for(Yn[0]=lr[0]=1,Fn=254;Fn>=0;--Fn)Dn=Jt[Fn>>>3]>>>(Fn&7)&1,zt(Yn,tr,Dn),zt(ar,lr,Dn),Ht(Vr,Yn,ar),Qt(Yn,Yn,ar),Ht(ar,tr,lr),Qt(tr,tr,lr),Yt(lr,Vr),Yt(vr,Yn),an(Yn,ar,Yn),an(ar,tr,Vr),Ht(Vr,Yn,ar),Qt(Yn,Yn,ar),Yt(tr,Yn),Qt(ar,lr,vr),an(Yn,ar,lt),Ht(Yn,Yn,lr),an(ar,ar,Yn),an(Yn,lr,vr),an(lr,tr,Sn),Yt(tr,Vr),zt(Yn,tr,Dn),zt(ar,lr,Dn);for(Fn=0;Fn<16;Fn++)Sn[Fn+16]=Yn[Fn],Sn[Fn+32]=ar[Fn],Sn[Fn+48]=tr[Fn],Sn[Fn+64]=lr[Fn];var Nr=Sn.subarray(32),Hr=Sn.subarray(16);return nn(Nr,Nr),an(Hr,Hr,Nr),Ft(_n,Hr),0}function wn(_n,Pn){return dn(_n,Pn,ot)}function rn(_n,Pn){return rt(Pn,32),wn(_n,Pn)}function Zt(_n,Pn,un){var Jt=new Uint8Array(32);return dn(Jt,un,Pn),St(_n,it,Jt,Tt)}var vn=vt,Cn=It;function $n(_n,Pn,un,Jt,Sn,Dn){var Fn=new Uint8Array(32);return Zt(Fn,Sn,Dn),vn(_n,Pn,un,Jt,Fn)}function Nn(_n,Pn,un,Jt,Sn,Dn){var Fn=new Uint8Array(32);return Zt(Fn,Sn,Dn),Cn(_n,Pn,un,Jt,Fn)}var En=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function sn(_n,Pn,un,Jt){for(var Sn=new Int32Array(16),Dn=new Int32Array(16),Fn,Yn,tr,ar,lr,Vr,vr,Nr,Hr,eo,Jr,Zr,br,Pr,Fr,Mr,Cr,Dr,Ur,Rr,er,rr,xr,dr,yr,$r,no=_n[0],ao=_n[1],ho=_n[2],fo=_n[3],qn=_n[4],wo=_n[5],vo=_n[6],_o=_n[7],yo=Pn[0],Ao=Pn[1],Mo=Pn[2],zo=Pn[3],Co=Pn[4],Lo=Pn[5],Ho=Pn[6],Ko=Pn[7],na=0;Jt>=128;){for(Ur=0;Ur<16;Ur++)Rr=8*Ur+na,Sn[Ur]=un[Rr+0]<<24|un[Rr+1]<<16|un[Rr+2]<<8|un[Rr+3],Dn[Ur]=un[Rr+4]<<24|un[Rr+5]<<16|un[Rr+6]<<8|un[Rr+7];for(Ur=0;Ur<80;Ur++)if(Fn=no,Yn=ao,tr=ho,ar=fo,lr=qn,Vr=wo,vr=vo,Nr=_o,Hr=yo,eo=Ao,Jr=Mo,Zr=zo,br=Co,Pr=Lo,Fr=Ho,Mr=Ko,er=_o,rr=Ko,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=(qn>>>14|Co<<32-14)^(qn>>>18|Co<<32-18)^(Co>>>41-32|qn<<32-(41-32)),rr=(Co>>>14|qn<<32-14)^(Co>>>18|qn<<32-18)^(qn>>>41-32|Co<<32-(41-32)),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=qn&wo^~qn&vo,rr=Co&Lo^~Co&Ho,xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=En[Ur*2],rr=En[Ur*2+1],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=Sn[Ur%16],rr=Dn[Ur%16],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,Cr=yr&65535|$r<<16,Dr=xr&65535|dr<<16,er=Cr,rr=Dr,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=(no>>>28|yo<<32-28)^(yo>>>34-32|no<<32-(34-32))^(yo>>>39-32|no<<32-(39-32)),rr=(yo>>>28|no<<32-28)^(no>>>34-32|yo<<32-(34-32))^(no>>>39-32|yo<<32-(39-32)),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,er=no&ao^no&ho^ao&ho,rr=yo&Ao^yo&Mo^Ao&Mo,xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,Nr=yr&65535|$r<<16,Mr=xr&65535|dr<<16,er=ar,rr=Zr,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=Cr,rr=Dr,xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,ar=yr&65535|$r<<16,Zr=xr&65535|dr<<16,ao=Fn,ho=Yn,fo=tr,qn=ar,wo=lr,vo=Vr,_o=vr,no=Nr,Ao=Hr,Mo=eo,zo=Jr,Co=Zr,Lo=br,Ho=Pr,Ko=Fr,yo=Mr,Ur%16===15)for(Rr=0;Rr<16;Rr++)er=Sn[Rr],rr=Dn[Rr],xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=Sn[(Rr+9)%16],rr=Dn[(Rr+9)%16],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,Cr=Sn[(Rr+1)%16],Dr=Dn[(Rr+1)%16],er=(Cr>>>1|Dr<<32-1)^(Cr>>>8|Dr<<32-8)^Cr>>>7,rr=(Dr>>>1|Cr<<32-1)^(Dr>>>8|Cr<<32-8)^(Dr>>>7|Cr<<32-7),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,Cr=Sn[(Rr+14)%16],Dr=Dn[(Rr+14)%16],er=(Cr>>>19|Dr<<32-19)^(Dr>>>61-32|Cr<<32-(61-32))^Cr>>>6,rr=(Dr>>>19|Cr<<32-19)^(Cr>>>61-32|Dr<<32-(61-32))^(Dr>>>6|Cr<<32-6),xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,Sn[Rr]=yr&65535|$r<<16,Dn[Rr]=xr&65535|dr<<16;er=no,rr=yo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[0],rr=Pn[0],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[0]=no=yr&65535|$r<<16,Pn[0]=yo=xr&65535|dr<<16,er=ao,rr=Ao,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[1],rr=Pn[1],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[1]=ao=yr&65535|$r<<16,Pn[1]=Ao=xr&65535|dr<<16,er=ho,rr=Mo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[2],rr=Pn[2],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[2]=ho=yr&65535|$r<<16,Pn[2]=Mo=xr&65535|dr<<16,er=fo,rr=zo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[3],rr=Pn[3],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[3]=fo=yr&65535|$r<<16,Pn[3]=zo=xr&65535|dr<<16,er=qn,rr=Co,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[4],rr=Pn[4],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[4]=qn=yr&65535|$r<<16,Pn[4]=Co=xr&65535|dr<<16,er=wo,rr=Lo,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[5],rr=Pn[5],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[5]=wo=yr&65535|$r<<16,Pn[5]=Lo=xr&65535|dr<<16,er=vo,rr=Ho,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[6],rr=Pn[6],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[6]=vo=yr&65535|$r<<16,Pn[6]=Ho=xr&65535|dr<<16,er=_o,rr=Ko,xr=rr&65535,dr=rr>>>16,yr=er&65535,$r=er>>>16,er=_n[7],rr=Pn[7],xr+=rr&65535,dr+=rr>>>16,yr+=er&65535,$r+=er>>>16,dr+=xr>>>16,yr+=dr>>>16,$r+=yr>>>16,_n[7]=_o=yr&65535|$r<<16,Pn[7]=Ko=xr&65535|dr<<16,na+=128,Jt-=128}return Jt}function pn(_n,Pn,un){var Jt=new Int32Array(8),Sn=new Int32Array(8),Dn=new Uint8Array(256),Fn,Yn=un;for(Jt[0]=1779033703,Jt[1]=3144134277,Jt[2]=1013904242,Jt[3]=2773480762,Jt[4]=1359893119,Jt[5]=2600822924,Jt[6]=528734635,Jt[7]=1541459225,Sn[0]=4089235720,Sn[1]=2227873595,Sn[2]=4271175723,Sn[3]=1595750129,Sn[4]=2917565137,Sn[5]=725511199,Sn[6]=4215389547,Sn[7]=327033209,sn(Jt,Sn,Pn,un),un%=128,Fn=0;Fn=0;--Sn)Jt=un[Sn/8|0]>>(Sn&7)&1,In(_n,Pn,Jt),Tn(Pn,_n),Tn(_n,_n),In(_n,Pn,Jt)}function fn(_n,Pn){var un=[nt(),nt(),nt(),nt()];Ot(un[0],ht),Ot(un[1],dt),Ot(un[2],st),an(un[3],ht,dt),hn(_n,un,Pn)}function xn(_n,Pn,un){var Jt=new Uint8Array(64),Sn=[nt(),nt(),nt(),nt()],Dn;for(un||rt(Pn,32),pn(Jt,Pn,32),Jt[0]&=248,Jt[31]&=127,Jt[31]|=64,fn(Sn,Jt),yn(_n,Sn),Dn=0;Dn<32;Dn++)Pn[Dn+32]=_n[Dn];return 0}var jn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function cn(_n,Pn){var un,Jt,Sn,Dn;for(Jt=63;Jt>=32;--Jt){for(un=0,Sn=Jt-32,Dn=Jt-12;Sn>4)*jn[Sn],un=Pn[Sn]>>8,Pn[Sn]&=255;for(Sn=0;Sn<32;Sn++)Pn[Sn]-=un*jn[Sn];for(Jt=0;Jt<32;Jt++)Pn[Jt+1]+=Pn[Jt]>>8,_n[Jt]=Pn[Jt]&255}function Xt(_n){var Pn=new Float64Array(64),un;for(un=0;un<64;un++)Pn[un]=_n[un];for(un=0;un<64;un++)_n[un]=0;cn(_n,Pn)}function Kt(_n,Pn,un,Jt){var Sn=new Uint8Array(64),Dn=new Uint8Array(64),Fn=new Uint8Array(64),Yn,tr,ar=new Float64Array(64),lr=[nt(),nt(),nt(),nt()];pn(Sn,Jt,32),Sn[0]&=248,Sn[31]&=127,Sn[31]|=64;var Vr=un+64;for(Yn=0;Yn>7&&Qt(_n[0],at,_n[0]),an(_n[3],_n[0],_n[1]),0)}function Mn(_n,Pn,un,Jt){var Sn,Dn=new Uint8Array(32),Fn=new Uint8Array(64),Yn=[nt(),nt(),nt(),nt()],tr=[nt(),nt(),nt(),nt()];if(un<64||kn(tr,Jt))return-1;for(Sn=0;Sn=0},et.sign.keyPair=function(){var _n=new Uint8Array(Ir),Pn=new Uint8Array(Gr);return xn(_n,Pn),{publicKey:_n,secretKey:Pn}},et.sign.keyPair.fromSecretKey=function(_n){if(jr(_n),_n.length!==Gr)throw new Error("bad secret key size");for(var Pn=new Uint8Array(Ir),un=0;un"u"?typeof Buffer.from<"u"?(et.encodeBase64=function(rt){return Buffer.from(rt).toString("base64")},et.decodeBase64=function(rt){return nt(rt),new Uint8Array(Array.prototype.slice.call(Buffer.from(rt,"base64"),0))}):(et.encodeBase64=function(rt){return new Buffer(rt).toString("base64")},et.decodeBase64=function(rt){return nt(rt),new Uint8Array(Array.prototype.slice.call(new Buffer(rt,"base64"),0))}):(et.encodeBase64=function(rt){var it,ot=[],at=rt.length;for(it=0;itgt||pn<0)throw new RangeError(`varint ${pn} out of range`);this._grow(this._length+wt);let Tn=this._length;for(;pn>=128;)this._buf[Tn++]=pn&255|128,pn>>>=7;this._buf[Tn++]=pn|0,this._length=Tn}get bytes(){return this._buf.subarray(0,this._length)}_grow(pn){const Tn=this._buf.length;if(pn<=Tn)return;const In=Tn*2,yn=pn>In?pn:In,hn=new Uint8Array(yn);hn.set(this._buf.subarray(0,this._length)),this._buf=hn}}const wt=5;class xt{constructor(pn){this._buf=pn,this._index=0}readByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index++]}peekByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index]}readN(pn){if(this.lengthwt||fn===wt&&hn>1)throw new RangeError("Overflow error decoding varint");return(Tn|hn<>>0}Tn|=(hn&127)<sn!=null,St=sn=>kt(sn)?st.encode(sn):sn,Tt=sn=>kt(sn)?lt.decode(sn):sn,At=sn=>nt.default.codec.utf8String.fromBits(sn);tt.base64ToBytes=function(sn){return sn=sn.replace(/-/g,"+").replace(/_/g,"/"),sn.length%4!==0&&!sn.match(/=$/)&&(sn+="=".repeat(4-sn.length%4)),it.default.decodeBase64(sn)},tt.bytesToBase64=function(sn){return it.default.encodeBase64(sn).replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")};const Et=function(sn){return nt.default.codec.base64.toBits(it.default.encodeBase64(sn))},Ct=function(sn){return it.default.decodeBase64(nt.default.codec.base64.fromBits(sn))},Lt=function(sn){const pn=new Uint8Array(Math.ceil(sn.length/2));for(let Tn=0;Tnkt(sn)?Rt(sn,pn):"",vt=function(sn,pn){if(sn instanceof Uint8Array)return sn;if(typeof sn=="string")return St(sn);throw new TypeError(`${pn} has the wrong type; want string or Uint8Array, got ${typeof sn}.`)},It=new Uint8Array,Ot=function(sn,pn){const Tn=sn.readByte();if(Tn!==pn)throw new Error(`Unexpected field type, got ${Tn} want ${pn}`);return Tn===ut?It:sn.readN(sn.readUvarint())},Wt=function(sn,pn,Tn){sn.appendByte(pn),pn!==ut&&(sn.appendUvarint(Tn.length),sn.appendBytes(Tn))},zt=function(sn,pn){return sn.peekByte()!==pn?null:Ot(sn,pn)},Ft=function(sn,pn,Tn){jt(Tn)?sn[pn]=Tt(Tn):sn[pn+"64"]=tt.bytesToBase64(Tn)},Nt=function(sn,pn){const Tn=new nt.default.misc.hmac(sn,nt.default.hash.sha256);return Tn.update(pn),Tn.digest()},Ut=function(sn,pn,Tn){const In=Nt(sn,pn),yn=Nt(sn,Tn);return Nt(sn,nt.default.bitArray.concat(In,yn))},Pt=Et(St("macaroons-key-generator")),Ht=function(sn){return Nt(Pt,sn)},Qt=function(){return rt.default.randomBytes(ct)},an=function(sn,pn){const Tn=Ct(sn),In=Ct(pn),yn=Qt(),hn=rt.default.secretbox(In,yn,Tn),fn=new Uint8Array(yn.length+hn.length);return fn.set(yn,0),fn.set(hn,yn.length),Et(fn)},Yt=function(sn,pn){const Tn=Ct(sn),In=Ct(pn),yn=In.slice(0,ct),hn=In.slice(ct);let fn=rt.default.secretbox.open(hn,yn,Tn);if(!fn)throw new Error("decryption failed");return Et(fn)},nn=Et(St("\0".repeat(32))),tn=function(sn,pn){return nt.default.bitArray.equal(sn,pn)?sn:Ut(nn,sn,pn)};class dn{constructor(pn){if(!pn)return;let{version:Tn,identifierBytes:In,locationStr:yn,caveats:hn,signatureBytes:fn}=pn;if(Tn!==1&&Tn!==2)throw new Error(`Unexpected version ${Tn}`);if(this._version=Tn,this._locationStr=yn,In=vt(In,"Identifier"),Tn===1&&!jt(In))throw new Error("Version 1 macaroon identifier must be well-formed UTF-8");this._identifierBits=In&&Et(In),this._signatureBits=fn&&Et(vt(fn,"Signature")),this._caveats=hn?hn.map(xn=>{const jn=vt(xn.identifierBytes,"Caveat identifier");if(Tn===1&&!jt(jn))throw new Error("Version 1 caveat identifier must be well-formed UTF-8");return{_locationStr:$t(xn.locationStr),_identifierBits:Et(jn),_vidBits:xn.vidBytes&&Et(vt(xn.vidBytes,"Verification ID"))}}):[]}get caveats(){return this._caveats.map(pn=>kt(pn._vidBits)?{identifier:Ct(pn._identifierBits),location:pn._locationStr,vid:Ct(pn._vidBits)}:{identifier:Ct(pn._identifierBits)})}get location(){return this._locationStr}get identifier(){return Ct(this._identifierBits)}get signature(){return Ct(this._signatureBits)}addThirdPartyCaveat(pn,Tn,In){const yn={_identifierBits:Et(vt(Tn,"Caveat id")),_vidBits:an(this._signatureBits,Ht(Et(vt(pn,"Caveat root key")))),_locationStr:$t(In)};this._signatureBits=Ut(this._signatureBits,yn._vidBits,yn._identifierBits),this._caveats.push(yn)}addFirstPartyCaveat(pn){const Tn=Et(vt(pn,"Condition"));this._caveats.push({_identifierBits:Tn}),this._signatureBits=Nt(this._signatureBits,Tn)}bindToRoot(pn){const Tn=Et(vt(pn,"Primary macaroon signature"));this._signatureBits=tn(Tn,this._signatureBits)}clone(){const pn=new dn;return pn._version=this._version,pn._signatureBits=this._signatureBits,pn._identifierBits=this._identifierBits,pn._locationStr=this._locationStr,pn._caveats=this._caveats.slice(),pn}verify(pn,Tn,In=[]){const yn=Ht(Et(vt(pn,"Root key"))),hn=In.map(fn=>0);this._verify(this._signatureBits,yn,Tn,In,hn),In.forEach((fn,xn)=>{if(hn[xn]===0)throw new Error(`discharge macaroon ${yt(fn.identifier)} was not used`);if(hn[xn]!==1)throw new Error(`discharge macaroon ${yt(fn.identifier)} was used more than once`)})}_verify(pn,Tn,In,yn,hn){let fn=Nt(Tn,this._identifierBits);this._caveats.forEach(jn=>{if(jn._vidBits){const cn=Yt(fn,jn._vidBits);let Xt=!1,Kt,kn;for(Kt=0;Kt1)throw new Error(`discharge macaroon ${yt(kn.identifier)} was used more than once`);kn._verify(pn,cn,In,yn,hn);break}if(!Xt)throw new Error(`cannot find discharge macaroon for caveat ${yt(jn._identifierBits)}`);fn=Ut(fn,jn._vidBits,jn._identifierBits)}else{const cn=At(jn._identifierBits),Xt=In(cn);if(Xt)throw new Error(`caveat check failed (${cn}): ${Xt}`);fn=Nt(fn,jn._identifierBits)}});const xn=tn(pn,fn);if(!nt.default.bitArray.equal(xn,this._signatureBits))throw new Error("signature mismatch after caveat verification")}exportJSON(){switch(this._version){case 1:return this._exportAsJSONObjectV1();case 2:return this._exportAsJSONObjectV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}_exportAsJSONObjectV1(){const pn={identifier:At(this._identifierBits),signature:nt.default.codec.hex.fromBits(this._signatureBits)};return this._locationStr&&(pn.location=this._locationStr),this._caveats.length>0&&(pn.caveats=this._caveats.map(Tn=>{const In={cid:At(Tn._identifierBits)};return Tn._vidBits&&(In.vid=nt.default.codec.base64.fromBits(Tn._vidBits,!0,!0),In.cl=Tn._locationStr),In})),pn}_exportAsJSONObjectV2(){const pn={v:2};return Ft(pn,"s",Ct(this._signatureBits)),Ft(pn,"i",Ct(this._identifierBits)),this._locationStr&&(pn.l=this._locationStr),this._caveats&&this._caveats.length>0&&(pn.c=this._caveats.map(Tn=>{const In={};return Ft(In,"i",Ct(Tn._identifierBits)),Tn._vidBits&&(Ft(In,"v",Ct(Tn._vidBits)),In.l=Tn._locationStr),In})),pn}_exportBinaryV1(){throw new Error("V1 binary export not supported")}_exportBinaryV2(){const pn=new bt(200);return pn.appendByte(2),this._locationStr&&Wt(pn,ht,St(this._locationStr)),Wt(pn,dt,Ct(this._identifierBits)),Wt(pn,ut),this._caveats.forEach(function(Tn){Tn._locationStr&&Wt(pn,ht,St(Tn._locationStr)),Wt(pn,dt,Ct(Tn._identifierBits)),Tn._vidBits&&Wt(pn,pt,Ct(Tn._vidBits)),Wt(pn,ut)}),Wt(pn,ut),Wt(pn,mt,Ct(this._signatureBits)),pn.bytes}exportBinary(){switch(this._version){case 1:return this._exportBinaryV1();case 2:return this._exportBinaryV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}}tt.importMacaroon=function(sn){if(typeof sn=="string"&&(sn=tt.base64ToBytes(sn)),sn instanceof Uint8Array){const pn=new xt(sn),Tn=En(pn);if(pn.length!==0)throw new TypeError("extra data found at end of serialized macaroon");return Tn}if(Array.isArray(sn))throw new TypeError("cannot import an array of macaroons as a single macaroon");return wn(sn)},tt.importMacaroons=function(sn){if(typeof sn=="string"&&(sn=tt.base64ToBytes(sn)),sn instanceof Uint8Array){if(sn.length===0)throw new TypeError("empty macaroon data");const pn=new xt(sn),Tn=[];do Tn.push(En(pn));while(pn.length>0);return Tn}return Array.isArray(sn)?sn.map(pn=>wn(pn)):[wn(sn)]};const wn=function(sn){return rn(sn)?Zt(sn):vn(sn)};function rn(sn){return kt(sn.signature)}const Zt=function(sn){const pn=sn.caveats&&sn.caveats.map(Tn=>{const In={identifierBytes:St(Rt(Tn.cid,"Caveat id")),locationStr:$t(Tn.cl,"Caveat location")};return Tn.vid&&(In.vidBytes=tt.base64ToBytes(Rt(Tn.vid,"Caveat verification id"))),In});return new dn({version:1,locationStr:$t(sn.location,"Macaroon location"),identifierBytes:St(Rt(sn.identifier,"Macaroon identifier")),caveats:pn,signatureBytes:Lt(sn.signature)})},vn=function(sn){if(sn.v!==2&&sn.v!==void 0)throw new Error(`Unsupported macaroon version ${sn.v}`);const pn={version:2,signatureBytes:Cn(sn,"s",!0),locationStr:Tt(Cn(sn,"l",!1)),identifierBytes:Cn(sn,"i",!0)};if(sn.c){if(!Array.isArray(sn.c))throw new Error("caveats field does not hold an array");pn.caveats=sn.c.map(Tn=>({identifierBytes:Cn(Tn,"i",!0),locationStr:Tt(Cn(Tn,"l")),vidBytes:Cn(Tn,"v",!1)}))}return new dn(pn)};function Cn(sn,pn,Tn){if(sn.hasOwnProperty(pn))return St(sn[pn]);const In=pn+"64";if(sn.hasOwnProperty(In))return tt.base64ToBytes(sn[In]);if(Tn)throw new Error("Expected key: "+pn);return null}const $n=function(sn){const pn=sn.readByte();if(pn!==2)throw new Error(`Only version 2 is supported, found version ${pn}`);const Tn=Tt(zt(sn,ht)),In=Ot(sn,dt),yn=[];for(Ot(sn,ut);!zt(sn,ut);){const fn={locationStr:Tt(zt(sn,ht)),identifierBytes:Ot(sn,dt),vidBytes:zt(sn,pt)};Ot(sn,ut),yn.push(fn)}const hn=Ot(sn,mt);if(sn.length!==0)throw new Error("unexpected extra data at end of macaroon");return new dn({version:pn,locationStr:Tn,identifierBytes:In,signatureBytes:hn,caveats:yn})},Nn=function(sn){return 48<=sn&&sn<=58||97<=sn&&sn<=102},En=function(sn){if(sn.length===0)throw new Error("Empty macaroon data");const pn=sn.peekByte();if(pn===2)return $n(sn);throw Nn(pn)?new Error("Version 1 binary format not supported"):new Error("Cannot determine data format of binary-encoded macaroon")};tt.newMacaroon=function({identifier:sn,location:pn,rootKey:Tn,version:In}){const yn=vt(sn,"Macaroon identifier"),hn=vt(Tn,"Macaroon root key");return new dn({version:In===void 0?2:In,identifierBytes:yn,locationStr:$t(pn,"Macaroon location"),signatureBytes:Ct(Nt(Ht(Et(hn)),Et(yn)))})},tt.dischargeMacaroon=function(sn,pn,Tn,In){const yn=sn.signature,hn=[sn];let fn=0,xn=!1;const jn=sn.location,cn=kn=>{xn||(kn.bindToRoot(yn),hn.push(kn),fn--,Kt(kn))},Xt=kn=>{xn||(In(kn),xn=!0)},Kt=kn=>{let Mn,On;for(On=0;Ontt.LATEST_VERSION)throw new ut(mt.version);if(mt.version&&(this.version=mt.version),ot(typeof this.version=="number","Identifier version must be a number"),ot(mt.paymentHash.length===32,`Expected 32-byte hash, instead got ${mt.paymentHash.length}`),this.paymentHash=mt.paymentHash,mt.tokenId)this.tokenId=mt.tokenId;else{const gt=(0,lt.default)();this.tokenId=st.default.createHash("sha256").update(Buffer.from(gt)).digest()}return ot(this.tokenId.length===tt.TOKEN_ID_SIZE,"Token Id of unexpected size"),this}toString(){return this.toHex()}static fromString(mt){try{return new this().fromHex(mt)}catch{return new this().fromBase64(mt)}}write(mt){switch(mt.writeU16BE(this.version),this.version){case 0:return mt.writeHash(this.paymentHash),ot(Buffer.isBuffer(this.tokenId)&&this.tokenId.length===tt.TOKEN_ID_SIZE,`Token ID must be ${tt.TOKEN_ID_SIZE}-byte hash`),mt.writeBytes(this.tokenId),this;default:throw new ut(this.version)}}read(mt){switch(this.version=mt.readU16BE(),this.version){case 0:return this.paymentHash=mt.readHash(),this.tokenId=mt.readBytes(tt.TOKEN_ID_SIZE),this;default:throw new ut(this.version)}}}tt.Identifier=ht;const dt=pt=>{const mt=ct.importMacaroon(pt);let gt=mt._exportAsJSONObjectV2().i;if(gt==null&&(gt=mt._exportAsJSONObjectV2().i64,gt==null))throw new Error("Problem parsing macaroon identifier");return gt};tt.decodeIdentifierFromMacaroon=dt})(identifier$1);var caveat={};/*! * assert.js - assertions for javascript * Copyright (c) 2018, Christopher Jeffrey (MIT License). * https://github.com/chjj/bsert @@ -3577,17 +3577,17 @@ A Bitcoin Podcast. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var reactReconciler_production_min=function(et){var nt={},rt=reactExports,it=schedulerExports,ot=Object.assign;function at(Bt){for(var Dt="https://reactjs.org/docs/error-decoder.html?invariant="+Bt,Gt=1;Gtnr||mn[Hn]!==An[nr]){var _r=` -`+mn[Hn].replace(" at new "," at ");return Bt.displayName&&_r.includes("")&&(_r=_r.replace("",Bt.displayName)),_r}while(1<=Hn&&0<=nr);break}}}finally{Fr=!1,Error.prepareStackTrace=Gt}return(Bt=Bt?Bt.displayName||Bt.name:"")?Pr(Bt):""}var Cr=Object.prototype.hasOwnProperty,Dr=[],Ur=-1;function Rr(Bt){return{current:Bt}}function er(Bt){0>Ur||(Bt.current=Dr[Ur],Dr[Ur]=null,Ur--)}function rr(Bt,Dt){Ur++,Dr[Ur]=Bt.current,Bt.current=Dt}var xr={},dr=Rr(xr),yr=Rr(!1),$r=xr;function no(Bt,Dt){var Gt=Bt.type.contextTypes;if(!Gt)return xr;var en=Bt.stateNode;if(en&&en.__reactInternalMemoizedUnmaskedChildContext===Dt)return en.__reactInternalMemoizedMaskedChildContext;var mn={},An;for(An in Gt)mn[An]=Dt[An];return en&&(Bt=Bt.stateNode,Bt.__reactInternalMemoizedUnmaskedChildContext=Dt,Bt.__reactInternalMemoizedMaskedChildContext=mn),mn}function ao(Bt){return Bt=Bt.childContextTypes,Bt!=null}function ho(){er(yr),er(dr)}function fo(Bt,Dt,Gt){if(dr.current!==xr)throw Error(at(168));rr(dr,Dt),rr(yr,Gt)}function qn(Bt,Dt,Gt){var en=Bt.stateNode;if(Dt=Dt.childContextTypes,typeof en.getChildContext!="function")return Gt;en=en.getChildContext();for(var mn in en)if(!(mn in Dt))throw Error(at(108,Et(Bt)||"Unknown",mn));return ot({},Gt,en)}function wo(Bt){return Bt=(Bt=Bt.stateNode)&&Bt.__reactInternalMemoizedMergedChildContext||xr,$r=dr.current,rr(dr,Bt),rr(yr,yr.current),!0}function vo(Bt,Dt,Gt){var en=Bt.stateNode;if(!en)throw Error(at(169));Gt?(Bt=qn(Bt,Dt,$r),en.__reactInternalMemoizedMergedChildContext=Bt,er(yr),er(dr),rr(dr,Bt)):er(yr),rr(yr,Gt)}var _o=Math.clz32?Math.clz32:Mo,yo=Math.log,Ao=Math.LN2;function Mo(Bt){return Bt>>>=0,Bt===0?32:31-(yo(Bt)/Ao|0)|0}var zo=64,Co=4194304;function Lo(Bt){switch(Bt&-Bt){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return Bt&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return Bt&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return Bt}}function Ho(Bt,Dt){var Gt=Bt.pendingLanes;if(Gt===0)return 0;var en=0,mn=Bt.suspendedLanes,An=Bt.pingedLanes,Hn=Gt&268435455;if(Hn!==0){var nr=Hn&~mn;nr!==0?en=Lo(nr):(An&=Hn,An!==0&&(en=Lo(An)))}else Hn=Gt&~mn,Hn!==0?en=Lo(Hn):An!==0&&(en=Lo(An));if(en===0)return 0;if(Dt!==0&&Dt!==en&&!(Dt&mn)&&(mn=en&-en,An=Dt&-Dt,mn>=An||mn===16&&(An&4194240)!==0))return Dt;if(en&4&&(en|=Gt&16),Dt=Bt.entangledLanes,Dt!==0)for(Bt=Bt.entanglements,Dt&=en;0Gt;Gt++)Dt.push(Bt);return Dt}function Xo(Bt,Dt,Gt){Bt.pendingLanes|=Dt,Dt!==536870912&&(Bt.suspendedLanes=0,Bt.pingedLanes=0),Bt=Bt.eventTimes,Dt=31-_o(Dt),Bt[Dt]=Gt}function fu(Bt,Dt){var Gt=Bt.pendingLanes&~Dt;Bt.pendingLanes=Dt,Bt.suspendedLanes=0,Bt.pingedLanes=0,Bt.expiredLanes&=Dt,Bt.mutableReadLanes&=Dt,Bt.entangledLanes&=Dt,Dt=Bt.entanglements;var en=Bt.eventTimes;for(Bt=Bt.expirationTimes;0>=Hn,mn-=Hn,yu=1<<32-_o(Dt)+mn|Gt<Oo?(ps=Io,Io=null):ps=Io.sibling;var Uo=uo(cr,Io,gr[Oo],_i);if(Uo===null){Io===null&&(Io=ps);break}Bt&&Io&&Uo.alternate===null&&Dt(cr,Io),ir=An(Uo,ir,Oo),Bo===null?lo=Uo:Bo.sibling=Uo,Bo=Uo,Io=ps}if(Oo===gr.length)return Gt(cr,Io),ba&&bu(cr,Oo),lo;if(Io===null){for(;OoOo?(ps=Io,Io=null):ps=Io.sibling;var uu=uo(cr,Io,Uo.value,_i);if(uu===null){Io===null&&(Io=ps);break}Bt&&Io&&uu.alternate===null&&Dt(cr,Io),ir=An(uu,ir,Oo),Bo===null?lo=uu:Bo.sibling=uu,Bo=uu,Io=ps}if(Uo.done)return Gt(cr,Io),ba&&bu(cr,Oo),lo;if(Io===null){for(;!Uo.done;Oo++,Uo=gr.next())Uo=To(cr,Uo.value,_i),Uo!==null&&(ir=An(Uo,ir,Oo),Bo===null?lo=Uo:Bo.sibling=Uo,Bo=Uo);return ba&&bu(cr,Oo),lo}for(Io=en(cr,Io);!Uo.done;Oo++,Uo=gr.next())Uo=Zo(Io,cr,Oo,Uo.value,_i),Uo!==null&&(Bt&&Uo.alternate!==null&&Io.delete(Uo.key===null?Oo:Uo.key),ir=An(Uo,ir,Oo),Bo===null?lo=Uo:Bo.sibling=Uo,Bo=Uo);return Bt&&Io.forEach(function(Fm){return Dt(cr,Fm)}),ba&&bu(cr,Oo),lo}function El(cr,ir,gr,_i){if(typeof gr=="object"&&gr!==null&&gr.type===ut&&gr.key===null&&(gr=gr.props.children),typeof gr=="object"&&gr!==null){switch(gr.$$typeof){case lt:e:{for(var lo=gr.key,Bo=ir;Bo!==null;){if(Bo.key===lo){if(lo=gr.type,lo===ut){if(Bo.tag===7){Gt(cr,Bo.sibling),ir=mn(Bo,gr.props.children),ir.return=cr,cr=ir;break e}}else if(Bo.elementType===lo||typeof lo=="object"&&lo!==null&&lo.$$typeof===xt&&zp(lo)===Bo.type){Gt(cr,Bo.sibling),ir=mn(Bo,gr.props),ir.ref=up(cr,Bo,gr),ir.return=cr,cr=ir;break e}Gt(cr,Bo);break}else Dt(cr,Bo);Bo=Bo.sibling}gr.type===ut?(ir=Uu(gr.props.children,cr.mode,_i,gr.key),ir.return=cr,cr=ir):(_i=Dm(gr.type,gr.key,gr.props,null,cr.mode,_i),_i.ref=up(cr,ir,gr),_i.return=cr,cr=_i)}return Hn(cr);case ct:e:{for(Bo=gr.key;ir!==null;){if(ir.key===Bo)if(ir.tag===4&&ir.stateNode.containerInfo===gr.containerInfo&&ir.stateNode.implementation===gr.implementation){Gt(cr,ir.sibling),ir=mn(ir,gr.children||[]),ir.return=cr,cr=ir;break e}else{Gt(cr,ir);break}else Dt(cr,ir);ir=ir.sibling}ir=Ml(gr,cr.mode,_i),ir.return=cr,cr=ir}return Hn(cr);case xt:return Bo=gr._init,El(cr,ir,Bo(gr._payload),_i)}if(It(gr))return so(cr,ir,gr,_i);if(Tt(gr))return Ds(cr,ir,gr,_i);Wl(cr,gr)}return typeof gr=="string"&&gr!==""||typeof gr=="number"?(gr=""+gr,ir!==null&&ir.tag===6?(Gt(cr,ir.sibling),ir=mn(ir,gr),ir.return=cr,cr=ir):(Gt(cr,ir),ir=Ns(gr,cr.mode,_i),ir.return=cr,cr=ir),Hn(cr)):Gt(cr,ir)}return El}var hp=Ly(!0),Fy=Ly(!1),nu={},os=Rr(nu),dp=Rr(nu),fp=Rr(nu);function ru(Bt){if(Bt===nu)throw Error(at(174));return Bt}function Zm(Bt,Dt){rr(fp,Dt),rr(dp,Bt),rr(os,nu),Bt=Wt(Dt),er(os),rr(os,Bt)}function pp(){er(os),er(dp),er(fp)}function Uy(Bt){var Dt=ru(fp.current),Gt=ru(os.current);Dt=zt(Gt,Bt.type,Dt),Gt!==Dt&&(rr(dp,Bt),rr(os,Dt))}function Au(Bt){dp.current===Bt&&(er(os),er(dp))}var Qn=Rr(0);function Sr(Bt){for(var Dt=Bt;Dt!==null;){if(Dt.tag===13){var Gt=Dt.memoizedState;if(Gt!==null&&(Gt=Gt.dehydrated,Gt===null||_n(Gt)||Pn(Gt)))return Dt}else if(Dt.tag===19&&Dt.memoizedProps.revealOrder!==void 0){if(Dt.flags&128)return Dt}else if(Dt.child!==null){Dt.child.return=Dt,Dt=Dt.child;continue}if(Dt===Bt)break;for(;Dt.sibling===null;){if(Dt.return===null||Dt.return===Bt)return null;Dt=Dt.return}Dt.sibling.return=Dt.return,Dt=Dt.sibling}return null}var pr=[];function ro(){for(var Bt=0;BtGt?Gt:4,Bt(!0);var en=$o.transition;$o.transition={};try{Bt(!1),Dt()}finally{No=Gt,$o.transition=en}}function Hy(){return Js().memoizedState}function vs(Bt,Dt,Gt){var en=lu(Bt);Gt={lane:en,action:Gt,hasEagerState:!1,eagerState:null,next:null},Gy(Bt)?qy(Dt,Gt):(ny(Bt,Dt,Gt),Gt=Bs(),Bt=Cl(Bt,en,Gt),Bt!==null&&Yy(Bt,Dt,en))}function Ps(Bt,Dt,Gt){var en=lu(Bt),mn={lane:en,action:Gt,hasEagerState:!1,eagerState:null,next:null};if(Gy(Bt))qy(Dt,mn);else{ny(Bt,Dt,mn);var An=Bt.alternate;if(Bt.lanes===0&&(An===null||An.lanes===0)&&(An=Dt.lastRenderedReducer,An!==null))try{var Hn=Dt.lastRenderedState,nr=An(Hn,Gt);if(mn.hasEagerState=!0,mn.eagerState=nr,Xs(nr,Hn))return}catch{}finally{}Gt=Bs(),Bt=Cl(Bt,en,Gt),Bt!==null&&Yy(Bt,Dt,en)}}function Gy(Bt){var Dt=Bt.alternate;return Bt===xo||Dt!==null&&Dt===xo}function qy(Bt,Dt){$u=Hs=!0;var Gt=Bt.pending;Gt===null?Dt.next=Dt:(Dt.next=Gt.next,Gt.next=Dt),Bt.pending=Dt}function ny(Bt,Dt,Gt){ds!==null&&Bt.mode&1&&!(Ro&2)?(Bt=Dt.interleaved,Bt===null?(Gt.next=Gt,Zs===null?Zs=[Dt]:Zs.push(Dt)):(Gt.next=Bt.next,Bt.next=Gt),Dt.interleaved=Gt):(Bt=Dt.pending,Bt===null?Gt.next=Gt:(Gt.next=Bt.next,Bt.next=Gt),Dt.pending=Gt)}function Yy(Bt,Dt,Gt){if(Gt&4194240){var en=Dt.lanes;en&=Bt.pendingLanes,Gt|=en,Dt.lanes=Gt,_c(Bt,Gt)}}var bp={readContext:Wo,useCallback:ws,useContext:ws,useEffect:ws,useImperativeHandle:ws,useInsertionEffect:ws,useLayoutEffect:ws,useMemo:ws,useReducer:ws,useRef:ws,useState:ws,useDebugValue:ws,useDeferredValue:ws,useTransition:ws,useMutableSource:ws,useSyncExternalStore:ws,useId:ws,unstable_isNewReconciler:!1},Zp={readContext:Wo,useCallback:function(Bt,Dt){return iu().memoizedState=[Bt,Dt===void 0?null:Dt],Bt},useContext:Wo,useEffect:yp,useImperativeHandle:function(Bt,Dt,Gt){return Gt=Gt!=null?Gt.concat([Bt]):null,Pu(4194308,4,Yp.bind(null,Dt,Bt),Gt)},useLayoutEffect:function(Bt,Dt){return Pu(4194308,4,Bt,Dt)},useInsertionEffect:function(Bt,Dt){return Pu(4,2,Bt,Dt)},useMemo:function(Bt,Dt){var Gt=iu();return Dt=Dt===void 0?null:Dt,Bt=Bt(),Gt.memoizedState=[Bt,Dt],Bt},useReducer:function(Bt,Dt,Gt){var en=iu();return Dt=Gt!==void 0?Gt(Dt):Dt,en.memoizedState=en.baseState=Dt,Bt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:Dt},en.queue=Bt,Bt=Bt.dispatch=vs.bind(null,xo,Bt),[en.memoizedState,Bt]},useRef:function(Bt){var Dt=iu();return Bt={current:Bt},Dt.memoizedState=Bt},useState:_m,useDebugValue:Xp,useDeferredValue:function(Bt){var Dt=_m(Bt),Gt=Dt[0],en=Dt[1];return yp(function(){var mn=$o.transition;$o.transition={};try{en(Bt)}finally{$o.transition=mn}},[Bt]),Gt},useTransition:function(){var Bt=_m(!1),Dt=Bt[0];return Bt=j0.bind(null,Bt[1]),iu().memoizedState=Bt,[Dt,Bt]},useMutableSource:function(){},useSyncExternalStore:function(Bt,Dt,Gt){var en=xo,mn=iu();if(ba){if(Gt===void 0)throw Error(at(407));Gt=Gt()}else{if(Gt=Dt(),ds===null)throw Error(at(349));$a&30||Hp(en,Dt,Gt)}mn.memoizedState=Gt;var An={value:Gt,getSnapshot:Dt};return mn.queue=An,yp(Gp.bind(null,en,An,Bt),[Bt]),en.flags|=2048,Cu(9,Qm.bind(null,en,An,Gt,Dt),void 0,null),Gt},useId:function(){var Bt=iu(),Dt=ds.identifierPrefix;if(ba){var Gt=Fl,en=yu;Gt=(en&~(1<<32-_o(en)-1)).toString(32)+Gt,Dt=":"+Dt+"R"+Gt,Gt=Wp++,0")&&(_r=_r.replace("",Bt.displayName)),_r}while(1<=Hn&&0<=nr);break}}}finally{Fr=!1,Error.prepareStackTrace=Gt}return(Bt=Bt?Bt.displayName||Bt.name:"")?Pr(Bt):""}var Cr=Object.prototype.hasOwnProperty,Dr=[],Ur=-1;function Rr(Bt){return{current:Bt}}function er(Bt){0>Ur||(Bt.current=Dr[Ur],Dr[Ur]=null,Ur--)}function rr(Bt,Dt){Ur++,Dr[Ur]=Bt.current,Bt.current=Dt}var xr={},dr=Rr(xr),yr=Rr(!1),$r=xr;function no(Bt,Dt){var Gt=Bt.type.contextTypes;if(!Gt)return xr;var en=Bt.stateNode;if(en&&en.__reactInternalMemoizedUnmaskedChildContext===Dt)return en.__reactInternalMemoizedMaskedChildContext;var mn={},An;for(An in Gt)mn[An]=Dt[An];return en&&(Bt=Bt.stateNode,Bt.__reactInternalMemoizedUnmaskedChildContext=Dt,Bt.__reactInternalMemoizedMaskedChildContext=mn),mn}function ao(Bt){return Bt=Bt.childContextTypes,Bt!=null}function ho(){er(yr),er(dr)}function fo(Bt,Dt,Gt){if(dr.current!==xr)throw Error(at(168));rr(dr,Dt),rr(yr,Gt)}function qn(Bt,Dt,Gt){var en=Bt.stateNode;if(Dt=Dt.childContextTypes,typeof en.getChildContext!="function")return Gt;en=en.getChildContext();for(var mn in en)if(!(mn in Dt))throw Error(at(108,Et(Bt)||"Unknown",mn));return ot({},Gt,en)}function wo(Bt){return Bt=(Bt=Bt.stateNode)&&Bt.__reactInternalMemoizedMergedChildContext||xr,$r=dr.current,rr(dr,Bt),rr(yr,yr.current),!0}function vo(Bt,Dt,Gt){var en=Bt.stateNode;if(!en)throw Error(at(169));Gt?(Bt=qn(Bt,Dt,$r),en.__reactInternalMemoizedMergedChildContext=Bt,er(yr),er(dr),rr(dr,Bt)):er(yr),rr(yr,Gt)}var _o=Math.clz32?Math.clz32:Mo,yo=Math.log,Ao=Math.LN2;function Mo(Bt){return Bt>>>=0,Bt===0?32:31-(yo(Bt)/Ao|0)|0}var zo=64,Co=4194304;function Lo(Bt){switch(Bt&-Bt){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return Bt&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return Bt&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return Bt}}function Ho(Bt,Dt){var Gt=Bt.pendingLanes;if(Gt===0)return 0;var en=0,mn=Bt.suspendedLanes,An=Bt.pingedLanes,Hn=Gt&268435455;if(Hn!==0){var nr=Hn&~mn;nr!==0?en=Lo(nr):(An&=Hn,An!==0&&(en=Lo(An)))}else Hn=Gt&~mn,Hn!==0?en=Lo(Hn):An!==0&&(en=Lo(An));if(en===0)return 0;if(Dt!==0&&Dt!==en&&!(Dt&mn)&&(mn=en&-en,An=Dt&-Dt,mn>=An||mn===16&&(An&4194240)!==0))return Dt;if(en&4&&(en|=Gt&16),Dt=Bt.entangledLanes,Dt!==0)for(Bt=Bt.entanglements,Dt&=en;0Gt;Gt++)Dt.push(Bt);return Dt}function Xo(Bt,Dt,Gt){Bt.pendingLanes|=Dt,Dt!==536870912&&(Bt.suspendedLanes=0,Bt.pingedLanes=0),Bt=Bt.eventTimes,Dt=31-_o(Dt),Bt[Dt]=Gt}function fu(Bt,Dt){var Gt=Bt.pendingLanes&~Dt;Bt.pendingLanes=Dt,Bt.suspendedLanes=0,Bt.pingedLanes=0,Bt.expiredLanes&=Dt,Bt.mutableReadLanes&=Dt,Bt.entangledLanes&=Dt,Dt=Bt.entanglements;var en=Bt.eventTimes;for(Bt=Bt.expirationTimes;0>=Hn,mn-=Hn,yu=1<<32-_o(Dt)+mn|Gt<Oo?(ps=Io,Io=null):ps=Io.sibling;var Uo=uo(cr,Io,gr[Oo],_i);if(Uo===null){Io===null&&(Io=ps);break}Bt&&Io&&Uo.alternate===null&&Dt(cr,Io),ir=An(Uo,ir,Oo),Bo===null?lo=Uo:Bo.sibling=Uo,Bo=Uo,Io=ps}if(Oo===gr.length)return Gt(cr,Io),ba&&bu(cr,Oo),lo;if(Io===null){for(;OoOo?(ps=Io,Io=null):ps=Io.sibling;var uu=uo(cr,Io,Uo.value,_i);if(uu===null){Io===null&&(Io=ps);break}Bt&&Io&&uu.alternate===null&&Dt(cr,Io),ir=An(uu,ir,Oo),Bo===null?lo=uu:Bo.sibling=uu,Bo=uu,Io=ps}if(Uo.done)return Gt(cr,Io),ba&&bu(cr,Oo),lo;if(Io===null){for(;!Uo.done;Oo++,Uo=gr.next())Uo=To(cr,Uo.value,_i),Uo!==null&&(ir=An(Uo,ir,Oo),Bo===null?lo=Uo:Bo.sibling=Uo,Bo=Uo);return ba&&bu(cr,Oo),lo}for(Io=en(cr,Io);!Uo.done;Oo++,Uo=gr.next())Uo=Jo(Io,cr,Oo,Uo.value,_i),Uo!==null&&(Bt&&Uo.alternate!==null&&Io.delete(Uo.key===null?Oo:Uo.key),ir=An(Uo,ir,Oo),Bo===null?lo=Uo:Bo.sibling=Uo,Bo=Uo);return Bt&&Io.forEach(function(Fm){return Dt(cr,Fm)}),ba&&bu(cr,Oo),lo}function El(cr,ir,gr,_i){if(typeof gr=="object"&&gr!==null&&gr.type===ut&&gr.key===null&&(gr=gr.props.children),typeof gr=="object"&&gr!==null){switch(gr.$$typeof){case lt:e:{for(var lo=gr.key,Bo=ir;Bo!==null;){if(Bo.key===lo){if(lo=gr.type,lo===ut){if(Bo.tag===7){Gt(cr,Bo.sibling),ir=mn(Bo,gr.props.children),ir.return=cr,cr=ir;break e}}else if(Bo.elementType===lo||typeof lo=="object"&&lo!==null&&lo.$$typeof===xt&&zp(lo)===Bo.type){Gt(cr,Bo.sibling),ir=mn(Bo,gr.props),ir.ref=up(cr,Bo,gr),ir.return=cr,cr=ir;break e}Gt(cr,Bo);break}else Dt(cr,Bo);Bo=Bo.sibling}gr.type===ut?(ir=Uu(gr.props.children,cr.mode,_i,gr.key),ir.return=cr,cr=ir):(_i=Dm(gr.type,gr.key,gr.props,null,cr.mode,_i),_i.ref=up(cr,ir,gr),_i.return=cr,cr=_i)}return Hn(cr);case ct:e:{for(Bo=gr.key;ir!==null;){if(ir.key===Bo)if(ir.tag===4&&ir.stateNode.containerInfo===gr.containerInfo&&ir.stateNode.implementation===gr.implementation){Gt(cr,ir.sibling),ir=mn(ir,gr.children||[]),ir.return=cr,cr=ir;break e}else{Gt(cr,ir);break}else Dt(cr,ir);ir=ir.sibling}ir=Ml(gr,cr.mode,_i),ir.return=cr,cr=ir}return Hn(cr);case xt:return Bo=gr._init,El(cr,ir,Bo(gr._payload),_i)}if(It(gr))return so(cr,ir,gr,_i);if(Tt(gr))return Ds(cr,ir,gr,_i);Wl(cr,gr)}return typeof gr=="string"&&gr!==""||typeof gr=="number"?(gr=""+gr,ir!==null&&ir.tag===6?(Gt(cr,ir.sibling),ir=mn(ir,gr),ir.return=cr,cr=ir):(Gt(cr,ir),ir=Ns(gr,cr.mode,_i),ir.return=cr,cr=ir),Hn(cr)):Gt(cr,ir)}return El}var hp=Ly(!0),Fy=Ly(!1),nu={},os=Rr(nu),dp=Rr(nu),fp=Rr(nu);function ru(Bt){if(Bt===nu)throw Error(at(174));return Bt}function Jm(Bt,Dt){rr(fp,Dt),rr(dp,Bt),rr(os,nu),Bt=Wt(Dt),er(os),rr(os,Bt)}function pp(){er(os),er(dp),er(fp)}function Uy(Bt){var Dt=ru(fp.current),Gt=ru(os.current);Dt=zt(Gt,Bt.type,Dt),Gt!==Dt&&(rr(dp,Bt),rr(os,Dt))}function Au(Bt){dp.current===Bt&&(er(os),er(dp))}var Qn=Rr(0);function Sr(Bt){for(var Dt=Bt;Dt!==null;){if(Dt.tag===13){var Gt=Dt.memoizedState;if(Gt!==null&&(Gt=Gt.dehydrated,Gt===null||_n(Gt)||Pn(Gt)))return Dt}else if(Dt.tag===19&&Dt.memoizedProps.revealOrder!==void 0){if(Dt.flags&128)return Dt}else if(Dt.child!==null){Dt.child.return=Dt,Dt=Dt.child;continue}if(Dt===Bt)break;for(;Dt.sibling===null;){if(Dt.return===null||Dt.return===Bt)return null;Dt=Dt.return}Dt.sibling.return=Dt.return,Dt=Dt.sibling}return null}var pr=[];function ro(){for(var Bt=0;BtGt?Gt:4,Bt(!0);var en=$o.transition;$o.transition={};try{Bt(!1),Dt()}finally{No=Gt,$o.transition=en}}function Hy(){return Zs().memoizedState}function vs(Bt,Dt,Gt){var en=lu(Bt);Gt={lane:en,action:Gt,hasEagerState:!1,eagerState:null,next:null},Gy(Bt)?qy(Dt,Gt):(ny(Bt,Dt,Gt),Gt=Bs(),Bt=Cl(Bt,en,Gt),Bt!==null&&Yy(Bt,Dt,en))}function Ps(Bt,Dt,Gt){var en=lu(Bt),mn={lane:en,action:Gt,hasEagerState:!1,eagerState:null,next:null};if(Gy(Bt))qy(Dt,mn);else{ny(Bt,Dt,mn);var An=Bt.alternate;if(Bt.lanes===0&&(An===null||An.lanes===0)&&(An=Dt.lastRenderedReducer,An!==null))try{var Hn=Dt.lastRenderedState,nr=An(Hn,Gt);if(mn.hasEagerState=!0,mn.eagerState=nr,Xs(nr,Hn))return}catch{}finally{}Gt=Bs(),Bt=Cl(Bt,en,Gt),Bt!==null&&Yy(Bt,Dt,en)}}function Gy(Bt){var Dt=Bt.alternate;return Bt===xo||Dt!==null&&Dt===xo}function qy(Bt,Dt){$u=Hs=!0;var Gt=Bt.pending;Gt===null?Dt.next=Dt:(Dt.next=Gt.next,Gt.next=Dt),Bt.pending=Dt}function ny(Bt,Dt,Gt){ds!==null&&Bt.mode&1&&!(Ro&2)?(Bt=Dt.interleaved,Bt===null?(Gt.next=Gt,Js===null?Js=[Dt]:Js.push(Dt)):(Gt.next=Bt.next,Bt.next=Gt),Dt.interleaved=Gt):(Bt=Dt.pending,Bt===null?Gt.next=Gt:(Gt.next=Bt.next,Bt.next=Gt),Dt.pending=Gt)}function Yy(Bt,Dt,Gt){if(Gt&4194240){var en=Dt.lanes;en&=Bt.pendingLanes,Gt|=en,Dt.lanes=Gt,_c(Bt,Gt)}}var bp={readContext:Wo,useCallback:ws,useContext:ws,useEffect:ws,useImperativeHandle:ws,useInsertionEffect:ws,useLayoutEffect:ws,useMemo:ws,useReducer:ws,useRef:ws,useState:ws,useDebugValue:ws,useDeferredValue:ws,useTransition:ws,useMutableSource:ws,useSyncExternalStore:ws,useId:ws,unstable_isNewReconciler:!1},Jp={readContext:Wo,useCallback:function(Bt,Dt){return iu().memoizedState=[Bt,Dt===void 0?null:Dt],Bt},useContext:Wo,useEffect:yp,useImperativeHandle:function(Bt,Dt,Gt){return Gt=Gt!=null?Gt.concat([Bt]):null,Pu(4194308,4,Yp.bind(null,Dt,Bt),Gt)},useLayoutEffect:function(Bt,Dt){return Pu(4194308,4,Bt,Dt)},useInsertionEffect:function(Bt,Dt){return Pu(4,2,Bt,Dt)},useMemo:function(Bt,Dt){var Gt=iu();return Dt=Dt===void 0?null:Dt,Bt=Bt(),Gt.memoizedState=[Bt,Dt],Bt},useReducer:function(Bt,Dt,Gt){var en=iu();return Dt=Gt!==void 0?Gt(Dt):Dt,en.memoizedState=en.baseState=Dt,Bt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:Dt},en.queue=Bt,Bt=Bt.dispatch=vs.bind(null,xo,Bt),[en.memoizedState,Bt]},useRef:function(Bt){var Dt=iu();return Bt={current:Bt},Dt.memoizedState=Bt},useState:_m,useDebugValue:Xp,useDeferredValue:function(Bt){var Dt=_m(Bt),Gt=Dt[0],en=Dt[1];return yp(function(){var mn=$o.transition;$o.transition={};try{en(Bt)}finally{$o.transition=mn}},[Bt]),Gt},useTransition:function(){var Bt=_m(!1),Dt=Bt[0];return Bt=j0.bind(null,Bt[1]),iu().memoizedState=Bt,[Dt,Bt]},useMutableSource:function(){},useSyncExternalStore:function(Bt,Dt,Gt){var en=xo,mn=iu();if(ba){if(Gt===void 0)throw Error(at(407));Gt=Gt()}else{if(Gt=Dt(),ds===null)throw Error(at(349));$a&30||Hp(en,Dt,Gt)}mn.memoizedState=Gt;var An={value:Gt,getSnapshot:Dt};return mn.queue=An,yp(Gp.bind(null,en,An,Bt),[Bt]),en.flags|=2048,Cu(9,Qm.bind(null,en,An,Gt,Dt),void 0,null),Gt},useId:function(){var Bt=iu(),Dt=ds.identifierPrefix;if(ba){var Gt=Fl,en=yu;Gt=(en&~(1<<32-_o(en)-1)).toString(32)+Gt,Dt=":"+Dt+"R"+Gt,Gt=Wp++,0im&&(Dt.flags|=128,en=!0,Ms(mn,!1),Dt.lanes=4194304)}else{if(!en)if(Bt=Sr(An),Bt!==null){if(Dt.flags|=128,en=!0,Bt=Bt.updateQueue,Bt!==null&&(Dt.updateQueue=Bt,Dt.flags|=4),Ms(mn,!0),mn.tail===null&&mn.tailMode==="hidden"&&!An.alternate&&!ba)return go(Dt),null}else 2*es()-mn.renderingStartTime>im&&Gt!==1073741824&&(Dt.flags|=128,en=!0,Ms(mn,!1),Dt.lanes=4194304);mn.isBackwards?(An.sibling=Dt.child,Dt.child=An):(Bt=mn.last,Bt!==null?Bt.sibling=An:Dt.child=An,mn.last=An)}return mn.tail!==null?(Dt=mn.tail,mn.rendering=Dt,mn.tail=Dt.sibling,mn.renderingStartTime=es(),Dt.sibling=null,Bt=Qn.current,rr(Qn,en?Bt&1|2:Bt&1),Dt):(go(Dt),null);case 22:case 23:return vy(),en=Dt.memoizedState!==null,Bt!==null&&Bt.memoizedState!==null!==en&&(Dt.flags|=8192),en&&Dt.mode&1?xl&1073741824&&(go(Dt),rn&&Dt.subtreeFlags&6&&(Dt.flags|=8192)):go(Dt),null;case 24:return null;case 25:return null}throw Error(at(156,Dt.tag))}var D0=st.ReactCurrentOwner,Qs=!1;function ls(Bt,Dt,Gt,en){Dt.child=Bt===null?Fy(Dt,null,Gt,en):hp(Dt,Bt.child,Gt,en)}function Qy(Bt,Dt,Gt,en,mn){Gt=Gt.render;var An=Dt.ref;return rs(Dt,mn),en=Go(Bt,Dt,Gt,en,An,mn),Gt=Jm(),Bt!==null&&!Qs?(Dt.updateQueue=Bt.updateQueue,Dt.flags&=-2053,Bt.lanes&=~mn,_s(Bt,Dt,mn)):(ba&&Gt&&bm(Dt),Dt.flags|=1,ls(Bt,Dt,en,mn),Dt.child)}function e0(Bt,Dt,Gt,en,mn){if(Bt===null){var An=Gt.type;return typeof An=="function"&&!Ay(An)&&An.defaultProps===void 0&&Gt.compare===null&&Gt.defaultProps===void 0?(Dt.tag=15,Dt.type=An,n0(Bt,Dt,An,en,mn)):(Bt=Dm(Gt.type,null,en,Dt,Dt.mode,mn),Bt.ref=Dt.ref,Bt.return=Dt,Dt.child=Bt)}if(An=Bt.child,!(Bt.lanes&mn)){var Hn=An.memoizedProps;if(Gt=Gt.compare,Gt=Gt!==null?Gt:ts,Gt(Hn,en)&&Bt.ref===Dt.ref)return _s(Bt,Dt,mn)}return Dt.flags|=1,Bt=ku(An,en),Bt.ref=Dt.ref,Bt.return=Dt,Dt.child=Bt}function n0(Bt,Dt,Gt,en,mn){if(Bt!==null&&ts(Bt.memoizedProps,en)&&Bt.ref===Dt.ref)if(Qs=!1,(Bt.lanes&mn)!==0)Bt.flags&131072&&(Qs=!0);else return Dt.lanes=Bt.lanes,_s(Bt,Dt,mn);return Vl(Bt,Dt,Gt,en,mn)}function r0(Bt,Dt,Gt){var en=Dt.pendingProps,mn=en.children,An=Bt!==null?Bt.memoizedState:null;if(en.mode==="hidden")if(!(Dt.mode&1))Dt.memoizedState={baseLanes:0,cachePool:null},rr(Sp,xl),xl|=Gt;else if(Gt&1073741824)Dt.memoizedState={baseLanes:0,cachePool:null},en=An!==null?An.baseLanes:Gt,rr(Sp,xl),xl|=en;else return Bt=An!==null?An.baseLanes|Gt:Gt,Dt.lanes=Dt.childLanes=1073741824,Dt.memoizedState={baseLanes:Bt,cachePool:null},Dt.updateQueue=null,rr(Sp,xl),xl|=Bt,null;else An!==null?(en=An.baseLanes|Gt,Dt.memoizedState=null):en=Gt,rr(Sp,xl),xl|=en;return ls(Bt,Dt,mn,Gt),Dt.child}function i0(Bt,Dt){var Gt=Dt.ref;(Bt===null&&Gt!==null||Bt!==null&&Bt.ref!==Gt)&&(Dt.flags|=512,Dt.flags|=2097152)}function Vl(Bt,Dt,Gt,en,mn){var An=ao(Gt)?$r:dr.current;return An=no(Dt,An),rs(Dt,mn),Gt=Go(Bt,Dt,Gt,en,An,mn),en=Jm(),Bt!==null&&!Qs?(Dt.updateQueue=Bt.updateQueue,Dt.flags&=-2053,Bt.lanes&=~mn,_s(Bt,Dt,mn)):(ba&&en&&bm(Dt),Dt.flags|=1,ls(Bt,Dt,Gt,mn),Dt.child)}function o0(Bt,Dt,Gt,en,mn){if(ao(Gt)){var An=!0;wo(Dt)}else An=!1;if(rs(Dt,mn),Dt.stateNode===null)Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Oy(Dt,Gt,en),ap(Dt,Gt,en,mn),en=!0;else if(Bt===null){var Hn=Dt.stateNode,nr=Dt.memoizedProps;Hn.props=nr;var _r=Hn.context,Wr=Gt.contextType;typeof Wr=="object"&&Wr!==null?Wr=Wo(Wr):(Wr=ao(Gt)?$r:dr.current,Wr=no(Dt,Wr));var io=Gt.getDerivedStateFromProps,To=typeof io=="function"||typeof Hn.getSnapshotBeforeUpdate=="function";To||typeof Hn.UNSAFE_componentWillReceiveProps!="function"&&typeof Hn.componentWillReceiveProps!="function"||(nr!==en||_r!==Wr)&&Ym(Dt,Hn,en,Wr),bs=!1;var uo=Dt.memoizedState;Hn.state=uo,Dl(Dt,en,Hn,mn),_r=Dt.memoizedState,nr!==en||uo!==_r||yr.current||bs?(typeof io=="function"&&(Np(Dt,Gt,io,en),_r=Dt.memoizedState),(nr=bs||By(Dt,Gt,nr,en,uo,_r,Wr))?(To||typeof Hn.UNSAFE_componentWillMount!="function"&&typeof Hn.componentWillMount!="function"||(typeof Hn.componentWillMount=="function"&&Hn.componentWillMount(),typeof Hn.UNSAFE_componentWillMount=="function"&&Hn.UNSAFE_componentWillMount()),typeof Hn.componentDidMount=="function"&&(Dt.flags|=4194308)):(typeof Hn.componentDidMount=="function"&&(Dt.flags|=4194308),Dt.memoizedProps=en,Dt.memoizedState=_r),Hn.props=en,Hn.state=_r,Hn.context=Wr,en=nr):(typeof Hn.componentDidMount=="function"&&(Dt.flags|=4194308),en=!1)}else{Hn=Dt.stateNode,qm(Bt,Dt),nr=Dt.memoizedProps,Wr=Dt.type===Dt.elementType?nr:ss(Dt.type,nr),Hn.props=Wr,To=Dt.pendingProps,uo=Hn.context,_r=Gt.contextType,typeof _r=="object"&&_r!==null?_r=Wo(_r):(_r=ao(Gt)?$r:dr.current,_r=no(Dt,_r));var Zo=Gt.getDerivedStateFromProps;(io=typeof Zo=="function"||typeof Hn.getSnapshotBeforeUpdate=="function")||typeof Hn.UNSAFE_componentWillReceiveProps!="function"&&typeof Hn.componentWillReceiveProps!="function"||(nr!==To||uo!==_r)&&Ym(Dt,Hn,en,_r),bs=!1,uo=Dt.memoizedState,Hn.state=uo,Dl(Dt,en,Hn,mn);var so=Dt.memoizedState;nr!==To||uo!==so||yr.current||bs?(typeof Zo=="function"&&(Np(Dt,Gt,Zo,en),so=Dt.memoizedState),(Wr=bs||By(Dt,Gt,Wr,en,uo,so,_r)||!1)?(io||typeof Hn.UNSAFE_componentWillUpdate!="function"&&typeof Hn.componentWillUpdate!="function"||(typeof Hn.componentWillUpdate=="function"&&Hn.componentWillUpdate(en,so,_r),typeof Hn.UNSAFE_componentWillUpdate=="function"&&Hn.UNSAFE_componentWillUpdate(en,so,_r)),typeof Hn.componentDidUpdate=="function"&&(Dt.flags|=4),typeof Hn.getSnapshotBeforeUpdate=="function"&&(Dt.flags|=1024)):(typeof Hn.componentDidUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=4),typeof Hn.getSnapshotBeforeUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=1024),Dt.memoizedProps=en,Dt.memoizedState=so),Hn.props=en,Hn.state=so,Hn.context=_r,en=Wr):(typeof Hn.componentDidUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=4),typeof Hn.getSnapshotBeforeUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=1024),en=!1)}return iy(Bt,Dt,Gt,en,An,mn)}function iy(Bt,Dt,Gt,en,mn,An){i0(Bt,Dt);var Hn=(Dt.flags&128)!==0;if(!en&&!Hn)return mn&&vo(Dt,Gt,!1),_s(Bt,Dt,An);en=Dt.stateNode,D0.current=Dt;var nr=Hn&&typeof Gt.getDerivedStateFromError!="function"?null:en.render();return Dt.flags|=1,Bt!==null&&Hn?(Dt.child=hp(Dt,Bt.child,null,An),Dt.child=hp(Dt,null,nr,An)):ls(Bt,Dt,nr,An),Dt.memoizedState=en.state,mn&&vo(Dt,Gt,!0),Dt.child}function a0(Bt){var Dt=Bt.stateNode;Dt.pendingContext?fo(Bt,Dt.pendingContext,Dt.pendingContext!==Dt.context):Dt.context&&fo(Bt,Dt.context,!1),Zm(Bt,Dt.containerInfo)}function s0(Bt,Dt,Gt,en,mn){return cp(),Up(mn),Dt.flags|=256,ls(Bt,Dt,Gt,en),Dt.child}var km={dehydrated:null,treeContext:null,retryLane:0};function $l(Bt){return{baseLanes:Bt,cachePool:null}}function l0(Bt,Dt,Gt){var en=Dt.pendingProps,mn=Qn.current,An=!1,Hn=(Dt.flags&128)!==0,nr;if((nr=Hn)||(nr=Bt!==null&&Bt.memoizedState===null?!1:(mn&2)!==0),nr?(An=!0,Dt.flags&=-129):(Bt===null||Bt.memoizedState!==null)&&(mn|=1),rr(Qn,mn&1),Bt===null)return Xm(Dt),Bt=Dt.memoizedState,Bt!==null&&(Bt=Bt.dehydrated,Bt!==null)?(Dt.mode&1?Pn(Bt)?Dt.lanes=8:Dt.lanes=1073741824:Dt.lanes=1,null):(mn=en.children,Bt=en.fallback,An?(en=Dt.mode,An=Dt.child,mn={mode:"hidden",children:mn},!(en&1)&&An!==null?(An.childLanes=0,An.pendingProps=mn):An=cm(mn,en,0,null),Bt=Uu(Bt,en,Gt,null),An.return=Dt,Bt.return=Dt,An.sibling=Bt,Dt.child=An,Dt.child.memoizedState=$l(Gt),Dt.memoizedState=km,Bt):oy(Dt,mn));if(mn=Bt.memoizedState,mn!==null){if(nr=mn.dehydrated,nr!==null){if(Hn)return Dt.flags&256?(Dt.flags&=-257,Sm(Bt,Dt,Gt,Error(at(422)))):Dt.memoizedState!==null?(Dt.child=Bt.child,Dt.flags|=128,null):(An=en.fallback,mn=Dt.mode,en=cm({mode:"visible",children:en.children},mn,0,null),An=Uu(An,mn,Gt,null),An.flags|=2,en.return=Dt,An.return=Dt,en.sibling=An,Dt.child=en,Dt.mode&1&&hp(Dt,Bt.child,null,Gt),Dt.child.memoizedState=$l(Gt),Dt.memoizedState=km,An);if(!(Dt.mode&1))Dt=Sm(Bt,Dt,Gt,null);else if(Pn(nr))Dt=Sm(Bt,Dt,Gt,Error(at(419)));else if(en=(Gt&Bt.childLanes)!==0,Qs||en){if(en=ds,en!==null){switch(Gt&-Gt){case 4:An=2;break;case 16:An=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:An=32;break;case 536870912:An=268435456;break;default:An=0}en=An&(en.suspendedLanes|Gt)?0:An,en!==0&&en!==mn.retryLane&&(mn.retryLane=en,Cl(Bt,en,-1))}Om(),Dt=Sm(Bt,Dt,Gt,Error(at(421)))}else _n(nr)?(Dt.flags|=128,Dt.child=Bt.child,Dt=Fu.bind(null,Bt),un(nr,Dt),Dt=null):(Gt=mn.treeContext,vn&&(Is=Fn(nr),Vs=Dt,ba=!0,Ul=null,lp=!1,Gt!==null&&(Gs[qs++]=yu,Gs[qs++]=Fl,Gs[qs++]=Iu,yu=Gt.id,Fl=Gt.overflow,Iu=Dt)),Dt=oy(Dt,Dt.pendingProps.children),Dt.flags|=4096);return Dt}return An?(en=u0(Bt,Dt,en.children,en.fallback,Gt),An=Dt.child,mn=Bt.child.memoizedState,An.memoizedState=mn===null?$l(Gt):{baseLanes:mn.baseLanes|Gt,cachePool:null},An.childLanes=Bt.childLanes&~Gt,Dt.memoizedState=km,en):(Gt=c0(Bt,Dt,en.children,Gt),Dt.memoizedState=null,Gt)}return An?(en=u0(Bt,Dt,en.children,en.fallback,Gt),An=Dt.child,mn=Bt.child.memoizedState,An.memoizedState=mn===null?$l(Gt):{baseLanes:mn.baseLanes|Gt,cachePool:null},An.childLanes=Bt.childLanes&~Gt,Dt.memoizedState=km,en):(Gt=c0(Bt,Dt,en.children,Gt),Dt.memoizedState=null,Gt)}function oy(Bt,Dt){return Dt=cm({mode:"visible",children:Dt},Bt.mode,0,null),Dt.return=Bt,Bt.child=Dt}function c0(Bt,Dt,Gt,en){var mn=Bt.child;return Bt=mn.sibling,Gt=ku(mn,{mode:"visible",children:Gt}),!(Dt.mode&1)&&(Gt.lanes=en),Gt.return=Dt,Gt.sibling=null,Bt!==null&&(en=Dt.deletions,en===null?(Dt.deletions=[Bt],Dt.flags|=16):en.push(Bt)),Dt.child=Gt}function u0(Bt,Dt,Gt,en,mn){var An=Dt.mode;Bt=Bt.child;var Hn=Bt.sibling,nr={mode:"hidden",children:Gt};return!(An&1)&&Dt.child!==Bt?(Gt=Dt.child,Gt.childLanes=0,Gt.pendingProps=nr,Dt.deletions=null):(Gt=ku(Bt,nr),Gt.subtreeFlags=Bt.subtreeFlags&14680064),Hn!==null?en=ku(Hn,en):(en=Uu(en,An,mn,null),en.flags|=2),en.return=Dt,Gt.return=Dt,Gt.sibling=en,Dt.child=Gt,en}function Sm(Bt,Dt,Gt,en){return en!==null&&Up(en),hp(Dt,Bt.child,null,Gt),Bt=oy(Dt,Dt.pendingProps.children),Bt.flags|=2,Dt.memoizedState=null,Bt}function Mu(Bt,Dt,Gt){Bt.lanes|=Dt;var en=Bt.alternate;en!==null&&(en.lanes|=Dt),$s(Bt.return,Dt,Gt)}function ay(Bt,Dt,Gt,en,mn){var An=Bt.memoizedState;An===null?Bt.memoizedState={isBackwards:Dt,rendering:null,renderingStartTime:0,last:en,tail:Gt,tailMode:mn}:(An.isBackwards=Dt,An.rendering=null,An.renderingStartTime=0,An.last=en,An.tail=Gt,An.tailMode=mn)}function h0(Bt,Dt,Gt){var en=Dt.pendingProps,mn=en.revealOrder,An=en.tail;if(ls(Bt,Dt,en.children,Gt),en=Qn.current,en&2)en=en&1|2,Dt.flags|=128;else{if(Bt!==null&&Bt.flags&128)e:for(Bt=Dt.child;Bt!==null;){if(Bt.tag===13)Bt.memoizedState!==null&&Mu(Bt,Gt,Dt);else if(Bt.tag===19)Mu(Bt,Gt,Dt);else if(Bt.child!==null){Bt.child.return=Bt,Bt=Bt.child;continue}if(Bt===Dt)break e;for(;Bt.sibling===null;){if(Bt.return===null||Bt.return===Dt)break e;Bt=Bt.return}Bt.sibling.return=Bt.return,Bt=Bt.sibling}en&=1}if(rr(Qn,en),!(Dt.mode&1))Dt.memoizedState=null;else switch(mn){case"forwards":for(Gt=Dt.child,mn=null;Gt!==null;)Bt=Gt.alternate,Bt!==null&&Sr(Bt)===null&&(mn=Gt),Gt=Gt.sibling;Gt=mn,Gt===null?(mn=Dt.child,Dt.child=null):(mn=Gt.sibling,Gt.sibling=null),ay(Dt,!1,mn,Gt,An);break;case"backwards":for(Gt=null,mn=Dt.child,Dt.child=null;mn!==null;){if(Bt=mn.alternate,Bt!==null&&Sr(Bt)===null){Dt.child=mn;break}Bt=mn.sibling,mn.sibling=Gt,Gt=mn,mn=Bt}ay(Dt,!0,Gt,null,An);break;case"together":ay(Dt,!1,null,null,void 0);break;default:Dt.memoizedState=null}return Dt.child}function _s(Bt,Dt,Gt){if(Bt!==null&&(Dt.dependencies=Bt.dependencies),Tp|=Dt.lanes,!(Gt&Dt.childLanes))return null;if(Bt!==null&&Dt.child!==Bt.child)throw Error(at(153));if(Dt.child!==null){for(Bt=Dt.child,Gt=ku(Bt,Bt.pendingProps),Dt.child=Gt,Gt.return=Dt;Bt.sibling!==null;)Bt=Bt.sibling,Gt=Gt.sibling=ku(Bt,Bt.pendingProps),Gt.return=Dt;Gt.sibling=null}return Dt.child}function L0(Bt,Dt,Gt){switch(Dt.tag){case 3:a0(Dt),cp();break;case 5:Uy(Dt);break;case 1:ao(Dt.type)&&wo(Dt);break;case 4:Zm(Dt,Dt.stateNode.containerInfo);break;case 10:jp(Dt,Dt.type._context,Dt.memoizedProps.value);break;case 13:var en=Dt.memoizedState;if(en!==null)return en.dehydrated!==null?(rr(Qn,Qn.current&1),Dt.flags|=128,null):Gt&Dt.child.childLanes?l0(Bt,Dt,Gt):(rr(Qn,Qn.current&1),Bt=_s(Bt,Dt,Gt),Bt!==null?Bt.sibling:null);rr(Qn,Qn.current&1);break;case 19:if(en=(Gt&Dt.childLanes)!==0,Bt.flags&128){if(en)return h0(Bt,Dt,Gt);Dt.flags|=128}var mn=Dt.memoizedState;if(mn!==null&&(mn.rendering=null,mn.tail=null,mn.lastEffect=null),rr(Qn,Qn.current),en)break;return null;case 22:case 23:return Dt.lanes=0,r0(Bt,Dt,Gt)}return _s(Bt,Dt,Gt)}function F0(Bt,Dt){switch(Ws(Dt),Dt.tag){case 1:return ao(Dt.type)&&ho(),Bt=Dt.flags,Bt&65536?(Dt.flags=Bt&-65537|128,Dt):null;case 3:return pp(),er(yr),er(dr),ro(),Bt=Dt.flags,Bt&65536&&!(Bt&128)?(Dt.flags=Bt&-65537|128,Dt):null;case 5:return Au(Dt),null;case 13:if(er(Qn),Bt=Dt.memoizedState,Bt!==null&&Bt.dehydrated!==null){if(Dt.alternate===null)throw Error(at(340));cp()}return Bt=Dt.flags,Bt&65536?(Dt.flags=Bt&-65537|128,Dt):null;case 19:return er(Qn),null;case 4:return pp(),null;case 10:return ys(Dt.type._context),null;case 22:case 23:return vy(),null;case 24:return null;default:return null}}var Em=!1,Zu=!1,U0=typeof WeakSet=="function"?WeakSet:Set,Yr=null;function em(Bt,Dt){var Gt=Bt.ref;if(Gt!==null)if(typeof Gt=="function")try{Gt(null)}catch(en){js(Bt,Dt,en)}else Gt.current=null}function sy(Bt,Dt,Gt){try{Gt()}catch(en){js(Bt,Dt,en)}}var d0=!1;function ly(Bt,Dt){for(Ft(Bt.containerInfo),Yr=Dt;Yr!==null;)if(Bt=Yr,Dt=Bt.child,(Bt.subtreeFlags&1028)!==0&&Dt!==null)Dt.return=Bt,Yr=Dt;else for(;Yr!==null;){Bt=Yr;try{var Gt=Bt.alternate;if(Bt.flags&1024)switch(Bt.tag){case 0:case 11:case 15:break;case 1:if(Gt!==null){var en=Gt.memoizedProps,mn=Gt.memoizedState,An=Bt.stateNode,Hn=An.getSnapshotBeforeUpdate(Bt.elementType===Bt.type?en:ss(Bt.type,en),mn);An.__reactInternalSnapshotBeforeUpdate=Hn}break;case 3:rn&&wr(Bt.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(at(163))}}catch(nr){js(Bt,Bt.return,nr)}if(Dt=Bt.sibling,Dt!==null){Dt.return=Bt.return,Yr=Dt;break}Yr=Bt.return}return Gt=d0,d0=!1,Gt}function Hl(Bt,Dt,Gt){var en=Dt.updateQueue;if(en=en!==null?en.lastEffect:null,en!==null){var mn=en=en.next;do{if((mn.tag&Bt)===Bt){var An=mn.destroy;mn.destroy=void 0,An!==void 0&&sy(Dt,Gt,An)}mn=mn.next}while(mn!==en)}}function Ru(Bt,Dt){if(Dt=Dt.updateQueue,Dt=Dt!==null?Dt.lastEffect:null,Dt!==null){var Gt=Dt=Dt.next;do{if((Gt.tag&Bt)===Bt){var en=Gt.create;Gt.destroy=en()}Gt=Gt.next}while(Gt!==Dt)}}function cy(Bt){var Dt=Bt.ref;if(Dt!==null){var Gt=Bt.stateNode;switch(Bt.tag){case 5:Bt=Ot(Gt);break;default:Bt=Gt}typeof Dt=="function"?Dt(Bt):Dt.current=Bt}}function uy(Bt,Dt,Gt){if(Ks&&typeof Ks.onCommitFiberUnmount=="function")try{Ks.onCommitFiberUnmount(Wu,Dt)}catch{}switch(Dt.tag){case 0:case 11:case 14:case 15:if(Bt=Dt.updateQueue,Bt!==null&&(Bt=Bt.lastEffect,Bt!==null)){var en=Bt=Bt.next;do{var mn=en,An=mn.destroy;mn=mn.tag,An!==void 0&&(mn&2||mn&4)&&sy(Dt,Gt,An),en=en.next}while(en!==Bt)}break;case 1:if(em(Dt,Gt),Bt=Dt.stateNode,typeof Bt.componentWillUnmount=="function")try{Bt.props=Dt.memoizedProps,Bt.state=Dt.memoizedState,Bt.componentWillUnmount()}catch(Hn){js(Dt,Gt,Hn)}break;case 5:em(Dt,Gt);break;case 4:rn?dy(Bt,Dt,Gt):Jt&&Jt&&(Dt=Dt.stateNode.containerInfo,Gt=Er(Dt),Or(Dt,Gt))}}function f0(Bt,Dt,Gt){for(var en=Dt;;)if(uy(Bt,en,Gt),en.child===null||rn&&en.tag===4){if(en===Dt)break;for(;en.sibling===null;){if(en.return===null||en.return===Dt)return;en=en.return}en.sibling.return=en.return,en=en.sibling}else en.child.return=en,en=en.child}function su(Bt){var Dt=Bt.alternate;Dt!==null&&(Bt.alternate=null,su(Dt)),Bt.child=null,Bt.deletions=null,Bt.sibling=null,Bt.tag===5&&(Dt=Bt.stateNode,Dt!==null&&En(Dt)),Bt.stateNode=null,Bt.return=null,Bt.dependencies=null,Bt.memoizedProps=null,Bt.memoizedState=null,Bt.pendingProps=null,Bt.stateNode=null,Bt.updateQueue=null}function Tm(Bt){return Bt.tag===5||Bt.tag===3||Bt.tag===4}function Bu(Bt){e:for(;;){for(;Bt.sibling===null;){if(Bt.return===null||Tm(Bt.return))return null;Bt=Bt.return}for(Bt.sibling.return=Bt.return,Bt=Bt.sibling;Bt.tag!==5&&Bt.tag!==6&&Bt.tag!==18;){if(Bt.flags&2||Bt.child===null||Bt.tag===4)continue e;Bt.child.return=Bt,Bt=Bt.child}if(!(Bt.flags&2))return Bt.stateNode}}function yl(Bt){if(rn){e:{for(var Dt=Bt.return;Dt!==null;){if(Tm(Dt))break e;Dt=Dt.return}throw Error(at(160))}var Gt=Dt;switch(Gt.tag){case 5:Dt=Gt.stateNode,Gt.flags&32&&(zn(Dt),Gt.flags&=-33),Gt=Bu(Bt),Im(Bt,Gt,Dt);break;case 3:case 4:Dt=Gt.stateNode.containerInfo,Gt=Bu(Bt),hy(Bt,Gt,Dt);break;default:throw Error(at(161))}}}function hy(Bt,Dt,Gt){var en=Bt.tag;if(en===5||en===6)Bt=Bt.stateNode,Dt?Xn(Gt,Bt,Dt):Kt(Gt,Bt);else if(en!==4&&(Bt=Bt.child,Bt!==null))for(hy(Bt,Dt,Gt),Bt=Bt.sibling;Bt!==null;)hy(Bt,Dt,Gt),Bt=Bt.sibling}function Im(Bt,Dt,Gt){var en=Bt.tag;if(en===5||en===6)Bt=Bt.stateNode,Dt?Bn(Gt,Bt,Dt):Xt(Gt,Bt);else if(en!==4&&(Bt=Bt.child,Bt!==null))for(Im(Bt,Dt,Gt),Bt=Bt.sibling;Bt!==null;)Im(Bt,Dt,Gt),Bt=Bt.sibling}function dy(Bt,Dt,Gt){for(var en=Dt,mn=!1,An,Hn;;){if(!mn){mn=en.return;e:for(;;){if(mn===null)throw Error(at(160));switch(An=mn.stateNode,mn.tag){case 5:Hn=!1;break e;case 3:An=An.containerInfo,Hn=!0;break e;case 4:An=An.containerInfo,Hn=!0;break e}mn=mn.return}mn=!0}if(en.tag===5||en.tag===6)f0(Bt,en,Gt),Hn?Gn(An,en.stateNode):Vn(An,en.stateNode);else if(en.tag===18)Hn?Hr(An,en.stateNode):Nr(An,en.stateNode);else if(en.tag===4){if(en.child!==null){An=en.stateNode.containerInfo,Hn=!0,en.child.return=en,en=en.child;continue}}else if(uy(Bt,en,Gt),en.child!==null){en.child.return=en,en=en.child;continue}if(en===Dt)break;for(;en.sibling===null;){if(en.return===null||en.return===Dt)return;en=en.return,en.tag===4&&(mn=!1)}en.sibling.return=en.return,en=en.sibling}}function Ju(Bt,Dt){if(rn){switch(Dt.tag){case 0:case 11:case 14:case 15:Hl(3,Dt,Dt.return),Ru(3,Dt),Hl(5,Dt,Dt.return);return;case 1:return;case 5:var Gt=Dt.stateNode;if(Gt!=null){var en=Dt.memoizedProps;Bt=Bt!==null?Bt.memoizedProps:en;var mn=Dt.type,An=Dt.updateQueue;Dt.updateQueue=null,An!==null&&On(Gt,An,mn,Bt,en,Dt)}return;case 6:if(Dt.stateNode===null)throw Error(at(162));Gt=Dt.memoizedProps,kn(Dt.stateNode,Bt!==null?Bt.memoizedProps:Gt,Gt);return;case 3:vn&&Bt!==null&&Bt.memoizedState.isDehydrated&&Vr(Dt.stateNode.containerInfo);return;case 12:return;case 13:Gl(Dt);return;case 19:Gl(Dt);return;case 17:return}throw Error(at(163))}switch(Dt.tag){case 0:case 11:case 14:case 15:Hl(3,Dt,Dt.return),Ru(3,Dt),Hl(5,Dt,Dt.return);return;case 12:return;case 13:Gl(Dt);return;case 19:Gl(Dt);return;case 3:vn&&Bt!==null&&Bt.memoizedState.isDehydrated&&Vr(Dt.stateNode.containerInfo);break;case 22:case 23:return}e:if(Jt){switch(Dt.tag){case 1:case 5:case 6:break e;case 3:case 4:Dt=Dt.stateNode,Or(Dt.containerInfo,Dt.pendingChildren);break e}throw Error(at(163))}}function Gl(Bt){var Dt=Bt.updateQueue;if(Dt!==null){Bt.updateQueue=null;var Gt=Bt.stateNode;Gt===null&&(Gt=Bt.stateNode=new U0),Dt.forEach(function(en){var mn=_0.bind(null,Bt,en);Gt.has(en)||(Gt.add(en),en.then(mn,mn))})}}function p0(Bt,Dt){for(Yr=Dt;Yr!==null;){Dt=Yr;var Gt=Dt.deletions;if(Gt!==null)for(var en=0;en";case nm:return":has("+(rm(Bt)||"")+")";case _l:return'[role="'+Bt.value+'"]';case Qu:return'"'+Bt.value+'"';case xp:return'[data-testname="'+Bt.value+'"]';default:throw Error(at(365))}}function g0(Bt,Dt){var Gt=[];Bt=[Bt,0];for(var en=0;enmn&&(mn=Hn),en&=~An}if(en=mn,en=es()-en,en=(120>en?120:480>en?480:1080>en?1080:1920>en?1920:3e3>en?3e3:4320>en?4320:1960*W0(en/1960))-en,10Bt?16:Bt,xu===null)var en=!1;else{if(Bt=xu,xu=null,am=0,Ro&6)throw Error(at(331));var mn=Ro;for(Ro|=4,Yr=Bt.current;Yr!==null;){var An=Yr,Hn=An.child;if(Yr.flags&16){var nr=An.deletions;if(nr!==null){for(var _r=0;_res()-by?cu(Bt,0):yy|=Gt),po(Bt,Dt)}function v0(Bt,Dt){Dt===0&&(Bt.mode&1?(Dt=Co,Co<<=1,!(Co&130023424)&&(Co=4194304)):Dt=1);var Gt=Bs();Bt=$p(Bt,Dt),Bt!==null&&(Xo(Bt,Dt,Gt),po(Bt,Gt))}function Fu(Bt){var Dt=Bt.memoizedState,Gt=0;Dt!==null&&(Gt=Dt.retryLane),v0(Bt,Gt)}function _0(Bt,Dt){var Gt=0;switch(Bt.tag){case 13:var en=Bt.stateNode,mn=Bt.memoizedState;mn!==null&&(Gt=mn.retryLane);break;case 19:en=Bt.stateNode;break;default:throw Error(at(314))}en!==null&&en.delete(Dt),v0(Bt,Gt)}var Iy;Iy=function(Bt,Dt,Gt){if(Bt!==null)if(Bt.memoizedProps!==Dt.pendingProps||yr.current)Qs=!0;else{if(!(Bt.lanes&Gt)&&!(Dt.flags&128))return Qs=!1,L0(Bt,Dt,Gt);Qs=!!(Bt.flags&131072)}else Qs=!1,ba&&Dt.flags&1048576&&jy(Dt,Lp,Dt.index);switch(Dt.lanes=0,Dt.tag){case 2:var en=Dt.type;Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Bt=Dt.pendingProps;var mn=no(Dt,dr.current);rs(Dt,Gt),mn=Go(null,Dt,en,Bt,mn,Gt);var An=Jm();return Dt.flags|=1,typeof mn=="object"&&mn!==null&&typeof mn.render=="function"&&mn.$$typeof===void 0?(Dt.tag=1,Dt.memoizedState=null,Dt.updateQueue=null,ao(en)?(An=!0,wo(Dt)):An=!1,Dt.memoizedState=mn.state!==null&&mn.state!==void 0?mn.state:null,Gm(Dt),mn.updater=ym,Dt.stateNode=mn,mn._reactInternals=Dt,ap(Dt,en,Bt,Gt),Dt=iy(null,Dt,en,!0,An,Gt)):(Dt.tag=0,ba&&An&&bm(Dt),ls(null,Dt,mn,Gt),Dt=Dt.child),Dt;case 16:en=Dt.elementType;e:{switch(Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Bt=Dt.pendingProps,mn=en._init,en=mn(en._payload),Dt.type=en,mn=Dt.tag=x0(en),Bt=ss(en,Bt),mn){case 0:Dt=Vl(null,Dt,en,Bt,Gt);break e;case 1:Dt=o0(null,Dt,en,Bt,Gt);break e;case 11:Dt=Qy(null,Dt,en,Bt,Gt);break e;case 14:Dt=e0(null,Dt,en,ss(en.type,Bt),Gt);break e}throw Error(at(306,en,""))}return Dt;case 0:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),Vl(Bt,Dt,en,mn,Gt);case 1:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),o0(Bt,Dt,en,mn,Gt);case 3:e:{if(a0(Dt),Bt===null)throw Error(at(387));en=Dt.pendingProps,An=Dt.memoizedState,mn=An.element,qm(Bt,Dt),Dl(Dt,en,null,Gt);var Hn=Dt.memoizedState;if(en=Hn.element,vn&&An.isDehydrated)if(An={element:en,isDehydrated:!1,cache:Hn.cache,transitions:Hn.transitions},Dt.updateQueue.baseState=An,Dt.memoizedState=An,Dt.flags&256){mn=Error(at(423)),Dt=s0(Bt,Dt,en,Gt,mn);break e}else if(en!==mn){mn=Error(at(424)),Dt=s0(Bt,Dt,en,Gt,mn);break e}else for(vn&&(Is=Dn(Dt.stateNode.containerInfo),Vs=Dt,ba=!0,Ul=null,lp=!1),Gt=Fy(Dt,null,en,Gt),Dt.child=Gt;Gt;)Gt.flags=Gt.flags&-3|4096,Gt=Gt.sibling;else{if(cp(),en===mn){Dt=_s(Bt,Dt,Gt);break e}ls(Bt,Dt,en,Gt)}Dt=Dt.child}return Dt;case 5:return Uy(Dt),Bt===null&&Xm(Dt),en=Dt.type,mn=Dt.pendingProps,An=Bt!==null?Bt.memoizedProps:null,Hn=mn.children,an(en,mn)?Hn=null:An!==null&&an(en,An)&&(Dt.flags|=32),i0(Bt,Dt),ls(Bt,Dt,Hn,Gt),Dt.child;case 6:return Bt===null&&Xm(Dt),null;case 13:return l0(Bt,Dt,Gt);case 4:return Zm(Dt,Dt.stateNode.containerInfo),en=Dt.pendingProps,Bt===null?Dt.child=hp(Dt,null,en,Gt):ls(Bt,Dt,en,Gt),Dt.child;case 11:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),Qy(Bt,Dt,en,mn,Gt);case 7:return ls(Bt,Dt,Dt.pendingProps,Gt),Dt.child;case 8:return ls(Bt,Dt,Dt.pendingProps.children,Gt),Dt.child;case 12:return ls(Bt,Dt,Dt.pendingProps.children,Gt),Dt.child;case 10:e:{if(en=Dt.type._context,mn=Dt.pendingProps,An=Dt.memoizedProps,Hn=mn.value,jp(Dt,en,Hn),An!==null)if(Xs(An.value,Hn)){if(An.children===mn.children&&!yr.current){Dt=_s(Bt,Dt,Gt);break e}}else for(An=Dt.child,An!==null&&(An.return=Dt);An!==null;){var nr=An.dependencies;if(nr!==null){Hn=An.child;for(var _r=nr.firstContext;_r!==null;){if(_r.context===en){if(An.tag===1){_r=Cs(-1,Gt&-Gt),_r.tag=2;var Wr=An.updateQueue;if(Wr!==null){Wr=Wr.shared;var io=Wr.pending;io===null?_r.next=_r:(_r.next=io.next,io.next=_r),Wr.pending=_r}}An.lanes|=Gt,_r=An.alternate,_r!==null&&(_r.lanes|=Gt),$s(An.return,Gt,Dt),nr.lanes|=Gt;break}_r=_r.next}}else if(An.tag===10)Hn=An.type===Dt.type?null:An.child;else if(An.tag===18){if(Hn=An.return,Hn===null)throw Error(at(341));Hn.lanes|=Gt,nr=Hn.alternate,nr!==null&&(nr.lanes|=Gt),$s(Hn,Gt,Dt),Hn=An.sibling}else Hn=An.child;if(Hn!==null)Hn.return=An;else for(Hn=An;Hn!==null;){if(Hn===Dt){Hn=null;break}if(An=Hn.sibling,An!==null){An.return=Hn.return,Hn=An;break}Hn=Hn.return}An=Hn}ls(Bt,Dt,mn.children,Gt),Dt=Dt.child}return Dt;case 9:return mn=Dt.type,en=Dt.pendingProps.children,rs(Dt,Gt),mn=Wo(mn),en=en(mn),Dt.flags|=1,ls(Bt,Dt,en,Gt),Dt.child;case 14:return en=Dt.type,mn=ss(en,Dt.pendingProps),mn=ss(en.type,mn),e0(Bt,Dt,en,mn,Gt);case 15:return n0(Bt,Dt,Dt.type,Dt.pendingProps,Gt);case 17:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Dt.tag=1,ao(en)?(Bt=!0,wo(Dt)):Bt=!1,rs(Dt,Gt),Oy(Dt,en,mn),ap(Dt,en,mn,Gt),iy(null,Dt,en,!0,Bt,Gt);case 19:return h0(Bt,Dt,Gt);case 22:return r0(Bt,Dt,Gt)}throw Error(at(156,Dt.tag))};function Nm(Bt,Dt){return eu(Bt,Dt)}function V0(Bt,Dt,Gt,en){this.tag=Bt,this.key=Gt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=Dt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=en,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pl(Bt,Dt,Gt,en){return new V0(Bt,Dt,Gt,en)}function Ay(Bt){return Bt=Bt.prototype,!(!Bt||!Bt.isReactComponent)}function x0(Bt){if(typeof Bt=="function")return Ay(Bt)?1:0;if(Bt!=null){if(Bt=Bt.$$typeof,Bt===gt)return 11;if(Bt===wt)return 14}return 2}function ku(Bt,Dt){var Gt=Bt.alternate;return Gt===null?(Gt=Pl(Bt.tag,Dt,Bt.key,Bt.mode),Gt.elementType=Bt.elementType,Gt.type=Bt.type,Gt.stateNode=Bt.stateNode,Gt.alternate=Bt,Bt.alternate=Gt):(Gt.pendingProps=Dt,Gt.type=Bt.type,Gt.flags=0,Gt.subtreeFlags=0,Gt.deletions=null),Gt.flags=Bt.flags&14680064,Gt.childLanes=Bt.childLanes,Gt.lanes=Bt.lanes,Gt.child=Bt.child,Gt.memoizedProps=Bt.memoizedProps,Gt.memoizedState=Bt.memoizedState,Gt.updateQueue=Bt.updateQueue,Dt=Bt.dependencies,Gt.dependencies=Dt===null?null:{lanes:Dt.lanes,firstContext:Dt.firstContext},Gt.sibling=Bt.sibling,Gt.index=Bt.index,Gt.ref=Bt.ref,Gt}function Dm(Bt,Dt,Gt,en,mn,An){var Hn=2;if(en=Bt,typeof Bt=="function")Ay(Bt)&&(Hn=1);else if(typeof Bt=="string")Hn=5;else e:switch(Bt){case ut:return Uu(Gt.children,mn,An,Dt);case ht:Hn=8,mn|=8;break;case dt:return Bt=Pl(12,Gt,Dt,mn|2),Bt.elementType=dt,Bt.lanes=An,Bt;case yt:return Bt=Pl(13,Gt,Dt,mn),Bt.elementType=yt,Bt.lanes=An,Bt;case bt:return Bt=Pl(19,Gt,Dt,mn),Bt.elementType=bt,Bt.lanes=An,Bt;case kt:return cm(Gt,mn,An,Dt);default:if(typeof Bt=="object"&&Bt!==null)switch(Bt.$$typeof){case pt:Hn=10;break e;case mt:Hn=9;break e;case gt:Hn=11;break e;case wt:Hn=14;break e;case xt:Hn=16,en=null;break e}throw Error(at(130,Bt==null?Bt:typeof Bt,""))}return Dt=Pl(Hn,Gt,Dt,mn),Dt.elementType=Bt,Dt.type=en,Dt.lanes=An,Dt}function Uu(Bt,Dt,Gt,en){return Bt=Pl(7,Bt,en,Dt),Bt.lanes=Gt,Bt}function cm(Bt,Dt,Gt,en){return Bt=Pl(22,Bt,en,Dt),Bt.elementType=kt,Bt.lanes=Gt,Bt.stateNode={},Bt}function Ns(Bt,Dt,Gt){return Bt=Pl(6,Bt,null,Dt),Bt.lanes=Gt,Bt}function Ml(Bt,Dt,Gt){return Dt=Pl(4,Bt.children!==null?Bt.children:[],Bt.key,Dt),Dt.lanes=Gt,Dt.stateNode={containerInfo:Bt.containerInfo,pendingChildren:null,implementation:Bt.implementation},Dt}function H0(Bt,Dt,Gt,en,mn){this.tag=Dt,this.containerInfo=Bt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=dn,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xa(0),this.expirationTimes=xa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xa(0),this.identifierPrefix=en,this.onRecoverableError=mn,vn&&(this.mutableSourceEagerHydrationData=null)}function k0(Bt,Dt,Gt,en,mn,An,Hn,nr,_r){return Bt=new H0(Bt,Dt,Gt,nr,_r),Dt===1?(Dt=1,An===!0&&(Dt|=8)):Dt=0,An=Pl(3,null,null,Dt),Bt.current=An,An.stateNode=Bt,An.memoizedState={element:en,isDehydrated:Gt,cache:null,transitions:null},Gm(An),Bt}function um(Bt){if(!Bt)return xr;Bt=Bt._reactInternals;e:{if(Ct(Bt)!==Bt||Bt.tag!==1)throw Error(at(170));var Dt=Bt;do{switch(Dt.tag){case 3:Dt=Dt.stateNode.context;break e;case 1:if(ao(Dt.type)){Dt=Dt.stateNode.__reactInternalMemoizedMergedChildContext;break e}}Dt=Dt.return}while(Dt!==null);throw Error(at(171))}if(Bt.tag===1){var Gt=Bt.type;if(ao(Gt))return qn(Bt,Gt,Dt)}return Dt}function _f(Bt){var Dt=Bt._reactInternals;if(Dt===void 0)throw typeof Bt.render=="function"?Error(at(188)):(Bt=Object.keys(Bt).join(","),Error(at(268,Bt)));return Bt=Rt(Dt),Bt===null?null:Bt.stateNode}function $y(Bt,Dt){if(Bt=Bt.memoizedState,Bt!==null&&Bt.dehydrated!==null){var Gt=Bt.retryLane;Bt.retryLane=Gt!==0&&Gt=Wr&&An>=To&&mn<=io&&Hn<=uo){Bt.splice(Dt,1);break}else if(en!==Wr||Gt.width!==_r.width||uoHn){if(!(An!==To||Gt.height!==_r.height||iomn)){Wr>en&&(_r.width+=Wr-en,_r.x=en),ioAn&&(_r.height+=To-An,_r.y=An),uoGt&&(Gt=Hn)),Hnim&&(Dt.flags|=128,en=!0,Ms(mn,!1),Dt.lanes=4194304)}else{if(!en)if(Bt=Sr(An),Bt!==null){if(Dt.flags|=128,en=!0,Bt=Bt.updateQueue,Bt!==null&&(Dt.updateQueue=Bt,Dt.flags|=4),Ms(mn,!0),mn.tail===null&&mn.tailMode==="hidden"&&!An.alternate&&!ba)return go(Dt),null}else 2*es()-mn.renderingStartTime>im&&Gt!==1073741824&&(Dt.flags|=128,en=!0,Ms(mn,!1),Dt.lanes=4194304);mn.isBackwards?(An.sibling=Dt.child,Dt.child=An):(Bt=mn.last,Bt!==null?Bt.sibling=An:Dt.child=An,mn.last=An)}return mn.tail!==null?(Dt=mn.tail,mn.rendering=Dt,mn.tail=Dt.sibling,mn.renderingStartTime=es(),Dt.sibling=null,Bt=Qn.current,rr(Qn,en?Bt&1|2:Bt&1),Dt):(go(Dt),null);case 22:case 23:return vy(),en=Dt.memoizedState!==null,Bt!==null&&Bt.memoizedState!==null!==en&&(Dt.flags|=8192),en&&Dt.mode&1?xl&1073741824&&(go(Dt),rn&&Dt.subtreeFlags&6&&(Dt.flags|=8192)):go(Dt),null;case 24:return null;case 25:return null}throw Error(at(156,Dt.tag))}var D0=st.ReactCurrentOwner,Qs=!1;function ls(Bt,Dt,Gt,en){Dt.child=Bt===null?Fy(Dt,null,Gt,en):hp(Dt,Bt.child,Gt,en)}function Qy(Bt,Dt,Gt,en,mn){Gt=Gt.render;var An=Dt.ref;return rs(Dt,mn),en=Go(Bt,Dt,Gt,en,An,mn),Gt=Zm(),Bt!==null&&!Qs?(Dt.updateQueue=Bt.updateQueue,Dt.flags&=-2053,Bt.lanes&=~mn,_s(Bt,Dt,mn)):(ba&&Gt&&bm(Dt),Dt.flags|=1,ls(Bt,Dt,en,mn),Dt.child)}function e0(Bt,Dt,Gt,en,mn){if(Bt===null){var An=Gt.type;return typeof An=="function"&&!Ay(An)&&An.defaultProps===void 0&&Gt.compare===null&&Gt.defaultProps===void 0?(Dt.tag=15,Dt.type=An,n0(Bt,Dt,An,en,mn)):(Bt=Dm(Gt.type,null,en,Dt,Dt.mode,mn),Bt.ref=Dt.ref,Bt.return=Dt,Dt.child=Bt)}if(An=Bt.child,!(Bt.lanes&mn)){var Hn=An.memoizedProps;if(Gt=Gt.compare,Gt=Gt!==null?Gt:ts,Gt(Hn,en)&&Bt.ref===Dt.ref)return _s(Bt,Dt,mn)}return Dt.flags|=1,Bt=ku(An,en),Bt.ref=Dt.ref,Bt.return=Dt,Dt.child=Bt}function n0(Bt,Dt,Gt,en,mn){if(Bt!==null&&ts(Bt.memoizedProps,en)&&Bt.ref===Dt.ref)if(Qs=!1,(Bt.lanes&mn)!==0)Bt.flags&131072&&(Qs=!0);else return Dt.lanes=Bt.lanes,_s(Bt,Dt,mn);return Vl(Bt,Dt,Gt,en,mn)}function r0(Bt,Dt,Gt){var en=Dt.pendingProps,mn=en.children,An=Bt!==null?Bt.memoizedState:null;if(en.mode==="hidden")if(!(Dt.mode&1))Dt.memoizedState={baseLanes:0,cachePool:null},rr(Sp,xl),xl|=Gt;else if(Gt&1073741824)Dt.memoizedState={baseLanes:0,cachePool:null},en=An!==null?An.baseLanes:Gt,rr(Sp,xl),xl|=en;else return Bt=An!==null?An.baseLanes|Gt:Gt,Dt.lanes=Dt.childLanes=1073741824,Dt.memoizedState={baseLanes:Bt,cachePool:null},Dt.updateQueue=null,rr(Sp,xl),xl|=Bt,null;else An!==null?(en=An.baseLanes|Gt,Dt.memoizedState=null):en=Gt,rr(Sp,xl),xl|=en;return ls(Bt,Dt,mn,Gt),Dt.child}function i0(Bt,Dt){var Gt=Dt.ref;(Bt===null&&Gt!==null||Bt!==null&&Bt.ref!==Gt)&&(Dt.flags|=512,Dt.flags|=2097152)}function Vl(Bt,Dt,Gt,en,mn){var An=ao(Gt)?$r:dr.current;return An=no(Dt,An),rs(Dt,mn),Gt=Go(Bt,Dt,Gt,en,An,mn),en=Zm(),Bt!==null&&!Qs?(Dt.updateQueue=Bt.updateQueue,Dt.flags&=-2053,Bt.lanes&=~mn,_s(Bt,Dt,mn)):(ba&&en&&bm(Dt),Dt.flags|=1,ls(Bt,Dt,Gt,mn),Dt.child)}function o0(Bt,Dt,Gt,en,mn){if(ao(Gt)){var An=!0;wo(Dt)}else An=!1;if(rs(Dt,mn),Dt.stateNode===null)Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Oy(Dt,Gt,en),ap(Dt,Gt,en,mn),en=!0;else if(Bt===null){var Hn=Dt.stateNode,nr=Dt.memoizedProps;Hn.props=nr;var _r=Hn.context,Wr=Gt.contextType;typeof Wr=="object"&&Wr!==null?Wr=Wo(Wr):(Wr=ao(Gt)?$r:dr.current,Wr=no(Dt,Wr));var io=Gt.getDerivedStateFromProps,To=typeof io=="function"||typeof Hn.getSnapshotBeforeUpdate=="function";To||typeof Hn.UNSAFE_componentWillReceiveProps!="function"&&typeof Hn.componentWillReceiveProps!="function"||(nr!==en||_r!==Wr)&&Ym(Dt,Hn,en,Wr),bs=!1;var uo=Dt.memoizedState;Hn.state=uo,Dl(Dt,en,Hn,mn),_r=Dt.memoizedState,nr!==en||uo!==_r||yr.current||bs?(typeof io=="function"&&(Np(Dt,Gt,io,en),_r=Dt.memoizedState),(nr=bs||By(Dt,Gt,nr,en,uo,_r,Wr))?(To||typeof Hn.UNSAFE_componentWillMount!="function"&&typeof Hn.componentWillMount!="function"||(typeof Hn.componentWillMount=="function"&&Hn.componentWillMount(),typeof Hn.UNSAFE_componentWillMount=="function"&&Hn.UNSAFE_componentWillMount()),typeof Hn.componentDidMount=="function"&&(Dt.flags|=4194308)):(typeof Hn.componentDidMount=="function"&&(Dt.flags|=4194308),Dt.memoizedProps=en,Dt.memoizedState=_r),Hn.props=en,Hn.state=_r,Hn.context=Wr,en=nr):(typeof Hn.componentDidMount=="function"&&(Dt.flags|=4194308),en=!1)}else{Hn=Dt.stateNode,qm(Bt,Dt),nr=Dt.memoizedProps,Wr=Dt.type===Dt.elementType?nr:ss(Dt.type,nr),Hn.props=Wr,To=Dt.pendingProps,uo=Hn.context,_r=Gt.contextType,typeof _r=="object"&&_r!==null?_r=Wo(_r):(_r=ao(Gt)?$r:dr.current,_r=no(Dt,_r));var Jo=Gt.getDerivedStateFromProps;(io=typeof Jo=="function"||typeof Hn.getSnapshotBeforeUpdate=="function")||typeof Hn.UNSAFE_componentWillReceiveProps!="function"&&typeof Hn.componentWillReceiveProps!="function"||(nr!==To||uo!==_r)&&Ym(Dt,Hn,en,_r),bs=!1,uo=Dt.memoizedState,Hn.state=uo,Dl(Dt,en,Hn,mn);var so=Dt.memoizedState;nr!==To||uo!==so||yr.current||bs?(typeof Jo=="function"&&(Np(Dt,Gt,Jo,en),so=Dt.memoizedState),(Wr=bs||By(Dt,Gt,Wr,en,uo,so,_r)||!1)?(io||typeof Hn.UNSAFE_componentWillUpdate!="function"&&typeof Hn.componentWillUpdate!="function"||(typeof Hn.componentWillUpdate=="function"&&Hn.componentWillUpdate(en,so,_r),typeof Hn.UNSAFE_componentWillUpdate=="function"&&Hn.UNSAFE_componentWillUpdate(en,so,_r)),typeof Hn.componentDidUpdate=="function"&&(Dt.flags|=4),typeof Hn.getSnapshotBeforeUpdate=="function"&&(Dt.flags|=1024)):(typeof Hn.componentDidUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=4),typeof Hn.getSnapshotBeforeUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=1024),Dt.memoizedProps=en,Dt.memoizedState=so),Hn.props=en,Hn.state=so,Hn.context=_r,en=Wr):(typeof Hn.componentDidUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=4),typeof Hn.getSnapshotBeforeUpdate!="function"||nr===Bt.memoizedProps&&uo===Bt.memoizedState||(Dt.flags|=1024),en=!1)}return iy(Bt,Dt,Gt,en,An,mn)}function iy(Bt,Dt,Gt,en,mn,An){i0(Bt,Dt);var Hn=(Dt.flags&128)!==0;if(!en&&!Hn)return mn&&vo(Dt,Gt,!1),_s(Bt,Dt,An);en=Dt.stateNode,D0.current=Dt;var nr=Hn&&typeof Gt.getDerivedStateFromError!="function"?null:en.render();return Dt.flags|=1,Bt!==null&&Hn?(Dt.child=hp(Dt,Bt.child,null,An),Dt.child=hp(Dt,null,nr,An)):ls(Bt,Dt,nr,An),Dt.memoizedState=en.state,mn&&vo(Dt,Gt,!0),Dt.child}function a0(Bt){var Dt=Bt.stateNode;Dt.pendingContext?fo(Bt,Dt.pendingContext,Dt.pendingContext!==Dt.context):Dt.context&&fo(Bt,Dt.context,!1),Jm(Bt,Dt.containerInfo)}function s0(Bt,Dt,Gt,en,mn){return cp(),Up(mn),Dt.flags|=256,ls(Bt,Dt,Gt,en),Dt.child}var km={dehydrated:null,treeContext:null,retryLane:0};function $l(Bt){return{baseLanes:Bt,cachePool:null}}function l0(Bt,Dt,Gt){var en=Dt.pendingProps,mn=Qn.current,An=!1,Hn=(Dt.flags&128)!==0,nr;if((nr=Hn)||(nr=Bt!==null&&Bt.memoizedState===null?!1:(mn&2)!==0),nr?(An=!0,Dt.flags&=-129):(Bt===null||Bt.memoizedState!==null)&&(mn|=1),rr(Qn,mn&1),Bt===null)return Xm(Dt),Bt=Dt.memoizedState,Bt!==null&&(Bt=Bt.dehydrated,Bt!==null)?(Dt.mode&1?Pn(Bt)?Dt.lanes=8:Dt.lanes=1073741824:Dt.lanes=1,null):(mn=en.children,Bt=en.fallback,An?(en=Dt.mode,An=Dt.child,mn={mode:"hidden",children:mn},!(en&1)&&An!==null?(An.childLanes=0,An.pendingProps=mn):An=cm(mn,en,0,null),Bt=Uu(Bt,en,Gt,null),An.return=Dt,Bt.return=Dt,An.sibling=Bt,Dt.child=An,Dt.child.memoizedState=$l(Gt),Dt.memoizedState=km,Bt):oy(Dt,mn));if(mn=Bt.memoizedState,mn!==null){if(nr=mn.dehydrated,nr!==null){if(Hn)return Dt.flags&256?(Dt.flags&=-257,Sm(Bt,Dt,Gt,Error(at(422)))):Dt.memoizedState!==null?(Dt.child=Bt.child,Dt.flags|=128,null):(An=en.fallback,mn=Dt.mode,en=cm({mode:"visible",children:en.children},mn,0,null),An=Uu(An,mn,Gt,null),An.flags|=2,en.return=Dt,An.return=Dt,en.sibling=An,Dt.child=en,Dt.mode&1&&hp(Dt,Bt.child,null,Gt),Dt.child.memoizedState=$l(Gt),Dt.memoizedState=km,An);if(!(Dt.mode&1))Dt=Sm(Bt,Dt,Gt,null);else if(Pn(nr))Dt=Sm(Bt,Dt,Gt,Error(at(419)));else if(en=(Gt&Bt.childLanes)!==0,Qs||en){if(en=ds,en!==null){switch(Gt&-Gt){case 4:An=2;break;case 16:An=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:An=32;break;case 536870912:An=268435456;break;default:An=0}en=An&(en.suspendedLanes|Gt)?0:An,en!==0&&en!==mn.retryLane&&(mn.retryLane=en,Cl(Bt,en,-1))}Om(),Dt=Sm(Bt,Dt,Gt,Error(at(421)))}else _n(nr)?(Dt.flags|=128,Dt.child=Bt.child,Dt=Fu.bind(null,Bt),un(nr,Dt),Dt=null):(Gt=mn.treeContext,vn&&(Is=Fn(nr),Vs=Dt,ba=!0,Ul=null,lp=!1,Gt!==null&&(Gs[qs++]=yu,Gs[qs++]=Fl,Gs[qs++]=Iu,yu=Gt.id,Fl=Gt.overflow,Iu=Dt)),Dt=oy(Dt,Dt.pendingProps.children),Dt.flags|=4096);return Dt}return An?(en=u0(Bt,Dt,en.children,en.fallback,Gt),An=Dt.child,mn=Bt.child.memoizedState,An.memoizedState=mn===null?$l(Gt):{baseLanes:mn.baseLanes|Gt,cachePool:null},An.childLanes=Bt.childLanes&~Gt,Dt.memoizedState=km,en):(Gt=c0(Bt,Dt,en.children,Gt),Dt.memoizedState=null,Gt)}return An?(en=u0(Bt,Dt,en.children,en.fallback,Gt),An=Dt.child,mn=Bt.child.memoizedState,An.memoizedState=mn===null?$l(Gt):{baseLanes:mn.baseLanes|Gt,cachePool:null},An.childLanes=Bt.childLanes&~Gt,Dt.memoizedState=km,en):(Gt=c0(Bt,Dt,en.children,Gt),Dt.memoizedState=null,Gt)}function oy(Bt,Dt){return Dt=cm({mode:"visible",children:Dt},Bt.mode,0,null),Dt.return=Bt,Bt.child=Dt}function c0(Bt,Dt,Gt,en){var mn=Bt.child;return Bt=mn.sibling,Gt=ku(mn,{mode:"visible",children:Gt}),!(Dt.mode&1)&&(Gt.lanes=en),Gt.return=Dt,Gt.sibling=null,Bt!==null&&(en=Dt.deletions,en===null?(Dt.deletions=[Bt],Dt.flags|=16):en.push(Bt)),Dt.child=Gt}function u0(Bt,Dt,Gt,en,mn){var An=Dt.mode;Bt=Bt.child;var Hn=Bt.sibling,nr={mode:"hidden",children:Gt};return!(An&1)&&Dt.child!==Bt?(Gt=Dt.child,Gt.childLanes=0,Gt.pendingProps=nr,Dt.deletions=null):(Gt=ku(Bt,nr),Gt.subtreeFlags=Bt.subtreeFlags&14680064),Hn!==null?en=ku(Hn,en):(en=Uu(en,An,mn,null),en.flags|=2),en.return=Dt,Gt.return=Dt,Gt.sibling=en,Dt.child=Gt,en}function Sm(Bt,Dt,Gt,en){return en!==null&&Up(en),hp(Dt,Bt.child,null,Gt),Bt=oy(Dt,Dt.pendingProps.children),Bt.flags|=2,Dt.memoizedState=null,Bt}function Mu(Bt,Dt,Gt){Bt.lanes|=Dt;var en=Bt.alternate;en!==null&&(en.lanes|=Dt),$s(Bt.return,Dt,Gt)}function ay(Bt,Dt,Gt,en,mn){var An=Bt.memoizedState;An===null?Bt.memoizedState={isBackwards:Dt,rendering:null,renderingStartTime:0,last:en,tail:Gt,tailMode:mn}:(An.isBackwards=Dt,An.rendering=null,An.renderingStartTime=0,An.last=en,An.tail=Gt,An.tailMode=mn)}function h0(Bt,Dt,Gt){var en=Dt.pendingProps,mn=en.revealOrder,An=en.tail;if(ls(Bt,Dt,en.children,Gt),en=Qn.current,en&2)en=en&1|2,Dt.flags|=128;else{if(Bt!==null&&Bt.flags&128)e:for(Bt=Dt.child;Bt!==null;){if(Bt.tag===13)Bt.memoizedState!==null&&Mu(Bt,Gt,Dt);else if(Bt.tag===19)Mu(Bt,Gt,Dt);else if(Bt.child!==null){Bt.child.return=Bt,Bt=Bt.child;continue}if(Bt===Dt)break e;for(;Bt.sibling===null;){if(Bt.return===null||Bt.return===Dt)break e;Bt=Bt.return}Bt.sibling.return=Bt.return,Bt=Bt.sibling}en&=1}if(rr(Qn,en),!(Dt.mode&1))Dt.memoizedState=null;else switch(mn){case"forwards":for(Gt=Dt.child,mn=null;Gt!==null;)Bt=Gt.alternate,Bt!==null&&Sr(Bt)===null&&(mn=Gt),Gt=Gt.sibling;Gt=mn,Gt===null?(mn=Dt.child,Dt.child=null):(mn=Gt.sibling,Gt.sibling=null),ay(Dt,!1,mn,Gt,An);break;case"backwards":for(Gt=null,mn=Dt.child,Dt.child=null;mn!==null;){if(Bt=mn.alternate,Bt!==null&&Sr(Bt)===null){Dt.child=mn;break}Bt=mn.sibling,mn.sibling=Gt,Gt=mn,mn=Bt}ay(Dt,!0,Gt,null,An);break;case"together":ay(Dt,!1,null,null,void 0);break;default:Dt.memoizedState=null}return Dt.child}function _s(Bt,Dt,Gt){if(Bt!==null&&(Dt.dependencies=Bt.dependencies),Tp|=Dt.lanes,!(Gt&Dt.childLanes))return null;if(Bt!==null&&Dt.child!==Bt.child)throw Error(at(153));if(Dt.child!==null){for(Bt=Dt.child,Gt=ku(Bt,Bt.pendingProps),Dt.child=Gt,Gt.return=Dt;Bt.sibling!==null;)Bt=Bt.sibling,Gt=Gt.sibling=ku(Bt,Bt.pendingProps),Gt.return=Dt;Gt.sibling=null}return Dt.child}function L0(Bt,Dt,Gt){switch(Dt.tag){case 3:a0(Dt),cp();break;case 5:Uy(Dt);break;case 1:ao(Dt.type)&&wo(Dt);break;case 4:Jm(Dt,Dt.stateNode.containerInfo);break;case 10:jp(Dt,Dt.type._context,Dt.memoizedProps.value);break;case 13:var en=Dt.memoizedState;if(en!==null)return en.dehydrated!==null?(rr(Qn,Qn.current&1),Dt.flags|=128,null):Gt&Dt.child.childLanes?l0(Bt,Dt,Gt):(rr(Qn,Qn.current&1),Bt=_s(Bt,Dt,Gt),Bt!==null?Bt.sibling:null);rr(Qn,Qn.current&1);break;case 19:if(en=(Gt&Dt.childLanes)!==0,Bt.flags&128){if(en)return h0(Bt,Dt,Gt);Dt.flags|=128}var mn=Dt.memoizedState;if(mn!==null&&(mn.rendering=null,mn.tail=null,mn.lastEffect=null),rr(Qn,Qn.current),en)break;return null;case 22:case 23:return Dt.lanes=0,r0(Bt,Dt,Gt)}return _s(Bt,Dt,Gt)}function F0(Bt,Dt){switch(Ws(Dt),Dt.tag){case 1:return ao(Dt.type)&&ho(),Bt=Dt.flags,Bt&65536?(Dt.flags=Bt&-65537|128,Dt):null;case 3:return pp(),er(yr),er(dr),ro(),Bt=Dt.flags,Bt&65536&&!(Bt&128)?(Dt.flags=Bt&-65537|128,Dt):null;case 5:return Au(Dt),null;case 13:if(er(Qn),Bt=Dt.memoizedState,Bt!==null&&Bt.dehydrated!==null){if(Dt.alternate===null)throw Error(at(340));cp()}return Bt=Dt.flags,Bt&65536?(Dt.flags=Bt&-65537|128,Dt):null;case 19:return er(Qn),null;case 4:return pp(),null;case 10:return ys(Dt.type._context),null;case 22:case 23:return vy(),null;case 24:return null;default:return null}}var Em=!1,Ju=!1,U0=typeof WeakSet=="function"?WeakSet:Set,Yr=null;function em(Bt,Dt){var Gt=Bt.ref;if(Gt!==null)if(typeof Gt=="function")try{Gt(null)}catch(en){js(Bt,Dt,en)}else Gt.current=null}function sy(Bt,Dt,Gt){try{Gt()}catch(en){js(Bt,Dt,en)}}var d0=!1;function ly(Bt,Dt){for(Ft(Bt.containerInfo),Yr=Dt;Yr!==null;)if(Bt=Yr,Dt=Bt.child,(Bt.subtreeFlags&1028)!==0&&Dt!==null)Dt.return=Bt,Yr=Dt;else for(;Yr!==null;){Bt=Yr;try{var Gt=Bt.alternate;if(Bt.flags&1024)switch(Bt.tag){case 0:case 11:case 15:break;case 1:if(Gt!==null){var en=Gt.memoizedProps,mn=Gt.memoizedState,An=Bt.stateNode,Hn=An.getSnapshotBeforeUpdate(Bt.elementType===Bt.type?en:ss(Bt.type,en),mn);An.__reactInternalSnapshotBeforeUpdate=Hn}break;case 3:rn&&wr(Bt.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(at(163))}}catch(nr){js(Bt,Bt.return,nr)}if(Dt=Bt.sibling,Dt!==null){Dt.return=Bt.return,Yr=Dt;break}Yr=Bt.return}return Gt=d0,d0=!1,Gt}function Hl(Bt,Dt,Gt){var en=Dt.updateQueue;if(en=en!==null?en.lastEffect:null,en!==null){var mn=en=en.next;do{if((mn.tag&Bt)===Bt){var An=mn.destroy;mn.destroy=void 0,An!==void 0&&sy(Dt,Gt,An)}mn=mn.next}while(mn!==en)}}function Ru(Bt,Dt){if(Dt=Dt.updateQueue,Dt=Dt!==null?Dt.lastEffect:null,Dt!==null){var Gt=Dt=Dt.next;do{if((Gt.tag&Bt)===Bt){var en=Gt.create;Gt.destroy=en()}Gt=Gt.next}while(Gt!==Dt)}}function cy(Bt){var Dt=Bt.ref;if(Dt!==null){var Gt=Bt.stateNode;switch(Bt.tag){case 5:Bt=Ot(Gt);break;default:Bt=Gt}typeof Dt=="function"?Dt(Bt):Dt.current=Bt}}function uy(Bt,Dt,Gt){if(Ks&&typeof Ks.onCommitFiberUnmount=="function")try{Ks.onCommitFiberUnmount(Wu,Dt)}catch{}switch(Dt.tag){case 0:case 11:case 14:case 15:if(Bt=Dt.updateQueue,Bt!==null&&(Bt=Bt.lastEffect,Bt!==null)){var en=Bt=Bt.next;do{var mn=en,An=mn.destroy;mn=mn.tag,An!==void 0&&(mn&2||mn&4)&&sy(Dt,Gt,An),en=en.next}while(en!==Bt)}break;case 1:if(em(Dt,Gt),Bt=Dt.stateNode,typeof Bt.componentWillUnmount=="function")try{Bt.props=Dt.memoizedProps,Bt.state=Dt.memoizedState,Bt.componentWillUnmount()}catch(Hn){js(Dt,Gt,Hn)}break;case 5:em(Dt,Gt);break;case 4:rn?dy(Bt,Dt,Gt):Zt&&Zt&&(Dt=Dt.stateNode.containerInfo,Gt=Er(Dt),Or(Dt,Gt))}}function f0(Bt,Dt,Gt){for(var en=Dt;;)if(uy(Bt,en,Gt),en.child===null||rn&&en.tag===4){if(en===Dt)break;for(;en.sibling===null;){if(en.return===null||en.return===Dt)return;en=en.return}en.sibling.return=en.return,en=en.sibling}else en.child.return=en,en=en.child}function su(Bt){var Dt=Bt.alternate;Dt!==null&&(Bt.alternate=null,su(Dt)),Bt.child=null,Bt.deletions=null,Bt.sibling=null,Bt.tag===5&&(Dt=Bt.stateNode,Dt!==null&&En(Dt)),Bt.stateNode=null,Bt.return=null,Bt.dependencies=null,Bt.memoizedProps=null,Bt.memoizedState=null,Bt.pendingProps=null,Bt.stateNode=null,Bt.updateQueue=null}function Tm(Bt){return Bt.tag===5||Bt.tag===3||Bt.tag===4}function Bu(Bt){e:for(;;){for(;Bt.sibling===null;){if(Bt.return===null||Tm(Bt.return))return null;Bt=Bt.return}for(Bt.sibling.return=Bt.return,Bt=Bt.sibling;Bt.tag!==5&&Bt.tag!==6&&Bt.tag!==18;){if(Bt.flags&2||Bt.child===null||Bt.tag===4)continue e;Bt.child.return=Bt,Bt=Bt.child}if(!(Bt.flags&2))return Bt.stateNode}}function yl(Bt){if(rn){e:{for(var Dt=Bt.return;Dt!==null;){if(Tm(Dt))break e;Dt=Dt.return}throw Error(at(160))}var Gt=Dt;switch(Gt.tag){case 5:Dt=Gt.stateNode,Gt.flags&32&&(zn(Dt),Gt.flags&=-33),Gt=Bu(Bt),Im(Bt,Gt,Dt);break;case 3:case 4:Dt=Gt.stateNode.containerInfo,Gt=Bu(Bt),hy(Bt,Gt,Dt);break;default:throw Error(at(161))}}}function hy(Bt,Dt,Gt){var en=Bt.tag;if(en===5||en===6)Bt=Bt.stateNode,Dt?Xn(Gt,Bt,Dt):Kt(Gt,Bt);else if(en!==4&&(Bt=Bt.child,Bt!==null))for(hy(Bt,Dt,Gt),Bt=Bt.sibling;Bt!==null;)hy(Bt,Dt,Gt),Bt=Bt.sibling}function Im(Bt,Dt,Gt){var en=Bt.tag;if(en===5||en===6)Bt=Bt.stateNode,Dt?Bn(Gt,Bt,Dt):Xt(Gt,Bt);else if(en!==4&&(Bt=Bt.child,Bt!==null))for(Im(Bt,Dt,Gt),Bt=Bt.sibling;Bt!==null;)Im(Bt,Dt,Gt),Bt=Bt.sibling}function dy(Bt,Dt,Gt){for(var en=Dt,mn=!1,An,Hn;;){if(!mn){mn=en.return;e:for(;;){if(mn===null)throw Error(at(160));switch(An=mn.stateNode,mn.tag){case 5:Hn=!1;break e;case 3:An=An.containerInfo,Hn=!0;break e;case 4:An=An.containerInfo,Hn=!0;break e}mn=mn.return}mn=!0}if(en.tag===5||en.tag===6)f0(Bt,en,Gt),Hn?Gn(An,en.stateNode):Vn(An,en.stateNode);else if(en.tag===18)Hn?Hr(An,en.stateNode):Nr(An,en.stateNode);else if(en.tag===4){if(en.child!==null){An=en.stateNode.containerInfo,Hn=!0,en.child.return=en,en=en.child;continue}}else if(uy(Bt,en,Gt),en.child!==null){en.child.return=en,en=en.child;continue}if(en===Dt)break;for(;en.sibling===null;){if(en.return===null||en.return===Dt)return;en=en.return,en.tag===4&&(mn=!1)}en.sibling.return=en.return,en=en.sibling}}function Zu(Bt,Dt){if(rn){switch(Dt.tag){case 0:case 11:case 14:case 15:Hl(3,Dt,Dt.return),Ru(3,Dt),Hl(5,Dt,Dt.return);return;case 1:return;case 5:var Gt=Dt.stateNode;if(Gt!=null){var en=Dt.memoizedProps;Bt=Bt!==null?Bt.memoizedProps:en;var mn=Dt.type,An=Dt.updateQueue;Dt.updateQueue=null,An!==null&&On(Gt,An,mn,Bt,en,Dt)}return;case 6:if(Dt.stateNode===null)throw Error(at(162));Gt=Dt.memoizedProps,kn(Dt.stateNode,Bt!==null?Bt.memoizedProps:Gt,Gt);return;case 3:vn&&Bt!==null&&Bt.memoizedState.isDehydrated&&Vr(Dt.stateNode.containerInfo);return;case 12:return;case 13:Gl(Dt);return;case 19:Gl(Dt);return;case 17:return}throw Error(at(163))}switch(Dt.tag){case 0:case 11:case 14:case 15:Hl(3,Dt,Dt.return),Ru(3,Dt),Hl(5,Dt,Dt.return);return;case 12:return;case 13:Gl(Dt);return;case 19:Gl(Dt);return;case 3:vn&&Bt!==null&&Bt.memoizedState.isDehydrated&&Vr(Dt.stateNode.containerInfo);break;case 22:case 23:return}e:if(Zt){switch(Dt.tag){case 1:case 5:case 6:break e;case 3:case 4:Dt=Dt.stateNode,Or(Dt.containerInfo,Dt.pendingChildren);break e}throw Error(at(163))}}function Gl(Bt){var Dt=Bt.updateQueue;if(Dt!==null){Bt.updateQueue=null;var Gt=Bt.stateNode;Gt===null&&(Gt=Bt.stateNode=new U0),Dt.forEach(function(en){var mn=_0.bind(null,Bt,en);Gt.has(en)||(Gt.add(en),en.then(mn,mn))})}}function p0(Bt,Dt){for(Yr=Dt;Yr!==null;){Dt=Yr;var Gt=Dt.deletions;if(Gt!==null)for(var en=0;en";case nm:return":has("+(rm(Bt)||"")+")";case _l:return'[role="'+Bt.value+'"]';case Qu:return'"'+Bt.value+'"';case xp:return'[data-testname="'+Bt.value+'"]';default:throw Error(at(365))}}function g0(Bt,Dt){var Gt=[];Bt=[Bt,0];for(var en=0;enmn&&(mn=Hn),en&=~An}if(en=mn,en=es()-en,en=(120>en?120:480>en?480:1080>en?1080:1920>en?1920:3e3>en?3e3:4320>en?4320:1960*W0(en/1960))-en,10Bt?16:Bt,xu===null)var en=!1;else{if(Bt=xu,xu=null,am=0,Ro&6)throw Error(at(331));var mn=Ro;for(Ro|=4,Yr=Bt.current;Yr!==null;){var An=Yr,Hn=An.child;if(Yr.flags&16){var nr=An.deletions;if(nr!==null){for(var _r=0;_res()-by?cu(Bt,0):yy|=Gt),po(Bt,Dt)}function v0(Bt,Dt){Dt===0&&(Bt.mode&1?(Dt=Co,Co<<=1,!(Co&130023424)&&(Co=4194304)):Dt=1);var Gt=Bs();Bt=$p(Bt,Dt),Bt!==null&&(Xo(Bt,Dt,Gt),po(Bt,Gt))}function Fu(Bt){var Dt=Bt.memoizedState,Gt=0;Dt!==null&&(Gt=Dt.retryLane),v0(Bt,Gt)}function _0(Bt,Dt){var Gt=0;switch(Bt.tag){case 13:var en=Bt.stateNode,mn=Bt.memoizedState;mn!==null&&(Gt=mn.retryLane);break;case 19:en=Bt.stateNode;break;default:throw Error(at(314))}en!==null&&en.delete(Dt),v0(Bt,Gt)}var Iy;Iy=function(Bt,Dt,Gt){if(Bt!==null)if(Bt.memoizedProps!==Dt.pendingProps||yr.current)Qs=!0;else{if(!(Bt.lanes&Gt)&&!(Dt.flags&128))return Qs=!1,L0(Bt,Dt,Gt);Qs=!!(Bt.flags&131072)}else Qs=!1,ba&&Dt.flags&1048576&&jy(Dt,Lp,Dt.index);switch(Dt.lanes=0,Dt.tag){case 2:var en=Dt.type;Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Bt=Dt.pendingProps;var mn=no(Dt,dr.current);rs(Dt,Gt),mn=Go(null,Dt,en,Bt,mn,Gt);var An=Zm();return Dt.flags|=1,typeof mn=="object"&&mn!==null&&typeof mn.render=="function"&&mn.$$typeof===void 0?(Dt.tag=1,Dt.memoizedState=null,Dt.updateQueue=null,ao(en)?(An=!0,wo(Dt)):An=!1,Dt.memoizedState=mn.state!==null&&mn.state!==void 0?mn.state:null,Gm(Dt),mn.updater=ym,Dt.stateNode=mn,mn._reactInternals=Dt,ap(Dt,en,Bt,Gt),Dt=iy(null,Dt,en,!0,An,Gt)):(Dt.tag=0,ba&&An&&bm(Dt),ls(null,Dt,mn,Gt),Dt=Dt.child),Dt;case 16:en=Dt.elementType;e:{switch(Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Bt=Dt.pendingProps,mn=en._init,en=mn(en._payload),Dt.type=en,mn=Dt.tag=x0(en),Bt=ss(en,Bt),mn){case 0:Dt=Vl(null,Dt,en,Bt,Gt);break e;case 1:Dt=o0(null,Dt,en,Bt,Gt);break e;case 11:Dt=Qy(null,Dt,en,Bt,Gt);break e;case 14:Dt=e0(null,Dt,en,ss(en.type,Bt),Gt);break e}throw Error(at(306,en,""))}return Dt;case 0:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),Vl(Bt,Dt,en,mn,Gt);case 1:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),o0(Bt,Dt,en,mn,Gt);case 3:e:{if(a0(Dt),Bt===null)throw Error(at(387));en=Dt.pendingProps,An=Dt.memoizedState,mn=An.element,qm(Bt,Dt),Dl(Dt,en,null,Gt);var Hn=Dt.memoizedState;if(en=Hn.element,vn&&An.isDehydrated)if(An={element:en,isDehydrated:!1,cache:Hn.cache,transitions:Hn.transitions},Dt.updateQueue.baseState=An,Dt.memoizedState=An,Dt.flags&256){mn=Error(at(423)),Dt=s0(Bt,Dt,en,Gt,mn);break e}else if(en!==mn){mn=Error(at(424)),Dt=s0(Bt,Dt,en,Gt,mn);break e}else for(vn&&(Is=Dn(Dt.stateNode.containerInfo),Vs=Dt,ba=!0,Ul=null,lp=!1),Gt=Fy(Dt,null,en,Gt),Dt.child=Gt;Gt;)Gt.flags=Gt.flags&-3|4096,Gt=Gt.sibling;else{if(cp(),en===mn){Dt=_s(Bt,Dt,Gt);break e}ls(Bt,Dt,en,Gt)}Dt=Dt.child}return Dt;case 5:return Uy(Dt),Bt===null&&Xm(Dt),en=Dt.type,mn=Dt.pendingProps,An=Bt!==null?Bt.memoizedProps:null,Hn=mn.children,an(en,mn)?Hn=null:An!==null&&an(en,An)&&(Dt.flags|=32),i0(Bt,Dt),ls(Bt,Dt,Hn,Gt),Dt.child;case 6:return Bt===null&&Xm(Dt),null;case 13:return l0(Bt,Dt,Gt);case 4:return Jm(Dt,Dt.stateNode.containerInfo),en=Dt.pendingProps,Bt===null?Dt.child=hp(Dt,null,en,Gt):ls(Bt,Dt,en,Gt),Dt.child;case 11:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),Qy(Bt,Dt,en,mn,Gt);case 7:return ls(Bt,Dt,Dt.pendingProps,Gt),Dt.child;case 8:return ls(Bt,Dt,Dt.pendingProps.children,Gt),Dt.child;case 12:return ls(Bt,Dt,Dt.pendingProps.children,Gt),Dt.child;case 10:e:{if(en=Dt.type._context,mn=Dt.pendingProps,An=Dt.memoizedProps,Hn=mn.value,jp(Dt,en,Hn),An!==null)if(Xs(An.value,Hn)){if(An.children===mn.children&&!yr.current){Dt=_s(Bt,Dt,Gt);break e}}else for(An=Dt.child,An!==null&&(An.return=Dt);An!==null;){var nr=An.dependencies;if(nr!==null){Hn=An.child;for(var _r=nr.firstContext;_r!==null;){if(_r.context===en){if(An.tag===1){_r=Cs(-1,Gt&-Gt),_r.tag=2;var Wr=An.updateQueue;if(Wr!==null){Wr=Wr.shared;var io=Wr.pending;io===null?_r.next=_r:(_r.next=io.next,io.next=_r),Wr.pending=_r}}An.lanes|=Gt,_r=An.alternate,_r!==null&&(_r.lanes|=Gt),$s(An.return,Gt,Dt),nr.lanes|=Gt;break}_r=_r.next}}else if(An.tag===10)Hn=An.type===Dt.type?null:An.child;else if(An.tag===18){if(Hn=An.return,Hn===null)throw Error(at(341));Hn.lanes|=Gt,nr=Hn.alternate,nr!==null&&(nr.lanes|=Gt),$s(Hn,Gt,Dt),Hn=An.sibling}else Hn=An.child;if(Hn!==null)Hn.return=An;else for(Hn=An;Hn!==null;){if(Hn===Dt){Hn=null;break}if(An=Hn.sibling,An!==null){An.return=Hn.return,Hn=An;break}Hn=Hn.return}An=Hn}ls(Bt,Dt,mn.children,Gt),Dt=Dt.child}return Dt;case 9:return mn=Dt.type,en=Dt.pendingProps.children,rs(Dt,Gt),mn=Wo(mn),en=en(mn),Dt.flags|=1,ls(Bt,Dt,en,Gt),Dt.child;case 14:return en=Dt.type,mn=ss(en,Dt.pendingProps),mn=ss(en.type,mn),e0(Bt,Dt,en,mn,Gt);case 15:return n0(Bt,Dt,Dt.type,Dt.pendingProps,Gt);case 17:return en=Dt.type,mn=Dt.pendingProps,mn=Dt.elementType===en?mn:ss(en,mn),Bt!==null&&(Bt.alternate=null,Dt.alternate=null,Dt.flags|=2),Dt.tag=1,ao(en)?(Bt=!0,wo(Dt)):Bt=!1,rs(Dt,Gt),Oy(Dt,en,mn),ap(Dt,en,mn,Gt),iy(null,Dt,en,!0,Bt,Gt);case 19:return h0(Bt,Dt,Gt);case 22:return r0(Bt,Dt,Gt)}throw Error(at(156,Dt.tag))};function Nm(Bt,Dt){return eu(Bt,Dt)}function V0(Bt,Dt,Gt,en){this.tag=Bt,this.key=Gt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=Dt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=en,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pl(Bt,Dt,Gt,en){return new V0(Bt,Dt,Gt,en)}function Ay(Bt){return Bt=Bt.prototype,!(!Bt||!Bt.isReactComponent)}function x0(Bt){if(typeof Bt=="function")return Ay(Bt)?1:0;if(Bt!=null){if(Bt=Bt.$$typeof,Bt===gt)return 11;if(Bt===wt)return 14}return 2}function ku(Bt,Dt){var Gt=Bt.alternate;return Gt===null?(Gt=Pl(Bt.tag,Dt,Bt.key,Bt.mode),Gt.elementType=Bt.elementType,Gt.type=Bt.type,Gt.stateNode=Bt.stateNode,Gt.alternate=Bt,Bt.alternate=Gt):(Gt.pendingProps=Dt,Gt.type=Bt.type,Gt.flags=0,Gt.subtreeFlags=0,Gt.deletions=null),Gt.flags=Bt.flags&14680064,Gt.childLanes=Bt.childLanes,Gt.lanes=Bt.lanes,Gt.child=Bt.child,Gt.memoizedProps=Bt.memoizedProps,Gt.memoizedState=Bt.memoizedState,Gt.updateQueue=Bt.updateQueue,Dt=Bt.dependencies,Gt.dependencies=Dt===null?null:{lanes:Dt.lanes,firstContext:Dt.firstContext},Gt.sibling=Bt.sibling,Gt.index=Bt.index,Gt.ref=Bt.ref,Gt}function Dm(Bt,Dt,Gt,en,mn,An){var Hn=2;if(en=Bt,typeof Bt=="function")Ay(Bt)&&(Hn=1);else if(typeof Bt=="string")Hn=5;else e:switch(Bt){case ut:return Uu(Gt.children,mn,An,Dt);case ht:Hn=8,mn|=8;break;case dt:return Bt=Pl(12,Gt,Dt,mn|2),Bt.elementType=dt,Bt.lanes=An,Bt;case yt:return Bt=Pl(13,Gt,Dt,mn),Bt.elementType=yt,Bt.lanes=An,Bt;case bt:return Bt=Pl(19,Gt,Dt,mn),Bt.elementType=bt,Bt.lanes=An,Bt;case kt:return cm(Gt,mn,An,Dt);default:if(typeof Bt=="object"&&Bt!==null)switch(Bt.$$typeof){case pt:Hn=10;break e;case mt:Hn=9;break e;case gt:Hn=11;break e;case wt:Hn=14;break e;case xt:Hn=16,en=null;break e}throw Error(at(130,Bt==null?Bt:typeof Bt,""))}return Dt=Pl(Hn,Gt,Dt,mn),Dt.elementType=Bt,Dt.type=en,Dt.lanes=An,Dt}function Uu(Bt,Dt,Gt,en){return Bt=Pl(7,Bt,en,Dt),Bt.lanes=Gt,Bt}function cm(Bt,Dt,Gt,en){return Bt=Pl(22,Bt,en,Dt),Bt.elementType=kt,Bt.lanes=Gt,Bt.stateNode={},Bt}function Ns(Bt,Dt,Gt){return Bt=Pl(6,Bt,null,Dt),Bt.lanes=Gt,Bt}function Ml(Bt,Dt,Gt){return Dt=Pl(4,Bt.children!==null?Bt.children:[],Bt.key,Dt),Dt.lanes=Gt,Dt.stateNode={containerInfo:Bt.containerInfo,pendingChildren:null,implementation:Bt.implementation},Dt}function H0(Bt,Dt,Gt,en,mn){this.tag=Dt,this.containerInfo=Bt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=dn,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xa(0),this.expirationTimes=xa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xa(0),this.identifierPrefix=en,this.onRecoverableError=mn,vn&&(this.mutableSourceEagerHydrationData=null)}function k0(Bt,Dt,Gt,en,mn,An,Hn,nr,_r){return Bt=new H0(Bt,Dt,Gt,nr,_r),Dt===1?(Dt=1,An===!0&&(Dt|=8)):Dt=0,An=Pl(3,null,null,Dt),Bt.current=An,An.stateNode=Bt,An.memoizedState={element:en,isDehydrated:Gt,cache:null,transitions:null},Gm(An),Bt}function um(Bt){if(!Bt)return xr;Bt=Bt._reactInternals;e:{if(Ct(Bt)!==Bt||Bt.tag!==1)throw Error(at(170));var Dt=Bt;do{switch(Dt.tag){case 3:Dt=Dt.stateNode.context;break e;case 1:if(ao(Dt.type)){Dt=Dt.stateNode.__reactInternalMemoizedMergedChildContext;break e}}Dt=Dt.return}while(Dt!==null);throw Error(at(171))}if(Bt.tag===1){var Gt=Bt.type;if(ao(Gt))return qn(Bt,Gt,Dt)}return Dt}function _f(Bt){var Dt=Bt._reactInternals;if(Dt===void 0)throw typeof Bt.render=="function"?Error(at(188)):(Bt=Object.keys(Bt).join(","),Error(at(268,Bt)));return Bt=Rt(Dt),Bt===null?null:Bt.stateNode}function $y(Bt,Dt){if(Bt=Bt.memoizedState,Bt!==null&&Bt.dehydrated!==null){var Gt=Bt.retryLane;Bt.retryLane=Gt!==0&&Gt=Wr&&An>=To&&mn<=io&&Hn<=uo){Bt.splice(Dt,1);break}else if(en!==Wr||Gt.width!==_r.width||uoHn){if(!(An!==To||Gt.height!==_r.height||iomn)){Wr>en&&(_r.width+=Wr-en,_r.x=en),ioAn&&(_r.height+=To-An,_r.y=An),uoGt&&(Gt=Hn)),Hn ")+` No matching component was found for: - `)+Bt.join(" > ")}return null},nt.getPublicRootInstance=function(Bt){if(Bt=Bt.current,!Bt.child)return null;switch(Bt.child.tag){case 5:return Ot(Bt.child.stateNode);default:return Bt.child.stateNode}},nt.injectIntoDevTools=function(Bt){if(Bt={bundleType:Bt.bundleType,version:Bt.version,rendererPackageName:Bt.rendererPackageName,rendererConfig:Bt.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:st.ReactCurrentDispatcher,findHostInstanceByFiber:G0,findFiberByHostInstance:Bt.findFiberByHostInstance||S0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")Bt=!1;else{var Dt=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(Dt.isDisabled||!Dt.supportsFiber)Bt=!0;else{try{Wu=Dt.inject(Bt),Ks=Dt}catch{}Bt=!!Dt.checkDCE}}return Bt},nt.isAlreadyRendering=function(){return!1},nt.observeVisibleRects=function(Bt,Dt,Gt,en){if(!Tn)throw Error(at(363));Bt=my(Bt,Dt);var mn=cn(Bt,Gt,en).disconnect;return{disconnect:function(){mn()}}},nt.registerMutableSourceForHydration=function(Bt,Dt){var Gt=Dt._getVersion;Gt=Gt(Dt._source),Bt.mutableSourceEagerHydrationData==null?Bt.mutableSourceEagerHydrationData=[Dt,Gt]:Bt.mutableSourceEagerHydrationData.push(Dt,Gt)},nt.runWithPriority=function(Bt,Dt){var Gt=No;try{return No=Bt,Dt()}finally{No=Gt}},nt.shouldError=function(){return null},nt.shouldSuspend=function(){return!1},nt.updateContainer=function(Bt,Dt,Gt,en){var mn=Dt.current,An=Bs(),Hn=lu(mn);return Gt=um(Gt),Dt.context===null?Dt.context=Gt:Dt.pendingContext=Gt,Dt=Cs(An,Hn),Dt.payload={element:Bt},en=en===void 0?null:en,en!==null&&(Dt.callback=en),Nl(mn,Dt),Bt=Cl(mn,Hn,An),Bt!==null&&op(Bt,mn,Hn),Hn},nt};reactReconciler.exports=reactReconciler_production_min;var reactReconcilerExports=reactReconciler.exports;const Reconciler=getDefaultExportFromCjs(reactReconcilerExports),isPromise=tt=>typeof tt=="object"&&typeof tt.then=="function",globalCache$1=[];function shallowEqualArrays$1(tt,et,nt=(rt,it)=>rt===it){if(tt===et)return!0;if(!tt||!et)return!1;const rt=tt.length;if(et.length!==rt)return!1;for(let it=0;it0&&(ot.timeout&&clearTimeout(ot.timeout),ot.timeout=setTimeout(ot.remove,rt.lifespan)),ot.response;if(!nt)throw ot.promise}const it={keys:et,equal:rt.equal,remove:()=>{const ot=globalCache$1.indexOf(it);ot!==-1&&globalCache$1.splice(ot,1)},promise:(isPromise(tt)?tt:tt(...et)).then(ot=>{it.response=ot,rt.lifespan&&rt.lifespan>0&&(it.timeout=setTimeout(it.remove,rt.lifespan))}).catch(ot=>it.error=ot)};if(globalCache$1.push(it),!nt)throw it.promise}const suspend$1=(tt,et,nt)=>query$1(tt,et,!1,nt),preload=(tt,et,nt)=>void query$1(tt,et,!0,nt),clear=tt=>{if(tt===void 0||tt.length===0)globalCache$1.splice(0,globalCache$1.length);else{const et=globalCache$1.find(nt=>shallowEqualArrays$1(tt,nt.keys,nt.equal));et&&et.remove()}},catalogue={},extend$1=tt=>void Object.assign(catalogue,tt);function createRenderer(tt,et){function nt(ut,{args:ht=[],attach:dt,...pt},mt){let gt=`${ut[0].toUpperCase()}${ut.slice(1)}`,yt;if(ut==="primitive"){if(pt.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const bt=pt.object;yt=prepare$1(bt,{type:ut,root:mt,attach:dt,primitive:!0})}else{const bt=catalogue[gt];if(!bt)throw new Error(`R3F: ${gt} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(ht))throw new Error("R3F: The args prop must be an array!");yt=prepare$1(new bt(...ht),{type:ut,root:mt,attach:dt,memoizedProps:{args:ht}})}return yt.__r3f.attach===void 0&&(yt instanceof BufferGeometry?yt.__r3f.attach="geometry":yt instanceof Material&&(yt.__r3f.attach="material")),gt!=="inject"&&applyProps$1(yt,pt),yt}function rt(ut,ht){let dt=!1;if(ht){var pt,mt;(pt=ht.__r3f)!=null&&pt.attach?attach(ut,ht,ht.__r3f.attach):ht.isObject3D&&ut.isObject3D&&(ut.add(ht),dt=!0),dt||(mt=ut.__r3f)==null||mt.objects.push(ht),ht.__r3f||prepare$1(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function it(ut,ht,dt){let pt=!1;if(ht){var mt,gt;if((mt=ht.__r3f)!=null&&mt.attach)attach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){ht.parent=ut,ht.dispatchEvent({type:"added"});const yt=ut.children.filter(wt=>wt!==ht),bt=yt.indexOf(dt);ut.children=[...yt.slice(0,bt),ht,...yt.slice(bt)],pt=!0}pt||(gt=ut.__r3f)==null||gt.objects.push(ht),ht.__r3f||prepare$1(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function ot(ut,ht,dt=!1){ut&&[...ut].forEach(pt=>at(ht,pt,dt))}function at(ut,ht,dt){if(ht){var pt,mt,gt;if(ht.__r3f&&(ht.__r3f.parent=null),(pt=ut.__r3f)!=null&&pt.objects&&(ut.__r3f.objects=ut.__r3f.objects.filter(kt=>kt!==ht)),(mt=ht.__r3f)!=null&&mt.attach)detach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){var yt;ut.remove(ht),(yt=ht.__r3f)!=null&&yt.root&&removeInteractivity(ht.__r3f.root,ht)}const wt=(gt=ht.__r3f)==null?void 0:gt.primitive,xt=dt===void 0?ht.dispose!==null&&!wt:dt;if(!wt){var bt;ot((bt=ht.__r3f)==null?void 0:bt.objects,ht,xt),ot(ht.children,ht,xt)}delete ht.__r3f,xt&&ht.dispose&&ht.type!=="Scene"&&schedulerExports.unstable_scheduleCallback(schedulerExports.unstable_IdlePriority,()=>{try{ht.dispose()}catch{}}),invalidateInstance(ut)}}function st(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)==null?void 0:mt.parent;if(!gt)return;const yt=nt(ht,dt,ut.__r3f.root);if(ut.children){for(const bt of ut.children)bt.__r3f&&rt(yt,bt);ut.children=ut.children.filter(bt=>!bt.__r3f)}ut.__r3f.objects.forEach(bt=>rt(yt,bt)),ut.__r3f.objects=[],ut.__r3f.autoRemovedBeforeAppend||at(gt,ut),yt.parent&&(yt.__r3f.autoRemovedBeforeAppend=!0),rt(gt,yt),yt.raycast&&yt.__r3f.eventCount&&yt.__r3f.root.getState().internal.interaction.push(yt),[pt,pt.alternate].forEach(bt=>{bt!==null&&(bt.stateNode=yt,bt.ref&&(typeof bt.ref=="function"?bt.ref(yt):bt.ref.current=yt))})}const lt=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:Reconciler({createInstance:nt,removeChild:at,appendChild:rt,appendInitialChild:rt,insertBefore:it,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(ut,ht)=>{if(!ht)return;const dt=ut.getState().scene;dt.__r3f&&(dt.__r3f.root=ut,rt(dt,ht))},removeChildFromContainer:(ut,ht)=>{ht&&at(ut.getState().scene,ht)},insertInContainerBefore:(ut,ht,dt)=>{if(!ht||!dt)return;const pt=ut.getState().scene;pt.__r3f&&it(pt,ht,dt)},getRootHostContext:()=>null,getChildHostContext:ut=>ut,finalizeInitialChildren(ut){var ht;return!!((ht=ut==null?void 0:ut.__r3f)!=null?ht:{}).handlers},prepareUpdate(ut,ht,dt,pt){var mt;if(((mt=ut==null?void 0:ut.__r3f)!=null?mt:{}).primitive&&pt.object&&pt.object!==ut)return[!0];{const{args:yt=[],children:bt,...wt}=pt,{args:xt=[],children:kt,...St}=dt;if(!Array.isArray(yt))throw new Error("R3F: the args prop must be an array!");if(yt.some((At,Et)=>At!==xt[Et]))return[!0];const Tt=diffProps(ut,wt,St,!0);return Tt.changes.length?[!1,Tt]:null}},commitUpdate(ut,[ht,dt],pt,mt,gt,yt){ht?st(ut,pt,gt,yt):applyProps$1(ut,dt)},commitMount(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)!=null?mt:{};ut.raycast&>.handlers&>.eventCount&&ut.__r3f.root.getState().internal.interaction.push(ut)},getPublicInstance:ut=>ut,prepareForCommit:()=>null,preparePortalMount:ut=>prepare$1(ut.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(ut){var ht;const{attach:dt,parent:pt}=(ht=ut.__r3f)!=null?ht:{};dt&&pt&&detach(pt,ut,dt),ut.isObject3D&&(ut.visible=!1),invalidateInstance(ut)},unhideInstance(ut,ht){var dt;const{attach:pt,parent:mt}=(dt=ut.__r3f)!=null?dt:{};pt&&mt&&attach(mt,ut,pt),(ut.isObject3D&&ht.visible==null||ht.visible)&&(ut.visible=!0),invalidateInstance(ut)},createTextInstance:lt,hideTextInstance:lt,unhideTextInstance:lt,getCurrentEventPriority:()=>et?et():constantsExports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&is$1.fun(performance.now)?performance.now:is$1.fun(Date.now)?Date.now:()=>0,scheduleTimeout:is$1.fun(setTimeout)?setTimeout:void 0,cancelTimeout:is$1.fun(clearTimeout)?clearTimeout:void 0}),applyProps:applyProps$1}}var _window$document,_window$navigator;const hasColorSpace=tt=>"colorSpace"in tt||"outputColorSpace"in tt,getColorManagement=()=>{var tt;return(tt=catalogue.ColorManagement)!=null?tt:null},isOrthographicCamera$1=tt=>tt&&tt.isOrthographicCamera,isRef=tt=>tt&&tt.hasOwnProperty("current"),useIsomorphicLayoutEffect$1=typeof window<"u"&&((_window$document=window.document)!=null&&_window$document.createElement||((_window$navigator=window.navigator)==null?void 0:_window$navigator.product)==="ReactNative")?reactExports.useLayoutEffect:reactExports.useEffect;function useMutableCallback(tt){const et=reactExports.useRef(tt);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt),[tt]),et}function Block({set:tt}){return useIsomorphicLayoutEffect$1(()=>(tt(new Promise(()=>null)),()=>tt(!1)),[tt]),null}class ErrorBoundary extends reactExports.Component{constructor(...et){super(...et),this.state={error:!1}}componentDidCatch(et){this.props.set(et)}render(){return this.state.error?null:this.props.children}}ErrorBoundary.getDerivedStateFromError=()=>({error:!0});const DEFAULT="__default",DEFAULTS=new Map,isDiffSet=tt=>tt&&!!tt.memoized&&!!tt.changes;function calculateDpr(tt){var et;const nt=typeof window<"u"?(et=window.devicePixelRatio)!=null?et:2:1;return Array.isArray(tt)?Math.min(Math.max(tt[0],nt),tt[1]):tt}const getRootState=tt=>{var et;return(et=tt.__r3f)==null?void 0:et.root.getState()},is$1={obj:tt=>tt===Object(tt)&&!is$1.arr(tt)&&typeof tt!="function",fun:tt=>typeof tt=="function",str:tt=>typeof tt=="string",num:tt=>typeof tt=="number",boo:tt=>typeof tt=="boolean",und:tt=>tt===void 0,arr:tt=>Array.isArray(tt),equ(tt,et,{arrays:nt="shallow",objects:rt="reference",strict:it=!0}={}){if(typeof tt!=typeof et||!!tt!=!!et)return!1;if(is$1.str(tt)||is$1.num(tt))return tt===et;const ot=is$1.obj(tt);if(ot&&rt==="reference")return tt===et;const at=is$1.arr(tt);if(at&&nt==="reference")return tt===et;if((at||ot)&&tt===et)return!0;let st;for(st in tt)if(!(st in et))return!1;if(ot&&nt==="shallow"&&rt==="shallow"){for(st in it?et:tt)if(!is$1.equ(tt[st],et[st],{strict:it,objects:"reference"}))return!1}else for(st in it?et:tt)if(tt[st]!==et[st])return!1;if(is$1.und(st)){if(at&&tt.length===0&&et.length===0||ot&&Object.keys(tt).length===0&&Object.keys(et).length===0)return!0;if(tt!==et)return!1}return!0}};function buildGraph(tt){const et={nodes:{},materials:{}};return tt&&tt.traverse(nt=>{nt.name&&(et.nodes[nt.name]=nt),nt.material&&!et.materials[nt.material.name]&&(et.materials[nt.material.name]=nt.material)}),et}function dispose(tt){tt.dispose&&tt.type!=="Scene"&&tt.dispose();for(const et in tt)et.dispose==null||et.dispose(),delete tt[et]}function prepare$1(tt,et){const nt=tt;return nt.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...et},tt}function resolve(tt,et){let nt=tt;if(et.includes("-")){const rt=et.split("-"),it=rt.pop();return nt=rt.reduce((ot,at)=>ot[at],tt),{target:nt,key:it}}else return{target:nt,key:et}}const INDEX_REGEX=/-\d+$/;function attach(tt,et,nt){if(is$1.str(nt)){if(INDEX_REGEX.test(nt)){const ot=nt.replace(INDEX_REGEX,""),{target:at,key:st}=resolve(tt,ot);Array.isArray(at[st])||(at[st]=[])}const{target:rt,key:it}=resolve(tt,nt);et.__r3f.previousAttach=rt[it],rt[it]=et}else et.__r3f.previousAttach=nt(tt,et)}function detach(tt,et,nt){var rt,it;if(is$1.str(nt)){const{target:ot,key:at}=resolve(tt,nt),st=et.__r3f.previousAttach;st===void 0?delete ot[at]:ot[at]=st}else(rt=et.__r3f)==null||rt.previousAttach==null||rt.previousAttach(tt,et);(it=et.__r3f)==null||delete it.previousAttach}function diffProps(tt,{children:et,key:nt,ref:rt,...it},{children:ot,key:at,ref:st,...lt}={},ct=!1){var ut;const ht=(ut=tt==null?void 0:tt.__r3f)!=null?ut:{},dt=Object.entries(it),pt=[];if(ct){const gt=Object.keys(lt);for(let yt=0;yt{var bt;if((bt=tt.__r3f)!=null&&bt.primitive&>==="object"||is$1.equ(yt,lt[gt]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(gt))return pt.push([gt,yt,!0,[]]);let wt=[];gt.includes("-")&&(wt=gt.split("-")),pt.push([gt,yt,!1,wt]);for(const xt in it){const kt=it[xt];xt.startsWith(`${gt}-`)&&pt.push([xt,kt,!1,xt.split("-")])}});const mt={...it};return ht.memoizedProps&&ht.memoizedProps.args&&(mt.args=ht.memoizedProps.args),ht.memoizedProps&&ht.memoizedProps.attach&&(mt.attach=ht.memoizedProps.attach),{memoized:mt,changes:pt}}const __DEV__=typeof process<"u"&&!1;function applyProps$1(tt,et){var nt,rt,it;const ot=(nt=tt.__r3f)!=null?nt:{},at=ot.root,st=(rt=at==null||at.getState==null?void 0:at.getState())!=null?rt:{},{memoized:lt,changes:ct}=isDiffSet(et)?et:diffProps(tt,et),ut=ot.eventCount;tt.__r3f&&(tt.__r3f.memoizedProps=lt);for(let dt=0;dtxt[kt],tt),!(wt&&wt.set))){const[xt,...kt]=yt.reverse();bt=kt.reverse().reduce((St,Tt)=>St[Tt],tt),pt=xt}if(mt===DEFAULT+"remove")if(bt.constructor){let xt=DEFAULTS.get(bt.constructor);xt||(xt=new bt.constructor,DEFAULTS.set(bt.constructor,xt)),mt=xt[pt]}else mt=0;if(gt)mt?ot.handlers[pt]=mt:delete ot.handlers[pt],ot.eventCount=Object.keys(ot.handlers).length;else if(wt&&wt.set&&(wt.copy||wt instanceof Layers)){if(Array.isArray(mt))wt.fromArray?wt.fromArray(mt):wt.set(...mt);else if(wt.copy&&mt&&mt.constructor&&(__DEV__?wt.constructor.name===mt.constructor.name:wt.constructor===mt.constructor))wt.copy(mt);else if(mt!==void 0){const xt=wt instanceof Color$1;!xt&&wt.setScalar?wt.setScalar(mt):wt instanceof Layers&&mt instanceof Layers?wt.mask=mt.mask:wt.set(mt),!getColorManagement()&&!st.linear&&xt&&wt.convertSRGBToLinear()}}else if(bt[pt]=mt,bt[pt]instanceof Texture&&bt[pt].format===RGBAFormat&&bt[pt].type===UnsignedByteType){const xt=bt[pt];hasColorSpace(xt)&&hasColorSpace(st.gl)?xt.colorSpace=st.gl.outputColorSpace:xt.encoding=st.gl.outputEncoding}invalidateInstance(tt)}if(ot.parent&&st.internal&&tt.raycast&&ut!==ot.eventCount){const dt=st.internal.interaction.indexOf(tt);dt>-1&&st.internal.interaction.splice(dt,1),ot.eventCount&&st.internal.interaction.push(tt)}return!(ct.length===1&&ct[0][0]==="onUpdate")&&ct.length&&(it=tt.__r3f)!=null&&it.parent&&updateInstance(tt),tt}function invalidateInstance(tt){var et,nt;const rt=(et=tt.__r3f)==null||(nt=et.root)==null||nt.getState==null?void 0:nt.getState();rt&&rt.internal.frames===0&&rt.invalidate()}function updateInstance(tt){tt.onUpdate==null||tt.onUpdate(tt)}function updateCamera(tt,et){tt.manual||(isOrthographicCamera$1(tt)?(tt.left=et.width/-2,tt.right=et.width/2,tt.top=et.height/2,tt.bottom=et.height/-2):tt.aspect=et.width/et.height,tt.updateProjectionMatrix(),tt.updateMatrixWorld())}function makeId(tt){return(tt.eventObject||tt.object).uuid+"/"+tt.index+tt.instanceId}function getEventPriority(){var tt;const et=typeof self<"u"&&self||typeof window<"u"&&window;if(!et)return constantsExports.DefaultEventPriority;switch((tt=et.event)==null?void 0:tt.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return constantsExports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return constantsExports.ContinuousEventPriority;default:return constantsExports.DefaultEventPriority}}function releaseInternalPointerCapture(tt,et,nt,rt){const it=nt.get(et);it&&(nt.delete(et),nt.size===0&&(tt.delete(rt),it.target.releasePointerCapture(rt)))}function removeInteractivity(tt,et){const{internal:nt}=tt.getState();nt.interaction=nt.interaction.filter(rt=>rt!==et),nt.initialHits=nt.initialHits.filter(rt=>rt!==et),nt.hovered.forEach((rt,it)=>{(rt.eventObject===et||rt.object===et)&&nt.hovered.delete(it)}),nt.capturedMap.forEach((rt,it)=>{releaseInternalPointerCapture(nt.capturedMap,et,rt,it)})}function createEvents(tt){function et(lt){const{internal:ct}=tt.getState(),ut=lt.offsetX-ct.initialClick[0],ht=lt.offsetY-ct.initialClick[1];return Math.round(Math.sqrt(ut*ut+ht*ht))}function nt(lt){return lt.filter(ct=>["Move","Over","Enter","Out","Leave"].some(ut=>{var ht;return(ht=ct.__r3f)==null?void 0:ht.handlers["onPointer"+ut]}))}function rt(lt,ct){const ut=tt.getState(),ht=new Set,dt=[],pt=ct?ct(ut.internal.interaction):ut.internal.interaction;for(let bt=0;bt{const xt=getRootState(bt.object),kt=getRootState(wt.object);return!xt||!kt?bt.distance-wt.distance:kt.events.priority-xt.events.priority||bt.distance-wt.distance}).filter(bt=>{const wt=makeId(bt);return ht.has(wt)?!1:(ht.add(wt),!0)});ut.events.filter&&(gt=ut.events.filter(gt,ut));for(const bt of gt){let wt=bt.object;for(;wt;){var yt;(yt=wt.__r3f)!=null&&yt.eventCount&&dt.push({...bt,eventObject:wt}),wt=wt.parent}}if("pointerId"in lt&&ut.internal.capturedMap.has(lt.pointerId))for(let bt of ut.internal.capturedMap.get(lt.pointerId).values())ht.has(makeId(bt.intersection))||dt.push(bt.intersection);return dt}function it(lt,ct,ut,ht){const dt=tt.getState();if(lt.length){const pt={stopped:!1};for(const mt of lt){const gt=getRootState(mt.object)||dt,{raycaster:yt,pointer:bt,camera:wt,internal:xt}=gt,kt=new Vector3(bt.x,bt.y,0).unproject(wt),St=Lt=>{var jt,Rt;return(jt=(Rt=xt.capturedMap.get(Lt))==null?void 0:Rt.has(mt.eventObject))!=null?jt:!1},Tt=Lt=>{const jt={intersection:mt,target:ct.target};xt.capturedMap.has(Lt)?xt.capturedMap.get(Lt).set(mt.eventObject,jt):xt.capturedMap.set(Lt,new Map([[mt.eventObject,jt]])),ct.target.setPointerCapture(Lt)},At=Lt=>{const jt=xt.capturedMap.get(Lt);jt&&releaseInternalPointerCapture(xt.capturedMap,mt.eventObject,jt,Lt)};let Et={};for(let Lt in ct){let jt=ct[Lt];typeof jt!="function"&&(Et[Lt]=jt)}let Ct={...mt,...Et,pointer:bt,intersections:lt,stopped:pt.stopped,delta:ut,unprojectedPoint:kt,ray:yt.ray,camera:wt,stopPropagation(){const Lt="pointerId"in ct&&xt.capturedMap.get(ct.pointerId);if((!Lt||Lt.has(mt.eventObject))&&(Ct.stopped=pt.stopped=!0,xt.hovered.size&&Array.from(xt.hovered.values()).find(jt=>jt.eventObject===mt.eventObject))){const jt=lt.slice(0,lt.indexOf(mt));ot([...jt,mt])}},target:{hasPointerCapture:St,setPointerCapture:Tt,releasePointerCapture:At},currentTarget:{hasPointerCapture:St,setPointerCapture:Tt,releasePointerCapture:At},nativeEvent:ct};if(ht(Ct),pt.stopped===!0)break}}return lt}function ot(lt){const{internal:ct}=tt.getState();for(const ut of ct.hovered.values())if(!lt.length||!lt.find(ht=>ht.object===ut.object&&ht.index===ut.index&&ht.instanceId===ut.instanceId)){const dt=ut.eventObject.__r3f,pt=dt==null?void 0:dt.handlers;if(ct.hovered.delete(makeId(ut)),dt!=null&&dt.eventCount){const mt={...ut,intersections:lt};pt.onPointerOut==null||pt.onPointerOut(mt),pt.onPointerLeave==null||pt.onPointerLeave(mt)}}}function at(lt,ct){for(let ut=0;utot([]);case"onLostPointerCapture":return ct=>{const{internal:ut}=tt.getState();"pointerId"in ct&&ut.capturedMap.has(ct.pointerId)&&requestAnimationFrame(()=>{ut.capturedMap.has(ct.pointerId)&&(ut.capturedMap.delete(ct.pointerId),ot([]))})}}return function(ut){const{onPointerMissed:ht,internal:dt}=tt.getState();dt.lastEvent.current=ut;const pt=lt==="onPointerMove",mt=lt==="onClick"||lt==="onContextMenu"||lt==="onDoubleClick",yt=rt(ut,pt?nt:void 0),bt=mt?et(ut):0;lt==="onPointerDown"&&(dt.initialClick=[ut.offsetX,ut.offsetY],dt.initialHits=yt.map(xt=>xt.eventObject)),mt&&!yt.length&&bt<=2&&(at(ut,dt.interaction),ht&&ht(ut)),pt&&ot(yt);function wt(xt){const kt=xt.eventObject,St=kt.__r3f,Tt=St==null?void 0:St.handlers;if(St!=null&&St.eventCount)if(pt){if(Tt.onPointerOver||Tt.onPointerEnter||Tt.onPointerOut||Tt.onPointerLeave){const At=makeId(xt),Et=dt.hovered.get(At);Et?Et.stopped&&xt.stopPropagation():(dt.hovered.set(At,xt),Tt.onPointerOver==null||Tt.onPointerOver(xt),Tt.onPointerEnter==null||Tt.onPointerEnter(xt))}Tt.onPointerMove==null||Tt.onPointerMove(xt)}else{const At=Tt[lt];At?(!mt||dt.initialHits.includes(kt))&&(at(ut,dt.interaction.filter(Et=>!dt.initialHits.includes(Et))),At(xt)):mt&&dt.initialHits.includes(kt)&&at(ut,dt.interaction.filter(Et=>!dt.initialHits.includes(Et)))}}it(yt,ut,bt,wt)}}return{handlePointer:st}}const isRenderer=tt=>!!(tt!=null&&tt.render),context$2=reactExports.createContext(null),createStore$1=(tt,et)=>{const nt=create$2((st,lt)=>{const ct=new Vector3,ut=new Vector3,ht=new Vector3;function dt(bt=lt().camera,wt=ut,xt=lt().size){const{width:kt,height:St,top:Tt,left:At}=xt,Et=kt/St;wt instanceof Vector3?ht.copy(wt):ht.set(...wt);const Ct=bt.getWorldPosition(ct).distanceTo(ht);if(isOrthographicCamera$1(bt))return{width:kt/bt.zoom,height:St/bt.zoom,top:Tt,left:At,factor:1,distance:Ct,aspect:Et};{const Lt=bt.fov*Math.PI/180,jt=2*Math.tan(Lt/2)*Ct,Rt=jt*(kt/St);return{width:Rt,height:jt,top:Tt,left:At,factor:kt/Rt,distance:Ct,aspect:Et}}}let pt;const mt=bt=>st(wt=>({performance:{...wt.performance,current:bt}})),gt=new Vector2;return{set:st,get:lt,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(bt=1)=>tt(lt(),bt),advance:(bt,wt)=>et(bt,wt,lt()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Clock$1,pointer:gt,mouse:gt,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const bt=lt();pt&&clearTimeout(pt),bt.performance.current!==bt.performance.min&&mt(bt.performance.min),pt=setTimeout(()=>mt(lt().performance.max),bt.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:dt},setEvents:bt=>st(wt=>({...wt,events:{...wt.events,...bt}})),setSize:(bt,wt,xt,kt,St)=>{const Tt=lt().camera,At={width:bt,height:wt,top:kt||0,left:St||0,updateStyle:xt};st(Et=>({size:At,viewport:{...Et.viewport,...dt(Tt,ut,At)}}))},setDpr:bt=>st(wt=>{const xt=calculateDpr(bt);return{viewport:{...wt.viewport,dpr:xt,initialDpr:wt.viewport.initialDpr||xt}}}),setFrameloop:(bt="always")=>{const wt=lt().clock;wt.stop(),wt.elapsedTime=0,bt!=="never"&&(wt.start(),wt.elapsedTime=0),st(()=>({frameloop:bt}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:reactExports.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(bt,wt,xt)=>{const kt=lt().internal;return kt.priority=kt.priority+(wt>0?1:0),kt.subscribers.push({ref:bt,priority:wt,store:xt}),kt.subscribers=kt.subscribers.sort((St,Tt)=>St.priority-Tt.priority),()=>{const St=lt().internal;St!=null&&St.subscribers&&(St.priority=St.priority-(wt>0?1:0),St.subscribers=St.subscribers.filter(Tt=>Tt.ref!==bt))}}}}}),rt=nt.getState();let it=rt.size,ot=rt.viewport.dpr,at=rt.camera;return nt.subscribe(()=>{const{camera:st,size:lt,viewport:ct,gl:ut,set:ht}=nt.getState();if(lt.width!==it.width||lt.height!==it.height||ct.dpr!==ot){var dt;it=lt,ot=ct.dpr,updateCamera(st,lt),ut.setPixelRatio(ct.dpr);const pt=(dt=lt.updateStyle)!=null?dt:typeof HTMLCanvasElement<"u"&&ut.domElement instanceof HTMLCanvasElement;ut.setSize(lt.width,lt.height,pt)}st!==at&&(at=st,ht(pt=>({viewport:{...pt.viewport,...pt.viewport.getCurrentViewport(st)}})))}),nt.subscribe(st=>tt(st)),nt};function createSubs(tt,et){const nt={callback:tt};return et.add(nt),()=>void et.delete(nt)}let i$3,globalEffects=new Set,globalAfterEffects=new Set,globalTailEffects=new Set;const addEffect=tt=>createSubs(tt,globalEffects),addAfterEffect=tt=>createSubs(tt,globalAfterEffects),addTail=tt=>createSubs(tt,globalTailEffects);function run(tt,et){if(tt.size)for(const{callback:nt}of tt.values())nt(et)}function flushGlobalEffects(tt,et){switch(tt){case"before":return run(globalEffects,et);case"after":return run(globalAfterEffects,et);case"tail":return run(globalTailEffects,et)}}let subscribers,subscription;function render$1(tt,et,nt){let rt=et.clock.getDelta();for(et.frameloop==="never"&&typeof tt=="number"&&(rt=tt-et.clock.elapsedTime,et.clock.oldTime=et.clock.elapsedTime,et.clock.elapsedTime=tt),subscribers=et.internal.subscribers,i$3=0;i$30)&&!((ct=it.gl.xr)!=null&&ct.isPresenting)&&(nt+=render$1(lt,it))}if(flushGlobalEffects("after",lt),nt===0)return flushGlobalEffects("tail",lt),et=!1,cancelAnimationFrame(rt)}function at(lt,ct=1){var ut;if(!lt)return tt.forEach(ht=>at(ht.store.getState()),ct);(ut=lt.gl.xr)!=null&&ut.isPresenting||!lt.internal.active||lt.frameloop==="never"||(lt.internal.frames=Math.min(60,lt.internal.frames+ct),et||(et=!0,requestAnimationFrame(ot)))}function st(lt,ct=!0,ut,ht){if(ct&&flushGlobalEffects("before",lt),ut)render$1(lt,ut,ht);else for(const dt of tt.values())render$1(lt,dt.store.getState());ct&&flushGlobalEffects("after",lt)}return{loop:ot,invalidate:at,advance:st}}function useInstanceHandle(tt){const et=reactExports.useRef(null);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt.current.__r3f),[tt]),et}function useStore$1(){const tt=reactExports.useContext(context$2);if(!tt)throw new Error("R3F: Hooks can only be used within the Canvas component!");return tt}function useThree(tt=nt=>nt,et){return useStore$1()(tt,et)}function useFrame(tt,et=0){const nt=useStore$1(),rt=nt.getState().internal.subscribe,it=useMutableCallback(tt);return useIsomorphicLayoutEffect$1(()=>rt(it,et,nt),[et,rt,nt]),null}const memoizedLoaders=new WeakMap;function loadingFn(tt,et){return function(nt,...rt){let it=memoizedLoaders.get(nt);return it||(it=new nt,memoizedLoaders.set(nt,it)),tt&&tt(it),Promise.all(rt.map(ot=>new Promise((at,st)=>it.load(ot,lt=>{lt.scene&&Object.assign(lt,buildGraph(lt.scene)),at(lt)},et,lt=>st(new Error(`Could not load ${ot}: ${lt==null?void 0:lt.message}`)))))).finally(()=>it.dispose==null?void 0:it.dispose())}}function useLoader(tt,et,nt,rt){const it=Array.isArray(et)?et:[et],ot=suspend$1(loadingFn(nt,rt),[tt,...it],{equal:is$1.equ});return Array.isArray(et)?ot:ot[0]}useLoader.preload=function(tt,et,nt){const rt=Array.isArray(et)?et:[et];return preload(loadingFn(nt),[tt,...rt])};useLoader.clear=function(tt,et){const nt=Array.isArray(et)?et:[et];return clear([tt,...nt])};const roots=new Map,{invalidate,advance}=createLoop(roots),{reconciler,applyProps}=createRenderer(roots,getEventPriority),shallowLoose={objects:"shallow",strict:!1},createRendererInstance=(tt,et)=>{const nt=typeof tt=="function"?tt(et):tt;return isRenderer(nt)?nt:new WebGLRenderer({powerPreference:"high-performance",canvas:et,antialias:!0,alpha:!0,...tt})};function computeInitialSize(tt,et){const nt=typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement;if(et){const{width:rt,height:it,top:ot,left:at,updateStyle:st=nt}=et;return{width:rt,height:it,top:ot,left:at,updateStyle:st}}else if(typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement&&tt.parentElement){const{width:rt,height:it,top:ot,left:at}=tt.parentElement.getBoundingClientRect();return{width:rt,height:it,top:ot,left:at,updateStyle:nt}}else if(typeof OffscreenCanvas<"u"&&tt instanceof OffscreenCanvas)return{width:tt.width,height:tt.height,top:0,left:0,updateStyle:nt};return{width:0,height:0,top:0,left:0}}function createRoot(tt){const et=roots.get(tt),nt=et==null?void 0:et.fiber,rt=et==null?void 0:et.store;et&&console.warn("R3F.createRoot should only be called once!");const it=typeof reportError=="function"?reportError:console.error,ot=rt||createStore$1(invalidate,advance),at=nt||reconciler.createContainer(ot,constantsExports.ConcurrentRoot,null,!1,null,"",it,null);et||roots.set(tt,{fiber:at,store:ot});let st,lt=!1,ct;return{configure(ut={}){let{gl:ht,size:dt,scene:pt,events:mt,onCreated:gt,shadows:yt=!1,linear:bt=!1,flat:wt=!1,legacy:xt=!1,orthographic:kt=!1,frameloop:St="always",dpr:Tt=[1,2],performance:At,raycaster:Et,camera:Ct,onPointerMissed:Lt}=ut,jt=ot.getState(),Rt=jt.gl;jt.gl||jt.set({gl:Rt=createRendererInstance(ht,tt)});let $t=jt.raycaster;$t||jt.set({raycaster:$t=new Raycaster});const{params:vt,...It}=Et||{};if(is$1.equ(It,$t,shallowLoose)||applyProps($t,{...It}),is$1.equ(vt,$t.params,shallowLoose)||applyProps($t,{params:{...$t.params,...vt}}),!jt.camera||jt.camera===ct&&!is$1.equ(ct,Ct,shallowLoose)){ct=Ct;const Pt=Ct instanceof Camera,Ht=Pt?Ct:kt?new OrthographicCamera(0,0,0,0,.1,1e3):new PerspectiveCamera(75,0,.1,1e3);Pt||(Ht.position.z=5,Ct&&applyProps(Ht,Ct),!jt.camera&&!(Ct!=null&&Ct.rotation)&&Ht.lookAt(0,0,0)),jt.set({camera:Ht}),$t.camera=Ht}if(!jt.scene){let Pt;pt instanceof Scene?Pt=pt:(Pt=new Scene,pt&&applyProps(Pt,pt)),jt.set({scene:prepare$1(Pt)})}if(!jt.xr){var Ot;const Pt=(an,Yt)=>{const nn=ot.getState();nn.frameloop!=="never"&&advance(an,!0,nn,Yt)},Ht=()=>{const an=ot.getState();an.gl.xr.enabled=an.gl.xr.isPresenting,an.gl.xr.setAnimationLoop(an.gl.xr.isPresenting?Pt:null),an.gl.xr.isPresenting||invalidate(an)},Qt={connect(){const an=ot.getState().gl;an.xr.addEventListener("sessionstart",Ht),an.xr.addEventListener("sessionend",Ht)},disconnect(){const an=ot.getState().gl;an.xr.removeEventListener("sessionstart",Ht),an.xr.removeEventListener("sessionend",Ht)}};typeof((Ot=Rt.xr)==null?void 0:Ot.addEventListener)=="function"&&Qt.connect(),jt.set({xr:Qt})}if(Rt.shadowMap){const Pt=Rt.shadowMap.enabled,Ht=Rt.shadowMap.type;if(Rt.shadowMap.enabled=!!yt,is$1.boo(yt))Rt.shadowMap.type=PCFSoftShadowMap;else if(is$1.str(yt)){var Wt;const Qt={basic:BasicShadowMap,percentage:PCFShadowMap,soft:PCFSoftShadowMap,variance:VSMShadowMap};Rt.shadowMap.type=(Wt=Qt[yt])!=null?Wt:PCFSoftShadowMap}else is$1.obj(yt)&&Object.assign(Rt.shadowMap,yt);(Pt!==Rt.shadowMap.enabled||Ht!==Rt.shadowMap.type)&&(Rt.shadowMap.needsUpdate=!0)}const zt=getColorManagement();zt&&("enabled"in zt?zt.enabled=!xt:"legacyMode"in zt&&(zt.legacyMode=xt)),applyProps(Rt,{outputEncoding:bt?3e3:3001,toneMapping:wt?NoToneMapping:ACESFilmicToneMapping}),jt.legacy!==xt&&jt.set(()=>({legacy:xt})),jt.linear!==bt&&jt.set(()=>({linear:bt})),jt.flat!==wt&&jt.set(()=>({flat:wt})),ht&&!is$1.fun(ht)&&!isRenderer(ht)&&!is$1.equ(ht,Rt,shallowLoose)&&applyProps(Rt,ht),mt&&!jt.events.handlers&&jt.set({events:mt(ot)});const Ut=computeInitialSize(tt,dt);return is$1.equ(Ut,jt.size,shallowLoose)||jt.setSize(Ut.width,Ut.height,Ut.updateStyle,Ut.top,Ut.left),Tt&&jt.viewport.dpr!==calculateDpr(Tt)&&jt.setDpr(Tt),jt.frameloop!==St&&jt.setFrameloop(St),jt.onPointerMissed||jt.set({onPointerMissed:Lt}),At&&!is$1.equ(At,jt.performance,shallowLoose)&&jt.set(Pt=>({performance:{...Pt.performance,...At}})),st=gt,lt=!0,this},render(ut){return lt||this.configure(),reconciler.updateContainer(reactExports.createElement(Provider$2,{store:ot,children:ut,onCreated:st,rootElement:tt}),at,null,()=>{}),ot},unmount(){unmountComponentAtNode(tt)}}}function Provider$2({store:tt,children:et,onCreated:nt,rootElement:rt}){return useIsomorphicLayoutEffect$1(()=>{const it=tt.getState();it.set(ot=>({internal:{...ot.internal,active:!0}})),nt&&nt(it),tt.getState().events.connected||it.events.connect==null||it.events.connect(rt)},[]),reactExports.createElement(context$2.Provider,{value:tt},et)}function unmountComponentAtNode(tt,et){const nt=roots.get(tt),rt=nt==null?void 0:nt.fiber;if(rt){const it=nt==null?void 0:nt.store.getState();it&&(it.internal.active=!1),reconciler.updateContainer(null,rt,null,()=>{it&&setTimeout(()=>{try{var ot,at,st,lt;it.events.disconnect==null||it.events.disconnect(),(ot=it.gl)==null||(at=ot.renderLists)==null||at.dispose==null||at.dispose(),(st=it.gl)==null||st.forceContextLoss==null||st.forceContextLoss(),(lt=it.gl)!=null&<.xr&&it.xr.disconnect(),dispose(it),roots.delete(tt),et&&et(tt)}catch{}},500)})}}reconciler.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:reactExports.version});function debounce$5(tt,et,nt){var rt,it,ot,at,st;et==null&&(et=100);function lt(){var ut=Date.now()-at;ut=0?rt=setTimeout(lt,et-ut):(rt=null,nt||(st=tt.apply(ot,it),ot=it=null))}var ct=function(){ot=this,it=arguments,at=Date.now();var ut=nt&&!rt;return rt||(rt=setTimeout(lt,et)),ut&&(st=tt.apply(ot,it),ot=it=null),st};return ct.clear=function(){rt&&(clearTimeout(rt),rt=null)},ct.flush=function(){rt&&(st=tt.apply(ot,it),ot=it=null,clearTimeout(rt),rt=null)},ct}debounce$5.debounce=debounce$5;var debounce_1$1=debounce$5;const createDebounce=getDefaultExportFromCjs(debounce_1$1);function useMeasure(tt){let{debounce:et,scroll:nt,polyfill:rt,offsetSize:it}=tt===void 0?{debounce:0,scroll:!1,offsetSize:!1}:tt;const ot=rt||(typeof window>"u"?class{}:window.ResizeObserver);if(!ot)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[at,st]=reactExports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),lt=reactExports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:at}),ct=et?typeof et=="number"?et:et.scroll:null,ut=et?typeof et=="number"?et:et.resize:null,ht=reactExports.useRef(!1);reactExports.useEffect(()=>(ht.current=!0,()=>void(ht.current=!1)));const[dt,pt,mt]=reactExports.useMemo(()=>{const wt=()=>{if(!lt.current.element)return;const{left:xt,top:kt,width:St,height:Tt,bottom:At,right:Et,x:Ct,y:Lt}=lt.current.element.getBoundingClientRect(),jt={left:xt,top:kt,width:St,height:Tt,bottom:At,right:Et,x:Ct,y:Lt};lt.current.element instanceof HTMLElement&&it&&(jt.height=lt.current.element.offsetHeight,jt.width=lt.current.element.offsetWidth),Object.freeze(jt),ht.current&&!areBoundsEqual(lt.current.lastBounds,jt)&&st(lt.current.lastBounds=jt)};return[wt,ut?createDebounce(wt,ut):wt,ct?createDebounce(wt,ct):wt]},[st,it,ct,ut]);function gt(){lt.current.scrollContainers&&(lt.current.scrollContainers.forEach(wt=>wt.removeEventListener("scroll",mt,!0)),lt.current.scrollContainers=null),lt.current.resizeObserver&&(lt.current.resizeObserver.disconnect(),lt.current.resizeObserver=null)}function yt(){lt.current.element&&(lt.current.resizeObserver=new ot(mt),lt.current.resizeObserver.observe(lt.current.element),nt&<.current.scrollContainers&<.current.scrollContainers.forEach(wt=>wt.addEventListener("scroll",mt,{capture:!0,passive:!0})))}const bt=wt=>{!wt||wt===lt.current.element||(gt(),lt.current.element=wt,lt.current.scrollContainers=findScrollContainers(wt),yt())};return useOnWindowScroll(mt,!!nt),useOnWindowResize(pt),reactExports.useEffect(()=>{gt(),yt()},[nt,mt,pt]),reactExports.useEffect(()=>gt,[]),[bt,at,dt]}function useOnWindowResize(tt){reactExports.useEffect(()=>{const et=tt;return window.addEventListener("resize",et),()=>void window.removeEventListener("resize",et)},[tt])}function useOnWindowScroll(tt,et){reactExports.useEffect(()=>{if(et){const nt=tt;return window.addEventListener("scroll",nt,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",nt,!0)}},[tt,et])}function findScrollContainers(tt){const et=[];if(!tt||tt===document.body)return et;const{overflow:nt,overflowX:rt,overflowY:it}=window.getComputedStyle(tt);return[nt,rt,it].some(ot=>ot==="auto"||ot==="scroll")&&et.push(tt),[...et,...findScrollContainers(tt.parentElement)]}const keys$4=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(tt,et)=>keys$4.every(nt=>tt[nt]===et[nt]);var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(tt,et,nt)=>et in tt?__defProp(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt,__spreadValues=(tt,et)=>{for(var nt in et||(et={}))__hasOwnProp.call(et,nt)&&__defNormalProp(tt,nt,et[nt]);if(__getOwnPropSymbols)for(var nt of __getOwnPropSymbols(et))__propIsEnum.call(et,nt)&&__defNormalProp(tt,nt,et[nt]);return tt},__spreadProps=(tt,et)=>__defProps(tt,__getOwnPropDescs(et));function traverseFiber(tt,et,nt){if(!tt)return;if(nt(tt)===!0)return tt;let rt=et?tt.return:tt.child;for(;rt;){const it=traverseFiber(rt,et,nt);if(it)return it;rt=et?null:rt.sibling}}function wrapContext(tt){try{return Object.defineProperties(tt,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return tt}}const FiberContext=wrapContext(reactExports.createContext(null));class FiberProvider extends reactExports.Component{render(){return reactExports.createElement(FiberContext.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner,ReactCurrentDispatcher}=reactExports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function useFiber(){const tt=reactExports.useContext(FiberContext);if(tt===null)throw new Error("its-fine: useFiber must be called within a !");const et=reactExports.useId();return reactExports.useMemo(()=>{for(const rt of[ReactCurrentOwner==null?void 0:ReactCurrentOwner.current,tt,tt==null?void 0:tt.alternate]){if(!rt)continue;const it=traverseFiber(rt,!1,ot=>{let at=ot.memoizedState;for(;at;){if(at.memoizedState===et)return!0;at=at.next}});if(it)return it}},[tt,et])}function useContextMap(){var tt,et;const nt=useFiber(),[rt]=reactExports.useState(()=>new Map);rt.clear();let it=nt;for(;it;){const ot=(tt=it.type)==null?void 0:tt._context;ot&&ot!==FiberContext&&!rt.has(ot)&&rt.set(ot,(et=ReactCurrentDispatcher==null?void 0:ReactCurrentDispatcher.current)==null?void 0:et.readContext(wrapContext(ot))),it=it.return}return rt}function useContextBridge(){const tt=useContextMap();return reactExports.useMemo(()=>Array.from(tt.keys()).reduce((et,nt)=>rt=>reactExports.createElement(et,null,reactExports.createElement(nt.Provider,__spreadProps(__spreadValues({},rt),{value:tt.get(nt)}))),et=>reactExports.createElement(FiberProvider,__spreadValues({},et))),[tt])}const DOM_EVENTS={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function createPointerEvents(tt){const{handlePointer:et}=createEvents(tt);return{priority:1,enabled:!0,compute(nt,rt,it){rt.pointer.set(nt.offsetX/rt.size.width*2-1,-(nt.offsetY/rt.size.height)*2+1),rt.raycaster.setFromCamera(rt.pointer,rt.camera)},connected:void 0,handlers:Object.keys(DOM_EVENTS).reduce((nt,rt)=>({...nt,[rt]:et(rt)}),{}),update:()=>{var nt;const{events:rt,internal:it}=tt.getState();(nt=it.lastEvent)!=null&&nt.current&&rt.handlers&&rt.handlers.onPointerMove(it.lastEvent.current)},connect:nt=>{var rt;const{set:it,events:ot}=tt.getState();ot.disconnect==null||ot.disconnect(),it(at=>({events:{...at.events,connected:nt}})),Object.entries((rt=ot.handlers)!=null?rt:[]).forEach(([at,st])=>{const[lt,ct]=DOM_EVENTS[at];nt.addEventListener(lt,st,{passive:ct})})},disconnect:()=>{const{set:nt,events:rt}=tt.getState();if(rt.connected){var it;Object.entries((it=rt.handlers)!=null?it:[]).forEach(([ot,at])=>{if(rt&&rt.connected instanceof HTMLElement){const[st]=DOM_EVENTS[ot];rt.connected.removeEventListener(st,at)}}),nt(ot=>({events:{...ot.events,connected:void 0}}))}}}}const CanvasImpl=reactExports.forwardRef(function({children:et,fallback:nt,resize:rt,style:it,gl:ot,events:at=createPointerEvents,eventSource:st,eventPrefix:lt,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:yt,raycaster:bt,camera:wt,scene:xt,onPointerMissed:kt,onCreated:St,...Tt},At){reactExports.useMemo(()=>extend$1(THREE$1),[]);const Et=useContextBridge(),[Ct,Lt]=useMeasure({scroll:!0,debounce:{scroll:50,resize:0},...rt}),jt=reactExports.useRef(null),Rt=reactExports.useRef(null);reactExports.useImperativeHandle(At,()=>jt.current);const $t=useMutableCallback(kt),[vt,It]=reactExports.useState(!1),[Ot,Wt]=reactExports.useState(!1);if(vt)throw vt;if(Ot)throw Ot;const zt=reactExports.useRef(null);useIsomorphicLayoutEffect$1(()=>{const Nt=jt.current;Lt.width>0&&Lt.height>0&&Nt&&(zt.current||(zt.current=createRoot(Nt)),zt.current.configure({gl:ot,events:at,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:yt,raycaster:bt,camera:wt,scene:xt,size:Lt,onPointerMissed:(...Ut)=>$t.current==null?void 0:$t.current(...Ut),onCreated:Ut=>{Ut.events.connect==null||Ut.events.connect(st?isRef(st)?st.current:st:Rt.current),lt&&Ut.setEvents({compute:(Pt,Ht)=>{const Qt=Pt[lt+"X"],an=Pt[lt+"Y"];Ht.pointer.set(Qt/Ht.size.width*2-1,-(an/Ht.size.height)*2+1),Ht.raycaster.setFromCamera(Ht.pointer,Ht.camera)}}),St==null||St(Ut)}}),zt.current.render(reactExports.createElement(Et,null,reactExports.createElement(ErrorBoundary,{set:Wt},reactExports.createElement(reactExports.Suspense,{fallback:reactExports.createElement(Block,{set:It})},et)))))}),reactExports.useEffect(()=>{const Nt=jt.current;if(Nt)return()=>unmountComponentAtNode(Nt)},[]);const Ft=st?"none":"auto";return reactExports.createElement("div",_extends$u({ref:Rt,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Ft,...it}},Tt),reactExports.createElement("div",{ref:Ct,style:{width:"100%",height:"100%"}},reactExports.createElement("canvas",{ref:jt,style:{display:"block"}},nt)))}),Canvas$1=reactExports.forwardRef(function(et,nt){return reactExports.createElement(FiberProvider,null,reactExports.createElement(CanvasImpl,_extends$u({},et,{ref:nt})))}),v1=new Vector3,v2=new Vector3,v3=new Vector3;function defaultCalculatePosition(tt,et,nt){const rt=v1.setFromMatrixPosition(tt.matrixWorld);rt.project(et);const it=nt.width/2,ot=nt.height/2;return[rt.x*it+it,-(rt.y*ot)+ot]}function isObjectBehindCamera(tt,et){const nt=v1.setFromMatrixPosition(tt.matrixWorld),rt=v2.setFromMatrixPosition(et.matrixWorld),it=nt.sub(rt),ot=et.getWorldDirection(v3);return it.angleTo(ot)>Math.PI/2}function isObjectVisible(tt,et,nt,rt){const it=v1.setFromMatrixPosition(tt.matrixWorld),ot=it.clone();ot.project(et),nt.setFromCamera(ot,et);const at=nt.intersectObjects(rt,!0);if(at.length){const st=at[0].distance;return it.distanceTo(nt.ray.origin)Math.abs(tt)<1e-10?0:tt;function getCSSMatrix(tt,et,nt=""){let rt="matrix3d(";for(let it=0;it!==16;it++)rt+=epsilon$1(et[it]*tt.elements[it])+(it!==15?",":")");return nt+rt}const getCameraCSSMatrix=(tt=>et=>getCSSMatrix(et,tt))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),getObjectCSSMatrix=(tt=>(et,nt)=>getCSSMatrix(et,tt(nt),"translate(-50%,-50%)"))(tt=>[1/tt,1/tt,1/tt,1,-1/tt,-1/tt,-1/tt,-1,1/tt,1/tt,1/tt,1,1,1,1,1]);function isRefObject(tt){return tt&&typeof tt=="object"&&"current"in tt}const Html$1=reactExports.forwardRef(({children:tt,eps:et=.001,style:nt,className:rt,prepend:it,center:ot,fullscreen:at,portal:st,distanceFactor:lt,sprite:ct=!1,transform:ut=!1,occlude:ht,onOcclude:dt,castShadow:pt,receiveShadow:mt,material:gt,geometry:yt,zIndexRange:bt=[16777271,0],calculatePosition:wt=defaultCalculatePosition,as:xt="div",wrapperClass:kt,pointerEvents:St="auto",...Tt},At)=>{const{gl:Et,camera:Ct,scene:Lt,size:jt,raycaster:Rt,events:$t,viewport:vt}=useThree(),[It]=reactExports.useState(()=>document.createElement(xt)),Ot=reactExports.useRef(),Wt=reactExports.useRef(null),zt=reactExports.useRef(0),Ft=reactExports.useRef([0,0]),Nt=reactExports.useRef(null),Ut=reactExports.useRef(null),Pt=(st==null?void 0:st.current)||$t.connected||Et.domElement.parentNode,Ht=reactExports.useRef(null),Qt=reactExports.useRef(!1),an=reactExports.useMemo(()=>ht&&ht!=="blending"||Array.isArray(ht)&&ht.length&&isRefObject(ht[0]),[ht]);reactExports.useLayoutEffect(()=>{const wn=Et.domElement;ht&&ht==="blending"?(wn.style.zIndex=`${Math.floor(bt[0]/2)}`,wn.style.position="absolute",wn.style.pointerEvents="none"):(wn.style.zIndex=null,wn.style.position=null,wn.style.pointerEvents=null)},[ht]),reactExports.useLayoutEffect(()=>{if(Wt.current){const wn=Ot.current=createRoot$1(It);if(Lt.updateMatrixWorld(),ut)It.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const rn=wt(Wt.current,Ct,jt);It.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${rn[0]}px,${rn[1]}px,0);transform-origin:0 0;`}return Pt&&(it?Pt.prepend(It):Pt.appendChild(It)),()=>{Pt&&Pt.removeChild(It),wn.unmount()}}},[Pt,ut]),reactExports.useLayoutEffect(()=>{kt&&(It.className=kt)},[kt]);const Yt=reactExports.useMemo(()=>ut?{position:"absolute",top:0,left:0,width:jt.width,height:jt.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:ot?"translate3d(-50%,-50%,0)":"none",...at&&{top:-jt.height/2,left:-jt.width/2,width:jt.width,height:jt.height},...nt},[nt,ot,at,jt,ut]),nn=reactExports.useMemo(()=>({position:"absolute",pointerEvents:St}),[St]);reactExports.useLayoutEffect(()=>{if(Qt.current=!1,ut){var wn;(wn=Ot.current)==null||wn.render(reactExports.createElement("div",{ref:Nt,style:Yt},reactExports.createElement("div",{ref:Ut,style:nn},reactExports.createElement("div",{ref:At,className:rt,style:nt,children:tt}))))}else{var rn;(rn=Ot.current)==null||rn.render(reactExports.createElement("div",{ref:At,style:Yt,className:rt,children:tt}))}});const tn=reactExports.useRef(!0);useFrame(wn=>{if(Wt.current){Ct.updateMatrixWorld(),Wt.current.updateWorldMatrix(!0,!1);const rn=ut?Ft.current:wt(Wt.current,Ct,jt);if(ut||Math.abs(zt.current-Ct.zoom)>et||Math.abs(Ft.current[0]-rn[0])>et||Math.abs(Ft.current[1]-rn[1])>et){const Jt=isObjectBehindCamera(Wt.current,Ct);let vn=!1;an&&(ht!=="blending"?vn=[Lt]:Array.isArray(ht)&&(vn=ht.map(En=>En.current)));const Cn=tn.current;if(vn){const En=isObjectVisible(Wt.current,Ct,Rt,vn);tn.current=En&&!Jt}else tn.current=!Jt;Cn!==tn.current&&(dt?dt(!tn.current):It.style.display=tn.current?"block":"none");const $n=Math.floor(bt[0]/2),Nn=ht?an?[bt[0],$n]:[$n-1,0]:bt;if(It.style.zIndex=`${objectZIndex(Wt.current,Ct,Nn)}`,ut){const[En,sn]=[jt.width/2,jt.height/2],pn=Ct.projectionMatrix.elements[5]*sn,{isOrthographicCamera:Tn,top:In,left:yn,bottom:hn,right:fn}=Ct,xn=getCameraCSSMatrix(Ct.matrixWorldInverse),jn=Tn?`scale(${pn})translate(${epsilon$1(-(fn+yn)/2)}px,${epsilon$1((In+hn)/2)}px)`:`translateZ(${pn}px)`;let cn=Wt.current.matrixWorld;ct&&(cn=Ct.matrixWorldInverse.clone().transpose().copyPosition(cn).scale(Wt.current.scale),cn.elements[3]=cn.elements[7]=cn.elements[11]=0,cn.elements[15]=1),It.style.width=jt.width+"px",It.style.height=jt.height+"px",It.style.perspective=Tn?"":`${pn}px`,Nt.current&&Ut.current&&(Nt.current.style.transform=`${jn}${xn}translate(${En}px,${sn}px)`,Ut.current.style.transform=getObjectCSSMatrix(cn,1/((lt||10)/400)))}else{const En=lt===void 0?1:objectScale(Wt.current,Ct)*lt;It.style.transform=`translate3d(${rn[0]}px,${rn[1]}px,0) scale(${En})`}Ft.current=rn,zt.current=Ct.zoom}}if(!an&&Ht.current&&!Qt.current)if(ut){if(Nt.current){const rn=Nt.current.children[0];if(rn!=null&&rn.clientWidth&&rn!=null&&rn.clientHeight){const{isOrthographicCamera:Jt}=Ct;if(Jt||yt)Tt.scale&&(Array.isArray(Tt.scale)?Tt.scale instanceof Vector3?Ht.current.scale.copy(Tt.scale.clone().divideScalar(1)):Ht.current.scale.set(1/Tt.scale[0],1/Tt.scale[1],1/Tt.scale[2]):Ht.current.scale.setScalar(1/Tt.scale));else{const vn=(lt||10)/400,Cn=rn.clientWidth*vn,$n=rn.clientHeight*vn;Ht.current.scale.set(Cn,$n,1)}Qt.current=!0}}}else{const rn=It.children[0];if(rn!=null&&rn.clientWidth&&rn!=null&&rn.clientHeight){const Jt=1/vt.factor,vn=rn.clientWidth*Jt,Cn=rn.clientHeight*Jt;Ht.current.scale.set(vn,Cn,1),Qt.current=!0}Ht.current.lookAt(wn.camera.position)}});const dn=reactExports.useMemo(()=>({vertexShader:ut?void 0:` + `)+Bt.join(" > ")}return null},nt.getPublicRootInstance=function(Bt){if(Bt=Bt.current,!Bt.child)return null;switch(Bt.child.tag){case 5:return Ot(Bt.child.stateNode);default:return Bt.child.stateNode}},nt.injectIntoDevTools=function(Bt){if(Bt={bundleType:Bt.bundleType,version:Bt.version,rendererPackageName:Bt.rendererPackageName,rendererConfig:Bt.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:st.ReactCurrentDispatcher,findHostInstanceByFiber:G0,findFiberByHostInstance:Bt.findFiberByHostInstance||S0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")Bt=!1;else{var Dt=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(Dt.isDisabled||!Dt.supportsFiber)Bt=!0;else{try{Wu=Dt.inject(Bt),Ks=Dt}catch{}Bt=!!Dt.checkDCE}}return Bt},nt.isAlreadyRendering=function(){return!1},nt.observeVisibleRects=function(Bt,Dt,Gt,en){if(!Tn)throw Error(at(363));Bt=my(Bt,Dt);var mn=cn(Bt,Gt,en).disconnect;return{disconnect:function(){mn()}}},nt.registerMutableSourceForHydration=function(Bt,Dt){var Gt=Dt._getVersion;Gt=Gt(Dt._source),Bt.mutableSourceEagerHydrationData==null?Bt.mutableSourceEagerHydrationData=[Dt,Gt]:Bt.mutableSourceEagerHydrationData.push(Dt,Gt)},nt.runWithPriority=function(Bt,Dt){var Gt=No;try{return No=Bt,Dt()}finally{No=Gt}},nt.shouldError=function(){return null},nt.shouldSuspend=function(){return!1},nt.updateContainer=function(Bt,Dt,Gt,en){var mn=Dt.current,An=Bs(),Hn=lu(mn);return Gt=um(Gt),Dt.context===null?Dt.context=Gt:Dt.pendingContext=Gt,Dt=Cs(An,Hn),Dt.payload={element:Bt},en=en===void 0?null:en,en!==null&&(Dt.callback=en),Nl(mn,Dt),Bt=Cl(mn,Hn,An),Bt!==null&&op(Bt,mn,Hn),Hn},nt};reactReconciler.exports=reactReconciler_production_min;var reactReconcilerExports=reactReconciler.exports;const Reconciler=getDefaultExportFromCjs(reactReconcilerExports),isPromise=tt=>typeof tt=="object"&&typeof tt.then=="function",globalCache$1=[];function shallowEqualArrays$1(tt,et,nt=(rt,it)=>rt===it){if(tt===et)return!0;if(!tt||!et)return!1;const rt=tt.length;if(et.length!==rt)return!1;for(let it=0;it0&&(ot.timeout&&clearTimeout(ot.timeout),ot.timeout=setTimeout(ot.remove,rt.lifespan)),ot.response;if(!nt)throw ot.promise}const it={keys:et,equal:rt.equal,remove:()=>{const ot=globalCache$1.indexOf(it);ot!==-1&&globalCache$1.splice(ot,1)},promise:(isPromise(tt)?tt:tt(...et)).then(ot=>{it.response=ot,rt.lifespan&&rt.lifespan>0&&(it.timeout=setTimeout(it.remove,rt.lifespan))}).catch(ot=>it.error=ot)};if(globalCache$1.push(it),!nt)throw it.promise}const suspend$1=(tt,et,nt)=>query$1(tt,et,!1,nt),preload=(tt,et,nt)=>void query$1(tt,et,!0,nt),clear=tt=>{if(tt===void 0||tt.length===0)globalCache$1.splice(0,globalCache$1.length);else{const et=globalCache$1.find(nt=>shallowEqualArrays$1(tt,nt.keys,nt.equal));et&&et.remove()}},catalogue={},extend$1=tt=>void Object.assign(catalogue,tt);function createRenderer(tt,et){function nt(ut,{args:ht=[],attach:dt,...pt},mt){let gt=`${ut[0].toUpperCase()}${ut.slice(1)}`,yt;if(ut==="primitive"){if(pt.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const bt=pt.object;yt=prepare$1(bt,{type:ut,root:mt,attach:dt,primitive:!0})}else{const bt=catalogue[gt];if(!bt)throw new Error(`R3F: ${gt} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(ht))throw new Error("R3F: The args prop must be an array!");yt=prepare$1(new bt(...ht),{type:ut,root:mt,attach:dt,memoizedProps:{args:ht}})}return yt.__r3f.attach===void 0&&(yt instanceof BufferGeometry?yt.__r3f.attach="geometry":yt instanceof Material&&(yt.__r3f.attach="material")),gt!=="inject"&&applyProps$1(yt,pt),yt}function rt(ut,ht){let dt=!1;if(ht){var pt,mt;(pt=ht.__r3f)!=null&&pt.attach?attach(ut,ht,ht.__r3f.attach):ht.isObject3D&&ut.isObject3D&&(ut.add(ht),dt=!0),dt||(mt=ut.__r3f)==null||mt.objects.push(ht),ht.__r3f||prepare$1(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function it(ut,ht,dt){let pt=!1;if(ht){var mt,gt;if((mt=ht.__r3f)!=null&&mt.attach)attach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){ht.parent=ut,ht.dispatchEvent({type:"added"});const yt=ut.children.filter(wt=>wt!==ht),bt=yt.indexOf(dt);ut.children=[...yt.slice(0,bt),ht,...yt.slice(bt)],pt=!0}pt||(gt=ut.__r3f)==null||gt.objects.push(ht),ht.__r3f||prepare$1(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function ot(ut,ht,dt=!1){ut&&[...ut].forEach(pt=>at(ht,pt,dt))}function at(ut,ht,dt){if(ht){var pt,mt,gt;if(ht.__r3f&&(ht.__r3f.parent=null),(pt=ut.__r3f)!=null&&pt.objects&&(ut.__r3f.objects=ut.__r3f.objects.filter(kt=>kt!==ht)),(mt=ht.__r3f)!=null&&mt.attach)detach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){var yt;ut.remove(ht),(yt=ht.__r3f)!=null&&yt.root&&removeInteractivity(ht.__r3f.root,ht)}const wt=(gt=ht.__r3f)==null?void 0:gt.primitive,xt=dt===void 0?ht.dispose!==null&&!wt:dt;if(!wt){var bt;ot((bt=ht.__r3f)==null?void 0:bt.objects,ht,xt),ot(ht.children,ht,xt)}delete ht.__r3f,xt&&ht.dispose&&ht.type!=="Scene"&&schedulerExports.unstable_scheduleCallback(schedulerExports.unstable_IdlePriority,()=>{try{ht.dispose()}catch{}}),invalidateInstance(ut)}}function st(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)==null?void 0:mt.parent;if(!gt)return;const yt=nt(ht,dt,ut.__r3f.root);if(ut.children){for(const bt of ut.children)bt.__r3f&&rt(yt,bt);ut.children=ut.children.filter(bt=>!bt.__r3f)}ut.__r3f.objects.forEach(bt=>rt(yt,bt)),ut.__r3f.objects=[],ut.__r3f.autoRemovedBeforeAppend||at(gt,ut),yt.parent&&(yt.__r3f.autoRemovedBeforeAppend=!0),rt(gt,yt),yt.raycast&&yt.__r3f.eventCount&&yt.__r3f.root.getState().internal.interaction.push(yt),[pt,pt.alternate].forEach(bt=>{bt!==null&&(bt.stateNode=yt,bt.ref&&(typeof bt.ref=="function"?bt.ref(yt):bt.ref.current=yt))})}const lt=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:Reconciler({createInstance:nt,removeChild:at,appendChild:rt,appendInitialChild:rt,insertBefore:it,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(ut,ht)=>{if(!ht)return;const dt=ut.getState().scene;dt.__r3f&&(dt.__r3f.root=ut,rt(dt,ht))},removeChildFromContainer:(ut,ht)=>{ht&&at(ut.getState().scene,ht)},insertInContainerBefore:(ut,ht,dt)=>{if(!ht||!dt)return;const pt=ut.getState().scene;pt.__r3f&&it(pt,ht,dt)},getRootHostContext:()=>null,getChildHostContext:ut=>ut,finalizeInitialChildren(ut){var ht;return!!((ht=ut==null?void 0:ut.__r3f)!=null?ht:{}).handlers},prepareUpdate(ut,ht,dt,pt){var mt;if(((mt=ut==null?void 0:ut.__r3f)!=null?mt:{}).primitive&&pt.object&&pt.object!==ut)return[!0];{const{args:yt=[],children:bt,...wt}=pt,{args:xt=[],children:kt,...St}=dt;if(!Array.isArray(yt))throw new Error("R3F: the args prop must be an array!");if(yt.some((At,Et)=>At!==xt[Et]))return[!0];const Tt=diffProps(ut,wt,St,!0);return Tt.changes.length?[!1,Tt]:null}},commitUpdate(ut,[ht,dt],pt,mt,gt,yt){ht?st(ut,pt,gt,yt):applyProps$1(ut,dt)},commitMount(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)!=null?mt:{};ut.raycast&>.handlers&>.eventCount&&ut.__r3f.root.getState().internal.interaction.push(ut)},getPublicInstance:ut=>ut,prepareForCommit:()=>null,preparePortalMount:ut=>prepare$1(ut.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(ut){var ht;const{attach:dt,parent:pt}=(ht=ut.__r3f)!=null?ht:{};dt&&pt&&detach(pt,ut,dt),ut.isObject3D&&(ut.visible=!1),invalidateInstance(ut)},unhideInstance(ut,ht){var dt;const{attach:pt,parent:mt}=(dt=ut.__r3f)!=null?dt:{};pt&&mt&&attach(mt,ut,pt),(ut.isObject3D&&ht.visible==null||ht.visible)&&(ut.visible=!0),invalidateInstance(ut)},createTextInstance:lt,hideTextInstance:lt,unhideTextInstance:lt,getCurrentEventPriority:()=>et?et():constantsExports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&is$1.fun(performance.now)?performance.now:is$1.fun(Date.now)?Date.now:()=>0,scheduleTimeout:is$1.fun(setTimeout)?setTimeout:void 0,cancelTimeout:is$1.fun(clearTimeout)?clearTimeout:void 0}),applyProps:applyProps$1}}var _window$document,_window$navigator;const hasColorSpace=tt=>"colorSpace"in tt||"outputColorSpace"in tt,getColorManagement=()=>{var tt;return(tt=catalogue.ColorManagement)!=null?tt:null},isOrthographicCamera$1=tt=>tt&&tt.isOrthographicCamera,isRef=tt=>tt&&tt.hasOwnProperty("current"),useIsomorphicLayoutEffect$1=typeof window<"u"&&((_window$document=window.document)!=null&&_window$document.createElement||((_window$navigator=window.navigator)==null?void 0:_window$navigator.product)==="ReactNative")?reactExports.useLayoutEffect:reactExports.useEffect;function useMutableCallback(tt){const et=reactExports.useRef(tt);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt),[tt]),et}function Block({set:tt}){return useIsomorphicLayoutEffect$1(()=>(tt(new Promise(()=>null)),()=>tt(!1)),[tt]),null}class ErrorBoundary extends reactExports.Component{constructor(...et){super(...et),this.state={error:!1}}componentDidCatch(et){this.props.set(et)}render(){return this.state.error?null:this.props.children}}ErrorBoundary.getDerivedStateFromError=()=>({error:!0});const DEFAULT="__default",DEFAULTS=new Map,isDiffSet=tt=>tt&&!!tt.memoized&&!!tt.changes;function calculateDpr(tt){var et;const nt=typeof window<"u"?(et=window.devicePixelRatio)!=null?et:2:1;return Array.isArray(tt)?Math.min(Math.max(tt[0],nt),tt[1]):tt}const getRootState=tt=>{var et;return(et=tt.__r3f)==null?void 0:et.root.getState()},is$1={obj:tt=>tt===Object(tt)&&!is$1.arr(tt)&&typeof tt!="function",fun:tt=>typeof tt=="function",str:tt=>typeof tt=="string",num:tt=>typeof tt=="number",boo:tt=>typeof tt=="boolean",und:tt=>tt===void 0,arr:tt=>Array.isArray(tt),equ(tt,et,{arrays:nt="shallow",objects:rt="reference",strict:it=!0}={}){if(typeof tt!=typeof et||!!tt!=!!et)return!1;if(is$1.str(tt)||is$1.num(tt))return tt===et;const ot=is$1.obj(tt);if(ot&&rt==="reference")return tt===et;const at=is$1.arr(tt);if(at&&nt==="reference")return tt===et;if((at||ot)&&tt===et)return!0;let st;for(st in tt)if(!(st in et))return!1;if(ot&&nt==="shallow"&&rt==="shallow"){for(st in it?et:tt)if(!is$1.equ(tt[st],et[st],{strict:it,objects:"reference"}))return!1}else for(st in it?et:tt)if(tt[st]!==et[st])return!1;if(is$1.und(st)){if(at&&tt.length===0&&et.length===0||ot&&Object.keys(tt).length===0&&Object.keys(et).length===0)return!0;if(tt!==et)return!1}return!0}};function buildGraph(tt){const et={nodes:{},materials:{}};return tt&&tt.traverse(nt=>{nt.name&&(et.nodes[nt.name]=nt),nt.material&&!et.materials[nt.material.name]&&(et.materials[nt.material.name]=nt.material)}),et}function dispose(tt){tt.dispose&&tt.type!=="Scene"&&tt.dispose();for(const et in tt)et.dispose==null||et.dispose(),delete tt[et]}function prepare$1(tt,et){const nt=tt;return nt.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...et},tt}function resolve(tt,et){let nt=tt;if(et.includes("-")){const rt=et.split("-"),it=rt.pop();return nt=rt.reduce((ot,at)=>ot[at],tt),{target:nt,key:it}}else return{target:nt,key:et}}const INDEX_REGEX=/-\d+$/;function attach(tt,et,nt){if(is$1.str(nt)){if(INDEX_REGEX.test(nt)){const ot=nt.replace(INDEX_REGEX,""),{target:at,key:st}=resolve(tt,ot);Array.isArray(at[st])||(at[st]=[])}const{target:rt,key:it}=resolve(tt,nt);et.__r3f.previousAttach=rt[it],rt[it]=et}else et.__r3f.previousAttach=nt(tt,et)}function detach(tt,et,nt){var rt,it;if(is$1.str(nt)){const{target:ot,key:at}=resolve(tt,nt),st=et.__r3f.previousAttach;st===void 0?delete ot[at]:ot[at]=st}else(rt=et.__r3f)==null||rt.previousAttach==null||rt.previousAttach(tt,et);(it=et.__r3f)==null||delete it.previousAttach}function diffProps(tt,{children:et,key:nt,ref:rt,...it},{children:ot,key:at,ref:st,...lt}={},ct=!1){var ut;const ht=(ut=tt==null?void 0:tt.__r3f)!=null?ut:{},dt=Object.entries(it),pt=[];if(ct){const gt=Object.keys(lt);for(let yt=0;yt{var bt;if((bt=tt.__r3f)!=null&&bt.primitive&>==="object"||is$1.equ(yt,lt[gt]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(gt))return pt.push([gt,yt,!0,[]]);let wt=[];gt.includes("-")&&(wt=gt.split("-")),pt.push([gt,yt,!1,wt]);for(const xt in it){const kt=it[xt];xt.startsWith(`${gt}-`)&&pt.push([xt,kt,!1,xt.split("-")])}});const mt={...it};return ht.memoizedProps&&ht.memoizedProps.args&&(mt.args=ht.memoizedProps.args),ht.memoizedProps&&ht.memoizedProps.attach&&(mt.attach=ht.memoizedProps.attach),{memoized:mt,changes:pt}}const __DEV__=typeof process<"u"&&!1;function applyProps$1(tt,et){var nt,rt,it;const ot=(nt=tt.__r3f)!=null?nt:{},at=ot.root,st=(rt=at==null||at.getState==null?void 0:at.getState())!=null?rt:{},{memoized:lt,changes:ct}=isDiffSet(et)?et:diffProps(tt,et),ut=ot.eventCount;tt.__r3f&&(tt.__r3f.memoizedProps=lt);for(let dt=0;dtxt[kt],tt),!(wt&&wt.set))){const[xt,...kt]=yt.reverse();bt=kt.reverse().reduce((St,Tt)=>St[Tt],tt),pt=xt}if(mt===DEFAULT+"remove")if(bt.constructor){let xt=DEFAULTS.get(bt.constructor);xt||(xt=new bt.constructor,DEFAULTS.set(bt.constructor,xt)),mt=xt[pt]}else mt=0;if(gt)mt?ot.handlers[pt]=mt:delete ot.handlers[pt],ot.eventCount=Object.keys(ot.handlers).length;else if(wt&&wt.set&&(wt.copy||wt instanceof Layers)){if(Array.isArray(mt))wt.fromArray?wt.fromArray(mt):wt.set(...mt);else if(wt.copy&&mt&&mt.constructor&&(__DEV__?wt.constructor.name===mt.constructor.name:wt.constructor===mt.constructor))wt.copy(mt);else if(mt!==void 0){const xt=wt instanceof Color$1;!xt&&wt.setScalar?wt.setScalar(mt):wt instanceof Layers&&mt instanceof Layers?wt.mask=mt.mask:wt.set(mt),!getColorManagement()&&!st.linear&&xt&&wt.convertSRGBToLinear()}}else if(bt[pt]=mt,bt[pt]instanceof Texture&&bt[pt].format===RGBAFormat&&bt[pt].type===UnsignedByteType){const xt=bt[pt];hasColorSpace(xt)&&hasColorSpace(st.gl)?xt.colorSpace=st.gl.outputColorSpace:xt.encoding=st.gl.outputEncoding}invalidateInstance(tt)}if(ot.parent&&st.internal&&tt.raycast&&ut!==ot.eventCount){const dt=st.internal.interaction.indexOf(tt);dt>-1&&st.internal.interaction.splice(dt,1),ot.eventCount&&st.internal.interaction.push(tt)}return!(ct.length===1&&ct[0][0]==="onUpdate")&&ct.length&&(it=tt.__r3f)!=null&&it.parent&&updateInstance(tt),tt}function invalidateInstance(tt){var et,nt;const rt=(et=tt.__r3f)==null||(nt=et.root)==null||nt.getState==null?void 0:nt.getState();rt&&rt.internal.frames===0&&rt.invalidate()}function updateInstance(tt){tt.onUpdate==null||tt.onUpdate(tt)}function updateCamera(tt,et){tt.manual||(isOrthographicCamera$1(tt)?(tt.left=et.width/-2,tt.right=et.width/2,tt.top=et.height/2,tt.bottom=et.height/-2):tt.aspect=et.width/et.height,tt.updateProjectionMatrix(),tt.updateMatrixWorld())}function makeId(tt){return(tt.eventObject||tt.object).uuid+"/"+tt.index+tt.instanceId}function getEventPriority(){var tt;const et=typeof self<"u"&&self||typeof window<"u"&&window;if(!et)return constantsExports.DefaultEventPriority;switch((tt=et.event)==null?void 0:tt.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return constantsExports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return constantsExports.ContinuousEventPriority;default:return constantsExports.DefaultEventPriority}}function releaseInternalPointerCapture(tt,et,nt,rt){const it=nt.get(et);it&&(nt.delete(et),nt.size===0&&(tt.delete(rt),it.target.releasePointerCapture(rt)))}function removeInteractivity(tt,et){const{internal:nt}=tt.getState();nt.interaction=nt.interaction.filter(rt=>rt!==et),nt.initialHits=nt.initialHits.filter(rt=>rt!==et),nt.hovered.forEach((rt,it)=>{(rt.eventObject===et||rt.object===et)&&nt.hovered.delete(it)}),nt.capturedMap.forEach((rt,it)=>{releaseInternalPointerCapture(nt.capturedMap,et,rt,it)})}function createEvents(tt){function et(lt){const{internal:ct}=tt.getState(),ut=lt.offsetX-ct.initialClick[0],ht=lt.offsetY-ct.initialClick[1];return Math.round(Math.sqrt(ut*ut+ht*ht))}function nt(lt){return lt.filter(ct=>["Move","Over","Enter","Out","Leave"].some(ut=>{var ht;return(ht=ct.__r3f)==null?void 0:ht.handlers["onPointer"+ut]}))}function rt(lt,ct){const ut=tt.getState(),ht=new Set,dt=[],pt=ct?ct(ut.internal.interaction):ut.internal.interaction;for(let bt=0;bt{const xt=getRootState(bt.object),kt=getRootState(wt.object);return!xt||!kt?bt.distance-wt.distance:kt.events.priority-xt.events.priority||bt.distance-wt.distance}).filter(bt=>{const wt=makeId(bt);return ht.has(wt)?!1:(ht.add(wt),!0)});ut.events.filter&&(gt=ut.events.filter(gt,ut));for(const bt of gt){let wt=bt.object;for(;wt;){var yt;(yt=wt.__r3f)!=null&&yt.eventCount&&dt.push({...bt,eventObject:wt}),wt=wt.parent}}if("pointerId"in lt&&ut.internal.capturedMap.has(lt.pointerId))for(let bt of ut.internal.capturedMap.get(lt.pointerId).values())ht.has(makeId(bt.intersection))||dt.push(bt.intersection);return dt}function it(lt,ct,ut,ht){const dt=tt.getState();if(lt.length){const pt={stopped:!1};for(const mt of lt){const gt=getRootState(mt.object)||dt,{raycaster:yt,pointer:bt,camera:wt,internal:xt}=gt,kt=new Vector3(bt.x,bt.y,0).unproject(wt),St=Lt=>{var jt,Rt;return(jt=(Rt=xt.capturedMap.get(Lt))==null?void 0:Rt.has(mt.eventObject))!=null?jt:!1},Tt=Lt=>{const jt={intersection:mt,target:ct.target};xt.capturedMap.has(Lt)?xt.capturedMap.get(Lt).set(mt.eventObject,jt):xt.capturedMap.set(Lt,new Map([[mt.eventObject,jt]])),ct.target.setPointerCapture(Lt)},At=Lt=>{const jt=xt.capturedMap.get(Lt);jt&&releaseInternalPointerCapture(xt.capturedMap,mt.eventObject,jt,Lt)};let Et={};for(let Lt in ct){let jt=ct[Lt];typeof jt!="function"&&(Et[Lt]=jt)}let Ct={...mt,...Et,pointer:bt,intersections:lt,stopped:pt.stopped,delta:ut,unprojectedPoint:kt,ray:yt.ray,camera:wt,stopPropagation(){const Lt="pointerId"in ct&&xt.capturedMap.get(ct.pointerId);if((!Lt||Lt.has(mt.eventObject))&&(Ct.stopped=pt.stopped=!0,xt.hovered.size&&Array.from(xt.hovered.values()).find(jt=>jt.eventObject===mt.eventObject))){const jt=lt.slice(0,lt.indexOf(mt));ot([...jt,mt])}},target:{hasPointerCapture:St,setPointerCapture:Tt,releasePointerCapture:At},currentTarget:{hasPointerCapture:St,setPointerCapture:Tt,releasePointerCapture:At},nativeEvent:ct};if(ht(Ct),pt.stopped===!0)break}}return lt}function ot(lt){const{internal:ct}=tt.getState();for(const ut of ct.hovered.values())if(!lt.length||!lt.find(ht=>ht.object===ut.object&&ht.index===ut.index&&ht.instanceId===ut.instanceId)){const dt=ut.eventObject.__r3f,pt=dt==null?void 0:dt.handlers;if(ct.hovered.delete(makeId(ut)),dt!=null&&dt.eventCount){const mt={...ut,intersections:lt};pt.onPointerOut==null||pt.onPointerOut(mt),pt.onPointerLeave==null||pt.onPointerLeave(mt)}}}function at(lt,ct){for(let ut=0;utot([]);case"onLostPointerCapture":return ct=>{const{internal:ut}=tt.getState();"pointerId"in ct&&ut.capturedMap.has(ct.pointerId)&&requestAnimationFrame(()=>{ut.capturedMap.has(ct.pointerId)&&(ut.capturedMap.delete(ct.pointerId),ot([]))})}}return function(ut){const{onPointerMissed:ht,internal:dt}=tt.getState();dt.lastEvent.current=ut;const pt=lt==="onPointerMove",mt=lt==="onClick"||lt==="onContextMenu"||lt==="onDoubleClick",yt=rt(ut,pt?nt:void 0),bt=mt?et(ut):0;lt==="onPointerDown"&&(dt.initialClick=[ut.offsetX,ut.offsetY],dt.initialHits=yt.map(xt=>xt.eventObject)),mt&&!yt.length&&bt<=2&&(at(ut,dt.interaction),ht&&ht(ut)),pt&&ot(yt);function wt(xt){const kt=xt.eventObject,St=kt.__r3f,Tt=St==null?void 0:St.handlers;if(St!=null&&St.eventCount)if(pt){if(Tt.onPointerOver||Tt.onPointerEnter||Tt.onPointerOut||Tt.onPointerLeave){const At=makeId(xt),Et=dt.hovered.get(At);Et?Et.stopped&&xt.stopPropagation():(dt.hovered.set(At,xt),Tt.onPointerOver==null||Tt.onPointerOver(xt),Tt.onPointerEnter==null||Tt.onPointerEnter(xt))}Tt.onPointerMove==null||Tt.onPointerMove(xt)}else{const At=Tt[lt];At?(!mt||dt.initialHits.includes(kt))&&(at(ut,dt.interaction.filter(Et=>!dt.initialHits.includes(Et))),At(xt)):mt&&dt.initialHits.includes(kt)&&at(ut,dt.interaction.filter(Et=>!dt.initialHits.includes(Et)))}}it(yt,ut,bt,wt)}}return{handlePointer:st}}const isRenderer=tt=>!!(tt!=null&&tt.render),context$2=reactExports.createContext(null),createStore$1=(tt,et)=>{const nt=create$2((st,lt)=>{const ct=new Vector3,ut=new Vector3,ht=new Vector3;function dt(bt=lt().camera,wt=ut,xt=lt().size){const{width:kt,height:St,top:Tt,left:At}=xt,Et=kt/St;wt instanceof Vector3?ht.copy(wt):ht.set(...wt);const Ct=bt.getWorldPosition(ct).distanceTo(ht);if(isOrthographicCamera$1(bt))return{width:kt/bt.zoom,height:St/bt.zoom,top:Tt,left:At,factor:1,distance:Ct,aspect:Et};{const Lt=bt.fov*Math.PI/180,jt=2*Math.tan(Lt/2)*Ct,Rt=jt*(kt/St);return{width:Rt,height:jt,top:Tt,left:At,factor:kt/Rt,distance:Ct,aspect:Et}}}let pt;const mt=bt=>st(wt=>({performance:{...wt.performance,current:bt}})),gt=new Vector2;return{set:st,get:lt,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(bt=1)=>tt(lt(),bt),advance:(bt,wt)=>et(bt,wt,lt()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Clock$1,pointer:gt,mouse:gt,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const bt=lt();pt&&clearTimeout(pt),bt.performance.current!==bt.performance.min&&mt(bt.performance.min),pt=setTimeout(()=>mt(lt().performance.max),bt.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:dt},setEvents:bt=>st(wt=>({...wt,events:{...wt.events,...bt}})),setSize:(bt,wt,xt,kt,St)=>{const Tt=lt().camera,At={width:bt,height:wt,top:kt||0,left:St||0,updateStyle:xt};st(Et=>({size:At,viewport:{...Et.viewport,...dt(Tt,ut,At)}}))},setDpr:bt=>st(wt=>{const xt=calculateDpr(bt);return{viewport:{...wt.viewport,dpr:xt,initialDpr:wt.viewport.initialDpr||xt}}}),setFrameloop:(bt="always")=>{const wt=lt().clock;wt.stop(),wt.elapsedTime=0,bt!=="never"&&(wt.start(),wt.elapsedTime=0),st(()=>({frameloop:bt}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:reactExports.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(bt,wt,xt)=>{const kt=lt().internal;return kt.priority=kt.priority+(wt>0?1:0),kt.subscribers.push({ref:bt,priority:wt,store:xt}),kt.subscribers=kt.subscribers.sort((St,Tt)=>St.priority-Tt.priority),()=>{const St=lt().internal;St!=null&&St.subscribers&&(St.priority=St.priority-(wt>0?1:0),St.subscribers=St.subscribers.filter(Tt=>Tt.ref!==bt))}}}}}),rt=nt.getState();let it=rt.size,ot=rt.viewport.dpr,at=rt.camera;return nt.subscribe(()=>{const{camera:st,size:lt,viewport:ct,gl:ut,set:ht}=nt.getState();if(lt.width!==it.width||lt.height!==it.height||ct.dpr!==ot){var dt;it=lt,ot=ct.dpr,updateCamera(st,lt),ut.setPixelRatio(ct.dpr);const pt=(dt=lt.updateStyle)!=null?dt:typeof HTMLCanvasElement<"u"&&ut.domElement instanceof HTMLCanvasElement;ut.setSize(lt.width,lt.height,pt)}st!==at&&(at=st,ht(pt=>({viewport:{...pt.viewport,...pt.viewport.getCurrentViewport(st)}})))}),nt.subscribe(st=>tt(st)),nt};function createSubs(tt,et){const nt={callback:tt};return et.add(nt),()=>void et.delete(nt)}let i$3,globalEffects=new Set,globalAfterEffects=new Set,globalTailEffects=new Set;const addEffect=tt=>createSubs(tt,globalEffects),addAfterEffect=tt=>createSubs(tt,globalAfterEffects),addTail=tt=>createSubs(tt,globalTailEffects);function run(tt,et){if(tt.size)for(const{callback:nt}of tt.values())nt(et)}function flushGlobalEffects(tt,et){switch(tt){case"before":return run(globalEffects,et);case"after":return run(globalAfterEffects,et);case"tail":return run(globalTailEffects,et)}}let subscribers,subscription;function render$1(tt,et,nt){let rt=et.clock.getDelta();for(et.frameloop==="never"&&typeof tt=="number"&&(rt=tt-et.clock.elapsedTime,et.clock.oldTime=et.clock.elapsedTime,et.clock.elapsedTime=tt),subscribers=et.internal.subscribers,i$3=0;i$30)&&!((ct=it.gl.xr)!=null&&ct.isPresenting)&&(nt+=render$1(lt,it))}if(flushGlobalEffects("after",lt),nt===0)return flushGlobalEffects("tail",lt),et=!1,cancelAnimationFrame(rt)}function at(lt,ct=1){var ut;if(!lt)return tt.forEach(ht=>at(ht.store.getState()),ct);(ut=lt.gl.xr)!=null&&ut.isPresenting||!lt.internal.active||lt.frameloop==="never"||(lt.internal.frames=Math.min(60,lt.internal.frames+ct),et||(et=!0,requestAnimationFrame(ot)))}function st(lt,ct=!0,ut,ht){if(ct&&flushGlobalEffects("before",lt),ut)render$1(lt,ut,ht);else for(const dt of tt.values())render$1(lt,dt.store.getState());ct&&flushGlobalEffects("after",lt)}return{loop:ot,invalidate:at,advance:st}}function useInstanceHandle(tt){const et=reactExports.useRef(null);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt.current.__r3f),[tt]),et}function useStore$1(){const tt=reactExports.useContext(context$2);if(!tt)throw new Error("R3F: Hooks can only be used within the Canvas component!");return tt}function useThree(tt=nt=>nt,et){return useStore$1()(tt,et)}function useFrame(tt,et=0){const nt=useStore$1(),rt=nt.getState().internal.subscribe,it=useMutableCallback(tt);return useIsomorphicLayoutEffect$1(()=>rt(it,et,nt),[et,rt,nt]),null}const memoizedLoaders=new WeakMap;function loadingFn(tt,et){return function(nt,...rt){let it=memoizedLoaders.get(nt);return it||(it=new nt,memoizedLoaders.set(nt,it)),tt&&tt(it),Promise.all(rt.map(ot=>new Promise((at,st)=>it.load(ot,lt=>{lt.scene&&Object.assign(lt,buildGraph(lt.scene)),at(lt)},et,lt=>st(new Error(`Could not load ${ot}: ${lt==null?void 0:lt.message}`)))))).finally(()=>it.dispose==null?void 0:it.dispose())}}function useLoader(tt,et,nt,rt){const it=Array.isArray(et)?et:[et],ot=suspend$1(loadingFn(nt,rt),[tt,...it],{equal:is$1.equ});return Array.isArray(et)?ot:ot[0]}useLoader.preload=function(tt,et,nt){const rt=Array.isArray(et)?et:[et];return preload(loadingFn(nt),[tt,...rt])};useLoader.clear=function(tt,et){const nt=Array.isArray(et)?et:[et];return clear([tt,...nt])};const roots=new Map,{invalidate,advance}=createLoop(roots),{reconciler,applyProps}=createRenderer(roots,getEventPriority),shallowLoose={objects:"shallow",strict:!1},createRendererInstance=(tt,et)=>{const nt=typeof tt=="function"?tt(et):tt;return isRenderer(nt)?nt:new WebGLRenderer({powerPreference:"high-performance",canvas:et,antialias:!0,alpha:!0,...tt})};function computeInitialSize(tt,et){const nt=typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement;if(et){const{width:rt,height:it,top:ot,left:at,updateStyle:st=nt}=et;return{width:rt,height:it,top:ot,left:at,updateStyle:st}}else if(typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement&&tt.parentElement){const{width:rt,height:it,top:ot,left:at}=tt.parentElement.getBoundingClientRect();return{width:rt,height:it,top:ot,left:at,updateStyle:nt}}else if(typeof OffscreenCanvas<"u"&&tt instanceof OffscreenCanvas)return{width:tt.width,height:tt.height,top:0,left:0,updateStyle:nt};return{width:0,height:0,top:0,left:0}}function createRoot(tt){const et=roots.get(tt),nt=et==null?void 0:et.fiber,rt=et==null?void 0:et.store;et&&console.warn("R3F.createRoot should only be called once!");const it=typeof reportError=="function"?reportError:console.error,ot=rt||createStore$1(invalidate,advance),at=nt||reconciler.createContainer(ot,constantsExports.ConcurrentRoot,null,!1,null,"",it,null);et||roots.set(tt,{fiber:at,store:ot});let st,lt=!1,ct;return{configure(ut={}){let{gl:ht,size:dt,scene:pt,events:mt,onCreated:gt,shadows:yt=!1,linear:bt=!1,flat:wt=!1,legacy:xt=!1,orthographic:kt=!1,frameloop:St="always",dpr:Tt=[1,2],performance:At,raycaster:Et,camera:Ct,onPointerMissed:Lt}=ut,jt=ot.getState(),Rt=jt.gl;jt.gl||jt.set({gl:Rt=createRendererInstance(ht,tt)});let $t=jt.raycaster;$t||jt.set({raycaster:$t=new Raycaster});const{params:vt,...It}=Et||{};if(is$1.equ(It,$t,shallowLoose)||applyProps($t,{...It}),is$1.equ(vt,$t.params,shallowLoose)||applyProps($t,{params:{...$t.params,...vt}}),!jt.camera||jt.camera===ct&&!is$1.equ(ct,Ct,shallowLoose)){ct=Ct;const Pt=Ct instanceof Camera,Ht=Pt?Ct:kt?new OrthographicCamera(0,0,0,0,.1,1e3):new PerspectiveCamera(75,0,.1,1e3);Pt||(Ht.position.z=5,Ct&&applyProps(Ht,Ct),!jt.camera&&!(Ct!=null&&Ct.rotation)&&Ht.lookAt(0,0,0)),jt.set({camera:Ht}),$t.camera=Ht}if(!jt.scene){let Pt;pt instanceof Scene?Pt=pt:(Pt=new Scene,pt&&applyProps(Pt,pt)),jt.set({scene:prepare$1(Pt)})}if(!jt.xr){var Ot;const Pt=(an,Yt)=>{const nn=ot.getState();nn.frameloop!=="never"&&advance(an,!0,nn,Yt)},Ht=()=>{const an=ot.getState();an.gl.xr.enabled=an.gl.xr.isPresenting,an.gl.xr.setAnimationLoop(an.gl.xr.isPresenting?Pt:null),an.gl.xr.isPresenting||invalidate(an)},Qt={connect(){const an=ot.getState().gl;an.xr.addEventListener("sessionstart",Ht),an.xr.addEventListener("sessionend",Ht)},disconnect(){const an=ot.getState().gl;an.xr.removeEventListener("sessionstart",Ht),an.xr.removeEventListener("sessionend",Ht)}};typeof((Ot=Rt.xr)==null?void 0:Ot.addEventListener)=="function"&&Qt.connect(),jt.set({xr:Qt})}if(Rt.shadowMap){const Pt=Rt.shadowMap.enabled,Ht=Rt.shadowMap.type;if(Rt.shadowMap.enabled=!!yt,is$1.boo(yt))Rt.shadowMap.type=PCFSoftShadowMap;else if(is$1.str(yt)){var Wt;const Qt={basic:BasicShadowMap,percentage:PCFShadowMap,soft:PCFSoftShadowMap,variance:VSMShadowMap};Rt.shadowMap.type=(Wt=Qt[yt])!=null?Wt:PCFSoftShadowMap}else is$1.obj(yt)&&Object.assign(Rt.shadowMap,yt);(Pt!==Rt.shadowMap.enabled||Ht!==Rt.shadowMap.type)&&(Rt.shadowMap.needsUpdate=!0)}const zt=getColorManagement();zt&&("enabled"in zt?zt.enabled=!xt:"legacyMode"in zt&&(zt.legacyMode=xt)),applyProps(Rt,{outputEncoding:bt?3e3:3001,toneMapping:wt?NoToneMapping:ACESFilmicToneMapping}),jt.legacy!==xt&&jt.set(()=>({legacy:xt})),jt.linear!==bt&&jt.set(()=>({linear:bt})),jt.flat!==wt&&jt.set(()=>({flat:wt})),ht&&!is$1.fun(ht)&&!isRenderer(ht)&&!is$1.equ(ht,Rt,shallowLoose)&&applyProps(Rt,ht),mt&&!jt.events.handlers&&jt.set({events:mt(ot)});const Ut=computeInitialSize(tt,dt);return is$1.equ(Ut,jt.size,shallowLoose)||jt.setSize(Ut.width,Ut.height,Ut.updateStyle,Ut.top,Ut.left),Tt&&jt.viewport.dpr!==calculateDpr(Tt)&&jt.setDpr(Tt),jt.frameloop!==St&&jt.setFrameloop(St),jt.onPointerMissed||jt.set({onPointerMissed:Lt}),At&&!is$1.equ(At,jt.performance,shallowLoose)&&jt.set(Pt=>({performance:{...Pt.performance,...At}})),st=gt,lt=!0,this},render(ut){return lt||this.configure(),reconciler.updateContainer(reactExports.createElement(Provider$2,{store:ot,children:ut,onCreated:st,rootElement:tt}),at,null,()=>{}),ot},unmount(){unmountComponentAtNode(tt)}}}function Provider$2({store:tt,children:et,onCreated:nt,rootElement:rt}){return useIsomorphicLayoutEffect$1(()=>{const it=tt.getState();it.set(ot=>({internal:{...ot.internal,active:!0}})),nt&&nt(it),tt.getState().events.connected||it.events.connect==null||it.events.connect(rt)},[]),reactExports.createElement(context$2.Provider,{value:tt},et)}function unmountComponentAtNode(tt,et){const nt=roots.get(tt),rt=nt==null?void 0:nt.fiber;if(rt){const it=nt==null?void 0:nt.store.getState();it&&(it.internal.active=!1),reconciler.updateContainer(null,rt,null,()=>{it&&setTimeout(()=>{try{var ot,at,st,lt;it.events.disconnect==null||it.events.disconnect(),(ot=it.gl)==null||(at=ot.renderLists)==null||at.dispose==null||at.dispose(),(st=it.gl)==null||st.forceContextLoss==null||st.forceContextLoss(),(lt=it.gl)!=null&<.xr&&it.xr.disconnect(),dispose(it),roots.delete(tt),et&&et(tt)}catch{}},500)})}}reconciler.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:reactExports.version});function debounce$5(tt,et,nt){var rt,it,ot,at,st;et==null&&(et=100);function lt(){var ut=Date.now()-at;ut=0?rt=setTimeout(lt,et-ut):(rt=null,nt||(st=tt.apply(ot,it),ot=it=null))}var ct=function(){ot=this,it=arguments,at=Date.now();var ut=nt&&!rt;return rt||(rt=setTimeout(lt,et)),ut&&(st=tt.apply(ot,it),ot=it=null),st};return ct.clear=function(){rt&&(clearTimeout(rt),rt=null)},ct.flush=function(){rt&&(st=tt.apply(ot,it),ot=it=null,clearTimeout(rt),rt=null)},ct}debounce$5.debounce=debounce$5;var debounce_1$1=debounce$5;const createDebounce=getDefaultExportFromCjs(debounce_1$1);function useMeasure(tt){let{debounce:et,scroll:nt,polyfill:rt,offsetSize:it}=tt===void 0?{debounce:0,scroll:!1,offsetSize:!1}:tt;const ot=rt||(typeof window>"u"?class{}:window.ResizeObserver);if(!ot)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[at,st]=reactExports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),lt=reactExports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:at}),ct=et?typeof et=="number"?et:et.scroll:null,ut=et?typeof et=="number"?et:et.resize:null,ht=reactExports.useRef(!1);reactExports.useEffect(()=>(ht.current=!0,()=>void(ht.current=!1)));const[dt,pt,mt]=reactExports.useMemo(()=>{const wt=()=>{if(!lt.current.element)return;const{left:xt,top:kt,width:St,height:Tt,bottom:At,right:Et,x:Ct,y:Lt}=lt.current.element.getBoundingClientRect(),jt={left:xt,top:kt,width:St,height:Tt,bottom:At,right:Et,x:Ct,y:Lt};lt.current.element instanceof HTMLElement&&it&&(jt.height=lt.current.element.offsetHeight,jt.width=lt.current.element.offsetWidth),Object.freeze(jt),ht.current&&!areBoundsEqual(lt.current.lastBounds,jt)&&st(lt.current.lastBounds=jt)};return[wt,ut?createDebounce(wt,ut):wt,ct?createDebounce(wt,ct):wt]},[st,it,ct,ut]);function gt(){lt.current.scrollContainers&&(lt.current.scrollContainers.forEach(wt=>wt.removeEventListener("scroll",mt,!0)),lt.current.scrollContainers=null),lt.current.resizeObserver&&(lt.current.resizeObserver.disconnect(),lt.current.resizeObserver=null)}function yt(){lt.current.element&&(lt.current.resizeObserver=new ot(mt),lt.current.resizeObserver.observe(lt.current.element),nt&<.current.scrollContainers&<.current.scrollContainers.forEach(wt=>wt.addEventListener("scroll",mt,{capture:!0,passive:!0})))}const bt=wt=>{!wt||wt===lt.current.element||(gt(),lt.current.element=wt,lt.current.scrollContainers=findScrollContainers(wt),yt())};return useOnWindowScroll(mt,!!nt),useOnWindowResize(pt),reactExports.useEffect(()=>{gt(),yt()},[nt,mt,pt]),reactExports.useEffect(()=>gt,[]),[bt,at,dt]}function useOnWindowResize(tt){reactExports.useEffect(()=>{const et=tt;return window.addEventListener("resize",et),()=>void window.removeEventListener("resize",et)},[tt])}function useOnWindowScroll(tt,et){reactExports.useEffect(()=>{if(et){const nt=tt;return window.addEventListener("scroll",nt,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",nt,!0)}},[tt,et])}function findScrollContainers(tt){const et=[];if(!tt||tt===document.body)return et;const{overflow:nt,overflowX:rt,overflowY:it}=window.getComputedStyle(tt);return[nt,rt,it].some(ot=>ot==="auto"||ot==="scroll")&&et.push(tt),[...et,...findScrollContainers(tt.parentElement)]}const keys$4=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(tt,et)=>keys$4.every(nt=>tt[nt]===et[nt]);var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(tt,et,nt)=>et in tt?__defProp(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt,__spreadValues=(tt,et)=>{for(var nt in et||(et={}))__hasOwnProp.call(et,nt)&&__defNormalProp(tt,nt,et[nt]);if(__getOwnPropSymbols)for(var nt of __getOwnPropSymbols(et))__propIsEnum.call(et,nt)&&__defNormalProp(tt,nt,et[nt]);return tt},__spreadProps=(tt,et)=>__defProps(tt,__getOwnPropDescs(et));function traverseFiber(tt,et,nt){if(!tt)return;if(nt(tt)===!0)return tt;let rt=et?tt.return:tt.child;for(;rt;){const it=traverseFiber(rt,et,nt);if(it)return it;rt=et?null:rt.sibling}}function wrapContext(tt){try{return Object.defineProperties(tt,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return tt}}const FiberContext=wrapContext(reactExports.createContext(null));class FiberProvider extends reactExports.Component{render(){return reactExports.createElement(FiberContext.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner,ReactCurrentDispatcher}=reactExports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function useFiber(){const tt=reactExports.useContext(FiberContext);if(tt===null)throw new Error("its-fine: useFiber must be called within a !");const et=reactExports.useId();return reactExports.useMemo(()=>{for(const rt of[ReactCurrentOwner==null?void 0:ReactCurrentOwner.current,tt,tt==null?void 0:tt.alternate]){if(!rt)continue;const it=traverseFiber(rt,!1,ot=>{let at=ot.memoizedState;for(;at;){if(at.memoizedState===et)return!0;at=at.next}});if(it)return it}},[tt,et])}function useContextMap(){var tt,et;const nt=useFiber(),[rt]=reactExports.useState(()=>new Map);rt.clear();let it=nt;for(;it;){const ot=(tt=it.type)==null?void 0:tt._context;ot&&ot!==FiberContext&&!rt.has(ot)&&rt.set(ot,(et=ReactCurrentDispatcher==null?void 0:ReactCurrentDispatcher.current)==null?void 0:et.readContext(wrapContext(ot))),it=it.return}return rt}function useContextBridge(){const tt=useContextMap();return reactExports.useMemo(()=>Array.from(tt.keys()).reduce((et,nt)=>rt=>reactExports.createElement(et,null,reactExports.createElement(nt.Provider,__spreadProps(__spreadValues({},rt),{value:tt.get(nt)}))),et=>reactExports.createElement(FiberProvider,__spreadValues({},et))),[tt])}const DOM_EVENTS={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function createPointerEvents(tt){const{handlePointer:et}=createEvents(tt);return{priority:1,enabled:!0,compute(nt,rt,it){rt.pointer.set(nt.offsetX/rt.size.width*2-1,-(nt.offsetY/rt.size.height)*2+1),rt.raycaster.setFromCamera(rt.pointer,rt.camera)},connected:void 0,handlers:Object.keys(DOM_EVENTS).reduce((nt,rt)=>({...nt,[rt]:et(rt)}),{}),update:()=>{var nt;const{events:rt,internal:it}=tt.getState();(nt=it.lastEvent)!=null&&nt.current&&rt.handlers&&rt.handlers.onPointerMove(it.lastEvent.current)},connect:nt=>{var rt;const{set:it,events:ot}=tt.getState();ot.disconnect==null||ot.disconnect(),it(at=>({events:{...at.events,connected:nt}})),Object.entries((rt=ot.handlers)!=null?rt:[]).forEach(([at,st])=>{const[lt,ct]=DOM_EVENTS[at];nt.addEventListener(lt,st,{passive:ct})})},disconnect:()=>{const{set:nt,events:rt}=tt.getState();if(rt.connected){var it;Object.entries((it=rt.handlers)!=null?it:[]).forEach(([ot,at])=>{if(rt&&rt.connected instanceof HTMLElement){const[st]=DOM_EVENTS[ot];rt.connected.removeEventListener(st,at)}}),nt(ot=>({events:{...ot.events,connected:void 0}}))}}}}const CanvasImpl=reactExports.forwardRef(function({children:et,fallback:nt,resize:rt,style:it,gl:ot,events:at=createPointerEvents,eventSource:st,eventPrefix:lt,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:yt,raycaster:bt,camera:wt,scene:xt,onPointerMissed:kt,onCreated:St,...Tt},At){reactExports.useMemo(()=>extend$1(THREE$1),[]);const Et=useContextBridge(),[Ct,Lt]=useMeasure({scroll:!0,debounce:{scroll:50,resize:0},...rt}),jt=reactExports.useRef(null),Rt=reactExports.useRef(null);reactExports.useImperativeHandle(At,()=>jt.current);const $t=useMutableCallback(kt),[vt,It]=reactExports.useState(!1),[Ot,Wt]=reactExports.useState(!1);if(vt)throw vt;if(Ot)throw Ot;const zt=reactExports.useRef(null);useIsomorphicLayoutEffect$1(()=>{const Nt=jt.current;Lt.width>0&&Lt.height>0&&Nt&&(zt.current||(zt.current=createRoot(Nt)),zt.current.configure({gl:ot,events:at,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:yt,raycaster:bt,camera:wt,scene:xt,size:Lt,onPointerMissed:(...Ut)=>$t.current==null?void 0:$t.current(...Ut),onCreated:Ut=>{Ut.events.connect==null||Ut.events.connect(st?isRef(st)?st.current:st:Rt.current),lt&&Ut.setEvents({compute:(Pt,Ht)=>{const Qt=Pt[lt+"X"],an=Pt[lt+"Y"];Ht.pointer.set(Qt/Ht.size.width*2-1,-(an/Ht.size.height)*2+1),Ht.raycaster.setFromCamera(Ht.pointer,Ht.camera)}}),St==null||St(Ut)}}),zt.current.render(reactExports.createElement(Et,null,reactExports.createElement(ErrorBoundary,{set:Wt},reactExports.createElement(reactExports.Suspense,{fallback:reactExports.createElement(Block,{set:It})},et)))))}),reactExports.useEffect(()=>{const Nt=jt.current;if(Nt)return()=>unmountComponentAtNode(Nt)},[]);const Ft=st?"none":"auto";return reactExports.createElement("div",_extends$u({ref:Rt,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Ft,...it}},Tt),reactExports.createElement("div",{ref:Ct,style:{width:"100%",height:"100%"}},reactExports.createElement("canvas",{ref:jt,style:{display:"block"}},nt)))}),Canvas$1=reactExports.forwardRef(function(et,nt){return reactExports.createElement(FiberProvider,null,reactExports.createElement(CanvasImpl,_extends$u({},et,{ref:nt})))}),v1=new Vector3,v2=new Vector3,v3=new Vector3;function defaultCalculatePosition(tt,et,nt){const rt=v1.setFromMatrixPosition(tt.matrixWorld);rt.project(et);const it=nt.width/2,ot=nt.height/2;return[rt.x*it+it,-(rt.y*ot)+ot]}function isObjectBehindCamera(tt,et){const nt=v1.setFromMatrixPosition(tt.matrixWorld),rt=v2.setFromMatrixPosition(et.matrixWorld),it=nt.sub(rt),ot=et.getWorldDirection(v3);return it.angleTo(ot)>Math.PI/2}function isObjectVisible(tt,et,nt,rt){const it=v1.setFromMatrixPosition(tt.matrixWorld),ot=it.clone();ot.project(et),nt.setFromCamera(ot,et);const at=nt.intersectObjects(rt,!0);if(at.length){const st=at[0].distance;return it.distanceTo(nt.ray.origin)Math.abs(tt)<1e-10?0:tt;function getCSSMatrix(tt,et,nt=""){let rt="matrix3d(";for(let it=0;it!==16;it++)rt+=epsilon$1(et[it]*tt.elements[it])+(it!==15?",":")");return nt+rt}const getCameraCSSMatrix=(tt=>et=>getCSSMatrix(et,tt))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),getObjectCSSMatrix=(tt=>(et,nt)=>getCSSMatrix(et,tt(nt),"translate(-50%,-50%)"))(tt=>[1/tt,1/tt,1/tt,1,-1/tt,-1/tt,-1/tt,-1,1/tt,1/tt,1/tt,1,1,1,1,1]);function isRefObject(tt){return tt&&typeof tt=="object"&&"current"in tt}const Html$1=reactExports.forwardRef(({children:tt,eps:et=.001,style:nt,className:rt,prepend:it,center:ot,fullscreen:at,portal:st,distanceFactor:lt,sprite:ct=!1,transform:ut=!1,occlude:ht,onOcclude:dt,castShadow:pt,receiveShadow:mt,material:gt,geometry:yt,zIndexRange:bt=[16777271,0],calculatePosition:wt=defaultCalculatePosition,as:xt="div",wrapperClass:kt,pointerEvents:St="auto",...Tt},At)=>{const{gl:Et,camera:Ct,scene:Lt,size:jt,raycaster:Rt,events:$t,viewport:vt}=useThree(),[It]=reactExports.useState(()=>document.createElement(xt)),Ot=reactExports.useRef(),Wt=reactExports.useRef(null),zt=reactExports.useRef(0),Ft=reactExports.useRef([0,0]),Nt=reactExports.useRef(null),Ut=reactExports.useRef(null),Pt=(st==null?void 0:st.current)||$t.connected||Et.domElement.parentNode,Ht=reactExports.useRef(null),Qt=reactExports.useRef(!1),an=reactExports.useMemo(()=>ht&&ht!=="blending"||Array.isArray(ht)&&ht.length&&isRefObject(ht[0]),[ht]);reactExports.useLayoutEffect(()=>{const wn=Et.domElement;ht&&ht==="blending"?(wn.style.zIndex=`${Math.floor(bt[0]/2)}`,wn.style.position="absolute",wn.style.pointerEvents="none"):(wn.style.zIndex=null,wn.style.position=null,wn.style.pointerEvents=null)},[ht]),reactExports.useLayoutEffect(()=>{if(Wt.current){const wn=Ot.current=createRoot$1(It);if(Lt.updateMatrixWorld(),ut)It.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const rn=wt(Wt.current,Ct,jt);It.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${rn[0]}px,${rn[1]}px,0);transform-origin:0 0;`}return Pt&&(it?Pt.prepend(It):Pt.appendChild(It)),()=>{Pt&&Pt.removeChild(It),wn.unmount()}}},[Pt,ut]),reactExports.useLayoutEffect(()=>{kt&&(It.className=kt)},[kt]);const Yt=reactExports.useMemo(()=>ut?{position:"absolute",top:0,left:0,width:jt.width,height:jt.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:ot?"translate3d(-50%,-50%,0)":"none",...at&&{top:-jt.height/2,left:-jt.width/2,width:jt.width,height:jt.height},...nt},[nt,ot,at,jt,ut]),nn=reactExports.useMemo(()=>({position:"absolute",pointerEvents:St}),[St]);reactExports.useLayoutEffect(()=>{if(Qt.current=!1,ut){var wn;(wn=Ot.current)==null||wn.render(reactExports.createElement("div",{ref:Nt,style:Yt},reactExports.createElement("div",{ref:Ut,style:nn},reactExports.createElement("div",{ref:At,className:rt,style:nt,children:tt}))))}else{var rn;(rn=Ot.current)==null||rn.render(reactExports.createElement("div",{ref:At,style:Yt,className:rt,children:tt}))}});const tn=reactExports.useRef(!0);useFrame(wn=>{if(Wt.current){Ct.updateMatrixWorld(),Wt.current.updateWorldMatrix(!0,!1);const rn=ut?Ft.current:wt(Wt.current,Ct,jt);if(ut||Math.abs(zt.current-Ct.zoom)>et||Math.abs(Ft.current[0]-rn[0])>et||Math.abs(Ft.current[1]-rn[1])>et){const Zt=isObjectBehindCamera(Wt.current,Ct);let vn=!1;an&&(ht!=="blending"?vn=[Lt]:Array.isArray(ht)&&(vn=ht.map(En=>En.current)));const Cn=tn.current;if(vn){const En=isObjectVisible(Wt.current,Ct,Rt,vn);tn.current=En&&!Zt}else tn.current=!Zt;Cn!==tn.current&&(dt?dt(!tn.current):It.style.display=tn.current?"block":"none");const $n=Math.floor(bt[0]/2),Nn=ht?an?[bt[0],$n]:[$n-1,0]:bt;if(It.style.zIndex=`${objectZIndex(Wt.current,Ct,Nn)}`,ut){const[En,sn]=[jt.width/2,jt.height/2],pn=Ct.projectionMatrix.elements[5]*sn,{isOrthographicCamera:Tn,top:In,left:yn,bottom:hn,right:fn}=Ct,xn=getCameraCSSMatrix(Ct.matrixWorldInverse),jn=Tn?`scale(${pn})translate(${epsilon$1(-(fn+yn)/2)}px,${epsilon$1((In+hn)/2)}px)`:`translateZ(${pn}px)`;let cn=Wt.current.matrixWorld;ct&&(cn=Ct.matrixWorldInverse.clone().transpose().copyPosition(cn).scale(Wt.current.scale),cn.elements[3]=cn.elements[7]=cn.elements[11]=0,cn.elements[15]=1),It.style.width=jt.width+"px",It.style.height=jt.height+"px",It.style.perspective=Tn?"":`${pn}px`,Nt.current&&Ut.current&&(Nt.current.style.transform=`${jn}${xn}translate(${En}px,${sn}px)`,Ut.current.style.transform=getObjectCSSMatrix(cn,1/((lt||10)/400)))}else{const En=lt===void 0?1:objectScale(Wt.current,Ct)*lt;It.style.transform=`translate3d(${rn[0]}px,${rn[1]}px,0) scale(${En})`}Ft.current=rn,zt.current=Ct.zoom}}if(!an&&Ht.current&&!Qt.current)if(ut){if(Nt.current){const rn=Nt.current.children[0];if(rn!=null&&rn.clientWidth&&rn!=null&&rn.clientHeight){const{isOrthographicCamera:Zt}=Ct;if(Zt||yt)Tt.scale&&(Array.isArray(Tt.scale)?Tt.scale instanceof Vector3?Ht.current.scale.copy(Tt.scale.clone().divideScalar(1)):Ht.current.scale.set(1/Tt.scale[0],1/Tt.scale[1],1/Tt.scale[2]):Ht.current.scale.setScalar(1/Tt.scale));else{const vn=(lt||10)/400,Cn=rn.clientWidth*vn,$n=rn.clientHeight*vn;Ht.current.scale.set(Cn,$n,1)}Qt.current=!0}}}else{const rn=It.children[0];if(rn!=null&&rn.clientWidth&&rn!=null&&rn.clientHeight){const Zt=1/vt.factor,vn=rn.clientWidth*Zt,Cn=rn.clientHeight*Zt;Ht.current.scale.set(vn,Cn,1),Qt.current=!0}Ht.current.lookAt(wn.camera.position)}});const dn=reactExports.useMemo(()=>({vertexShader:ut?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite @@ -4019,7 +4019,7 @@ troikaDefine( `+stringifyFunction(ct)+` )}`}),_allowInitAsString=!1),ct&&ct.workerModuleData&&(ct=ct.workerModuleData),ct});function lt(){for(var ct=[],ut=arguments.length;ut--;)ct[ut]=arguments[ut];if(!st){st=callWorker(it,"registerModule",lt.workerModuleData);var ht=function(){st=null,registeredModules[it].delete(ht)};(registeredModules[it]||(registeredModules[it]=new Set)).add(ht)}return st.then(function(dt){var pt=dt.isCallable;if(pt)return callWorker(it,"callModule",{id:ot,args:ct});throw new Error("Worker module function was called but `init` did not return a callable function")})}return lt.workerModuleData={isWorkerModule:!0,id:ot,name:at,dependencies:et,init:stringifyFunction(nt),getTransferables:rt&&stringifyFunction(rt)},lt}function terminateWorker(tt){registeredModules[tt]&®isteredModules[tt].forEach(function(et){et()}),workers[tt]&&(workers[tt].terminate(),delete workers[tt])}function stringifyFunction(tt){var et=tt.toString();return!/^function/.test(et)&&/^\w+\s*\(/.test(et)&&(et="function "+et),et}function getWorker(tt){var et=workers[tt];if(!et){var nt=stringifyFunction(workerBootstrap);et=workers[tt]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+tt.replace(/\*/g,"")+` **/ -;(`+nt+")()"],{type:"application/javascript"}))),et.onmessage=function(rt){var it=rt.data,ot=it.messageId,at=openRequests[ot];if(!at)throw new Error("WorkerModule response with empty or unknown messageId");delete openRequests[ot],at(it)}}return et}function callWorker(tt,et,nt){return new Promise(function(rt,it){var ot=++_messageId;openRequests[ot]=function(at){at.success?rt(at.result):it(new Error("Error in worker "+et+" call: "+at.error))},getWorker(tt).postMessage({messageId:ot,action:et,data:nt})})}function SDFGenerator(){var tt=function(et){function nt(Ft,Nt,Ut,Pt,Ht,Qt,an,Yt){var nn=1-an;Yt.x=nn*nn*Ft+2*nn*an*Ut+an*an*Ht,Yt.y=nn*nn*Nt+2*nn*an*Pt+an*an*Qt}function rt(Ft,Nt,Ut,Pt,Ht,Qt,an,Yt,nn,tn){var dn=1-nn;tn.x=dn*dn*dn*Ft+3*dn*dn*nn*Ut+3*dn*nn*nn*Ht+nn*nn*nn*an,tn.y=dn*dn*dn*Nt+3*dn*dn*nn*Pt+3*dn*nn*nn*Qt+nn*nn*nn*Yt}function it(Ft,Nt){for(var Ut=/([MLQCZ])([^MLQCZ]*)/g,Pt,Ht,Qt,an,Yt;Pt=Ut.exec(Ft);){var nn=Pt[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(tn){return parseFloat(tn)});switch(Pt[1]){case"M":an=Ht=nn[0],Yt=Qt=nn[1];break;case"L":(nn[0]!==an||nn[1]!==Yt)&&Nt("L",an,Yt,an=nn[0],Yt=nn[1]);break;case"Q":{Nt("Q",an,Yt,an=nn[2],Yt=nn[3],nn[0],nn[1]);break}case"C":{Nt("C",an,Yt,an=nn[4],Yt=nn[5],nn[0],nn[1],nn[2],nn[3]);break}case"Z":(an!==Ht||Yt!==Qt)&&Nt("L",an,Yt,Ht,Qt);break}}}function ot(Ft,Nt,Ut){Ut===void 0&&(Ut=16);var Pt={x:0,y:0};it(Ft,function(Ht,Qt,an,Yt,nn,tn,dn,wn,rn){switch(Ht){case"L":Nt(Qt,an,Yt,nn);break;case"Q":{for(var Jt=Qt,vn=an,Cn=1;Cn0;)Bn[Xn]=arguments[Xn+2];var Vn=jn[On]||(jn[On]=Ut.getUniformLocation(cn,On));Ut["uniform"+Mn].apply(Ut,[Vn].concat(Bn))},setAttribute:function(Mn,On,Bn,Xn,Vn){var Gn=xn[Mn];Gn||(Gn=xn[Mn]={buf:Ut.createBuffer(),loc:Ut.getAttribLocation(cn,Mn),data:null}),Ut.bindBuffer(Ut.ARRAY_BUFFER,Gn.buf),Ut.vertexAttribPointer(Gn.loc,On,Ut.FLOAT,!1,0,0),Ut.enableVertexAttribArray(Gn.loc),Ht?Ut.vertexAttribDivisor(Gn.loc,Xn):$n("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Gn.loc,Xn),Vn!==Gn.data&&(Ut.bufferData(Ut.ARRAY_BUFFER,Vn,Bn),Gn.data=Vn)}})}}}an[In].transaction(fn)},sn=function(In,yn){nn++;try{Ut.activeTexture(Ut.TEXTURE0+nn);var hn=Yt[In];hn||(hn=Yt[In]=Ut.createTexture(),Ut.bindTexture(Ut.TEXTURE_2D,hn),Ut.texParameteri(Ut.TEXTURE_2D,Ut.TEXTURE_MIN_FILTER,Ut.NEAREST),Ut.texParameteri(Ut.TEXTURE_2D,Ut.TEXTURE_MAG_FILTER,Ut.NEAREST)),Ut.bindTexture(Ut.TEXTURE_2D,hn),yn(hn,nn)}finally{nn--}},pn=function(In,yn,hn){var fn=Ut.createFramebuffer();tn.push(fn),Ut.bindFramebuffer(Ut.FRAMEBUFFER,fn),Ut.activeTexture(Ut.TEXTURE0+yn),Ut.bindTexture(Ut.TEXTURE_2D,In),Ut.framebufferTexture2D(Ut.FRAMEBUFFER,Ut.COLOR_ATTACHMENT0,Ut.TEXTURE_2D,In,0);try{hn(fn)}finally{Ut.deleteFramebuffer(fn),Ut.bindFramebuffer(Ut.FRAMEBUFFER,tn[--tn.length-1]||null)}},Tn=function(){Qt={},an={},Yt={},nn=-1,tn.length=0};var dn=$n,wn=Nn,rn=En,Jt=sn,vn=pn,Cn=Tn,Ht=typeof WebGL2RenderingContext<"u"&&Ut instanceof WebGL2RenderingContext,Qt={},an={},Yt={},nn=-1,tn=[];Ut.canvas.addEventListener("webglcontextlost",function(In){Tn(),In.preventDefault()},!1),lt.set(Ut,Pt={gl:Ut,isWebGL2:Ht,getExtension:$n,withProgram:En,withTexture:sn,withTextureFramebuffer:pn,handleContextLoss:Tn})}Nt(Pt)}function ht(Ft,Nt,Ut,Pt,Ht,Qt,an,Yt){an===void 0&&(an=15),Yt===void 0&&(Yt=null),ut(Ft,function(nn){var tn=nn.gl,dn=nn.withProgram,wn=nn.withTexture;wn("copy",function(rn,Jt){tn.texImage2D(tn.TEXTURE_2D,0,tn.RGBA,Ht,Qt,0,tn.RGBA,tn.UNSIGNED_BYTE,Nt),dn("copy",at,st,function(vn){var Cn=vn.setUniform,$n=vn.setAttribute;$n("aUV",2,tn.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Cn("1i","image",Jt),tn.bindFramebuffer(tn.FRAMEBUFFER,Yt||null),tn.disable(tn.BLEND),tn.colorMask(an&8,an&4,an&2,an&1),tn.viewport(Ut,Pt,Ht,Qt),tn.scissor(Ut,Pt,Ht,Qt),tn.drawArrays(tn.TRIANGLES,0,3)})})})}function dt(Ft,Nt,Ut){var Pt=Ft.width,Ht=Ft.height;ut(Ft,function(Qt){var an=Qt.gl,Yt=new Uint8Array(Pt*Ht*4);an.readPixels(0,0,Pt,Ht,an.RGBA,an.UNSIGNED_BYTE,Yt),Ft.width=Nt,Ft.height=Ut,ht(an,Yt,0,0,Pt,Ht)})}var pt=Object.freeze({__proto__:null,withWebGLContext:ut,renderImageData:ht,resizeWebGLCanvasWithoutClearing:dt});function mt(Ft,Nt,Ut,Pt,Ht,Qt){Qt===void 0&&(Qt=1);var an=new Uint8Array(Ft*Nt),Yt=Pt[2]-Pt[0],nn=Pt[3]-Pt[1],tn=[];ot(Ut,function($n,Nn,En,sn){tn.push({x1:$n,y1:Nn,x2:En,y2:sn,minX:Math.min($n,En),minY:Math.min(Nn,sn),maxX:Math.max($n,En),maxY:Math.max(Nn,sn)})}),tn.sort(function($n,Nn){return $n.maxX-Nn.maxX});for(var dn=0;dnTn.minX&&Nn-snTn.minY){var In=bt($n,Nn,Tn.x1,Tn.y1,Tn.x2,Tn.y2);InNn!=pn.y2>Nn&&$n<(pn.x2-pn.x1)*(Nn-pn.y1)/(pn.y2-pn.y1)+pn.x1;Tn&&(En+=pn.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function gt(sn,pn){var Tn=36,In=0,yn=new Map,hn=pn&&new Map,fn;return sn.split(",").forEach(function xn(jn){if(jn.indexOf("+")!==-1)for(var cn=+jn;cn--;)xn(fn);else{fn=jn;var Xt=jn.split(">"),Kt=Xt[0],kn=Xt[1];Kt=String.fromCodePoint(In+=parseInt(Kt,Tn)),kn=String.fromCodePoint(In+=parseInt(kn,Tn)),yn.set(Kt,kn),pn&&hn.set(kn,Kt)}}),{map:yn,reverseMap:hn}}var yt,bt,wt;function xt(){if(!yt){var sn=gt(mt.pairs,!0),pn=sn.map,Tn=sn.reverseMap;yt=pn,bt=Tn,wt=gt(mt.canonical,!1).map}}function kt(sn){return xt(),yt.get(sn)||null}function St(sn){return xt(),bt.get(sn)||null}function Tt(sn){return xt(),wt.get(sn)||null}var At=rt.L,Et=rt.R,Ct=rt.EN,Lt=rt.ES,jt=rt.ET,Rt=rt.AN,$t=rt.CS,vt=rt.B,It=rt.S,Ot=rt.ON,Wt=rt.BN,zt=rt.NSM,Ft=rt.AL,Nt=rt.LRO,Ut=rt.RLO,Pt=rt.LRE,Ht=rt.RLE,Qt=rt.PDF,an=rt.LRI,Yt=rt.RLI,nn=rt.FSI,tn=rt.PDI;function dn(sn,pn){for(var Tn=125,In=new Uint32Array(sn.length),yn=0;yn0)Gn--;else if(Zn>0){for(zn=0;!Xn[Xn.length-1]._isolate;)Xn.pop();var Er=Xn[Xn.length-1]._isolInitIndex;Er!=null&&(jn.set(Er,Wn),jn.set(Wn,Er)),Xn.pop(),Zn--}Vn=Xn[Xn.length-1],xn[Wn]=Vn._level,Vn._override&&fn(Wn,Vn._override)}else fr&Qt?(Gn===0&&(zn>0?zn--:!Vn._isolate&&Xn.length>1&&(Xn.pop(),Vn=Xn[Xn.length-1])),xn[Wn]=Vn._level):fr&vt&&(xn[Wn]=Xt.level);else xn[Wn]=Vn._level,Vn._override&&fr!==Wt&&fn(Wn,Vn._override)}for(var Ir=[],Gr=null,Or=Xt.start;Or<=Xt.end;Or++){var Lr=In[Or];if(!(Lr<)){var oo=xn[Or],qr=Lr&ot,jr=Lr===tn;Gr&&oo===Gr._level?(Gr._end=Or,Gr._endsWithIsolInit=qr):Ir.push(Gr={_start:Or,_end:Or,_level:oo,_startsWithPDI:jr,_endsWithIsolInit:qr})}}for(var mo=[],_n=0;_n=0;Vr--)if(!(In[Vr]<)){lr=xn[Vr];break}var vr=Dn[Dn.length-1],Nr=xn[vr],Hr=Xt.level;if(!(In[vr]&ot)){for(var eo=vr+1;eo<=Xt.end;eo++)if(!(In[eo]<)){Hr=xn[eo];break}}mo.push({_seqIndices:Dn,_sosType:Math.max(lr,ar)%2?Et:At,_eosType:Math.max(Hr,Nr)%2?Et:At})}}for(var Zr=0;Zr=0;Rr--)if(!(In[br[Rr]]<)){Ur=In[br[Rr]];break}fn(Dr,Ur&(ot|tn)?Ot:Ur)}}if(hn.get(Ct))for(var er=0;er=-1;xr--){var dr=xr===-1?Pr:In[br[xr]];if(dr&at){dr===Ft&&fn(rr,Rt);break}}}if(hn.get(Ft))for(var yr=0;yr=0&&(ho=In[br[qn]],!!(ho<));qn--);for(var wo=no+1;wo=0&&In[br[yo]]&(jt|lt);yo--)fn(br[yo],Ct);for(vo++;vo=0&&In[br[zo]]<zo--)fn(br[zo],Ot);for(var Co=Ao+1;Co=0;eu--){var ip=fu[eu].char;if(ip===Pp||ip===St(Tt(No))||kt(Tt(ip))===No){Xo.push([fu[eu].seqIndex,_c]),fu.length=eu;break}}}Xo.sort(function(ys,$s){return ys[0]-$s[0]})}for(var Mp=0;Mp=0;qo--){var Yo=br[qo];if(In[Yo]&xa){var Xs=In[Yo]&Qo?Et:At;Xs!==Mr?Fs=Xs:Fs=Mr;break}}}if(Fs){if(In[br[es]]=In[br[pu]]=Fs,Fs!==Mr){for(var Us=es+1;Us=0;Vu--)if(In[br[Vu]]<)Bp=Vu;else{zs=In[br[Vu]]&Qo?Et:At;break}for(var ts=Fr,mu=Al+1;mu=0&&dt(sn[gu])&ct;gu--)xn[gu]=Xt.level}}return{levels:xn,paragraphs:cn};function Hu(ys,$s){for(var rs=ys;rs=xn&&dt(sn[Xt])&ct;Xt--)cn[Xt]=fn.level;for(var Kt=fn.level,kn=1/0,Mn=0;MnKt&&(Kt=On),On=kn;Bn--)for(var Xn=0;Xn=Bn){for(var Vn=Xn;Xn+1=Bn;)Xn++;Xn>Vn&&hn.push([Vn+xn,Xn+xn])}}}),hn}function Nn(sn,pn,Tn,In){var yn=En(sn,pn,Tn,In),hn=[].concat(sn);return yn.forEach(function(fn,xn){hn[xn]=(pn.levels[fn]&1?vn(sn[fn]):null)||sn[fn]}),hn.join("")}function En(sn,pn,Tn,In){for(var yn=$n(sn,pn,Tn,In),hn=[],fn=0;fn/gm;function nt(rt,it){let ot=ShaderChunk[it];return ot?expandShaderIncludes(ot):rt}return tt.replace(et,nt)}const _lut=[];for(let tt=0;tt<256;tt++)_lut[tt]=(tt<16?"0":"")+tt.toString(16);function generateUUID(){const tt=Math.random()*4294967295|0,et=Math.random()*4294967295|0,nt=Math.random()*4294967295|0,rt=Math.random()*4294967295|0;return(_lut[tt&255]+_lut[tt>>8&255]+_lut[tt>>16&255]+_lut[tt>>24&255]+"-"+_lut[et&255]+_lut[et>>8&255]+"-"+_lut[et>>16&15|64]+_lut[et>>24&255]+"-"+_lut[nt&63|128]+_lut[nt>>8&255]+"-"+_lut[nt>>16&255]+_lut[nt>>24&255]+_lut[rt&255]+_lut[rt>>8&255]+_lut[rt>>16&255]+_lut[rt>>24&255]).toUpperCase()}const assign$3=Object.assign||function(){let tt=arguments[0];for(let et=1,nt=arguments.length;et/gm,` +;(`+nt+")()"],{type:"application/javascript"}))),et.onmessage=function(rt){var it=rt.data,ot=it.messageId,at=openRequests[ot];if(!at)throw new Error("WorkerModule response with empty or unknown messageId");delete openRequests[ot],at(it)}}return et}function callWorker(tt,et,nt){return new Promise(function(rt,it){var ot=++_messageId;openRequests[ot]=function(at){at.success?rt(at.result):it(new Error("Error in worker "+et+" call: "+at.error))},getWorker(tt).postMessage({messageId:ot,action:et,data:nt})})}function SDFGenerator(){var tt=function(et){function nt(Ft,Nt,Ut,Pt,Ht,Qt,an,Yt){var nn=1-an;Yt.x=nn*nn*Ft+2*nn*an*Ut+an*an*Ht,Yt.y=nn*nn*Nt+2*nn*an*Pt+an*an*Qt}function rt(Ft,Nt,Ut,Pt,Ht,Qt,an,Yt,nn,tn){var dn=1-nn;tn.x=dn*dn*dn*Ft+3*dn*dn*nn*Ut+3*dn*nn*nn*Ht+nn*nn*nn*an,tn.y=dn*dn*dn*Nt+3*dn*dn*nn*Pt+3*dn*nn*nn*Qt+nn*nn*nn*Yt}function it(Ft,Nt){for(var Ut=/([MLQCZ])([^MLQCZ]*)/g,Pt,Ht,Qt,an,Yt;Pt=Ut.exec(Ft);){var nn=Pt[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(tn){return parseFloat(tn)});switch(Pt[1]){case"M":an=Ht=nn[0],Yt=Qt=nn[1];break;case"L":(nn[0]!==an||nn[1]!==Yt)&&Nt("L",an,Yt,an=nn[0],Yt=nn[1]);break;case"Q":{Nt("Q",an,Yt,an=nn[2],Yt=nn[3],nn[0],nn[1]);break}case"C":{Nt("C",an,Yt,an=nn[4],Yt=nn[5],nn[0],nn[1],nn[2],nn[3]);break}case"Z":(an!==Ht||Yt!==Qt)&&Nt("L",an,Yt,Ht,Qt);break}}}function ot(Ft,Nt,Ut){Ut===void 0&&(Ut=16);var Pt={x:0,y:0};it(Ft,function(Ht,Qt,an,Yt,nn,tn,dn,wn,rn){switch(Ht){case"L":Nt(Qt,an,Yt,nn);break;case"Q":{for(var Zt=Qt,vn=an,Cn=1;Cn0;)Bn[Xn]=arguments[Xn+2];var Vn=jn[On]||(jn[On]=Ut.getUniformLocation(cn,On));Ut["uniform"+Mn].apply(Ut,[Vn].concat(Bn))},setAttribute:function(Mn,On,Bn,Xn,Vn){var Gn=xn[Mn];Gn||(Gn=xn[Mn]={buf:Ut.createBuffer(),loc:Ut.getAttribLocation(cn,Mn),data:null}),Ut.bindBuffer(Ut.ARRAY_BUFFER,Gn.buf),Ut.vertexAttribPointer(Gn.loc,On,Ut.FLOAT,!1,0,0),Ut.enableVertexAttribArray(Gn.loc),Ht?Ut.vertexAttribDivisor(Gn.loc,Xn):$n("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Gn.loc,Xn),Vn!==Gn.data&&(Ut.bufferData(Ut.ARRAY_BUFFER,Vn,Bn),Gn.data=Vn)}})}}}an[In].transaction(fn)},sn=function(In,yn){nn++;try{Ut.activeTexture(Ut.TEXTURE0+nn);var hn=Yt[In];hn||(hn=Yt[In]=Ut.createTexture(),Ut.bindTexture(Ut.TEXTURE_2D,hn),Ut.texParameteri(Ut.TEXTURE_2D,Ut.TEXTURE_MIN_FILTER,Ut.NEAREST),Ut.texParameteri(Ut.TEXTURE_2D,Ut.TEXTURE_MAG_FILTER,Ut.NEAREST)),Ut.bindTexture(Ut.TEXTURE_2D,hn),yn(hn,nn)}finally{nn--}},pn=function(In,yn,hn){var fn=Ut.createFramebuffer();tn.push(fn),Ut.bindFramebuffer(Ut.FRAMEBUFFER,fn),Ut.activeTexture(Ut.TEXTURE0+yn),Ut.bindTexture(Ut.TEXTURE_2D,In),Ut.framebufferTexture2D(Ut.FRAMEBUFFER,Ut.COLOR_ATTACHMENT0,Ut.TEXTURE_2D,In,0);try{hn(fn)}finally{Ut.deleteFramebuffer(fn),Ut.bindFramebuffer(Ut.FRAMEBUFFER,tn[--tn.length-1]||null)}},Tn=function(){Qt={},an={},Yt={},nn=-1,tn.length=0};var dn=$n,wn=Nn,rn=En,Zt=sn,vn=pn,Cn=Tn,Ht=typeof WebGL2RenderingContext<"u"&&Ut instanceof WebGL2RenderingContext,Qt={},an={},Yt={},nn=-1,tn=[];Ut.canvas.addEventListener("webglcontextlost",function(In){Tn(),In.preventDefault()},!1),lt.set(Ut,Pt={gl:Ut,isWebGL2:Ht,getExtension:$n,withProgram:En,withTexture:sn,withTextureFramebuffer:pn,handleContextLoss:Tn})}Nt(Pt)}function ht(Ft,Nt,Ut,Pt,Ht,Qt,an,Yt){an===void 0&&(an=15),Yt===void 0&&(Yt=null),ut(Ft,function(nn){var tn=nn.gl,dn=nn.withProgram,wn=nn.withTexture;wn("copy",function(rn,Zt){tn.texImage2D(tn.TEXTURE_2D,0,tn.RGBA,Ht,Qt,0,tn.RGBA,tn.UNSIGNED_BYTE,Nt),dn("copy",at,st,function(vn){var Cn=vn.setUniform,$n=vn.setAttribute;$n("aUV",2,tn.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Cn("1i","image",Zt),tn.bindFramebuffer(tn.FRAMEBUFFER,Yt||null),tn.disable(tn.BLEND),tn.colorMask(an&8,an&4,an&2,an&1),tn.viewport(Ut,Pt,Ht,Qt),tn.scissor(Ut,Pt,Ht,Qt),tn.drawArrays(tn.TRIANGLES,0,3)})})})}function dt(Ft,Nt,Ut){var Pt=Ft.width,Ht=Ft.height;ut(Ft,function(Qt){var an=Qt.gl,Yt=new Uint8Array(Pt*Ht*4);an.readPixels(0,0,Pt,Ht,an.RGBA,an.UNSIGNED_BYTE,Yt),Ft.width=Nt,Ft.height=Ut,ht(an,Yt,0,0,Pt,Ht)})}var pt=Object.freeze({__proto__:null,withWebGLContext:ut,renderImageData:ht,resizeWebGLCanvasWithoutClearing:dt});function mt(Ft,Nt,Ut,Pt,Ht,Qt){Qt===void 0&&(Qt=1);var an=new Uint8Array(Ft*Nt),Yt=Pt[2]-Pt[0],nn=Pt[3]-Pt[1],tn=[];ot(Ut,function($n,Nn,En,sn){tn.push({x1:$n,y1:Nn,x2:En,y2:sn,minX:Math.min($n,En),minY:Math.min(Nn,sn),maxX:Math.max($n,En),maxY:Math.max(Nn,sn)})}),tn.sort(function($n,Nn){return $n.maxX-Nn.maxX});for(var dn=0;dnTn.minX&&Nn-snTn.minY){var In=bt($n,Nn,Tn.x1,Tn.y1,Tn.x2,Tn.y2);InNn!=pn.y2>Nn&&$n<(pn.x2-pn.x1)*(Nn-pn.y1)/(pn.y2-pn.y1)+pn.x1;Tn&&(En+=pn.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function gt(sn,pn){var Tn=36,In=0,yn=new Map,hn=pn&&new Map,fn;return sn.split(",").forEach(function xn(jn){if(jn.indexOf("+")!==-1)for(var cn=+jn;cn--;)xn(fn);else{fn=jn;var Xt=jn.split(">"),Kt=Xt[0],kn=Xt[1];Kt=String.fromCodePoint(In+=parseInt(Kt,Tn)),kn=String.fromCodePoint(In+=parseInt(kn,Tn)),yn.set(Kt,kn),pn&&hn.set(kn,Kt)}}),{map:yn,reverseMap:hn}}var yt,bt,wt;function xt(){if(!yt){var sn=gt(mt.pairs,!0),pn=sn.map,Tn=sn.reverseMap;yt=pn,bt=Tn,wt=gt(mt.canonical,!1).map}}function kt(sn){return xt(),yt.get(sn)||null}function St(sn){return xt(),bt.get(sn)||null}function Tt(sn){return xt(),wt.get(sn)||null}var At=rt.L,Et=rt.R,Ct=rt.EN,Lt=rt.ES,jt=rt.ET,Rt=rt.AN,$t=rt.CS,vt=rt.B,It=rt.S,Ot=rt.ON,Wt=rt.BN,zt=rt.NSM,Ft=rt.AL,Nt=rt.LRO,Ut=rt.RLO,Pt=rt.LRE,Ht=rt.RLE,Qt=rt.PDF,an=rt.LRI,Yt=rt.RLI,nn=rt.FSI,tn=rt.PDI;function dn(sn,pn){for(var Tn=125,In=new Uint32Array(sn.length),yn=0;yn0)Gn--;else if(Jn>0){for(zn=0;!Xn[Xn.length-1]._isolate;)Xn.pop();var Er=Xn[Xn.length-1]._isolInitIndex;Er!=null&&(jn.set(Er,Wn),jn.set(Wn,Er)),Xn.pop(),Jn--}Vn=Xn[Xn.length-1],xn[Wn]=Vn._level,Vn._override&&fn(Wn,Vn._override)}else fr&Qt?(Gn===0&&(zn>0?zn--:!Vn._isolate&&Xn.length>1&&(Xn.pop(),Vn=Xn[Xn.length-1])),xn[Wn]=Vn._level):fr&vt&&(xn[Wn]=Xt.level);else xn[Wn]=Vn._level,Vn._override&&fr!==Wt&&fn(Wn,Vn._override)}for(var Ir=[],Gr=null,Or=Xt.start;Or<=Xt.end;Or++){var Lr=In[Or];if(!(Lr<)){var oo=xn[Or],qr=Lr&ot,jr=Lr===tn;Gr&&oo===Gr._level?(Gr._end=Or,Gr._endsWithIsolInit=qr):Ir.push(Gr={_start:Or,_end:Or,_level:oo,_startsWithPDI:jr,_endsWithIsolInit:qr})}}for(var mo=[],_n=0;_n=0;Vr--)if(!(In[Vr]<)){lr=xn[Vr];break}var vr=Dn[Dn.length-1],Nr=xn[vr],Hr=Xt.level;if(!(In[vr]&ot)){for(var eo=vr+1;eo<=Xt.end;eo++)if(!(In[eo]<)){Hr=xn[eo];break}}mo.push({_seqIndices:Dn,_sosType:Math.max(lr,ar)%2?Et:At,_eosType:Math.max(Hr,Nr)%2?Et:At})}}for(var Jr=0;Jr=0;Rr--)if(!(In[br[Rr]]<)){Ur=In[br[Rr]];break}fn(Dr,Ur&(ot|tn)?Ot:Ur)}}if(hn.get(Ct))for(var er=0;er=-1;xr--){var dr=xr===-1?Pr:In[br[xr]];if(dr&at){dr===Ft&&fn(rr,Rt);break}}}if(hn.get(Ft))for(var yr=0;yr=0&&(ho=In[br[qn]],!!(ho<));qn--);for(var wo=no+1;wo=0&&In[br[yo]]&(jt|lt);yo--)fn(br[yo],Ct);for(vo++;vo=0&&In[br[zo]]<zo--)fn(br[zo],Ot);for(var Co=Ao+1;Co=0;eu--){var ip=fu[eu].char;if(ip===Pp||ip===St(Tt(No))||kt(Tt(ip))===No){Xo.push([fu[eu].seqIndex,_c]),fu.length=eu;break}}}Xo.sort(function(ys,$s){return ys[0]-$s[0]})}for(var Mp=0;Mp=0;qo--){var Yo=br[qo];if(In[Yo]&xa){var Xs=In[Yo]&Qo?Et:At;Xs!==Mr?Fs=Xs:Fs=Mr;break}}}if(Fs){if(In[br[es]]=In[br[pu]]=Fs,Fs!==Mr){for(var Us=es+1;Us=0;Vu--)if(In[br[Vu]]<)Bp=Vu;else{zs=In[br[Vu]]&Qo?Et:At;break}for(var ts=Fr,mu=Al+1;mu=0&&dt(sn[gu])&ct;gu--)xn[gu]=Xt.level}}return{levels:xn,paragraphs:cn};function Hu(ys,$s){for(var rs=ys;rs=xn&&dt(sn[Xt])&ct;Xt--)cn[Xt]=fn.level;for(var Kt=fn.level,kn=1/0,Mn=0;MnKt&&(Kt=On),On=kn;Bn--)for(var Xn=0;Xn=Bn){for(var Vn=Xn;Xn+1=Bn;)Xn++;Xn>Vn&&hn.push([Vn+xn,Xn+xn])}}}),hn}function Nn(sn,pn,Tn,In){var yn=En(sn,pn,Tn,In),hn=[].concat(sn);return yn.forEach(function(fn,xn){hn[xn]=(pn.levels[fn]&1?vn(sn[fn]):null)||sn[fn]}),hn.join("")}function En(sn,pn,Tn,In){for(var yn=$n(sn,pn,Tn,In),hn=[],fn=0;fn/gm;function nt(rt,it){let ot=ShaderChunk[it];return ot?expandShaderIncludes(ot):rt}return tt.replace(et,nt)}const _lut=[];for(let tt=0;tt<256;tt++)_lut[tt]=(tt<16?"0":"")+tt.toString(16);function generateUUID(){const tt=Math.random()*4294967295|0,et=Math.random()*4294967295|0,nt=Math.random()*4294967295|0,rt=Math.random()*4294967295|0;return(_lut[tt&255]+_lut[tt>>8&255]+_lut[tt>>16&255]+_lut[tt>>24&255]+"-"+_lut[et&255]+_lut[et>>8&255]+"-"+_lut[et>>16&15|64]+_lut[et>>24&255]+"-"+_lut[nt&63|128]+_lut[nt>>8&255]+"-"+_lut[nt>>16&255]+_lut[nt>>24&255]+_lut[rt&255]+_lut[rt>>8&255]+_lut[rt>>16&255]+_lut[rt>>24&255]).toUpperCase()}const assign$3=Object.assign||function(){let tt=arguments[0];for(let et=1,nt=arguments.length;et/gm,` //!BEGIN_POST_CHUNK $1 $& //!END_POST_CHUNK @@ -4051,8 +4051,8 @@ void main() { ${it} }`),tt}function optionsJsonReplacer(tt,et){return tt==="uniforms"?void 0:typeof et=="function"?et.toString():et}let _idCtr=0;const optionsHashesToIds=new Map;function getKeyForOptions(tt){const et=JSON.stringify(tt,optionsJsonReplacer);let nt=optionsHashesToIds.get(et);return nt==null&&optionsHashesToIds.set(et,nt=++_idCtr),nt}function createTypesetter(tt,et,nt){const{defaultFontURL:rt}=nt,it=Object.create(null),ot=1/0,at=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,st="[^\\S\\u00A0]",lt=new RegExp(`${st}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function ct(wt,xt){function kt(){const St=Tt=>{console.error(`Failure loading font ${wt}${wt===rt?"":"; trying fallback"}`,Tt),wt!==rt&&(wt=rt,kt())};try{const Tt=new XMLHttpRequest;Tt.open("get",wt,!0),Tt.responseType="arraybuffer",Tt.onload=function(){if(Tt.status>=400)St(new Error(Tt.statusText));else if(Tt.status>0)try{const At=tt(Tt.response);xt(At)}catch(At){St(At)}},Tt.onerror=St,Tt.send()}catch(Tt){St(Tt)}}kt()}function ut(wt,xt){wt||(wt=rt);let kt=it[wt];kt?kt.pending?kt.pending.push(xt):xt(kt):(it[wt]={pending:[xt]},ct(wt,St=>{let Tt=it[wt].pending;it[wt]=St,Tt.forEach(At=>At(St))}))}function ht({text:wt="",font:xt=rt,sdfGlyphSize:kt=64,fontSize:St=1,letterSpacing:Tt=0,lineHeight:At="normal",maxWidth:Et=ot,direction:Ct,textAlign:Lt="left",textIndent:jt=0,whiteSpace:Rt="normal",overflowWrap:$t="normal",anchorX:vt=0,anchorY:It=0,includeCaretPositions:Ot=!1,chunkedBoundsSize:Wt=8192,colorRanges:zt=null},Ft,Nt=!1){const Ut=gt(),Pt={fontLoad:0,typesetting:0};wt.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),wt=wt.replace(/\r\n/g,` `).replace(/\r/g,` -`)),St=+St,Tt=+Tt,Et=+Et,At=At||"normal",jt=+jt,ut(xt,Ht=>{const Qt=isFinite(Et);let an=null,Yt=null,nn=null,tn=null,dn=null,wn=null,rn=null,Jt=0,vn=0,Cn=Rt!=="nowrap";const{ascender:$n,descender:Nn,unitsPerEm:En,lineGap:sn,capHeight:pn,xHeight:Tn}=Ht;Pt.fontLoad=gt()-Ut;const In=gt(),yn=St/En;At==="normal"&&(At=($n-Nn+sn)/En),At=At*St;const hn=(At-($n-Nn)*yn)/2,fn=-($n*yn+hn),xn=Math.min(At,($n-Nn)*yn),jn=($n+Nn)/2*yn-xn/2;let cn=jt,Xt=new yt;const Kt=[Xt];Ht.forEachGlyph(wt,St,Tt,(On,Bn,Xn)=>{const Vn=wt.charAt(Xn),Gn=On.advanceWidth*yn,zn=Xt.count;let Zn;if("isEmpty"in On||(On.isWhitespace=!!Vn&&new RegExp(st).test(Vn),On.canBreakAfter=!!Vn&<.test(Vn),On.isEmpty=On.xMin===On.xMax||On.yMin===On.yMax||at.test(Vn)),!On.isWhitespace&&!On.isEmpty&&vn++,Cn&&Qt&&!On.isWhitespace&&Bn+Gn+cn>Et&&zn){if(Xt.glyphAt(zn-1).glyphObj.canBreakAfter)Zn=new yt,cn=-Bn;else for(let fr=zn;fr--;)if(fr===0&&$t==="break-word"){Zn=new yt,cn=-Bn;break}else if(Xt.glyphAt(fr).glyphObj.canBreakAfter){Zn=Xt.splitAt(fr+1);const ur=Zn.glyphAt(0).x;cn-=ur;for(let wr=Zn.count;wr--;)Zn.glyphAt(wr).x-=ur;break}Zn&&(Xt.isSoftWrapped=!0,Xt=Zn,Kt.push(Xt),Jt=Et)}let Wn=Xt.glyphAt(Xt.count);Wn.glyphObj=On,Wn.x=Bn+cn,Wn.width=Gn,Wn.charIndex=Xn,Vn===` -`&&(Xt=new yt,Kt.push(Xt),cn=-(Bn+Gn+Tt*St)+jt)}),Kt.forEach(On=>{for(let Bn=On.count;Bn--;){let{glyphObj:Xn,x:Vn,width:Gn}=On.glyphAt(Bn);if(!Xn.isWhitespace){On.width=Vn+Gn,On.width>Jt&&(Jt=On.width);return}}});let kn=0,Mn=0;if(vt&&(typeof vt=="number"?kn=-vt:typeof vt=="string"&&(kn=-Jt*(vt==="left"?0:vt==="center"?.5:vt==="right"?1:pt(vt)))),It){if(typeof It=="number")Mn=-It;else if(typeof It=="string"){let On=Kt.length*At;Mn=It==="top"?0:It==="top-baseline"?-fn:It==="top-cap"?-fn-pn*yn:It==="top-ex"?-fn-Tn*yn:It==="middle"?On/2:It==="bottom"?On:It==="bottom-baseline"?On-hn+Nn*yn:pt(It)*On}}if(!Nt){const On=et.getEmbeddingLevels(wt,Ct);an=new Uint16Array(vn),Yt=new Float32Array(vn*2),nn={},wn=[ot,ot,-ot,-ot],rn=[];let Bn=fn;Ot&&(dn=new Float32Array(wt.length*3)),zt&&(tn=new Uint8Array(vn*3));let Xn=0,Vn=-1,Gn=-1,zn,Zn;if(Kt.forEach((Wn,fr)=>{let{count:ur,width:wr}=Wn;if(ur>0){let Xr=0;for(let oo=ur;oo--&&Wn.glyphAt(oo).glyphObj.isWhitespace;)Xr++;let Er=0,Ir=0;if(Lt==="center")Er=(Jt-wr)/2;else if(Lt==="right")Er=Jt-wr;else if(Lt==="justify"&&Wn.isSoftWrapped){let oo=0;for(let qr=ur-Xr;qr--;)Wn.glyphAt(qr).glyphObj.isWhitespace&&oo++;Ir=(Jt-wr)/oo}if(Ir||Er){let oo=0;for(let qr=0;qr=qr){let un=Pn,Zt=Pn;for(;Ztjr)break;ZtOr=oo;for(let oo=0;oo1&&mt(dn,Vn,Zt),Vn=_n}if(zt){const{charIndex:_n}=qr;for(;_n>Gn;)Gn++,zt.hasOwnProperty(Gn)&&(Zn=zt[Gn])}if(!Or.isWhitespace&&!Or.isEmpty){const _n=Xn++;nn[jr]||(nn[jr]={path:Or.path,pathBounds:[Or.xMin,Or.yMin,Or.xMax,Or.yMax]});const Pn=qr.x+kn,un=Bn+Mn;Yt[_n*2]=Pn,Yt[_n*2+1]=un;const Zt=Pn+Or.xMin*yn,Sn=un+Or.yMin*yn,Dn=Pn+Or.xMax*yn,Fn=un+Or.yMax*yn;Ztwn[2]&&(wn[2]=Dn),Fn>wn[3]&&(wn[3]=Fn),_n%Wt===0&&(zn={start:_n,end:_n,rect:[ot,ot,-ot,-ot]},rn.push(zn)),zn.end++;const Yn=zn.rect;if(ZtYn[2]&&(Yn[2]=Dn),Fn>Yn[3]&&(Yn[3]=Fn),an[_n]=jr,zt){const tr=_n*3;tn[tr]=Zn>>16&255,tn[tr+1]=Zn>>8&255,tn[tr+2]=Zn&255}}}}Bn-=At}),dn){const Wn=wt.length-Vn;Wn>1&&mt(dn,Vn,Wn)}}Pt.typesetting=gt()-In,Ft({glyphIds:an,glyphPositions:Yt,glyphData:nn,caretPositions:dn,caretHeight:xn,glyphColors:tn,chunkedBounds:rn,fontSize:St,unitsPerEm:En,ascender:$n*yn,descender:Nn*yn,capHeight:pn*yn,xHeight:Tn*yn,lineHeight:At,topBaseline:fn,blockBounds:[kn,Mn-Kt.length*At,kn+Jt,Mn],visibleBounds:wn,timings:Pt})})}function dt(wt,xt){ht(wt,kt=>{const[St,Tt,At,Et]=kt.blockBounds;xt({width:At-St,height:Et-Tt})},{metricsOnly:!0})}function pt(wt){let xt=wt.match(/^([\d.]+)%$/),kt=xt?parseFloat(xt[1]):NaN;return isNaN(kt)?0:kt/100}function mt(wt,xt,kt){const St=wt[xt*3],Tt=wt[xt*3+1],At=wt[xt*3+2],Et=(Tt-St)/kt;for(let Ct=0;Ct(Object.defineProperty(wt,xt,{get(){return this.data[this.index*bt.length+kt]},set(Tt){this.data[this.index*bt.length+kt]=Tt}}),wt),{data:null,index:0}),{typeset:ht,measure:dt,loadFont:ut}}const now$2=()=>(self.performance||Date).now(),mainThreadGenerator=SDFGenerator();let warned;function generateSDF(tt,et,nt,rt,it,ot,at,st,lt,ct,ut=!0){return ut?generateSDF_GL(tt,et,nt,rt,it,ot,at,st,lt,ct).then(null,ht=>(warned||(console.warn("WebGL SDF generation failed, falling back to JS",ht),warned=!0),generateSDF_JS_Worker(tt,et,nt,rt,it,ot,at,st,lt,ct))):generateSDF_JS_Worker(tt,et,nt,rt,it,ot,at,st,lt,ct)}const queue$1=[],chunkTimeBudget=5;let timer=0;function nextChunk(){const tt=now$2();for(;queue$1.length&&now$2()-ttnew Promise((et,nt)=>{queue$1.push(()=>{const rt=now$2();try{mainThreadGenerator.webgl.generateIntoCanvas(...tt),et({timing:now$2()-rt})}catch(it){nt(it)}}),timer||(timer=setTimeout(nextChunk,0))}),threadCount=4,idleTimeout=2e3,threads={};let callNum=0;function generateSDF_JS_Worker(tt,et,nt,rt,it,ot,at,st,lt,ct){const ut="TroikaTextSDFGenerator_JS_"+callNum++%threadCount;let ht=threads[ut];return ht||(ht=threads[ut]={workerModule:defineWorkerModule({name:ut,workerId:ut,dependencies:[SDFGenerator,now$2],init(dt,pt){const mt=dt().javascript.generate;return function(...gt){const yt=pt();return{textureData:mt(...gt),timing:pt()-yt}}},getTransferables(dt){return[dt.textureData.buffer]}}),requests:0,idleTimer:null}),ht.requests++,clearTimeout(ht.idleTimer),ht.workerModule(tt,et,nt,rt,it,ot).then(({textureData:dt,timing:pt})=>{const mt=now$2(),gt=new Uint8Array(dt.length*4);for(let yt=0;yt{terminateWorker(ut)},idleTimeout)),{timing:pt}})}function warmUpSDFCanvas(tt){tt._warm||(mainThreadGenerator.webgl.isSupported(tt),tt._warm=!0)}const resizeWebGLCanvasWithoutClearing=mainThreadGenerator.webglUtils.resizeWebGLCanvasWithoutClearing;/*! +`)),St=+St,Tt=+Tt,Et=+Et,At=At||"normal",jt=+jt,ut(xt,Ht=>{const Qt=isFinite(Et);let an=null,Yt=null,nn=null,tn=null,dn=null,wn=null,rn=null,Zt=0,vn=0,Cn=Rt!=="nowrap";const{ascender:$n,descender:Nn,unitsPerEm:En,lineGap:sn,capHeight:pn,xHeight:Tn}=Ht;Pt.fontLoad=gt()-Ut;const In=gt(),yn=St/En;At==="normal"&&(At=($n-Nn+sn)/En),At=At*St;const hn=(At-($n-Nn)*yn)/2,fn=-($n*yn+hn),xn=Math.min(At,($n-Nn)*yn),jn=($n+Nn)/2*yn-xn/2;let cn=jt,Xt=new yt;const Kt=[Xt];Ht.forEachGlyph(wt,St,Tt,(On,Bn,Xn)=>{const Vn=wt.charAt(Xn),Gn=On.advanceWidth*yn,zn=Xt.count;let Jn;if("isEmpty"in On||(On.isWhitespace=!!Vn&&new RegExp(st).test(Vn),On.canBreakAfter=!!Vn&<.test(Vn),On.isEmpty=On.xMin===On.xMax||On.yMin===On.yMax||at.test(Vn)),!On.isWhitespace&&!On.isEmpty&&vn++,Cn&&Qt&&!On.isWhitespace&&Bn+Gn+cn>Et&&zn){if(Xt.glyphAt(zn-1).glyphObj.canBreakAfter)Jn=new yt,cn=-Bn;else for(let fr=zn;fr--;)if(fr===0&&$t==="break-word"){Jn=new yt,cn=-Bn;break}else if(Xt.glyphAt(fr).glyphObj.canBreakAfter){Jn=Xt.splitAt(fr+1);const ur=Jn.glyphAt(0).x;cn-=ur;for(let wr=Jn.count;wr--;)Jn.glyphAt(wr).x-=ur;break}Jn&&(Xt.isSoftWrapped=!0,Xt=Jn,Kt.push(Xt),Zt=Et)}let Wn=Xt.glyphAt(Xt.count);Wn.glyphObj=On,Wn.x=Bn+cn,Wn.width=Gn,Wn.charIndex=Xn,Vn===` +`&&(Xt=new yt,Kt.push(Xt),cn=-(Bn+Gn+Tt*St)+jt)}),Kt.forEach(On=>{for(let Bn=On.count;Bn--;){let{glyphObj:Xn,x:Vn,width:Gn}=On.glyphAt(Bn);if(!Xn.isWhitespace){On.width=Vn+Gn,On.width>Zt&&(Zt=On.width);return}}});let kn=0,Mn=0;if(vt&&(typeof vt=="number"?kn=-vt:typeof vt=="string"&&(kn=-Zt*(vt==="left"?0:vt==="center"?.5:vt==="right"?1:pt(vt)))),It){if(typeof It=="number")Mn=-It;else if(typeof It=="string"){let On=Kt.length*At;Mn=It==="top"?0:It==="top-baseline"?-fn:It==="top-cap"?-fn-pn*yn:It==="top-ex"?-fn-Tn*yn:It==="middle"?On/2:It==="bottom"?On:It==="bottom-baseline"?On-hn+Nn*yn:pt(It)*On}}if(!Nt){const On=et.getEmbeddingLevels(wt,Ct);an=new Uint16Array(vn),Yt=new Float32Array(vn*2),nn={},wn=[ot,ot,-ot,-ot],rn=[];let Bn=fn;Ot&&(dn=new Float32Array(wt.length*3)),zt&&(tn=new Uint8Array(vn*3));let Xn=0,Vn=-1,Gn=-1,zn,Jn;if(Kt.forEach((Wn,fr)=>{let{count:ur,width:wr}=Wn;if(ur>0){let Xr=0;for(let oo=ur;oo--&&Wn.glyphAt(oo).glyphObj.isWhitespace;)Xr++;let Er=0,Ir=0;if(Lt==="center")Er=(Zt-wr)/2;else if(Lt==="right")Er=Zt-wr;else if(Lt==="justify"&&Wn.isSoftWrapped){let oo=0;for(let qr=ur-Xr;qr--;)Wn.glyphAt(qr).glyphObj.isWhitespace&&oo++;Ir=(Zt-wr)/oo}if(Ir||Er){let oo=0;for(let qr=0;qr=qr){let un=Pn,Jt=Pn;for(;Jtjr)break;JtOr=oo;for(let oo=0;oo1&&mt(dn,Vn,Jt),Vn=_n}if(zt){const{charIndex:_n}=qr;for(;_n>Gn;)Gn++,zt.hasOwnProperty(Gn)&&(Jn=zt[Gn])}if(!Or.isWhitespace&&!Or.isEmpty){const _n=Xn++;nn[jr]||(nn[jr]={path:Or.path,pathBounds:[Or.xMin,Or.yMin,Or.xMax,Or.yMax]});const Pn=qr.x+kn,un=Bn+Mn;Yt[_n*2]=Pn,Yt[_n*2+1]=un;const Jt=Pn+Or.xMin*yn,Sn=un+Or.yMin*yn,Dn=Pn+Or.xMax*yn,Fn=un+Or.yMax*yn;Jtwn[2]&&(wn[2]=Dn),Fn>wn[3]&&(wn[3]=Fn),_n%Wt===0&&(zn={start:_n,end:_n,rect:[ot,ot,-ot,-ot]},rn.push(zn)),zn.end++;const Yn=zn.rect;if(JtYn[2]&&(Yn[2]=Dn),Fn>Yn[3]&&(Yn[3]=Fn),an[_n]=jr,zt){const tr=_n*3;tn[tr]=Jn>>16&255,tn[tr+1]=Jn>>8&255,tn[tr+2]=Jn&255}}}}Bn-=At}),dn){const Wn=wt.length-Vn;Wn>1&&mt(dn,Vn,Wn)}}Pt.typesetting=gt()-In,Ft({glyphIds:an,glyphPositions:Yt,glyphData:nn,caretPositions:dn,caretHeight:xn,glyphColors:tn,chunkedBounds:rn,fontSize:St,unitsPerEm:En,ascender:$n*yn,descender:Nn*yn,capHeight:pn*yn,xHeight:Tn*yn,lineHeight:At,topBaseline:fn,blockBounds:[kn,Mn-Kt.length*At,kn+Zt,Mn],visibleBounds:wn,timings:Pt})})}function dt(wt,xt){ht(wt,kt=>{const[St,Tt,At,Et]=kt.blockBounds;xt({width:At-St,height:Et-Tt})},{metricsOnly:!0})}function pt(wt){let xt=wt.match(/^([\d.]+)%$/),kt=xt?parseFloat(xt[1]):NaN;return isNaN(kt)?0:kt/100}function mt(wt,xt,kt){const St=wt[xt*3],Tt=wt[xt*3+1],At=wt[xt*3+2],Et=(Tt-St)/kt;for(let Ct=0;Ct(Object.defineProperty(wt,xt,{get(){return this.data[this.index*bt.length+kt]},set(Tt){this.data[this.index*bt.length+kt]=Tt}}),wt),{data:null,index:0}),{typeset:ht,measure:dt,loadFont:ut}}const now$2=()=>(self.performance||Date).now(),mainThreadGenerator=SDFGenerator();let warned;function generateSDF(tt,et,nt,rt,it,ot,at,st,lt,ct,ut=!0){return ut?generateSDF_GL(tt,et,nt,rt,it,ot,at,st,lt,ct).then(null,ht=>(warned||(console.warn("WebGL SDF generation failed, falling back to JS",ht),warned=!0),generateSDF_JS_Worker(tt,et,nt,rt,it,ot,at,st,lt,ct))):generateSDF_JS_Worker(tt,et,nt,rt,it,ot,at,st,lt,ct)}const queue$1=[],chunkTimeBudget=5;let timer=0;function nextChunk(){const tt=now$2();for(;queue$1.length&&now$2()-ttnew Promise((et,nt)=>{queue$1.push(()=>{const rt=now$2();try{mainThreadGenerator.webgl.generateIntoCanvas(...tt),et({timing:now$2()-rt})}catch(it){nt(it)}}),timer||(timer=setTimeout(nextChunk,0))}),threadCount=4,idleTimeout=2e3,threads={};let callNum=0;function generateSDF_JS_Worker(tt,et,nt,rt,it,ot,at,st,lt,ct){const ut="TroikaTextSDFGenerator_JS_"+callNum++%threadCount;let ht=threads[ut];return ht||(ht=threads[ut]={workerModule:defineWorkerModule({name:ut,workerId:ut,dependencies:[SDFGenerator,now$2],init(dt,pt){const mt=dt().javascript.generate;return function(...gt){const yt=pt();return{textureData:mt(...gt),timing:pt()-yt}}},getTransferables(dt){return[dt.textureData.buffer]}}),requests:0,idleTimer:null}),ht.requests++,clearTimeout(ht.idleTimer),ht.workerModule(tt,et,nt,rt,it,ot).then(({textureData:dt,timing:pt})=>{const mt=now$2(),gt=new Uint8Array(dt.length*4);for(let yt=0;yt{terminateWorker(ut)},idleTimeout)),{timing:pt}})}function warmUpSDFCanvas(tt){tt._warm||(mainThreadGenerator.webgl.isSupported(tt),tt._warm=!0)}const resizeWebGLCanvasWithoutClearing=mainThreadGenerator.webglUtils.resizeWebGLCanvasWithoutClearing;/*! Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering. Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE */function typrFactory(){return typeof window>"u"&&(self.window=self),function(tt){var et={parse:function(it){var ot=et._bin,at=new Uint8Array(it);if(ot.readASCII(at,0,4)=="ttcf"){var st=4;ot.readUshort(at,st),st+=2,ot.readUshort(at,st),st+=2;var lt=ot.readUint(at,st);st+=4;for(var ct=[],ut=0;ut>>at&1&&ot++;return ot},et._lctf.readClassDef=function(it,ot){var at=et._bin,st=[],lt=at.readUshort(it,ot);if(ot+=2,lt==1){var ct=at.readUshort(it,ot);ot+=2;var ut=at.readUshort(it,ot);ot+=2;for(var ht=0;ht0&&(lt.featureParams=st+ct);var ut=at.readUshort(it,ot);ot+=2,lt.tab=[];for(var ht=0;ht255?-1:et.CFF.glyphByUnicode(it,et.CFF.tableSE[ot])},et.CFF.readEncoding=function(it,ot,at){et._bin;var st=[".notdef"],lt=it[ot];if(ot++,lt!=0)throw"error: unknown encoding format: "+lt;var ct=it[ot];ot++;for(var ut=0;ut>4,wt=15&yt;if(bt!=15&>.push(bt),wt!=15&>.push(wt),wt==15)break}for(var xt="",kt=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],St=0;St=ct.xMax||ct.yMin>=ct.yMax)return null;if(ct.noc>0){ct.endPts=[];for(var ut=0;ut=1&&ut.fmt<=2){dt=lt.readUshort(it,at),at+=2;var mt=lt.readUshort(it,at);at+=2,pt=et._lctf.numOfOnes(dt);var gt=et._lctf.numOfOnes(mt);if(ut.fmt==1){ut.pairsets=[];var yt=lt.readUshort(it,at);at+=2;for(var bt=0;bt=1&&ut.fmt<=2){if(ut.fmt==1)ut.delta=lt.readShort(it,at),at+=2;else if(ut.fmt==2){var dt=lt.readUshort(it,at);at+=2,ut.newg=lt.readUshorts(it,at,dt),at+=2*ut.newg.length}}else if(ot==4){ut.vals=[],dt=lt.readUshort(it,at),at+=2;for(var pt=0;pt>>8;if((mt&=15)!=0)throw"unknown kern table format: "+mt;ot=et.kern.readFormat0(it,ot,ht)}return ht},et.kern.parseV1=function(it,ot,at,st){var lt=et._bin;lt.readFixed(it,ot),ot+=4;var ct=lt.readUint(it,ot);ot+=4;for(var ut={glyph1:[],rval:[]},ht=0;ht>>8;if((pt&=15)!=0)throw"unknown kern table format: "+pt;ot=et.kern.readFormat0(it,ot,ut)}return ut},et.kern.readFormat0=function(it,ot,at){var st=et._bin,lt=-1,ct=st.readUshort(it,ot);ot+=2,st.readUshort(it,ot),ot+=2,st.readUshort(it,ot),ot+=2,st.readUshort(it,ot),ot+=2;for(var ut=0;ut=lt.map.length?0:lt.map[ot];if(lt.format==4){for(var ct=-1,ut=0;utot?0:65535&(lt.idRangeOffset[ct]!=0?lt.glyphIdArray[ot-lt.startCount[ct]+(lt.idRangeOffset[ct]>>1)-(lt.idRangeOffset.length-ct)]:ot+lt.idDelta[ct])}if(lt.format==12){if(ot>lt.groups[lt.groups.length-1][1])return 0;for(ut=0;ut-1?et.U._simpleGlyph(st,at):et.U._compoGlyph(st,ot,at))},et.U._simpleGlyph=function(it,ot){for(var at=0;atlt)){for(var yt=!0,bt=0,wt=0;wtlt)){for(yt=!0,wt=0;wt>1,ct.length=0,ht=!0;else if(Rt=="o3"||Rt=="o23")ct.length%2!=0&&!ht&&(dt=ct.shift()+st.nominalWidthX),ut+=ct.length>>1,ct.length=0,ht=!0;else if(Rt=="o4")ct.length>1&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),pt&&et.U.P.closePath(lt),yt+=ct.pop(),et.U.P.moveTo(lt,gt,yt),pt=!0;else if(Rt=="o5")for(;ct.length>0;)gt+=ct.shift(),yt+=ct.shift(),et.U.P.lineTo(lt,gt,yt);else if(Rt=="o6"||Rt=="o7")for(var $t=ct.length,vt=Rt=="o6",It=0;It<$t;It++){var Ot=ct.shift();vt?gt+=Ot:yt+=Ot,vt=!vt,et.U.P.lineTo(lt,gt,yt)}else if(Rt=="o8"||Rt=="o24"){$t=ct.length;for(var Wt=0;Wt+6<=$t;)bt=gt+ct.shift(),wt=yt+ct.shift(),xt=bt+ct.shift(),kt=wt+ct.shift(),gt=xt+ct.shift(),yt=kt+ct.shift(),et.U.P.curveTo(lt,bt,wt,xt,kt,gt,yt),Wt+=6;Rt=="o24"&&(gt+=ct.shift(),yt+=ct.shift(),et.U.P.lineTo(lt,gt,yt))}else{if(Rt=="o11")break;if(Rt=="o1234"||Rt=="o1235"||Rt=="o1236"||Rt=="o1237")Rt=="o1234"&&(wt=yt,xt=(bt=gt+ct.shift())+ct.shift(),Lt=kt=wt+ct.shift(),Tt=kt,Et=yt,gt=(At=(St=(Ct=xt+ct.shift())+ct.shift())+ct.shift())+ct.shift(),et.U.P.curveTo(lt,bt,wt,xt,kt,Ct,Lt),et.U.P.curveTo(lt,St,Tt,At,Et,gt,yt)),Rt=="o1235"&&(bt=gt+ct.shift(),wt=yt+ct.shift(),xt=bt+ct.shift(),kt=wt+ct.shift(),Ct=xt+ct.shift(),Lt=kt+ct.shift(),St=Ct+ct.shift(),Tt=Lt+ct.shift(),At=St+ct.shift(),Et=Tt+ct.shift(),gt=At+ct.shift(),yt=Et+ct.shift(),ct.shift(),et.U.P.curveTo(lt,bt,wt,xt,kt,Ct,Lt),et.U.P.curveTo(lt,St,Tt,At,Et,gt,yt)),Rt=="o1236"&&(bt=gt+ct.shift(),wt=yt+ct.shift(),xt=bt+ct.shift(),Lt=kt=wt+ct.shift(),Tt=kt,At=(St=(Ct=xt+ct.shift())+ct.shift())+ct.shift(),Et=Tt+ct.shift(),gt=At+ct.shift(),et.U.P.curveTo(lt,bt,wt,xt,kt,Ct,Lt),et.U.P.curveTo(lt,St,Tt,At,Et,gt,yt)),Rt=="o1237"&&(bt=gt+ct.shift(),wt=yt+ct.shift(),xt=bt+ct.shift(),kt=wt+ct.shift(),Ct=xt+ct.shift(),Lt=kt+ct.shift(),St=Ct+ct.shift(),Tt=Lt+ct.shift(),At=St+ct.shift(),Et=Tt+ct.shift(),Math.abs(At-gt)>Math.abs(Et-yt)?gt=At+ct.shift():yt=Et+ct.shift(),et.U.P.curveTo(lt,bt,wt,xt,kt,Ct,Lt),et.U.P.curveTo(lt,St,Tt,At,Et,gt,yt));else if(Rt=="o14"){if(ct.length>0&&!ht&&(dt=ct.shift()+at.nominalWidthX,ht=!0),ct.length==4){var zt=ct.shift(),Ft=ct.shift(),Nt=ct.shift(),Ut=ct.shift(),Pt=et.CFF.glyphBySE(at,Nt),Ht=et.CFF.glyphBySE(at,Ut);et.U._drawCFF(at.CharStrings[Pt],ot,at,st,lt),ot.x=zt,ot.y=Ft,et.U._drawCFF(at.CharStrings[Ht],ot,at,st,lt)}pt&&(et.U.P.closePath(lt),pt=!1)}else if(Rt=="o19"||Rt=="o20")ct.length%2!=0&&!ht&&(dt=ct.shift()+st.nominalWidthX),ut+=ct.length>>1,ct.length=0,ht=!0,mt+=ut+7>>3;else if(Rt=="o21")ct.length>2&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),yt+=ct.pop(),gt+=ct.pop(),pt&&et.U.P.closePath(lt),et.U.P.moveTo(lt,gt,yt),pt=!0;else if(Rt=="o22")ct.length>1&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),gt+=ct.pop(),pt&&et.U.P.closePath(lt),et.U.P.moveTo(lt,gt,yt),pt=!0;else if(Rt=="o25"){for(;ct.length>6;)gt+=ct.shift(),yt+=ct.shift(),et.U.P.lineTo(lt,gt,yt);bt=gt+ct.shift(),wt=yt+ct.shift(),xt=bt+ct.shift(),kt=wt+ct.shift(),gt=xt+ct.shift(),yt=kt+ct.shift(),et.U.P.curveTo(lt,bt,wt,xt,kt,gt,yt)}else if(Rt=="o26")for(ct.length%2&&(gt+=ct.shift());ct.length>0;)bt=gt,wt=yt+ct.shift(),gt=xt=bt+ct.shift(),yt=(kt=wt+ct.shift())+ct.shift(),et.U.P.curveTo(lt,bt,wt,xt,kt,gt,yt);else if(Rt=="o27")for(ct.length%2&&(yt+=ct.shift());ct.length>0;)wt=yt,xt=(bt=gt+ct.shift())+ct.shift(),kt=wt+ct.shift(),gt=xt+ct.shift(),yt=kt,et.U.P.curveTo(lt,bt,wt,xt,kt,gt,yt);else if(Rt=="o10"||Rt=="o29"){var Qt=Rt=="o10"?st:at;if(ct.length==0)console.debug("error: empty stack");else{var an=ct.pop(),Yt=Qt.Subrs[an+Qt.Bias];ot.x=gt,ot.y=yt,ot.nStems=ut,ot.haveWidth=ht,ot.width=dt,ot.open=pt,et.U._drawCFF(Yt,ot,at,st,lt),gt=ot.x,yt=ot.y,ut=ot.nStems,ht=ot.haveWidth,dt=ot.width,pt=ot.open}}else if(Rt=="o30"||Rt=="o31"){var nn=ct.length,tn=(Wt=0,Rt=="o31");for(Wt+=nn-($t=-3&nn);Wt<$t;)tn?(wt=yt,xt=(bt=gt+ct.shift())+ct.shift(),yt=(kt=wt+ct.shift())+ct.shift(),$t-Wt==5?(gt=xt+ct.shift(),Wt++):gt=xt,tn=!1):(bt=gt,wt=yt+ct.shift(),xt=bt+ct.shift(),kt=wt+ct.shift(),gt=xt+ct.shift(),$t-Wt==5?(yt=kt+ct.shift(),Wt++):yt=kt,tn=!0),et.U.P.curveTo(lt,bt,wt,xt,kt,gt,yt),Wt+=4}else{if((Rt+"").charAt(0)=="o")throw console.debug("Unknown operation: "+Rt,it),Rt;ct.push(Rt)}}}ot.x=gt,ot.y=yt,ot.nStems=ut,ot.haveWidth=ht,ot.width=dt,ot.open=pt};var nt=et,rt={Typr:nt};return tt.Typr=nt,tt.default=rt,Object.defineProperty(tt,"__esModule",{value:!0}),tt}({}).Typr}/*! @@ -4061,7 +4061,7 @@ Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate Original licenses apply: - fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT) - woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2) -*/function woff2otfFactory(){return function(tt){var et=Uint8Array,nt=Uint16Array,rt=Uint32Array,it=new et([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ot=new et([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),at=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),st=function(Rt,$t){for(var vt=new nt(31),It=0;It<31;++It)vt[It]=$t+=1<>>1|(21845&pt)<<1;mt=(61680&(mt=(52428&mt)>>>2|(13107&mt)<<2))>>>4|(3855&mt)<<4,dt[pt]=((65280&mt)>>>8|(255&mt)<<8)>>>1}var gt=function(Rt,$t,vt){for(var It=Rt.length,Ot=0,Wt=new nt($t);Ot>>Nt]=Ut}else for(zt=new nt(It),Ot=0;Ot>>15-Rt[Ot]);return zt},yt=new et(288);for(pt=0;pt<144;++pt)yt[pt]=8;for(pt=144;pt<256;++pt)yt[pt]=9;for(pt=256;pt<280;++pt)yt[pt]=7;for(pt=280;pt<288;++pt)yt[pt]=8;var bt=new et(32);for(pt=0;pt<32;++pt)bt[pt]=5;var wt=gt(yt,9,1),xt=gt(bt,5,1),kt=function(Rt){for(var $t=Rt[0],vt=1;vt$t&&($t=Rt[vt]);return $t},St=function(Rt,$t,vt){var It=$t/8|0;return(Rt[It]|Rt[It+1]<<8)>>(7&$t)&vt},Tt=function(Rt,$t){var vt=$t/8|0;return(Rt[vt]|Rt[vt+1]<<8|Rt[vt+2]<<16)>>(7&$t)},At=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Et=function(Rt,$t,vt){var It=new Error($t||At[Rt]);if(It.code=Rt,Error.captureStackTrace&&Error.captureStackTrace(It,Et),!vt)throw It;return It},Ct=function(Rt,$t,vt){var It=Rt.length;if(!It||vt&&!vt.l&&It<5)return $t||new et(0);var Ot=!$t||vt,Wt=!vt||vt.i;vt||(vt={}),$t||($t=new et(3*It));var zt,Ft=function(Vn){var Gn=$t.length;if(Vn>Gn){var zn=new et(Math.max(2*Gn,Vn));zn.set($t),$t=zn}},Nt=vt.f||0,Ut=vt.p||0,Pt=vt.b||0,Ht=vt.l,Qt=vt.d,an=vt.m,Yt=vt.n,nn=8*It;do{if(!Ht){vt.f=Nt=St(Rt,Ut,1);var tn=St(Rt,Ut+1,3);if(Ut+=3,!tn){var dn=Rt[(Tn=((zt=Ut)/8|0)+(7&zt&&1)+4)-4]|Rt[Tn-3]<<8,wn=Tn+dn;if(wn>It){Wt&&Et(0);break}Ot&&Ft(Pt+dn),$t.set(Rt.subarray(Tn,wn),Pt),vt.b=Pt+=dn,vt.p=Ut=8*wn;continue}if(tn==1)Ht=wt,Qt=xt,an=9,Yt=5;else if(tn==2){var rn=St(Rt,Ut,31)+257,Jt=St(Rt,Ut+10,15)+4,vn=rn+St(Rt,Ut+5,31)+1;Ut+=14;for(var Cn=new et(vn),$n=new et(19),Nn=0;Nn>>4)<16)Cn[Nn++]=Tn;else{var yn=0,hn=0;for(Tn==16?(hn=3+St(Rt,Ut,3),Ut+=2,yn=Cn[Nn-1]):Tn==17?(hn=3+St(Rt,Ut,7),Ut+=3):Tn==18&&(hn=11+St(Rt,Ut,127),Ut+=7);hn--;)Cn[Nn++]=yn}}var fn=Cn.subarray(0,rn),xn=Cn.subarray(rn);an=kt(fn),Yt=kt(xn),Ht=gt(fn,an,1),Qt=gt(xn,Yt,1)}else Et(1);if(Ut>nn){Wt&&Et(0);break}}Ot&&Ft(Pt+131072);for(var jn=(1<>>4;if((Ut+=15&yn)>nn){Wt&&Et(0);break}if(yn||Et(2),Kt<256)$t[Pt++]=Kt;else{if(Kt==256){Xt=Ut,Ht=null;break}var kn=Kt-254;if(Kt>264){var Mn=it[Nn=Kt-257];kn=St(Rt,Ut,(1<>>4;if(On||Et(3),Ut+=15&On,xn=ht[Bn],Bn>3&&(Mn=ot[Bn],xn+=Tt(Rt,Ut)&(1<nn){Wt&&Et(0);break}Ot&&Ft(Pt+131072);for(var Xn=Pt+kn;PtVn.length)&&(zn=Vn.length);var Zn=new(Vn instanceof nt?nt:Vn instanceof rt?rt:et)(zn-Gn);return Zn.set(Vn.subarray(Gn,zn)),Zn}($t,0,Pt)},Lt=new et(0),jt=typeof TextDecoder<"u"&&new TextDecoder;try{jt.decode(Lt,{stream:!0})}catch{}return tt.convert_streams=function(Rt){var $t=new DataView(Rt),vt=0;function It(){var rn=$t.getUint16(vt);return vt+=2,rn}function Ot(){var rn=$t.getUint32(vt);return vt+=4,rn}function Wt(rn){dn.setUint16(wn,rn),wn+=2}function zt(rn){dn.setUint32(wn,rn),wn+=4}for(var Ft={signature:Ot(),flavor:Ot(),length:Ot(),numTables:It(),reserved:It(),totalSfntSize:Ot(),majorVersion:It(),minorVersion:It(),metaOffset:Ot(),metaLength:Ot(),metaOrigLength:Ot(),privOffset:Ot(),privLength:Ot()},Nt=0;Math.pow(2,Nt)<=Ft.numTables;)Nt++;Nt--;for(var Ut=16*Math.pow(2,Nt),Pt=16*Ft.numTables-Ut,Ht=12,Qt=[],an=0;an{let[Lt,jt]=Ct.split("+");Lt=parseInt(Lt,36),jt=jt?parseInt(jt,36):0,ut.set(Et+=Lt,Tt[At]);for(let Rt=jt;Rt--;)ut.set(++Et,Tt[At])})}}return ut.get(St)||ct}const dt=1,pt=2,mt=3,gt=4,yt=[null,"isol","init","fina","medi"];function bt(St){const Tt=new Uint8Array(St.length);let At=ct,Et=dt,Ct=-1;for(let Lt=0;Lt65535&&Lt++)}return Tt}function wt(St,Tt){const At=[];for(let Ct=0;Ct65535&&Ct++,At.push(tt.U.codeToGlyph(St,Lt))}const Et=St.GSUB;if(Et){const{lookupList:Ct,featureList:Lt}=Et;let jt;const Rt=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,$t=[];Lt.forEach(vt=>{if(Rt.test(vt.tag))for(let It=0;It{if(Ut!==-1){let Ht=Tt[Ut];if(!Ht){const{cmds:Qt,crds:an}=tt.U.glyphToPath(St,Ut);let Yt="",nn=0;for(let Jt=0,vn=Qt.length;Jt1?",":"")+an[nn++]}let tn,dn,wn,rn;if(an.length){tn=dn=1/0,wn=rn=-1/0;for(let Jt=0,vn=an.length;Jtwn&&(wn=Cn),$n>rn&&(rn=$n)}}else tn=wn=dn=rn=0;Ht=Tt[Ut]={index:Ut,advanceWidth:St.hmtx.aWidth[Ut],xMin:tn,yMin:dn,xMax:wn,yMax:rn,path:Yt,pathCommandCount:Qt.length}}Nt!==-1&&(Ot+=tt.U.getPairAdjustment(St,Nt,Ut)*Wt),It.call(null,Ht,Ot,Ft),Ht.advanceWidth&&(Ot+=Ht.advanceWidth*Wt),vt&&(Ot+=vt*$t),Nt=Ut}Ft+=Rt.codePointAt(Ft)>65535?2:1}),Ot}};return jt}return function(Tt){const At=new Uint8Array(Tt,0,4),Et=tt._bin.readASCII(At,0,4);if(Et==="wOFF")Tt=et(Tt);else if(Et==="wOF2")throw new Error("woff2 fonts not supported");return kt(tt.parse(Tt)[0])}}const workerModule=defineWorkerModule({name:"Typr Font Parser",dependencies:[typrFactory,woff2otfFactory,parserFactory],init(tt,et,nt){const rt=tt(),it=et();return nt(rt,it)}}),CONFIG={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},tempColor=new Color$1;function now$1$1(){return(self.performance||Date).now()}const atlases=Object.create(null);function getTextRenderInfo(tt,et){tt=assign$2({},tt);const nt=now$1$1();if(tt.font=toAbsoluteURL(tt.font||CONFIG.defaultFontURL),tt.text=""+tt.text,tt.sdfGlyphSize=tt.sdfGlyphSize||CONFIG.sdfGlyphSize,tt.colorRanges!=null){let ht={};for(let dt in tt.colorRanges)if(tt.colorRanges.hasOwnProperty(dt)){let pt=tt.colorRanges[dt];typeof pt!="number"&&(pt=tempColor.set(pt).getHex()),ht[dt]=pt}tt.colorRanges=ht}Object.freeze(tt);const{textureWidth:rt,sdfExponent:it}=CONFIG,{sdfGlyphSize:ot}=tt,at=rt/ot*4;let st=atlases[ot];if(!st){const ht=document.createElement("canvas");ht.width=rt,ht.height=ot*256/at,st=atlases[ot]={glyphCount:0,sdfGlyphSize:ot,sdfCanvas:ht,sdfTexture:new Texture(ht,void 0,void 0,void 0,LinearFilter,LinearFilter),contextLost:!1,glyphsByFont:new Map},st.sdfTexture.generateMipmaps=!1,initContextLossHandling(st)}const{sdfTexture:lt,sdfCanvas:ct}=st;let ut=st.glyphsByFont.get(tt.font);ut||st.glyphsByFont.set(tt.font,ut=new Map),typesetInWorker(tt).then(ht=>{const{glyphIds:dt,glyphPositions:pt,fontSize:mt,unitsPerEm:gt,timings:yt}=ht,bt=[],wt=new Float32Array(dt.length*4),xt=mt/gt;let kt=0,St=0;const Tt=now$1$1();dt.forEach((jt,Rt)=>{let $t=ut.get(jt);if(!$t){const{path:Wt,pathBounds:zt}=ht.glyphData[jt],Ft=Math.max(zt[2]-zt[0],zt[3]-zt[1])/ot*(CONFIG.sdfMargin*ot+.5),Nt=st.glyphCount++,Ut=[zt[0]-Ft,zt[1]-Ft,zt[2]+Ft,zt[3]+Ft];ut.set(jt,$t={path:Wt,atlasIndex:Nt,sdfViewBox:Ut}),bt.push($t)}const{sdfViewBox:vt}=$t,It=pt[St++],Ot=pt[St++];wt[kt++]=It+vt[0]*xt,wt[kt++]=Ot+vt[1]*xt,wt[kt++]=It+vt[2]*xt,wt[kt++]=Ot+vt[3]*xt,dt[Rt]=$t.atlasIndex}),yt.quads=(yt.quads||0)+(now$1$1()-Tt);const At=now$1$1();yt.sdf={};const Et=ct.height,Ct=Math.ceil(st.glyphCount/at),Lt=Math.pow(2,Math.ceil(Math.log2(Ct*ot)));Lt>Et&&(console.info(`Increasing SDF texture size ${Et}->${Lt}`),resizeWebGLCanvasWithoutClearing(ct,rt,Lt),lt.dispose()),Promise.all(bt.map(jt=>generateGlyphSDF(jt,st,tt.gpuAccelerateSDF).then(({timing:Rt})=>{yt.sdf[jt.atlasIndex]=Rt}))).then(()=>{bt.length&&!st.contextLost&&(safariPre15Workaround(st),lt.needsUpdate=!0),yt.sdfTotal=now$1$1()-At,yt.total=now$1$1()-nt,et(Object.freeze({parameters:tt,sdfTexture:lt,sdfGlyphSize:ot,sdfExponent:it,glyphBounds:wt,glyphAtlasIndices:dt,glyphColors:ht.glyphColors,caretPositions:ht.caretPositions,caretHeight:ht.caretHeight,chunkedBounds:ht.chunkedBounds,ascender:ht.ascender,descender:ht.descender,lineHeight:ht.lineHeight,capHeight:ht.capHeight,xHeight:ht.xHeight,topBaseline:ht.topBaseline,blockBounds:ht.blockBounds,visibleBounds:ht.visibleBounds,timings:ht.timings}))})}),Promise.resolve().then(()=>{st.contextLost||warmUpSDFCanvas(ct)})}function generateGlyphSDF({path:tt,atlasIndex:et,sdfViewBox:nt},{sdfGlyphSize:rt,sdfCanvas:it,contextLost:ot},at){if(ot)return Promise.resolve({timing:-1});const{textureWidth:st,sdfExponent:lt}=CONFIG,ct=Math.max(nt[2]-nt[0],nt[3]-nt[1]),ut=Math.floor(et/4),ht=ut%(st/rt)*rt,dt=Math.floor(ut/(st/rt))*rt,pt=et%4;return generateSDF(rt,rt,tt,nt,ct,lt,it,ht,dt,pt,at)}function initContextLossHandling(tt){const et=tt.sdfCanvas;et.addEventListener("webglcontextlost",nt=>{console.log("Context Lost",nt),nt.preventDefault(),tt.contextLost=!0}),et.addEventListener("webglcontextrestored",nt=>{console.log("Context Restored",nt),tt.contextLost=!1;const rt=[];tt.glyphsByFont.forEach(it=>{it.forEach(ot=>{rt.push(generateGlyphSDF(ot,tt,!0))})}),Promise.all(rt).then(()=>{safariPre15Workaround(tt),tt.sdfTexture.needsUpdate=!0})})}function preloadFont({font:tt,characters:et,sdfGlyphSize:nt},rt){let it=Array.isArray(et)?et.join(` +*/function woff2otfFactory(){return function(tt){var et=Uint8Array,nt=Uint16Array,rt=Uint32Array,it=new et([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ot=new et([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),at=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),st=function(Rt,$t){for(var vt=new nt(31),It=0;It<31;++It)vt[It]=$t+=1<>>1|(21845&pt)<<1;mt=(61680&(mt=(52428&mt)>>>2|(13107&mt)<<2))>>>4|(3855&mt)<<4,dt[pt]=((65280&mt)>>>8|(255&mt)<<8)>>>1}var gt=function(Rt,$t,vt){for(var It=Rt.length,Ot=0,Wt=new nt($t);Ot>>Nt]=Ut}else for(zt=new nt(It),Ot=0;Ot>>15-Rt[Ot]);return zt},yt=new et(288);for(pt=0;pt<144;++pt)yt[pt]=8;for(pt=144;pt<256;++pt)yt[pt]=9;for(pt=256;pt<280;++pt)yt[pt]=7;for(pt=280;pt<288;++pt)yt[pt]=8;var bt=new et(32);for(pt=0;pt<32;++pt)bt[pt]=5;var wt=gt(yt,9,1),xt=gt(bt,5,1),kt=function(Rt){for(var $t=Rt[0],vt=1;vt$t&&($t=Rt[vt]);return $t},St=function(Rt,$t,vt){var It=$t/8|0;return(Rt[It]|Rt[It+1]<<8)>>(7&$t)&vt},Tt=function(Rt,$t){var vt=$t/8|0;return(Rt[vt]|Rt[vt+1]<<8|Rt[vt+2]<<16)>>(7&$t)},At=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Et=function(Rt,$t,vt){var It=new Error($t||At[Rt]);if(It.code=Rt,Error.captureStackTrace&&Error.captureStackTrace(It,Et),!vt)throw It;return It},Ct=function(Rt,$t,vt){var It=Rt.length;if(!It||vt&&!vt.l&&It<5)return $t||new et(0);var Ot=!$t||vt,Wt=!vt||vt.i;vt||(vt={}),$t||($t=new et(3*It));var zt,Ft=function(Vn){var Gn=$t.length;if(Vn>Gn){var zn=new et(Math.max(2*Gn,Vn));zn.set($t),$t=zn}},Nt=vt.f||0,Ut=vt.p||0,Pt=vt.b||0,Ht=vt.l,Qt=vt.d,an=vt.m,Yt=vt.n,nn=8*It;do{if(!Ht){vt.f=Nt=St(Rt,Ut,1);var tn=St(Rt,Ut+1,3);if(Ut+=3,!tn){var dn=Rt[(Tn=((zt=Ut)/8|0)+(7&zt&&1)+4)-4]|Rt[Tn-3]<<8,wn=Tn+dn;if(wn>It){Wt&&Et(0);break}Ot&&Ft(Pt+dn),$t.set(Rt.subarray(Tn,wn),Pt),vt.b=Pt+=dn,vt.p=Ut=8*wn;continue}if(tn==1)Ht=wt,Qt=xt,an=9,Yt=5;else if(tn==2){var rn=St(Rt,Ut,31)+257,Zt=St(Rt,Ut+10,15)+4,vn=rn+St(Rt,Ut+5,31)+1;Ut+=14;for(var Cn=new et(vn),$n=new et(19),Nn=0;Nn>>4)<16)Cn[Nn++]=Tn;else{var yn=0,hn=0;for(Tn==16?(hn=3+St(Rt,Ut,3),Ut+=2,yn=Cn[Nn-1]):Tn==17?(hn=3+St(Rt,Ut,7),Ut+=3):Tn==18&&(hn=11+St(Rt,Ut,127),Ut+=7);hn--;)Cn[Nn++]=yn}}var fn=Cn.subarray(0,rn),xn=Cn.subarray(rn);an=kt(fn),Yt=kt(xn),Ht=gt(fn,an,1),Qt=gt(xn,Yt,1)}else Et(1);if(Ut>nn){Wt&&Et(0);break}}Ot&&Ft(Pt+131072);for(var jn=(1<>>4;if((Ut+=15&yn)>nn){Wt&&Et(0);break}if(yn||Et(2),Kt<256)$t[Pt++]=Kt;else{if(Kt==256){Xt=Ut,Ht=null;break}var kn=Kt-254;if(Kt>264){var Mn=it[Nn=Kt-257];kn=St(Rt,Ut,(1<>>4;if(On||Et(3),Ut+=15&On,xn=ht[Bn],Bn>3&&(Mn=ot[Bn],xn+=Tt(Rt,Ut)&(1<nn){Wt&&Et(0);break}Ot&&Ft(Pt+131072);for(var Xn=Pt+kn;PtVn.length)&&(zn=Vn.length);var Jn=new(Vn instanceof nt?nt:Vn instanceof rt?rt:et)(zn-Gn);return Jn.set(Vn.subarray(Gn,zn)),Jn}($t,0,Pt)},Lt=new et(0),jt=typeof TextDecoder<"u"&&new TextDecoder;try{jt.decode(Lt,{stream:!0})}catch{}return tt.convert_streams=function(Rt){var $t=new DataView(Rt),vt=0;function It(){var rn=$t.getUint16(vt);return vt+=2,rn}function Ot(){var rn=$t.getUint32(vt);return vt+=4,rn}function Wt(rn){dn.setUint16(wn,rn),wn+=2}function zt(rn){dn.setUint32(wn,rn),wn+=4}for(var Ft={signature:Ot(),flavor:Ot(),length:Ot(),numTables:It(),reserved:It(),totalSfntSize:Ot(),majorVersion:It(),minorVersion:It(),metaOffset:Ot(),metaLength:Ot(),metaOrigLength:Ot(),privOffset:Ot(),privLength:Ot()},Nt=0;Math.pow(2,Nt)<=Ft.numTables;)Nt++;Nt--;for(var Ut=16*Math.pow(2,Nt),Pt=16*Ft.numTables-Ut,Ht=12,Qt=[],an=0;an{let[Lt,jt]=Ct.split("+");Lt=parseInt(Lt,36),jt=jt?parseInt(jt,36):0,ut.set(Et+=Lt,Tt[At]);for(let Rt=jt;Rt--;)ut.set(++Et,Tt[At])})}}return ut.get(St)||ct}const dt=1,pt=2,mt=3,gt=4,yt=[null,"isol","init","fina","medi"];function bt(St){const Tt=new Uint8Array(St.length);let At=ct,Et=dt,Ct=-1;for(let Lt=0;Lt65535&&Lt++)}return Tt}function wt(St,Tt){const At=[];for(let Ct=0;Ct65535&&Ct++,At.push(tt.U.codeToGlyph(St,Lt))}const Et=St.GSUB;if(Et){const{lookupList:Ct,featureList:Lt}=Et;let jt;const Rt=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,$t=[];Lt.forEach(vt=>{if(Rt.test(vt.tag))for(let It=0;It{if(Ut!==-1){let Ht=Tt[Ut];if(!Ht){const{cmds:Qt,crds:an}=tt.U.glyphToPath(St,Ut);let Yt="",nn=0;for(let Zt=0,vn=Qt.length;Zt1?",":"")+an[nn++]}let tn,dn,wn,rn;if(an.length){tn=dn=1/0,wn=rn=-1/0;for(let Zt=0,vn=an.length;Ztwn&&(wn=Cn),$n>rn&&(rn=$n)}}else tn=wn=dn=rn=0;Ht=Tt[Ut]={index:Ut,advanceWidth:St.hmtx.aWidth[Ut],xMin:tn,yMin:dn,xMax:wn,yMax:rn,path:Yt,pathCommandCount:Qt.length}}Nt!==-1&&(Ot+=tt.U.getPairAdjustment(St,Nt,Ut)*Wt),It.call(null,Ht,Ot,Ft),Ht.advanceWidth&&(Ot+=Ht.advanceWidth*Wt),vt&&(Ot+=vt*$t),Nt=Ut}Ft+=Rt.codePointAt(Ft)>65535?2:1}),Ot}};return jt}return function(Tt){const At=new Uint8Array(Tt,0,4),Et=tt._bin.readASCII(At,0,4);if(Et==="wOFF")Tt=et(Tt);else if(Et==="wOF2")throw new Error("woff2 fonts not supported");return kt(tt.parse(Tt)[0])}}const workerModule=defineWorkerModule({name:"Typr Font Parser",dependencies:[typrFactory,woff2otfFactory,parserFactory],init(tt,et,nt){const rt=tt(),it=et();return nt(rt,it)}}),CONFIG={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},tempColor=new Color$1;function now$1$1(){return(self.performance||Date).now()}const atlases=Object.create(null);function getTextRenderInfo(tt,et){tt=assign$2({},tt);const nt=now$1$1();if(tt.font=toAbsoluteURL(tt.font||CONFIG.defaultFontURL),tt.text=""+tt.text,tt.sdfGlyphSize=tt.sdfGlyphSize||CONFIG.sdfGlyphSize,tt.colorRanges!=null){let ht={};for(let dt in tt.colorRanges)if(tt.colorRanges.hasOwnProperty(dt)){let pt=tt.colorRanges[dt];typeof pt!="number"&&(pt=tempColor.set(pt).getHex()),ht[dt]=pt}tt.colorRanges=ht}Object.freeze(tt);const{textureWidth:rt,sdfExponent:it}=CONFIG,{sdfGlyphSize:ot}=tt,at=rt/ot*4;let st=atlases[ot];if(!st){const ht=document.createElement("canvas");ht.width=rt,ht.height=ot*256/at,st=atlases[ot]={glyphCount:0,sdfGlyphSize:ot,sdfCanvas:ht,sdfTexture:new Texture(ht,void 0,void 0,void 0,LinearFilter,LinearFilter),contextLost:!1,glyphsByFont:new Map},st.sdfTexture.generateMipmaps=!1,initContextLossHandling(st)}const{sdfTexture:lt,sdfCanvas:ct}=st;let ut=st.glyphsByFont.get(tt.font);ut||st.glyphsByFont.set(tt.font,ut=new Map),typesetInWorker(tt).then(ht=>{const{glyphIds:dt,glyphPositions:pt,fontSize:mt,unitsPerEm:gt,timings:yt}=ht,bt=[],wt=new Float32Array(dt.length*4),xt=mt/gt;let kt=0,St=0;const Tt=now$1$1();dt.forEach((jt,Rt)=>{let $t=ut.get(jt);if(!$t){const{path:Wt,pathBounds:zt}=ht.glyphData[jt],Ft=Math.max(zt[2]-zt[0],zt[3]-zt[1])/ot*(CONFIG.sdfMargin*ot+.5),Nt=st.glyphCount++,Ut=[zt[0]-Ft,zt[1]-Ft,zt[2]+Ft,zt[3]+Ft];ut.set(jt,$t={path:Wt,atlasIndex:Nt,sdfViewBox:Ut}),bt.push($t)}const{sdfViewBox:vt}=$t,It=pt[St++],Ot=pt[St++];wt[kt++]=It+vt[0]*xt,wt[kt++]=Ot+vt[1]*xt,wt[kt++]=It+vt[2]*xt,wt[kt++]=Ot+vt[3]*xt,dt[Rt]=$t.atlasIndex}),yt.quads=(yt.quads||0)+(now$1$1()-Tt);const At=now$1$1();yt.sdf={};const Et=ct.height,Ct=Math.ceil(st.glyphCount/at),Lt=Math.pow(2,Math.ceil(Math.log2(Ct*ot)));Lt>Et&&(console.info(`Increasing SDF texture size ${Et}->${Lt}`),resizeWebGLCanvasWithoutClearing(ct,rt,Lt),lt.dispose()),Promise.all(bt.map(jt=>generateGlyphSDF(jt,st,tt.gpuAccelerateSDF).then(({timing:Rt})=>{yt.sdf[jt.atlasIndex]=Rt}))).then(()=>{bt.length&&!st.contextLost&&(safariPre15Workaround(st),lt.needsUpdate=!0),yt.sdfTotal=now$1$1()-At,yt.total=now$1$1()-nt,et(Object.freeze({parameters:tt,sdfTexture:lt,sdfGlyphSize:ot,sdfExponent:it,glyphBounds:wt,glyphAtlasIndices:dt,glyphColors:ht.glyphColors,caretPositions:ht.caretPositions,caretHeight:ht.caretHeight,chunkedBounds:ht.chunkedBounds,ascender:ht.ascender,descender:ht.descender,lineHeight:ht.lineHeight,capHeight:ht.capHeight,xHeight:ht.xHeight,topBaseline:ht.topBaseline,blockBounds:ht.blockBounds,visibleBounds:ht.visibleBounds,timings:ht.timings}))})}),Promise.resolve().then(()=>{st.contextLost||warmUpSDFCanvas(ct)})}function generateGlyphSDF({path:tt,atlasIndex:et,sdfViewBox:nt},{sdfGlyphSize:rt,sdfCanvas:it,contextLost:ot},at){if(ot)return Promise.resolve({timing:-1});const{textureWidth:st,sdfExponent:lt}=CONFIG,ct=Math.max(nt[2]-nt[0],nt[3]-nt[1]),ut=Math.floor(et/4),ht=ut%(st/rt)*rt,dt=Math.floor(ut/(st/rt))*rt,pt=et%4;return generateSDF(rt,rt,tt,nt,ct,lt,it,ht,dt,pt,at)}function initContextLossHandling(tt){const et=tt.sdfCanvas;et.addEventListener("webglcontextlost",nt=>{console.log("Context Lost",nt),nt.preventDefault(),tt.contextLost=!0}),et.addEventListener("webglcontextrestored",nt=>{console.log("Context Restored",nt),tt.contextLost=!1;const rt=[];tt.glyphsByFont.forEach(it=>{it.forEach(ot=>{rt.push(generateGlyphSDF(ot,tt,!0))})}),Promise.all(rt).then(()=>{safariPre15Workaround(tt),tt.sdfTexture.needsUpdate=!0})})}function preloadFont({font:tt,characters:et,sdfGlyphSize:nt},rt){let it=Array.isArray(et)?et.join(` `):""+et;getTextRenderInfo({font:tt,sdfGlyphSize:nt,text:it},rt)}function assign$2(tt,et){for(let nt in et)et.hasOwnProperty(nt)&&(tt[nt]=et[nt]);return tt}let linkEl;function toAbsoluteURL(tt){return linkEl||(linkEl=typeof document>"u"?{}:document.createElement("a")),linkEl.href=tt,linkEl.href}function safariPre15Workaround(tt){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:et,sdfTexture:nt}=tt,{width:rt,height:it}=et,ot=tt.sdfCanvas.getContext("webgl");let at=nt.image.data;(!at||at.length!==rt*it*4)&&(at=new Uint8Array(rt*it*4),nt.image={width:rt,height:it,data:at},nt.flipY=!1,nt.isDataTexture=!0),ot.readPixels(0,0,rt,it,ot.RGBA,ot.UNSIGNED_BYTE,at)}}const typesetterWorkerModule=defineWorkerModule({name:"Typesetter",dependencies:[CONFIG,workerModule,createTypesetter,bidiFactory],init(tt,et,nt,rt){const{defaultFontURL:it}=tt;return nt(et,rt(),{defaultFontURL:it})}}),typesetInWorker=defineWorkerModule({name:"Typesetter",dependencies:[typesetterWorkerModule],init(tt){return function(et){return new Promise(nt=>{tt.typeset(et,nt)})}},getTransferables(tt){const et=[tt.glyphPositions.buffer,tt.glyphIds.buffer];return tt.caretPositions&&et.push(tt.caretPositions.buffer),tt.glyphColors&&et.push(tt.glyphColors.buffer),et}}),templateGeometries={};function getTemplateGeometry(tt){let et=templateGeometries[tt];if(!et){const nt=new PlaneGeometry(1,1,tt,tt),rt=nt.clone(),it=nt.attributes,ot=rt.attributes,at=new BufferGeometry,st=it.uv.count;for(let lt=0;lt{at.setAttribute(lt,new Float32BufferAttribute([...it[lt].array,...ot[lt].array],it[lt].itemSize))}),at.setIndex([...nt.index.array,...rt.index.array.map(lt=>lt+st)]),at.translate(.5,.5,0),et=templateGeometries[tt]=at}return et}const glyphBoundsAttrName="aTroikaGlyphBounds",glyphIndexAttrName="aTroikaGlyphIndex",glyphColorAttrName="aTroikaGlyphColor";class GlyphsGeometry extends InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new Sphere,this.boundingBox=new Box3}computeBoundingSphere(){}computeBoundingBox(){}setSide(et){const nt=this.getIndex().count;this.setDrawRange(et===BackSide?nt/2:0,et===DoubleSide?nt:nt/2)}set detail(et){if(et!==this._detail){this._detail=et,(typeof et!="number"||et<1)&&(et=1);let nt=getTemplateGeometry(et);["position","normal","uv"].forEach(rt=>{this.attributes[rt]=nt.attributes[rt].clone()}),this.setIndex(nt.getIndex().clone())}}get detail(){return this._detail}set curveRadius(et){et!==this._curveRadius&&(this._curveRadius=et,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(et,nt,rt,it,ot){updateBufferAttr(this,glyphBoundsAttrName,et,4),updateBufferAttr(this,glyphIndexAttrName,nt,1),updateBufferAttr(this,glyphColorAttrName,ot,3),this._blockBounds=rt,this._chunkedBounds=it,this.instanceCount=nt.length,this._updateBounds()}_updateBounds(){const et=this._blockBounds;if(et){const{curveRadius:nt,boundingBox:rt}=this;if(nt){const{PI:it,floor:ot,min:at,max:st,sin:lt,cos:ct}=Math,ut=it/2,ht=it*2,dt=Math.abs(nt),pt=et[0]/dt,mt=et[2]/dt,gt=ot((pt+ut)/ht)!==ot((mt+ut)/ht)?-dt:at(lt(pt)*dt,lt(mt)*dt),yt=ot((pt-ut)/ht)!==ot((mt-ut)/ht)?dt:st(lt(pt)*dt,lt(mt)*dt),bt=ot((pt+it)/ht)!==ot((mt+it)/ht)?dt*2:st(dt-ct(pt)*dt,dt-ct(mt)*dt);rt.min.set(gt,et[1],nt<0?-bt:0),rt.max.set(yt,et[3],nt<0?0:bt)}else rt.min.set(et[0],et[1],0),rt.max.set(et[2],et[3],0);rt.getBoundingSphere(this.boundingSphere)}}applyClipRect(et){let nt=this.getAttribute(glyphIndexAttrName).count,rt=this._chunkedBounds;if(rt)for(let it=rt.length;it--;){nt=rt[it].end;let ot=rt[it].rect;if(ot[1]et.y&&ot[0]et.x)break}this.instanceCount=nt}}function updateBufferAttr(tt,et,nt,rt){const it=tt.getAttribute(et);nt?it&&it.array.length===nt.length?(it.array.set(nt),it.needsUpdate=!0):(tt.setAttribute(et,new InstancedBufferAttribute(nt,rt)),delete tt._maxInstanceCount,tt.dispose()):it&&tt.deleteAttribute(et)}const VERTEX_DEFS=` uniform vec2 uTroikaSDFTextureSize; uniform float uTroikaSDFGlyphSize; @@ -4458,7 +4458,7 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co * @author: Jack Doyle, jack@greensock.com */var _win,_doc,_docElement,_pluginInitted,_tempDiv,_recentSetterPlugin,_reverting,_windowExists=function(){return typeof window<"u"},_transformProps={},_RAD2DEG=180/Math.PI,_DEG2RAD=Math.PI/180,_atan2=Math.atan2,_bigNum=1e8,_capsExp=/([A-Z])/g,_horizontalExp=/(left|right|width|margin|padding|x)/i,_complexExp=/[\s,\(]\S/,_propertyAliases={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_renderCSSProp=function(et,nt){return nt.set(nt.t,nt.p,Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u,nt)},_renderPropWithEnd=function(et,nt){return nt.set(nt.t,nt.p,et===1?nt.e:Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u,nt)},_renderCSSPropWithBeginning=function(et,nt){return nt.set(nt.t,nt.p,et?Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u:nt.b,nt)},_renderRoundedCSSProp=function(et,nt){var rt=nt.s+nt.c*et;nt.set(nt.t,nt.p,~~(rt+(rt<0?-.5:.5))+nt.u,nt)},_renderNonTweeningValue=function(et,nt){return nt.set(nt.t,nt.p,et?nt.e:nt.b,nt)},_renderNonTweeningValueOnlyAtEnd=function(et,nt){return nt.set(nt.t,nt.p,et!==1?nt.b:nt.e,nt)},_setterCSSStyle=function(et,nt,rt){return et.style[nt]=rt},_setterCSSProp=function(et,nt,rt){return et.style.setProperty(nt,rt)},_setterTransform=function(et,nt,rt){return et._gsap[nt]=rt},_setterScale=function(et,nt,rt){return et._gsap.scaleX=et._gsap.scaleY=rt},_setterScaleWithRender=function(et,nt,rt,it,ot){var at=et._gsap;at.scaleX=at.scaleY=rt,at.renderTransform(ot,at)},_setterTransformWithRender=function(et,nt,rt,it,ot){var at=et._gsap;at[nt]=rt,at.renderTransform(ot,at)},_transformProp="transform",_transformOriginProp=_transformProp+"Origin",_saveStyle=function tt(et,nt){var rt=this,it=this.target,ot=it.style;if(et in _transformProps&&ot){if(this.tfm=this.tfm||{},et!=="transform")et=_propertyAliases[et]||et,~et.indexOf(",")?et.split(",").forEach(function(at){return rt.tfm[at]=_get$1(it,at)}):this.tfm[et]=it._gsap.x?it._gsap[et]:_get$1(it,et);else return _propertyAliases.transform.split(",").forEach(function(at){return tt.call(rt,at,nt)});if(this.props.indexOf(_transformProp)>=0)return;it._gsap.svg&&(this.svgo=it.getAttribute("data-svg-origin"),this.props.push(_transformOriginProp,nt,"")),et=_transformProp}(ot||nt)&&this.props.push(et,nt,ot[et])},_removeIndependentTransforms=function(et){et.translate&&(et.removeProperty("translate"),et.removeProperty("scale"),et.removeProperty("rotate"))},_revertStyle=function(){var et=this.props,nt=this.target,rt=nt.style,it=nt._gsap,ot,at;for(ot=0;ot=0?_prefixes[at]:"")+et},_initCore=function(){_windowExists()&&window.document&&(_win=window,_doc=_win.document,_docElement=_doc.documentElement,_tempDiv=_createElement("div")||{style:{}},_createElement("div"),_transformProp=_checkPropPrefix(_transformProp),_transformOriginProp=_transformProp+"Origin",_tempDiv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",_supports3D=!!_checkPropPrefix("perspective"),_reverting=gsap.core.reverting,_pluginInitted=1)},_getBBoxHack=function tt(et){var nt=_createElement("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),rt=this.parentNode,it=this.nextSibling,ot=this.style.cssText,at;if(_docElement.appendChild(nt),nt.appendChild(this),this.style.display="block",et)try{at=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=tt}catch{}else this._gsapBBox&&(at=this._gsapBBox());return rt&&(it?rt.insertBefore(this,it):rt.appendChild(this)),_docElement.removeChild(nt),this.style.cssText=ot,at},_getAttributeFallbacks=function(et,nt){for(var rt=nt.length;rt--;)if(et.hasAttribute(nt[rt]))return et.getAttribute(nt[rt])},_getBBox=function(et){var nt;try{nt=et.getBBox()}catch{nt=_getBBoxHack.call(et,!0)}return nt&&(nt.width||nt.height)||et.getBBox===_getBBoxHack||(nt=_getBBoxHack.call(et,!0)),nt&&!nt.width&&!nt.x&&!nt.y?{x:+_getAttributeFallbacks(et,["x","cx","x1"])||0,y:+_getAttributeFallbacks(et,["y","cy","y1"])||0,width:0,height:0}:nt},_isSVG=function(et){return!!(et.getCTM&&(!et.parentNode||et.ownerSVGElement)&&_getBBox(et))},_removeProperty=function(et,nt){if(nt){var rt=et.style;nt in _transformProps&&nt!==_transformOriginProp&&(nt=_transformProp),rt.removeProperty?((nt.substr(0,2)==="ms"||nt.substr(0,6)==="webkit")&&(nt="-"+nt),rt.removeProperty(nt.replace(_capsExp,"-$1").toLowerCase())):rt.removeAttribute(nt)}},_addNonTweeningPT=function(et,nt,rt,it,ot,at){var st=new PropTween(et._pt,nt,rt,0,1,at?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue);return et._pt=st,st.b=it,st.e=ot,et._props.push(rt),st},_nonConvertibleUnits={deg:1,rad:1,turn:1},_nonStandardLayouts={grid:1,flex:1},_convertToUnit=function tt(et,nt,rt,it){var ot=parseFloat(rt)||0,at=(rt+"").trim().substr((ot+"").length)||"px",st=_tempDiv.style,lt=_horizontalExp.test(nt),ct=et.tagName.toLowerCase()==="svg",ut=(ct?"client":"offset")+(lt?"Width":"Height"),ht=100,dt=it==="px",pt=it==="%",mt,gt,yt,bt;return it===at||!ot||_nonConvertibleUnits[it]||_nonConvertibleUnits[at]?ot:(at!=="px"&&!dt&&(ot=tt(et,nt,rt,"px")),bt=et.getCTM&&_isSVG(et),(pt||at==="%")&&(_transformProps[nt]||~nt.indexOf("adius"))?(mt=bt?et.getBBox()[lt?"width":"height"]:et[ut],_round(pt?ot/mt*ht:ot/100*mt)):(st[lt?"width":"height"]=ht+(dt?at:it),gt=~nt.indexOf("adius")||it==="em"&&et.appendChild&&!ct?et:et.parentNode,bt&&(gt=(et.ownerSVGElement||{}).parentNode),(!gt||gt===_doc||!gt.appendChild)&&(gt=_doc.body),yt=gt._gsap,yt&&pt&&yt.width&<&&yt.time===_ticker.time&&!yt.uncache?_round(ot/yt.width*ht):((pt||at==="%")&&!_nonStandardLayouts[_getComputedProperty(gt,"display")]&&(st.position=_getComputedProperty(et,"position")),gt===et&&(st.position="static"),gt.appendChild(_tempDiv),mt=_tempDiv[ut],gt.removeChild(_tempDiv),st.position="absolute",lt&&pt&&(yt=_getCache(gt),yt.time=_ticker.time,yt.width=gt[ut]),_round(dt?mt*ot/ht:mt&&ot?ht/mt*ot:0))))},_get$1=function(et,nt,rt,it){var ot;return _pluginInitted||_initCore(),nt in _propertyAliases&&nt!=="transform"&&(nt=_propertyAliases[nt],~nt.indexOf(",")&&(nt=nt.split(",")[0])),_transformProps[nt]&&nt!=="transform"?(ot=_parseTransform(et,it),ot=nt!=="transformOrigin"?ot[nt]:ot.svg?ot.origin:_firstTwoOnly(_getComputedProperty(et,_transformOriginProp))+" "+ot.zOrigin+"px"):(ot=et.style[nt],(!ot||ot==="auto"||it||~(ot+"").indexOf("calc("))&&(ot=_specialProps[nt]&&_specialProps[nt](et,nt,rt)||_getComputedProperty(et,nt)||_getProperty(et,nt)||(nt==="opacity"?1:0))),rt&&!~(ot+"").trim().indexOf(" ")?_convertToUnit(et,nt,ot,rt)+rt:ot},_tweenComplexCSSString=function(et,nt,rt,it){if(!rt||rt==="none"){var ot=_checkPropPrefix(nt,et,1),at=ot&&_getComputedProperty(et,ot,1);at&&at!==rt?(nt=ot,rt=at):nt==="borderColor"&&(rt=_getComputedProperty(et,"borderTopColor"))}var st=new PropTween(this._pt,et.style,nt,0,1,_renderComplexString),lt=0,ct=0,ut,ht,dt,pt,mt,gt,yt,bt,wt,xt,kt,St;if(st.b=rt,st.e=it,rt+="",it+="",it==="auto"&&(et.style[nt]=it,it=_getComputedProperty(et,nt)||it,et.style[nt]=rt),ut=[rt,it],_colorStringFilter(ut),rt=ut[0],it=ut[1],dt=rt.match(_numWithUnitExp)||[],St=it.match(_numWithUnitExp)||[],St.length){for(;ht=_numWithUnitExp.exec(it);)yt=ht[0],wt=it.substring(lt,ht.index),mt?mt=(mt+1)%5:(wt.substr(-5)==="rgba("||wt.substr(-5)==="hsla(")&&(mt=1),yt!==(gt=dt[ct++]||"")&&(pt=parseFloat(gt)||0,kt=gt.substr((pt+"").length),yt.charAt(1)==="="&&(yt=_parseRelative(pt,yt)+kt),bt=parseFloat(yt),xt=yt.substr((bt+"").length),lt=_numWithUnitExp.lastIndex-xt.length,xt||(xt=xt||_config.units[nt]||kt,lt===it.length&&(it+=xt,st.e+=xt)),kt!==xt&&(pt=_convertToUnit(et,nt,gt,xt)||0),st._pt={_next:st._pt,p:wt||ct===1?wt:",",s:pt,c:bt-pt,m:mt&&mt<4||nt==="zIndex"?Math.round:0});st.c=lt-1;)st=ot[ct],_transformProps[st]&&(lt=1,st=st==="transformOrigin"?_transformOriginProp:_transformProp),_removeProperty(rt,st);lt&&(_removeProperty(rt,_transformProp),at&&(at.svg&&rt.removeAttribute("transform"),_parseTransform(rt,1),at.uncache=1,_removeIndependentTransforms(it)))}},_specialProps={clearProps:function(et,nt,rt,it,ot){if(ot.data!=="isFromStart"){var at=et._pt=new PropTween(et._pt,nt,rt,0,0,_renderClearProps);return at.u=it,at.pr=-10,at.tween=ot,et._props.push(rt),1}}},_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function(et){return et==="matrix(1, 0, 0, 1, 0, 0)"||et==="none"||!et},_getComputedTransformMatrixAsArray=function(et){var nt=_getComputedProperty(et,_transformProp);return _isNullTransform(nt)?_identity2DMatrix:nt.substr(7).match(_numExp).map(_round)},_getMatrix=function(et,nt){var rt=et._gsap||_getCache(et),it=et.style,ot=_getComputedTransformMatrixAsArray(et),at,st,lt,ct;return rt.svg&&et.getAttribute("transform")?(lt=et.transform.baseVal.consolidate().matrix,ot=[lt.a,lt.b,lt.c,lt.d,lt.e,lt.f],ot.join(",")==="1,0,0,1,0,0"?_identity2DMatrix:ot):(ot===_identity2DMatrix&&!et.offsetParent&&et!==_docElement&&!rt.svg&&(lt=it.display,it.display="block",at=et.parentNode,(!at||!et.offsetParent)&&(ct=1,st=et.nextElementSibling,_docElement.appendChild(et)),ot=_getComputedTransformMatrixAsArray(et),lt?it.display=lt:_removeProperty(et,"display"),ct&&(st?at.insertBefore(et,st):at?at.appendChild(et):_docElement.removeChild(et))),nt&&ot.length>6?[ot[0],ot[1],ot[4],ot[5],ot[12],ot[13]]:ot)},_applySVGOrigin=function(et,nt,rt,it,ot,at){var st=et._gsap,lt=ot||_getMatrix(et,!0),ct=st.xOrigin||0,ut=st.yOrigin||0,ht=st.xOffset||0,dt=st.yOffset||0,pt=lt[0],mt=lt[1],gt=lt[2],yt=lt[3],bt=lt[4],wt=lt[5],xt=nt.split(" "),kt=parseFloat(xt[0])||0,St=parseFloat(xt[1])||0,Tt,At,Et,Ct;rt?lt!==_identity2DMatrix&&(At=pt*yt-mt*gt)&&(Et=kt*(yt/At)+St*(-gt/At)+(gt*wt-yt*bt)/At,Ct=kt*(-mt/At)+St*(pt/At)-(pt*wt-mt*bt)/At,kt=Et,St=Ct):(Tt=_getBBox(et),kt=Tt.x+(~xt[0].indexOf("%")?kt/100*Tt.width:kt),St=Tt.y+(~(xt[1]||xt[0]).indexOf("%")?St/100*Tt.height:St)),it||it!==!1&&st.smooth?(bt=kt-ct,wt=St-ut,st.xOffset=ht+(bt*pt+wt*gt)-bt,st.yOffset=dt+(bt*mt+wt*yt)-wt):st.xOffset=st.yOffset=0,st.xOrigin=kt,st.yOrigin=St,st.smooth=!!it,st.origin=nt,st.originIsAbsolute=!!rt,et.style[_transformOriginProp]="0px 0px",at&&(_addNonTweeningPT(at,st,"xOrigin",ct,kt),_addNonTweeningPT(at,st,"yOrigin",ut,St),_addNonTweeningPT(at,st,"xOffset",ht,st.xOffset),_addNonTweeningPT(at,st,"yOffset",dt,st.yOffset)),et.setAttribute("data-svg-origin",kt+" "+St)},_parseTransform=function(et,nt){var rt=et._gsap||new GSCache(et);if("x"in rt&&!nt&&!rt.uncache)return rt;var it=et.style,ot=rt.scaleX<0,at="px",st="deg",lt=getComputedStyle(et),ct=_getComputedProperty(et,_transformOriginProp)||"0",ut,ht,dt,pt,mt,gt,yt,bt,wt,xt,kt,St,Tt,At,Et,Ct,Lt,jt,Rt,$t,vt,It,Ot,Wt,zt,Ft,Nt,Ut,Pt,Ht,Qt,an;return ut=ht=dt=gt=yt=bt=wt=xt=kt=0,pt=mt=1,rt.svg=!!(et.getCTM&&_isSVG(et)),lt.translate&&((lt.translate!=="none"||lt.scale!=="none"||lt.rotate!=="none")&&(it[_transformProp]=(lt.translate!=="none"?"translate3d("+(lt.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(lt.rotate!=="none"?"rotate("+lt.rotate+") ":"")+(lt.scale!=="none"?"scale("+lt.scale.split(" ").join(",")+") ":"")+(lt[_transformProp]!=="none"?lt[_transformProp]:"")),it.scale=it.rotate=it.translate="none"),At=_getMatrix(et,rt.svg),rt.svg&&(rt.uncache?(zt=et.getBBox(),ct=rt.xOrigin-zt.x+"px "+(rt.yOrigin-zt.y)+"px",Wt=""):Wt=!nt&&et.getAttribute("data-svg-origin"),_applySVGOrigin(et,Wt||ct,!!Wt||rt.originIsAbsolute,rt.smooth!==!1,At)),St=rt.xOrigin||0,Tt=rt.yOrigin||0,At!==_identity2DMatrix&&(jt=At[0],Rt=At[1],$t=At[2],vt=At[3],ut=It=At[4],ht=Ot=At[5],At.length===6?(pt=Math.sqrt(jt*jt+Rt*Rt),mt=Math.sqrt(vt*vt+$t*$t),gt=jt||Rt?_atan2(Rt,jt)*_RAD2DEG:0,wt=$t||vt?_atan2($t,vt)*_RAD2DEG+gt:0,wt&&(mt*=Math.abs(Math.cos(wt*_DEG2RAD))),rt.svg&&(ut-=St-(St*jt+Tt*$t),ht-=Tt-(St*Rt+Tt*vt))):(an=At[6],Ht=At[7],Nt=At[8],Ut=At[9],Pt=At[10],Qt=At[11],ut=At[12],ht=At[13],dt=At[14],Et=_atan2(an,Pt),yt=Et*_RAD2DEG,Et&&(Ct=Math.cos(-Et),Lt=Math.sin(-Et),Wt=It*Ct+Nt*Lt,zt=Ot*Ct+Ut*Lt,Ft=an*Ct+Pt*Lt,Nt=It*-Lt+Nt*Ct,Ut=Ot*-Lt+Ut*Ct,Pt=an*-Lt+Pt*Ct,Qt=Ht*-Lt+Qt*Ct,It=Wt,Ot=zt,an=Ft),Et=_atan2(-$t,Pt),bt=Et*_RAD2DEG,Et&&(Ct=Math.cos(-Et),Lt=Math.sin(-Et),Wt=jt*Ct-Nt*Lt,zt=Rt*Ct-Ut*Lt,Ft=$t*Ct-Pt*Lt,Qt=vt*Lt+Qt*Ct,jt=Wt,Rt=zt,$t=Ft),Et=_atan2(Rt,jt),gt=Et*_RAD2DEG,Et&&(Ct=Math.cos(Et),Lt=Math.sin(Et),Wt=jt*Ct+Rt*Lt,zt=It*Ct+Ot*Lt,Rt=Rt*Ct-jt*Lt,Ot=Ot*Ct-It*Lt,jt=Wt,It=zt),yt&&Math.abs(yt)+Math.abs(gt)>359.9&&(yt=gt=0,bt=180-bt),pt=_round(Math.sqrt(jt*jt+Rt*Rt+$t*$t)),mt=_round(Math.sqrt(Ot*Ot+an*an)),Et=_atan2(It,Ot),wt=Math.abs(Et)>2e-4?Et*_RAD2DEG:0,kt=Qt?1/(Qt<0?-Qt:Qt):0),rt.svg&&(Wt=et.getAttribute("transform"),rt.forceCSS=et.setAttribute("transform","")||!_isNullTransform(_getComputedProperty(et,_transformProp)),Wt&&et.setAttribute("transform",Wt))),Math.abs(wt)>90&&Math.abs(wt)<270&&(ot?(pt*=-1,wt+=gt<=0?180:-180,gt+=gt<=0?180:-180):(mt*=-1,wt+=wt<=0?180:-180)),nt=nt||rt.uncache,rt.x=ut-((rt.xPercent=ut&&(!nt&&rt.xPercent||(Math.round(et.offsetWidth/2)===Math.round(-ut)?-50:0)))?et.offsetWidth*rt.xPercent/100:0)+at,rt.y=ht-((rt.yPercent=ht&&(!nt&&rt.yPercent||(Math.round(et.offsetHeight/2)===Math.round(-ht)?-50:0)))?et.offsetHeight*rt.yPercent/100:0)+at,rt.z=dt+at,rt.scaleX=_round(pt),rt.scaleY=_round(mt),rt.rotation=_round(gt)+st,rt.rotationX=_round(yt)+st,rt.rotationY=_round(bt)+st,rt.skewX=wt+st,rt.skewY=xt+st,rt.transformPerspective=kt+at,(rt.zOrigin=parseFloat(ct.split(" ")[2])||0)&&(it[_transformOriginProp]=_firstTwoOnly(ct)),rt.xOffset=rt.yOffset=0,rt.force3D=_config.force3D,rt.renderTransform=rt.svg?_renderSVGTransforms:_supports3D?_renderCSSTransforms:_renderNon3DTransforms,rt.uncache=0,rt},_firstTwoOnly=function(et){return(et=et.split(" "))[0]+" "+et[1]},_addPxTranslate=function(et,nt,rt){var it=getUnit$1(nt);return _round(parseFloat(nt)+parseFloat(_convertToUnit(et,"x",rt+"px",it)))+it},_renderNon3DTransforms=function(et,nt){nt.z="0px",nt.rotationY=nt.rotationX="0deg",nt.force3D=0,_renderCSSTransforms(et,nt)},_zeroDeg="0deg",_zeroPx="0px",_endParenthesis=") ",_renderCSSTransforms=function(et,nt){var rt=nt||this,it=rt.xPercent,ot=rt.yPercent,at=rt.x,st=rt.y,lt=rt.z,ct=rt.rotation,ut=rt.rotationY,ht=rt.rotationX,dt=rt.skewX,pt=rt.skewY,mt=rt.scaleX,gt=rt.scaleY,yt=rt.transformPerspective,bt=rt.force3D,wt=rt.target,xt=rt.zOrigin,kt="",St=bt==="auto"&&et&&et!==1||bt===!0;if(xt&&(ht!==_zeroDeg||ut!==_zeroDeg)){var Tt=parseFloat(ut)*_DEG2RAD,At=Math.sin(Tt),Et=Math.cos(Tt),Ct;Tt=parseFloat(ht)*_DEG2RAD,Ct=Math.cos(Tt),at=_addPxTranslate(wt,at,At*Ct*-xt),st=_addPxTranslate(wt,st,-Math.sin(Tt)*-xt),lt=_addPxTranslate(wt,lt,Et*Ct*-xt+xt)}yt!==_zeroPx&&(kt+="perspective("+yt+_endParenthesis),(it||ot)&&(kt+="translate("+it+"%, "+ot+"%) "),(St||at!==_zeroPx||st!==_zeroPx||lt!==_zeroPx)&&(kt+=lt!==_zeroPx||St?"translate3d("+at+", "+st+", "+lt+") ":"translate("+at+", "+st+_endParenthesis),ct!==_zeroDeg&&(kt+="rotate("+ct+_endParenthesis),ut!==_zeroDeg&&(kt+="rotateY("+ut+_endParenthesis),ht!==_zeroDeg&&(kt+="rotateX("+ht+_endParenthesis),(dt!==_zeroDeg||pt!==_zeroDeg)&&(kt+="skew("+dt+", "+pt+_endParenthesis),(mt!==1||gt!==1)&&(kt+="scale("+mt+", "+gt+_endParenthesis),wt.style[_transformProp]=kt||"translate(0, 0)"},_renderSVGTransforms=function(et,nt){var rt=nt||this,it=rt.xPercent,ot=rt.yPercent,at=rt.x,st=rt.y,lt=rt.rotation,ct=rt.skewX,ut=rt.skewY,ht=rt.scaleX,dt=rt.scaleY,pt=rt.target,mt=rt.xOrigin,gt=rt.yOrigin,yt=rt.xOffset,bt=rt.yOffset,wt=rt.forceCSS,xt=parseFloat(at),kt=parseFloat(st),St,Tt,At,Et,Ct;lt=parseFloat(lt),ct=parseFloat(ct),ut=parseFloat(ut),ut&&(ut=parseFloat(ut),ct+=ut,lt+=ut),lt||ct?(lt*=_DEG2RAD,ct*=_DEG2RAD,St=Math.cos(lt)*ht,Tt=Math.sin(lt)*ht,At=Math.sin(lt-ct)*-dt,Et=Math.cos(lt-ct)*dt,ct&&(ut*=_DEG2RAD,Ct=Math.tan(ct-ut),Ct=Math.sqrt(1+Ct*Ct),At*=Ct,Et*=Ct,ut&&(Ct=Math.tan(ut),Ct=Math.sqrt(1+Ct*Ct),St*=Ct,Tt*=Ct)),St=_round(St),Tt=_round(Tt),At=_round(At),Et=_round(Et)):(St=ht,Et=dt,Tt=At=0),(xt&&!~(at+"").indexOf("px")||kt&&!~(st+"").indexOf("px"))&&(xt=_convertToUnit(pt,"x",at,"px"),kt=_convertToUnit(pt,"y",st,"px")),(mt||gt||yt||bt)&&(xt=_round(xt+mt-(mt*St+gt*At)+yt),kt=_round(kt+gt-(mt*Tt+gt*Et)+bt)),(it||ot)&&(Ct=pt.getBBox(),xt=_round(xt+it/100*Ct.width),kt=_round(kt+ot/100*Ct.height)),Ct="matrix("+St+","+Tt+","+At+","+Et+","+xt+","+kt+")",pt.setAttribute("transform",Ct),wt&&(pt.style[_transformProp]=Ct)},_addRotationalPropTween=function(et,nt,rt,it,ot){var at=360,st=_isString$1(ot),lt=parseFloat(ot)*(st&&~ot.indexOf("rad")?_RAD2DEG:1),ct=lt-it,ut=it+ct+"deg",ht,dt;return st&&(ht=ot.split("_")[1],ht==="short"&&(ct%=at,ct!==ct%(at/2)&&(ct+=ct<0?at:-at)),ht==="cw"&&ct<0?ct=(ct+at*_bigNum)%at-~~(ct/at)*at:ht==="ccw"&&ct>0&&(ct=(ct-at*_bigNum)%at-~~(ct/at)*at)),et._pt=dt=new PropTween(et._pt,nt,rt,it,ct,_renderPropWithEnd),dt.e=ut,dt.u="deg",et._props.push(rt),dt},_assign=function(et,nt){for(var rt in nt)et[rt]=nt[rt];return et},_addRawTransformPTs=function(et,nt,rt){var it=_assign({},rt._gsap),ot="perspective,force3D,transformOrigin,svgOrigin",at=rt.style,st,lt,ct,ut,ht,dt,pt,mt;it.svg?(ct=rt.getAttribute("transform"),rt.setAttribute("transform",""),at[_transformProp]=nt,st=_parseTransform(rt,1),_removeProperty(rt,_transformProp),rt.setAttribute("transform",ct)):(ct=getComputedStyle(rt)[_transformProp],at[_transformProp]=nt,st=_parseTransform(rt,1),at[_transformProp]=ct);for(lt in _transformProps)ct=it[lt],ut=st[lt],ct!==ut&&ot.indexOf(lt)<0&&(pt=getUnit$1(ct),mt=getUnit$1(ut),ht=pt!==mt?_convertToUnit(rt,lt,ct,mt):parseFloat(ct),dt=parseFloat(ut),et._pt=new PropTween(et._pt,st,lt,ht,dt-ht,_renderCSSProp),et._pt.u=mt||0,et._props.push(lt));_assign(st,it)};_forEachName("padding,margin,Width,Radius",function(tt,et){var nt="Top",rt="Right",it="Bottom",ot="Left",at=(et<3?[nt,rt,it,ot]:[nt+ot,nt+rt,it+rt,it+ot]).map(function(st){return et<2?tt+st:"border"+st+tt});_specialProps[et>1?"border"+tt:tt]=function(st,lt,ct,ut,ht){var dt,pt;if(arguments.length<4)return dt=at.map(function(mt){return _get$1(st,mt,ct)}),pt=dt.join(" "),pt.split(dt[0]).length===5?dt[0]:pt;dt=(ut+"").split(" "),pt={},at.forEach(function(mt,gt){return pt[mt]=dt[gt]=dt[gt]||dt[(gt-1)/2|0]}),st.init(lt,pt,ht)}});var CSSPlugin={name:"css",register:_initCore,targetTest:function(et){return et.style&&et.nodeType},init:function(et,nt,rt,it,ot){var at=this._props,st=et.style,lt=rt.vars.startAt,ct,ut,ht,dt,pt,mt,gt,yt,bt,wt,xt,kt,St,Tt,At,Et;_pluginInitted||_initCore(),this.styles=this.styles||_getStyleSaver(et),Et=this.styles.props,this.tween=rt;for(gt in nt)if(gt!=="autoRound"&&(ut=nt[gt],!(_plugins[gt]&&_checkPlugin(gt,nt,rt,it,et,ot)))){if(pt=typeof ut,mt=_specialProps[gt],pt==="function"&&(ut=ut.call(rt,it,et,ot),pt=typeof ut),pt==="string"&&~ut.indexOf("random(")&&(ut=_replaceRandom(ut)),mt)mt(this,et,gt,ut,rt)&&(At=1);else if(gt.substr(0,2)==="--")ct=(getComputedStyle(et).getPropertyValue(gt)+"").trim(),ut+="",_colorExp.lastIndex=0,_colorExp.test(ct)||(yt=getUnit$1(ct),bt=getUnit$1(ut)),bt?yt!==bt&&(ct=_convertToUnit(et,gt,ct,bt)+bt):yt&&(ut+=yt),this.add(st,"setProperty",ct,ut,it,ot,0,0,gt),at.push(gt),Et.push(gt,0,st[gt]);else if(pt!=="undefined"){if(lt&> in lt?(ct=typeof lt[gt]=="function"?lt[gt].call(rt,it,et,ot):lt[gt],_isString$1(ct)&&~ct.indexOf("random(")&&(ct=_replaceRandom(ct)),getUnit$1(ct+"")||(ct+=_config.units[gt]||getUnit$1(_get$1(et,gt))||""),(ct+"").charAt(1)==="="&&(ct=_get$1(et,gt))):ct=_get$1(et,gt),dt=parseFloat(ct),wt=pt==="string"&&ut.charAt(1)==="="&&ut.substr(0,2),wt&&(ut=ut.substr(2)),ht=parseFloat(ut),gt in _propertyAliases&&(gt==="autoAlpha"&&(dt===1&&_get$1(et,"visibility")==="hidden"&&ht&&(dt=0),Et.push("visibility",0,st.visibility),_addNonTweeningPT(this,st,"visibility",dt?"inherit":"hidden",ht?"inherit":"hidden",!ht)),gt!=="scale"&>!=="transform"&&(gt=_propertyAliases[gt],~gt.indexOf(",")&&(gt=gt.split(",")[0]))),xt=gt in _transformProps,xt){if(this.styles.save(gt),kt||(St=et._gsap,St.renderTransform&&!nt.parseTransform||_parseTransform(et,nt.parseTransform),Tt=nt.smoothOrigin!==!1&&St.smooth,kt=this._pt=new PropTween(this._pt,st,_transformProp,0,1,St.renderTransform,St,0,-1),kt.dep=1),gt==="scale")this._pt=new PropTween(this._pt,St,"scaleY",St.scaleY,(wt?_parseRelative(St.scaleY,wt+ht):ht)-St.scaleY||0,_renderCSSProp),this._pt.u=0,at.push("scaleY",gt),gt+="X";else if(gt==="transformOrigin"){Et.push(_transformOriginProp,0,st[_transformOriginProp]),ut=_convertKeywordsToPercentages(ut),St.svg?_applySVGOrigin(et,ut,0,Tt,0,this):(bt=parseFloat(ut.split(" ")[2])||0,bt!==St.zOrigin&&_addNonTweeningPT(this,St,"zOrigin",St.zOrigin,bt),_addNonTweeningPT(this,st,gt,_firstTwoOnly(ct),_firstTwoOnly(ut)));continue}else if(gt==="svgOrigin"){_applySVGOrigin(et,ut,1,Tt,0,this);continue}else if(gt in _rotationalProperties){_addRotationalPropTween(this,St,gt,dt,wt?_parseRelative(dt,wt+ut):ut);continue}else if(gt==="smoothOrigin"){_addNonTweeningPT(this,St,"smooth",St.smooth,ut);continue}else if(gt==="force3D"){St[gt]=ut;continue}else if(gt==="transform"){_addRawTransformPTs(this,ut,et);continue}}else gt in st||(gt=_checkPropPrefix(gt)||gt);if(xt||(ht||ht===0)&&(dt||dt===0)&&!_complexExp.test(ut)&> in st)yt=(ct+"").substr((dt+"").length),ht||(ht=0),bt=getUnit$1(ut)||(gt in _config.units?_config.units[gt]:yt),yt!==bt&&(dt=_convertToUnit(et,gt,ct,bt)),this._pt=new PropTween(this._pt,xt?St:st,gt,dt,(wt?_parseRelative(dt,wt+ht):ht)-dt,!xt&&(bt==="px"||gt==="zIndex")&&nt.autoRound!==!1?_renderRoundedCSSProp:_renderCSSProp),this._pt.u=bt||0,yt!==bt&&bt!=="%"&&(this._pt.b=ct,this._pt.r=_renderCSSPropWithBeginning);else if(gt in st)_tweenComplexCSSString.call(this,et,gt,ct,wt?wt+ut:ut);else if(gt in et)this.add(et,gt,ct||et[gt],wt?wt+ut:ut,it,ot);else if(gt!=="parseTransform"){_missingPlugin(gt,ut);continue}xt||(gt in st?Et.push(gt,0,st[gt]):Et.push(gt,1,ct||et[gt])),at.push(gt)}}At&&_sortPropTweensByPriority(this)},render:function(et,nt){if(nt.tween._time||!_reverting())for(var rt=nt._pt;rt;)rt.r(et,rt.d),rt=rt._next;else nt.styles.revert()},get:_get$1,aliases:_propertyAliases,getSetter:function(et,nt,rt){var it=_propertyAliases[nt];return it&&it.indexOf(",")<0&&(nt=it),nt in _transformProps&&nt!==_transformOriginProp&&(et._gsap.x||_get$1(et,"x"))?rt&&_recentSetterPlugin===rt?nt==="scale"?_setterScale:_setterTransform:(_recentSetterPlugin=rt||{})&&(nt==="scale"?_setterScaleWithRender:_setterTransformWithRender):et.style&&!_isUndefined(et.style[nt])?_setterCSSStyle:~nt.indexOf("-")?_setterCSSProp:_getSetter(et,nt)},core:{_removeProperty,_getMatrix}};gsap.utils.checkPrefix=_checkPropPrefix;gsap.core.getStyleSaver=_getStyleSaver;(function(tt,et,nt,rt){var it=_forEachName(tt+","+et+","+nt,function(ot){_transformProps[ot]=1});_forEachName(et,function(ot){_config.units[ot]="deg",_rotationalProperties[ot]=1}),_propertyAliases[it[13]]=tt+","+et,_forEachName(rt,function(ot){var at=ot.split(":");_propertyAliases[at[1]]=it[at[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(tt){_config.units[tt]="px"});gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;gsapWithCSS.core.Tween;const createRoundedBoxGeometry=(tt,et,nt,rt,it)=>{const ot=new Shape$1,at=1e-5;ot.absarc(at,at,at,-Math.PI/2,-Math.PI,!0),ot.absarc(at,et-rt*2,at,Math.PI,Math.PI/2,!0),ot.absarc(tt-rt*2,et-rt*2,at,Math.PI/2,0,!0),ot.absarc(tt-rt*2,at,at,0,-Math.PI/2,!0);const st=new ExtrudeGeometry(ot,{depth:nt-rt*2,bevelEnabled:!0,bevelSegments:it,steps:2,bevelSize:rt,bevelThickness:rt,curveSegments:it});st.center();const lt=[],ct=st.getAttribute("normal"),ut=st.getAttribute("position");for(let ht=0;ht.9?(mt=pt.x/tt+.5,gt=1-(pt.z/nt+.5)):Math.abs(dt.x)>.9?(mt=-pt.z/nt+.5,gt=1-(-pt.y/et+.5)):Math.abs(dt.z)>.9&&(mt=pt.x/tt+.5,gt=1-(-pt.y/et+.5)),lt.push(mt,gt)}return st.setAttribute("uv",new Float32BufferAttribute(lt,2)),st};createRoundedBoxGeometry(10,10,10,2,10);const boxGeometry=new BoxGeometry(10,10,10),isMainTopic=tt=>tt.node_type==="topic"&&(tt.scale||1)>5,meshRenderLimit=500,meshRenderRadius=800;let nearbyNodeTimeout=null;const nearbyNodeTimeoutCycle=500,getNearbyNodeIds=(tt,et)=>{if(nearbyNodeTimeout)return null;nearbyNodeTimeout=setTimeout(()=>{nearbyNodeTimeout&&(clearTimeout(nearbyNodeTimeout),nearbyNodeTimeout=null)},nearbyNodeTimeoutCycle);const nt=[];return tt.forEach(it=>{const ot=et.position.distanceTo(variableVector3$1.set(it.x,it.y,it.z));otit.distance-ot.distance).slice(0,meshRenderLimit).map(it=>it.id)},initialCameraPosition=new Vector3(5e3,600,1600),arriveDistance=100,topicArriveDistance=600,selectionGraphDistance=2e3,selectionGraphCameraPosition={x:172.7392402058252,y:-239.04675366094037,z:-2e3},version$1="14.8.49",createExtendedExponentialRampToValueAutomationEvent=(tt,et,nt)=>({endTime:et,insertTime:nt,type:"exponentialRampToValue",value:tt}),createExtendedLinearRampToValueAutomationEvent=(tt,et,nt)=>({endTime:et,insertTime:nt,type:"linearRampToValue",value:tt}),createSetValueAutomationEvent=(tt,et)=>({startTime:et,type:"setValue",value:tt}),createSetValueCurveAutomationEvent=(tt,et,nt)=>({duration:nt,startTime:et,type:"setValueCurve",values:tt}),getTargetValueAtTime=(tt,et,{startTime:nt,target:rt,timeConstant:it})=>rt+(et-rt)*Math.exp((nt-tt)/it),isExponentialRampToValueAutomationEvent=tt=>tt.type==="exponentialRampToValue",isLinearRampToValueAutomationEvent=tt=>tt.type==="linearRampToValue",isAnyRampToValueAutomationEvent=tt=>isExponentialRampToValueAutomationEvent(tt)||isLinearRampToValueAutomationEvent(tt),isSetValueAutomationEvent=tt=>tt.type==="setValue",isSetValueCurveAutomationEvent=tt=>tt.type==="setValueCurve",getValueOfAutomationEventAtIndexAtTime=(tt,et,nt,rt)=>{const it=tt[et];return it===void 0?rt:isAnyRampToValueAutomationEvent(it)||isSetValueAutomationEvent(it)?it.value:isSetValueCurveAutomationEvent(it)?it.values[it.values.length-1]:getTargetValueAtTime(nt,getValueOfAutomationEventAtIndexAtTime(tt,et-1,it.startTime,rt),it)},getEndTimeAndValueOfPreviousAutomationEvent=(tt,et,nt,rt,it)=>nt===void 0?[rt.insertTime,it]:isAnyRampToValueAutomationEvent(nt)?[nt.endTime,nt.value]:isSetValueAutomationEvent(nt)?[nt.startTime,nt.value]:isSetValueCurveAutomationEvent(nt)?[nt.startTime+nt.duration,nt.values[nt.values.length-1]]:[nt.startTime,getValueOfAutomationEventAtIndexAtTime(tt,et-1,nt.startTime,it)],isCancelAndHoldAutomationEvent=tt=>tt.type==="cancelAndHold",isCancelScheduledValuesAutomationEvent=tt=>tt.type==="cancelScheduledValues",getEventTime=tt=>isCancelAndHoldAutomationEvent(tt)||isCancelScheduledValuesAutomationEvent(tt)?tt.cancelTime:isExponentialRampToValueAutomationEvent(tt)||isLinearRampToValueAutomationEvent(tt)?tt.endTime:tt.startTime,getExponentialRampValueAtTime=(tt,et,nt,{endTime:rt,value:it})=>nt===it?it:0nt+(tt-et)/(rt-et)*(it-nt),interpolateValue=(tt,et)=>{const nt=Math.floor(et),rt=Math.ceil(et);return nt===rt?tt[nt]:(1-(et-nt))*tt[nt]+(1-(rt-et))*tt[rt]},getValueCurveValueAtTime=(tt,{duration:et,startTime:nt,values:rt})=>{const it=(tt-nt)/et*(rt.length-1);return interpolateValue(rt,it)},isSetTargetAutomationEvent=tt=>tt.type==="setTarget";class AutomationEventList{constructor(et){this._automationEvents=[],this._currenTime=0,this._defaultValue=et}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(et){const nt=getEventTime(et);if(isCancelAndHoldAutomationEvent(et)||isCancelScheduledValuesAutomationEvent(et)){const rt=this._automationEvents.findIndex(ot=>isCancelScheduledValuesAutomationEvent(et)&&isSetValueCurveAutomationEvent(ot)?ot.startTime+ot.duration>=nt:getEventTime(ot)>=nt),it=this._automationEvents[rt];if(rt!==-1&&(this._automationEvents=this._automationEvents.slice(0,rt)),isCancelAndHoldAutomationEvent(et)){const ot=this._automationEvents[this._automationEvents.length-1];if(it!==void 0&&isAnyRampToValueAutomationEvent(it)){if(ot!==void 0&&isSetTargetAutomationEvent(ot))throw new Error("The internal list is malformed.");const at=ot===void 0?it.insertTime:isSetValueCurveAutomationEvent(ot)?ot.startTime+ot.duration:getEventTime(ot),st=ot===void 0?this._defaultValue:isSetValueCurveAutomationEvent(ot)?ot.values[ot.values.length-1]:ot.value,lt=isExponentialRampToValueAutomationEvent(it)?getExponentialRampValueAtTime(nt,at,st,it):getLinearRampValueAtTime(nt,at,st,it),ct=isExponentialRampToValueAutomationEvent(it)?createExtendedExponentialRampToValueAutomationEvent(lt,nt,this._currenTime):createExtendedLinearRampToValueAutomationEvent(lt,nt,this._currenTime);this._automationEvents.push(ct)}if(ot!==void 0&&isSetTargetAutomationEvent(ot)&&this._automationEvents.push(createSetValueAutomationEvent(this.getValue(nt),nt)),ot!==void 0&&isSetValueCurveAutomationEvent(ot)&&ot.startTime+ot.duration>nt){const at=nt-ot.startTime,st=(ot.values.length-1)/ot.duration,lt=Math.max(2,1+Math.ceil(at*st)),ct=at/(lt-1)*st,ut=ot.values.slice(0,lt);if(ct<1)for(let ht=1;htgetEventTime(at)>nt),it=rt===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[rt-1];if(it!==void 0&&isSetValueCurveAutomationEvent(it)&&getEventTime(it)+it.duration>nt)return!1;const ot=isExponentialRampToValueAutomationEvent(et)?createExtendedExponentialRampToValueAutomationEvent(et.value,et.endTime,this._currenTime):isLinearRampToValueAutomationEvent(et)?createExtendedLinearRampToValueAutomationEvent(et.value,nt,this._currenTime):et;if(rt===-1)this._automationEvents.push(ot);else{if(isSetValueCurveAutomationEvent(et)&&nt+et.duration>getEventTime(this._automationEvents[rt]))return!1;this._automationEvents.splice(rt,0,ot)}}return!0}flush(et){const nt=this._automationEvents.findIndex(rt=>getEventTime(rt)>et);if(nt>1){const rt=this._automationEvents.slice(nt-1),it=rt[0];isSetTargetAutomationEvent(it)&&rt.unshift(createSetValueAutomationEvent(getValueOfAutomationEventAtIndexAtTime(this._automationEvents,nt-2,it.startTime,this._defaultValue),it.startTime)),this._automationEvents=rt}}getValue(et){if(this._automationEvents.length===0)return this._defaultValue;const nt=this._automationEvents.findIndex(at=>getEventTime(at)>et),rt=this._automationEvents[nt],it=(nt===-1?this._automationEvents.length:nt)-1,ot=this._automationEvents[it];if(ot!==void 0&&isSetTargetAutomationEvent(ot)&&(rt===void 0||!isAnyRampToValueAutomationEvent(rt)||rt.insertTime>et))return getTargetValueAtTime(et,getValueOfAutomationEventAtIndexAtTime(this._automationEvents,it-1,ot.startTime,this._defaultValue),ot);if(ot!==void 0&&isSetValueAutomationEvent(ot)&&(rt===void 0||!isAnyRampToValueAutomationEvent(rt)))return ot.value;if(ot!==void 0&&isSetValueCurveAutomationEvent(ot)&&(rt===void 0||!isAnyRampToValueAutomationEvent(rt)||ot.startTime+ot.duration>et))return et({cancelTime:tt,type:"cancelAndHold"}),createCancelScheduledValuesAutomationEvent=tt=>({cancelTime:tt,type:"cancelScheduledValues"}),createExponentialRampToValueAutomationEvent=(tt,et)=>({endTime:et,type:"exponentialRampToValue",value:tt}),createLinearRampToValueAutomationEvent=(tt,et)=>({endTime:et,type:"linearRampToValue",value:tt}),createSetTargetAutomationEvent=(tt,et,nt)=>({startTime:et,target:tt,timeConstant:nt,type:"setTarget"}),createAbortError=()=>new DOMException("","AbortError"),createAddActiveInputConnectionToAudioNode=tt=>(et,nt,[rt,it,ot],at)=>{tt(et[it],[nt,rt,ot],st=>st[0]===nt&&st[1]===rt,at)},createAddAudioNodeConnections=tt=>(et,nt,rt)=>{const it=[];for(let ot=0;ot(et,nt)=>{tt.set(et,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:nt})},ACTIVE_AUDIO_NODE_STORE=new WeakSet,AUDIO_NODE_CONNECTIONS_STORE=new WeakMap,AUDIO_NODE_STORE=new WeakMap,AUDIO_PARAM_CONNECTIONS_STORE=new WeakMap,AUDIO_PARAM_STORE=new WeakMap,CONTEXT_STORE=new WeakMap,EVENT_LISTENERS=new WeakMap,CYCLE_COUNTERS=new WeakMap,NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS=new WeakMap,NODE_TO_PROCESSOR_MAPS=new WeakMap,handler={construct(){return handler}},isConstructible=tt=>{try{const et=new Proxy(tt,handler);new et}catch{return!1}return!0},IMPORT_STATEMENT_REGEX=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,splitImportStatements=(tt,et)=>{const nt=[];let rt=tt.replace(/^[\s]+/,""),it=rt.match(IMPORT_STATEMENT_REGEX);for(;it!==null;){const ot=it[1].slice(1,-1),at=it[0].replace(/([\s]+)?;?$/,"").replace(ot,new URL(ot,et).toString());nt.push(at),rt=rt.slice(it[0].length).replace(/^[\s]+/,""),it=rt.match(IMPORT_STATEMENT_REGEX)}return[nt.join(";"),rt]},verifyParameterDescriptors=tt=>{if(tt!==void 0&&!Array.isArray(tt))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},verifyProcessorCtor=tt=>{if(!isConstructible(tt))throw new TypeError("The given value for processorCtor should be a constructor.");if(tt.prototype===null||typeof tt.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},createAddAudioWorkletModule=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt)=>{let pt=0;return(mt,gt,yt={credentials:"omit"})=>{const bt=ut.get(mt);if(bt!==void 0&&bt.has(gt))return Promise.resolve();const wt=ct.get(mt);if(wt!==void 0){const St=wt.get(gt);if(St!==void 0)return St}const xt=ot(mt),kt=xt.audioWorklet===void 0?it(gt).then(([St,Tt])=>{const[At,Et]=splitImportStatements(St,Tt),Ct=`${At};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${Et} })})(window,'_AWGS')`;return nt(Ct)}).then(()=>{const St=dt._AWGS.pop();if(St===void 0)throw new SyntaxError;rt(xt.currentTime,xt.sampleRate,()=>St(class{},void 0,(Tt,At)=>{if(Tt.trim()==="")throw et();const Et=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(xt);if(Et!==void 0){if(Et.has(Tt))throw et();verifyProcessorCtor(At),verifyParameterDescriptors(At.parameterDescriptors),Et.set(Tt,At)}else verifyProcessorCtor(At),verifyParameterDescriptors(At.parameterDescriptors),NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.set(xt,new Map([[Tt,At]]))},xt.sampleRate,void 0,void 0))}):Promise.all([it(gt),Promise.resolve(tt(ht,ht))]).then(([[St,Tt],At])=>{const Et=pt+1;pt=Et;const[Ct,Lt]=splitImportStatements(St,Tt),vt=`${Ct};((AudioWorkletProcessor,registerProcessor)=>{${Lt} -})(${At?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${At?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${At?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${Et}',class extends AudioWorkletProcessor{process(){return !1}})`,It=new Blob([vt],{type:"application/javascript; charset=utf-8"}),Ot=URL.createObjectURL(It);return xt.audioWorklet.addModule(Ot,yt).then(()=>{if(st(xt))return xt;const Wt=at(xt);return Wt.audioWorklet.addModule(Ot,yt).then(()=>Wt)}).then(Wt=>{if(lt===null)throw new SyntaxError;try{new lt(Wt,`__sac${Et}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(Ot))});return wt===void 0?ct.set(mt,new Map([[gt,kt]])):wt.set(gt,kt),kt.then(()=>{const St=ut.get(mt);St===void 0?ut.set(mt,new Set([gt])):St.add(gt)}).finally(()=>{const St=ct.get(mt);St!==void 0&&St.delete(gt)}),kt}},getValueForKey=(tt,et)=>{const nt=tt.get(et);if(nt===void 0)throw new Error("A value with the given key could not be found.");return nt},pickElementFromSet=(tt,et)=>{const nt=Array.from(tt).filter(et);if(nt.length>1)throw Error("More than one element was found.");if(nt.length===0)throw Error("No element was found.");const[rt]=nt;return tt.delete(rt),rt},deletePassiveInputConnectionToAudioNode=(tt,et,nt,rt)=>{const it=getValueForKey(tt,et),ot=pickElementFromSet(it,at=>at[0]===nt&&at[1]===rt);return it.size===0&&tt.delete(et),ot},getEventListenersOfAudioNode=tt=>getValueForKey(EVENT_LISTENERS,tt),setInternalStateToActive=tt=>{if(ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is already stored.");ACTIVE_AUDIO_NODE_STORE.add(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!0))},isAudioWorkletNode=tt=>"port"in tt,setInternalStateToPassive=tt=>{if(!ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is not stored.");ACTIVE_AUDIO_NODE_STORE.delete(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!1))},setInternalStateToPassiveWhenNecessary=(tt,et)=>{!isAudioWorkletNode(tt)&&et.every(nt=>nt.size===0)&&setInternalStateToPassive(tt)},createAddConnectionToAudioNode=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt)=>{const pt=new WeakMap;return(mt,gt,yt,bt,wt)=>{const{activeInputs:xt,passiveInputs:kt}=ot(gt),{outputs:St}=ot(mt),Tt=st(mt),At=Et=>{const Ct=lt(gt),Lt=lt(mt);if(Et){const jt=deletePassiveInputConnectionToAudioNode(kt,mt,yt,bt);tt(xt,mt,jt,!1),!wt&&!ht(mt)&&nt(Lt,Ct,yt,bt),dt(gt)&&setInternalStateToActive(gt)}else{const jt=rt(xt,mt,yt,bt);et(kt,bt,jt,!1),!wt&&!ht(mt)&&it(Lt,Ct,yt,bt);const Rt=at(gt);if(Rt===0)ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,xt);else{const $t=pt.get(gt);$t!==void 0&&clearTimeout($t),pt.set(gt,setTimeout(()=>{ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,xt)},Rt*1e3))}}};return ct(St,[gt,yt,bt],Et=>Et[0]===gt&&Et[1]===yt&&Et[2]===bt,!0)?(Tt.add(At),ut(mt)?tt(xt,mt,[yt,bt,At],!0):et(kt,bt,[mt,yt,At],!0),!0):!1}},createAddPassiveInputConnectionToAudioNode=tt=>(et,nt,[rt,it,ot],at)=>{const st=et.get(rt);st===void 0?et.set(rt,new Set([[it,nt,ot]])):tt(st,[it,nt,ot],lt=>lt[0]===it&<[1]===nt,at)},createAddSilentConnection=tt=>(et,nt)=>{const rt=tt(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});nt.connect(rt).connect(et.destination);const it=()=>{nt.removeEventListener("ended",it),nt.disconnect(rt),rt.disconnect()};nt.addEventListener("ended",it)},createAddUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).add(nt)},DEFAULT_OPTIONS$k={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},createAnalyserNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$k,...lt},ht=rt(ct,ut),dt=ot(ct)?et():null;super(st,!1,ht,dt),this._nativeAnalyserNode=ht}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(st){this._nativeAnalyserNode.fftSize=st}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(st){const lt=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=st,!(st>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=lt,nt()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(st){const lt=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=st,!(this._nativeAnalyserNode.maxDecibels>st))throw this._nativeAnalyserNode.minDecibels=lt,nt()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(st){this._nativeAnalyserNode.smoothingTimeConstant=st}getByteFrequencyData(st){this._nativeAnalyserNode.getByteFrequencyData(st)}getByteTimeDomainData(st){this._nativeAnalyserNode.getByteTimeDomainData(st)}getFloatFrequencyData(st){this._nativeAnalyserNode.getFloatFrequencyData(st)}getFloatTimeDomainData(st){this._nativeAnalyserNode.getFloatTimeDomainData(st)}},isOwnedByContext=(tt,et)=>tt.context===et,createAnalyserNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,fftSize:st.fftSize,maxDecibels:st.maxDecibels,minDecibels:st.minDecibels,smoothingTimeConstant:st.smoothingTimeConstant};st=tt(at,ct)}return rt.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},testAudioBufferCopyChannelMethodsOutOfBoundsSupport=tt=>{try{tt.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},createIndexSizeError=()=>new DOMException("","IndexSizeError"),wrapAudioBufferGetChannelDataMethod=tt=>{tt.getChannelData=(et=>nt=>{try{return et.call(tt,nt)}catch(rt){throw rt.code===12?createIndexSizeError():rt}})(tt.getChannelData)},DEFAULT_OPTIONS$j={numberOfChannels:1},createAudioBufferConstructor=(tt,et,nt,rt,it,ot,at,st)=>{let lt=null;return class bw{constructor(ut){if(it===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:ht,numberOfChannels:dt,sampleRate:pt}={...DEFAULT_OPTIONS$j,...ut};lt===null&&(lt=new it(1,1,44100));const mt=rt!==null&&et(ot,ot)?new rt({length:ht,numberOfChannels:dt,sampleRate:pt}):lt.createBuffer(dt,ht,pt);if(mt.numberOfChannels===0)throw nt();return typeof mt.copyFromChannel!="function"?(at(mt),wrapAudioBufferGetChannelDataMethod(mt)):et(testAudioBufferCopyChannelMethodsOutOfBoundsSupport,()=>testAudioBufferCopyChannelMethodsOutOfBoundsSupport(mt))||st(mt),tt.add(mt),mt}static[Symbol.hasInstance](ut){return ut!==null&&typeof ut=="object"&&Object.getPrototypeOf(ut)===bw.prototype||tt.has(ut)}}},MOST_NEGATIVE_SINGLE_FLOAT=-34028234663852886e22,MOST_POSITIVE_SINGLE_FLOAT=-MOST_NEGATIVE_SINGLE_FLOAT,isActiveAudioNode=tt=>ACTIVE_AUDIO_NODE_STORE.has(tt),DEFAULT_OPTIONS$i={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},createAudioBufferSourceNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$i,...ut},pt=it(ht,dt),mt=at(ht),gt=mt?et():null;super(ct,!1,pt,gt),this._audioBufferSourceNodeRenderer=gt,this._isBufferNullified=!1,this._isBufferSet=dt.buffer!==null,this._nativeAudioBufferSourceNode=pt,this._onended=null,this._playbackRate=nt(this,mt,pt.playbackRate,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(ct){if(this._nativeAudioBufferSourceNode.buffer=ct,ct!==null){if(this._isBufferSet)throw rt();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(ct){this._nativeAudioBufferSourceNode.loop=ct}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(ct){this._nativeAudioBufferSourceNode.loopEnd=ct}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(ct){this._nativeAudioBufferSourceNode.loopStart=ct}get onended(){return this._onended}set onended(ct){const ut=typeof ct=="function"?st(this,ct):null;this._nativeAudioBufferSourceNode.onended=ut;const ht=this._nativeAudioBufferSourceNode.onended;this._onended=ht!==null&&ht===ut?ct:ht}get playbackRate(){return this._playbackRate}start(ct=0,ut=0,ht){if(this._nativeAudioBufferSourceNode.start(ct,ut,ht),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=ht===void 0?[ct,ut]:[ct,ut,ht]),this.context.state!=="closed"){setInternalStateToActive(this);const dt=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",dt),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",dt)}}stop(ct=0){this._nativeAudioBufferSourceNode.stop(ct),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=ct)}},createAudioBufferSourceNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={buffer:ht.buffer,channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,loop:ht.loop,loopEnd:ht.loopEnd,loopStart:ht.loopStart,playbackRate:ht.playbackRate.value};ht=et(ut,pt),at!==null&&ht.start(...at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.playbackRate,ht.playbackRate):await rt(ut,ct.playbackRate,ht.playbackRate),await it(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},isAudioBufferSourceNode=tt=>"playbackRate"in tt,isBiquadFilterNode=tt=>"frequency"in tt&&"gain"in tt,isConstantSourceNode=tt=>"offset"in tt,isGainNode=tt=>!("frequency"in tt)&&"gain"in tt,isOscillatorNode=tt=>"detune"in tt&&"frequency"in tt,isStereoPannerNode=tt=>"pan"in tt,getAudioNodeConnections=tt=>getValueForKey(AUDIO_NODE_CONNECTIONS_STORE,tt),getAudioParamConnections=tt=>getValueForKey(AUDIO_PARAM_CONNECTIONS_STORE,tt),deactivateActiveAudioNodeInputConnections=(tt,et)=>{const{activeInputs:nt}=getAudioNodeConnections(tt);nt.forEach(it=>it.forEach(([ot])=>{et.includes(tt)||deactivateActiveAudioNodeInputConnections(ot,[...et,tt])}));const rt=isAudioBufferSourceNode(tt)?[tt.playbackRate]:isAudioWorkletNode(tt)?Array.from(tt.parameters.values()):isBiquadFilterNode(tt)?[tt.Q,tt.detune,tt.frequency,tt.gain]:isConstantSourceNode(tt)?[tt.offset]:isGainNode(tt)?[tt.gain]:isOscillatorNode(tt)?[tt.detune,tt.frequency]:isStereoPannerNode(tt)?[tt.pan]:[];for(const it of rt){const ot=getAudioParamConnections(it);ot!==void 0&&ot.activeInputs.forEach(([at])=>deactivateActiveAudioNodeInputConnections(at,et))}isActiveAudioNode(tt)&&setInternalStateToPassive(tt)},deactivateAudioGraph=tt=>{deactivateActiveAudioNodeInputConnections(tt.destination,[])},isValidLatencyHint=tt=>tt===void 0||typeof tt=="number"||typeof tt=="string"&&(tt==="balanced"||tt==="interactive"||tt==="playback"),createAudioContextConstructor=(tt,et,nt,rt,it,ot,at,st,lt)=>class extends tt{constructor(ut={}){if(lt===null)throw new Error("Missing the native AudioContext constructor.");let ht;try{ht=new lt(ut)}catch(mt){throw mt.code===12&&mt.message==="sampleRate is not in range"?nt():mt}if(ht===null)throw rt();if(!isValidLatencyHint(ut.latencyHint))throw new TypeError(`The provided value '${ut.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(ut.sampleRate!==void 0&&ht.sampleRate!==ut.sampleRate)throw nt();super(ht,2);const{latencyHint:dt}=ut,{sampleRate:pt}=ht;if(this._baseLatency=typeof ht.baseLatency=="number"?ht.baseLatency:dt==="balanced"?512/pt:dt==="interactive"||dt===void 0?256/pt:dt==="playback"?1024/pt:Math.max(2,Math.min(128,Math.round(dt*pt/128)))*128/pt,this._nativeAudioContext=ht,lt.name==="webkitAudioContext"?(this._nativeGainNode=ht.createGain(),this._nativeOscillatorNode=ht.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(ht.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,ht.state==="running"){this._state="suspended";const mt=()=>{this._state==="suspended"&&(this._state=null),ht.removeEventListener("statechange",mt)};ht.addEventListener("statechange",mt)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw et()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),deactivateAudioGraph(this)}))}createMediaElementSource(ut){return new it(this,{mediaElement:ut})}createMediaStreamDestination(){return new ot(this)}createMediaStreamSource(ut){return new at(this,{mediaStream:ut})}createMediaStreamTrackSource(ut){return new st(this,{mediaStreamTrack:ut})}resume(){return this._state==="suspended"?new Promise((ut,ht)=>{const dt=()=>{this._nativeAudioContext.removeEventListener("statechange",dt),this._nativeAudioContext.state==="running"?ut():this.resume().then(ut,ht)};this._nativeAudioContext.addEventListener("statechange",dt)}):this._nativeAudioContext.resume().catch(ut=>{throw ut===void 0||ut.code===15?et():ut})}suspend(){return this._nativeAudioContext.suspend().catch(ut=>{throw ut===void 0?et():ut})}},createAudioDestinationNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt=at(ht),pt=it(ht,ut,dt),mt=dt?et(st):null;super(ct,!1,pt,mt),this._isNodeOfNativeOfflineAudioContext=dt,this._nativeAudioDestinationNode=pt}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(ct){if(this._isNodeOfNativeOfflineAudioContext)throw rt();if(ct>this._nativeAudioDestinationNode.maxChannelCount)throw nt();this._nativeAudioDestinationNode.channelCount=ct}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(ct){if(this._isNodeOfNativeOfflineAudioContext)throw rt();this._nativeAudioDestinationNode.channelCountMode=ct}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},createAudioDestinationNodeRenderer=tt=>{const et=new WeakMap,nt=async(rt,it)=>{const ot=it.destination;return et.set(it,ot),await tt(rt,it,ot),ot};return{render(rt,it){const ot=et.get(it);return ot!==void 0?Promise.resolve(ot):nt(rt,it)}}},createAudioListenerFactory=(tt,et,nt,rt,it,ot,at,st)=>(lt,ct)=>{const ut=ct.listener,ht=()=>{const St=new Float32Array(1),Tt=et(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),At=at(ct);let Et=!1,Ct=[0,0,-1,0,1,0],Lt=[0,0,0];const jt=()=>{if(Et)return;Et=!0;const It=rt(ct,256,9,0);It.onaudioprocess=({inputBuffer:Ot})=>{const Wt=[ot(Ot,St,0),ot(Ot,St,1),ot(Ot,St,2),ot(Ot,St,3),ot(Ot,St,4),ot(Ot,St,5)];Wt.some((Ft,Nt)=>Ft!==Ct[Nt])&&(ut.setOrientation(...Wt),Ct=Wt);const zt=[ot(Ot,St,6),ot(Ot,St,7),ot(Ot,St,8)];zt.some((Ft,Nt)=>Ft!==Lt[Nt])&&(ut.setPosition(...zt),Lt=zt)},Tt.connect(It)},Rt=It=>Ot=>{Ot!==Ct[It]&&(Ct[It]=Ot,ut.setOrientation(...Ct))},$t=It=>Ot=>{Ot!==Lt[It]&&(Lt[It]=Ot,ut.setPosition(...Lt))},vt=(It,Ot,Wt)=>{const zt=nt(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Ot});zt.connect(Tt,0,It),zt.start(),Object.defineProperty(zt.offset,"defaultValue",{get(){return Ot}});const Ft=tt({context:lt},At,zt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT);return st(Ft,"value",Nt=>()=>Nt.call(Ft),Nt=>Ut=>{try{Nt.call(Ft,Ut)}catch(Pt){if(Pt.code!==9)throw Pt}jt(),At&&Wt(Ut)}),Ft.cancelAndHoldAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.cancelAndHoldAtTime),Ft.cancelScheduledValues=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.cancelScheduledValues),Ft.exponentialRampToValueAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.exponentialRampToValueAtTime),Ft.linearRampToValueAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.linearRampToValueAtTime),Ft.setTargetAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.setTargetAtTime),Ft.setValueAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.setValueAtTime),Ft.setValueCurveAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.setValueCurveAtTime),Ft};return{forwardX:vt(0,0,Rt(0)),forwardY:vt(1,0,Rt(1)),forwardZ:vt(2,-1,Rt(2)),positionX:vt(6,0,$t(0)),positionY:vt(7,0,$t(1)),positionZ:vt(8,0,$t(2)),upX:vt(3,0,Rt(3)),upY:vt(4,1,Rt(4)),upZ:vt(5,0,Rt(5))}},{forwardX:dt,forwardY:pt,forwardZ:mt,positionX:gt,positionY:yt,positionZ:bt,upX:wt,upY:xt,upZ:kt}=ut.forwardX===void 0?ht():ut;return{get forwardX(){return dt},get forwardY(){return pt},get forwardZ(){return mt},get positionX(){return gt},get positionY(){return yt},get positionZ(){return bt},get upX(){return wt},get upY(){return xt},get upZ(){return kt}}},isAudioNode$1=tt=>"context"in tt,isAudioNodeOutputConnection=tt=>isAudioNode$1(tt[0]),insertElementInSet=(tt,et,nt,rt)=>{for(const it of tt)if(nt(it)){if(rt)return!1;throw Error("The set contains at least one similar element.")}return tt.add(et),!0},addActiveInputConnectionToAudioParam=(tt,et,[nt,rt],it)=>{insertElementInSet(tt,[et,nt,rt],ot=>ot[0]===et&&ot[1]===nt,it)},addPassiveInputConnectionToAudioParam=(tt,[et,nt,rt],it)=>{const ot=tt.get(et);ot===void 0?tt.set(et,new Set([[nt,rt]])):insertElementInSet(ot,[nt,rt],at=>at[0]===nt,it)},isNativeAudioNodeFaker=tt=>"inputs"in tt,connectNativeAudioNodeToNativeAudioNode=(tt,et,nt,rt)=>{if(isNativeAudioNodeFaker(et)){const it=et.inputs[rt];return tt.connect(it,nt,0),[it,nt,0]}return tt.connect(et,nt,rt),[et,nt,rt]},deleteActiveInputConnection=(tt,et,nt)=>{for(const rt of tt)if(rt[0]===et&&rt[1]===nt)return tt.delete(rt),rt;return null},deleteActiveInputConnectionToAudioParam=(tt,et,nt)=>pickElementFromSet(tt,rt=>rt[0]===et&&rt[1]===nt),deleteEventListenerOfAudioNode=(tt,et)=>{if(!getEventListenersOfAudioNode(tt).delete(et))throw new Error("Missing the expected event listener.")},deletePassiveInputConnectionToAudioParam=(tt,et,nt)=>{const rt=getValueForKey(tt,et),it=pickElementFromSet(rt,ot=>ot[0]===nt);return rt.size===0&&tt.delete(et),it},disconnectNativeAudioNodeFromNativeAudioNode=(tt,et,nt,rt)=>{isNativeAudioNodeFaker(et)?tt.disconnect(et.inputs[rt],nt,0):tt.disconnect(et,nt,rt)},getNativeAudioNode=tt=>getValueForKey(AUDIO_NODE_STORE,tt),getNativeAudioParam=tt=>getValueForKey(AUDIO_PARAM_STORE,tt),isPartOfACycle=tt=>CYCLE_COUNTERS.has(tt),isPassiveAudioNode=tt=>!ACTIVE_AUDIO_NODE_STORE.has(tt),testAudioNodeDisconnectMethodSupport=(tt,et)=>new Promise(nt=>{if(et!==null)nt(!0);else{const rt=tt.createScriptProcessor(256,1,1),it=tt.createGain(),ot=tt.createBuffer(1,2,44100),at=ot.getChannelData(0);at[0]=1,at[1]=1;const st=tt.createBufferSource();st.buffer=ot,st.loop=!0,st.connect(rt).connect(tt.destination),st.connect(it),st.disconnect(it),rt.onaudioprocess=lt=>{const ct=lt.inputBuffer.getChannelData(0);Array.prototype.some.call(ct,ut=>ut===1)?nt(!0):nt(!1),st.stop(),rt.onaudioprocess=null,st.disconnect(rt),rt.disconnect(tt.destination)},st.start()}}),visitEachAudioNodeOnce=(tt,et)=>{const nt=new Map;for(const rt of tt)for(const it of rt){const ot=nt.get(it);nt.set(it,ot===void 0?1:ot+1)}nt.forEach((rt,it)=>et(it,rt))},isNativeAudioNode$1=tt=>"context"in tt,wrapAudioNodeDisconnectMethod=tt=>{const et=new Map;tt.connect=(nt=>(rt,it=0,ot=0)=>{const at=isNativeAudioNode$1(rt)?nt(rt,it,ot):nt(rt,it),st=et.get(rt);return st===void 0?et.set(rt,[{input:ot,output:it}]):st.every(lt=>lt.input!==ot||lt.output!==it)&&st.push({input:ot,output:it}),at})(tt.connect.bind(tt)),tt.disconnect=(nt=>(rt,it,ot)=>{if(nt.apply(tt),rt===void 0)et.clear();else if(typeof rt=="number")for(const[at,st]of et){const lt=st.filter(ct=>ct.output!==rt);lt.length===0?et.delete(at):et.set(at,lt)}else if(et.has(rt))if(it===void 0)et.delete(rt);else{const at=et.get(rt);if(at!==void 0){const st=at.filter(lt=>lt.output!==it&&(lt.input!==ot||ot===void 0));st.length===0?et.delete(rt):et.set(rt,st)}}for(const[at,st]of et)st.forEach(lt=>{isNativeAudioNode$1(at)?tt.connect(at,lt.output,lt.input):tt.connect(at,lt.output)})})(tt.disconnect)},addConnectionToAudioParamOfAudioContext=(tt,et,nt,rt)=>{const{activeInputs:it,passiveInputs:ot}=getAudioParamConnections(et),{outputs:at}=getAudioNodeConnections(tt),st=getEventListenersOfAudioNode(tt),lt=ct=>{const ut=getNativeAudioNode(tt),ht=getNativeAudioParam(et);if(ct){const dt=deletePassiveInputConnectionToAudioParam(ot,tt,nt);addActiveInputConnectionToAudioParam(it,tt,dt,!1),!rt&&!isPartOfACycle(tt)&&ut.connect(ht,nt)}else{const dt=deleteActiveInputConnectionToAudioParam(it,tt,nt);addPassiveInputConnectionToAudioParam(ot,dt,!1),!rt&&!isPartOfACycle(tt)&&ut.disconnect(ht,nt)}};return insertElementInSet(at,[et,nt],ct=>ct[0]===et&&ct[1]===nt,!0)?(st.add(lt),isActiveAudioNode(tt)?addActiveInputConnectionToAudioParam(it,tt,[nt,lt],!0):addPassiveInputConnectionToAudioParam(ot,[tt,nt,lt],!0),!0):!1},deleteInputConnectionOfAudioNode=(tt,et,nt,rt)=>{const{activeInputs:it,passiveInputs:ot}=getAudioNodeConnections(et),at=deleteActiveInputConnection(it[rt],tt,nt);return at===null?[deletePassiveInputConnectionToAudioNode(ot,tt,nt,rt)[2],!1]:[at[2],!0]},deleteInputConnectionOfAudioParam=(tt,et,nt)=>{const{activeInputs:rt,passiveInputs:it}=getAudioParamConnections(et),ot=deleteActiveInputConnection(rt,tt,nt);return ot===null?[deletePassiveInputConnectionToAudioParam(it,tt,nt)[1],!1]:[ot[2],!0]},deleteInputsOfAudioNode=(tt,et,nt,rt,it)=>{const[ot,at]=deleteInputConnectionOfAudioNode(tt,nt,rt,it);if(ot!==null&&(deleteEventListenerOfAudioNode(tt,ot),at&&!et&&!isPartOfACycle(tt)&&disconnectNativeAudioNodeFromNativeAudioNode(getNativeAudioNode(tt),getNativeAudioNode(nt),rt,it)),isActiveAudioNode(nt)){const{activeInputs:st}=getAudioNodeConnections(nt);setInternalStateToPassiveWhenNecessary(nt,st)}},deleteInputsOfAudioParam=(tt,et,nt,rt)=>{const[it,ot]=deleteInputConnectionOfAudioParam(tt,nt,rt);it!==null&&(deleteEventListenerOfAudioNode(tt,it),ot&&!et&&!isPartOfACycle(tt)&&getNativeAudioNode(tt).disconnect(getNativeAudioParam(nt),rt))},deleteAnyConnection=(tt,et)=>{const nt=getAudioNodeConnections(tt),rt=[];for(const it of nt.outputs)isAudioNodeOutputConnection(it)?deleteInputsOfAudioNode(tt,et,...it):deleteInputsOfAudioParam(tt,et,...it),rt.push(it[0]);return nt.outputs.clear(),rt},deleteConnectionAtOutput=(tt,et,nt)=>{const rt=getAudioNodeConnections(tt),it=[];for(const ot of rt.outputs)ot[1]===nt&&(isAudioNodeOutputConnection(ot)?deleteInputsOfAudioNode(tt,et,...ot):deleteInputsOfAudioParam(tt,et,...ot),it.push(ot[0]),rt.outputs.delete(ot));return it},deleteConnectionToDestination=(tt,et,nt,rt,it)=>{const ot=getAudioNodeConnections(tt);return Array.from(ot.outputs).filter(at=>at[0]===nt&&(rt===void 0||at[1]===rt)&&(it===void 0||at[2]===it)).map(at=>(isAudioNodeOutputConnection(at)?deleteInputsOfAudioNode(tt,et,...at):deleteInputsOfAudioParam(tt,et,...at),ot.outputs.delete(at),at[0]))},createAudioNodeConstructor=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt)=>class extends ct{constructor(bt,wt,xt,kt){super(xt),this._context=bt,this._nativeAudioNode=xt;const St=ut(bt);ht(St)&&nt(testAudioNodeDisconnectMethodSupport,()=>testAudioNodeDisconnectMethodSupport(St,gt))!==!0&&wrapAudioNodeDisconnectMethod(xt),AUDIO_NODE_STORE.set(this,xt),EVENT_LISTENERS.set(this,new Set),bt.state!=="closed"&&wt&&setInternalStateToActive(this),tt(this,kt,xt)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(bt){this._nativeAudioNode.channelCount=bt}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(bt){this._nativeAudioNode.channelCountMode=bt}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(bt){this._nativeAudioNode.channelInterpretation=bt}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(bt,wt=0,xt=0){if(wt<0||wt>=this._nativeAudioNode.numberOfOutputs)throw it();const kt=ut(this._context),St=mt(kt);if(dt(bt)||pt(bt))throw ot();if(isAudioNode$1(bt)){const Et=getNativeAudioNode(bt);try{const Lt=connectNativeAudioNodeToNativeAudioNode(this._nativeAudioNode,Et,wt,xt),jt=isPassiveAudioNode(this);(St||jt)&&this._nativeAudioNode.disconnect(...Lt),this.context.state!=="closed"&&!jt&&isPassiveAudioNode(bt)&&setInternalStateToActive(bt)}catch(Lt){throw Lt.code===12?ot():Lt}if(et(this,bt,wt,xt,St)){const Lt=lt([this],bt);visitEachAudioNodeOnce(Lt,rt(St))}return bt}const Tt=getNativeAudioParam(bt);if(Tt.name==="playbackRate"&&Tt.maxValue===1024)throw at();try{this._nativeAudioNode.connect(Tt,wt),(St||isPassiveAudioNode(this))&&this._nativeAudioNode.disconnect(Tt,wt)}catch(Et){throw Et.code===12?ot():Et}if(addConnectionToAudioParamOfAudioContext(this,bt,wt,St)){const Et=lt([this],bt);visitEachAudioNodeOnce(Et,rt(St))}}disconnect(bt,wt,xt){let kt;const St=ut(this._context),Tt=mt(St);if(bt===void 0)kt=deleteAnyConnection(this,Tt);else if(typeof bt=="number"){if(bt<0||bt>=this.numberOfOutputs)throw it();kt=deleteConnectionAtOutput(this,Tt,bt)}else{if(wt!==void 0&&(wt<0||wt>=this.numberOfOutputs)||isAudioNode$1(bt)&&xt!==void 0&&(xt<0||xt>=bt.numberOfInputs))throw it();if(kt=deleteConnectionToDestination(this,Tt,bt,wt,xt),kt.length===0)throw ot()}for(const At of kt){const Et=lt([this],At);visitEachAudioNodeOnce(Et,st)}}},createAudioParamFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,yt=null,bt=null)=>{const wt=gt.value,xt=new AutomationEventList(wt),kt=mt?rt(xt):null,St={get defaultValue(){return wt},get maxValue(){return yt===null?gt.maxValue:yt},get minValue(){return bt===null?gt.minValue:bt},get value(){return gt.value},set value(Tt){gt.value=Tt,St.setValueAtTime(Tt,pt.context.currentTime)},cancelAndHoldAtTime(Tt){if(typeof gt.cancelAndHoldAtTime=="function")kt===null&&xt.flush(pt.context.currentTime),xt.add(it(Tt)),gt.cancelAndHoldAtTime(Tt);else{const At=Array.from(xt).pop();kt===null&&xt.flush(pt.context.currentTime),xt.add(it(Tt));const Et=Array.from(xt).pop();gt.cancelScheduledValues(Tt),At!==Et&&Et!==void 0&&(Et.type==="exponentialRampToValue"?gt.exponentialRampToValueAtTime(Et.value,Et.endTime):Et.type==="linearRampToValue"?gt.linearRampToValueAtTime(Et.value,Et.endTime):Et.type==="setValue"?gt.setValueAtTime(Et.value,Et.startTime):Et.type==="setValueCurve"&>.setValueCurveAtTime(Et.values,Et.startTime,Et.duration))}return St},cancelScheduledValues(Tt){return kt===null&&xt.flush(pt.context.currentTime),xt.add(ot(Tt)),gt.cancelScheduledValues(Tt),St},exponentialRampToValueAtTime(Tt,At){if(Tt===0)throw new RangeError;if(!Number.isFinite(At)||At<0)throw new RangeError;const Et=pt.context.currentTime;return kt===null&&xt.flush(Et),Array.from(xt).length===0&&(xt.add(ct(wt,Et)),gt.setValueAtTime(wt,Et)),xt.add(at(Tt,At)),gt.exponentialRampToValueAtTime(Tt,At),St},linearRampToValueAtTime(Tt,At){const Et=pt.context.currentTime;return kt===null&&xt.flush(Et),Array.from(xt).length===0&&(xt.add(ct(wt,Et)),gt.setValueAtTime(wt,Et)),xt.add(st(Tt,At)),gt.linearRampToValueAtTime(Tt,At),St},setTargetAtTime(Tt,At,Et){return kt===null&&xt.flush(pt.context.currentTime),xt.add(lt(Tt,At,Et)),gt.setTargetAtTime(Tt,At,Et),St},setValueAtTime(Tt,At){return kt===null&&xt.flush(pt.context.currentTime),xt.add(ct(Tt,At)),gt.setValueAtTime(Tt,At),St},setValueCurveAtTime(Tt,At,Et){const Ct=Tt instanceof Float32Array?Tt:new Float32Array(Tt);if(ht!==null&&ht.name==="webkitAudioContext"){const Lt=At+Et,jt=pt.context.sampleRate,Rt=Math.ceil(At*jt),$t=Math.floor(Lt*jt),vt=$t-Rt,It=new Float32Array(vt);for(let Wt=0;Wt({replay(et){for(const nt of tt)if(nt.type==="exponentialRampToValue"){const{endTime:rt,value:it}=nt;et.exponentialRampToValueAtTime(it,rt)}else if(nt.type==="linearRampToValue"){const{endTime:rt,value:it}=nt;et.linearRampToValueAtTime(it,rt)}else if(nt.type==="setTarget"){const{startTime:rt,target:it,timeConstant:ot}=nt;et.setTargetAtTime(it,rt,ot)}else if(nt.type==="setValue"){const{startTime:rt,value:it}=nt;et.setValueAtTime(it,rt)}else if(nt.type==="setValueCurve"){const{duration:rt,startTime:it,values:ot}=nt;et.setValueCurveAtTime(ot,it,rt)}else throw new Error("Can't apply an unknown automation.")}});class ReadOnlyMap{constructor(et){this._map=new Map(et)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(et,nt=null){return this._map.forEach((rt,it)=>et.call(nt,rt,it,this))}get(et){return this._map.get(et)}has(et){return this._map.has(et)}keys(){return this._map.keys()}values(){return this._map.values()}}const DEFAULT_OPTIONS$h={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},createAudioWorkletNodeConstructor=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt,pt)=>class extends et{constructor(gt,yt,bt){var wt;const xt=st(gt),kt=lt(xt),St=ut({...DEFAULT_OPTIONS$h,...bt});dt(St);const Tt=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(xt),At=Tt==null?void 0:Tt.get(yt),Et=kt||xt.state!=="closed"?xt:(wt=at(xt))!==null&&wt!==void 0?wt:xt,Ct=it(Et,kt?null:gt.baseLatency,ct,yt,At,St),Lt=kt?rt(yt,St,At):null;super(gt,!0,Ct,Lt);const jt=[];Ct.parameters.forEach(($t,vt)=>{const It=nt(this,kt,$t);jt.push([vt,It])}),this._nativeAudioWorkletNode=Ct,this._onprocessorerror=null,this._parameters=new ReadOnlyMap(jt),kt&&tt(xt,this);const{activeInputs:Rt}=ot(this);ht(Ct,Rt)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(gt){const yt=typeof gt=="function"?pt(this,gt):null;this._nativeAudioWorkletNode.onprocessorerror=yt;const bt=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=bt!==null&&bt===yt?gt:bt}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function copyFromChannel(tt,et,nt,rt,it){if(typeof tt.copyFromChannel=="function")et[nt].byteLength===0&&(et[nt]=new Float32Array(128)),tt.copyFromChannel(et[nt],rt,it);else{const ot=tt.getChannelData(rt);if(et[nt].byteLength===0)et[nt]=ot.slice(it,it+128);else{const at=new Float32Array(ot.buffer,it*Float32Array.BYTES_PER_ELEMENT,128);et[nt].set(at)}}}const copyToChannel=(tt,et,nt,rt,it)=>{typeof tt.copyToChannel=="function"?et[nt].byteLength!==0&&tt.copyToChannel(et[nt],rt,it):et[nt].byteLength!==0&&tt.getChannelData(rt).set(et[nt],it)},createNestedArrays=(tt,et)=>{const nt=[];for(let rt=0;rt{const nt=getValueForKey(NODE_TO_PROCESSOR_MAPS,tt),rt=getNativeAudioNode(et);return getValueForKey(nt,rt)},processBuffer=async(tt,et,nt,rt,it,ot,at)=>{const st=et===null?Math.ceil(tt.context.length/128)*128:et.length,lt=rt.channelCount*rt.numberOfInputs,ct=it.reduce((yt,bt)=>yt+bt,0),ut=ct===0?null:nt.createBuffer(ct,st,nt.sampleRate);if(ot===void 0)throw new Error("Missing the processor constructor.");const ht=getAudioNodeConnections(tt),dt=await getAudioWorkletProcessor(nt,tt),pt=createNestedArrays(rt.numberOfInputs,rt.channelCount),mt=createNestedArrays(rt.numberOfOutputs,it),gt=Array.from(tt.parameters.keys()).reduce((yt,bt)=>({...yt,[bt]:new Float32Array(128)}),{});for(let yt=0;yt0&&et!==null)for(let bt=0;bt{copyFromChannel(et,gt,bt,lt+wt,yt)});for(let bt=0;btht.activeInputs[kt].size===0?[]:xt),wt=at(yt/nt.sampleRate,nt.sampleRate,()=>dt.process(bt,mt,gt));if(ut!==null)for(let xt=0,kt=0;xt(yt,bt,wt)=>{const xt=new WeakMap;let kt=null;const St=async(Tt,At)=>{let Et=ut(Tt),Ct=null;const Lt=isOwnedByContext(Et,At),jt=Array.isArray(bt.outputChannelCount)?bt.outputChannelCount:Array.from(bt.outputChannelCount);if(ht===null){const Rt=jt.reduce((Ot,Wt)=>Ot+Wt,0),$t=it(At,{channelCount:Math.max(1,Rt),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,Rt)}),vt=[];for(let Ot=0;Ot{const Ut=new dt(Ft,Math.ceil(Tt.context.length/128)*128,At.sampleRate),Pt=[],Ht=[];for(let Yt=0;Yt{const nn=ot(Ut,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Yt.value});return await pt(Ut,Yt,nn.offset),nn})),an=rt(Ut,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,Wt+zt)});for(let Yt=0;Ytmt(Tt,Ut,Yt))),gt(Ut)})(),At,bt,jt,wt,ct)}const Rt=await kt,$t=nt(At,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[vt,It,Ot]=Ct;Rt!==null&&($t.buffer=Rt,$t.start(0)),$t.connect(vt);for(let Wt=0,zt=0;Wtclass extends mt{constructor(St,Tt){super(St,Tt),this._nativeContext=St,this._audioWorklet=tt===void 0?void 0:{addModule:(At,Et)=>tt(this,At,Et)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new et(this)}createBiquadFilter(){return new it(this)}createBuffer(St,Tt,At){return new nt({length:Tt,numberOfChannels:St,sampleRate:At})}createBufferSource(){return new rt(this)}createChannelMerger(St=6){return new ot(this,{numberOfInputs:St})}createChannelSplitter(St=6){return new at(this,{numberOfOutputs:St})}createConstantSource(){return new st(this)}createConvolver(){return new lt(this)}createDelay(St=1){return new ut(this,{maxDelayTime:St})}createDynamicsCompressor(){return new ht(this)}createGain(){return new dt(this)}createIIRFilter(St,Tt){return new pt(this,{feedback:Tt,feedforward:St})}createOscillator(){return new gt(this)}createPanner(){return new yt(this)}createPeriodicWave(St,Tt,At={disableNormalization:!1}){return new bt(this,{...At,imag:Tt,real:St})}createStereoPanner(){return new wt(this)}createWaveShaper(){return new xt(this)}decodeAudioData(St,Tt,At){return ct(this._nativeContext,St).then(Et=>(typeof Tt=="function"&&Tt(Et),Et),Et=>{throw typeof At=="function"&&At(Et),Et})}},DEFAULT_OPTIONS$g={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},createBiquadFilterNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$g,...ut},pt=it(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._Q=et(this,mt,pt.Q,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._detune=et(this,mt,pt.detune,1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT),-1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT)),this._frequency=et(this,mt,pt.frequency,ct.sampleRate/2,0),this._gain=et(this,mt,pt.gain,40*Math.log10(MOST_POSITIVE_SINGLE_FLOAT),MOST_NEGATIVE_SINGLE_FLOAT),this._nativeBiquadFilterNode=pt,st(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(ct){this._nativeBiquadFilterNode.type=ct}getFrequencyResponse(ct,ut,ht){try{this._nativeBiquadFilterNode.getFrequencyResponse(ct,ut,ht)}catch(dt){throw dt.code===11?rt():dt}if(ct.length!==ut.length||ut.length!==ht.length)throw rt()}},createBiquadFilterNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={Q:ct.Q.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,detune:ct.detune.value,frequency:ct.frequency.value,gain:ct.gain.value,type:ct.type};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.Q,ct.Q),await tt(lt,st.detune,ct.detune),await tt(lt,st.frequency,ct.frequency),await tt(lt,st.gain,ct.gain)):(await rt(lt,st.Q,ct.Q),await rt(lt,st.detune,ct.detune),await rt(lt,st.frequency,ct.frequency),await rt(lt,st.gain,ct.gain)),await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createCacheTestResult=(tt,et)=>(nt,rt)=>{const it=et.get(nt);if(it!==void 0)return it;const ot=tt.get(nt);if(ot!==void 0)return ot;try{const at=rt();return at instanceof Promise?(tt.set(nt,at),at.catch(()=>!1).then(st=>(tt.delete(nt),et.set(nt,st),st))):(et.set(nt,at),at)}catch{return et.set(nt,!1),!1}},DEFAULT_OPTIONS$f={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},createChannelMergerNodeConstructor=(tt,et,nt,rt,it)=>class extends tt{constructor(at,st){const lt=rt(at),ct={...DEFAULT_OPTIONS$f,...st},ut=nt(lt,ct),ht=it(lt)?et():null;super(at,!1,ut,ht)}},createChannelMergerNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfInputs:st.numberOfInputs};st=tt(at,ct)}return rt.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},DEFAULT_OPTIONS$e={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},createChannelSplitterNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut=ot({...DEFAULT_OPTIONS$e,...lt}),ht=nt(ct,ut),dt=it(ct)?et():null;super(st,!1,ht,dt)}},createChannelSplitterNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfOutputs:st.numberOfOutputs};st=tt(at,ct)}return rt.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},createConnectAudioParam=tt=>(et,nt,rt)=>tt(nt,et,rt),createConnectMultipleOutputs=tt=>(et,nt,rt=0,it=0)=>{const ot=et[rt];if(ot===void 0)throw tt();return isNativeAudioNode$1(nt)?ot.connect(nt,0,it):ot.connect(nt,0)},createConnectedNativeAudioBufferSourceNodeFactory=tt=>(et,nt)=>{const rt=tt(et,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),it=et.createBuffer(1,2,44100);return rt.buffer=it,rt.loop=!0,rt.connect(nt),rt.start(),()=>{rt.stop(),rt.disconnect(nt)}},DEFAULT_OPTIONS$d={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},createConstantSourceNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$d,...ct},dt=rt(ut,ht),pt=ot(ut),mt=pt?nt():null;super(lt,!1,dt,mt),this._constantSourceNodeRenderer=mt,this._nativeConstantSourceNode=dt,this._offset=et(this,pt,dt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeConstantSourceNode.onended=ct;const ut=this._nativeConstantSourceNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}start(lt=0){if(this._nativeConstantSourceNode.start(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeConstantSourceNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeConstantSourceNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeConstantSourceNode.stop(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=lt)}},createConstantSourceNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,offset:ht.offset.value};ht=et(ut,pt),at!==null&&ht.start(at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.offset,ht.offset):await rt(ut,ct.offset,ht.offset),await it(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},createConvertNumberToUnsignedLong=tt=>et=>(tt[0]=et,tt[0]),DEFAULT_OPTIONS$c={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},createConvolverNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$c,...lt},ht=nt(ct,ut),pt=it(ct)?et():null;super(st,!1,ht,pt),this._isBufferNullified=!1,this._nativeConvolverNode=ht,ut.buffer!==null&&ot(this,ut.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(st){if(this._nativeConvolverNode.buffer=st,st===null&&this._nativeConvolverNode.buffer!==null){const lt=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=lt.createBuffer(1,1,lt.sampleRate),this._isBufferNullified=!0,ot(this,0)}else this._isBufferNullified=!1,ot(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(st){this._nativeConvolverNode.normalize=st}},createConvolverNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={buffer:st.buffer,channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,disableNormalization:!st.normalize};st=tt(at,ct)}return rt.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},createCreateNativeOfflineAudioContext=(tt,et)=>(nt,rt,it)=>{if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new et(nt,rt,it)}catch(ot){throw ot.name==="SyntaxError"?tt():ot}},createDataCloneError=()=>new DOMException("","DataCloneError"),detachArrayBuffer=tt=>{const{port1:et,port2:nt}=new MessageChannel;return new Promise(rt=>{const it=()=>{nt.onmessage=null,et.close(),nt.close(),rt()};nt.onmessage=()=>it();try{et.postMessage(tt,[tt])}catch{}finally{it()}})},createDecodeAudioData=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=at(ht)?ht:ot(ht);if(it.has(dt)){const mt=nt();return Promise.reject(mt)}try{it.add(dt)}catch{}return et(lt,()=>lt(pt))?pt.decodeAudioData(dt).then(mt=>(detachArrayBuffer(dt).catch(()=>{}),et(st,()=>st(mt))||ut(mt),tt.add(mt),mt)):new Promise((mt,gt)=>{const yt=async()=>{try{await detachArrayBuffer(dt)}catch{}},bt=wt=>{gt(wt),yt()};try{pt.decodeAudioData(dt,wt=>{typeof wt.copyFromChannel!="function"&&(ct(wt),wrapAudioBufferGetChannelDataMethod(wt)),tt.add(wt),yt().then(()=>mt(wt))},wt=>{bt(wt===null?rt():wt)})}catch(wt){bt(wt)}})},createDecrementCycleCounter=(tt,et,nt,rt,it,ot,at,st)=>(lt,ct)=>{const ut=et.get(lt);if(ut===void 0)throw new Error("Missing the expected cycle count.");const ht=ot(lt.context),dt=st(ht);if(ut===ct){if(et.delete(lt),!dt&&at(lt)){const pt=rt(lt),{outputs:mt}=nt(lt);for(const gt of mt)if(isAudioNodeOutputConnection(gt)){const yt=rt(gt[0]);tt(pt,yt,gt[1],gt[2])}else{const yt=it(gt[0]);pt.connect(yt,gt[1])}}}else et.set(lt,ut-ct)},DEFAULT_OPTIONS$b={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},createDelayNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$b,...ct},dt=rt(ut,ht),pt=ot(ut),mt=pt?nt(ht.maxDelayTime):null;super(lt,!1,dt,mt),this._delayTime=et(this,pt,dt.delayTime),at(this,ht.maxDelayTime)}get delayTime(){return this._delayTime}},createDelayNodeRendererFactory=(tt,et,nt,rt,it)=>ot=>{const at=new WeakMap,st=async(lt,ct)=>{let ut=nt(lt);const ht=isOwnedByContext(ut,ct);if(!ht){const dt={channelCount:ut.channelCount,channelCountMode:ut.channelCountMode,channelInterpretation:ut.channelInterpretation,delayTime:ut.delayTime.value,maxDelayTime:ot};ut=et(ct,dt)}return at.set(ct,ut),ht?await tt(ct,lt.delayTime,ut.delayTime):await rt(ct,lt.delayTime,ut.delayTime),await it(lt,ct,ut),ut};return{render(lt,ct){const ut=at.get(ct);return ut!==void 0?Promise.resolve(ut):st(lt,ct)}}},createDeleteActiveInputConnectionToAudioNode=tt=>(et,nt,rt,it)=>tt(et[it],ot=>ot[0]===nt&&ot[1]===rt),createDeleteUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).delete(nt)},isDelayNode=tt=>"delayTime"in tt,createDetectCycles=(tt,et,nt)=>function rt(it,ot){const at=isAudioNode$1(ot)?ot:nt(tt,ot);if(isDelayNode(at))return[];if(it[0]===at)return[it];if(it.includes(at))return[];const{outputs:st}=et(at);return Array.from(st).map(lt=>rt([...it,at],lt[0])).reduce((lt,ct)=>lt.concat(ct),[])},getOutputAudioNodeAtIndex=(tt,et,nt)=>{const rt=et[nt];if(rt===void 0)throw tt();return rt},createDisconnectMultipleOutputs=tt=>(et,nt=void 0,rt=void 0,it=0)=>nt===void 0?et.forEach(ot=>ot.disconnect()):typeof nt=="number"?getOutputAudioNodeAtIndex(tt,et,nt).disconnect():isNativeAudioNode$1(nt)?rt===void 0?et.forEach(ot=>ot.disconnect(nt)):it===void 0?getOutputAudioNodeAtIndex(tt,et,rt).disconnect(nt,0):getOutputAudioNodeAtIndex(tt,et,rt).disconnect(nt,0,it):rt===void 0?et.forEach(ot=>ot.disconnect(nt)):getOutputAudioNodeAtIndex(tt,et,rt).disconnect(nt,0),DEFAULT_OPTIONS$a={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},createDynamicsCompressorNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$a,...ut},pt=rt(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._attack=et(this,mt,pt.attack),this._knee=et(this,mt,pt.knee),this._nativeDynamicsCompressorNode=pt,this._ratio=et(this,mt,pt.ratio),this._release=et(this,mt,pt.release),this._threshold=et(this,mt,pt.threshold),st(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(ct){const ut=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=ct,ct>2)throw this._nativeDynamicsCompressorNode.channelCount=ut,it()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(ct){const ut=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=ct,ct==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=ut,it()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value=="number"?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},createDynamicsCompressorNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={attack:ct.attack.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,knee:ct.knee.value,ratio:ct.ratio.value,release:ct.release.value,threshold:ct.threshold.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.attack,ct.attack),await tt(lt,st.knee,ct.knee),await tt(lt,st.ratio,ct.ratio),await tt(lt,st.release,ct.release),await tt(lt,st.threshold,ct.threshold)):(await rt(lt,st.attack,ct.attack),await rt(lt,st.knee,ct.knee),await rt(lt,st.ratio,ct.ratio),await rt(lt,st.release,ct.release),await rt(lt,st.threshold,ct.threshold)),await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createEncodingError=()=>new DOMException("","EncodingError"),createEvaluateSource=tt=>et=>new Promise((nt,rt)=>{if(tt===null){rt(new SyntaxError);return}const it=tt.document.head;if(it===null)rt(new SyntaxError);else{const ot=tt.document.createElement("script"),at=new Blob([et],{type:"application/javascript"}),st=URL.createObjectURL(at),lt=tt.onerror,ct=()=>{tt.onerror=lt,URL.revokeObjectURL(st)};tt.onerror=(ut,ht,dt,pt,mt)=>{if(ht===st||ht===tt.location.href&&dt===1&&pt===1)return ct(),rt(mt),!1;if(lt!==null)return lt(ut,ht,dt,pt,mt)},ot.onerror=()=>{ct(),rt(new SyntaxError)},ot.onload=()=>{ct(),nt()},ot.src=st,ot.type="module",it.appendChild(ot)}}),createEventTargetConstructor=tt=>class{constructor(nt){this._nativeEventTarget=nt,this._listeners=new WeakMap}addEventListener(nt,rt,it){if(rt!==null){let ot=this._listeners.get(rt);ot===void 0&&(ot=tt(this,rt),typeof rt=="function"&&this._listeners.set(rt,ot)),this._nativeEventTarget.addEventListener(nt,ot,it)}}dispatchEvent(nt){return this._nativeEventTarget.dispatchEvent(nt)}removeEventListener(nt,rt,it){const ot=rt===null?void 0:this._listeners.get(rt);this._nativeEventTarget.removeEventListener(nt,ot===void 0?null:ot,it)}},createExposeCurrentFrameAndCurrentTime=tt=>(et,nt,rt)=>{Object.defineProperties(tt,{currentFrame:{configurable:!0,get(){return Math.round(et*nt)}},currentTime:{configurable:!0,get(){return et}}});try{return rt()}finally{tt!==null&&(delete tt.currentFrame,delete tt.currentTime)}},createFetchSource=tt=>async et=>{try{const nt=await fetch(et);if(nt.ok)return[await nt.text(),nt.url]}catch{}throw tt()},DEFAULT_OPTIONS$9={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},createGainNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$9,...lt},ht=rt(ct,ut),dt=ot(ct),pt=dt?nt():null;super(st,!1,ht,pt),this._gain=et(this,dt,ht.gain,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get gain(){return this._gain}},createGainNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,gain:ct.gain.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.gain,ct.gain):await rt(lt,st.gain,ct.gain),await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createGetActiveAudioWorkletNodeInputs=(tt,et)=>nt=>et(tt,nt),createGetAudioNodeRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return nt.renderer},createGetAudioNodeTailTime=tt=>et=>{var nt;return(nt=tt.get(et))!==null&&nt!==void 0?nt:0},createGetAudioParamRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return nt.renderer},createGetBackupOfflineAudioContext=tt=>et=>tt.get(et),createInvalidStateError=()=>new DOMException("","InvalidStateError"),createGetNativeContext=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw createInvalidStateError();return nt},createGetOrCreateBackupOfflineAudioContext=(tt,et)=>nt=>{let rt=tt.get(nt);if(rt!==void 0)return rt;if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");return rt=new et(1,1,44100),tt.set(nt,rt),rt},createGetUnrenderedAudioWorkletNodes=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return nt},createInvalidAccessError=()=>new DOMException("","InvalidAccessError"),wrapIIRFilterNodeGetFrequencyResponseMethod=tt=>{tt.getFrequencyResponse=(et=>(nt,rt,it)=>{if(nt.length!==rt.length||rt.length!==it.length)throw createInvalidAccessError();return et.call(tt,nt,rt,it)})(tt.getFrequencyResponse)},DEFAULT_OPTIONS$8={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},createIIRFilterNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut=it(ct),ht={...DEFAULT_OPTIONS$8,...lt},dt=et(ct,ut?null:st.baseLatency,ht),pt=ut?nt(ht.feedback,ht.feedforward):null;super(st,!1,dt,pt),wrapIIRFilterNodeGetFrequencyResponseMethod(dt),this._nativeIIRFilterNode=dt,ot(this,1)}getFrequencyResponse(st,lt,ct){return this._nativeIIRFilterNode.getFrequencyResponse(st,lt,ct)}},filterBuffer=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut)=>{const ht=ct.length;let dt=st;for(let pt=0;pt{const it=nt instanceof Float64Array?nt:new Float64Array(nt),ot=rt instanceof Float64Array?rt:new Float64Array(rt),at=it.length,st=ot.length,lt=Math.min(at,st);if(it[0]!==1){for(let mt=0;mt(ot,at)=>{const st=new WeakMap;let lt=null;const ct=async(ut,ht)=>{let dt=null,pt=et(ut);const mt=isOwnedByContext(pt,ht);if(ht.createIIRFilter===void 0?dt=tt(ht,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):mt||(pt=ht.createIIRFilter(at,ot)),st.set(ht,dt===null?pt:dt),dt!==null){if(lt===null){if(nt===null)throw new Error("Missing the native OfflineAudioContext constructor.");const yt=new nt(ut.context.destination.channelCount,ut.context.length,ht.sampleRate);lt=(async()=>{await rt(ut,yt,yt.destination);const bt=await it(yt);return filterFullBuffer(bt,ht,ot,at)})()}const gt=await lt;return dt.buffer=gt,dt.start(0),dt}return await rt(ut,ht,pt),pt};return{render(ut,ht){const dt=st.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},createIncrementCycleCounterFactory=(tt,et,nt,rt,it,ot)=>at=>(st,lt)=>{const ct=tt.get(st);if(ct===void 0){if(!at&&ot(st)){const ut=rt(st),{outputs:ht}=nt(st);for(const dt of ht)if(isAudioNodeOutputConnection(dt)){const pt=rt(dt[0]);et(ut,pt,dt[1],dt[2])}else{const pt=it(dt[0]);ut.disconnect(pt,dt[1])}}tt.set(st,lt)}else tt.set(st,ct+lt)},createIsAnyAudioContext=(tt,et)=>nt=>{const rt=tt.get(nt);return et(rt)||et(nt)},createIsAnyAudioNode=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyAudioParam=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyOfflineAudioContext=(tt,et)=>nt=>{const rt=tt.get(nt);return et(rt)||et(nt)},createIsNativeAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsNativeAudioNode=tt=>et=>tt!==null&&typeof tt.AudioNode=="function"&&et instanceof tt.AudioNode,createIsNativeAudioParam=tt=>et=>tt!==null&&typeof tt.AudioParam=="function"&&et instanceof tt.AudioParam,createIsNativeContext=(tt,et)=>nt=>tt(nt)||et(nt),createIsNativeOfflineAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsSecureContext=tt=>tt!==null&&tt.isSecureContext,createMediaElementAudioSourceNodeConstructor=(tt,et,nt,rt)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(rt(st))throw TypeError();super(ot,!0,lt,null),this._nativeMediaElementAudioSourceNode=lt}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},DEFAULT_OPTIONS$7={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},createMediaStreamAudioDestinationNodeConstructor=(tt,et,nt,rt)=>class extends tt{constructor(ot,at){const st=nt(ot);if(rt(st))throw new TypeError;const lt={...DEFAULT_OPTIONS$7,...at},ct=et(st,lt);super(ot,!1,ct,null),this._nativeMediaStreamAudioDestinationNode=ct}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},createMediaStreamAudioSourceNodeConstructor=(tt,et,nt,rt)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(rt(st))throw new TypeError;super(ot,!0,lt,null),this._nativeMediaStreamAudioSourceNode=lt}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},createMediaStreamTrackAudioSourceNodeConstructor=(tt,et,nt)=>class extends tt{constructor(it,ot){const at=nt(it),st=et(at,ot);super(it,!0,st,null)}},createMinimalBaseAudioContextConstructor=(tt,et,nt,rt,it,ot)=>class extends nt{constructor(st,lt){super(st),this._nativeContext=st,CONTEXT_STORE.set(this,st),rt(st)&&it.set(st,new Set),this._destination=new tt(this,lt),this._listener=et(this,st),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(st){const lt=typeof st=="function"?ot(this,st):null;this._nativeContext.onstatechange=lt;const ct=this._nativeContext.onstatechange;this._onstatechange=ct!==null&&ct===lt?st:ct}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},testPromiseSupport=tt=>{const et=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const nt=tt.decodeAudioData(et.buffer,()=>{});return nt===void 0?!1:(nt.catch(()=>{}),!0)}catch{}return!1},createMonitorConnections=(tt,et)=>(nt,rt,it)=>{const ot=new Set;return nt.connect=(at=>(st,lt=0,ct=0)=>{const ut=ot.size===0;if(et(st))return at.call(nt,st,lt,ct),tt(ot,[st,lt,ct],ht=>ht[0]===st&&ht[1]===lt&&ht[2]===ct,!0),ut&&rt(),st;at.call(nt,st,lt),tt(ot,[st,lt],ht=>ht[0]===st&&ht[1]===lt,!0),ut&&rt()})(nt.connect),nt.disconnect=(at=>(st,lt,ct)=>{const ut=ot.size>0;if(st===void 0)at.apply(nt),ot.clear();else if(typeof st=="number"){at.call(nt,st);for(const dt of ot)dt[1]===st&&ot.delete(dt)}else{et(st)?at.call(nt,st,lt,ct):at.call(nt,st,lt);for(const dt of ot)dt[0]===st&&(lt===void 0||dt[1]===lt)&&(ct===void 0||dt[2]===ct)&&ot.delete(dt)}const ht=ot.size===0;ut&&ht&&it()})(nt.disconnect),nt},assignNativeAudioNodeOption=(tt,et,nt)=>{const rt=et[nt];rt!==void 0&&rt!==tt[nt]&&(tt[nt]=rt)},assignNativeAudioNodeOptions=(tt,et)=>{assignNativeAudioNodeOption(tt,et,"channelCount"),assignNativeAudioNodeOption(tt,et,"channelCountMode"),assignNativeAudioNodeOption(tt,et,"channelInterpretation")},testAnalyserNodeGetFloatTimeDomainDataMethodSupport=tt=>typeof tt.getFloatTimeDomainData=="function",wrapAnalyserNodeGetFloatTimeDomainDataMethod=tt=>{tt.getFloatTimeDomainData=et=>{const nt=new Uint8Array(et.length);tt.getByteTimeDomainData(nt);const rt=Math.max(nt.length,tt.fftSize);for(let it=0;it(nt,rt)=>{const it=nt.createAnalyser();if(assignNativeAudioNodeOptions(it,rt),!(rt.maxDecibels>rt.minDecibels))throw et();return assignNativeAudioNodeOption(it,rt,"fftSize"),assignNativeAudioNodeOption(it,rt,"maxDecibels"),assignNativeAudioNodeOption(it,rt,"minDecibels"),assignNativeAudioNodeOption(it,rt,"smoothingTimeConstant"),tt(testAnalyserNodeGetFloatTimeDomainDataMethodSupport,()=>testAnalyserNodeGetFloatTimeDomainDataMethodSupport(it))||wrapAnalyserNodeGetFloatTimeDomainDataMethod(it),it},createNativeAudioBufferConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioBuffer")?tt.AudioBuffer:null,assignNativeAudioNodeAudioParamValue=(tt,et,nt)=>{const rt=et[nt];rt!==void 0&&rt!==tt[nt].value&&(tt[nt].value=rt)},wrapAudioBufferSourceNodeStartMethodConsecutiveCalls=tt=>{tt.start=(et=>{let nt=!1;return(rt=0,it=0,ot)=>{if(nt)throw createInvalidStateError();et.call(tt,rt,it,ot),nt=!0}})(tt.start)},wrapAudioScheduledSourceNodeStartMethodNegativeParameters=tt=>{tt.start=(et=>(nt=0,rt=0,it)=>{if(typeof it=="number"&&it<0||rt<0||nt<0)throw new RangeError("The parameters can't be negative.");et.call(tt,nt,rt,it)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodNegativeParameters=tt=>{tt.stop=(et=>(nt=0)=>{if(nt<0)throw new RangeError("The parameter can't be negative.");et.call(tt,nt)})(tt.stop)},createNativeAudioBufferSourceNodeFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=ht.createBufferSource();return assignNativeAudioNodeOptions(pt,dt),assignNativeAudioNodeAudioParamValue(pt,dt,"playbackRate"),assignNativeAudioNodeOption(pt,dt,"buffer"),assignNativeAudioNodeOption(pt,dt,"loop"),assignNativeAudioNodeOption(pt,dt,"loopEnd"),assignNativeAudioNodeOption(pt,dt,"loopStart"),et(nt,()=>nt(ht))||wrapAudioBufferSourceNodeStartMethodConsecutiveCalls(pt),et(rt,()=>rt(ht))||lt(pt),et(it,()=>it(ht))||ct(pt,ht),et(ot,()=>ot(ht))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(pt),et(at,()=>at(ht))||ut(pt,ht),et(st,()=>st(ht))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(pt),tt(ht,pt),pt},createNativeAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioContext")?tt.AudioContext:tt.hasOwnProperty("webkitAudioContext")?tt.webkitAudioContext:null,createNativeAudioDestinationNodeFactory=(tt,et)=>(nt,rt,it)=>{const ot=nt.destination;if(ot.channelCount!==rt)try{ot.channelCount=rt}catch{}it&&ot.channelCountMode!=="explicit"&&(ot.channelCountMode="explicit"),ot.maxChannelCount===0&&Object.defineProperty(ot,"maxChannelCount",{value:rt});const at=tt(nt,{channelCount:rt,channelCountMode:ot.channelCountMode,channelInterpretation:ot.channelInterpretation,gain:1});return et(at,"channelCount",st=>()=>st.call(at),st=>lt=>{st.call(at,lt);try{ot.channelCount=lt}catch(ct){if(lt>ot.maxChannelCount)throw ct}}),et(at,"channelCountMode",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelCountMode=lt}),et(at,"channelInterpretation",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelInterpretation=lt}),Object.defineProperty(at,"maxChannelCount",{get:()=>ot.maxChannelCount}),at.connect(ot),at},createNativeAudioWorkletNodeConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioWorkletNode")?tt.AudioWorkletNode:null,testClonabilityOfAudioWorkletNodeOptions=tt=>{const{port1:et}=new MessageChannel;try{et.postMessage(tt)}finally{et.close()}},createNativeAudioWorkletNodeFactory=(tt,et,nt,rt,it)=>(ot,at,st,lt,ct,ut)=>{if(st!==null)try{const ht=new st(ot,lt,ut),dt=new Map;let pt=null;if(Object.defineProperties(ht,{channelCount:{get:()=>ut.channelCount,set:()=>{throw tt()}},channelCountMode:{get:()=>"explicit",set:()=>{throw tt()}},onprocessorerror:{get:()=>pt,set:mt=>{typeof pt=="function"&&ht.removeEventListener("processorerror",pt),pt=typeof mt=="function"?mt:null,typeof pt=="function"&&ht.addEventListener("processorerror",pt)}}}),ht.addEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const yt=typeof gt[1]=="function"?gt[1]:typeof gt[1]=="object"&>[1]!==null&&typeof gt[1].handleEvent=="function"?gt[1].handleEvent:null;if(yt!==null){const bt=dt.get(gt[1]);bt!==void 0?gt[1]=bt:(gt[1]=wt=>{wt.type==="error"?(Object.defineProperties(wt,{type:{value:"processorerror"}}),yt(wt)):yt(new ErrorEvent(gt[0],{...wt}))},dt.set(yt,gt[1]))}}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,...gt)})(ht.addEventListener),ht.removeEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const yt=dt.get(gt[1]);yt!==void 0&&(dt.delete(gt[1]),gt[1]=yt)}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,gt[0],gt[1],gt[2])})(ht.removeEventListener),ut.numberOfOutputs!==0){const mt=nt(ot,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return ht.connect(mt).connect(ot.destination),it(ht,()=>mt.disconnect(),()=>mt.connect(ot.destination))}return ht}catch(ht){throw ht.code===11?rt():ht}if(ct===void 0)throw rt();return testClonabilityOfAudioWorkletNodeOptions(ut),et(ot,at,ct,ut)},computeBufferSize=(tt,et)=>tt===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(tt*et))))),cloneAudioWorkletNodeOptions=tt=>new Promise((et,nt)=>{const{port1:rt,port2:it}=new MessageChannel;rt.onmessage=({data:ot})=>{rt.close(),it.close(),et(ot)},rt.onmessageerror=({data:ot})=>{rt.close(),it.close(),nt(ot)},it.postMessage(tt)}),createAudioWorkletProcessorPromise=async(tt,et)=>{const nt=await cloneAudioWorkletNodeOptions(et);return new tt(nt)},createAudioWorkletProcessor=(tt,et,nt,rt)=>{let it=NODE_TO_PROCESSOR_MAPS.get(tt);it===void 0&&(it=new WeakMap,NODE_TO_PROCESSOR_MAPS.set(tt,it));const ot=createAudioWorkletProcessorPromise(nt,rt);return it.set(et,ot),ot},createNativeAudioWorkletNodeFakerFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,yt)=>{if(yt.numberOfInputs===0&&yt.numberOfOutputs===0)throw lt();const bt=Array.isArray(yt.outputChannelCount)?yt.outputChannelCount:Array.from(yt.outputChannelCount);if(bt.some($n=>$n<1))throw lt();if(bt.length!==yt.numberOfOutputs)throw et();if(yt.channelCountMode!=="explicit")throw lt();const wt=yt.channelCount*yt.numberOfInputs,xt=bt.reduce(($n,Nn)=>$n+Nn,0),kt=gt.parameterDescriptors===void 0?0:gt.parameterDescriptors.length;if(wt+kt>6||xt>6)throw lt();const St=new MessageChannel,Tt=[],At=[];for(let $n=0;$n$n===void 0?0:$n},maxValue:{get:()=>Nn===void 0?MOST_POSITIVE_SINGLE_FLOAT:Nn},minValue:{get:()=>En===void 0?MOST_NEGATIVE_SINGLE_FLOAT:En}}),Et.push(pn)}const Ct=rt(pt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,wt+kt)}),Lt=computeBufferSize(mt,pt.sampleRate),jt=st(pt,Lt,wt+kt,Math.max(1,xt)),Rt=it(pt,{channelCount:Math.max(1,xt),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,xt)}),$t=[];for(let $n=0;$n{const En=Et[Nn];return En.connect(Ct,0,wt+Nn),En.start(0),[$n,En.offset]}));Ct.connect(jt);let It=yt.channelInterpretation,Ot=null;const Wt=yt.numberOfOutputs===0?[jt]:$t,zt={get bufferSize(){return Lt},get channelCount(){return yt.channelCount},set channelCount($n){throw nt()},get channelCountMode(){return yt.channelCountMode},set channelCountMode($n){throw nt()},get channelInterpretation(){return It},set channelInterpretation($n){for(const Nn of Tt)Nn.channelInterpretation=$n;It=$n},get context(){return jt.context},get inputs(){return Tt},get numberOfInputs(){return yt.numberOfInputs},get numberOfOutputs(){return yt.numberOfOutputs},get onprocessorerror(){return Ot},set onprocessorerror($n){typeof Ot=="function"&&zt.removeEventListener("processorerror",Ot),Ot=typeof $n=="function"?$n:null,typeof Ot=="function"&&zt.addEventListener("processorerror",Ot)},get parameters(){return vt},get port(){return St.port2},addEventListener(...$n){return jt.addEventListener($n[0],$n[1],$n[2])},connect:tt.bind(null,Wt),disconnect:ct.bind(null,Wt),dispatchEvent(...$n){return jt.dispatchEvent($n[0])},removeEventListener(...$n){return jt.removeEventListener($n[0],$n[1],$n[2])}},Ft=new Map;St.port1.addEventListener=($n=>(...Nn)=>{if(Nn[0]==="message"){const En=typeof Nn[1]=="function"?Nn[1]:typeof Nn[1]=="object"&&Nn[1]!==null&&typeof Nn[1].handleEvent=="function"?Nn[1].handleEvent:null;if(En!==null){const sn=Ft.get(Nn[1]);sn!==void 0?Nn[1]=sn:(Nn[1]=pn=>{ut(pt.currentTime,pt.sampleRate,()=>En(pn))},Ft.set(En,Nn[1]))}}return $n.call(St.port1,Nn[0],Nn[1],Nn[2])})(St.port1.addEventListener),St.port1.removeEventListener=($n=>(...Nn)=>{if(Nn[0]==="message"){const En=Ft.get(Nn[1]);En!==void 0&&(Ft.delete(Nn[1]),Nn[1]=En)}return $n.call(St.port1,Nn[0],Nn[1],Nn[2])})(St.port1.removeEventListener);let Nt=null;Object.defineProperty(St.port1,"onmessage",{get:()=>Nt,set:$n=>{typeof Nt=="function"&&St.port1.removeEventListener("message",Nt),Nt=typeof $n=="function"?$n:null,typeof Nt=="function"&&(St.port1.addEventListener("message",Nt),St.port1.start())}}),gt.prototype.port=St.port1;let Ut=null;createAudioWorkletProcessor(pt,zt,gt,yt).then($n=>Ut=$n);const Ht=createNestedArrays(yt.numberOfInputs,yt.channelCount),Qt=createNestedArrays(yt.numberOfOutputs,bt),an=gt.parameterDescriptors===void 0?[]:gt.parameterDescriptors.reduce(($n,{name:Nn})=>({...$n,[Nn]:new Float32Array(128)}),{});let Yt=!0;const nn=()=>{yt.numberOfOutputs>0&&jt.disconnect(Rt);for(let $n=0,Nn=0;$n{if(Ut!==null){const En=ht(zt);for(let sn=0;sn{copyFromChannel($n,an,pn,wt+Tn,sn)});for(let pn=0;pn{if(En[yn].size>0)return tn.set(yn,Lt/128),In;const fn=tn.get(yn);return fn===void 0?[]:(In.every(xn=>xn.every(jn=>jn===0))&&(fn===1?tn.delete(yn):tn.set(yn,fn-1)),In)});Yt=ut(pt.currentTime+sn/pt.sampleRate,pt.sampleRate,()=>Ut.process(pn,Qt,an));for(let In=0,yn=0;Injt.connect(wn).connect(pt.destination),Jt=()=>{jt.disconnect(wn),wn.disconnect()},vn=()=>{if(Yt){Jt(),yt.numberOfOutputs>0&&jt.connect(Rt);for(let $n=0,Nn=0;$n{Yt&&(rn(),nn()),dn=!1};return rn(),dt(zt,vn,Cn)},createNativeBiquadFilterNode=(tt,et)=>{const nt=tt.createBiquadFilter();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"Q"),assignNativeAudioNodeAudioParamValue(nt,et,"detune"),assignNativeAudioNodeAudioParamValue(nt,et,"frequency"),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),assignNativeAudioNodeOption(nt,et,"type"),nt},createNativeChannelMergerNodeFactory=(tt,et)=>(nt,rt)=>{const it=nt.createChannelMerger(rt.numberOfInputs);return tt!==null&&tt.name==="webkitAudioContext"&&et(nt,it),assignNativeAudioNodeOptions(it,rt),it},wrapChannelSplitterNode=tt=>{const et=tt.numberOfOutputs;Object.defineProperty(tt,"channelCount",{get:()=>et,set:nt=>{if(nt!==et)throw createInvalidStateError()}}),Object.defineProperty(tt,"channelCountMode",{get:()=>"explicit",set:nt=>{if(nt!=="explicit")throw createInvalidStateError()}}),Object.defineProperty(tt,"channelInterpretation",{get:()=>"discrete",set:nt=>{if(nt!=="discrete")throw createInvalidStateError()}})},createNativeChannelSplitterNode=(tt,et)=>{const nt=tt.createChannelSplitter(et.numberOfOutputs);return assignNativeAudioNodeOptions(nt,et),wrapChannelSplitterNode(nt),nt},createNativeConstantSourceNodeFactory=(tt,et,nt,rt,it)=>(ot,at)=>{if(ot.createConstantSource===void 0)return nt(ot,at);const st=ot.createConstantSource();return assignNativeAudioNodeOptions(st,at),assignNativeAudioNodeAudioParamValue(st,at,"offset"),et(rt,()=>rt(ot))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(st),et(it,()=>it(ot))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(st),tt(ot,st),st},interceptConnections=(tt,et)=>(tt.connect=et.connect.bind(et),tt.disconnect=et.disconnect.bind(et),tt),createNativeConstantSourceNodeFakerFactory=(tt,et,nt,rt)=>(it,{offset:ot,...at})=>{const st=it.createBuffer(1,2,44100),lt=et(it,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),ct=nt(it,{...at,gain:ot}),ut=st.getChannelData(0);ut[0]=1,ut[1]=1,lt.buffer=st,lt.loop=!0;const ht={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(mt){ct.channelCount=mt},get channelCountMode(){return ct.channelCountMode},set channelCountMode(mt){ct.channelCountMode=mt},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(mt){ct.channelInterpretation=mt},get context(){return ct.context},get inputs(){return[]},get numberOfInputs(){return lt.numberOfInputs},get numberOfOutputs(){return ct.numberOfOutputs},get offset(){return ct.gain},get onended(){return lt.onended},set onended(mt){lt.onended=mt},addEventListener(...mt){return lt.addEventListener(mt[0],mt[1],mt[2])},dispatchEvent(...mt){return lt.dispatchEvent(mt[0])},removeEventListener(...mt){return lt.removeEventListener(mt[0],mt[1],mt[2])},start(mt=0){lt.start.call(lt,mt)},stop(mt=0){lt.stop.call(lt,mt)}},dt=()=>lt.connect(ct),pt=()=>lt.disconnect(ct);return tt(it,lt),rt(interceptConnections(ht,ct),dt,pt)},createNativeConvolverNodeFactory=(tt,et)=>(nt,rt)=>{const it=nt.createConvolver();if(assignNativeAudioNodeOptions(it,rt),rt.disableNormalization===it.normalize&&(it.normalize=!rt.disableNormalization),assignNativeAudioNodeOption(it,rt,"buffer"),rt.channelCount>2||(et(it,"channelCount",ot=>()=>ot.call(it),ot=>at=>{if(at>2)throw tt();return ot.call(it,at)}),rt.channelCountMode==="max"))throw tt();return et(it,"channelCountMode",ot=>()=>ot.call(it),ot=>at=>{if(at==="max")throw tt();return ot.call(it,at)}),it},createNativeDelayNode=(tt,et)=>{const nt=tt.createDelay(et.maxDelayTime);return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"delayTime"),nt},createNativeDynamicsCompressorNodeFactory=tt=>(et,nt)=>{const rt=et.createDynamicsCompressor();if(assignNativeAudioNodeOptions(rt,nt),nt.channelCount>2||nt.channelCountMode==="max")throw tt();return assignNativeAudioNodeAudioParamValue(rt,nt,"attack"),assignNativeAudioNodeAudioParamValue(rt,nt,"knee"),assignNativeAudioNodeAudioParamValue(rt,nt,"ratio"),assignNativeAudioNodeAudioParamValue(rt,nt,"release"),assignNativeAudioNodeAudioParamValue(rt,nt,"threshold"),rt},createNativeGainNode=(tt,et)=>{const nt=tt.createGain();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),nt},createNativeIIRFilterNodeFactory=tt=>(et,nt,rt)=>{if(et.createIIRFilter===void 0)return tt(et,nt,rt);const it=et.createIIRFilter(rt.feedforward,rt.feedback);return assignNativeAudioNodeOptions(it,rt),it};function divide$1(tt,et){const nt=et[0]*et[0]+et[1]*et[1];return[(tt[0]*et[0]+tt[1]*et[1])/nt,(tt[1]*et[0]-tt[0]*et[1])/nt]}function multiply(tt,et){return[tt[0]*et[0]-tt[1]*et[1],tt[0]*et[1]+tt[1]*et[0]]}function evaluatePolynomial(tt,et){let nt=[0,0];for(let rt=tt.length-1;rt>=0;rt-=1)nt=multiply(nt,et),nt[0]+=tt[rt];return nt}const createNativeIIRFilterNodeFakerFactory=(tt,et,nt,rt)=>(it,ot,{channelCount:at,channelCountMode:st,channelInterpretation:lt,feedback:ct,feedforward:ut})=>{const ht=computeBufferSize(ot,it.sampleRate),dt=ct instanceof Float64Array?ct:new Float64Array(ct),pt=ut instanceof Float64Array?ut:new Float64Array(ut),mt=dt.length,gt=pt.length,yt=Math.min(mt,gt);if(mt===0||mt>20)throw rt();if(dt[0]===0)throw et();if(gt===0||gt>20)throw rt();if(pt[0]===0)throw et();if(dt[0]!==1){for(let Et=0;Et{const Ct=Et.inputBuffer,Lt=Et.outputBuffer,jt=Ct.numberOfChannels;for(let Rt=0;Rttt.createMediaElementSource(et.mediaElement),createNativeMediaStreamAudioDestinationNode=(tt,et)=>{const nt=tt.createMediaStreamDestination();return assignNativeAudioNodeOptions(nt,et),nt.numberOfOutputs===1&&Object.defineProperty(nt,"numberOfOutputs",{get:()=>0}),nt},createNativeMediaStreamAudioSourceNode=(tt,{mediaStream:et})=>{const nt=et.getAudioTracks();nt.sort((ot,at)=>ot.idat.id?1:0);const rt=nt.slice(0,1),it=tt.createMediaStreamSource(new MediaStream(rt));return Object.defineProperty(it,"mediaStream",{value:et}),it},createNativeMediaStreamTrackAudioSourceNodeFactory=(tt,et)=>(nt,{mediaStreamTrack:rt})=>{if(typeof nt.createMediaStreamTrackSource=="function")return nt.createMediaStreamTrackSource(rt);const it=new MediaStream([rt]),ot=nt.createMediaStreamSource(it);if(rt.kind!=="audio")throw tt();if(et(nt))throw new TypeError;return ot},createNativeOfflineAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("OfflineAudioContext")?tt.OfflineAudioContext:tt.hasOwnProperty("webkitOfflineAudioContext")?tt.webkitOfflineAudioContext:null,createNativeOscillatorNodeFactory=(tt,et,nt,rt,it,ot)=>(at,st)=>{const lt=at.createOscillator();return assignNativeAudioNodeOptions(lt,st),assignNativeAudioNodeAudioParamValue(lt,st,"detune"),assignNativeAudioNodeAudioParamValue(lt,st,"frequency"),st.periodicWave!==void 0?lt.setPeriodicWave(st.periodicWave):assignNativeAudioNodeOption(lt,st,"type"),et(nt,()=>nt(at))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(lt),et(rt,()=>rt(at))||ot(lt,at),et(it,()=>it(at))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(lt),tt(at,lt),lt},createNativePannerNodeFactory=tt=>(et,nt)=>{const rt=et.createPanner();return rt.orientationX===void 0?tt(et,nt):(assignNativeAudioNodeOptions(rt,nt),assignNativeAudioNodeAudioParamValue(rt,nt,"orientationX"),assignNativeAudioNodeAudioParamValue(rt,nt,"orientationY"),assignNativeAudioNodeAudioParamValue(rt,nt,"orientationZ"),assignNativeAudioNodeAudioParamValue(rt,nt,"positionX"),assignNativeAudioNodeAudioParamValue(rt,nt,"positionY"),assignNativeAudioNodeAudioParamValue(rt,nt,"positionZ"),assignNativeAudioNodeOption(rt,nt,"coneInnerAngle"),assignNativeAudioNodeOption(rt,nt,"coneOuterAngle"),assignNativeAudioNodeOption(rt,nt,"coneOuterGain"),assignNativeAudioNodeOption(rt,nt,"distanceModel"),assignNativeAudioNodeOption(rt,nt,"maxDistance"),assignNativeAudioNodeOption(rt,nt,"panningModel"),assignNativeAudioNodeOption(rt,nt,"refDistance"),assignNativeAudioNodeOption(rt,nt,"rolloffFactor"),rt)},createNativePannerNodeFakerFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct)=>(ut,{coneInnerAngle:ht,coneOuterAngle:dt,coneOuterGain:pt,distanceModel:mt,maxDistance:gt,orientationX:yt,orientationY:bt,orientationZ:wt,panningModel:xt,positionX:kt,positionY:St,positionZ:Tt,refDistance:At,rolloffFactor:Et,...Ct})=>{const Lt=ut.createPanner();if(Ct.channelCount>2||Ct.channelCountMode==="max")throw at();assignNativeAudioNodeOptions(Lt,Ct);const jt={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},Rt=nt(ut,{...jt,channelInterpretation:"speakers",numberOfInputs:6}),$t=rt(ut,{...Ct,gain:1}),vt=rt(ut,{...jt,gain:1}),It=rt(ut,{...jt,gain:0}),Ot=rt(ut,{...jt,gain:0}),Wt=rt(ut,{...jt,gain:0}),zt=rt(ut,{...jt,gain:0}),Ft=rt(ut,{...jt,gain:0}),Nt=it(ut,256,6,1),Ut=ot(ut,{...jt,curve:new Float32Array([1,1]),oversample:"none"});let Pt=[yt,bt,wt],Ht=[kt,St,Tt];const Qt=new Float32Array(1);Nt.onaudioprocess=({inputBuffer:tn})=>{const dn=[lt(tn,Qt,0),lt(tn,Qt,1),lt(tn,Qt,2)];dn.some((rn,Jt)=>rn!==Pt[Jt])&&(Lt.setOrientation(...dn),Pt=dn);const wn=[lt(tn,Qt,3),lt(tn,Qt,4),lt(tn,Qt,5)];wn.some((rn,Jt)=>rn!==Ht[Jt])&&(Lt.setPosition(...wn),Ht=wn)},Object.defineProperty(It.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Ot.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Wt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(zt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Ft.gain,"defaultValue",{get:()=>0});const an={get bufferSize(){},get channelCount(){return Lt.channelCount},set channelCount(tn){if(tn>2)throw at();$t.channelCount=tn,Lt.channelCount=tn},get channelCountMode(){return Lt.channelCountMode},set channelCountMode(tn){if(tn==="max")throw at();$t.channelCountMode=tn,Lt.channelCountMode=tn},get channelInterpretation(){return Lt.channelInterpretation},set channelInterpretation(tn){$t.channelInterpretation=tn,Lt.channelInterpretation=tn},get coneInnerAngle(){return Lt.coneInnerAngle},set coneInnerAngle(tn){Lt.coneInnerAngle=tn},get coneOuterAngle(){return Lt.coneOuterAngle},set coneOuterAngle(tn){Lt.coneOuterAngle=tn},get coneOuterGain(){return Lt.coneOuterGain},set coneOuterGain(tn){if(tn<0||tn>1)throw et();Lt.coneOuterGain=tn},get context(){return Lt.context},get distanceModel(){return Lt.distanceModel},set distanceModel(tn){Lt.distanceModel=tn},get inputs(){return[$t]},get maxDistance(){return Lt.maxDistance},set maxDistance(tn){if(tn<0)throw new RangeError;Lt.maxDistance=tn},get numberOfInputs(){return Lt.numberOfInputs},get numberOfOutputs(){return Lt.numberOfOutputs},get orientationX(){return vt.gain},get orientationY(){return It.gain},get orientationZ(){return Ot.gain},get panningModel(){return Lt.panningModel},set panningModel(tn){Lt.panningModel=tn},get positionX(){return Wt.gain},get positionY(){return zt.gain},get positionZ(){return Ft.gain},get refDistance(){return Lt.refDistance},set refDistance(tn){if(tn<0)throw new RangeError;Lt.refDistance=tn},get rolloffFactor(){return Lt.rolloffFactor},set rolloffFactor(tn){if(tn<0)throw new RangeError;Lt.rolloffFactor=tn},addEventListener(...tn){return $t.addEventListener(tn[0],tn[1],tn[2])},dispatchEvent(...tn){return $t.dispatchEvent(tn[0])},removeEventListener(...tn){return $t.removeEventListener(tn[0],tn[1],tn[2])}};ht!==an.coneInnerAngle&&(an.coneInnerAngle=ht),dt!==an.coneOuterAngle&&(an.coneOuterAngle=dt),pt!==an.coneOuterGain&&(an.coneOuterGain=pt),mt!==an.distanceModel&&(an.distanceModel=mt),gt!==an.maxDistance&&(an.maxDistance=gt),yt!==an.orientationX.value&&(an.orientationX.value=yt),bt!==an.orientationY.value&&(an.orientationY.value=bt),wt!==an.orientationZ.value&&(an.orientationZ.value=wt),xt!==an.panningModel&&(an.panningModel=xt),kt!==an.positionX.value&&(an.positionX.value=kt),St!==an.positionY.value&&(an.positionY.value=St),Tt!==an.positionZ.value&&(an.positionZ.value=Tt),At!==an.refDistance&&(an.refDistance=At),Et!==an.rolloffFactor&&(an.rolloffFactor=Et),(Pt[0]!==1||Pt[1]!==0||Pt[2]!==0)&&Lt.setOrientation(...Pt),(Ht[0]!==0||Ht[1]!==0||Ht[2]!==0)&&Lt.setPosition(...Ht);const Yt=()=>{$t.connect(Lt),tt($t,Ut,0,0),Ut.connect(vt).connect(Rt,0,0),Ut.connect(It).connect(Rt,0,1),Ut.connect(Ot).connect(Rt,0,2),Ut.connect(Wt).connect(Rt,0,3),Ut.connect(zt).connect(Rt,0,4),Ut.connect(Ft).connect(Rt,0,5),Rt.connect(Nt).connect(ut.destination)},nn=()=>{$t.disconnect(Lt),st($t,Ut,0,0),Ut.disconnect(vt),vt.disconnect(Rt),Ut.disconnect(It),It.disconnect(Rt),Ut.disconnect(Ot),Ot.disconnect(Rt),Ut.disconnect(Wt),Wt.disconnect(Rt),Ut.disconnect(zt),zt.disconnect(Rt),Ut.disconnect(Ft),Ft.disconnect(Rt),Rt.disconnect(Nt),Nt.disconnect(ut.destination)};return ct(interceptConnections(an,Lt),Yt,nn)},createNativePeriodicWaveFactory=tt=>(et,{disableNormalization:nt,imag:rt,real:it})=>{const ot=rt instanceof Float32Array?rt:new Float32Array(rt),at=it instanceof Float32Array?it:new Float32Array(it),st=et.createPeriodicWave(at,ot,{disableNormalization:nt});if(Array.from(rt).length<2)throw tt();return st},createNativeScriptProcessorNode=(tt,et,nt,rt)=>tt.createScriptProcessor(et,nt,rt),createNativeStereoPannerNodeFactory=(tt,et)=>(nt,rt)=>{const it=rt.channelCountMode;if(it==="clamped-max")throw et();if(nt.createStereoPanner===void 0)return tt(nt,rt);const ot=nt.createStereoPanner();return assignNativeAudioNodeOptions(ot,rt),assignNativeAudioNodeAudioParamValue(ot,rt,"pan"),Object.defineProperty(ot,"channelCountMode",{get:()=>it,set:at=>{if(at!==it)throw et()}}),ot},createNativeStereoPannerNodeFakerFactory=(tt,et,nt,rt,it,ot)=>{const st=new Float32Array([1,1]),lt=Math.PI/2,ct={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},ut={...ct,oversample:"none"},ht=(mt,gt,yt,bt)=>{const wt=new Float32Array(16385),xt=new Float32Array(16385);for(let Ct=0;Ct<16385;Ct+=1){const Lt=Ct/16384*lt;wt[Ct]=Math.cos(Lt),xt[Ct]=Math.sin(Lt)}const kt=nt(mt,{...ct,gain:0}),St=rt(mt,{...ut,curve:wt}),Tt=rt(mt,{...ut,curve:st}),At=nt(mt,{...ct,gain:0}),Et=rt(mt,{...ut,curve:xt});return{connectGraph(){gt.connect(kt),gt.connect(Tt.inputs===void 0?Tt:Tt.inputs[0]),gt.connect(At),Tt.connect(yt),yt.connect(St.inputs===void 0?St:St.inputs[0]),yt.connect(Et.inputs===void 0?Et:Et.inputs[0]),St.connect(kt.gain),Et.connect(At.gain),kt.connect(bt,0,0),At.connect(bt,0,1)},disconnectGraph(){gt.disconnect(kt),gt.disconnect(Tt.inputs===void 0?Tt:Tt.inputs[0]),gt.disconnect(At),Tt.disconnect(yt),yt.disconnect(St.inputs===void 0?St:St.inputs[0]),yt.disconnect(Et.inputs===void 0?Et:Et.inputs[0]),St.disconnect(kt.gain),Et.disconnect(At.gain),kt.disconnect(bt,0,0),At.disconnect(bt,0,1)}}},dt=(mt,gt,yt,bt)=>{const wt=new Float32Array(16385),xt=new Float32Array(16385),kt=new Float32Array(16385),St=new Float32Array(16385),Tt=Math.floor(16385/2);for(let Wt=0;Wt<16385;Wt+=1)if(Wt>Tt){const zt=(Wt-Tt)/(16384-Tt)*lt;wt[Wt]=Math.cos(zt),xt[Wt]=Math.sin(zt),kt[Wt]=0,St[Wt]=1}else{const zt=Wt/(16384-Tt)*lt;wt[Wt]=1,xt[Wt]=0,kt[Wt]=Math.cos(zt),St[Wt]=Math.sin(zt)}const At=et(mt,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),Et=nt(mt,{...ct,gain:0}),Ct=rt(mt,{...ut,curve:wt}),Lt=nt(mt,{...ct,gain:0}),jt=rt(mt,{...ut,curve:xt}),Rt=rt(mt,{...ut,curve:st}),$t=nt(mt,{...ct,gain:0}),vt=rt(mt,{...ut,curve:kt}),It=nt(mt,{...ct,gain:0}),Ot=rt(mt,{...ut,curve:St});return{connectGraph(){gt.connect(At),gt.connect(Rt.inputs===void 0?Rt:Rt.inputs[0]),At.connect(Et,0),At.connect(Lt,0),At.connect($t,1),At.connect(It,1),Rt.connect(yt),yt.connect(Ct.inputs===void 0?Ct:Ct.inputs[0]),yt.connect(jt.inputs===void 0?jt:jt.inputs[0]),yt.connect(vt.inputs===void 0?vt:vt.inputs[0]),yt.connect(Ot.inputs===void 0?Ot:Ot.inputs[0]),Ct.connect(Et.gain),jt.connect(Lt.gain),vt.connect($t.gain),Ot.connect(It.gain),Et.connect(bt,0,0),$t.connect(bt,0,0),Lt.connect(bt,0,1),It.connect(bt,0,1)},disconnectGraph(){gt.disconnect(At),gt.disconnect(Rt.inputs===void 0?Rt:Rt.inputs[0]),At.disconnect(Et,0),At.disconnect(Lt,0),At.disconnect($t,1),At.disconnect(It,1),Rt.disconnect(yt),yt.disconnect(Ct.inputs===void 0?Ct:Ct.inputs[0]),yt.disconnect(jt.inputs===void 0?jt:jt.inputs[0]),yt.disconnect(vt.inputs===void 0?vt:vt.inputs[0]),yt.disconnect(Ot.inputs===void 0?Ot:Ot.inputs[0]),Ct.disconnect(Et.gain),jt.disconnect(Lt.gain),vt.disconnect($t.gain),Ot.disconnect(It.gain),Et.disconnect(bt,0,0),$t.disconnect(bt,0,0),Lt.disconnect(bt,0,1),It.disconnect(bt,0,1)}}},pt=(mt,gt,yt,bt,wt)=>{if(gt===1)return ht(mt,yt,bt,wt);if(gt===2)return dt(mt,yt,bt,wt);throw it()};return(mt,{channelCount:gt,channelCountMode:yt,pan:bt,...wt})=>{if(yt==="max")throw it();const xt=tt(mt,{...wt,channelCount:1,channelCountMode:yt,numberOfInputs:2}),kt=nt(mt,{...wt,channelCount:gt,channelCountMode:yt,gain:1}),St=nt(mt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:bt});let{connectGraph:Tt,disconnectGraph:At}=pt(mt,gt,kt,St,xt);Object.defineProperty(St.gain,"defaultValue",{get:()=>0}),Object.defineProperty(St.gain,"maxValue",{get:()=>1}),Object.defineProperty(St.gain,"minValue",{get:()=>-1});const Et={get bufferSize(){},get channelCount(){return kt.channelCount},set channelCount(Rt){kt.channelCount!==Rt&&(Ct&&At(),{connectGraph:Tt,disconnectGraph:At}=pt(mt,Rt,kt,St,xt),Ct&&Tt()),kt.channelCount=Rt},get channelCountMode(){return kt.channelCountMode},set channelCountMode(Rt){if(Rt==="clamped-max"||Rt==="max")throw it();kt.channelCountMode=Rt},get channelInterpretation(){return kt.channelInterpretation},set channelInterpretation(Rt){kt.channelInterpretation=Rt},get context(){return kt.context},get inputs(){return[kt]},get numberOfInputs(){return kt.numberOfInputs},get numberOfOutputs(){return kt.numberOfOutputs},get pan(){return St.gain},addEventListener(...Rt){return kt.addEventListener(Rt[0],Rt[1],Rt[2])},dispatchEvent(...Rt){return kt.dispatchEvent(Rt[0])},removeEventListener(...Rt){return kt.removeEventListener(Rt[0],Rt[1],Rt[2])}};let Ct=!1;const Lt=()=>{Tt(),Ct=!0},jt=()=>{At(),Ct=!1};return ot(interceptConnections(Et,xt),Lt,jt)}},createNativeWaveShaperNodeFactory=(tt,et,nt,rt,it,ot,at)=>(st,lt)=>{const ct=st.createWaveShaper();if(ot!==null&&ot.name==="webkitAudioContext"&&st.createGain().gain.automationRate===void 0)return nt(st,lt);assignNativeAudioNodeOptions(ct,lt);const ut=lt.curve===null||lt.curve instanceof Float32Array?lt.curve:new Float32Array(lt.curve);if(ut!==null&&ut.length<2)throw et();assignNativeAudioNodeOption(ct,{curve:ut},"curve"),assignNativeAudioNodeOption(ct,lt,"oversample");let ht=null,dt=!1;return at(ct,"curve",gt=>()=>gt.call(ct),gt=>yt=>(gt.call(ct,yt),dt&&(rt(yt)&&ht===null?ht=tt(st,ct):!rt(yt)&&ht!==null&&(ht(),ht=null)),yt)),it(ct,()=>{dt=!0,rt(ct.curve)&&(ht=tt(st,ct))},()=>{dt=!1,ht!==null&&(ht(),ht=null)})},createNativeWaveShaperNodeFakerFactory=(tt,et,nt,rt,it)=>(ot,{curve:at,oversample:st,...lt})=>{const ct=ot.createWaveShaper(),ut=ot.createWaveShaper();assignNativeAudioNodeOptions(ct,lt),assignNativeAudioNodeOptions(ut,lt);const ht=nt(ot,{...lt,gain:1}),dt=nt(ot,{...lt,gain:-1}),pt=nt(ot,{...lt,gain:1}),mt=nt(ot,{...lt,gain:-1});let gt=null,yt=!1,bt=null;const wt={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(St){ht.channelCount=St,dt.channelCount=St,ct.channelCount=St,pt.channelCount=St,ut.channelCount=St,mt.channelCount=St},get channelCountMode(){return ct.channelCountMode},set channelCountMode(St){ht.channelCountMode=St,dt.channelCountMode=St,ct.channelCountMode=St,pt.channelCountMode=St,ut.channelCountMode=St,mt.channelCountMode=St},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(St){ht.channelInterpretation=St,dt.channelInterpretation=St,ct.channelInterpretation=St,pt.channelInterpretation=St,ut.channelInterpretation=St,mt.channelInterpretation=St},get context(){return ct.context},get curve(){return bt},set curve(St){if(St!==null&&St.length<2)throw et();if(St===null)ct.curve=St,ut.curve=St;else{const Tt=St.length,At=new Float32Array(Tt+2-Tt%2),Et=new Float32Array(Tt+2-Tt%2);At[0]=St[0],Et[0]=-St[Tt-1];const Ct=Math.ceil((Tt+1)/2),Lt=(Tt+1)/2-1;for(let jt=1;jt{ht.connect(ct).connect(pt),ht.connect(dt).connect(ut).connect(mt).connect(pt),yt=!0,rt(bt)&&(gt=tt(ot,ht))},kt=()=>{ht.disconnect(ct),ct.disconnect(pt),ht.disconnect(dt),dt.disconnect(ut),ut.disconnect(mt),mt.disconnect(pt),yt=!1,gt!==null&&(gt(),gt=null)};return it(interceptConnections(wt,pt),xt,kt)},createNotSupportedError=()=>new DOMException("","NotSupportedError"),DEFAULT_OPTIONS$6={numberOfChannels:1},createOfflineAudioContextConstructor=(tt,et,nt,rt,it)=>class extends tt{constructor(at,st,lt){let ct;if(typeof at=="number"&&st!==void 0&<!==void 0)ct={length:st,numberOfChannels:at,sampleRate:lt};else if(typeof at=="object")ct=at;else throw new Error("The given parameters are not valid.");const{length:ut,numberOfChannels:ht,sampleRate:dt}={...DEFAULT_OPTIONS$6,...ct},pt=rt(ht,ut,dt);et(testPromiseSupport,()=>testPromiseSupport(pt))||pt.addEventListener("statechange",(()=>{let mt=0;const gt=yt=>{this._state==="running"&&(mt>0?(pt.removeEventListener("statechange",gt),yt.stopImmediatePropagation(),this._waitForThePromiseToSettle(yt)):mt+=1)};return gt})()),super(pt,ht),this._length=ut,this._nativeOfflineAudioContext=pt,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(nt()):(this._state="running",it(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,deactivateAudioGraph(this)}))}_waitForThePromiseToSettle(at){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(at):setTimeout(()=>this._waitForThePromiseToSettle(at))}},DEFAULT_OPTIONS$5={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},createOscillatorNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$5,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?rt():null,gt=lt.sampleRate/2;super(lt,!1,dt,mt),this._detune=et(this,pt,dt.detune,153600,-153600),this._frequency=et(this,pt,dt.frequency,gt,-gt),this._nativeOscillatorNode=dt,this._onended=null,this._oscillatorNodeRenderer=mt,this._oscillatorNodeRenderer!==null&&ht.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=ht.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeOscillatorNode.onended=ct;const ut=this._nativeOscillatorNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}get type(){return this._nativeOscillatorNode.type}set type(lt){this._nativeOscillatorNode.type=lt,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(lt){this._nativeOscillatorNode.setPeriodicWave(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=lt)}start(lt=0){if(this._nativeOscillatorNode.start(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeOscillatorNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeOscillatorNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeOscillatorNode.stop(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=lt)}},createOscillatorNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap;let at=null,st=null,lt=null;const ct=async(ut,ht)=>{let dt=nt(ut);const pt=isOwnedByContext(dt,ht);if(!pt){const mt={channelCount:dt.channelCount,channelCountMode:dt.channelCountMode,channelInterpretation:dt.channelInterpretation,detune:dt.detune.value,frequency:dt.frequency.value,periodicWave:at===null?void 0:at,type:dt.type};dt=et(ht,mt),st!==null&&dt.start(st),lt!==null&&dt.stop(lt)}return ot.set(ht,dt),pt?(await tt(ht,ut.detune,dt.detune),await tt(ht,ut.frequency,dt.frequency)):(await rt(ht,ut.detune,dt.detune),await rt(ht,ut.frequency,dt.frequency)),await it(ut,ht,dt),dt};return{set periodicWave(ut){at=ut},set start(ut){st=ut},set stop(ut){lt=ut},render(ut,ht){const dt=ot.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},DEFAULT_OPTIONS$4={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},createPannerNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$4,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?rt():null;super(lt,!1,dt,mt),this._nativePannerNode=dt,this._orientationX=et(this,pt,dt.orientationX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationY=et(this,pt,dt.orientationY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationZ=et(this,pt,dt.orientationZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionX=et(this,pt,dt.positionX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionY=et(this,pt,dt.positionY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionZ=et(this,pt,dt.positionZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),at(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(lt){this._nativePannerNode.coneInnerAngle=lt}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(lt){this._nativePannerNode.coneOuterAngle=lt}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(lt){this._nativePannerNode.coneOuterGain=lt}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(lt){this._nativePannerNode.distanceModel=lt}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(lt){this._nativePannerNode.maxDistance=lt}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(lt){this._nativePannerNode.panningModel=lt}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(lt){this._nativePannerNode.refDistance=lt}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(lt){this._nativePannerNode.rolloffFactor=lt}},createPannerNodeRendererFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct)=>()=>{const ut=new WeakMap;let ht=null;const dt=async(pt,mt)=>{let gt=null,yt=ot(pt);const bt={channelCount:yt.channelCount,channelCountMode:yt.channelCountMode,channelInterpretation:yt.channelInterpretation},wt={...bt,coneInnerAngle:yt.coneInnerAngle,coneOuterAngle:yt.coneOuterAngle,coneOuterGain:yt.coneOuterGain,distanceModel:yt.distanceModel,maxDistance:yt.maxDistance,panningModel:yt.panningModel,refDistance:yt.refDistance,rolloffFactor:yt.rolloffFactor},xt=isOwnedByContext(yt,mt);if("bufferSize"in yt)gt=rt(mt,{...bt,gain:1});else if(!xt){const kt={...wt,orientationX:yt.orientationX.value,orientationY:yt.orientationY.value,orientationZ:yt.orientationZ.value,positionX:yt.positionX.value,positionY:yt.positionY.value,positionZ:yt.positionZ.value};yt=it(mt,kt)}if(ut.set(mt,gt===null?yt:gt),gt!==null){if(ht===null){if(at===null)throw new Error("Missing the native OfflineAudioContext constructor.");const jt=new at(6,pt.context.length,mt.sampleRate),Rt=et(jt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});Rt.connect(jt.destination),ht=(async()=>{const $t=await Promise.all([pt.orientationX,pt.orientationY,pt.orientationZ,pt.positionX,pt.positionY,pt.positionZ].map(async(vt,It)=>{const Ot=nt(jt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:It===0?1:0});return await st(jt,vt,Ot.offset),Ot}));for(let vt=0;vt<6;vt+=1)$t[vt].connect(Rt,0,vt),$t[vt].start(0);return ct(jt)})()}const kt=await ht,St=rt(mt,{...bt,gain:1});await lt(pt,mt,St);const Tt=[];for(let jt=0;jtvt!==At[It])||$t.some((vt,It)=>vt!==Et[It])){At=Rt,Et=$t;const vt=jt/mt.sampleRate;Ct.gain.setValueAtTime(0,vt),Ct=rt(mt,{...bt,gain:0}),Lt=it(mt,{...wt,orientationX:At[0],orientationY:At[1],orientationZ:At[2],positionX:Et[0],positionY:Et[1],positionZ:Et[2]}),Ct.gain.setValueAtTime(1,vt),St.connect(Ct).connect(Lt.inputs[0]),Lt.connect(gt)}}return gt}return xt?(await tt(mt,pt.orientationX,yt.orientationX),await tt(mt,pt.orientationY,yt.orientationY),await tt(mt,pt.orientationZ,yt.orientationZ),await tt(mt,pt.positionX,yt.positionX),await tt(mt,pt.positionY,yt.positionY),await tt(mt,pt.positionZ,yt.positionZ)):(await st(mt,pt.orientationX,yt.orientationX),await st(mt,pt.orientationY,yt.orientationY),await st(mt,pt.orientationZ,yt.orientationZ),await st(mt,pt.positionX,yt.positionX),await st(mt,pt.positionY,yt.positionY),await st(mt,pt.positionZ,yt.positionZ)),isNativeAudioNodeFaker(yt)?await lt(pt,mt,yt.inputs[0]):await lt(pt,mt,yt),yt};return{render(pt,mt){const gt=ut.get(mt);return gt!==void 0?Promise.resolve(gt):dt(pt,mt)}}},DEFAULT_OPTIONS$3={disableNormalization:!1},createPeriodicWaveConstructor=(tt,et,nt,rt)=>class ww{constructor(ot,at){const st=et(ot),lt=rt({...DEFAULT_OPTIONS$3,...at}),ct=tt(st,lt);return nt.add(ct),ct}static[Symbol.hasInstance](ot){return ot!==null&&typeof ot=="object"&&Object.getPrototypeOf(ot)===ww.prototype||nt.has(ot)}},createRenderAutomation=(tt,et)=>(nt,rt,it)=>(tt(rt).replay(it),et(rt,nt,it)),createRenderInputsOfAudioNode=(tt,et,nt)=>async(rt,it,ot)=>{const at=tt(rt);await Promise.all(at.activeInputs.map((st,lt)=>Array.from(st).map(async([ct,ut])=>{const dt=await et(ct).render(ct,it),pt=rt.context.destination;!nt(ct)&&(rt!==pt||!nt(rt))&&dt.connect(ot,ut,lt)})).reduce((st,lt)=>[...st,...lt],[]))},createRenderInputsOfAudioParam=(tt,et,nt)=>async(rt,it,ot)=>{const at=et(rt);await Promise.all(Array.from(at.activeInputs).map(async([st,lt])=>{const ut=await tt(st).render(st,it);nt(st)||ut.connect(ot,lt)}))},createRenderNativeOfflineAudioContext=(tt,et,nt,rt)=>it=>tt(testPromiseSupport,()=>testPromiseSupport(it))?Promise.resolve(tt(rt,rt)).then(ot=>{if(!ot){const at=nt(it,512,0,1);it.oncomplete=()=>{at.onaudioprocess=null,at.disconnect()},at.onaudioprocess=()=>it.currentTime,at.connect(it.destination)}return it.startRendering()}):new Promise(ot=>{const at=et(it,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});it.oncomplete=st=>{at.disconnect(),ot(st.renderedBuffer)},at.connect(it.destination),it.startRendering()}),createSetActiveAudioWorkletNodeInputs=tt=>(et,nt)=>{tt.set(et,nt)},createSetAudioNodeTailTime=tt=>(et,nt)=>tt.set(et,nt),createStartRendering=(tt,et,nt,rt,it,ot,at,st)=>(lt,ct)=>nt(lt).render(lt,ct).then(()=>Promise.all(Array.from(rt(ct)).map(ut=>nt(ut).render(ut,ct)))).then(()=>it(ct)).then(ut=>(typeof ut.copyFromChannel!="function"?(at(ut),wrapAudioBufferGetChannelDataMethod(ut)):et(ot,()=>ot(ut))||st(ut),tt.add(ut),ut)),DEFAULT_OPTIONS$2={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},createStereoPannerNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$2,...lt},ht=nt(ct,ut),dt=ot(ct),pt=dt?rt():null;super(st,!1,ht,pt),this._pan=et(this,dt,ht.pan)}get pan(){return this._pan}},createStereoPannerNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,pan:ct.pan.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.pan,ct.pan):await rt(lt,st.pan,ct.pan),isNativeAudioNodeFaker(ct)?await it(st,lt,ct.inputs[0]):await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createTestAudioBufferConstructorSupport=tt=>()=>{if(tt===null)return!1;try{new tt({length:1,sampleRate:44100})}catch{return!1}return!0},createTestAudioWorkletProcessorPostMessageSupport=(tt,et)=>async()=>{if(tt===null)return!0;if(et===null)return!1;const nt=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),rt=new et(1,128,44100),it=URL.createObjectURL(nt);let ot=!1,at=!1;try{await rt.audioWorklet.addModule(it);const st=new tt(rt,"a",{numberOfOutputs:0}),lt=rt.createOscillator();st.port.onmessage=()=>ot=!0,st.onprocessorerror=()=>at=!0,lt.connect(st),lt.start(0),await rt.startRendering(),await new Promise(ct=>setTimeout(ct))}catch{}finally{URL.revokeObjectURL(it)}return ot&&!at},createTestOfflineAudioContextCurrentTimeSupport=(tt,et)=>()=>{if(et===null)return Promise.resolve(!1);const nt=new et(1,1,44100),rt=tt(nt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(it=>{nt.oncomplete=()=>{rt.disconnect(),it(nt.currentTime!==0)},nt.startRendering()})},createUnknownError=()=>new DOMException("","UnknownError"),DEFAULT_OPTIONS$1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},createWaveShaperNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$1,...ct},dt=nt(ut,ht),mt=ot(ut)?rt():null;super(lt,!0,dt,mt),this._isCurveNullified=!1,this._nativeWaveShaperNode=dt,at(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(lt){if(lt===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(lt.length<2)throw et();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=lt}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(lt){this._nativeWaveShaperNode.oversample=lt}},createWaveShaperNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,curve:st.curve,oversample:st.oversample};st=tt(at,ct)}return rt.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},createWindow=()=>typeof window>"u"?null:window,createWrapAudioBufferCopyChannelMethods=(tt,et)=>nt=>{nt.copyFromChannel=(rt,it,ot=0)=>{const at=tt(ot),st=tt(it);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=rt.length;for(let ht=at<0?-at:0;ht+at{const at=tt(ot),st=tt(it);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=rt.length;for(let ht=at<0?-at:0;ht+atet=>{et.copyFromChannel=(nt=>(rt,it,ot=0)=>{const at=tt(ot),st=tt(it);if(at(rt,it,ot=0)=>{const at=tt(ot),st=tt(it);if(at(et,nt)=>{const rt=nt.createBuffer(1,1,44100);et.buffer===null&&(et.buffer=rt),tt(et,"buffer",it=>()=>{const ot=it.call(et);return ot===rt?null:ot},it=>ot=>it.call(et,ot===null?rt:ot))},createWrapChannelMergerNode=(tt,et)=>(nt,rt)=>{rt.channelCount=1,rt.channelCountMode="explicit",Object.defineProperty(rt,"channelCount",{get:()=>1,set:()=>{throw tt()}}),Object.defineProperty(rt,"channelCountMode",{get:()=>"explicit",set:()=>{throw tt()}});const it=nt.createBufferSource();et(rt,()=>{const st=rt.numberOfInputs;for(let lt=0;ltit.disconnect(rt))},getFirstSample=(tt,et,nt)=>tt.copyFromChannel===void 0?tt.getChannelData(nt)[0]:(tt.copyFromChannel(et,nt),et[0]),isDCCurve=tt=>{if(tt===null)return!1;const et=tt.length;return et%2!==0?tt[Math.floor(et/2)]!==0:tt[et/2-1]+tt[et/2]!==0},overwriteAccessors=(tt,et,nt,rt)=>{let it=tt;for(;!it.hasOwnProperty(et);)it=Object.getPrototypeOf(it);const{get:ot,set:at}=Object.getOwnPropertyDescriptor(it,et);Object.defineProperty(tt,et,{get:nt(ot),set:rt(at)})},sanitizeAudioWorkletNodeOptions=tt=>({...tt,outputChannelCount:tt.outputChannelCount!==void 0?tt.outputChannelCount:tt.numberOfInputs===1&&tt.numberOfOutputs===1?[tt.channelCount]:Array.from({length:tt.numberOfOutputs},()=>1)}),sanitizeChannelSplitterOptions=tt=>({...tt,channelCount:tt.numberOfOutputs}),sanitizePeriodicWaveOptions=tt=>{const{imag:et,real:nt}=tt;return et===void 0?nt===void 0?{...tt,imag:[0,0],real:[0,0]}:{...tt,imag:Array.from(nt,()=>0),real:nt}:nt===void 0?{...tt,imag:et,real:Array.from(et,()=>0)}:{...tt,imag:et,real:nt}},setValueAtTimeUntilPossible=(tt,et,nt)=>{try{tt.setValueAtTime(et,nt)}catch(rt){if(rt.code!==9)throw rt;setValueAtTimeUntilPossible(tt,et,nt+1e-7)}},testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.start()}catch{return!0}return!1},testAudioBufferSourceNodeStartMethodOffsetClampingSupport=tt=>{const et=tt.createBufferSource(),nt=tt.createBuffer(1,1,44100);et.buffer=nt;try{et.start(0,1)}catch{return!1}return!0},testAudioBufferSourceNodeStopMethodNullifiedBufferSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.stop()}catch{return!1}return!0},testAudioScheduledSourceNodeStartMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.start(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport=tt=>{const et=tt.createBuffer(1,1,44100),nt=tt.createBufferSource();nt.buffer=et,nt.start(),nt.stop();try{return nt.stop(),!0}catch{return!1}},testAudioScheduledSourceNodeStopMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.stop(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioWorkletNodeOptionsClonability=tt=>{const{port1:et,port2:nt}=new MessageChannel;try{et.postMessage(tt)}finally{et.close(),nt.close()}},wrapAudioBufferSourceNodeStartMethodOffsetClamping=tt=>{tt.start=(et=>(nt=0,rt=0,it)=>{const ot=tt.buffer,at=ot===null?rt:Math.min(ot.duration,rt);ot!==null&&at>ot.duration-.5/tt.context.sampleRate?et.call(tt,nt,0,0):et.call(tt,nt,at,it)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls=(tt,et)=>{const nt=et.createGain();tt.connect(nt);const rt=(it=>()=>{it.call(tt,nt),tt.removeEventListener("ended",rt)})(tt.disconnect);tt.addEventListener("ended",rt),interceptConnections(tt,nt),tt.stop=(it=>{let ot=!1;return(at=0)=>{if(ot)try{it.call(tt,at)}catch{nt.gain.setValueAtTime(0,at)}else it.call(tt,at),ot=!0}})(tt.stop)},wrapEventListener=(tt,et)=>nt=>{const rt={value:tt};return Object.defineProperties(nt,{currentTarget:rt,target:rt}),typeof et=="function"?et.call(tt,nt):et.handleEvent.call(tt,nt)},addActiveInputConnectionToAudioNode=createAddActiveInputConnectionToAudioNode(insertElementInSet),addPassiveInputConnectionToAudioNode=createAddPassiveInputConnectionToAudioNode(insertElementInSet),deleteActiveInputConnectionToAudioNode=createDeleteActiveInputConnectionToAudioNode(pickElementFromSet),audioNodeTailTimeStore=new WeakMap,getAudioNodeTailTime=createGetAudioNodeTailTime(audioNodeTailTimeStore),cacheTestResult=createCacheTestResult(new Map,new WeakMap),window$1=createWindow(),createNativeAnalyserNode=createNativeAnalyserNodeFactory(cacheTestResult,createIndexSizeError),getAudioNodeRenderer=createGetAudioNodeRenderer(getAudioNodeConnections),renderInputsOfAudioNode=createRenderInputsOfAudioNode(getAudioNodeConnections,getAudioNodeRenderer,isPartOfACycle),createAnalyserNodeRenderer=createAnalyserNodeRendererFactory(createNativeAnalyserNode,getNativeAudioNode,renderInputsOfAudioNode),getNativeContext=createGetNativeContext(CONTEXT_STORE),nativeOfflineAudioContextConstructor=createNativeOfflineAudioContextConstructor(window$1),isNativeOfflineAudioContext=createIsNativeOfflineAudioContext(nativeOfflineAudioContextConstructor),audioParamAudioNodeStore=new WeakMap,eventTargetConstructor=createEventTargetConstructor(wrapEventListener),nativeAudioContextConstructor=createNativeAudioContextConstructor(window$1),isNativeAudioContext=createIsNativeAudioContext(nativeAudioContextConstructor),isNativeAudioNode=createIsNativeAudioNode(window$1),isNativeAudioParam=createIsNativeAudioParam(window$1),nativeAudioWorkletNodeConstructor=createNativeAudioWorkletNodeConstructor(window$1),audioNodeConstructor=createAudioNodeConstructor(createAddAudioNodeConnections(AUDIO_NODE_CONNECTIONS_STORE),createAddConnectionToAudioNode(addActiveInputConnectionToAudioNode,addPassiveInputConnectionToAudioNode,connectNativeAudioNodeToNativeAudioNode,deleteActiveInputConnectionToAudioNode,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getAudioNodeTailTime,getEventListenersOfAudioNode,getNativeAudioNode,insertElementInSet,isActiveAudioNode,isPartOfACycle,isPassiveAudioNode),cacheTestResult,createIncrementCycleCounterFactory(CYCLE_COUNTERS,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,isActiveAudioNode),createIndexSizeError,createInvalidAccessError,createNotSupportedError,createDecrementCycleCounter(connectNativeAudioNodeToNativeAudioNode,CYCLE_COUNTERS,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,getNativeContext,isActiveAudioNode,isNativeOfflineAudioContext),createDetectCycles(audioParamAudioNodeStore,getAudioNodeConnections,getValueForKey),eventTargetConstructor,getNativeContext,isNativeAudioContext,isNativeAudioNode,isNativeAudioParam,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor),analyserNodeConstructor=createAnalyserNodeConstructor(audioNodeConstructor,createAnalyserNodeRenderer,createIndexSizeError,createNativeAnalyserNode,getNativeContext,isNativeOfflineAudioContext),audioBufferStore=new WeakSet,nativeAudioBufferConstructor=createNativeAudioBufferConstructor(window$1),convertNumberToUnsignedLong=createConvertNumberToUnsignedLong(new Uint32Array(1)),wrapAudioBufferCopyChannelMethods=createWrapAudioBufferCopyChannelMethods(convertNumberToUnsignedLong,createIndexSizeError),wrapAudioBufferCopyChannelMethodsOutOfBounds=createWrapAudioBufferCopyChannelMethodsOutOfBounds(convertNumberToUnsignedLong),audioBufferConstructor=createAudioBufferConstructor(audioBufferStore,cacheTestResult,createNotSupportedError,nativeAudioBufferConstructor,nativeOfflineAudioContextConstructor,createTestAudioBufferConstructorSupport(nativeAudioBufferConstructor),wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),addSilentConnection=createAddSilentConnection(createNativeGainNode),renderInputsOfAudioParam=createRenderInputsOfAudioParam(getAudioNodeRenderer,getAudioParamConnections,isPartOfACycle),connectAudioParam=createConnectAudioParam(renderInputsOfAudioParam),createNativeAudioBufferSourceNode=createNativeAudioBufferSourceNodeFactory(addSilentConnection,cacheTestResult,testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport,testAudioBufferSourceNodeStartMethodOffsetClampingSupport,testAudioBufferSourceNodeStopMethodNullifiedBufferSupport,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioBufferSourceNodeStartMethodOffsetClamping,createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer(overwriteAccessors),wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),renderAutomation=createRenderAutomation(createGetAudioParamRenderer(getAudioParamConnections),renderInputsOfAudioParam),createAudioBufferSourceNodeRenderer=createAudioBufferSourceNodeRendererFactory(connectAudioParam,createNativeAudioBufferSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),createAudioParam=createAudioParamFactory(createAddAudioParamConnections(AUDIO_PARAM_CONNECTIONS_STORE),audioParamAudioNodeStore,AUDIO_PARAM_STORE,createAudioParamRenderer,createCancelAndHoldAutomationEvent,createCancelScheduledValuesAutomationEvent,createExponentialRampToValueAutomationEvent,createLinearRampToValueAutomationEvent,createSetTargetAutomationEvent,createSetValueAutomationEvent,createSetValueCurveAutomationEvent,nativeAudioContextConstructor,setValueAtTimeUntilPossible),audioBufferSourceNodeConstructor=createAudioBufferSourceNodeConstructor(audioNodeConstructor,createAudioBufferSourceNodeRenderer,createAudioParam,createInvalidStateError,createNativeAudioBufferSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),audioDestinationNodeConstructor=createAudioDestinationNodeConstructor(audioNodeConstructor,createAudioDestinationNodeRenderer,createIndexSizeError,createInvalidStateError,createNativeAudioDestinationNodeFactory(createNativeGainNode,overwriteAccessors),getNativeContext,isNativeOfflineAudioContext,renderInputsOfAudioNode),createBiquadFilterNodeRenderer=createBiquadFilterNodeRendererFactory(connectAudioParam,createNativeBiquadFilterNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),setAudioNodeTailTime=createSetAudioNodeTailTime(audioNodeTailTimeStore),biquadFilterNodeConstructor=createBiquadFilterNodeConstructor(audioNodeConstructor,createAudioParam,createBiquadFilterNodeRenderer,createInvalidAccessError,createNativeBiquadFilterNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),monitorConnections=createMonitorConnections(insertElementInSet,isNativeAudioNode),wrapChannelMergerNode=createWrapChannelMergerNode(createInvalidStateError,monitorConnections),createNativeChannelMergerNode=createNativeChannelMergerNodeFactory(nativeAudioContextConstructor,wrapChannelMergerNode),createChannelMergerNodeRenderer=createChannelMergerNodeRendererFactory(createNativeChannelMergerNode,getNativeAudioNode,renderInputsOfAudioNode),channelMergerNodeConstructor=createChannelMergerNodeConstructor(audioNodeConstructor,createChannelMergerNodeRenderer,createNativeChannelMergerNode,getNativeContext,isNativeOfflineAudioContext),createChannelSplitterNodeRenderer=createChannelSplitterNodeRendererFactory(createNativeChannelSplitterNode,getNativeAudioNode,renderInputsOfAudioNode),channelSplitterNodeConstructor=createChannelSplitterNodeConstructor(audioNodeConstructor,createChannelSplitterNodeRenderer,createNativeChannelSplitterNode,getNativeContext,isNativeOfflineAudioContext,sanitizeChannelSplitterOptions),createNativeConstantSourceNodeFaker=createNativeConstantSourceNodeFakerFactory(addSilentConnection,createNativeAudioBufferSourceNode,createNativeGainNode,monitorConnections),createNativeConstantSourceNode=createNativeConstantSourceNodeFactory(addSilentConnection,cacheTestResult,createNativeConstantSourceNodeFaker,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport),createConstantSourceNodeRenderer=createConstantSourceNodeRendererFactory(connectAudioParam,createNativeConstantSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),constantSourceNodeConstructor=createConstantSourceNodeConstructor(audioNodeConstructor,createAudioParam,createConstantSourceNodeRenderer,createNativeConstantSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createNativeConvolverNode=createNativeConvolverNodeFactory(createNotSupportedError,overwriteAccessors),createConvolverNodeRenderer=createConvolverNodeRendererFactory(createNativeConvolverNode,getNativeAudioNode,renderInputsOfAudioNode),convolverNodeConstructor=createConvolverNodeConstructor(audioNodeConstructor,createConvolverNodeRenderer,createNativeConvolverNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createDelayNodeRenderer=createDelayNodeRendererFactory(connectAudioParam,createNativeDelayNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),delayNodeConstructor=createDelayNodeConstructor(audioNodeConstructor,createAudioParam,createDelayNodeRenderer,createNativeDelayNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativeDynamicsCompressorNode=createNativeDynamicsCompressorNodeFactory(createNotSupportedError),createDynamicsCompressorNodeRenderer=createDynamicsCompressorNodeRendererFactory(connectAudioParam,createNativeDynamicsCompressorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),dynamicsCompressorNodeConstructor=createDynamicsCompressorNodeConstructor(audioNodeConstructor,createAudioParam,createDynamicsCompressorNodeRenderer,createNativeDynamicsCompressorNode,createNotSupportedError,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createGainNodeRenderer=createGainNodeRendererFactory(connectAudioParam,createNativeGainNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),gainNodeConstructor=createGainNodeConstructor(audioNodeConstructor,createAudioParam,createGainNodeRenderer,createNativeGainNode,getNativeContext,isNativeOfflineAudioContext),createNativeIIRFilterNodeFaker=createNativeIIRFilterNodeFakerFactory(createInvalidAccessError,createInvalidStateError,createNativeScriptProcessorNode,createNotSupportedError),renderNativeOfflineAudioContext=createRenderNativeOfflineAudioContext(cacheTestResult,createNativeGainNode,createNativeScriptProcessorNode,createTestOfflineAudioContextCurrentTimeSupport(createNativeGainNode,nativeOfflineAudioContextConstructor)),createIIRFilterNodeRenderer=createIIRFilterNodeRendererFactory(createNativeAudioBufferSourceNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderInputsOfAudioNode,renderNativeOfflineAudioContext),createNativeIIRFilterNode=createNativeIIRFilterNodeFactory(createNativeIIRFilterNodeFaker),iIRFilterNodeConstructor=createIIRFilterNodeConstructor(audioNodeConstructor,createNativeIIRFilterNode,createIIRFilterNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createAudioListener=createAudioListenerFactory(createAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeScriptProcessorNode,createNotSupportedError,getFirstSample,isNativeOfflineAudioContext,overwriteAccessors),unrenderedAudioWorkletNodeStore=new WeakMap,minimalBaseAudioContextConstructor=createMinimalBaseAudioContextConstructor(audioDestinationNodeConstructor,createAudioListener,eventTargetConstructor,isNativeOfflineAudioContext,unrenderedAudioWorkletNodeStore,wrapEventListener),createNativeOscillatorNode=createNativeOscillatorNodeFactory(addSilentConnection,cacheTestResult,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),createOscillatorNodeRenderer=createOscillatorNodeRendererFactory(connectAudioParam,createNativeOscillatorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),oscillatorNodeConstructor=createOscillatorNodeConstructor(audioNodeConstructor,createAudioParam,createNativeOscillatorNode,createOscillatorNodeRenderer,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createConnectedNativeAudioBufferSourceNode=createConnectedNativeAudioBufferSourceNodeFactory(createNativeAudioBufferSourceNode),createNativeWaveShaperNodeFaker=createNativeWaveShaperNodeFakerFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeGainNode,isDCCurve,monitorConnections),createNativeWaveShaperNode=createNativeWaveShaperNodeFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeWaveShaperNodeFaker,isDCCurve,monitorConnections,nativeAudioContextConstructor,overwriteAccessors),createNativePannerNodeFaker=createNativePannerNodeFakerFactory(connectNativeAudioNodeToNativeAudioNode,createInvalidStateError,createNativeChannelMergerNode,createNativeGainNode,createNativeScriptProcessorNode,createNativeWaveShaperNode,createNotSupportedError,disconnectNativeAudioNodeFromNativeAudioNode,getFirstSample,monitorConnections),createNativePannerNode=createNativePannerNodeFactory(createNativePannerNodeFaker),createPannerNodeRenderer=createPannerNodeRendererFactory(connectAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeGainNode,createNativePannerNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),pannerNodeConstructor=createPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativePannerNode,createPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativePeriodicWave=createNativePeriodicWaveFactory(createIndexSizeError),periodicWaveConstructor=createPeriodicWaveConstructor(createNativePeriodicWave,getNativeContext,new WeakSet,sanitizePeriodicWaveOptions),nativeStereoPannerNodeFakerFactory=createNativeStereoPannerNodeFakerFactory(createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeGainNode,createNativeWaveShaperNode,createNotSupportedError,monitorConnections),createNativeStereoPannerNode=createNativeStereoPannerNodeFactory(nativeStereoPannerNodeFakerFactory,createNotSupportedError),createStereoPannerNodeRenderer=createStereoPannerNodeRendererFactory(connectAudioParam,createNativeStereoPannerNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),stereoPannerNodeConstructor=createStereoPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativeStereoPannerNode,createStereoPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext),createWaveShaperNodeRenderer=createWaveShaperNodeRendererFactory(createNativeWaveShaperNode,getNativeAudioNode,renderInputsOfAudioNode),waveShaperNodeConstructor=createWaveShaperNodeConstructor(audioNodeConstructor,createInvalidStateError,createNativeWaveShaperNode,createWaveShaperNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),isSecureContext=createIsSecureContext(window$1),exposeCurrentFrameAndCurrentTime=createExposeCurrentFrameAndCurrentTime(window$1),backupOfflineAudioContextStore=new WeakMap,getOrCreateBackupOfflineAudioContext=createGetOrCreateBackupOfflineAudioContext(backupOfflineAudioContextStore,nativeOfflineAudioContextConstructor),addAudioWorkletModule=isSecureContext?createAddAudioWorkletModule(cacheTestResult,createNotSupportedError,createEvaluateSource(window$1),exposeCurrentFrameAndCurrentTime,createFetchSource(createAbortError),getNativeContext,getOrCreateBackupOfflineAudioContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,new WeakMap,new WeakMap,createTestAudioWorkletProcessorPostMessageSupport(nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor),window$1):void 0,isNativeContext=createIsNativeContext(isNativeAudioContext,isNativeOfflineAudioContext),decodeAudioData=createDecodeAudioData(audioBufferStore,cacheTestResult,createDataCloneError,createEncodingError,new WeakSet,getNativeContext,isNativeContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,testPromiseSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),baseAudioContextConstructor=createBaseAudioContextConstructor(addAudioWorkletModule,analyserNodeConstructor,audioBufferConstructor,audioBufferSourceNodeConstructor,biquadFilterNodeConstructor,channelMergerNodeConstructor,channelSplitterNodeConstructor,constantSourceNodeConstructor,convolverNodeConstructor,decodeAudioData,delayNodeConstructor,dynamicsCompressorNodeConstructor,gainNodeConstructor,iIRFilterNodeConstructor,minimalBaseAudioContextConstructor,oscillatorNodeConstructor,pannerNodeConstructor,periodicWaveConstructor,stereoPannerNodeConstructor,waveShaperNodeConstructor),mediaElementAudioSourceNodeConstructor=createMediaElementAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaElementAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioDestinationNodeConstructor=createMediaStreamAudioDestinationNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioDestinationNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioSourceNodeConstructor=createMediaStreamAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),createNativeMediaStreamTrackAudioSourceNode=createNativeMediaStreamTrackAudioSourceNodeFactory(createInvalidStateError,isNativeOfflineAudioContext),mediaStreamTrackAudioSourceNodeConstructor=createMediaStreamTrackAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamTrackAudioSourceNode,getNativeContext),audioContextConstructor=createAudioContextConstructor(baseAudioContextConstructor,createInvalidStateError,createNotSupportedError,createUnknownError,mediaElementAudioSourceNodeConstructor,mediaStreamAudioDestinationNodeConstructor,mediaStreamAudioSourceNodeConstructor,mediaStreamTrackAudioSourceNodeConstructor,nativeAudioContextConstructor),getUnrenderedAudioWorkletNodes=createGetUnrenderedAudioWorkletNodes(unrenderedAudioWorkletNodeStore),addUnrenderedAudioWorkletNode=createAddUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),connectMultipleOutputs=createConnectMultipleOutputs(createIndexSizeError),deleteUnrenderedAudioWorkletNode=createDeleteUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),disconnectMultipleOutputs=createDisconnectMultipleOutputs(createIndexSizeError),activeAudioWorkletNodeInputsStore=new WeakMap,getActiveAudioWorkletNodeInputs=createGetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore,getValueForKey),createNativeAudioWorkletNodeFaker=createNativeAudioWorkletNodeFakerFactory(connectMultipleOutputs,createIndexSizeError,createInvalidStateError,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,createNativeScriptProcessorNode,createNotSupportedError,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getActiveAudioWorkletNodeInputs,monitorConnections),createNativeAudioWorkletNode=createNativeAudioWorkletNodeFactory(createInvalidStateError,createNativeAudioWorkletNodeFaker,createNativeGainNode,createNotSupportedError,monitorConnections),createAudioWorkletNodeRenderer=createAudioWorkletNodeRendererFactory(connectAudioParam,connectMultipleOutputs,createNativeAudioBufferSourceNode,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,deleteUnrenderedAudioWorkletNode,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getNativeAudioNode,nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),getBackupOfflineAudioContext=createGetBackupOfflineAudioContext(backupOfflineAudioContextStore),setActiveAudioWorkletNodeInputs=createSetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore),audioWorkletNodeConstructor=isSecureContext?createAudioWorkletNodeConstructor(addUnrenderedAudioWorkletNode,audioNodeConstructor,createAudioParam,createAudioWorkletNodeRenderer,createNativeAudioWorkletNode,getAudioNodeConnections,getBackupOfflineAudioContext,getNativeContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,sanitizeAudioWorkletNodeOptions,setActiveAudioWorkletNodeInputs,testAudioWorkletNodeOptionsClonability,wrapEventListener):void 0,createNativeOfflineAudioContext=createCreateNativeOfflineAudioContext(createNotSupportedError,nativeOfflineAudioContextConstructor),startRendering=createStartRendering(audioBufferStore,cacheTestResult,getAudioNodeRenderer,getUnrenderedAudioWorkletNodes,renderNativeOfflineAudioContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),offlineAudioContextConstructor=createOfflineAudioContextConstructor(baseAudioContextConstructor,cacheTestResult,createInvalidStateError,createNativeOfflineAudioContext,startRendering),isAnyAudioContext=createIsAnyAudioContext(CONTEXT_STORE,isNativeAudioContext),isAnyAudioNode=createIsAnyAudioNode(AUDIO_NODE_STORE,isNativeAudioNode),isAnyAudioParam=createIsAnyAudioParam(AUDIO_PARAM_STORE,isNativeAudioParam),isAnyOfflineAudioContext=createIsAnyOfflineAudioContext(CONTEXT_STORE,isNativeOfflineAudioContext);function isUndef(tt){return typeof tt>"u"}function isDefined(tt){return!isUndef(tt)}function isFunction$1(tt){return typeof tt=="function"}function isNumber$3(tt){return typeof tt=="number"}function isObject$6(tt){return Object.prototype.toString.call(tt)==="[object Object]"&&tt.constructor===Object}function isBoolean$1(tt){return typeof tt=="boolean"}function isArray$d(tt){return Array.isArray(tt)}function isString$1(tt){return typeof tt=="string"}function isNote(tt){return isString$1(tt)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(tt)}function assert(tt,et){if(!tt)throw new Error(et)}function assertRange(tt,et,nt=1/0){if(!(et<=tt&&tt<=nt))throw new RangeError(`Value must be within [${et}, ${nt}], got: ${tt}`)}function assertContextRunning(tt){!tt.isOffline&&tt.state!=="running"&&warn$1('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let isInsideScheduledCallback=!1,printedScheduledWarning=!1;function enterScheduledCallback(tt){isInsideScheduledCallback=tt}function assertUsedScheduleTime(tt){isUndef(tt)&&isInsideScheduledCallback&&!printedScheduledWarning&&(printedScheduledWarning=!0,warn$1("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let defaultLogger=console;function log$1(...tt){defaultLogger.log(...tt)}function warn$1(...tt){defaultLogger.warn(...tt)}function createAudioContext(tt){return new audioContextConstructor(tt)}function createOfflineAudioContext(tt,et,nt){return new offlineAudioContextConstructor(tt,et,nt)}const theWindow=typeof self=="object"?self:null,hasAudioContext=theWindow&&(theWindow.hasOwnProperty("AudioContext")||theWindow.hasOwnProperty("webkitAudioContext"));function createAudioWorkletNode(tt,et,nt){return assert(isDefined(audioWorkletNodeConstructor),"This node only works in a secure context (https or localhost)"),new audioWorkletNodeConstructor(tt,et,nt)}class Ticker{constructor(et,nt,rt,it){this._callback=et,this._type=nt,this._minimumUpdateInterval=Math.max(128/(it||44100),.001),this.updateInterval=rt,this._createClock()}_createWorker(){const et=new Blob([` +})(${At?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${At?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${At?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${Et}',class extends AudioWorkletProcessor{process(){return !1}})`,It=new Blob([vt],{type:"application/javascript; charset=utf-8"}),Ot=URL.createObjectURL(It);return xt.audioWorklet.addModule(Ot,yt).then(()=>{if(st(xt))return xt;const Wt=at(xt);return Wt.audioWorklet.addModule(Ot,yt).then(()=>Wt)}).then(Wt=>{if(lt===null)throw new SyntaxError;try{new lt(Wt,`__sac${Et}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(Ot))});return wt===void 0?ct.set(mt,new Map([[gt,kt]])):wt.set(gt,kt),kt.then(()=>{const St=ut.get(mt);St===void 0?ut.set(mt,new Set([gt])):St.add(gt)}).finally(()=>{const St=ct.get(mt);St!==void 0&&St.delete(gt)}),kt}},getValueForKey=(tt,et)=>{const nt=tt.get(et);if(nt===void 0)throw new Error("A value with the given key could not be found.");return nt},pickElementFromSet=(tt,et)=>{const nt=Array.from(tt).filter(et);if(nt.length>1)throw Error("More than one element was found.");if(nt.length===0)throw Error("No element was found.");const[rt]=nt;return tt.delete(rt),rt},deletePassiveInputConnectionToAudioNode=(tt,et,nt,rt)=>{const it=getValueForKey(tt,et),ot=pickElementFromSet(it,at=>at[0]===nt&&at[1]===rt);return it.size===0&&tt.delete(et),ot},getEventListenersOfAudioNode=tt=>getValueForKey(EVENT_LISTENERS,tt),setInternalStateToActive=tt=>{if(ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is already stored.");ACTIVE_AUDIO_NODE_STORE.add(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!0))},isAudioWorkletNode=tt=>"port"in tt,setInternalStateToPassive=tt=>{if(!ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is not stored.");ACTIVE_AUDIO_NODE_STORE.delete(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!1))},setInternalStateToPassiveWhenNecessary=(tt,et)=>{!isAudioWorkletNode(tt)&&et.every(nt=>nt.size===0)&&setInternalStateToPassive(tt)},createAddConnectionToAudioNode=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt)=>{const pt=new WeakMap;return(mt,gt,yt,bt,wt)=>{const{activeInputs:xt,passiveInputs:kt}=ot(gt),{outputs:St}=ot(mt),Tt=st(mt),At=Et=>{const Ct=lt(gt),Lt=lt(mt);if(Et){const jt=deletePassiveInputConnectionToAudioNode(kt,mt,yt,bt);tt(xt,mt,jt,!1),!wt&&!ht(mt)&&nt(Lt,Ct,yt,bt),dt(gt)&&setInternalStateToActive(gt)}else{const jt=rt(xt,mt,yt,bt);et(kt,bt,jt,!1),!wt&&!ht(mt)&&it(Lt,Ct,yt,bt);const Rt=at(gt);if(Rt===0)ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,xt);else{const $t=pt.get(gt);$t!==void 0&&clearTimeout($t),pt.set(gt,setTimeout(()=>{ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,xt)},Rt*1e3))}}};return ct(St,[gt,yt,bt],Et=>Et[0]===gt&&Et[1]===yt&&Et[2]===bt,!0)?(Tt.add(At),ut(mt)?tt(xt,mt,[yt,bt,At],!0):et(kt,bt,[mt,yt,At],!0),!0):!1}},createAddPassiveInputConnectionToAudioNode=tt=>(et,nt,[rt,it,ot],at)=>{const st=et.get(rt);st===void 0?et.set(rt,new Set([[it,nt,ot]])):tt(st,[it,nt,ot],lt=>lt[0]===it&<[1]===nt,at)},createAddSilentConnection=tt=>(et,nt)=>{const rt=tt(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});nt.connect(rt).connect(et.destination);const it=()=>{nt.removeEventListener("ended",it),nt.disconnect(rt),rt.disconnect()};nt.addEventListener("ended",it)},createAddUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).add(nt)},DEFAULT_OPTIONS$k={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},createAnalyserNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$k,...lt},ht=rt(ct,ut),dt=ot(ct)?et():null;super(st,!1,ht,dt),this._nativeAnalyserNode=ht}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(st){this._nativeAnalyserNode.fftSize=st}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(st){const lt=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=st,!(st>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=lt,nt()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(st){const lt=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=st,!(this._nativeAnalyserNode.maxDecibels>st))throw this._nativeAnalyserNode.minDecibels=lt,nt()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(st){this._nativeAnalyserNode.smoothingTimeConstant=st}getByteFrequencyData(st){this._nativeAnalyserNode.getByteFrequencyData(st)}getByteTimeDomainData(st){this._nativeAnalyserNode.getByteTimeDomainData(st)}getFloatFrequencyData(st){this._nativeAnalyserNode.getFloatFrequencyData(st)}getFloatTimeDomainData(st){this._nativeAnalyserNode.getFloatTimeDomainData(st)}},isOwnedByContext=(tt,et)=>tt.context===et,createAnalyserNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,fftSize:st.fftSize,maxDecibels:st.maxDecibels,minDecibels:st.minDecibels,smoothingTimeConstant:st.smoothingTimeConstant};st=tt(at,ct)}return rt.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},testAudioBufferCopyChannelMethodsOutOfBoundsSupport=tt=>{try{tt.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},createIndexSizeError=()=>new DOMException("","IndexSizeError"),wrapAudioBufferGetChannelDataMethod=tt=>{tt.getChannelData=(et=>nt=>{try{return et.call(tt,nt)}catch(rt){throw rt.code===12?createIndexSizeError():rt}})(tt.getChannelData)},DEFAULT_OPTIONS$j={numberOfChannels:1},createAudioBufferConstructor=(tt,et,nt,rt,it,ot,at,st)=>{let lt=null;return class bw{constructor(ut){if(it===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:ht,numberOfChannels:dt,sampleRate:pt}={...DEFAULT_OPTIONS$j,...ut};lt===null&&(lt=new it(1,1,44100));const mt=rt!==null&&et(ot,ot)?new rt({length:ht,numberOfChannels:dt,sampleRate:pt}):lt.createBuffer(dt,ht,pt);if(mt.numberOfChannels===0)throw nt();return typeof mt.copyFromChannel!="function"?(at(mt),wrapAudioBufferGetChannelDataMethod(mt)):et(testAudioBufferCopyChannelMethodsOutOfBoundsSupport,()=>testAudioBufferCopyChannelMethodsOutOfBoundsSupport(mt))||st(mt),tt.add(mt),mt}static[Symbol.hasInstance](ut){return ut!==null&&typeof ut=="object"&&Object.getPrototypeOf(ut)===bw.prototype||tt.has(ut)}}},MOST_NEGATIVE_SINGLE_FLOAT=-34028234663852886e22,MOST_POSITIVE_SINGLE_FLOAT=-MOST_NEGATIVE_SINGLE_FLOAT,isActiveAudioNode=tt=>ACTIVE_AUDIO_NODE_STORE.has(tt),DEFAULT_OPTIONS$i={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},createAudioBufferSourceNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$i,...ut},pt=it(ht,dt),mt=at(ht),gt=mt?et():null;super(ct,!1,pt,gt),this._audioBufferSourceNodeRenderer=gt,this._isBufferNullified=!1,this._isBufferSet=dt.buffer!==null,this._nativeAudioBufferSourceNode=pt,this._onended=null,this._playbackRate=nt(this,mt,pt.playbackRate,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(ct){if(this._nativeAudioBufferSourceNode.buffer=ct,ct!==null){if(this._isBufferSet)throw rt();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(ct){this._nativeAudioBufferSourceNode.loop=ct}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(ct){this._nativeAudioBufferSourceNode.loopEnd=ct}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(ct){this._nativeAudioBufferSourceNode.loopStart=ct}get onended(){return this._onended}set onended(ct){const ut=typeof ct=="function"?st(this,ct):null;this._nativeAudioBufferSourceNode.onended=ut;const ht=this._nativeAudioBufferSourceNode.onended;this._onended=ht!==null&&ht===ut?ct:ht}get playbackRate(){return this._playbackRate}start(ct=0,ut=0,ht){if(this._nativeAudioBufferSourceNode.start(ct,ut,ht),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=ht===void 0?[ct,ut]:[ct,ut,ht]),this.context.state!=="closed"){setInternalStateToActive(this);const dt=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",dt),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",dt)}}stop(ct=0){this._nativeAudioBufferSourceNode.stop(ct),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=ct)}},createAudioBufferSourceNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={buffer:ht.buffer,channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,loop:ht.loop,loopEnd:ht.loopEnd,loopStart:ht.loopStart,playbackRate:ht.playbackRate.value};ht=et(ut,pt),at!==null&&ht.start(...at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.playbackRate,ht.playbackRate):await rt(ut,ct.playbackRate,ht.playbackRate),await it(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},isAudioBufferSourceNode=tt=>"playbackRate"in tt,isBiquadFilterNode=tt=>"frequency"in tt&&"gain"in tt,isConstantSourceNode=tt=>"offset"in tt,isGainNode=tt=>!("frequency"in tt)&&"gain"in tt,isOscillatorNode=tt=>"detune"in tt&&"frequency"in tt,isStereoPannerNode=tt=>"pan"in tt,getAudioNodeConnections=tt=>getValueForKey(AUDIO_NODE_CONNECTIONS_STORE,tt),getAudioParamConnections=tt=>getValueForKey(AUDIO_PARAM_CONNECTIONS_STORE,tt),deactivateActiveAudioNodeInputConnections=(tt,et)=>{const{activeInputs:nt}=getAudioNodeConnections(tt);nt.forEach(it=>it.forEach(([ot])=>{et.includes(tt)||deactivateActiveAudioNodeInputConnections(ot,[...et,tt])}));const rt=isAudioBufferSourceNode(tt)?[tt.playbackRate]:isAudioWorkletNode(tt)?Array.from(tt.parameters.values()):isBiquadFilterNode(tt)?[tt.Q,tt.detune,tt.frequency,tt.gain]:isConstantSourceNode(tt)?[tt.offset]:isGainNode(tt)?[tt.gain]:isOscillatorNode(tt)?[tt.detune,tt.frequency]:isStereoPannerNode(tt)?[tt.pan]:[];for(const it of rt){const ot=getAudioParamConnections(it);ot!==void 0&&ot.activeInputs.forEach(([at])=>deactivateActiveAudioNodeInputConnections(at,et))}isActiveAudioNode(tt)&&setInternalStateToPassive(tt)},deactivateAudioGraph=tt=>{deactivateActiveAudioNodeInputConnections(tt.destination,[])},isValidLatencyHint=tt=>tt===void 0||typeof tt=="number"||typeof tt=="string"&&(tt==="balanced"||tt==="interactive"||tt==="playback"),createAudioContextConstructor=(tt,et,nt,rt,it,ot,at,st,lt)=>class extends tt{constructor(ut={}){if(lt===null)throw new Error("Missing the native AudioContext constructor.");let ht;try{ht=new lt(ut)}catch(mt){throw mt.code===12&&mt.message==="sampleRate is not in range"?nt():mt}if(ht===null)throw rt();if(!isValidLatencyHint(ut.latencyHint))throw new TypeError(`The provided value '${ut.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(ut.sampleRate!==void 0&&ht.sampleRate!==ut.sampleRate)throw nt();super(ht,2);const{latencyHint:dt}=ut,{sampleRate:pt}=ht;if(this._baseLatency=typeof ht.baseLatency=="number"?ht.baseLatency:dt==="balanced"?512/pt:dt==="interactive"||dt===void 0?256/pt:dt==="playback"?1024/pt:Math.max(2,Math.min(128,Math.round(dt*pt/128)))*128/pt,this._nativeAudioContext=ht,lt.name==="webkitAudioContext"?(this._nativeGainNode=ht.createGain(),this._nativeOscillatorNode=ht.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(ht.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,ht.state==="running"){this._state="suspended";const mt=()=>{this._state==="suspended"&&(this._state=null),ht.removeEventListener("statechange",mt)};ht.addEventListener("statechange",mt)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw et()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),deactivateAudioGraph(this)}))}createMediaElementSource(ut){return new it(this,{mediaElement:ut})}createMediaStreamDestination(){return new ot(this)}createMediaStreamSource(ut){return new at(this,{mediaStream:ut})}createMediaStreamTrackSource(ut){return new st(this,{mediaStreamTrack:ut})}resume(){return this._state==="suspended"?new Promise((ut,ht)=>{const dt=()=>{this._nativeAudioContext.removeEventListener("statechange",dt),this._nativeAudioContext.state==="running"?ut():this.resume().then(ut,ht)};this._nativeAudioContext.addEventListener("statechange",dt)}):this._nativeAudioContext.resume().catch(ut=>{throw ut===void 0||ut.code===15?et():ut})}suspend(){return this._nativeAudioContext.suspend().catch(ut=>{throw ut===void 0?et():ut})}},createAudioDestinationNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt=at(ht),pt=it(ht,ut,dt),mt=dt?et(st):null;super(ct,!1,pt,mt),this._isNodeOfNativeOfflineAudioContext=dt,this._nativeAudioDestinationNode=pt}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(ct){if(this._isNodeOfNativeOfflineAudioContext)throw rt();if(ct>this._nativeAudioDestinationNode.maxChannelCount)throw nt();this._nativeAudioDestinationNode.channelCount=ct}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(ct){if(this._isNodeOfNativeOfflineAudioContext)throw rt();this._nativeAudioDestinationNode.channelCountMode=ct}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},createAudioDestinationNodeRenderer=tt=>{const et=new WeakMap,nt=async(rt,it)=>{const ot=it.destination;return et.set(it,ot),await tt(rt,it,ot),ot};return{render(rt,it){const ot=et.get(it);return ot!==void 0?Promise.resolve(ot):nt(rt,it)}}},createAudioListenerFactory=(tt,et,nt,rt,it,ot,at,st)=>(lt,ct)=>{const ut=ct.listener,ht=()=>{const St=new Float32Array(1),Tt=et(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),At=at(ct);let Et=!1,Ct=[0,0,-1,0,1,0],Lt=[0,0,0];const jt=()=>{if(Et)return;Et=!0;const It=rt(ct,256,9,0);It.onaudioprocess=({inputBuffer:Ot})=>{const Wt=[ot(Ot,St,0),ot(Ot,St,1),ot(Ot,St,2),ot(Ot,St,3),ot(Ot,St,4),ot(Ot,St,5)];Wt.some((Ft,Nt)=>Ft!==Ct[Nt])&&(ut.setOrientation(...Wt),Ct=Wt);const zt=[ot(Ot,St,6),ot(Ot,St,7),ot(Ot,St,8)];zt.some((Ft,Nt)=>Ft!==Lt[Nt])&&(ut.setPosition(...zt),Lt=zt)},Tt.connect(It)},Rt=It=>Ot=>{Ot!==Ct[It]&&(Ct[It]=Ot,ut.setOrientation(...Ct))},$t=It=>Ot=>{Ot!==Lt[It]&&(Lt[It]=Ot,ut.setPosition(...Lt))},vt=(It,Ot,Wt)=>{const zt=nt(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Ot});zt.connect(Tt,0,It),zt.start(),Object.defineProperty(zt.offset,"defaultValue",{get(){return Ot}});const Ft=tt({context:lt},At,zt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT);return st(Ft,"value",Nt=>()=>Nt.call(Ft),Nt=>Ut=>{try{Nt.call(Ft,Ut)}catch(Pt){if(Pt.code!==9)throw Pt}jt(),At&&Wt(Ut)}),Ft.cancelAndHoldAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.cancelAndHoldAtTime),Ft.cancelScheduledValues=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.cancelScheduledValues),Ft.exponentialRampToValueAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.exponentialRampToValueAtTime),Ft.linearRampToValueAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.linearRampToValueAtTime),Ft.setTargetAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.setTargetAtTime),Ft.setValueAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.setValueAtTime),Ft.setValueCurveAtTime=(Nt=>At?()=>{throw it()}:(...Ut)=>{const Pt=Nt.apply(Ft,Ut);return jt(),Pt})(Ft.setValueCurveAtTime),Ft};return{forwardX:vt(0,0,Rt(0)),forwardY:vt(1,0,Rt(1)),forwardZ:vt(2,-1,Rt(2)),positionX:vt(6,0,$t(0)),positionY:vt(7,0,$t(1)),positionZ:vt(8,0,$t(2)),upX:vt(3,0,Rt(3)),upY:vt(4,1,Rt(4)),upZ:vt(5,0,Rt(5))}},{forwardX:dt,forwardY:pt,forwardZ:mt,positionX:gt,positionY:yt,positionZ:bt,upX:wt,upY:xt,upZ:kt}=ut.forwardX===void 0?ht():ut;return{get forwardX(){return dt},get forwardY(){return pt},get forwardZ(){return mt},get positionX(){return gt},get positionY(){return yt},get positionZ(){return bt},get upX(){return wt},get upY(){return xt},get upZ(){return kt}}},isAudioNode$1=tt=>"context"in tt,isAudioNodeOutputConnection=tt=>isAudioNode$1(tt[0]),insertElementInSet=(tt,et,nt,rt)=>{for(const it of tt)if(nt(it)){if(rt)return!1;throw Error("The set contains at least one similar element.")}return tt.add(et),!0},addActiveInputConnectionToAudioParam=(tt,et,[nt,rt],it)=>{insertElementInSet(tt,[et,nt,rt],ot=>ot[0]===et&&ot[1]===nt,it)},addPassiveInputConnectionToAudioParam=(tt,[et,nt,rt],it)=>{const ot=tt.get(et);ot===void 0?tt.set(et,new Set([[nt,rt]])):insertElementInSet(ot,[nt,rt],at=>at[0]===nt,it)},isNativeAudioNodeFaker=tt=>"inputs"in tt,connectNativeAudioNodeToNativeAudioNode=(tt,et,nt,rt)=>{if(isNativeAudioNodeFaker(et)){const it=et.inputs[rt];return tt.connect(it,nt,0),[it,nt,0]}return tt.connect(et,nt,rt),[et,nt,rt]},deleteActiveInputConnection=(tt,et,nt)=>{for(const rt of tt)if(rt[0]===et&&rt[1]===nt)return tt.delete(rt),rt;return null},deleteActiveInputConnectionToAudioParam=(tt,et,nt)=>pickElementFromSet(tt,rt=>rt[0]===et&&rt[1]===nt),deleteEventListenerOfAudioNode=(tt,et)=>{if(!getEventListenersOfAudioNode(tt).delete(et))throw new Error("Missing the expected event listener.")},deletePassiveInputConnectionToAudioParam=(tt,et,nt)=>{const rt=getValueForKey(tt,et),it=pickElementFromSet(rt,ot=>ot[0]===nt);return rt.size===0&&tt.delete(et),it},disconnectNativeAudioNodeFromNativeAudioNode=(tt,et,nt,rt)=>{isNativeAudioNodeFaker(et)?tt.disconnect(et.inputs[rt],nt,0):tt.disconnect(et,nt,rt)},getNativeAudioNode=tt=>getValueForKey(AUDIO_NODE_STORE,tt),getNativeAudioParam=tt=>getValueForKey(AUDIO_PARAM_STORE,tt),isPartOfACycle=tt=>CYCLE_COUNTERS.has(tt),isPassiveAudioNode=tt=>!ACTIVE_AUDIO_NODE_STORE.has(tt),testAudioNodeDisconnectMethodSupport=(tt,et)=>new Promise(nt=>{if(et!==null)nt(!0);else{const rt=tt.createScriptProcessor(256,1,1),it=tt.createGain(),ot=tt.createBuffer(1,2,44100),at=ot.getChannelData(0);at[0]=1,at[1]=1;const st=tt.createBufferSource();st.buffer=ot,st.loop=!0,st.connect(rt).connect(tt.destination),st.connect(it),st.disconnect(it),rt.onaudioprocess=lt=>{const ct=lt.inputBuffer.getChannelData(0);Array.prototype.some.call(ct,ut=>ut===1)?nt(!0):nt(!1),st.stop(),rt.onaudioprocess=null,st.disconnect(rt),rt.disconnect(tt.destination)},st.start()}}),visitEachAudioNodeOnce=(tt,et)=>{const nt=new Map;for(const rt of tt)for(const it of rt){const ot=nt.get(it);nt.set(it,ot===void 0?1:ot+1)}nt.forEach((rt,it)=>et(it,rt))},isNativeAudioNode$1=tt=>"context"in tt,wrapAudioNodeDisconnectMethod=tt=>{const et=new Map;tt.connect=(nt=>(rt,it=0,ot=0)=>{const at=isNativeAudioNode$1(rt)?nt(rt,it,ot):nt(rt,it),st=et.get(rt);return st===void 0?et.set(rt,[{input:ot,output:it}]):st.every(lt=>lt.input!==ot||lt.output!==it)&&st.push({input:ot,output:it}),at})(tt.connect.bind(tt)),tt.disconnect=(nt=>(rt,it,ot)=>{if(nt.apply(tt),rt===void 0)et.clear();else if(typeof rt=="number")for(const[at,st]of et){const lt=st.filter(ct=>ct.output!==rt);lt.length===0?et.delete(at):et.set(at,lt)}else if(et.has(rt))if(it===void 0)et.delete(rt);else{const at=et.get(rt);if(at!==void 0){const st=at.filter(lt=>lt.output!==it&&(lt.input!==ot||ot===void 0));st.length===0?et.delete(rt):et.set(rt,st)}}for(const[at,st]of et)st.forEach(lt=>{isNativeAudioNode$1(at)?tt.connect(at,lt.output,lt.input):tt.connect(at,lt.output)})})(tt.disconnect)},addConnectionToAudioParamOfAudioContext=(tt,et,nt,rt)=>{const{activeInputs:it,passiveInputs:ot}=getAudioParamConnections(et),{outputs:at}=getAudioNodeConnections(tt),st=getEventListenersOfAudioNode(tt),lt=ct=>{const ut=getNativeAudioNode(tt),ht=getNativeAudioParam(et);if(ct){const dt=deletePassiveInputConnectionToAudioParam(ot,tt,nt);addActiveInputConnectionToAudioParam(it,tt,dt,!1),!rt&&!isPartOfACycle(tt)&&ut.connect(ht,nt)}else{const dt=deleteActiveInputConnectionToAudioParam(it,tt,nt);addPassiveInputConnectionToAudioParam(ot,dt,!1),!rt&&!isPartOfACycle(tt)&&ut.disconnect(ht,nt)}};return insertElementInSet(at,[et,nt],ct=>ct[0]===et&&ct[1]===nt,!0)?(st.add(lt),isActiveAudioNode(tt)?addActiveInputConnectionToAudioParam(it,tt,[nt,lt],!0):addPassiveInputConnectionToAudioParam(ot,[tt,nt,lt],!0),!0):!1},deleteInputConnectionOfAudioNode=(tt,et,nt,rt)=>{const{activeInputs:it,passiveInputs:ot}=getAudioNodeConnections(et),at=deleteActiveInputConnection(it[rt],tt,nt);return at===null?[deletePassiveInputConnectionToAudioNode(ot,tt,nt,rt)[2],!1]:[at[2],!0]},deleteInputConnectionOfAudioParam=(tt,et,nt)=>{const{activeInputs:rt,passiveInputs:it}=getAudioParamConnections(et),ot=deleteActiveInputConnection(rt,tt,nt);return ot===null?[deletePassiveInputConnectionToAudioParam(it,tt,nt)[1],!1]:[ot[2],!0]},deleteInputsOfAudioNode=(tt,et,nt,rt,it)=>{const[ot,at]=deleteInputConnectionOfAudioNode(tt,nt,rt,it);if(ot!==null&&(deleteEventListenerOfAudioNode(tt,ot),at&&!et&&!isPartOfACycle(tt)&&disconnectNativeAudioNodeFromNativeAudioNode(getNativeAudioNode(tt),getNativeAudioNode(nt),rt,it)),isActiveAudioNode(nt)){const{activeInputs:st}=getAudioNodeConnections(nt);setInternalStateToPassiveWhenNecessary(nt,st)}},deleteInputsOfAudioParam=(tt,et,nt,rt)=>{const[it,ot]=deleteInputConnectionOfAudioParam(tt,nt,rt);it!==null&&(deleteEventListenerOfAudioNode(tt,it),ot&&!et&&!isPartOfACycle(tt)&&getNativeAudioNode(tt).disconnect(getNativeAudioParam(nt),rt))},deleteAnyConnection=(tt,et)=>{const nt=getAudioNodeConnections(tt),rt=[];for(const it of nt.outputs)isAudioNodeOutputConnection(it)?deleteInputsOfAudioNode(tt,et,...it):deleteInputsOfAudioParam(tt,et,...it),rt.push(it[0]);return nt.outputs.clear(),rt},deleteConnectionAtOutput=(tt,et,nt)=>{const rt=getAudioNodeConnections(tt),it=[];for(const ot of rt.outputs)ot[1]===nt&&(isAudioNodeOutputConnection(ot)?deleteInputsOfAudioNode(tt,et,...ot):deleteInputsOfAudioParam(tt,et,...ot),it.push(ot[0]),rt.outputs.delete(ot));return it},deleteConnectionToDestination=(tt,et,nt,rt,it)=>{const ot=getAudioNodeConnections(tt);return Array.from(ot.outputs).filter(at=>at[0]===nt&&(rt===void 0||at[1]===rt)&&(it===void 0||at[2]===it)).map(at=>(isAudioNodeOutputConnection(at)?deleteInputsOfAudioNode(tt,et,...at):deleteInputsOfAudioParam(tt,et,...at),ot.outputs.delete(at),at[0]))},createAudioNodeConstructor=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt)=>class extends ct{constructor(bt,wt,xt,kt){super(xt),this._context=bt,this._nativeAudioNode=xt;const St=ut(bt);ht(St)&&nt(testAudioNodeDisconnectMethodSupport,()=>testAudioNodeDisconnectMethodSupport(St,gt))!==!0&&wrapAudioNodeDisconnectMethod(xt),AUDIO_NODE_STORE.set(this,xt),EVENT_LISTENERS.set(this,new Set),bt.state!=="closed"&&wt&&setInternalStateToActive(this),tt(this,kt,xt)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(bt){this._nativeAudioNode.channelCount=bt}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(bt){this._nativeAudioNode.channelCountMode=bt}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(bt){this._nativeAudioNode.channelInterpretation=bt}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(bt,wt=0,xt=0){if(wt<0||wt>=this._nativeAudioNode.numberOfOutputs)throw it();const kt=ut(this._context),St=mt(kt);if(dt(bt)||pt(bt))throw ot();if(isAudioNode$1(bt)){const Et=getNativeAudioNode(bt);try{const Lt=connectNativeAudioNodeToNativeAudioNode(this._nativeAudioNode,Et,wt,xt),jt=isPassiveAudioNode(this);(St||jt)&&this._nativeAudioNode.disconnect(...Lt),this.context.state!=="closed"&&!jt&&isPassiveAudioNode(bt)&&setInternalStateToActive(bt)}catch(Lt){throw Lt.code===12?ot():Lt}if(et(this,bt,wt,xt,St)){const Lt=lt([this],bt);visitEachAudioNodeOnce(Lt,rt(St))}return bt}const Tt=getNativeAudioParam(bt);if(Tt.name==="playbackRate"&&Tt.maxValue===1024)throw at();try{this._nativeAudioNode.connect(Tt,wt),(St||isPassiveAudioNode(this))&&this._nativeAudioNode.disconnect(Tt,wt)}catch(Et){throw Et.code===12?ot():Et}if(addConnectionToAudioParamOfAudioContext(this,bt,wt,St)){const Et=lt([this],bt);visitEachAudioNodeOnce(Et,rt(St))}}disconnect(bt,wt,xt){let kt;const St=ut(this._context),Tt=mt(St);if(bt===void 0)kt=deleteAnyConnection(this,Tt);else if(typeof bt=="number"){if(bt<0||bt>=this.numberOfOutputs)throw it();kt=deleteConnectionAtOutput(this,Tt,bt)}else{if(wt!==void 0&&(wt<0||wt>=this.numberOfOutputs)||isAudioNode$1(bt)&&xt!==void 0&&(xt<0||xt>=bt.numberOfInputs))throw it();if(kt=deleteConnectionToDestination(this,Tt,bt,wt,xt),kt.length===0)throw ot()}for(const At of kt){const Et=lt([this],At);visitEachAudioNodeOnce(Et,st)}}},createAudioParamFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,yt=null,bt=null)=>{const wt=gt.value,xt=new AutomationEventList(wt),kt=mt?rt(xt):null,St={get defaultValue(){return wt},get maxValue(){return yt===null?gt.maxValue:yt},get minValue(){return bt===null?gt.minValue:bt},get value(){return gt.value},set value(Tt){gt.value=Tt,St.setValueAtTime(Tt,pt.context.currentTime)},cancelAndHoldAtTime(Tt){if(typeof gt.cancelAndHoldAtTime=="function")kt===null&&xt.flush(pt.context.currentTime),xt.add(it(Tt)),gt.cancelAndHoldAtTime(Tt);else{const At=Array.from(xt).pop();kt===null&&xt.flush(pt.context.currentTime),xt.add(it(Tt));const Et=Array.from(xt).pop();gt.cancelScheduledValues(Tt),At!==Et&&Et!==void 0&&(Et.type==="exponentialRampToValue"?gt.exponentialRampToValueAtTime(Et.value,Et.endTime):Et.type==="linearRampToValue"?gt.linearRampToValueAtTime(Et.value,Et.endTime):Et.type==="setValue"?gt.setValueAtTime(Et.value,Et.startTime):Et.type==="setValueCurve"&>.setValueCurveAtTime(Et.values,Et.startTime,Et.duration))}return St},cancelScheduledValues(Tt){return kt===null&&xt.flush(pt.context.currentTime),xt.add(ot(Tt)),gt.cancelScheduledValues(Tt),St},exponentialRampToValueAtTime(Tt,At){if(Tt===0)throw new RangeError;if(!Number.isFinite(At)||At<0)throw new RangeError;const Et=pt.context.currentTime;return kt===null&&xt.flush(Et),Array.from(xt).length===0&&(xt.add(ct(wt,Et)),gt.setValueAtTime(wt,Et)),xt.add(at(Tt,At)),gt.exponentialRampToValueAtTime(Tt,At),St},linearRampToValueAtTime(Tt,At){const Et=pt.context.currentTime;return kt===null&&xt.flush(Et),Array.from(xt).length===0&&(xt.add(ct(wt,Et)),gt.setValueAtTime(wt,Et)),xt.add(st(Tt,At)),gt.linearRampToValueAtTime(Tt,At),St},setTargetAtTime(Tt,At,Et){return kt===null&&xt.flush(pt.context.currentTime),xt.add(lt(Tt,At,Et)),gt.setTargetAtTime(Tt,At,Et),St},setValueAtTime(Tt,At){return kt===null&&xt.flush(pt.context.currentTime),xt.add(ct(Tt,At)),gt.setValueAtTime(Tt,At),St},setValueCurveAtTime(Tt,At,Et){const Ct=Tt instanceof Float32Array?Tt:new Float32Array(Tt);if(ht!==null&&ht.name==="webkitAudioContext"){const Lt=At+Et,jt=pt.context.sampleRate,Rt=Math.ceil(At*jt),$t=Math.floor(Lt*jt),vt=$t-Rt,It=new Float32Array(vt);for(let Wt=0;Wt({replay(et){for(const nt of tt)if(nt.type==="exponentialRampToValue"){const{endTime:rt,value:it}=nt;et.exponentialRampToValueAtTime(it,rt)}else if(nt.type==="linearRampToValue"){const{endTime:rt,value:it}=nt;et.linearRampToValueAtTime(it,rt)}else if(nt.type==="setTarget"){const{startTime:rt,target:it,timeConstant:ot}=nt;et.setTargetAtTime(it,rt,ot)}else if(nt.type==="setValue"){const{startTime:rt,value:it}=nt;et.setValueAtTime(it,rt)}else if(nt.type==="setValueCurve"){const{duration:rt,startTime:it,values:ot}=nt;et.setValueCurveAtTime(ot,it,rt)}else throw new Error("Can't apply an unknown automation.")}});class ReadOnlyMap{constructor(et){this._map=new Map(et)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(et,nt=null){return this._map.forEach((rt,it)=>et.call(nt,rt,it,this))}get(et){return this._map.get(et)}has(et){return this._map.has(et)}keys(){return this._map.keys()}values(){return this._map.values()}}const DEFAULT_OPTIONS$h={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},createAudioWorkletNodeConstructor=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt,pt)=>class extends et{constructor(gt,yt,bt){var wt;const xt=st(gt),kt=lt(xt),St=ut({...DEFAULT_OPTIONS$h,...bt});dt(St);const Tt=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(xt),At=Tt==null?void 0:Tt.get(yt),Et=kt||xt.state!=="closed"?xt:(wt=at(xt))!==null&&wt!==void 0?wt:xt,Ct=it(Et,kt?null:gt.baseLatency,ct,yt,At,St),Lt=kt?rt(yt,St,At):null;super(gt,!0,Ct,Lt);const jt=[];Ct.parameters.forEach(($t,vt)=>{const It=nt(this,kt,$t);jt.push([vt,It])}),this._nativeAudioWorkletNode=Ct,this._onprocessorerror=null,this._parameters=new ReadOnlyMap(jt),kt&&tt(xt,this);const{activeInputs:Rt}=ot(this);ht(Ct,Rt)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(gt){const yt=typeof gt=="function"?pt(this,gt):null;this._nativeAudioWorkletNode.onprocessorerror=yt;const bt=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=bt!==null&&bt===yt?gt:bt}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function copyFromChannel(tt,et,nt,rt,it){if(typeof tt.copyFromChannel=="function")et[nt].byteLength===0&&(et[nt]=new Float32Array(128)),tt.copyFromChannel(et[nt],rt,it);else{const ot=tt.getChannelData(rt);if(et[nt].byteLength===0)et[nt]=ot.slice(it,it+128);else{const at=new Float32Array(ot.buffer,it*Float32Array.BYTES_PER_ELEMENT,128);et[nt].set(at)}}}const copyToChannel=(tt,et,nt,rt,it)=>{typeof tt.copyToChannel=="function"?et[nt].byteLength!==0&&tt.copyToChannel(et[nt],rt,it):et[nt].byteLength!==0&&tt.getChannelData(rt).set(et[nt],it)},createNestedArrays=(tt,et)=>{const nt=[];for(let rt=0;rt{const nt=getValueForKey(NODE_TO_PROCESSOR_MAPS,tt),rt=getNativeAudioNode(et);return getValueForKey(nt,rt)},processBuffer=async(tt,et,nt,rt,it,ot,at)=>{const st=et===null?Math.ceil(tt.context.length/128)*128:et.length,lt=rt.channelCount*rt.numberOfInputs,ct=it.reduce((yt,bt)=>yt+bt,0),ut=ct===0?null:nt.createBuffer(ct,st,nt.sampleRate);if(ot===void 0)throw new Error("Missing the processor constructor.");const ht=getAudioNodeConnections(tt),dt=await getAudioWorkletProcessor(nt,tt),pt=createNestedArrays(rt.numberOfInputs,rt.channelCount),mt=createNestedArrays(rt.numberOfOutputs,it),gt=Array.from(tt.parameters.keys()).reduce((yt,bt)=>({...yt,[bt]:new Float32Array(128)}),{});for(let yt=0;yt0&&et!==null)for(let bt=0;bt{copyFromChannel(et,gt,bt,lt+wt,yt)});for(let bt=0;btht.activeInputs[kt].size===0?[]:xt),wt=at(yt/nt.sampleRate,nt.sampleRate,()=>dt.process(bt,mt,gt));if(ut!==null)for(let xt=0,kt=0;xt(yt,bt,wt)=>{const xt=new WeakMap;let kt=null;const St=async(Tt,At)=>{let Et=ut(Tt),Ct=null;const Lt=isOwnedByContext(Et,At),jt=Array.isArray(bt.outputChannelCount)?bt.outputChannelCount:Array.from(bt.outputChannelCount);if(ht===null){const Rt=jt.reduce((Ot,Wt)=>Ot+Wt,0),$t=it(At,{channelCount:Math.max(1,Rt),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,Rt)}),vt=[];for(let Ot=0;Ot{const Ut=new dt(Ft,Math.ceil(Tt.context.length/128)*128,At.sampleRate),Pt=[],Ht=[];for(let Yt=0;Yt{const nn=ot(Ut,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Yt.value});return await pt(Ut,Yt,nn.offset),nn})),an=rt(Ut,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,Wt+zt)});for(let Yt=0;Ytmt(Tt,Ut,Yt))),gt(Ut)})(),At,bt,jt,wt,ct)}const Rt=await kt,$t=nt(At,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[vt,It,Ot]=Ct;Rt!==null&&($t.buffer=Rt,$t.start(0)),$t.connect(vt);for(let Wt=0,zt=0;Wtclass extends mt{constructor(St,Tt){super(St,Tt),this._nativeContext=St,this._audioWorklet=tt===void 0?void 0:{addModule:(At,Et)=>tt(this,At,Et)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new et(this)}createBiquadFilter(){return new it(this)}createBuffer(St,Tt,At){return new nt({length:Tt,numberOfChannels:St,sampleRate:At})}createBufferSource(){return new rt(this)}createChannelMerger(St=6){return new ot(this,{numberOfInputs:St})}createChannelSplitter(St=6){return new at(this,{numberOfOutputs:St})}createConstantSource(){return new st(this)}createConvolver(){return new lt(this)}createDelay(St=1){return new ut(this,{maxDelayTime:St})}createDynamicsCompressor(){return new ht(this)}createGain(){return new dt(this)}createIIRFilter(St,Tt){return new pt(this,{feedback:Tt,feedforward:St})}createOscillator(){return new gt(this)}createPanner(){return new yt(this)}createPeriodicWave(St,Tt,At={disableNormalization:!1}){return new bt(this,{...At,imag:Tt,real:St})}createStereoPanner(){return new wt(this)}createWaveShaper(){return new xt(this)}decodeAudioData(St,Tt,At){return ct(this._nativeContext,St).then(Et=>(typeof Tt=="function"&&Tt(Et),Et),Et=>{throw typeof At=="function"&&At(Et),Et})}},DEFAULT_OPTIONS$g={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},createBiquadFilterNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$g,...ut},pt=it(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._Q=et(this,mt,pt.Q,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._detune=et(this,mt,pt.detune,1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT),-1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT)),this._frequency=et(this,mt,pt.frequency,ct.sampleRate/2,0),this._gain=et(this,mt,pt.gain,40*Math.log10(MOST_POSITIVE_SINGLE_FLOAT),MOST_NEGATIVE_SINGLE_FLOAT),this._nativeBiquadFilterNode=pt,st(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(ct){this._nativeBiquadFilterNode.type=ct}getFrequencyResponse(ct,ut,ht){try{this._nativeBiquadFilterNode.getFrequencyResponse(ct,ut,ht)}catch(dt){throw dt.code===11?rt():dt}if(ct.length!==ut.length||ut.length!==ht.length)throw rt()}},createBiquadFilterNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={Q:ct.Q.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,detune:ct.detune.value,frequency:ct.frequency.value,gain:ct.gain.value,type:ct.type};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.Q,ct.Q),await tt(lt,st.detune,ct.detune),await tt(lt,st.frequency,ct.frequency),await tt(lt,st.gain,ct.gain)):(await rt(lt,st.Q,ct.Q),await rt(lt,st.detune,ct.detune),await rt(lt,st.frequency,ct.frequency),await rt(lt,st.gain,ct.gain)),await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createCacheTestResult=(tt,et)=>(nt,rt)=>{const it=et.get(nt);if(it!==void 0)return it;const ot=tt.get(nt);if(ot!==void 0)return ot;try{const at=rt();return at instanceof Promise?(tt.set(nt,at),at.catch(()=>!1).then(st=>(tt.delete(nt),et.set(nt,st),st))):(et.set(nt,at),at)}catch{return et.set(nt,!1),!1}},DEFAULT_OPTIONS$f={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},createChannelMergerNodeConstructor=(tt,et,nt,rt,it)=>class extends tt{constructor(at,st){const lt=rt(at),ct={...DEFAULT_OPTIONS$f,...st},ut=nt(lt,ct),ht=it(lt)?et():null;super(at,!1,ut,ht)}},createChannelMergerNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfInputs:st.numberOfInputs};st=tt(at,ct)}return rt.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},DEFAULT_OPTIONS$e={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},createChannelSplitterNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut=ot({...DEFAULT_OPTIONS$e,...lt}),ht=nt(ct,ut),dt=it(ct)?et():null;super(st,!1,ht,dt)}},createChannelSplitterNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfOutputs:st.numberOfOutputs};st=tt(at,ct)}return rt.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},createConnectAudioParam=tt=>(et,nt,rt)=>tt(nt,et,rt),createConnectMultipleOutputs=tt=>(et,nt,rt=0,it=0)=>{const ot=et[rt];if(ot===void 0)throw tt();return isNativeAudioNode$1(nt)?ot.connect(nt,0,it):ot.connect(nt,0)},createConnectedNativeAudioBufferSourceNodeFactory=tt=>(et,nt)=>{const rt=tt(et,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),it=et.createBuffer(1,2,44100);return rt.buffer=it,rt.loop=!0,rt.connect(nt),rt.start(),()=>{rt.stop(),rt.disconnect(nt)}},DEFAULT_OPTIONS$d={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},createConstantSourceNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$d,...ct},dt=rt(ut,ht),pt=ot(ut),mt=pt?nt():null;super(lt,!1,dt,mt),this._constantSourceNodeRenderer=mt,this._nativeConstantSourceNode=dt,this._offset=et(this,pt,dt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeConstantSourceNode.onended=ct;const ut=this._nativeConstantSourceNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}start(lt=0){if(this._nativeConstantSourceNode.start(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeConstantSourceNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeConstantSourceNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeConstantSourceNode.stop(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=lt)}},createConstantSourceNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,offset:ht.offset.value};ht=et(ut,pt),at!==null&&ht.start(at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.offset,ht.offset):await rt(ut,ct.offset,ht.offset),await it(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},createConvertNumberToUnsignedLong=tt=>et=>(tt[0]=et,tt[0]),DEFAULT_OPTIONS$c={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},createConvolverNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$c,...lt},ht=nt(ct,ut),pt=it(ct)?et():null;super(st,!1,ht,pt),this._isBufferNullified=!1,this._nativeConvolverNode=ht,ut.buffer!==null&&ot(this,ut.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(st){if(this._nativeConvolverNode.buffer=st,st===null&&this._nativeConvolverNode.buffer!==null){const lt=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=lt.createBuffer(1,1,lt.sampleRate),this._isBufferNullified=!0,ot(this,0)}else this._isBufferNullified=!1,ot(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(st){this._nativeConvolverNode.normalize=st}},createConvolverNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={buffer:st.buffer,channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,disableNormalization:!st.normalize};st=tt(at,ct)}return rt.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},createCreateNativeOfflineAudioContext=(tt,et)=>(nt,rt,it)=>{if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new et(nt,rt,it)}catch(ot){throw ot.name==="SyntaxError"?tt():ot}},createDataCloneError=()=>new DOMException("","DataCloneError"),detachArrayBuffer=tt=>{const{port1:et,port2:nt}=new MessageChannel;return new Promise(rt=>{const it=()=>{nt.onmessage=null,et.close(),nt.close(),rt()};nt.onmessage=()=>it();try{et.postMessage(tt,[tt])}catch{}finally{it()}})},createDecodeAudioData=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=at(ht)?ht:ot(ht);if(it.has(dt)){const mt=nt();return Promise.reject(mt)}try{it.add(dt)}catch{}return et(lt,()=>lt(pt))?pt.decodeAudioData(dt).then(mt=>(detachArrayBuffer(dt).catch(()=>{}),et(st,()=>st(mt))||ut(mt),tt.add(mt),mt)):new Promise((mt,gt)=>{const yt=async()=>{try{await detachArrayBuffer(dt)}catch{}},bt=wt=>{gt(wt),yt()};try{pt.decodeAudioData(dt,wt=>{typeof wt.copyFromChannel!="function"&&(ct(wt),wrapAudioBufferGetChannelDataMethod(wt)),tt.add(wt),yt().then(()=>mt(wt))},wt=>{bt(wt===null?rt():wt)})}catch(wt){bt(wt)}})},createDecrementCycleCounter=(tt,et,nt,rt,it,ot,at,st)=>(lt,ct)=>{const ut=et.get(lt);if(ut===void 0)throw new Error("Missing the expected cycle count.");const ht=ot(lt.context),dt=st(ht);if(ut===ct){if(et.delete(lt),!dt&&at(lt)){const pt=rt(lt),{outputs:mt}=nt(lt);for(const gt of mt)if(isAudioNodeOutputConnection(gt)){const yt=rt(gt[0]);tt(pt,yt,gt[1],gt[2])}else{const yt=it(gt[0]);pt.connect(yt,gt[1])}}}else et.set(lt,ut-ct)},DEFAULT_OPTIONS$b={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},createDelayNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$b,...ct},dt=rt(ut,ht),pt=ot(ut),mt=pt?nt(ht.maxDelayTime):null;super(lt,!1,dt,mt),this._delayTime=et(this,pt,dt.delayTime),at(this,ht.maxDelayTime)}get delayTime(){return this._delayTime}},createDelayNodeRendererFactory=(tt,et,nt,rt,it)=>ot=>{const at=new WeakMap,st=async(lt,ct)=>{let ut=nt(lt);const ht=isOwnedByContext(ut,ct);if(!ht){const dt={channelCount:ut.channelCount,channelCountMode:ut.channelCountMode,channelInterpretation:ut.channelInterpretation,delayTime:ut.delayTime.value,maxDelayTime:ot};ut=et(ct,dt)}return at.set(ct,ut),ht?await tt(ct,lt.delayTime,ut.delayTime):await rt(ct,lt.delayTime,ut.delayTime),await it(lt,ct,ut),ut};return{render(lt,ct){const ut=at.get(ct);return ut!==void 0?Promise.resolve(ut):st(lt,ct)}}},createDeleteActiveInputConnectionToAudioNode=tt=>(et,nt,rt,it)=>tt(et[it],ot=>ot[0]===nt&&ot[1]===rt),createDeleteUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).delete(nt)},isDelayNode=tt=>"delayTime"in tt,createDetectCycles=(tt,et,nt)=>function rt(it,ot){const at=isAudioNode$1(ot)?ot:nt(tt,ot);if(isDelayNode(at))return[];if(it[0]===at)return[it];if(it.includes(at))return[];const{outputs:st}=et(at);return Array.from(st).map(lt=>rt([...it,at],lt[0])).reduce((lt,ct)=>lt.concat(ct),[])},getOutputAudioNodeAtIndex=(tt,et,nt)=>{const rt=et[nt];if(rt===void 0)throw tt();return rt},createDisconnectMultipleOutputs=tt=>(et,nt=void 0,rt=void 0,it=0)=>nt===void 0?et.forEach(ot=>ot.disconnect()):typeof nt=="number"?getOutputAudioNodeAtIndex(tt,et,nt).disconnect():isNativeAudioNode$1(nt)?rt===void 0?et.forEach(ot=>ot.disconnect(nt)):it===void 0?getOutputAudioNodeAtIndex(tt,et,rt).disconnect(nt,0):getOutputAudioNodeAtIndex(tt,et,rt).disconnect(nt,0,it):rt===void 0?et.forEach(ot=>ot.disconnect(nt)):getOutputAudioNodeAtIndex(tt,et,rt).disconnect(nt,0),DEFAULT_OPTIONS$a={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},createDynamicsCompressorNodeConstructor=(tt,et,nt,rt,it,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$a,...ut},pt=rt(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._attack=et(this,mt,pt.attack),this._knee=et(this,mt,pt.knee),this._nativeDynamicsCompressorNode=pt,this._ratio=et(this,mt,pt.ratio),this._release=et(this,mt,pt.release),this._threshold=et(this,mt,pt.threshold),st(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(ct){const ut=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=ct,ct>2)throw this._nativeDynamicsCompressorNode.channelCount=ut,it()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(ct){const ut=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=ct,ct==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=ut,it()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value=="number"?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},createDynamicsCompressorNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={attack:ct.attack.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,knee:ct.knee.value,ratio:ct.ratio.value,release:ct.release.value,threshold:ct.threshold.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.attack,ct.attack),await tt(lt,st.knee,ct.knee),await tt(lt,st.ratio,ct.ratio),await tt(lt,st.release,ct.release),await tt(lt,st.threshold,ct.threshold)):(await rt(lt,st.attack,ct.attack),await rt(lt,st.knee,ct.knee),await rt(lt,st.ratio,ct.ratio),await rt(lt,st.release,ct.release),await rt(lt,st.threshold,ct.threshold)),await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createEncodingError=()=>new DOMException("","EncodingError"),createEvaluateSource=tt=>et=>new Promise((nt,rt)=>{if(tt===null){rt(new SyntaxError);return}const it=tt.document.head;if(it===null)rt(new SyntaxError);else{const ot=tt.document.createElement("script"),at=new Blob([et],{type:"application/javascript"}),st=URL.createObjectURL(at),lt=tt.onerror,ct=()=>{tt.onerror=lt,URL.revokeObjectURL(st)};tt.onerror=(ut,ht,dt,pt,mt)=>{if(ht===st||ht===tt.location.href&&dt===1&&pt===1)return ct(),rt(mt),!1;if(lt!==null)return lt(ut,ht,dt,pt,mt)},ot.onerror=()=>{ct(),rt(new SyntaxError)},ot.onload=()=>{ct(),nt()},ot.src=st,ot.type="module",it.appendChild(ot)}}),createEventTargetConstructor=tt=>class{constructor(nt){this._nativeEventTarget=nt,this._listeners=new WeakMap}addEventListener(nt,rt,it){if(rt!==null){let ot=this._listeners.get(rt);ot===void 0&&(ot=tt(this,rt),typeof rt=="function"&&this._listeners.set(rt,ot)),this._nativeEventTarget.addEventListener(nt,ot,it)}}dispatchEvent(nt){return this._nativeEventTarget.dispatchEvent(nt)}removeEventListener(nt,rt,it){const ot=rt===null?void 0:this._listeners.get(rt);this._nativeEventTarget.removeEventListener(nt,ot===void 0?null:ot,it)}},createExposeCurrentFrameAndCurrentTime=tt=>(et,nt,rt)=>{Object.defineProperties(tt,{currentFrame:{configurable:!0,get(){return Math.round(et*nt)}},currentTime:{configurable:!0,get(){return et}}});try{return rt()}finally{tt!==null&&(delete tt.currentFrame,delete tt.currentTime)}},createFetchSource=tt=>async et=>{try{const nt=await fetch(et);if(nt.ok)return[await nt.text(),nt.url]}catch{}throw tt()},DEFAULT_OPTIONS$9={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},createGainNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$9,...lt},ht=rt(ct,ut),dt=ot(ct),pt=dt?nt():null;super(st,!1,ht,pt),this._gain=et(this,dt,ht.gain,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get gain(){return this._gain}},createGainNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,gain:ct.gain.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.gain,ct.gain):await rt(lt,st.gain,ct.gain),await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createGetActiveAudioWorkletNodeInputs=(tt,et)=>nt=>et(tt,nt),createGetAudioNodeRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return nt.renderer},createGetAudioNodeTailTime=tt=>et=>{var nt;return(nt=tt.get(et))!==null&&nt!==void 0?nt:0},createGetAudioParamRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return nt.renderer},createGetBackupOfflineAudioContext=tt=>et=>tt.get(et),createInvalidStateError=()=>new DOMException("","InvalidStateError"),createGetNativeContext=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw createInvalidStateError();return nt},createGetOrCreateBackupOfflineAudioContext=(tt,et)=>nt=>{let rt=tt.get(nt);if(rt!==void 0)return rt;if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");return rt=new et(1,1,44100),tt.set(nt,rt),rt},createGetUnrenderedAudioWorkletNodes=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return nt},createInvalidAccessError=()=>new DOMException("","InvalidAccessError"),wrapIIRFilterNodeGetFrequencyResponseMethod=tt=>{tt.getFrequencyResponse=(et=>(nt,rt,it)=>{if(nt.length!==rt.length||rt.length!==it.length)throw createInvalidAccessError();return et.call(tt,nt,rt,it)})(tt.getFrequencyResponse)},DEFAULT_OPTIONS$8={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},createIIRFilterNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut=it(ct),ht={...DEFAULT_OPTIONS$8,...lt},dt=et(ct,ut?null:st.baseLatency,ht),pt=ut?nt(ht.feedback,ht.feedforward):null;super(st,!1,dt,pt),wrapIIRFilterNodeGetFrequencyResponseMethod(dt),this._nativeIIRFilterNode=dt,ot(this,1)}getFrequencyResponse(st,lt,ct){return this._nativeIIRFilterNode.getFrequencyResponse(st,lt,ct)}},filterBuffer=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut)=>{const ht=ct.length;let dt=st;for(let pt=0;pt{const it=nt instanceof Float64Array?nt:new Float64Array(nt),ot=rt instanceof Float64Array?rt:new Float64Array(rt),at=it.length,st=ot.length,lt=Math.min(at,st);if(it[0]!==1){for(let mt=0;mt(ot,at)=>{const st=new WeakMap;let lt=null;const ct=async(ut,ht)=>{let dt=null,pt=et(ut);const mt=isOwnedByContext(pt,ht);if(ht.createIIRFilter===void 0?dt=tt(ht,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):mt||(pt=ht.createIIRFilter(at,ot)),st.set(ht,dt===null?pt:dt),dt!==null){if(lt===null){if(nt===null)throw new Error("Missing the native OfflineAudioContext constructor.");const yt=new nt(ut.context.destination.channelCount,ut.context.length,ht.sampleRate);lt=(async()=>{await rt(ut,yt,yt.destination);const bt=await it(yt);return filterFullBuffer(bt,ht,ot,at)})()}const gt=await lt;return dt.buffer=gt,dt.start(0),dt}return await rt(ut,ht,pt),pt};return{render(ut,ht){const dt=st.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},createIncrementCycleCounterFactory=(tt,et,nt,rt,it,ot)=>at=>(st,lt)=>{const ct=tt.get(st);if(ct===void 0){if(!at&&ot(st)){const ut=rt(st),{outputs:ht}=nt(st);for(const dt of ht)if(isAudioNodeOutputConnection(dt)){const pt=rt(dt[0]);et(ut,pt,dt[1],dt[2])}else{const pt=it(dt[0]);ut.disconnect(pt,dt[1])}}tt.set(st,lt)}else tt.set(st,ct+lt)},createIsAnyAudioContext=(tt,et)=>nt=>{const rt=tt.get(nt);return et(rt)||et(nt)},createIsAnyAudioNode=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyAudioParam=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyOfflineAudioContext=(tt,et)=>nt=>{const rt=tt.get(nt);return et(rt)||et(nt)},createIsNativeAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsNativeAudioNode=tt=>et=>tt!==null&&typeof tt.AudioNode=="function"&&et instanceof tt.AudioNode,createIsNativeAudioParam=tt=>et=>tt!==null&&typeof tt.AudioParam=="function"&&et instanceof tt.AudioParam,createIsNativeContext=(tt,et)=>nt=>tt(nt)||et(nt),createIsNativeOfflineAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsSecureContext=tt=>tt!==null&&tt.isSecureContext,createMediaElementAudioSourceNodeConstructor=(tt,et,nt,rt)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(rt(st))throw TypeError();super(ot,!0,lt,null),this._nativeMediaElementAudioSourceNode=lt}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},DEFAULT_OPTIONS$7={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},createMediaStreamAudioDestinationNodeConstructor=(tt,et,nt,rt)=>class extends tt{constructor(ot,at){const st=nt(ot);if(rt(st))throw new TypeError;const lt={...DEFAULT_OPTIONS$7,...at},ct=et(st,lt);super(ot,!1,ct,null),this._nativeMediaStreamAudioDestinationNode=ct}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},createMediaStreamAudioSourceNodeConstructor=(tt,et,nt,rt)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(rt(st))throw new TypeError;super(ot,!0,lt,null),this._nativeMediaStreamAudioSourceNode=lt}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},createMediaStreamTrackAudioSourceNodeConstructor=(tt,et,nt)=>class extends tt{constructor(it,ot){const at=nt(it),st=et(at,ot);super(it,!0,st,null)}},createMinimalBaseAudioContextConstructor=(tt,et,nt,rt,it,ot)=>class extends nt{constructor(st,lt){super(st),this._nativeContext=st,CONTEXT_STORE.set(this,st),rt(st)&&it.set(st,new Set),this._destination=new tt(this,lt),this._listener=et(this,st),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(st){const lt=typeof st=="function"?ot(this,st):null;this._nativeContext.onstatechange=lt;const ct=this._nativeContext.onstatechange;this._onstatechange=ct!==null&&ct===lt?st:ct}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},testPromiseSupport=tt=>{const et=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const nt=tt.decodeAudioData(et.buffer,()=>{});return nt===void 0?!1:(nt.catch(()=>{}),!0)}catch{}return!1},createMonitorConnections=(tt,et)=>(nt,rt,it)=>{const ot=new Set;return nt.connect=(at=>(st,lt=0,ct=0)=>{const ut=ot.size===0;if(et(st))return at.call(nt,st,lt,ct),tt(ot,[st,lt,ct],ht=>ht[0]===st&&ht[1]===lt&&ht[2]===ct,!0),ut&&rt(),st;at.call(nt,st,lt),tt(ot,[st,lt],ht=>ht[0]===st&&ht[1]===lt,!0),ut&&rt()})(nt.connect),nt.disconnect=(at=>(st,lt,ct)=>{const ut=ot.size>0;if(st===void 0)at.apply(nt),ot.clear();else if(typeof st=="number"){at.call(nt,st);for(const dt of ot)dt[1]===st&&ot.delete(dt)}else{et(st)?at.call(nt,st,lt,ct):at.call(nt,st,lt);for(const dt of ot)dt[0]===st&&(lt===void 0||dt[1]===lt)&&(ct===void 0||dt[2]===ct)&&ot.delete(dt)}const ht=ot.size===0;ut&&ht&&it()})(nt.disconnect),nt},assignNativeAudioNodeOption=(tt,et,nt)=>{const rt=et[nt];rt!==void 0&&rt!==tt[nt]&&(tt[nt]=rt)},assignNativeAudioNodeOptions=(tt,et)=>{assignNativeAudioNodeOption(tt,et,"channelCount"),assignNativeAudioNodeOption(tt,et,"channelCountMode"),assignNativeAudioNodeOption(tt,et,"channelInterpretation")},testAnalyserNodeGetFloatTimeDomainDataMethodSupport=tt=>typeof tt.getFloatTimeDomainData=="function",wrapAnalyserNodeGetFloatTimeDomainDataMethod=tt=>{tt.getFloatTimeDomainData=et=>{const nt=new Uint8Array(et.length);tt.getByteTimeDomainData(nt);const rt=Math.max(nt.length,tt.fftSize);for(let it=0;it(nt,rt)=>{const it=nt.createAnalyser();if(assignNativeAudioNodeOptions(it,rt),!(rt.maxDecibels>rt.minDecibels))throw et();return assignNativeAudioNodeOption(it,rt,"fftSize"),assignNativeAudioNodeOption(it,rt,"maxDecibels"),assignNativeAudioNodeOption(it,rt,"minDecibels"),assignNativeAudioNodeOption(it,rt,"smoothingTimeConstant"),tt(testAnalyserNodeGetFloatTimeDomainDataMethodSupport,()=>testAnalyserNodeGetFloatTimeDomainDataMethodSupport(it))||wrapAnalyserNodeGetFloatTimeDomainDataMethod(it),it},createNativeAudioBufferConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioBuffer")?tt.AudioBuffer:null,assignNativeAudioNodeAudioParamValue=(tt,et,nt)=>{const rt=et[nt];rt!==void 0&&rt!==tt[nt].value&&(tt[nt].value=rt)},wrapAudioBufferSourceNodeStartMethodConsecutiveCalls=tt=>{tt.start=(et=>{let nt=!1;return(rt=0,it=0,ot)=>{if(nt)throw createInvalidStateError();et.call(tt,rt,it,ot),nt=!0}})(tt.start)},wrapAudioScheduledSourceNodeStartMethodNegativeParameters=tt=>{tt.start=(et=>(nt=0,rt=0,it)=>{if(typeof it=="number"&&it<0||rt<0||nt<0)throw new RangeError("The parameters can't be negative.");et.call(tt,nt,rt,it)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodNegativeParameters=tt=>{tt.stop=(et=>(nt=0)=>{if(nt<0)throw new RangeError("The parameter can't be negative.");et.call(tt,nt)})(tt.stop)},createNativeAudioBufferSourceNodeFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=ht.createBufferSource();return assignNativeAudioNodeOptions(pt,dt),assignNativeAudioNodeAudioParamValue(pt,dt,"playbackRate"),assignNativeAudioNodeOption(pt,dt,"buffer"),assignNativeAudioNodeOption(pt,dt,"loop"),assignNativeAudioNodeOption(pt,dt,"loopEnd"),assignNativeAudioNodeOption(pt,dt,"loopStart"),et(nt,()=>nt(ht))||wrapAudioBufferSourceNodeStartMethodConsecutiveCalls(pt),et(rt,()=>rt(ht))||lt(pt),et(it,()=>it(ht))||ct(pt,ht),et(ot,()=>ot(ht))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(pt),et(at,()=>at(ht))||ut(pt,ht),et(st,()=>st(ht))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(pt),tt(ht,pt),pt},createNativeAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioContext")?tt.AudioContext:tt.hasOwnProperty("webkitAudioContext")?tt.webkitAudioContext:null,createNativeAudioDestinationNodeFactory=(tt,et)=>(nt,rt,it)=>{const ot=nt.destination;if(ot.channelCount!==rt)try{ot.channelCount=rt}catch{}it&&ot.channelCountMode!=="explicit"&&(ot.channelCountMode="explicit"),ot.maxChannelCount===0&&Object.defineProperty(ot,"maxChannelCount",{value:rt});const at=tt(nt,{channelCount:rt,channelCountMode:ot.channelCountMode,channelInterpretation:ot.channelInterpretation,gain:1});return et(at,"channelCount",st=>()=>st.call(at),st=>lt=>{st.call(at,lt);try{ot.channelCount=lt}catch(ct){if(lt>ot.maxChannelCount)throw ct}}),et(at,"channelCountMode",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelCountMode=lt}),et(at,"channelInterpretation",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelInterpretation=lt}),Object.defineProperty(at,"maxChannelCount",{get:()=>ot.maxChannelCount}),at.connect(ot),at},createNativeAudioWorkletNodeConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioWorkletNode")?tt.AudioWorkletNode:null,testClonabilityOfAudioWorkletNodeOptions=tt=>{const{port1:et}=new MessageChannel;try{et.postMessage(tt)}finally{et.close()}},createNativeAudioWorkletNodeFactory=(tt,et,nt,rt,it)=>(ot,at,st,lt,ct,ut)=>{if(st!==null)try{const ht=new st(ot,lt,ut),dt=new Map;let pt=null;if(Object.defineProperties(ht,{channelCount:{get:()=>ut.channelCount,set:()=>{throw tt()}},channelCountMode:{get:()=>"explicit",set:()=>{throw tt()}},onprocessorerror:{get:()=>pt,set:mt=>{typeof pt=="function"&&ht.removeEventListener("processorerror",pt),pt=typeof mt=="function"?mt:null,typeof pt=="function"&&ht.addEventListener("processorerror",pt)}}}),ht.addEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const yt=typeof gt[1]=="function"?gt[1]:typeof gt[1]=="object"&>[1]!==null&&typeof gt[1].handleEvent=="function"?gt[1].handleEvent:null;if(yt!==null){const bt=dt.get(gt[1]);bt!==void 0?gt[1]=bt:(gt[1]=wt=>{wt.type==="error"?(Object.defineProperties(wt,{type:{value:"processorerror"}}),yt(wt)):yt(new ErrorEvent(gt[0],{...wt}))},dt.set(yt,gt[1]))}}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,...gt)})(ht.addEventListener),ht.removeEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const yt=dt.get(gt[1]);yt!==void 0&&(dt.delete(gt[1]),gt[1]=yt)}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,gt[0],gt[1],gt[2])})(ht.removeEventListener),ut.numberOfOutputs!==0){const mt=nt(ot,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return ht.connect(mt).connect(ot.destination),it(ht,()=>mt.disconnect(),()=>mt.connect(ot.destination))}return ht}catch(ht){throw ht.code===11?rt():ht}if(ct===void 0)throw rt();return testClonabilityOfAudioWorkletNodeOptions(ut),et(ot,at,ct,ut)},computeBufferSize=(tt,et)=>tt===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(tt*et))))),cloneAudioWorkletNodeOptions=tt=>new Promise((et,nt)=>{const{port1:rt,port2:it}=new MessageChannel;rt.onmessage=({data:ot})=>{rt.close(),it.close(),et(ot)},rt.onmessageerror=({data:ot})=>{rt.close(),it.close(),nt(ot)},it.postMessage(tt)}),createAudioWorkletProcessorPromise=async(tt,et)=>{const nt=await cloneAudioWorkletNodeOptions(et);return new tt(nt)},createAudioWorkletProcessor=(tt,et,nt,rt)=>{let it=NODE_TO_PROCESSOR_MAPS.get(tt);it===void 0&&(it=new WeakMap,NODE_TO_PROCESSOR_MAPS.set(tt,it));const ot=createAudioWorkletProcessorPromise(nt,rt);return it.set(et,ot),ot},createNativeAudioWorkletNodeFakerFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,yt)=>{if(yt.numberOfInputs===0&&yt.numberOfOutputs===0)throw lt();const bt=Array.isArray(yt.outputChannelCount)?yt.outputChannelCount:Array.from(yt.outputChannelCount);if(bt.some($n=>$n<1))throw lt();if(bt.length!==yt.numberOfOutputs)throw et();if(yt.channelCountMode!=="explicit")throw lt();const wt=yt.channelCount*yt.numberOfInputs,xt=bt.reduce(($n,Nn)=>$n+Nn,0),kt=gt.parameterDescriptors===void 0?0:gt.parameterDescriptors.length;if(wt+kt>6||xt>6)throw lt();const St=new MessageChannel,Tt=[],At=[];for(let $n=0;$n$n===void 0?0:$n},maxValue:{get:()=>Nn===void 0?MOST_POSITIVE_SINGLE_FLOAT:Nn},minValue:{get:()=>En===void 0?MOST_NEGATIVE_SINGLE_FLOAT:En}}),Et.push(pn)}const Ct=rt(pt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,wt+kt)}),Lt=computeBufferSize(mt,pt.sampleRate),jt=st(pt,Lt,wt+kt,Math.max(1,xt)),Rt=it(pt,{channelCount:Math.max(1,xt),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,xt)}),$t=[];for(let $n=0;$n{const En=Et[Nn];return En.connect(Ct,0,wt+Nn),En.start(0),[$n,En.offset]}));Ct.connect(jt);let It=yt.channelInterpretation,Ot=null;const Wt=yt.numberOfOutputs===0?[jt]:$t,zt={get bufferSize(){return Lt},get channelCount(){return yt.channelCount},set channelCount($n){throw nt()},get channelCountMode(){return yt.channelCountMode},set channelCountMode($n){throw nt()},get channelInterpretation(){return It},set channelInterpretation($n){for(const Nn of Tt)Nn.channelInterpretation=$n;It=$n},get context(){return jt.context},get inputs(){return Tt},get numberOfInputs(){return yt.numberOfInputs},get numberOfOutputs(){return yt.numberOfOutputs},get onprocessorerror(){return Ot},set onprocessorerror($n){typeof Ot=="function"&&zt.removeEventListener("processorerror",Ot),Ot=typeof $n=="function"?$n:null,typeof Ot=="function"&&zt.addEventListener("processorerror",Ot)},get parameters(){return vt},get port(){return St.port2},addEventListener(...$n){return jt.addEventListener($n[0],$n[1],$n[2])},connect:tt.bind(null,Wt),disconnect:ct.bind(null,Wt),dispatchEvent(...$n){return jt.dispatchEvent($n[0])},removeEventListener(...$n){return jt.removeEventListener($n[0],$n[1],$n[2])}},Ft=new Map;St.port1.addEventListener=($n=>(...Nn)=>{if(Nn[0]==="message"){const En=typeof Nn[1]=="function"?Nn[1]:typeof Nn[1]=="object"&&Nn[1]!==null&&typeof Nn[1].handleEvent=="function"?Nn[1].handleEvent:null;if(En!==null){const sn=Ft.get(Nn[1]);sn!==void 0?Nn[1]=sn:(Nn[1]=pn=>{ut(pt.currentTime,pt.sampleRate,()=>En(pn))},Ft.set(En,Nn[1]))}}return $n.call(St.port1,Nn[0],Nn[1],Nn[2])})(St.port1.addEventListener),St.port1.removeEventListener=($n=>(...Nn)=>{if(Nn[0]==="message"){const En=Ft.get(Nn[1]);En!==void 0&&(Ft.delete(Nn[1]),Nn[1]=En)}return $n.call(St.port1,Nn[0],Nn[1],Nn[2])})(St.port1.removeEventListener);let Nt=null;Object.defineProperty(St.port1,"onmessage",{get:()=>Nt,set:$n=>{typeof Nt=="function"&&St.port1.removeEventListener("message",Nt),Nt=typeof $n=="function"?$n:null,typeof Nt=="function"&&(St.port1.addEventListener("message",Nt),St.port1.start())}}),gt.prototype.port=St.port1;let Ut=null;createAudioWorkletProcessor(pt,zt,gt,yt).then($n=>Ut=$n);const Ht=createNestedArrays(yt.numberOfInputs,yt.channelCount),Qt=createNestedArrays(yt.numberOfOutputs,bt),an=gt.parameterDescriptors===void 0?[]:gt.parameterDescriptors.reduce(($n,{name:Nn})=>({...$n,[Nn]:new Float32Array(128)}),{});let Yt=!0;const nn=()=>{yt.numberOfOutputs>0&&jt.disconnect(Rt);for(let $n=0,Nn=0;$n{if(Ut!==null){const En=ht(zt);for(let sn=0;sn{copyFromChannel($n,an,pn,wt+Tn,sn)});for(let pn=0;pn{if(En[yn].size>0)return tn.set(yn,Lt/128),In;const fn=tn.get(yn);return fn===void 0?[]:(In.every(xn=>xn.every(jn=>jn===0))&&(fn===1?tn.delete(yn):tn.set(yn,fn-1)),In)});Yt=ut(pt.currentTime+sn/pt.sampleRate,pt.sampleRate,()=>Ut.process(pn,Qt,an));for(let In=0,yn=0;Injt.connect(wn).connect(pt.destination),Zt=()=>{jt.disconnect(wn),wn.disconnect()},vn=()=>{if(Yt){Zt(),yt.numberOfOutputs>0&&jt.connect(Rt);for(let $n=0,Nn=0;$n{Yt&&(rn(),nn()),dn=!1};return rn(),dt(zt,vn,Cn)},createNativeBiquadFilterNode=(tt,et)=>{const nt=tt.createBiquadFilter();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"Q"),assignNativeAudioNodeAudioParamValue(nt,et,"detune"),assignNativeAudioNodeAudioParamValue(nt,et,"frequency"),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),assignNativeAudioNodeOption(nt,et,"type"),nt},createNativeChannelMergerNodeFactory=(tt,et)=>(nt,rt)=>{const it=nt.createChannelMerger(rt.numberOfInputs);return tt!==null&&tt.name==="webkitAudioContext"&&et(nt,it),assignNativeAudioNodeOptions(it,rt),it},wrapChannelSplitterNode=tt=>{const et=tt.numberOfOutputs;Object.defineProperty(tt,"channelCount",{get:()=>et,set:nt=>{if(nt!==et)throw createInvalidStateError()}}),Object.defineProperty(tt,"channelCountMode",{get:()=>"explicit",set:nt=>{if(nt!=="explicit")throw createInvalidStateError()}}),Object.defineProperty(tt,"channelInterpretation",{get:()=>"discrete",set:nt=>{if(nt!=="discrete")throw createInvalidStateError()}})},createNativeChannelSplitterNode=(tt,et)=>{const nt=tt.createChannelSplitter(et.numberOfOutputs);return assignNativeAudioNodeOptions(nt,et),wrapChannelSplitterNode(nt),nt},createNativeConstantSourceNodeFactory=(tt,et,nt,rt,it)=>(ot,at)=>{if(ot.createConstantSource===void 0)return nt(ot,at);const st=ot.createConstantSource();return assignNativeAudioNodeOptions(st,at),assignNativeAudioNodeAudioParamValue(st,at,"offset"),et(rt,()=>rt(ot))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(st),et(it,()=>it(ot))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(st),tt(ot,st),st},interceptConnections=(tt,et)=>(tt.connect=et.connect.bind(et),tt.disconnect=et.disconnect.bind(et),tt),createNativeConstantSourceNodeFakerFactory=(tt,et,nt,rt)=>(it,{offset:ot,...at})=>{const st=it.createBuffer(1,2,44100),lt=et(it,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),ct=nt(it,{...at,gain:ot}),ut=st.getChannelData(0);ut[0]=1,ut[1]=1,lt.buffer=st,lt.loop=!0;const ht={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(mt){ct.channelCount=mt},get channelCountMode(){return ct.channelCountMode},set channelCountMode(mt){ct.channelCountMode=mt},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(mt){ct.channelInterpretation=mt},get context(){return ct.context},get inputs(){return[]},get numberOfInputs(){return lt.numberOfInputs},get numberOfOutputs(){return ct.numberOfOutputs},get offset(){return ct.gain},get onended(){return lt.onended},set onended(mt){lt.onended=mt},addEventListener(...mt){return lt.addEventListener(mt[0],mt[1],mt[2])},dispatchEvent(...mt){return lt.dispatchEvent(mt[0])},removeEventListener(...mt){return lt.removeEventListener(mt[0],mt[1],mt[2])},start(mt=0){lt.start.call(lt,mt)},stop(mt=0){lt.stop.call(lt,mt)}},dt=()=>lt.connect(ct),pt=()=>lt.disconnect(ct);return tt(it,lt),rt(interceptConnections(ht,ct),dt,pt)},createNativeConvolverNodeFactory=(tt,et)=>(nt,rt)=>{const it=nt.createConvolver();if(assignNativeAudioNodeOptions(it,rt),rt.disableNormalization===it.normalize&&(it.normalize=!rt.disableNormalization),assignNativeAudioNodeOption(it,rt,"buffer"),rt.channelCount>2||(et(it,"channelCount",ot=>()=>ot.call(it),ot=>at=>{if(at>2)throw tt();return ot.call(it,at)}),rt.channelCountMode==="max"))throw tt();return et(it,"channelCountMode",ot=>()=>ot.call(it),ot=>at=>{if(at==="max")throw tt();return ot.call(it,at)}),it},createNativeDelayNode=(tt,et)=>{const nt=tt.createDelay(et.maxDelayTime);return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"delayTime"),nt},createNativeDynamicsCompressorNodeFactory=tt=>(et,nt)=>{const rt=et.createDynamicsCompressor();if(assignNativeAudioNodeOptions(rt,nt),nt.channelCount>2||nt.channelCountMode==="max")throw tt();return assignNativeAudioNodeAudioParamValue(rt,nt,"attack"),assignNativeAudioNodeAudioParamValue(rt,nt,"knee"),assignNativeAudioNodeAudioParamValue(rt,nt,"ratio"),assignNativeAudioNodeAudioParamValue(rt,nt,"release"),assignNativeAudioNodeAudioParamValue(rt,nt,"threshold"),rt},createNativeGainNode=(tt,et)=>{const nt=tt.createGain();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),nt},createNativeIIRFilterNodeFactory=tt=>(et,nt,rt)=>{if(et.createIIRFilter===void 0)return tt(et,nt,rt);const it=et.createIIRFilter(rt.feedforward,rt.feedback);return assignNativeAudioNodeOptions(it,rt),it};function divide$1(tt,et){const nt=et[0]*et[0]+et[1]*et[1];return[(tt[0]*et[0]+tt[1]*et[1])/nt,(tt[1]*et[0]-tt[0]*et[1])/nt]}function multiply(tt,et){return[tt[0]*et[0]-tt[1]*et[1],tt[0]*et[1]+tt[1]*et[0]]}function evaluatePolynomial(tt,et){let nt=[0,0];for(let rt=tt.length-1;rt>=0;rt-=1)nt=multiply(nt,et),nt[0]+=tt[rt];return nt}const createNativeIIRFilterNodeFakerFactory=(tt,et,nt,rt)=>(it,ot,{channelCount:at,channelCountMode:st,channelInterpretation:lt,feedback:ct,feedforward:ut})=>{const ht=computeBufferSize(ot,it.sampleRate),dt=ct instanceof Float64Array?ct:new Float64Array(ct),pt=ut instanceof Float64Array?ut:new Float64Array(ut),mt=dt.length,gt=pt.length,yt=Math.min(mt,gt);if(mt===0||mt>20)throw rt();if(dt[0]===0)throw et();if(gt===0||gt>20)throw rt();if(pt[0]===0)throw et();if(dt[0]!==1){for(let Et=0;Et{const Ct=Et.inputBuffer,Lt=Et.outputBuffer,jt=Ct.numberOfChannels;for(let Rt=0;Rttt.createMediaElementSource(et.mediaElement),createNativeMediaStreamAudioDestinationNode=(tt,et)=>{const nt=tt.createMediaStreamDestination();return assignNativeAudioNodeOptions(nt,et),nt.numberOfOutputs===1&&Object.defineProperty(nt,"numberOfOutputs",{get:()=>0}),nt},createNativeMediaStreamAudioSourceNode=(tt,{mediaStream:et})=>{const nt=et.getAudioTracks();nt.sort((ot,at)=>ot.idat.id?1:0);const rt=nt.slice(0,1),it=tt.createMediaStreamSource(new MediaStream(rt));return Object.defineProperty(it,"mediaStream",{value:et}),it},createNativeMediaStreamTrackAudioSourceNodeFactory=(tt,et)=>(nt,{mediaStreamTrack:rt})=>{if(typeof nt.createMediaStreamTrackSource=="function")return nt.createMediaStreamTrackSource(rt);const it=new MediaStream([rt]),ot=nt.createMediaStreamSource(it);if(rt.kind!=="audio")throw tt();if(et(nt))throw new TypeError;return ot},createNativeOfflineAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("OfflineAudioContext")?tt.OfflineAudioContext:tt.hasOwnProperty("webkitOfflineAudioContext")?tt.webkitOfflineAudioContext:null,createNativeOscillatorNodeFactory=(tt,et,nt,rt,it,ot)=>(at,st)=>{const lt=at.createOscillator();return assignNativeAudioNodeOptions(lt,st),assignNativeAudioNodeAudioParamValue(lt,st,"detune"),assignNativeAudioNodeAudioParamValue(lt,st,"frequency"),st.periodicWave!==void 0?lt.setPeriodicWave(st.periodicWave):assignNativeAudioNodeOption(lt,st,"type"),et(nt,()=>nt(at))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(lt),et(rt,()=>rt(at))||ot(lt,at),et(it,()=>it(at))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(lt),tt(at,lt),lt},createNativePannerNodeFactory=tt=>(et,nt)=>{const rt=et.createPanner();return rt.orientationX===void 0?tt(et,nt):(assignNativeAudioNodeOptions(rt,nt),assignNativeAudioNodeAudioParamValue(rt,nt,"orientationX"),assignNativeAudioNodeAudioParamValue(rt,nt,"orientationY"),assignNativeAudioNodeAudioParamValue(rt,nt,"orientationZ"),assignNativeAudioNodeAudioParamValue(rt,nt,"positionX"),assignNativeAudioNodeAudioParamValue(rt,nt,"positionY"),assignNativeAudioNodeAudioParamValue(rt,nt,"positionZ"),assignNativeAudioNodeOption(rt,nt,"coneInnerAngle"),assignNativeAudioNodeOption(rt,nt,"coneOuterAngle"),assignNativeAudioNodeOption(rt,nt,"coneOuterGain"),assignNativeAudioNodeOption(rt,nt,"distanceModel"),assignNativeAudioNodeOption(rt,nt,"maxDistance"),assignNativeAudioNodeOption(rt,nt,"panningModel"),assignNativeAudioNodeOption(rt,nt,"refDistance"),assignNativeAudioNodeOption(rt,nt,"rolloffFactor"),rt)},createNativePannerNodeFakerFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct)=>(ut,{coneInnerAngle:ht,coneOuterAngle:dt,coneOuterGain:pt,distanceModel:mt,maxDistance:gt,orientationX:yt,orientationY:bt,orientationZ:wt,panningModel:xt,positionX:kt,positionY:St,positionZ:Tt,refDistance:At,rolloffFactor:Et,...Ct})=>{const Lt=ut.createPanner();if(Ct.channelCount>2||Ct.channelCountMode==="max")throw at();assignNativeAudioNodeOptions(Lt,Ct);const jt={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},Rt=nt(ut,{...jt,channelInterpretation:"speakers",numberOfInputs:6}),$t=rt(ut,{...Ct,gain:1}),vt=rt(ut,{...jt,gain:1}),It=rt(ut,{...jt,gain:0}),Ot=rt(ut,{...jt,gain:0}),Wt=rt(ut,{...jt,gain:0}),zt=rt(ut,{...jt,gain:0}),Ft=rt(ut,{...jt,gain:0}),Nt=it(ut,256,6,1),Ut=ot(ut,{...jt,curve:new Float32Array([1,1]),oversample:"none"});let Pt=[yt,bt,wt],Ht=[kt,St,Tt];const Qt=new Float32Array(1);Nt.onaudioprocess=({inputBuffer:tn})=>{const dn=[lt(tn,Qt,0),lt(tn,Qt,1),lt(tn,Qt,2)];dn.some((rn,Zt)=>rn!==Pt[Zt])&&(Lt.setOrientation(...dn),Pt=dn);const wn=[lt(tn,Qt,3),lt(tn,Qt,4),lt(tn,Qt,5)];wn.some((rn,Zt)=>rn!==Ht[Zt])&&(Lt.setPosition(...wn),Ht=wn)},Object.defineProperty(It.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Ot.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Wt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(zt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Ft.gain,"defaultValue",{get:()=>0});const an={get bufferSize(){},get channelCount(){return Lt.channelCount},set channelCount(tn){if(tn>2)throw at();$t.channelCount=tn,Lt.channelCount=tn},get channelCountMode(){return Lt.channelCountMode},set channelCountMode(tn){if(tn==="max")throw at();$t.channelCountMode=tn,Lt.channelCountMode=tn},get channelInterpretation(){return Lt.channelInterpretation},set channelInterpretation(tn){$t.channelInterpretation=tn,Lt.channelInterpretation=tn},get coneInnerAngle(){return Lt.coneInnerAngle},set coneInnerAngle(tn){Lt.coneInnerAngle=tn},get coneOuterAngle(){return Lt.coneOuterAngle},set coneOuterAngle(tn){Lt.coneOuterAngle=tn},get coneOuterGain(){return Lt.coneOuterGain},set coneOuterGain(tn){if(tn<0||tn>1)throw et();Lt.coneOuterGain=tn},get context(){return Lt.context},get distanceModel(){return Lt.distanceModel},set distanceModel(tn){Lt.distanceModel=tn},get inputs(){return[$t]},get maxDistance(){return Lt.maxDistance},set maxDistance(tn){if(tn<0)throw new RangeError;Lt.maxDistance=tn},get numberOfInputs(){return Lt.numberOfInputs},get numberOfOutputs(){return Lt.numberOfOutputs},get orientationX(){return vt.gain},get orientationY(){return It.gain},get orientationZ(){return Ot.gain},get panningModel(){return Lt.panningModel},set panningModel(tn){Lt.panningModel=tn},get positionX(){return Wt.gain},get positionY(){return zt.gain},get positionZ(){return Ft.gain},get refDistance(){return Lt.refDistance},set refDistance(tn){if(tn<0)throw new RangeError;Lt.refDistance=tn},get rolloffFactor(){return Lt.rolloffFactor},set rolloffFactor(tn){if(tn<0)throw new RangeError;Lt.rolloffFactor=tn},addEventListener(...tn){return $t.addEventListener(tn[0],tn[1],tn[2])},dispatchEvent(...tn){return $t.dispatchEvent(tn[0])},removeEventListener(...tn){return $t.removeEventListener(tn[0],tn[1],tn[2])}};ht!==an.coneInnerAngle&&(an.coneInnerAngle=ht),dt!==an.coneOuterAngle&&(an.coneOuterAngle=dt),pt!==an.coneOuterGain&&(an.coneOuterGain=pt),mt!==an.distanceModel&&(an.distanceModel=mt),gt!==an.maxDistance&&(an.maxDistance=gt),yt!==an.orientationX.value&&(an.orientationX.value=yt),bt!==an.orientationY.value&&(an.orientationY.value=bt),wt!==an.orientationZ.value&&(an.orientationZ.value=wt),xt!==an.panningModel&&(an.panningModel=xt),kt!==an.positionX.value&&(an.positionX.value=kt),St!==an.positionY.value&&(an.positionY.value=St),Tt!==an.positionZ.value&&(an.positionZ.value=Tt),At!==an.refDistance&&(an.refDistance=At),Et!==an.rolloffFactor&&(an.rolloffFactor=Et),(Pt[0]!==1||Pt[1]!==0||Pt[2]!==0)&&Lt.setOrientation(...Pt),(Ht[0]!==0||Ht[1]!==0||Ht[2]!==0)&&Lt.setPosition(...Ht);const Yt=()=>{$t.connect(Lt),tt($t,Ut,0,0),Ut.connect(vt).connect(Rt,0,0),Ut.connect(It).connect(Rt,0,1),Ut.connect(Ot).connect(Rt,0,2),Ut.connect(Wt).connect(Rt,0,3),Ut.connect(zt).connect(Rt,0,4),Ut.connect(Ft).connect(Rt,0,5),Rt.connect(Nt).connect(ut.destination)},nn=()=>{$t.disconnect(Lt),st($t,Ut,0,0),Ut.disconnect(vt),vt.disconnect(Rt),Ut.disconnect(It),It.disconnect(Rt),Ut.disconnect(Ot),Ot.disconnect(Rt),Ut.disconnect(Wt),Wt.disconnect(Rt),Ut.disconnect(zt),zt.disconnect(Rt),Ut.disconnect(Ft),Ft.disconnect(Rt),Rt.disconnect(Nt),Nt.disconnect(ut.destination)};return ct(interceptConnections(an,Lt),Yt,nn)},createNativePeriodicWaveFactory=tt=>(et,{disableNormalization:nt,imag:rt,real:it})=>{const ot=rt instanceof Float32Array?rt:new Float32Array(rt),at=it instanceof Float32Array?it:new Float32Array(it),st=et.createPeriodicWave(at,ot,{disableNormalization:nt});if(Array.from(rt).length<2)throw tt();return st},createNativeScriptProcessorNode=(tt,et,nt,rt)=>tt.createScriptProcessor(et,nt,rt),createNativeStereoPannerNodeFactory=(tt,et)=>(nt,rt)=>{const it=rt.channelCountMode;if(it==="clamped-max")throw et();if(nt.createStereoPanner===void 0)return tt(nt,rt);const ot=nt.createStereoPanner();return assignNativeAudioNodeOptions(ot,rt),assignNativeAudioNodeAudioParamValue(ot,rt,"pan"),Object.defineProperty(ot,"channelCountMode",{get:()=>it,set:at=>{if(at!==it)throw et()}}),ot},createNativeStereoPannerNodeFakerFactory=(tt,et,nt,rt,it,ot)=>{const st=new Float32Array([1,1]),lt=Math.PI/2,ct={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},ut={...ct,oversample:"none"},ht=(mt,gt,yt,bt)=>{const wt=new Float32Array(16385),xt=new Float32Array(16385);for(let Ct=0;Ct<16385;Ct+=1){const Lt=Ct/16384*lt;wt[Ct]=Math.cos(Lt),xt[Ct]=Math.sin(Lt)}const kt=nt(mt,{...ct,gain:0}),St=rt(mt,{...ut,curve:wt}),Tt=rt(mt,{...ut,curve:st}),At=nt(mt,{...ct,gain:0}),Et=rt(mt,{...ut,curve:xt});return{connectGraph(){gt.connect(kt),gt.connect(Tt.inputs===void 0?Tt:Tt.inputs[0]),gt.connect(At),Tt.connect(yt),yt.connect(St.inputs===void 0?St:St.inputs[0]),yt.connect(Et.inputs===void 0?Et:Et.inputs[0]),St.connect(kt.gain),Et.connect(At.gain),kt.connect(bt,0,0),At.connect(bt,0,1)},disconnectGraph(){gt.disconnect(kt),gt.disconnect(Tt.inputs===void 0?Tt:Tt.inputs[0]),gt.disconnect(At),Tt.disconnect(yt),yt.disconnect(St.inputs===void 0?St:St.inputs[0]),yt.disconnect(Et.inputs===void 0?Et:Et.inputs[0]),St.disconnect(kt.gain),Et.disconnect(At.gain),kt.disconnect(bt,0,0),At.disconnect(bt,0,1)}}},dt=(mt,gt,yt,bt)=>{const wt=new Float32Array(16385),xt=new Float32Array(16385),kt=new Float32Array(16385),St=new Float32Array(16385),Tt=Math.floor(16385/2);for(let Wt=0;Wt<16385;Wt+=1)if(Wt>Tt){const zt=(Wt-Tt)/(16384-Tt)*lt;wt[Wt]=Math.cos(zt),xt[Wt]=Math.sin(zt),kt[Wt]=0,St[Wt]=1}else{const zt=Wt/(16384-Tt)*lt;wt[Wt]=1,xt[Wt]=0,kt[Wt]=Math.cos(zt),St[Wt]=Math.sin(zt)}const At=et(mt,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),Et=nt(mt,{...ct,gain:0}),Ct=rt(mt,{...ut,curve:wt}),Lt=nt(mt,{...ct,gain:0}),jt=rt(mt,{...ut,curve:xt}),Rt=rt(mt,{...ut,curve:st}),$t=nt(mt,{...ct,gain:0}),vt=rt(mt,{...ut,curve:kt}),It=nt(mt,{...ct,gain:0}),Ot=rt(mt,{...ut,curve:St});return{connectGraph(){gt.connect(At),gt.connect(Rt.inputs===void 0?Rt:Rt.inputs[0]),At.connect(Et,0),At.connect(Lt,0),At.connect($t,1),At.connect(It,1),Rt.connect(yt),yt.connect(Ct.inputs===void 0?Ct:Ct.inputs[0]),yt.connect(jt.inputs===void 0?jt:jt.inputs[0]),yt.connect(vt.inputs===void 0?vt:vt.inputs[0]),yt.connect(Ot.inputs===void 0?Ot:Ot.inputs[0]),Ct.connect(Et.gain),jt.connect(Lt.gain),vt.connect($t.gain),Ot.connect(It.gain),Et.connect(bt,0,0),$t.connect(bt,0,0),Lt.connect(bt,0,1),It.connect(bt,0,1)},disconnectGraph(){gt.disconnect(At),gt.disconnect(Rt.inputs===void 0?Rt:Rt.inputs[0]),At.disconnect(Et,0),At.disconnect(Lt,0),At.disconnect($t,1),At.disconnect(It,1),Rt.disconnect(yt),yt.disconnect(Ct.inputs===void 0?Ct:Ct.inputs[0]),yt.disconnect(jt.inputs===void 0?jt:jt.inputs[0]),yt.disconnect(vt.inputs===void 0?vt:vt.inputs[0]),yt.disconnect(Ot.inputs===void 0?Ot:Ot.inputs[0]),Ct.disconnect(Et.gain),jt.disconnect(Lt.gain),vt.disconnect($t.gain),Ot.disconnect(It.gain),Et.disconnect(bt,0,0),$t.disconnect(bt,0,0),Lt.disconnect(bt,0,1),It.disconnect(bt,0,1)}}},pt=(mt,gt,yt,bt,wt)=>{if(gt===1)return ht(mt,yt,bt,wt);if(gt===2)return dt(mt,yt,bt,wt);throw it()};return(mt,{channelCount:gt,channelCountMode:yt,pan:bt,...wt})=>{if(yt==="max")throw it();const xt=tt(mt,{...wt,channelCount:1,channelCountMode:yt,numberOfInputs:2}),kt=nt(mt,{...wt,channelCount:gt,channelCountMode:yt,gain:1}),St=nt(mt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:bt});let{connectGraph:Tt,disconnectGraph:At}=pt(mt,gt,kt,St,xt);Object.defineProperty(St.gain,"defaultValue",{get:()=>0}),Object.defineProperty(St.gain,"maxValue",{get:()=>1}),Object.defineProperty(St.gain,"minValue",{get:()=>-1});const Et={get bufferSize(){},get channelCount(){return kt.channelCount},set channelCount(Rt){kt.channelCount!==Rt&&(Ct&&At(),{connectGraph:Tt,disconnectGraph:At}=pt(mt,Rt,kt,St,xt),Ct&&Tt()),kt.channelCount=Rt},get channelCountMode(){return kt.channelCountMode},set channelCountMode(Rt){if(Rt==="clamped-max"||Rt==="max")throw it();kt.channelCountMode=Rt},get channelInterpretation(){return kt.channelInterpretation},set channelInterpretation(Rt){kt.channelInterpretation=Rt},get context(){return kt.context},get inputs(){return[kt]},get numberOfInputs(){return kt.numberOfInputs},get numberOfOutputs(){return kt.numberOfOutputs},get pan(){return St.gain},addEventListener(...Rt){return kt.addEventListener(Rt[0],Rt[1],Rt[2])},dispatchEvent(...Rt){return kt.dispatchEvent(Rt[0])},removeEventListener(...Rt){return kt.removeEventListener(Rt[0],Rt[1],Rt[2])}};let Ct=!1;const Lt=()=>{Tt(),Ct=!0},jt=()=>{At(),Ct=!1};return ot(interceptConnections(Et,xt),Lt,jt)}},createNativeWaveShaperNodeFactory=(tt,et,nt,rt,it,ot,at)=>(st,lt)=>{const ct=st.createWaveShaper();if(ot!==null&&ot.name==="webkitAudioContext"&&st.createGain().gain.automationRate===void 0)return nt(st,lt);assignNativeAudioNodeOptions(ct,lt);const ut=lt.curve===null||lt.curve instanceof Float32Array?lt.curve:new Float32Array(lt.curve);if(ut!==null&&ut.length<2)throw et();assignNativeAudioNodeOption(ct,{curve:ut},"curve"),assignNativeAudioNodeOption(ct,lt,"oversample");let ht=null,dt=!1;return at(ct,"curve",gt=>()=>gt.call(ct),gt=>yt=>(gt.call(ct,yt),dt&&(rt(yt)&&ht===null?ht=tt(st,ct):!rt(yt)&&ht!==null&&(ht(),ht=null)),yt)),it(ct,()=>{dt=!0,rt(ct.curve)&&(ht=tt(st,ct))},()=>{dt=!1,ht!==null&&(ht(),ht=null)})},createNativeWaveShaperNodeFakerFactory=(tt,et,nt,rt,it)=>(ot,{curve:at,oversample:st,...lt})=>{const ct=ot.createWaveShaper(),ut=ot.createWaveShaper();assignNativeAudioNodeOptions(ct,lt),assignNativeAudioNodeOptions(ut,lt);const ht=nt(ot,{...lt,gain:1}),dt=nt(ot,{...lt,gain:-1}),pt=nt(ot,{...lt,gain:1}),mt=nt(ot,{...lt,gain:-1});let gt=null,yt=!1,bt=null;const wt={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(St){ht.channelCount=St,dt.channelCount=St,ct.channelCount=St,pt.channelCount=St,ut.channelCount=St,mt.channelCount=St},get channelCountMode(){return ct.channelCountMode},set channelCountMode(St){ht.channelCountMode=St,dt.channelCountMode=St,ct.channelCountMode=St,pt.channelCountMode=St,ut.channelCountMode=St,mt.channelCountMode=St},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(St){ht.channelInterpretation=St,dt.channelInterpretation=St,ct.channelInterpretation=St,pt.channelInterpretation=St,ut.channelInterpretation=St,mt.channelInterpretation=St},get context(){return ct.context},get curve(){return bt},set curve(St){if(St!==null&&St.length<2)throw et();if(St===null)ct.curve=St,ut.curve=St;else{const Tt=St.length,At=new Float32Array(Tt+2-Tt%2),Et=new Float32Array(Tt+2-Tt%2);At[0]=St[0],Et[0]=-St[Tt-1];const Ct=Math.ceil((Tt+1)/2),Lt=(Tt+1)/2-1;for(let jt=1;jt{ht.connect(ct).connect(pt),ht.connect(dt).connect(ut).connect(mt).connect(pt),yt=!0,rt(bt)&&(gt=tt(ot,ht))},kt=()=>{ht.disconnect(ct),ct.disconnect(pt),ht.disconnect(dt),dt.disconnect(ut),ut.disconnect(mt),mt.disconnect(pt),yt=!1,gt!==null&&(gt(),gt=null)};return it(interceptConnections(wt,pt),xt,kt)},createNotSupportedError=()=>new DOMException("","NotSupportedError"),DEFAULT_OPTIONS$6={numberOfChannels:1},createOfflineAudioContextConstructor=(tt,et,nt,rt,it)=>class extends tt{constructor(at,st,lt){let ct;if(typeof at=="number"&&st!==void 0&<!==void 0)ct={length:st,numberOfChannels:at,sampleRate:lt};else if(typeof at=="object")ct=at;else throw new Error("The given parameters are not valid.");const{length:ut,numberOfChannels:ht,sampleRate:dt}={...DEFAULT_OPTIONS$6,...ct},pt=rt(ht,ut,dt);et(testPromiseSupport,()=>testPromiseSupport(pt))||pt.addEventListener("statechange",(()=>{let mt=0;const gt=yt=>{this._state==="running"&&(mt>0?(pt.removeEventListener("statechange",gt),yt.stopImmediatePropagation(),this._waitForThePromiseToSettle(yt)):mt+=1)};return gt})()),super(pt,ht),this._length=ut,this._nativeOfflineAudioContext=pt,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(nt()):(this._state="running",it(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,deactivateAudioGraph(this)}))}_waitForThePromiseToSettle(at){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(at):setTimeout(()=>this._waitForThePromiseToSettle(at))}},DEFAULT_OPTIONS$5={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},createOscillatorNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$5,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?rt():null,gt=lt.sampleRate/2;super(lt,!1,dt,mt),this._detune=et(this,pt,dt.detune,153600,-153600),this._frequency=et(this,pt,dt.frequency,gt,-gt),this._nativeOscillatorNode=dt,this._onended=null,this._oscillatorNodeRenderer=mt,this._oscillatorNodeRenderer!==null&&ht.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=ht.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeOscillatorNode.onended=ct;const ut=this._nativeOscillatorNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}get type(){return this._nativeOscillatorNode.type}set type(lt){this._nativeOscillatorNode.type=lt,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(lt){this._nativeOscillatorNode.setPeriodicWave(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=lt)}start(lt=0){if(this._nativeOscillatorNode.start(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeOscillatorNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeOscillatorNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeOscillatorNode.stop(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=lt)}},createOscillatorNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap;let at=null,st=null,lt=null;const ct=async(ut,ht)=>{let dt=nt(ut);const pt=isOwnedByContext(dt,ht);if(!pt){const mt={channelCount:dt.channelCount,channelCountMode:dt.channelCountMode,channelInterpretation:dt.channelInterpretation,detune:dt.detune.value,frequency:dt.frequency.value,periodicWave:at===null?void 0:at,type:dt.type};dt=et(ht,mt),st!==null&&dt.start(st),lt!==null&&dt.stop(lt)}return ot.set(ht,dt),pt?(await tt(ht,ut.detune,dt.detune),await tt(ht,ut.frequency,dt.frequency)):(await rt(ht,ut.detune,dt.detune),await rt(ht,ut.frequency,dt.frequency)),await it(ut,ht,dt),dt};return{set periodicWave(ut){at=ut},set start(ut){st=ut},set stop(ut){lt=ut},render(ut,ht){const dt=ot.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},DEFAULT_OPTIONS$4={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},createPannerNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$4,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?rt():null;super(lt,!1,dt,mt),this._nativePannerNode=dt,this._orientationX=et(this,pt,dt.orientationX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationY=et(this,pt,dt.orientationY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationZ=et(this,pt,dt.orientationZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionX=et(this,pt,dt.positionX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionY=et(this,pt,dt.positionY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionZ=et(this,pt,dt.positionZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),at(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(lt){this._nativePannerNode.coneInnerAngle=lt}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(lt){this._nativePannerNode.coneOuterAngle=lt}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(lt){this._nativePannerNode.coneOuterGain=lt}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(lt){this._nativePannerNode.distanceModel=lt}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(lt){this._nativePannerNode.maxDistance=lt}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(lt){this._nativePannerNode.panningModel=lt}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(lt){this._nativePannerNode.refDistance=lt}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(lt){this._nativePannerNode.rolloffFactor=lt}},createPannerNodeRendererFactory=(tt,et,nt,rt,it,ot,at,st,lt,ct)=>()=>{const ut=new WeakMap;let ht=null;const dt=async(pt,mt)=>{let gt=null,yt=ot(pt);const bt={channelCount:yt.channelCount,channelCountMode:yt.channelCountMode,channelInterpretation:yt.channelInterpretation},wt={...bt,coneInnerAngle:yt.coneInnerAngle,coneOuterAngle:yt.coneOuterAngle,coneOuterGain:yt.coneOuterGain,distanceModel:yt.distanceModel,maxDistance:yt.maxDistance,panningModel:yt.panningModel,refDistance:yt.refDistance,rolloffFactor:yt.rolloffFactor},xt=isOwnedByContext(yt,mt);if("bufferSize"in yt)gt=rt(mt,{...bt,gain:1});else if(!xt){const kt={...wt,orientationX:yt.orientationX.value,orientationY:yt.orientationY.value,orientationZ:yt.orientationZ.value,positionX:yt.positionX.value,positionY:yt.positionY.value,positionZ:yt.positionZ.value};yt=it(mt,kt)}if(ut.set(mt,gt===null?yt:gt),gt!==null){if(ht===null){if(at===null)throw new Error("Missing the native OfflineAudioContext constructor.");const jt=new at(6,pt.context.length,mt.sampleRate),Rt=et(jt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});Rt.connect(jt.destination),ht=(async()=>{const $t=await Promise.all([pt.orientationX,pt.orientationY,pt.orientationZ,pt.positionX,pt.positionY,pt.positionZ].map(async(vt,It)=>{const Ot=nt(jt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:It===0?1:0});return await st(jt,vt,Ot.offset),Ot}));for(let vt=0;vt<6;vt+=1)$t[vt].connect(Rt,0,vt),$t[vt].start(0);return ct(jt)})()}const kt=await ht,St=rt(mt,{...bt,gain:1});await lt(pt,mt,St);const Tt=[];for(let jt=0;jtvt!==At[It])||$t.some((vt,It)=>vt!==Et[It])){At=Rt,Et=$t;const vt=jt/mt.sampleRate;Ct.gain.setValueAtTime(0,vt),Ct=rt(mt,{...bt,gain:0}),Lt=it(mt,{...wt,orientationX:At[0],orientationY:At[1],orientationZ:At[2],positionX:Et[0],positionY:Et[1],positionZ:Et[2]}),Ct.gain.setValueAtTime(1,vt),St.connect(Ct).connect(Lt.inputs[0]),Lt.connect(gt)}}return gt}return xt?(await tt(mt,pt.orientationX,yt.orientationX),await tt(mt,pt.orientationY,yt.orientationY),await tt(mt,pt.orientationZ,yt.orientationZ),await tt(mt,pt.positionX,yt.positionX),await tt(mt,pt.positionY,yt.positionY),await tt(mt,pt.positionZ,yt.positionZ)):(await st(mt,pt.orientationX,yt.orientationX),await st(mt,pt.orientationY,yt.orientationY),await st(mt,pt.orientationZ,yt.orientationZ),await st(mt,pt.positionX,yt.positionX),await st(mt,pt.positionY,yt.positionY),await st(mt,pt.positionZ,yt.positionZ)),isNativeAudioNodeFaker(yt)?await lt(pt,mt,yt.inputs[0]):await lt(pt,mt,yt),yt};return{render(pt,mt){const gt=ut.get(mt);return gt!==void 0?Promise.resolve(gt):dt(pt,mt)}}},DEFAULT_OPTIONS$3={disableNormalization:!1},createPeriodicWaveConstructor=(tt,et,nt,rt)=>class ww{constructor(ot,at){const st=et(ot),lt=rt({...DEFAULT_OPTIONS$3,...at}),ct=tt(st,lt);return nt.add(ct),ct}static[Symbol.hasInstance](ot){return ot!==null&&typeof ot=="object"&&Object.getPrototypeOf(ot)===ww.prototype||nt.has(ot)}},createRenderAutomation=(tt,et)=>(nt,rt,it)=>(tt(rt).replay(it),et(rt,nt,it)),createRenderInputsOfAudioNode=(tt,et,nt)=>async(rt,it,ot)=>{const at=tt(rt);await Promise.all(at.activeInputs.map((st,lt)=>Array.from(st).map(async([ct,ut])=>{const dt=await et(ct).render(ct,it),pt=rt.context.destination;!nt(ct)&&(rt!==pt||!nt(rt))&&dt.connect(ot,ut,lt)})).reduce((st,lt)=>[...st,...lt],[]))},createRenderInputsOfAudioParam=(tt,et,nt)=>async(rt,it,ot)=>{const at=et(rt);await Promise.all(Array.from(at.activeInputs).map(async([st,lt])=>{const ut=await tt(st).render(st,it);nt(st)||ut.connect(ot,lt)}))},createRenderNativeOfflineAudioContext=(tt,et,nt,rt)=>it=>tt(testPromiseSupport,()=>testPromiseSupport(it))?Promise.resolve(tt(rt,rt)).then(ot=>{if(!ot){const at=nt(it,512,0,1);it.oncomplete=()=>{at.onaudioprocess=null,at.disconnect()},at.onaudioprocess=()=>it.currentTime,at.connect(it.destination)}return it.startRendering()}):new Promise(ot=>{const at=et(it,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});it.oncomplete=st=>{at.disconnect(),ot(st.renderedBuffer)},at.connect(it.destination),it.startRendering()}),createSetActiveAudioWorkletNodeInputs=tt=>(et,nt)=>{tt.set(et,nt)},createSetAudioNodeTailTime=tt=>(et,nt)=>tt.set(et,nt),createStartRendering=(tt,et,nt,rt,it,ot,at,st)=>(lt,ct)=>nt(lt).render(lt,ct).then(()=>Promise.all(Array.from(rt(ct)).map(ut=>nt(ut).render(ut,ct)))).then(()=>it(ct)).then(ut=>(typeof ut.copyFromChannel!="function"?(at(ut),wrapAudioBufferGetChannelDataMethod(ut)):et(ot,()=>ot(ut))||st(ut),tt.add(ut),ut)),DEFAULT_OPTIONS$2={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},createStereoPannerNodeConstructor=(tt,et,nt,rt,it,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$2,...lt},ht=nt(ct,ut),dt=ot(ct),pt=dt?rt():null;super(st,!1,ht,pt),this._pan=et(this,dt,ht.pan)}get pan(){return this._pan}},createStereoPannerNodeRendererFactory=(tt,et,nt,rt,it)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,pan:ct.pan.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.pan,ct.pan):await rt(lt,st.pan,ct.pan),isNativeAudioNodeFaker(ct)?await it(st,lt,ct.inputs[0]):await it(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createTestAudioBufferConstructorSupport=tt=>()=>{if(tt===null)return!1;try{new tt({length:1,sampleRate:44100})}catch{return!1}return!0},createTestAudioWorkletProcessorPostMessageSupport=(tt,et)=>async()=>{if(tt===null)return!0;if(et===null)return!1;const nt=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),rt=new et(1,128,44100),it=URL.createObjectURL(nt);let ot=!1,at=!1;try{await rt.audioWorklet.addModule(it);const st=new tt(rt,"a",{numberOfOutputs:0}),lt=rt.createOscillator();st.port.onmessage=()=>ot=!0,st.onprocessorerror=()=>at=!0,lt.connect(st),lt.start(0),await rt.startRendering(),await new Promise(ct=>setTimeout(ct))}catch{}finally{URL.revokeObjectURL(it)}return ot&&!at},createTestOfflineAudioContextCurrentTimeSupport=(tt,et)=>()=>{if(et===null)return Promise.resolve(!1);const nt=new et(1,1,44100),rt=tt(nt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(it=>{nt.oncomplete=()=>{rt.disconnect(),it(nt.currentTime!==0)},nt.startRendering()})},createUnknownError=()=>new DOMException("","UnknownError"),DEFAULT_OPTIONS$1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},createWaveShaperNodeConstructor=(tt,et,nt,rt,it,ot,at)=>class extends tt{constructor(lt,ct){const ut=it(lt),ht={...DEFAULT_OPTIONS$1,...ct},dt=nt(ut,ht),mt=ot(ut)?rt():null;super(lt,!0,dt,mt),this._isCurveNullified=!1,this._nativeWaveShaperNode=dt,at(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(lt){if(lt===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(lt.length<2)throw et();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=lt}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(lt){this._nativeWaveShaperNode.oversample=lt}},createWaveShaperNodeRendererFactory=(tt,et,nt)=>()=>{const rt=new WeakMap,it=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,curve:st.curve,oversample:st.oversample};st=tt(at,ct)}return rt.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=rt.get(at);return st!==void 0?Promise.resolve(st):it(ot,at)}}},createWindow=()=>typeof window>"u"?null:window,createWrapAudioBufferCopyChannelMethods=(tt,et)=>nt=>{nt.copyFromChannel=(rt,it,ot=0)=>{const at=tt(ot),st=tt(it);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=rt.length;for(let ht=at<0?-at:0;ht+at{const at=tt(ot),st=tt(it);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=rt.length;for(let ht=at<0?-at:0;ht+atet=>{et.copyFromChannel=(nt=>(rt,it,ot=0)=>{const at=tt(ot),st=tt(it);if(at(rt,it,ot=0)=>{const at=tt(ot),st=tt(it);if(at(et,nt)=>{const rt=nt.createBuffer(1,1,44100);et.buffer===null&&(et.buffer=rt),tt(et,"buffer",it=>()=>{const ot=it.call(et);return ot===rt?null:ot},it=>ot=>it.call(et,ot===null?rt:ot))},createWrapChannelMergerNode=(tt,et)=>(nt,rt)=>{rt.channelCount=1,rt.channelCountMode="explicit",Object.defineProperty(rt,"channelCount",{get:()=>1,set:()=>{throw tt()}}),Object.defineProperty(rt,"channelCountMode",{get:()=>"explicit",set:()=>{throw tt()}});const it=nt.createBufferSource();et(rt,()=>{const st=rt.numberOfInputs;for(let lt=0;ltit.disconnect(rt))},getFirstSample=(tt,et,nt)=>tt.copyFromChannel===void 0?tt.getChannelData(nt)[0]:(tt.copyFromChannel(et,nt),et[0]),isDCCurve=tt=>{if(tt===null)return!1;const et=tt.length;return et%2!==0?tt[Math.floor(et/2)]!==0:tt[et/2-1]+tt[et/2]!==0},overwriteAccessors=(tt,et,nt,rt)=>{let it=tt;for(;!it.hasOwnProperty(et);)it=Object.getPrototypeOf(it);const{get:ot,set:at}=Object.getOwnPropertyDescriptor(it,et);Object.defineProperty(tt,et,{get:nt(ot),set:rt(at)})},sanitizeAudioWorkletNodeOptions=tt=>({...tt,outputChannelCount:tt.outputChannelCount!==void 0?tt.outputChannelCount:tt.numberOfInputs===1&&tt.numberOfOutputs===1?[tt.channelCount]:Array.from({length:tt.numberOfOutputs},()=>1)}),sanitizeChannelSplitterOptions=tt=>({...tt,channelCount:tt.numberOfOutputs}),sanitizePeriodicWaveOptions=tt=>{const{imag:et,real:nt}=tt;return et===void 0?nt===void 0?{...tt,imag:[0,0],real:[0,0]}:{...tt,imag:Array.from(nt,()=>0),real:nt}:nt===void 0?{...tt,imag:et,real:Array.from(et,()=>0)}:{...tt,imag:et,real:nt}},setValueAtTimeUntilPossible=(tt,et,nt)=>{try{tt.setValueAtTime(et,nt)}catch(rt){if(rt.code!==9)throw rt;setValueAtTimeUntilPossible(tt,et,nt+1e-7)}},testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.start()}catch{return!0}return!1},testAudioBufferSourceNodeStartMethodOffsetClampingSupport=tt=>{const et=tt.createBufferSource(),nt=tt.createBuffer(1,1,44100);et.buffer=nt;try{et.start(0,1)}catch{return!1}return!0},testAudioBufferSourceNodeStopMethodNullifiedBufferSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.stop()}catch{return!1}return!0},testAudioScheduledSourceNodeStartMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.start(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport=tt=>{const et=tt.createBuffer(1,1,44100),nt=tt.createBufferSource();nt.buffer=et,nt.start(),nt.stop();try{return nt.stop(),!0}catch{return!1}},testAudioScheduledSourceNodeStopMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.stop(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioWorkletNodeOptionsClonability=tt=>{const{port1:et,port2:nt}=new MessageChannel;try{et.postMessage(tt)}finally{et.close(),nt.close()}},wrapAudioBufferSourceNodeStartMethodOffsetClamping=tt=>{tt.start=(et=>(nt=0,rt=0,it)=>{const ot=tt.buffer,at=ot===null?rt:Math.min(ot.duration,rt);ot!==null&&at>ot.duration-.5/tt.context.sampleRate?et.call(tt,nt,0,0):et.call(tt,nt,at,it)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls=(tt,et)=>{const nt=et.createGain();tt.connect(nt);const rt=(it=>()=>{it.call(tt,nt),tt.removeEventListener("ended",rt)})(tt.disconnect);tt.addEventListener("ended",rt),interceptConnections(tt,nt),tt.stop=(it=>{let ot=!1;return(at=0)=>{if(ot)try{it.call(tt,at)}catch{nt.gain.setValueAtTime(0,at)}else it.call(tt,at),ot=!0}})(tt.stop)},wrapEventListener=(tt,et)=>nt=>{const rt={value:tt};return Object.defineProperties(nt,{currentTarget:rt,target:rt}),typeof et=="function"?et.call(tt,nt):et.handleEvent.call(tt,nt)},addActiveInputConnectionToAudioNode=createAddActiveInputConnectionToAudioNode(insertElementInSet),addPassiveInputConnectionToAudioNode=createAddPassiveInputConnectionToAudioNode(insertElementInSet),deleteActiveInputConnectionToAudioNode=createDeleteActiveInputConnectionToAudioNode(pickElementFromSet),audioNodeTailTimeStore=new WeakMap,getAudioNodeTailTime=createGetAudioNodeTailTime(audioNodeTailTimeStore),cacheTestResult=createCacheTestResult(new Map,new WeakMap),window$1=createWindow(),createNativeAnalyserNode=createNativeAnalyserNodeFactory(cacheTestResult,createIndexSizeError),getAudioNodeRenderer=createGetAudioNodeRenderer(getAudioNodeConnections),renderInputsOfAudioNode=createRenderInputsOfAudioNode(getAudioNodeConnections,getAudioNodeRenderer,isPartOfACycle),createAnalyserNodeRenderer=createAnalyserNodeRendererFactory(createNativeAnalyserNode,getNativeAudioNode,renderInputsOfAudioNode),getNativeContext=createGetNativeContext(CONTEXT_STORE),nativeOfflineAudioContextConstructor=createNativeOfflineAudioContextConstructor(window$1),isNativeOfflineAudioContext=createIsNativeOfflineAudioContext(nativeOfflineAudioContextConstructor),audioParamAudioNodeStore=new WeakMap,eventTargetConstructor=createEventTargetConstructor(wrapEventListener),nativeAudioContextConstructor=createNativeAudioContextConstructor(window$1),isNativeAudioContext=createIsNativeAudioContext(nativeAudioContextConstructor),isNativeAudioNode=createIsNativeAudioNode(window$1),isNativeAudioParam=createIsNativeAudioParam(window$1),nativeAudioWorkletNodeConstructor=createNativeAudioWorkletNodeConstructor(window$1),audioNodeConstructor=createAudioNodeConstructor(createAddAudioNodeConnections(AUDIO_NODE_CONNECTIONS_STORE),createAddConnectionToAudioNode(addActiveInputConnectionToAudioNode,addPassiveInputConnectionToAudioNode,connectNativeAudioNodeToNativeAudioNode,deleteActiveInputConnectionToAudioNode,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getAudioNodeTailTime,getEventListenersOfAudioNode,getNativeAudioNode,insertElementInSet,isActiveAudioNode,isPartOfACycle,isPassiveAudioNode),cacheTestResult,createIncrementCycleCounterFactory(CYCLE_COUNTERS,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,isActiveAudioNode),createIndexSizeError,createInvalidAccessError,createNotSupportedError,createDecrementCycleCounter(connectNativeAudioNodeToNativeAudioNode,CYCLE_COUNTERS,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,getNativeContext,isActiveAudioNode,isNativeOfflineAudioContext),createDetectCycles(audioParamAudioNodeStore,getAudioNodeConnections,getValueForKey),eventTargetConstructor,getNativeContext,isNativeAudioContext,isNativeAudioNode,isNativeAudioParam,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor),analyserNodeConstructor=createAnalyserNodeConstructor(audioNodeConstructor,createAnalyserNodeRenderer,createIndexSizeError,createNativeAnalyserNode,getNativeContext,isNativeOfflineAudioContext),audioBufferStore=new WeakSet,nativeAudioBufferConstructor=createNativeAudioBufferConstructor(window$1),convertNumberToUnsignedLong=createConvertNumberToUnsignedLong(new Uint32Array(1)),wrapAudioBufferCopyChannelMethods=createWrapAudioBufferCopyChannelMethods(convertNumberToUnsignedLong,createIndexSizeError),wrapAudioBufferCopyChannelMethodsOutOfBounds=createWrapAudioBufferCopyChannelMethodsOutOfBounds(convertNumberToUnsignedLong),audioBufferConstructor=createAudioBufferConstructor(audioBufferStore,cacheTestResult,createNotSupportedError,nativeAudioBufferConstructor,nativeOfflineAudioContextConstructor,createTestAudioBufferConstructorSupport(nativeAudioBufferConstructor),wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),addSilentConnection=createAddSilentConnection(createNativeGainNode),renderInputsOfAudioParam=createRenderInputsOfAudioParam(getAudioNodeRenderer,getAudioParamConnections,isPartOfACycle),connectAudioParam=createConnectAudioParam(renderInputsOfAudioParam),createNativeAudioBufferSourceNode=createNativeAudioBufferSourceNodeFactory(addSilentConnection,cacheTestResult,testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport,testAudioBufferSourceNodeStartMethodOffsetClampingSupport,testAudioBufferSourceNodeStopMethodNullifiedBufferSupport,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioBufferSourceNodeStartMethodOffsetClamping,createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer(overwriteAccessors),wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),renderAutomation=createRenderAutomation(createGetAudioParamRenderer(getAudioParamConnections),renderInputsOfAudioParam),createAudioBufferSourceNodeRenderer=createAudioBufferSourceNodeRendererFactory(connectAudioParam,createNativeAudioBufferSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),createAudioParam=createAudioParamFactory(createAddAudioParamConnections(AUDIO_PARAM_CONNECTIONS_STORE),audioParamAudioNodeStore,AUDIO_PARAM_STORE,createAudioParamRenderer,createCancelAndHoldAutomationEvent,createCancelScheduledValuesAutomationEvent,createExponentialRampToValueAutomationEvent,createLinearRampToValueAutomationEvent,createSetTargetAutomationEvent,createSetValueAutomationEvent,createSetValueCurveAutomationEvent,nativeAudioContextConstructor,setValueAtTimeUntilPossible),audioBufferSourceNodeConstructor=createAudioBufferSourceNodeConstructor(audioNodeConstructor,createAudioBufferSourceNodeRenderer,createAudioParam,createInvalidStateError,createNativeAudioBufferSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),audioDestinationNodeConstructor=createAudioDestinationNodeConstructor(audioNodeConstructor,createAudioDestinationNodeRenderer,createIndexSizeError,createInvalidStateError,createNativeAudioDestinationNodeFactory(createNativeGainNode,overwriteAccessors),getNativeContext,isNativeOfflineAudioContext,renderInputsOfAudioNode),createBiquadFilterNodeRenderer=createBiquadFilterNodeRendererFactory(connectAudioParam,createNativeBiquadFilterNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),setAudioNodeTailTime=createSetAudioNodeTailTime(audioNodeTailTimeStore),biquadFilterNodeConstructor=createBiquadFilterNodeConstructor(audioNodeConstructor,createAudioParam,createBiquadFilterNodeRenderer,createInvalidAccessError,createNativeBiquadFilterNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),monitorConnections=createMonitorConnections(insertElementInSet,isNativeAudioNode),wrapChannelMergerNode=createWrapChannelMergerNode(createInvalidStateError,monitorConnections),createNativeChannelMergerNode=createNativeChannelMergerNodeFactory(nativeAudioContextConstructor,wrapChannelMergerNode),createChannelMergerNodeRenderer=createChannelMergerNodeRendererFactory(createNativeChannelMergerNode,getNativeAudioNode,renderInputsOfAudioNode),channelMergerNodeConstructor=createChannelMergerNodeConstructor(audioNodeConstructor,createChannelMergerNodeRenderer,createNativeChannelMergerNode,getNativeContext,isNativeOfflineAudioContext),createChannelSplitterNodeRenderer=createChannelSplitterNodeRendererFactory(createNativeChannelSplitterNode,getNativeAudioNode,renderInputsOfAudioNode),channelSplitterNodeConstructor=createChannelSplitterNodeConstructor(audioNodeConstructor,createChannelSplitterNodeRenderer,createNativeChannelSplitterNode,getNativeContext,isNativeOfflineAudioContext,sanitizeChannelSplitterOptions),createNativeConstantSourceNodeFaker=createNativeConstantSourceNodeFakerFactory(addSilentConnection,createNativeAudioBufferSourceNode,createNativeGainNode,monitorConnections),createNativeConstantSourceNode=createNativeConstantSourceNodeFactory(addSilentConnection,cacheTestResult,createNativeConstantSourceNodeFaker,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport),createConstantSourceNodeRenderer=createConstantSourceNodeRendererFactory(connectAudioParam,createNativeConstantSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),constantSourceNodeConstructor=createConstantSourceNodeConstructor(audioNodeConstructor,createAudioParam,createConstantSourceNodeRenderer,createNativeConstantSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createNativeConvolverNode=createNativeConvolverNodeFactory(createNotSupportedError,overwriteAccessors),createConvolverNodeRenderer=createConvolverNodeRendererFactory(createNativeConvolverNode,getNativeAudioNode,renderInputsOfAudioNode),convolverNodeConstructor=createConvolverNodeConstructor(audioNodeConstructor,createConvolverNodeRenderer,createNativeConvolverNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createDelayNodeRenderer=createDelayNodeRendererFactory(connectAudioParam,createNativeDelayNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),delayNodeConstructor=createDelayNodeConstructor(audioNodeConstructor,createAudioParam,createDelayNodeRenderer,createNativeDelayNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativeDynamicsCompressorNode=createNativeDynamicsCompressorNodeFactory(createNotSupportedError),createDynamicsCompressorNodeRenderer=createDynamicsCompressorNodeRendererFactory(connectAudioParam,createNativeDynamicsCompressorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),dynamicsCompressorNodeConstructor=createDynamicsCompressorNodeConstructor(audioNodeConstructor,createAudioParam,createDynamicsCompressorNodeRenderer,createNativeDynamicsCompressorNode,createNotSupportedError,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createGainNodeRenderer=createGainNodeRendererFactory(connectAudioParam,createNativeGainNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),gainNodeConstructor=createGainNodeConstructor(audioNodeConstructor,createAudioParam,createGainNodeRenderer,createNativeGainNode,getNativeContext,isNativeOfflineAudioContext),createNativeIIRFilterNodeFaker=createNativeIIRFilterNodeFakerFactory(createInvalidAccessError,createInvalidStateError,createNativeScriptProcessorNode,createNotSupportedError),renderNativeOfflineAudioContext=createRenderNativeOfflineAudioContext(cacheTestResult,createNativeGainNode,createNativeScriptProcessorNode,createTestOfflineAudioContextCurrentTimeSupport(createNativeGainNode,nativeOfflineAudioContextConstructor)),createIIRFilterNodeRenderer=createIIRFilterNodeRendererFactory(createNativeAudioBufferSourceNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderInputsOfAudioNode,renderNativeOfflineAudioContext),createNativeIIRFilterNode=createNativeIIRFilterNodeFactory(createNativeIIRFilterNodeFaker),iIRFilterNodeConstructor=createIIRFilterNodeConstructor(audioNodeConstructor,createNativeIIRFilterNode,createIIRFilterNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createAudioListener=createAudioListenerFactory(createAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeScriptProcessorNode,createNotSupportedError,getFirstSample,isNativeOfflineAudioContext,overwriteAccessors),unrenderedAudioWorkletNodeStore=new WeakMap,minimalBaseAudioContextConstructor=createMinimalBaseAudioContextConstructor(audioDestinationNodeConstructor,createAudioListener,eventTargetConstructor,isNativeOfflineAudioContext,unrenderedAudioWorkletNodeStore,wrapEventListener),createNativeOscillatorNode=createNativeOscillatorNodeFactory(addSilentConnection,cacheTestResult,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),createOscillatorNodeRenderer=createOscillatorNodeRendererFactory(connectAudioParam,createNativeOscillatorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),oscillatorNodeConstructor=createOscillatorNodeConstructor(audioNodeConstructor,createAudioParam,createNativeOscillatorNode,createOscillatorNodeRenderer,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createConnectedNativeAudioBufferSourceNode=createConnectedNativeAudioBufferSourceNodeFactory(createNativeAudioBufferSourceNode),createNativeWaveShaperNodeFaker=createNativeWaveShaperNodeFakerFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeGainNode,isDCCurve,monitorConnections),createNativeWaveShaperNode=createNativeWaveShaperNodeFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeWaveShaperNodeFaker,isDCCurve,monitorConnections,nativeAudioContextConstructor,overwriteAccessors),createNativePannerNodeFaker=createNativePannerNodeFakerFactory(connectNativeAudioNodeToNativeAudioNode,createInvalidStateError,createNativeChannelMergerNode,createNativeGainNode,createNativeScriptProcessorNode,createNativeWaveShaperNode,createNotSupportedError,disconnectNativeAudioNodeFromNativeAudioNode,getFirstSample,monitorConnections),createNativePannerNode=createNativePannerNodeFactory(createNativePannerNodeFaker),createPannerNodeRenderer=createPannerNodeRendererFactory(connectAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeGainNode,createNativePannerNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),pannerNodeConstructor=createPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativePannerNode,createPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativePeriodicWave=createNativePeriodicWaveFactory(createIndexSizeError),periodicWaveConstructor=createPeriodicWaveConstructor(createNativePeriodicWave,getNativeContext,new WeakSet,sanitizePeriodicWaveOptions),nativeStereoPannerNodeFakerFactory=createNativeStereoPannerNodeFakerFactory(createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeGainNode,createNativeWaveShaperNode,createNotSupportedError,monitorConnections),createNativeStereoPannerNode=createNativeStereoPannerNodeFactory(nativeStereoPannerNodeFakerFactory,createNotSupportedError),createStereoPannerNodeRenderer=createStereoPannerNodeRendererFactory(connectAudioParam,createNativeStereoPannerNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),stereoPannerNodeConstructor=createStereoPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativeStereoPannerNode,createStereoPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext),createWaveShaperNodeRenderer=createWaveShaperNodeRendererFactory(createNativeWaveShaperNode,getNativeAudioNode,renderInputsOfAudioNode),waveShaperNodeConstructor=createWaveShaperNodeConstructor(audioNodeConstructor,createInvalidStateError,createNativeWaveShaperNode,createWaveShaperNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),isSecureContext=createIsSecureContext(window$1),exposeCurrentFrameAndCurrentTime=createExposeCurrentFrameAndCurrentTime(window$1),backupOfflineAudioContextStore=new WeakMap,getOrCreateBackupOfflineAudioContext=createGetOrCreateBackupOfflineAudioContext(backupOfflineAudioContextStore,nativeOfflineAudioContextConstructor),addAudioWorkletModule=isSecureContext?createAddAudioWorkletModule(cacheTestResult,createNotSupportedError,createEvaluateSource(window$1),exposeCurrentFrameAndCurrentTime,createFetchSource(createAbortError),getNativeContext,getOrCreateBackupOfflineAudioContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,new WeakMap,new WeakMap,createTestAudioWorkletProcessorPostMessageSupport(nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor),window$1):void 0,isNativeContext=createIsNativeContext(isNativeAudioContext,isNativeOfflineAudioContext),decodeAudioData=createDecodeAudioData(audioBufferStore,cacheTestResult,createDataCloneError,createEncodingError,new WeakSet,getNativeContext,isNativeContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,testPromiseSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),baseAudioContextConstructor=createBaseAudioContextConstructor(addAudioWorkletModule,analyserNodeConstructor,audioBufferConstructor,audioBufferSourceNodeConstructor,biquadFilterNodeConstructor,channelMergerNodeConstructor,channelSplitterNodeConstructor,constantSourceNodeConstructor,convolverNodeConstructor,decodeAudioData,delayNodeConstructor,dynamicsCompressorNodeConstructor,gainNodeConstructor,iIRFilterNodeConstructor,minimalBaseAudioContextConstructor,oscillatorNodeConstructor,pannerNodeConstructor,periodicWaveConstructor,stereoPannerNodeConstructor,waveShaperNodeConstructor),mediaElementAudioSourceNodeConstructor=createMediaElementAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaElementAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioDestinationNodeConstructor=createMediaStreamAudioDestinationNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioDestinationNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioSourceNodeConstructor=createMediaStreamAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),createNativeMediaStreamTrackAudioSourceNode=createNativeMediaStreamTrackAudioSourceNodeFactory(createInvalidStateError,isNativeOfflineAudioContext),mediaStreamTrackAudioSourceNodeConstructor=createMediaStreamTrackAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamTrackAudioSourceNode,getNativeContext),audioContextConstructor=createAudioContextConstructor(baseAudioContextConstructor,createInvalidStateError,createNotSupportedError,createUnknownError,mediaElementAudioSourceNodeConstructor,mediaStreamAudioDestinationNodeConstructor,mediaStreamAudioSourceNodeConstructor,mediaStreamTrackAudioSourceNodeConstructor,nativeAudioContextConstructor),getUnrenderedAudioWorkletNodes=createGetUnrenderedAudioWorkletNodes(unrenderedAudioWorkletNodeStore),addUnrenderedAudioWorkletNode=createAddUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),connectMultipleOutputs=createConnectMultipleOutputs(createIndexSizeError),deleteUnrenderedAudioWorkletNode=createDeleteUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),disconnectMultipleOutputs=createDisconnectMultipleOutputs(createIndexSizeError),activeAudioWorkletNodeInputsStore=new WeakMap,getActiveAudioWorkletNodeInputs=createGetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore,getValueForKey),createNativeAudioWorkletNodeFaker=createNativeAudioWorkletNodeFakerFactory(connectMultipleOutputs,createIndexSizeError,createInvalidStateError,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,createNativeScriptProcessorNode,createNotSupportedError,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getActiveAudioWorkletNodeInputs,monitorConnections),createNativeAudioWorkletNode=createNativeAudioWorkletNodeFactory(createInvalidStateError,createNativeAudioWorkletNodeFaker,createNativeGainNode,createNotSupportedError,monitorConnections),createAudioWorkletNodeRenderer=createAudioWorkletNodeRendererFactory(connectAudioParam,connectMultipleOutputs,createNativeAudioBufferSourceNode,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,deleteUnrenderedAudioWorkletNode,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getNativeAudioNode,nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),getBackupOfflineAudioContext=createGetBackupOfflineAudioContext(backupOfflineAudioContextStore),setActiveAudioWorkletNodeInputs=createSetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore),audioWorkletNodeConstructor=isSecureContext?createAudioWorkletNodeConstructor(addUnrenderedAudioWorkletNode,audioNodeConstructor,createAudioParam,createAudioWorkletNodeRenderer,createNativeAudioWorkletNode,getAudioNodeConnections,getBackupOfflineAudioContext,getNativeContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,sanitizeAudioWorkletNodeOptions,setActiveAudioWorkletNodeInputs,testAudioWorkletNodeOptionsClonability,wrapEventListener):void 0,createNativeOfflineAudioContext=createCreateNativeOfflineAudioContext(createNotSupportedError,nativeOfflineAudioContextConstructor),startRendering=createStartRendering(audioBufferStore,cacheTestResult,getAudioNodeRenderer,getUnrenderedAudioWorkletNodes,renderNativeOfflineAudioContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),offlineAudioContextConstructor=createOfflineAudioContextConstructor(baseAudioContextConstructor,cacheTestResult,createInvalidStateError,createNativeOfflineAudioContext,startRendering),isAnyAudioContext=createIsAnyAudioContext(CONTEXT_STORE,isNativeAudioContext),isAnyAudioNode=createIsAnyAudioNode(AUDIO_NODE_STORE,isNativeAudioNode),isAnyAudioParam=createIsAnyAudioParam(AUDIO_PARAM_STORE,isNativeAudioParam),isAnyOfflineAudioContext=createIsAnyOfflineAudioContext(CONTEXT_STORE,isNativeOfflineAudioContext);function isUndef(tt){return typeof tt>"u"}function isDefined(tt){return!isUndef(tt)}function isFunction$1(tt){return typeof tt=="function"}function isNumber$3(tt){return typeof tt=="number"}function isObject$6(tt){return Object.prototype.toString.call(tt)==="[object Object]"&&tt.constructor===Object}function isBoolean$1(tt){return typeof tt=="boolean"}function isArray$d(tt){return Array.isArray(tt)}function isString$1(tt){return typeof tt=="string"}function isNote(tt){return isString$1(tt)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(tt)}function assert(tt,et){if(!tt)throw new Error(et)}function assertRange(tt,et,nt=1/0){if(!(et<=tt&&tt<=nt))throw new RangeError(`Value must be within [${et}, ${nt}], got: ${tt}`)}function assertContextRunning(tt){!tt.isOffline&&tt.state!=="running"&&warn$1('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let isInsideScheduledCallback=!1,printedScheduledWarning=!1;function enterScheduledCallback(tt){isInsideScheduledCallback=tt}function assertUsedScheduleTime(tt){isUndef(tt)&&isInsideScheduledCallback&&!printedScheduledWarning&&(printedScheduledWarning=!0,warn$1("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let defaultLogger=console;function log$1(...tt){defaultLogger.log(...tt)}function warn$1(...tt){defaultLogger.warn(...tt)}function createAudioContext(tt){return new audioContextConstructor(tt)}function createOfflineAudioContext(tt,et,nt){return new offlineAudioContextConstructor(tt,et,nt)}const theWindow=typeof self=="object"?self:null,hasAudioContext=theWindow&&(theWindow.hasOwnProperty("AudioContext")||theWindow.hasOwnProperty("webkitAudioContext"));function createAudioWorkletNode(tt,et,nt){return assert(isDefined(audioWorkletNodeConstructor),"This node only works in a secure context (https or localhost)"),new audioWorkletNodeConstructor(tt,et,nt)}class Ticker{constructor(et,nt,rt,it){this._callback=et,this._type=nt,this._minimumUpdateInterval=Math.max(128/(it||44100),.001),this.updateInterval=rt,this._createClock()}_createWorker(){const et=new Blob([` // the initial timeout time let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; // onmessage callback @@ -4893,8 +4893,8 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co animation-iteration-count: infinite; animation-delay: 200ms; } -`),touchRippleClasses$1.rippleVisible,enterKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.ripplePulsate,({theme:tt})=>tt.transitions.duration.shorter,touchRippleClasses$1.child,touchRippleClasses$1.childLeaving,exitKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.childPulsate,pulsateKeyframe,({theme:tt})=>tt.transitions.easing.easeInOut),TouchRipple=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTouchRipple"}),{center:it=!1,classes:ot={},className:at}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$1t),[lt,ct]=reactExports.useState([]),ut=reactExports.useRef(0),ht=reactExports.useRef(null);reactExports.useEffect(()=>{ht.current&&(ht.current(),ht.current=null)},[lt]);const dt=reactExports.useRef(!1),pt=reactExports.useRef(0),mt=reactExports.useRef(null),gt=reactExports.useRef(null);reactExports.useEffect(()=>()=>{pt.current&&clearTimeout(pt.current)},[]);const yt=reactExports.useCallback(kt=>{const{pulsate:St,rippleX:Tt,rippleY:At,rippleSize:Et,cb:Ct}=kt;ct(Lt=>[...Lt,jsxRuntimeExports.jsx(TouchRippleRipple,{classes:{ripple:clsx$2(ot.ripple,touchRippleClasses$1.ripple),rippleVisible:clsx$2(ot.rippleVisible,touchRippleClasses$1.rippleVisible),ripplePulsate:clsx$2(ot.ripplePulsate,touchRippleClasses$1.ripplePulsate),child:clsx$2(ot.child,touchRippleClasses$1.child),childLeaving:clsx$2(ot.childLeaving,touchRippleClasses$1.childLeaving),childPulsate:clsx$2(ot.childPulsate,touchRippleClasses$1.childPulsate)},timeout:DURATION,pulsate:St,rippleX:Tt,rippleY:At,rippleSize:Et},ut.current)]),ut.current+=1,ht.current=Ct},[ot]),bt=reactExports.useCallback((kt={},St={},Tt=()=>{})=>{const{pulsate:At=!1,center:Et=it||St.pulsate,fakeElement:Ct=!1}=St;if((kt==null?void 0:kt.type)==="mousedown"&&dt.current){dt.current=!1;return}(kt==null?void 0:kt.type)==="touchstart"&&(dt.current=!0);const Lt=Ct?null:gt.current,jt=Lt?Lt.getBoundingClientRect():{width:0,height:0,left:0,top:0};let Rt,$t,vt;if(Et||kt===void 0||kt.clientX===0&&kt.clientY===0||!kt.clientX&&!kt.touches)Rt=Math.round(jt.width/2),$t=Math.round(jt.height/2);else{const{clientX:It,clientY:Ot}=kt.touches&&kt.touches.length>0?kt.touches[0]:kt;Rt=Math.round(It-jt.left),$t=Math.round(Ot-jt.top)}if(Et)vt=Math.sqrt((2*jt.width**2+jt.height**2)/3),vt%2===0&&(vt+=1);else{const It=Math.max(Math.abs((Lt?Lt.clientWidth:0)-Rt),Rt)*2+2,Ot=Math.max(Math.abs((Lt?Lt.clientHeight:0)-$t),$t)*2+2;vt=Math.sqrt(It**2+Ot**2)}kt!=null&&kt.touches?mt.current===null&&(mt.current=()=>{yt({pulsate:At,rippleX:Rt,rippleY:$t,rippleSize:vt,cb:Tt})},pt.current=setTimeout(()=>{mt.current&&(mt.current(),mt.current=null)},DELAY_RIPPLE)):yt({pulsate:At,rippleX:Rt,rippleY:$t,rippleSize:vt,cb:Tt})},[it,yt]),wt=reactExports.useCallback(()=>{bt({},{pulsate:!0})},[bt]),xt=reactExports.useCallback((kt,St)=>{if(clearTimeout(pt.current),(kt==null?void 0:kt.type)==="touchend"&&mt.current){mt.current(),mt.current=null,pt.current=setTimeout(()=>{xt(kt,St)});return}mt.current=null,ct(Tt=>Tt.length>0?Tt.slice(1):Tt),ht.current=St},[]);return reactExports.useImperativeHandle(nt,()=>({pulsate:wt,start:bt,stop:xt}),[wt,bt,xt]),jsxRuntimeExports.jsx(TouchRippleRoot,_extends$u({className:clsx$2(touchRippleClasses$1.root,ot.root,at),ref:gt},st,{children:jsxRuntimeExports.jsx(TransitionGroup$1,{component:null,exit:!0,children:lt})}))}),TouchRipple$1=TouchRipple;function getButtonBaseUtilityClass(tt){return generateUtilityClass("MuiButtonBase",tt)}const buttonBaseClasses=generateUtilityClasses("MuiButtonBase",["root","disabled","focusVisible"]),buttonBaseClasses$1=buttonBaseClasses,_excluded$1s=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],useUtilityClasses$U=tt=>{const{disabled:et,focusVisible:nt,focusVisibleClassName:rt,classes:it}=tt,at=composeClasses({root:["root",et&&"disabled",nt&&"focusVisible"]},getButtonBaseUtilityClass,it);return nt&&rt&&(at.root+=` ${rt}`),at},ButtonBaseRoot=styled$1("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${buttonBaseClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ButtonBase=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiButtonBase"}),{action:it,centerRipple:ot=!1,children:at,className:st,component:lt="button",disabled:ct=!1,disableRipple:ut=!1,disableTouchRipple:ht=!1,focusRipple:dt=!1,LinkComponent:pt="a",onBlur:mt,onClick:gt,onContextMenu:yt,onDragLeave:bt,onFocus:wt,onFocusVisible:xt,onKeyDown:kt,onKeyUp:St,onMouseDown:Tt,onMouseLeave:At,onMouseUp:Et,onTouchEnd:Ct,onTouchMove:Lt,onTouchStart:jt,tabIndex:Rt=0,TouchRippleProps:$t,touchRippleRef:vt,type:It}=rt,Ot=_objectWithoutPropertiesLoose$k(rt,_excluded$1s),Wt=reactExports.useRef(null),zt=reactExports.useRef(null),Ft=useForkRef(zt,vt),{isFocusVisibleRef:Nt,onFocus:Ut,onBlur:Pt,ref:Ht}=useIsFocusVisible(),[Qt,an]=reactExports.useState(!1);ct&&Qt&&an(!1),reactExports.useImperativeHandle(it,()=>({focusVisible:()=>{an(!0),Wt.current.focus()}}),[]);const[Yt,nn]=reactExports.useState(!1);reactExports.useEffect(()=>{nn(!0)},[]);const tn=Yt&&!ut&&!ct;reactExports.useEffect(()=>{Qt&&dt&&!ut&&Yt&&zt.current.pulsate()},[ut,dt,Qt,Yt]);function dn(Kt,kn,Mn=ht){return useEventCallback(On=>(kn&&kn(On),!Mn&&zt.current&&zt.current[Kt](On),!0))}const wn=dn("start",Tt),rn=dn("stop",yt),Jt=dn("stop",bt),vn=dn("stop",Et),Cn=dn("stop",Kt=>{Qt&&Kt.preventDefault(),At&&At(Kt)}),$n=dn("start",jt),Nn=dn("stop",Ct),En=dn("stop",Lt),sn=dn("stop",Kt=>{Pt(Kt),Nt.current===!1&&an(!1),mt&&mt(Kt)},!1),pn=useEventCallback(Kt=>{Wt.current||(Wt.current=Kt.currentTarget),Ut(Kt),Nt.current===!0&&(an(!0),xt&&xt(Kt)),wt&&wt(Kt)}),Tn=()=>{const Kt=Wt.current;return lt&<!=="button"&&!(Kt.tagName==="A"&&Kt.href)},In=reactExports.useRef(!1),yn=useEventCallback(Kt=>{dt&&!In.current&&Qt&&zt.current&&Kt.key===" "&&(In.current=!0,zt.current.stop(Kt,()=>{zt.current.start(Kt)})),Kt.target===Kt.currentTarget&&Tn()&&Kt.key===" "&&Kt.preventDefault(),kt&&kt(Kt),Kt.target===Kt.currentTarget&&Tn()&&Kt.key==="Enter"&&!ct&&(Kt.preventDefault(),gt&>(Kt))}),hn=useEventCallback(Kt=>{dt&&Kt.key===" "&&zt.current&&Qt&&!Kt.defaultPrevented&&(In.current=!1,zt.current.stop(Kt,()=>{zt.current.pulsate(Kt)})),St&&St(Kt),gt&&Kt.target===Kt.currentTarget&&Tn()&&Kt.key===" "&&!Kt.defaultPrevented&>(Kt)});let fn=lt;fn==="button"&&(Ot.href||Ot.to)&&(fn=pt);const xn={};fn==="button"?(xn.type=It===void 0?"button":It,xn.disabled=ct):(!Ot.href&&!Ot.to&&(xn.role="button"),ct&&(xn["aria-disabled"]=ct));const jn=useForkRef(nt,Ht,Wt),cn=_extends$u({},rt,{centerRipple:ot,component:lt,disabled:ct,disableRipple:ut,disableTouchRipple:ht,focusRipple:dt,tabIndex:Rt,focusVisible:Qt}),Xt=useUtilityClasses$U(cn);return jsxRuntimeExports.jsxs(ButtonBaseRoot,_extends$u({as:fn,className:clsx$2(Xt.root,st),ownerState:cn,onBlur:sn,onClick:gt,onContextMenu:rn,onFocus:pn,onKeyDown:yn,onKeyUp:hn,onMouseDown:wn,onMouseLeave:Cn,onMouseUp:vn,onDragLeave:Jt,onTouchEnd:Nn,onTouchMove:En,onTouchStart:$n,ref:jn,tabIndex:ct?-1:Rt,type:It},xn,Ot,{children:[at,tn?jsxRuntimeExports.jsx(TouchRipple$1,_extends$u({ref:Ft,center:ot},$t)):null]}))}),ButtonBase$1=ButtonBase;function getIconButtonUtilityClass(tt){return generateUtilityClass("MuiIconButton",tt)}const iconButtonClasses=generateUtilityClasses("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),iconButtonClasses$1=iconButtonClasses,_excluded$1r=["edge","children","className","color","disabled","disableFocusRipple","size"],useUtilityClasses$T=tt=>{const{classes:et,disabled:nt,color:rt,edge:it,size:ot}=tt,at={root:["root",nt&&"disabled",rt!=="default"&&`color${capitalize(rt)}`,it&&`edge${capitalize(it)}`,`size${capitalize(ot)}`]};return composeClasses(at,getIconButtonUtilityClass,et)},IconButtonRoot=styled$1(ButtonBase$1,{name:"MuiIconButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.color!=="default"&&et[`color${capitalize(nt.color)}`],nt.edge&&et[`edge${capitalize(nt.edge)}`],et[`size${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$u({textAlign:"center",flex:"0 0 auto",fontSize:tt.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(tt.vars||tt).palette.action.active,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shortest})},!et.disableRipple&&{"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},et.edge==="start"&&{marginLeft:et.size==="small"?-3:-12},et.edge==="end"&&{marginRight:et.size==="small"?-3:-12}),({theme:tt,ownerState:et})=>{var nt;const rt=(nt=(tt.vars||tt).palette)==null?void 0:nt[et.color];return _extends$u({},et.color==="inherit"&&{color:"inherit"},et.color!=="inherit"&&et.color!=="default"&&_extends$u({color:rt==null?void 0:rt.main},!et.disableRipple&&{"&:hover":_extends$u({},rt&&{backgroundColor:tt.vars?`rgba(${rt.mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(rt.main,tt.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),et.size==="small"&&{padding:5,fontSize:tt.typography.pxToRem(18)},et.size==="large"&&{padding:12,fontSize:tt.typography.pxToRem(28)},{[`&.${iconButtonClasses$1.disabled}`]:{backgroundColor:"transparent",color:(tt.vars||tt).palette.action.disabled}})}),IconButton=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiIconButton"}),{edge:it=!1,children:ot,className:at,color:st="default",disabled:lt=!1,disableFocusRipple:ct=!1,size:ut="medium"}=rt,ht=_objectWithoutPropertiesLoose$k(rt,_excluded$1r),dt=_extends$u({},rt,{edge:it,color:st,disabled:lt,disableFocusRipple:ct,size:ut}),pt=useUtilityClasses$T(dt);return jsxRuntimeExports.jsx(IconButtonRoot,_extends$u({className:clsx$2(pt.root,at),centerRipple:!0,focusRipple:!ct,disabled:lt,ref:nt,ownerState:dt},ht,{children:ot}))}),IconButton$1=IconButton;function getTypographyUtilityClass(tt){return generateUtilityClass("MuiTypography",tt)}generateUtilityClasses("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const _excluded$1q=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],useUtilityClasses$S=tt=>{const{align:et,gutterBottom:nt,noWrap:rt,paragraph:it,variant:ot,classes:at}=tt,st={root:["root",ot,tt.align!=="inherit"&&`align${capitalize(et)}`,nt&&"gutterBottom",rt&&"noWrap",it&&"paragraph"]};return composeClasses(st,getTypographyUtilityClass,at)},TypographyRoot=styled$1("span",{name:"MuiTypography",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.variant&&et[nt.variant],nt.align!=="inherit"&&et[`align${capitalize(nt.align)}`],nt.noWrap&&et.noWrap,nt.gutterBottom&&et.gutterBottom,nt.paragraph&&et.paragraph]}})(({theme:tt,ownerState:et})=>_extends$u({margin:0},et.variant==="inherit"&&{font:"inherit"},et.variant!=="inherit"&&tt.typography[et.variant],et.align!=="inherit"&&{textAlign:et.align},et.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},et.gutterBottom&&{marginBottom:"0.35em"},et.paragraph&&{marginBottom:16})),defaultVariantMapping={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},colorTransformations={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors=tt=>colorTransformations[tt]||tt,Typography=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTypography"}),it=transformDeprecatedColors(rt.color),ot=extendSxProp(_extends$u({},rt,{color:it})),{align:at="inherit",className:st,component:lt,gutterBottom:ct=!1,noWrap:ut=!1,paragraph:ht=!1,variant:dt="body1",variantMapping:pt=defaultVariantMapping}=ot,mt=_objectWithoutPropertiesLoose$k(ot,_excluded$1q),gt=_extends$u({},ot,{align:at,color:it,className:st,component:lt,gutterBottom:ct,noWrap:ut,paragraph:ht,variant:dt,variantMapping:pt}),yt=lt||(ht?"p":pt[dt]||defaultVariantMapping[dt])||"span",bt=useUtilityClasses$S(gt);return jsxRuntimeExports.jsx(TypographyRoot,_extends$u({as:yt,ref:nt,ownerState:gt,className:clsx$2(bt.root,st)},mt))}),Typography$1=Typography;function isHostComponent(tt){return typeof tt=="string"}function appendOwnerState(tt,et,nt){return tt===void 0||isHostComponent(tt)?et:_extends$u({},et,{ownerState:_extends$u({},et.ownerState,nt)})}function areArraysEqual$1(tt,et,nt=(rt,it)=>rt===it){return tt.length===et.length&&tt.every((rt,it)=>nt(rt,et[it]))}const defaultContextValue={disableDefaultClasses:!1},ClassNameConfiguratorContext=reactExports.createContext(defaultContextValue);function useClassNamesOverride(tt){const{disableDefaultClasses:et}=reactExports.useContext(ClassNameConfiguratorContext);return nt=>et?"":tt(nt)}function extractEventHandlers(tt,et=[]){if(tt===void 0)return{};const nt={};return Object.keys(tt).filter(rt=>rt.match(/^on[A-Z]/)&&typeof tt[rt]=="function"&&!et.includes(rt)).forEach(rt=>{nt[rt]=tt[rt]}),nt}function resolveComponentProps(tt,et,nt){return typeof tt=="function"?tt(et,nt):tt}function r$3(tt){var et,nt,rt="";if(typeof tt=="string"||typeof tt=="number")rt+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et!(nt.match(/^on[A-Z]/)&&typeof tt[nt]=="function")).forEach(nt=>{et[nt]=tt[nt]}),et}function mergeSlotProps(tt){const{getSlotProps:et,additionalProps:nt,externalSlotProps:rt,externalForwardedProps:it,className:ot}=tt;if(!et){const pt=clsx$1(nt==null?void 0:nt.className,ot,it==null?void 0:it.className,rt==null?void 0:rt.className),mt=_extends$u({},nt==null?void 0:nt.style,it==null?void 0:it.style,rt==null?void 0:rt.style),gt=_extends$u({},nt,it,rt);return pt.length>0&&(gt.className=pt),Object.keys(mt).length>0&&(gt.style=mt),{props:gt,internalRef:void 0}}const at=extractEventHandlers(_extends$u({},it,rt)),st=omitEventHandlers(rt),lt=omitEventHandlers(it),ct=et(at),ut=clsx$1(ct==null?void 0:ct.className,nt==null?void 0:nt.className,ot,it==null?void 0:it.className,rt==null?void 0:rt.className),ht=_extends$u({},ct==null?void 0:ct.style,nt==null?void 0:nt.style,it==null?void 0:it.style,rt==null?void 0:rt.style),dt=_extends$u({},ct,nt,lt,st);return ut.length>0&&(dt.className=ut),Object.keys(ht).length>0&&(dt.style=ht),{props:dt,internalRef:ct.ref}}const _excluded$1p=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function useSlotProps(tt){var et;const{elementType:nt,externalSlotProps:rt,ownerState:it,skipResolvingSlotProps:ot=!1}=tt,at=_objectWithoutPropertiesLoose$k(tt,_excluded$1p),st=ot?{}:resolveComponentProps(rt,it),{props:lt,internalRef:ct}=mergeSlotProps(_extends$u({},at,{externalSlotProps:st})),ut=useForkRef(ct,st==null?void 0:st.ref,(et=tt.additionalProps)==null?void 0:et.ref);return appendOwnerState(nt,_extends$u({},lt,{ref:ut}),it)}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(tt){const et=parseInt(tt.getAttribute("tabindex")||"",10);return Number.isNaN(et)?tt.contentEditable==="true"||(tt.nodeName==="AUDIO"||tt.nodeName==="VIDEO"||tt.nodeName==="DETAILS")&&tt.getAttribute("tabindex")===null?0:tt.tabIndex:et}function isNonTabbableRadio(tt){if(tt.tagName!=="INPUT"||tt.type!=="radio"||!tt.name)return!1;const et=rt=>tt.ownerDocument.querySelector(`input[type="radio"]${rt}`);let nt=et(`[name="${tt.name}"]:checked`);return nt||(nt=et(`[name="${tt.name}"]`)),nt!==tt}function isNodeMatchingSelectorFocusable(tt){return!(tt.disabled||tt.tagName==="INPUT"&&tt.type==="hidden"||isNonTabbableRadio(tt))}function defaultGetTabbable(tt){const et=[],nt=[];return Array.from(tt.querySelectorAll(candidatesSelector)).forEach((rt,it)=>{const ot=getTabIndex(rt);ot===-1||!isNodeMatchingSelectorFocusable(rt)||(ot===0?et.push(rt):nt.push({documentOrder:it,tabIndex:ot,node:rt}))}),nt.sort((rt,it)=>rt.tabIndex===it.tabIndex?rt.documentOrder-it.documentOrder:rt.tabIndex-it.tabIndex).map(rt=>rt.node).concat(et)}function defaultIsEnabled(){return!0}function FocusTrap(tt){const{children:et,disableAutoFocus:nt=!1,disableEnforceFocus:rt=!1,disableRestoreFocus:it=!1,getTabbable:ot=defaultGetTabbable,isEnabled:at=defaultIsEnabled,open:st}=tt,lt=reactExports.useRef(!1),ct=reactExports.useRef(null),ut=reactExports.useRef(null),ht=reactExports.useRef(null),dt=reactExports.useRef(null),pt=reactExports.useRef(!1),mt=reactExports.useRef(null),gt=useForkRef(et.ref,mt),yt=reactExports.useRef(null);reactExports.useEffect(()=>{!st||!mt.current||(pt.current=!nt)},[nt,st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const xt=ownerDocument(mt.current);return mt.current.contains(xt.activeElement)||(mt.current.hasAttribute("tabIndex")||mt.current.setAttribute("tabIndex","-1"),pt.current&&mt.current.focus()),()=>{it||(ht.current&&ht.current.focus&&(lt.current=!0,ht.current.focus()),ht.current=null)}},[st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const xt=ownerDocument(mt.current),kt=At=>{yt.current=At,!(rt||!at()||At.key!=="Tab")&&xt.activeElement===mt.current&&At.shiftKey&&(lt.current=!0,ut.current&&ut.current.focus())},St=()=>{const At=mt.current;if(At===null)return;if(!xt.hasFocus()||!at()||lt.current){lt.current=!1;return}if(At.contains(xt.activeElement)||rt&&xt.activeElement!==ct.current&&xt.activeElement!==ut.current)return;if(xt.activeElement!==dt.current)dt.current=null;else if(dt.current!==null)return;if(!pt.current)return;let Et=[];if((xt.activeElement===ct.current||xt.activeElement===ut.current)&&(Et=ot(mt.current)),Et.length>0){var Ct,Lt;const jt=!!((Ct=yt.current)!=null&&Ct.shiftKey&&((Lt=yt.current)==null?void 0:Lt.key)==="Tab"),Rt=Et[0],$t=Et[Et.length-1];typeof Rt!="string"&&typeof $t!="string"&&(jt?$t.focus():Rt.focus())}else At.focus()};xt.addEventListener("focusin",St),xt.addEventListener("keydown",kt,!0);const Tt=setInterval(()=>{xt.activeElement&&xt.activeElement.tagName==="BODY"&&St()},50);return()=>{clearInterval(Tt),xt.removeEventListener("focusin",St),xt.removeEventListener("keydown",kt,!0)}},[nt,rt,it,at,st,ot]);const bt=xt=>{ht.current===null&&(ht.current=xt.relatedTarget),pt.current=!0,dt.current=xt.target;const kt=et.props.onFocus;kt&&kt(xt)},wt=xt=>{ht.current===null&&(ht.current=xt.relatedTarget),pt.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ct,"data-testid":"sentinelStart"}),reactExports.cloneElement(et,{ref:gt,onFocus:bt}),jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ut,"data-testid":"sentinelEnd"})]})}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start$1="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(tt,et){return tt.concat([et+"-"+start$1,et+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(tt,et){return tt.concat([et,et+"-"+start$1,et+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(tt){return tt?(tt.nodeName||"").toLowerCase():null}function getWindow(tt){if(tt==null)return window;if(tt.toString()!=="[object Window]"){var et=tt.ownerDocument;return et&&et.defaultView||window}return tt}function isElement(tt){var et=getWindow(tt).Element;return tt instanceof et||tt instanceof Element}function isHTMLElement$1(tt){var et=getWindow(tt).HTMLElement;return tt instanceof et||tt instanceof HTMLElement}function isShadowRoot(tt){if(typeof ShadowRoot>"u")return!1;var et=getWindow(tt).ShadowRoot;return tt instanceof et||tt instanceof ShadowRoot}function applyStyles(tt){var et=tt.state;Object.keys(et.elements).forEach(function(nt){var rt=et.styles[nt]||{},it=et.attributes[nt]||{},ot=et.elements[nt];!isHTMLElement$1(ot)||!getNodeName(ot)||(Object.assign(ot.style,rt),Object.keys(it).forEach(function(at){var st=it[at];st===!1?ot.removeAttribute(at):ot.setAttribute(at,st===!0?"":st)}))})}function effect$2(tt){var et=tt.state,nt={popper:{position:et.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(et.elements.popper.style,nt.popper),et.styles=nt,et.elements.arrow&&Object.assign(et.elements.arrow.style,nt.arrow),function(){Object.keys(et.elements).forEach(function(rt){var it=et.elements[rt],ot=et.attributes[rt]||{},at=Object.keys(et.styles.hasOwnProperty(rt)?et.styles[rt]:nt[rt]),st=at.reduce(function(lt,ct){return lt[ct]="",lt},{});!isHTMLElement$1(it)||!getNodeName(it)||(Object.assign(it.style,st),Object.keys(ot).forEach(function(lt){it.removeAttribute(lt)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(tt){return tt.split("-")[0]}var max$2=Math.max,min$2=Math.min,round$1=Math.round;function getUAString(){var tt=navigator.userAgentData;return tt!=null&&tt.brands&&Array.isArray(tt.brands)?tt.brands.map(function(et){return et.brand+"/"+et.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(tt,et,nt){et===void 0&&(et=!1),nt===void 0&&(nt=!1);var rt=tt.getBoundingClientRect(),it=1,ot=1;et&&isHTMLElement$1(tt)&&(it=tt.offsetWidth>0&&round$1(rt.width)/tt.offsetWidth||1,ot=tt.offsetHeight>0&&round$1(rt.height)/tt.offsetHeight||1);var at=isElement(tt)?getWindow(tt):window,st=at.visualViewport,lt=!isLayoutViewport()&&nt,ct=(rt.left+(lt&&st?st.offsetLeft:0))/it,ut=(rt.top+(lt&&st?st.offsetTop:0))/ot,ht=rt.width/it,dt=rt.height/ot;return{width:ht,height:dt,top:ut,right:ct+ht,bottom:ut+dt,left:ct,x:ct,y:ut}}function getLayoutRect(tt){var et=getBoundingClientRect(tt),nt=tt.offsetWidth,rt=tt.offsetHeight;return Math.abs(et.width-nt)<=1&&(nt=et.width),Math.abs(et.height-rt)<=1&&(rt=et.height),{x:tt.offsetLeft,y:tt.offsetTop,width:nt,height:rt}}function contains(tt,et){var nt=et.getRootNode&&et.getRootNode();if(tt.contains(et))return!0;if(nt&&isShadowRoot(nt)){var rt=et;do{if(rt&&tt.isSameNode(rt))return!0;rt=rt.parentNode||rt.host}while(rt)}return!1}function getComputedStyle$1(tt){return getWindow(tt).getComputedStyle(tt)}function isTableElement(tt){return["table","td","th"].indexOf(getNodeName(tt))>=0}function getDocumentElement(tt){return((isElement(tt)?tt.ownerDocument:tt.document)||window.document).documentElement}function getParentNode(tt){return getNodeName(tt)==="html"?tt:tt.assignedSlot||tt.parentNode||(isShadowRoot(tt)?tt.host:null)||getDocumentElement(tt)}function getTrueOffsetParent(tt){return!isHTMLElement$1(tt)||getComputedStyle$1(tt).position==="fixed"?null:tt.offsetParent}function getContainingBlock(tt){var et=/firefox/i.test(getUAString()),nt=/Trident/i.test(getUAString());if(nt&&isHTMLElement$1(tt)){var rt=getComputedStyle$1(tt);if(rt.position==="fixed")return null}var it=getParentNode(tt);for(isShadowRoot(it)&&(it=it.host);isHTMLElement$1(it)&&["html","body"].indexOf(getNodeName(it))<0;){var ot=getComputedStyle$1(it);if(ot.transform!=="none"||ot.perspective!=="none"||ot.contain==="paint"||["transform","perspective"].indexOf(ot.willChange)!==-1||et&&ot.willChange==="filter"||et&&ot.filter&&ot.filter!=="none")return it;it=it.parentNode}return null}function getOffsetParent(tt){for(var et=getWindow(tt),nt=getTrueOffsetParent(tt);nt&&isTableElement(nt)&&getComputedStyle$1(nt).position==="static";)nt=getTrueOffsetParent(nt);return nt&&(getNodeName(nt)==="html"||getNodeName(nt)==="body"&&getComputedStyle$1(nt).position==="static")?et:nt||getContainingBlock(tt)||et}function getMainAxisFromPlacement(tt){return["top","bottom"].indexOf(tt)>=0?"x":"y"}function within(tt,et,nt){return max$2(tt,min$2(et,nt))}function withinMaxClamp(tt,et,nt){var rt=within(tt,et,nt);return rt>nt?nt:rt}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(tt){return Object.assign({},getFreshSideObject(),tt)}function expandToHashMap(tt,et){return et.reduce(function(nt,rt){return nt[rt]=tt,nt},{})}var toPaddingObject=function(et,nt){return et=typeof et=="function"?et(Object.assign({},nt.rects,{placement:nt.placement})):et,mergePaddingObject(typeof et!="number"?et:expandToHashMap(et,basePlacements))};function arrow(tt){var et,nt=tt.state,rt=tt.name,it=tt.options,ot=nt.elements.arrow,at=nt.modifiersData.popperOffsets,st=getBasePlacement(nt.placement),lt=getMainAxisFromPlacement(st),ct=[left,right].indexOf(st)>=0,ut=ct?"height":"width";if(!(!ot||!at)){var ht=toPaddingObject(it.padding,nt),dt=getLayoutRect(ot),pt=lt==="y"?top:left,mt=lt==="y"?bottom:right,gt=nt.rects.reference[ut]+nt.rects.reference[lt]-at[lt]-nt.rects.popper[ut],yt=at[lt]-nt.rects.reference[lt],bt=getOffsetParent(ot),wt=bt?lt==="y"?bt.clientHeight||0:bt.clientWidth||0:0,xt=gt/2-yt/2,kt=ht[pt],St=wt-dt[ut]-ht[mt],Tt=wt/2-dt[ut]/2+xt,At=within(kt,Tt,St),Et=lt;nt.modifiersData[rt]=(et={},et[Et]=At,et.centerOffset=At-Tt,et)}}function effect$1(tt){var et=tt.state,nt=tt.options,rt=nt.element,it=rt===void 0?"[data-popper-arrow]":rt;it!=null&&(typeof it=="string"&&(it=et.elements.popper.querySelector(it),!it)||contains(et.elements.popper,it)&&(et.elements.arrow=it))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(tt){return tt.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(tt,et){var nt=tt.x,rt=tt.y,it=et.devicePixelRatio||1;return{x:round$1(nt*it)/it||0,y:round$1(rt*it)/it||0}}function mapToStyles(tt){var et,nt=tt.popper,rt=tt.popperRect,it=tt.placement,ot=tt.variation,at=tt.offsets,st=tt.position,lt=tt.gpuAcceleration,ct=tt.adaptive,ut=tt.roundOffsets,ht=tt.isFixed,dt=at.x,pt=dt===void 0?0:dt,mt=at.y,gt=mt===void 0?0:mt,yt=typeof ut=="function"?ut({x:pt,y:gt}):{x:pt,y:gt};pt=yt.x,gt=yt.y;var bt=at.hasOwnProperty("x"),wt=at.hasOwnProperty("y"),xt=left,kt=top,St=window;if(ct){var Tt=getOffsetParent(nt),At="clientHeight",Et="clientWidth";if(Tt===getWindow(nt)&&(Tt=getDocumentElement(nt),getComputedStyle$1(Tt).position!=="static"&&st==="absolute"&&(At="scrollHeight",Et="scrollWidth")),Tt=Tt,it===top||(it===left||it===right)&&ot===end){kt=bottom;var Ct=ht&&Tt===St&&St.visualViewport?St.visualViewport.height:Tt[At];gt-=Ct-rt.height,gt*=lt?1:-1}if(it===left||(it===top||it===bottom)&&ot===end){xt=right;var Lt=ht&&Tt===St&&St.visualViewport?St.visualViewport.width:Tt[Et];pt-=Lt-rt.width,pt*=lt?1:-1}}var jt=Object.assign({position:st},ct&&unsetSides),Rt=ut===!0?roundOffsetsByDPR({x:pt,y:gt},getWindow(nt)):{x:pt,y:gt};if(pt=Rt.x,gt=Rt.y,lt){var $t;return Object.assign({},jt,($t={},$t[kt]=wt?"0":"",$t[xt]=bt?"0":"",$t.transform=(St.devicePixelRatio||1)<=1?"translate("+pt+"px, "+gt+"px)":"translate3d("+pt+"px, "+gt+"px, 0)",$t))}return Object.assign({},jt,(et={},et[kt]=wt?gt+"px":"",et[xt]=bt?pt+"px":"",et.transform="",et))}function computeStyles(tt){var et=tt.state,nt=tt.options,rt=nt.gpuAcceleration,it=rt===void 0?!0:rt,ot=nt.adaptive,at=ot===void 0?!0:ot,st=nt.roundOffsets,lt=st===void 0?!0:st,ct={placement:getBasePlacement(et.placement),variation:getVariation(et.placement),popper:et.elements.popper,popperRect:et.rects.popper,gpuAcceleration:it,isFixed:et.options.strategy==="fixed"};et.modifiersData.popperOffsets!=null&&(et.styles.popper=Object.assign({},et.styles.popper,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.popperOffsets,position:et.options.strategy,adaptive:at,roundOffsets:lt})))),et.modifiersData.arrow!=null&&(et.styles.arrow=Object.assign({},et.styles.arrow,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:lt})))),et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-placement":et.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(tt){var et=tt.state,nt=tt.instance,rt=tt.options,it=rt.scroll,ot=it===void 0?!0:it,at=rt.resize,st=at===void 0?!0:at,lt=getWindow(et.elements.popper),ct=[].concat(et.scrollParents.reference,et.scrollParents.popper);return ot&&ct.forEach(function(ut){ut.addEventListener("scroll",nt.update,passive)}),st&<.addEventListener("resize",nt.update,passive),function(){ot&&ct.forEach(function(ut){ut.removeEventListener("scroll",nt.update,passive)}),st&<.removeEventListener("resize",nt.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(tt){return tt.replace(/left|right|bottom|top/g,function(et){return hash$1[et]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(tt){return tt.replace(/start|end/g,function(et){return hash[et]})}function getWindowScroll(tt){var et=getWindow(tt),nt=et.pageXOffset,rt=et.pageYOffset;return{scrollLeft:nt,scrollTop:rt}}function getWindowScrollBarX(tt){return getBoundingClientRect(getDocumentElement(tt)).left+getWindowScroll(tt).scrollLeft}function getViewportRect(tt,et){var nt=getWindow(tt),rt=getDocumentElement(tt),it=nt.visualViewport,ot=rt.clientWidth,at=rt.clientHeight,st=0,lt=0;if(it){ot=it.width,at=it.height;var ct=isLayoutViewport();(ct||!ct&&et==="fixed")&&(st=it.offsetLeft,lt=it.offsetTop)}return{width:ot,height:at,x:st+getWindowScrollBarX(tt),y:lt}}function getDocumentRect(tt){var et,nt=getDocumentElement(tt),rt=getWindowScroll(tt),it=(et=tt.ownerDocument)==null?void 0:et.body,ot=max$2(nt.scrollWidth,nt.clientWidth,it?it.scrollWidth:0,it?it.clientWidth:0),at=max$2(nt.scrollHeight,nt.clientHeight,it?it.scrollHeight:0,it?it.clientHeight:0),st=-rt.scrollLeft+getWindowScrollBarX(tt),lt=-rt.scrollTop;return getComputedStyle$1(it||nt).direction==="rtl"&&(st+=max$2(nt.clientWidth,it?it.clientWidth:0)-ot),{width:ot,height:at,x:st,y:lt}}function isScrollParent(tt){var et=getComputedStyle$1(tt),nt=et.overflow,rt=et.overflowX,it=et.overflowY;return/auto|scroll|overlay|hidden/.test(nt+it+rt)}function getScrollParent(tt){return["html","body","#document"].indexOf(getNodeName(tt))>=0?tt.ownerDocument.body:isHTMLElement$1(tt)&&isScrollParent(tt)?tt:getScrollParent(getParentNode(tt))}function listScrollParents(tt,et){var nt;et===void 0&&(et=[]);var rt=getScrollParent(tt),it=rt===((nt=tt.ownerDocument)==null?void 0:nt.body),ot=getWindow(rt),at=it?[ot].concat(ot.visualViewport||[],isScrollParent(rt)?rt:[]):rt,st=et.concat(at);return it?st:st.concat(listScrollParents(getParentNode(at)))}function rectToClientRect(tt){return Object.assign({},tt,{left:tt.x,top:tt.y,right:tt.x+tt.width,bottom:tt.y+tt.height})}function getInnerBoundingClientRect(tt,et){var nt=getBoundingClientRect(tt,!1,et==="fixed");return nt.top=nt.top+tt.clientTop,nt.left=nt.left+tt.clientLeft,nt.bottom=nt.top+tt.clientHeight,nt.right=nt.left+tt.clientWidth,nt.width=tt.clientWidth,nt.height=tt.clientHeight,nt.x=nt.left,nt.y=nt.top,nt}function getClientRectFromMixedType(tt,et,nt){return et===viewport?rectToClientRect(getViewportRect(tt,nt)):isElement(et)?getInnerBoundingClientRect(et,nt):rectToClientRect(getDocumentRect(getDocumentElement(tt)))}function getClippingParents(tt){var et=listScrollParents(getParentNode(tt)),nt=["absolute","fixed"].indexOf(getComputedStyle$1(tt).position)>=0,rt=nt&&isHTMLElement$1(tt)?getOffsetParent(tt):tt;return isElement(rt)?et.filter(function(it){return isElement(it)&&contains(it,rt)&&getNodeName(it)!=="body"}):[]}function getClippingRect(tt,et,nt,rt){var it=et==="clippingParents"?getClippingParents(tt):[].concat(et),ot=[].concat(it,[nt]),at=ot[0],st=ot.reduce(function(lt,ct){var ut=getClientRectFromMixedType(tt,ct,rt);return lt.top=max$2(ut.top,lt.top),lt.right=min$2(ut.right,lt.right),lt.bottom=min$2(ut.bottom,lt.bottom),lt.left=max$2(ut.left,lt.left),lt},getClientRectFromMixedType(tt,at,rt));return st.width=st.right-st.left,st.height=st.bottom-st.top,st.x=st.left,st.y=st.top,st}function computeOffsets(tt){var et=tt.reference,nt=tt.element,rt=tt.placement,it=rt?getBasePlacement(rt):null,ot=rt?getVariation(rt):null,at=et.x+et.width/2-nt.width/2,st=et.y+et.height/2-nt.height/2,lt;switch(it){case top:lt={x:at,y:et.y-nt.height};break;case bottom:lt={x:at,y:et.y+et.height};break;case right:lt={x:et.x+et.width,y:st};break;case left:lt={x:et.x-nt.width,y:st};break;default:lt={x:et.x,y:et.y}}var ct=it?getMainAxisFromPlacement(it):null;if(ct!=null){var ut=ct==="y"?"height":"width";switch(ot){case start$1:lt[ct]=lt[ct]-(et[ut]/2-nt[ut]/2);break;case end:lt[ct]=lt[ct]+(et[ut]/2-nt[ut]/2);break}}return lt}function detectOverflow(tt,et){et===void 0&&(et={});var nt=et,rt=nt.placement,it=rt===void 0?tt.placement:rt,ot=nt.strategy,at=ot===void 0?tt.strategy:ot,st=nt.boundary,lt=st===void 0?clippingParents:st,ct=nt.rootBoundary,ut=ct===void 0?viewport:ct,ht=nt.elementContext,dt=ht===void 0?popper:ht,pt=nt.altBoundary,mt=pt===void 0?!1:pt,gt=nt.padding,yt=gt===void 0?0:gt,bt=mergePaddingObject(typeof yt!="number"?yt:expandToHashMap(yt,basePlacements)),wt=dt===popper?reference:popper,xt=tt.rects.popper,kt=tt.elements[mt?wt:dt],St=getClippingRect(isElement(kt)?kt:kt.contextElement||getDocumentElement(tt.elements.popper),lt,ut,at),Tt=getBoundingClientRect(tt.elements.reference),At=computeOffsets({reference:Tt,element:xt,strategy:"absolute",placement:it}),Et=rectToClientRect(Object.assign({},xt,At)),Ct=dt===popper?Et:Tt,Lt={top:St.top-Ct.top+bt.top,bottom:Ct.bottom-St.bottom+bt.bottom,left:St.left-Ct.left+bt.left,right:Ct.right-St.right+bt.right},jt=tt.modifiersData.offset;if(dt===popper&&jt){var Rt=jt[it];Object.keys(Lt).forEach(function($t){var vt=[right,bottom].indexOf($t)>=0?1:-1,It=[top,bottom].indexOf($t)>=0?"y":"x";Lt[$t]+=Rt[It]*vt})}return Lt}function computeAutoPlacement(tt,et){et===void 0&&(et={});var nt=et,rt=nt.placement,it=nt.boundary,ot=nt.rootBoundary,at=nt.padding,st=nt.flipVariations,lt=nt.allowedAutoPlacements,ct=lt===void 0?placements:lt,ut=getVariation(rt),ht=ut?st?variationPlacements:variationPlacements.filter(function(mt){return getVariation(mt)===ut}):basePlacements,dt=ht.filter(function(mt){return ct.indexOf(mt)>=0});dt.length===0&&(dt=ht);var pt=dt.reduce(function(mt,gt){return mt[gt]=detectOverflow(tt,{placement:gt,boundary:it,rootBoundary:ot,padding:at})[getBasePlacement(gt)],mt},{});return Object.keys(pt).sort(function(mt,gt){return pt[mt]-pt[gt]})}function getExpandedFallbackPlacements(tt){if(getBasePlacement(tt)===auto)return[];var et=getOppositePlacement(tt);return[getOppositeVariationPlacement(tt),et,getOppositeVariationPlacement(et)]}function flip(tt){var et=tt.state,nt=tt.options,rt=tt.name;if(!et.modifiersData[rt]._skip){for(var it=nt.mainAxis,ot=it===void 0?!0:it,at=nt.altAxis,st=at===void 0?!0:at,lt=nt.fallbackPlacements,ct=nt.padding,ut=nt.boundary,ht=nt.rootBoundary,dt=nt.altBoundary,pt=nt.flipVariations,mt=pt===void 0?!0:pt,gt=nt.allowedAutoPlacements,yt=et.options.placement,bt=getBasePlacement(yt),wt=bt===yt,xt=lt||(wt||!mt?[getOppositePlacement(yt)]:getExpandedFallbackPlacements(yt)),kt=[yt].concat(xt).reduce(function(Qt,an){return Qt.concat(getBasePlacement(an)===auto?computeAutoPlacement(et,{placement:an,boundary:ut,rootBoundary:ht,padding:ct,flipVariations:mt,allowedAutoPlacements:gt}):an)},[]),St=et.rects.reference,Tt=et.rects.popper,At=new Map,Et=!0,Ct=kt[0],Lt=0;Lt=0,It=vt?"width":"height",Ot=detectOverflow(et,{placement:jt,boundary:ut,rootBoundary:ht,altBoundary:dt,padding:ct}),Wt=vt?$t?right:left:$t?bottom:top;St[It]>Tt[It]&&(Wt=getOppositePlacement(Wt));var zt=getOppositePlacement(Wt),Ft=[];if(ot&&Ft.push(Ot[Rt]<=0),st&&Ft.push(Ot[Wt]<=0,Ot[zt]<=0),Ft.every(function(Qt){return Qt})){Ct=jt,Et=!1;break}At.set(jt,Ft)}if(Et)for(var Nt=mt?3:1,Ut=function(an){var Yt=kt.find(function(nn){var tn=At.get(nn);if(tn)return tn.slice(0,an).every(function(dn){return dn})});if(Yt)return Ct=Yt,"break"},Pt=Nt;Pt>0;Pt--){var Ht=Ut(Pt);if(Ht==="break")break}et.placement!==Ct&&(et.modifiersData[rt]._skip=!0,et.placement=Ct,et.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(tt,et,nt){return nt===void 0&&(nt={x:0,y:0}),{top:tt.top-et.height-nt.y,right:tt.right-et.width+nt.x,bottom:tt.bottom-et.height+nt.y,left:tt.left-et.width-nt.x}}function isAnySideFullyClipped(tt){return[top,right,bottom,left].some(function(et){return tt[et]>=0})}function hide(tt){var et=tt.state,nt=tt.name,rt=et.rects.reference,it=et.rects.popper,ot=et.modifiersData.preventOverflow,at=detectOverflow(et,{elementContext:"reference"}),st=detectOverflow(et,{altBoundary:!0}),lt=getSideOffsets(at,rt),ct=getSideOffsets(st,it,ot),ut=isAnySideFullyClipped(lt),ht=isAnySideFullyClipped(ct);et.modifiersData[nt]={referenceClippingOffsets:lt,popperEscapeOffsets:ct,isReferenceHidden:ut,hasPopperEscaped:ht},et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-reference-hidden":ut,"data-popper-escaped":ht})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(tt,et,nt){var rt=getBasePlacement(tt),it=[left,top].indexOf(rt)>=0?-1:1,ot=typeof nt=="function"?nt(Object.assign({},et,{placement:tt})):nt,at=ot[0],st=ot[1];return at=at||0,st=(st||0)*it,[left,right].indexOf(rt)>=0?{x:st,y:at}:{x:at,y:st}}function offset(tt){var et=tt.state,nt=tt.options,rt=tt.name,it=nt.offset,ot=it===void 0?[0,0]:it,at=placements.reduce(function(ut,ht){return ut[ht]=distanceAndSkiddingToXY(ht,et.rects,ot),ut},{}),st=at[et.placement],lt=st.x,ct=st.y;et.modifiersData.popperOffsets!=null&&(et.modifiersData.popperOffsets.x+=lt,et.modifiersData.popperOffsets.y+=ct),et.modifiersData[rt]=at}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(tt){var et=tt.state,nt=tt.name;et.modifiersData[nt]=computeOffsets({reference:et.rects.reference,element:et.rects.popper,strategy:"absolute",placement:et.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(tt){return tt==="x"?"y":"x"}function preventOverflow(tt){var et=tt.state,nt=tt.options,rt=tt.name,it=nt.mainAxis,ot=it===void 0?!0:it,at=nt.altAxis,st=at===void 0?!1:at,lt=nt.boundary,ct=nt.rootBoundary,ut=nt.altBoundary,ht=nt.padding,dt=nt.tether,pt=dt===void 0?!0:dt,mt=nt.tetherOffset,gt=mt===void 0?0:mt,yt=detectOverflow(et,{boundary:lt,rootBoundary:ct,padding:ht,altBoundary:ut}),bt=getBasePlacement(et.placement),wt=getVariation(et.placement),xt=!wt,kt=getMainAxisFromPlacement(bt),St=getAltAxis(kt),Tt=et.modifiersData.popperOffsets,At=et.rects.reference,Et=et.rects.popper,Ct=typeof gt=="function"?gt(Object.assign({},et.rects,{placement:et.placement})):gt,Lt=typeof Ct=="number"?{mainAxis:Ct,altAxis:Ct}:Object.assign({mainAxis:0,altAxis:0},Ct),jt=et.modifiersData.offset?et.modifiersData.offset[et.placement]:null,Rt={x:0,y:0};if(Tt){if(ot){var $t,vt=kt==="y"?top:left,It=kt==="y"?bottom:right,Ot=kt==="y"?"height":"width",Wt=Tt[kt],zt=Wt+yt[vt],Ft=Wt-yt[It],Nt=pt?-Et[Ot]/2:0,Ut=wt===start$1?At[Ot]:Et[Ot],Pt=wt===start$1?-Et[Ot]:-At[Ot],Ht=et.elements.arrow,Qt=pt&&Ht?getLayoutRect(Ht):{width:0,height:0},an=et.modifiersData["arrow#persistent"]?et.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Yt=an[vt],nn=an[It],tn=within(0,At[Ot],Qt[Ot]),dn=xt?At[Ot]/2-Nt-tn-Yt-Lt.mainAxis:Ut-tn-Yt-Lt.mainAxis,wn=xt?-At[Ot]/2+Nt+tn+nn+Lt.mainAxis:Pt+tn+nn+Lt.mainAxis,rn=et.elements.arrow&&getOffsetParent(et.elements.arrow),Jt=rn?kt==="y"?rn.clientTop||0:rn.clientLeft||0:0,vn=($t=jt==null?void 0:jt[kt])!=null?$t:0,Cn=Wt+dn-vn-Jt,$n=Wt+wn-vn,Nn=within(pt?min$2(zt,Cn):zt,Wt,pt?max$2(Ft,$n):Ft);Tt[kt]=Nn,Rt[kt]=Nn-Wt}if(st){var En,sn=kt==="x"?top:left,pn=kt==="x"?bottom:right,Tn=Tt[St],In=St==="y"?"height":"width",yn=Tn+yt[sn],hn=Tn-yt[pn],fn=[top,left].indexOf(bt)!==-1,xn=(En=jt==null?void 0:jt[St])!=null?En:0,jn=fn?yn:Tn-At[In]-Et[In]-xn+Lt.altAxis,cn=fn?Tn+At[In]+Et[In]-xn-Lt.altAxis:hn,Xt=pt&&fn?withinMaxClamp(jn,Tn,cn):within(pt?jn:yn,Tn,pt?cn:hn);Tt[St]=Xt,Rt[St]=Xt-Tn}et.modifiersData[rt]=Rt}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(tt){return{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}}function getNodeScroll(tt){return tt===getWindow(tt)||!isHTMLElement$1(tt)?getWindowScroll(tt):getHTMLElementScroll(tt)}function isElementScaled(tt){var et=tt.getBoundingClientRect(),nt=round$1(et.width)/tt.offsetWidth||1,rt=round$1(et.height)/tt.offsetHeight||1;return nt!==1||rt!==1}function getCompositeRect(tt,et,nt){nt===void 0&&(nt=!1);var rt=isHTMLElement$1(et),it=isHTMLElement$1(et)&&isElementScaled(et),ot=getDocumentElement(et),at=getBoundingClientRect(tt,it,nt),st={scrollLeft:0,scrollTop:0},lt={x:0,y:0};return(rt||!rt&&!nt)&&((getNodeName(et)!=="body"||isScrollParent(ot))&&(st=getNodeScroll(et)),isHTMLElement$1(et)?(lt=getBoundingClientRect(et,!0),lt.x+=et.clientLeft,lt.y+=et.clientTop):ot&&(lt.x=getWindowScrollBarX(ot))),{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function order(tt){var et=new Map,nt=new Set,rt=[];tt.forEach(function(ot){et.set(ot.name,ot)});function it(ot){nt.add(ot.name);var at=[].concat(ot.requires||[],ot.requiresIfExists||[]);at.forEach(function(st){if(!nt.has(st)){var lt=et.get(st);lt&&it(lt)}}),rt.push(ot)}return tt.forEach(function(ot){nt.has(ot.name)||it(ot)}),rt}function orderModifiers(tt){var et=order(tt);return modifierPhases.reduce(function(nt,rt){return nt.concat(et.filter(function(it){return it.phase===rt}))},[])}function debounce$3(tt){var et;return function(){return et||(et=new Promise(function(nt){Promise.resolve().then(function(){et=void 0,nt(tt())})})),et}}function mergeByName(tt){var et=tt.reduce(function(nt,rt){var it=nt[rt.name];return nt[rt.name]=it?Object.assign({},it,rt,{options:Object.assign({},it.options,rt.options),data:Object.assign({},it.data,rt.data)}):rt,nt},{});return Object.keys(et).map(function(nt){return et[nt]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var tt=arguments.length,et=new Array(tt),nt=0;nt{ot||st(getContainer$1(it)||document.body)},[it,ot]),useEnhancedEffect$1(()=>{if(at&&!ot)return setRef(nt,at),()=>{setRef(nt,null)}},[nt,at,ot]),ot){if(reactExports.isValidElement(rt)){const ct={ref:lt};return reactExports.cloneElement(rt,ct)}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:rt})}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:at&&reactDomExports.createPortal(rt,at)})});function getPopperUtilityClass(tt){return generateUtilityClass("MuiPopper",tt)}generateUtilityClasses("MuiPopper",["root"]);const _excluded$1o=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],_excluded2$g=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function flipPlacement(tt,et){if(et==="ltr")return tt;switch(tt){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return tt}}function resolveAnchorEl$1(tt){return typeof tt=="function"?tt():tt}function isHTMLElement(tt){return tt.nodeType!==void 0}const useUtilityClasses$R=()=>composeClasses({root:["root"]},useClassNamesOverride(getPopperUtilityClass)),defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(et,nt){var rt;const{anchorEl:it,children:ot,direction:at,disablePortal:st,modifiers:lt,open:ct,placement:ut,popperOptions:ht,popperRef:dt,slotProps:pt={},slots:mt={},TransitionProps:gt}=et,yt=_objectWithoutPropertiesLoose$k(et,_excluded$1o),bt=reactExports.useRef(null),wt=useForkRef(bt,nt),xt=reactExports.useRef(null),kt=useForkRef(xt,dt),St=reactExports.useRef(kt);useEnhancedEffect$1(()=>{St.current=kt},[kt]),reactExports.useImperativeHandle(dt,()=>xt.current,[]);const Tt=flipPlacement(ut,at),[At,Et]=reactExports.useState(Tt),[Ct,Lt]=reactExports.useState(resolveAnchorEl$1(it));reactExports.useEffect(()=>{xt.current&&xt.current.forceUpdate()}),reactExports.useEffect(()=>{it&&Lt(resolveAnchorEl$1(it))},[it]),useEnhancedEffect$1(()=>{if(!Ct||!ct)return;const It=zt=>{Et(zt.placement)};let Ot=[{name:"preventOverflow",options:{altBoundary:st}},{name:"flip",options:{altBoundary:st}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:zt})=>{It(zt)}}];lt!=null&&(Ot=Ot.concat(lt)),ht&&ht.modifiers!=null&&(Ot=Ot.concat(ht.modifiers));const Wt=createPopper(Ct,bt.current,_extends$u({placement:Tt},ht,{modifiers:Ot}));return St.current(Wt),()=>{Wt.destroy(),St.current(null)}},[Ct,st,lt,ct,ht,Tt]);const jt={placement:At};gt!==null&&(jt.TransitionProps=gt);const Rt=useUtilityClasses$R(),$t=(rt=mt.root)!=null?rt:"div",vt=useSlotProps({elementType:$t,externalSlotProps:pt.root,externalForwardedProps:yt,additionalProps:{role:"tooltip",ref:wt},ownerState:et,className:Rt.root});return jsxRuntimeExports.jsx($t,_extends$u({},vt,{children:typeof ot=="function"?ot(jt):ot}))}),Popper$1=reactExports.forwardRef(function(et,nt){const{anchorEl:rt,children:it,container:ot,direction:at="ltr",disablePortal:st=!1,keepMounted:lt=!1,modifiers:ct,open:ut,placement:ht="bottom",popperOptions:dt=defaultPopperOptions,popperRef:pt,style:mt,transition:gt=!1,slotProps:yt={},slots:bt={}}=et,wt=_objectWithoutPropertiesLoose$k(et,_excluded2$g),[xt,kt]=reactExports.useState(!0),St=()=>{kt(!1)},Tt=()=>{kt(!0)};if(!lt&&!ut&&(!gt||xt))return null;let At;if(ot)At=ot;else if(rt){const Lt=resolveAnchorEl$1(rt);At=Lt&&isHTMLElement(Lt)?ownerDocument(Lt).body:ownerDocument(null).body}const Et=!ut&<&&(!gt||xt)?"none":void 0,Ct=gt?{in:ut,onEnter:St,onExited:Tt}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:st,container:At,children:jsxRuntimeExports.jsx(PopperTooltip,_extends$u({anchorEl:rt,direction:at,disablePortal:st,modifiers:ct,ref:nt,open:gt?!xt:ut,placement:ht,popperOptions:dt,popperRef:pt,slotProps:yt,slots:bt},wt,{style:_extends$u({position:"fixed",top:0,left:0,display:Et},mt),TransitionProps:Ct,children:it}))})});function isOverflowing(tt){const et=ownerDocument(tt);return et.body===tt?ownerWindow(tt).innerWidth>et.documentElement.clientWidth:tt.scrollHeight>tt.clientHeight}function ariaHidden(tt,et){et?tt.setAttribute("aria-hidden","true"):tt.removeAttribute("aria-hidden")}function getPaddingRight(tt){return parseInt(ownerWindow(tt).getComputedStyle(tt).paddingRight,10)||0}function isAriaHiddenForbiddenOnElement(tt){const nt=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(tt.tagName)!==-1,rt=tt.tagName==="INPUT"&&tt.getAttribute("type")==="hidden";return nt||rt}function ariaHiddenSiblings(tt,et,nt,rt,it){const ot=[et,nt,...rt];[].forEach.call(tt.children,at=>{const st=ot.indexOf(at)===-1,lt=!isAriaHiddenForbiddenOnElement(at);st&<&&ariaHidden(at,it)})}function findIndexOf(tt,et){let nt=-1;return tt.some((rt,it)=>et(rt)?(nt=it,!0):!1),nt}function handleContainer(tt,et){const nt=[],rt=tt.container;if(!et.disableScrollLock){if(isOverflowing(rt)){const at=getScrollbarSize(ownerDocument(rt));nt.push({value:rt.style.paddingRight,property:"padding-right",el:rt}),rt.style.paddingRight=`${getPaddingRight(rt)+at}px`;const st=ownerDocument(rt).querySelectorAll(".mui-fixed");[].forEach.call(st,lt=>{nt.push({value:lt.style.paddingRight,property:"padding-right",el:lt}),lt.style.paddingRight=`${getPaddingRight(lt)+at}px`})}let ot;if(rt.parentNode instanceof DocumentFragment)ot=ownerDocument(rt).body;else{const at=rt.parentElement,st=ownerWindow(rt);ot=(at==null?void 0:at.nodeName)==="HTML"&&st.getComputedStyle(at).overflowY==="scroll"?at:rt}nt.push({value:ot.style.overflow,property:"overflow",el:ot},{value:ot.style.overflowX,property:"overflow-x",el:ot},{value:ot.style.overflowY,property:"overflow-y",el:ot}),ot.style.overflow="hidden"}return()=>{nt.forEach(({value:ot,el:at,property:st})=>{ot?at.style.setProperty(st,ot):at.style.removeProperty(st)})}}function getHiddenSiblings(tt){const et=[];return[].forEach.call(tt.children,nt=>{nt.getAttribute("aria-hidden")==="true"&&et.push(nt)}),et}class ModalManager{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(et,nt){let rt=this.modals.indexOf(et);if(rt!==-1)return rt;rt=this.modals.length,this.modals.push(et),et.modalRef&&ariaHidden(et.modalRef,!1);const it=getHiddenSiblings(nt);ariaHiddenSiblings(nt,et.mount,et.modalRef,it,!0);const ot=findIndexOf(this.containers,at=>at.container===nt);return ot!==-1?(this.containers[ot].modals.push(et),rt):(this.containers.push({modals:[et],container:nt,restore:null,hiddenSiblings:it}),rt)}mount(et,nt){const rt=findIndexOf(this.containers,ot=>ot.modals.indexOf(et)!==-1),it=this.containers[rt];it.restore||(it.restore=handleContainer(it,nt))}remove(et,nt=!0){const rt=this.modals.indexOf(et);if(rt===-1)return rt;const it=findIndexOf(this.containers,at=>at.modals.indexOf(et)!==-1),ot=this.containers[it];if(ot.modals.splice(ot.modals.indexOf(et),1),this.modals.splice(rt,1),ot.modals.length===0)ot.restore&&ot.restore(),et.modalRef&&ariaHidden(et.modalRef,nt),ariaHiddenSiblings(ot.container,et.mount,et.modalRef,ot.hiddenSiblings,!1),this.containers.splice(it,1);else{const at=ot.modals[ot.modals.length-1];at.modalRef&&ariaHidden(at.modalRef,!1)}return rt}isTopModal(et){return this.modals.length>0&&this.modals[this.modals.length-1]===et}}function getContainer(tt){return typeof tt=="function"?tt():tt}function getHasTransition(tt){return tt?tt.props.hasOwnProperty("in"):!1}const defaultManager=new ModalManager;function useModal$1(tt){const{container:et,disableEscapeKeyDown:nt=!1,disableScrollLock:rt=!1,manager:it=defaultManager,closeAfterTransition:ot=!1,onTransitionEnter:at,onTransitionExited:st,children:lt,onClose:ct,open:ut,rootRef:ht}=tt,dt=reactExports.useRef({}),pt=reactExports.useRef(null),mt=reactExports.useRef(null),gt=useForkRef(mt,ht),[yt,bt]=reactExports.useState(!ut),wt=getHasTransition(lt);let xt=!0;(tt["aria-hidden"]==="false"||tt["aria-hidden"]===!1)&&(xt=!1);const kt=()=>ownerDocument(pt.current),St=()=>(dt.current.modalRef=mt.current,dt.current.mount=pt.current,dt.current),Tt=()=>{it.mount(St(),{disableScrollLock:rt}),mt.current&&(mt.current.scrollTop=0)},At=useEventCallback(()=>{const Ot=getContainer(et)||kt().body;it.add(St(),Ot),mt.current&&Tt()}),Et=reactExports.useCallback(()=>it.isTopModal(St()),[it]),Ct=useEventCallback(Ot=>{pt.current=Ot,Ot&&(ut&&Et()?Tt():mt.current&&ariaHidden(mt.current,xt))}),Lt=reactExports.useCallback(()=>{it.remove(St(),xt)},[xt,it]);reactExports.useEffect(()=>()=>{Lt()},[Lt]),reactExports.useEffect(()=>{ut?At():(!wt||!ot)&&Lt()},[ut,Lt,wt,ot,At]);const jt=Ot=>Wt=>{var zt;(zt=Ot.onKeyDown)==null||zt.call(Ot,Wt),!(Wt.key!=="Escape"||!Et())&&(nt||(Wt.stopPropagation(),ct&&ct(Wt,"escapeKeyDown")))},Rt=Ot=>Wt=>{var zt;(zt=Ot.onClick)==null||zt.call(Ot,Wt),Wt.target===Wt.currentTarget&&ct&&ct(Wt,"backdropClick")};return{getRootProps:(Ot={})=>{const Wt=extractEventHandlers(tt);delete Wt.onTransitionEnter,delete Wt.onTransitionExited;const zt=_extends$u({},Wt,Ot);return _extends$u({role:"presentation"},zt,{onKeyDown:jt(zt),ref:gt})},getBackdropProps:(Ot={})=>{const Wt=Ot;return _extends$u({"aria-hidden":!0},Wt,{onClick:Rt(Wt),open:ut})},getTransitionProps:()=>{const Ot=()=>{bt(!1),at&&at()},Wt=()=>{bt(!0),st&&st(),ot&&Lt()};return{onEnter:createChainedFunction(Ot,lt==null?void 0:lt.props.onEnter),onExited:createChainedFunction(Wt,lt==null?void 0:lt.props.onExited)}},rootRef:gt,portalRef:Ct,isTopModal:Et,exited:yt,hasTransition:wt}}const INTENTIONAL_DRAG_COUNT_THRESHOLD=2;function asc(tt,et){return tt-et}function clamp$1(tt,et,nt){return tt==null?et:Math.min(Math.max(et,tt),nt)}function findClosest(tt,et){var nt;const{index:rt}=(nt=tt.reduce((it,ot,at)=>{const st=Math.abs(et-ot);return it===null||st({left:`${tt}%`}),leap:tt=>({width:`${tt}%`})},"horizontal-reverse":{offset:tt=>({right:`${tt}%`}),leap:tt=>({width:`${tt}%`})},vertical:{offset:tt=>({bottom:`${tt}%`}),leap:tt=>({height:`${tt}%`})}},Identity$1=tt=>tt;let cachedSupportsTouchActionNone;function doesSupportTouchActionNone(){return cachedSupportsTouchActionNone===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?cachedSupportsTouchActionNone=CSS.supports("touch-action","none"):cachedSupportsTouchActionNone=!0),cachedSupportsTouchActionNone}function useSlider(tt){const{"aria-labelledby":et,defaultValue:nt,disabled:rt=!1,disableSwap:it=!1,isRtl:ot=!1,marks:at=!1,max:st=100,min:lt=0,name:ct,onChange:ut,onChangeCommitted:ht,orientation:dt="horizontal",rootRef:pt,scale:mt=Identity$1,step:gt=1,tabIndex:yt,value:bt}=tt,wt=reactExports.useRef(),[xt,kt]=reactExports.useState(-1),[St,Tt]=reactExports.useState(-1),[At,Et]=reactExports.useState(!1),Ct=reactExports.useRef(0),[Lt,jt]=useControlled({controlled:bt,default:nt??lt,name:"Slider"}),Rt=ut&&((xn,jn,cn)=>{const Xt=xn.nativeEvent||xn,Kt=new Xt.constructor(Xt.type,Xt);Object.defineProperty(Kt,"target",{writable:!0,value:{value:jn,name:ct}}),ut(Kt,jn,cn)}),$t=Array.isArray(Lt);let vt=$t?Lt.slice().sort(asc):[Lt];vt=vt.map(xn=>clamp$1(xn,lt,st));const It=at===!0&>!==null?[...Array(Math.floor((st-lt)/gt)+1)].map((xn,jn)=>({value:lt+gt*jn})):at||[],Ot=It.map(xn=>xn.value),{isFocusVisibleRef:Wt,onBlur:zt,onFocus:Ft,ref:Nt}=useIsFocusVisible(),[Ut,Pt]=reactExports.useState(-1),Ht=reactExports.useRef(),Qt=useForkRef(Nt,Ht),an=useForkRef(pt,Qt),Yt=xn=>jn=>{var cn;const Xt=Number(jn.currentTarget.getAttribute("data-index"));Ft(jn),Wt.current===!0&&Pt(Xt),Tt(Xt),xn==null||(cn=xn.onFocus)==null||cn.call(xn,jn)},nn=xn=>jn=>{var cn;zt(jn),Wt.current===!1&&Pt(-1),Tt(-1),xn==null||(cn=xn.onBlur)==null||cn.call(xn,jn)};useEnhancedEffect$1(()=>{if(rt&&Ht.current.contains(document.activeElement)){var xn;(xn=document.activeElement)==null||xn.blur()}},[rt]),rt&&xt!==-1&&kt(-1),rt&&Ut!==-1&&Pt(-1);const tn=xn=>jn=>{var cn;(cn=xn.onChange)==null||cn.call(xn,jn);const Xt=Number(jn.currentTarget.getAttribute("data-index")),Kt=vt[Xt],kn=Ot.indexOf(Kt);let Mn=jn.target.valueAsNumber;if(It&>==null){const On=Ot[Ot.length-1];Mn>On?Mn=On:Mn{const{current:cn}=Ht,{width:Xt,height:Kt,bottom:kn,left:Mn}=cn.getBoundingClientRect();let On;wn.indexOf("vertical")===0?On=(kn-xn.y)/Kt:On=(xn.x-Mn)/Xt,wn.indexOf("-reverse")!==-1&&(On=1-On);let Bn;if(Bn=percentToValue(On,lt,st),gt)Bn=roundValueToStep(Bn,gt,lt);else{const Vn=findClosest(Ot,Bn);Bn=Ot[Vn]}Bn=clamp$1(Bn,lt,st);let Xn=0;if($t){jn?Xn=dn.current:Xn=findClosest(vt,Bn),it&&(Bn=clamp$1(Bn,vt[Xn-1]||-1/0,vt[Xn+1]||1/0));const Vn=Bn;Bn=setValueIndex({values:vt,newValue:Bn,index:Xn}),it&&jn||(Xn=Bn.indexOf(Vn),dn.current=Xn)}return{newValue:Bn,activeIndex:Xn}},Jt=useEventCallback(xn=>{const jn=trackFinger(xn,wt);if(!jn)return;if(Ct.current+=1,xn.type==="mousemove"&&xn.buttons===0){vn(xn);return}const{newValue:cn,activeIndex:Xt}=rn({finger:jn,move:!0});focusThumb({sliderRef:Ht,activeIndex:Xt,setActive:kt}),jt(cn),!At&&Ct.current>INTENTIONAL_DRAG_COUNT_THRESHOLD&&Et(!0),Rt&&!areValuesEqual(cn,Lt)&&Rt(xn,cn,Xt)}),vn=useEventCallback(xn=>{const jn=trackFinger(xn,wt);if(Et(!1),!jn)return;const{newValue:cn}=rn({finger:jn,move:!0});kt(-1),xn.type==="touchend"&&Tt(-1),ht&&ht(xn,cn),wt.current=void 0,$n()}),Cn=useEventCallback(xn=>{if(rt)return;doesSupportTouchActionNone()||xn.preventDefault();const jn=xn.changedTouches[0];jn!=null&&(wt.current=jn.identifier);const cn=trackFinger(xn,wt);if(cn!==!1){const{newValue:Kt,activeIndex:kn}=rn({finger:cn});focusThumb({sliderRef:Ht,activeIndex:kn,setActive:kt}),jt(Kt),Rt&&!areValuesEqual(Kt,Lt)&&Rt(xn,Kt,kn)}Ct.current=0;const Xt=ownerDocument(Ht.current);Xt.addEventListener("touchmove",Jt),Xt.addEventListener("touchend",vn)}),$n=reactExports.useCallback(()=>{const xn=ownerDocument(Ht.current);xn.removeEventListener("mousemove",Jt),xn.removeEventListener("mouseup",vn),xn.removeEventListener("touchmove",Jt),xn.removeEventListener("touchend",vn)},[vn,Jt]);reactExports.useEffect(()=>{const{current:xn}=Ht;return xn.addEventListener("touchstart",Cn,{passive:doesSupportTouchActionNone()}),()=>{xn.removeEventListener("touchstart",Cn,{passive:doesSupportTouchActionNone()}),$n()}},[$n,Cn]),reactExports.useEffect(()=>{rt&&$n()},[rt,$n]);const Nn=xn=>jn=>{var cn;if((cn=xn.onMouseDown)==null||cn.call(xn,jn),rt||jn.defaultPrevented||jn.button!==0)return;jn.preventDefault();const Xt=trackFinger(jn,wt);if(Xt!==!1){const{newValue:kn,activeIndex:Mn}=rn({finger:Xt});focusThumb({sliderRef:Ht,activeIndex:Mn,setActive:kt}),jt(kn),Rt&&!areValuesEqual(kn,Lt)&&Rt(jn,kn,Mn)}Ct.current=0;const Kt=ownerDocument(Ht.current);Kt.addEventListener("mousemove",Jt),Kt.addEventListener("mouseup",vn)},En=valueToPercent($t?vt[0]:lt,lt,st),sn=valueToPercent(vt[vt.length-1],lt,st)-En,pn=(xn={})=>{const jn=extractEventHandlers(xn),cn={onMouseDown:Nn(jn||{})},Xt=_extends$u({},jn,cn);return _extends$u({},xn,{ref:an},Xt)},Tn=xn=>jn=>{var cn;(cn=xn.onMouseOver)==null||cn.call(xn,jn);const Xt=Number(jn.currentTarget.getAttribute("data-index"));Tt(Xt)},In=xn=>jn=>{var cn;(cn=xn.onMouseLeave)==null||cn.call(xn,jn),Tt(-1)};return{active:xt,axis:wn,axisProps,dragging:At,focusedThumbIndex:Ut,getHiddenInputProps:(xn={})=>{var jn;const cn=extractEventHandlers(xn),Xt={onChange:tn(cn||{}),onFocus:Yt(cn||{}),onBlur:nn(cn||{})},Kt=_extends$u({},cn,Xt);return _extends$u({tabIndex:yt,"aria-labelledby":et,"aria-orientation":dt,"aria-valuemax":mt(st),"aria-valuemin":mt(lt),name:ct,type:"range",min:tt.min,max:tt.max,step:tt.step===null&&tt.marks?"any":(jn=tt.step)!=null?jn:void 0,disabled:rt},xn,Kt,{style:_extends$u({},visuallyHidden$1,{direction:ot?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:pn,getThumbProps:(xn={})=>{const jn=extractEventHandlers(xn),cn={onMouseOver:Tn(jn||{}),onMouseLeave:In(jn||{})};return _extends$u({},xn,jn,cn)},marks:It,open:St,range:$t,rootRef:an,trackLeap:sn,trackOffset:En,values:vt,getThumbStyle:xn=>({pointerEvents:xt!==-1&&xt!==xn?"none":void 0})}}const _excluded$1n=["onChange","maxRows","minRows","style","value"];function getStyleValue(tt){return parseInt(tt,10)||0}const styles$4={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isEmpty$1(tt){return tt==null||Object.keys(tt).length===0||tt.outerHeightStyle===0&&!tt.overflow}const TextareaAutosize=reactExports.forwardRef(function(et,nt){const{onChange:rt,maxRows:it,minRows:ot=1,style:at,value:st}=et,lt=_objectWithoutPropertiesLoose$k(et,_excluded$1n),{current:ct}=reactExports.useRef(st!=null),ut=reactExports.useRef(null),ht=useForkRef(nt,ut),dt=reactExports.useRef(null),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState({outerHeightStyle:0}),yt=reactExports.useCallback(()=>{const kt=ut.current,Tt=ownerWindow(kt).getComputedStyle(kt);if(Tt.width==="0px")return{outerHeightStyle:0};const At=dt.current;At.style.width=Tt.width,At.value=kt.value||et.placeholder||"x",At.value.slice(-1)===` -`&&(At.value+=" ");const Et=Tt.boxSizing,Ct=getStyleValue(Tt.paddingBottom)+getStyleValue(Tt.paddingTop),Lt=getStyleValue(Tt.borderBottomWidth)+getStyleValue(Tt.borderTopWidth),jt=At.scrollHeight;At.value="x";const Rt=At.scrollHeight;let $t=jt;ot&&($t=Math.max(Number(ot)*Rt,$t)),it&&($t=Math.min(Number(it)*Rt,$t)),$t=Math.max($t,Rt);const vt=$t+(Et==="border-box"?Ct+Lt:0),It=Math.abs($t-jt)<=1;return{outerHeightStyle:vt,overflow:It}},[it,ot,et.placeholder]),bt=(kt,St)=>{const{outerHeightStyle:Tt,overflow:At}=St;return pt.current<20&&(Tt>0&&Math.abs((kt.outerHeightStyle||0)-Tt)>1||kt.overflow!==At)?(pt.current+=1,{overflow:At,outerHeightStyle:Tt}):kt},wt=reactExports.useCallback(()=>{const kt=yt();isEmpty$1(kt)||gt(St=>bt(St,kt))},[yt]);useEnhancedEffect$1(()=>{const kt=()=>{const jt=yt();isEmpty$1(jt)||reactDomExports.flushSync(()=>{gt(Rt=>bt(Rt,jt))})},St=()=>{pt.current=0,kt()};let Tt;const At=debounce$4(St),Et=ut.current,Ct=ownerWindow(Et);Ct.addEventListener("resize",At);let Lt;return typeof ResizeObserver<"u"&&(Lt=new ResizeObserver(St),Lt.observe(Et)),()=>{At.clear(),cancelAnimationFrame(Tt),Ct.removeEventListener("resize",At),Lt&&Lt.disconnect()}},[yt]),useEnhancedEffect$1(()=>{wt()}),reactExports.useEffect(()=>{pt.current=0},[st]);const xt=kt=>{pt.current=0,ct||wt(),rt&&rt(kt)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",_extends$u({value:st,onChange:xt,ref:ht,rows:ot,style:_extends$u({height:mt.outerHeightStyle,overflow:mt.overflow?"hidden":void 0},at)},lt)),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:et.className,readOnly:!0,ref:dt,tabIndex:-1,style:_extends$u({},styles$4.shadow,at,{paddingTop:0,paddingBottom:0})})]})}),_excluded$1m=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],PopperRoot=styled$1(Popper$1,{name:"MuiPopper",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),Popper=reactExports.forwardRef(function(et,nt){var rt;const it=useTheme$3(),ot=useThemeProps({props:et,name:"MuiPopper"}),{anchorEl:at,component:st,components:lt,componentsProps:ct,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:yt,popperRef:bt,transition:wt,slots:xt,slotProps:kt}=ot,St=_objectWithoutPropertiesLoose$k(ot,_excluded$1m),Tt=(rt=xt==null?void 0:xt.root)!=null?rt:lt==null?void 0:lt.Root,At=_extends$u({anchorEl:at,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:yt,popperRef:bt,transition:wt},St);return jsxRuntimeExports.jsx(PopperRoot,_extends$u({as:st,direction:it==null?void 0:it.direction,slots:{root:Tt},slotProps:kt??ct},At,{ref:nt}))}),MuiPopper=Popper,CancelIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function getChipUtilityClass(tt){return generateUtilityClass("MuiChip",tt)}const chipClasses=generateUtilityClasses("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),chipClasses$1=chipClasses,_excluded$1l=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],useUtilityClasses$Q=tt=>{const{classes:et,disabled:nt,size:rt,color:it,iconColor:ot,onDelete:at,clickable:st,variant:lt}=tt,ct={root:["root",lt,nt&&"disabled",`size${capitalize(rt)}`,`color${capitalize(it)}`,st&&"clickable",st&&`clickableColor${capitalize(it)}`,at&&"deletable",at&&`deletableColor${capitalize(it)}`,`${lt}${capitalize(it)}`],label:["label",`label${capitalize(rt)}`],avatar:["avatar",`avatar${capitalize(rt)}`,`avatarColor${capitalize(it)}`],icon:["icon",`icon${capitalize(rt)}`,`iconColor${capitalize(ot)}`],deleteIcon:["deleteIcon",`deleteIcon${capitalize(rt)}`,`deleteIconColor${capitalize(it)}`,`deleteIcon${capitalize(lt)}Color${capitalize(it)}`]};return composeClasses(ct,getChipUtilityClass,et)},ChipRoot=styled$1("div",{name:"MuiChip",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt,{color:rt,iconColor:it,clickable:ot,onDelete:at,size:st,variant:lt}=nt;return[{[`& .${chipClasses$1.avatar}`]:et.avatar},{[`& .${chipClasses$1.avatar}`]:et[`avatar${capitalize(st)}`]},{[`& .${chipClasses$1.avatar}`]:et[`avatarColor${capitalize(rt)}`]},{[`& .${chipClasses$1.icon}`]:et.icon},{[`& .${chipClasses$1.icon}`]:et[`icon${capitalize(st)}`]},{[`& .${chipClasses$1.icon}`]:et[`iconColor${capitalize(it)}`]},{[`& .${chipClasses$1.deleteIcon}`]:et.deleteIcon},{[`& .${chipClasses$1.deleteIcon}`]:et[`deleteIcon${capitalize(st)}`]},{[`& .${chipClasses$1.deleteIcon}`]:et[`deleteIconColor${capitalize(rt)}`]},{[`& .${chipClasses$1.deleteIcon}`]:et[`deleteIcon${capitalize(lt)}Color${capitalize(rt)}`]},et.root,et[`size${capitalize(st)}`],et[`color${capitalize(rt)}`],ot&&et.clickable,ot&&rt!=="default"&&et[`clickableColor${capitalize(rt)})`],at&&et.deletable,at&&rt!=="default"&&et[`deletableColor${capitalize(rt)}`],et[lt],et[`${lt}${capitalize(rt)}`]]}})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?tt.palette.grey[700]:tt.palette.grey[300];return _extends$u({maxWidth:"100%",fontFamily:tt.typography.fontFamily,fontSize:tt.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(tt.vars||tt).palette.text.primary,backgroundColor:(tt.vars||tt).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:tt.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${chipClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${chipClasses$1.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:tt.vars?tt.vars.palette.Chip.defaultAvatarColor:nt,fontSize:tt.typography.pxToRem(12)},[`& .${chipClasses$1.avatarColorPrimary}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.dark},[`& .${chipClasses$1.avatarColorSecondary}`]:{color:(tt.vars||tt).palette.secondary.contrastText,backgroundColor:(tt.vars||tt).palette.secondary.dark},[`& .${chipClasses$1.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:tt.typography.pxToRem(10)},[`& .${chipClasses$1.icon}`]:_extends$u({marginLeft:5,marginRight:-6},et.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},et.iconColor===et.color&&_extends$u({color:tt.vars?tt.vars.palette.Chip.defaultIconColor:nt},et.color!=="default"&&{color:"inherit"})),[`& .${chipClasses$1.deleteIcon}`]:_extends$u({WebkitTapHighlightColor:"transparent",color:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / 0.26)`:alpha$1(tt.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / 0.4)`:alpha$1(tt.palette.text.primary,.4)}},et.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},et.color!=="default"&&{color:tt.vars?`rgba(${tt.vars.palette[et.color].contrastTextChannel} / 0.7)`:alpha$1(tt.palette[et.color].contrastText,.7),"&:hover, &:active":{color:(tt.vars||tt).palette[et.color].contrastText}})},et.size==="small"&&{height:24},et.color!=="default"&&{backgroundColor:(tt.vars||tt).palette[et.color].main,color:(tt.vars||tt).palette[et.color].contrastText},et.onDelete&&{[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.selectedChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.action.selected,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},et.onDelete&&et.color!=="default"&&{[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette[et.color].dark}})},({theme:tt,ownerState:et})=>_extends$u({},et.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.selectedChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.action.selected,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity)},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.selectedChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.action.selected,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)},"&:active":{boxShadow:(tt.vars||tt).shadows[1]}},et.clickable&&et.color!=="default"&&{[`&:hover, &.${chipClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette[et.color].dark}}),({theme:tt,ownerState:et})=>_extends$u({},et.variant==="outlined"&&{backgroundColor:"transparent",border:tt.vars?`1px solid ${tt.vars.palette.Chip.defaultBorder}`:`1px solid ${tt.palette.mode==="light"?tt.palette.grey[400]:tt.palette.grey[700]}`,[`&.${chipClasses$1.clickable}:hover`]:{backgroundColor:(tt.vars||tt).palette.action.hover},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`& .${chipClasses$1.avatar}`]:{marginLeft:4},[`& .${chipClasses$1.avatarSmall}`]:{marginLeft:2},[`& .${chipClasses$1.icon}`]:{marginLeft:4},[`& .${chipClasses$1.iconSmall}`]:{marginLeft:2},[`& .${chipClasses$1.deleteIcon}`]:{marginRight:5},[`& .${chipClasses$1.deleteIconSmall}`]:{marginRight:3}},et.variant==="outlined"&&et.color!=="default"&&{color:(tt.vars||tt).palette[et.color].main,border:`1px solid ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.7)`:alpha$1(tt.palette[et.color].main,.7)}`,[`&.${chipClasses$1.clickable}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity)},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.focusOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.focusOpacity)},[`& .${chipClasses$1.deleteIcon}`]:{color:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.7)`:alpha$1(tt.palette[et.color].main,.7),"&:hover, &:active":{color:(tt.vars||tt).palette[et.color].main}}})),ChipLabel=styled$1("span",{name:"MuiChip",slot:"Label",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt,{size:rt}=nt;return[et.label,et[`label${capitalize(rt)}`]]}})(({ownerState:tt})=>_extends$u({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},tt.variant==="outlined"&&{paddingLeft:11,paddingRight:11},tt.size==="small"&&{paddingLeft:8,paddingRight:8},tt.size==="small"&&tt.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function isDeleteKeyboardEvent(tt){return tt.key==="Backspace"||tt.key==="Delete"}const Chip=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiChip"}),{avatar:it,className:ot,clickable:at,color:st="default",component:lt,deleteIcon:ct,disabled:ut=!1,icon:ht,label:dt,onClick:pt,onDelete:mt,onKeyDown:gt,onKeyUp:yt,size:bt="medium",variant:wt="filled",tabIndex:xt,skipFocusWhenDisabled:kt=!1}=rt,St=_objectWithoutPropertiesLoose$k(rt,_excluded$1l),Tt=reactExports.useRef(null),At=useForkRef(Tt,nt),Et=Ft=>{Ft.stopPropagation(),mt&&mt(Ft)},Ct=Ft=>{Ft.currentTarget===Ft.target&&isDeleteKeyboardEvent(Ft)&&Ft.preventDefault(),gt&>(Ft)},Lt=Ft=>{Ft.currentTarget===Ft.target&&(mt&&isDeleteKeyboardEvent(Ft)?mt(Ft):Ft.key==="Escape"&&Tt.current&&Tt.current.blur()),yt&&yt(Ft)},jt=at!==!1&&pt?!0:at,Rt=jt||mt?ButtonBase$1:lt||"div",$t=_extends$u({},rt,{component:Rt,disabled:ut,size:bt,color:st,iconColor:reactExports.isValidElement(ht)&&ht.props.color||st,onDelete:!!mt,clickable:jt,variant:wt}),vt=useUtilityClasses$Q($t),It=Rt===ButtonBase$1?_extends$u({component:lt||"div",focusVisibleClassName:vt.focusVisible},mt&&{disableRipple:!0}):{};let Ot=null;mt&&(Ot=ct&&reactExports.isValidElement(ct)?reactExports.cloneElement(ct,{className:clsx$2(ct.props.className,vt.deleteIcon),onClick:Et}):jsxRuntimeExports.jsx(CancelIcon,{className:clsx$2(vt.deleteIcon),onClick:Et}));let Wt=null;it&&reactExports.isValidElement(it)&&(Wt=reactExports.cloneElement(it,{className:clsx$2(vt.avatar,it.props.className)}));let zt=null;return ht&&reactExports.isValidElement(ht)&&(zt=reactExports.cloneElement(ht,{className:clsx$2(vt.icon,ht.props.className)})),jsxRuntimeExports.jsxs(ChipRoot,_extends$u({as:Rt,className:clsx$2(vt.root,ot),disabled:jt&&ut?!0:void 0,onClick:pt,onKeyDown:Ct,onKeyUp:Lt,ref:At,tabIndex:kt&&ut?-1:xt,ownerState:$t},It,St,{children:[Wt||zt,jsxRuntimeExports.jsx(ChipLabel,{className:clsx$2(vt.label),ownerState:$t,children:dt}),Ot]}))}),Chip$1=Chip;function formControlState({props:tt,states:et,muiFormControl:nt}){return et.reduce((rt,it)=>(rt[it]=tt[it],nt&&typeof tt[it]>"u"&&(rt[it]=nt[it]),rt),{})}const FormControlContext=reactExports.createContext(void 0),FormControlContext$1=FormControlContext;function useFormControl(){return reactExports.useContext(FormControlContext$1)}function GlobalStyles(tt){return jsxRuntimeExports.jsx(GlobalStyles$1,_extends$u({},tt,{defaultTheme:defaultTheme$1,themeId:THEME_ID}))}function hasValue(tt){return tt!=null&&!(Array.isArray(tt)&&tt.length===0)}function isFilled(tt,et=!1){return tt&&(hasValue(tt.value)&&tt.value!==""||et&&hasValue(tt.defaultValue)&&tt.defaultValue!=="")}function isAdornedStart(tt){return tt.startAdornment}function getInputBaseUtilityClass(tt){return generateUtilityClass("MuiInputBase",tt)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),inputBaseClasses$1=inputBaseClasses,_excluded$1k=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],rootOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.formControl&&et.formControl,nt.startAdornment&&et.adornedStart,nt.endAdornment&&et.adornedEnd,nt.error&&et.error,nt.size==="small"&&et.sizeSmall,nt.multiline&&et.multiline,nt.color&&et[`color${capitalize(nt.color)}`],nt.fullWidth&&et.fullWidth,nt.hiddenLabel&&et.hiddenLabel]},inputOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.input,nt.size==="small"&&et.inputSizeSmall,nt.multiline&&et.inputMultiline,nt.type==="search"&&et.inputTypeSearch,nt.startAdornment&&et.inputAdornedStart,nt.endAdornment&&et.inputAdornedEnd,nt.hiddenLabel&&et.inputHiddenLabel]},useUtilityClasses$P=tt=>{const{classes:et,color:nt,disabled:rt,error:it,endAdornment:ot,focused:at,formControl:st,fullWidth:lt,hiddenLabel:ct,multiline:ut,readOnly:ht,size:dt,startAdornment:pt,type:mt}=tt,gt={root:["root",`color${capitalize(nt)}`,rt&&"disabled",it&&"error",lt&&"fullWidth",at&&"focused",st&&"formControl",dt&&dt!=="medium"&&`size${capitalize(dt)}`,ut&&"multiline",pt&&"adornedStart",ot&&"adornedEnd",ct&&"hiddenLabel",ht&&"readOnly"],input:["input",rt&&"disabled",mt==="search"&&"inputTypeSearch",ut&&"inputMultiline",dt==="small"&&"inputSizeSmall",ct&&"inputHiddenLabel",pt&&"inputAdornedStart",ot&&"inputAdornedEnd",ht&&"readOnly"]};return composeClasses(gt,getInputBaseUtilityClass,et)},InputBaseRoot=styled$1("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body1,{color:(tt.vars||tt).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled,cursor:"default"}},et.multiline&&_extends$u({padding:"4px 0 5px"},et.size==="small"&&{paddingTop:1}),et.fullWidth&&{width:"100%"})),InputBaseComponent=styled$1("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light",rt=_extends$u({color:"currentColor"},tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5},{transition:tt.transitions.create("opacity",{duration:tt.transitions.duration.shorter})}),it={opacity:"0 !important"},ot=tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5};return _extends$u({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":rt,"&::-moz-placeholder":rt,"&:-ms-input-placeholder":rt,"&::-ms-input-placeholder":rt,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses$1.formControl} &`]:{"&::-webkit-input-placeholder":it,"&::-moz-placeholder":it,"&:-ms-input-placeholder":it,"&::-ms-input-placeholder":it,"&:focus::-webkit-input-placeholder":ot,"&:focus::-moz-placeholder":ot,"&:focus:-ms-input-placeholder":ot,"&:focus::-ms-input-placeholder":ot},[`&.${inputBaseClasses$1.disabled}`]:{opacity:1,WebkitTextFillColor:(tt.vars||tt).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},et.size==="small"&&{paddingTop:1},et.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},et.type==="search"&&{MozAppearance:"textfield"})}),inputGlobalStyles=jsxRuntimeExports.jsx(GlobalStyles,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),InputBase=reactExports.forwardRef(function(et,nt){var rt;const it=useThemeProps({props:et,name:"MuiInputBase"}),{"aria-describedby":ot,autoComplete:at,autoFocus:st,className:lt,components:ct={},componentsProps:ut={},defaultValue:ht,disabled:dt,disableInjectingGlobalStyles:pt,endAdornment:mt,fullWidth:gt=!1,id:yt,inputComponent:bt="input",inputProps:wt={},inputRef:xt,maxRows:kt,minRows:St,multiline:Tt=!1,name:At,onBlur:Et,onChange:Ct,onClick:Lt,onFocus:jt,onKeyDown:Rt,onKeyUp:$t,placeholder:vt,readOnly:It,renderSuffix:Ot,rows:Wt,slotProps:zt={},slots:Ft={},startAdornment:Nt,type:Ut="text",value:Pt}=it,Ht=_objectWithoutPropertiesLoose$k(it,_excluded$1k),Qt=wt.value!=null?wt.value:Pt,{current:an}=reactExports.useRef(Qt!=null),Yt=reactExports.useRef(),nn=reactExports.useCallback(Xt=>{},[]),tn=useForkRef(Yt,xt,wt.ref,nn),[dn,wn]=reactExports.useState(!1),rn=useFormControl(),Jt=formControlState({props:it,muiFormControl:rn,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Jt.focused=rn?rn.focused:dn,reactExports.useEffect(()=>{!rn&&dt&&dn&&(wn(!1),Et&&Et())},[rn,dt,dn,Et]);const vn=rn&&rn.onFilled,Cn=rn&&rn.onEmpty,$n=reactExports.useCallback(Xt=>{isFilled(Xt)?vn&&vn():Cn&&Cn()},[vn,Cn]);useEnhancedEffect$1(()=>{an&&$n({value:Qt})},[Qt,$n,an]);const Nn=Xt=>{if(Jt.disabled){Xt.stopPropagation();return}jt&&jt(Xt),wt.onFocus&&wt.onFocus(Xt),rn&&rn.onFocus?rn.onFocus(Xt):wn(!0)},En=Xt=>{Et&&Et(Xt),wt.onBlur&&wt.onBlur(Xt),rn&&rn.onBlur?rn.onBlur(Xt):wn(!1)},sn=(Xt,...Kt)=>{if(!an){const kn=Xt.target||Yt.current;if(kn==null)throw new Error(formatMuiErrorMessage(1));$n({value:kn.value})}wt.onChange&&wt.onChange(Xt,...Kt),Ct&&Ct(Xt,...Kt)};reactExports.useEffect(()=>{$n(Yt.current)},[]);const pn=Xt=>{Yt.current&&Xt.currentTarget===Xt.target&&Yt.current.focus(),Lt&&Lt(Xt)};let Tn=bt,In=wt;Tt&&Tn==="input"&&(Wt?In=_extends$u({type:void 0,minRows:Wt,maxRows:Wt},In):In=_extends$u({type:void 0,maxRows:kt,minRows:St},In),Tn=TextareaAutosize);const yn=Xt=>{$n(Xt.animationName==="mui-auto-fill-cancel"?Yt.current:{value:"x"})};reactExports.useEffect(()=>{rn&&rn.setAdornedStart(!!Nt)},[rn,Nt]);const hn=_extends$u({},it,{color:Jt.color||"primary",disabled:Jt.disabled,endAdornment:mt,error:Jt.error,focused:Jt.focused,formControl:rn,fullWidth:gt,hiddenLabel:Jt.hiddenLabel,multiline:Tt,size:Jt.size,startAdornment:Nt,type:Ut}),fn=useUtilityClasses$P(hn),xn=Ft.root||ct.Root||InputBaseRoot,jn=zt.root||ut.root||{},cn=Ft.input||ct.Input||InputBaseComponent;return In=_extends$u({},In,(rt=zt.input)!=null?rt:ut.input),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!pt&&inputGlobalStyles,jsxRuntimeExports.jsxs(xn,_extends$u({},jn,!isHostComponent(xn)&&{ownerState:_extends$u({},hn,jn.ownerState)},{ref:nt,onClick:pn},Ht,{className:clsx$2(fn.root,jn.className,lt,It&&"MuiInputBase-readOnly"),children:[Nt,jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:null,children:jsxRuntimeExports.jsx(cn,_extends$u({ownerState:hn,"aria-invalid":Jt.error,"aria-describedby":ot,autoComplete:at,autoFocus:st,defaultValue:ht,disabled:Jt.disabled,id:yt,onAnimationStart:yn,name:At,placeholder:vt,readOnly:It,required:Jt.required,rows:Wt,value:Qt,onKeyDown:Rt,onKeyUp:$t,type:Ut},In,!isHostComponent(cn)&&{as:Tn,ownerState:_extends$u({},hn,In.ownerState)},{ref:tn,className:clsx$2(fn.input,In.className,It&&"MuiInputBase-readOnly"),onBlur:En,onChange:sn,onFocus:Nn}))}),mt,Ot?Ot(_extends$u({},Jt,{startAdornment:Nt})):null]}))]})}),InputBase$1=InputBase;function getInputUtilityClass(tt){return generateUtilityClass("MuiInput",tt)}const inputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiInput",["root","underline","input"])),inputClasses$1=inputClasses;function getOutlinedInputUtilityClass(tt){return generateUtilityClass("MuiOutlinedInput",tt)}const outlinedInputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"])),outlinedInputClasses$1=outlinedInputClasses;function getFilledInputUtilityClass(tt){return generateUtilityClass("MuiFilledInput",tt)}const filledInputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiFilledInput",["root","underline","input"])),filledInputClasses$1=filledInputClasses,ArrowDropDownIcon$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),_excluded$1j=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],styles$3={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(et,nt){const rt=useTheme(),it={enter:rt.transitions.duration.enteringScreen,exit:rt.transitions.duration.leavingScreen},{addEndListener:ot,appear:at=!0,children:st,easing:lt,in:ct,onEnter:ut,onEntered:ht,onEntering:dt,onExit:pt,onExited:mt,onExiting:gt,style:yt,timeout:bt=it,TransitionComponent:wt=Transition$2}=et,xt=_objectWithoutPropertiesLoose$k(et,_excluded$1j),kt=reactExports.useRef(null),St=useForkRef(kt,st.ref,nt),Tt=vt=>It=>{if(vt){const Ot=kt.current;It===void 0?vt(Ot):vt(Ot,It)}},At=Tt(dt),Et=Tt((vt,It)=>{reflow(vt);const Ot=getTransitionProps({style:yt,timeout:bt,easing:lt},{mode:"enter"});vt.style.webkitTransition=rt.transitions.create("opacity",Ot),vt.style.transition=rt.transitions.create("opacity",Ot),ut&&ut(vt,It)}),Ct=Tt(ht),Lt=Tt(gt),jt=Tt(vt=>{const It=getTransitionProps({style:yt,timeout:bt,easing:lt},{mode:"exit"});vt.style.webkitTransition=rt.transitions.create("opacity",It),vt.style.transition=rt.transitions.create("opacity",It),pt&&pt(vt)}),Rt=Tt(mt),$t=vt=>{ot&&ot(kt.current,vt)};return jsxRuntimeExports.jsx(wt,_extends$u({appear:at,in:ct,nodeRef:kt,onEnter:Et,onEntered:Ct,onEntering:At,onExit:jt,onExited:Rt,onExiting:Lt,addEndListener:$t,timeout:bt},xt,{children:(vt,It)=>reactExports.cloneElement(st,_extends$u({style:_extends$u({opacity:0,visibility:vt==="exited"&&!ct?"hidden":void 0},styles$3[vt],yt,st.props.style),ref:St},It))}))}),Fade$1=Fade;function getBackdropUtilityClass(tt){return generateUtilityClass("MuiBackdrop",tt)}generateUtilityClasses("MuiBackdrop",["root","invisible"]);const _excluded$1i=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],useUtilityClasses$O=tt=>{const{classes:et,invisible:nt}=tt;return composeClasses({root:["root",nt&&"invisible"]},getBackdropUtilityClass,et)},BackdropRoot=styled$1("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.invisible&&et.invisible]}})(({ownerState:tt})=>_extends$u({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},tt.invisible&&{backgroundColor:"transparent"})),Backdrop=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useThemeProps({props:et,name:"MuiBackdrop"}),{children:st,className:lt,component:ct="div",components:ut={},componentsProps:ht={},invisible:dt=!1,open:pt,slotProps:mt={},slots:gt={},TransitionComponent:yt=Fade$1,transitionDuration:bt}=at,wt=_objectWithoutPropertiesLoose$k(at,_excluded$1i),xt=_extends$u({},at,{component:ct,invisible:dt}),kt=useUtilityClasses$O(xt),St=(rt=mt.root)!=null?rt:ht.root;return jsxRuntimeExports.jsx(yt,_extends$u({in:pt,timeout:bt},wt,{children:jsxRuntimeExports.jsx(BackdropRoot,_extends$u({"aria-hidden":!0},St,{as:(it=(ot=gt.root)!=null?ot:ut.Root)!=null?it:ct,className:clsx$2(kt.root,lt,St==null?void 0:St.className),ownerState:_extends$u({},xt,St==null?void 0:St.ownerState),classes:kt,ref:nt,children:st}))}))}),Backdrop$1=Backdrop;function getButtonUtilityClass(tt){return generateUtilityClass("MuiButton",tt)}const buttonClasses=generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),buttonClasses$1=buttonClasses,ButtonGroupContext=reactExports.createContext({}),ButtonGroupContext$1=ButtonGroupContext,ButtonGroupButtonContext=reactExports.createContext(void 0),ButtonGroupButtonContext$1=ButtonGroupButtonContext,_excluded$1h=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],useUtilityClasses$N=tt=>{const{color:et,disableElevation:nt,fullWidth:rt,size:it,variant:ot,classes:at}=tt,st={root:["root",ot,`${ot}${capitalize(et)}`,`size${capitalize(it)}`,`${ot}Size${capitalize(it)}`,et==="inherit"&&"colorInherit",nt&&"disableElevation",rt&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${capitalize(it)}`],endIcon:["endIcon",`iconSize${capitalize(it)}`]},lt=composeClasses(st,getButtonUtilityClass,at);return _extends$u({},at,lt)},commonIconStyles=tt=>_extends$u({},tt.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},tt.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},tt.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),ButtonRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`${nt.variant}${capitalize(nt.color)}`],et[`size${capitalize(nt.size)}`],et[`${nt.variant}Size${capitalize(nt.size)}`],nt.color==="inherit"&&et.colorInherit,nt.disableElevation&&et.disableElevation,nt.fullWidth&&et.fullWidth]}})(({theme:tt,ownerState:et})=>{var nt,rt;const it=tt.palette.mode==="light"?tt.palette.grey[300]:tt.palette.grey[800],ot=tt.palette.mode==="light"?tt.palette.grey.A100:tt.palette.grey[700];return _extends$u({},tt.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create(["background-color","box-shadow","border-color","color"],{duration:tt.transitions.duration.short}),"&:hover":_extends$u({textDecoration:"none",backgroundColor:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.text.primary,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="text"&&et.color!=="inherit"&&{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="outlined"&&et.color!=="inherit"&&{border:`1px solid ${(tt.vars||tt).palette[et.color].main}`,backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="contained"&&{backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedHoverBg:ot,boxShadow:(tt.vars||tt).shadows[4],"@media (hover: none)":{boxShadow:(tt.vars||tt).shadows[2],backgroundColor:(tt.vars||tt).palette.grey[300]}},et.variant==="contained"&&et.color!=="inherit"&&{backgroundColor:(tt.vars||tt).palette[et.color].dark,"@media (hover: none)":{backgroundColor:(tt.vars||tt).palette[et.color].main}}),"&:active":_extends$u({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[8]}),[`&.${buttonClasses$1.focusVisible}`]:_extends$u({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[6]}),[`&.${buttonClasses$1.disabled}`]:_extends$u({color:(tt.vars||tt).palette.action.disabled},et.variant==="outlined"&&{border:`1px solid ${(tt.vars||tt).palette.action.disabledBackground}`},et.variant==="contained"&&{color:(tt.vars||tt).palette.action.disabled,boxShadow:(tt.vars||tt).shadows[0],backgroundColor:(tt.vars||tt).palette.action.disabledBackground})},et.variant==="text"&&{padding:"6px 8px"},et.variant==="text"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main},et.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},et.variant==="outlined"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main,border:tt.vars?`1px solid rgba(${tt.vars.palette[et.color].mainChannel} / 0.5)`:`1px solid ${alpha$1(tt.palette[et.color].main,.5)}`},et.variant==="contained"&&{color:tt.vars?tt.vars.palette.text.primary:(nt=(rt=tt.palette).getContrastText)==null?void 0:nt.call(rt,tt.palette.grey[300]),backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedBg:it,boxShadow:(tt.vars||tt).shadows[2]},et.variant==="contained"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].contrastText,backgroundColor:(tt.vars||tt).palette[et.color].main},et.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},et.size==="small"&&et.variant==="text"&&{padding:"4px 5px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="text"&&{padding:"8px 11px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="outlined"&&{padding:"3px 9px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="outlined"&&{padding:"7px 21px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="contained"&&{padding:"4px 10px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="contained"&&{padding:"8px 22px",fontSize:tt.typography.pxToRem(15)},et.fullWidth&&{width:"100%"})},({ownerState:tt})=>tt.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${buttonClasses$1.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${buttonClasses$1.disabled}`]:{boxShadow:"none"}}),ButtonStartIcon=styled$1("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.startIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$u({display:"inherit",marginRight:8,marginLeft:-4},tt.size==="small"&&{marginLeft:-2},commonIconStyles(tt))),ButtonEndIcon=styled$1("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.endIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$u({display:"inherit",marginRight:-4,marginLeft:8},tt.size==="small"&&{marginRight:-2},commonIconStyles(tt))),Button$1=reactExports.forwardRef(function(et,nt){const rt=reactExports.useContext(ButtonGroupContext$1),it=reactExports.useContext(ButtonGroupButtonContext$1),ot=resolveProps(rt,et),at=useThemeProps({props:ot,name:"MuiButton"}),{children:st,color:lt="primary",component:ct="button",className:ut,disabled:ht=!1,disableElevation:dt=!1,disableFocusRipple:pt=!1,endIcon:mt,focusVisibleClassName:gt,fullWidth:yt=!1,size:bt="medium",startIcon:wt,type:xt,variant:kt="text"}=at,St=_objectWithoutPropertiesLoose$k(at,_excluded$1h),Tt=_extends$u({},at,{color:lt,component:ct,disabled:ht,disableElevation:dt,disableFocusRipple:pt,fullWidth:yt,size:bt,type:xt,variant:kt}),At=useUtilityClasses$N(Tt),Et=wt&&jsxRuntimeExports.jsx(ButtonStartIcon,{className:At.startIcon,ownerState:Tt,children:wt}),Ct=mt&&jsxRuntimeExports.jsx(ButtonEndIcon,{className:At.endIcon,ownerState:Tt,children:mt}),Lt=it||"";return jsxRuntimeExports.jsxs(ButtonRoot,_extends$u({ownerState:Tt,className:clsx$2(rt.className,At.root,ut,Lt),component:ct,disabled:ht,focusRipple:!pt,focusVisibleClassName:clsx$2(At.focusVisible,gt),ref:nt,type:xt},St,{classes:At,children:[Et,st,Ct]}))}),Button$2=Button$1;function getModalUtilityClass(tt){return generateUtilityClass("MuiModal",tt)}generateUtilityClasses("MuiModal",["root","hidden","backdrop"]);const _excluded$1g=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],useUtilityClasses$M=tt=>{const{open:et,exited:nt,classes:rt}=tt;return composeClasses({root:["root",!et&&nt&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,rt)},ModalRoot=styled$1("div",{name:"MuiModal",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.open&&nt.exited&&et.hidden]}})(({theme:tt,ownerState:et})=>_extends$u({position:"fixed",zIndex:(tt.vars||tt).zIndex.modal,right:0,bottom:0,top:0,left:0},!et.open&&et.exited&&{visibility:"hidden"})),ModalBackdrop=styled$1(Backdrop$1,{name:"MuiModal",slot:"Backdrop",overridesResolver:(tt,et)=>et.backdrop})({zIndex:-1}),Modal=reactExports.forwardRef(function(et,nt){var rt,it,ot,at,st,lt;const ct=useThemeProps({name:"MuiModal",props:et}),{BackdropComponent:ut=ModalBackdrop,BackdropProps:ht,className:dt,closeAfterTransition:pt=!1,children:mt,container:gt,component:yt,components:bt={},componentsProps:wt={},disableAutoFocus:xt=!1,disableEnforceFocus:kt=!1,disableEscapeKeyDown:St=!1,disablePortal:Tt=!1,disableRestoreFocus:At=!1,disableScrollLock:Et=!1,hideBackdrop:Ct=!1,keepMounted:Lt=!1,onBackdropClick:jt,open:Rt,slotProps:$t,slots:vt}=ct,It=_objectWithoutPropertiesLoose$k(ct,_excluded$1g),Ot=_extends$u({},ct,{closeAfterTransition:pt,disableAutoFocus:xt,disableEnforceFocus:kt,disableEscapeKeyDown:St,disablePortal:Tt,disableRestoreFocus:At,disableScrollLock:Et,hideBackdrop:Ct,keepMounted:Lt}),{getRootProps:Wt,getBackdropProps:zt,getTransitionProps:Ft,portalRef:Nt,isTopModal:Ut,exited:Pt,hasTransition:Ht}=useModal$1(_extends$u({},Ot,{rootRef:nt})),Qt=_extends$u({},Ot,{exited:Pt}),an=useUtilityClasses$M(Qt),Yt={};if(mt.props.tabIndex===void 0&&(Yt.tabIndex="-1"),Ht){const{onEnter:vn,onExited:Cn}=Ft();Yt.onEnter=vn,Yt.onExited=Cn}const nn=(rt=(it=vt==null?void 0:vt.root)!=null?it:bt.Root)!=null?rt:ModalRoot,tn=(ot=(at=vt==null?void 0:vt.backdrop)!=null?at:bt.Backdrop)!=null?ot:ut,dn=(st=$t==null?void 0:$t.root)!=null?st:wt.root,wn=(lt=$t==null?void 0:$t.backdrop)!=null?lt:wt.backdrop,rn=useSlotProps({elementType:nn,externalSlotProps:dn,externalForwardedProps:It,getSlotProps:Wt,additionalProps:{ref:nt,as:yt},ownerState:Qt,className:clsx$2(dt,dn==null?void 0:dn.className,an==null?void 0:an.root,!Qt.open&&Qt.exited&&(an==null?void 0:an.hidden))}),Jt=useSlotProps({elementType:tn,externalSlotProps:wn,additionalProps:ht,getSlotProps:vn=>zt(_extends$u({},vn,{onClick:Cn=>{jt&&jt(Cn),vn!=null&&vn.onClick&&vn.onClick(Cn)}})),className:clsx$2(wn==null?void 0:wn.className,ht==null?void 0:ht.className,an==null?void 0:an.backdrop),ownerState:Qt});return!Lt&&!Rt&&(!Ht||Pt)?null:jsxRuntimeExports.jsx(Portal,{ref:Nt,container:gt,disablePortal:Tt,children:jsxRuntimeExports.jsxs(nn,_extends$u({},rn,{children:[!Ct&&ut?jsxRuntimeExports.jsx(tn,_extends$u({},Jt)):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:kt,disableAutoFocus:xt,disableRestoreFocus:At,isEnabled:Ut,open:Rt,children:reactExports.cloneElement(mt,Yt)})]}))})}),Modal$1=Modal;function getDialogUtilityClass(tt){return generateUtilityClass("MuiDialog",tt)}const dialogClasses=generateUtilityClasses("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),dialogClasses$1=dialogClasses,DialogContext=reactExports.createContext({}),DialogContext$1=DialogContext,_excluded$1f=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],DialogBackdrop=styled$1(Backdrop$1,{name:"MuiDialog",slot:"Backdrop",overrides:(tt,et)=>et.backdrop})({zIndex:-1}),useUtilityClasses$L=tt=>{const{classes:et,scroll:nt,maxWidth:rt,fullWidth:it,fullScreen:ot}=tt,at={root:["root"],container:["container",`scroll${capitalize(nt)}`],paper:["paper",`paperScroll${capitalize(nt)}`,`paperWidth${capitalize(String(rt))}`,it&&"paperFullWidth",ot&&"paperFullScreen"]};return composeClasses(at,getDialogUtilityClass,et)},DialogRoot=styled$1(Modal$1,{name:"MuiDialog",slot:"Root",overridesResolver:(tt,et)=>et.root})({"@media print":{position:"absolute !important"}}),DialogContainer=styled$1("div",{name:"MuiDialog",slot:"Container",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.container,et[`scroll${capitalize(nt.scroll)}`]]}})(({ownerState:tt})=>_extends$u({height:"100%","@media print":{height:"auto"},outline:0},tt.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},tt.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),DialogPaper=styled$1(Paper$1,{name:"MuiDialog",slot:"Paper",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.paper,et[`scrollPaper${capitalize(nt.scroll)}`],et[`paperWidth${capitalize(String(nt.maxWidth))}`],nt.fullWidth&&et.paperFullWidth,nt.fullScreen&&et.paperFullScreen]}})(({theme:tt,ownerState:et})=>_extends$u({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},et.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},et.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!et.maxWidth&&{maxWidth:"calc(100% - 64px)"},et.maxWidth==="xs"&&{maxWidth:tt.breakpoints.unit==="px"?Math.max(tt.breakpoints.values.xs,444):`max(${tt.breakpoints.values.xs}${tt.breakpoints.unit}, 444px)`,[`&.${dialogClasses$1.paperScrollBody}`]:{[tt.breakpoints.down(Math.max(tt.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},et.maxWidth&&et.maxWidth!=="xs"&&{maxWidth:`${tt.breakpoints.values[et.maxWidth]}${tt.breakpoints.unit}`,[`&.${dialogClasses$1.paperScrollBody}`]:{[tt.breakpoints.down(tt.breakpoints.values[et.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},et.fullWidth&&{width:"calc(100% - 64px)"},et.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${dialogClasses$1.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Dialog=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDialog"}),it=useTheme(),ot={enter:it.transitions.duration.enteringScreen,exit:it.transitions.duration.leavingScreen},{"aria-describedby":at,"aria-labelledby":st,BackdropComponent:lt,BackdropProps:ct,children:ut,className:ht,disableEscapeKeyDown:dt=!1,fullScreen:pt=!1,fullWidth:mt=!1,maxWidth:gt="sm",onBackdropClick:yt,onClose:bt,open:wt,PaperComponent:xt=Paper$1,PaperProps:kt={},scroll:St="paper",TransitionComponent:Tt=Fade$1,transitionDuration:At=ot,TransitionProps:Et}=rt,Ct=_objectWithoutPropertiesLoose$k(rt,_excluded$1f),Lt=_extends$u({},rt,{disableEscapeKeyDown:dt,fullScreen:pt,fullWidth:mt,maxWidth:gt,scroll:St}),jt=useUtilityClasses$L(Lt),Rt=reactExports.useRef(),$t=Wt=>{Rt.current=Wt.target===Wt.currentTarget},vt=Wt=>{Rt.current&&(Rt.current=null,yt&&yt(Wt),bt&&bt(Wt,"backdropClick"))},It=useId(st),Ot=reactExports.useMemo(()=>({titleId:It}),[It]);return jsxRuntimeExports.jsx(DialogRoot,_extends$u({className:clsx$2(jt.root,ht),closeAfterTransition:!0,components:{Backdrop:DialogBackdrop},componentsProps:{backdrop:_extends$u({transitionDuration:At,as:lt},ct)},disableEscapeKeyDown:dt,onClose:bt,open:wt,ref:nt,onClick:vt,ownerState:Lt},Ct,{children:jsxRuntimeExports.jsx(Tt,_extends$u({appear:!0,in:wt,timeout:At,role:"presentation"},Et,{children:jsxRuntimeExports.jsx(DialogContainer,{className:clsx$2(jt.container),onMouseDown:$t,ownerState:Lt,children:jsxRuntimeExports.jsx(DialogPaper,_extends$u({as:xt,elevation:24,role:"dialog","aria-describedby":at,"aria-labelledby":It},kt,{className:clsx$2(jt.paper,kt.className),ownerState:Lt,children:jsxRuntimeExports.jsx(DialogContext$1.Provider,{value:Ot,children:ut})}))})}))}))}),MuiDialog=Dialog;function getDialogActionsUtilityClass(tt){return generateUtilityClass("MuiDialogActions",tt)}generateUtilityClasses("MuiDialogActions",["root","spacing"]);const _excluded$1e=["className","disableSpacing"],useUtilityClasses$K=tt=>{const{classes:et,disableSpacing:nt}=tt;return composeClasses({root:["root",!nt&&"spacing"]},getDialogActionsUtilityClass,et)},DialogActionsRoot=styled$1("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disableSpacing&&et.spacing]}})(({ownerState:tt})=>_extends$u({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!tt.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),DialogActions=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDialogActions"}),{className:it,disableSpacing:ot=!1}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$1e),st=_extends$u({},rt,{disableSpacing:ot}),lt=useUtilityClasses$K(st);return jsxRuntimeExports.jsx(DialogActionsRoot,_extends$u({className:clsx$2(lt.root,it),ownerState:st,ref:nt},at))}),DialogActions$1=DialogActions;function getDialogContentUtilityClass(tt){return generateUtilityClass("MuiDialogContent",tt)}generateUtilityClasses("MuiDialogContent",["root","dividers"]);const dialogTitleClasses=generateUtilityClasses("MuiDialogTitle",["root"]),dialogTitleClasses$1=dialogTitleClasses,_excluded$1d=["className","dividers"],useUtilityClasses$J=tt=>{const{classes:et,dividers:nt}=tt;return composeClasses({root:["root",nt&&"dividers"]},getDialogContentUtilityClass,et)},DialogContentRoot=styled$1("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dividers&&et.dividers]}})(({theme:tt,ownerState:et})=>_extends$u({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},et.dividers?{padding:"16px 24px",borderTop:`1px solid ${(tt.vars||tt).palette.divider}`,borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`}:{[`.${dialogTitleClasses$1.root} + &`]:{paddingTop:0}})),DialogContent=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDialogContent"}),{className:it,dividers:ot=!1}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$1d),st=_extends$u({},rt,{dividers:ot}),lt=useUtilityClasses$J(st);return jsxRuntimeExports.jsx(DialogContentRoot,_extends$u({className:clsx$2(lt.root,it),ownerState:st,ref:nt},at))}),DialogContent$1=DialogContent;function getDividerUtilityClass(tt){return generateUtilityClass("MuiDivider",tt)}const dividerClasses=generateUtilityClasses("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),_excluded$1c=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],useUtilityClasses$I=tt=>{const{absolute:et,children:nt,classes:rt,flexItem:it,light:ot,orientation:at,textAlign:st,variant:lt}=tt;return composeClasses({root:["root",et&&"absolute",lt,ot&&"light",at==="vertical"&&"vertical",it&&"flexItem",nt&&"withChildren",nt&&at==="vertical"&&"withChildrenVertical",st==="right"&&at!=="vertical"&&"textAlignRight",st==="left"&&at!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",at==="vertical"&&"wrapperVertical"]},getDividerUtilityClass,rt)},DividerRoot=styled$1("div",{name:"MuiDivider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.absolute&&et.absolute,et[nt.variant],nt.light&&et.light,nt.orientation==="vertical"&&et.vertical,nt.flexItem&&et.flexItem,nt.children&&et.withChildren,nt.children&&nt.orientation==="vertical"&&et.withChildrenVertical,nt.textAlign==="right"&&nt.orientation!=="vertical"&&et.textAlignRight,nt.textAlign==="left"&&nt.orientation!=="vertical"&&et.textAlignLeft]}})(({theme:tt,ownerState:et})=>_extends$u({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(tt.vars||tt).palette.divider,borderBottomWidth:"thin"},et.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},et.light&&{borderColor:tt.vars?`rgba(${tt.vars.palette.dividerChannel} / 0.08)`:alpha$1(tt.palette.divider,.08)},et.variant==="inset"&&{marginLeft:72},et.variant==="middle"&&et.orientation==="horizontal"&&{marginLeft:tt.spacing(2),marginRight:tt.spacing(2)},et.variant==="middle"&&et.orientation==="vertical"&&{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},et.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},et.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:tt})=>_extends$u({},tt.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:tt,ownerState:et})=>_extends$u({},et.children&&et.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(tt.vars||tt).palette.divider}`}}),({theme:tt,ownerState:et})=>_extends$u({},et.children&&et.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(tt.vars||tt).palette.divider}`}}),({ownerState:tt})=>_extends$u({},tt.textAlign==="right"&&tt.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},tt.textAlign==="left"&&tt.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),DividerWrapper=styled$1("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.wrapper,nt.orientation==="vertical"&&et.wrapperVertical]}})(({theme:tt,ownerState:et})=>_extends$u({display:"inline-block",paddingLeft:`calc(${tt.spacing(1)} * 1.2)`,paddingRight:`calc(${tt.spacing(1)} * 1.2)`},et.orientation==="vertical"&&{paddingTop:`calc(${tt.spacing(1)} * 1.2)`,paddingBottom:`calc(${tt.spacing(1)} * 1.2)`})),Divider$2=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDivider"}),{absolute:it=!1,children:ot,className:at,component:st=ot?"div":"hr",flexItem:lt=!1,light:ct=!1,orientation:ut="horizontal",role:ht=st!=="hr"?"separator":void 0,textAlign:dt="center",variant:pt="fullWidth"}=rt,mt=_objectWithoutPropertiesLoose$k(rt,_excluded$1c),gt=_extends$u({},rt,{absolute:it,component:st,flexItem:lt,light:ct,orientation:ut,role:ht,textAlign:dt,variant:pt}),yt=useUtilityClasses$I(gt);return jsxRuntimeExports.jsx(DividerRoot,_extends$u({as:st,className:clsx$2(yt.root,at),role:ht,ref:nt,ownerState:gt},mt,{children:ot?jsxRuntimeExports.jsx(DividerWrapper,{className:yt.wrapper,ownerState:gt,children:ot}):null}))});Divider$2.muiSkipListHighlight=!0;const Divider$3=Divider$2,_excluded$1b=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getTranslateValue(tt,et,nt){const rt=et.getBoundingClientRect(),it=nt&&nt.getBoundingClientRect(),ot=ownerWindow(et);let at;if(et.fakeTransform)at=et.fakeTransform;else{const ct=ot.getComputedStyle(et);at=ct.getPropertyValue("-webkit-transform")||ct.getPropertyValue("transform")}let st=0,lt=0;if(at&&at!=="none"&&typeof at=="string"){const ct=at.split("(")[1].split(")")[0].split(",");st=parseInt(ct[4],10),lt=parseInt(ct[5],10)}return tt==="left"?it?`translateX(${it.right+st-rt.left}px)`:`translateX(${ot.innerWidth+st-rt.left}px)`:tt==="right"?it?`translateX(-${rt.right-it.left-st}px)`:`translateX(-${rt.left+rt.width-st}px)`:tt==="up"?it?`translateY(${it.bottom+lt-rt.top}px)`:`translateY(${ot.innerHeight+lt-rt.top}px)`:it?`translateY(-${rt.top-it.top+rt.height-lt}px)`:`translateY(-${rt.top+rt.height-lt}px)`}function resolveContainer(tt){return typeof tt=="function"?tt():tt}function setTranslateValue(tt,et,nt){const rt=resolveContainer(nt),it=getTranslateValue(tt,et,rt);it&&(et.style.webkitTransform=it,et.style.transform=it)}const Slide=reactExports.forwardRef(function(et,nt){const rt=useTheme(),it={enter:rt.transitions.easing.easeOut,exit:rt.transitions.easing.sharp},ot={enter:rt.transitions.duration.enteringScreen,exit:rt.transitions.duration.leavingScreen},{addEndListener:at,appear:st=!0,children:lt,container:ct,direction:ut="down",easing:ht=it,in:dt,onEnter:pt,onEntered:mt,onEntering:gt,onExit:yt,onExited:bt,onExiting:wt,style:xt,timeout:kt=ot,TransitionComponent:St=Transition$2}=et,Tt=_objectWithoutPropertiesLoose$k(et,_excluded$1b),At=reactExports.useRef(null),Et=useForkRef(lt.ref,At,nt),Ct=zt=>Ft=>{zt&&(Ft===void 0?zt(At.current):zt(At.current,Ft))},Lt=Ct((zt,Ft)=>{setTranslateValue(ut,zt,ct),reflow(zt),pt&&pt(zt,Ft)}),jt=Ct((zt,Ft)=>{const Nt=getTransitionProps({timeout:kt,style:xt,easing:ht},{mode:"enter"});zt.style.webkitTransition=rt.transitions.create("-webkit-transform",_extends$u({},Nt)),zt.style.transition=rt.transitions.create("transform",_extends$u({},Nt)),zt.style.webkitTransform="none",zt.style.transform="none",gt&>(zt,Ft)}),Rt=Ct(mt),$t=Ct(wt),vt=Ct(zt=>{const Ft=getTransitionProps({timeout:kt,style:xt,easing:ht},{mode:"exit"});zt.style.webkitTransition=rt.transitions.create("-webkit-transform",Ft),zt.style.transition=rt.transitions.create("transform",Ft),setTranslateValue(ut,zt,ct),yt&&yt(zt)}),It=Ct(zt=>{zt.style.webkitTransition="",zt.style.transition="",bt&&bt(zt)}),Ot=zt=>{at&&at(At.current,zt)},Wt=reactExports.useCallback(()=>{At.current&&setTranslateValue(ut,At.current,ct)},[ut,ct]);return reactExports.useEffect(()=>{if(dt||ut==="down"||ut==="right")return;const zt=debounce$4(()=>{At.current&&setTranslateValue(ut,At.current,ct)}),Ft=ownerWindow(At.current);return Ft.addEventListener("resize",zt),()=>{zt.clear(),Ft.removeEventListener("resize",zt)}},[ut,dt,ct]),reactExports.useEffect(()=>{dt||Wt()},[dt,Wt]),jsxRuntimeExports.jsx(St,_extends$u({nodeRef:At,onEnter:Lt,onEntered:Rt,onEntering:jt,onExit:vt,onExited:It,onExiting:$t,addEndListener:Ot,appear:st,in:dt,timeout:kt},Tt,{children:(zt,Ft)=>reactExports.cloneElement(lt,_extends$u({ref:Et,style:_extends$u({visibility:zt==="exited"&&!dt?"hidden":void 0},xt,lt.props.style)},Ft))}))}),Slide$1=Slide,_excluded$1a=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$H=tt=>{const{classes:et,disableUnderline:nt}=tt,it=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getFilledInputUtilityClass,et);return _extends$u({},et,it)},FilledInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{var nt;const rt=tt.palette.mode==="light",it=rt?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",ot=rt?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",at=rt?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",st=rt?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return _extends$u({position:"relative",backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot,borderTopLeftRadius:(tt.vars||tt).shape.borderRadius,borderTopRightRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),"&:hover":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.hoverBg:at,"@media (hover: none)":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot}},[`&.${filledInputClasses$1.focused}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot},[`&.${filledInputClasses$1.disabled}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.disabledBg:st}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(nt=(tt.vars||tt).palette[et.color||"primary"])==null?void 0:nt.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`:it}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses$1.disabled}, .${filledInputClasses$1.error}):before`]:{borderBottom:`1px solid ${(tt.vars||tt).palette.text.primary}`},[`&.${filledInputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}},et.startAdornment&&{paddingLeft:12},et.endAdornment&&{paddingRight:12},et.multiline&&_extends$u({padding:"25px 12px 8px"},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17}))}),FilledInputInput=styled$1(InputBaseComponent,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17},et.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0},et.hiddenLabel&&et.size==="small"&&{paddingTop:8,paddingBottom:9})),FilledInput=reactExports.forwardRef(function(et,nt){var rt,it,ot,at;const st=useThemeProps({props:et,name:"MuiFilledInput"}),{components:lt={},componentsProps:ct,fullWidth:ut=!1,inputComponent:ht="input",multiline:dt=!1,slotProps:pt,slots:mt={},type:gt="text"}=st,yt=_objectWithoutPropertiesLoose$k(st,_excluded$1a),bt=_extends$u({},st,{fullWidth:ut,inputComponent:ht,multiline:dt,type:gt}),wt=useUtilityClasses$H(st),xt={root:{ownerState:bt},input:{ownerState:bt}},kt=pt??ct?deepmerge$1(pt??ct,xt):xt,St=(rt=(it=mt.root)!=null?it:lt.Root)!=null?rt:FilledInputRoot,Tt=(ot=(at=mt.input)!=null?at:lt.Input)!=null?ot:FilledInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:St,input:Tt},componentsProps:kt,fullWidth:ut,inputComponent:ht,multiline:dt,ref:nt,type:gt},yt,{classes:wt}))});FilledInput.muiName="Input";const FilledInput$1=FilledInput;function getFormControlUtilityClasses(tt){return generateUtilityClass("MuiFormControl",tt)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _excluded$19=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],useUtilityClasses$G=tt=>{const{classes:et,margin:nt,fullWidth:rt}=tt,it={root:["root",nt!=="none"&&`margin${capitalize(nt)}`,rt&&"fullWidth"]};return composeClasses(it,getFormControlUtilityClasses,et)},FormControlRoot=styled$1("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$u({},et.root,et[`margin${capitalize(tt.margin)}`],tt.fullWidth&&et.fullWidth)})(({ownerState:tt})=>_extends$u({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},tt.margin==="normal"&&{marginTop:16,marginBottom:8},tt.margin==="dense"&&{marginTop:8,marginBottom:4},tt.fullWidth&&{width:"100%"})),FormControl=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiFormControl"}),{children:it,className:ot,color:at="primary",component:st="div",disabled:lt=!1,error:ct=!1,focused:ut,fullWidth:ht=!1,hiddenLabel:dt=!1,margin:pt="none",required:mt=!1,size:gt="medium",variant:yt="outlined"}=rt,bt=_objectWithoutPropertiesLoose$k(rt,_excluded$19),wt=_extends$u({},rt,{color:at,component:st,disabled:lt,error:ct,fullWidth:ht,hiddenLabel:dt,margin:pt,required:mt,size:gt,variant:yt}),xt=useUtilityClasses$G(wt),[kt,St]=reactExports.useState(()=>{let $t=!1;return it&&reactExports.Children.forEach(it,vt=>{if(!isMuiElement(vt,["Input","Select"]))return;const It=isMuiElement(vt,["Select"])?vt.props.input:vt;It&&isAdornedStart(It.props)&&($t=!0)}),$t}),[Tt,At]=reactExports.useState(()=>{let $t=!1;return it&&reactExports.Children.forEach(it,vt=>{isMuiElement(vt,["Input","Select"])&&(isFilled(vt.props,!0)||isFilled(vt.props.inputProps,!0))&&($t=!0)}),$t}),[Et,Ct]=reactExports.useState(!1);lt&&Et&&Ct(!1);const Lt=ut!==void 0&&!lt?ut:Et;let jt;const Rt=reactExports.useMemo(()=>({adornedStart:kt,setAdornedStart:St,color:at,disabled:lt,error:ct,filled:Tt,focused:Lt,fullWidth:ht,hiddenLabel:dt,size:gt,onBlur:()=>{Ct(!1)},onEmpty:()=>{At(!1)},onFilled:()=>{At(!0)},onFocus:()=>{Ct(!0)},registerEffect:jt,required:mt,variant:yt}),[kt,at,lt,ct,Tt,Lt,ht,dt,jt,mt,gt,yt]);return jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:Rt,children:jsxRuntimeExports.jsx(FormControlRoot,_extends$u({as:st,ownerState:wt,className:clsx$2(xt.root,ot),ref:nt},bt,{children:it}))})}),FormControl$1=FormControl,Stack$2=createStack({createStyledComponent:styled$1("div",{name:"MuiStack",slot:"Root",overridesResolver:(tt,et)=>et.root}),useThemeProps:tt=>useThemeProps({props:tt,name:"MuiStack"})}),Stack$3=Stack$2;function getFormHelperTextUtilityClasses(tt){return generateUtilityClass("MuiFormHelperText",tt)}const formHelperTextClasses=generateUtilityClasses("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),formHelperTextClasses$1=formHelperTextClasses;var _span$3;const _excluded$18=["children","className","component","disabled","error","filled","focused","margin","required","variant"],useUtilityClasses$F=tt=>{const{classes:et,contained:nt,size:rt,disabled:it,error:ot,filled:at,focused:st,required:lt}=tt,ct={root:["root",it&&"disabled",ot&&"error",rt&&`size${capitalize(rt)}`,nt&&"contained",st&&"focused",at&&"filled",lt&&"required"]};return composeClasses(ct,getFormHelperTextUtilityClasses,et)},FormHelperTextRoot=styled$1("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.size&&et[`size${capitalize(nt.size)}`],nt.contained&&et.contained,nt.filled&&et.filled]}})(({theme:tt,ownerState:et})=>_extends$u({color:(tt.vars||tt).palette.text.secondary},tt.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${formHelperTextClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${formHelperTextClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}},et.size==="small"&&{marginTop:4},et.contained&&{marginLeft:14,marginRight:14})),FormHelperText=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiFormHelperText"}),{children:it,className:ot,component:at="p"}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$18),lt=useFormControl(),ct=formControlState({props:rt,muiFormControl:lt,states:["variant","size","disabled","error","filled","focused","required"]}),ut=_extends$u({},rt,{component:at,contained:ct.variant==="filled"||ct.variant==="outlined",variant:ct.variant,size:ct.size,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),ht=useUtilityClasses$F(ut);return jsxRuntimeExports.jsx(FormHelperTextRoot,_extends$u({as:at,ownerState:ut,className:clsx$2(ht.root,ot),ref:nt},st,{children:it===" "?_span$3||(_span$3=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"})):it}))}),FormHelperText$1=FormHelperText;function getFormLabelUtilityClasses(tt){return generateUtilityClass("MuiFormLabel",tt)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),formLabelClasses$1=formLabelClasses,_excluded$17=["children","className","color","component","disabled","error","filled","focused","required"],useUtilityClasses$E=tt=>{const{classes:et,color:nt,focused:rt,disabled:it,error:ot,filled:at,required:st}=tt,lt={root:["root",`color${capitalize(nt)}`,it&&"disabled",ot&&"error",at&&"filled",rt&&"focused",st&&"required"],asterisk:["asterisk",ot&&"error"]};return composeClasses(lt,getFormLabelUtilityClasses,et)},FormLabelRoot=styled$1("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$u({},et.root,tt.color==="secondary"&&et.colorSecondary,tt.filled&&et.filled)})(({theme:tt,ownerState:et})=>_extends$u({color:(tt.vars||tt).palette.text.secondary},tt.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${formLabelClasses$1.focused}`]:{color:(tt.vars||tt).palette[et.color].main},[`&.${formLabelClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),AsteriskComponent=styled$1("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(tt,et)=>et.asterisk})(({theme:tt})=>({[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),FormLabel=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiFormLabel"}),{children:it,className:ot,component:at="label"}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$17),lt=useFormControl(),ct=formControlState({props:rt,muiFormControl:lt,states:["color","required","focused","disabled","error","filled"]}),ut=_extends$u({},rt,{color:ct.color||"primary",component:at,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),ht=useUtilityClasses$E(ut);return jsxRuntimeExports.jsxs(FormLabelRoot,_extends$u({as:at,ownerState:ut,className:clsx$2(ht.root,ot),ref:nt},st,{children:[it,ct.required&&jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:ut,"aria-hidden":!0,className:ht.asterisk,children:[" ","*"]})]}))}),FormLabel$1=FormLabel,_excluded$16=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getScale(tt){return`scale(${tt}, ${tt**2})`}const styles$2={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(et,nt){const{addEndListener:rt,appear:it=!0,children:ot,easing:at,in:st,onEnter:lt,onEntered:ct,onEntering:ut,onExit:ht,onExited:dt,onExiting:pt,style:mt,timeout:gt="auto",TransitionComponent:yt=Transition$2}=et,bt=_objectWithoutPropertiesLoose$k(et,_excluded$16),wt=reactExports.useRef(),xt=reactExports.useRef(),kt=useTheme(),St=reactExports.useRef(null),Tt=useForkRef(St,ot.ref,nt),At=It=>Ot=>{if(It){const Wt=St.current;Ot===void 0?It(Wt):It(Wt,Ot)}},Et=At(ut),Ct=At((It,Ot)=>{reflow(It);const{duration:Wt,delay:zt,easing:Ft}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"enter"});let Nt;gt==="auto"?(Nt=kt.transitions.getAutoHeightDuration(It.clientHeight),xt.current=Nt):Nt=Wt,It.style.transition=[kt.transitions.create("opacity",{duration:Nt,delay:zt}),kt.transitions.create("transform",{duration:isWebKit154?Nt:Nt*.666,delay:zt,easing:Ft})].join(","),lt&<(It,Ot)}),Lt=At(ct),jt=At(pt),Rt=At(It=>{const{duration:Ot,delay:Wt,easing:zt}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"exit"});let Ft;gt==="auto"?(Ft=kt.transitions.getAutoHeightDuration(It.clientHeight),xt.current=Ft):Ft=Ot,It.style.transition=[kt.transitions.create("opacity",{duration:Ft,delay:Wt}),kt.transitions.create("transform",{duration:isWebKit154?Ft:Ft*.666,delay:isWebKit154?Wt:Wt||Ft*.333,easing:zt})].join(","),It.style.opacity=0,It.style.transform=getScale(.75),ht&&ht(It)}),$t=At(dt),vt=It=>{gt==="auto"&&(wt.current=setTimeout(It,xt.current||0)),rt&&rt(St.current,It)};return reactExports.useEffect(()=>()=>{clearTimeout(wt.current)},[]),jsxRuntimeExports.jsx(yt,_extends$u({appear:it,in:st,nodeRef:St,onEnter:Ct,onEntered:Lt,onEntering:Et,onExit:Rt,onExited:$t,onExiting:jt,addEndListener:vt,timeout:gt==="auto"?null:gt},bt,{children:(It,Ot)=>reactExports.cloneElement(ot,_extends$u({style:_extends$u({opacity:0,transform:getScale(.75),visibility:It==="exited"&&!st?"hidden":void 0},styles$2[It],mt,ot.props.style),ref:Tt},Ot))}))});Grow.muiSupportAuto=!0;const Grow$1=Grow;function useMediaQueryOld(tt,et,nt,rt,it){const[ot,at]=reactExports.useState(()=>it&&nt?nt(tt).matches:rt?rt(tt).matches:et);return useEnhancedEffect$1(()=>{let st=!0;if(!nt)return;const lt=nt(tt),ct=()=>{st&&at(lt.matches)};return ct(),lt.addListener(ct),()=>{st=!1,lt.removeListener(ct)}},[tt,nt]),ot}const maybeReactUseSyncExternalStore=React$2["useSyncExternalStore"];function useMediaQueryNew(tt,et,nt,rt,it){const ot=reactExports.useCallback(()=>et,[et]),at=reactExports.useMemo(()=>{if(it&&nt)return()=>nt(tt).matches;if(rt!==null){const{matches:ut}=rt(tt);return()=>ut}return ot},[ot,tt,rt,it,nt]),[st,lt]=reactExports.useMemo(()=>{if(nt===null)return[ot,()=>()=>{}];const ut=nt(tt);return[()=>ut.matches,ht=>(ut.addListener(ht),()=>{ut.removeListener(ht)})]},[ot,nt,tt]);return maybeReactUseSyncExternalStore(lt,st,at)}function useMediaQuery(tt,et={}){const nt=useTheme$3(),rt=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:it=!1,matchMedia:ot=rt?window.matchMedia:null,ssrMatchMedia:at=null,noSsr:st=!1}=getThemeProps({name:"MuiUseMediaQuery",props:et,theme:nt});let lt=typeof tt=="function"?tt(nt):tt;return lt=lt.replace(/^@media( ?)/m,""),(maybeReactUseSyncExternalStore!==void 0?useMediaQueryNew:useMediaQueryOld)(lt,it,ot,at,st)}const _excluded$15=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$D=tt=>{const{classes:et,disableUnderline:nt}=tt,it=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getInputUtilityClass,et);return _extends$u({},et,it)},InputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{let rt=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return tt.vars&&(rt=`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`),_extends$u({position:"relative"},et.formControl&&{"label + &":{marginTop:16}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(tt.vars||tt).palette[et.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${rt}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses$1.disabled}, .${inputClasses$1.error}):before`]:{borderBottom:`2px solid ${(tt.vars||tt).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${rt}`}},[`&.${inputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}})}),InputInput=styled$1(InputBaseComponent,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input$1=reactExports.forwardRef(function(et,nt){var rt,it,ot,at;const st=useThemeProps({props:et,name:"MuiInput"}),{disableUnderline:lt,components:ct={},componentsProps:ut,fullWidth:ht=!1,inputComponent:dt="input",multiline:pt=!1,slotProps:mt,slots:gt={},type:yt="text"}=st,bt=_objectWithoutPropertiesLoose$k(st,_excluded$15),wt=useUtilityClasses$D(st),kt={root:{ownerState:{disableUnderline:lt}}},St=mt??ut?deepmerge$1(mt??ut,kt):kt,Tt=(rt=(it=gt.root)!=null?it:ct.Root)!=null?rt:InputRoot,At=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:InputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:Tt,input:At},slotProps:St,fullWidth:ht,inputComponent:dt,multiline:pt,ref:nt,type:yt},bt,{classes:wt}))});Input$1.muiName="Input";const Input$2=Input$1;function getInputAdornmentUtilityClass(tt){return generateUtilityClass("MuiInputAdornment",tt)}const inputAdornmentClasses=generateUtilityClasses("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),inputAdornmentClasses$1=inputAdornmentClasses;var _span$2;const _excluded$14=["children","className","component","disablePointerEvents","disableTypography","position","variant"],overridesResolver$3=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`position${capitalize(nt.position)}`],nt.disablePointerEvents===!0&&et.disablePointerEvents,et[nt.variant]]},useUtilityClasses$C=tt=>{const{classes:et,disablePointerEvents:nt,hiddenLabel:rt,position:it,size:ot,variant:at}=tt,st={root:["root",nt&&"disablePointerEvents",it&&`position${capitalize(it)}`,at,rt&&"hiddenLabel",ot&&`size${capitalize(ot)}`]};return composeClasses(st,getInputAdornmentUtilityClass,et)},InputAdornmentRoot=styled$1("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:overridesResolver$3})(({theme:tt,ownerState:et})=>_extends$u({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(tt.vars||tt).palette.action.active},et.variant==="filled"&&{[`&.${inputAdornmentClasses$1.positionStart}&:not(.${inputAdornmentClasses$1.hiddenLabel})`]:{marginTop:16}},et.position==="start"&&{marginRight:8},et.position==="end"&&{marginLeft:8},et.disablePointerEvents===!0&&{pointerEvents:"none"})),InputAdornment=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiInputAdornment"}),{children:it,className:ot,component:at="div",disablePointerEvents:st=!1,disableTypography:lt=!1,position:ct,variant:ut}=rt,ht=_objectWithoutPropertiesLoose$k(rt,_excluded$14),dt=useFormControl()||{};let pt=ut;ut&&dt.variant,dt&&!pt&&(pt=dt.variant);const mt=_extends$u({},rt,{hiddenLabel:dt.hiddenLabel,size:dt.size,disablePointerEvents:st,position:ct,variant:pt}),gt=useUtilityClasses$C(mt);return jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:null,children:jsxRuntimeExports.jsx(InputAdornmentRoot,_extends$u({as:at,ownerState:mt,className:clsx$2(gt.root,ot),ref:nt},ht,{children:typeof it=="string"&&!lt?jsxRuntimeExports.jsx(Typography$1,{color:"text.secondary",children:it}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ct==="start"?_span$2||(_span$2=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"})):null,it]})}))})}),MuiInputAdornment=InputAdornment;function getInputLabelUtilityClasses(tt){return generateUtilityClass("MuiInputLabel",tt)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const _excluded$13=["disableAnimation","margin","shrink","variant","className"],useUtilityClasses$B=tt=>{const{classes:et,formControl:nt,size:rt,shrink:it,disableAnimation:ot,variant:at,required:st}=tt,lt={root:["root",nt&&"formControl",!ot&&"animated",it&&"shrink",rt&&rt!=="normal"&&`size${capitalize(rt)}`,at],asterisk:[st&&"asterisk"]},ct=composeClasses(lt,getInputLabelUtilityClasses,et);return _extends$u({},et,ct)},InputLabelRoot=styled$1(FormLabel$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${formLabelClasses$1.asterisk}`]:et.asterisk},et.root,nt.formControl&&et.formControl,nt.size==="small"&&et.sizeSmall,nt.shrink&&et.shrink,!nt.disableAnimation&&et.animated,nt.focused&&et.focused,et[nt.variant]]}})(({theme:tt,ownerState:et})=>_extends$u({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},et.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},et.size==="small"&&{transform:"translate(0, 17px) scale(1)"},et.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!et.disableAnimation&&{transition:tt.transitions.create(["color","transform","max-width"],{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut})},et.variant==="filled"&&_extends$u({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},et.shrink&&_extends$u({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},et.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),et.variant==="outlined"&&_extends$u({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},et.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),InputLabel=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({name:"MuiInputLabel",props:et}),{disableAnimation:it=!1,shrink:ot,className:at}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$13),lt=useFormControl();let ct=ot;typeof ct>"u"&<&&(ct=lt.filled||lt.focused||lt.adornedStart);const ut=formControlState({props:rt,muiFormControl:lt,states:["size","variant","required","focused"]}),ht=_extends$u({},rt,{disableAnimation:it,formControl:lt,shrink:ct,size:ut.size,variant:ut.variant,required:ut.required,focused:ut.focused}),dt=useUtilityClasses$B(ht);return jsxRuntimeExports.jsx(InputLabelRoot,_extends$u({"data-shrink":ct,ownerState:ht,ref:nt,className:clsx$2(dt.root,at)},st,{classes:dt}))}),InputLabel$1=InputLabel,ListContext=reactExports.createContext({}),ListContext$1=ListContext;function getListUtilityClass(tt){return generateUtilityClass("MuiList",tt)}generateUtilityClasses("MuiList",["root","padding","dense","subheader"]);const _excluded$12=["children","className","component","dense","disablePadding","subheader"],useUtilityClasses$A=tt=>{const{classes:et,disablePadding:nt,dense:rt,subheader:it}=tt;return composeClasses({root:["root",!nt&&"padding",rt&&"dense",it&&"subheader"]},getListUtilityClass,et)},ListRoot=styled$1("ul",{name:"MuiList",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disablePadding&&et.padding,nt.dense&&et.dense,nt.subheader&&et.subheader]}})(({ownerState:tt})=>_extends$u({listStyle:"none",margin:0,padding:0,position:"relative"},!tt.disablePadding&&{paddingTop:8,paddingBottom:8},tt.subheader&&{paddingTop:0})),List=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiList"}),{children:it,className:ot,component:at="ul",dense:st=!1,disablePadding:lt=!1,subheader:ct}=rt,ut=_objectWithoutPropertiesLoose$k(rt,_excluded$12),ht=reactExports.useMemo(()=>({dense:st}),[st]),dt=_extends$u({},rt,{component:at,dense:st,disablePadding:lt}),pt=useUtilityClasses$A(dt);return jsxRuntimeExports.jsx(ListContext$1.Provider,{value:ht,children:jsxRuntimeExports.jsxs(ListRoot,_extends$u({as:at,className:clsx$2(pt.root,ot),ref:nt,ownerState:dt},ut,{children:[ct,it]}))})}),List$1=List;function getListItemUtilityClass(tt){return generateUtilityClass("MuiListItem",tt)}const listItemClasses=generateUtilityClasses("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),listItemClasses$1=listItemClasses,listItemButtonClasses=generateUtilityClasses("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),listItemButtonClasses$1=listItemButtonClasses;function getListItemSecondaryActionClassesUtilityClass(tt){return generateUtilityClass("MuiListItemSecondaryAction",tt)}generateUtilityClasses("MuiListItemSecondaryAction",["root","disableGutters"]);const _excluded$11=["className"],useUtilityClasses$z=tt=>{const{disableGutters:et,classes:nt}=tt;return composeClasses({root:["root",et&&"disableGutters"]},getListItemSecondaryActionClassesUtilityClass,nt)},ListItemSecondaryActionRoot=styled$1("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.disableGutters&&et.disableGutters]}})(({ownerState:tt})=>_extends$u({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},tt.disableGutters&&{right:0})),ListItemSecondaryAction=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiListItemSecondaryAction"}),{className:it}=rt,ot=_objectWithoutPropertiesLoose$k(rt,_excluded$11),at=reactExports.useContext(ListContext$1),st=_extends$u({},rt,{disableGutters:at.disableGutters}),lt=useUtilityClasses$z(st);return jsxRuntimeExports.jsx(ListItemSecondaryActionRoot,_extends$u({className:clsx$2(lt.root,it),ownerState:st,ref:nt},ot))});ListItemSecondaryAction.muiName="ListItemSecondaryAction";const ListItemSecondaryAction$1=ListItemSecondaryAction,_excluded$10=["className"],_excluded2$f=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],overridesResolver$2=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dense&&et.dense,nt.alignItems==="flex-start"&&et.alignItemsFlexStart,nt.divider&&et.divider,!nt.disableGutters&&et.gutters,!nt.disablePadding&&et.padding,nt.button&&et.button,nt.hasSecondaryAction&&et.secondaryAction]},useUtilityClasses$y=tt=>{const{alignItems:et,button:nt,classes:rt,dense:it,disabled:ot,disableGutters:at,disablePadding:st,divider:lt,hasSecondaryAction:ct,selected:ut}=tt;return composeClasses({root:["root",it&&"dense",!at&&"gutters",!st&&"padding",lt&&"divider",ot&&"disabled",nt&&"button",et==="flex-start"&&"alignItemsFlexStart",ct&&"secondaryAction",ut&&"selected"],container:["container"]},getListItemUtilityClass,rt)},ListItemRoot=styled$1("div",{name:"MuiListItem",slot:"Root",overridesResolver:overridesResolver$2})(({theme:tt,ownerState:et})=>_extends$u({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!et.disablePadding&&_extends$u({paddingTop:8,paddingBottom:8},et.dense&&{paddingTop:4,paddingBottom:4},!et.disableGutters&&{paddingLeft:16,paddingRight:16},!!et.secondaryAction&&{paddingRight:48}),!!et.secondaryAction&&{[`& > .${listItemButtonClasses$1.root}`]:{paddingRight:48}},{[`&.${listItemClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`&.${listItemClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),[`&.${listItemClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},[`&.${listItemClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity}},et.alignItems==="flex-start"&&{alignItems:"flex-start"},et.divider&&{borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`,backgroundClip:"padding-box"},et.button&&{transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(tt.vars||tt).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${listItemClasses$1.selected}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity)}}},et.hasSecondaryAction&&{paddingRight:48})),ListItemContainer=styled$1("li",{name:"MuiListItem",slot:"Container",overridesResolver:(tt,et)=>et.container})({position:"relative"}),ListItem=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiListItem"}),{alignItems:it="center",autoFocus:ot=!1,button:at=!1,children:st,className:lt,component:ct,components:ut={},componentsProps:ht={},ContainerComponent:dt="li",ContainerProps:{className:pt}={},dense:mt=!1,disabled:gt=!1,disableGutters:yt=!1,disablePadding:bt=!1,divider:wt=!1,focusVisibleClassName:xt,secondaryAction:kt,selected:St=!1,slotProps:Tt={},slots:At={}}=rt,Et=_objectWithoutPropertiesLoose$k(rt.ContainerProps,_excluded$10),Ct=_objectWithoutPropertiesLoose$k(rt,_excluded2$f),Lt=reactExports.useContext(ListContext$1),jt=reactExports.useMemo(()=>({dense:mt||Lt.dense||!1,alignItems:it,disableGutters:yt}),[it,Lt.dense,mt,yt]),Rt=reactExports.useRef(null);useEnhancedEffect$1(()=>{ot&&Rt.current&&Rt.current.focus()},[ot]);const $t=reactExports.Children.toArray(st),vt=$t.length&&isMuiElement($t[$t.length-1],["ListItemSecondaryAction"]),It=_extends$u({},rt,{alignItems:it,autoFocus:ot,button:at,dense:jt.dense,disabled:gt,disableGutters:yt,disablePadding:bt,divider:wt,hasSecondaryAction:vt,selected:St}),Ot=useUtilityClasses$y(It),Wt=useForkRef(Rt,nt),zt=At.root||ut.Root||ListItemRoot,Ft=Tt.root||ht.root||{},Nt=_extends$u({className:clsx$2(Ot.root,Ft.className,lt),disabled:gt},Ct);let Ut=ct||"li";return at&&(Nt.component=ct||"div",Nt.focusVisibleClassName=clsx$2(listItemClasses$1.focusVisible,xt),Ut=ButtonBase$1),vt?(Ut=!Nt.component&&!ct?"div":Ut,dt==="li"&&(Ut==="li"?Ut="div":Nt.component==="li"&&(Nt.component="div")),jsxRuntimeExports.jsx(ListContext$1.Provider,{value:jt,children:jsxRuntimeExports.jsxs(ListItemContainer,_extends$u({as:dt,className:clsx$2(Ot.container,pt),ref:Wt,ownerState:It},Et,{children:[jsxRuntimeExports.jsx(zt,_extends$u({},Ft,!isHostComponent(zt)&&{as:Ut,ownerState:_extends$u({},It,Ft.ownerState)},Nt,{children:$t})),$t.pop()]}))})):jsxRuntimeExports.jsx(ListContext$1.Provider,{value:jt,children:jsxRuntimeExports.jsxs(zt,_extends$u({},Ft,{as:Ut,ref:Wt},!isHostComponent(zt)&&{ownerState:_extends$u({},It,Ft.ownerState)},Nt,{children:[$t,kt&&jsxRuntimeExports.jsx(ListItemSecondaryAction$1,{children:kt})]}))})}),ListItem$1=ListItem,listItemIconClasses=generateUtilityClasses("MuiListItemIcon",["root","alignItemsFlexStart"]),listItemIconClasses$1=listItemIconClasses,listItemTextClasses=generateUtilityClasses("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),listItemTextClasses$1=listItemTextClasses,_excluded$$=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nextItem$1(tt,et,nt){return tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:nt?null:tt.firstChild}function previousItem$1(tt,et,nt){return tt===et?nt?tt.firstChild:tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:nt?null:tt.lastChild}function textCriteriaMatches(tt,et){if(et===void 0)return!0;let nt=tt.innerText;return nt===void 0&&(nt=tt.textContent),nt=nt.trim().toLowerCase(),nt.length===0?!1:et.repeating?nt[0]===et.keys[0]:nt.indexOf(et.keys.join(""))===0}function moveFocus$1(tt,et,nt,rt,it,ot){let at=!1,st=it(tt,et,et?nt:!1);for(;st;){if(st===tt.firstChild){if(at)return!1;at=!0}const lt=rt?!1:st.disabled||st.getAttribute("aria-disabled")==="true";if(!st.hasAttribute("tabindex")||!textCriteriaMatches(st,ot)||lt)st=it(tt,st,nt);else return st.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(et,nt){const{actions:rt,autoFocus:it=!1,autoFocusItem:ot=!1,children:at,className:st,disabledItemsFocusable:lt=!1,disableListWrap:ct=!1,onKeyDown:ut,variant:ht="selectedMenu"}=et,dt=_objectWithoutPropertiesLoose$k(et,_excluded$$),pt=reactExports.useRef(null),mt=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect$1(()=>{it&&pt.current.focus()},[it]),reactExports.useImperativeHandle(rt,()=>({adjustStyleForScrollbar:(xt,kt)=>{const St=!pt.current.style.width;if(xt.clientHeight{const kt=pt.current,St=xt.key,Tt=ownerDocument(kt).activeElement;if(St==="ArrowDown")xt.preventDefault(),moveFocus$1(kt,Tt,ct,lt,nextItem$1);else if(St==="ArrowUp")xt.preventDefault(),moveFocus$1(kt,Tt,ct,lt,previousItem$1);else if(St==="Home")xt.preventDefault(),moveFocus$1(kt,null,ct,lt,nextItem$1);else if(St==="End")xt.preventDefault(),moveFocus$1(kt,null,ct,lt,previousItem$1);else if(St.length===1){const At=mt.current,Et=St.toLowerCase(),Ct=performance.now();At.keys.length>0&&(Ct-At.lastTime>500?(At.keys=[],At.repeating=!0,At.previousKeyMatched=!0):At.repeating&&Et!==At.keys[0]&&(At.repeating=!1)),At.lastTime=Ct,At.keys.push(Et);const Lt=Tt&&!At.repeating&&textCriteriaMatches(Tt,At);At.previousKeyMatched&&(Lt||moveFocus$1(kt,Tt,!1,lt,nextItem$1,At))?xt.preventDefault():At.previousKeyMatched=!1}ut&&ut(xt)},yt=useForkRef(pt,nt);let bt=-1;reactExports.Children.forEach(at,(xt,kt)=>{if(!reactExports.isValidElement(xt)){bt===kt&&(bt+=1,bt>=at.length&&(bt=-1));return}xt.props.disabled||(ht==="selectedMenu"&&xt.props.selected||bt===-1)&&(bt=kt),bt===kt&&(xt.props.disabled||xt.props.muiSkipListHighlight||xt.type.muiSkipListHighlight)&&(bt+=1,bt>=at.length&&(bt=-1))});const wt=reactExports.Children.map(at,(xt,kt)=>{if(kt===bt){const St={};return ot&&(St.autoFocus=!0),xt.props.tabIndex===void 0&&ht==="selectedMenu"&&(St.tabIndex=0),reactExports.cloneElement(xt,St)}return xt});return jsxRuntimeExports.jsx(List$1,_extends$u({role:"menu",ref:yt,className:st,onKeyDown:gt,tabIndex:it?0:-1},dt,{children:wt}))}),MenuList$1=MenuList;function getPopoverUtilityClass(tt){return generateUtilityClass("MuiPopover",tt)}generateUtilityClasses("MuiPopover",["root","paper"]);const _excluded$_=["onEntering"],_excluded2$e=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_excluded3$4=["slotProps"];function getOffsetTop(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.height/2:et==="bottom"&&(nt=tt.height),nt}function getOffsetLeft(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.width/2:et==="right"&&(nt=tt.width),nt}function getTransformOriginValue(tt){return[tt.horizontal,tt.vertical].map(et=>typeof et=="number"?`${et}px`:et).join(" ")}function resolveAnchorEl(tt){return typeof tt=="function"?tt():tt}const useUtilityClasses$x=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,et)},PopoverRoot=styled$1(Modal$1,{name:"MuiPopover",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),PopoverPaper=styled$1(Paper$1,{name:"MuiPopover",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useThemeProps({props:et,name:"MuiPopover"}),{action:st,anchorEl:lt,anchorOrigin:ct={vertical:"top",horizontal:"left"},anchorPosition:ut,anchorReference:ht="anchorEl",children:dt,className:pt,container:mt,elevation:gt=8,marginThreshold:yt=16,open:bt,PaperProps:wt={},slots:xt,slotProps:kt,transformOrigin:St={vertical:"top",horizontal:"left"},TransitionComponent:Tt=Grow$1,transitionDuration:At="auto",TransitionProps:{onEntering:Et}={},disableScrollLock:Ct=!1}=at,Lt=_objectWithoutPropertiesLoose$k(at.TransitionProps,_excluded$_),jt=_objectWithoutPropertiesLoose$k(at,_excluded2$e),Rt=(rt=kt==null?void 0:kt.paper)!=null?rt:wt,$t=reactExports.useRef(),vt=useForkRef($t,Rt.ref),It=_extends$u({},at,{anchorOrigin:ct,anchorReference:ht,elevation:gt,marginThreshold:yt,externalPaperSlotProps:Rt,transformOrigin:St,TransitionComponent:Tt,transitionDuration:At,TransitionProps:Lt}),Ot=useUtilityClasses$x(It),Wt=reactExports.useCallback(()=>{if(ht==="anchorPosition")return ut;const vn=resolveAnchorEl(lt),$n=(vn&&vn.nodeType===1?vn:ownerDocument($t.current).body).getBoundingClientRect();return{top:$n.top+getOffsetTop($n,ct.vertical),left:$n.left+getOffsetLeft($n,ct.horizontal)}},[lt,ct.horizontal,ct.vertical,ut,ht]),zt=reactExports.useCallback(vn=>({vertical:getOffsetTop(vn,St.vertical),horizontal:getOffsetLeft(vn,St.horizontal)}),[St.horizontal,St.vertical]),Ft=reactExports.useCallback(vn=>{const Cn={width:vn.offsetWidth,height:vn.offsetHeight},$n=zt(Cn);if(ht==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue($n)};const Nn=Wt();let En=Nn.top-$n.vertical,sn=Nn.left-$n.horizontal;const pn=En+Cn.height,Tn=sn+Cn.width,In=ownerWindow(resolveAnchorEl(lt)),yn=In.innerHeight-yt,hn=In.innerWidth-yt;if(yt!==null&&Enyn){const fn=pn-yn;En-=fn,$n.vertical+=fn}if(yt!==null&&snhn){const fn=Tn-hn;sn-=fn,$n.horizontal+=fn}return{top:`${Math.round(En)}px`,left:`${Math.round(sn)}px`,transformOrigin:getTransformOriginValue($n)}},[lt,ht,Wt,zt,yt]),[Nt,Ut]=reactExports.useState(bt),Pt=reactExports.useCallback(()=>{const vn=$t.current;if(!vn)return;const Cn=Ft(vn);Cn.top!==null&&(vn.style.top=Cn.top),Cn.left!==null&&(vn.style.left=Cn.left),vn.style.transformOrigin=Cn.transformOrigin,Ut(!0)},[Ft]);reactExports.useEffect(()=>(Ct&&window.addEventListener("scroll",Pt),()=>window.removeEventListener("scroll",Pt)),[lt,Ct,Pt]);const Ht=(vn,Cn)=>{Et&&Et(vn,Cn),Pt()},Qt=()=>{Ut(!1)};reactExports.useEffect(()=>{bt&&Pt()}),reactExports.useImperativeHandle(st,()=>bt?{updatePosition:()=>{Pt()}}:null,[bt,Pt]),reactExports.useEffect(()=>{if(!bt)return;const vn=debounce$4(()=>{Pt()}),Cn=ownerWindow(lt);return Cn.addEventListener("resize",vn),()=>{vn.clear(),Cn.removeEventListener("resize",vn)}},[lt,bt,Pt]);let an=At;At==="auto"&&!Tt.muiSupportAuto&&(an=void 0);const Yt=mt||(lt?ownerDocument(resolveAnchorEl(lt)).body:void 0),nn=(it=xt==null?void 0:xt.root)!=null?it:PopoverRoot,tn=(ot=xt==null?void 0:xt.paper)!=null?ot:PopoverPaper,dn=useSlotProps({elementType:tn,externalSlotProps:_extends$u({},Rt,{style:Nt?Rt.style:_extends$u({},Rt.style,{opacity:0})}),additionalProps:{elevation:gt,ref:vt},ownerState:It,className:clsx$2(Ot.paper,Rt==null?void 0:Rt.className)}),wn=useSlotProps({elementType:nn,externalSlotProps:(kt==null?void 0:kt.root)||{},externalForwardedProps:jt,additionalProps:{ref:nt,slotProps:{backdrop:{invisible:!0}},container:Yt,open:bt},ownerState:It,className:clsx$2(Ot.root,pt)}),{slotProps:rn}=wn,Jt=_objectWithoutPropertiesLoose$k(wn,_excluded3$4);return jsxRuntimeExports.jsx(nn,_extends$u({},Jt,!isHostComponent(nn)&&{slotProps:rn,disableScrollLock:Ct},{children:jsxRuntimeExports.jsx(Tt,_extends$u({appear:!0,in:bt,onEntering:Ht,onExited:Qt,timeout:an},Lt,{children:jsxRuntimeExports.jsx(tn,_extends$u({},dn,{children:dt}))}))}))}),Popover$1=Popover;function getMenuUtilityClass(tt){return generateUtilityClass("MuiMenu",tt)}generateUtilityClasses("MuiMenu",["root","paper","list"]);const _excluded$Z=["onEntering"],_excluded2$d=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$w=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,et)},MenuRoot=styled$1(Popover$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),MenuPaper=styled$1(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled$1(MenuList$1,{name:"MuiMenu",slot:"List",overridesResolver:(tt,et)=>et.list})({outline:0}),Menu=reactExports.forwardRef(function(et,nt){var rt,it;const ot=useThemeProps({props:et,name:"MuiMenu"}),{autoFocus:at=!0,children:st,className:lt,disableAutoFocusItem:ct=!1,MenuListProps:ut={},onClose:ht,open:dt,PaperProps:pt={},PopoverClasses:mt,transitionDuration:gt="auto",TransitionProps:{onEntering:yt}={},variant:bt="selectedMenu",slots:wt={},slotProps:xt={}}=ot,kt=_objectWithoutPropertiesLoose$k(ot.TransitionProps,_excluded$Z),St=_objectWithoutPropertiesLoose$k(ot,_excluded2$d),Tt=useTheme(),At=Tt.direction==="rtl",Et=_extends$u({},ot,{autoFocus:at,disableAutoFocusItem:ct,MenuListProps:ut,onEntering:yt,PaperProps:pt,transitionDuration:gt,TransitionProps:kt,variant:bt}),Ct=useUtilityClasses$w(Et),Lt=at&&!ct&&dt,jt=reactExports.useRef(null),Rt=(Ft,Nt)=>{jt.current&&jt.current.adjustStyleForScrollbar(Ft,Tt),yt&&yt(Ft,Nt)},$t=Ft=>{Ft.key==="Tab"&&(Ft.preventDefault(),ht&&ht(Ft,"tabKeyDown"))};let vt=-1;reactExports.Children.map(st,(Ft,Nt)=>{reactExports.isValidElement(Ft)&&(Ft.props.disabled||(bt==="selectedMenu"&&Ft.props.selected||vt===-1)&&(vt=Nt))});const It=(rt=wt.paper)!=null?rt:MenuPaper,Ot=(it=xt.paper)!=null?it:pt,Wt=useSlotProps({elementType:wt.root,externalSlotProps:xt.root,ownerState:Et,className:[Ct.root,lt]}),zt=useSlotProps({elementType:It,externalSlotProps:Ot,ownerState:Et,className:Ct.paper});return jsxRuntimeExports.jsx(MenuRoot,_extends$u({onClose:ht,anchorOrigin:{vertical:"bottom",horizontal:At?"right":"left"},transformOrigin:At?RTL_ORIGIN:LTR_ORIGIN,slots:{paper:It,root:wt.root},slotProps:{root:Wt,paper:zt},open:dt,ref:nt,transitionDuration:gt,TransitionProps:_extends$u({onEntering:Rt},kt),ownerState:Et},St,{classes:mt,children:jsxRuntimeExports.jsx(MenuMenuList,_extends$u({onKeyDown:$t,actions:jt,autoFocus:at&&(vt===-1||ct),autoFocusItem:Lt,variant:bt},ut,{className:clsx$2(Ct.list,ut.className),children:st}))}))}),Menu$1=Menu;function getMenuItemUtilityClass(tt){return generateUtilityClass("MuiMenuItem",tt)}const menuItemClasses=generateUtilityClasses("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),menuItemClasses$1=menuItemClasses,_excluded$Y=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],overridesResolver$1=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dense&&et.dense,nt.divider&&et.divider,!nt.disableGutters&&et.gutters]},useUtilityClasses$v=tt=>{const{disabled:et,dense:nt,divider:rt,disableGutters:it,selected:ot,classes:at}=tt,lt=composeClasses({root:["root",nt&&"dense",et&&"disabled",!it&&"gutters",rt&&"divider",ot&&"selected"]},getMenuItemUtilityClass,at);return _extends$u({},at,lt)},MenuItemRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:overridesResolver$1})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!et.disableGutters&&{paddingLeft:16,paddingRight:16},et.divider&&{borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(tt.vars||tt).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},[`&.${menuItemClasses$1.selected}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity)}},[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`&.${menuItemClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses$1.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses$1.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses$1.root}`]:{minWidth:36}},!et.dense&&{[tt.breakpoints.up("sm")]:{minHeight:"auto"}},et.dense&&_extends$u({minHeight:32,paddingTop:4,paddingBottom:4},tt.typography.body2,{[`& .${listItemIconClasses$1.root} svg`]:{fontSize:"1.25rem"}}))),MenuItem$2=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiMenuItem"}),{autoFocus:it=!1,component:ot="li",dense:at=!1,divider:st=!1,disableGutters:lt=!1,focusVisibleClassName:ct,role:ut="menuitem",tabIndex:ht,className:dt}=rt,pt=_objectWithoutPropertiesLoose$k(rt,_excluded$Y),mt=reactExports.useContext(ListContext$1),gt=reactExports.useMemo(()=>({dense:at||mt.dense||!1,disableGutters:lt}),[mt.dense,at,lt]),yt=reactExports.useRef(null);useEnhancedEffect$1(()=>{it&&yt.current&&yt.current.focus()},[it]);const bt=_extends$u({},rt,{dense:gt.dense,divider:st,disableGutters:lt}),wt=useUtilityClasses$v(rt),xt=useForkRef(yt,nt);let kt;return rt.disabled||(kt=ht!==void 0?ht:-1),jsxRuntimeExports.jsx(ListContext$1.Provider,{value:gt,children:jsxRuntimeExports.jsx(MenuItemRoot,_extends$u({ref:xt,role:ut,tabIndex:kt,component:ot,focusVisibleClassName:clsx$2(wt.focusVisible,ct),className:clsx$2(wt.root,dt)},pt,{ownerState:bt,classes:wt}))})}),MenuItem$3=MenuItem$2;function getNativeSelectUtilityClasses(tt){return generateUtilityClass("MuiNativeSelect",tt)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),nativeSelectClasses$1=nativeSelectClasses,_excluded$X=["className","disabled","error","IconComponent","inputRef","variant"],useUtilityClasses$u=tt=>{const{classes:et,variant:nt,disabled:rt,multiple:it,open:ot,error:at}=tt,st={select:["select",nt,rt&&"disabled",it&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",rt&&"disabled"]};return composeClasses(st,getNativeSelectUtilityClasses,et)},nativeSelectSelectStyles=({ownerState:tt,theme:et})=>_extends$u({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":_extends$u({},et.vars?{backgroundColor:`rgba(${et.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:et.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nativeSelectClasses$1.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(et.vars||et).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},tt.variant==="filled"&&{"&&&":{paddingRight:32}},tt.variant==="outlined"&&{borderRadius:(et.vars||et).shape.borderRadius,"&:focus":{borderRadius:(et.vars||et).shape.borderRadius},"&&&":{paddingRight:32}}),NativeSelectSelect=styled$1("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.select,et[nt.variant],nt.error&&et.error,{[`&.${nativeSelectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles),nativeSelectIconStyles=({ownerState:tt,theme:et})=>_extends$u({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(et.vars||et).palette.action.active,[`&.${nativeSelectClasses$1.disabled}`]:{color:(et.vars||et).palette.action.disabled}},tt.open&&{transform:"rotate(180deg)"},tt.variant==="filled"&&{right:7},tt.variant==="outlined"&&{right:7}),NativeSelectIcon=styled$1("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),NativeSelectInput=reactExports.forwardRef(function(et,nt){const{className:rt,disabled:it,error:ot,IconComponent:at,inputRef:st,variant:lt="standard"}=et,ct=_objectWithoutPropertiesLoose$k(et,_excluded$X),ut=_extends$u({},et,{disabled:it,variant:lt,error:ot}),ht=useUtilityClasses$u(ut);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,_extends$u({ownerState:ut,className:clsx$2(ht.select,rt),disabled:it,ref:st||nt},ct)),et.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:at,ownerState:ut,className:ht.icon})]})}),NativeSelectInput$1=NativeSelectInput;var _span$1;const _excluded$W=["children","classes","className","label","notched"],NotchedOutlineRoot$1=styled$1("fieldset",{shouldForwardProp:rootShouldForwardProp})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled$1("legend",{shouldForwardProp:rootShouldForwardProp})(({ownerState:tt,theme:et})=>_extends$u({float:"unset",width:"auto",overflow:"hidden"},!tt.withLabel&&{padding:0,lineHeight:"11px",transition:et.transitions.create("width",{duration:150,easing:et.transitions.easing.easeOut})},tt.withLabel&&_extends$u({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:et.transitions.create("max-width",{duration:50,easing:et.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},tt.notched&&{maxWidth:"100%",transition:et.transitions.create("max-width",{duration:100,easing:et.transitions.easing.easeOut,delay:50})})));function NotchedOutline(tt){const{className:et,label:nt,notched:rt}=tt,it=_objectWithoutPropertiesLoose$k(tt,_excluded$W),ot=nt!=null&&nt!=="",at=_extends$u({},tt,{notched:rt,withLabel:ot});return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,_extends$u({"aria-hidden":!0,className:et,ownerState:at},it,{children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:at,children:ot?jsxRuntimeExports.jsx("span",{children:nt}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"}))})}))}const _excluded$V=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],useUtilityClasses$t=tt=>{const{classes:et}=tt,rt=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,et);return _extends$u({},et,rt)},OutlinedInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return _extends$u({position:"relative",borderRadius:(tt.vars||tt).shape.borderRadius,[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:nt}},[`&.${outlinedInputClasses$1.focused} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette[et.color].main,borderWidth:2},[`&.${outlinedInputClasses$1.error} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.error.main},[`&.${outlinedInputClasses$1.disabled} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.action.disabled}},et.startAdornment&&{paddingLeft:14},et.endAdornment&&{paddingRight:14},et.multiline&&_extends$u({padding:"16.5px 14px"},et.size==="small"&&{padding:"8.5px 14px"}))}),NotchedOutlineRoot=styled$1(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(tt,et)=>et.notchedOutline})(({theme:tt})=>{const et=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:et}}),OutlinedInputInput=styled$1(InputBaseComponent,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({padding:"16.5px 14px"},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{padding:"8.5px 14px"},et.multiline&&{padding:0},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0})),OutlinedInput=reactExports.forwardRef(function(et,nt){var rt,it,ot,at,st;const lt=useThemeProps({props:et,name:"MuiOutlinedInput"}),{components:ct={},fullWidth:ut=!1,inputComponent:ht="input",label:dt,multiline:pt=!1,notched:mt,slots:gt={},type:yt="text"}=lt,bt=_objectWithoutPropertiesLoose$k(lt,_excluded$V),wt=useUtilityClasses$t(lt),xt=useFormControl(),kt=formControlState({props:lt,muiFormControl:xt,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),St=_extends$u({},lt,{color:kt.color||"primary",disabled:kt.disabled,error:kt.error,focused:kt.focused,formControl:xt,fullWidth:ut,hiddenLabel:kt.hiddenLabel,multiline:pt,size:kt.size,type:yt}),Tt=(rt=(it=gt.root)!=null?it:ct.Root)!=null?rt:OutlinedInputRoot,At=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:Tt,input:At},renderSuffix:Et=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:St,className:wt.notchedOutline,label:dt!=null&&dt!==""&&kt.required?st||(st=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[dt," ","*"]})):dt,notched:typeof mt<"u"?mt:!!(Et.startAdornment||Et.filled||Et.focused)}),fullWidth:ut,inputComponent:ht,multiline:pt,ref:nt,type:yt},bt,{classes:_extends$u({},wt,{notchedOutline:null})}))});OutlinedInput.muiName="Input";const OutlinedInput$1=OutlinedInput;function getSelectUtilityClasses(tt){return generateUtilityClass("MuiSelect",tt)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),selectClasses$1=selectClasses;var _span;const _excluded$U=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],SelectSelect=styled$1("div",{name:"MuiSelect",slot:"Select",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`&.${selectClasses$1.select}`]:et.select},{[`&.${selectClasses$1.select}`]:et[nt.variant]},{[`&.${selectClasses$1.error}`]:et.error},{[`&.${selectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles,{[`&.${selectClasses$1.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled$1("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),SelectNativeInput=styled$1("input",{shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(tt,et)=>et.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(tt,et){return typeof et=="object"&&et!==null?tt===et:String(tt)===String(et)}function isEmpty(tt){return tt==null||typeof tt=="string"&&!tt.trim()}const useUtilityClasses$s=tt=>{const{classes:et,variant:nt,disabled:rt,multiple:it,open:ot,error:at}=tt,st={select:["select",nt,rt&&"disabled",it&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",rt&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(st,getSelectUtilityClasses,et)},SelectInput=reactExports.forwardRef(function(et,nt){var rt;const{"aria-describedby":it,"aria-label":ot,autoFocus:at,autoWidth:st,children:lt,className:ct,defaultOpen:ut,defaultValue:ht,disabled:dt,displayEmpty:pt,error:mt=!1,IconComponent:gt,inputRef:yt,labelId:bt,MenuProps:wt={},multiple:xt,name:kt,onBlur:St,onChange:Tt,onClose:At,onFocus:Et,onOpen:Ct,open:Lt,readOnly:jt,renderValue:Rt,SelectDisplayProps:$t={},tabIndex:vt,value:It,variant:Ot="standard"}=et,Wt=_objectWithoutPropertiesLoose$k(et,_excluded$U),[zt,Ft]=useControlled({controlled:It,default:ht,name:"Select"}),[Nt,Ut]=useControlled({controlled:Lt,default:ut,name:"Select"}),Pt=reactExports.useRef(null),Ht=reactExports.useRef(null),[Qt,an]=reactExports.useState(null),{current:Yt}=reactExports.useRef(Lt!=null),[nn,tn]=reactExports.useState(),dn=useForkRef(nt,yt),wn=reactExports.useCallback(Bn=>{Ht.current=Bn,Bn&&an(Bn)},[]),rn=Qt==null?void 0:Qt.parentNode;reactExports.useImperativeHandle(dn,()=>({focus:()=>{Ht.current.focus()},node:Pt.current,value:zt}),[zt]),reactExports.useEffect(()=>{ut&&Nt&&Qt&&!Yt&&(tn(st?null:rn.clientWidth),Ht.current.focus())},[Qt,st]),reactExports.useEffect(()=>{at&&Ht.current.focus()},[at]),reactExports.useEffect(()=>{if(!bt)return;const Bn=ownerDocument(Ht.current).getElementById(bt);if(Bn){const Xn=()=>{getSelection().isCollapsed&&Ht.current.focus()};return Bn.addEventListener("click",Xn),()=>{Bn.removeEventListener("click",Xn)}}},[bt]);const Jt=(Bn,Xn)=>{Bn?Ct&&Ct(Xn):At&&At(Xn),Yt||(tn(st?null:rn.clientWidth),Ut(Bn))},vn=Bn=>{Bn.button===0&&(Bn.preventDefault(),Ht.current.focus(),Jt(!0,Bn))},Cn=Bn=>{Jt(!1,Bn)},$n=reactExports.Children.toArray(lt),Nn=Bn=>{const Xn=$n.find(Vn=>Vn.props.value===Bn.target.value);Xn!==void 0&&(Ft(Xn.props.value),Tt&&Tt(Bn,Xn))},En=Bn=>Xn=>{let Vn;if(Xn.currentTarget.hasAttribute("tabindex")){if(xt){Vn=Array.isArray(zt)?zt.slice():[];const Gn=zt.indexOf(Bn.props.value);Gn===-1?Vn.push(Bn.props.value):Vn.splice(Gn,1)}else Vn=Bn.props.value;if(Bn.props.onClick&&Bn.props.onClick(Xn),zt!==Vn&&(Ft(Vn),Tt)){const Gn=Xn.nativeEvent||Xn,zn=new Gn.constructor(Gn.type,Gn);Object.defineProperty(zn,"target",{writable:!0,value:{value:Vn,name:kt}}),Tt(zn,Bn)}xt||Jt(!1,Xn)}},sn=Bn=>{jt||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Bn.key)!==-1&&(Bn.preventDefault(),Jt(!0,Bn))},pn=Qt!==null&&Nt,Tn=Bn=>{!pn&&St&&(Object.defineProperty(Bn,"target",{writable:!0,value:{value:zt,name:kt}}),St(Bn))};delete Wt["aria-invalid"];let In,yn;const hn=[];let fn=!1;(isFilled({value:zt})||pt)&&(Rt?In=Rt(zt):fn=!0);const xn=$n.map(Bn=>{if(!reactExports.isValidElement(Bn))return null;let Xn;if(xt){if(!Array.isArray(zt))throw new Error(formatMuiErrorMessage(2));Xn=zt.some(Vn=>areEqualValues(Vn,Bn.props.value)),Xn&&fn&&hn.push(Bn.props.children)}else Xn=areEqualValues(zt,Bn.props.value),Xn&&fn&&(yn=Bn.props.children);return reactExports.cloneElement(Bn,{"aria-selected":Xn?"true":"false",onClick:En(Bn),onKeyUp:Vn=>{Vn.key===" "&&Vn.preventDefault(),Bn.props.onKeyUp&&Bn.props.onKeyUp(Vn)},role:"option",selected:Xn,value:void 0,"data-value":Bn.props.value})});fn&&(xt?hn.length===0?In=null:In=hn.reduce((Bn,Xn,Vn)=>(Bn.push(Xn),Vn{const{classes:et}=tt;return et},styledRootConfig={name:"MuiSelect",overridesResolver:(tt,et)=>et.root,shouldForwardProp:tt=>rootShouldForwardProp(tt)&&tt!=="variant",slot:"Root"},StyledInput$1=styled$1(Input$2,styledRootConfig)(""),StyledOutlinedInput=styled$1(OutlinedInput$1,styledRootConfig)(""),StyledFilledInput=styled$1(FilledInput$1,styledRootConfig)(""),Select=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({name:"MuiSelect",props:et}),{autoWidth:it=!1,children:ot,classes:at={},className:st,defaultOpen:lt=!1,displayEmpty:ct=!1,IconComponent:ut=ArrowDropDownIcon$1,id:ht,input:dt,inputProps:pt,label:mt,labelId:gt,MenuProps:yt,multiple:bt=!1,native:wt=!1,onClose:xt,onOpen:kt,open:St,renderValue:Tt,SelectDisplayProps:At,variant:Et="outlined"}=rt,Ct=_objectWithoutPropertiesLoose$k(rt,_excluded$T),Lt=wt?NativeSelectInput$1:SelectInput$1,jt=useFormControl(),Rt=formControlState({props:rt,muiFormControl:jt,states:["variant","error"]}),$t=Rt.variant||Et,vt=_extends$u({},rt,{variant:$t,classes:at}),It=useUtilityClasses$r(vt),Ot=_objectWithoutPropertiesLoose$k(It,_excluded2$c),Wt=dt||{standard:jsxRuntimeExports.jsx(StyledInput$1,{ownerState:vt}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:mt,ownerState:vt}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:vt})}[$t],zt=useForkRef(nt,Wt.ref);return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(Wt,_extends$u({inputComponent:Lt,inputProps:_extends$u({children:ot,error:Rt.error,IconComponent:ut,variant:$t,type:void 0,multiple:bt},wt?{id:ht}:{autoWidth:it,defaultOpen:lt,displayEmpty:ct,labelId:gt,MenuProps:yt,onClose:xt,onOpen:kt,open:St,renderValue:Tt,SelectDisplayProps:_extends$u({id:ht},At)},pt,{classes:pt?deepmerge$1(Ot,pt.classes):Ot},dt?dt.props.inputProps:{})},bt&&wt&&$t==="outlined"?{notched:!0}:{},{ref:zt,className:clsx$2(Wt.props.className,st,It.root)},!dt&&{variant:$t},Ct))})});Select.muiName="Select";const Select$1=Select;function getSkeletonUtilityClass(tt){return generateUtilityClass("MuiSkeleton",tt)}generateUtilityClasses("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const _excluded$S=["animation","className","component","height","style","variant","width"];let _=tt=>tt,_t,_t2,_t3,_t4;const useUtilityClasses$q=tt=>{const{classes:et,variant:nt,animation:rt,hasChildren:it,width:ot,height:at}=tt;return composeClasses({root:["root",nt,rt,it&&"withChildren",it&&!ot&&"fitContent",it&&!at&&"heightAuto"]},getSkeletonUtilityClass,et)},pulseKeyframe=keyframes(_t||(_t=_` +`),touchRippleClasses$1.rippleVisible,enterKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.ripplePulsate,({theme:tt})=>tt.transitions.duration.shorter,touchRippleClasses$1.child,touchRippleClasses$1.childLeaving,exitKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.childPulsate,pulsateKeyframe,({theme:tt})=>tt.transitions.easing.easeInOut),TouchRipple=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTouchRipple"}),{center:it=!1,classes:ot={},className:at}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$1t),[lt,ct]=reactExports.useState([]),ut=reactExports.useRef(0),ht=reactExports.useRef(null);reactExports.useEffect(()=>{ht.current&&(ht.current(),ht.current=null)},[lt]);const dt=reactExports.useRef(!1),pt=reactExports.useRef(0),mt=reactExports.useRef(null),gt=reactExports.useRef(null);reactExports.useEffect(()=>()=>{pt.current&&clearTimeout(pt.current)},[]);const yt=reactExports.useCallback(kt=>{const{pulsate:St,rippleX:Tt,rippleY:At,rippleSize:Et,cb:Ct}=kt;ct(Lt=>[...Lt,jsxRuntimeExports.jsx(TouchRippleRipple,{classes:{ripple:clsx$2(ot.ripple,touchRippleClasses$1.ripple),rippleVisible:clsx$2(ot.rippleVisible,touchRippleClasses$1.rippleVisible),ripplePulsate:clsx$2(ot.ripplePulsate,touchRippleClasses$1.ripplePulsate),child:clsx$2(ot.child,touchRippleClasses$1.child),childLeaving:clsx$2(ot.childLeaving,touchRippleClasses$1.childLeaving),childPulsate:clsx$2(ot.childPulsate,touchRippleClasses$1.childPulsate)},timeout:DURATION,pulsate:St,rippleX:Tt,rippleY:At,rippleSize:Et},ut.current)]),ut.current+=1,ht.current=Ct},[ot]),bt=reactExports.useCallback((kt={},St={},Tt=()=>{})=>{const{pulsate:At=!1,center:Et=it||St.pulsate,fakeElement:Ct=!1}=St;if((kt==null?void 0:kt.type)==="mousedown"&&dt.current){dt.current=!1;return}(kt==null?void 0:kt.type)==="touchstart"&&(dt.current=!0);const Lt=Ct?null:gt.current,jt=Lt?Lt.getBoundingClientRect():{width:0,height:0,left:0,top:0};let Rt,$t,vt;if(Et||kt===void 0||kt.clientX===0&&kt.clientY===0||!kt.clientX&&!kt.touches)Rt=Math.round(jt.width/2),$t=Math.round(jt.height/2);else{const{clientX:It,clientY:Ot}=kt.touches&&kt.touches.length>0?kt.touches[0]:kt;Rt=Math.round(It-jt.left),$t=Math.round(Ot-jt.top)}if(Et)vt=Math.sqrt((2*jt.width**2+jt.height**2)/3),vt%2===0&&(vt+=1);else{const It=Math.max(Math.abs((Lt?Lt.clientWidth:0)-Rt),Rt)*2+2,Ot=Math.max(Math.abs((Lt?Lt.clientHeight:0)-$t),$t)*2+2;vt=Math.sqrt(It**2+Ot**2)}kt!=null&&kt.touches?mt.current===null&&(mt.current=()=>{yt({pulsate:At,rippleX:Rt,rippleY:$t,rippleSize:vt,cb:Tt})},pt.current=setTimeout(()=>{mt.current&&(mt.current(),mt.current=null)},DELAY_RIPPLE)):yt({pulsate:At,rippleX:Rt,rippleY:$t,rippleSize:vt,cb:Tt})},[it,yt]),wt=reactExports.useCallback(()=>{bt({},{pulsate:!0})},[bt]),xt=reactExports.useCallback((kt,St)=>{if(clearTimeout(pt.current),(kt==null?void 0:kt.type)==="touchend"&&mt.current){mt.current(),mt.current=null,pt.current=setTimeout(()=>{xt(kt,St)});return}mt.current=null,ct(Tt=>Tt.length>0?Tt.slice(1):Tt),ht.current=St},[]);return reactExports.useImperativeHandle(nt,()=>({pulsate:wt,start:bt,stop:xt}),[wt,bt,xt]),jsxRuntimeExports.jsx(TouchRippleRoot,_extends$u({className:clsx$2(touchRippleClasses$1.root,ot.root,at),ref:gt},st,{children:jsxRuntimeExports.jsx(TransitionGroup$1,{component:null,exit:!0,children:lt})}))}),TouchRipple$1=TouchRipple;function getButtonBaseUtilityClass(tt){return generateUtilityClass("MuiButtonBase",tt)}const buttonBaseClasses=generateUtilityClasses("MuiButtonBase",["root","disabled","focusVisible"]),buttonBaseClasses$1=buttonBaseClasses,_excluded$1s=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],useUtilityClasses$U=tt=>{const{disabled:et,focusVisible:nt,focusVisibleClassName:rt,classes:it}=tt,at=composeClasses({root:["root",et&&"disabled",nt&&"focusVisible"]},getButtonBaseUtilityClass,it);return nt&&rt&&(at.root+=` ${rt}`),at},ButtonBaseRoot=styled$1("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${buttonBaseClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ButtonBase=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiButtonBase"}),{action:it,centerRipple:ot=!1,children:at,className:st,component:lt="button",disabled:ct=!1,disableRipple:ut=!1,disableTouchRipple:ht=!1,focusRipple:dt=!1,LinkComponent:pt="a",onBlur:mt,onClick:gt,onContextMenu:yt,onDragLeave:bt,onFocus:wt,onFocusVisible:xt,onKeyDown:kt,onKeyUp:St,onMouseDown:Tt,onMouseLeave:At,onMouseUp:Et,onTouchEnd:Ct,onTouchMove:Lt,onTouchStart:jt,tabIndex:Rt=0,TouchRippleProps:$t,touchRippleRef:vt,type:It}=rt,Ot=_objectWithoutPropertiesLoose$k(rt,_excluded$1s),Wt=reactExports.useRef(null),zt=reactExports.useRef(null),Ft=useForkRef(zt,vt),{isFocusVisibleRef:Nt,onFocus:Ut,onBlur:Pt,ref:Ht}=useIsFocusVisible(),[Qt,an]=reactExports.useState(!1);ct&&Qt&&an(!1),reactExports.useImperativeHandle(it,()=>({focusVisible:()=>{an(!0),Wt.current.focus()}}),[]);const[Yt,nn]=reactExports.useState(!1);reactExports.useEffect(()=>{nn(!0)},[]);const tn=Yt&&!ut&&!ct;reactExports.useEffect(()=>{Qt&&dt&&!ut&&Yt&&zt.current.pulsate()},[ut,dt,Qt,Yt]);function dn(Kt,kn,Mn=ht){return useEventCallback(On=>(kn&&kn(On),!Mn&&zt.current&&zt.current[Kt](On),!0))}const wn=dn("start",Tt),rn=dn("stop",yt),Zt=dn("stop",bt),vn=dn("stop",Et),Cn=dn("stop",Kt=>{Qt&&Kt.preventDefault(),At&&At(Kt)}),$n=dn("start",jt),Nn=dn("stop",Ct),En=dn("stop",Lt),sn=dn("stop",Kt=>{Pt(Kt),Nt.current===!1&&an(!1),mt&&mt(Kt)},!1),pn=useEventCallback(Kt=>{Wt.current||(Wt.current=Kt.currentTarget),Ut(Kt),Nt.current===!0&&(an(!0),xt&&xt(Kt)),wt&&wt(Kt)}),Tn=()=>{const Kt=Wt.current;return lt&<!=="button"&&!(Kt.tagName==="A"&&Kt.href)},In=reactExports.useRef(!1),yn=useEventCallback(Kt=>{dt&&!In.current&&Qt&&zt.current&&Kt.key===" "&&(In.current=!0,zt.current.stop(Kt,()=>{zt.current.start(Kt)})),Kt.target===Kt.currentTarget&&Tn()&&Kt.key===" "&&Kt.preventDefault(),kt&&kt(Kt),Kt.target===Kt.currentTarget&&Tn()&&Kt.key==="Enter"&&!ct&&(Kt.preventDefault(),gt&>(Kt))}),hn=useEventCallback(Kt=>{dt&&Kt.key===" "&&zt.current&&Qt&&!Kt.defaultPrevented&&(In.current=!1,zt.current.stop(Kt,()=>{zt.current.pulsate(Kt)})),St&&St(Kt),gt&&Kt.target===Kt.currentTarget&&Tn()&&Kt.key===" "&&!Kt.defaultPrevented&>(Kt)});let fn=lt;fn==="button"&&(Ot.href||Ot.to)&&(fn=pt);const xn={};fn==="button"?(xn.type=It===void 0?"button":It,xn.disabled=ct):(!Ot.href&&!Ot.to&&(xn.role="button"),ct&&(xn["aria-disabled"]=ct));const jn=useForkRef(nt,Ht,Wt),cn=_extends$u({},rt,{centerRipple:ot,component:lt,disabled:ct,disableRipple:ut,disableTouchRipple:ht,focusRipple:dt,tabIndex:Rt,focusVisible:Qt}),Xt=useUtilityClasses$U(cn);return jsxRuntimeExports.jsxs(ButtonBaseRoot,_extends$u({as:fn,className:clsx$2(Xt.root,st),ownerState:cn,onBlur:sn,onClick:gt,onContextMenu:rn,onFocus:pn,onKeyDown:yn,onKeyUp:hn,onMouseDown:wn,onMouseLeave:Cn,onMouseUp:vn,onDragLeave:Zt,onTouchEnd:Nn,onTouchMove:En,onTouchStart:$n,ref:jn,tabIndex:ct?-1:Rt,type:It},xn,Ot,{children:[at,tn?jsxRuntimeExports.jsx(TouchRipple$1,_extends$u({ref:Ft,center:ot},$t)):null]}))}),ButtonBase$1=ButtonBase;function getIconButtonUtilityClass(tt){return generateUtilityClass("MuiIconButton",tt)}const iconButtonClasses=generateUtilityClasses("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),iconButtonClasses$1=iconButtonClasses,_excluded$1r=["edge","children","className","color","disabled","disableFocusRipple","size"],useUtilityClasses$T=tt=>{const{classes:et,disabled:nt,color:rt,edge:it,size:ot}=tt,at={root:["root",nt&&"disabled",rt!=="default"&&`color${capitalize(rt)}`,it&&`edge${capitalize(it)}`,`size${capitalize(ot)}`]};return composeClasses(at,getIconButtonUtilityClass,et)},IconButtonRoot=styled$1(ButtonBase$1,{name:"MuiIconButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.color!=="default"&&et[`color${capitalize(nt.color)}`],nt.edge&&et[`edge${capitalize(nt.edge)}`],et[`size${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$u({textAlign:"center",flex:"0 0 auto",fontSize:tt.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(tt.vars||tt).palette.action.active,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shortest})},!et.disableRipple&&{"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},et.edge==="start"&&{marginLeft:et.size==="small"?-3:-12},et.edge==="end"&&{marginRight:et.size==="small"?-3:-12}),({theme:tt,ownerState:et})=>{var nt;const rt=(nt=(tt.vars||tt).palette)==null?void 0:nt[et.color];return _extends$u({},et.color==="inherit"&&{color:"inherit"},et.color!=="inherit"&&et.color!=="default"&&_extends$u({color:rt==null?void 0:rt.main},!et.disableRipple&&{"&:hover":_extends$u({},rt&&{backgroundColor:tt.vars?`rgba(${rt.mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(rt.main,tt.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),et.size==="small"&&{padding:5,fontSize:tt.typography.pxToRem(18)},et.size==="large"&&{padding:12,fontSize:tt.typography.pxToRem(28)},{[`&.${iconButtonClasses$1.disabled}`]:{backgroundColor:"transparent",color:(tt.vars||tt).palette.action.disabled}})}),IconButton=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiIconButton"}),{edge:it=!1,children:ot,className:at,color:st="default",disabled:lt=!1,disableFocusRipple:ct=!1,size:ut="medium"}=rt,ht=_objectWithoutPropertiesLoose$k(rt,_excluded$1r),dt=_extends$u({},rt,{edge:it,color:st,disabled:lt,disableFocusRipple:ct,size:ut}),pt=useUtilityClasses$T(dt);return jsxRuntimeExports.jsx(IconButtonRoot,_extends$u({className:clsx$2(pt.root,at),centerRipple:!0,focusRipple:!ct,disabled:lt,ref:nt,ownerState:dt},ht,{children:ot}))}),IconButton$1=IconButton;function getTypographyUtilityClass(tt){return generateUtilityClass("MuiTypography",tt)}generateUtilityClasses("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const _excluded$1q=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],useUtilityClasses$S=tt=>{const{align:et,gutterBottom:nt,noWrap:rt,paragraph:it,variant:ot,classes:at}=tt,st={root:["root",ot,tt.align!=="inherit"&&`align${capitalize(et)}`,nt&&"gutterBottom",rt&&"noWrap",it&&"paragraph"]};return composeClasses(st,getTypographyUtilityClass,at)},TypographyRoot=styled$1("span",{name:"MuiTypography",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.variant&&et[nt.variant],nt.align!=="inherit"&&et[`align${capitalize(nt.align)}`],nt.noWrap&&et.noWrap,nt.gutterBottom&&et.gutterBottom,nt.paragraph&&et.paragraph]}})(({theme:tt,ownerState:et})=>_extends$u({margin:0},et.variant==="inherit"&&{font:"inherit"},et.variant!=="inherit"&&tt.typography[et.variant],et.align!=="inherit"&&{textAlign:et.align},et.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},et.gutterBottom&&{marginBottom:"0.35em"},et.paragraph&&{marginBottom:16})),defaultVariantMapping={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},colorTransformations={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors=tt=>colorTransformations[tt]||tt,Typography=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTypography"}),it=transformDeprecatedColors(rt.color),ot=extendSxProp(_extends$u({},rt,{color:it})),{align:at="inherit",className:st,component:lt,gutterBottom:ct=!1,noWrap:ut=!1,paragraph:ht=!1,variant:dt="body1",variantMapping:pt=defaultVariantMapping}=ot,mt=_objectWithoutPropertiesLoose$k(ot,_excluded$1q),gt=_extends$u({},ot,{align:at,color:it,className:st,component:lt,gutterBottom:ct,noWrap:ut,paragraph:ht,variant:dt,variantMapping:pt}),yt=lt||(ht?"p":pt[dt]||defaultVariantMapping[dt])||"span",bt=useUtilityClasses$S(gt);return jsxRuntimeExports.jsx(TypographyRoot,_extends$u({as:yt,ref:nt,ownerState:gt,className:clsx$2(bt.root,st)},mt))}),Typography$1=Typography;function isHostComponent(tt){return typeof tt=="string"}function appendOwnerState(tt,et,nt){return tt===void 0||isHostComponent(tt)?et:_extends$u({},et,{ownerState:_extends$u({},et.ownerState,nt)})}function areArraysEqual$1(tt,et,nt=(rt,it)=>rt===it){return tt.length===et.length&&tt.every((rt,it)=>nt(rt,et[it]))}const defaultContextValue={disableDefaultClasses:!1},ClassNameConfiguratorContext=reactExports.createContext(defaultContextValue);function useClassNamesOverride(tt){const{disableDefaultClasses:et}=reactExports.useContext(ClassNameConfiguratorContext);return nt=>et?"":tt(nt)}function extractEventHandlers(tt,et=[]){if(tt===void 0)return{};const nt={};return Object.keys(tt).filter(rt=>rt.match(/^on[A-Z]/)&&typeof tt[rt]=="function"&&!et.includes(rt)).forEach(rt=>{nt[rt]=tt[rt]}),nt}function resolveComponentProps(tt,et,nt){return typeof tt=="function"?tt(et,nt):tt}function r$3(tt){var et,nt,rt="";if(typeof tt=="string"||typeof tt=="number")rt+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et!(nt.match(/^on[A-Z]/)&&typeof tt[nt]=="function")).forEach(nt=>{et[nt]=tt[nt]}),et}function mergeSlotProps(tt){const{getSlotProps:et,additionalProps:nt,externalSlotProps:rt,externalForwardedProps:it,className:ot}=tt;if(!et){const pt=clsx$1(nt==null?void 0:nt.className,ot,it==null?void 0:it.className,rt==null?void 0:rt.className),mt=_extends$u({},nt==null?void 0:nt.style,it==null?void 0:it.style,rt==null?void 0:rt.style),gt=_extends$u({},nt,it,rt);return pt.length>0&&(gt.className=pt),Object.keys(mt).length>0&&(gt.style=mt),{props:gt,internalRef:void 0}}const at=extractEventHandlers(_extends$u({},it,rt)),st=omitEventHandlers(rt),lt=omitEventHandlers(it),ct=et(at),ut=clsx$1(ct==null?void 0:ct.className,nt==null?void 0:nt.className,ot,it==null?void 0:it.className,rt==null?void 0:rt.className),ht=_extends$u({},ct==null?void 0:ct.style,nt==null?void 0:nt.style,it==null?void 0:it.style,rt==null?void 0:rt.style),dt=_extends$u({},ct,nt,lt,st);return ut.length>0&&(dt.className=ut),Object.keys(ht).length>0&&(dt.style=ht),{props:dt,internalRef:ct.ref}}const _excluded$1p=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function useSlotProps(tt){var et;const{elementType:nt,externalSlotProps:rt,ownerState:it,skipResolvingSlotProps:ot=!1}=tt,at=_objectWithoutPropertiesLoose$k(tt,_excluded$1p),st=ot?{}:resolveComponentProps(rt,it),{props:lt,internalRef:ct}=mergeSlotProps(_extends$u({},at,{externalSlotProps:st})),ut=useForkRef(ct,st==null?void 0:st.ref,(et=tt.additionalProps)==null?void 0:et.ref);return appendOwnerState(nt,_extends$u({},lt,{ref:ut}),it)}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(tt){const et=parseInt(tt.getAttribute("tabindex")||"",10);return Number.isNaN(et)?tt.contentEditable==="true"||(tt.nodeName==="AUDIO"||tt.nodeName==="VIDEO"||tt.nodeName==="DETAILS")&&tt.getAttribute("tabindex")===null?0:tt.tabIndex:et}function isNonTabbableRadio(tt){if(tt.tagName!=="INPUT"||tt.type!=="radio"||!tt.name)return!1;const et=rt=>tt.ownerDocument.querySelector(`input[type="radio"]${rt}`);let nt=et(`[name="${tt.name}"]:checked`);return nt||(nt=et(`[name="${tt.name}"]`)),nt!==tt}function isNodeMatchingSelectorFocusable(tt){return!(tt.disabled||tt.tagName==="INPUT"&&tt.type==="hidden"||isNonTabbableRadio(tt))}function defaultGetTabbable(tt){const et=[],nt=[];return Array.from(tt.querySelectorAll(candidatesSelector)).forEach((rt,it)=>{const ot=getTabIndex(rt);ot===-1||!isNodeMatchingSelectorFocusable(rt)||(ot===0?et.push(rt):nt.push({documentOrder:it,tabIndex:ot,node:rt}))}),nt.sort((rt,it)=>rt.tabIndex===it.tabIndex?rt.documentOrder-it.documentOrder:rt.tabIndex-it.tabIndex).map(rt=>rt.node).concat(et)}function defaultIsEnabled(){return!0}function FocusTrap(tt){const{children:et,disableAutoFocus:nt=!1,disableEnforceFocus:rt=!1,disableRestoreFocus:it=!1,getTabbable:ot=defaultGetTabbable,isEnabled:at=defaultIsEnabled,open:st}=tt,lt=reactExports.useRef(!1),ct=reactExports.useRef(null),ut=reactExports.useRef(null),ht=reactExports.useRef(null),dt=reactExports.useRef(null),pt=reactExports.useRef(!1),mt=reactExports.useRef(null),gt=useForkRef(et.ref,mt),yt=reactExports.useRef(null);reactExports.useEffect(()=>{!st||!mt.current||(pt.current=!nt)},[nt,st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const xt=ownerDocument(mt.current);return mt.current.contains(xt.activeElement)||(mt.current.hasAttribute("tabIndex")||mt.current.setAttribute("tabIndex","-1"),pt.current&&mt.current.focus()),()=>{it||(ht.current&&ht.current.focus&&(lt.current=!0,ht.current.focus()),ht.current=null)}},[st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const xt=ownerDocument(mt.current),kt=At=>{yt.current=At,!(rt||!at()||At.key!=="Tab")&&xt.activeElement===mt.current&&At.shiftKey&&(lt.current=!0,ut.current&&ut.current.focus())},St=()=>{const At=mt.current;if(At===null)return;if(!xt.hasFocus()||!at()||lt.current){lt.current=!1;return}if(At.contains(xt.activeElement)||rt&&xt.activeElement!==ct.current&&xt.activeElement!==ut.current)return;if(xt.activeElement!==dt.current)dt.current=null;else if(dt.current!==null)return;if(!pt.current)return;let Et=[];if((xt.activeElement===ct.current||xt.activeElement===ut.current)&&(Et=ot(mt.current)),Et.length>0){var Ct,Lt;const jt=!!((Ct=yt.current)!=null&&Ct.shiftKey&&((Lt=yt.current)==null?void 0:Lt.key)==="Tab"),Rt=Et[0],$t=Et[Et.length-1];typeof Rt!="string"&&typeof $t!="string"&&(jt?$t.focus():Rt.focus())}else At.focus()};xt.addEventListener("focusin",St),xt.addEventListener("keydown",kt,!0);const Tt=setInterval(()=>{xt.activeElement&&xt.activeElement.tagName==="BODY"&&St()},50);return()=>{clearInterval(Tt),xt.removeEventListener("focusin",St),xt.removeEventListener("keydown",kt,!0)}},[nt,rt,it,at,st,ot]);const bt=xt=>{ht.current===null&&(ht.current=xt.relatedTarget),pt.current=!0,dt.current=xt.target;const kt=et.props.onFocus;kt&&kt(xt)},wt=xt=>{ht.current===null&&(ht.current=xt.relatedTarget),pt.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ct,"data-testid":"sentinelStart"}),reactExports.cloneElement(et,{ref:gt,onFocus:bt}),jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ut,"data-testid":"sentinelEnd"})]})}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start$1="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(tt,et){return tt.concat([et+"-"+start$1,et+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(tt,et){return tt.concat([et,et+"-"+start$1,et+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(tt){return tt?(tt.nodeName||"").toLowerCase():null}function getWindow(tt){if(tt==null)return window;if(tt.toString()!=="[object Window]"){var et=tt.ownerDocument;return et&&et.defaultView||window}return tt}function isElement(tt){var et=getWindow(tt).Element;return tt instanceof et||tt instanceof Element}function isHTMLElement$1(tt){var et=getWindow(tt).HTMLElement;return tt instanceof et||tt instanceof HTMLElement}function isShadowRoot(tt){if(typeof ShadowRoot>"u")return!1;var et=getWindow(tt).ShadowRoot;return tt instanceof et||tt instanceof ShadowRoot}function applyStyles(tt){var et=tt.state;Object.keys(et.elements).forEach(function(nt){var rt=et.styles[nt]||{},it=et.attributes[nt]||{},ot=et.elements[nt];!isHTMLElement$1(ot)||!getNodeName(ot)||(Object.assign(ot.style,rt),Object.keys(it).forEach(function(at){var st=it[at];st===!1?ot.removeAttribute(at):ot.setAttribute(at,st===!0?"":st)}))})}function effect$2(tt){var et=tt.state,nt={popper:{position:et.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(et.elements.popper.style,nt.popper),et.styles=nt,et.elements.arrow&&Object.assign(et.elements.arrow.style,nt.arrow),function(){Object.keys(et.elements).forEach(function(rt){var it=et.elements[rt],ot=et.attributes[rt]||{},at=Object.keys(et.styles.hasOwnProperty(rt)?et.styles[rt]:nt[rt]),st=at.reduce(function(lt,ct){return lt[ct]="",lt},{});!isHTMLElement$1(it)||!getNodeName(it)||(Object.assign(it.style,st),Object.keys(ot).forEach(function(lt){it.removeAttribute(lt)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(tt){return tt.split("-")[0]}var max$2=Math.max,min$2=Math.min,round$1=Math.round;function getUAString(){var tt=navigator.userAgentData;return tt!=null&&tt.brands&&Array.isArray(tt.brands)?tt.brands.map(function(et){return et.brand+"/"+et.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(tt,et,nt){et===void 0&&(et=!1),nt===void 0&&(nt=!1);var rt=tt.getBoundingClientRect(),it=1,ot=1;et&&isHTMLElement$1(tt)&&(it=tt.offsetWidth>0&&round$1(rt.width)/tt.offsetWidth||1,ot=tt.offsetHeight>0&&round$1(rt.height)/tt.offsetHeight||1);var at=isElement(tt)?getWindow(tt):window,st=at.visualViewport,lt=!isLayoutViewport()&&nt,ct=(rt.left+(lt&&st?st.offsetLeft:0))/it,ut=(rt.top+(lt&&st?st.offsetTop:0))/ot,ht=rt.width/it,dt=rt.height/ot;return{width:ht,height:dt,top:ut,right:ct+ht,bottom:ut+dt,left:ct,x:ct,y:ut}}function getLayoutRect(tt){var et=getBoundingClientRect(tt),nt=tt.offsetWidth,rt=tt.offsetHeight;return Math.abs(et.width-nt)<=1&&(nt=et.width),Math.abs(et.height-rt)<=1&&(rt=et.height),{x:tt.offsetLeft,y:tt.offsetTop,width:nt,height:rt}}function contains(tt,et){var nt=et.getRootNode&&et.getRootNode();if(tt.contains(et))return!0;if(nt&&isShadowRoot(nt)){var rt=et;do{if(rt&&tt.isSameNode(rt))return!0;rt=rt.parentNode||rt.host}while(rt)}return!1}function getComputedStyle$1(tt){return getWindow(tt).getComputedStyle(tt)}function isTableElement(tt){return["table","td","th"].indexOf(getNodeName(tt))>=0}function getDocumentElement(tt){return((isElement(tt)?tt.ownerDocument:tt.document)||window.document).documentElement}function getParentNode(tt){return getNodeName(tt)==="html"?tt:tt.assignedSlot||tt.parentNode||(isShadowRoot(tt)?tt.host:null)||getDocumentElement(tt)}function getTrueOffsetParent(tt){return!isHTMLElement$1(tt)||getComputedStyle$1(tt).position==="fixed"?null:tt.offsetParent}function getContainingBlock(tt){var et=/firefox/i.test(getUAString()),nt=/Trident/i.test(getUAString());if(nt&&isHTMLElement$1(tt)){var rt=getComputedStyle$1(tt);if(rt.position==="fixed")return null}var it=getParentNode(tt);for(isShadowRoot(it)&&(it=it.host);isHTMLElement$1(it)&&["html","body"].indexOf(getNodeName(it))<0;){var ot=getComputedStyle$1(it);if(ot.transform!=="none"||ot.perspective!=="none"||ot.contain==="paint"||["transform","perspective"].indexOf(ot.willChange)!==-1||et&&ot.willChange==="filter"||et&&ot.filter&&ot.filter!=="none")return it;it=it.parentNode}return null}function getOffsetParent(tt){for(var et=getWindow(tt),nt=getTrueOffsetParent(tt);nt&&isTableElement(nt)&&getComputedStyle$1(nt).position==="static";)nt=getTrueOffsetParent(nt);return nt&&(getNodeName(nt)==="html"||getNodeName(nt)==="body"&&getComputedStyle$1(nt).position==="static")?et:nt||getContainingBlock(tt)||et}function getMainAxisFromPlacement(tt){return["top","bottom"].indexOf(tt)>=0?"x":"y"}function within(tt,et,nt){return max$2(tt,min$2(et,nt))}function withinMaxClamp(tt,et,nt){var rt=within(tt,et,nt);return rt>nt?nt:rt}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(tt){return Object.assign({},getFreshSideObject(),tt)}function expandToHashMap(tt,et){return et.reduce(function(nt,rt){return nt[rt]=tt,nt},{})}var toPaddingObject=function(et,nt){return et=typeof et=="function"?et(Object.assign({},nt.rects,{placement:nt.placement})):et,mergePaddingObject(typeof et!="number"?et:expandToHashMap(et,basePlacements))};function arrow(tt){var et,nt=tt.state,rt=tt.name,it=tt.options,ot=nt.elements.arrow,at=nt.modifiersData.popperOffsets,st=getBasePlacement(nt.placement),lt=getMainAxisFromPlacement(st),ct=[left,right].indexOf(st)>=0,ut=ct?"height":"width";if(!(!ot||!at)){var ht=toPaddingObject(it.padding,nt),dt=getLayoutRect(ot),pt=lt==="y"?top:left,mt=lt==="y"?bottom:right,gt=nt.rects.reference[ut]+nt.rects.reference[lt]-at[lt]-nt.rects.popper[ut],yt=at[lt]-nt.rects.reference[lt],bt=getOffsetParent(ot),wt=bt?lt==="y"?bt.clientHeight||0:bt.clientWidth||0:0,xt=gt/2-yt/2,kt=ht[pt],St=wt-dt[ut]-ht[mt],Tt=wt/2-dt[ut]/2+xt,At=within(kt,Tt,St),Et=lt;nt.modifiersData[rt]=(et={},et[Et]=At,et.centerOffset=At-Tt,et)}}function effect$1(tt){var et=tt.state,nt=tt.options,rt=nt.element,it=rt===void 0?"[data-popper-arrow]":rt;it!=null&&(typeof it=="string"&&(it=et.elements.popper.querySelector(it),!it)||contains(et.elements.popper,it)&&(et.elements.arrow=it))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(tt){return tt.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(tt,et){var nt=tt.x,rt=tt.y,it=et.devicePixelRatio||1;return{x:round$1(nt*it)/it||0,y:round$1(rt*it)/it||0}}function mapToStyles(tt){var et,nt=tt.popper,rt=tt.popperRect,it=tt.placement,ot=tt.variation,at=tt.offsets,st=tt.position,lt=tt.gpuAcceleration,ct=tt.adaptive,ut=tt.roundOffsets,ht=tt.isFixed,dt=at.x,pt=dt===void 0?0:dt,mt=at.y,gt=mt===void 0?0:mt,yt=typeof ut=="function"?ut({x:pt,y:gt}):{x:pt,y:gt};pt=yt.x,gt=yt.y;var bt=at.hasOwnProperty("x"),wt=at.hasOwnProperty("y"),xt=left,kt=top,St=window;if(ct){var Tt=getOffsetParent(nt),At="clientHeight",Et="clientWidth";if(Tt===getWindow(nt)&&(Tt=getDocumentElement(nt),getComputedStyle$1(Tt).position!=="static"&&st==="absolute"&&(At="scrollHeight",Et="scrollWidth")),Tt=Tt,it===top||(it===left||it===right)&&ot===end){kt=bottom;var Ct=ht&&Tt===St&&St.visualViewport?St.visualViewport.height:Tt[At];gt-=Ct-rt.height,gt*=lt?1:-1}if(it===left||(it===top||it===bottom)&&ot===end){xt=right;var Lt=ht&&Tt===St&&St.visualViewport?St.visualViewport.width:Tt[Et];pt-=Lt-rt.width,pt*=lt?1:-1}}var jt=Object.assign({position:st},ct&&unsetSides),Rt=ut===!0?roundOffsetsByDPR({x:pt,y:gt},getWindow(nt)):{x:pt,y:gt};if(pt=Rt.x,gt=Rt.y,lt){var $t;return Object.assign({},jt,($t={},$t[kt]=wt?"0":"",$t[xt]=bt?"0":"",$t.transform=(St.devicePixelRatio||1)<=1?"translate("+pt+"px, "+gt+"px)":"translate3d("+pt+"px, "+gt+"px, 0)",$t))}return Object.assign({},jt,(et={},et[kt]=wt?gt+"px":"",et[xt]=bt?pt+"px":"",et.transform="",et))}function computeStyles(tt){var et=tt.state,nt=tt.options,rt=nt.gpuAcceleration,it=rt===void 0?!0:rt,ot=nt.adaptive,at=ot===void 0?!0:ot,st=nt.roundOffsets,lt=st===void 0?!0:st,ct={placement:getBasePlacement(et.placement),variation:getVariation(et.placement),popper:et.elements.popper,popperRect:et.rects.popper,gpuAcceleration:it,isFixed:et.options.strategy==="fixed"};et.modifiersData.popperOffsets!=null&&(et.styles.popper=Object.assign({},et.styles.popper,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.popperOffsets,position:et.options.strategy,adaptive:at,roundOffsets:lt})))),et.modifiersData.arrow!=null&&(et.styles.arrow=Object.assign({},et.styles.arrow,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:lt})))),et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-placement":et.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(tt){var et=tt.state,nt=tt.instance,rt=tt.options,it=rt.scroll,ot=it===void 0?!0:it,at=rt.resize,st=at===void 0?!0:at,lt=getWindow(et.elements.popper),ct=[].concat(et.scrollParents.reference,et.scrollParents.popper);return ot&&ct.forEach(function(ut){ut.addEventListener("scroll",nt.update,passive)}),st&<.addEventListener("resize",nt.update,passive),function(){ot&&ct.forEach(function(ut){ut.removeEventListener("scroll",nt.update,passive)}),st&<.removeEventListener("resize",nt.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(tt){return tt.replace(/left|right|bottom|top/g,function(et){return hash$1[et]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(tt){return tt.replace(/start|end/g,function(et){return hash[et]})}function getWindowScroll(tt){var et=getWindow(tt),nt=et.pageXOffset,rt=et.pageYOffset;return{scrollLeft:nt,scrollTop:rt}}function getWindowScrollBarX(tt){return getBoundingClientRect(getDocumentElement(tt)).left+getWindowScroll(tt).scrollLeft}function getViewportRect(tt,et){var nt=getWindow(tt),rt=getDocumentElement(tt),it=nt.visualViewport,ot=rt.clientWidth,at=rt.clientHeight,st=0,lt=0;if(it){ot=it.width,at=it.height;var ct=isLayoutViewport();(ct||!ct&&et==="fixed")&&(st=it.offsetLeft,lt=it.offsetTop)}return{width:ot,height:at,x:st+getWindowScrollBarX(tt),y:lt}}function getDocumentRect(tt){var et,nt=getDocumentElement(tt),rt=getWindowScroll(tt),it=(et=tt.ownerDocument)==null?void 0:et.body,ot=max$2(nt.scrollWidth,nt.clientWidth,it?it.scrollWidth:0,it?it.clientWidth:0),at=max$2(nt.scrollHeight,nt.clientHeight,it?it.scrollHeight:0,it?it.clientHeight:0),st=-rt.scrollLeft+getWindowScrollBarX(tt),lt=-rt.scrollTop;return getComputedStyle$1(it||nt).direction==="rtl"&&(st+=max$2(nt.clientWidth,it?it.clientWidth:0)-ot),{width:ot,height:at,x:st,y:lt}}function isScrollParent(tt){var et=getComputedStyle$1(tt),nt=et.overflow,rt=et.overflowX,it=et.overflowY;return/auto|scroll|overlay|hidden/.test(nt+it+rt)}function getScrollParent(tt){return["html","body","#document"].indexOf(getNodeName(tt))>=0?tt.ownerDocument.body:isHTMLElement$1(tt)&&isScrollParent(tt)?tt:getScrollParent(getParentNode(tt))}function listScrollParents(tt,et){var nt;et===void 0&&(et=[]);var rt=getScrollParent(tt),it=rt===((nt=tt.ownerDocument)==null?void 0:nt.body),ot=getWindow(rt),at=it?[ot].concat(ot.visualViewport||[],isScrollParent(rt)?rt:[]):rt,st=et.concat(at);return it?st:st.concat(listScrollParents(getParentNode(at)))}function rectToClientRect(tt){return Object.assign({},tt,{left:tt.x,top:tt.y,right:tt.x+tt.width,bottom:tt.y+tt.height})}function getInnerBoundingClientRect(tt,et){var nt=getBoundingClientRect(tt,!1,et==="fixed");return nt.top=nt.top+tt.clientTop,nt.left=nt.left+tt.clientLeft,nt.bottom=nt.top+tt.clientHeight,nt.right=nt.left+tt.clientWidth,nt.width=tt.clientWidth,nt.height=tt.clientHeight,nt.x=nt.left,nt.y=nt.top,nt}function getClientRectFromMixedType(tt,et,nt){return et===viewport?rectToClientRect(getViewportRect(tt,nt)):isElement(et)?getInnerBoundingClientRect(et,nt):rectToClientRect(getDocumentRect(getDocumentElement(tt)))}function getClippingParents(tt){var et=listScrollParents(getParentNode(tt)),nt=["absolute","fixed"].indexOf(getComputedStyle$1(tt).position)>=0,rt=nt&&isHTMLElement$1(tt)?getOffsetParent(tt):tt;return isElement(rt)?et.filter(function(it){return isElement(it)&&contains(it,rt)&&getNodeName(it)!=="body"}):[]}function getClippingRect(tt,et,nt,rt){var it=et==="clippingParents"?getClippingParents(tt):[].concat(et),ot=[].concat(it,[nt]),at=ot[0],st=ot.reduce(function(lt,ct){var ut=getClientRectFromMixedType(tt,ct,rt);return lt.top=max$2(ut.top,lt.top),lt.right=min$2(ut.right,lt.right),lt.bottom=min$2(ut.bottom,lt.bottom),lt.left=max$2(ut.left,lt.left),lt},getClientRectFromMixedType(tt,at,rt));return st.width=st.right-st.left,st.height=st.bottom-st.top,st.x=st.left,st.y=st.top,st}function computeOffsets(tt){var et=tt.reference,nt=tt.element,rt=tt.placement,it=rt?getBasePlacement(rt):null,ot=rt?getVariation(rt):null,at=et.x+et.width/2-nt.width/2,st=et.y+et.height/2-nt.height/2,lt;switch(it){case top:lt={x:at,y:et.y-nt.height};break;case bottom:lt={x:at,y:et.y+et.height};break;case right:lt={x:et.x+et.width,y:st};break;case left:lt={x:et.x-nt.width,y:st};break;default:lt={x:et.x,y:et.y}}var ct=it?getMainAxisFromPlacement(it):null;if(ct!=null){var ut=ct==="y"?"height":"width";switch(ot){case start$1:lt[ct]=lt[ct]-(et[ut]/2-nt[ut]/2);break;case end:lt[ct]=lt[ct]+(et[ut]/2-nt[ut]/2);break}}return lt}function detectOverflow(tt,et){et===void 0&&(et={});var nt=et,rt=nt.placement,it=rt===void 0?tt.placement:rt,ot=nt.strategy,at=ot===void 0?tt.strategy:ot,st=nt.boundary,lt=st===void 0?clippingParents:st,ct=nt.rootBoundary,ut=ct===void 0?viewport:ct,ht=nt.elementContext,dt=ht===void 0?popper:ht,pt=nt.altBoundary,mt=pt===void 0?!1:pt,gt=nt.padding,yt=gt===void 0?0:gt,bt=mergePaddingObject(typeof yt!="number"?yt:expandToHashMap(yt,basePlacements)),wt=dt===popper?reference:popper,xt=tt.rects.popper,kt=tt.elements[mt?wt:dt],St=getClippingRect(isElement(kt)?kt:kt.contextElement||getDocumentElement(tt.elements.popper),lt,ut,at),Tt=getBoundingClientRect(tt.elements.reference),At=computeOffsets({reference:Tt,element:xt,strategy:"absolute",placement:it}),Et=rectToClientRect(Object.assign({},xt,At)),Ct=dt===popper?Et:Tt,Lt={top:St.top-Ct.top+bt.top,bottom:Ct.bottom-St.bottom+bt.bottom,left:St.left-Ct.left+bt.left,right:Ct.right-St.right+bt.right},jt=tt.modifiersData.offset;if(dt===popper&&jt){var Rt=jt[it];Object.keys(Lt).forEach(function($t){var vt=[right,bottom].indexOf($t)>=0?1:-1,It=[top,bottom].indexOf($t)>=0?"y":"x";Lt[$t]+=Rt[It]*vt})}return Lt}function computeAutoPlacement(tt,et){et===void 0&&(et={});var nt=et,rt=nt.placement,it=nt.boundary,ot=nt.rootBoundary,at=nt.padding,st=nt.flipVariations,lt=nt.allowedAutoPlacements,ct=lt===void 0?placements:lt,ut=getVariation(rt),ht=ut?st?variationPlacements:variationPlacements.filter(function(mt){return getVariation(mt)===ut}):basePlacements,dt=ht.filter(function(mt){return ct.indexOf(mt)>=0});dt.length===0&&(dt=ht);var pt=dt.reduce(function(mt,gt){return mt[gt]=detectOverflow(tt,{placement:gt,boundary:it,rootBoundary:ot,padding:at})[getBasePlacement(gt)],mt},{});return Object.keys(pt).sort(function(mt,gt){return pt[mt]-pt[gt]})}function getExpandedFallbackPlacements(tt){if(getBasePlacement(tt)===auto)return[];var et=getOppositePlacement(tt);return[getOppositeVariationPlacement(tt),et,getOppositeVariationPlacement(et)]}function flip(tt){var et=tt.state,nt=tt.options,rt=tt.name;if(!et.modifiersData[rt]._skip){for(var it=nt.mainAxis,ot=it===void 0?!0:it,at=nt.altAxis,st=at===void 0?!0:at,lt=nt.fallbackPlacements,ct=nt.padding,ut=nt.boundary,ht=nt.rootBoundary,dt=nt.altBoundary,pt=nt.flipVariations,mt=pt===void 0?!0:pt,gt=nt.allowedAutoPlacements,yt=et.options.placement,bt=getBasePlacement(yt),wt=bt===yt,xt=lt||(wt||!mt?[getOppositePlacement(yt)]:getExpandedFallbackPlacements(yt)),kt=[yt].concat(xt).reduce(function(Qt,an){return Qt.concat(getBasePlacement(an)===auto?computeAutoPlacement(et,{placement:an,boundary:ut,rootBoundary:ht,padding:ct,flipVariations:mt,allowedAutoPlacements:gt}):an)},[]),St=et.rects.reference,Tt=et.rects.popper,At=new Map,Et=!0,Ct=kt[0],Lt=0;Lt=0,It=vt?"width":"height",Ot=detectOverflow(et,{placement:jt,boundary:ut,rootBoundary:ht,altBoundary:dt,padding:ct}),Wt=vt?$t?right:left:$t?bottom:top;St[It]>Tt[It]&&(Wt=getOppositePlacement(Wt));var zt=getOppositePlacement(Wt),Ft=[];if(ot&&Ft.push(Ot[Rt]<=0),st&&Ft.push(Ot[Wt]<=0,Ot[zt]<=0),Ft.every(function(Qt){return Qt})){Ct=jt,Et=!1;break}At.set(jt,Ft)}if(Et)for(var Nt=mt?3:1,Ut=function(an){var Yt=kt.find(function(nn){var tn=At.get(nn);if(tn)return tn.slice(0,an).every(function(dn){return dn})});if(Yt)return Ct=Yt,"break"},Pt=Nt;Pt>0;Pt--){var Ht=Ut(Pt);if(Ht==="break")break}et.placement!==Ct&&(et.modifiersData[rt]._skip=!0,et.placement=Ct,et.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(tt,et,nt){return nt===void 0&&(nt={x:0,y:0}),{top:tt.top-et.height-nt.y,right:tt.right-et.width+nt.x,bottom:tt.bottom-et.height+nt.y,left:tt.left-et.width-nt.x}}function isAnySideFullyClipped(tt){return[top,right,bottom,left].some(function(et){return tt[et]>=0})}function hide(tt){var et=tt.state,nt=tt.name,rt=et.rects.reference,it=et.rects.popper,ot=et.modifiersData.preventOverflow,at=detectOverflow(et,{elementContext:"reference"}),st=detectOverflow(et,{altBoundary:!0}),lt=getSideOffsets(at,rt),ct=getSideOffsets(st,it,ot),ut=isAnySideFullyClipped(lt),ht=isAnySideFullyClipped(ct);et.modifiersData[nt]={referenceClippingOffsets:lt,popperEscapeOffsets:ct,isReferenceHidden:ut,hasPopperEscaped:ht},et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-reference-hidden":ut,"data-popper-escaped":ht})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(tt,et,nt){var rt=getBasePlacement(tt),it=[left,top].indexOf(rt)>=0?-1:1,ot=typeof nt=="function"?nt(Object.assign({},et,{placement:tt})):nt,at=ot[0],st=ot[1];return at=at||0,st=(st||0)*it,[left,right].indexOf(rt)>=0?{x:st,y:at}:{x:at,y:st}}function offset(tt){var et=tt.state,nt=tt.options,rt=tt.name,it=nt.offset,ot=it===void 0?[0,0]:it,at=placements.reduce(function(ut,ht){return ut[ht]=distanceAndSkiddingToXY(ht,et.rects,ot),ut},{}),st=at[et.placement],lt=st.x,ct=st.y;et.modifiersData.popperOffsets!=null&&(et.modifiersData.popperOffsets.x+=lt,et.modifiersData.popperOffsets.y+=ct),et.modifiersData[rt]=at}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(tt){var et=tt.state,nt=tt.name;et.modifiersData[nt]=computeOffsets({reference:et.rects.reference,element:et.rects.popper,strategy:"absolute",placement:et.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(tt){return tt==="x"?"y":"x"}function preventOverflow(tt){var et=tt.state,nt=tt.options,rt=tt.name,it=nt.mainAxis,ot=it===void 0?!0:it,at=nt.altAxis,st=at===void 0?!1:at,lt=nt.boundary,ct=nt.rootBoundary,ut=nt.altBoundary,ht=nt.padding,dt=nt.tether,pt=dt===void 0?!0:dt,mt=nt.tetherOffset,gt=mt===void 0?0:mt,yt=detectOverflow(et,{boundary:lt,rootBoundary:ct,padding:ht,altBoundary:ut}),bt=getBasePlacement(et.placement),wt=getVariation(et.placement),xt=!wt,kt=getMainAxisFromPlacement(bt),St=getAltAxis(kt),Tt=et.modifiersData.popperOffsets,At=et.rects.reference,Et=et.rects.popper,Ct=typeof gt=="function"?gt(Object.assign({},et.rects,{placement:et.placement})):gt,Lt=typeof Ct=="number"?{mainAxis:Ct,altAxis:Ct}:Object.assign({mainAxis:0,altAxis:0},Ct),jt=et.modifiersData.offset?et.modifiersData.offset[et.placement]:null,Rt={x:0,y:0};if(Tt){if(ot){var $t,vt=kt==="y"?top:left,It=kt==="y"?bottom:right,Ot=kt==="y"?"height":"width",Wt=Tt[kt],zt=Wt+yt[vt],Ft=Wt-yt[It],Nt=pt?-Et[Ot]/2:0,Ut=wt===start$1?At[Ot]:Et[Ot],Pt=wt===start$1?-Et[Ot]:-At[Ot],Ht=et.elements.arrow,Qt=pt&&Ht?getLayoutRect(Ht):{width:0,height:0},an=et.modifiersData["arrow#persistent"]?et.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Yt=an[vt],nn=an[It],tn=within(0,At[Ot],Qt[Ot]),dn=xt?At[Ot]/2-Nt-tn-Yt-Lt.mainAxis:Ut-tn-Yt-Lt.mainAxis,wn=xt?-At[Ot]/2+Nt+tn+nn+Lt.mainAxis:Pt+tn+nn+Lt.mainAxis,rn=et.elements.arrow&&getOffsetParent(et.elements.arrow),Zt=rn?kt==="y"?rn.clientTop||0:rn.clientLeft||0:0,vn=($t=jt==null?void 0:jt[kt])!=null?$t:0,Cn=Wt+dn-vn-Zt,$n=Wt+wn-vn,Nn=within(pt?min$2(zt,Cn):zt,Wt,pt?max$2(Ft,$n):Ft);Tt[kt]=Nn,Rt[kt]=Nn-Wt}if(st){var En,sn=kt==="x"?top:left,pn=kt==="x"?bottom:right,Tn=Tt[St],In=St==="y"?"height":"width",yn=Tn+yt[sn],hn=Tn-yt[pn],fn=[top,left].indexOf(bt)!==-1,xn=(En=jt==null?void 0:jt[St])!=null?En:0,jn=fn?yn:Tn-At[In]-Et[In]-xn+Lt.altAxis,cn=fn?Tn+At[In]+Et[In]-xn-Lt.altAxis:hn,Xt=pt&&fn?withinMaxClamp(jn,Tn,cn):within(pt?jn:yn,Tn,pt?cn:hn);Tt[St]=Xt,Rt[St]=Xt-Tn}et.modifiersData[rt]=Rt}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(tt){return{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}}function getNodeScroll(tt){return tt===getWindow(tt)||!isHTMLElement$1(tt)?getWindowScroll(tt):getHTMLElementScroll(tt)}function isElementScaled(tt){var et=tt.getBoundingClientRect(),nt=round$1(et.width)/tt.offsetWidth||1,rt=round$1(et.height)/tt.offsetHeight||1;return nt!==1||rt!==1}function getCompositeRect(tt,et,nt){nt===void 0&&(nt=!1);var rt=isHTMLElement$1(et),it=isHTMLElement$1(et)&&isElementScaled(et),ot=getDocumentElement(et),at=getBoundingClientRect(tt,it,nt),st={scrollLeft:0,scrollTop:0},lt={x:0,y:0};return(rt||!rt&&!nt)&&((getNodeName(et)!=="body"||isScrollParent(ot))&&(st=getNodeScroll(et)),isHTMLElement$1(et)?(lt=getBoundingClientRect(et,!0),lt.x+=et.clientLeft,lt.y+=et.clientTop):ot&&(lt.x=getWindowScrollBarX(ot))),{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function order(tt){var et=new Map,nt=new Set,rt=[];tt.forEach(function(ot){et.set(ot.name,ot)});function it(ot){nt.add(ot.name);var at=[].concat(ot.requires||[],ot.requiresIfExists||[]);at.forEach(function(st){if(!nt.has(st)){var lt=et.get(st);lt&&it(lt)}}),rt.push(ot)}return tt.forEach(function(ot){nt.has(ot.name)||it(ot)}),rt}function orderModifiers(tt){var et=order(tt);return modifierPhases.reduce(function(nt,rt){return nt.concat(et.filter(function(it){return it.phase===rt}))},[])}function debounce$3(tt){var et;return function(){return et||(et=new Promise(function(nt){Promise.resolve().then(function(){et=void 0,nt(tt())})})),et}}function mergeByName(tt){var et=tt.reduce(function(nt,rt){var it=nt[rt.name];return nt[rt.name]=it?Object.assign({},it,rt,{options:Object.assign({},it.options,rt.options),data:Object.assign({},it.data,rt.data)}):rt,nt},{});return Object.keys(et).map(function(nt){return et[nt]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var tt=arguments.length,et=new Array(tt),nt=0;nt{ot||st(getContainer$1(it)||document.body)},[it,ot]),useEnhancedEffect$1(()=>{if(at&&!ot)return setRef(nt,at),()=>{setRef(nt,null)}},[nt,at,ot]),ot){if(reactExports.isValidElement(rt)){const ct={ref:lt};return reactExports.cloneElement(rt,ct)}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:rt})}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:at&&reactDomExports.createPortal(rt,at)})});function getPopperUtilityClass(tt){return generateUtilityClass("MuiPopper",tt)}generateUtilityClasses("MuiPopper",["root"]);const _excluded$1o=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],_excluded2$g=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function flipPlacement(tt,et){if(et==="ltr")return tt;switch(tt){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return tt}}function resolveAnchorEl$1(tt){return typeof tt=="function"?tt():tt}function isHTMLElement(tt){return tt.nodeType!==void 0}const useUtilityClasses$R=()=>composeClasses({root:["root"]},useClassNamesOverride(getPopperUtilityClass)),defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(et,nt){var rt;const{anchorEl:it,children:ot,direction:at,disablePortal:st,modifiers:lt,open:ct,placement:ut,popperOptions:ht,popperRef:dt,slotProps:pt={},slots:mt={},TransitionProps:gt}=et,yt=_objectWithoutPropertiesLoose$k(et,_excluded$1o),bt=reactExports.useRef(null),wt=useForkRef(bt,nt),xt=reactExports.useRef(null),kt=useForkRef(xt,dt),St=reactExports.useRef(kt);useEnhancedEffect$1(()=>{St.current=kt},[kt]),reactExports.useImperativeHandle(dt,()=>xt.current,[]);const Tt=flipPlacement(ut,at),[At,Et]=reactExports.useState(Tt),[Ct,Lt]=reactExports.useState(resolveAnchorEl$1(it));reactExports.useEffect(()=>{xt.current&&xt.current.forceUpdate()}),reactExports.useEffect(()=>{it&&Lt(resolveAnchorEl$1(it))},[it]),useEnhancedEffect$1(()=>{if(!Ct||!ct)return;const It=zt=>{Et(zt.placement)};let Ot=[{name:"preventOverflow",options:{altBoundary:st}},{name:"flip",options:{altBoundary:st}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:zt})=>{It(zt)}}];lt!=null&&(Ot=Ot.concat(lt)),ht&&ht.modifiers!=null&&(Ot=Ot.concat(ht.modifiers));const Wt=createPopper(Ct,bt.current,_extends$u({placement:Tt},ht,{modifiers:Ot}));return St.current(Wt),()=>{Wt.destroy(),St.current(null)}},[Ct,st,lt,ct,ht,Tt]);const jt={placement:At};gt!==null&&(jt.TransitionProps=gt);const Rt=useUtilityClasses$R(),$t=(rt=mt.root)!=null?rt:"div",vt=useSlotProps({elementType:$t,externalSlotProps:pt.root,externalForwardedProps:yt,additionalProps:{role:"tooltip",ref:wt},ownerState:et,className:Rt.root});return jsxRuntimeExports.jsx($t,_extends$u({},vt,{children:typeof ot=="function"?ot(jt):ot}))}),Popper$1=reactExports.forwardRef(function(et,nt){const{anchorEl:rt,children:it,container:ot,direction:at="ltr",disablePortal:st=!1,keepMounted:lt=!1,modifiers:ct,open:ut,placement:ht="bottom",popperOptions:dt=defaultPopperOptions,popperRef:pt,style:mt,transition:gt=!1,slotProps:yt={},slots:bt={}}=et,wt=_objectWithoutPropertiesLoose$k(et,_excluded2$g),[xt,kt]=reactExports.useState(!0),St=()=>{kt(!1)},Tt=()=>{kt(!0)};if(!lt&&!ut&&(!gt||xt))return null;let At;if(ot)At=ot;else if(rt){const Lt=resolveAnchorEl$1(rt);At=Lt&&isHTMLElement(Lt)?ownerDocument(Lt).body:ownerDocument(null).body}const Et=!ut&<&&(!gt||xt)?"none":void 0,Ct=gt?{in:ut,onEnter:St,onExited:Tt}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:st,container:At,children:jsxRuntimeExports.jsx(PopperTooltip,_extends$u({anchorEl:rt,direction:at,disablePortal:st,modifiers:ct,ref:nt,open:gt?!xt:ut,placement:ht,popperOptions:dt,popperRef:pt,slotProps:yt,slots:bt},wt,{style:_extends$u({position:"fixed",top:0,left:0,display:Et},mt),TransitionProps:Ct,children:it}))})});function isOverflowing(tt){const et=ownerDocument(tt);return et.body===tt?ownerWindow(tt).innerWidth>et.documentElement.clientWidth:tt.scrollHeight>tt.clientHeight}function ariaHidden(tt,et){et?tt.setAttribute("aria-hidden","true"):tt.removeAttribute("aria-hidden")}function getPaddingRight(tt){return parseInt(ownerWindow(tt).getComputedStyle(tt).paddingRight,10)||0}function isAriaHiddenForbiddenOnElement(tt){const nt=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(tt.tagName)!==-1,rt=tt.tagName==="INPUT"&&tt.getAttribute("type")==="hidden";return nt||rt}function ariaHiddenSiblings(tt,et,nt,rt,it){const ot=[et,nt,...rt];[].forEach.call(tt.children,at=>{const st=ot.indexOf(at)===-1,lt=!isAriaHiddenForbiddenOnElement(at);st&<&&ariaHidden(at,it)})}function findIndexOf(tt,et){let nt=-1;return tt.some((rt,it)=>et(rt)?(nt=it,!0):!1),nt}function handleContainer(tt,et){const nt=[],rt=tt.container;if(!et.disableScrollLock){if(isOverflowing(rt)){const at=getScrollbarSize(ownerDocument(rt));nt.push({value:rt.style.paddingRight,property:"padding-right",el:rt}),rt.style.paddingRight=`${getPaddingRight(rt)+at}px`;const st=ownerDocument(rt).querySelectorAll(".mui-fixed");[].forEach.call(st,lt=>{nt.push({value:lt.style.paddingRight,property:"padding-right",el:lt}),lt.style.paddingRight=`${getPaddingRight(lt)+at}px`})}let ot;if(rt.parentNode instanceof DocumentFragment)ot=ownerDocument(rt).body;else{const at=rt.parentElement,st=ownerWindow(rt);ot=(at==null?void 0:at.nodeName)==="HTML"&&st.getComputedStyle(at).overflowY==="scroll"?at:rt}nt.push({value:ot.style.overflow,property:"overflow",el:ot},{value:ot.style.overflowX,property:"overflow-x",el:ot},{value:ot.style.overflowY,property:"overflow-y",el:ot}),ot.style.overflow="hidden"}return()=>{nt.forEach(({value:ot,el:at,property:st})=>{ot?at.style.setProperty(st,ot):at.style.removeProperty(st)})}}function getHiddenSiblings(tt){const et=[];return[].forEach.call(tt.children,nt=>{nt.getAttribute("aria-hidden")==="true"&&et.push(nt)}),et}class ModalManager{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(et,nt){let rt=this.modals.indexOf(et);if(rt!==-1)return rt;rt=this.modals.length,this.modals.push(et),et.modalRef&&ariaHidden(et.modalRef,!1);const it=getHiddenSiblings(nt);ariaHiddenSiblings(nt,et.mount,et.modalRef,it,!0);const ot=findIndexOf(this.containers,at=>at.container===nt);return ot!==-1?(this.containers[ot].modals.push(et),rt):(this.containers.push({modals:[et],container:nt,restore:null,hiddenSiblings:it}),rt)}mount(et,nt){const rt=findIndexOf(this.containers,ot=>ot.modals.indexOf(et)!==-1),it=this.containers[rt];it.restore||(it.restore=handleContainer(it,nt))}remove(et,nt=!0){const rt=this.modals.indexOf(et);if(rt===-1)return rt;const it=findIndexOf(this.containers,at=>at.modals.indexOf(et)!==-1),ot=this.containers[it];if(ot.modals.splice(ot.modals.indexOf(et),1),this.modals.splice(rt,1),ot.modals.length===0)ot.restore&&ot.restore(),et.modalRef&&ariaHidden(et.modalRef,nt),ariaHiddenSiblings(ot.container,et.mount,et.modalRef,ot.hiddenSiblings,!1),this.containers.splice(it,1);else{const at=ot.modals[ot.modals.length-1];at.modalRef&&ariaHidden(at.modalRef,!1)}return rt}isTopModal(et){return this.modals.length>0&&this.modals[this.modals.length-1]===et}}function getContainer(tt){return typeof tt=="function"?tt():tt}function getHasTransition(tt){return tt?tt.props.hasOwnProperty("in"):!1}const defaultManager=new ModalManager;function useModal$1(tt){const{container:et,disableEscapeKeyDown:nt=!1,disableScrollLock:rt=!1,manager:it=defaultManager,closeAfterTransition:ot=!1,onTransitionEnter:at,onTransitionExited:st,children:lt,onClose:ct,open:ut,rootRef:ht}=tt,dt=reactExports.useRef({}),pt=reactExports.useRef(null),mt=reactExports.useRef(null),gt=useForkRef(mt,ht),[yt,bt]=reactExports.useState(!ut),wt=getHasTransition(lt);let xt=!0;(tt["aria-hidden"]==="false"||tt["aria-hidden"]===!1)&&(xt=!1);const kt=()=>ownerDocument(pt.current),St=()=>(dt.current.modalRef=mt.current,dt.current.mount=pt.current,dt.current),Tt=()=>{it.mount(St(),{disableScrollLock:rt}),mt.current&&(mt.current.scrollTop=0)},At=useEventCallback(()=>{const Ot=getContainer(et)||kt().body;it.add(St(),Ot),mt.current&&Tt()}),Et=reactExports.useCallback(()=>it.isTopModal(St()),[it]),Ct=useEventCallback(Ot=>{pt.current=Ot,Ot&&(ut&&Et()?Tt():mt.current&&ariaHidden(mt.current,xt))}),Lt=reactExports.useCallback(()=>{it.remove(St(),xt)},[xt,it]);reactExports.useEffect(()=>()=>{Lt()},[Lt]),reactExports.useEffect(()=>{ut?At():(!wt||!ot)&&Lt()},[ut,Lt,wt,ot,At]);const jt=Ot=>Wt=>{var zt;(zt=Ot.onKeyDown)==null||zt.call(Ot,Wt),!(Wt.key!=="Escape"||!Et())&&(nt||(Wt.stopPropagation(),ct&&ct(Wt,"escapeKeyDown")))},Rt=Ot=>Wt=>{var zt;(zt=Ot.onClick)==null||zt.call(Ot,Wt),Wt.target===Wt.currentTarget&&ct&&ct(Wt,"backdropClick")};return{getRootProps:(Ot={})=>{const Wt=extractEventHandlers(tt);delete Wt.onTransitionEnter,delete Wt.onTransitionExited;const zt=_extends$u({},Wt,Ot);return _extends$u({role:"presentation"},zt,{onKeyDown:jt(zt),ref:gt})},getBackdropProps:(Ot={})=>{const Wt=Ot;return _extends$u({"aria-hidden":!0},Wt,{onClick:Rt(Wt),open:ut})},getTransitionProps:()=>{const Ot=()=>{bt(!1),at&&at()},Wt=()=>{bt(!0),st&&st(),ot&&Lt()};return{onEnter:createChainedFunction(Ot,lt==null?void 0:lt.props.onEnter),onExited:createChainedFunction(Wt,lt==null?void 0:lt.props.onExited)}},rootRef:gt,portalRef:Ct,isTopModal:Et,exited:yt,hasTransition:wt}}const INTENTIONAL_DRAG_COUNT_THRESHOLD=2;function asc(tt,et){return tt-et}function clamp$1(tt,et,nt){return tt==null?et:Math.min(Math.max(et,tt),nt)}function findClosest(tt,et){var nt;const{index:rt}=(nt=tt.reduce((it,ot,at)=>{const st=Math.abs(et-ot);return it===null||st({left:`${tt}%`}),leap:tt=>({width:`${tt}%`})},"horizontal-reverse":{offset:tt=>({right:`${tt}%`}),leap:tt=>({width:`${tt}%`})},vertical:{offset:tt=>({bottom:`${tt}%`}),leap:tt=>({height:`${tt}%`})}},Identity$1=tt=>tt;let cachedSupportsTouchActionNone;function doesSupportTouchActionNone(){return cachedSupportsTouchActionNone===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?cachedSupportsTouchActionNone=CSS.supports("touch-action","none"):cachedSupportsTouchActionNone=!0),cachedSupportsTouchActionNone}function useSlider(tt){const{"aria-labelledby":et,defaultValue:nt,disabled:rt=!1,disableSwap:it=!1,isRtl:ot=!1,marks:at=!1,max:st=100,min:lt=0,name:ct,onChange:ut,onChangeCommitted:ht,orientation:dt="horizontal",rootRef:pt,scale:mt=Identity$1,step:gt=1,tabIndex:yt,value:bt}=tt,wt=reactExports.useRef(),[xt,kt]=reactExports.useState(-1),[St,Tt]=reactExports.useState(-1),[At,Et]=reactExports.useState(!1),Ct=reactExports.useRef(0),[Lt,jt]=useControlled({controlled:bt,default:nt??lt,name:"Slider"}),Rt=ut&&((xn,jn,cn)=>{const Xt=xn.nativeEvent||xn,Kt=new Xt.constructor(Xt.type,Xt);Object.defineProperty(Kt,"target",{writable:!0,value:{value:jn,name:ct}}),ut(Kt,jn,cn)}),$t=Array.isArray(Lt);let vt=$t?Lt.slice().sort(asc):[Lt];vt=vt.map(xn=>clamp$1(xn,lt,st));const It=at===!0&>!==null?[...Array(Math.floor((st-lt)/gt)+1)].map((xn,jn)=>({value:lt+gt*jn})):at||[],Ot=It.map(xn=>xn.value),{isFocusVisibleRef:Wt,onBlur:zt,onFocus:Ft,ref:Nt}=useIsFocusVisible(),[Ut,Pt]=reactExports.useState(-1),Ht=reactExports.useRef(),Qt=useForkRef(Nt,Ht),an=useForkRef(pt,Qt),Yt=xn=>jn=>{var cn;const Xt=Number(jn.currentTarget.getAttribute("data-index"));Ft(jn),Wt.current===!0&&Pt(Xt),Tt(Xt),xn==null||(cn=xn.onFocus)==null||cn.call(xn,jn)},nn=xn=>jn=>{var cn;zt(jn),Wt.current===!1&&Pt(-1),Tt(-1),xn==null||(cn=xn.onBlur)==null||cn.call(xn,jn)};useEnhancedEffect$1(()=>{if(rt&&Ht.current.contains(document.activeElement)){var xn;(xn=document.activeElement)==null||xn.blur()}},[rt]),rt&&xt!==-1&&kt(-1),rt&&Ut!==-1&&Pt(-1);const tn=xn=>jn=>{var cn;(cn=xn.onChange)==null||cn.call(xn,jn);const Xt=Number(jn.currentTarget.getAttribute("data-index")),Kt=vt[Xt],kn=Ot.indexOf(Kt);let Mn=jn.target.valueAsNumber;if(It&>==null){const On=Ot[Ot.length-1];Mn>On?Mn=On:Mn{const{current:cn}=Ht,{width:Xt,height:Kt,bottom:kn,left:Mn}=cn.getBoundingClientRect();let On;wn.indexOf("vertical")===0?On=(kn-xn.y)/Kt:On=(xn.x-Mn)/Xt,wn.indexOf("-reverse")!==-1&&(On=1-On);let Bn;if(Bn=percentToValue(On,lt,st),gt)Bn=roundValueToStep(Bn,gt,lt);else{const Vn=findClosest(Ot,Bn);Bn=Ot[Vn]}Bn=clamp$1(Bn,lt,st);let Xn=0;if($t){jn?Xn=dn.current:Xn=findClosest(vt,Bn),it&&(Bn=clamp$1(Bn,vt[Xn-1]||-1/0,vt[Xn+1]||1/0));const Vn=Bn;Bn=setValueIndex({values:vt,newValue:Bn,index:Xn}),it&&jn||(Xn=Bn.indexOf(Vn),dn.current=Xn)}return{newValue:Bn,activeIndex:Xn}},Zt=useEventCallback(xn=>{const jn=trackFinger(xn,wt);if(!jn)return;if(Ct.current+=1,xn.type==="mousemove"&&xn.buttons===0){vn(xn);return}const{newValue:cn,activeIndex:Xt}=rn({finger:jn,move:!0});focusThumb({sliderRef:Ht,activeIndex:Xt,setActive:kt}),jt(cn),!At&&Ct.current>INTENTIONAL_DRAG_COUNT_THRESHOLD&&Et(!0),Rt&&!areValuesEqual(cn,Lt)&&Rt(xn,cn,Xt)}),vn=useEventCallback(xn=>{const jn=trackFinger(xn,wt);if(Et(!1),!jn)return;const{newValue:cn}=rn({finger:jn,move:!0});kt(-1),xn.type==="touchend"&&Tt(-1),ht&&ht(xn,cn),wt.current=void 0,$n()}),Cn=useEventCallback(xn=>{if(rt)return;doesSupportTouchActionNone()||xn.preventDefault();const jn=xn.changedTouches[0];jn!=null&&(wt.current=jn.identifier);const cn=trackFinger(xn,wt);if(cn!==!1){const{newValue:Kt,activeIndex:kn}=rn({finger:cn});focusThumb({sliderRef:Ht,activeIndex:kn,setActive:kt}),jt(Kt),Rt&&!areValuesEqual(Kt,Lt)&&Rt(xn,Kt,kn)}Ct.current=0;const Xt=ownerDocument(Ht.current);Xt.addEventListener("touchmove",Zt),Xt.addEventListener("touchend",vn)}),$n=reactExports.useCallback(()=>{const xn=ownerDocument(Ht.current);xn.removeEventListener("mousemove",Zt),xn.removeEventListener("mouseup",vn),xn.removeEventListener("touchmove",Zt),xn.removeEventListener("touchend",vn)},[vn,Zt]);reactExports.useEffect(()=>{const{current:xn}=Ht;return xn.addEventListener("touchstart",Cn,{passive:doesSupportTouchActionNone()}),()=>{xn.removeEventListener("touchstart",Cn,{passive:doesSupportTouchActionNone()}),$n()}},[$n,Cn]),reactExports.useEffect(()=>{rt&&$n()},[rt,$n]);const Nn=xn=>jn=>{var cn;if((cn=xn.onMouseDown)==null||cn.call(xn,jn),rt||jn.defaultPrevented||jn.button!==0)return;jn.preventDefault();const Xt=trackFinger(jn,wt);if(Xt!==!1){const{newValue:kn,activeIndex:Mn}=rn({finger:Xt});focusThumb({sliderRef:Ht,activeIndex:Mn,setActive:kt}),jt(kn),Rt&&!areValuesEqual(kn,Lt)&&Rt(jn,kn,Mn)}Ct.current=0;const Kt=ownerDocument(Ht.current);Kt.addEventListener("mousemove",Zt),Kt.addEventListener("mouseup",vn)},En=valueToPercent($t?vt[0]:lt,lt,st),sn=valueToPercent(vt[vt.length-1],lt,st)-En,pn=(xn={})=>{const jn=extractEventHandlers(xn),cn={onMouseDown:Nn(jn||{})},Xt=_extends$u({},jn,cn);return _extends$u({},xn,{ref:an},Xt)},Tn=xn=>jn=>{var cn;(cn=xn.onMouseOver)==null||cn.call(xn,jn);const Xt=Number(jn.currentTarget.getAttribute("data-index"));Tt(Xt)},In=xn=>jn=>{var cn;(cn=xn.onMouseLeave)==null||cn.call(xn,jn),Tt(-1)};return{active:xt,axis:wn,axisProps,dragging:At,focusedThumbIndex:Ut,getHiddenInputProps:(xn={})=>{var jn;const cn=extractEventHandlers(xn),Xt={onChange:tn(cn||{}),onFocus:Yt(cn||{}),onBlur:nn(cn||{})},Kt=_extends$u({},cn,Xt);return _extends$u({tabIndex:yt,"aria-labelledby":et,"aria-orientation":dt,"aria-valuemax":mt(st),"aria-valuemin":mt(lt),name:ct,type:"range",min:tt.min,max:tt.max,step:tt.step===null&&tt.marks?"any":(jn=tt.step)!=null?jn:void 0,disabled:rt},xn,Kt,{style:_extends$u({},visuallyHidden$1,{direction:ot?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:pn,getThumbProps:(xn={})=>{const jn=extractEventHandlers(xn),cn={onMouseOver:Tn(jn||{}),onMouseLeave:In(jn||{})};return _extends$u({},xn,jn,cn)},marks:It,open:St,range:$t,rootRef:an,trackLeap:sn,trackOffset:En,values:vt,getThumbStyle:xn=>({pointerEvents:xt!==-1&&xt!==xn?"none":void 0})}}const _excluded$1n=["onChange","maxRows","minRows","style","value"];function getStyleValue(tt){return parseInt(tt,10)||0}const styles$4={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isEmpty$1(tt){return tt==null||Object.keys(tt).length===0||tt.outerHeightStyle===0&&!tt.overflow}const TextareaAutosize=reactExports.forwardRef(function(et,nt){const{onChange:rt,maxRows:it,minRows:ot=1,style:at,value:st}=et,lt=_objectWithoutPropertiesLoose$k(et,_excluded$1n),{current:ct}=reactExports.useRef(st!=null),ut=reactExports.useRef(null),ht=useForkRef(nt,ut),dt=reactExports.useRef(null),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState({outerHeightStyle:0}),yt=reactExports.useCallback(()=>{const kt=ut.current,Tt=ownerWindow(kt).getComputedStyle(kt);if(Tt.width==="0px")return{outerHeightStyle:0};const At=dt.current;At.style.width=Tt.width,At.value=kt.value||et.placeholder||"x",At.value.slice(-1)===` +`&&(At.value+=" ");const Et=Tt.boxSizing,Ct=getStyleValue(Tt.paddingBottom)+getStyleValue(Tt.paddingTop),Lt=getStyleValue(Tt.borderBottomWidth)+getStyleValue(Tt.borderTopWidth),jt=At.scrollHeight;At.value="x";const Rt=At.scrollHeight;let $t=jt;ot&&($t=Math.max(Number(ot)*Rt,$t)),it&&($t=Math.min(Number(it)*Rt,$t)),$t=Math.max($t,Rt);const vt=$t+(Et==="border-box"?Ct+Lt:0),It=Math.abs($t-jt)<=1;return{outerHeightStyle:vt,overflow:It}},[it,ot,et.placeholder]),bt=(kt,St)=>{const{outerHeightStyle:Tt,overflow:At}=St;return pt.current<20&&(Tt>0&&Math.abs((kt.outerHeightStyle||0)-Tt)>1||kt.overflow!==At)?(pt.current+=1,{overflow:At,outerHeightStyle:Tt}):kt},wt=reactExports.useCallback(()=>{const kt=yt();isEmpty$1(kt)||gt(St=>bt(St,kt))},[yt]);useEnhancedEffect$1(()=>{const kt=()=>{const jt=yt();isEmpty$1(jt)||reactDomExports.flushSync(()=>{gt(Rt=>bt(Rt,jt))})},St=()=>{pt.current=0,kt()};let Tt;const At=debounce$4(St),Et=ut.current,Ct=ownerWindow(Et);Ct.addEventListener("resize",At);let Lt;return typeof ResizeObserver<"u"&&(Lt=new ResizeObserver(St),Lt.observe(Et)),()=>{At.clear(),cancelAnimationFrame(Tt),Ct.removeEventListener("resize",At),Lt&&Lt.disconnect()}},[yt]),useEnhancedEffect$1(()=>{wt()}),reactExports.useEffect(()=>{pt.current=0},[st]);const xt=kt=>{pt.current=0,ct||wt(),rt&&rt(kt)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",_extends$u({value:st,onChange:xt,ref:ht,rows:ot,style:_extends$u({height:mt.outerHeightStyle,overflow:mt.overflow?"hidden":void 0},at)},lt)),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:et.className,readOnly:!0,ref:dt,tabIndex:-1,style:_extends$u({},styles$4.shadow,at,{paddingTop:0,paddingBottom:0})})]})}),_excluded$1m=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],PopperRoot=styled$1(Popper$1,{name:"MuiPopper",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),Popper=reactExports.forwardRef(function(et,nt){var rt;const it=useTheme$3(),ot=useThemeProps({props:et,name:"MuiPopper"}),{anchorEl:at,component:st,components:lt,componentsProps:ct,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:yt,popperRef:bt,transition:wt,slots:xt,slotProps:kt}=ot,St=_objectWithoutPropertiesLoose$k(ot,_excluded$1m),Tt=(rt=xt==null?void 0:xt.root)!=null?rt:lt==null?void 0:lt.Root,At=_extends$u({anchorEl:at,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:yt,popperRef:bt,transition:wt},St);return jsxRuntimeExports.jsx(PopperRoot,_extends$u({as:st,direction:it==null?void 0:it.direction,slots:{root:Tt},slotProps:kt??ct},At,{ref:nt}))}),MuiPopper=Popper,CancelIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function getChipUtilityClass(tt){return generateUtilityClass("MuiChip",tt)}const chipClasses=generateUtilityClasses("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),chipClasses$1=chipClasses,_excluded$1l=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],useUtilityClasses$Q=tt=>{const{classes:et,disabled:nt,size:rt,color:it,iconColor:ot,onDelete:at,clickable:st,variant:lt}=tt,ct={root:["root",lt,nt&&"disabled",`size${capitalize(rt)}`,`color${capitalize(it)}`,st&&"clickable",st&&`clickableColor${capitalize(it)}`,at&&"deletable",at&&`deletableColor${capitalize(it)}`,`${lt}${capitalize(it)}`],label:["label",`label${capitalize(rt)}`],avatar:["avatar",`avatar${capitalize(rt)}`,`avatarColor${capitalize(it)}`],icon:["icon",`icon${capitalize(rt)}`,`iconColor${capitalize(ot)}`],deleteIcon:["deleteIcon",`deleteIcon${capitalize(rt)}`,`deleteIconColor${capitalize(it)}`,`deleteIcon${capitalize(lt)}Color${capitalize(it)}`]};return composeClasses(ct,getChipUtilityClass,et)},ChipRoot=styled$1("div",{name:"MuiChip",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt,{color:rt,iconColor:it,clickable:ot,onDelete:at,size:st,variant:lt}=nt;return[{[`& .${chipClasses$1.avatar}`]:et.avatar},{[`& .${chipClasses$1.avatar}`]:et[`avatar${capitalize(st)}`]},{[`& .${chipClasses$1.avatar}`]:et[`avatarColor${capitalize(rt)}`]},{[`& .${chipClasses$1.icon}`]:et.icon},{[`& .${chipClasses$1.icon}`]:et[`icon${capitalize(st)}`]},{[`& .${chipClasses$1.icon}`]:et[`iconColor${capitalize(it)}`]},{[`& .${chipClasses$1.deleteIcon}`]:et.deleteIcon},{[`& .${chipClasses$1.deleteIcon}`]:et[`deleteIcon${capitalize(st)}`]},{[`& .${chipClasses$1.deleteIcon}`]:et[`deleteIconColor${capitalize(rt)}`]},{[`& .${chipClasses$1.deleteIcon}`]:et[`deleteIcon${capitalize(lt)}Color${capitalize(rt)}`]},et.root,et[`size${capitalize(st)}`],et[`color${capitalize(rt)}`],ot&&et.clickable,ot&&rt!=="default"&&et[`clickableColor${capitalize(rt)})`],at&&et.deletable,at&&rt!=="default"&&et[`deletableColor${capitalize(rt)}`],et[lt],et[`${lt}${capitalize(rt)}`]]}})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?tt.palette.grey[700]:tt.palette.grey[300];return _extends$u({maxWidth:"100%",fontFamily:tt.typography.fontFamily,fontSize:tt.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(tt.vars||tt).palette.text.primary,backgroundColor:(tt.vars||tt).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:tt.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${chipClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${chipClasses$1.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:tt.vars?tt.vars.palette.Chip.defaultAvatarColor:nt,fontSize:tt.typography.pxToRem(12)},[`& .${chipClasses$1.avatarColorPrimary}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.dark},[`& .${chipClasses$1.avatarColorSecondary}`]:{color:(tt.vars||tt).palette.secondary.contrastText,backgroundColor:(tt.vars||tt).palette.secondary.dark},[`& .${chipClasses$1.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:tt.typography.pxToRem(10)},[`& .${chipClasses$1.icon}`]:_extends$u({marginLeft:5,marginRight:-6},et.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},et.iconColor===et.color&&_extends$u({color:tt.vars?tt.vars.palette.Chip.defaultIconColor:nt},et.color!=="default"&&{color:"inherit"})),[`& .${chipClasses$1.deleteIcon}`]:_extends$u({WebkitTapHighlightColor:"transparent",color:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / 0.26)`:alpha$1(tt.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / 0.4)`:alpha$1(tt.palette.text.primary,.4)}},et.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},et.color!=="default"&&{color:tt.vars?`rgba(${tt.vars.palette[et.color].contrastTextChannel} / 0.7)`:alpha$1(tt.palette[et.color].contrastText,.7),"&:hover, &:active":{color:(tt.vars||tt).palette[et.color].contrastText}})},et.size==="small"&&{height:24},et.color!=="default"&&{backgroundColor:(tt.vars||tt).palette[et.color].main,color:(tt.vars||tt).palette[et.color].contrastText},et.onDelete&&{[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.selectedChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.action.selected,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},et.onDelete&&et.color!=="default"&&{[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette[et.color].dark}})},({theme:tt,ownerState:et})=>_extends$u({},et.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.selectedChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.action.selected,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity)},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.selectedChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.action.selected,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)},"&:active":{boxShadow:(tt.vars||tt).shadows[1]}},et.clickable&&et.color!=="default"&&{[`&:hover, &.${chipClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette[et.color].dark}}),({theme:tt,ownerState:et})=>_extends$u({},et.variant==="outlined"&&{backgroundColor:"transparent",border:tt.vars?`1px solid ${tt.vars.palette.Chip.defaultBorder}`:`1px solid ${tt.palette.mode==="light"?tt.palette.grey[400]:tt.palette.grey[700]}`,[`&.${chipClasses$1.clickable}:hover`]:{backgroundColor:(tt.vars||tt).palette.action.hover},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`& .${chipClasses$1.avatar}`]:{marginLeft:4},[`& .${chipClasses$1.avatarSmall}`]:{marginLeft:2},[`& .${chipClasses$1.icon}`]:{marginLeft:4},[`& .${chipClasses$1.iconSmall}`]:{marginLeft:2},[`& .${chipClasses$1.deleteIcon}`]:{marginRight:5},[`& .${chipClasses$1.deleteIconSmall}`]:{marginRight:3}},et.variant==="outlined"&&et.color!=="default"&&{color:(tt.vars||tt).palette[et.color].main,border:`1px solid ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.7)`:alpha$1(tt.palette[et.color].main,.7)}`,[`&.${chipClasses$1.clickable}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity)},[`&.${chipClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.focusOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.focusOpacity)},[`& .${chipClasses$1.deleteIcon}`]:{color:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.7)`:alpha$1(tt.palette[et.color].main,.7),"&:hover, &:active":{color:(tt.vars||tt).palette[et.color].main}}})),ChipLabel=styled$1("span",{name:"MuiChip",slot:"Label",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt,{size:rt}=nt;return[et.label,et[`label${capitalize(rt)}`]]}})(({ownerState:tt})=>_extends$u({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},tt.variant==="outlined"&&{paddingLeft:11,paddingRight:11},tt.size==="small"&&{paddingLeft:8,paddingRight:8},tt.size==="small"&&tt.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function isDeleteKeyboardEvent(tt){return tt.key==="Backspace"||tt.key==="Delete"}const Chip=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiChip"}),{avatar:it,className:ot,clickable:at,color:st="default",component:lt,deleteIcon:ct,disabled:ut=!1,icon:ht,label:dt,onClick:pt,onDelete:mt,onKeyDown:gt,onKeyUp:yt,size:bt="medium",variant:wt="filled",tabIndex:xt,skipFocusWhenDisabled:kt=!1}=rt,St=_objectWithoutPropertiesLoose$k(rt,_excluded$1l),Tt=reactExports.useRef(null),At=useForkRef(Tt,nt),Et=Ft=>{Ft.stopPropagation(),mt&&mt(Ft)},Ct=Ft=>{Ft.currentTarget===Ft.target&&isDeleteKeyboardEvent(Ft)&&Ft.preventDefault(),gt&>(Ft)},Lt=Ft=>{Ft.currentTarget===Ft.target&&(mt&&isDeleteKeyboardEvent(Ft)?mt(Ft):Ft.key==="Escape"&&Tt.current&&Tt.current.blur()),yt&&yt(Ft)},jt=at!==!1&&pt?!0:at,Rt=jt||mt?ButtonBase$1:lt||"div",$t=_extends$u({},rt,{component:Rt,disabled:ut,size:bt,color:st,iconColor:reactExports.isValidElement(ht)&&ht.props.color||st,onDelete:!!mt,clickable:jt,variant:wt}),vt=useUtilityClasses$Q($t),It=Rt===ButtonBase$1?_extends$u({component:lt||"div",focusVisibleClassName:vt.focusVisible},mt&&{disableRipple:!0}):{};let Ot=null;mt&&(Ot=ct&&reactExports.isValidElement(ct)?reactExports.cloneElement(ct,{className:clsx$2(ct.props.className,vt.deleteIcon),onClick:Et}):jsxRuntimeExports.jsx(CancelIcon,{className:clsx$2(vt.deleteIcon),onClick:Et}));let Wt=null;it&&reactExports.isValidElement(it)&&(Wt=reactExports.cloneElement(it,{className:clsx$2(vt.avatar,it.props.className)}));let zt=null;return ht&&reactExports.isValidElement(ht)&&(zt=reactExports.cloneElement(ht,{className:clsx$2(vt.icon,ht.props.className)})),jsxRuntimeExports.jsxs(ChipRoot,_extends$u({as:Rt,className:clsx$2(vt.root,ot),disabled:jt&&ut?!0:void 0,onClick:pt,onKeyDown:Ct,onKeyUp:Lt,ref:At,tabIndex:kt&&ut?-1:xt,ownerState:$t},It,St,{children:[Wt||zt,jsxRuntimeExports.jsx(ChipLabel,{className:clsx$2(vt.label),ownerState:$t,children:dt}),Ot]}))}),Chip$1=Chip;function formControlState({props:tt,states:et,muiFormControl:nt}){return et.reduce((rt,it)=>(rt[it]=tt[it],nt&&typeof tt[it]>"u"&&(rt[it]=nt[it]),rt),{})}const FormControlContext=reactExports.createContext(void 0),FormControlContext$1=FormControlContext;function useFormControl(){return reactExports.useContext(FormControlContext$1)}function GlobalStyles(tt){return jsxRuntimeExports.jsx(GlobalStyles$1,_extends$u({},tt,{defaultTheme:defaultTheme$1,themeId:THEME_ID}))}function hasValue(tt){return tt!=null&&!(Array.isArray(tt)&&tt.length===0)}function isFilled(tt,et=!1){return tt&&(hasValue(tt.value)&&tt.value!==""||et&&hasValue(tt.defaultValue)&&tt.defaultValue!=="")}function isAdornedStart(tt){return tt.startAdornment}function getInputBaseUtilityClass(tt){return generateUtilityClass("MuiInputBase",tt)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),inputBaseClasses$1=inputBaseClasses,_excluded$1k=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],rootOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.formControl&&et.formControl,nt.startAdornment&&et.adornedStart,nt.endAdornment&&et.adornedEnd,nt.error&&et.error,nt.size==="small"&&et.sizeSmall,nt.multiline&&et.multiline,nt.color&&et[`color${capitalize(nt.color)}`],nt.fullWidth&&et.fullWidth,nt.hiddenLabel&&et.hiddenLabel]},inputOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.input,nt.size==="small"&&et.inputSizeSmall,nt.multiline&&et.inputMultiline,nt.type==="search"&&et.inputTypeSearch,nt.startAdornment&&et.inputAdornedStart,nt.endAdornment&&et.inputAdornedEnd,nt.hiddenLabel&&et.inputHiddenLabel]},useUtilityClasses$P=tt=>{const{classes:et,color:nt,disabled:rt,error:it,endAdornment:ot,focused:at,formControl:st,fullWidth:lt,hiddenLabel:ct,multiline:ut,readOnly:ht,size:dt,startAdornment:pt,type:mt}=tt,gt={root:["root",`color${capitalize(nt)}`,rt&&"disabled",it&&"error",lt&&"fullWidth",at&&"focused",st&&"formControl",dt&&dt!=="medium"&&`size${capitalize(dt)}`,ut&&"multiline",pt&&"adornedStart",ot&&"adornedEnd",ct&&"hiddenLabel",ht&&"readOnly"],input:["input",rt&&"disabled",mt==="search"&&"inputTypeSearch",ut&&"inputMultiline",dt==="small"&&"inputSizeSmall",ct&&"inputHiddenLabel",pt&&"inputAdornedStart",ot&&"inputAdornedEnd",ht&&"readOnly"]};return composeClasses(gt,getInputBaseUtilityClass,et)},InputBaseRoot=styled$1("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body1,{color:(tt.vars||tt).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled,cursor:"default"}},et.multiline&&_extends$u({padding:"4px 0 5px"},et.size==="small"&&{paddingTop:1}),et.fullWidth&&{width:"100%"})),InputBaseComponent=styled$1("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light",rt=_extends$u({color:"currentColor"},tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5},{transition:tt.transitions.create("opacity",{duration:tt.transitions.duration.shorter})}),it={opacity:"0 !important"},ot=tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5};return _extends$u({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":rt,"&::-moz-placeholder":rt,"&:-ms-input-placeholder":rt,"&::-ms-input-placeholder":rt,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses$1.formControl} &`]:{"&::-webkit-input-placeholder":it,"&::-moz-placeholder":it,"&:-ms-input-placeholder":it,"&::-ms-input-placeholder":it,"&:focus::-webkit-input-placeholder":ot,"&:focus::-moz-placeholder":ot,"&:focus:-ms-input-placeholder":ot,"&:focus::-ms-input-placeholder":ot},[`&.${inputBaseClasses$1.disabled}`]:{opacity:1,WebkitTextFillColor:(tt.vars||tt).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},et.size==="small"&&{paddingTop:1},et.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},et.type==="search"&&{MozAppearance:"textfield"})}),inputGlobalStyles=jsxRuntimeExports.jsx(GlobalStyles,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),InputBase=reactExports.forwardRef(function(et,nt){var rt;const it=useThemeProps({props:et,name:"MuiInputBase"}),{"aria-describedby":ot,autoComplete:at,autoFocus:st,className:lt,components:ct={},componentsProps:ut={},defaultValue:ht,disabled:dt,disableInjectingGlobalStyles:pt,endAdornment:mt,fullWidth:gt=!1,id:yt,inputComponent:bt="input",inputProps:wt={},inputRef:xt,maxRows:kt,minRows:St,multiline:Tt=!1,name:At,onBlur:Et,onChange:Ct,onClick:Lt,onFocus:jt,onKeyDown:Rt,onKeyUp:$t,placeholder:vt,readOnly:It,renderSuffix:Ot,rows:Wt,slotProps:zt={},slots:Ft={},startAdornment:Nt,type:Ut="text",value:Pt}=it,Ht=_objectWithoutPropertiesLoose$k(it,_excluded$1k),Qt=wt.value!=null?wt.value:Pt,{current:an}=reactExports.useRef(Qt!=null),Yt=reactExports.useRef(),nn=reactExports.useCallback(Xt=>{},[]),tn=useForkRef(Yt,xt,wt.ref,nn),[dn,wn]=reactExports.useState(!1),rn=useFormControl(),Zt=formControlState({props:it,muiFormControl:rn,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Zt.focused=rn?rn.focused:dn,reactExports.useEffect(()=>{!rn&&dt&&dn&&(wn(!1),Et&&Et())},[rn,dt,dn,Et]);const vn=rn&&rn.onFilled,Cn=rn&&rn.onEmpty,$n=reactExports.useCallback(Xt=>{isFilled(Xt)?vn&&vn():Cn&&Cn()},[vn,Cn]);useEnhancedEffect$1(()=>{an&&$n({value:Qt})},[Qt,$n,an]);const Nn=Xt=>{if(Zt.disabled){Xt.stopPropagation();return}jt&&jt(Xt),wt.onFocus&&wt.onFocus(Xt),rn&&rn.onFocus?rn.onFocus(Xt):wn(!0)},En=Xt=>{Et&&Et(Xt),wt.onBlur&&wt.onBlur(Xt),rn&&rn.onBlur?rn.onBlur(Xt):wn(!1)},sn=(Xt,...Kt)=>{if(!an){const kn=Xt.target||Yt.current;if(kn==null)throw new Error(formatMuiErrorMessage(1));$n({value:kn.value})}wt.onChange&&wt.onChange(Xt,...Kt),Ct&&Ct(Xt,...Kt)};reactExports.useEffect(()=>{$n(Yt.current)},[]);const pn=Xt=>{Yt.current&&Xt.currentTarget===Xt.target&&Yt.current.focus(),Lt&&Lt(Xt)};let Tn=bt,In=wt;Tt&&Tn==="input"&&(Wt?In=_extends$u({type:void 0,minRows:Wt,maxRows:Wt},In):In=_extends$u({type:void 0,maxRows:kt,minRows:St},In),Tn=TextareaAutosize);const yn=Xt=>{$n(Xt.animationName==="mui-auto-fill-cancel"?Yt.current:{value:"x"})};reactExports.useEffect(()=>{rn&&rn.setAdornedStart(!!Nt)},[rn,Nt]);const hn=_extends$u({},it,{color:Zt.color||"primary",disabled:Zt.disabled,endAdornment:mt,error:Zt.error,focused:Zt.focused,formControl:rn,fullWidth:gt,hiddenLabel:Zt.hiddenLabel,multiline:Tt,size:Zt.size,startAdornment:Nt,type:Ut}),fn=useUtilityClasses$P(hn),xn=Ft.root||ct.Root||InputBaseRoot,jn=zt.root||ut.root||{},cn=Ft.input||ct.Input||InputBaseComponent;return In=_extends$u({},In,(rt=zt.input)!=null?rt:ut.input),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!pt&&inputGlobalStyles,jsxRuntimeExports.jsxs(xn,_extends$u({},jn,!isHostComponent(xn)&&{ownerState:_extends$u({},hn,jn.ownerState)},{ref:nt,onClick:pn},Ht,{className:clsx$2(fn.root,jn.className,lt,It&&"MuiInputBase-readOnly"),children:[Nt,jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:null,children:jsxRuntimeExports.jsx(cn,_extends$u({ownerState:hn,"aria-invalid":Zt.error,"aria-describedby":ot,autoComplete:at,autoFocus:st,defaultValue:ht,disabled:Zt.disabled,id:yt,onAnimationStart:yn,name:At,placeholder:vt,readOnly:It,required:Zt.required,rows:Wt,value:Qt,onKeyDown:Rt,onKeyUp:$t,type:Ut},In,!isHostComponent(cn)&&{as:Tn,ownerState:_extends$u({},hn,In.ownerState)},{ref:tn,className:clsx$2(fn.input,In.className,It&&"MuiInputBase-readOnly"),onBlur:En,onChange:sn,onFocus:Nn}))}),mt,Ot?Ot(_extends$u({},Zt,{startAdornment:Nt})):null]}))]})}),InputBase$1=InputBase;function getInputUtilityClass(tt){return generateUtilityClass("MuiInput",tt)}const inputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiInput",["root","underline","input"])),inputClasses$1=inputClasses;function getOutlinedInputUtilityClass(tt){return generateUtilityClass("MuiOutlinedInput",tt)}const outlinedInputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"])),outlinedInputClasses$1=outlinedInputClasses;function getFilledInputUtilityClass(tt){return generateUtilityClass("MuiFilledInput",tt)}const filledInputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiFilledInput",["root","underline","input"])),filledInputClasses$1=filledInputClasses,ArrowDropDownIcon$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),_excluded$1j=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],styles$3={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(et,nt){const rt=useTheme(),it={enter:rt.transitions.duration.enteringScreen,exit:rt.transitions.duration.leavingScreen},{addEndListener:ot,appear:at=!0,children:st,easing:lt,in:ct,onEnter:ut,onEntered:ht,onEntering:dt,onExit:pt,onExited:mt,onExiting:gt,style:yt,timeout:bt=it,TransitionComponent:wt=Transition$2}=et,xt=_objectWithoutPropertiesLoose$k(et,_excluded$1j),kt=reactExports.useRef(null),St=useForkRef(kt,st.ref,nt),Tt=vt=>It=>{if(vt){const Ot=kt.current;It===void 0?vt(Ot):vt(Ot,It)}},At=Tt(dt),Et=Tt((vt,It)=>{reflow(vt);const Ot=getTransitionProps({style:yt,timeout:bt,easing:lt},{mode:"enter"});vt.style.webkitTransition=rt.transitions.create("opacity",Ot),vt.style.transition=rt.transitions.create("opacity",Ot),ut&&ut(vt,It)}),Ct=Tt(ht),Lt=Tt(gt),jt=Tt(vt=>{const It=getTransitionProps({style:yt,timeout:bt,easing:lt},{mode:"exit"});vt.style.webkitTransition=rt.transitions.create("opacity",It),vt.style.transition=rt.transitions.create("opacity",It),pt&&pt(vt)}),Rt=Tt(mt),$t=vt=>{ot&&ot(kt.current,vt)};return jsxRuntimeExports.jsx(wt,_extends$u({appear:at,in:ct,nodeRef:kt,onEnter:Et,onEntered:Ct,onEntering:At,onExit:jt,onExited:Rt,onExiting:Lt,addEndListener:$t,timeout:bt},xt,{children:(vt,It)=>reactExports.cloneElement(st,_extends$u({style:_extends$u({opacity:0,visibility:vt==="exited"&&!ct?"hidden":void 0},styles$3[vt],yt,st.props.style),ref:St},It))}))}),Fade$1=Fade;function getBackdropUtilityClass(tt){return generateUtilityClass("MuiBackdrop",tt)}generateUtilityClasses("MuiBackdrop",["root","invisible"]);const _excluded$1i=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],useUtilityClasses$O=tt=>{const{classes:et,invisible:nt}=tt;return composeClasses({root:["root",nt&&"invisible"]},getBackdropUtilityClass,et)},BackdropRoot=styled$1("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.invisible&&et.invisible]}})(({ownerState:tt})=>_extends$u({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},tt.invisible&&{backgroundColor:"transparent"})),Backdrop=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useThemeProps({props:et,name:"MuiBackdrop"}),{children:st,className:lt,component:ct="div",components:ut={},componentsProps:ht={},invisible:dt=!1,open:pt,slotProps:mt={},slots:gt={},TransitionComponent:yt=Fade$1,transitionDuration:bt}=at,wt=_objectWithoutPropertiesLoose$k(at,_excluded$1i),xt=_extends$u({},at,{component:ct,invisible:dt}),kt=useUtilityClasses$O(xt),St=(rt=mt.root)!=null?rt:ht.root;return jsxRuntimeExports.jsx(yt,_extends$u({in:pt,timeout:bt},wt,{children:jsxRuntimeExports.jsx(BackdropRoot,_extends$u({"aria-hidden":!0},St,{as:(it=(ot=gt.root)!=null?ot:ut.Root)!=null?it:ct,className:clsx$2(kt.root,lt,St==null?void 0:St.className),ownerState:_extends$u({},xt,St==null?void 0:St.ownerState),classes:kt,ref:nt,children:st}))}))}),Backdrop$1=Backdrop;function getButtonUtilityClass(tt){return generateUtilityClass("MuiButton",tt)}const buttonClasses=generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),buttonClasses$1=buttonClasses,ButtonGroupContext=reactExports.createContext({}),ButtonGroupContext$1=ButtonGroupContext,ButtonGroupButtonContext=reactExports.createContext(void 0),ButtonGroupButtonContext$1=ButtonGroupButtonContext,_excluded$1h=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],useUtilityClasses$N=tt=>{const{color:et,disableElevation:nt,fullWidth:rt,size:it,variant:ot,classes:at}=tt,st={root:["root",ot,`${ot}${capitalize(et)}`,`size${capitalize(it)}`,`${ot}Size${capitalize(it)}`,et==="inherit"&&"colorInherit",nt&&"disableElevation",rt&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${capitalize(it)}`],endIcon:["endIcon",`iconSize${capitalize(it)}`]},lt=composeClasses(st,getButtonUtilityClass,at);return _extends$u({},at,lt)},commonIconStyles=tt=>_extends$u({},tt.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},tt.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},tt.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),ButtonRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`${nt.variant}${capitalize(nt.color)}`],et[`size${capitalize(nt.size)}`],et[`${nt.variant}Size${capitalize(nt.size)}`],nt.color==="inherit"&&et.colorInherit,nt.disableElevation&&et.disableElevation,nt.fullWidth&&et.fullWidth]}})(({theme:tt,ownerState:et})=>{var nt,rt;const it=tt.palette.mode==="light"?tt.palette.grey[300]:tt.palette.grey[800],ot=tt.palette.mode==="light"?tt.palette.grey.A100:tt.palette.grey[700];return _extends$u({},tt.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create(["background-color","box-shadow","border-color","color"],{duration:tt.transitions.duration.short}),"&:hover":_extends$u({textDecoration:"none",backgroundColor:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.text.primary,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="text"&&et.color!=="inherit"&&{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="outlined"&&et.color!=="inherit"&&{border:`1px solid ${(tt.vars||tt).palette[et.color].main}`,backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="contained"&&{backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedHoverBg:ot,boxShadow:(tt.vars||tt).shadows[4],"@media (hover: none)":{boxShadow:(tt.vars||tt).shadows[2],backgroundColor:(tt.vars||tt).palette.grey[300]}},et.variant==="contained"&&et.color!=="inherit"&&{backgroundColor:(tt.vars||tt).palette[et.color].dark,"@media (hover: none)":{backgroundColor:(tt.vars||tt).palette[et.color].main}}),"&:active":_extends$u({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[8]}),[`&.${buttonClasses$1.focusVisible}`]:_extends$u({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[6]}),[`&.${buttonClasses$1.disabled}`]:_extends$u({color:(tt.vars||tt).palette.action.disabled},et.variant==="outlined"&&{border:`1px solid ${(tt.vars||tt).palette.action.disabledBackground}`},et.variant==="contained"&&{color:(tt.vars||tt).palette.action.disabled,boxShadow:(tt.vars||tt).shadows[0],backgroundColor:(tt.vars||tt).palette.action.disabledBackground})},et.variant==="text"&&{padding:"6px 8px"},et.variant==="text"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main},et.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},et.variant==="outlined"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main,border:tt.vars?`1px solid rgba(${tt.vars.palette[et.color].mainChannel} / 0.5)`:`1px solid ${alpha$1(tt.palette[et.color].main,.5)}`},et.variant==="contained"&&{color:tt.vars?tt.vars.palette.text.primary:(nt=(rt=tt.palette).getContrastText)==null?void 0:nt.call(rt,tt.palette.grey[300]),backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedBg:it,boxShadow:(tt.vars||tt).shadows[2]},et.variant==="contained"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].contrastText,backgroundColor:(tt.vars||tt).palette[et.color].main},et.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},et.size==="small"&&et.variant==="text"&&{padding:"4px 5px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="text"&&{padding:"8px 11px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="outlined"&&{padding:"3px 9px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="outlined"&&{padding:"7px 21px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="contained"&&{padding:"4px 10px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="contained"&&{padding:"8px 22px",fontSize:tt.typography.pxToRem(15)},et.fullWidth&&{width:"100%"})},({ownerState:tt})=>tt.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${buttonClasses$1.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${buttonClasses$1.disabled}`]:{boxShadow:"none"}}),ButtonStartIcon=styled$1("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.startIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$u({display:"inherit",marginRight:8,marginLeft:-4},tt.size==="small"&&{marginLeft:-2},commonIconStyles(tt))),ButtonEndIcon=styled$1("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.endIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$u({display:"inherit",marginRight:-4,marginLeft:8},tt.size==="small"&&{marginRight:-2},commonIconStyles(tt))),Button$1=reactExports.forwardRef(function(et,nt){const rt=reactExports.useContext(ButtonGroupContext$1),it=reactExports.useContext(ButtonGroupButtonContext$1),ot=resolveProps(rt,et),at=useThemeProps({props:ot,name:"MuiButton"}),{children:st,color:lt="primary",component:ct="button",className:ut,disabled:ht=!1,disableElevation:dt=!1,disableFocusRipple:pt=!1,endIcon:mt,focusVisibleClassName:gt,fullWidth:yt=!1,size:bt="medium",startIcon:wt,type:xt,variant:kt="text"}=at,St=_objectWithoutPropertiesLoose$k(at,_excluded$1h),Tt=_extends$u({},at,{color:lt,component:ct,disabled:ht,disableElevation:dt,disableFocusRipple:pt,fullWidth:yt,size:bt,type:xt,variant:kt}),At=useUtilityClasses$N(Tt),Et=wt&&jsxRuntimeExports.jsx(ButtonStartIcon,{className:At.startIcon,ownerState:Tt,children:wt}),Ct=mt&&jsxRuntimeExports.jsx(ButtonEndIcon,{className:At.endIcon,ownerState:Tt,children:mt}),Lt=it||"";return jsxRuntimeExports.jsxs(ButtonRoot,_extends$u({ownerState:Tt,className:clsx$2(rt.className,At.root,ut,Lt),component:ct,disabled:ht,focusRipple:!pt,focusVisibleClassName:clsx$2(At.focusVisible,gt),ref:nt,type:xt},St,{classes:At,children:[Et,st,Ct]}))}),Button$2=Button$1;function getModalUtilityClass(tt){return generateUtilityClass("MuiModal",tt)}generateUtilityClasses("MuiModal",["root","hidden","backdrop"]);const _excluded$1g=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],useUtilityClasses$M=tt=>{const{open:et,exited:nt,classes:rt}=tt;return composeClasses({root:["root",!et&&nt&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,rt)},ModalRoot=styled$1("div",{name:"MuiModal",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.open&&nt.exited&&et.hidden]}})(({theme:tt,ownerState:et})=>_extends$u({position:"fixed",zIndex:(tt.vars||tt).zIndex.modal,right:0,bottom:0,top:0,left:0},!et.open&&et.exited&&{visibility:"hidden"})),ModalBackdrop=styled$1(Backdrop$1,{name:"MuiModal",slot:"Backdrop",overridesResolver:(tt,et)=>et.backdrop})({zIndex:-1}),Modal=reactExports.forwardRef(function(et,nt){var rt,it,ot,at,st,lt;const ct=useThemeProps({name:"MuiModal",props:et}),{BackdropComponent:ut=ModalBackdrop,BackdropProps:ht,className:dt,closeAfterTransition:pt=!1,children:mt,container:gt,component:yt,components:bt={},componentsProps:wt={},disableAutoFocus:xt=!1,disableEnforceFocus:kt=!1,disableEscapeKeyDown:St=!1,disablePortal:Tt=!1,disableRestoreFocus:At=!1,disableScrollLock:Et=!1,hideBackdrop:Ct=!1,keepMounted:Lt=!1,onBackdropClick:jt,open:Rt,slotProps:$t,slots:vt}=ct,It=_objectWithoutPropertiesLoose$k(ct,_excluded$1g),Ot=_extends$u({},ct,{closeAfterTransition:pt,disableAutoFocus:xt,disableEnforceFocus:kt,disableEscapeKeyDown:St,disablePortal:Tt,disableRestoreFocus:At,disableScrollLock:Et,hideBackdrop:Ct,keepMounted:Lt}),{getRootProps:Wt,getBackdropProps:zt,getTransitionProps:Ft,portalRef:Nt,isTopModal:Ut,exited:Pt,hasTransition:Ht}=useModal$1(_extends$u({},Ot,{rootRef:nt})),Qt=_extends$u({},Ot,{exited:Pt}),an=useUtilityClasses$M(Qt),Yt={};if(mt.props.tabIndex===void 0&&(Yt.tabIndex="-1"),Ht){const{onEnter:vn,onExited:Cn}=Ft();Yt.onEnter=vn,Yt.onExited=Cn}const nn=(rt=(it=vt==null?void 0:vt.root)!=null?it:bt.Root)!=null?rt:ModalRoot,tn=(ot=(at=vt==null?void 0:vt.backdrop)!=null?at:bt.Backdrop)!=null?ot:ut,dn=(st=$t==null?void 0:$t.root)!=null?st:wt.root,wn=(lt=$t==null?void 0:$t.backdrop)!=null?lt:wt.backdrop,rn=useSlotProps({elementType:nn,externalSlotProps:dn,externalForwardedProps:It,getSlotProps:Wt,additionalProps:{ref:nt,as:yt},ownerState:Qt,className:clsx$2(dt,dn==null?void 0:dn.className,an==null?void 0:an.root,!Qt.open&&Qt.exited&&(an==null?void 0:an.hidden))}),Zt=useSlotProps({elementType:tn,externalSlotProps:wn,additionalProps:ht,getSlotProps:vn=>zt(_extends$u({},vn,{onClick:Cn=>{jt&&jt(Cn),vn!=null&&vn.onClick&&vn.onClick(Cn)}})),className:clsx$2(wn==null?void 0:wn.className,ht==null?void 0:ht.className,an==null?void 0:an.backdrop),ownerState:Qt});return!Lt&&!Rt&&(!Ht||Pt)?null:jsxRuntimeExports.jsx(Portal,{ref:Nt,container:gt,disablePortal:Tt,children:jsxRuntimeExports.jsxs(nn,_extends$u({},rn,{children:[!Ct&&ut?jsxRuntimeExports.jsx(tn,_extends$u({},Zt)):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:kt,disableAutoFocus:xt,disableRestoreFocus:At,isEnabled:Ut,open:Rt,children:reactExports.cloneElement(mt,Yt)})]}))})}),Modal$1=Modal;function getDialogUtilityClass(tt){return generateUtilityClass("MuiDialog",tt)}const dialogClasses=generateUtilityClasses("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),dialogClasses$1=dialogClasses,DialogContext=reactExports.createContext({}),DialogContext$1=DialogContext,_excluded$1f=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],DialogBackdrop=styled$1(Backdrop$1,{name:"MuiDialog",slot:"Backdrop",overrides:(tt,et)=>et.backdrop})({zIndex:-1}),useUtilityClasses$L=tt=>{const{classes:et,scroll:nt,maxWidth:rt,fullWidth:it,fullScreen:ot}=tt,at={root:["root"],container:["container",`scroll${capitalize(nt)}`],paper:["paper",`paperScroll${capitalize(nt)}`,`paperWidth${capitalize(String(rt))}`,it&&"paperFullWidth",ot&&"paperFullScreen"]};return composeClasses(at,getDialogUtilityClass,et)},DialogRoot=styled$1(Modal$1,{name:"MuiDialog",slot:"Root",overridesResolver:(tt,et)=>et.root})({"@media print":{position:"absolute !important"}}),DialogContainer=styled$1("div",{name:"MuiDialog",slot:"Container",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.container,et[`scroll${capitalize(nt.scroll)}`]]}})(({ownerState:tt})=>_extends$u({height:"100%","@media print":{height:"auto"},outline:0},tt.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},tt.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),DialogPaper=styled$1(Paper$1,{name:"MuiDialog",slot:"Paper",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.paper,et[`scrollPaper${capitalize(nt.scroll)}`],et[`paperWidth${capitalize(String(nt.maxWidth))}`],nt.fullWidth&&et.paperFullWidth,nt.fullScreen&&et.paperFullScreen]}})(({theme:tt,ownerState:et})=>_extends$u({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},et.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},et.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!et.maxWidth&&{maxWidth:"calc(100% - 64px)"},et.maxWidth==="xs"&&{maxWidth:tt.breakpoints.unit==="px"?Math.max(tt.breakpoints.values.xs,444):`max(${tt.breakpoints.values.xs}${tt.breakpoints.unit}, 444px)`,[`&.${dialogClasses$1.paperScrollBody}`]:{[tt.breakpoints.down(Math.max(tt.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},et.maxWidth&&et.maxWidth!=="xs"&&{maxWidth:`${tt.breakpoints.values[et.maxWidth]}${tt.breakpoints.unit}`,[`&.${dialogClasses$1.paperScrollBody}`]:{[tt.breakpoints.down(tt.breakpoints.values[et.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},et.fullWidth&&{width:"calc(100% - 64px)"},et.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${dialogClasses$1.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Dialog=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDialog"}),it=useTheme(),ot={enter:it.transitions.duration.enteringScreen,exit:it.transitions.duration.leavingScreen},{"aria-describedby":at,"aria-labelledby":st,BackdropComponent:lt,BackdropProps:ct,children:ut,className:ht,disableEscapeKeyDown:dt=!1,fullScreen:pt=!1,fullWidth:mt=!1,maxWidth:gt="sm",onBackdropClick:yt,onClose:bt,open:wt,PaperComponent:xt=Paper$1,PaperProps:kt={},scroll:St="paper",TransitionComponent:Tt=Fade$1,transitionDuration:At=ot,TransitionProps:Et}=rt,Ct=_objectWithoutPropertiesLoose$k(rt,_excluded$1f),Lt=_extends$u({},rt,{disableEscapeKeyDown:dt,fullScreen:pt,fullWidth:mt,maxWidth:gt,scroll:St}),jt=useUtilityClasses$L(Lt),Rt=reactExports.useRef(),$t=Wt=>{Rt.current=Wt.target===Wt.currentTarget},vt=Wt=>{Rt.current&&(Rt.current=null,yt&&yt(Wt),bt&&bt(Wt,"backdropClick"))},It=useId(st),Ot=reactExports.useMemo(()=>({titleId:It}),[It]);return jsxRuntimeExports.jsx(DialogRoot,_extends$u({className:clsx$2(jt.root,ht),closeAfterTransition:!0,components:{Backdrop:DialogBackdrop},componentsProps:{backdrop:_extends$u({transitionDuration:At,as:lt},ct)},disableEscapeKeyDown:dt,onClose:bt,open:wt,ref:nt,onClick:vt,ownerState:Lt},Ct,{children:jsxRuntimeExports.jsx(Tt,_extends$u({appear:!0,in:wt,timeout:At,role:"presentation"},Et,{children:jsxRuntimeExports.jsx(DialogContainer,{className:clsx$2(jt.container),onMouseDown:$t,ownerState:Lt,children:jsxRuntimeExports.jsx(DialogPaper,_extends$u({as:xt,elevation:24,role:"dialog","aria-describedby":at,"aria-labelledby":It},kt,{className:clsx$2(jt.paper,kt.className),ownerState:Lt,children:jsxRuntimeExports.jsx(DialogContext$1.Provider,{value:Ot,children:ut})}))})}))}))}),MuiDialog=Dialog;function getDialogActionsUtilityClass(tt){return generateUtilityClass("MuiDialogActions",tt)}generateUtilityClasses("MuiDialogActions",["root","spacing"]);const _excluded$1e=["className","disableSpacing"],useUtilityClasses$K=tt=>{const{classes:et,disableSpacing:nt}=tt;return composeClasses({root:["root",!nt&&"spacing"]},getDialogActionsUtilityClass,et)},DialogActionsRoot=styled$1("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disableSpacing&&et.spacing]}})(({ownerState:tt})=>_extends$u({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!tt.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),DialogActions=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDialogActions"}),{className:it,disableSpacing:ot=!1}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$1e),st=_extends$u({},rt,{disableSpacing:ot}),lt=useUtilityClasses$K(st);return jsxRuntimeExports.jsx(DialogActionsRoot,_extends$u({className:clsx$2(lt.root,it),ownerState:st,ref:nt},at))}),DialogActions$1=DialogActions;function getDialogContentUtilityClass(tt){return generateUtilityClass("MuiDialogContent",tt)}generateUtilityClasses("MuiDialogContent",["root","dividers"]);const dialogTitleClasses=generateUtilityClasses("MuiDialogTitle",["root"]),dialogTitleClasses$1=dialogTitleClasses,_excluded$1d=["className","dividers"],useUtilityClasses$J=tt=>{const{classes:et,dividers:nt}=tt;return composeClasses({root:["root",nt&&"dividers"]},getDialogContentUtilityClass,et)},DialogContentRoot=styled$1("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dividers&&et.dividers]}})(({theme:tt,ownerState:et})=>_extends$u({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},et.dividers?{padding:"16px 24px",borderTop:`1px solid ${(tt.vars||tt).palette.divider}`,borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`}:{[`.${dialogTitleClasses$1.root} + &`]:{paddingTop:0}})),DialogContent=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDialogContent"}),{className:it,dividers:ot=!1}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$1d),st=_extends$u({},rt,{dividers:ot}),lt=useUtilityClasses$J(st);return jsxRuntimeExports.jsx(DialogContentRoot,_extends$u({className:clsx$2(lt.root,it),ownerState:st,ref:nt},at))}),DialogContent$1=DialogContent;function getDividerUtilityClass(tt){return generateUtilityClass("MuiDivider",tt)}const dividerClasses=generateUtilityClasses("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),_excluded$1c=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],useUtilityClasses$I=tt=>{const{absolute:et,children:nt,classes:rt,flexItem:it,light:ot,orientation:at,textAlign:st,variant:lt}=tt;return composeClasses({root:["root",et&&"absolute",lt,ot&&"light",at==="vertical"&&"vertical",it&&"flexItem",nt&&"withChildren",nt&&at==="vertical"&&"withChildrenVertical",st==="right"&&at!=="vertical"&&"textAlignRight",st==="left"&&at!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",at==="vertical"&&"wrapperVertical"]},getDividerUtilityClass,rt)},DividerRoot=styled$1("div",{name:"MuiDivider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.absolute&&et.absolute,et[nt.variant],nt.light&&et.light,nt.orientation==="vertical"&&et.vertical,nt.flexItem&&et.flexItem,nt.children&&et.withChildren,nt.children&&nt.orientation==="vertical"&&et.withChildrenVertical,nt.textAlign==="right"&&nt.orientation!=="vertical"&&et.textAlignRight,nt.textAlign==="left"&&nt.orientation!=="vertical"&&et.textAlignLeft]}})(({theme:tt,ownerState:et})=>_extends$u({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(tt.vars||tt).palette.divider,borderBottomWidth:"thin"},et.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},et.light&&{borderColor:tt.vars?`rgba(${tt.vars.palette.dividerChannel} / 0.08)`:alpha$1(tt.palette.divider,.08)},et.variant==="inset"&&{marginLeft:72},et.variant==="middle"&&et.orientation==="horizontal"&&{marginLeft:tt.spacing(2),marginRight:tt.spacing(2)},et.variant==="middle"&&et.orientation==="vertical"&&{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},et.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},et.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:tt})=>_extends$u({},tt.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:tt,ownerState:et})=>_extends$u({},et.children&&et.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(tt.vars||tt).palette.divider}`}}),({theme:tt,ownerState:et})=>_extends$u({},et.children&&et.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(tt.vars||tt).palette.divider}`}}),({ownerState:tt})=>_extends$u({},tt.textAlign==="right"&&tt.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},tt.textAlign==="left"&&tt.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),DividerWrapper=styled$1("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.wrapper,nt.orientation==="vertical"&&et.wrapperVertical]}})(({theme:tt,ownerState:et})=>_extends$u({display:"inline-block",paddingLeft:`calc(${tt.spacing(1)} * 1.2)`,paddingRight:`calc(${tt.spacing(1)} * 1.2)`},et.orientation==="vertical"&&{paddingTop:`calc(${tt.spacing(1)} * 1.2)`,paddingBottom:`calc(${tt.spacing(1)} * 1.2)`})),Divider$2=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDivider"}),{absolute:it=!1,children:ot,className:at,component:st=ot?"div":"hr",flexItem:lt=!1,light:ct=!1,orientation:ut="horizontal",role:ht=st!=="hr"?"separator":void 0,textAlign:dt="center",variant:pt="fullWidth"}=rt,mt=_objectWithoutPropertiesLoose$k(rt,_excluded$1c),gt=_extends$u({},rt,{absolute:it,component:st,flexItem:lt,light:ct,orientation:ut,role:ht,textAlign:dt,variant:pt}),yt=useUtilityClasses$I(gt);return jsxRuntimeExports.jsx(DividerRoot,_extends$u({as:st,className:clsx$2(yt.root,at),role:ht,ref:nt,ownerState:gt},mt,{children:ot?jsxRuntimeExports.jsx(DividerWrapper,{className:yt.wrapper,ownerState:gt,children:ot}):null}))});Divider$2.muiSkipListHighlight=!0;const Divider$3=Divider$2,_excluded$1b=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getTranslateValue(tt,et,nt){const rt=et.getBoundingClientRect(),it=nt&&nt.getBoundingClientRect(),ot=ownerWindow(et);let at;if(et.fakeTransform)at=et.fakeTransform;else{const ct=ot.getComputedStyle(et);at=ct.getPropertyValue("-webkit-transform")||ct.getPropertyValue("transform")}let st=0,lt=0;if(at&&at!=="none"&&typeof at=="string"){const ct=at.split("(")[1].split(")")[0].split(",");st=parseInt(ct[4],10),lt=parseInt(ct[5],10)}return tt==="left"?it?`translateX(${it.right+st-rt.left}px)`:`translateX(${ot.innerWidth+st-rt.left}px)`:tt==="right"?it?`translateX(-${rt.right-it.left-st}px)`:`translateX(-${rt.left+rt.width-st}px)`:tt==="up"?it?`translateY(${it.bottom+lt-rt.top}px)`:`translateY(${ot.innerHeight+lt-rt.top}px)`:it?`translateY(-${rt.top-it.top+rt.height-lt}px)`:`translateY(-${rt.top+rt.height-lt}px)`}function resolveContainer(tt){return typeof tt=="function"?tt():tt}function setTranslateValue(tt,et,nt){const rt=resolveContainer(nt),it=getTranslateValue(tt,et,rt);it&&(et.style.webkitTransform=it,et.style.transform=it)}const Slide=reactExports.forwardRef(function(et,nt){const rt=useTheme(),it={enter:rt.transitions.easing.easeOut,exit:rt.transitions.easing.sharp},ot={enter:rt.transitions.duration.enteringScreen,exit:rt.transitions.duration.leavingScreen},{addEndListener:at,appear:st=!0,children:lt,container:ct,direction:ut="down",easing:ht=it,in:dt,onEnter:pt,onEntered:mt,onEntering:gt,onExit:yt,onExited:bt,onExiting:wt,style:xt,timeout:kt=ot,TransitionComponent:St=Transition$2}=et,Tt=_objectWithoutPropertiesLoose$k(et,_excluded$1b),At=reactExports.useRef(null),Et=useForkRef(lt.ref,At,nt),Ct=zt=>Ft=>{zt&&(Ft===void 0?zt(At.current):zt(At.current,Ft))},Lt=Ct((zt,Ft)=>{setTranslateValue(ut,zt,ct),reflow(zt),pt&&pt(zt,Ft)}),jt=Ct((zt,Ft)=>{const Nt=getTransitionProps({timeout:kt,style:xt,easing:ht},{mode:"enter"});zt.style.webkitTransition=rt.transitions.create("-webkit-transform",_extends$u({},Nt)),zt.style.transition=rt.transitions.create("transform",_extends$u({},Nt)),zt.style.webkitTransform="none",zt.style.transform="none",gt&>(zt,Ft)}),Rt=Ct(mt),$t=Ct(wt),vt=Ct(zt=>{const Ft=getTransitionProps({timeout:kt,style:xt,easing:ht},{mode:"exit"});zt.style.webkitTransition=rt.transitions.create("-webkit-transform",Ft),zt.style.transition=rt.transitions.create("transform",Ft),setTranslateValue(ut,zt,ct),yt&&yt(zt)}),It=Ct(zt=>{zt.style.webkitTransition="",zt.style.transition="",bt&&bt(zt)}),Ot=zt=>{at&&at(At.current,zt)},Wt=reactExports.useCallback(()=>{At.current&&setTranslateValue(ut,At.current,ct)},[ut,ct]);return reactExports.useEffect(()=>{if(dt||ut==="down"||ut==="right")return;const zt=debounce$4(()=>{At.current&&setTranslateValue(ut,At.current,ct)}),Ft=ownerWindow(At.current);return Ft.addEventListener("resize",zt),()=>{zt.clear(),Ft.removeEventListener("resize",zt)}},[ut,dt,ct]),reactExports.useEffect(()=>{dt||Wt()},[dt,Wt]),jsxRuntimeExports.jsx(St,_extends$u({nodeRef:At,onEnter:Lt,onEntered:Rt,onEntering:jt,onExit:vt,onExited:It,onExiting:$t,addEndListener:Ot,appear:st,in:dt,timeout:kt},Tt,{children:(zt,Ft)=>reactExports.cloneElement(lt,_extends$u({ref:Et,style:_extends$u({visibility:zt==="exited"&&!dt?"hidden":void 0},xt,lt.props.style)},Ft))}))}),Slide$1=Slide,_excluded$1a=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$H=tt=>{const{classes:et,disableUnderline:nt}=tt,it=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getFilledInputUtilityClass,et);return _extends$u({},et,it)},FilledInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{var nt;const rt=tt.palette.mode==="light",it=rt?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",ot=rt?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",at=rt?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",st=rt?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return _extends$u({position:"relative",backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot,borderTopLeftRadius:(tt.vars||tt).shape.borderRadius,borderTopRightRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),"&:hover":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.hoverBg:at,"@media (hover: none)":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot}},[`&.${filledInputClasses$1.focused}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot},[`&.${filledInputClasses$1.disabled}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.disabledBg:st}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(nt=(tt.vars||tt).palette[et.color||"primary"])==null?void 0:nt.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`:it}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses$1.disabled}, .${filledInputClasses$1.error}):before`]:{borderBottom:`1px solid ${(tt.vars||tt).palette.text.primary}`},[`&.${filledInputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}},et.startAdornment&&{paddingLeft:12},et.endAdornment&&{paddingRight:12},et.multiline&&_extends$u({padding:"25px 12px 8px"},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17}))}),FilledInputInput=styled$1(InputBaseComponent,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17},et.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0},et.hiddenLabel&&et.size==="small"&&{paddingTop:8,paddingBottom:9})),FilledInput=reactExports.forwardRef(function(et,nt){var rt,it,ot,at;const st=useThemeProps({props:et,name:"MuiFilledInput"}),{components:lt={},componentsProps:ct,fullWidth:ut=!1,inputComponent:ht="input",multiline:dt=!1,slotProps:pt,slots:mt={},type:gt="text"}=st,yt=_objectWithoutPropertiesLoose$k(st,_excluded$1a),bt=_extends$u({},st,{fullWidth:ut,inputComponent:ht,multiline:dt,type:gt}),wt=useUtilityClasses$H(st),xt={root:{ownerState:bt},input:{ownerState:bt}},kt=pt??ct?deepmerge$1(pt??ct,xt):xt,St=(rt=(it=mt.root)!=null?it:lt.Root)!=null?rt:FilledInputRoot,Tt=(ot=(at=mt.input)!=null?at:lt.Input)!=null?ot:FilledInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:St,input:Tt},componentsProps:kt,fullWidth:ut,inputComponent:ht,multiline:dt,ref:nt,type:gt},yt,{classes:wt}))});FilledInput.muiName="Input";const FilledInput$1=FilledInput;function getFormControlUtilityClasses(tt){return generateUtilityClass("MuiFormControl",tt)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _excluded$19=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],useUtilityClasses$G=tt=>{const{classes:et,margin:nt,fullWidth:rt}=tt,it={root:["root",nt!=="none"&&`margin${capitalize(nt)}`,rt&&"fullWidth"]};return composeClasses(it,getFormControlUtilityClasses,et)},FormControlRoot=styled$1("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$u({},et.root,et[`margin${capitalize(tt.margin)}`],tt.fullWidth&&et.fullWidth)})(({ownerState:tt})=>_extends$u({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},tt.margin==="normal"&&{marginTop:16,marginBottom:8},tt.margin==="dense"&&{marginTop:8,marginBottom:4},tt.fullWidth&&{width:"100%"})),FormControl=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiFormControl"}),{children:it,className:ot,color:at="primary",component:st="div",disabled:lt=!1,error:ct=!1,focused:ut,fullWidth:ht=!1,hiddenLabel:dt=!1,margin:pt="none",required:mt=!1,size:gt="medium",variant:yt="outlined"}=rt,bt=_objectWithoutPropertiesLoose$k(rt,_excluded$19),wt=_extends$u({},rt,{color:at,component:st,disabled:lt,error:ct,fullWidth:ht,hiddenLabel:dt,margin:pt,required:mt,size:gt,variant:yt}),xt=useUtilityClasses$G(wt),[kt,St]=reactExports.useState(()=>{let $t=!1;return it&&reactExports.Children.forEach(it,vt=>{if(!isMuiElement(vt,["Input","Select"]))return;const It=isMuiElement(vt,["Select"])?vt.props.input:vt;It&&isAdornedStart(It.props)&&($t=!0)}),$t}),[Tt,At]=reactExports.useState(()=>{let $t=!1;return it&&reactExports.Children.forEach(it,vt=>{isMuiElement(vt,["Input","Select"])&&(isFilled(vt.props,!0)||isFilled(vt.props.inputProps,!0))&&($t=!0)}),$t}),[Et,Ct]=reactExports.useState(!1);lt&&Et&&Ct(!1);const Lt=ut!==void 0&&!lt?ut:Et;let jt;const Rt=reactExports.useMemo(()=>({adornedStart:kt,setAdornedStart:St,color:at,disabled:lt,error:ct,filled:Tt,focused:Lt,fullWidth:ht,hiddenLabel:dt,size:gt,onBlur:()=>{Ct(!1)},onEmpty:()=>{At(!1)},onFilled:()=>{At(!0)},onFocus:()=>{Ct(!0)},registerEffect:jt,required:mt,variant:yt}),[kt,at,lt,ct,Tt,Lt,ht,dt,jt,mt,gt,yt]);return jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:Rt,children:jsxRuntimeExports.jsx(FormControlRoot,_extends$u({as:st,ownerState:wt,className:clsx$2(xt.root,ot),ref:nt},bt,{children:it}))})}),FormControl$1=FormControl,Stack$2=createStack({createStyledComponent:styled$1("div",{name:"MuiStack",slot:"Root",overridesResolver:(tt,et)=>et.root}),useThemeProps:tt=>useThemeProps({props:tt,name:"MuiStack"})}),Stack$3=Stack$2;function getFormHelperTextUtilityClasses(tt){return generateUtilityClass("MuiFormHelperText",tt)}const formHelperTextClasses=generateUtilityClasses("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),formHelperTextClasses$1=formHelperTextClasses;var _span$3;const _excluded$18=["children","className","component","disabled","error","filled","focused","margin","required","variant"],useUtilityClasses$F=tt=>{const{classes:et,contained:nt,size:rt,disabled:it,error:ot,filled:at,focused:st,required:lt}=tt,ct={root:["root",it&&"disabled",ot&&"error",rt&&`size${capitalize(rt)}`,nt&&"contained",st&&"focused",at&&"filled",lt&&"required"]};return composeClasses(ct,getFormHelperTextUtilityClasses,et)},FormHelperTextRoot=styled$1("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.size&&et[`size${capitalize(nt.size)}`],nt.contained&&et.contained,nt.filled&&et.filled]}})(({theme:tt,ownerState:et})=>_extends$u({color:(tt.vars||tt).palette.text.secondary},tt.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${formHelperTextClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${formHelperTextClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}},et.size==="small"&&{marginTop:4},et.contained&&{marginLeft:14,marginRight:14})),FormHelperText=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiFormHelperText"}),{children:it,className:ot,component:at="p"}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$18),lt=useFormControl(),ct=formControlState({props:rt,muiFormControl:lt,states:["variant","size","disabled","error","filled","focused","required"]}),ut=_extends$u({},rt,{component:at,contained:ct.variant==="filled"||ct.variant==="outlined",variant:ct.variant,size:ct.size,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),ht=useUtilityClasses$F(ut);return jsxRuntimeExports.jsx(FormHelperTextRoot,_extends$u({as:at,ownerState:ut,className:clsx$2(ht.root,ot),ref:nt},st,{children:it===" "?_span$3||(_span$3=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"})):it}))}),FormHelperText$1=FormHelperText;function getFormLabelUtilityClasses(tt){return generateUtilityClass("MuiFormLabel",tt)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),formLabelClasses$1=formLabelClasses,_excluded$17=["children","className","color","component","disabled","error","filled","focused","required"],useUtilityClasses$E=tt=>{const{classes:et,color:nt,focused:rt,disabled:it,error:ot,filled:at,required:st}=tt,lt={root:["root",`color${capitalize(nt)}`,it&&"disabled",ot&&"error",at&&"filled",rt&&"focused",st&&"required"],asterisk:["asterisk",ot&&"error"]};return composeClasses(lt,getFormLabelUtilityClasses,et)},FormLabelRoot=styled$1("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$u({},et.root,tt.color==="secondary"&&et.colorSecondary,tt.filled&&et.filled)})(({theme:tt,ownerState:et})=>_extends$u({color:(tt.vars||tt).palette.text.secondary},tt.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${formLabelClasses$1.focused}`]:{color:(tt.vars||tt).palette[et.color].main},[`&.${formLabelClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),AsteriskComponent=styled$1("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(tt,et)=>et.asterisk})(({theme:tt})=>({[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),FormLabel=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiFormLabel"}),{children:it,className:ot,component:at="label"}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$17),lt=useFormControl(),ct=formControlState({props:rt,muiFormControl:lt,states:["color","required","focused","disabled","error","filled"]}),ut=_extends$u({},rt,{color:ct.color||"primary",component:at,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),ht=useUtilityClasses$E(ut);return jsxRuntimeExports.jsxs(FormLabelRoot,_extends$u({as:at,ownerState:ut,className:clsx$2(ht.root,ot),ref:nt},st,{children:[it,ct.required&&jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:ut,"aria-hidden":!0,className:ht.asterisk,children:[" ","*"]})]}))}),FormLabel$1=FormLabel,_excluded$16=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getScale(tt){return`scale(${tt}, ${tt**2})`}const styles$2={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(et,nt){const{addEndListener:rt,appear:it=!0,children:ot,easing:at,in:st,onEnter:lt,onEntered:ct,onEntering:ut,onExit:ht,onExited:dt,onExiting:pt,style:mt,timeout:gt="auto",TransitionComponent:yt=Transition$2}=et,bt=_objectWithoutPropertiesLoose$k(et,_excluded$16),wt=reactExports.useRef(),xt=reactExports.useRef(),kt=useTheme(),St=reactExports.useRef(null),Tt=useForkRef(St,ot.ref,nt),At=It=>Ot=>{if(It){const Wt=St.current;Ot===void 0?It(Wt):It(Wt,Ot)}},Et=At(ut),Ct=At((It,Ot)=>{reflow(It);const{duration:Wt,delay:zt,easing:Ft}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"enter"});let Nt;gt==="auto"?(Nt=kt.transitions.getAutoHeightDuration(It.clientHeight),xt.current=Nt):Nt=Wt,It.style.transition=[kt.transitions.create("opacity",{duration:Nt,delay:zt}),kt.transitions.create("transform",{duration:isWebKit154?Nt:Nt*.666,delay:zt,easing:Ft})].join(","),lt&<(It,Ot)}),Lt=At(ct),jt=At(pt),Rt=At(It=>{const{duration:Ot,delay:Wt,easing:zt}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"exit"});let Ft;gt==="auto"?(Ft=kt.transitions.getAutoHeightDuration(It.clientHeight),xt.current=Ft):Ft=Ot,It.style.transition=[kt.transitions.create("opacity",{duration:Ft,delay:Wt}),kt.transitions.create("transform",{duration:isWebKit154?Ft:Ft*.666,delay:isWebKit154?Wt:Wt||Ft*.333,easing:zt})].join(","),It.style.opacity=0,It.style.transform=getScale(.75),ht&&ht(It)}),$t=At(dt),vt=It=>{gt==="auto"&&(wt.current=setTimeout(It,xt.current||0)),rt&&rt(St.current,It)};return reactExports.useEffect(()=>()=>{clearTimeout(wt.current)},[]),jsxRuntimeExports.jsx(yt,_extends$u({appear:it,in:st,nodeRef:St,onEnter:Ct,onEntered:Lt,onEntering:Et,onExit:Rt,onExited:$t,onExiting:jt,addEndListener:vt,timeout:gt==="auto"?null:gt},bt,{children:(It,Ot)=>reactExports.cloneElement(ot,_extends$u({style:_extends$u({opacity:0,transform:getScale(.75),visibility:It==="exited"&&!st?"hidden":void 0},styles$2[It],mt,ot.props.style),ref:Tt},Ot))}))});Grow.muiSupportAuto=!0;const Grow$1=Grow;function useMediaQueryOld(tt,et,nt,rt,it){const[ot,at]=reactExports.useState(()=>it&&nt?nt(tt).matches:rt?rt(tt).matches:et);return useEnhancedEffect$1(()=>{let st=!0;if(!nt)return;const lt=nt(tt),ct=()=>{st&&at(lt.matches)};return ct(),lt.addListener(ct),()=>{st=!1,lt.removeListener(ct)}},[tt,nt]),ot}const maybeReactUseSyncExternalStore=React$2["useSyncExternalStore"];function useMediaQueryNew(tt,et,nt,rt,it){const ot=reactExports.useCallback(()=>et,[et]),at=reactExports.useMemo(()=>{if(it&&nt)return()=>nt(tt).matches;if(rt!==null){const{matches:ut}=rt(tt);return()=>ut}return ot},[ot,tt,rt,it,nt]),[st,lt]=reactExports.useMemo(()=>{if(nt===null)return[ot,()=>()=>{}];const ut=nt(tt);return[()=>ut.matches,ht=>(ut.addListener(ht),()=>{ut.removeListener(ht)})]},[ot,nt,tt]);return maybeReactUseSyncExternalStore(lt,st,at)}function useMediaQuery(tt,et={}){const nt=useTheme$3(),rt=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:it=!1,matchMedia:ot=rt?window.matchMedia:null,ssrMatchMedia:at=null,noSsr:st=!1}=getThemeProps({name:"MuiUseMediaQuery",props:et,theme:nt});let lt=typeof tt=="function"?tt(nt):tt;return lt=lt.replace(/^@media( ?)/m,""),(maybeReactUseSyncExternalStore!==void 0?useMediaQueryNew:useMediaQueryOld)(lt,it,ot,at,st)}const _excluded$15=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$D=tt=>{const{classes:et,disableUnderline:nt}=tt,it=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getInputUtilityClass,et);return _extends$u({},et,it)},InputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{let rt=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return tt.vars&&(rt=`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`),_extends$u({position:"relative"},et.formControl&&{"label + &":{marginTop:16}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(tt.vars||tt).palette[et.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${rt}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses$1.disabled}, .${inputClasses$1.error}):before`]:{borderBottom:`2px solid ${(tt.vars||tt).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${rt}`}},[`&.${inputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}})}),InputInput=styled$1(InputBaseComponent,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input$1=reactExports.forwardRef(function(et,nt){var rt,it,ot,at;const st=useThemeProps({props:et,name:"MuiInput"}),{disableUnderline:lt,components:ct={},componentsProps:ut,fullWidth:ht=!1,inputComponent:dt="input",multiline:pt=!1,slotProps:mt,slots:gt={},type:yt="text"}=st,bt=_objectWithoutPropertiesLoose$k(st,_excluded$15),wt=useUtilityClasses$D(st),kt={root:{ownerState:{disableUnderline:lt}}},St=mt??ut?deepmerge$1(mt??ut,kt):kt,Tt=(rt=(it=gt.root)!=null?it:ct.Root)!=null?rt:InputRoot,At=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:InputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:Tt,input:At},slotProps:St,fullWidth:ht,inputComponent:dt,multiline:pt,ref:nt,type:yt},bt,{classes:wt}))});Input$1.muiName="Input";const Input$2=Input$1;function getInputAdornmentUtilityClass(tt){return generateUtilityClass("MuiInputAdornment",tt)}const inputAdornmentClasses=generateUtilityClasses("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),inputAdornmentClasses$1=inputAdornmentClasses;var _span$2;const _excluded$14=["children","className","component","disablePointerEvents","disableTypography","position","variant"],overridesResolver$3=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`position${capitalize(nt.position)}`],nt.disablePointerEvents===!0&&et.disablePointerEvents,et[nt.variant]]},useUtilityClasses$C=tt=>{const{classes:et,disablePointerEvents:nt,hiddenLabel:rt,position:it,size:ot,variant:at}=tt,st={root:["root",nt&&"disablePointerEvents",it&&`position${capitalize(it)}`,at,rt&&"hiddenLabel",ot&&`size${capitalize(ot)}`]};return composeClasses(st,getInputAdornmentUtilityClass,et)},InputAdornmentRoot=styled$1("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:overridesResolver$3})(({theme:tt,ownerState:et})=>_extends$u({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(tt.vars||tt).palette.action.active},et.variant==="filled"&&{[`&.${inputAdornmentClasses$1.positionStart}&:not(.${inputAdornmentClasses$1.hiddenLabel})`]:{marginTop:16}},et.position==="start"&&{marginRight:8},et.position==="end"&&{marginLeft:8},et.disablePointerEvents===!0&&{pointerEvents:"none"})),InputAdornment=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiInputAdornment"}),{children:it,className:ot,component:at="div",disablePointerEvents:st=!1,disableTypography:lt=!1,position:ct,variant:ut}=rt,ht=_objectWithoutPropertiesLoose$k(rt,_excluded$14),dt=useFormControl()||{};let pt=ut;ut&&dt.variant,dt&&!pt&&(pt=dt.variant);const mt=_extends$u({},rt,{hiddenLabel:dt.hiddenLabel,size:dt.size,disablePointerEvents:st,position:ct,variant:pt}),gt=useUtilityClasses$C(mt);return jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:null,children:jsxRuntimeExports.jsx(InputAdornmentRoot,_extends$u({as:at,ownerState:mt,className:clsx$2(gt.root,ot),ref:nt},ht,{children:typeof it=="string"&&!lt?jsxRuntimeExports.jsx(Typography$1,{color:"text.secondary",children:it}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ct==="start"?_span$2||(_span$2=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"})):null,it]})}))})}),MuiInputAdornment=InputAdornment;function getInputLabelUtilityClasses(tt){return generateUtilityClass("MuiInputLabel",tt)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const _excluded$13=["disableAnimation","margin","shrink","variant","className"],useUtilityClasses$B=tt=>{const{classes:et,formControl:nt,size:rt,shrink:it,disableAnimation:ot,variant:at,required:st}=tt,lt={root:["root",nt&&"formControl",!ot&&"animated",it&&"shrink",rt&&rt!=="normal"&&`size${capitalize(rt)}`,at],asterisk:[st&&"asterisk"]},ct=composeClasses(lt,getInputLabelUtilityClasses,et);return _extends$u({},et,ct)},InputLabelRoot=styled$1(FormLabel$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${formLabelClasses$1.asterisk}`]:et.asterisk},et.root,nt.formControl&&et.formControl,nt.size==="small"&&et.sizeSmall,nt.shrink&&et.shrink,!nt.disableAnimation&&et.animated,nt.focused&&et.focused,et[nt.variant]]}})(({theme:tt,ownerState:et})=>_extends$u({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},et.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},et.size==="small"&&{transform:"translate(0, 17px) scale(1)"},et.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!et.disableAnimation&&{transition:tt.transitions.create(["color","transform","max-width"],{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut})},et.variant==="filled"&&_extends$u({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},et.shrink&&_extends$u({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},et.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),et.variant==="outlined"&&_extends$u({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},et.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),InputLabel=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({name:"MuiInputLabel",props:et}),{disableAnimation:it=!1,shrink:ot,className:at}=rt,st=_objectWithoutPropertiesLoose$k(rt,_excluded$13),lt=useFormControl();let ct=ot;typeof ct>"u"&<&&(ct=lt.filled||lt.focused||lt.adornedStart);const ut=formControlState({props:rt,muiFormControl:lt,states:["size","variant","required","focused"]}),ht=_extends$u({},rt,{disableAnimation:it,formControl:lt,shrink:ct,size:ut.size,variant:ut.variant,required:ut.required,focused:ut.focused}),dt=useUtilityClasses$B(ht);return jsxRuntimeExports.jsx(InputLabelRoot,_extends$u({"data-shrink":ct,ownerState:ht,ref:nt,className:clsx$2(dt.root,at)},st,{classes:dt}))}),InputLabel$1=InputLabel,ListContext=reactExports.createContext({}),ListContext$1=ListContext;function getListUtilityClass(tt){return generateUtilityClass("MuiList",tt)}generateUtilityClasses("MuiList",["root","padding","dense","subheader"]);const _excluded$12=["children","className","component","dense","disablePadding","subheader"],useUtilityClasses$A=tt=>{const{classes:et,disablePadding:nt,dense:rt,subheader:it}=tt;return composeClasses({root:["root",!nt&&"padding",rt&&"dense",it&&"subheader"]},getListUtilityClass,et)},ListRoot=styled$1("ul",{name:"MuiList",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disablePadding&&et.padding,nt.dense&&et.dense,nt.subheader&&et.subheader]}})(({ownerState:tt})=>_extends$u({listStyle:"none",margin:0,padding:0,position:"relative"},!tt.disablePadding&&{paddingTop:8,paddingBottom:8},tt.subheader&&{paddingTop:0})),List=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiList"}),{children:it,className:ot,component:at="ul",dense:st=!1,disablePadding:lt=!1,subheader:ct}=rt,ut=_objectWithoutPropertiesLoose$k(rt,_excluded$12),ht=reactExports.useMemo(()=>({dense:st}),[st]),dt=_extends$u({},rt,{component:at,dense:st,disablePadding:lt}),pt=useUtilityClasses$A(dt);return jsxRuntimeExports.jsx(ListContext$1.Provider,{value:ht,children:jsxRuntimeExports.jsxs(ListRoot,_extends$u({as:at,className:clsx$2(pt.root,ot),ref:nt,ownerState:dt},ut,{children:[ct,it]}))})}),List$1=List;function getListItemUtilityClass(tt){return generateUtilityClass("MuiListItem",tt)}const listItemClasses=generateUtilityClasses("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),listItemClasses$1=listItemClasses,listItemButtonClasses=generateUtilityClasses("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),listItemButtonClasses$1=listItemButtonClasses;function getListItemSecondaryActionClassesUtilityClass(tt){return generateUtilityClass("MuiListItemSecondaryAction",tt)}generateUtilityClasses("MuiListItemSecondaryAction",["root","disableGutters"]);const _excluded$11=["className"],useUtilityClasses$z=tt=>{const{disableGutters:et,classes:nt}=tt;return composeClasses({root:["root",et&&"disableGutters"]},getListItemSecondaryActionClassesUtilityClass,nt)},ListItemSecondaryActionRoot=styled$1("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.disableGutters&&et.disableGutters]}})(({ownerState:tt})=>_extends$u({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},tt.disableGutters&&{right:0})),ListItemSecondaryAction=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiListItemSecondaryAction"}),{className:it}=rt,ot=_objectWithoutPropertiesLoose$k(rt,_excluded$11),at=reactExports.useContext(ListContext$1),st=_extends$u({},rt,{disableGutters:at.disableGutters}),lt=useUtilityClasses$z(st);return jsxRuntimeExports.jsx(ListItemSecondaryActionRoot,_extends$u({className:clsx$2(lt.root,it),ownerState:st,ref:nt},ot))});ListItemSecondaryAction.muiName="ListItemSecondaryAction";const ListItemSecondaryAction$1=ListItemSecondaryAction,_excluded$10=["className"],_excluded2$f=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],overridesResolver$2=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dense&&et.dense,nt.alignItems==="flex-start"&&et.alignItemsFlexStart,nt.divider&&et.divider,!nt.disableGutters&&et.gutters,!nt.disablePadding&&et.padding,nt.button&&et.button,nt.hasSecondaryAction&&et.secondaryAction]},useUtilityClasses$y=tt=>{const{alignItems:et,button:nt,classes:rt,dense:it,disabled:ot,disableGutters:at,disablePadding:st,divider:lt,hasSecondaryAction:ct,selected:ut}=tt;return composeClasses({root:["root",it&&"dense",!at&&"gutters",!st&&"padding",lt&&"divider",ot&&"disabled",nt&&"button",et==="flex-start"&&"alignItemsFlexStart",ct&&"secondaryAction",ut&&"selected"],container:["container"]},getListItemUtilityClass,rt)},ListItemRoot=styled$1("div",{name:"MuiListItem",slot:"Root",overridesResolver:overridesResolver$2})(({theme:tt,ownerState:et})=>_extends$u({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!et.disablePadding&&_extends$u({paddingTop:8,paddingBottom:8},et.dense&&{paddingTop:4,paddingBottom:4},!et.disableGutters&&{paddingLeft:16,paddingRight:16},!!et.secondaryAction&&{paddingRight:48}),!!et.secondaryAction&&{[`& > .${listItemButtonClasses$1.root}`]:{paddingRight:48}},{[`&.${listItemClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`&.${listItemClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),[`&.${listItemClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},[`&.${listItemClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity}},et.alignItems==="flex-start"&&{alignItems:"flex-start"},et.divider&&{borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`,backgroundClip:"padding-box"},et.button&&{transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(tt.vars||tt).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${listItemClasses$1.selected}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity)}}},et.hasSecondaryAction&&{paddingRight:48})),ListItemContainer=styled$1("li",{name:"MuiListItem",slot:"Container",overridesResolver:(tt,et)=>et.container})({position:"relative"}),ListItem=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiListItem"}),{alignItems:it="center",autoFocus:ot=!1,button:at=!1,children:st,className:lt,component:ct,components:ut={},componentsProps:ht={},ContainerComponent:dt="li",ContainerProps:{className:pt}={},dense:mt=!1,disabled:gt=!1,disableGutters:yt=!1,disablePadding:bt=!1,divider:wt=!1,focusVisibleClassName:xt,secondaryAction:kt,selected:St=!1,slotProps:Tt={},slots:At={}}=rt,Et=_objectWithoutPropertiesLoose$k(rt.ContainerProps,_excluded$10),Ct=_objectWithoutPropertiesLoose$k(rt,_excluded2$f),Lt=reactExports.useContext(ListContext$1),jt=reactExports.useMemo(()=>({dense:mt||Lt.dense||!1,alignItems:it,disableGutters:yt}),[it,Lt.dense,mt,yt]),Rt=reactExports.useRef(null);useEnhancedEffect$1(()=>{ot&&Rt.current&&Rt.current.focus()},[ot]);const $t=reactExports.Children.toArray(st),vt=$t.length&&isMuiElement($t[$t.length-1],["ListItemSecondaryAction"]),It=_extends$u({},rt,{alignItems:it,autoFocus:ot,button:at,dense:jt.dense,disabled:gt,disableGutters:yt,disablePadding:bt,divider:wt,hasSecondaryAction:vt,selected:St}),Ot=useUtilityClasses$y(It),Wt=useForkRef(Rt,nt),zt=At.root||ut.Root||ListItemRoot,Ft=Tt.root||ht.root||{},Nt=_extends$u({className:clsx$2(Ot.root,Ft.className,lt),disabled:gt},Ct);let Ut=ct||"li";return at&&(Nt.component=ct||"div",Nt.focusVisibleClassName=clsx$2(listItemClasses$1.focusVisible,xt),Ut=ButtonBase$1),vt?(Ut=!Nt.component&&!ct?"div":Ut,dt==="li"&&(Ut==="li"?Ut="div":Nt.component==="li"&&(Nt.component="div")),jsxRuntimeExports.jsx(ListContext$1.Provider,{value:jt,children:jsxRuntimeExports.jsxs(ListItemContainer,_extends$u({as:dt,className:clsx$2(Ot.container,pt),ref:Wt,ownerState:It},Et,{children:[jsxRuntimeExports.jsx(zt,_extends$u({},Ft,!isHostComponent(zt)&&{as:Ut,ownerState:_extends$u({},It,Ft.ownerState)},Nt,{children:$t})),$t.pop()]}))})):jsxRuntimeExports.jsx(ListContext$1.Provider,{value:jt,children:jsxRuntimeExports.jsxs(zt,_extends$u({},Ft,{as:Ut,ref:Wt},!isHostComponent(zt)&&{ownerState:_extends$u({},It,Ft.ownerState)},Nt,{children:[$t,kt&&jsxRuntimeExports.jsx(ListItemSecondaryAction$1,{children:kt})]}))})}),ListItem$1=ListItem,listItemIconClasses=generateUtilityClasses("MuiListItemIcon",["root","alignItemsFlexStart"]),listItemIconClasses$1=listItemIconClasses,listItemTextClasses=generateUtilityClasses("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),listItemTextClasses$1=listItemTextClasses,_excluded$$=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nextItem$1(tt,et,nt){return tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:nt?null:tt.firstChild}function previousItem$1(tt,et,nt){return tt===et?nt?tt.firstChild:tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:nt?null:tt.lastChild}function textCriteriaMatches(tt,et){if(et===void 0)return!0;let nt=tt.innerText;return nt===void 0&&(nt=tt.textContent),nt=nt.trim().toLowerCase(),nt.length===0?!1:et.repeating?nt[0]===et.keys[0]:nt.indexOf(et.keys.join(""))===0}function moveFocus$1(tt,et,nt,rt,it,ot){let at=!1,st=it(tt,et,et?nt:!1);for(;st;){if(st===tt.firstChild){if(at)return!1;at=!0}const lt=rt?!1:st.disabled||st.getAttribute("aria-disabled")==="true";if(!st.hasAttribute("tabindex")||!textCriteriaMatches(st,ot)||lt)st=it(tt,st,nt);else return st.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(et,nt){const{actions:rt,autoFocus:it=!1,autoFocusItem:ot=!1,children:at,className:st,disabledItemsFocusable:lt=!1,disableListWrap:ct=!1,onKeyDown:ut,variant:ht="selectedMenu"}=et,dt=_objectWithoutPropertiesLoose$k(et,_excluded$$),pt=reactExports.useRef(null),mt=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect$1(()=>{it&&pt.current.focus()},[it]),reactExports.useImperativeHandle(rt,()=>({adjustStyleForScrollbar:(xt,kt)=>{const St=!pt.current.style.width;if(xt.clientHeight{const kt=pt.current,St=xt.key,Tt=ownerDocument(kt).activeElement;if(St==="ArrowDown")xt.preventDefault(),moveFocus$1(kt,Tt,ct,lt,nextItem$1);else if(St==="ArrowUp")xt.preventDefault(),moveFocus$1(kt,Tt,ct,lt,previousItem$1);else if(St==="Home")xt.preventDefault(),moveFocus$1(kt,null,ct,lt,nextItem$1);else if(St==="End")xt.preventDefault(),moveFocus$1(kt,null,ct,lt,previousItem$1);else if(St.length===1){const At=mt.current,Et=St.toLowerCase(),Ct=performance.now();At.keys.length>0&&(Ct-At.lastTime>500?(At.keys=[],At.repeating=!0,At.previousKeyMatched=!0):At.repeating&&Et!==At.keys[0]&&(At.repeating=!1)),At.lastTime=Ct,At.keys.push(Et);const Lt=Tt&&!At.repeating&&textCriteriaMatches(Tt,At);At.previousKeyMatched&&(Lt||moveFocus$1(kt,Tt,!1,lt,nextItem$1,At))?xt.preventDefault():At.previousKeyMatched=!1}ut&&ut(xt)},yt=useForkRef(pt,nt);let bt=-1;reactExports.Children.forEach(at,(xt,kt)=>{if(!reactExports.isValidElement(xt)){bt===kt&&(bt+=1,bt>=at.length&&(bt=-1));return}xt.props.disabled||(ht==="selectedMenu"&&xt.props.selected||bt===-1)&&(bt=kt),bt===kt&&(xt.props.disabled||xt.props.muiSkipListHighlight||xt.type.muiSkipListHighlight)&&(bt+=1,bt>=at.length&&(bt=-1))});const wt=reactExports.Children.map(at,(xt,kt)=>{if(kt===bt){const St={};return ot&&(St.autoFocus=!0),xt.props.tabIndex===void 0&&ht==="selectedMenu"&&(St.tabIndex=0),reactExports.cloneElement(xt,St)}return xt});return jsxRuntimeExports.jsx(List$1,_extends$u({role:"menu",ref:yt,className:st,onKeyDown:gt,tabIndex:it?0:-1},dt,{children:wt}))}),MenuList$1=MenuList;function getPopoverUtilityClass(tt){return generateUtilityClass("MuiPopover",tt)}generateUtilityClasses("MuiPopover",["root","paper"]);const _excluded$_=["onEntering"],_excluded2$e=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_excluded3$4=["slotProps"];function getOffsetTop(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.height/2:et==="bottom"&&(nt=tt.height),nt}function getOffsetLeft(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.width/2:et==="right"&&(nt=tt.width),nt}function getTransformOriginValue(tt){return[tt.horizontal,tt.vertical].map(et=>typeof et=="number"?`${et}px`:et).join(" ")}function resolveAnchorEl(tt){return typeof tt=="function"?tt():tt}const useUtilityClasses$x=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,et)},PopoverRoot=styled$1(Modal$1,{name:"MuiPopover",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),PopoverPaper=styled$1(Paper$1,{name:"MuiPopover",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useThemeProps({props:et,name:"MuiPopover"}),{action:st,anchorEl:lt,anchorOrigin:ct={vertical:"top",horizontal:"left"},anchorPosition:ut,anchorReference:ht="anchorEl",children:dt,className:pt,container:mt,elevation:gt=8,marginThreshold:yt=16,open:bt,PaperProps:wt={},slots:xt,slotProps:kt,transformOrigin:St={vertical:"top",horizontal:"left"},TransitionComponent:Tt=Grow$1,transitionDuration:At="auto",TransitionProps:{onEntering:Et}={},disableScrollLock:Ct=!1}=at,Lt=_objectWithoutPropertiesLoose$k(at.TransitionProps,_excluded$_),jt=_objectWithoutPropertiesLoose$k(at,_excluded2$e),Rt=(rt=kt==null?void 0:kt.paper)!=null?rt:wt,$t=reactExports.useRef(),vt=useForkRef($t,Rt.ref),It=_extends$u({},at,{anchorOrigin:ct,anchorReference:ht,elevation:gt,marginThreshold:yt,externalPaperSlotProps:Rt,transformOrigin:St,TransitionComponent:Tt,transitionDuration:At,TransitionProps:Lt}),Ot=useUtilityClasses$x(It),Wt=reactExports.useCallback(()=>{if(ht==="anchorPosition")return ut;const vn=resolveAnchorEl(lt),$n=(vn&&vn.nodeType===1?vn:ownerDocument($t.current).body).getBoundingClientRect();return{top:$n.top+getOffsetTop($n,ct.vertical),left:$n.left+getOffsetLeft($n,ct.horizontal)}},[lt,ct.horizontal,ct.vertical,ut,ht]),zt=reactExports.useCallback(vn=>({vertical:getOffsetTop(vn,St.vertical),horizontal:getOffsetLeft(vn,St.horizontal)}),[St.horizontal,St.vertical]),Ft=reactExports.useCallback(vn=>{const Cn={width:vn.offsetWidth,height:vn.offsetHeight},$n=zt(Cn);if(ht==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue($n)};const Nn=Wt();let En=Nn.top-$n.vertical,sn=Nn.left-$n.horizontal;const pn=En+Cn.height,Tn=sn+Cn.width,In=ownerWindow(resolveAnchorEl(lt)),yn=In.innerHeight-yt,hn=In.innerWidth-yt;if(yt!==null&&Enyn){const fn=pn-yn;En-=fn,$n.vertical+=fn}if(yt!==null&&snhn){const fn=Tn-hn;sn-=fn,$n.horizontal+=fn}return{top:`${Math.round(En)}px`,left:`${Math.round(sn)}px`,transformOrigin:getTransformOriginValue($n)}},[lt,ht,Wt,zt,yt]),[Nt,Ut]=reactExports.useState(bt),Pt=reactExports.useCallback(()=>{const vn=$t.current;if(!vn)return;const Cn=Ft(vn);Cn.top!==null&&(vn.style.top=Cn.top),Cn.left!==null&&(vn.style.left=Cn.left),vn.style.transformOrigin=Cn.transformOrigin,Ut(!0)},[Ft]);reactExports.useEffect(()=>(Ct&&window.addEventListener("scroll",Pt),()=>window.removeEventListener("scroll",Pt)),[lt,Ct,Pt]);const Ht=(vn,Cn)=>{Et&&Et(vn,Cn),Pt()},Qt=()=>{Ut(!1)};reactExports.useEffect(()=>{bt&&Pt()}),reactExports.useImperativeHandle(st,()=>bt?{updatePosition:()=>{Pt()}}:null,[bt,Pt]),reactExports.useEffect(()=>{if(!bt)return;const vn=debounce$4(()=>{Pt()}),Cn=ownerWindow(lt);return Cn.addEventListener("resize",vn),()=>{vn.clear(),Cn.removeEventListener("resize",vn)}},[lt,bt,Pt]);let an=At;At==="auto"&&!Tt.muiSupportAuto&&(an=void 0);const Yt=mt||(lt?ownerDocument(resolveAnchorEl(lt)).body:void 0),nn=(it=xt==null?void 0:xt.root)!=null?it:PopoverRoot,tn=(ot=xt==null?void 0:xt.paper)!=null?ot:PopoverPaper,dn=useSlotProps({elementType:tn,externalSlotProps:_extends$u({},Rt,{style:Nt?Rt.style:_extends$u({},Rt.style,{opacity:0})}),additionalProps:{elevation:gt,ref:vt},ownerState:It,className:clsx$2(Ot.paper,Rt==null?void 0:Rt.className)}),wn=useSlotProps({elementType:nn,externalSlotProps:(kt==null?void 0:kt.root)||{},externalForwardedProps:jt,additionalProps:{ref:nt,slotProps:{backdrop:{invisible:!0}},container:Yt,open:bt},ownerState:It,className:clsx$2(Ot.root,pt)}),{slotProps:rn}=wn,Zt=_objectWithoutPropertiesLoose$k(wn,_excluded3$4);return jsxRuntimeExports.jsx(nn,_extends$u({},Zt,!isHostComponent(nn)&&{slotProps:rn,disableScrollLock:Ct},{children:jsxRuntimeExports.jsx(Tt,_extends$u({appear:!0,in:bt,onEntering:Ht,onExited:Qt,timeout:an},Lt,{children:jsxRuntimeExports.jsx(tn,_extends$u({},dn,{children:dt}))}))}))}),Popover$1=Popover;function getMenuUtilityClass(tt){return generateUtilityClass("MuiMenu",tt)}generateUtilityClasses("MuiMenu",["root","paper","list"]);const _excluded$Z=["onEntering"],_excluded2$d=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$w=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,et)},MenuRoot=styled$1(Popover$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),MenuPaper=styled$1(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled$1(MenuList$1,{name:"MuiMenu",slot:"List",overridesResolver:(tt,et)=>et.list})({outline:0}),Menu=reactExports.forwardRef(function(et,nt){var rt,it;const ot=useThemeProps({props:et,name:"MuiMenu"}),{autoFocus:at=!0,children:st,className:lt,disableAutoFocusItem:ct=!1,MenuListProps:ut={},onClose:ht,open:dt,PaperProps:pt={},PopoverClasses:mt,transitionDuration:gt="auto",TransitionProps:{onEntering:yt}={},variant:bt="selectedMenu",slots:wt={},slotProps:xt={}}=ot,kt=_objectWithoutPropertiesLoose$k(ot.TransitionProps,_excluded$Z),St=_objectWithoutPropertiesLoose$k(ot,_excluded2$d),Tt=useTheme(),At=Tt.direction==="rtl",Et=_extends$u({},ot,{autoFocus:at,disableAutoFocusItem:ct,MenuListProps:ut,onEntering:yt,PaperProps:pt,transitionDuration:gt,TransitionProps:kt,variant:bt}),Ct=useUtilityClasses$w(Et),Lt=at&&!ct&&dt,jt=reactExports.useRef(null),Rt=(Ft,Nt)=>{jt.current&&jt.current.adjustStyleForScrollbar(Ft,Tt),yt&&yt(Ft,Nt)},$t=Ft=>{Ft.key==="Tab"&&(Ft.preventDefault(),ht&&ht(Ft,"tabKeyDown"))};let vt=-1;reactExports.Children.map(st,(Ft,Nt)=>{reactExports.isValidElement(Ft)&&(Ft.props.disabled||(bt==="selectedMenu"&&Ft.props.selected||vt===-1)&&(vt=Nt))});const It=(rt=wt.paper)!=null?rt:MenuPaper,Ot=(it=xt.paper)!=null?it:pt,Wt=useSlotProps({elementType:wt.root,externalSlotProps:xt.root,ownerState:Et,className:[Ct.root,lt]}),zt=useSlotProps({elementType:It,externalSlotProps:Ot,ownerState:Et,className:Ct.paper});return jsxRuntimeExports.jsx(MenuRoot,_extends$u({onClose:ht,anchorOrigin:{vertical:"bottom",horizontal:At?"right":"left"},transformOrigin:At?RTL_ORIGIN:LTR_ORIGIN,slots:{paper:It,root:wt.root},slotProps:{root:Wt,paper:zt},open:dt,ref:nt,transitionDuration:gt,TransitionProps:_extends$u({onEntering:Rt},kt),ownerState:Et},St,{classes:mt,children:jsxRuntimeExports.jsx(MenuMenuList,_extends$u({onKeyDown:$t,actions:jt,autoFocus:at&&(vt===-1||ct),autoFocusItem:Lt,variant:bt},ut,{className:clsx$2(Ct.list,ut.className),children:st}))}))}),Menu$1=Menu;function getMenuItemUtilityClass(tt){return generateUtilityClass("MuiMenuItem",tt)}const menuItemClasses=generateUtilityClasses("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),menuItemClasses$1=menuItemClasses,_excluded$Y=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],overridesResolver$1=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dense&&et.dense,nt.divider&&et.divider,!nt.disableGutters&&et.gutters]},useUtilityClasses$v=tt=>{const{disabled:et,dense:nt,divider:rt,disableGutters:it,selected:ot,classes:at}=tt,lt=composeClasses({root:["root",nt&&"dense",et&&"disabled",!it&&"gutters",rt&&"divider",ot&&"selected"]},getMenuItemUtilityClass,at);return _extends$u({},at,lt)},MenuItemRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:overridesResolver$1})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!et.disableGutters&&{paddingLeft:16,paddingRight:16},et.divider&&{borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(tt.vars||tt).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},[`&.${menuItemClasses$1.selected}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity)}},[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`&.${menuItemClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses$1.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses$1.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses$1.root}`]:{minWidth:36}},!et.dense&&{[tt.breakpoints.up("sm")]:{minHeight:"auto"}},et.dense&&_extends$u({minHeight:32,paddingTop:4,paddingBottom:4},tt.typography.body2,{[`& .${listItemIconClasses$1.root} svg`]:{fontSize:"1.25rem"}}))),MenuItem$3=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiMenuItem"}),{autoFocus:it=!1,component:ot="li",dense:at=!1,divider:st=!1,disableGutters:lt=!1,focusVisibleClassName:ct,role:ut="menuitem",tabIndex:ht,className:dt}=rt,pt=_objectWithoutPropertiesLoose$k(rt,_excluded$Y),mt=reactExports.useContext(ListContext$1),gt=reactExports.useMemo(()=>({dense:at||mt.dense||!1,disableGutters:lt}),[mt.dense,at,lt]),yt=reactExports.useRef(null);useEnhancedEffect$1(()=>{it&&yt.current&&yt.current.focus()},[it]);const bt=_extends$u({},rt,{dense:gt.dense,divider:st,disableGutters:lt}),wt=useUtilityClasses$v(rt),xt=useForkRef(yt,nt);let kt;return rt.disabled||(kt=ht!==void 0?ht:-1),jsxRuntimeExports.jsx(ListContext$1.Provider,{value:gt,children:jsxRuntimeExports.jsx(MenuItemRoot,_extends$u({ref:xt,role:ut,tabIndex:kt,component:ot,focusVisibleClassName:clsx$2(wt.focusVisible,ct),className:clsx$2(wt.root,dt)},pt,{ownerState:bt,classes:wt}))})}),MenuItem$4=MenuItem$3;function getNativeSelectUtilityClasses(tt){return generateUtilityClass("MuiNativeSelect",tt)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),nativeSelectClasses$1=nativeSelectClasses,_excluded$X=["className","disabled","error","IconComponent","inputRef","variant"],useUtilityClasses$u=tt=>{const{classes:et,variant:nt,disabled:rt,multiple:it,open:ot,error:at}=tt,st={select:["select",nt,rt&&"disabled",it&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",rt&&"disabled"]};return composeClasses(st,getNativeSelectUtilityClasses,et)},nativeSelectSelectStyles=({ownerState:tt,theme:et})=>_extends$u({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":_extends$u({},et.vars?{backgroundColor:`rgba(${et.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:et.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nativeSelectClasses$1.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(et.vars||et).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},tt.variant==="filled"&&{"&&&":{paddingRight:32}},tt.variant==="outlined"&&{borderRadius:(et.vars||et).shape.borderRadius,"&:focus":{borderRadius:(et.vars||et).shape.borderRadius},"&&&":{paddingRight:32}}),NativeSelectSelect=styled$1("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.select,et[nt.variant],nt.error&&et.error,{[`&.${nativeSelectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles),nativeSelectIconStyles=({ownerState:tt,theme:et})=>_extends$u({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(et.vars||et).palette.action.active,[`&.${nativeSelectClasses$1.disabled}`]:{color:(et.vars||et).palette.action.disabled}},tt.open&&{transform:"rotate(180deg)"},tt.variant==="filled"&&{right:7},tt.variant==="outlined"&&{right:7}),NativeSelectIcon=styled$1("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),NativeSelectInput=reactExports.forwardRef(function(et,nt){const{className:rt,disabled:it,error:ot,IconComponent:at,inputRef:st,variant:lt="standard"}=et,ct=_objectWithoutPropertiesLoose$k(et,_excluded$X),ut=_extends$u({},et,{disabled:it,variant:lt,error:ot}),ht=useUtilityClasses$u(ut);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,_extends$u({ownerState:ut,className:clsx$2(ht.select,rt),disabled:it,ref:st||nt},ct)),et.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:at,ownerState:ut,className:ht.icon})]})}),NativeSelectInput$1=NativeSelectInput;var _span$1;const _excluded$W=["children","classes","className","label","notched"],NotchedOutlineRoot$1=styled$1("fieldset",{shouldForwardProp:rootShouldForwardProp})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled$1("legend",{shouldForwardProp:rootShouldForwardProp})(({ownerState:tt,theme:et})=>_extends$u({float:"unset",width:"auto",overflow:"hidden"},!tt.withLabel&&{padding:0,lineHeight:"11px",transition:et.transitions.create("width",{duration:150,easing:et.transitions.easing.easeOut})},tt.withLabel&&_extends$u({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:et.transitions.create("max-width",{duration:50,easing:et.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},tt.notched&&{maxWidth:"100%",transition:et.transitions.create("max-width",{duration:100,easing:et.transitions.easing.easeOut,delay:50})})));function NotchedOutline(tt){const{className:et,label:nt,notched:rt}=tt,it=_objectWithoutPropertiesLoose$k(tt,_excluded$W),ot=nt!=null&&nt!=="",at=_extends$u({},tt,{notched:rt,withLabel:ot});return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,_extends$u({"aria-hidden":!0,className:et,ownerState:at},it,{children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:at,children:ot?jsxRuntimeExports.jsx("span",{children:nt}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"}))})}))}const _excluded$V=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],useUtilityClasses$t=tt=>{const{classes:et}=tt,rt=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,et);return _extends$u({},et,rt)},OutlinedInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return _extends$u({position:"relative",borderRadius:(tt.vars||tt).shape.borderRadius,[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:nt}},[`&.${outlinedInputClasses$1.focused} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette[et.color].main,borderWidth:2},[`&.${outlinedInputClasses$1.error} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.error.main},[`&.${outlinedInputClasses$1.disabled} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.action.disabled}},et.startAdornment&&{paddingLeft:14},et.endAdornment&&{paddingRight:14},et.multiline&&_extends$u({padding:"16.5px 14px"},et.size==="small"&&{padding:"8.5px 14px"}))}),NotchedOutlineRoot=styled$1(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(tt,et)=>et.notchedOutline})(({theme:tt})=>{const et=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:et}}),OutlinedInputInput=styled$1(InputBaseComponent,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({padding:"16.5px 14px"},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{padding:"8.5px 14px"},et.multiline&&{padding:0},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0})),OutlinedInput=reactExports.forwardRef(function(et,nt){var rt,it,ot,at,st;const lt=useThemeProps({props:et,name:"MuiOutlinedInput"}),{components:ct={},fullWidth:ut=!1,inputComponent:ht="input",label:dt,multiline:pt=!1,notched:mt,slots:gt={},type:yt="text"}=lt,bt=_objectWithoutPropertiesLoose$k(lt,_excluded$V),wt=useUtilityClasses$t(lt),xt=useFormControl(),kt=formControlState({props:lt,muiFormControl:xt,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),St=_extends$u({},lt,{color:kt.color||"primary",disabled:kt.disabled,error:kt.error,focused:kt.focused,formControl:xt,fullWidth:ut,hiddenLabel:kt.hiddenLabel,multiline:pt,size:kt.size,type:yt}),Tt=(rt=(it=gt.root)!=null?it:ct.Root)!=null?rt:OutlinedInputRoot,At=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:Tt,input:At},renderSuffix:Et=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:St,className:wt.notchedOutline,label:dt!=null&&dt!==""&&kt.required?st||(st=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[dt," ","*"]})):dt,notched:typeof mt<"u"?mt:!!(Et.startAdornment||Et.filled||Et.focused)}),fullWidth:ut,inputComponent:ht,multiline:pt,ref:nt,type:yt},bt,{classes:_extends$u({},wt,{notchedOutline:null})}))});OutlinedInput.muiName="Input";const OutlinedInput$1=OutlinedInput;function getSelectUtilityClasses(tt){return generateUtilityClass("MuiSelect",tt)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),selectClasses$1=selectClasses;var _span;const _excluded$U=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],SelectSelect=styled$1("div",{name:"MuiSelect",slot:"Select",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`&.${selectClasses$1.select}`]:et.select},{[`&.${selectClasses$1.select}`]:et[nt.variant]},{[`&.${selectClasses$1.error}`]:et.error},{[`&.${selectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles,{[`&.${selectClasses$1.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled$1("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),SelectNativeInput=styled$1("input",{shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(tt,et)=>et.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(tt,et){return typeof et=="object"&&et!==null?tt===et:String(tt)===String(et)}function isEmpty(tt){return tt==null||typeof tt=="string"&&!tt.trim()}const useUtilityClasses$s=tt=>{const{classes:et,variant:nt,disabled:rt,multiple:it,open:ot,error:at}=tt,st={select:["select",nt,rt&&"disabled",it&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",rt&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(st,getSelectUtilityClasses,et)},SelectInput=reactExports.forwardRef(function(et,nt){var rt;const{"aria-describedby":it,"aria-label":ot,autoFocus:at,autoWidth:st,children:lt,className:ct,defaultOpen:ut,defaultValue:ht,disabled:dt,displayEmpty:pt,error:mt=!1,IconComponent:gt,inputRef:yt,labelId:bt,MenuProps:wt={},multiple:xt,name:kt,onBlur:St,onChange:Tt,onClose:At,onFocus:Et,onOpen:Ct,open:Lt,readOnly:jt,renderValue:Rt,SelectDisplayProps:$t={},tabIndex:vt,value:It,variant:Ot="standard"}=et,Wt=_objectWithoutPropertiesLoose$k(et,_excluded$U),[zt,Ft]=useControlled({controlled:It,default:ht,name:"Select"}),[Nt,Ut]=useControlled({controlled:Lt,default:ut,name:"Select"}),Pt=reactExports.useRef(null),Ht=reactExports.useRef(null),[Qt,an]=reactExports.useState(null),{current:Yt}=reactExports.useRef(Lt!=null),[nn,tn]=reactExports.useState(),dn=useForkRef(nt,yt),wn=reactExports.useCallback(Bn=>{Ht.current=Bn,Bn&&an(Bn)},[]),rn=Qt==null?void 0:Qt.parentNode;reactExports.useImperativeHandle(dn,()=>({focus:()=>{Ht.current.focus()},node:Pt.current,value:zt}),[zt]),reactExports.useEffect(()=>{ut&&Nt&&Qt&&!Yt&&(tn(st?null:rn.clientWidth),Ht.current.focus())},[Qt,st]),reactExports.useEffect(()=>{at&&Ht.current.focus()},[at]),reactExports.useEffect(()=>{if(!bt)return;const Bn=ownerDocument(Ht.current).getElementById(bt);if(Bn){const Xn=()=>{getSelection().isCollapsed&&Ht.current.focus()};return Bn.addEventListener("click",Xn),()=>{Bn.removeEventListener("click",Xn)}}},[bt]);const Zt=(Bn,Xn)=>{Bn?Ct&&Ct(Xn):At&&At(Xn),Yt||(tn(st?null:rn.clientWidth),Ut(Bn))},vn=Bn=>{Bn.button===0&&(Bn.preventDefault(),Ht.current.focus(),Zt(!0,Bn))},Cn=Bn=>{Zt(!1,Bn)},$n=reactExports.Children.toArray(lt),Nn=Bn=>{const Xn=$n.find(Vn=>Vn.props.value===Bn.target.value);Xn!==void 0&&(Ft(Xn.props.value),Tt&&Tt(Bn,Xn))},En=Bn=>Xn=>{let Vn;if(Xn.currentTarget.hasAttribute("tabindex")){if(xt){Vn=Array.isArray(zt)?zt.slice():[];const Gn=zt.indexOf(Bn.props.value);Gn===-1?Vn.push(Bn.props.value):Vn.splice(Gn,1)}else Vn=Bn.props.value;if(Bn.props.onClick&&Bn.props.onClick(Xn),zt!==Vn&&(Ft(Vn),Tt)){const Gn=Xn.nativeEvent||Xn,zn=new Gn.constructor(Gn.type,Gn);Object.defineProperty(zn,"target",{writable:!0,value:{value:Vn,name:kt}}),Tt(zn,Bn)}xt||Zt(!1,Xn)}},sn=Bn=>{jt||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Bn.key)!==-1&&(Bn.preventDefault(),Zt(!0,Bn))},pn=Qt!==null&&Nt,Tn=Bn=>{!pn&&St&&(Object.defineProperty(Bn,"target",{writable:!0,value:{value:zt,name:kt}}),St(Bn))};delete Wt["aria-invalid"];let In,yn;const hn=[];let fn=!1;(isFilled({value:zt})||pt)&&(Rt?In=Rt(zt):fn=!0);const xn=$n.map(Bn=>{if(!reactExports.isValidElement(Bn))return null;let Xn;if(xt){if(!Array.isArray(zt))throw new Error(formatMuiErrorMessage(2));Xn=zt.some(Vn=>areEqualValues(Vn,Bn.props.value)),Xn&&fn&&hn.push(Bn.props.children)}else Xn=areEqualValues(zt,Bn.props.value),Xn&&fn&&(yn=Bn.props.children);return reactExports.cloneElement(Bn,{"aria-selected":Xn?"true":"false",onClick:En(Bn),onKeyUp:Vn=>{Vn.key===" "&&Vn.preventDefault(),Bn.props.onKeyUp&&Bn.props.onKeyUp(Vn)},role:"option",selected:Xn,value:void 0,"data-value":Bn.props.value})});fn&&(xt?hn.length===0?In=null:In=hn.reduce((Bn,Xn,Vn)=>(Bn.push(Xn),Vn{const{classes:et}=tt;return et},styledRootConfig={name:"MuiSelect",overridesResolver:(tt,et)=>et.root,shouldForwardProp:tt=>rootShouldForwardProp(tt)&&tt!=="variant",slot:"Root"},StyledInput$1=styled$1(Input$2,styledRootConfig)(""),StyledOutlinedInput=styled$1(OutlinedInput$1,styledRootConfig)(""),StyledFilledInput=styled$1(FilledInput$1,styledRootConfig)(""),Select=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({name:"MuiSelect",props:et}),{autoWidth:it=!1,children:ot,classes:at={},className:st,defaultOpen:lt=!1,displayEmpty:ct=!1,IconComponent:ut=ArrowDropDownIcon$1,id:ht,input:dt,inputProps:pt,label:mt,labelId:gt,MenuProps:yt,multiple:bt=!1,native:wt=!1,onClose:xt,onOpen:kt,open:St,renderValue:Tt,SelectDisplayProps:At,variant:Et="outlined"}=rt,Ct=_objectWithoutPropertiesLoose$k(rt,_excluded$T),Lt=wt?NativeSelectInput$1:SelectInput$1,jt=useFormControl(),Rt=formControlState({props:rt,muiFormControl:jt,states:["variant","error"]}),$t=Rt.variant||Et,vt=_extends$u({},rt,{variant:$t,classes:at}),It=useUtilityClasses$r(vt),Ot=_objectWithoutPropertiesLoose$k(It,_excluded2$c),Wt=dt||{standard:jsxRuntimeExports.jsx(StyledInput$1,{ownerState:vt}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:mt,ownerState:vt}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:vt})}[$t],zt=useForkRef(nt,Wt.ref);return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(Wt,_extends$u({inputComponent:Lt,inputProps:_extends$u({children:ot,error:Rt.error,IconComponent:ut,variant:$t,type:void 0,multiple:bt},wt?{id:ht}:{autoWidth:it,defaultOpen:lt,displayEmpty:ct,labelId:gt,MenuProps:yt,onClose:xt,onOpen:kt,open:St,renderValue:Tt,SelectDisplayProps:_extends$u({id:ht},At)},pt,{classes:pt?deepmerge$1(Ot,pt.classes):Ot},dt?dt.props.inputProps:{})},bt&&wt&&$t==="outlined"?{notched:!0}:{},{ref:zt,className:clsx$2(Wt.props.className,st,It.root)},!dt&&{variant:$t},Ct))})});Select.muiName="Select";const Select$1=Select;function getSkeletonUtilityClass(tt){return generateUtilityClass("MuiSkeleton",tt)}generateUtilityClasses("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const _excluded$S=["animation","className","component","height","style","variant","width"];let _=tt=>tt,_t,_t2,_t3,_t4;const useUtilityClasses$q=tt=>{const{classes:et,variant:nt,animation:rt,hasChildren:it,width:ot,height:at}=tt;return composeClasses({root:["root",nt,rt,it&&"withChildren",it&&!ot&&"fitContent",it&&!at&&"heightAuto"]},getSkeletonUtilityClass,et)},pulseKeyframe=keyframes(_t||(_t=_` 0% { opacity: 1; } @@ -4944,8 +4944,8 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co right: 0; top: 0; } - `),waveKeyframe,(et.vars||et).palette.action.hover)),Skeleton=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiSkeleton"}),{animation:it="pulse",className:ot,component:at="span",height:st,style:lt,variant:ct="text",width:ut}=rt,ht=_objectWithoutPropertiesLoose$k(rt,_excluded$S),dt=_extends$u({},rt,{animation:it,component:at,variant:ct,hasChildren:!!ht.children}),pt=useUtilityClasses$q(dt);return jsxRuntimeExports.jsx(SkeletonRoot,_extends$u({as:at,ref:nt,className:clsx$2(pt.root,ot),ownerState:dt},ht,{style:_extends$u({width:ut,height:st},lt)}))}),Skeleton$1=Skeleton,shouldSpreadAdditionalProps=tt=>!tt||!isHostComponent(tt),shouldSpreadAdditionalProps$1=shouldSpreadAdditionalProps;function getSliderUtilityClass(tt){return generateUtilityClass("MuiSlider",tt)}const sliderClasses=generateUtilityClasses("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),sliderClasses$1=sliderClasses,useValueLabelClasses=tt=>{const{open:et}=tt;return{offset:clsx$2(et&&sliderClasses$1.valueLabelOpen),circle:sliderClasses$1.valueLabelCircle,label:sliderClasses$1.valueLabelLabel}};function SliderValueLabel$1(tt){const{children:et,className:nt,value:rt}=tt,it=useValueLabelClasses(tt);return et?reactExports.cloneElement(et,{className:clsx$2(et.props.className)},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[et.props.children,jsxRuntimeExports.jsx("span",{className:clsx$2(it.offset,nt),"aria-hidden":!0,children:jsxRuntimeExports.jsx("span",{className:it.circle,children:jsxRuntimeExports.jsx("span",{className:it.label,children:rt})})})]})):null}const _excluded$R=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function Identity(tt){return tt}const SliderRoot=styled$1("span",{name:"MuiSlider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`color${capitalize(nt.color)}`],nt.size!=="medium"&&et[`size${capitalize(nt.size)}`],nt.marked&&et.marked,nt.orientation==="vertical"&&et.vertical,nt.track==="inverted"&&et.trackInverted,nt.track===!1&&et.trackFalse]}})(({theme:tt,ownerState:et})=>_extends$u({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(tt.vars||tt).palette[et.color].main,WebkitTapHighlightColor:"transparent"},et.orientation==="horizontal"&&_extends$u({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},et.size==="small"&&{height:2},et.marked&&{marginBottom:20}),et.orientation==="vertical"&&_extends$u({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},et.size==="small"&&{width:2},et.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${sliderClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default",color:(tt.vars||tt).palette.grey[400]},[`&.${sliderClasses$1.dragging}`]:{[`& .${sliderClasses$1.thumb}, & .${sliderClasses$1.track}`]:{transition:"none"}}})),SliderRail=styled$1("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(tt,et)=>et.rail})(({ownerState:tt})=>_extends$u({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},tt.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},tt.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},tt.track==="inverted"&&{opacity:1})),SliderTrack=styled$1("span",{name:"MuiSlider",slot:"Track",overridesResolver:(tt,et)=>et.track})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?lighten(tt.palette[et.color].main,.62):darken(tt.palette[et.color].main,.5);return _extends$u({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:tt.transitions.create(["left","width","bottom","height"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{border:"none"},et.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},et.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},et.track===!1&&{display:"none"},et.track==="inverted"&&{backgroundColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt,borderColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt})}),SliderThumb=styled$1("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.thumb,et[`thumbColor${capitalize(nt.color)}`],nt.size!=="medium"&&et[`thumbSize${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$u({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:tt.transitions.create(["box-shadow","left","bottom"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{width:12,height:12},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":_extends$u({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(tt.vars||tt).shadows[2]},et.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${sliderClasses$1.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${sliderClasses$1.active}`]:{boxShadow:`0px 0px 0px 14px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`},[`&.${sliderClasses$1.disabled}`]:{"&:hover":{boxShadow:"none"}}})),SliderValueLabel=styled$1(SliderValueLabel$1,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(tt,et)=>et.valueLabel})(({theme:tt,ownerState:et})=>_extends$u({[`&.${sliderClasses$1.valueLabelOpen}`]:{transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},tt.typography.body2,{fontWeight:500,transition:tt.transitions.create(["transform"],{duration:tt.transitions.duration.shortest}),transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(tt.vars||tt).palette.grey[600],borderRadius:2,color:(tt.vars||tt).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},et.orientation==="horizontal"&&{top:"-10px",transformOrigin:"bottom center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"}},et.orientation==="vertical"&&{right:et.size==="small"?"20px":"30px",top:"50%",transformOrigin:"right center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"}},et.size==="small"&&{fontSize:tt.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),SliderMark=styled$1("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markActive",overridesResolver:(tt,et)=>{const{markActive:nt}=tt;return[et.mark,nt&&et.markActive]}})(({theme:tt,ownerState:et,markActive:nt})=>_extends$u({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},nt&&{backgroundColor:(tt.vars||tt).palette.background.paper,opacity:.8})),SliderMarkLabel=styled$1("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markLabelActive",overridesResolver:(tt,et)=>et.markLabel})(({theme:tt,ownerState:et,markLabelActive:nt})=>_extends$u({},tt.typography.body2,{color:(tt.vars||tt).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},et.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},et.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},nt&&{color:(tt.vars||tt).palette.text.primary})),useUtilityClasses$p=tt=>{const{disabled:et,dragging:nt,marked:rt,orientation:it,track:ot,classes:at,color:st,size:lt}=tt,ct={root:["root",et&&"disabled",nt&&"dragging",rt&&"marked",it==="vertical"&&"vertical",ot==="inverted"&&"trackInverted",ot===!1&&"trackFalse",st&&`color${capitalize(st)}`,lt&&`size${capitalize(lt)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",et&&"disabled",lt&&`thumbSize${capitalize(lt)}`,st&&`thumbColor${capitalize(st)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return composeClasses(ct,getSliderUtilityClass,at)},Forward=({children:tt})=>tt,Slider=reactExports.forwardRef(function(et,nt){var rt,it,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt,yt,bt,wt,xt,kt,St,Tt,At,Et,Ct,Lt;const jt=useThemeProps({props:et,name:"MuiSlider"}),$t=useTheme().direction==="rtl",{"aria-label":vt,"aria-valuetext":It,"aria-labelledby":Ot,component:Wt="span",components:zt={},componentsProps:Ft={},color:Nt="primary",classes:Ut,className:Pt,disableSwap:Ht=!1,disabled:Qt=!1,getAriaLabel:an,getAriaValueText:Yt,marks:nn=!1,max:tn=100,min:dn=0,orientation:wn="horizontal",size:rn="medium",step:Jt=1,scale:vn=Identity,slotProps:Cn,slots:$n,track:Nn="normal",valueLabelDisplay:En="off",valueLabelFormat:sn=Identity}=jt,pn=_objectWithoutPropertiesLoose$k(jt,_excluded$R),Tn=_extends$u({},jt,{isRtl:$t,max:tn,min:dn,classes:Ut,disabled:Qt,disableSwap:Ht,orientation:wn,marks:nn,color:Nt,size:rn,step:Jt,scale:vn,track:Nn,valueLabelDisplay:En,valueLabelFormat:sn}),{axisProps:In,getRootProps:yn,getHiddenInputProps:hn,getThumbProps:fn,open:xn,active:jn,axis:cn,focusedThumbIndex:Xt,range:Kt,dragging:kn,marks:Mn,values:On,trackOffset:Bn,trackLeap:Xn,getThumbStyle:Vn}=useSlider(_extends$u({},Tn,{rootRef:nt}));Tn.marked=Mn.length>0&&Mn.some(tr=>tr.label),Tn.dragging=kn,Tn.focusedThumbIndex=Xt;const Gn=useUtilityClasses$p(Tn),zn=(rt=(it=$n==null?void 0:$n.root)!=null?it:zt.Root)!=null?rt:SliderRoot,Zn=(ot=(at=$n==null?void 0:$n.rail)!=null?at:zt.Rail)!=null?ot:SliderRail,Wn=(st=(lt=$n==null?void 0:$n.track)!=null?lt:zt.Track)!=null?st:SliderTrack,fr=(ct=(ut=$n==null?void 0:$n.thumb)!=null?ut:zt.Thumb)!=null?ct:SliderThumb,ur=(ht=(dt=$n==null?void 0:$n.valueLabel)!=null?dt:zt.ValueLabel)!=null?ht:SliderValueLabel,wr=(pt=(mt=$n==null?void 0:$n.mark)!=null?mt:zt.Mark)!=null?pt:SliderMark,Xr=(gt=(yt=$n==null?void 0:$n.markLabel)!=null?yt:zt.MarkLabel)!=null?gt:SliderMarkLabel,Er=(bt=(wt=$n==null?void 0:$n.input)!=null?wt:zt.Input)!=null?bt:"input",Ir=(xt=Cn==null?void 0:Cn.root)!=null?xt:Ft.root,Gr=(kt=Cn==null?void 0:Cn.rail)!=null?kt:Ft.rail,Or=(St=Cn==null?void 0:Cn.track)!=null?St:Ft.track,Lr=(Tt=Cn==null?void 0:Cn.thumb)!=null?Tt:Ft.thumb,oo=(At=Cn==null?void 0:Cn.valueLabel)!=null?At:Ft.valueLabel,qr=(Et=Cn==null?void 0:Cn.mark)!=null?Et:Ft.mark,jr=(Ct=Cn==null?void 0:Cn.markLabel)!=null?Ct:Ft.markLabel,mo=(Lt=Cn==null?void 0:Cn.input)!=null?Lt:Ft.input,_n=useSlotProps({elementType:zn,getSlotProps:yn,externalSlotProps:Ir,externalForwardedProps:pn,additionalProps:_extends$u({},shouldSpreadAdditionalProps$1(zn)&&{as:Wt}),ownerState:_extends$u({},Tn,Ir==null?void 0:Ir.ownerState),className:[Gn.root,Pt]}),Pn=useSlotProps({elementType:Zn,externalSlotProps:Gr,ownerState:Tn,className:Gn.rail}),un=useSlotProps({elementType:Wn,externalSlotProps:Or,additionalProps:{style:_extends$u({},In[cn].offset(Bn),In[cn].leap(Xn))},ownerState:_extends$u({},Tn,Or==null?void 0:Or.ownerState),className:Gn.track}),Zt=useSlotProps({elementType:fr,getSlotProps:fn,externalSlotProps:Lr,ownerState:_extends$u({},Tn,Lr==null?void 0:Lr.ownerState),className:Gn.thumb}),Sn=useSlotProps({elementType:ur,externalSlotProps:oo,ownerState:_extends$u({},Tn,oo==null?void 0:oo.ownerState),className:Gn.valueLabel}),Dn=useSlotProps({elementType:wr,externalSlotProps:qr,ownerState:Tn,className:Gn.mark}),Fn=useSlotProps({elementType:Xr,externalSlotProps:jr,ownerState:Tn,className:Gn.markLabel}),Yn=useSlotProps({elementType:Er,getSlotProps:hn,externalSlotProps:mo,ownerState:Tn});return jsxRuntimeExports.jsxs(zn,_extends$u({},_n,{children:[jsxRuntimeExports.jsx(Zn,_extends$u({},Pn)),jsxRuntimeExports.jsx(Wn,_extends$u({},un)),Mn.filter(tr=>tr.value>=dn&&tr.value<=tn).map((tr,ar)=>{const lr=valueToPercent(tr.value,dn,tn),Vr=In[cn].offset(lr);let vr;return Nn===!1?vr=On.indexOf(tr.value)!==-1:vr=Nn==="normal"&&(Kt?tr.value>=On[0]&&tr.value<=On[On.length-1]:tr.value<=On[0])||Nn==="inverted"&&(Kt?tr.value<=On[0]||tr.value>=On[On.length-1]:tr.value>=On[0]),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(wr,_extends$u({"data-index":ar},Dn,!isHostComponent(wr)&&{markActive:vr},{style:_extends$u({},Vr,Dn.style),className:clsx$2(Dn.className,vr&&Gn.markActive)})),tr.label!=null?jsxRuntimeExports.jsx(Xr,_extends$u({"aria-hidden":!0,"data-index":ar},Fn,!isHostComponent(Xr)&&{markLabelActive:vr},{style:_extends$u({},Vr,Fn.style),className:clsx$2(Gn.markLabel,Fn.className,vr&&Gn.markLabelActive),children:tr.label})):null]},ar)}),On.map((tr,ar)=>{const lr=valueToPercent(tr,dn,tn),Vr=In[cn].offset(lr),vr=En==="off"?Forward:ur;return jsxRuntimeExports.jsx(vr,_extends$u({},!isHostComponent(vr)&&{valueLabelFormat:sn,valueLabelDisplay:En,value:typeof sn=="function"?sn(vn(tr),ar):sn,index:ar,open:xn===ar||jn===ar||En==="on",disabled:Qt},Sn,{children:jsxRuntimeExports.jsx(fr,_extends$u({"data-index":ar},Zt,{className:clsx$2(Gn.thumb,Zt.className,jn===ar&&Gn.active,Xt===ar&&Gn.focusVisible),style:_extends$u({},Vr,Vn(ar),Zt.style),children:jsxRuntimeExports.jsx(Er,_extends$u({"data-index":ar,"aria-label":an?an(ar):vt,"aria-valuenow":vn(tr),"aria-labelledby":Ot,"aria-valuetext":Yt?Yt(vn(tr),ar):It,value:On[ar]},Yn))}))}),ar)})]}))}),Slider$1=Slider;function getTabUtilityClass(tt){return generateUtilityClass("MuiTab",tt)}const tabClasses=generateUtilityClasses("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),tabClasses$1=tabClasses,_excluded$Q=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],useUtilityClasses$o=tt=>{const{classes:et,textColor:nt,fullWidth:rt,wrapped:it,icon:ot,label:at,selected:st,disabled:lt}=tt,ct={root:["root",ot&&at&&"labelIcon",`textColor${capitalize(nt)}`,rt&&"fullWidth",it&&"wrapped",st&&"selected",lt&&"disabled"],iconWrapper:["iconWrapper"]};return composeClasses(ct,getTabUtilityClass,et)},TabRoot=styled$1(ButtonBase$1,{name:"MuiTab",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.label&&nt.icon&&et.labelIcon,et[`textColor${capitalize(nt.textColor)}`],nt.fullWidth&&et.fullWidth,nt.wrapped&&et.wrapped]}})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},et.label&&{flexDirection:et.iconPosition==="top"||et.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},et.icon&&et.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${tabClasses$1.iconWrapper}`]:_extends$u({},et.iconPosition==="top"&&{marginBottom:6},et.iconPosition==="bottom"&&{marginTop:6},et.iconPosition==="start"&&{marginRight:tt.spacing(1)},et.iconPosition==="end"&&{marginLeft:tt.spacing(1)})},et.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${tabClasses$1.selected}`]:{opacity:1},[`&.${tabClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity}},et.textColor==="primary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.primary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.textColor==="secondary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.secondary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},et.wrapped&&{fontSize:tt.typography.pxToRem(12)})),Tab$1=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTab"}),{className:it,disabled:ot=!1,disableFocusRipple:at=!1,fullWidth:st,icon:lt,iconPosition:ct="top",indicator:ut,label:ht,onChange:dt,onClick:pt,onFocus:mt,selected:gt,selectionFollowsFocus:yt,textColor:bt="inherit",value:wt,wrapped:xt=!1}=rt,kt=_objectWithoutPropertiesLoose$k(rt,_excluded$Q),St=_extends$u({},rt,{disabled:ot,disableFocusRipple:at,selected:gt,icon:!!lt,iconPosition:ct,label:!!ht,fullWidth:st,textColor:bt,wrapped:xt}),Tt=useUtilityClasses$o(St),At=lt&&ht&&reactExports.isValidElement(lt)?reactExports.cloneElement(lt,{className:clsx$2(Tt.iconWrapper,lt.props.className)}):lt,Et=Lt=>{!gt&&dt&&dt(Lt,wt),pt&&pt(Lt)},Ct=Lt=>{yt&&!gt&&dt&&dt(Lt,wt),mt&&mt(Lt)};return jsxRuntimeExports.jsxs(TabRoot,_extends$u({focusRipple:!at,className:clsx$2(Tt.root,it),ref:nt,role:"tab","aria-selected":gt,disabled:ot,onClick:Et,onFocus:Ct,ownerState:St,tabIndex:gt?0:-1},kt,{children:[ct==="top"||ct==="start"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[At,ht]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ht,At]}),ut]}))}),Tab$2=Tab$1,TableContext=reactExports.createContext(),TableContext$1=TableContext;function getTableUtilityClass(tt){return generateUtilityClass("MuiTable",tt)}generateUtilityClasses("MuiTable",["root","stickyHeader"]);const _excluded$P=["className","component","padding","size","stickyHeader"],useUtilityClasses$n=tt=>{const{classes:et,stickyHeader:nt}=tt;return composeClasses({root:["root",nt&&"stickyHeader"]},getTableUtilityClass,et)},TableRoot=styled$1("table",{name:"MuiTable",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$u({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":_extends$u({},tt.typography.body2,{padding:tt.spacing(2),color:(tt.vars||tt).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},et.stickyHeader&&{borderCollapse:"separate"})),defaultComponent$3="table",Table$3=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTable"}),{className:it,component:ot=defaultComponent$3,padding:at="normal",size:st="medium",stickyHeader:lt=!1}=rt,ct=_objectWithoutPropertiesLoose$k(rt,_excluded$P),ut=_extends$u({},rt,{component:ot,padding:at,size:st,stickyHeader:lt}),ht=useUtilityClasses$n(ut),dt=reactExports.useMemo(()=>({padding:at,size:st,stickyHeader:lt}),[at,st,lt]);return jsxRuntimeExports.jsx(TableContext$1.Provider,{value:dt,children:jsxRuntimeExports.jsx(TableRoot,_extends$u({as:ot,role:ot===defaultComponent$3?null:"table",ref:nt,className:clsx$2(ht.root,it),ownerState:ut},ct))})}),MaterialTable=Table$3,Tablelvl2Context=reactExports.createContext(),Tablelvl2Context$1=Tablelvl2Context;function getTableBodyUtilityClass(tt){return generateUtilityClass("MuiTableBody",tt)}generateUtilityClasses("MuiTableBody",["root"]);const _excluded$O=["className","component"],useUtilityClasses$m=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableBodyUtilityClass,et)},TableBodyRoot=styled$1("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-row-group"}),tablelvl2$1={variant:"body"},defaultComponent$2="tbody",TableBody=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableBody"}),{className:it,component:ot=defaultComponent$2}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$O),st=_extends$u({},rt,{component:ot}),lt=useUtilityClasses$m(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2$1,children:jsxRuntimeExports.jsx(TableBodyRoot,_extends$u({className:clsx$2(lt.root,it),as:ot,ref:nt,role:ot===defaultComponent$2?null:"rowgroup",ownerState:st},at))})}),TableBody$1=TableBody;function getTableCellUtilityClass(tt){return generateUtilityClass("MuiTableCell",tt)}const tableCellClasses=generateUtilityClasses("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),tableCellClasses$1=tableCellClasses,_excluded$N=["align","className","component","padding","scope","size","sortDirection","variant"],useUtilityClasses$l=tt=>{const{classes:et,variant:nt,align:rt,padding:it,size:ot,stickyHeader:at}=tt,st={root:["root",nt,at&&"stickyHeader",rt!=="inherit"&&`align${capitalize(rt)}`,it!=="normal"&&`padding${capitalize(it)}`,`size${capitalize(ot)}`]};return composeClasses(st,getTableCellUtilityClass,et)},TableCellRoot=styled$1("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`size${capitalize(nt.size)}`],nt.padding!=="normal"&&et[`padding${capitalize(nt.padding)}`],nt.align!=="inherit"&&et[`align${capitalize(nt.align)}`],nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:tt.vars?`1px solid ${tt.vars.palette.TableCell.border}`:`1px solid - ${tt.palette.mode==="light"?lighten(alpha$1(tt.palette.divider,1),.88):darken(alpha$1(tt.palette.divider,1),.68)}`,textAlign:"left",padding:16},et.variant==="head"&&{color:(tt.vars||tt).palette.text.primary,lineHeight:tt.typography.pxToRem(24),fontWeight:tt.typography.fontWeightMedium},et.variant==="body"&&{color:(tt.vars||tt).palette.text.primary},et.variant==="footer"&&{color:(tt.vars||tt).palette.text.secondary,lineHeight:tt.typography.pxToRem(21),fontSize:tt.typography.pxToRem(12)},et.size==="small"&&{padding:"6px 16px",[`&.${tableCellClasses$1.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},et.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},et.padding==="none"&&{padding:0},et.align==="left"&&{textAlign:"left"},et.align==="center"&&{textAlign:"center"},et.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},et.align==="justify"&&{textAlign:"justify"},et.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(tt.vars||tt).palette.background.default})),TableCell=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableCell"}),{align:it="inherit",className:ot,component:at,padding:st,scope:lt,size:ct,sortDirection:ut,variant:ht}=rt,dt=_objectWithoutPropertiesLoose$k(rt,_excluded$N),pt=reactExports.useContext(TableContext$1),mt=reactExports.useContext(Tablelvl2Context$1),gt=mt&&mt.variant==="head";let yt;at?yt=at:yt=gt?"th":"td";let bt=lt;yt==="td"?bt=void 0:!bt&>&&(bt="col");const wt=ht||mt&&mt.variant,xt=_extends$u({},rt,{align:it,component:yt,padding:st||(pt&&pt.padding?pt.padding:"normal"),size:ct||(pt&&pt.size?pt.size:"medium"),sortDirection:ut,stickyHeader:wt==="head"&&pt&&pt.stickyHeader,variant:wt}),kt=useUtilityClasses$l(xt);let St=null;return ut&&(St=ut==="asc"?"ascending":"descending"),jsxRuntimeExports.jsx(TableCellRoot,_extends$u({as:yt,ref:nt,className:clsx$2(kt.root,ot),"aria-sort":St,scope:bt,ownerState:xt},dt))}),TableCell$1=TableCell;function getTableHeadUtilityClass(tt){return generateUtilityClass("MuiTableHead",tt)}generateUtilityClasses("MuiTableHead",["root"]);const _excluded$M=["className","component"],useUtilityClasses$k=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableHeadUtilityClass,et)},TableHeadRoot=styled$1("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-header-group"}),tablelvl2={variant:"head"},defaultComponent$1="thead",TableHead=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableHead"}),{className:it,component:ot=defaultComponent$1}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$M),st=_extends$u({},rt,{component:ot}),lt=useUtilityClasses$k(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2,children:jsxRuntimeExports.jsx(TableHeadRoot,_extends$u({as:ot,className:clsx$2(lt.root,it),ref:nt,role:ot===defaultComponent$1?null:"rowgroup",ownerState:st},at))})}),TableHead$1=TableHead,KeyboardArrowLeft=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),KeyboardArrowRight=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function getTableRowUtilityClass(tt){return generateUtilityClass("MuiTableRow",tt)}const tableRowClasses=generateUtilityClasses("MuiTableRow",["root","selected","hover","head","footer"]),tableRowClasses$1=tableRowClasses,_excluded$L=["className","component","hover","selected"],useUtilityClasses$j=tt=>{const{classes:et,selected:nt,hover:rt,head:it,footer:ot}=tt;return composeClasses({root:["root",nt&&"selected",rt&&"hover",it&&"head",ot&&"footer"]},getTableRowUtilityClass,et)},TableRowRoot=styled$1("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.head&&et.head,nt.footer&&et.footer]}})(({theme:tt})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${tableRowClasses$1.hover}:hover`]:{backgroundColor:(tt.vars||tt).palette.action.hover},[`&.${tableRowClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity)}}})),defaultComponent="tr",TableRow=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableRow"}),{className:it,component:ot=defaultComponent,hover:at=!1,selected:st=!1}=rt,lt=_objectWithoutPropertiesLoose$k(rt,_excluded$L),ct=reactExports.useContext(Tablelvl2Context$1),ut=_extends$u({},rt,{component:ot,hover:at,selected:st,head:ct&&ct.variant==="head",footer:ct&&ct.variant==="footer"}),ht=useUtilityClasses$j(ut);return jsxRuntimeExports.jsx(TableRowRoot,_extends$u({as:ot,ref:nt,className:clsx$2(ht.root,it),role:ot===defaultComponent?null:"row",ownerState:ut},lt))}),TableRow$1=TableRow;function easeInOutSin(tt){return(1+Math.sin(Math.PI*tt-Math.PI/2))/2}function animate(tt,et,nt,rt={},it=()=>{}){const{ease:ot=easeInOutSin,duration:at=300}=rt;let st=null;const lt=et[tt];let ct=!1;const ut=()=>{ct=!0},ht=dt=>{if(ct){it(new Error("Animation cancelled"));return}st===null&&(st=dt);const pt=Math.min(1,(dt-st)/at);if(et[tt]=ot(pt)*(nt-lt)+lt,pt>=1){requestAnimationFrame(()=>{it(null)});return}requestAnimationFrame(ht)};return lt===nt?(it(new Error("Element already at target position")),ut):(requestAnimationFrame(ht),ut)}const _excluded$K=["onChange"],styles$1={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ScrollbarSize(tt){const{onChange:et}=tt,nt=_objectWithoutPropertiesLoose$k(tt,_excluded$K),rt=reactExports.useRef(),it=reactExports.useRef(null),ot=()=>{rt.current=it.current.offsetHeight-it.current.clientHeight};return useEnhancedEffect$1(()=>{const at=debounce$4(()=>{const lt=rt.current;ot(),lt!==rt.current&&et(rt.current)}),st=ownerWindow(it.current);return st.addEventListener("resize",at),()=>{at.clear(),st.removeEventListener("resize",at)}},[et]),reactExports.useEffect(()=>{ot(),et(rt.current)},[et]),jsxRuntimeExports.jsx("div",_extends$u({style:styles$1,ref:it},nt))}function getTabScrollButtonUtilityClass(tt){return generateUtilityClass("MuiTabScrollButton",tt)}const tabScrollButtonClasses=generateUtilityClasses("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),tabScrollButtonClasses$1=tabScrollButtonClasses,_excluded$J=["className","slots","slotProps","direction","orientation","disabled"],useUtilityClasses$i=tt=>{const{classes:et,orientation:nt,disabled:rt}=tt;return composeClasses({root:["root",nt,rt&&"disabled"]},getTabScrollButtonUtilityClass,et)},TabScrollButtonRoot=styled$1(ButtonBase$1,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.orientation&&et[nt.orientation]]}})(({ownerState:tt})=>_extends$u({width:40,flexShrink:0,opacity:.8,[`&.${tabScrollButtonClasses$1.disabled}`]:{opacity:0}},tt.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${tt.isRtl?-90:90}deg)`}})),TabScrollButton=reactExports.forwardRef(function(et,nt){var rt,it;const ot=useThemeProps({props:et,name:"MuiTabScrollButton"}),{className:at,slots:st={},slotProps:lt={},direction:ct}=ot,ut=_objectWithoutPropertiesLoose$k(ot,_excluded$J),dt=useTheme().direction==="rtl",pt=_extends$u({isRtl:dt},ot),mt=useUtilityClasses$i(pt),gt=(rt=st.StartScrollButtonIcon)!=null?rt:KeyboardArrowLeft,yt=(it=st.EndScrollButtonIcon)!=null?it:KeyboardArrowRight,bt=useSlotProps({elementType:gt,externalSlotProps:lt.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt}),wt=useSlotProps({elementType:yt,externalSlotProps:lt.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt});return jsxRuntimeExports.jsx(TabScrollButtonRoot,_extends$u({component:"div",className:clsx$2(mt.root,at),ref:nt,role:null,ownerState:pt,tabIndex:null},ut,{children:ct==="left"?jsxRuntimeExports.jsx(gt,_extends$u({},bt)):jsxRuntimeExports.jsx(yt,_extends$u({},wt))}))}),TabScrollButton$1=TabScrollButton;function getTabsUtilityClass(tt){return generateUtilityClass("MuiTabs",tt)}const tabsClasses=generateUtilityClasses("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),tabsClasses$1=tabsClasses,_excluded$I=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],nextItem=(tt,et)=>tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:tt.firstChild,previousItem=(tt,et)=>tt===et?tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:tt.lastChild,moveFocus=(tt,et,nt)=>{let rt=!1,it=nt(tt,et);for(;it;){if(it===tt.firstChild){if(rt)return;rt=!0}const ot=it.disabled||it.getAttribute("aria-disabled")==="true";if(!it.hasAttribute("tabindex")||ot)it=nt(tt,it);else{it.focus();return}}},useUtilityClasses$h=tt=>{const{vertical:et,fixed:nt,hideScrollbar:rt,scrollableX:it,scrollableY:ot,centered:at,scrollButtonsHideMobile:st,classes:lt}=tt;return composeClasses({root:["root",et&&"vertical"],scroller:["scroller",nt&&"fixed",rt&&"hideScrollbar",it&&"scrollableX",ot&&"scrollableY"],flexContainer:["flexContainer",et&&"flexContainerVertical",at&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",st&&"scrollButtonsHideMobile"],scrollableX:[it&&"scrollableX"],hideScrollbar:[rt&&"hideScrollbar"]},getTabsUtilityClass,lt)},TabsRoot=styled$1("div",{name:"MuiTabs",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${tabsClasses$1.scrollButtons}`]:et.scrollButtons},{[`& .${tabsClasses$1.scrollButtons}`]:nt.scrollButtonsHideMobile&&et.scrollButtonsHideMobile},et.root,nt.vertical&&et.vertical]}})(({ownerState:tt,theme:et})=>_extends$u({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},tt.vertical&&{flexDirection:"column"},tt.scrollButtonsHideMobile&&{[`& .${tabsClasses$1.scrollButtons}`]:{[et.breakpoints.down("sm")]:{display:"none"}}})),TabsScroller=styled$1("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.scroller,nt.fixed&&et.fixed,nt.hideScrollbar&&et.hideScrollbar,nt.scrollableX&&et.scrollableX,nt.scrollableY&&et.scrollableY]}})(({ownerState:tt})=>_extends$u({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},tt.fixed&&{overflowX:"hidden",width:"100%"},tt.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},tt.scrollableX&&{overflowX:"auto",overflowY:"hidden"},tt.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),FlexContainer=styled$1("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.flexContainer,nt.vertical&&et.flexContainerVertical,nt.centered&&et.centered]}})(({ownerState:tt})=>_extends$u({display:"flex"},tt.vertical&&{flexDirection:"column"},tt.centered&&{justifyContent:"center"})),TabsIndicator=styled$1("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(tt,et)=>et.indicator})(({ownerState:tt,theme:et})=>_extends$u({position:"absolute",height:2,bottom:0,width:"100%",transition:et.transitions.create()},tt.indicatorColor==="primary"&&{backgroundColor:(et.vars||et).palette.primary.main},tt.indicatorColor==="secondary"&&{backgroundColor:(et.vars||et).palette.secondary.main},tt.vertical&&{height:"100%",width:2,right:0})),TabsScrollbarSize=styled$1(ScrollbarSize)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),defaultIndicatorStyle={},Tabs=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTabs"}),it=useTheme(),ot=it.direction==="rtl",{"aria-label":at,"aria-labelledby":st,action:lt,centered:ct=!1,children:ut,className:ht,component:dt="div",allowScrollButtonsMobile:pt=!1,indicatorColor:mt="primary",onChange:gt,orientation:yt="horizontal",ScrollButtonComponent:bt=TabScrollButton$1,scrollButtons:wt="auto",selectionFollowsFocus:xt,slots:kt={},slotProps:St={},TabIndicatorProps:Tt={},TabScrollButtonProps:At={},textColor:Et="primary",value:Ct,variant:Lt="standard",visibleScrollbar:jt=!1}=rt,Rt=_objectWithoutPropertiesLoose$k(rt,_excluded$I),$t=Lt==="scrollable",vt=yt==="vertical",It=vt?"scrollTop":"scrollLeft",Ot=vt?"top":"left",Wt=vt?"bottom":"right",zt=vt?"clientHeight":"clientWidth",Ft=vt?"height":"width",Nt=_extends$u({},rt,{component:dt,allowScrollButtonsMobile:pt,indicatorColor:mt,orientation:yt,vertical:vt,scrollButtons:wt,textColor:Et,variant:Lt,visibleScrollbar:jt,fixed:!$t,hideScrollbar:$t&&!jt,scrollableX:$t&&!vt,scrollableY:$t&&vt,centered:ct&&!$t,scrollButtonsHideMobile:!pt}),Ut=useUtilityClasses$h(Nt),Pt=useSlotProps({elementType:kt.StartScrollButtonIcon,externalSlotProps:St.startScrollButtonIcon,ownerState:Nt}),Ht=useSlotProps({elementType:kt.EndScrollButtonIcon,externalSlotProps:St.endScrollButtonIcon,ownerState:Nt}),[Qt,an]=reactExports.useState(!1),[Yt,nn]=reactExports.useState(defaultIndicatorStyle),[tn,dn]=reactExports.useState(!1),[wn,rn]=reactExports.useState(!1),[Jt,vn]=reactExports.useState(!1),[Cn,$n]=reactExports.useState({overflow:"hidden",scrollbarWidth:0}),Nn=new Map,En=reactExports.useRef(null),sn=reactExports.useRef(null),pn=()=>{const Vn=En.current;let Gn;if(Vn){const Zn=Vn.getBoundingClientRect();Gn={clientWidth:Vn.clientWidth,scrollLeft:Vn.scrollLeft,scrollTop:Vn.scrollTop,scrollLeftNormalized:getNormalizedScrollLeft(Vn,it.direction),scrollWidth:Vn.scrollWidth,top:Zn.top,bottom:Zn.bottom,left:Zn.left,right:Zn.right}}let zn;if(Vn&&Ct!==!1){const Zn=sn.current.children;if(Zn.length>0){const Wn=Zn[Nn.get(Ct)];zn=Wn?Wn.getBoundingClientRect():null}}return{tabsMeta:Gn,tabMeta:zn}},Tn=useEventCallback(()=>{const{tabsMeta:Vn,tabMeta:Gn}=pn();let zn=0,Zn;if(vt)Zn="top",Gn&&Vn&&(zn=Gn.top-Vn.top+Vn.scrollTop);else if(Zn=ot?"right":"left",Gn&&Vn){const fr=ot?Vn.scrollLeftNormalized+Vn.clientWidth-Vn.scrollWidth:Vn.scrollLeft;zn=(ot?-1:1)*(Gn[Zn]-Vn[Zn]+fr)}const Wn={[Zn]:zn,[Ft]:Gn?Gn[Ft]:0};if(isNaN(Yt[Zn])||isNaN(Yt[Ft]))nn(Wn);else{const fr=Math.abs(Yt[Zn]-Wn[Zn]),ur=Math.abs(Yt[Ft]-Wn[Ft]);(fr>=1||ur>=1)&&nn(Wn)}}),In=(Vn,{animation:Gn=!0}={})=>{Gn?animate(It,En.current,Vn,{duration:it.transitions.duration.standard}):En.current[It]=Vn},yn=Vn=>{let Gn=En.current[It];vt?Gn+=Vn:(Gn+=Vn*(ot?-1:1),Gn*=ot&&detectScrollType()==="reverse"?-1:1),In(Gn)},hn=()=>{const Vn=En.current[zt];let Gn=0;const zn=Array.from(sn.current.children);for(let Zn=0;ZnVn){Zn===0&&(Gn=Vn);break}Gn+=Wn[zt]}return Gn},fn=()=>{yn(-1*hn())},xn=()=>{yn(hn())},jn=reactExports.useCallback(Vn=>{$n({overflow:null,scrollbarWidth:Vn})},[]),cn=()=>{const Vn={};Vn.scrollbarSizeListener=$t?jsxRuntimeExports.jsx(TabsScrollbarSize,{onChange:jn,className:clsx$2(Ut.scrollableX,Ut.hideScrollbar)}):null;const zn=$t&&(wt==="auto"&&(tn||wn)||wt===!0);return Vn.scrollButtonStart=zn?jsxRuntimeExports.jsx(bt,_extends$u({slots:{StartScrollButtonIcon:kt.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Pt},orientation:yt,direction:ot?"right":"left",onClick:fn,disabled:!tn},At,{className:clsx$2(Ut.scrollButtons,At.className)})):null,Vn.scrollButtonEnd=zn?jsxRuntimeExports.jsx(bt,_extends$u({slots:{EndScrollButtonIcon:kt.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:yt,direction:ot?"left":"right",onClick:xn,disabled:!wn},At,{className:clsx$2(Ut.scrollButtons,At.className)})):null,Vn},Xt=useEventCallback(Vn=>{const{tabsMeta:Gn,tabMeta:zn}=pn();if(!(!zn||!Gn)){if(zn[Ot]Gn[Wt]){const Zn=Gn[It]+(zn[Wt]-Gn[Wt]);In(Zn,{animation:Vn})}}}),Kt=useEventCallback(()=>{$t&&wt!==!1&&vn(!Jt)});reactExports.useEffect(()=>{const Vn=debounce$4(()=>{En.current&&Tn()});let Gn;const zn=fr=>{fr.forEach(ur=>{ur.removedNodes.forEach(wr=>{var Xr;(Xr=Gn)==null||Xr.unobserve(wr)}),ur.addedNodes.forEach(wr=>{var Xr;(Xr=Gn)==null||Xr.observe(wr)})}),Vn(),Kt()},Zn=ownerWindow(En.current);Zn.addEventListener("resize",Vn);let Wn;return typeof ResizeObserver<"u"&&(Gn=new ResizeObserver(Vn),Array.from(sn.current.children).forEach(fr=>{Gn.observe(fr)})),typeof MutationObserver<"u"&&(Wn=new MutationObserver(zn),Wn.observe(sn.current,{childList:!0})),()=>{var fr,ur;Vn.clear(),Zn.removeEventListener("resize",Vn),(fr=Wn)==null||fr.disconnect(),(ur=Gn)==null||ur.disconnect()}},[Tn,Kt]),reactExports.useEffect(()=>{const Vn=Array.from(sn.current.children),Gn=Vn.length;if(typeof IntersectionObserver<"u"&&Gn>0&&$t&&wt!==!1){const zn=Vn[0],Zn=Vn[Gn-1],Wn={root:En.current,threshold:.99},fr=Er=>{dn(!Er[0].isIntersecting)},ur=new IntersectionObserver(fr,Wn);ur.observe(zn);const wr=Er=>{rn(!Er[0].isIntersecting)},Xr=new IntersectionObserver(wr,Wn);return Xr.observe(Zn),()=>{ur.disconnect(),Xr.disconnect()}}},[$t,wt,Jt,ut==null?void 0:ut.length]),reactExports.useEffect(()=>{an(!0)},[]),reactExports.useEffect(()=>{Tn()}),reactExports.useEffect(()=>{Xt(defaultIndicatorStyle!==Yt)},[Xt,Yt]),reactExports.useImperativeHandle(lt,()=>({updateIndicator:Tn,updateScrollButtons:Kt}),[Tn,Kt]);const kn=jsxRuntimeExports.jsx(TabsIndicator,_extends$u({},Tt,{className:clsx$2(Ut.indicator,Tt.className),ownerState:Nt,style:_extends$u({},Yt,Tt.style)}));let Mn=0;const On=reactExports.Children.map(ut,Vn=>{if(!reactExports.isValidElement(Vn))return null;const Gn=Vn.props.value===void 0?Mn:Vn.props.value;Nn.set(Gn,Mn);const zn=Gn===Ct;return Mn+=1,reactExports.cloneElement(Vn,_extends$u({fullWidth:Lt==="fullWidth",indicator:zn&&!Qt&&kn,selected:zn,selectionFollowsFocus:xt,onChange:gt,textColor:Et,value:Gn},Mn===1&&Ct===!1&&!Vn.props.tabIndex?{tabIndex:0}:{}))}),Bn=Vn=>{const Gn=sn.current,zn=ownerDocument(Gn).activeElement;if(zn.getAttribute("role")!=="tab")return;let Wn=yt==="horizontal"?"ArrowLeft":"ArrowUp",fr=yt==="horizontal"?"ArrowRight":"ArrowDown";switch(yt==="horizontal"&&ot&&(Wn="ArrowRight",fr="ArrowLeft"),Vn.key){case Wn:Vn.preventDefault(),moveFocus(Gn,zn,previousItem);break;case fr:Vn.preventDefault(),moveFocus(Gn,zn,nextItem);break;case"Home":Vn.preventDefault(),moveFocus(Gn,null,nextItem);break;case"End":Vn.preventDefault(),moveFocus(Gn,null,previousItem);break}},Xn=cn();return jsxRuntimeExports.jsxs(TabsRoot,_extends$u({className:clsx$2(Ut.root,ht),ownerState:Nt,ref:nt,as:dt},Rt,{children:[Xn.scrollButtonStart,Xn.scrollbarSizeListener,jsxRuntimeExports.jsxs(TabsScroller,{className:Ut.scroller,ownerState:Nt,style:{overflow:Cn.overflow,[vt?`margin${ot?"Left":"Right"}`:"marginBottom"]:jt?void 0:-Cn.scrollbarWidth},ref:En,children:[jsxRuntimeExports.jsx(FlexContainer,{"aria-label":at,"aria-labelledby":st,"aria-orientation":yt==="vertical"?"vertical":null,className:Ut.flexContainer,ownerState:Nt,onKeyDown:Bn,ref:sn,role:"tablist",children:On}),Qt&&kn]}),Xn.scrollButtonEnd]}))}),Tabs$1=Tabs;function getTextFieldUtilityClass(tt){return generateUtilityClass("MuiTextField",tt)}generateUtilityClasses("MuiTextField",["root"]);const _excluded$H=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],variantComponent={standard:Input$2,filled:FilledInput$1,outlined:OutlinedInput$1},useUtilityClasses$g=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTextFieldUtilityClass,et)},TextFieldRoot=styled$1(FormControl$1,{name:"MuiTextField",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),TextField=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTextField"}),{autoComplete:it,autoFocus:ot=!1,children:at,className:st,color:lt="primary",defaultValue:ct,disabled:ut=!1,error:ht=!1,FormHelperTextProps:dt,fullWidth:pt=!1,helperText:mt,id:gt,InputLabelProps:yt,inputProps:bt,InputProps:wt,inputRef:xt,label:kt,maxRows:St,minRows:Tt,multiline:At=!1,name:Et,onBlur:Ct,onChange:Lt,onFocus:jt,placeholder:Rt,required:$t=!1,rows:vt,select:It=!1,SelectProps:Ot,type:Wt,value:zt,variant:Ft="outlined"}=rt,Nt=_objectWithoutPropertiesLoose$k(rt,_excluded$H),Ut=_extends$u({},rt,{autoFocus:ot,color:lt,disabled:ut,error:ht,fullWidth:pt,multiline:At,required:$t,select:It,variant:Ft}),Pt=useUtilityClasses$g(Ut),Ht={};Ft==="outlined"&&(yt&&typeof yt.shrink<"u"&&(Ht.notched=yt.shrink),Ht.label=kt),It&&((!Ot||!Ot.native)&&(Ht.id=void 0),Ht["aria-describedby"]=void 0);const Qt=useId(gt),an=mt&&Qt?`${Qt}-helper-text`:void 0,Yt=kt&&Qt?`${Qt}-label`:void 0,nn=variantComponent[Ft],tn=jsxRuntimeExports.jsx(nn,_extends$u({"aria-describedby":an,autoComplete:it,autoFocus:ot,defaultValue:ct,fullWidth:pt,multiline:At,name:Et,rows:vt,maxRows:St,minRows:Tt,type:Wt,value:zt,id:Qt,inputRef:xt,onBlur:Ct,onChange:Lt,onFocus:jt,placeholder:Rt,inputProps:bt},Ht,wt));return jsxRuntimeExports.jsxs(TextFieldRoot,_extends$u({className:clsx$2(Pt.root,st),disabled:ut,error:ht,fullWidth:pt,ref:nt,required:$t,color:lt,variant:Ft,ownerState:Ut},Nt,{children:[kt!=null&&kt!==""&&jsxRuntimeExports.jsx(InputLabel$1,_extends$u({htmlFor:Qt,id:Yt},yt,{children:kt})),It?jsxRuntimeExports.jsx(Select$1,_extends$u({"aria-describedby":an,id:Qt,labelId:Yt,value:zt,input:tn},Ot,{children:at})):tn,mt&&jsxRuntimeExports.jsx(FormHelperText$1,_extends$u({id:an},dt,{children:mt}))]}))}),MuiTextField=TextField,CameraCenterIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 17",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"center",children:[jsxRuntimeExports.jsx("path",{id:"Vector 121",d:"M9 4L9 1",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("path",{id:"Vector 123",d:"M14 9H17",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("path",{id:"Vector 122",d:"M9 16L9 14",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("path",{id:"Vector 124",d:"M1 9L4 9",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("circle",{id:"Ellipse 2",cx:"9.00001",cy:"9.00001",r:"5.02857",stroke:"white"})]})}),cssWithMediaQuery=tt=>(et,...nt)=>{const rt=Ae(et,...nt);return rt.join("").trim()?Ae` + `),waveKeyframe,(et.vars||et).palette.action.hover)),Skeleton=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiSkeleton"}),{animation:it="pulse",className:ot,component:at="span",height:st,style:lt,variant:ct="text",width:ut}=rt,ht=_objectWithoutPropertiesLoose$k(rt,_excluded$S),dt=_extends$u({},rt,{animation:it,component:at,variant:ct,hasChildren:!!ht.children}),pt=useUtilityClasses$q(dt);return jsxRuntimeExports.jsx(SkeletonRoot,_extends$u({as:at,ref:nt,className:clsx$2(pt.root,ot),ownerState:dt},ht,{style:_extends$u({width:ut,height:st},lt)}))}),Skeleton$1=Skeleton,shouldSpreadAdditionalProps=tt=>!tt||!isHostComponent(tt),shouldSpreadAdditionalProps$1=shouldSpreadAdditionalProps;function getSliderUtilityClass(tt){return generateUtilityClass("MuiSlider",tt)}const sliderClasses=generateUtilityClasses("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),sliderClasses$1=sliderClasses,useValueLabelClasses=tt=>{const{open:et}=tt;return{offset:clsx$2(et&&sliderClasses$1.valueLabelOpen),circle:sliderClasses$1.valueLabelCircle,label:sliderClasses$1.valueLabelLabel}};function SliderValueLabel$1(tt){const{children:et,className:nt,value:rt}=tt,it=useValueLabelClasses(tt);return et?reactExports.cloneElement(et,{className:clsx$2(et.props.className)},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[et.props.children,jsxRuntimeExports.jsx("span",{className:clsx$2(it.offset,nt),"aria-hidden":!0,children:jsxRuntimeExports.jsx("span",{className:it.circle,children:jsxRuntimeExports.jsx("span",{className:it.label,children:rt})})})]})):null}const _excluded$R=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function Identity(tt){return tt}const SliderRoot=styled$1("span",{name:"MuiSlider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`color${capitalize(nt.color)}`],nt.size!=="medium"&&et[`size${capitalize(nt.size)}`],nt.marked&&et.marked,nt.orientation==="vertical"&&et.vertical,nt.track==="inverted"&&et.trackInverted,nt.track===!1&&et.trackFalse]}})(({theme:tt,ownerState:et})=>_extends$u({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(tt.vars||tt).palette[et.color].main,WebkitTapHighlightColor:"transparent"},et.orientation==="horizontal"&&_extends$u({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},et.size==="small"&&{height:2},et.marked&&{marginBottom:20}),et.orientation==="vertical"&&_extends$u({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},et.size==="small"&&{width:2},et.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${sliderClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default",color:(tt.vars||tt).palette.grey[400]},[`&.${sliderClasses$1.dragging}`]:{[`& .${sliderClasses$1.thumb}, & .${sliderClasses$1.track}`]:{transition:"none"}}})),SliderRail=styled$1("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(tt,et)=>et.rail})(({ownerState:tt})=>_extends$u({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},tt.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},tt.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},tt.track==="inverted"&&{opacity:1})),SliderTrack=styled$1("span",{name:"MuiSlider",slot:"Track",overridesResolver:(tt,et)=>et.track})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?lighten(tt.palette[et.color].main,.62):darken(tt.palette[et.color].main,.5);return _extends$u({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:tt.transitions.create(["left","width","bottom","height"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{border:"none"},et.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},et.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},et.track===!1&&{display:"none"},et.track==="inverted"&&{backgroundColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt,borderColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt})}),SliderThumb=styled$1("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.thumb,et[`thumbColor${capitalize(nt.color)}`],nt.size!=="medium"&&et[`thumbSize${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$u({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:tt.transitions.create(["box-shadow","left","bottom"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{width:12,height:12},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":_extends$u({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(tt.vars||tt).shadows[2]},et.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${sliderClasses$1.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${sliderClasses$1.active}`]:{boxShadow:`0px 0px 0px 14px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`},[`&.${sliderClasses$1.disabled}`]:{"&:hover":{boxShadow:"none"}}})),SliderValueLabel=styled$1(SliderValueLabel$1,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(tt,et)=>et.valueLabel})(({theme:tt,ownerState:et})=>_extends$u({[`&.${sliderClasses$1.valueLabelOpen}`]:{transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},tt.typography.body2,{fontWeight:500,transition:tt.transitions.create(["transform"],{duration:tt.transitions.duration.shortest}),transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(tt.vars||tt).palette.grey[600],borderRadius:2,color:(tt.vars||tt).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},et.orientation==="horizontal"&&{top:"-10px",transformOrigin:"bottom center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"}},et.orientation==="vertical"&&{right:et.size==="small"?"20px":"30px",top:"50%",transformOrigin:"right center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"}},et.size==="small"&&{fontSize:tt.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),SliderMark=styled$1("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markActive",overridesResolver:(tt,et)=>{const{markActive:nt}=tt;return[et.mark,nt&&et.markActive]}})(({theme:tt,ownerState:et,markActive:nt})=>_extends$u({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},nt&&{backgroundColor:(tt.vars||tt).palette.background.paper,opacity:.8})),SliderMarkLabel=styled$1("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markLabelActive",overridesResolver:(tt,et)=>et.markLabel})(({theme:tt,ownerState:et,markLabelActive:nt})=>_extends$u({},tt.typography.body2,{color:(tt.vars||tt).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},et.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},et.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},nt&&{color:(tt.vars||tt).palette.text.primary})),useUtilityClasses$p=tt=>{const{disabled:et,dragging:nt,marked:rt,orientation:it,track:ot,classes:at,color:st,size:lt}=tt,ct={root:["root",et&&"disabled",nt&&"dragging",rt&&"marked",it==="vertical"&&"vertical",ot==="inverted"&&"trackInverted",ot===!1&&"trackFalse",st&&`color${capitalize(st)}`,lt&&`size${capitalize(lt)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",et&&"disabled",lt&&`thumbSize${capitalize(lt)}`,st&&`thumbColor${capitalize(st)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return composeClasses(ct,getSliderUtilityClass,at)},Forward=({children:tt})=>tt,Slider=reactExports.forwardRef(function(et,nt){var rt,it,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt,yt,bt,wt,xt,kt,St,Tt,At,Et,Ct,Lt;const jt=useThemeProps({props:et,name:"MuiSlider"}),$t=useTheme().direction==="rtl",{"aria-label":vt,"aria-valuetext":It,"aria-labelledby":Ot,component:Wt="span",components:zt={},componentsProps:Ft={},color:Nt="primary",classes:Ut,className:Pt,disableSwap:Ht=!1,disabled:Qt=!1,getAriaLabel:an,getAriaValueText:Yt,marks:nn=!1,max:tn=100,min:dn=0,orientation:wn="horizontal",size:rn="medium",step:Zt=1,scale:vn=Identity,slotProps:Cn,slots:$n,track:Nn="normal",valueLabelDisplay:En="off",valueLabelFormat:sn=Identity}=jt,pn=_objectWithoutPropertiesLoose$k(jt,_excluded$R),Tn=_extends$u({},jt,{isRtl:$t,max:tn,min:dn,classes:Ut,disabled:Qt,disableSwap:Ht,orientation:wn,marks:nn,color:Nt,size:rn,step:Zt,scale:vn,track:Nn,valueLabelDisplay:En,valueLabelFormat:sn}),{axisProps:In,getRootProps:yn,getHiddenInputProps:hn,getThumbProps:fn,open:xn,active:jn,axis:cn,focusedThumbIndex:Xt,range:Kt,dragging:kn,marks:Mn,values:On,trackOffset:Bn,trackLeap:Xn,getThumbStyle:Vn}=useSlider(_extends$u({},Tn,{rootRef:nt}));Tn.marked=Mn.length>0&&Mn.some(tr=>tr.label),Tn.dragging=kn,Tn.focusedThumbIndex=Xt;const Gn=useUtilityClasses$p(Tn),zn=(rt=(it=$n==null?void 0:$n.root)!=null?it:zt.Root)!=null?rt:SliderRoot,Jn=(ot=(at=$n==null?void 0:$n.rail)!=null?at:zt.Rail)!=null?ot:SliderRail,Wn=(st=(lt=$n==null?void 0:$n.track)!=null?lt:zt.Track)!=null?st:SliderTrack,fr=(ct=(ut=$n==null?void 0:$n.thumb)!=null?ut:zt.Thumb)!=null?ct:SliderThumb,ur=(ht=(dt=$n==null?void 0:$n.valueLabel)!=null?dt:zt.ValueLabel)!=null?ht:SliderValueLabel,wr=(pt=(mt=$n==null?void 0:$n.mark)!=null?mt:zt.Mark)!=null?pt:SliderMark,Xr=(gt=(yt=$n==null?void 0:$n.markLabel)!=null?yt:zt.MarkLabel)!=null?gt:SliderMarkLabel,Er=(bt=(wt=$n==null?void 0:$n.input)!=null?wt:zt.Input)!=null?bt:"input",Ir=(xt=Cn==null?void 0:Cn.root)!=null?xt:Ft.root,Gr=(kt=Cn==null?void 0:Cn.rail)!=null?kt:Ft.rail,Or=(St=Cn==null?void 0:Cn.track)!=null?St:Ft.track,Lr=(Tt=Cn==null?void 0:Cn.thumb)!=null?Tt:Ft.thumb,oo=(At=Cn==null?void 0:Cn.valueLabel)!=null?At:Ft.valueLabel,qr=(Et=Cn==null?void 0:Cn.mark)!=null?Et:Ft.mark,jr=(Ct=Cn==null?void 0:Cn.markLabel)!=null?Ct:Ft.markLabel,mo=(Lt=Cn==null?void 0:Cn.input)!=null?Lt:Ft.input,_n=useSlotProps({elementType:zn,getSlotProps:yn,externalSlotProps:Ir,externalForwardedProps:pn,additionalProps:_extends$u({},shouldSpreadAdditionalProps$1(zn)&&{as:Wt}),ownerState:_extends$u({},Tn,Ir==null?void 0:Ir.ownerState),className:[Gn.root,Pt]}),Pn=useSlotProps({elementType:Jn,externalSlotProps:Gr,ownerState:Tn,className:Gn.rail}),un=useSlotProps({elementType:Wn,externalSlotProps:Or,additionalProps:{style:_extends$u({},In[cn].offset(Bn),In[cn].leap(Xn))},ownerState:_extends$u({},Tn,Or==null?void 0:Or.ownerState),className:Gn.track}),Jt=useSlotProps({elementType:fr,getSlotProps:fn,externalSlotProps:Lr,ownerState:_extends$u({},Tn,Lr==null?void 0:Lr.ownerState),className:Gn.thumb}),Sn=useSlotProps({elementType:ur,externalSlotProps:oo,ownerState:_extends$u({},Tn,oo==null?void 0:oo.ownerState),className:Gn.valueLabel}),Dn=useSlotProps({elementType:wr,externalSlotProps:qr,ownerState:Tn,className:Gn.mark}),Fn=useSlotProps({elementType:Xr,externalSlotProps:jr,ownerState:Tn,className:Gn.markLabel}),Yn=useSlotProps({elementType:Er,getSlotProps:hn,externalSlotProps:mo,ownerState:Tn});return jsxRuntimeExports.jsxs(zn,_extends$u({},_n,{children:[jsxRuntimeExports.jsx(Jn,_extends$u({},Pn)),jsxRuntimeExports.jsx(Wn,_extends$u({},un)),Mn.filter(tr=>tr.value>=dn&&tr.value<=tn).map((tr,ar)=>{const lr=valueToPercent(tr.value,dn,tn),Vr=In[cn].offset(lr);let vr;return Nn===!1?vr=On.indexOf(tr.value)!==-1:vr=Nn==="normal"&&(Kt?tr.value>=On[0]&&tr.value<=On[On.length-1]:tr.value<=On[0])||Nn==="inverted"&&(Kt?tr.value<=On[0]||tr.value>=On[On.length-1]:tr.value>=On[0]),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(wr,_extends$u({"data-index":ar},Dn,!isHostComponent(wr)&&{markActive:vr},{style:_extends$u({},Vr,Dn.style),className:clsx$2(Dn.className,vr&&Gn.markActive)})),tr.label!=null?jsxRuntimeExports.jsx(Xr,_extends$u({"aria-hidden":!0,"data-index":ar},Fn,!isHostComponent(Xr)&&{markLabelActive:vr},{style:_extends$u({},Vr,Fn.style),className:clsx$2(Gn.markLabel,Fn.className,vr&&Gn.markLabelActive),children:tr.label})):null]},ar)}),On.map((tr,ar)=>{const lr=valueToPercent(tr,dn,tn),Vr=In[cn].offset(lr),vr=En==="off"?Forward:ur;return jsxRuntimeExports.jsx(vr,_extends$u({},!isHostComponent(vr)&&{valueLabelFormat:sn,valueLabelDisplay:En,value:typeof sn=="function"?sn(vn(tr),ar):sn,index:ar,open:xn===ar||jn===ar||En==="on",disabled:Qt},Sn,{children:jsxRuntimeExports.jsx(fr,_extends$u({"data-index":ar},Jt,{className:clsx$2(Gn.thumb,Jt.className,jn===ar&&Gn.active,Xt===ar&&Gn.focusVisible),style:_extends$u({},Vr,Vn(ar),Jt.style),children:jsxRuntimeExports.jsx(Er,_extends$u({"data-index":ar,"aria-label":an?an(ar):vt,"aria-valuenow":vn(tr),"aria-labelledby":Ot,"aria-valuetext":Yt?Yt(vn(tr),ar):It,value:On[ar]},Yn))}))}),ar)})]}))}),Slider$1=Slider;function getTabUtilityClass(tt){return generateUtilityClass("MuiTab",tt)}const tabClasses=generateUtilityClasses("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),tabClasses$1=tabClasses,_excluded$Q=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],useUtilityClasses$o=tt=>{const{classes:et,textColor:nt,fullWidth:rt,wrapped:it,icon:ot,label:at,selected:st,disabled:lt}=tt,ct={root:["root",ot&&at&&"labelIcon",`textColor${capitalize(nt)}`,rt&&"fullWidth",it&&"wrapped",st&&"selected",lt&&"disabled"],iconWrapper:["iconWrapper"]};return composeClasses(ct,getTabUtilityClass,et)},TabRoot=styled$1(ButtonBase$1,{name:"MuiTab",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.label&&nt.icon&&et.labelIcon,et[`textColor${capitalize(nt.textColor)}`],nt.fullWidth&&et.fullWidth,nt.wrapped&&et.wrapped]}})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},et.label&&{flexDirection:et.iconPosition==="top"||et.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},et.icon&&et.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${tabClasses$1.iconWrapper}`]:_extends$u({},et.iconPosition==="top"&&{marginBottom:6},et.iconPosition==="bottom"&&{marginTop:6},et.iconPosition==="start"&&{marginRight:tt.spacing(1)},et.iconPosition==="end"&&{marginLeft:tt.spacing(1)})},et.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${tabClasses$1.selected}`]:{opacity:1},[`&.${tabClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity}},et.textColor==="primary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.primary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.textColor==="secondary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.secondary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},et.wrapped&&{fontSize:tt.typography.pxToRem(12)})),Tab$1=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTab"}),{className:it,disabled:ot=!1,disableFocusRipple:at=!1,fullWidth:st,icon:lt,iconPosition:ct="top",indicator:ut,label:ht,onChange:dt,onClick:pt,onFocus:mt,selected:gt,selectionFollowsFocus:yt,textColor:bt="inherit",value:wt,wrapped:xt=!1}=rt,kt=_objectWithoutPropertiesLoose$k(rt,_excluded$Q),St=_extends$u({},rt,{disabled:ot,disableFocusRipple:at,selected:gt,icon:!!lt,iconPosition:ct,label:!!ht,fullWidth:st,textColor:bt,wrapped:xt}),Tt=useUtilityClasses$o(St),At=lt&&ht&&reactExports.isValidElement(lt)?reactExports.cloneElement(lt,{className:clsx$2(Tt.iconWrapper,lt.props.className)}):lt,Et=Lt=>{!gt&&dt&&dt(Lt,wt),pt&&pt(Lt)},Ct=Lt=>{yt&&!gt&&dt&&dt(Lt,wt),mt&&mt(Lt)};return jsxRuntimeExports.jsxs(TabRoot,_extends$u({focusRipple:!at,className:clsx$2(Tt.root,it),ref:nt,role:"tab","aria-selected":gt,disabled:ot,onClick:Et,onFocus:Ct,ownerState:St,tabIndex:gt?0:-1},kt,{children:[ct==="top"||ct==="start"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[At,ht]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ht,At]}),ut]}))}),Tab$2=Tab$1,TableContext=reactExports.createContext(),TableContext$1=TableContext;function getTableUtilityClass(tt){return generateUtilityClass("MuiTable",tt)}generateUtilityClasses("MuiTable",["root","stickyHeader"]);const _excluded$P=["className","component","padding","size","stickyHeader"],useUtilityClasses$n=tt=>{const{classes:et,stickyHeader:nt}=tt;return composeClasses({root:["root",nt&&"stickyHeader"]},getTableUtilityClass,et)},TableRoot=styled$1("table",{name:"MuiTable",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$u({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":_extends$u({},tt.typography.body2,{padding:tt.spacing(2),color:(tt.vars||tt).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},et.stickyHeader&&{borderCollapse:"separate"})),defaultComponent$3="table",Table$3=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTable"}),{className:it,component:ot=defaultComponent$3,padding:at="normal",size:st="medium",stickyHeader:lt=!1}=rt,ct=_objectWithoutPropertiesLoose$k(rt,_excluded$P),ut=_extends$u({},rt,{component:ot,padding:at,size:st,stickyHeader:lt}),ht=useUtilityClasses$n(ut),dt=reactExports.useMemo(()=>({padding:at,size:st,stickyHeader:lt}),[at,st,lt]);return jsxRuntimeExports.jsx(TableContext$1.Provider,{value:dt,children:jsxRuntimeExports.jsx(TableRoot,_extends$u({as:ot,role:ot===defaultComponent$3?null:"table",ref:nt,className:clsx$2(ht.root,it),ownerState:ut},ct))})}),MaterialTable=Table$3,Tablelvl2Context=reactExports.createContext(),Tablelvl2Context$1=Tablelvl2Context;function getTableBodyUtilityClass(tt){return generateUtilityClass("MuiTableBody",tt)}generateUtilityClasses("MuiTableBody",["root"]);const _excluded$O=["className","component"],useUtilityClasses$m=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableBodyUtilityClass,et)},TableBodyRoot=styled$1("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-row-group"}),tablelvl2$1={variant:"body"},defaultComponent$2="tbody",TableBody=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableBody"}),{className:it,component:ot=defaultComponent$2}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$O),st=_extends$u({},rt,{component:ot}),lt=useUtilityClasses$m(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2$1,children:jsxRuntimeExports.jsx(TableBodyRoot,_extends$u({className:clsx$2(lt.root,it),as:ot,ref:nt,role:ot===defaultComponent$2?null:"rowgroup",ownerState:st},at))})}),TableBody$1=TableBody;function getTableCellUtilityClass(tt){return generateUtilityClass("MuiTableCell",tt)}const tableCellClasses=generateUtilityClasses("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),tableCellClasses$1=tableCellClasses,_excluded$N=["align","className","component","padding","scope","size","sortDirection","variant"],useUtilityClasses$l=tt=>{const{classes:et,variant:nt,align:rt,padding:it,size:ot,stickyHeader:at}=tt,st={root:["root",nt,at&&"stickyHeader",rt!=="inherit"&&`align${capitalize(rt)}`,it!=="normal"&&`padding${capitalize(it)}`,`size${capitalize(ot)}`]};return composeClasses(st,getTableCellUtilityClass,et)},TableCellRoot=styled$1("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`size${capitalize(nt.size)}`],nt.padding!=="normal"&&et[`padding${capitalize(nt.padding)}`],nt.align!=="inherit"&&et[`align${capitalize(nt.align)}`],nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:tt.vars?`1px solid ${tt.vars.palette.TableCell.border}`:`1px solid + ${tt.palette.mode==="light"?lighten(alpha$1(tt.palette.divider,1),.88):darken(alpha$1(tt.palette.divider,1),.68)}`,textAlign:"left",padding:16},et.variant==="head"&&{color:(tt.vars||tt).palette.text.primary,lineHeight:tt.typography.pxToRem(24),fontWeight:tt.typography.fontWeightMedium},et.variant==="body"&&{color:(tt.vars||tt).palette.text.primary},et.variant==="footer"&&{color:(tt.vars||tt).palette.text.secondary,lineHeight:tt.typography.pxToRem(21),fontSize:tt.typography.pxToRem(12)},et.size==="small"&&{padding:"6px 16px",[`&.${tableCellClasses$1.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},et.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},et.padding==="none"&&{padding:0},et.align==="left"&&{textAlign:"left"},et.align==="center"&&{textAlign:"center"},et.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},et.align==="justify"&&{textAlign:"justify"},et.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(tt.vars||tt).palette.background.default})),TableCell=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableCell"}),{align:it="inherit",className:ot,component:at,padding:st,scope:lt,size:ct,sortDirection:ut,variant:ht}=rt,dt=_objectWithoutPropertiesLoose$k(rt,_excluded$N),pt=reactExports.useContext(TableContext$1),mt=reactExports.useContext(Tablelvl2Context$1),gt=mt&&mt.variant==="head";let yt;at?yt=at:yt=gt?"th":"td";let bt=lt;yt==="td"?bt=void 0:!bt&>&&(bt="col");const wt=ht||mt&&mt.variant,xt=_extends$u({},rt,{align:it,component:yt,padding:st||(pt&&pt.padding?pt.padding:"normal"),size:ct||(pt&&pt.size?pt.size:"medium"),sortDirection:ut,stickyHeader:wt==="head"&&pt&&pt.stickyHeader,variant:wt}),kt=useUtilityClasses$l(xt);let St=null;return ut&&(St=ut==="asc"?"ascending":"descending"),jsxRuntimeExports.jsx(TableCellRoot,_extends$u({as:yt,ref:nt,className:clsx$2(kt.root,ot),"aria-sort":St,scope:bt,ownerState:xt},dt))}),TableCell$1=TableCell;function getTableHeadUtilityClass(tt){return generateUtilityClass("MuiTableHead",tt)}generateUtilityClasses("MuiTableHead",["root"]);const _excluded$M=["className","component"],useUtilityClasses$k=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableHeadUtilityClass,et)},TableHeadRoot=styled$1("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-header-group"}),tablelvl2={variant:"head"},defaultComponent$1="thead",TableHead=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableHead"}),{className:it,component:ot=defaultComponent$1}=rt,at=_objectWithoutPropertiesLoose$k(rt,_excluded$M),st=_extends$u({},rt,{component:ot}),lt=useUtilityClasses$k(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2,children:jsxRuntimeExports.jsx(TableHeadRoot,_extends$u({as:ot,className:clsx$2(lt.root,it),ref:nt,role:ot===defaultComponent$1?null:"rowgroup",ownerState:st},at))})}),TableHead$1=TableHead,KeyboardArrowLeft=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),KeyboardArrowRight=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function getTableRowUtilityClass(tt){return generateUtilityClass("MuiTableRow",tt)}const tableRowClasses=generateUtilityClasses("MuiTableRow",["root","selected","hover","head","footer"]),tableRowClasses$1=tableRowClasses,_excluded$L=["className","component","hover","selected"],useUtilityClasses$j=tt=>{const{classes:et,selected:nt,hover:rt,head:it,footer:ot}=tt;return composeClasses({root:["root",nt&&"selected",rt&&"hover",it&&"head",ot&&"footer"]},getTableRowUtilityClass,et)},TableRowRoot=styled$1("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.head&&et.head,nt.footer&&et.footer]}})(({theme:tt})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${tableRowClasses$1.hover}:hover`]:{backgroundColor:(tt.vars||tt).palette.action.hover},[`&.${tableRowClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity)}}})),defaultComponent="tr",TableRow=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTableRow"}),{className:it,component:ot=defaultComponent,hover:at=!1,selected:st=!1}=rt,lt=_objectWithoutPropertiesLoose$k(rt,_excluded$L),ct=reactExports.useContext(Tablelvl2Context$1),ut=_extends$u({},rt,{component:ot,hover:at,selected:st,head:ct&&ct.variant==="head",footer:ct&&ct.variant==="footer"}),ht=useUtilityClasses$j(ut);return jsxRuntimeExports.jsx(TableRowRoot,_extends$u({as:ot,ref:nt,className:clsx$2(ht.root,it),role:ot===defaultComponent?null:"row",ownerState:ut},lt))}),TableRow$1=TableRow;function easeInOutSin(tt){return(1+Math.sin(Math.PI*tt-Math.PI/2))/2}function animate(tt,et,nt,rt={},it=()=>{}){const{ease:ot=easeInOutSin,duration:at=300}=rt;let st=null;const lt=et[tt];let ct=!1;const ut=()=>{ct=!0},ht=dt=>{if(ct){it(new Error("Animation cancelled"));return}st===null&&(st=dt);const pt=Math.min(1,(dt-st)/at);if(et[tt]=ot(pt)*(nt-lt)+lt,pt>=1){requestAnimationFrame(()=>{it(null)});return}requestAnimationFrame(ht)};return lt===nt?(it(new Error("Element already at target position")),ut):(requestAnimationFrame(ht),ut)}const _excluded$K=["onChange"],styles$1={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ScrollbarSize(tt){const{onChange:et}=tt,nt=_objectWithoutPropertiesLoose$k(tt,_excluded$K),rt=reactExports.useRef(),it=reactExports.useRef(null),ot=()=>{rt.current=it.current.offsetHeight-it.current.clientHeight};return useEnhancedEffect$1(()=>{const at=debounce$4(()=>{const lt=rt.current;ot(),lt!==rt.current&&et(rt.current)}),st=ownerWindow(it.current);return st.addEventListener("resize",at),()=>{at.clear(),st.removeEventListener("resize",at)}},[et]),reactExports.useEffect(()=>{ot(),et(rt.current)},[et]),jsxRuntimeExports.jsx("div",_extends$u({style:styles$1,ref:it},nt))}function getTabScrollButtonUtilityClass(tt){return generateUtilityClass("MuiTabScrollButton",tt)}const tabScrollButtonClasses=generateUtilityClasses("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),tabScrollButtonClasses$1=tabScrollButtonClasses,_excluded$J=["className","slots","slotProps","direction","orientation","disabled"],useUtilityClasses$i=tt=>{const{classes:et,orientation:nt,disabled:rt}=tt;return composeClasses({root:["root",nt,rt&&"disabled"]},getTabScrollButtonUtilityClass,et)},TabScrollButtonRoot=styled$1(ButtonBase$1,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.orientation&&et[nt.orientation]]}})(({ownerState:tt})=>_extends$u({width:40,flexShrink:0,opacity:.8,[`&.${tabScrollButtonClasses$1.disabled}`]:{opacity:0}},tt.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${tt.isRtl?-90:90}deg)`}})),TabScrollButton=reactExports.forwardRef(function(et,nt){var rt,it;const ot=useThemeProps({props:et,name:"MuiTabScrollButton"}),{className:at,slots:st={},slotProps:lt={},direction:ct}=ot,ut=_objectWithoutPropertiesLoose$k(ot,_excluded$J),dt=useTheme().direction==="rtl",pt=_extends$u({isRtl:dt},ot),mt=useUtilityClasses$i(pt),gt=(rt=st.StartScrollButtonIcon)!=null?rt:KeyboardArrowLeft,yt=(it=st.EndScrollButtonIcon)!=null?it:KeyboardArrowRight,bt=useSlotProps({elementType:gt,externalSlotProps:lt.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt}),wt=useSlotProps({elementType:yt,externalSlotProps:lt.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt});return jsxRuntimeExports.jsx(TabScrollButtonRoot,_extends$u({component:"div",className:clsx$2(mt.root,at),ref:nt,role:null,ownerState:pt,tabIndex:null},ut,{children:ct==="left"?jsxRuntimeExports.jsx(gt,_extends$u({},bt)):jsxRuntimeExports.jsx(yt,_extends$u({},wt))}))}),TabScrollButton$1=TabScrollButton;function getTabsUtilityClass(tt){return generateUtilityClass("MuiTabs",tt)}const tabsClasses=generateUtilityClasses("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),tabsClasses$1=tabsClasses,_excluded$I=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],nextItem=(tt,et)=>tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:tt.firstChild,previousItem=(tt,et)=>tt===et?tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:tt.lastChild,moveFocus=(tt,et,nt)=>{let rt=!1,it=nt(tt,et);for(;it;){if(it===tt.firstChild){if(rt)return;rt=!0}const ot=it.disabled||it.getAttribute("aria-disabled")==="true";if(!it.hasAttribute("tabindex")||ot)it=nt(tt,it);else{it.focus();return}}},useUtilityClasses$h=tt=>{const{vertical:et,fixed:nt,hideScrollbar:rt,scrollableX:it,scrollableY:ot,centered:at,scrollButtonsHideMobile:st,classes:lt}=tt;return composeClasses({root:["root",et&&"vertical"],scroller:["scroller",nt&&"fixed",rt&&"hideScrollbar",it&&"scrollableX",ot&&"scrollableY"],flexContainer:["flexContainer",et&&"flexContainerVertical",at&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",st&&"scrollButtonsHideMobile"],scrollableX:[it&&"scrollableX"],hideScrollbar:[rt&&"hideScrollbar"]},getTabsUtilityClass,lt)},TabsRoot=styled$1("div",{name:"MuiTabs",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${tabsClasses$1.scrollButtons}`]:et.scrollButtons},{[`& .${tabsClasses$1.scrollButtons}`]:nt.scrollButtonsHideMobile&&et.scrollButtonsHideMobile},et.root,nt.vertical&&et.vertical]}})(({ownerState:tt,theme:et})=>_extends$u({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},tt.vertical&&{flexDirection:"column"},tt.scrollButtonsHideMobile&&{[`& .${tabsClasses$1.scrollButtons}`]:{[et.breakpoints.down("sm")]:{display:"none"}}})),TabsScroller=styled$1("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.scroller,nt.fixed&&et.fixed,nt.hideScrollbar&&et.hideScrollbar,nt.scrollableX&&et.scrollableX,nt.scrollableY&&et.scrollableY]}})(({ownerState:tt})=>_extends$u({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},tt.fixed&&{overflowX:"hidden",width:"100%"},tt.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},tt.scrollableX&&{overflowX:"auto",overflowY:"hidden"},tt.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),FlexContainer=styled$1("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.flexContainer,nt.vertical&&et.flexContainerVertical,nt.centered&&et.centered]}})(({ownerState:tt})=>_extends$u({display:"flex"},tt.vertical&&{flexDirection:"column"},tt.centered&&{justifyContent:"center"})),TabsIndicator=styled$1("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(tt,et)=>et.indicator})(({ownerState:tt,theme:et})=>_extends$u({position:"absolute",height:2,bottom:0,width:"100%",transition:et.transitions.create()},tt.indicatorColor==="primary"&&{backgroundColor:(et.vars||et).palette.primary.main},tt.indicatorColor==="secondary"&&{backgroundColor:(et.vars||et).palette.secondary.main},tt.vertical&&{height:"100%",width:2,right:0})),TabsScrollbarSize=styled$1(ScrollbarSize)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),defaultIndicatorStyle={},Tabs=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTabs"}),it=useTheme(),ot=it.direction==="rtl",{"aria-label":at,"aria-labelledby":st,action:lt,centered:ct=!1,children:ut,className:ht,component:dt="div",allowScrollButtonsMobile:pt=!1,indicatorColor:mt="primary",onChange:gt,orientation:yt="horizontal",ScrollButtonComponent:bt=TabScrollButton$1,scrollButtons:wt="auto",selectionFollowsFocus:xt,slots:kt={},slotProps:St={},TabIndicatorProps:Tt={},TabScrollButtonProps:At={},textColor:Et="primary",value:Ct,variant:Lt="standard",visibleScrollbar:jt=!1}=rt,Rt=_objectWithoutPropertiesLoose$k(rt,_excluded$I),$t=Lt==="scrollable",vt=yt==="vertical",It=vt?"scrollTop":"scrollLeft",Ot=vt?"top":"left",Wt=vt?"bottom":"right",zt=vt?"clientHeight":"clientWidth",Ft=vt?"height":"width",Nt=_extends$u({},rt,{component:dt,allowScrollButtonsMobile:pt,indicatorColor:mt,orientation:yt,vertical:vt,scrollButtons:wt,textColor:Et,variant:Lt,visibleScrollbar:jt,fixed:!$t,hideScrollbar:$t&&!jt,scrollableX:$t&&!vt,scrollableY:$t&&vt,centered:ct&&!$t,scrollButtonsHideMobile:!pt}),Ut=useUtilityClasses$h(Nt),Pt=useSlotProps({elementType:kt.StartScrollButtonIcon,externalSlotProps:St.startScrollButtonIcon,ownerState:Nt}),Ht=useSlotProps({elementType:kt.EndScrollButtonIcon,externalSlotProps:St.endScrollButtonIcon,ownerState:Nt}),[Qt,an]=reactExports.useState(!1),[Yt,nn]=reactExports.useState(defaultIndicatorStyle),[tn,dn]=reactExports.useState(!1),[wn,rn]=reactExports.useState(!1),[Zt,vn]=reactExports.useState(!1),[Cn,$n]=reactExports.useState({overflow:"hidden",scrollbarWidth:0}),Nn=new Map,En=reactExports.useRef(null),sn=reactExports.useRef(null),pn=()=>{const Vn=En.current;let Gn;if(Vn){const Jn=Vn.getBoundingClientRect();Gn={clientWidth:Vn.clientWidth,scrollLeft:Vn.scrollLeft,scrollTop:Vn.scrollTop,scrollLeftNormalized:getNormalizedScrollLeft(Vn,it.direction),scrollWidth:Vn.scrollWidth,top:Jn.top,bottom:Jn.bottom,left:Jn.left,right:Jn.right}}let zn;if(Vn&&Ct!==!1){const Jn=sn.current.children;if(Jn.length>0){const Wn=Jn[Nn.get(Ct)];zn=Wn?Wn.getBoundingClientRect():null}}return{tabsMeta:Gn,tabMeta:zn}},Tn=useEventCallback(()=>{const{tabsMeta:Vn,tabMeta:Gn}=pn();let zn=0,Jn;if(vt)Jn="top",Gn&&Vn&&(zn=Gn.top-Vn.top+Vn.scrollTop);else if(Jn=ot?"right":"left",Gn&&Vn){const fr=ot?Vn.scrollLeftNormalized+Vn.clientWidth-Vn.scrollWidth:Vn.scrollLeft;zn=(ot?-1:1)*(Gn[Jn]-Vn[Jn]+fr)}const Wn={[Jn]:zn,[Ft]:Gn?Gn[Ft]:0};if(isNaN(Yt[Jn])||isNaN(Yt[Ft]))nn(Wn);else{const fr=Math.abs(Yt[Jn]-Wn[Jn]),ur=Math.abs(Yt[Ft]-Wn[Ft]);(fr>=1||ur>=1)&&nn(Wn)}}),In=(Vn,{animation:Gn=!0}={})=>{Gn?animate(It,En.current,Vn,{duration:it.transitions.duration.standard}):En.current[It]=Vn},yn=Vn=>{let Gn=En.current[It];vt?Gn+=Vn:(Gn+=Vn*(ot?-1:1),Gn*=ot&&detectScrollType()==="reverse"?-1:1),In(Gn)},hn=()=>{const Vn=En.current[zt];let Gn=0;const zn=Array.from(sn.current.children);for(let Jn=0;JnVn){Jn===0&&(Gn=Vn);break}Gn+=Wn[zt]}return Gn},fn=()=>{yn(-1*hn())},xn=()=>{yn(hn())},jn=reactExports.useCallback(Vn=>{$n({overflow:null,scrollbarWidth:Vn})},[]),cn=()=>{const Vn={};Vn.scrollbarSizeListener=$t?jsxRuntimeExports.jsx(TabsScrollbarSize,{onChange:jn,className:clsx$2(Ut.scrollableX,Ut.hideScrollbar)}):null;const zn=$t&&(wt==="auto"&&(tn||wn)||wt===!0);return Vn.scrollButtonStart=zn?jsxRuntimeExports.jsx(bt,_extends$u({slots:{StartScrollButtonIcon:kt.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Pt},orientation:yt,direction:ot?"right":"left",onClick:fn,disabled:!tn},At,{className:clsx$2(Ut.scrollButtons,At.className)})):null,Vn.scrollButtonEnd=zn?jsxRuntimeExports.jsx(bt,_extends$u({slots:{EndScrollButtonIcon:kt.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:yt,direction:ot?"left":"right",onClick:xn,disabled:!wn},At,{className:clsx$2(Ut.scrollButtons,At.className)})):null,Vn},Xt=useEventCallback(Vn=>{const{tabsMeta:Gn,tabMeta:zn}=pn();if(!(!zn||!Gn)){if(zn[Ot]Gn[Wt]){const Jn=Gn[It]+(zn[Wt]-Gn[Wt]);In(Jn,{animation:Vn})}}}),Kt=useEventCallback(()=>{$t&&wt!==!1&&vn(!Zt)});reactExports.useEffect(()=>{const Vn=debounce$4(()=>{En.current&&Tn()});let Gn;const zn=fr=>{fr.forEach(ur=>{ur.removedNodes.forEach(wr=>{var Xr;(Xr=Gn)==null||Xr.unobserve(wr)}),ur.addedNodes.forEach(wr=>{var Xr;(Xr=Gn)==null||Xr.observe(wr)})}),Vn(),Kt()},Jn=ownerWindow(En.current);Jn.addEventListener("resize",Vn);let Wn;return typeof ResizeObserver<"u"&&(Gn=new ResizeObserver(Vn),Array.from(sn.current.children).forEach(fr=>{Gn.observe(fr)})),typeof MutationObserver<"u"&&(Wn=new MutationObserver(zn),Wn.observe(sn.current,{childList:!0})),()=>{var fr,ur;Vn.clear(),Jn.removeEventListener("resize",Vn),(fr=Wn)==null||fr.disconnect(),(ur=Gn)==null||ur.disconnect()}},[Tn,Kt]),reactExports.useEffect(()=>{const Vn=Array.from(sn.current.children),Gn=Vn.length;if(typeof IntersectionObserver<"u"&&Gn>0&&$t&&wt!==!1){const zn=Vn[0],Jn=Vn[Gn-1],Wn={root:En.current,threshold:.99},fr=Er=>{dn(!Er[0].isIntersecting)},ur=new IntersectionObserver(fr,Wn);ur.observe(zn);const wr=Er=>{rn(!Er[0].isIntersecting)},Xr=new IntersectionObserver(wr,Wn);return Xr.observe(Jn),()=>{ur.disconnect(),Xr.disconnect()}}},[$t,wt,Zt,ut==null?void 0:ut.length]),reactExports.useEffect(()=>{an(!0)},[]),reactExports.useEffect(()=>{Tn()}),reactExports.useEffect(()=>{Xt(defaultIndicatorStyle!==Yt)},[Xt,Yt]),reactExports.useImperativeHandle(lt,()=>({updateIndicator:Tn,updateScrollButtons:Kt}),[Tn,Kt]);const kn=jsxRuntimeExports.jsx(TabsIndicator,_extends$u({},Tt,{className:clsx$2(Ut.indicator,Tt.className),ownerState:Nt,style:_extends$u({},Yt,Tt.style)}));let Mn=0;const On=reactExports.Children.map(ut,Vn=>{if(!reactExports.isValidElement(Vn))return null;const Gn=Vn.props.value===void 0?Mn:Vn.props.value;Nn.set(Gn,Mn);const zn=Gn===Ct;return Mn+=1,reactExports.cloneElement(Vn,_extends$u({fullWidth:Lt==="fullWidth",indicator:zn&&!Qt&&kn,selected:zn,selectionFollowsFocus:xt,onChange:gt,textColor:Et,value:Gn},Mn===1&&Ct===!1&&!Vn.props.tabIndex?{tabIndex:0}:{}))}),Bn=Vn=>{const Gn=sn.current,zn=ownerDocument(Gn).activeElement;if(zn.getAttribute("role")!=="tab")return;let Wn=yt==="horizontal"?"ArrowLeft":"ArrowUp",fr=yt==="horizontal"?"ArrowRight":"ArrowDown";switch(yt==="horizontal"&&ot&&(Wn="ArrowRight",fr="ArrowLeft"),Vn.key){case Wn:Vn.preventDefault(),moveFocus(Gn,zn,previousItem);break;case fr:Vn.preventDefault(),moveFocus(Gn,zn,nextItem);break;case"Home":Vn.preventDefault(),moveFocus(Gn,null,nextItem);break;case"End":Vn.preventDefault(),moveFocus(Gn,null,previousItem);break}},Xn=cn();return jsxRuntimeExports.jsxs(TabsRoot,_extends$u({className:clsx$2(Ut.root,ht),ownerState:Nt,ref:nt,as:dt},Rt,{children:[Xn.scrollButtonStart,Xn.scrollbarSizeListener,jsxRuntimeExports.jsxs(TabsScroller,{className:Ut.scroller,ownerState:Nt,style:{overflow:Cn.overflow,[vt?`margin${ot?"Left":"Right"}`:"marginBottom"]:jt?void 0:-Cn.scrollbarWidth},ref:En,children:[jsxRuntimeExports.jsx(FlexContainer,{"aria-label":at,"aria-labelledby":st,"aria-orientation":yt==="vertical"?"vertical":null,className:Ut.flexContainer,ownerState:Nt,onKeyDown:Bn,ref:sn,role:"tablist",children:On}),Qt&&kn]}),Xn.scrollButtonEnd]}))}),Tabs$1=Tabs;function getTextFieldUtilityClass(tt){return generateUtilityClass("MuiTextField",tt)}generateUtilityClasses("MuiTextField",["root"]);const _excluded$H=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],variantComponent={standard:Input$2,filled:FilledInput$1,outlined:OutlinedInput$1},useUtilityClasses$g=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTextFieldUtilityClass,et)},TextFieldRoot=styled$1(FormControl$1,{name:"MuiTextField",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),TextField=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiTextField"}),{autoComplete:it,autoFocus:ot=!1,children:at,className:st,color:lt="primary",defaultValue:ct,disabled:ut=!1,error:ht=!1,FormHelperTextProps:dt,fullWidth:pt=!1,helperText:mt,id:gt,InputLabelProps:yt,inputProps:bt,InputProps:wt,inputRef:xt,label:kt,maxRows:St,minRows:Tt,multiline:At=!1,name:Et,onBlur:Ct,onChange:Lt,onFocus:jt,placeholder:Rt,required:$t=!1,rows:vt,select:It=!1,SelectProps:Ot,type:Wt,value:zt,variant:Ft="outlined"}=rt,Nt=_objectWithoutPropertiesLoose$k(rt,_excluded$H),Ut=_extends$u({},rt,{autoFocus:ot,color:lt,disabled:ut,error:ht,fullWidth:pt,multiline:At,required:$t,select:It,variant:Ft}),Pt=useUtilityClasses$g(Ut),Ht={};Ft==="outlined"&&(yt&&typeof yt.shrink<"u"&&(Ht.notched=yt.shrink),Ht.label=kt),It&&((!Ot||!Ot.native)&&(Ht.id=void 0),Ht["aria-describedby"]=void 0);const Qt=useId(gt),an=mt&&Qt?`${Qt}-helper-text`:void 0,Yt=kt&&Qt?`${Qt}-label`:void 0,nn=variantComponent[Ft],tn=jsxRuntimeExports.jsx(nn,_extends$u({"aria-describedby":an,autoComplete:it,autoFocus:ot,defaultValue:ct,fullWidth:pt,multiline:At,name:Et,rows:vt,maxRows:St,minRows:Tt,type:Wt,value:zt,id:Qt,inputRef:xt,onBlur:Ct,onChange:Lt,onFocus:jt,placeholder:Rt,inputProps:bt},Ht,wt));return jsxRuntimeExports.jsxs(TextFieldRoot,_extends$u({className:clsx$2(Pt.root,st),disabled:ut,error:ht,fullWidth:pt,ref:nt,required:$t,color:lt,variant:Ft,ownerState:Ut},Nt,{children:[kt!=null&&kt!==""&&jsxRuntimeExports.jsx(InputLabel$1,_extends$u({htmlFor:Qt,id:Yt},yt,{children:kt})),It?jsxRuntimeExports.jsx(Select$1,_extends$u({"aria-describedby":an,id:Qt,labelId:Yt,value:zt,input:tn},Ot,{children:at})):tn,mt&&jsxRuntimeExports.jsx(FormHelperText$1,_extends$u({id:an},dt,{children:mt}))]}))}),MuiTextField=TextField,CameraCenterIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 17",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"center",children:[jsxRuntimeExports.jsx("path",{id:"Vector 121",d:"M9 4L9 1",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("path",{id:"Vector 123",d:"M14 9H17",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("path",{id:"Vector 122",d:"M9 16L9 14",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("path",{id:"Vector 124",d:"M1 9L4 9",stroke:"white","stroke-linecap":"round"}),jsxRuntimeExports.jsx("circle",{id:"Ellipse 2",cx:"9.00001",cy:"9.00001",r:"5.02857",stroke:"white"})]})}),cssWithMediaQuery=tt=>(et,...nt)=>{const rt=Ae(et,...nt);return rt.join("").trim()?Ae` @media ${tt} { ${rt} } @@ -5008,10 +5008,10 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co top: 0; background-color: ${colors.black}; z-index: 1; -`,Fallback=()=>jsxRuntimeExports.jsx(Html$1,{children:jsxRuntimeExports.jsx(Loader$1,{})}),Content$1=()=>{const{universeColor:tt}=useControls("universe",{universeColor:colors.black}),et=useSelectedNode(),nt=reactExports.useMemo(()=>et!=null&&et.node_type?getNodeColorByType(et.node_type):outlineEffectColor,[et]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("color",{args:[tt],attach:"background"}),jsxRuntimeExports.jsx(Lights,{}),jsxRuntimeExports.jsx(Controls,{}),jsxRuntimeExports.jsxs(Selection$3,{children:[jsxRuntimeExports.jsxs(EffectComposer,{autoClear:!1,multisampling:8,children:[jsxRuntimeExports.jsx(Vignette,{darkness:.7,eskil:!1,offset:.05}),jsxRuntimeExports.jsx(Bloom,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Resolution.AUTO_SIZE,resolutionY:Resolution.AUTO_SIZE}),jsxRuntimeExports.jsx(Outline,{blendFunction:BlendFunction.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:nt,visibleEdgeColor:nt})]}),jsxRuntimeExports.jsx(Graph,{})]})]})};let wheelEventTimeout=null;const cameraProps={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z]},_Universe=()=>{const[tt,et,nt]=[useControlStore(at=>at.setIsUserScrollingOnHtmlPanel),useControlStore(at=>at.setIsUserScrolling),useControlStore(at=>at.setUserMovedCamera)],rt=useDataStore(at=>at.isFetching),it=reactExports.useCallback(at=>{var ct;const{target:st}=at,{offsetParent:lt}=st;wheelEventTimeout&&clearTimeout(wheelEventTimeout),(ct=lt==null?void 0:lt.classList)!=null&&ct.contains("html-panel")&<.clientHeight{et(!1),tt(!1)},200)},[et,tt,nt]),ot=reactExports.useCallback(at=>addToGlobalForE2e(at,"threeState"),[]);return jsxRuntimeExports.jsxs(Wrapper$p,{children:[jsxRuntimeExports.jsx(Overlay,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsxs(Canvas$1,{camera:cameraProps,id:"universe-canvas",onCreated:ot,onWheel:it,children:[isDevelopment&&jsxRuntimeExports.jsx(Perf,{position:"top-right"}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Fallback,{}),children:[jsxRuntimeExports.jsx(Preload,{}),jsxRuntimeExports.jsx(AdaptiveDpr,{}),jsxRuntimeExports.jsx(AdaptiveEvents,{}),jsxRuntimeExports.jsx(Content$1,{})]})]})}),rt&&jsxRuntimeExports.jsx(Preloader,{fullSize:!1})]})},Wrapper$p=styled$4(Flex)` +`,Fallback=()=>jsxRuntimeExports.jsx(Html$1,{children:jsxRuntimeExports.jsx(Loader$1,{})}),Content$2=()=>{const{universeColor:tt}=useControls("universe",{universeColor:colors.black}),et=useSelectedNode(),nt=reactExports.useMemo(()=>et!=null&&et.node_type?getNodeColorByType(et.node_type):outlineEffectColor,[et]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("color",{args:[tt],attach:"background"}),jsxRuntimeExports.jsx(Lights,{}),jsxRuntimeExports.jsx(Controls,{}),jsxRuntimeExports.jsxs(Selection$3,{children:[jsxRuntimeExports.jsxs(EffectComposer,{autoClear:!1,multisampling:8,children:[jsxRuntimeExports.jsx(Vignette,{darkness:.7,eskil:!1,offset:.05}),jsxRuntimeExports.jsx(Bloom,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Resolution.AUTO_SIZE,resolutionY:Resolution.AUTO_SIZE}),jsxRuntimeExports.jsx(Outline,{blendFunction:BlendFunction.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:nt,visibleEdgeColor:nt})]}),jsxRuntimeExports.jsx(Graph,{})]})]})};let wheelEventTimeout=null;const cameraProps={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z]},_Universe=()=>{const[tt,et,nt]=[useControlStore(at=>at.setIsUserScrollingOnHtmlPanel),useControlStore(at=>at.setIsUserScrolling),useControlStore(at=>at.setUserMovedCamera)],rt=useDataStore(at=>at.isFetching),it=reactExports.useCallback(at=>{var ct;const{target:st}=at,{offsetParent:lt}=st;wheelEventTimeout&&clearTimeout(wheelEventTimeout),(ct=lt==null?void 0:lt.classList)!=null&&ct.contains("html-panel")&<.clientHeight{et(!1),tt(!1)},200)},[et,tt,nt]),ot=reactExports.useCallback(at=>addToGlobalForE2e(at,"threeState"),[]);return jsxRuntimeExports.jsxs(Wrapper$p,{children:[jsxRuntimeExports.jsx(Overlay,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsxs(Canvas$1,{camera:cameraProps,id:"universe-canvas",onCreated:ot,onWheel:it,children:[isDevelopment&&jsxRuntimeExports.jsx(Perf,{position:"top-right"}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Fallback,{}),children:[jsxRuntimeExports.jsx(Preload,{}),jsxRuntimeExports.jsx(AdaptiveDpr,{}),jsxRuntimeExports.jsx(AdaptiveEvents,{}),jsxRuntimeExports.jsx(Content$2,{})]})]})}),rt&&jsxRuntimeExports.jsx(Preloader,{fullSize:!1})]})},Wrapper$p=styled$4(Flex)` flex: 1 1 100%; position: relative; -`,Universe=reactExports.memo(_Universe),PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(tt=>{PACKET_TYPES_REVERSE[PACKET_TYPES[tt]]=tt});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=tt=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt&&tt.buffer instanceof ArrayBuffer,encodePacket=({type:tt,data:et},nt,rt)=>withNativeBlob$1&&et instanceof Blob?nt?rt(et):encodeBlobAsBase64(et,rt):withNativeArrayBuffer$2&&(et instanceof ArrayBuffer||isView$1(et))?nt?rt(et):encodeBlobAsBase64(new Blob([et]),rt):rt(PACKET_TYPES[tt]+(et||"")),encodeBlobAsBase64=(tt,et)=>{const nt=new FileReader;return nt.onload=function(){const rt=nt.result.split(",")[1];et("b"+(rt||""))},nt.readAsDataURL(tt)};function toArray$1(tt){return tt instanceof Uint8Array?tt:tt instanceof ArrayBuffer?new Uint8Array(tt):new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(tt,et){if(withNativeBlob$1&&tt.data instanceof Blob)return tt.data.arrayBuffer().then(toArray$1).then(et);if(withNativeArrayBuffer$2&&(tt.data instanceof ArrayBuffer||isView$1(tt.data)))return et(toArray$1(tt.data));encodePacket(tt,!1,nt=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),et(TEXT_ENCODER.encode(nt))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let tt=0;tt{let et=tt.length*.75,nt=tt.length,rt,it=0,ot,at,st,lt;tt[tt.length-1]==="="&&(et--,tt[tt.length-2]==="="&&et--);const ct=new ArrayBuffer(et),ut=new Uint8Array(ct);for(rt=0;rt>4,ut[it++]=(at&15)<<4|st>>2,ut[it++]=(st&3)<<6|lt&63;return ct},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(tt,et)=>{if(typeof tt!="string")return{type:"message",data:mapBinary(tt,et)};const nt=tt.charAt(0);return nt==="b"?{type:"message",data:decodeBase64Packet(tt.substring(1),et)}:PACKET_TYPES_REVERSE[nt]?tt.length>1?{type:PACKET_TYPES_REVERSE[nt],data:tt.substring(1)}:{type:PACKET_TYPES_REVERSE[nt]}:ERROR_PACKET},decodeBase64Packet=(tt,et)=>{if(withNativeArrayBuffer$1){const nt=decode$1(tt);return mapBinary(nt,et)}else return{base64:!0,data:tt}},mapBinary=(tt,et)=>{switch(et){case"blob":return tt instanceof Blob?tt:new Blob([tt]);case"arraybuffer":default:return tt instanceof ArrayBuffer?tt:tt.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(tt,et)=>{const nt=tt.length,rt=new Array(nt);let it=0;tt.forEach((ot,at)=>{encodePacket(ot,!1,st=>{rt[at]=st,++it===nt&&et(rt.join(SEPARATOR))})})},decodePayload=(tt,et)=>{const nt=tt.split(SEPARATOR),rt=[];for(let it=0;it{const rt=nt.length;let it;if(rt<126)it=new Uint8Array(1),new DataView(it.buffer).setUint8(0,rt);else if(rt<65536){it=new Uint8Array(3);const ot=new DataView(it.buffer);ot.setUint8(0,126),ot.setUint16(1,rt)}else{it=new Uint8Array(9);const ot=new DataView(it.buffer);ot.setUint8(0,127),ot.setBigUint64(1,BigInt(rt))}tt.data&&typeof tt.data!="string"&&(it[0]|=128),et.enqueue(it),et.enqueue(nt)})}})}let TEXT_DECODER;function totalLength(tt){return tt.reduce((et,nt)=>et+nt.length,0)}function concatChunks(tt,et){if(tt[0].length===et)return tt.shift();const nt=new Uint8Array(et);let rt=0;for(let it=0;itMath.pow(2,53-32)-1){st.enqueue(ERROR_PACKET);break}it=ut*Math.pow(2,32)+ct.getUint32(4),rt=3}else{if(totalLength(nt)tt){st.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(tt){if(tt)return mixin(tt)}function mixin(tt){for(var et in Emitter.prototype)tt[et]=Emitter.prototype[et];return tt}Emitter.prototype.on=Emitter.prototype.addEventListener=function(tt,et){return this._callbacks=this._callbacks||{},(this._callbacks["$"+tt]=this._callbacks["$"+tt]||[]).push(et),this};Emitter.prototype.once=function(tt,et){function nt(){this.off(tt,nt),et.apply(this,arguments)}return nt.fn=et,this.on(tt,nt),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(tt,et){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var nt=this._callbacks["$"+tt];if(!nt)return this;if(arguments.length==1)return delete this._callbacks["$"+tt],this;for(var rt,it=0;ittypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick(tt,...et){return et.reduce((nt,rt)=>(tt.hasOwnProperty(rt)&&(nt[rt]=tt[rt]),nt),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(tt,et){et.useNativeTimers?(tt.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),tt.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(tt.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),tt.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(tt){return typeof tt=="string"?utf8Length(tt):Math.ceil((tt.byteLength||tt.size)*BASE64_OVERHEAD)}function utf8Length(tt){let et=0,nt=0;for(let rt=0,it=tt.length;rt=57344?nt+=3:(rt++,nt+=4);return nt}function encode$1(tt){let et="";for(let nt in tt)tt.hasOwnProperty(nt)&&(et.length&&(et+="&"),et+=encodeURIComponent(nt)+"="+encodeURIComponent(tt[nt]));return et}function decode(tt){let et={},nt=tt.split("&");for(let rt=0,it=nt.length;rt0);return et}function yeast(){const tt=encode(+new Date);return tt!==prev?(seed=0,prev=tt):tt+"."+encode(seed++)}for(;i$1{this.readyState="paused",et()};if(this.polling||!this.writable){let rt=0;this.polling&&(rt++,this.once("pollComplete",function(){--rt||nt()})),this.writable||(rt++,this.once("drain",function(){--rt||nt()}))}else nt()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(et){const nt=rt=>{if(this.readyState==="opening"&&rt.type==="open"&&this.onOpen(),rt.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(rt)};decodePayload(et,this.socket.binaryType).forEach(nt),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const et=()=>{this.write([{type:"close"}])};this.readyState==="open"?et():this.once("open",et)}write(et){this.writable=!1,encodePayload(et,nt=>{this.doWrite(nt,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const et=this.opts.secure?"https":"http",nt=this.query||{};return this.opts.timestampRequests!==!1&&(nt[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!nt.sid&&(nt.b64=1),this.createUri(et,nt)}request(et={}){return Object.assign(et,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request$1(this.uri(),et)}doWrite(et,nt){const rt=this.request({method:"POST",data:et});rt.on("success",nt),rt.on("error",(it,ot)=>{this.onError("xhr post error",it,ot)})}doPoll(){const et=this.request();et.on("data",this.onData.bind(this)),et.on("error",(nt,rt)=>{this.onError("xhr poll error",nt,rt)}),this.pollXhr=et}}let Request$1=class O0 extends Emitter{constructor(et,nt){super(),installTimerFunctions(this,nt),this.opts=nt,this.method=nt.method||"GET",this.uri=et,this.data=nt.data!==void 0?nt.data:null,this.create()}create(){var et;const nt=pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");nt.xdomain=!!this.opts.xd;const rt=this.xhr=new XHR(nt);try{rt.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){rt.setDisableHeaderCheck&&rt.setDisableHeaderCheck(!0);for(let it in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(it)&&rt.setRequestHeader(it,this.opts.extraHeaders[it])}}catch{}if(this.method==="POST")try{rt.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{rt.setRequestHeader("Accept","*/*")}catch{}(et=this.opts.cookieJar)===null||et===void 0||et.addCookies(rt),"withCredentials"in rt&&(rt.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(rt.timeout=this.opts.requestTimeout),rt.onreadystatechange=()=>{var it;rt.readyState===3&&((it=this.opts.cookieJar)===null||it===void 0||it.parseCookies(rt)),rt.readyState===4&&(rt.status===200||rt.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof rt.status=="number"?rt.status:0)},0))},rt.send(this.data)}catch(it){this.setTimeoutFn(()=>{this.onError(it)},0);return}typeof document<"u"&&(this.index=O0.requestsCount++,O0.requests[this.index]=this)}onError(et){this.emitReserved("error",et,this.xhr),this.cleanup(!0)}cleanup(et){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty$1,et)try{this.xhr.abort()}catch{}typeof document<"u"&&delete O0.requests[this.index],this.xhr=null}}onLoad(){const et=this.xhr.responseText;et!==null&&(this.emitReserved("data",et),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Request$1.requestsCount=0;Request$1.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const tt="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(tt,unloadHandler,!1)}}function unloadHandler(){for(let tt in Request$1.requests)Request$1.requests.hasOwnProperty(tt)&&Request$1.requests[tt].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?et=>Promise.resolve().then(et):(et,nt)=>nt(et,0))(),WebSocket=globalThisShim.WebSocket||globalThisShim.MozWebSocket,usingBrowserWebSocket=!0,defaultBinaryType="arraybuffer",isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WS extends Transport{constructor(et){super(et),this.supportsBinary=!et.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const et=this.uri(),nt=this.opts.protocols,rt=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(rt.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?nt?new WebSocket(et,nt):new WebSocket(et):new WebSocket(et,nt,rt)}catch(it){return this.emitReserved("error",it)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=et=>this.onClose({description:"websocket connection closed",context:et}),this.ws.onmessage=et=>this.onData(et.data),this.ws.onerror=et=>this.onError("websocket error",et)}write(et){this.writable=!1;for(let nt=0;nt{const at={};try{usingBrowserWebSocket&&this.ws.send(ot)}catch{}it&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const et=this.opts.secure?"wss":"ws",nt=this.query||{};return this.opts.timestampRequests&&(nt[this.opts.timestampParam]=yeast()),this.supportsBinary||(nt.b64=1),this.createUri(et,nt)}check(){return!!WebSocket}}class WT extends Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(et=>{this.onError("webtransport error",et)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(et=>{const nt=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),rt=et.readable.pipeThrough(nt).getReader(),it=createPacketEncoderStream();it.readable.pipeTo(et.writable),this.writer=it.writable.getWriter();const ot=()=>{rt.read().then(({done:st,value:lt})=>{st||(this.onPacket(lt),ot())}).catch(st=>{})};ot();const at={type:"open"};this.query.sid&&(at.data=`{"sid":"${this.query.sid}"}`),this.writer.write(at).then(()=>this.onOpen())})}))}write(et){this.writable=!1;for(let nt=0;nt{it&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var et;(et=this.transport)===null||et===void 0||et.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re$1=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse(tt){const et=tt,nt=tt.indexOf("["),rt=tt.indexOf("]");nt!=-1&&rt!=-1&&(tt=tt.substring(0,nt)+tt.substring(nt,rt).replace(/:/g,";")+tt.substring(rt,tt.length));let it=re$1.exec(tt||""),ot={},at=14;for(;at--;)ot[parts[at]]=it[at]||"";return nt!=-1&&rt!=-1&&(ot.source=et,ot.host=ot.host.substring(1,ot.host.length-1).replace(/;/g,":"),ot.authority=ot.authority.replace("[","").replace("]","").replace(/;/g,":"),ot.ipv6uri=!0),ot.pathNames=pathNames(ot,ot.path),ot.queryKey=queryKey(ot,ot.query),ot}function pathNames(tt,et){const nt=/\/{2,9}/g,rt=et.replace(nt,"/").split("/");return(et.slice(0,1)=="/"||et.length===0)&&rt.splice(0,1),et.slice(-1)=="/"&&rt.splice(rt.length-1,1),rt}function queryKey(tt,et){const nt={};return et.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(rt,it,ot){it&&(nt[it]=ot)}),nt}let Socket$1=class Hm extends Emitter{constructor(et,nt={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],et&&typeof et=="object"&&(nt=et,et=null),et?(et=parse(et),nt.hostname=et.host,nt.secure=et.protocol==="https"||et.protocol==="wss",nt.port=et.port,et.query&&(nt.query=et.query)):nt.host&&(nt.hostname=parse(nt.host).host),installTimerFunctions(this,nt),this.secure=nt.secure!=null?nt.secure:typeof location<"u"&&location.protocol==="https:",nt.hostname&&!nt.port&&(nt.port=this.secure?"443":"80"),this.hostname=nt.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=nt.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=nt.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},nt),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(et){const nt=Object.assign({},this.opts.query);nt.EIO=protocol$1,nt.transport=et,this.id&&(nt.sid=this.id);const rt=Object.assign({},this.opts,{query:nt,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[et]);return new transports[et](rt)}open(){let et;if(this.opts.rememberUpgrade&&Hm.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)et="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else et=this.transports[0];this.readyState="opening";try{et=this.createTransport(et)}catch{this.transports.shift(),this.open();return}et.open(),this.setTransport(et)}setTransport(et){this.transport&&this.transport.removeAllListeners(),this.transport=et,et.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",nt=>this.onClose("transport close",nt))}probe(et){let nt=this.createTransport(et),rt=!1;Hm.priorWebsocketSuccess=!1;const it=()=>{rt||(nt.send([{type:"ping",data:"probe"}]),nt.once("packet",ht=>{if(!rt)if(ht.type==="pong"&&ht.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",nt),!nt)return;Hm.priorWebsocketSuccess=nt.name==="websocket",this.transport.pause(()=>{rt||this.readyState!=="closed"&&(ut(),this.setTransport(nt),nt.send([{type:"upgrade"}]),this.emitReserved("upgrade",nt),nt=null,this.upgrading=!1,this.flush())})}else{const dt=new Error("probe error");dt.transport=nt.name,this.emitReserved("upgradeError",dt)}}))};function ot(){rt||(rt=!0,ut(),nt.close(),nt=null)}const at=ht=>{const dt=new Error("probe error: "+ht);dt.transport=nt.name,ot(),this.emitReserved("upgradeError",dt)};function st(){at("transport closed")}function lt(){at("socket closed")}function ct(ht){nt&&ht.name!==nt.name&&ot()}const ut=()=>{nt.removeListener("open",it),nt.removeListener("error",at),nt.removeListener("close",st),this.off("close",lt),this.off("upgrading",ct)};nt.once("open",it),nt.once("error",at),nt.once("close",st),this.once("close",lt),this.once("upgrading",ct),this.upgrades.indexOf("webtransport")!==-1&&et!=="webtransport"?this.setTimeoutFn(()=>{rt||nt.open()},200):nt.open()}onOpen(){if(this.readyState="open",Hm.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let et=0;const nt=this.upgrades.length;for(;et{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const et=this.getWritablePackets();this.transport.send(et),this.prevBufferLen=et.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let nt=1;for(let rt=0;rt0&&nt>this.maxPayload)return this.writeBuffer.slice(0,rt);nt+=2}return this.writeBuffer}write(et,nt,rt){return this.sendPacket("message",et,nt,rt),this}send(et,nt,rt){return this.sendPacket("message",et,nt,rt),this}sendPacket(et,nt,rt,it){if(typeof nt=="function"&&(it=nt,nt=void 0),typeof rt=="function"&&(it=rt,rt=null),this.readyState==="closing"||this.readyState==="closed")return;rt=rt||{},rt.compress=rt.compress!==!1;const ot={type:et,data:nt,options:rt};this.emitReserved("packetCreate",ot),this.writeBuffer.push(ot),it&&this.once("flush",it),this.flush()}close(){const et=()=>{this.onClose("forced close"),this.transport.close()},nt=()=>{this.off("upgrade",nt),this.off("upgradeError",nt),et()},rt=()=>{this.once("upgrade",nt),this.once("upgradeError",nt)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?rt():et()}):this.upgrading?rt():et()),this}onError(et){Hm.priorWebsocketSuccess=!1,this.emitReserved("error",et),this.onClose("transport error",et)}onClose(et,nt){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",et,nt),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(et){const nt=[];let rt=0;const it=et.length;for(;rttypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt.buffer instanceof ArrayBuffer,toString$4=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$4.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$4.call(File)==="[object FileConstructor]";function isBinary(tt){return withNativeArrayBuffer&&(tt instanceof ArrayBuffer||isView(tt))||withNativeBlob&&tt instanceof Blob||withNativeFile&&tt instanceof File}function hasBinary(tt,et){if(!tt||typeof tt!="object")return!1;if(Array.isArray(tt)){for(let nt=0,rt=tt.length;nt=0&&tt.num{delete this.acks[et];for(let at=0;at{this.io.clearTimeoutFn(ot),nt.apply(this,[null,...at])}}emitWithAck(et,...nt){const rt=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((it,ot)=>{nt.push((at,st)=>rt?at?ot(at):it(st):it(at)),this.emit(et,...nt)})}_addToQueue(et){let nt;typeof et[et.length-1]=="function"&&(nt=et.pop());const rt={id:this._queueSeq++,tryCount:0,pending:!1,args:et,flags:Object.assign({fromQueue:!0},this.flags)};et.push((it,...ot)=>rt!==this._queue[0]?void 0:(it!==null?rt.tryCount>this._opts.retries&&(this._queue.shift(),nt&&nt(it)):(this._queue.shift(),nt&&nt(null,...ot)),rt.pending=!1,this._drainQueue())),this._queue.push(rt),this._drainQueue()}_drainQueue(et=!1){if(!this.connected||this._queue.length===0)return;const nt=this._queue[0];nt.pending&&!et||(nt.pending=!0,nt.tryCount++,this.flags=nt.flags,this.emit.apply(this,nt.args))}packet(et){et.nsp=this.nsp,this.io._packet(et)}onopen(){typeof this.auth=="function"?this.auth(et=>{this._sendConnectPacket(et)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(et){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},et):et})}onerror(et){this.connected||this.emitReserved("connect_error",et)}onclose(et,nt){this.connected=!1,delete this.id,this.emitReserved("disconnect",et,nt)}onpacket(et){if(et.nsp===this.nsp)switch(et.type){case PacketType.CONNECT:et.data&&et.data.sid?this.onconnect(et.data.sid,et.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(et);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(et);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const rt=new Error(et.data.message);rt.data=et.data.data,this.emitReserved("connect_error",rt);break}}onevent(et){const nt=et.data||[];et.id!=null&&nt.push(this.ack(et.id)),this.connected?this.emitEvent(nt):this.receiveBuffer.push(Object.freeze(nt))}emitEvent(et){if(this._anyListeners&&this._anyListeners.length){const nt=this._anyListeners.slice();for(const rt of nt)rt.apply(this,et)}super.emit.apply(this,et),this._pid&&et.length&&typeof et[et.length-1]=="string"&&(this._lastOffset=et[et.length-1])}ack(et){const nt=this;let rt=!1;return function(...it){rt||(rt=!0,nt.packet({type:PacketType.ACK,id:et,data:it}))}}onack(et){const nt=this.acks[et.id];typeof nt=="function"&&(nt.apply(this,et.data),delete this.acks[et.id])}onconnect(et,nt){this.id=et,this.recovered=nt&&this._pid===nt,this._pid=nt,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(et=>this.emitEvent(et)),this.receiveBuffer=[],this.sendBuffer.forEach(et=>{this.notifyOutgoingListeners(et),this.packet(et)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(et=>et()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(et){return this.flags.compress=et,this}get volatile(){return this.flags.volatile=!0,this}timeout(et){return this.flags.timeout=et,this}onAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(et),this}prependAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(et),this}offAny(et){if(!this._anyListeners)return this;if(et){const nt=this._anyListeners;for(let rt=0;rt0&&tt.jitter<=1?tt.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var tt=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var et=Math.random(),nt=Math.floor(et*this.jitter*tt);tt=Math.floor(et*10)&1?tt+nt:tt-nt}return Math.min(tt,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(tt){this.ms=tt};Backoff.prototype.setMax=function(tt){this.max=tt};Backoff.prototype.setJitter=function(tt){this.jitter=tt};class Manager extends Emitter{constructor(et,nt){var rt;super(),this.nsps={},this.subs=[],et&&typeof et=="object"&&(nt=et,et=void 0),nt=nt||{},nt.path=nt.path||"/socket.io",this.opts=nt,installTimerFunctions(this,nt),this.reconnection(nt.reconnection!==!1),this.reconnectionAttempts(nt.reconnectionAttempts||1/0),this.reconnectionDelay(nt.reconnectionDelay||1e3),this.reconnectionDelayMax(nt.reconnectionDelayMax||5e3),this.randomizationFactor((rt=nt.randomizationFactor)!==null&&rt!==void 0?rt:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(nt.timeout==null?2e4:nt.timeout),this._readyState="closed",this.uri=et;const it=nt.parser||parser;this.encoder=new it.Encoder,this.decoder=new it.Decoder,this._autoConnect=nt.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(et){return arguments.length?(this._reconnection=!!et,this):this._reconnection}reconnectionAttempts(et){return et===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=et,this)}reconnectionDelay(et){var nt;return et===void 0?this._reconnectionDelay:(this._reconnectionDelay=et,(nt=this.backoff)===null||nt===void 0||nt.setMin(et),this)}randomizationFactor(et){var nt;return et===void 0?this._randomizationFactor:(this._randomizationFactor=et,(nt=this.backoff)===null||nt===void 0||nt.setJitter(et),this)}reconnectionDelayMax(et){var nt;return et===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=et,(nt=this.backoff)===null||nt===void 0||nt.setMax(et),this)}timeout(et){return arguments.length?(this._timeout=et,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(et){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const nt=this.engine,rt=this;this._readyState="opening",this.skipReconnect=!1;const it=on(nt,"open",function(){rt.onopen(),et&&et()}),ot=st=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",st),et?et(st):this.maybeReconnectOnOpen()},at=on(nt,"error",ot);if(this._timeout!==!1){const st=this._timeout,lt=this.setTimeoutFn(()=>{it(),ot(new Error("timeout")),nt.close()},st);this.opts.autoUnref&<.unref(),this.subs.push(()=>{this.clearTimeoutFn(lt)})}return this.subs.push(it),this.subs.push(at),this}connect(et){return this.open(et)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const et=this.engine;this.subs.push(on(et,"ping",this.onping.bind(this)),on(et,"data",this.ondata.bind(this)),on(et,"error",this.onerror.bind(this)),on(et,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(et){try{this.decoder.add(et)}catch(nt){this.onclose("parse error",nt)}}ondecoded(et){nextTick(()=>{this.emitReserved("packet",et)},this.setTimeoutFn)}onerror(et){this.emitReserved("error",et)}socket(et,nt){let rt=this.nsps[et];return rt?this._autoConnect&&!rt.active&&rt.connect():(rt=new Socket(this,et,nt),this.nsps[et]=rt),rt}_destroy(et){const nt=Object.keys(this.nsps);for(const rt of nt)if(this.nsps[rt].active)return;this._close()}_packet(et){const nt=this.encoder.encode(et);for(let rt=0;rtet()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(et,nt){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",et,nt),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const et=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const nt=this.backoff.duration();this._reconnecting=!0;const rt=this.setTimeoutFn(()=>{et.skipReconnect||(this.emitReserved("reconnect_attempt",et.backoff.attempts),!et.skipReconnect&&et.open(it=>{it?(et._reconnecting=!1,et.reconnect(),this.emitReserved("reconnect_error",it)):et.onreconnect()}))},nt);this.opts.autoUnref&&rt.unref(),this.subs.push(()=>{this.clearTimeoutFn(rt)})}}onreconnect(){const et=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",et)}}const cache={};function lookup(tt,et){typeof tt=="object"&&(et=tt,tt=void 0),et=et||{};const nt=url(tt,et.path||"/socket.io"),rt=nt.source,it=nt.id,ot=nt.path,at=cache[it]&&ot in cache[it].nsps,st=et.forceNew||et["force new connection"]||et.multiplex===!1||at;let lt;return st?lt=new Manager(rt,et):(cache[it]||(cache[it]=new Manager(rt,et)),lt=cache[it]),nt.query&&!et.query&&(et.query=nt.queryKey),lt.socket(nt.path,et)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const useSocket=()=>{const[tt,et]=reactExports.useState(null);return reactExports.useEffect(()=>{const nt=lookup(API_URL);return et(nt),()=>{nt.disconnect()}},[]),tt},defaultData$5={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},useTeachStore=react(tt=>({...defaultData$5,setAskedQuestion:et=>tt(nt=>({askedQuestions:[...nt.askedQuestions||[],et],hasQuestionInProgress:!0})),setAskedQuestionAnswer:et=>tt(nt=>({askedQuestionsAnswers:[...nt.askedQuestionsAnswers||[],et],hasQuestionInProgress:!1})),setHasQuestionInProgress:et=>tt({hasQuestionInProgress:et}),setHasTeachingInProgress:et=>tt({hasTeachingInProgress:et}),setHasInstagraphInProgress:et=>tt({hasInstagraphInProgress:et}),setTeachMeAnswer:et=>tt({hasTeachingInProgress:!1,teachMeAnswer:et}),setInstagraphAnswer:et=>{var nt,rt,it,ot;(nt=et==null?void 0:et.instagraph)!=null&&nt.edges&&((rt=et==null?void 0:et.instagraph)!=null&&rt.nodes)&&tt({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(it=et==null?void 0:et.instagraph)==null?void 0:it.edges,nodes:(ot=et==null?void 0:et.instagraph)==null?void 0:ot.nodes}})}}));async function updateBudget(tt){const et=await distExports$1.getBudget();(et==null?void 0:et.msg)==="Invalid Action"?tt(null):et!=null&&et.budget&&tt(et.budget)}const version="0.1.106",defaultData$4={addNodeModalData:null,currentModals:{budgetExplanation:!1,sourcesTable:!1,addContent:!1,editTopic:!1,addSource:!1}},useModalStore=create$3(tt=>({...defaultData$4,close:et=>{tt(nt=>({addNodeModalData:null,currentModals:{...nt.currentModals,[et]:!1}}))},open:et=>{tt(nt=>({currentModals:{...nt.currentModals,[et]:!0}}))}})),useModal=tt=>{const{open:et,close:nt,currentModals:rt}=useModalStore();return{close:()=>nt(tt),open:()=>et(tt),visible:rt[tt]}},ClearIcon$1=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Property 1=press",children:jsxRuntimeExports.jsx("path",{id:"close",d:"M16 17.2833L11.5083 21.775C11.3403 21.943 11.1264 22.0271 10.8667 22.0271C10.6069 22.0271 10.393 21.943 10.225 21.775C10.0569 21.6069 9.9729 21.393 9.9729 21.1333C9.9729 20.8736 10.0569 20.6597 10.225 20.4917L14.7167 16L10.225 11.5083C10.0569 11.3403 9.9729 11.1264 9.9729 10.8667C9.9729 10.6069 10.0569 10.393 10.225 10.225C10.393 10.0569 10.6069 9.9729 10.8667 9.9729C11.1264 9.9729 11.3403 10.0569 11.5083 10.225L16 14.7167L20.4917 10.225C20.6597 10.0569 20.8736 9.9729 21.1333 9.9729C21.393 9.9729 21.6069 10.0569 21.775 10.225C21.943 10.393 22.0271 10.6069 22.0271 10.8667C22.0271 11.1264 21.943 11.3403 21.775 11.5083L17.2833 16L21.775 20.4917C21.943 20.6597 22.0271 20.8736 22.0271 21.1333C22.0271 21.393 21.943 21.6069 21.775 21.775C21.6069 21.943 21.393 22.0271 21.1333 22.0271C20.8736 22.0271 20.6597 21.943 20.4917 21.775L16 17.2833Z",fill:"currentColor"})})}),scaleAnimation=We` +`,Universe=reactExports.memo(_Universe),PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(tt=>{PACKET_TYPES_REVERSE[PACKET_TYPES[tt]]=tt});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=tt=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt&&tt.buffer instanceof ArrayBuffer,encodePacket=({type:tt,data:et},nt,rt)=>withNativeBlob$1&&et instanceof Blob?nt?rt(et):encodeBlobAsBase64(et,rt):withNativeArrayBuffer$2&&(et instanceof ArrayBuffer||isView$1(et))?nt?rt(et):encodeBlobAsBase64(new Blob([et]),rt):rt(PACKET_TYPES[tt]+(et||"")),encodeBlobAsBase64=(tt,et)=>{const nt=new FileReader;return nt.onload=function(){const rt=nt.result.split(",")[1];et("b"+(rt||""))},nt.readAsDataURL(tt)};function toArray$1(tt){return tt instanceof Uint8Array?tt:tt instanceof ArrayBuffer?new Uint8Array(tt):new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(tt,et){if(withNativeBlob$1&&tt.data instanceof Blob)return tt.data.arrayBuffer().then(toArray$1).then(et);if(withNativeArrayBuffer$2&&(tt.data instanceof ArrayBuffer||isView$1(tt.data)))return et(toArray$1(tt.data));encodePacket(tt,!1,nt=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),et(TEXT_ENCODER.encode(nt))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let tt=0;tt{let et=tt.length*.75,nt=tt.length,rt,it=0,ot,at,st,lt;tt[tt.length-1]==="="&&(et--,tt[tt.length-2]==="="&&et--);const ct=new ArrayBuffer(et),ut=new Uint8Array(ct);for(rt=0;rt>4,ut[it++]=(at&15)<<4|st>>2,ut[it++]=(st&3)<<6|lt&63;return ct},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(tt,et)=>{if(typeof tt!="string")return{type:"message",data:mapBinary(tt,et)};const nt=tt.charAt(0);return nt==="b"?{type:"message",data:decodeBase64Packet(tt.substring(1),et)}:PACKET_TYPES_REVERSE[nt]?tt.length>1?{type:PACKET_TYPES_REVERSE[nt],data:tt.substring(1)}:{type:PACKET_TYPES_REVERSE[nt]}:ERROR_PACKET},decodeBase64Packet=(tt,et)=>{if(withNativeArrayBuffer$1){const nt=decode$1(tt);return mapBinary(nt,et)}else return{base64:!0,data:tt}},mapBinary=(tt,et)=>{switch(et){case"blob":return tt instanceof Blob?tt:new Blob([tt]);case"arraybuffer":default:return tt instanceof ArrayBuffer?tt:tt.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(tt,et)=>{const nt=tt.length,rt=new Array(nt);let it=0;tt.forEach((ot,at)=>{encodePacket(ot,!1,st=>{rt[at]=st,++it===nt&&et(rt.join(SEPARATOR))})})},decodePayload=(tt,et)=>{const nt=tt.split(SEPARATOR),rt=[];for(let it=0;it{const rt=nt.length;let it;if(rt<126)it=new Uint8Array(1),new DataView(it.buffer).setUint8(0,rt);else if(rt<65536){it=new Uint8Array(3);const ot=new DataView(it.buffer);ot.setUint8(0,126),ot.setUint16(1,rt)}else{it=new Uint8Array(9);const ot=new DataView(it.buffer);ot.setUint8(0,127),ot.setBigUint64(1,BigInt(rt))}tt.data&&typeof tt.data!="string"&&(it[0]|=128),et.enqueue(it),et.enqueue(nt)})}})}let TEXT_DECODER;function totalLength(tt){return tt.reduce((et,nt)=>et+nt.length,0)}function concatChunks(tt,et){if(tt[0].length===et)return tt.shift();const nt=new Uint8Array(et);let rt=0;for(let it=0;itMath.pow(2,53-32)-1){st.enqueue(ERROR_PACKET);break}it=ut*Math.pow(2,32)+ct.getUint32(4),rt=3}else{if(totalLength(nt)tt){st.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(tt){if(tt)return mixin(tt)}function mixin(tt){for(var et in Emitter.prototype)tt[et]=Emitter.prototype[et];return tt}Emitter.prototype.on=Emitter.prototype.addEventListener=function(tt,et){return this._callbacks=this._callbacks||{},(this._callbacks["$"+tt]=this._callbacks["$"+tt]||[]).push(et),this};Emitter.prototype.once=function(tt,et){function nt(){this.off(tt,nt),et.apply(this,arguments)}return nt.fn=et,this.on(tt,nt),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(tt,et){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var nt=this._callbacks["$"+tt];if(!nt)return this;if(arguments.length==1)return delete this._callbacks["$"+tt],this;for(var rt,it=0;ittypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick(tt,...et){return et.reduce((nt,rt)=>(tt.hasOwnProperty(rt)&&(nt[rt]=tt[rt]),nt),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(tt,et){et.useNativeTimers?(tt.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),tt.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(tt.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),tt.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(tt){return typeof tt=="string"?utf8Length(tt):Math.ceil((tt.byteLength||tt.size)*BASE64_OVERHEAD)}function utf8Length(tt){let et=0,nt=0;for(let rt=0,it=tt.length;rt=57344?nt+=3:(rt++,nt+=4);return nt}function encode$1(tt){let et="";for(let nt in tt)tt.hasOwnProperty(nt)&&(et.length&&(et+="&"),et+=encodeURIComponent(nt)+"="+encodeURIComponent(tt[nt]));return et}function decode(tt){let et={},nt=tt.split("&");for(let rt=0,it=nt.length;rt0);return et}function yeast(){const tt=encode(+new Date);return tt!==prev?(seed=0,prev=tt):tt+"."+encode(seed++)}for(;i$1{this.readyState="paused",et()};if(this.polling||!this.writable){let rt=0;this.polling&&(rt++,this.once("pollComplete",function(){--rt||nt()})),this.writable||(rt++,this.once("drain",function(){--rt||nt()}))}else nt()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(et){const nt=rt=>{if(this.readyState==="opening"&&rt.type==="open"&&this.onOpen(),rt.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(rt)};decodePayload(et,this.socket.binaryType).forEach(nt),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const et=()=>{this.write([{type:"close"}])};this.readyState==="open"?et():this.once("open",et)}write(et){this.writable=!1,encodePayload(et,nt=>{this.doWrite(nt,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const et=this.opts.secure?"https":"http",nt=this.query||{};return this.opts.timestampRequests!==!1&&(nt[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!nt.sid&&(nt.b64=1),this.createUri(et,nt)}request(et={}){return Object.assign(et,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request$1(this.uri(),et)}doWrite(et,nt){const rt=this.request({method:"POST",data:et});rt.on("success",nt),rt.on("error",(it,ot)=>{this.onError("xhr post error",it,ot)})}doPoll(){const et=this.request();et.on("data",this.onData.bind(this)),et.on("error",(nt,rt)=>{this.onError("xhr poll error",nt,rt)}),this.pollXhr=et}}let Request$1=class O0 extends Emitter{constructor(et,nt){super(),installTimerFunctions(this,nt),this.opts=nt,this.method=nt.method||"GET",this.uri=et,this.data=nt.data!==void 0?nt.data:null,this.create()}create(){var et;const nt=pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");nt.xdomain=!!this.opts.xd;const rt=this.xhr=new XHR(nt);try{rt.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){rt.setDisableHeaderCheck&&rt.setDisableHeaderCheck(!0);for(let it in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(it)&&rt.setRequestHeader(it,this.opts.extraHeaders[it])}}catch{}if(this.method==="POST")try{rt.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{rt.setRequestHeader("Accept","*/*")}catch{}(et=this.opts.cookieJar)===null||et===void 0||et.addCookies(rt),"withCredentials"in rt&&(rt.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(rt.timeout=this.opts.requestTimeout),rt.onreadystatechange=()=>{var it;rt.readyState===3&&((it=this.opts.cookieJar)===null||it===void 0||it.parseCookies(rt)),rt.readyState===4&&(rt.status===200||rt.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof rt.status=="number"?rt.status:0)},0))},rt.send(this.data)}catch(it){this.setTimeoutFn(()=>{this.onError(it)},0);return}typeof document<"u"&&(this.index=O0.requestsCount++,O0.requests[this.index]=this)}onError(et){this.emitReserved("error",et,this.xhr),this.cleanup(!0)}cleanup(et){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty$1,et)try{this.xhr.abort()}catch{}typeof document<"u"&&delete O0.requests[this.index],this.xhr=null}}onLoad(){const et=this.xhr.responseText;et!==null&&(this.emitReserved("data",et),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Request$1.requestsCount=0;Request$1.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const tt="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(tt,unloadHandler,!1)}}function unloadHandler(){for(let tt in Request$1.requests)Request$1.requests.hasOwnProperty(tt)&&Request$1.requests[tt].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?et=>Promise.resolve().then(et):(et,nt)=>nt(et,0))(),WebSocket=globalThisShim.WebSocket||globalThisShim.MozWebSocket,usingBrowserWebSocket=!0,defaultBinaryType="arraybuffer",isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WS extends Transport{constructor(et){super(et),this.supportsBinary=!et.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const et=this.uri(),nt=this.opts.protocols,rt=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(rt.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?nt?new WebSocket(et,nt):new WebSocket(et):new WebSocket(et,nt,rt)}catch(it){return this.emitReserved("error",it)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=et=>this.onClose({description:"websocket connection closed",context:et}),this.ws.onmessage=et=>this.onData(et.data),this.ws.onerror=et=>this.onError("websocket error",et)}write(et){this.writable=!1;for(let nt=0;nt{const at={};try{usingBrowserWebSocket&&this.ws.send(ot)}catch{}it&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const et=this.opts.secure?"wss":"ws",nt=this.query||{};return this.opts.timestampRequests&&(nt[this.opts.timestampParam]=yeast()),this.supportsBinary||(nt.b64=1),this.createUri(et,nt)}check(){return!!WebSocket}}class WT extends Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(et=>{this.onError("webtransport error",et)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(et=>{const nt=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),rt=et.readable.pipeThrough(nt).getReader(),it=createPacketEncoderStream();it.readable.pipeTo(et.writable),this.writer=it.writable.getWriter();const ot=()=>{rt.read().then(({done:st,value:lt})=>{st||(this.onPacket(lt),ot())}).catch(st=>{})};ot();const at={type:"open"};this.query.sid&&(at.data=`{"sid":"${this.query.sid}"}`),this.writer.write(at).then(()=>this.onOpen())})}))}write(et){this.writable=!1;for(let nt=0;nt{it&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var et;(et=this.transport)===null||et===void 0||et.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re$1=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse(tt){const et=tt,nt=tt.indexOf("["),rt=tt.indexOf("]");nt!=-1&&rt!=-1&&(tt=tt.substring(0,nt)+tt.substring(nt,rt).replace(/:/g,";")+tt.substring(rt,tt.length));let it=re$1.exec(tt||""),ot={},at=14;for(;at--;)ot[parts[at]]=it[at]||"";return nt!=-1&&rt!=-1&&(ot.source=et,ot.host=ot.host.substring(1,ot.host.length-1).replace(/;/g,":"),ot.authority=ot.authority.replace("[","").replace("]","").replace(/;/g,":"),ot.ipv6uri=!0),ot.pathNames=pathNames(ot,ot.path),ot.queryKey=queryKey(ot,ot.query),ot}function pathNames(tt,et){const nt=/\/{2,9}/g,rt=et.replace(nt,"/").split("/");return(et.slice(0,1)=="/"||et.length===0)&&rt.splice(0,1),et.slice(-1)=="/"&&rt.splice(rt.length-1,1),rt}function queryKey(tt,et){const nt={};return et.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(rt,it,ot){it&&(nt[it]=ot)}),nt}let Socket$1=class Hm extends Emitter{constructor(et,nt={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],et&&typeof et=="object"&&(nt=et,et=null),et?(et=parse(et),nt.hostname=et.host,nt.secure=et.protocol==="https"||et.protocol==="wss",nt.port=et.port,et.query&&(nt.query=et.query)):nt.host&&(nt.hostname=parse(nt.host).host),installTimerFunctions(this,nt),this.secure=nt.secure!=null?nt.secure:typeof location<"u"&&location.protocol==="https:",nt.hostname&&!nt.port&&(nt.port=this.secure?"443":"80"),this.hostname=nt.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=nt.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=nt.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},nt),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(et){const nt=Object.assign({},this.opts.query);nt.EIO=protocol$1,nt.transport=et,this.id&&(nt.sid=this.id);const rt=Object.assign({},this.opts,{query:nt,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[et]);return new transports[et](rt)}open(){let et;if(this.opts.rememberUpgrade&&Hm.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)et="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else et=this.transports[0];this.readyState="opening";try{et=this.createTransport(et)}catch{this.transports.shift(),this.open();return}et.open(),this.setTransport(et)}setTransport(et){this.transport&&this.transport.removeAllListeners(),this.transport=et,et.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",nt=>this.onClose("transport close",nt))}probe(et){let nt=this.createTransport(et),rt=!1;Hm.priorWebsocketSuccess=!1;const it=()=>{rt||(nt.send([{type:"ping",data:"probe"}]),nt.once("packet",ht=>{if(!rt)if(ht.type==="pong"&&ht.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",nt),!nt)return;Hm.priorWebsocketSuccess=nt.name==="websocket",this.transport.pause(()=>{rt||this.readyState!=="closed"&&(ut(),this.setTransport(nt),nt.send([{type:"upgrade"}]),this.emitReserved("upgrade",nt),nt=null,this.upgrading=!1,this.flush())})}else{const dt=new Error("probe error");dt.transport=nt.name,this.emitReserved("upgradeError",dt)}}))};function ot(){rt||(rt=!0,ut(),nt.close(),nt=null)}const at=ht=>{const dt=new Error("probe error: "+ht);dt.transport=nt.name,ot(),this.emitReserved("upgradeError",dt)};function st(){at("transport closed")}function lt(){at("socket closed")}function ct(ht){nt&&ht.name!==nt.name&&ot()}const ut=()=>{nt.removeListener("open",it),nt.removeListener("error",at),nt.removeListener("close",st),this.off("close",lt),this.off("upgrading",ct)};nt.once("open",it),nt.once("error",at),nt.once("close",st),this.once("close",lt),this.once("upgrading",ct),this.upgrades.indexOf("webtransport")!==-1&&et!=="webtransport"?this.setTimeoutFn(()=>{rt||nt.open()},200):nt.open()}onOpen(){if(this.readyState="open",Hm.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let et=0;const nt=this.upgrades.length;for(;et{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const et=this.getWritablePackets();this.transport.send(et),this.prevBufferLen=et.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let nt=1;for(let rt=0;rt0&&nt>this.maxPayload)return this.writeBuffer.slice(0,rt);nt+=2}return this.writeBuffer}write(et,nt,rt){return this.sendPacket("message",et,nt,rt),this}send(et,nt,rt){return this.sendPacket("message",et,nt,rt),this}sendPacket(et,nt,rt,it){if(typeof nt=="function"&&(it=nt,nt=void 0),typeof rt=="function"&&(it=rt,rt=null),this.readyState==="closing"||this.readyState==="closed")return;rt=rt||{},rt.compress=rt.compress!==!1;const ot={type:et,data:nt,options:rt};this.emitReserved("packetCreate",ot),this.writeBuffer.push(ot),it&&this.once("flush",it),this.flush()}close(){const et=()=>{this.onClose("forced close"),this.transport.close()},nt=()=>{this.off("upgrade",nt),this.off("upgradeError",nt),et()},rt=()=>{this.once("upgrade",nt),this.once("upgradeError",nt)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?rt():et()}):this.upgrading?rt():et()),this}onError(et){Hm.priorWebsocketSuccess=!1,this.emitReserved("error",et),this.onClose("transport error",et)}onClose(et,nt){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",et,nt),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(et){const nt=[];let rt=0;const it=et.length;for(;rttypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt.buffer instanceof ArrayBuffer,toString$4=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$4.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$4.call(File)==="[object FileConstructor]";function isBinary(tt){return withNativeArrayBuffer&&(tt instanceof ArrayBuffer||isView(tt))||withNativeBlob&&tt instanceof Blob||withNativeFile&&tt instanceof File}function hasBinary(tt,et){if(!tt||typeof tt!="object")return!1;if(Array.isArray(tt)){for(let nt=0,rt=tt.length;nt=0&&tt.num{delete this.acks[et];for(let at=0;at{this.io.clearTimeoutFn(ot),nt.apply(this,[null,...at])}}emitWithAck(et,...nt){const rt=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((it,ot)=>{nt.push((at,st)=>rt?at?ot(at):it(st):it(at)),this.emit(et,...nt)})}_addToQueue(et){let nt;typeof et[et.length-1]=="function"&&(nt=et.pop());const rt={id:this._queueSeq++,tryCount:0,pending:!1,args:et,flags:Object.assign({fromQueue:!0},this.flags)};et.push((it,...ot)=>rt!==this._queue[0]?void 0:(it!==null?rt.tryCount>this._opts.retries&&(this._queue.shift(),nt&&nt(it)):(this._queue.shift(),nt&&nt(null,...ot)),rt.pending=!1,this._drainQueue())),this._queue.push(rt),this._drainQueue()}_drainQueue(et=!1){if(!this.connected||this._queue.length===0)return;const nt=this._queue[0];nt.pending&&!et||(nt.pending=!0,nt.tryCount++,this.flags=nt.flags,this.emit.apply(this,nt.args))}packet(et){et.nsp=this.nsp,this.io._packet(et)}onopen(){typeof this.auth=="function"?this.auth(et=>{this._sendConnectPacket(et)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(et){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},et):et})}onerror(et){this.connected||this.emitReserved("connect_error",et)}onclose(et,nt){this.connected=!1,delete this.id,this.emitReserved("disconnect",et,nt)}onpacket(et){if(et.nsp===this.nsp)switch(et.type){case PacketType.CONNECT:et.data&&et.data.sid?this.onconnect(et.data.sid,et.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(et);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(et);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const rt=new Error(et.data.message);rt.data=et.data.data,this.emitReserved("connect_error",rt);break}}onevent(et){const nt=et.data||[];et.id!=null&&nt.push(this.ack(et.id)),this.connected?this.emitEvent(nt):this.receiveBuffer.push(Object.freeze(nt))}emitEvent(et){if(this._anyListeners&&this._anyListeners.length){const nt=this._anyListeners.slice();for(const rt of nt)rt.apply(this,et)}super.emit.apply(this,et),this._pid&&et.length&&typeof et[et.length-1]=="string"&&(this._lastOffset=et[et.length-1])}ack(et){const nt=this;let rt=!1;return function(...it){rt||(rt=!0,nt.packet({type:PacketType.ACK,id:et,data:it}))}}onack(et){const nt=this.acks[et.id];typeof nt=="function"&&(nt.apply(this,et.data),delete this.acks[et.id])}onconnect(et,nt){this.id=et,this.recovered=nt&&this._pid===nt,this._pid=nt,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(et=>this.emitEvent(et)),this.receiveBuffer=[],this.sendBuffer.forEach(et=>{this.notifyOutgoingListeners(et),this.packet(et)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(et=>et()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(et){return this.flags.compress=et,this}get volatile(){return this.flags.volatile=!0,this}timeout(et){return this.flags.timeout=et,this}onAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(et),this}prependAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(et),this}offAny(et){if(!this._anyListeners)return this;if(et){const nt=this._anyListeners;for(let rt=0;rt0&&tt.jitter<=1?tt.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var tt=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var et=Math.random(),nt=Math.floor(et*this.jitter*tt);tt=Math.floor(et*10)&1?tt+nt:tt-nt}return Math.min(tt,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(tt){this.ms=tt};Backoff.prototype.setMax=function(tt){this.max=tt};Backoff.prototype.setJitter=function(tt){this.jitter=tt};class Manager extends Emitter{constructor(et,nt){var rt;super(),this.nsps={},this.subs=[],et&&typeof et=="object"&&(nt=et,et=void 0),nt=nt||{},nt.path=nt.path||"/socket.io",this.opts=nt,installTimerFunctions(this,nt),this.reconnection(nt.reconnection!==!1),this.reconnectionAttempts(nt.reconnectionAttempts||1/0),this.reconnectionDelay(nt.reconnectionDelay||1e3),this.reconnectionDelayMax(nt.reconnectionDelayMax||5e3),this.randomizationFactor((rt=nt.randomizationFactor)!==null&&rt!==void 0?rt:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(nt.timeout==null?2e4:nt.timeout),this._readyState="closed",this.uri=et;const it=nt.parser||parser;this.encoder=new it.Encoder,this.decoder=new it.Decoder,this._autoConnect=nt.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(et){return arguments.length?(this._reconnection=!!et,this):this._reconnection}reconnectionAttempts(et){return et===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=et,this)}reconnectionDelay(et){var nt;return et===void 0?this._reconnectionDelay:(this._reconnectionDelay=et,(nt=this.backoff)===null||nt===void 0||nt.setMin(et),this)}randomizationFactor(et){var nt;return et===void 0?this._randomizationFactor:(this._randomizationFactor=et,(nt=this.backoff)===null||nt===void 0||nt.setJitter(et),this)}reconnectionDelayMax(et){var nt;return et===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=et,(nt=this.backoff)===null||nt===void 0||nt.setMax(et),this)}timeout(et){return arguments.length?(this._timeout=et,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(et){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const nt=this.engine,rt=this;this._readyState="opening",this.skipReconnect=!1;const it=on(nt,"open",function(){rt.onopen(),et&&et()}),ot=st=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",st),et?et(st):this.maybeReconnectOnOpen()},at=on(nt,"error",ot);if(this._timeout!==!1){const st=this._timeout,lt=this.setTimeoutFn(()=>{it(),ot(new Error("timeout")),nt.close()},st);this.opts.autoUnref&<.unref(),this.subs.push(()=>{this.clearTimeoutFn(lt)})}return this.subs.push(it),this.subs.push(at),this}connect(et){return this.open(et)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const et=this.engine;this.subs.push(on(et,"ping",this.onping.bind(this)),on(et,"data",this.ondata.bind(this)),on(et,"error",this.onerror.bind(this)),on(et,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(et){try{this.decoder.add(et)}catch(nt){this.onclose("parse error",nt)}}ondecoded(et){nextTick(()=>{this.emitReserved("packet",et)},this.setTimeoutFn)}onerror(et){this.emitReserved("error",et)}socket(et,nt){let rt=this.nsps[et];return rt?this._autoConnect&&!rt.active&&rt.connect():(rt=new Socket(this,et,nt),this.nsps[et]=rt),rt}_destroy(et){const nt=Object.keys(this.nsps);for(const rt of nt)if(this.nsps[rt].active)return;this._close()}_packet(et){const nt=this.encoder.encode(et);for(let rt=0;rtet()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(et,nt){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",et,nt),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const et=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const nt=this.backoff.duration();this._reconnecting=!0;const rt=this.setTimeoutFn(()=>{et.skipReconnect||(this.emitReserved("reconnect_attempt",et.backoff.attempts),!et.skipReconnect&&et.open(it=>{it?(et._reconnecting=!1,et.reconnect(),this.emitReserved("reconnect_error",it)):et.onreconnect()}))},nt);this.opts.autoUnref&&rt.unref(),this.subs.push(()=>{this.clearTimeoutFn(rt)})}}onreconnect(){const et=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",et)}}const cache={};function lookup(tt,et){typeof tt=="object"&&(et=tt,tt=void 0),et=et||{};const nt=url(tt,et.path||"/socket.io"),rt=nt.source,it=nt.id,ot=nt.path,at=cache[it]&&ot in cache[it].nsps,st=et.forceNew||et["force new connection"]||et.multiplex===!1||at;let lt;return st?lt=new Manager(rt,et):(cache[it]||(cache[it]=new Manager(rt,et)),lt=cache[it]),nt.query&&!et.query&&(et.query=nt.queryKey),lt.socket(nt.path,et)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const useSocket=()=>{const[tt,et]=reactExports.useState(null);return reactExports.useEffect(()=>{const nt=lookup(API_URL);return et(nt),()=>{nt.disconnect()}},[]),tt},defaultData$5={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},useTeachStore=react(tt=>({...defaultData$5,setAskedQuestion:et=>tt(nt=>({askedQuestions:[...nt.askedQuestions||[],et],hasQuestionInProgress:!0})),setAskedQuestionAnswer:et=>tt(nt=>({askedQuestionsAnswers:[...nt.askedQuestionsAnswers||[],et],hasQuestionInProgress:!1})),setHasQuestionInProgress:et=>tt({hasQuestionInProgress:et}),setHasTeachingInProgress:et=>tt({hasTeachingInProgress:et}),setHasInstagraphInProgress:et=>tt({hasInstagraphInProgress:et}),setTeachMeAnswer:et=>tt({hasTeachingInProgress:!1,teachMeAnswer:et}),setInstagraphAnswer:et=>{var nt,rt,it,ot;(nt=et==null?void 0:et.instagraph)!=null&&nt.edges&&((rt=et==null?void 0:et.instagraph)!=null&&rt.nodes)&&tt({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(it=et==null?void 0:et.instagraph)==null?void 0:it.edges,nodes:(ot=et==null?void 0:et.instagraph)==null?void 0:ot.nodes}})}}));async function updateBudget(tt){const et=await distExports$1.getBudget();(et==null?void 0:et.msg)==="Invalid Action"?tt(null):et!=null&&et.budget&&tt(et.budget)}const version="0.1.106",defaultData$4={addNodeModalData:null,currentModals:{budgetExplanation:!1,sourcesTable:!1,addContent:!1,editTopic:!1,addSource:!1,mergeTopic:!1,briefDescription:!1}},useModalStore=create$3(tt=>({...defaultData$4,close:et=>{tt(nt=>({addNodeModalData:null,currentModals:{...nt.currentModals,[et]:!1}}))},open:et=>{tt(nt=>({currentModals:{...nt.currentModals,[et]:!0}}))}})),useModal=tt=>{const{open:et,close:nt,currentModals:rt}=useModalStore();return{close:()=>nt(tt),open:()=>et(tt),visible:rt[tt]}},ClearIcon$1=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Property 1=press",children:jsxRuntimeExports.jsx("path",{id:"close",d:"M16 17.2833L11.5083 21.775C11.3403 21.943 11.1264 22.0271 10.8667 22.0271C10.6069 22.0271 10.393 21.943 10.225 21.775C10.0569 21.6069 9.9729 21.393 9.9729 21.1333C9.9729 20.8736 10.0569 20.6597 10.225 20.4917L14.7167 16L10.225 11.5083C10.0569 11.3403 9.9729 11.1264 9.9729 10.8667C9.9729 10.6069 10.0569 10.393 10.225 10.225C10.393 10.0569 10.6069 9.9729 10.8667 9.9729C11.1264 9.9729 11.3403 10.0569 11.5083 10.225L16 14.7167L20.4917 10.225C20.6597 10.0569 20.8736 9.9729 21.1333 9.9729C21.393 9.9729 21.6069 10.0569 21.775 10.225C21.943 10.393 22.0271 10.6069 22.0271 10.8667C22.0271 11.1264 21.943 11.3403 21.775 11.5083L17.2833 16L21.775 20.4917C21.943 20.6597 22.0271 20.8736 22.0271 21.1333C22.0271 21.393 21.943 21.6069 21.775 21.775C21.6069 21.943 21.393 22.0271 21.1333 22.0271C20.8736 22.0271 20.6597 21.943 20.4917 21.775L16 17.2833Z",fill:"currentColor"})})}),scaleAnimation=We` 0% { transform: scale(0.8); } @@ -5074,10 +5074,10 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */lodash.exports;(function(tt,et){(function(){var nt,rt="4.17.21",it=200,ot="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",at="Expected a function",st="Invalid `variable` option passed into `_.template`",lt="__lodash_hash_undefined__",ct=500,ut="__lodash_placeholder__",ht=1,dt=2,pt=4,mt=1,gt=2,yt=1,bt=2,wt=4,xt=8,kt=16,St=32,Tt=64,At=128,Et=256,Ct=512,Lt=30,jt="...",Rt=800,$t=16,vt=1,It=2,Ot=3,Wt=1/0,zt=9007199254740991,Ft=17976931348623157e292,Nt=0/0,Ut=4294967295,Pt=Ut-1,Ht=Ut>>>1,Qt=[["ary",At],["bind",yt],["bindKey",bt],["curry",xt],["curryRight",kt],["flip",Ct],["partial",St],["partialRight",Tt],["rearg",Et]],an="[object Arguments]",Yt="[object Array]",nn="[object AsyncFunction]",tn="[object Boolean]",dn="[object Date]",wn="[object DOMException]",rn="[object Error]",Jt="[object Function]",vn="[object GeneratorFunction]",Cn="[object Map]",$n="[object Number]",Nn="[object Null]",En="[object Object]",sn="[object Promise]",pn="[object Proxy]",Tn="[object RegExp]",In="[object Set]",yn="[object String]",hn="[object Symbol]",fn="[object Undefined]",xn="[object WeakMap]",jn="[object WeakSet]",cn="[object ArrayBuffer]",Xt="[object DataView]",Kt="[object Float32Array]",kn="[object Float64Array]",Mn="[object Int8Array]",On="[object Int16Array]",Bn="[object Int32Array]",Xn="[object Uint8Array]",Vn="[object Uint8ClampedArray]",Gn="[object Uint16Array]",zn="[object Uint32Array]",Zn=/\b__p \+= '';/g,Wn=/\b(__p \+=) '' \+/g,fr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ur=/&(?:amp|lt|gt|quot|#39);/g,wr=/[&<>"']/g,Xr=RegExp(ur.source),Er=RegExp(wr.source),Ir=/<%-([\s\S]+?)%>/g,Gr=/<%([\s\S]+?)%>/g,Or=/<%=([\s\S]+?)%>/g,Lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oo=/^\w*$/,qr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jr=/[\\^$.*+?()[\]{}|]/g,mo=RegExp(jr.source),_n=/^\s+/,Pn=/\s/,un=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Zt=/\{\n\/\* \[wrapped with (.+)\] \*/,Sn=/,? & /,Dn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fn=/[()=,{}\[\]\/\s]/,Yn=/\\(\\)?/g,tr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ar=/\w*$/,lr=/^[-+]0x[0-9a-f]+$/i,Vr=/^0b[01]+$/i,vr=/^\[object .+?Constructor\]$/,Nr=/^0o[0-7]+$/i,Hr=/^(?:0|[1-9]\d*)$/,eo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zr=/($^)/,Jr=/['\n\r\u2028\u2029\\]/g,br="\\ud800-\\udfff",Pr="\\u0300-\\u036f",Fr="\\ufe20-\\ufe2f",Mr="\\u20d0-\\u20ff",Cr=Pr+Fr+Mr,Dr="\\u2700-\\u27bf",Ur="a-z\\xdf-\\xf6\\xf8-\\xff",Rr="\\xac\\xb1\\xd7\\xf7",er="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rr="\\u2000-\\u206f",xr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dr="A-Z\\xc0-\\xd6\\xd8-\\xde",yr="\\ufe0e\\ufe0f",$r=Rr+er+rr+xr,no="['’]",ao="["+br+"]",ho="["+$r+"]",fo="["+Cr+"]",qn="\\d+",wo="["+Dr+"]",vo="["+Ur+"]",_o="[^"+br+$r+qn+Dr+Ur+dr+"]",yo="\\ud83c[\\udffb-\\udfff]",Ao="(?:"+fo+"|"+yo+")",Mo="[^"+br+"]",zo="(?:\\ud83c[\\udde6-\\uddff]){2}",Co="[\\ud800-\\udbff][\\udc00-\\udfff]",Lo="["+dr+"]",Ho="\\u200d",Ko="(?:"+vo+"|"+_o+")",na="(?:"+Lo+"|"+_o+")",Qo="(?:"+no+"(?:d|ll|m|re|s|t|ve))?",xa="(?:"+no+"(?:D|LL|M|RE|S|T|VE))?",Xo=Ao+"?",fu="["+yr+"]?",_c="(?:"+Ho+"(?:"+[Mo,zo,Co].join("|")+")"+fu+Xo+")*",No="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",eu=fu+Xo+_c,ip="(?:"+[wo,zo,Co].join("|")+")"+eu,Mp="(?:"+[Mo+fo+"?",fo,zo,Co,ao].join("|")+")",pm=RegExp(no,"g"),es=RegExp(fo,"g"),pu=RegExp(yo+"(?="+yo+")|"+Mp+eu,"g"),mm=RegExp([Lo+"?"+vo+"+"+Qo+"(?="+[ho,Lo,"$"].join("|")+")",na+"+"+xa+"(?="+[ho,Lo+Ko,"$"].join("|")+")",Lo+"?"+Ko+"+"+Qo,Lo+"+"+xa,Pp,No,qn,ip].join("|"),"g"),Fs=RegExp("["+Ho+br+Cr+yr+"]"),Rp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ks=-1,qo={};qo[Kt]=qo[kn]=qo[Mn]=qo[On]=qo[Bn]=qo[Xn]=qo[Vn]=qo[Gn]=qo[zn]=!0,qo[an]=qo[Yt]=qo[cn]=qo[tn]=qo[Xt]=qo[dn]=qo[rn]=qo[Jt]=qo[Cn]=qo[$n]=qo[En]=qo[Tn]=qo[In]=qo[yn]=qo[xn]=!1;var Yo={};Yo[an]=Yo[Yt]=Yo[cn]=Yo[Xt]=Yo[tn]=Yo[dn]=Yo[Kt]=Yo[kn]=Yo[Mn]=Yo[On]=Yo[Bn]=Yo[Cn]=Yo[$n]=Yo[En]=Yo[Tn]=Yo[In]=Yo[yn]=Yo[hn]=Yo[Xn]=Yo[Vn]=Yo[Gn]=Yo[zn]=!0,Yo[rn]=Yo[Jt]=Yo[xn]=!1;var Xs={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Us={"&":"&","<":"<",">":">",'"':""","'":"'"},tu={"&":"&","<":"<",">":">",""":'"',"'":"'"},Al={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bp=parseFloat,Op=parseInt,zs=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Vu=typeof self=="object"&&self&&self.Object===Object&&self,ts=zs||Vu||Function("return this")(),mu=et&&!et.nodeType&&et,ss=mu&&!0&&tt&&!tt.nodeType&&tt,gs=ss&&ss.exports===mu,Tu=gs&&zs.process,ns=function(){try{var Qn=ss&&ss.require&&ss.require("util").types;return Qn||Tu&&Tu.binding&&Tu.binding("util")}catch{}}(),gu=ns&&ns.isArrayBuffer,Hu=ns&&ns.isDate,jp=ns&&ns.isMap,ys=ns&&ns.isRegExp,$s=ns&&ns.isSet,rs=ns&&ns.isTypedArray;function Wo(Qn,Sr,pr){switch(pr.length){case 0:return Qn.call(Sr);case 1:return Qn.call(Sr,pr[0]);case 2:return Qn.call(Sr,pr[0],pr[1]);case 3:return Qn.call(Sr,pr[0],pr[1],pr[2])}return Qn.apply(Sr,pr)}function Zs(Qn,Sr,pr,ro){for(var Eo=-1,$o=Qn==null?0:Qn.length;++Eo<$o;){var $a=Qn[Eo];Sr(ro,$a,pr($a),Qn)}return ro}function bs(Qn,Sr){for(var pr=-1,ro=Qn==null?0:Qn.length;++pr-1}function op(Qn,Sr,pr){for(var ro=-1,Eo=Qn==null?0:Qn.length;++ro-1;);return pr}function lp(Qn,Sr){for(var pr=Qn.length;pr--&&Ll(Sr,Qn[pr],0)>-1;);return pr}function Ul(Qn,Sr){for(var pr=Qn.length,ro=0;pr--;)Qn[pr]===Sr&&++ro;return ro}var Ny=qs(Xs),Dy=qs(Us);function Km(Qn){return"\\"+Al[Qn]}function Xm(Qn,Sr){return Qn==null?nt:Qn[Sr]}function Gu(Qn){return Fs.test(Qn)}function Fp(Qn){return Rp.test(Qn)}function cp(Qn){for(var Sr,pr=[];!(Sr=Qn.next()).done;)pr.push(Sr.value);return pr}function Up(Qn){var Sr=-1,pr=Array(Qn.size);return Qn.forEach(function(ro,Eo){pr[++Sr]=[Eo,ro]}),pr}function up(Qn,Sr){return function(pr){return Qn(Sr(pr))}}function Wl(Qn,Sr){for(var pr=-1,ro=Qn.length,Eo=0,$o=[];++pr-1}function km(Mt,Vt){var qt=this.__data__,gn=Ru(qt,Mt);return gn<0?(++this.size,qt.push([Mt,Vt])):qt[gn][1]=Vt,this}Vl.prototype.clear=o0,Vl.prototype.delete=iy,Vl.prototype.get=a0,Vl.prototype.has=s0,Vl.prototype.set=km;function $l(Mt){var Vt=-1,qt=Mt==null?0:Mt.length;for(this.clear();++Vt=Vt?Mt:Vt)),Mt}function yl(Mt,Vt,qt,gn,Rn,Un){var Kn,Jn=Vt&ht,or=Vt&dt,Tr=Vt&pt;if(qt&&(Kn=Rn?qt(Mt,gn,Rn,Un):qt(Mt)),Kn!==nt)return Kn;if(!hs(Mt))return Mt;var Ar=Po(Mt);if(Ar){if(Kn=Sw(Mt),!Jn)return Ns(Mt,Kn)}else{var Br=Ys(Mt),Qr=Br==Jt||Br==vn;if(Cp(Mt))return Iy(Mt,Jn);if(Br==En||Br==an||Qr&&!Rn){if(Kn=or||Qr?{}:S1(Mt),!Jn)return or?k0(Mt,f0(Kn,Mt)):H0(Mt,uy(Kn,Mt))}else{if(!Yo[Br])return Rn?Mt:{};Kn=Ew(Mt,Br,Jn)}}Un||(Un=new _s);var co=Un.get(Mt);if(co)return co;Un.set(Mt,Kn),Q1(Mt)?Mt.forEach(function(So){Kn.add(yl(So,Vt,qt,So,Mt,Un))}):Z1(Mt)&&Mt.forEach(function(So,Fo){Kn.set(Fo,yl(So,Vt,qt,Fo,Mt,Un))});var ko=Tr?or?Uo:ps:or?Bl:Ls,Do=Ar?nt:ko(Mt);return bs(Do||Mt,function(So,Fo){Do&&(Fo=So,So=Mt[Fo]),Hl(Kn,Fo,yl(So,Vt,qt,Fo,Mt,Un))}),Kn}function hy(Mt){var Vt=Ls(Mt);return function(qt){return Im(qt,Mt,Vt)}}function Im(Mt,Vt,qt){var gn=qt.length;if(Mt==null)return!gn;for(Mt=xo(Mt);gn--;){var Rn=qt[gn],Un=Vt[Rn],Kn=Mt[Rn];if(Kn===nt&&!(Rn in Mt)||!Un(Kn))return!1}return!0}function dy(Mt,Vt,qt){if(typeof Mt!="function")throw new Hs(at);return Py(function(){Mt.apply(nt,qt)},Vt)}function Ju(Mt,Vt,qt,gn){var Rn=-1,Un=Nl,Kn=!0,Jn=Mt.length,or=[],Tr=Vt.length;if(!Jn)return or;qt&&(Vt=ga(Vt,Ws(qt))),gn?(Un=op,Kn=!1):Vt.length>=it&&(Un=Is,Kn=!1,Vt=new Mu(Vt));e:for(;++RnRn?0:Rn+qt),gn=gn===nt||gn>Rn?Rn:jo(gn),gn<0&&(gn+=Rn),gn=qt>gn?0:tw(gn);qt0&&qt(Jn)?Vt>1?Ts(Jn,Vt-1,qt,gn,Rn):Dl(Rn,Jn):gn||(Rn[Rn.length]=Jn)}return Rn}var _p=Lm(),nm=Lm(!0);function _l(Mt,Vt){return Mt&&_p(Mt,Vt,Ls)}function xp(Mt,Vt){return Mt&&nm(Mt,Vt,Ls)}function Qu(Mt,Vt){return Cs(Vt,function(qt){return tp(Mt[qt])})}function Yl(Mt,Vt){Vt=Lu(Vt,Mt);for(var qt=0,gn=Vt.length;Mt!=null&&qtVt}function g0(Mt,Vt){return Mt!=null&&Go.call(Mt,Vt)}function my(Mt,Vt){return Mt!=null&&Vt in xo(Mt)}function W0(Mt,Vt,qt){return Mt>=Ps(Vt,qt)&&Mt=120&&Ar.length>=120)?new Mu(Kn&&Ar):nt}Ar=Mt[0];var Br=-1,Qr=Jn[0];e:for(;++Br-1;)Jn!==Mt&&Cu.call(Jn,or,1),Cu.call(Mt,or,1);return Mt}function Bs(Mt,Vt){for(var qt=Mt?Vt.length:0,gn=qt-1;qt--;){var Rn=Vt[qt];if(qt==gn||Rn!==Un){var Un=Rn;ep(Rn)?Cu.call(Mt,Rn,1):Sy(Mt,Rn)}}return Mt}function lu(Mt,Vt){return Mt+Kp(ny()*(Vt-Mt+1))}function Cl(Mt,Vt,qt,gn){for(var Rn=-1,Un=vs(Yp((Vt-Mt)/(qt||1)),0),Kn=pr(Un);Un--;)Kn[gn?Un:++Rn]=Mt,Mt+=qt;return Kn}function $p(Mt,Vt){var qt="";if(!Mt||Vt<1||Vt>zt)return qt;do Vt%2&&(qt+=Mt),Vt=Kp(Vt/2),Vt&&(Mt+=Mt);while(Vt);return qt}function po(Mt,Vt){return J0(I1(Mt,Vt,Ol),Mt+"")}function y0(Mt){return em(Wm(Mt))}function wy(Mt,Vt){var qt=Wm(Mt);return T0(qt,Bu(Vt,0,qt.length))}function _d(Mt,Vt,qt,gn){if(!hs(Mt))return Mt;Vt=Lu(Vt,Mt);for(var Rn=-1,Un=Vt.length,Kn=Un-1,Jn=Mt;Jn!=null&&++RnRn?0:Rn+Vt),qt=qt>Rn?Rn:qt,qt<0&&(qt+=Rn),Rn=Vt>qt?0:qt-Vt>>>0,Vt>>>=0;for(var Un=pr(Rn);++gn>>1,Kn=Mt[Un];Kn!==null&&!Zl(Kn)&&(qt?Kn<=Vt:Kn=it){var Tr=Vt?null:Ds(Mt);if(Tr)return zp(Tr);Kn=!1,Rn=Is,or=new Mu}else or=Vt?[]:Jn;e:for(;++gn=gn?Mt:Sl(Mt,Vt,qt)}var _0=qp||function(Mt){return ts.clearTimeout(Mt)};function Iy(Mt,Vt){if(Vt)return Mt.slice();var qt=Mt.length,gn=Qm?Qm(qt):new Mt.constructor(qt);return Mt.copy(gn),gn}function Nm(Mt){var Vt=new Mt.constructor(Mt.byteLength);return new Hp(Vt).set(new Hp(Mt)),Vt}function V0(Mt,Vt){var qt=Vt?Nm(Mt.buffer):Mt.buffer;return new Mt.constructor(qt,Mt.byteOffset,Mt.byteLength)}function Pl(Mt){var Vt=new Mt.constructor(Mt.source,ar.exec(Mt));return Vt.lastIndex=Mt.lastIndex,Vt}function Ay(Mt){return vu?xo(vu.call(Mt)):{}}function x0(Mt,Vt){var qt=Vt?Nm(Mt.buffer):Mt.buffer;return new Mt.constructor(qt,Mt.byteOffset,Mt.length)}function ku(Mt,Vt){if(Mt!==Vt){var qt=Mt!==nt,gn=Mt===null,Rn=Mt===Mt,Un=Zl(Mt),Kn=Vt!==nt,Jn=Vt===null,or=Vt===Vt,Tr=Zl(Vt);if(!Jn&&!Tr&&!Un&&Mt>Vt||Un&&Kn&&or&&!Jn&&!Tr||gn&&Kn&&or||!qt&&or||!Rn)return 1;if(!gn&&!Un&&!Tr&&Mt=Jn)return or;var Tr=qt[gn];return or*(Tr=="desc"?-1:1)}}return Mt.index-Vt.index}function Uu(Mt,Vt,qt,gn){for(var Rn=-1,Un=Mt.length,Kn=qt.length,Jn=-1,or=Vt.length,Tr=vs(Un-Kn,0),Ar=pr(or+Tr),Br=!gn;++Jn1?qt[Rn-1]:nt,Kn=Rn>2?qt[2]:nt;for(Un=Mt.length>3&&typeof Un=="function"?(Rn--,Un):nt,Kn&&Tl(qt[0],qt[1],Kn)&&(Un=Rn<3?nt:Un,Rn=1),Vt=xo(Vt);++gn-1?Rn[Un?Vt[Kn]:Kn]:nt}}function mn(Mt){return Oo(function(Vt){var qt=Vt.length,gn=qt,Rn=Ms.prototype.thru;for(Mt&&Vt.reverse();gn--;){var Un=Vt[gn];if(typeof Un!="function")throw new Hs(at);if(Rn&&!Kn&&Fm(Un)=="wrapper")var Kn=new Ms([],!0)}for(gn=Kn?gn:qt;++gn1&&Vo.reverse(),Ar&&orJn))return!1;var Tr=Un.get(Mt),Ar=Un.get(Vt);if(Tr&&Ar)return Tr==Vt&&Ar==Mt;var Br=-1,Qr=!0,co=qt>?new Mu:nt;for(Un.set(Mt,Vt),Un.set(Vt,Mt);++Br1?"& ":"")+Vt[gn],Vt=Vt.join(qt>2?", ":" "),Mt.replace(un,`{ + */lodash.exports;(function(tt,et){(function(){var nt,rt="4.17.21",it=200,ot="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",at="Expected a function",st="Invalid `variable` option passed into `_.template`",lt="__lodash_hash_undefined__",ct=500,ut="__lodash_placeholder__",ht=1,dt=2,pt=4,mt=1,gt=2,yt=1,bt=2,wt=4,xt=8,kt=16,St=32,Tt=64,At=128,Et=256,Ct=512,Lt=30,jt="...",Rt=800,$t=16,vt=1,It=2,Ot=3,Wt=1/0,zt=9007199254740991,Ft=17976931348623157e292,Nt=0/0,Ut=4294967295,Pt=Ut-1,Ht=Ut>>>1,Qt=[["ary",At],["bind",yt],["bindKey",bt],["curry",xt],["curryRight",kt],["flip",Ct],["partial",St],["partialRight",Tt],["rearg",Et]],an="[object Arguments]",Yt="[object Array]",nn="[object AsyncFunction]",tn="[object Boolean]",dn="[object Date]",wn="[object DOMException]",rn="[object Error]",Zt="[object Function]",vn="[object GeneratorFunction]",Cn="[object Map]",$n="[object Number]",Nn="[object Null]",En="[object Object]",sn="[object Promise]",pn="[object Proxy]",Tn="[object RegExp]",In="[object Set]",yn="[object String]",hn="[object Symbol]",fn="[object Undefined]",xn="[object WeakMap]",jn="[object WeakSet]",cn="[object ArrayBuffer]",Xt="[object DataView]",Kt="[object Float32Array]",kn="[object Float64Array]",Mn="[object Int8Array]",On="[object Int16Array]",Bn="[object Int32Array]",Xn="[object Uint8Array]",Vn="[object Uint8ClampedArray]",Gn="[object Uint16Array]",zn="[object Uint32Array]",Jn=/\b__p \+= '';/g,Wn=/\b(__p \+=) '' \+/g,fr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ur=/&(?:amp|lt|gt|quot|#39);/g,wr=/[&<>"']/g,Xr=RegExp(ur.source),Er=RegExp(wr.source),Ir=/<%-([\s\S]+?)%>/g,Gr=/<%([\s\S]+?)%>/g,Or=/<%=([\s\S]+?)%>/g,Lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oo=/^\w*$/,qr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jr=/[\\^$.*+?()[\]{}|]/g,mo=RegExp(jr.source),_n=/^\s+/,Pn=/\s/,un=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jt=/\{\n\/\* \[wrapped with (.+)\] \*/,Sn=/,? & /,Dn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fn=/[()=,{}\[\]\/\s]/,Yn=/\\(\\)?/g,tr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ar=/\w*$/,lr=/^[-+]0x[0-9a-f]+$/i,Vr=/^0b[01]+$/i,vr=/^\[object .+?Constructor\]$/,Nr=/^0o[0-7]+$/i,Hr=/^(?:0|[1-9]\d*)$/,eo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jr=/($^)/,Zr=/['\n\r\u2028\u2029\\]/g,br="\\ud800-\\udfff",Pr="\\u0300-\\u036f",Fr="\\ufe20-\\ufe2f",Mr="\\u20d0-\\u20ff",Cr=Pr+Fr+Mr,Dr="\\u2700-\\u27bf",Ur="a-z\\xdf-\\xf6\\xf8-\\xff",Rr="\\xac\\xb1\\xd7\\xf7",er="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rr="\\u2000-\\u206f",xr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dr="A-Z\\xc0-\\xd6\\xd8-\\xde",yr="\\ufe0e\\ufe0f",$r=Rr+er+rr+xr,no="['’]",ao="["+br+"]",ho="["+$r+"]",fo="["+Cr+"]",qn="\\d+",wo="["+Dr+"]",vo="["+Ur+"]",_o="[^"+br+$r+qn+Dr+Ur+dr+"]",yo="\\ud83c[\\udffb-\\udfff]",Ao="(?:"+fo+"|"+yo+")",Mo="[^"+br+"]",zo="(?:\\ud83c[\\udde6-\\uddff]){2}",Co="[\\ud800-\\udbff][\\udc00-\\udfff]",Lo="["+dr+"]",Ho="\\u200d",Ko="(?:"+vo+"|"+_o+")",na="(?:"+Lo+"|"+_o+")",Qo="(?:"+no+"(?:d|ll|m|re|s|t|ve))?",xa="(?:"+no+"(?:D|LL|M|RE|S|T|VE))?",Xo=Ao+"?",fu="["+yr+"]?",_c="(?:"+Ho+"(?:"+[Mo,zo,Co].join("|")+")"+fu+Xo+")*",No="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",eu=fu+Xo+_c,ip="(?:"+[wo,zo,Co].join("|")+")"+eu,Mp="(?:"+[Mo+fo+"?",fo,zo,Co,ao].join("|")+")",pm=RegExp(no,"g"),es=RegExp(fo,"g"),pu=RegExp(yo+"(?="+yo+")|"+Mp+eu,"g"),mm=RegExp([Lo+"?"+vo+"+"+Qo+"(?="+[ho,Lo,"$"].join("|")+")",na+"+"+xa+"(?="+[ho,Lo+Ko,"$"].join("|")+")",Lo+"?"+Ko+"+"+Qo,Lo+"+"+xa,Pp,No,qn,ip].join("|"),"g"),Fs=RegExp("["+Ho+br+Cr+yr+"]"),Rp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ks=-1,qo={};qo[Kt]=qo[kn]=qo[Mn]=qo[On]=qo[Bn]=qo[Xn]=qo[Vn]=qo[Gn]=qo[zn]=!0,qo[an]=qo[Yt]=qo[cn]=qo[tn]=qo[Xt]=qo[dn]=qo[rn]=qo[Zt]=qo[Cn]=qo[$n]=qo[En]=qo[Tn]=qo[In]=qo[yn]=qo[xn]=!1;var Yo={};Yo[an]=Yo[Yt]=Yo[cn]=Yo[Xt]=Yo[tn]=Yo[dn]=Yo[Kt]=Yo[kn]=Yo[Mn]=Yo[On]=Yo[Bn]=Yo[Cn]=Yo[$n]=Yo[En]=Yo[Tn]=Yo[In]=Yo[yn]=Yo[hn]=Yo[Xn]=Yo[Vn]=Yo[Gn]=Yo[zn]=!0,Yo[rn]=Yo[Zt]=Yo[xn]=!1;var Xs={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Us={"&":"&","<":"<",">":">",'"':""","'":"'"},tu={"&":"&","<":"<",">":">",""":'"',"'":"'"},Al={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bp=parseFloat,Op=parseInt,zs=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Vu=typeof self=="object"&&self&&self.Object===Object&&self,ts=zs||Vu||Function("return this")(),mu=et&&!et.nodeType&&et,ss=mu&&!0&&tt&&!tt.nodeType&&tt,gs=ss&&ss.exports===mu,Tu=gs&&zs.process,ns=function(){try{var Qn=ss&&ss.require&&ss.require("util").types;return Qn||Tu&&Tu.binding&&Tu.binding("util")}catch{}}(),gu=ns&&ns.isArrayBuffer,Hu=ns&&ns.isDate,jp=ns&&ns.isMap,ys=ns&&ns.isRegExp,$s=ns&&ns.isSet,rs=ns&&ns.isTypedArray;function Wo(Qn,Sr,pr){switch(pr.length){case 0:return Qn.call(Sr);case 1:return Qn.call(Sr,pr[0]);case 2:return Qn.call(Sr,pr[0],pr[1]);case 3:return Qn.call(Sr,pr[0],pr[1],pr[2])}return Qn.apply(Sr,pr)}function Js(Qn,Sr,pr,ro){for(var Eo=-1,$o=Qn==null?0:Qn.length;++Eo<$o;){var $a=Qn[Eo];Sr(ro,$a,pr($a),Qn)}return ro}function bs(Qn,Sr){for(var pr=-1,ro=Qn==null?0:Qn.length;++pr-1}function op(Qn,Sr,pr){for(var ro=-1,Eo=Qn==null?0:Qn.length;++ro-1;);return pr}function lp(Qn,Sr){for(var pr=Qn.length;pr--&&Ll(Sr,Qn[pr],0)>-1;);return pr}function Ul(Qn,Sr){for(var pr=Qn.length,ro=0;pr--;)Qn[pr]===Sr&&++ro;return ro}var Ny=qs(Xs),Dy=qs(Us);function Km(Qn){return"\\"+Al[Qn]}function Xm(Qn,Sr){return Qn==null?nt:Qn[Sr]}function Gu(Qn){return Fs.test(Qn)}function Fp(Qn){return Rp.test(Qn)}function cp(Qn){for(var Sr,pr=[];!(Sr=Qn.next()).done;)pr.push(Sr.value);return pr}function Up(Qn){var Sr=-1,pr=Array(Qn.size);return Qn.forEach(function(ro,Eo){pr[++Sr]=[Eo,ro]}),pr}function up(Qn,Sr){return function(pr){return Qn(Sr(pr))}}function Wl(Qn,Sr){for(var pr=-1,ro=Qn.length,Eo=0,$o=[];++pr-1}function km(Mt,Vt){var qt=this.__data__,gn=Ru(qt,Mt);return gn<0?(++this.size,qt.push([Mt,Vt])):qt[gn][1]=Vt,this}Vl.prototype.clear=o0,Vl.prototype.delete=iy,Vl.prototype.get=a0,Vl.prototype.has=s0,Vl.prototype.set=km;function $l(Mt){var Vt=-1,qt=Mt==null?0:Mt.length;for(this.clear();++Vt=Vt?Mt:Vt)),Mt}function yl(Mt,Vt,qt,gn,Rn,Un){var Kn,Zn=Vt&ht,or=Vt&dt,Tr=Vt&pt;if(qt&&(Kn=Rn?qt(Mt,gn,Rn,Un):qt(Mt)),Kn!==nt)return Kn;if(!hs(Mt))return Mt;var Ar=Po(Mt);if(Ar){if(Kn=Sw(Mt),!Zn)return Ns(Mt,Kn)}else{var Br=Ys(Mt),Qr=Br==Zt||Br==vn;if(Cp(Mt))return Iy(Mt,Zn);if(Br==En||Br==an||Qr&&!Rn){if(Kn=or||Qr?{}:S1(Mt),!Zn)return or?k0(Mt,f0(Kn,Mt)):H0(Mt,uy(Kn,Mt))}else{if(!Yo[Br])return Rn?Mt:{};Kn=Ew(Mt,Br,Zn)}}Un||(Un=new _s);var co=Un.get(Mt);if(co)return co;Un.set(Mt,Kn),Q1(Mt)?Mt.forEach(function(So){Kn.add(yl(So,Vt,qt,So,Mt,Un))}):J1(Mt)&&Mt.forEach(function(So,Fo){Kn.set(Fo,yl(So,Vt,qt,Fo,Mt,Un))});var ko=Tr?or?Uo:ps:or?Bl:Ls,Do=Ar?nt:ko(Mt);return bs(Do||Mt,function(So,Fo){Do&&(Fo=So,So=Mt[Fo]),Hl(Kn,Fo,yl(So,Vt,qt,Fo,Mt,Un))}),Kn}function hy(Mt){var Vt=Ls(Mt);return function(qt){return Im(qt,Mt,Vt)}}function Im(Mt,Vt,qt){var gn=qt.length;if(Mt==null)return!gn;for(Mt=xo(Mt);gn--;){var Rn=qt[gn],Un=Vt[Rn],Kn=Mt[Rn];if(Kn===nt&&!(Rn in Mt)||!Un(Kn))return!1}return!0}function dy(Mt,Vt,qt){if(typeof Mt!="function")throw new Hs(at);return Py(function(){Mt.apply(nt,qt)},Vt)}function Zu(Mt,Vt,qt,gn){var Rn=-1,Un=Nl,Kn=!0,Zn=Mt.length,or=[],Tr=Vt.length;if(!Zn)return or;qt&&(Vt=ga(Vt,Ws(qt))),gn?(Un=op,Kn=!1):Vt.length>=it&&(Un=Is,Kn=!1,Vt=new Mu(Vt));e:for(;++RnRn?0:Rn+qt),gn=gn===nt||gn>Rn?Rn:jo(gn),gn<0&&(gn+=Rn),gn=qt>gn?0:tw(gn);qt0&&qt(Zn)?Vt>1?Ts(Zn,Vt-1,qt,gn,Rn):Dl(Rn,Zn):gn||(Rn[Rn.length]=Zn)}return Rn}var _p=Lm(),nm=Lm(!0);function _l(Mt,Vt){return Mt&&_p(Mt,Vt,Ls)}function xp(Mt,Vt){return Mt&&nm(Mt,Vt,Ls)}function Qu(Mt,Vt){return Cs(Vt,function(qt){return tp(Mt[qt])})}function Yl(Mt,Vt){Vt=Lu(Vt,Mt);for(var qt=0,gn=Vt.length;Mt!=null&&qtVt}function g0(Mt,Vt){return Mt!=null&&Go.call(Mt,Vt)}function my(Mt,Vt){return Mt!=null&&Vt in xo(Mt)}function W0(Mt,Vt,qt){return Mt>=Ps(Vt,qt)&&Mt=120&&Ar.length>=120)?new Mu(Kn&&Ar):nt}Ar=Mt[0];var Br=-1,Qr=Zn[0];e:for(;++Br-1;)Zn!==Mt&&Cu.call(Zn,or,1),Cu.call(Mt,or,1);return Mt}function Bs(Mt,Vt){for(var qt=Mt?Vt.length:0,gn=qt-1;qt--;){var Rn=Vt[qt];if(qt==gn||Rn!==Un){var Un=Rn;ep(Rn)?Cu.call(Mt,Rn,1):Sy(Mt,Rn)}}return Mt}function lu(Mt,Vt){return Mt+Kp(ny()*(Vt-Mt+1))}function Cl(Mt,Vt,qt,gn){for(var Rn=-1,Un=vs(Yp((Vt-Mt)/(qt||1)),0),Kn=pr(Un);Un--;)Kn[gn?Un:++Rn]=Mt,Mt+=qt;return Kn}function $p(Mt,Vt){var qt="";if(!Mt||Vt<1||Vt>zt)return qt;do Vt%2&&(qt+=Mt),Vt=Kp(Vt/2),Vt&&(Mt+=Mt);while(Vt);return qt}function po(Mt,Vt){return Z0(I1(Mt,Vt,Ol),Mt+"")}function y0(Mt){return em(Wm(Mt))}function wy(Mt,Vt){var qt=Wm(Mt);return T0(qt,Bu(Vt,0,qt.length))}function _d(Mt,Vt,qt,gn){if(!hs(Mt))return Mt;Vt=Lu(Vt,Mt);for(var Rn=-1,Un=Vt.length,Kn=Un-1,Zn=Mt;Zn!=null&&++RnRn?0:Rn+Vt),qt=qt>Rn?Rn:qt,qt<0&&(qt+=Rn),Rn=Vt>qt?0:qt-Vt>>>0,Vt>>>=0;for(var Un=pr(Rn);++gn>>1,Kn=Mt[Un];Kn!==null&&!Jl(Kn)&&(qt?Kn<=Vt:Kn=it){var Tr=Vt?null:Ds(Mt);if(Tr)return zp(Tr);Kn=!1,Rn=Is,or=new Mu}else or=Vt?[]:Zn;e:for(;++gn=gn?Mt:Sl(Mt,Vt,qt)}var _0=qp||function(Mt){return ts.clearTimeout(Mt)};function Iy(Mt,Vt){if(Vt)return Mt.slice();var qt=Mt.length,gn=Qm?Qm(qt):new Mt.constructor(qt);return Mt.copy(gn),gn}function Nm(Mt){var Vt=new Mt.constructor(Mt.byteLength);return new Hp(Vt).set(new Hp(Mt)),Vt}function V0(Mt,Vt){var qt=Vt?Nm(Mt.buffer):Mt.buffer;return new Mt.constructor(qt,Mt.byteOffset,Mt.byteLength)}function Pl(Mt){var Vt=new Mt.constructor(Mt.source,ar.exec(Mt));return Vt.lastIndex=Mt.lastIndex,Vt}function Ay(Mt){return vu?xo(vu.call(Mt)):{}}function x0(Mt,Vt){var qt=Vt?Nm(Mt.buffer):Mt.buffer;return new Mt.constructor(qt,Mt.byteOffset,Mt.length)}function ku(Mt,Vt){if(Mt!==Vt){var qt=Mt!==nt,gn=Mt===null,Rn=Mt===Mt,Un=Jl(Mt),Kn=Vt!==nt,Zn=Vt===null,or=Vt===Vt,Tr=Jl(Vt);if(!Zn&&!Tr&&!Un&&Mt>Vt||Un&&Kn&&or&&!Zn&&!Tr||gn&&Kn&&or||!qt&&or||!Rn)return 1;if(!gn&&!Un&&!Tr&&Mt=Zn)return or;var Tr=qt[gn];return or*(Tr=="desc"?-1:1)}}return Mt.index-Vt.index}function Uu(Mt,Vt,qt,gn){for(var Rn=-1,Un=Mt.length,Kn=qt.length,Zn=-1,or=Vt.length,Tr=vs(Un-Kn,0),Ar=pr(or+Tr),Br=!gn;++Zn1?qt[Rn-1]:nt,Kn=Rn>2?qt[2]:nt;for(Un=Mt.length>3&&typeof Un=="function"?(Rn--,Un):nt,Kn&&Tl(qt[0],qt[1],Kn)&&(Un=Rn<3?nt:Un,Rn=1),Vt=xo(Vt);++gn-1?Rn[Un?Vt[Kn]:Kn]:nt}}function mn(Mt){return Oo(function(Vt){var qt=Vt.length,gn=qt,Rn=Ms.prototype.thru;for(Mt&&Vt.reverse();gn--;){var Un=Vt[gn];if(typeof Un!="function")throw new Hs(at);if(Rn&&!Kn&&Fm(Un)=="wrapper")var Kn=new Ms([],!0)}for(gn=Kn?gn:qt;++gn1&&Vo.reverse(),Ar&&orZn))return!1;var Tr=Un.get(Mt),Ar=Un.get(Vt);if(Tr&&Ar)return Tr==Vt&&Ar==Mt;var Br=-1,Qr=!0,co=qt>?new Mu:nt;for(Un.set(Mt,Vt),Un.set(Vt,Mt);++Br1?"& ":"")+Vt[gn],Vt=Vt.join(qt>2?", ":" "),Mt.replace(un,`{ /* [wrapped with `+Vt+`] */ -`)}function Iw(Mt){return Po(Mt)||fm(Mt)||!!(ey&&Mt&&Mt[ey])}function ep(Mt,Vt){var qt=typeof Mt;return Vt=Vt??zt,!!Vt&&(qt=="number"||qt!="symbol"&&Hr.test(Mt))&&Mt>-1&&Mt%1==0&&Mt0){if(++Vt>=Rt)return arguments[0]}else Vt=0;return Mt.apply(nt,arguments)}}function T0(Mt,Vt){var qt=-1,gn=Mt.length,Rn=gn-1;for(Vt=Vt===nt?gn:Vt;++qt1?Mt[Vt-1]:nt;return qt=typeof qt=="function"?(Mt.pop(),qt):nt,L1(Mt,qt)});function F1(Mt){var Vt=Ln(Mt);return Vt.__chain__=!0,Vt}function Dv(Mt,Vt){return Vt(Mt),Mt}function I0(Mt,Vt){return Vt(Mt)}var Lv=Oo(function(Mt){var Vt=Mt.length,qt=Vt?Mt[0]:0,gn=this.__wrapped__,Rn=function(Un){return Tm(Un,Mt)};return Vt>1||this.__actions__.length||!(gn instanceof go)||!ep(qt)?this.thru(Rn):(gn=gn.slice(qt,+qt+(Vt?1:0)),gn.__actions__.push({func:I0,args:[Rn],thisArg:nt}),new Ms(gn,this.__chain__).thru(function(Un){return Vt&&!Un.length&&Un.push(nt),Un}))});function Fv(){return F1(this)}function Uv(){return new Ms(this.value(),this.__chain__)}function zv(){this.__values__===nt&&(this.__values__=ew(this.value()));var Mt=this.__index__>=this.__values__.length,Vt=Mt?nt:this.__values__[this.__index__++];return{done:Mt,value:Vt}}function Wv(){return this}function Vv(Mt){for(var Vt,qt=this;qt instanceof Qp;){var gn=R1(qt);gn.__index__=0,gn.__values__=nt,Vt?Rn.__wrapped__=gn:Vt=gn;var Rn=gn;qt=qt.__wrapped__}return Rn.__wrapped__=Mt,Vt}function Hv(){var Mt=this.__wrapped__;if(Mt instanceof go){var Vt=Mt;return this.__actions__.length&&(Vt=new go(this)),Vt=Vt.reverse(),Vt.__actions__.push({func:I0,args:[Q0],thisArg:nt}),new Ms(Vt,this.__chain__)}return this.thru(Q0)}function Gv(){return Nu(this.__wrapped__,this.__actions__)}var qv=um(function(Mt,Vt,qt){Go.call(Mt,qt)?++Mt[qt]:su(Mt,qt,1)});function Yv(Mt,Vt,qt){var gn=Po(Mt)?qm:z0;return qt&&Tl(Mt,Vt,qt)&&(Vt=nt),gn(Mt,bo(Vt,3))}function Kv(Mt,Vt){var qt=Po(Mt)?Cs:fy;return qt(Mt,bo(Vt,3))}var Xv=en(B1),Zv=en(O1);function Jv(Mt,Vt){return Ts(A0(Mt,Vt),1)}function Qv(Mt,Vt){return Ts(A0(Mt,Vt),Wt)}function e_(Mt,Vt,qt){return qt=qt===nt?1:jo(qt),Ts(A0(Mt,Vt),qt)}function U1(Mt,Vt){var qt=Po(Mt)?bs:Gl;return qt(Mt,bo(Vt,3))}function z1(Mt,Vt){var qt=Po(Mt)?Gm:p0;return qt(Mt,bo(Vt,3))}var t_=um(function(Mt,Vt,qt){Go.call(Mt,qt)?Mt[qt].push(Vt):su(Mt,qt,[Vt])});function n_(Mt,Vt,qt,gn){Mt=Rl(Mt)?Mt:Wm(Mt),qt=qt&&!gn?jo(qt):0;var Rn=Mt.length;return qt<0&&(qt=vs(Rn+qt,0)),R0(Mt)?qt<=Rn&&Mt.indexOf(Vt,qt)>-1:!!Rn&&Ll(Mt,Vt,qt)>-1}var r_=po(function(Mt,Vt,qt){var gn=-1,Rn=typeof Vt=="function",Un=Rl(Mt)?pr(Mt.length):[];return Gl(Mt,function(Kn){Un[++gn]=Rn?Wo(Vt,Kn,qt):_a(Kn,Vt,qt)}),Un}),i_=um(function(Mt,Vt,qt){su(Mt,qt,Vt)});function A0(Mt,Vt){var qt=Po(Mt)?ga:_h;return qt(Mt,bo(Vt,3))}function o_(Mt,Vt,qt,gn){return Mt==null?[]:(Po(Vt)||(Vt=Vt==null?[]:[Vt]),qt=gn?nt:qt,Po(qt)||(qt=qt==null?[]:[qt]),am(Mt,Vt,qt))}var a_=um(function(Mt,Vt,qt){Mt[qt?0:1].push(Vt)},function(){return[[],[]]});function s_(Mt,Vt,qt){var gn=Po(Mt)?gm:Iu,Rn=arguments.length<3;return gn(Mt,bo(Vt,4),qt,Rn,Gl)}function l_(Mt,Vt,qt){var gn=Po(Mt)?Ry:Iu,Rn=arguments.length<3;return gn(Mt,bo(Vt,4),qt,Rn,p0)}function c_(Mt,Vt){var qt=Po(Mt)?Cs:fy;return qt(Mt,P0(bo(Vt,3)))}function u_(Mt){var Vt=Po(Mt)?em:y0;return Vt(Mt)}function h_(Mt,Vt,qt){(qt?Tl(Mt,Vt,qt):Vt===nt)?Vt=1:Vt=jo(Vt);var gn=Po(Mt)?sy:wy;return gn(Mt,Vt)}function d_(Mt){var Vt=Po(Mt)?d0:w0;return Vt(Mt)}function f_(Mt){if(Mt==null)return 0;if(Rl(Mt))return R0(Mt)?nu(Mt):Mt.length;var Vt=Ys(Mt);return Vt==Cn||Vt==In?Mt.size:Rs(Mt).length}function p_(Mt,Vt,qt){var gn=Po(Mt)?Np:vy;return qt&&Tl(Mt,Vt,qt)&&(Vt=nt),gn(Mt,bo(Vt,3))}var m_=po(function(Mt,Vt){if(Mt==null)return[];var qt=Vt.length;return qt>1&&Tl(Mt,Vt[0],Vt[1])?Vt=[]:qt>2&&Tl(Vt[0],Vt[1],Vt[2])&&(Vt=[Vt[0]]),am(Mt,Ts(Vt,1),[])}),$0=zy||function(){return ts.Date.now()};function g_(Mt,Vt){if(typeof Vt!="function")throw new Hs(at);return Mt=jo(Mt),function(){if(--Mt<1)return Vt.apply(this,arguments)}}function W1(Mt,Vt,qt){return Vt=qt?nt:Vt,Vt=Mt&&Vt==null?Mt.length:Vt,cr(Mt,At,nt,nt,nt,nt,Vt)}function V1(Mt,Vt){var qt;if(typeof Vt!="function")throw new Hs(at);return Mt=jo(Mt),function(){return--Mt>0&&(qt=Vt.apply(this,arguments)),Mt<=1&&(Vt=nt),qt}}var e1=po(function(Mt,Vt,qt){var gn=yt;if(qt.length){var Rn=Wl(qt,Um(e1));gn|=St}return cr(Mt,gn,Vt,qt,Rn)}),H1=po(function(Mt,Vt,qt){var gn=yt|bt;if(qt.length){var Rn=Wl(qt,Um(H1));gn|=St}return cr(Vt,gn,Mt,qt,Rn)});function G1(Mt,Vt,qt){Vt=qt?nt:Vt;var gn=cr(Mt,xt,nt,nt,nt,nt,nt,Vt);return gn.placeholder=G1.placeholder,gn}function q1(Mt,Vt,qt){Vt=qt?nt:Vt;var gn=cr(Mt,kt,nt,nt,nt,nt,nt,Vt);return gn.placeholder=q1.placeholder,gn}function Y1(Mt,Vt,qt){var gn,Rn,Un,Kn,Jn,or,Tr=0,Ar=!1,Br=!1,Qr=!0;if(typeof Mt!="function")throw new Hs(at);Vt=du(Vt)||0,hs(qt)&&(Ar=!!qt.leading,Br="maxWait"in qt,Un=Br?vs(du(qt.maxWait)||0,Vt):Un,Qr="trailing"in qt?!!qt.trailing:Qr);function co(ks){var Eu=gn,rp=Rn;return gn=Rn=nt,Tr=ks,Kn=Mt.apply(rp,Eu),Kn}function ko(ks){return Tr=ks,Jn=Py(Fo,Vt),Ar?co(ks):Kn}function Do(ks){var Eu=ks-or,rp=ks-Tr,fw=Vt-Eu;return Br?Ps(fw,Un-rp):fw}function So(ks){var Eu=ks-or,rp=ks-Tr;return or===nt||Eu>=Vt||Eu<0||Br&&rp>=Un}function Fo(){var ks=$0();if(So(ks))return Vo(ks);Jn=Py(Fo,Do(ks))}function Vo(ks){return Jn=nt,Qr&&gn?co(ks):(gn=Rn=nt,Kn)}function Jl(){Jn!==nt&&_0(Jn),Tr=0,gn=or=Rn=Jn=nt}function Il(){return Jn===nt?Kn:Vo($0())}function Ql(){var ks=$0(),Eu=So(ks);if(gn=arguments,Rn=this,or=ks,Eu){if(Jn===nt)return ko(or);if(Br)return _0(Jn),Jn=Py(Fo,Vt),co(or)}return Jn===nt&&(Jn=Py(Fo,Vt)),Kn}return Ql.cancel=Jl,Ql.flush=Il,Ql}var y_=po(function(Mt,Vt){return dy(Mt,1,Vt)}),b_=po(function(Mt,Vt,qt){return dy(Mt,du(Vt)||0,qt)});function w_(Mt){return cr(Mt,Ct)}function C0(Mt,Vt){if(typeof Mt!="function"||Vt!=null&&typeof Vt!="function")throw new Hs(at);var qt=function(){var gn=arguments,Rn=Vt?Vt.apply(this,gn):gn[0],Un=qt.cache;if(Un.has(Rn))return Un.get(Rn);var Kn=Mt.apply(this,gn);return qt.cache=Un.set(Rn,Kn)||Un,Kn};return qt.cache=new(C0.Cache||$l),qt}C0.Cache=$l;function P0(Mt){if(typeof Mt!="function")throw new Hs(at);return function(){var Vt=arguments;switch(Vt.length){case 0:return!Mt.call(this);case 1:return!Mt.call(this,Vt[0]);case 2:return!Mt.call(this,Vt[0],Vt[1]);case 3:return!Mt.call(this,Vt[0],Vt[1],Vt[2])}return!Mt.apply(this,Vt)}}function v_(Mt){return V1(2,Mt)}var __=v0(function(Mt,Vt){Vt=Vt.length==1&&Po(Vt[0])?ga(Vt[0],Ws(bo())):ga(Ts(Vt,1),Ws(bo()));var qt=Vt.length;return po(function(gn){for(var Rn=-1,Un=Ps(gn.length,qt);++Rn=Vt}),fm=Ro(function(){return arguments}())?Ro:function(Mt){return ms(Mt)&&Go.call(Mt,"callee")&&!_m.call(Mt,"callee")},Po=pr.isArray,j_=gu?Ws(gu):ds;function Rl(Mt){return Mt!=null&&M0(Mt.length)&&!tp(Mt)}function xs(Mt){return ms(Mt)&&Rl(Mt)}function N_(Mt){return Mt===!0||Mt===!1||ms(Mt)&&As(Mt)==tn}var Cp=Vy||f1,D_=Hu?Ws(Hu):fs;function L_(Mt){return ms(Mt)&&Mt.nodeType===1&&!My(Mt)}function F_(Mt){if(Mt==null)return!0;if(Rl(Mt)&&(Po(Mt)||typeof Mt=="string"||typeof Mt.splice=="function"||Cp(Mt)||zm(Mt)||fm(Mt)))return!Mt.length;var Vt=Ys(Mt);if(Vt==Cn||Vt==In)return!Mt.size;if(Cy(Mt))return!Rs(Mt).length;for(var qt in Mt)if(Go.call(Mt,qt))return!1;return!0}function U_(Mt,Vt){return cs(Mt,Vt)}function z_(Mt,Vt,qt){qt=typeof qt=="function"?qt:nt;var gn=qt?qt(Mt,Vt):nt;return gn===nt?cs(Mt,Vt,nt,qt):!!gn}function r1(Mt){if(!ms(Mt))return!1;var Vt=As(Mt);return Vt==rn||Vt==wn||typeof Mt.message=="string"&&typeof Mt.name=="string"&&!My(Mt)}function W_(Mt){return typeof Mt=="number"&&ty(Mt)}function tp(Mt){if(!hs(Mt))return!1;var Vt=As(Mt);return Vt==Jt||Vt==vn||Vt==nn||Vt==pn}function X1(Mt){return typeof Mt=="number"&&Mt==jo(Mt)}function M0(Mt){return typeof Mt=="number"&&Mt>-1&&Mt%1==0&&Mt<=zt}function hs(Mt){var Vt=typeof Mt;return Mt!=null&&(Vt=="object"||Vt=="function")}function ms(Mt){return Mt!=null&&typeof Mt=="object"}var Z1=jp?Ws(jp):Sp;function V_(Mt,Vt){return Mt===Vt||us(Mt,Vt,q0(Vt))}function H_(Mt,Vt,qt){return qt=typeof qt=="function"?qt:nt,us(Mt,Vt,q0(Vt),qt)}function G_(Mt){return J1(Mt)&&Mt!=+Mt}function q_(Mt){if(Cw(Mt))throw new Eo(ot);return Ep(Mt)}function Y_(Mt){return Mt===null}function K_(Mt){return Mt==null}function J1(Mt){return typeof Mt=="number"||ms(Mt)&&As(Mt)==$n}function My(Mt){if(!ms(Mt)||As(Mt)!=En)return!1;var Vt=Gp(Mt);if(Vt===null)return!0;var qt=Go.call(Vt,"constructor")&&Vt.constructor;return typeof qt=="function"&&qt instanceof qt&&gp.call(qt)==qu}var i1=ys?Ws(ys):Tp;function X_(Mt){return X1(Mt)&&Mt>=-zt&&Mt<=zt}var Q1=$s?Ws($s):$m;function R0(Mt){return typeof Mt=="string"||!Po(Mt)&&ms(Mt)&&As(Mt)==yn}function Zl(Mt){return typeof Mt=="symbol"||ms(Mt)&&As(Mt)==hn}var zm=rs?Ws(rs):yy;function Z_(Mt){return Mt===nt}function J_(Mt){return ms(Mt)&&Ys(Mt)==xn}function Q_(Mt){return ms(Mt)&&As(Mt)==jn}var t2=uo(im),n2=uo(function(Mt,Vt){return Mt<=Vt});function ew(Mt){if(!Mt)return[];if(Rl(Mt))return R0(Mt)?os(Mt):Ns(Mt);if(Pu&&Mt[Pu])return cp(Mt[Pu]());var Vt=Ys(Mt),qt=Vt==Cn?Up:Vt==In?zp:Wm;return qt(Mt)}function np(Mt){if(!Mt)return Mt===0?Mt:0;if(Mt=du(Mt),Mt===Wt||Mt===-Wt){var Vt=Mt<0?-1:1;return Vt*Ft}return Mt===Mt?Mt:0}function jo(Mt){var Vt=np(Mt),qt=Vt%1;return Vt===Vt?qt?Vt-qt:Vt:0}function tw(Mt){return Mt?Bu(jo(Mt),0,Ut):0}function du(Mt){if(typeof Mt=="number")return Mt;if(Zl(Mt))return Nt;if(hs(Mt)){var Vt=typeof Mt.valueOf=="function"?Mt.valueOf():Mt;Mt=hs(Vt)?Vt+"":Vt}if(typeof Mt!="string")return Mt===0?Mt:+Mt;Mt=bm(Mt);var qt=Vr.test(Mt);return qt||Nr.test(Mt)?Op(Mt.slice(2),qt?2:8):lr.test(Mt)?Nt:+Mt}function nw(Mt){return Ml(Mt,Bl(Mt))}function r2(Mt){return Mt?Bu(jo(Mt),-zt,zt):Mt===0?Mt:0}function Jo(Mt){return Mt==null?"":Os(Mt)}var i2=_f(function(Mt,Vt){if(Cy(Vt)||Rl(Vt)){Ml(Vt,Ls(Vt),Mt);return}for(var qt in Vt)Go.call(Vt,qt)&&Hl(Mt,qt,Vt[qt])}),rw=_f(function(Mt,Vt){Ml(Vt,Bl(Vt),Mt)}),B0=_f(function(Mt,Vt,qt,gn){Ml(Vt,Bl(Vt),Mt,gn)}),o2=_f(function(Mt,Vt,qt,gn){Ml(Vt,Ls(Vt),Mt,gn)}),a2=Oo(Tm);function s2(Mt,Vt){var qt=_u(Mt);return Vt==null?qt:uy(qt,Vt)}var l2=po(function(Mt,Vt){Mt=xo(Mt);var qt=-1,gn=Vt.length,Rn=gn>2?Vt[2]:nt;for(Rn&&Tl(Vt[0],Vt[1],Rn)&&(gn=1);++qt1),Un}),Ml(Mt,Uo(Mt),qt),gn&&(qt=yl(qt,ht|dt|pt,_i));for(var Rn=Vt.length;Rn--;)Sy(qt,Vt[Rn]);return qt});function I2(Mt,Vt){return ow(Mt,P0(bo(Vt)))}var A2=Oo(function(Mt,Vt){return Mt==null?{}:sm(Mt,Vt)});function ow(Mt,Vt){if(Mt==null)return{};var qt=ga(Uo(Mt),function(gn){return[gn]});return Vt=bo(Vt),Mm(Mt,qt,function(gn,Rn){return Vt(gn,Rn[0])})}function $2(Mt,Vt,qt){Vt=Lu(Vt,Mt);var gn=-1,Rn=Vt.length;for(Rn||(Rn=1,Mt=nt);++gnVt){var gn=Mt;Mt=Vt,Vt=gn}if(qt||Mt%1||Vt%1){var Rn=ny();return Ps(Mt+Rn*(Vt-Mt+Bp("1e-"+((Rn+"").length-1))),Vt)}return lu(Mt,Vt)}var F2=Bt(function(Mt,Vt,qt){return Vt=Vt.toLowerCase(),Mt+(qt?lw(Vt):Vt)});function lw(Mt){return s1(Jo(Mt).toLowerCase())}function cw(Mt){return Mt=Jo(Mt),Mt&&Mt.replace(eo,Ny).replace(es,"")}function U2(Mt,Vt,qt){Mt=Jo(Mt),Vt=Os(Vt);var gn=Mt.length;qt=qt===nt?gn:Bu(jo(qt),0,gn);var Rn=qt;return qt-=Vt.length,qt>=0&&Mt.slice(qt,Rn)==Vt}function z2(Mt){return Mt=Jo(Mt),Mt&&Er.test(Mt)?Mt.replace(wr,Dy):Mt}function W2(Mt){return Mt=Jo(Mt),Mt&&mo.test(Mt)?Mt.replace(jr,"\\$&"):Mt}var V2=Bt(function(Mt,Vt,qt){return Mt+(qt?"-":"")+Vt.toLowerCase()}),H2=Bt(function(Mt,Vt,qt){return Mt+(qt?" ":"")+Vt.toLowerCase()}),G2=S0("toLowerCase");function q2(Mt,Vt,qt){Mt=Jo(Mt),Vt=jo(Vt);var gn=Vt?nu(Mt):0;if(!Vt||gn>=Vt)return Mt;var Rn=(Vt-gn)/2;return Wr(Kp(Rn),qt)+Mt+Wr(Yp(Rn),qt)}function Y2(Mt,Vt,qt){Mt=Jo(Mt),Vt=jo(Vt);var gn=Vt?nu(Mt):0;return Vt&&gn>>0,qt?(Mt=Jo(Mt),Mt&&(typeof Vt=="string"||Vt!=null&&!i1(Vt))&&(Vt=Os(Vt),!Vt&&Gu(Mt))?Fu(os(Mt),0,qt):Mt.split(Vt,qt)):[]}var t4=Bt(function(Mt,Vt,qt){return Mt+(qt?" ":"")+s1(Vt)});function n4(Mt,Vt,qt){return Mt=Jo(Mt),qt=qt==null?0:Bu(jo(qt),0,Mt.length),Vt=Os(Vt),Mt.slice(qt,qt+Vt.length)==Vt}function r4(Mt,Vt,qt){var gn=Ln.templateSettings;qt&&Tl(Mt,Vt,qt)&&(Vt=nt),Mt=Jo(Mt),Vt=B0({},Vt,gn,ir);var Rn=B0({},Vt.imports,gn.imports,ir),Un=Ls(Rn),Kn=Vs(Rn,Un),Jn,or,Tr=0,Ar=Vt.interpolate||Zr,Br="__p += '",Qr=Ss((Vt.escape||Zr).source+"|"+Ar.source+"|"+(Ar===Or?tr:Zr).source+"|"+(Vt.evaluate||Zr).source+"|$","g"),co="//# sourceURL="+(Go.call(Vt,"sourceURL")?(Vt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ks+"]")+` -`;Mt.replace(Qr,function(So,Fo,Vo,Jl,Il,Ql){return Vo||(Vo=Jl),Br+=Mt.slice(Tr,Ql).replace(Jr,Km),Fo&&(Jn=!0,Br+=`' + +`)}function Iw(Mt){return Po(Mt)||fm(Mt)||!!(ey&&Mt&&Mt[ey])}function ep(Mt,Vt){var qt=typeof Mt;return Vt=Vt??zt,!!Vt&&(qt=="number"||qt!="symbol"&&Hr.test(Mt))&&Mt>-1&&Mt%1==0&&Mt0){if(++Vt>=Rt)return arguments[0]}else Vt=0;return Mt.apply(nt,arguments)}}function T0(Mt,Vt){var qt=-1,gn=Mt.length,Rn=gn-1;for(Vt=Vt===nt?gn:Vt;++qt1?Mt[Vt-1]:nt;return qt=typeof qt=="function"?(Mt.pop(),qt):nt,L1(Mt,qt)});function F1(Mt){var Vt=Ln(Mt);return Vt.__chain__=!0,Vt}function Dv(Mt,Vt){return Vt(Mt),Mt}function I0(Mt,Vt){return Vt(Mt)}var Lv=Oo(function(Mt){var Vt=Mt.length,qt=Vt?Mt[0]:0,gn=this.__wrapped__,Rn=function(Un){return Tm(Un,Mt)};return Vt>1||this.__actions__.length||!(gn instanceof go)||!ep(qt)?this.thru(Rn):(gn=gn.slice(qt,+qt+(Vt?1:0)),gn.__actions__.push({func:I0,args:[Rn],thisArg:nt}),new Ms(gn,this.__chain__).thru(function(Un){return Vt&&!Un.length&&Un.push(nt),Un}))});function Fv(){return F1(this)}function Uv(){return new Ms(this.value(),this.__chain__)}function zv(){this.__values__===nt&&(this.__values__=ew(this.value()));var Mt=this.__index__>=this.__values__.length,Vt=Mt?nt:this.__values__[this.__index__++];return{done:Mt,value:Vt}}function Wv(){return this}function Vv(Mt){for(var Vt,qt=this;qt instanceof Qp;){var gn=R1(qt);gn.__index__=0,gn.__values__=nt,Vt?Rn.__wrapped__=gn:Vt=gn;var Rn=gn;qt=qt.__wrapped__}return Rn.__wrapped__=Mt,Vt}function Hv(){var Mt=this.__wrapped__;if(Mt instanceof go){var Vt=Mt;return this.__actions__.length&&(Vt=new go(this)),Vt=Vt.reverse(),Vt.__actions__.push({func:I0,args:[Q0],thisArg:nt}),new Ms(Vt,this.__chain__)}return this.thru(Q0)}function Gv(){return Nu(this.__wrapped__,this.__actions__)}var qv=um(function(Mt,Vt,qt){Go.call(Mt,qt)?++Mt[qt]:su(Mt,qt,1)});function Yv(Mt,Vt,qt){var gn=Po(Mt)?qm:z0;return qt&&Tl(Mt,Vt,qt)&&(Vt=nt),gn(Mt,bo(Vt,3))}function Kv(Mt,Vt){var qt=Po(Mt)?Cs:fy;return qt(Mt,bo(Vt,3))}var Xv=en(B1),Jv=en(O1);function Zv(Mt,Vt){return Ts(A0(Mt,Vt),1)}function Qv(Mt,Vt){return Ts(A0(Mt,Vt),Wt)}function e_(Mt,Vt,qt){return qt=qt===nt?1:jo(qt),Ts(A0(Mt,Vt),qt)}function U1(Mt,Vt){var qt=Po(Mt)?bs:Gl;return qt(Mt,bo(Vt,3))}function z1(Mt,Vt){var qt=Po(Mt)?Gm:p0;return qt(Mt,bo(Vt,3))}var t_=um(function(Mt,Vt,qt){Go.call(Mt,qt)?Mt[qt].push(Vt):su(Mt,qt,[Vt])});function n_(Mt,Vt,qt,gn){Mt=Rl(Mt)?Mt:Wm(Mt),qt=qt&&!gn?jo(qt):0;var Rn=Mt.length;return qt<0&&(qt=vs(Rn+qt,0)),R0(Mt)?qt<=Rn&&Mt.indexOf(Vt,qt)>-1:!!Rn&&Ll(Mt,Vt,qt)>-1}var r_=po(function(Mt,Vt,qt){var gn=-1,Rn=typeof Vt=="function",Un=Rl(Mt)?pr(Mt.length):[];return Gl(Mt,function(Kn){Un[++gn]=Rn?Wo(Vt,Kn,qt):_a(Kn,Vt,qt)}),Un}),i_=um(function(Mt,Vt,qt){su(Mt,qt,Vt)});function A0(Mt,Vt){var qt=Po(Mt)?ga:_h;return qt(Mt,bo(Vt,3))}function o_(Mt,Vt,qt,gn){return Mt==null?[]:(Po(Vt)||(Vt=Vt==null?[]:[Vt]),qt=gn?nt:qt,Po(qt)||(qt=qt==null?[]:[qt]),am(Mt,Vt,qt))}var a_=um(function(Mt,Vt,qt){Mt[qt?0:1].push(Vt)},function(){return[[],[]]});function s_(Mt,Vt,qt){var gn=Po(Mt)?gm:Iu,Rn=arguments.length<3;return gn(Mt,bo(Vt,4),qt,Rn,Gl)}function l_(Mt,Vt,qt){var gn=Po(Mt)?Ry:Iu,Rn=arguments.length<3;return gn(Mt,bo(Vt,4),qt,Rn,p0)}function c_(Mt,Vt){var qt=Po(Mt)?Cs:fy;return qt(Mt,P0(bo(Vt,3)))}function u_(Mt){var Vt=Po(Mt)?em:y0;return Vt(Mt)}function h_(Mt,Vt,qt){(qt?Tl(Mt,Vt,qt):Vt===nt)?Vt=1:Vt=jo(Vt);var gn=Po(Mt)?sy:wy;return gn(Mt,Vt)}function d_(Mt){var Vt=Po(Mt)?d0:w0;return Vt(Mt)}function f_(Mt){if(Mt==null)return 0;if(Rl(Mt))return R0(Mt)?nu(Mt):Mt.length;var Vt=Ys(Mt);return Vt==Cn||Vt==In?Mt.size:Rs(Mt).length}function p_(Mt,Vt,qt){var gn=Po(Mt)?Np:vy;return qt&&Tl(Mt,Vt,qt)&&(Vt=nt),gn(Mt,bo(Vt,3))}var m_=po(function(Mt,Vt){if(Mt==null)return[];var qt=Vt.length;return qt>1&&Tl(Mt,Vt[0],Vt[1])?Vt=[]:qt>2&&Tl(Vt[0],Vt[1],Vt[2])&&(Vt=[Vt[0]]),am(Mt,Ts(Vt,1),[])}),$0=zy||function(){return ts.Date.now()};function g_(Mt,Vt){if(typeof Vt!="function")throw new Hs(at);return Mt=jo(Mt),function(){if(--Mt<1)return Vt.apply(this,arguments)}}function W1(Mt,Vt,qt){return Vt=qt?nt:Vt,Vt=Mt&&Vt==null?Mt.length:Vt,cr(Mt,At,nt,nt,nt,nt,Vt)}function V1(Mt,Vt){var qt;if(typeof Vt!="function")throw new Hs(at);return Mt=jo(Mt),function(){return--Mt>0&&(qt=Vt.apply(this,arguments)),Mt<=1&&(Vt=nt),qt}}var e1=po(function(Mt,Vt,qt){var gn=yt;if(qt.length){var Rn=Wl(qt,Um(e1));gn|=St}return cr(Mt,gn,Vt,qt,Rn)}),H1=po(function(Mt,Vt,qt){var gn=yt|bt;if(qt.length){var Rn=Wl(qt,Um(H1));gn|=St}return cr(Vt,gn,Mt,qt,Rn)});function G1(Mt,Vt,qt){Vt=qt?nt:Vt;var gn=cr(Mt,xt,nt,nt,nt,nt,nt,Vt);return gn.placeholder=G1.placeholder,gn}function q1(Mt,Vt,qt){Vt=qt?nt:Vt;var gn=cr(Mt,kt,nt,nt,nt,nt,nt,Vt);return gn.placeholder=q1.placeholder,gn}function Y1(Mt,Vt,qt){var gn,Rn,Un,Kn,Zn,or,Tr=0,Ar=!1,Br=!1,Qr=!0;if(typeof Mt!="function")throw new Hs(at);Vt=du(Vt)||0,hs(qt)&&(Ar=!!qt.leading,Br="maxWait"in qt,Un=Br?vs(du(qt.maxWait)||0,Vt):Un,Qr="trailing"in qt?!!qt.trailing:Qr);function co(ks){var Eu=gn,rp=Rn;return gn=Rn=nt,Tr=ks,Kn=Mt.apply(rp,Eu),Kn}function ko(ks){return Tr=ks,Zn=Py(Fo,Vt),Ar?co(ks):Kn}function Do(ks){var Eu=ks-or,rp=ks-Tr,fw=Vt-Eu;return Br?Ps(fw,Un-rp):fw}function So(ks){var Eu=ks-or,rp=ks-Tr;return or===nt||Eu>=Vt||Eu<0||Br&&rp>=Un}function Fo(){var ks=$0();if(So(ks))return Vo(ks);Zn=Py(Fo,Do(ks))}function Vo(ks){return Zn=nt,Qr&&gn?co(ks):(gn=Rn=nt,Kn)}function Zl(){Zn!==nt&&_0(Zn),Tr=0,gn=or=Rn=Zn=nt}function Il(){return Zn===nt?Kn:Vo($0())}function Ql(){var ks=$0(),Eu=So(ks);if(gn=arguments,Rn=this,or=ks,Eu){if(Zn===nt)return ko(or);if(Br)return _0(Zn),Zn=Py(Fo,Vt),co(or)}return Zn===nt&&(Zn=Py(Fo,Vt)),Kn}return Ql.cancel=Zl,Ql.flush=Il,Ql}var y_=po(function(Mt,Vt){return dy(Mt,1,Vt)}),b_=po(function(Mt,Vt,qt){return dy(Mt,du(Vt)||0,qt)});function w_(Mt){return cr(Mt,Ct)}function C0(Mt,Vt){if(typeof Mt!="function"||Vt!=null&&typeof Vt!="function")throw new Hs(at);var qt=function(){var gn=arguments,Rn=Vt?Vt.apply(this,gn):gn[0],Un=qt.cache;if(Un.has(Rn))return Un.get(Rn);var Kn=Mt.apply(this,gn);return qt.cache=Un.set(Rn,Kn)||Un,Kn};return qt.cache=new(C0.Cache||$l),qt}C0.Cache=$l;function P0(Mt){if(typeof Mt!="function")throw new Hs(at);return function(){var Vt=arguments;switch(Vt.length){case 0:return!Mt.call(this);case 1:return!Mt.call(this,Vt[0]);case 2:return!Mt.call(this,Vt[0],Vt[1]);case 3:return!Mt.call(this,Vt[0],Vt[1],Vt[2])}return!Mt.apply(this,Vt)}}function v_(Mt){return V1(2,Mt)}var __=v0(function(Mt,Vt){Vt=Vt.length==1&&Po(Vt[0])?ga(Vt[0],Ws(bo())):ga(Ts(Vt,1),Ws(bo()));var qt=Vt.length;return po(function(gn){for(var Rn=-1,Un=Ps(gn.length,qt);++Rn=Vt}),fm=Ro(function(){return arguments}())?Ro:function(Mt){return ms(Mt)&&Go.call(Mt,"callee")&&!_m.call(Mt,"callee")},Po=pr.isArray,j_=gu?Ws(gu):ds;function Rl(Mt){return Mt!=null&&M0(Mt.length)&&!tp(Mt)}function xs(Mt){return ms(Mt)&&Rl(Mt)}function N_(Mt){return Mt===!0||Mt===!1||ms(Mt)&&As(Mt)==tn}var Cp=Vy||f1,D_=Hu?Ws(Hu):fs;function L_(Mt){return ms(Mt)&&Mt.nodeType===1&&!My(Mt)}function F_(Mt){if(Mt==null)return!0;if(Rl(Mt)&&(Po(Mt)||typeof Mt=="string"||typeof Mt.splice=="function"||Cp(Mt)||zm(Mt)||fm(Mt)))return!Mt.length;var Vt=Ys(Mt);if(Vt==Cn||Vt==In)return!Mt.size;if(Cy(Mt))return!Rs(Mt).length;for(var qt in Mt)if(Go.call(Mt,qt))return!1;return!0}function U_(Mt,Vt){return cs(Mt,Vt)}function z_(Mt,Vt,qt){qt=typeof qt=="function"?qt:nt;var gn=qt?qt(Mt,Vt):nt;return gn===nt?cs(Mt,Vt,nt,qt):!!gn}function r1(Mt){if(!ms(Mt))return!1;var Vt=As(Mt);return Vt==rn||Vt==wn||typeof Mt.message=="string"&&typeof Mt.name=="string"&&!My(Mt)}function W_(Mt){return typeof Mt=="number"&&ty(Mt)}function tp(Mt){if(!hs(Mt))return!1;var Vt=As(Mt);return Vt==Zt||Vt==vn||Vt==nn||Vt==pn}function X1(Mt){return typeof Mt=="number"&&Mt==jo(Mt)}function M0(Mt){return typeof Mt=="number"&&Mt>-1&&Mt%1==0&&Mt<=zt}function hs(Mt){var Vt=typeof Mt;return Mt!=null&&(Vt=="object"||Vt=="function")}function ms(Mt){return Mt!=null&&typeof Mt=="object"}var J1=jp?Ws(jp):Sp;function V_(Mt,Vt){return Mt===Vt||us(Mt,Vt,q0(Vt))}function H_(Mt,Vt,qt){return qt=typeof qt=="function"?qt:nt,us(Mt,Vt,q0(Vt),qt)}function G_(Mt){return Z1(Mt)&&Mt!=+Mt}function q_(Mt){if(Cw(Mt))throw new Eo(ot);return Ep(Mt)}function Y_(Mt){return Mt===null}function K_(Mt){return Mt==null}function Z1(Mt){return typeof Mt=="number"||ms(Mt)&&As(Mt)==$n}function My(Mt){if(!ms(Mt)||As(Mt)!=En)return!1;var Vt=Gp(Mt);if(Vt===null)return!0;var qt=Go.call(Vt,"constructor")&&Vt.constructor;return typeof qt=="function"&&qt instanceof qt&&gp.call(qt)==qu}var i1=ys?Ws(ys):Tp;function X_(Mt){return X1(Mt)&&Mt>=-zt&&Mt<=zt}var Q1=$s?Ws($s):$m;function R0(Mt){return typeof Mt=="string"||!Po(Mt)&&ms(Mt)&&As(Mt)==yn}function Jl(Mt){return typeof Mt=="symbol"||ms(Mt)&&As(Mt)==hn}var zm=rs?Ws(rs):yy;function J_(Mt){return Mt===nt}function Z_(Mt){return ms(Mt)&&Ys(Mt)==xn}function Q_(Mt){return ms(Mt)&&As(Mt)==jn}var t2=uo(im),n2=uo(function(Mt,Vt){return Mt<=Vt});function ew(Mt){if(!Mt)return[];if(Rl(Mt))return R0(Mt)?os(Mt):Ns(Mt);if(Pu&&Mt[Pu])return cp(Mt[Pu]());var Vt=Ys(Mt),qt=Vt==Cn?Up:Vt==In?zp:Wm;return qt(Mt)}function np(Mt){if(!Mt)return Mt===0?Mt:0;if(Mt=du(Mt),Mt===Wt||Mt===-Wt){var Vt=Mt<0?-1:1;return Vt*Ft}return Mt===Mt?Mt:0}function jo(Mt){var Vt=np(Mt),qt=Vt%1;return Vt===Vt?qt?Vt-qt:Vt:0}function tw(Mt){return Mt?Bu(jo(Mt),0,Ut):0}function du(Mt){if(typeof Mt=="number")return Mt;if(Jl(Mt))return Nt;if(hs(Mt)){var Vt=typeof Mt.valueOf=="function"?Mt.valueOf():Mt;Mt=hs(Vt)?Vt+"":Vt}if(typeof Mt!="string")return Mt===0?Mt:+Mt;Mt=bm(Mt);var qt=Vr.test(Mt);return qt||Nr.test(Mt)?Op(Mt.slice(2),qt?2:8):lr.test(Mt)?Nt:+Mt}function nw(Mt){return Ml(Mt,Bl(Mt))}function r2(Mt){return Mt?Bu(jo(Mt),-zt,zt):Mt===0?Mt:0}function Zo(Mt){return Mt==null?"":Os(Mt)}var i2=_f(function(Mt,Vt){if(Cy(Vt)||Rl(Vt)){Ml(Vt,Ls(Vt),Mt);return}for(var qt in Vt)Go.call(Vt,qt)&&Hl(Mt,qt,Vt[qt])}),rw=_f(function(Mt,Vt){Ml(Vt,Bl(Vt),Mt)}),B0=_f(function(Mt,Vt,qt,gn){Ml(Vt,Bl(Vt),Mt,gn)}),o2=_f(function(Mt,Vt,qt,gn){Ml(Vt,Ls(Vt),Mt,gn)}),a2=Oo(Tm);function s2(Mt,Vt){var qt=_u(Mt);return Vt==null?qt:uy(qt,Vt)}var l2=po(function(Mt,Vt){Mt=xo(Mt);var qt=-1,gn=Vt.length,Rn=gn>2?Vt[2]:nt;for(Rn&&Tl(Vt[0],Vt[1],Rn)&&(gn=1);++qt1),Un}),Ml(Mt,Uo(Mt),qt),gn&&(qt=yl(qt,ht|dt|pt,_i));for(var Rn=Vt.length;Rn--;)Sy(qt,Vt[Rn]);return qt});function I2(Mt,Vt){return ow(Mt,P0(bo(Vt)))}var A2=Oo(function(Mt,Vt){return Mt==null?{}:sm(Mt,Vt)});function ow(Mt,Vt){if(Mt==null)return{};var qt=ga(Uo(Mt),function(gn){return[gn]});return Vt=bo(Vt),Mm(Mt,qt,function(gn,Rn){return Vt(gn,Rn[0])})}function $2(Mt,Vt,qt){Vt=Lu(Vt,Mt);var gn=-1,Rn=Vt.length;for(Rn||(Rn=1,Mt=nt);++gnVt){var gn=Mt;Mt=Vt,Vt=gn}if(qt||Mt%1||Vt%1){var Rn=ny();return Ps(Mt+Rn*(Vt-Mt+Bp("1e-"+((Rn+"").length-1))),Vt)}return lu(Mt,Vt)}var F2=Bt(function(Mt,Vt,qt){return Vt=Vt.toLowerCase(),Mt+(qt?lw(Vt):Vt)});function lw(Mt){return s1(Zo(Mt).toLowerCase())}function cw(Mt){return Mt=Zo(Mt),Mt&&Mt.replace(eo,Ny).replace(es,"")}function U2(Mt,Vt,qt){Mt=Zo(Mt),Vt=Os(Vt);var gn=Mt.length;qt=qt===nt?gn:Bu(jo(qt),0,gn);var Rn=qt;return qt-=Vt.length,qt>=0&&Mt.slice(qt,Rn)==Vt}function z2(Mt){return Mt=Zo(Mt),Mt&&Er.test(Mt)?Mt.replace(wr,Dy):Mt}function W2(Mt){return Mt=Zo(Mt),Mt&&mo.test(Mt)?Mt.replace(jr,"\\$&"):Mt}var V2=Bt(function(Mt,Vt,qt){return Mt+(qt?"-":"")+Vt.toLowerCase()}),H2=Bt(function(Mt,Vt,qt){return Mt+(qt?" ":"")+Vt.toLowerCase()}),G2=S0("toLowerCase");function q2(Mt,Vt,qt){Mt=Zo(Mt),Vt=jo(Vt);var gn=Vt?nu(Mt):0;if(!Vt||gn>=Vt)return Mt;var Rn=(Vt-gn)/2;return Wr(Kp(Rn),qt)+Mt+Wr(Yp(Rn),qt)}function Y2(Mt,Vt,qt){Mt=Zo(Mt),Vt=jo(Vt);var gn=Vt?nu(Mt):0;return Vt&&gn>>0,qt?(Mt=Zo(Mt),Mt&&(typeof Vt=="string"||Vt!=null&&!i1(Vt))&&(Vt=Os(Vt),!Vt&&Gu(Mt))?Fu(os(Mt),0,qt):Mt.split(Vt,qt)):[]}var t4=Bt(function(Mt,Vt,qt){return Mt+(qt?" ":"")+s1(Vt)});function n4(Mt,Vt,qt){return Mt=Zo(Mt),qt=qt==null?0:Bu(jo(qt),0,Mt.length),Vt=Os(Vt),Mt.slice(qt,qt+Vt.length)==Vt}function r4(Mt,Vt,qt){var gn=Ln.templateSettings;qt&&Tl(Mt,Vt,qt)&&(Vt=nt),Mt=Zo(Mt),Vt=B0({},Vt,gn,ir);var Rn=B0({},Vt.imports,gn.imports,ir),Un=Ls(Rn),Kn=Vs(Rn,Un),Zn,or,Tr=0,Ar=Vt.interpolate||Jr,Br="__p += '",Qr=Ss((Vt.escape||Jr).source+"|"+Ar.source+"|"+(Ar===Or?tr:Jr).source+"|"+(Vt.evaluate||Jr).source+"|$","g"),co="//# sourceURL="+(Go.call(Vt,"sourceURL")?(Vt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ks+"]")+` +`;Mt.replace(Qr,function(So,Fo,Vo,Zl,Il,Ql){return Vo||(Vo=Zl),Br+=Mt.slice(Tr,Ql).replace(Zr,Km),Fo&&(Zn=!0,Br+=`' + __e(`+Fo+`) + '`),Il&&(or=!0,Br+=`'; `+Il+`; @@ -5087,13 +5087,13 @@ __p += '`),Vo&&(Br+=`' + `;var ko=Go.call(Vt,"variable")&&Vt.variable;if(!ko)Br=`with (obj) { `+Br+` } -`;else if(Fn.test(ko))throw new Eo(st);Br=(or?Br.replace(Zn,""):Br).replace(Wn,"$1").replace(fr,"$1;"),Br="function("+(ko||"obj")+`) { +`;else if(Fn.test(ko))throw new Eo(st);Br=(or?Br.replace(Jn,""):Br).replace(Wn,"$1").replace(fr,"$1;"),Br="function("+(ko||"obj")+`) { `+(ko?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(Jn?", __e = _.escape":"")+(or?`, __j = Array.prototype.join; +`)+"var __t, __p = ''"+(Zn?", __e = _.escape":"")+(or?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Br+`return __p -}`;var Do=hw(function(){return $o(Un,co+"return "+Br).apply(nt,Kn)});if(Do.source=Br,r1(Do))throw Do;return Do}function i4(Mt){return Jo(Mt).toLowerCase()}function o4(Mt){return Jo(Mt).toUpperCase()}function a4(Mt,Vt,qt){if(Mt=Jo(Mt),Mt&&(qt||Vt===nt))return bm(Mt);if(!Mt||!(Vt=Os(Vt)))return Mt;var gn=os(Mt),Rn=os(Vt),Un=ba(gn,Rn),Kn=lp(gn,Rn)+1;return Fu(gn,Un,Kn).join("")}function s4(Mt,Vt,qt){if(Mt=Jo(Mt),Mt&&(qt||Vt===nt))return Mt.slice(0,dp(Mt)+1);if(!Mt||!(Vt=Os(Vt)))return Mt;var gn=os(Mt),Rn=lp(gn,os(Vt))+1;return Fu(gn,0,Rn).join("")}function l4(Mt,Vt,qt){if(Mt=Jo(Mt),Mt&&(qt||Vt===nt))return Mt.replace(_n,"");if(!Mt||!(Vt=Os(Vt)))return Mt;var gn=os(Mt),Rn=ba(gn,os(Vt));return Fu(gn,Rn).join("")}function c4(Mt,Vt){var qt=Lt,gn=jt;if(hs(Vt)){var Rn="separator"in Vt?Vt.separator:Rn;qt="length"in Vt?jo(Vt.length):qt,gn="omission"in Vt?Os(Vt.omission):gn}Mt=Jo(Mt);var Un=Mt.length;if(Gu(Mt)){var Kn=os(Mt);Un=Kn.length}if(qt>=Un)return Mt;var Jn=qt-nu(gn);if(Jn<1)return gn;var or=Kn?Fu(Kn,0,Jn).join(""):Mt.slice(0,Jn);if(Rn===nt)return or+gn;if(Kn&&(Jn+=or.length-Jn),i1(Rn)){if(Mt.slice(Jn).search(Rn)){var Tr,Ar=or;for(Rn.global||(Rn=Ss(Rn.source,Jo(ar.exec(Rn))+"g")),Rn.lastIndex=0;Tr=Rn.exec(Ar);)var Br=Tr.index;or=or.slice(0,Br===nt?Jn:Br)}}else if(Mt.indexOf(Os(Rn),Jn)!=Jn){var Qr=or.lastIndexOf(Rn);Qr>-1&&(or=or.slice(0,Qr))}return or+gn}function u4(Mt){return Mt=Jo(Mt),Mt&&Xr.test(Mt)?Mt.replace(ur,fp):Mt}var h4=Bt(function(Mt,Vt,qt){return Mt+(qt?" ":"")+Vt.toUpperCase()}),s1=S0("toUpperCase");function uw(Mt,Vt,qt){return Mt=Jo(Mt),Vt=qt?nt:Vt,Vt===nt?Fp(Mt)?pp(Mt):Oy(Mt):Mt.match(Vt)||[]}var hw=po(function(Mt,Vt){try{return Wo(Mt,nt,Vt)}catch(qt){return r1(qt)?qt:new Eo(qt)}}),d4=Oo(function(Mt,Vt){return bs(Vt,function(qt){qt=zu(qt),su(Mt,qt,e1(Mt[qt],Mt))}),Mt});function f4(Mt){var Vt=Mt==null?0:Mt.length,qt=bo();return Mt=Vt?ga(Mt,function(gn){if(typeof gn[1]!="function")throw new Hs(at);return[qt(gn[0]),gn[1]]}):[],po(function(gn){for(var Rn=-1;++Rnzt)return[];var qt=Ut,gn=Ps(Mt,Ut);Vt=bo(Vt),Mt-=Ut;for(var Rn=bu(gn,Vt);++qt0||Vt<0)?new go(qt):(Mt<0?qt=qt.takeRight(-Mt):Mt&&(qt=qt.drop(Mt)),Vt!==nt&&(Vt=jo(Vt),qt=Vt<0?qt.dropRight(-Vt):qt.take(Vt-Mt)),qt)},go.prototype.takeRightWhile=function(Mt){return this.reverse().takeWhile(Mt).reverse()},go.prototype.toArray=function(){return this.take(Ut)},_l(go.prototype,function(Mt,Vt){var qt=/^(?:filter|find|map|reject)|While$/.test(Vt),gn=/^(?:head|last)$/.test(Vt),Rn=Ln[gn?"take"+(Vt=="last"?"Right":""):Vt],Un=gn||/^find/.test(Vt);Rn&&(Ln.prototype[Vt]=function(){var Kn=this.__wrapped__,Jn=gn?[1]:arguments,or=Kn instanceof go,Tr=Jn[0],Ar=or||Po(Kn),Br=function(Fo){var Vo=Rn.apply(Ln,Dl([Fo],Jn));return gn&&Qr?Vo[0]:Vo};Ar&&qt&&typeof Tr=="function"&&Tr.length!=1&&(or=Ar=!1);var Qr=this.__chain__,co=!!this.__actions__.length,ko=Un&&!Qr,Do=or&&!co;if(!Un&&Ar){Kn=Do?Kn:new go(this);var So=Mt.apply(Kn,Jn);return So.__actions__.push({func:I0,args:[Br],thisArg:nt}),new Ms(So,Qr)}return ko&&Do?Mt.apply(this,Jn):(So=this.thru(Br),ko?gn?So.value()[0]:So.value():So)})}),bs(["pop","push","shift","sort","splice","unshift"],function(Mt){var Vt=$u[Mt],qt=/^(?:push|sort|unshift)$/.test(Mt)?"tap":"thru",gn=/^(?:pop|shift)$/.test(Mt);Ln.prototype[Mt]=function(){var Rn=arguments;if(gn&&!this.__chain__){var Un=this.value();return Vt.apply(Po(Un)?Un:[],Rn)}return this[qt](function(Kn){return Vt.apply(Po(Kn)?Kn:[],Rn)})}}),_l(go.prototype,function(Mt,Vt){var qt=Ln[Vt];if(qt){var gn=qt.name+"";Go.call(Xu,gn)||(Xu[gn]=[]),Xu[gn].push({name:Vt,func:qt})}}),Xu[An(nt,bt).name]=[{name:"wrapper",func:nt}],go.prototype.clone=N0,go.prototype.reverse=D0,go.prototype.value=Qs,Ln.prototype.at=Lv,Ln.prototype.chain=Fv,Ln.prototype.commit=Uv,Ln.prototype.next=zv,Ln.prototype.plant=Vv,Ln.prototype.reverse=Hv,Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=Gv,Ln.prototype.first=Ln.prototype.head,Pu&&(Ln.prototype[Pu]=Wv),Ln},Au=Uy();ss?((ss.exports=Au)._=Au,mu._=Au):ts._=Au}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports;const videoTimetoSeconds=tt=>{const[et,nt,rt]=tt.split(":"),it=parseInt(et,10),ot=parseInt(nt,10),at=parseInt(rt,10);return it*3600+ot*60+at},getSelectedNodeTimestamps=(tt,et)=>{if(!et)return null;const nt=tt.filter(ot=>ot.show_title&&ot.link&&ot.show_title===et.show_title&&ot.episode_title===et.episode_title),rt=lodashExports.groupBy(nt,ot=>ot.timestamp),it=lodashExports.values(rt).reduce((ot,at)=>(at[0]&&ot.push(at[0]),ot),[]);return it.sort((ot,at)=>{var ht,dt;const[st]=((ht=ot.timestamp)==null?void 0:ht.split("-"))||[""],[lt]=((dt=at.timestamp)==null?void 0:dt.split("-"))||[""],ct=videoTimetoSeconds(st),ut=videoTimetoSeconds(lt);return ct-ut}),it},styles="",getElementsMemoized=()=>{const tt={};return()=>{if(tt.inner&&tt.body)return tt;const et=document.querySelector("body"),nt=document.createElement("div"),rt=document.createElement("div"),it=document.createElement("div"),ot=document.createElement("div"),at=()=>{nt.classList.toggle("hide")};return it.addEventListener("click",at),ot.addEventListener("click",at),nt.classList.add("loggerWrapper"),nt.classList.add("hide"),rt.classList.add("loggerInner"),it.classList.add("close"),ot.classList.add("open"),it.textContent="X",ot.textContent="OPEN LOG",et==null||et.appendChild(nt),et==null||et.appendChild(ot),nt.appendChild(it),nt.appendChild(rt),tt.body=et,tt.inner=rt,{body:et,inner:rt}}},getElements=getElementsMemoized(),variants=["log","info","warn","error"],logMessage=(tt,et)=>{const{inner:nt}=getElements(),rt=document.createElement("span");rt.textContent=tt,rt.classList.add("message"),rt.classList.add(et),nt.appendChild(rt)},overrideConsole=()=>{if(!window.location.hostname.includes("local"))return;const tt=function(et){const nt=variants.reduce((rt,it)=>({...rt,[it](...ot){et[it](...ot),logMessage(JSON.stringify(ot,null," "),it)}}),{});return{...et,...nt}}(window.console);window.console=tt},convertToChatMessage=tt=>{const et=/((http|https):\/\/[^\s]+)/g,nt=/@(\w+)/g;let rt=tt.replace(/\\/g,"");return rt=rt.replace(/'/g,"’"),rt=rt.replace(/\n/g,"
"),rt=rt.replace(et,'$1'),rt=rt.replace(nt,'@$1'),rt},useIsMatchBreakpoint=(tt,et="down")=>{const nt=useTheme(),[rt,it]=reactExports.useState(!1),ot=nt.breakpoints[et](tt).split("@media")[1].trim();return reactExports.useEffect(()=>{const at=()=>{const{matches:st}=window.matchMedia(ot);it(st)};return at(),window.addEventListener("resize",at),()=>window.removeEventListener("resize",at)},[ot]),rt};function _extends$s(){return _extends$s=Object.assign||function(tt){for(var et=1;et=0)&&(nt[it]=tt[it]);return nt}function isNum(tt){return typeof tt=="number"&&!isNaN(tt)}function isBool(tt){return typeof tt=="boolean"}function isStr(tt){return typeof tt=="string"}function isFn(tt){return typeof tt=="function"}function parseClassName(tt){return isStr(tt)||isFn(tt)?tt:null}function isToastIdValid(tt){return tt===0||tt}function getAutoCloseDelay(tt,et){return tt===!1||isNum(tt)&&tt>0?tt:et}var canUseDom=!!(typeof window<"u"&&window.document&&window.document.createElement);function canBeRendered(tt){return reactExports.isValidElement(tt)||isStr(tt)||isFn(tt)||isNum(tt)}var POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function collapseToast(tt,et,nt){nt===void 0&&(nt=300);var rt=tt.scrollHeight,it=tt.style;requestAnimationFrame(function(){it.minHeight="initial",it.height=rt+"px",it.transition="all "+nt+"ms",requestAnimationFrame(function(){it.height="0",it.padding="0",it.margin="0",setTimeout(et,nt)})})}function cssTransition(tt){var et=tt.enter,nt=tt.exit,rt=tt.appendPosition,it=rt===void 0?!1:rt,ot=tt.collapse,at=ot===void 0?!0:ot,st=tt.collapseDuration,lt=st===void 0?300:st;return function(ut){var ht=ut.children,dt=ut.position,pt=ut.preventExitTransition,mt=ut.done,gt=ut.nodeRef,yt=ut.isIn,bt=it?et+"--"+dt:et,wt=it?nt+"--"+dt:nt,xt=reactExports.useRef(),kt=reactExports.useRef(0);reactExports.useLayoutEffect(function(){St()},[]),reactExports.useEffect(function(){yt||(pt?Et():At())},[yt]);function St(){var Ct=gt.current;xt.current=Ct.className,Ct.className+=" "+bt,Ct.addEventListener("animationend",Tt),Ct.addEventListener("animationcancel",Tt)}function Tt(Ct){if(Ct.target===gt.current){var Lt=gt.current;Lt.dispatchEvent(new Event("d")),Lt.removeEventListener("animationend",Tt),Lt.removeEventListener("animationcancel",Tt),kt.current===0&&(Lt.className=xt.current)}}function At(){kt.current=1;var Ct=gt.current;Ct.className+=" "+wt,Ct.addEventListener("animationend",Et)}function Et(){var Ct=gt.current;Ct.removeEventListener("animationend",Et),at?collapseToast(Ct,mt,lt):mt()}return React$1.createElement(React$1.Fragment,null,ht)}}var eventManager={list:new Map,emitQueue:new Map,on:function(et,nt){return this.list.has(et)||this.list.set(et,[]),this.list.get(et).push(nt),this},off:function(et,nt){if(nt){var rt=this.list.get(et).filter(function(it){return it!==nt});return this.list.set(et,rt),this}return this.list.delete(et),this},cancelEmit:function(et){var nt=this.emitQueue.get(et);return nt&&(nt.forEach(clearTimeout),this.emitQueue.delete(et)),this},emit:function(et){for(var nt=this,rt=arguments.length,it=new Array(rt>1?rt-1:0),ot=1;ot0){var Ot=isToastIdValid(Tt)?1:ct.props.limit;if(It===1||Ot===1)ct.displayedToast++,dt();else{var Wt=Ot>It?It:Ot;ct.displayedToast=Wt;for(var zt=0;zt0&&ct.count>Ct.limit&&jt?ct.queue.push({toastContent:$t,toastProps:Rt,staleId:kt}):isNum(xt)&&xt>0?setTimeout(function(){gt($t,Rt,kt)},xt):gt($t,Rt,kt)}}function gt(bt,wt,xt){var kt=wt.toastId;xt&&st.delete(xt),st.set(kt,{content:bt,props:wt}),ot(function(St){return[].concat(St,[kt]).filter(function(Tt){return Tt!==xt})})}function yt(bt){var wt=new Map,xt=Array.from(st.values());return tt.newestOnTop&&xt.reverse(),xt.forEach(function(kt){var St=kt.props.position;wt.has(St)||wt.set(St,[]),wt.get(St).push(kt)}),Array.from(wt,function(kt){return bt(kt[0],kt[1])})}return{getToastToRender:yt,containerRef:at,isToastActive:lt}}function getX$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientX:tt.clientX}function getY$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientY:tt.clientY}function useToast(tt){var et=reactExports.useState(!1),nt=et[0],rt=et[1],it=reactExports.useState(!1),ot=it[0],at=it[1],st=reactExports.useRef(null),lt=reactExports.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,ct=reactExports.useRef(tt),ut=tt.autoClose,ht=tt.pauseOnHover,dt=tt.closeToast,pt=tt.onClick,mt=tt.closeOnClick;reactExports.useEffect(function(){ct.current=tt}),reactExports.useEffect(function(){return st.current&&st.current.addEventListener("d",bt,{once:!0}),isFn(tt.onOpen)&&tt.onOpen(reactExports.isValidElement(tt.children)&&tt.children.props),function(){var Lt=ct.current;isFn(Lt.onClose)&&Lt.onClose(reactExports.isValidElement(Lt.children)&&Lt.children.props)}},[]),reactExports.useEffect(function(){return tt.pauseOnFocusLoss&&xt(),function(){tt.pauseOnFocusLoss&&kt()}},[tt.pauseOnFocusLoss]);function gt(Lt){if(tt.draggable){St();var jt=st.current;lt.canCloseOnClick=!0,lt.canDrag=!0,lt.boundingRect=jt.getBoundingClientRect(),jt.style.transition="",lt.x=getX$1(Lt.nativeEvent),lt.y=getY$1(Lt.nativeEvent),tt.draggableDirection==="x"?(lt.start=lt.x,lt.removalDistance=jt.offsetWidth*(tt.draggablePercent/100)):(lt.start=lt.y,lt.removalDistance=jt.offsetHeight*(tt.draggablePercent===80?tt.draggablePercent*1.5:tt.draggablePercent/100))}}function yt(){if(lt.boundingRect){var Lt=lt.boundingRect,jt=Lt.top,Rt=Lt.bottom,$t=Lt.left,vt=Lt.right;tt.pauseOnHover&<.x>=$t&<.x<=vt&<.y>=jt&<.y<=Rt?wt():bt()}}function bt(){rt(!0)}function wt(){rt(!1)}function xt(){document.hasFocus()||wt(),window.addEventListener("focus",bt),window.addEventListener("blur",wt)}function kt(){window.removeEventListener("focus",bt),window.removeEventListener("blur",wt)}function St(){lt.didMove=!1,document.addEventListener("mousemove",At),document.addEventListener("mouseup",Et),document.addEventListener("touchmove",At),document.addEventListener("touchend",Et)}function Tt(){document.removeEventListener("mousemove",At),document.removeEventListener("mouseup",Et),document.removeEventListener("touchmove",At),document.removeEventListener("touchend",Et)}function At(Lt){var jt=st.current;lt.canDrag&&jt&&(lt.didMove=!0,nt&&wt(),lt.x=getX$1(Lt),lt.y=getY$1(Lt),tt.draggableDirection==="x"?lt.delta=lt.x-lt.start:lt.delta=lt.y-lt.start,lt.start!==lt.x&&(lt.canCloseOnClick=!1),jt.style.transform="translate"+tt.draggableDirection+"("+lt.delta+"px)",jt.style.opacity=""+(1-Math.abs(lt.delta/lt.removalDistance)))}function Et(){Tt();var Lt=st.current;if(lt.canDrag&<.didMove&&Lt){if(lt.canDrag=!1,Math.abs(lt.delta)>lt.removalDistance){at(!0),tt.closeToast();return}Lt.style.transition="transform 0.2s, opacity 0.2s",Lt.style.transform="translate"+tt.draggableDirection+"(0)",Lt.style.opacity="1"}}var Ct={onMouseDown:gt,onTouchStart:gt,onMouseUp:yt,onTouchEnd:yt};return ut&&ht&&(Ct.onMouseEnter=wt,Ct.onMouseLeave=bt),mt&&(Ct.onClick=function(Lt){pt&&pt(Lt),lt.canCloseOnClick&&dt()}),{playToast:bt,pauseToast:wt,isRunning:nt,preventExitTransition:ot,toastRef:st,eventHandlers:Ct}}function CloseButton$4(tt){var et=tt.closeToast,nt=tt.theme,rt=tt.ariaLabel,it=rt===void 0?"close":rt;return reactExports.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+nt,type:"button",onClick:function(at){at.stopPropagation(),et(at)},"aria-label":it},reactExports.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},reactExports.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ProgressBar(tt){var et,nt,rt=tt.delay,it=tt.isRunning,ot=tt.closeToast,at=tt.type,st=tt.hide,lt=tt.className,ct=tt.style,ut=tt.controlledProgress,ht=tt.progress,dt=tt.rtl,pt=tt.isIn,mt=tt.theme,gt=_extends$s({},ct,{animationDuration:rt+"ms",animationPlayState:it?"running":"paused",opacity:st?0:1});ut&&(gt.transform="scaleX("+ht+")");var yt=clsx$4("Toastify__progress-bar",ut?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+mt,"Toastify__progress-bar--"+at,(et={},et["Toastify__progress-bar--rtl"]=dt,et)),bt=isFn(lt)?lt({rtl:dt,type:at,defaultClassName:yt}):clsx$4(yt,lt),wt=(nt={},nt[ut&&ht>=1?"onTransitionEnd":"onAnimationEnd"]=ut&&ht<1?null:function(){pt&&ot()},nt);return reactExports.createElement("div",Object.assign({role:"progressbar","aria-hidden":st?"true":"false","aria-label":"notification timer",className:bt,style:gt},wt))}ProgressBar.defaultProps={type:TYPE.DEFAULT,hide:!1};var _excluded$1$1=["theme","type"],Svg=function(et){var nt=et.theme,rt=et.type,it=_objectWithoutPropertiesLoose$j(et,_excluded$1$1);return reactExports.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:nt==="colored"?"currentColor":"var(--toastify-icon-color-"+rt+")"},it))};function Warning(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Info(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Success(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Error$1(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Spinner(){return reactExports.createElement("div",{className:"Toastify__spinner"})}var Icons={info:Info,warning:Warning,success:Success,error:Error$1,spinner:Spinner},Toast=function(et){var nt,rt,it=useToast(et),ot=it.isRunning,at=it.preventExitTransition,st=it.toastRef,lt=it.eventHandlers,ct=et.closeButton,ut=et.children,ht=et.autoClose,dt=et.onClick,pt=et.type,mt=et.hideProgressBar,gt=et.closeToast,yt=et.transition,bt=et.position,wt=et.className,xt=et.style,kt=et.bodyClassName,St=et.bodyStyle,Tt=et.progressClassName,At=et.progressStyle,Et=et.updateId,Ct=et.role,Lt=et.progress,jt=et.rtl,Rt=et.toastId,$t=et.deleteToast,vt=et.isIn,It=et.isLoading,Ot=et.icon,Wt=et.theme,zt=clsx$4("Toastify__toast","Toastify__toast-theme--"+Wt,"Toastify__toast--"+pt,(nt={},nt["Toastify__toast--rtl"]=jt,nt)),Ft=isFn(wt)?wt({rtl:jt,position:bt,type:pt,defaultClassName:zt}):clsx$4(zt,wt),Nt=!!Lt,Ut=Icons[pt],Pt={theme:Wt,type:pt},Ht=Ut&&Ut(Pt);Ot===!1?Ht=void 0:isFn(Ot)?Ht=Ot(Pt):reactExports.isValidElement(Ot)?Ht=reactExports.cloneElement(Ot,Pt):isStr(Ot)?Ht=Ot:It&&(Ht=Icons.spinner());function Qt(an){if(an){var Yt={closeToast:gt,type:pt,theme:Wt};if(isFn(an))return an(Yt);if(reactExports.isValidElement(an))return reactExports.cloneElement(an,Yt)}}return reactExports.createElement(yt,{isIn:vt,done:$t,position:bt,preventExitTransition:at,nodeRef:st},reactExports.createElement("div",Object.assign({id:Rt,onClick:dt,className:Ft},lt,{style:xt,ref:st}),reactExports.createElement("div",Object.assign({},vt&&{role:Ct},{className:isFn(kt)?kt({type:pt}):clsx$4("Toastify__toast-body",kt),style:St}),Ht&&reactExports.createElement("div",{className:clsx$4("Toastify__toast-icon",(rt={},rt["Toastify--animate-icon Toastify__zoom-enter"]=!It,rt))},Ht),reactExports.createElement("div",null,ut)),Qt(ct),(ht||Nt)&&reactExports.createElement(ProgressBar,Object.assign({},Et&&!Nt?{key:"pb-"+Et}:{},{rtl:jt,theme:Wt,delay:ht,isRunning:ot,isIn:vt,closeToast:gt,hide:mt,type:pt,style:At,className:Tt,controlledProgress:Nt,progress:Lt}))))},Bounce=cssTransition({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),ToastContainer=function(et){var nt=useToastContainer(et),rt=nt.getToastToRender,it=nt.containerRef,ot=nt.isToastActive,at=et.className,st=et.style,lt=et.rtl,ct=et.containerId;function ut(ht){var dt,pt=clsx$4("Toastify__toast-container","Toastify__toast-container--"+ht,(dt={},dt["Toastify__toast-container--rtl"]=lt,dt));return isFn(at)?at({position:ht,rtl:lt,defaultClassName:pt}):clsx$4(pt,parseClassName(at))}return reactExports.createElement("div",{ref:it,className:"Toastify",id:ct},rt(function(ht,dt){var pt=dt.length?_extends$s({},st):_extends$s({},st,{pointerEvents:"none"});return reactExports.createElement("div",{className:ut(ht),style:pt,key:"container-"+ht},dt.map(function(mt){var gt=mt.content,yt=mt.props;return reactExports.createElement(Toast,Object.assign({},yt,{isIn:ot(yt.toastId),key:"toast-"+yt.key,closeButton:yt.closeButton===!0?CloseButton$4:yt.closeButton}),gt)}))}))};ToastContainer.defaultProps={position:POSITION.TOP_RIGHT,transition:Bounce,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:CloseButton$4,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};var containers=new Map,latestInstance,containerDomNode,containerConfig,queue=[],lazy=!1;function getToast(tt,et){var nt=et.containerId,rt=containers.get(nt||latestInstance);return rt?rt.getToast(tt):null}function generateToastId(){return Math.random().toString(36).substring(2,9)}function getToastId(tt){return tt&&(isStr(tt.toastId)||isNum(tt.toastId))?tt.toastId:generateToastId()}function dispatchToast(tt,et){return containers.size>0?eventManager.emit(0,tt,et):(queue.push({content:tt,options:et}),lazy&&canUseDom&&(lazy=!1,containerDomNode=document.createElement("div"),document.body.appendChild(containerDomNode),reactDomExports.render(reactExports.createElement(ToastContainer,Object.assign({},containerConfig)),containerDomNode))),et.toastId}function mergeOptions(tt,et){return _extends$s({},et,{type:et&&et.type||tt,toastId:getToastId(et)})}function createToastByType(tt){return function(et,nt){return dispatchToast(et,mergeOptions(tt,nt))}}function toast(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,et))}toast.loading=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$s({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},et)))};function handlePromise(tt,et,nt){var rt=et.pending,it=et.error,ot=et.success,at;rt&&(at=isStr(rt)?toast.loading(rt,nt):toast.loading(rt.render,_extends$s({},nt,rt)));var st={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},lt=function(ht,dt,pt){if(dt==null){toast.dismiss(at);return}var mt=_extends$s({type:ht},st,nt,{data:pt}),gt=isStr(dt)?{render:dt}:dt;return at?toast.update(at,_extends$s({},mt,gt)):toast(gt.render,_extends$s({},mt,gt)),pt},ct=isFn(tt)?tt():tt;return ct.then(function(ut){return lt("success",ot,ut)}).catch(function(ut){return lt("error",it,ut)}),ct}toast.promise=handlePromise;toast.success=createToastByType(TYPE.SUCCESS);toast.info=createToastByType(TYPE.INFO);toast.error=createToastByType(TYPE.ERROR);toast.warning=createToastByType(TYPE.WARNING);toast.warn=toast.warning;toast.dark=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$s({theme:"dark"},et)))};toast.dismiss=function(tt){return eventManager.emit(1,tt)};toast.clearWaitingQueue=function(tt){return tt===void 0&&(tt={}),eventManager.emit(5,tt)};toast.isActive=function(tt){var et=!1;return containers.forEach(function(nt){nt.isToastActive&&nt.isToastActive(tt)&&(et=!0)}),et};toast.update=function(tt,et){et===void 0&&(et={}),setTimeout(function(){var nt=getToast(tt,et);if(nt){var rt=nt.props,it=nt.content,ot=_extends$s({},rt,et,{toastId:et.toastId||tt,updateId:generateToastId()});ot.toastId!==tt&&(ot.staleId=tt);var at=ot.render||it;delete ot.render,dispatchToast(at,ot)}},0)};toast.done=function(tt){toast.update(tt,{progress:1})};toast.onChange=function(tt){return isFn(tt)&&eventManager.on(4,tt),function(){isFn(tt)&&eventManager.off(4,tt)}};toast.configure=function(tt){tt===void 0&&(tt={}),lazy=!0,containerConfig=tt};toast.POSITION=POSITION;toast.TYPE=TYPE;eventManager.on(2,function(tt){latestInstance=tt.containerId||tt,containers.set(latestInstance,tt),queue.forEach(function(et){eventManager.emit(0,et.content,et.options)}),queue=[]}).on(3,function(tt){containers.delete(tt.containerId||tt),containers.size===0&&eventManager.off(0).off(1).off(5),canUseDom&&containerDomNode&&document.body.removeChild(containerDomNode)});const topupFromToast=async()=>{try{const tt=await distExports$1.topup();if(!tt)throw new Error("Topup failed");if(tt.budget<5)throw new Error("You set a budget of less than 5 sats");toast(jsxRuntimeExports.jsx(ToastMessage,{message:`You set a budget of ${tt.budget} sats`}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"success"})}catch(tt){tt instanceof Error&&toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt.message}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"error"})}},ToastMessage=({message:tt})=>tt===BOOST_ERROR_BUDGET?jsxRuntimeExports.jsxs("div",{children:[tt,jsxRuntimeExports.jsx(ButtonWrapper,{onClick:topupFromToast,type:"button",children:jsxRuntimeExports.jsx(Text$1,{color:"white",kind:"medium",children:"Topup"})})]}):jsxRuntimeExports.jsx("div",{children:tt}),notify$1=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:tt===NODE_ADD_SUCCESS?jsxRuntimeExports.jsx(MdCheckCircle,{color:colors.primaryGreen}):jsxRuntimeExports.jsx(MdWarning,{color:colors.primaryRed}),position:toast.POSITION.BOTTOM_CENTER,type:tt===NODE_ADD_SUCCESS?"success":"error"})},ButtonWrapper=styled$4.button` +}`;var Do=hw(function(){return $o(Un,co+"return "+Br).apply(nt,Kn)});if(Do.source=Br,r1(Do))throw Do;return Do}function i4(Mt){return Zo(Mt).toLowerCase()}function o4(Mt){return Zo(Mt).toUpperCase()}function a4(Mt,Vt,qt){if(Mt=Zo(Mt),Mt&&(qt||Vt===nt))return bm(Mt);if(!Mt||!(Vt=Os(Vt)))return Mt;var gn=os(Mt),Rn=os(Vt),Un=ba(gn,Rn),Kn=lp(gn,Rn)+1;return Fu(gn,Un,Kn).join("")}function s4(Mt,Vt,qt){if(Mt=Zo(Mt),Mt&&(qt||Vt===nt))return Mt.slice(0,dp(Mt)+1);if(!Mt||!(Vt=Os(Vt)))return Mt;var gn=os(Mt),Rn=lp(gn,os(Vt))+1;return Fu(gn,0,Rn).join("")}function l4(Mt,Vt,qt){if(Mt=Zo(Mt),Mt&&(qt||Vt===nt))return Mt.replace(_n,"");if(!Mt||!(Vt=Os(Vt)))return Mt;var gn=os(Mt),Rn=ba(gn,os(Vt));return Fu(gn,Rn).join("")}function c4(Mt,Vt){var qt=Lt,gn=jt;if(hs(Vt)){var Rn="separator"in Vt?Vt.separator:Rn;qt="length"in Vt?jo(Vt.length):qt,gn="omission"in Vt?Os(Vt.omission):gn}Mt=Zo(Mt);var Un=Mt.length;if(Gu(Mt)){var Kn=os(Mt);Un=Kn.length}if(qt>=Un)return Mt;var Zn=qt-nu(gn);if(Zn<1)return gn;var or=Kn?Fu(Kn,0,Zn).join(""):Mt.slice(0,Zn);if(Rn===nt)return or+gn;if(Kn&&(Zn+=or.length-Zn),i1(Rn)){if(Mt.slice(Zn).search(Rn)){var Tr,Ar=or;for(Rn.global||(Rn=Ss(Rn.source,Zo(ar.exec(Rn))+"g")),Rn.lastIndex=0;Tr=Rn.exec(Ar);)var Br=Tr.index;or=or.slice(0,Br===nt?Zn:Br)}}else if(Mt.indexOf(Os(Rn),Zn)!=Zn){var Qr=or.lastIndexOf(Rn);Qr>-1&&(or=or.slice(0,Qr))}return or+gn}function u4(Mt){return Mt=Zo(Mt),Mt&&Xr.test(Mt)?Mt.replace(ur,fp):Mt}var h4=Bt(function(Mt,Vt,qt){return Mt+(qt?" ":"")+Vt.toUpperCase()}),s1=S0("toUpperCase");function uw(Mt,Vt,qt){return Mt=Zo(Mt),Vt=qt?nt:Vt,Vt===nt?Fp(Mt)?pp(Mt):Oy(Mt):Mt.match(Vt)||[]}var hw=po(function(Mt,Vt){try{return Wo(Mt,nt,Vt)}catch(qt){return r1(qt)?qt:new Eo(qt)}}),d4=Oo(function(Mt,Vt){return bs(Vt,function(qt){qt=zu(qt),su(Mt,qt,e1(Mt[qt],Mt))}),Mt});function f4(Mt){var Vt=Mt==null?0:Mt.length,qt=bo();return Mt=Vt?ga(Mt,function(gn){if(typeof gn[1]!="function")throw new Hs(at);return[qt(gn[0]),gn[1]]}):[],po(function(gn){for(var Rn=-1;++Rnzt)return[];var qt=Ut,gn=Ps(Mt,Ut);Vt=bo(Vt),Mt-=Ut;for(var Rn=bu(gn,Vt);++qt0||Vt<0)?new go(qt):(Mt<0?qt=qt.takeRight(-Mt):Mt&&(qt=qt.drop(Mt)),Vt!==nt&&(Vt=jo(Vt),qt=Vt<0?qt.dropRight(-Vt):qt.take(Vt-Mt)),qt)},go.prototype.takeRightWhile=function(Mt){return this.reverse().takeWhile(Mt).reverse()},go.prototype.toArray=function(){return this.take(Ut)},_l(go.prototype,function(Mt,Vt){var qt=/^(?:filter|find|map|reject)|While$/.test(Vt),gn=/^(?:head|last)$/.test(Vt),Rn=Ln[gn?"take"+(Vt=="last"?"Right":""):Vt],Un=gn||/^find/.test(Vt);Rn&&(Ln.prototype[Vt]=function(){var Kn=this.__wrapped__,Zn=gn?[1]:arguments,or=Kn instanceof go,Tr=Zn[0],Ar=or||Po(Kn),Br=function(Fo){var Vo=Rn.apply(Ln,Dl([Fo],Zn));return gn&&Qr?Vo[0]:Vo};Ar&&qt&&typeof Tr=="function"&&Tr.length!=1&&(or=Ar=!1);var Qr=this.__chain__,co=!!this.__actions__.length,ko=Un&&!Qr,Do=or&&!co;if(!Un&&Ar){Kn=Do?Kn:new go(this);var So=Mt.apply(Kn,Zn);return So.__actions__.push({func:I0,args:[Br],thisArg:nt}),new Ms(So,Qr)}return ko&&Do?Mt.apply(this,Zn):(So=this.thru(Br),ko?gn?So.value()[0]:So.value():So)})}),bs(["pop","push","shift","sort","splice","unshift"],function(Mt){var Vt=$u[Mt],qt=/^(?:push|sort|unshift)$/.test(Mt)?"tap":"thru",gn=/^(?:pop|shift)$/.test(Mt);Ln.prototype[Mt]=function(){var Rn=arguments;if(gn&&!this.__chain__){var Un=this.value();return Vt.apply(Po(Un)?Un:[],Rn)}return this[qt](function(Kn){return Vt.apply(Po(Kn)?Kn:[],Rn)})}}),_l(go.prototype,function(Mt,Vt){var qt=Ln[Vt];if(qt){var gn=qt.name+"";Go.call(Xu,gn)||(Xu[gn]=[]),Xu[gn].push({name:Vt,func:qt})}}),Xu[An(nt,bt).name]=[{name:"wrapper",func:nt}],go.prototype.clone=N0,go.prototype.reverse=D0,go.prototype.value=Qs,Ln.prototype.at=Lv,Ln.prototype.chain=Fv,Ln.prototype.commit=Uv,Ln.prototype.next=zv,Ln.prototype.plant=Vv,Ln.prototype.reverse=Hv,Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=Gv,Ln.prototype.first=Ln.prototype.head,Pu&&(Ln.prototype[Pu]=Wv),Ln},Au=Uy();ss?((ss.exports=Au)._=Au,mu._=Au):ts._=Au}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports;const videoTimetoSeconds=tt=>{const[et,nt,rt]=tt.split(":"),it=parseInt(et,10),ot=parseInt(nt,10),at=parseInt(rt,10);return it*3600+ot*60+at},getSelectedNodeTimestamps=(tt,et)=>{if(!et)return null;const nt=tt.filter(ot=>ot.show_title&&ot.link&&ot.show_title===et.show_title&&ot.episode_title===et.episode_title),rt=lodashExports.groupBy(nt,ot=>ot.timestamp),it=lodashExports.values(rt).reduce((ot,at)=>(at[0]&&ot.push(at[0]),ot),[]);return it.sort((ot,at)=>{var ht,dt;const[st]=((ht=ot.timestamp)==null?void 0:ht.split("-"))||[""],[lt]=((dt=at.timestamp)==null?void 0:dt.split("-"))||[""],ct=videoTimetoSeconds(st),ut=videoTimetoSeconds(lt);return ct-ut}),it},styles="",getElementsMemoized=()=>{const tt={};return()=>{if(tt.inner&&tt.body)return tt;const et=document.querySelector("body"),nt=document.createElement("div"),rt=document.createElement("div"),it=document.createElement("div"),ot=document.createElement("div"),at=()=>{nt.classList.toggle("hide")};return it.addEventListener("click",at),ot.addEventListener("click",at),nt.classList.add("loggerWrapper"),nt.classList.add("hide"),rt.classList.add("loggerInner"),it.classList.add("close"),ot.classList.add("open"),it.textContent="X",ot.textContent="OPEN LOG",et==null||et.appendChild(nt),et==null||et.appendChild(ot),nt.appendChild(it),nt.appendChild(rt),tt.body=et,tt.inner=rt,{body:et,inner:rt}}},getElements=getElementsMemoized(),variants=["log","info","warn","error"],logMessage=(tt,et)=>{const{inner:nt}=getElements(),rt=document.createElement("span");rt.textContent=tt,rt.classList.add("message"),rt.classList.add(et),nt.appendChild(rt)},overrideConsole=()=>{if(!window.location.hostname.includes("local"))return;const tt=function(et){const nt=variants.reduce((rt,it)=>({...rt,[it](...ot){et[it](...ot),logMessage(JSON.stringify(ot,null," "),it)}}),{});return{...et,...nt}}(window.console);window.console=tt},convertToChatMessage=tt=>{const et=/((http|https):\/\/[^\s]+)/g,nt=/@(\w+)/g;let rt=tt.replace(/\\/g,"");return rt=rt.replace(/'/g,"’"),rt=rt.replace(/\n/g,"
"),rt=rt.replace(et,'$1'),rt=rt.replace(nt,'@$1'),rt},useIsMatchBreakpoint=(tt,et="down")=>{const nt=useTheme(),[rt,it]=reactExports.useState(!1),ot=nt.breakpoints[et](tt).split("@media")[1].trim();return reactExports.useEffect(()=>{const at=()=>{const{matches:st}=window.matchMedia(ot);it(st)};return at(),window.addEventListener("resize",at),()=>window.removeEventListener("resize",at)},[ot]),rt};function _extends$s(){return _extends$s=Object.assign||function(tt){for(var et=1;et=0)&&(nt[it]=tt[it]);return nt}function isNum(tt){return typeof tt=="number"&&!isNaN(tt)}function isBool(tt){return typeof tt=="boolean"}function isStr(tt){return typeof tt=="string"}function isFn(tt){return typeof tt=="function"}function parseClassName(tt){return isStr(tt)||isFn(tt)?tt:null}function isToastIdValid(tt){return tt===0||tt}function getAutoCloseDelay(tt,et){return tt===!1||isNum(tt)&&tt>0?tt:et}var canUseDom=!!(typeof window<"u"&&window.document&&window.document.createElement);function canBeRendered(tt){return reactExports.isValidElement(tt)||isStr(tt)||isFn(tt)||isNum(tt)}var POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function collapseToast(tt,et,nt){nt===void 0&&(nt=300);var rt=tt.scrollHeight,it=tt.style;requestAnimationFrame(function(){it.minHeight="initial",it.height=rt+"px",it.transition="all "+nt+"ms",requestAnimationFrame(function(){it.height="0",it.padding="0",it.margin="0",setTimeout(et,nt)})})}function cssTransition(tt){var et=tt.enter,nt=tt.exit,rt=tt.appendPosition,it=rt===void 0?!1:rt,ot=tt.collapse,at=ot===void 0?!0:ot,st=tt.collapseDuration,lt=st===void 0?300:st;return function(ut){var ht=ut.children,dt=ut.position,pt=ut.preventExitTransition,mt=ut.done,gt=ut.nodeRef,yt=ut.isIn,bt=it?et+"--"+dt:et,wt=it?nt+"--"+dt:nt,xt=reactExports.useRef(),kt=reactExports.useRef(0);reactExports.useLayoutEffect(function(){St()},[]),reactExports.useEffect(function(){yt||(pt?Et():At())},[yt]);function St(){var Ct=gt.current;xt.current=Ct.className,Ct.className+=" "+bt,Ct.addEventListener("animationend",Tt),Ct.addEventListener("animationcancel",Tt)}function Tt(Ct){if(Ct.target===gt.current){var Lt=gt.current;Lt.dispatchEvent(new Event("d")),Lt.removeEventListener("animationend",Tt),Lt.removeEventListener("animationcancel",Tt),kt.current===0&&(Lt.className=xt.current)}}function At(){kt.current=1;var Ct=gt.current;Ct.className+=" "+wt,Ct.addEventListener("animationend",Et)}function Et(){var Ct=gt.current;Ct.removeEventListener("animationend",Et),at?collapseToast(Ct,mt,lt):mt()}return React$1.createElement(React$1.Fragment,null,ht)}}var eventManager={list:new Map,emitQueue:new Map,on:function(et,nt){return this.list.has(et)||this.list.set(et,[]),this.list.get(et).push(nt),this},off:function(et,nt){if(nt){var rt=this.list.get(et).filter(function(it){return it!==nt});return this.list.set(et,rt),this}return this.list.delete(et),this},cancelEmit:function(et){var nt=this.emitQueue.get(et);return nt&&(nt.forEach(clearTimeout),this.emitQueue.delete(et)),this},emit:function(et){for(var nt=this,rt=arguments.length,it=new Array(rt>1?rt-1:0),ot=1;ot0){var Ot=isToastIdValid(Tt)?1:ct.props.limit;if(It===1||Ot===1)ct.displayedToast++,dt();else{var Wt=Ot>It?It:Ot;ct.displayedToast=Wt;for(var zt=0;zt0&&ct.count>Ct.limit&&jt?ct.queue.push({toastContent:$t,toastProps:Rt,staleId:kt}):isNum(xt)&&xt>0?setTimeout(function(){gt($t,Rt,kt)},xt):gt($t,Rt,kt)}}function gt(bt,wt,xt){var kt=wt.toastId;xt&&st.delete(xt),st.set(kt,{content:bt,props:wt}),ot(function(St){return[].concat(St,[kt]).filter(function(Tt){return Tt!==xt})})}function yt(bt){var wt=new Map,xt=Array.from(st.values());return tt.newestOnTop&&xt.reverse(),xt.forEach(function(kt){var St=kt.props.position;wt.has(St)||wt.set(St,[]),wt.get(St).push(kt)}),Array.from(wt,function(kt){return bt(kt[0],kt[1])})}return{getToastToRender:yt,containerRef:at,isToastActive:lt}}function getX$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientX:tt.clientX}function getY$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientY:tt.clientY}function useToast(tt){var et=reactExports.useState(!1),nt=et[0],rt=et[1],it=reactExports.useState(!1),ot=it[0],at=it[1],st=reactExports.useRef(null),lt=reactExports.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,ct=reactExports.useRef(tt),ut=tt.autoClose,ht=tt.pauseOnHover,dt=tt.closeToast,pt=tt.onClick,mt=tt.closeOnClick;reactExports.useEffect(function(){ct.current=tt}),reactExports.useEffect(function(){return st.current&&st.current.addEventListener("d",bt,{once:!0}),isFn(tt.onOpen)&&tt.onOpen(reactExports.isValidElement(tt.children)&&tt.children.props),function(){var Lt=ct.current;isFn(Lt.onClose)&&Lt.onClose(reactExports.isValidElement(Lt.children)&&Lt.children.props)}},[]),reactExports.useEffect(function(){return tt.pauseOnFocusLoss&&xt(),function(){tt.pauseOnFocusLoss&&kt()}},[tt.pauseOnFocusLoss]);function gt(Lt){if(tt.draggable){St();var jt=st.current;lt.canCloseOnClick=!0,lt.canDrag=!0,lt.boundingRect=jt.getBoundingClientRect(),jt.style.transition="",lt.x=getX$1(Lt.nativeEvent),lt.y=getY$1(Lt.nativeEvent),tt.draggableDirection==="x"?(lt.start=lt.x,lt.removalDistance=jt.offsetWidth*(tt.draggablePercent/100)):(lt.start=lt.y,lt.removalDistance=jt.offsetHeight*(tt.draggablePercent===80?tt.draggablePercent*1.5:tt.draggablePercent/100))}}function yt(){if(lt.boundingRect){var Lt=lt.boundingRect,jt=Lt.top,Rt=Lt.bottom,$t=Lt.left,vt=Lt.right;tt.pauseOnHover&<.x>=$t&<.x<=vt&<.y>=jt&<.y<=Rt?wt():bt()}}function bt(){rt(!0)}function wt(){rt(!1)}function xt(){document.hasFocus()||wt(),window.addEventListener("focus",bt),window.addEventListener("blur",wt)}function kt(){window.removeEventListener("focus",bt),window.removeEventListener("blur",wt)}function St(){lt.didMove=!1,document.addEventListener("mousemove",At),document.addEventListener("mouseup",Et),document.addEventListener("touchmove",At),document.addEventListener("touchend",Et)}function Tt(){document.removeEventListener("mousemove",At),document.removeEventListener("mouseup",Et),document.removeEventListener("touchmove",At),document.removeEventListener("touchend",Et)}function At(Lt){var jt=st.current;lt.canDrag&&jt&&(lt.didMove=!0,nt&&wt(),lt.x=getX$1(Lt),lt.y=getY$1(Lt),tt.draggableDirection==="x"?lt.delta=lt.x-lt.start:lt.delta=lt.y-lt.start,lt.start!==lt.x&&(lt.canCloseOnClick=!1),jt.style.transform="translate"+tt.draggableDirection+"("+lt.delta+"px)",jt.style.opacity=""+(1-Math.abs(lt.delta/lt.removalDistance)))}function Et(){Tt();var Lt=st.current;if(lt.canDrag&<.didMove&&Lt){if(lt.canDrag=!1,Math.abs(lt.delta)>lt.removalDistance){at(!0),tt.closeToast();return}Lt.style.transition="transform 0.2s, opacity 0.2s",Lt.style.transform="translate"+tt.draggableDirection+"(0)",Lt.style.opacity="1"}}var Ct={onMouseDown:gt,onTouchStart:gt,onMouseUp:yt,onTouchEnd:yt};return ut&&ht&&(Ct.onMouseEnter=wt,Ct.onMouseLeave=bt),mt&&(Ct.onClick=function(Lt){pt&&pt(Lt),lt.canCloseOnClick&&dt()}),{playToast:bt,pauseToast:wt,isRunning:nt,preventExitTransition:ot,toastRef:st,eventHandlers:Ct}}function CloseButton$4(tt){var et=tt.closeToast,nt=tt.theme,rt=tt.ariaLabel,it=rt===void 0?"close":rt;return reactExports.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+nt,type:"button",onClick:function(at){at.stopPropagation(),et(at)},"aria-label":it},reactExports.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},reactExports.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ProgressBar(tt){var et,nt,rt=tt.delay,it=tt.isRunning,ot=tt.closeToast,at=tt.type,st=tt.hide,lt=tt.className,ct=tt.style,ut=tt.controlledProgress,ht=tt.progress,dt=tt.rtl,pt=tt.isIn,mt=tt.theme,gt=_extends$s({},ct,{animationDuration:rt+"ms",animationPlayState:it?"running":"paused",opacity:st?0:1});ut&&(gt.transform="scaleX("+ht+")");var yt=clsx$4("Toastify__progress-bar",ut?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+mt,"Toastify__progress-bar--"+at,(et={},et["Toastify__progress-bar--rtl"]=dt,et)),bt=isFn(lt)?lt({rtl:dt,type:at,defaultClassName:yt}):clsx$4(yt,lt),wt=(nt={},nt[ut&&ht>=1?"onTransitionEnd":"onAnimationEnd"]=ut&&ht<1?null:function(){pt&&ot()},nt);return reactExports.createElement("div",Object.assign({role:"progressbar","aria-hidden":st?"true":"false","aria-label":"notification timer",className:bt,style:gt},wt))}ProgressBar.defaultProps={type:TYPE.DEFAULT,hide:!1};var _excluded$1$1=["theme","type"],Svg=function(et){var nt=et.theme,rt=et.type,it=_objectWithoutPropertiesLoose$j(et,_excluded$1$1);return reactExports.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:nt==="colored"?"currentColor":"var(--toastify-icon-color-"+rt+")"},it))};function Warning(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Info(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Success(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Error$1(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Spinner(){return reactExports.createElement("div",{className:"Toastify__spinner"})}var Icons={info:Info,warning:Warning,success:Success,error:Error$1,spinner:Spinner},Toast=function(et){var nt,rt,it=useToast(et),ot=it.isRunning,at=it.preventExitTransition,st=it.toastRef,lt=it.eventHandlers,ct=et.closeButton,ut=et.children,ht=et.autoClose,dt=et.onClick,pt=et.type,mt=et.hideProgressBar,gt=et.closeToast,yt=et.transition,bt=et.position,wt=et.className,xt=et.style,kt=et.bodyClassName,St=et.bodyStyle,Tt=et.progressClassName,At=et.progressStyle,Et=et.updateId,Ct=et.role,Lt=et.progress,jt=et.rtl,Rt=et.toastId,$t=et.deleteToast,vt=et.isIn,It=et.isLoading,Ot=et.icon,Wt=et.theme,zt=clsx$4("Toastify__toast","Toastify__toast-theme--"+Wt,"Toastify__toast--"+pt,(nt={},nt["Toastify__toast--rtl"]=jt,nt)),Ft=isFn(wt)?wt({rtl:jt,position:bt,type:pt,defaultClassName:zt}):clsx$4(zt,wt),Nt=!!Lt,Ut=Icons[pt],Pt={theme:Wt,type:pt},Ht=Ut&&Ut(Pt);Ot===!1?Ht=void 0:isFn(Ot)?Ht=Ot(Pt):reactExports.isValidElement(Ot)?Ht=reactExports.cloneElement(Ot,Pt):isStr(Ot)?Ht=Ot:It&&(Ht=Icons.spinner());function Qt(an){if(an){var Yt={closeToast:gt,type:pt,theme:Wt};if(isFn(an))return an(Yt);if(reactExports.isValidElement(an))return reactExports.cloneElement(an,Yt)}}return reactExports.createElement(yt,{isIn:vt,done:$t,position:bt,preventExitTransition:at,nodeRef:st},reactExports.createElement("div",Object.assign({id:Rt,onClick:dt,className:Ft},lt,{style:xt,ref:st}),reactExports.createElement("div",Object.assign({},vt&&{role:Ct},{className:isFn(kt)?kt({type:pt}):clsx$4("Toastify__toast-body",kt),style:St}),Ht&&reactExports.createElement("div",{className:clsx$4("Toastify__toast-icon",(rt={},rt["Toastify--animate-icon Toastify__zoom-enter"]=!It,rt))},Ht),reactExports.createElement("div",null,ut)),Qt(ct),(ht||Nt)&&reactExports.createElement(ProgressBar,Object.assign({},Et&&!Nt?{key:"pb-"+Et}:{},{rtl:jt,theme:Wt,delay:ht,isRunning:ot,isIn:vt,closeToast:gt,hide:mt,type:pt,style:At,className:Tt,controlledProgress:Nt,progress:Lt}))))},Bounce=cssTransition({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),ToastContainer=function(et){var nt=useToastContainer(et),rt=nt.getToastToRender,it=nt.containerRef,ot=nt.isToastActive,at=et.className,st=et.style,lt=et.rtl,ct=et.containerId;function ut(ht){var dt,pt=clsx$4("Toastify__toast-container","Toastify__toast-container--"+ht,(dt={},dt["Toastify__toast-container--rtl"]=lt,dt));return isFn(at)?at({position:ht,rtl:lt,defaultClassName:pt}):clsx$4(pt,parseClassName(at))}return reactExports.createElement("div",{ref:it,className:"Toastify",id:ct},rt(function(ht,dt){var pt=dt.length?_extends$s({},st):_extends$s({},st,{pointerEvents:"none"});return reactExports.createElement("div",{className:ut(ht),style:pt,key:"container-"+ht},dt.map(function(mt){var gt=mt.content,yt=mt.props;return reactExports.createElement(Toast,Object.assign({},yt,{isIn:ot(yt.toastId),key:"toast-"+yt.key,closeButton:yt.closeButton===!0?CloseButton$4:yt.closeButton}),gt)}))}))};ToastContainer.defaultProps={position:POSITION.TOP_RIGHT,transition:Bounce,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:CloseButton$4,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};var containers=new Map,latestInstance,containerDomNode,containerConfig,queue=[],lazy=!1;function getToast(tt,et){var nt=et.containerId,rt=containers.get(nt||latestInstance);return rt?rt.getToast(tt):null}function generateToastId(){return Math.random().toString(36).substring(2,9)}function getToastId(tt){return tt&&(isStr(tt.toastId)||isNum(tt.toastId))?tt.toastId:generateToastId()}function dispatchToast(tt,et){return containers.size>0?eventManager.emit(0,tt,et):(queue.push({content:tt,options:et}),lazy&&canUseDom&&(lazy=!1,containerDomNode=document.createElement("div"),document.body.appendChild(containerDomNode),reactDomExports.render(reactExports.createElement(ToastContainer,Object.assign({},containerConfig)),containerDomNode))),et.toastId}function mergeOptions(tt,et){return _extends$s({},et,{type:et&&et.type||tt,toastId:getToastId(et)})}function createToastByType(tt){return function(et,nt){return dispatchToast(et,mergeOptions(tt,nt))}}function toast(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,et))}toast.loading=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$s({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},et)))};function handlePromise(tt,et,nt){var rt=et.pending,it=et.error,ot=et.success,at;rt&&(at=isStr(rt)?toast.loading(rt,nt):toast.loading(rt.render,_extends$s({},nt,rt)));var st={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},lt=function(ht,dt,pt){if(dt==null){toast.dismiss(at);return}var mt=_extends$s({type:ht},st,nt,{data:pt}),gt=isStr(dt)?{render:dt}:dt;return at?toast.update(at,_extends$s({},mt,gt)):toast(gt.render,_extends$s({},mt,gt)),pt},ct=isFn(tt)?tt():tt;return ct.then(function(ut){return lt("success",ot,ut)}).catch(function(ut){return lt("error",it,ut)}),ct}toast.promise=handlePromise;toast.success=createToastByType(TYPE.SUCCESS);toast.info=createToastByType(TYPE.INFO);toast.error=createToastByType(TYPE.ERROR);toast.warning=createToastByType(TYPE.WARNING);toast.warn=toast.warning;toast.dark=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$s({theme:"dark"},et)))};toast.dismiss=function(tt){return eventManager.emit(1,tt)};toast.clearWaitingQueue=function(tt){return tt===void 0&&(tt={}),eventManager.emit(5,tt)};toast.isActive=function(tt){var et=!1;return containers.forEach(function(nt){nt.isToastActive&&nt.isToastActive(tt)&&(et=!0)}),et};toast.update=function(tt,et){et===void 0&&(et={}),setTimeout(function(){var nt=getToast(tt,et);if(nt){var rt=nt.props,it=nt.content,ot=_extends$s({},rt,et,{toastId:et.toastId||tt,updateId:generateToastId()});ot.toastId!==tt&&(ot.staleId=tt);var at=ot.render||it;delete ot.render,dispatchToast(at,ot)}},0)};toast.done=function(tt){toast.update(tt,{progress:1})};toast.onChange=function(tt){return isFn(tt)&&eventManager.on(4,tt),function(){isFn(tt)&&eventManager.off(4,tt)}};toast.configure=function(tt){tt===void 0&&(tt={}),lazy=!0,containerConfig=tt};toast.POSITION=POSITION;toast.TYPE=TYPE;eventManager.on(2,function(tt){latestInstance=tt.containerId||tt,containers.set(latestInstance,tt),queue.forEach(function(et){eventManager.emit(0,et.content,et.options)}),queue=[]}).on(3,function(tt){containers.delete(tt.containerId||tt),containers.size===0&&eventManager.off(0).off(1).off(5),canUseDom&&containerDomNode&&document.body.removeChild(containerDomNode)});const topupFromToast=async()=>{try{const tt=await distExports$1.topup();if(!tt)throw new Error("Topup failed");if(tt.budget<5)throw new Error("You set a budget of less than 5 sats");toast(jsxRuntimeExports.jsx(ToastMessage,{message:`You set a budget of ${tt.budget} sats`}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"success"})}catch(tt){tt instanceof Error&&toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt.message}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"error"})}},ToastMessage=({message:tt})=>tt===BOOST_ERROR_BUDGET?jsxRuntimeExports.jsxs("div",{children:[tt,jsxRuntimeExports.jsx(ButtonWrapper,{onClick:topupFromToast,type:"button",children:jsxRuntimeExports.jsx(Text$1,{color:"white",kind:"medium",children:"Topup"})})]}):jsxRuntimeExports.jsx("div",{children:tt}),notify$1=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:tt===NODE_ADD_SUCCESS?jsxRuntimeExports.jsx(MdCheckCircle,{color:colors.primaryGreen}):jsxRuntimeExports.jsx(MdWarning,{color:colors.primaryRed}),position:toast.POSITION.BOTTOM_CENTER,type:tt===NODE_ADD_SUCCESS?"success":"error"})},ButtonWrapper=styled$4.button` background: ${colors.gray200}; border: 1px solid ${colors.white}; border-radius: 2px; @@ -5104,7 +5104,7 @@ function print() { __p += __j.call(arguments, '') } cursor: pointer; background-color: ${colors.gray300}; } -`,CheckIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.08467 5.34482L8.02842 0.401074C8.14508 0.284408 8.28363 0.226074 8.44404 0.226074C8.60446 0.226074 8.743 0.284408 8.85967 0.401074C8.97633 0.517741 9.03467 0.656283 9.03467 0.816699C9.03467 0.977116 8.97633 1.11566 8.85967 1.23232L3.493 6.59899C3.37633 6.71566 3.24022 6.77399 3.08467 6.77399C2.92911 6.77399 2.793 6.71566 2.67633 6.59899L0.168 4.09066C0.0513333 3.97399 -0.00456944 3.83545 0.000291667 3.67503C0.00515278 3.51462 0.0659167 3.37607 0.182583 3.25941C0.29925 3.14274 0.437792 3.08441 0.598208 3.08441C0.758625 3.08441 0.897167 3.14274 1.01383 3.25941L3.08467 5.34482Z",fill:"currentColor"})}),BudgetStep$1=({onClick:tt})=>{const[et]=useUserStore(nt=>[nt.budget]);return jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$5,{children:"Approve Cost"})})}),jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:[jsxRuntimeExports.jsxs(Cost$1,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"COST"}),jsxRuntimeExports.jsx("div",{className:"value",children:"10 sats"})]}),jsxRuntimeExports.jsxs(Budget$2,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"BUDGET"}),jsxRuntimeExports.jsxs("div",{className:"value",children:[formatBudget(et)," sats"]})]})]}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",onClick:tt,size:"large",startIcon:jsxRuntimeExports.jsx(CheckIcon,{}),type:"submit",variant:"contained",children:"Approve"})})]})},Cost$1=styled$4(Flex).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +`,CheckIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.08467 5.34482L8.02842 0.401074C8.14508 0.284408 8.28363 0.226074 8.44404 0.226074C8.60446 0.226074 8.743 0.284408 8.85967 0.401074C8.97633 0.517741 9.03467 0.656283 9.03467 0.816699C9.03467 0.977116 8.97633 1.11566 8.85967 1.23232L3.493 6.59899C3.37633 6.71566 3.24022 6.77399 3.08467 6.77399C2.92911 6.77399 2.793 6.71566 2.67633 6.59899L0.168 4.09066C0.0513333 3.97399 -0.00456944 3.83545 0.000291667 3.67503C0.00515278 3.51462 0.0659167 3.37607 0.182583 3.25941C0.29925 3.14274 0.437792 3.08441 0.598208 3.08441C0.758625 3.08441 0.897167 3.14274 1.01383 3.25941L3.08467 5.34482Z",fill:"currentColor"})}),BudgetStep$1=({onClick:tt})=>{const[et]=useUserStore(nt=>[nt.budget]);return jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$7,{children:"Approve Cost"})})}),jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:[jsxRuntimeExports.jsxs(Cost$1,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"COST"}),jsxRuntimeExports.jsx("div",{className:"value",children:"10 sats"})]}),jsxRuntimeExports.jsxs(Budget$2,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"BUDGET"}),jsxRuntimeExports.jsxs("div",{className:"value",children:[formatBudget(et)," sats"]})]})]}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",onClick:tt,size:"large",startIcon:jsxRuntimeExports.jsx(CheckIcon,{}),type:"submit",variant:"contained",children:"Approve"})})]})},Cost$1=styled$4(Flex).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${colors.GRAY7}; @@ -5140,7 +5140,7 @@ function print() { __p += __j.call(arguments, '') } font-style: normal; font-weight: 400; } -`,StyledText$5=styled$4(Text$1)` +`,StyledText$7=styled$4(Text$1)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -5225,11 +5225,11 @@ function print() { __p += __j.call(arguments, '') } color: ${colors.lightGray}; font-size: 12px; font-weight: 600; -`,validateLatitude=tt=>{const et=Number(tt);return et<-90||et>90?"Latitude must be between -90 and 90.":!et&&et!==0?"Latitude is required.":!0},validateLongitude=tt=>tt<-180||tt>180?"Longitude must be between -180 and 180.":!tt&&tt!==0?"Longitude is required.":!0,latitudeReg=/^(-?\d{1,2}(\.\d+)?|90(\.0+)?)$/,longitudeReg=/^(-?\d{1,3}(\.\d+)?|180(\.0+)?)$/,LocationStep=({latitude:tt,longitude:et,onNextStep:nt,form:rt})=>{const it=()=>{const{errors:at}=rt.formState;Object.keys(at).length||nt()},ot=()=>{rt.setValue("latitude",""),rt.setValue("longitude",""),nt()};return jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$4,{children:"Add Location"})})}),jsxRuntimeExports.jsxs(Flex,{direction:"row",mb:20,children:[jsxRuntimeExports.jsx(Flex,{grow:1,children:jsxRuntimeExports.jsx(TextInput,{id:"add-node-latitude",label:"Latitude",message:"Enter latitude coordinates",name:"latitude",placeholder:"-90 to 90",rules:{pattern:{message:"Incorrect longitude format",value:latitudeReg},validate:{latitude:validateLatitude}}})}),jsxRuntimeExports.jsx(Flex,{grow:1,ml:20,children:jsxRuntimeExports.jsx(TextInput,{id:"add-node-location-longitude",label:"Longitude",message:"Enter longitude coordinates",name:"longitude",placeholder:"-180 to 180",rules:{pattern:{message:"Incorrect longitude format",value:longitudeReg},validate:{longitude:validateLongitude}}})})]}),jsxRuntimeExports.jsxs(Flex,{direction:"row",children:[jsxRuntimeExports.jsx(Flex,{grow:1,children:jsxRuntimeExports.jsx(StyledButton$4,{color:"secondary",disabled:!1,onClick:ot,size:"large",variant:"contained",children:"Skip"})}),jsxRuntimeExports.jsx(Flex,{grow:1,ml:20,children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",disabled:!tt||!et,onClick:it,size:"large",variant:"contained",children:"Next"})})]})]})},StyledText$4=styled$4(Text$1)` +`,validateLatitude=tt=>{const et=Number(tt);return et<-90||et>90?"Latitude must be between -90 and 90.":!et&&et!==0?"Latitude is required.":!0},validateLongitude=tt=>tt<-180||tt>180?"Longitude must be between -180 and 180.":!tt&&tt!==0?"Longitude is required.":!0,latitudeReg=/^(-?\d{1,2}(\.\d+)?|90(\.0+)?)$/,longitudeReg=/^(-?\d{1,3}(\.\d+)?|180(\.0+)?)$/,LocationStep=({latitude:tt,longitude:et,onNextStep:nt,form:rt})=>{const it=()=>{const{errors:at}=rt.formState;Object.keys(at).length||nt()},ot=()=>{rt.setValue("latitude",""),rt.setValue("longitude",""),nt()};return jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$6,{children:"Add Location"})})}),jsxRuntimeExports.jsxs(Flex,{direction:"row",mb:20,children:[jsxRuntimeExports.jsx(Flex,{grow:1,children:jsxRuntimeExports.jsx(TextInput,{id:"add-node-latitude",label:"Latitude",message:"Enter latitude coordinates",name:"latitude",placeholder:"-90 to 90",rules:{pattern:{message:"Incorrect longitude format",value:latitudeReg},validate:{latitude:validateLatitude}}})}),jsxRuntimeExports.jsx(Flex,{grow:1,ml:20,children:jsxRuntimeExports.jsx(TextInput,{id:"add-node-location-longitude",label:"Longitude",message:"Enter longitude coordinates",name:"longitude",placeholder:"-180 to 180",rules:{pattern:{message:"Incorrect longitude format",value:longitudeReg},validate:{longitude:validateLongitude}}})})]}),jsxRuntimeExports.jsxs(Flex,{direction:"row",children:[jsxRuntimeExports.jsx(Flex,{grow:1,children:jsxRuntimeExports.jsx(StyledButton$5,{color:"secondary",disabled:!1,onClick:ot,size:"large",variant:"contained",children:"Skip"})}),jsxRuntimeExports.jsx(Flex,{grow:1,ml:20,children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",disabled:!tt||!et,onClick:it,size:"large",variant:"contained",children:"Next"})})]})]})},StyledText$6=styled$4(Text$1)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,StyledButton$4=styled$4(Button$2)` +`,StyledButton$5=styled$4(Button$2)` && { background: ${colors.white}; color: ${colors.BG2}; @@ -5241,11 +5241,11 @@ function print() { __p += __j.call(arguments, '') } color: ${colors.BG2}; } } -`,twitterOrYoutubeRegexOrMp3=/^(?:(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)[\w-]{11}(?:\S*)?|(?:https?:\/\/)?(?:www\.)?twitter\.com\/i\/spaces\/\d+.*$|.+\.mp3)$/i,SourceStep$1=({type:tt,onNextStep:et,value:nt})=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:18,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$3,{children:"Add Content"})})}),jsxRuntimeExports.jsx(Flex,{mb:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...requiredRule$1,...tt===LINK?{pattern:{message:"You must enter a valid YouTube, Twitter Space or mp3 link.",value:twitterOrYoutubeRegexOrMp3}}:{}}})}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",disabled:!nt,onClick:et,size:"large",variant:"contained",children:"Next"})})]}),StyledText$3=styled$4(Text$1)` +`,twitterOrYoutubeRegexOrMp3=/^(?:(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)[\w-]{11}(?:\S*)?|(?:https?:\/\/)?(?:www\.)?twitter\.com\/i\/spaces\/\d+.*$|.+\.mp3)$/i,SourceStep$1=({type:tt,onNextStep:et,value:nt})=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:18,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$5,{children:"Add Content"})})}),jsxRuntimeExports.jsx(Flex,{mb:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...requiredRule$1,...tt===LINK?{pattern:{message:"You must enter a valid YouTube, Twitter Space or mp3 link.",value:twitterOrYoutubeRegexOrMp3}}:{}}})}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",disabled:!nt,onClick:et,size:"large",variant:"contained",children:"Next"})})]}),StyledText$5=styled$4(Text$1)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,youtubeRegex=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,twitterSpaceRegex=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,tweetUrlRegex=/https:\/\/twitter\.com\/[^/]+\/status\/(\d+)/,mp3Regex=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,genericUrlRegex$1=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/;function getInputType$1(tt){let et=DOCUMENT;return youtubeRegex.test(tt)||twitterSpaceRegex.test(tt)?et=LINK:tweetUrlRegex.test(tt)?et=TWITTER_SOURCE:mp3Regex.test(tt)?et=LINK:genericUrlRegex$1.test(tt)&&(et=WEB_PAGE),et}const handleSubmitForm$1=async(tt,et,nt,rt)=>{const it={};if(nt===LINK)it.media_url=tt.source,it.content_type;else if(nt===TWITTER_SOURCE){if(/(?:https?:\/\/)?(?:www\.)?twitter\.com\/\w+\/status\/\d+/s.test(tt.source)){const st=/\/status\/(\d+)/,lt=tt.source.match(st);if(lt!=null&<[1]){const[,ct]=lt;it.tweet_id=ct}}else it.tweet_id=tt.source;it.content_type="tweet"}else nt===WEB_PAGE?(it.content_type="webpage",it.web_page=tt.source):nt===DOCUMENT&&(it.content_type="document",it.text=tt.source);tt.latitude&&tt.longitude&&(it.latitude=tt.latitude,it.longitude=tt.longitude);let ot="";await executeIfProd(async()=>{const at=await distExports$1.enable();it.pubkey=at==null?void 0:at.pubkey,ot=await getLSat()});try{const at=await api.post("/add_node",JSON.stringify(it),{Authorization:ot});if(at.error){const{message:st}=at.error;throw new Error(st)}notify$1(NODE_ADD_SUCCESS),et()}catch(at){if(at.status===402){const st=distExports.Lsat.fromHeader(at.headers.get("www-authenticate"));await payLsat(st),await updateBudget(rt),await handleSubmitForm$1(tt,et,nt,rt)}at instanceof Error&&(notify$1(NODE_ADD_ERROR),et())}},AddContentModal=()=>{const[tt,et]=reactExports.useState(0),{close:nt,visible:rt}=useModal("addContent"),[it]=useUserStore(bt=>[bt.setBudget]),ot=useForm({mode:"onChange"}),{watch:at,setValue:st,reset:lt}=ot;reactExports.useEffect(()=>()=>{et(0),lt()},[rt,lt]);const ct=at("inputType"),ut=at("source"),ht=at("longitude"),dt=at("latitude"),pt=at("source");reactExports.useEffect(()=>{st("inputType",getInputType$1(pt))},[pt,st]);const mt=()=>{nt()},gt=()=>{et(tt+1)},yt=ot.handleSubmit(async bt=>{await handleSubmitForm$1(bt,mt,ct,it)});return jsxRuntimeExports.jsx(BaseModal,{id:"addContent",kind:"small",onClose:nt,preventOutsideClose:!0,children:jsxRuntimeExports.jsx(FormProvider,{...ot,children:jsxRuntimeExports.jsxs("form",{id:"add-node-form",onSubmit:yt,children:[tt===0&&jsxRuntimeExports.jsx(SourceStep$1,{onNextStep:gt,type:ct,value:ut}),tt===1&&jsxRuntimeExports.jsx(LocationStep,{form:ot,latitude:dt,longitude:ht,onNextStep:gt}),tt===2&&jsxRuntimeExports.jsx(BudgetStep$1,{onClick:()=>null})]})})})},BudgetStep=({onClick:tt})=>{const[et]=useUserStore(nt=>[nt.budget]);return jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$2,{children:"Approve Cost"})})}),jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:[jsxRuntimeExports.jsxs(Cost,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"COST"}),jsxRuntimeExports.jsx("div",{className:"value",children:"10 sats"})]}),jsxRuntimeExports.jsxs(Budget$1,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"BUDGET"}),jsxRuntimeExports.jsxs("div",{className:"value",children:[formatBudget(et)," sats"]})]})]}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",onClick:tt,size:"large",startIcon:jsxRuntimeExports.jsx(CheckIcon,{}),type:"submit",variant:"contained",children:"Approve"})})]})},Cost=styled$4(Flex).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +`,youtubeRegex=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,twitterSpaceRegex=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,tweetUrlRegex=/https:\/\/twitter\.com\/[^/]+\/status\/(\d+)/,mp3Regex=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,genericUrlRegex$1=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/;function getInputType$1(tt){let et=DOCUMENT;return youtubeRegex.test(tt)||twitterSpaceRegex.test(tt)?et=LINK:tweetUrlRegex.test(tt)?et=TWITTER_SOURCE:mp3Regex.test(tt)?et=LINK:genericUrlRegex$1.test(tt)&&(et=WEB_PAGE),et}const handleSubmitForm$1=async(tt,et,nt,rt)=>{const it={};if(nt===LINK)it.media_url=tt.source,it.content_type;else if(nt===TWITTER_SOURCE){if(/(?:https?:\/\/)?(?:www\.)?twitter\.com\/\w+\/status\/\d+/s.test(tt.source)){const st=/\/status\/(\d+)/,lt=tt.source.match(st);if(lt!=null&<[1]){const[,ct]=lt;it.tweet_id=ct}}else it.tweet_id=tt.source;it.content_type="tweet"}else nt===WEB_PAGE?(it.content_type="webpage",it.web_page=tt.source):nt===DOCUMENT&&(it.content_type="document",it.text=tt.source);tt.latitude&&tt.longitude&&(it.latitude=tt.latitude,it.longitude=tt.longitude);let ot="";await executeIfProd(async()=>{const at=await distExports$1.enable();it.pubkey=at==null?void 0:at.pubkey,ot=await getLSat()});try{const at=await api.post("/add_node",JSON.stringify(it),{Authorization:ot});if(at.error){const{message:st}=at.error;throw new Error(st)}notify$1(NODE_ADD_SUCCESS),et()}catch(at){if(at.status===402){const st=distExports.Lsat.fromHeader(at.headers.get("www-authenticate"));await payLsat(st),await updateBudget(rt),await handleSubmitForm$1(tt,et,nt,rt)}at instanceof Error&&(notify$1(NODE_ADD_ERROR),et())}},AddContentModal=()=>{const[tt,et]=reactExports.useState(0),{close:nt,visible:rt}=useModal("addContent"),[it]=useUserStore(bt=>[bt.setBudget]),ot=useForm({mode:"onChange"}),{watch:at,setValue:st,reset:lt}=ot;reactExports.useEffect(()=>()=>{et(0),lt()},[rt,lt]);const ct=at("inputType"),ut=at("source"),ht=at("longitude"),dt=at("latitude"),pt=at("source");reactExports.useEffect(()=>{st("inputType",getInputType$1(pt))},[pt,st]);const mt=()=>{nt()},gt=()=>{et(tt+1)},yt=ot.handleSubmit(async bt=>{await handleSubmitForm$1(bt,mt,ct,it)});return jsxRuntimeExports.jsx(BaseModal,{id:"addContent",kind:"small",onClose:nt,preventOutsideClose:!0,children:jsxRuntimeExports.jsx(FormProvider,{...ot,children:jsxRuntimeExports.jsxs("form",{id:"add-node-form",onSubmit:yt,children:[tt===0&&jsxRuntimeExports.jsx(SourceStep$1,{onNextStep:gt,type:ct,value:ut}),tt===1&&jsxRuntimeExports.jsx(LocationStep,{form:ot,latitude:dt,longitude:ht,onNextStep:gt}),tt===2&&jsxRuntimeExports.jsx(BudgetStep$1,{onClick:()=>null})]})})})},BudgetStep=({onClick:tt})=>{const[et]=useUserStore(nt=>[nt.budget]);return jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$4,{children:"Approve Cost"})})}),jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"space-between",mb:20,children:[jsxRuntimeExports.jsxs(Cost,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"COST"}),jsxRuntimeExports.jsx("div",{className:"value",children:"10 sats"})]}),jsxRuntimeExports.jsxs(Budget$1,{children:[jsxRuntimeExports.jsx("div",{className:"title",children:"BUDGET"}),jsxRuntimeExports.jsxs("div",{className:"value",children:[formatBudget(et)," sats"]})]})]}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",onClick:tt,size:"large",startIcon:jsxRuntimeExports.jsx(CheckIcon,{}),type:"submit",variant:"contained",children:"Approve"})})]})},Cost=styled$4(Flex).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${colors.GRAY7}; @@ -5281,15 +5281,15 @@ function print() { __p += __j.call(arguments, '') } font-style: normal; font-weight: 400; } -`,StyledText$2=styled$4(Text$1)` +`,StyledText$4=styled$4(Text$1)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,SourceStep=({onNextStep:tt,value:et})=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:18,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$1,{children:"Add Source"})})}),jsxRuntimeExports.jsx(Flex,{mb:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here..."})}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",disabled:!et,onClick:tt,size:"large",variant:"contained",children:"Next"})})]}),StyledText$1=styled$4(Text$1)` +`,SourceStep=({onNextStep:tt,value:et})=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:18,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$3,{children:"Add Source"})})}),jsxRuntimeExports.jsx(Flex,{mb:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here..."})}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Button$2,{color:"secondary",disabled:!et,onClick:tt,size:"large",variant:"contained",children:"Next"})})]}),StyledText$3=styled$4(Text$1)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,twitterHandlePattern=/@(\w+)/g,youtubeChannelPattern=/https?:\/\/(www\.)?youtube\.com\/(@)?([\w-]+)/i,githubRepoPattern=/https?:\/\/github\.com\/([\w-]+)\/([\w-]+)/i,genericUrlRegex=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/;function getInputType(tt){let et=DOCUMENT;return youtubeChannelPattern.test(tt)?et=YOUTUBE_CHANNEL:twitterHandlePattern.test(tt)?et=TWITTER_HANDLE:githubRepoPattern.test(tt)?et=GITHUB_REPOSITORY:genericUrlRegex.test(tt)?et=RSS:et=TOPIC,et}const handleSubmitForm=async(tt,et,nt,rt)=>{const it={};it.source_type=nt,nt===TWITTER_HANDLE?it.source=(tt.source||"").replace(/[@]/g,""):it.source=tt.source;let ot="";await executeIfProd(async()=>{const at=await distExports$1.enable();it.pubkey=at==null?void 0:at.pubkey,ot=await getLSat()});try{const at=await api.post("/radar",JSON.stringify(it),{Authorization:ot});if(at.error){const{message:st}=at.error;throw new Error(st)}notify$1(NODE_ADD_SUCCESS),et()}catch(at){if(at.status===402){const st=distExports.Lsat.fromHeader(at.headers.get("www-authenticate"));await payLsat(st),await updateBudget(rt),await handleSubmitForm(tt,et,nt,rt)}at instanceof Error&&(notify$1(NODE_ADD_ERROR),et())}},AddSourceModal=()=>{const[tt,et]=reactExports.useState(0),{close:nt,visible:rt}=useModal("addSource"),[it]=useUserStore(gt=>[gt.setBudget]),ot=useForm({mode:"onChange"}),{watch:at,setValue:st,reset:lt}=ot;reactExports.useEffect(()=>()=>{et(0),lt()},[rt,lt]);const ct=at("inputType"),ut=at("source"),ht=at("source");reactExports.useEffect(()=>{st("inputType",getInputType(ht))},[ht,st]);const dt=()=>{nt()},pt=()=>{et(tt+1)},mt=ot.handleSubmit(async gt=>{await handleSubmitForm(gt,dt,ct,it)});return jsxRuntimeExports.jsx(BaseModal,{id:"addSource",kind:"small",onClose:nt,preventOutsideClose:!0,children:jsxRuntimeExports.jsx(FormProvider,{...ot,children:jsxRuntimeExports.jsxs("form",{id:"add-node-form",onSubmit:mt,children:[tt===0&&jsxRuntimeExports.jsx(SourceStep,{onNextStep:pt,value:ut}),tt===1&&jsxRuntimeExports.jsx(BudgetStep,{onClick:()=>null})]})})})},defaultParams={skip:"0",limit:"500"},getRadarData=async(tt=defaultParams)=>await api.get(`/radar?${new URLSearchParams({...defaultParams,...tt}).toString()}`),getTopicsData=async(tt=defaultParams)=>await api.get(`/topics?${new URLSearchParams({...defaultParams,...tt}).toString()}`),getAboutData=async()=>await api.get("/about"),postAboutData=async tt=>await api.post("/about",JSON.stringify(tt)),triggerRadarJob=async()=>api.get("/radar/trigger-job"),putRadarData=async(tt,et)=>await api.put(`/radar/${tt}`,JSON.stringify(et)),putNodeData=async tt=>await api.put("/node",JSON.stringify(tt)),approveRadarData=async(tt,et)=>await api.put(`/radar/${tt}/approve`,JSON.stringify({approve:"True",pubkey:et})),deleteRadarData=async tt=>await api.delete(`/radar/${tt}`),StyledTableCell=styled$4(TableCell$1)` +`,twitterHandlePattern=/@(\w+)/g,youtubeChannelPattern=/https?:\/\/(www\.)?youtube\.com\/(@)?([\w-]+)/i,githubRepoPattern=/https?:\/\/github\.com\/([\w-]+)\/([\w-]+)/i,genericUrlRegex=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/;function getInputType(tt){let et=DOCUMENT;return youtubeChannelPattern.test(tt)?et=YOUTUBE_CHANNEL:twitterHandlePattern.test(tt)?et=TWITTER_HANDLE:githubRepoPattern.test(tt)?et=GITHUB_REPOSITORY:genericUrlRegex.test(tt)?et=RSS:et=TOPIC,et}const handleSubmitForm=async(tt,et,nt,rt)=>{const it={};it.source_type=nt,nt===TWITTER_HANDLE?it.source=(tt.source||"").replace(/[@]/g,""):it.source=tt.source;let ot="";await executeIfProd(async()=>{const at=await distExports$1.enable();it.pubkey=at==null?void 0:at.pubkey,ot=await getLSat()});try{const at=await api.post("/radar",JSON.stringify(it),{Authorization:ot});if(at.error){const{message:st}=at.error;throw new Error(st)}notify$1(NODE_ADD_SUCCESS),et()}catch(at){if(at.status===402){const st=distExports.Lsat.fromHeader(at.headers.get("www-authenticate"));await payLsat(st),await updateBudget(rt),await handleSubmitForm(tt,et,nt,rt)}at instanceof Error&&(notify$1(NODE_ADD_ERROR),et())}},AddSourceModal=()=>{const[tt,et]=reactExports.useState(0),{close:nt,visible:rt}=useModal("addSource"),[it]=useUserStore(gt=>[gt.setBudget]),ot=useForm({mode:"onChange"}),{watch:at,setValue:st,reset:lt}=ot;reactExports.useEffect(()=>()=>{et(0),lt()},[rt,lt]);const ct=at("inputType"),ut=at("source"),ht=at("source");reactExports.useEffect(()=>{st("inputType",getInputType(ht))},[ht,st]);const dt=()=>{nt()},pt=()=>{et(tt+1)},mt=ot.handleSubmit(async gt=>{await handleSubmitForm(gt,dt,ct,it)});return jsxRuntimeExports.jsx(BaseModal,{id:"addSource",kind:"small",onClose:nt,preventOutsideClose:!0,children:jsxRuntimeExports.jsx(FormProvider,{...ot,children:jsxRuntimeExports.jsxs("form",{id:"add-node-form",onSubmit:mt,children:[tt===0&&jsxRuntimeExports.jsx(SourceStep,{onNextStep:pt,value:ut}),tt===1&&jsxRuntimeExports.jsx(BudgetStep,{onClick:()=>null})]})})})},defaultParams={skip:"0",limit:"500"},getRadarData=async(tt=defaultParams)=>await api.get(`/radar?${new URLSearchParams({...defaultParams,...tt}).toString()}`),getTopicsData=async(tt=defaultParams)=>await api.get(`/topics?${new URLSearchParams({...defaultParams,...tt}).toString()}`),getAboutData=async()=>await api.get("/about"),postAboutData=async tt=>await api.post("/about",JSON.stringify(tt)),postMergeTopics=async tt=>await api.post("/curation/merge",JSON.stringify(tt)),triggerRadarJob=async()=>api.get("/radar/trigger-job"),putRadarData=async(tt,et)=>await api.put(`/radar/${tt}`,JSON.stringify(et)),putNodeData=async tt=>await api.put("/node",JSON.stringify(tt)),approveRadarData=async(tt,et)=>await api.put(`/radar/${tt}/approve`,JSON.stringify({approve:"True",pubkey:et})),deleteRadarData=async tt=>await api.delete(`/radar/${tt}`),StyledTableCell=styled$4(TableCell$1)` && { color: ${colors.white}; border: none; @@ -5348,7 +5348,7 @@ function print() { __p += __j.call(arguments, '') } ${Text$1} { margin-bottom: 0; } -`,sourcesMapper={[GITHUB_REPOSITORY]:"Github repository",[RSS]:"RSS link",[TOPIC]:"Topic",[TWITTER_HANDLE]:"Twitter Handle",[YOUTUBE_CHANNEL]:"Youtube channel"},DATE="date",EDGE_COUNT="edge_count",ALPHABETICALLY="alphabetically",SORT_MAPPING={[DATE]:"Date",[EDGE_COUNT]:"Edge Count",[ALPHABETICALLY]:"Alphabetically"},TWITTER_LINK="https://twitter.com",getButtonKindDimensions=({kind:tt,shape:et})=>{switch(tt){case"small":return Ae` +`,sourcesMapper={[GITHUB_REPOSITORY]:"Github repository",[RSS]:"RSS link",[TOPIC]:"Topic",[TWITTER_HANDLE]:"Twitter Handle",[YOUTUBE_CHANNEL]:"Youtube channel"},DATE="date",EDGE_COUNT="edge_count",ALPHABETICALLY="alphabetically",SORT_MAPPING={[DATE]:"Date",[EDGE_COUNT]:"Edge Count",[ALPHABETICALLY]:"Alphabetically"},TWITTER_LINK="https://twitter.com",IS_ALIAS="IS_ALIAS",getButtonKindDimensions=({kind:tt,shape:et})=>{switch(tt){case"small":return Ae` padding: 4px 8px; border-radius: ${et==="rounded"?"16px":"8px"}; height: 32px; @@ -5375,7 +5375,7 @@ function print() { __p += __j.call(arguments, '') } opacity: 0.5; pointer-events: none; `} -`,Button=({background:tt="primaryButton",children:et,className:nt="button",startIcon:rt,endIcon:it,disabled:ot,id:at,kind:st="regular",onClick:lt,onPointerDown:ct,shape:ut="squared",textColor:ht="white",type:dt})=>jsxRuntimeExports.jsxs(Wrapper$n,{as:"button",background:tt,className:nt,disabled:ot,id:at,kind:st,onClick:lt,onPointerDown:ct,shape:ut,type:dt,children:[rt&&rt,jsxRuntimeExports.jsx(Text$1,{color:ht,kind:getTextKind({kind:st}),children:et}),it&&it]}),ConfirmPopover=({message:tt="Are you sure you want to delete this item?",onConfirm:et,children:nt,anchorOrigin:rt={vertical:"bottom",horizontal:"center"},transformOrigin:it={vertical:"top",horizontal:"center"}})=>{const[ot,at]=reactExports.useState(null),st=dt=>{at(dt.currentTarget)},lt=()=>{at(null)},ct=()=>{et(),lt()},ut=()=>{lt()},ht=!!ot;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:React$1.cloneElement(nt,{onClick:st})}),jsxRuntimeExports.jsx(StyledPopover$2,{anchorEl:ot,anchorOrigin:rt,onClose:lt,open:ht,transformOrigin:it,children:jsxRuntimeExports.jsxs(Wrapper$m,{justify:"space-around",children:[jsxRuntimeExports.jsx(Text$1,{children:tt}),jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",pt:8,children:[jsxRuntimeExports.jsx(Button,{kind:"small",onClick:ct,children:"Yes"}),jsxRuntimeExports.jsx(Button,{className:"secondary",kind:"small",onClick:ut,children:"No"})]})]})})]})},Wrapper$m=styled$4(Flex)` +`,Button=({background:tt="primaryButton",children:et,className:nt="button",startIcon:rt,endIcon:it,disabled:ot,id:at,kind:st="regular",onClick:lt,onPointerDown:ct,shape:ut="squared",textColor:ht="white",type:dt})=>jsxRuntimeExports.jsxs(Wrapper$n,{as:"button",background:tt,className:nt,disabled:ot,id:at,kind:st,onClick:lt,onPointerDown:ct,shape:ut,type:dt,children:[rt&&rt,jsxRuntimeExports.jsx(Text$1,{color:ht,kind:getTextKind({kind:st}),children:et}),it&&it]}),ConfirmPopover=({message:tt="Are you sure you want to delete this item?",onConfirm:et,children:nt,anchorOrigin:rt={vertical:"bottom",horizontal:"center"},transformOrigin:it={vertical:"top",horizontal:"center"}})=>{const[ot,at]=reactExports.useState(null),st=dt=>{at(dt.currentTarget)},lt=()=>{at(null)},ct=()=>{et(),lt()},ut=()=>{lt()},ht=!!ot;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:React$1.cloneElement(nt,{onClick:st})}),jsxRuntimeExports.jsx(StyledPopover$3,{anchorEl:ot,anchorOrigin:rt,onClose:lt,open:ht,transformOrigin:it,children:jsxRuntimeExports.jsxs(Wrapper$m,{justify:"space-around",children:[jsxRuntimeExports.jsx(Text$1,{children:tt}),jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",pt:8,children:[jsxRuntimeExports.jsx(Button,{kind:"small",onClick:ct,children:"Yes"}),jsxRuntimeExports.jsx(Button,{className:"secondary",kind:"small",onClick:ut,children:"No"})]})]})})]})},Wrapper$m=styled$4(Flex)` background: ${colors.headerBackground}; color: ${colors.white}; padding: 16px 8px; @@ -5386,7 +5386,7 @@ function print() { __p += __j.call(arguments, '') } background: transparent; border: 1px solid ${colors.primaryButton}; } -`,StyledPopover$2=styled$4(Popover$1)` +`,StyledPopover$3=styled$4(Popover$1)` && { z-index: 9999; } @@ -5515,11 +5515,78 @@ function print() { __p += __j.call(arguments, '') } margin-left: 8px; `,EditButton$1=styled$4(Button$2)` margin-left: auto; -`,defaultData$3={data:null,ids:[],total:0,filters:{muted:!1,sortBy:DATE,page:0,pageSize:50}},useTopicsStore=react((tt,et)=>({...defaultData$3,setTopics:async()=>{const{data:nt,ids:rt,filters:it}=et(),ot=prepareTopicFilters(it),at=await getTopicsData(ot),st=it.page>0?nt||{}:{},lt=it.page>0?rt:[];at.data.forEach(ct=>{st[ct.ref_id]=ct,lt.push(ct.ref_id)}),tt({data:st,ids:lt,total:at.topicCount})},setFilters:nt=>tt({filters:{...et().filters,page:0,...nt}}),terminate:()=>tt(defaultData$3)})),prepareTopicFilters=tt=>({muted:tt.muted?"True":"False",skip:String(tt.page*tt.pageSize),limit:String(tt.pageSize),sort_by:tt.sortBy,...tt.search?{search:tt.search||""}:{}}),TitleEditor=()=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:18,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText,{children:"Edit topic"})})}),jsxRuntimeExports.jsx(Flex,{mb:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-topic",maxLength:50,name:"topic",placeholder:"Add your topic",rules:{...requiredRule$1}})})]}),StyledText=styled$4(Text$1)` +`,defaultData$3={data:null,ids:[],total:0,filters:{muted:!1,sortBy:DATE,page:0,pageSize:50}},useTopicsStore=react((tt,et)=>({...defaultData$3,setTopics:async()=>{const{data:nt,ids:rt,filters:it}=et(),ot=prepareTopicFilters(it);it.page<1&&tt({data:null,ids:[],total:0});const at=await getTopicsData(ot),st=it.page>0?nt||{}:{},lt=it.page>0?rt:[];at.data.forEach(ct=>{st[ct.ref_id]=ct,lt.push(ct.ref_id)}),tt({data:st,ids:lt,total:at.topicCount})},setFilters:nt=>tt({filters:{...et().filters,page:0,...nt}}),terminate:()=>tt(defaultData$3)})),prepareTopicFilters=tt=>({muted:tt.muted?"True":"False",skip:String(tt.page*tt.pageSize),limit:String(tt.pageSize),sort_by:tt.sortBy,search:tt.search||""}),TitleEditor$1=()=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:18,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$2,{children:"Edit topic"})})}),jsxRuntimeExports.jsx(Flex,{mb:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-topic",maxLength:50,name:"topic",placeholder:"Add your topic",rules:{...requiredRule$1}})})]}),StyledText$2=styled$4(Text$1)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,EditTopicModal=({topic:tt,onClose:et})=>{const{close:nt}=useModal("editTopic"),[rt]=useTopicsStore(pt=>[pt.data]),it=useForm({mode:"onChange"}),{watch:ot,setValue:at,reset:st}=it,[lt,ct]=reactExports.useState(!1);reactExports.useEffect(()=>(tt&&at("topic",tt==null?void 0:tt.topic),()=>{st()}),[tt,at,st]);const ut=ot("topic"),ht=()=>{et(),nt()},dt=async()=>{ct(!0);try{if(await putNodeData({ref_id:(tt==null?void 0:tt.ref_id)||"",node_name:"topic",node_value:ut.trim()}),rt){const pt={...rt};pt[tt==null?void 0:tt.ref_id].topic=ut.trim(),useTopicsStore.setState({data:pt})}ht()}catch(pt){console.warn(pt)}finally{ct(!1)}};return jsxRuntimeExports.jsx(BaseModal,{id:"editTopic",kind:"regular",onClose:ht,preventOutsideClose:!0,children:jsxRuntimeExports.jsxs(FormProvider,{...it,children:[jsxRuntimeExports.jsx(TitleEditor,{}),jsxRuntimeExports.jsxs(Button$2,{color:"secondary",disabled:lt,onClick:dt,size:"large",variant:"contained",children:["Save",lt&&jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.BLUE_PRESS_STATE,size:10})]})]})})},SearchIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Property 1=Normal",children:jsxRuntimeExports.jsx("path",{id:"search",d:"M15.5192 20.6153C13.8115 20.6153 12.3654 20.023 11.1808 18.8384C9.99618 17.6538 9.40387 16.2077 9.40387 14.5C9.40387 12.7923 9.99618 11.3462 11.1808 10.1615C12.3654 8.97694 13.8115 8.38464 15.5192 8.38464C17.2269 8.38464 18.6731 8.97694 19.8577 10.1615C21.0423 11.3462 21.6346 12.7923 21.6346 14.5C21.6346 15.2141 21.5147 15.8961 21.275 16.5461C21.0352 17.1961 20.7153 17.7615 20.3153 18.2423L23.0692 20.9961C23.2077 21.1346 23.2785 21.3087 23.2817 21.5183C23.2849 21.7279 23.2141 21.9051 23.0692 22.05C22.9243 22.1948 22.7487 22.2673 22.5423 22.2673C22.3359 22.2673 22.1603 22.1948 22.0154 22.05L19.2615 19.2961C18.7615 19.7089 18.1865 20.032 17.5365 20.2653C16.8865 20.4987 16.2141 20.6153 15.5192 20.6153ZM15.5192 19.1154C16.8077 19.1154 17.899 18.6683 18.7933 17.774C19.6875 16.8798 20.1346 15.7885 20.1346 14.5C20.1346 13.2115 19.6875 12.1202 18.7933 11.2259C17.899 10.3317 16.8077 9.88459 15.5192 9.88459C14.2308 9.88459 13.1394 10.3317 12.2452 11.2259C11.351 12.1202 10.9038 13.2115 10.9038 14.5C10.9038 15.7885 11.351 16.8798 12.2452 17.774C13.1394 18.6683 14.2308 19.1154 15.5192 19.1154Z",fill:"currentColor"})})}),Search$1=()=>{const[tt,et]=useTopicsStore(at=>[at.filters,at.setFilters]),[nt,rt]=reactExports.useState(""),it=at=>{at.preventDefault(),et({search:nt})},ot=()=>{rt(""),tt.search&&et({search:""})};return jsxRuntimeExports.jsxs(Paper$1,{component:"form",onSubmit:it,sx:{p:"2px 4px",display:"flex",alignItems:"center",width:300},children:[jsxRuntimeExports.jsx(InputBase$1,{autoComplete:"off",autoCorrect:"off",inputProps:{"aria-label":"search topic"},onChange:at=>rt(at.target.value),placeholder:"Search",size:"small",spellCheck:"false",sx:{ml:1,flex:1},value:nt}),nt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledButton$3,{"aria-label":"search",onClick:ot,type:"button",children:jsxRuntimeExports.jsx(ClearIcon$1,{})}),jsxRuntimeExports.jsx(Divider$3,{orientation:"vertical",sx:{height:28,m:.5}})]}),jsxRuntimeExports.jsx(StyledButton$3,{"aria-label":"search",onClick:it,type:"button",children:jsxRuntimeExports.jsx(SearchIcon,{})})]})},StyledButton$3=styled$4(IconButton$1)` +`,EditTopicModal=({topic:tt,onClose:et})=>{const{close:nt}=useModal("editTopic"),[rt]=useTopicsStore(pt=>[pt.data]),it=useForm({mode:"onChange"}),{watch:ot,setValue:at,reset:st}=it,[lt,ct]=reactExports.useState(!1);reactExports.useEffect(()=>(tt&&at("topic",tt==null?void 0:tt.topic),()=>{st()}),[tt,at,st]);const ut=ot("topic"),ht=()=>{et(),nt()},dt=async()=>{ct(!0);try{if(await putNodeData({ref_id:(tt==null?void 0:tt.ref_id)||"",node_name:"topic",node_value:ut.trim()}),rt){const pt={...rt};pt[tt==null?void 0:tt.ref_id].topic=ut.trim(),useTopicsStore.setState({data:pt})}ht()}catch(pt){console.warn(pt)}finally{ct(!1)}};return jsxRuntimeExports.jsx(BaseModal,{id:"editTopic",kind:"regular",onClose:ht,preventOutsideClose:!0,children:jsxRuntimeExports.jsxs(FormProvider,{...it,children:[jsxRuntimeExports.jsx(TitleEditor$1,{}),jsxRuntimeExports.jsxs(Button$2,{color:"secondary",disabled:lt,onClick:dt,size:"large",variant:"contained",children:["Save",lt&&jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.BLUE_PRESS_STATE,size:10})]})]})})},SearchIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Property 1=Normal",children:jsxRuntimeExports.jsx("path",{id:"search",d:"M15.5192 20.6153C13.8115 20.6153 12.3654 20.023 11.1808 18.8384C9.99618 17.6538 9.40387 16.2077 9.40387 14.5C9.40387 12.7923 9.99618 11.3462 11.1808 10.1615C12.3654 8.97694 13.8115 8.38464 15.5192 8.38464C17.2269 8.38464 18.6731 8.97694 19.8577 10.1615C21.0423 11.3462 21.6346 12.7923 21.6346 14.5C21.6346 15.2141 21.5147 15.8961 21.275 16.5461C21.0352 17.1961 20.7153 17.7615 20.3153 18.2423L23.0692 20.9961C23.2077 21.1346 23.2785 21.3087 23.2817 21.5183C23.2849 21.7279 23.2141 21.9051 23.0692 22.05C22.9243 22.1948 22.7487 22.2673 22.5423 22.2673C22.3359 22.2673 22.1603 22.1948 22.0154 22.05L19.2615 19.2961C18.7615 19.7089 18.1865 20.032 17.5365 20.2653C16.8865 20.4987 16.2141 20.6153 15.5192 20.6153ZM15.5192 19.1154C16.8077 19.1154 17.899 18.6683 18.7933 17.774C19.6875 16.8798 20.1346 15.7885 20.1346 14.5C20.1346 13.2115 19.6875 12.1202 18.7933 11.2259C17.899 10.3317 16.8077 9.88459 15.5192 9.88459C14.2308 9.88459 13.1394 10.3317 12.2452 11.2259C11.351 12.1202 10.9038 13.2115 10.9038 14.5C10.9038 15.7885 11.351 16.8798 12.2452 17.774C13.1394 18.6683 14.2308 19.1154 15.5192 19.1154Z",fill:"currentColor"})})}),DropdownSearch=({onSelect:tt,selectedTopic:et})=>{const[nt,rt]=reactExports.useState(!1),[it,ot]=reactExports.useState(""),[at,st]=reactExports.useState([]),[lt,ct]=reactExports.useState(!1),ut=reactExports.useRef(null);reactExports.useEffect(()=>()=>st([]),[st]);const ht=async gt=>{const yt={muted:"False",sort_by:ALPHABETICALLY,search:gt,skip:"0",limit:"1000"};ct(!0);try{const bt=await getTopicsData(yt);st(bt.data)}catch{st([])}finally{ct(!1)}},dt=reactExports.useMemo(()=>lodashExports.debounce(ht,300),[]),pt=gt=>{tt(gt)},mt=gt=>{if(ot(gt),!gt){st([]);return}gt.length>2&&dt(gt)};return et?jsxRuntimeExports.jsxs(SelectedValue,{children:[jsxRuntimeExports.jsx("div",{className:"value",children:et.topic}),jsxRuntimeExports.jsx(Flex,{className:"icon",onClick:()=>tt(null),children:jsxRuntimeExports.jsx(ClearIcon$1,{})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Paper$1,{ref:ut,component:"form",onSubmit:gt=>gt.preventDefault(),sx:{p:"2px 4px",display:"flex",alignItems:"center",width:200},children:[jsxRuntimeExports.jsx(InputBase$1,{inputProps:{"aria-label":"search topic"},onChange:gt=>mt(gt.target.value),onFocus:()=>rt(!0),placeholder:"Search",size:"small",sx:{ml:1,flex:1},value:it}),it&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledButton$4,{"aria-label":"search",onClick:()=>mt(""),type:"button",children:jsxRuntimeExports.jsx(ClearIcon$1,{})}),jsxRuntimeExports.jsx(Divider$3,{orientation:"vertical",sx:{height:28,m:.5}})]}),jsxRuntimeExports.jsx(StyledButton$4,{"aria-label":"search",type:"button",children:lt?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white,size:24}):jsxRuntimeExports.jsx(SearchIcon,{})})]}),ut.current&&at.length?jsxRuntimeExports.jsx(StyledPopover$2,{anchorEl:ut.current,open:nt,placement:"bottom",children:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:at.map(gt=>jsxRuntimeExports.jsx(MenuItem$2,{className:clsx$4({active:et===gt.ref_id}),onClick:()=>pt(gt),children:gt.topic},"option"))})}):null]})},MenuItem$2=styled$4(Flex).attrs({direction:"row",align:"center"})` + font-family: Barlow; + font-size: 13px; + font-style: normal; + font-weight: 500; + overflow: hidden; + width: 200px; + color: ${colors.GRAY3}; + margin-bottom: 4px; + cursor: pointer; + &.active { + color: ${colors.white}; + } + &:hover { + color: ${colors.white}; + } + + .icon { + margin-right: 8px; + width: 9px; + font-size: 10px; + } +`,StyledPopover$2=styled$4(MuiPopper)` + && { + z-index: 99999; + background: ${colors.BUTTON1}; + min-width: 200px; + padding: 16px; + color: ${colors.GRAY3}; + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); + border-radius: 6px; + max-height: 200px; + overflow: auto; + } +`,SelectedValue=styled$4(Flex).attrs({direction:"row",justify:"flex-start",align:"center"})` + .value { + overflow: hidden; + text-overflow: ellipsis; + } + .icon { + margin-left: 8px; + width: 20px; + height: 20px; + color: ${colors.white}; + background: ${colors.primaryBlue}; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + } +`,StyledButton$4=styled$4(IconButton$1)` + font-size: 24px; +`,TitleEditor=({from:tt,onSelect:et,selectedTopic:nt})=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"space-between",mb:18,children:jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",children:jsxRuntimeExports.jsx(StyledText$1,{children:"Merge topic"})})}),jsxRuntimeExports.jsxs(Content$1,{mb:12,children:[jsxRuntimeExports.jsxs(SectionWrapper,{children:[jsxRuntimeExports.jsx("div",{className:"label",children:"From"}),jsxRuntimeExports.jsx("div",{children:tt})]}),jsxRuntimeExports.jsxs(SectionWrapper,{ml:24,children:[jsxRuntimeExports.jsx("div",{className:"label",children:"To"}),jsxRuntimeExports.jsx(DropdownSearch,{onSelect:et,selectedTopic:nt})]})]})]}),StyledText$1=styled$4(Text$1)` + font-size: 22px; + font-weight: 600; + font-family: 'Barlow'; +`,Content$1=styled$4(Flex).attrs({align:"flex-start",direction:"row",justify:"flex-start"})` + color: ${colors.white}; + .label { + margin-bottom: 8px; + font-weight: 500; + font-size: 14px; + color: ${colors.GRAY3}; + } +`,SectionWrapper=styled$4(Flex)` + flex: 1 1 100%; +`,MergeTopicModal=({topic:tt,onClose:et})=>{const{close:nt}=useModal("mergeTopic"),[rt,it,ot]=useTopicsStore(bt=>[bt.data,bt.ids,bt.total]),at=useForm({mode:"onChange"}),{watch:st,setValue:lt,reset:ct}=at,[ut,ht]=reactExports.useState(!1),[dt,pt]=reactExports.useState(null);reactExports.useEffect(()=>(tt&<("topic",tt==null?void 0:tt.topic),()=>{ct()}),[tt,lt,ct]);const mt=st("topic"),gt=()=>{et(),nt()},yt=async()=>{if(!(!dt||!rt)){ht(!0);try{await postMergeTopics({from:tt.ref_id,to:dt==null?void 0:dt.ref_id});const{ref_id:bt}=tt;if(rt[bt]={...rt[bt],edgeList:[IS_ALIAS],edgeCount:rt[bt].edgeCount-1},useTopicsStore.setState({ids:it.filter(wt=>wt!==dt.ref_id),total:ot-1}),rt){const wt={...rt};wt[tt==null?void 0:tt.ref_id].topic=mt.trim(),useTopicsStore.setState({data:wt})}gt()}catch(bt){console.warn(bt)}finally{ht(!1)}}};return jsxRuntimeExports.jsx(BaseModal,{id:"mergeTopic",kind:"regular",onClose:gt,preventOutsideClose:!0,children:jsxRuntimeExports.jsxs(FormProvider,{...at,children:[jsxRuntimeExports.jsx(TitleEditor,{from:tt.topic,onSelect:pt,selectedTopic:dt}),jsxRuntimeExports.jsxs(Button$2,{color:"secondary",disabled:ut,onClick:yt,size:"large",variant:"contained",children:["Merge topics",ut&&jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.BLUE_PRESS_STATE,size:10})]})]})})},Search$1=()=>{const[tt,et]=useTopicsStore(at=>[at.filters,at.setFilters]),[nt,rt]=reactExports.useState(""),it=at=>{at.preventDefault(),et({search:nt})},ot=()=>{rt(""),tt.search&&et({search:""})};return jsxRuntimeExports.jsxs(Paper$1,{component:"form",onSubmit:it,sx:{p:"2px 4px",display:"flex",alignItems:"center",width:300},children:[jsxRuntimeExports.jsx(InputBase$1,{autoComplete:"off",autoCorrect:"off",inputProps:{"aria-label":"search topic"},onChange:at=>rt(at.target.value),placeholder:"Search",size:"small",spellCheck:"false",sx:{ml:1,flex:1},value:nt}),nt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledButton$3,{"aria-label":"search",onClick:ot,type:"button",children:jsxRuntimeExports.jsx(ClearIcon$1,{})}),jsxRuntimeExports.jsx(Divider$3,{orientation:"vertical",sx:{height:28,m:.5}})]}),jsxRuntimeExports.jsx(StyledButton$3,{"aria-label":"search",onClick:it,type:"button",children:jsxRuntimeExports.jsx(SearchIcon,{})})]})},StyledButton$3=styled$4(IconButton$1)` font-size: 24px; `,ChevronDownIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_2337_2483",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_2337_2483)",children:jsxRuntimeExports.jsx("path",{d:"M7.00001 8.72074C6.92223 8.72074 6.84931 8.70858 6.78126 8.68428C6.7132 8.65997 6.65001 8.61865 6.59167 8.56032L3.90834 5.87699C3.8014 5.77004 3.74792 5.63393 3.74792 5.46865C3.74792 5.30337 3.8014 5.16726 3.90834 5.06032C4.01529 4.95337 4.1514 4.8999 4.31667 4.8999C4.48195 4.8999 4.61806 4.95337 4.72501 5.06032L7.00001 7.33532L9.27501 5.06032C9.38195 4.95337 9.51806 4.8999 9.68334 4.8999C9.84862 4.8999 9.98473 4.95337 10.0917 5.06032C10.1986 5.16726 10.2521 5.30337 10.2521 5.46865C10.2521 5.63393 10.1986 5.77004 10.0917 5.87699L7.40834 8.56032C7.35001 8.61865 7.28681 8.65997 7.21876 8.68428C7.1507 8.70858 7.07779 8.72074 7.00001 8.72074Z",fill:"currentColor"})})]}),ChevronUpIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_2337_2442",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_2337_2442)",children:jsxRuntimeExports.jsx("path",{d:"M7.00001 6.28532L4.72501 8.56032C4.61806 8.66726 4.48195 8.72074 4.31667 8.72074C4.1514 8.72074 4.01529 8.66726 3.90834 8.56032C3.8014 8.45337 3.74792 8.31726 3.74792 8.15199C3.74792 7.98671 3.8014 7.8506 3.90834 7.74365L6.59167 5.06032C6.65001 5.00199 6.7132 4.96067 6.78126 4.93636C6.84931 4.91206 6.92223 4.8999 7.00001 4.8999C7.07779 4.8999 7.1507 4.91206 7.21876 4.93636C7.28681 4.96067 7.35001 5.00199 7.40834 5.06032L10.0917 7.74365C10.1986 7.8506 10.2521 7.98671 10.2521 8.15199C10.2521 8.31726 10.1986 8.45337 10.0917 8.56032C9.98473 8.66726 9.84862 8.72074 9.68334 8.72074C9.51806 8.72074 9.38195 8.66726 9.27501 8.56032L7.00001 6.28532Z",fill:"currentColor"})})]}),Filter=({onChangeFilter:tt,currentFilter:et})=>{const[nt,rt]=reactExports.useState(null),it=st=>{rt(st.currentTarget)},ot=()=>{rt(null)},at=st=>{tt(st),ot()};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(Action$1,{onClick:it,children:[jsxRuntimeExports.jsx("div",{className:"text",children:"Sort By"}),jsxRuntimeExports.jsx("div",{className:"value",children:SORT_MAPPING[et]}),jsxRuntimeExports.jsx("div",{className:"icon",children:nt?jsxRuntimeExports.jsx(ChevronUpIcon,{}):jsxRuntimeExports.jsx(ChevronDownIcon,{})})]}),jsxRuntimeExports.jsx(StyledPopover$1,{anchorEl:nt,anchorOrigin:{vertical:"bottom",horizontal:"left"},anchorPosition:{top:62,left:0},onClose:ot,open:!!nt,transformOrigin:{vertical:"top",horizontal:"left"},children:jsxRuntimeExports.jsx(FormControl$1,{children:Object.keys(SORT_MAPPING).map(st=>jsxRuntimeExports.jsxs(MenuItem$1,{className:clsx$4({active:st===et}),onClick:()=>at(st),children:[jsxRuntimeExports.jsx("span",{className:"icon",children:st===et?jsxRuntimeExports.jsx(CheckIcon,{}):null}),jsxRuntimeExports.jsx("span",{children:SORT_MAPPING[st]})]},st))})})]})},Action$1=styled$4(Flex).attrs({direction:"row",align:"center"})` cursor: pointer; @@ -5571,7 +5638,7 @@ function print() { __p += __j.call(arguments, '') } box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); border-radius: 6px; } -`,SettingsIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_29",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_29)",children:jsxRuntimeExports.jsx("path",{d:"M13.5096 21.5H10.4808C10.2564 21.5 10.0622 21.4246 9.8981 21.274C9.734 21.1233 9.63528 20.9358 9.60195 20.7115L9.31157 18.4538C9.04362 18.3641 8.76894 18.2384 8.48752 18.0769C8.2061 17.9153 7.9545 17.7422 7.7327 17.5576L5.64425 18.4384C5.43015 18.5217 5.21765 18.5301 5.00675 18.4634C4.79585 18.3967 4.63014 18.2647 4.50962 18.0673L3.00582 15.4481C2.8853 15.2506 2.84845 15.0397 2.89525 14.8154C2.94203 14.591 3.0558 14.4102 3.23657 14.2731L5.04427 12.9058C5.02119 12.757 5.00484 12.6077 4.99522 12.4577C4.9856 12.3077 4.9808 12.1583 4.9808 12.0096C4.9808 11.8673 4.9856 11.7227 4.99522 11.5759C5.00484 11.4291 5.02119 11.2686 5.04427 11.0942L3.23657 9.72688C3.0558 9.58971 2.94203 9.40894 2.89525 9.18458C2.84845 8.96023 2.8853 8.74934 3.00582 8.5519L4.50962 5.95195C4.61989 5.74425 4.78143 5.60963 4.99425 5.5481C5.20706 5.48657 5.42052 5.49747 5.63462 5.5808L7.72307 6.45195C7.9641 6.26092 8.22148 6.08623 8.4952 5.9279C8.76893 5.76955 9.03785 5.6423 9.30195 5.54615L9.60195 3.28848C9.63528 3.06411 9.734 2.87661 9.8981 2.72598C10.0622 2.57533 10.2564 2.5 10.4808 2.5H13.5096C13.7339 2.5 13.9298 2.57533 14.0971 2.72598C14.2644 2.87661 14.3647 3.06411 14.398 3.28848L14.6884 5.55578C14.9884 5.66474 15.2599 5.79198 15.5029 5.9375C15.7458 6.08302 15.991 6.2545 16.2384 6.45195L18.3654 5.5808C18.5795 5.49747 18.7904 5.48753 18.998 5.55098C19.2057 5.61444 19.3699 5.74489 19.4904 5.94233L20.9942 8.5519C21.1147 8.74934 21.1515 8.96023 21.1047 9.18458C21.058 9.40894 20.9442 9.58971 20.7634 9.72688L18.9173 11.123C18.9532 11.2846 18.9727 11.4355 18.9759 11.5759C18.9791 11.7163 18.9807 11.8577 18.9807 12C18.9807 12.1359 18.9775 12.274 18.9711 12.4144C18.9647 12.5548 18.9416 12.7154 18.9019 12.8962L20.7288 14.2731C20.916 14.4038 21.0314 14.583 21.0749 14.8106C21.1185 15.0381 21.0801 15.2506 20.9596 15.4481L19.4557 18.0519C19.3352 18.2493 19.167 18.3823 18.9509 18.4509C18.7349 18.5195 18.5198 18.5121 18.3057 18.4288L16.2384 17.548C15.991 17.7455 15.7384 17.9201 15.4807 18.0721C15.223 18.224 14.9589 18.348 14.6884 18.4442L14.398 20.7115C14.3647 20.9358 14.2644 21.1233 14.0971 21.274C13.9298 21.4246 13.7339 21.5 13.5096 21.5ZM12.0115 15C12.8436 15 13.5516 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.1679 14.7195 10.4599 14.1355 9.87595C13.5516 9.29198 12.8436 9 12.0115 9C11.1692 9 10.4587 9.29198 9.87982 9.87595C9.30099 10.4599 9.01157 11.1679 9.01157 12C9.01157 12.832 9.30099 13.54 9.87982 14.124C10.4587 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})})]}),Table=({data:tt,showMuted:et,setSelectedTopic:nt})=>{const[rt,it]=useTopicsStore(lt=>[lt.ids,lt.total]),[ot,at]=reactExports.useState(""),st=async(lt,ct)=>{if(tt!=null&&tt.length){at(lt);try{await putNodeData({ref_id:lt,node_name:"muted_topic",node_value:ct}),useTopicsStore.setState({ids:rt.filter(ut=>ut!==lt),total:it-1})}catch(ut){console.warn(ut)}}};return tt!=null&&tt.length?jsxRuntimeExports.jsxs(MaterialTable,{component:"table",children:[jsxRuntimeExports.jsx(StyledTableHead,{children:jsxRuntimeExports.jsxs(TableRow$1,{component:"tr",children:[jsxRuntimeExports.jsx(StyledTableCell,{className:"empty"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Type"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Edge Count"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Edge list"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Date"}),jsxRuntimeExports.jsx(StyledTableCell,{children:et?"Unmute":"Mute"}),jsxRuntimeExports.jsx(StyledTableCell,{})]})}),(tt==null?void 0:tt.length)&&jsxRuntimeExports.jsx("tbody",{children:tt==null?void 0:tt.map(lt=>{const ct=lt.date_added_to_graph.toString();return console.log(ct,lt.date_added_to_graph),jsxRuntimeExports.jsxs(StyledTableRow,{children:[jsxRuntimeExports.jsx(StyledTableCell,{className:"empty"}),jsxRuntimeExports.jsx(StyledTableCell,{children:lt.topic}),jsxRuntimeExports.jsx(StyledTableCell,{children:lt.edgeCount}),jsxRuntimeExports.jsx(StyledTableCell,{children:lt.edgeList.map(ut=>jsxRuntimeExports.jsx("span",{children:ut},ut))}),jsxRuntimeExports.jsx(StyledTableCell,{children:jsxRuntimeExports.jsx("span",{children:new Date(Number(ct)*1e3).toDateString()})}),jsxRuntimeExports.jsx(StyledTableCell,{className:"cell-center",children:jsxRuntimeExports.jsx(Flex,{direction:"row",justify:"space-between",children:jsxRuntimeExports.jsx("div",{className:"approve-wrapper",children:ot===lt.ref_id?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white,size:16}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lt.muted_topic?jsxRuntimeExports.jsx(IconWrapper$2,{className:"centered",onClick:()=>st(lt.ref_id,!1),children:jsxRuntimeExports.jsx(MdCheckCircle,{color:colors.primaryGreen,fontSize:24})}):jsxRuntimeExports.jsx(IconWrapper$2,{className:"centered",onClick:()=>st(lt.ref_id,!0),children:jsxRuntimeExports.jsx(MdCancel,{color:colors.primaryRed,fontSize:24})})})})})}),jsxRuntimeExports.jsx(StyledTableCell,{children:jsxRuntimeExports.jsx(IconButton$1,{onClick:()=>nt(lt),children:jsxRuntimeExports.jsx(SettingsIcon,{})})})]},lt.topic)})})]}):jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Text$1,{children:"There is not any results for selected filters"}),jsxRuntimeExports.jsx(FilterOffIcon,{})]})},IconWrapper$2=styled$4(Flex)` +`,SettingsIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_29",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_29)",children:jsxRuntimeExports.jsx("path",{d:"M13.5096 21.5H10.4808C10.2564 21.5 10.0622 21.4246 9.8981 21.274C9.734 21.1233 9.63528 20.9358 9.60195 20.7115L9.31157 18.4538C9.04362 18.3641 8.76894 18.2384 8.48752 18.0769C8.2061 17.9153 7.9545 17.7422 7.7327 17.5576L5.64425 18.4384C5.43015 18.5217 5.21765 18.5301 5.00675 18.4634C4.79585 18.3967 4.63014 18.2647 4.50962 18.0673L3.00582 15.4481C2.8853 15.2506 2.84845 15.0397 2.89525 14.8154C2.94203 14.591 3.0558 14.4102 3.23657 14.2731L5.04427 12.9058C5.02119 12.757 5.00484 12.6077 4.99522 12.4577C4.9856 12.3077 4.9808 12.1583 4.9808 12.0096C4.9808 11.8673 4.9856 11.7227 4.99522 11.5759C5.00484 11.4291 5.02119 11.2686 5.04427 11.0942L3.23657 9.72688C3.0558 9.58971 2.94203 9.40894 2.89525 9.18458C2.84845 8.96023 2.8853 8.74934 3.00582 8.5519L4.50962 5.95195C4.61989 5.74425 4.78143 5.60963 4.99425 5.5481C5.20706 5.48657 5.42052 5.49747 5.63462 5.5808L7.72307 6.45195C7.9641 6.26092 8.22148 6.08623 8.4952 5.9279C8.76893 5.76955 9.03785 5.6423 9.30195 5.54615L9.60195 3.28848C9.63528 3.06411 9.734 2.87661 9.8981 2.72598C10.0622 2.57533 10.2564 2.5 10.4808 2.5H13.5096C13.7339 2.5 13.9298 2.57533 14.0971 2.72598C14.2644 2.87661 14.3647 3.06411 14.398 3.28848L14.6884 5.55578C14.9884 5.66474 15.2599 5.79198 15.5029 5.9375C15.7458 6.08302 15.991 6.2545 16.2384 6.45195L18.3654 5.5808C18.5795 5.49747 18.7904 5.48753 18.998 5.55098C19.2057 5.61444 19.3699 5.74489 19.4904 5.94233L20.9942 8.5519C21.1147 8.74934 21.1515 8.96023 21.1047 9.18458C21.058 9.40894 20.9442 9.58971 20.7634 9.72688L18.9173 11.123C18.9532 11.2846 18.9727 11.4355 18.9759 11.5759C18.9791 11.7163 18.9807 11.8577 18.9807 12C18.9807 12.1359 18.9775 12.274 18.9711 12.4144C18.9647 12.5548 18.9416 12.7154 18.9019 12.8962L20.7288 14.2731C20.916 14.4038 21.0314 14.583 21.0749 14.8106C21.1185 15.0381 21.0801 15.2506 20.9596 15.4481L19.4557 18.0519C19.3352 18.2493 19.167 18.3823 18.9509 18.4509C18.7349 18.5195 18.5198 18.5121 18.3057 18.4288L16.2384 17.548C15.991 17.7455 15.7384 17.9201 15.4807 18.0721C15.223 18.224 14.9589 18.348 14.6884 18.4442L14.398 20.7115C14.3647 20.9358 14.2644 21.1233 14.0971 21.274C13.9298 21.4246 13.7339 21.5 13.5096 21.5ZM12.0115 15C12.8436 15 13.5516 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.1679 14.7195 10.4599 14.1355 9.87595C13.5516 9.29198 12.8436 9 12.0115 9C11.1692 9 10.4587 9.29198 9.87982 9.87595C9.30099 10.4599 9.01157 11.1679 9.01157 12C9.01157 12.832 9.30099 13.54 9.87982 14.124C10.4587 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})})]}),TableRowComponent=({topic:tt,onClick:et})=>{const[nt,rt]=useTopicsStore(lt=>[lt.ids,lt.total]),[it,ot]=reactExports.useState(!1),at=tt.date_added_to_graph.toString(),st=async(lt,ct)=>{ot(!0);try{await putNodeData({ref_id:lt,node_name:"muted_topic",node_value:ct}),useTopicsStore.setState({ids:nt.filter(ut=>ut!==lt),total:rt-1})}catch(ut){console.warn(ut)}};return jsxRuntimeExports.jsxs(StyledTableRow,{children:[jsxRuntimeExports.jsx(StyledTableCell,{className:"empty"}),jsxRuntimeExports.jsx(StyledTableCell,{children:tt.topic}),jsxRuntimeExports.jsx(StyledTableCell,{children:tt.edgeCount}),jsxRuntimeExports.jsx(StyledTableCell,{children:tt.edgeList.map(lt=>jsxRuntimeExports.jsx("span",{children:lt},lt))}),jsxRuntimeExports.jsx(StyledTableCell,{children:jsxRuntimeExports.jsx("span",{children:new Date(Number(at)*1e3).toDateString()})}),jsxRuntimeExports.jsx(StyledTableCell,{className:"cell-center",children:jsxRuntimeExports.jsx(Flex,{direction:"row",justify:"space-between",children:jsxRuntimeExports.jsx("div",{className:"approve-wrapper",children:it?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white,size:16}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:tt.muted_topic?jsxRuntimeExports.jsx(IconWrapper$2,{className:"centered",onClick:()=>st(tt.ref_id,!1),children:jsxRuntimeExports.jsx(MdCheckCircle,{color:colors.primaryGreen,fontSize:24})}):jsxRuntimeExports.jsx(IconWrapper$2,{className:"centered",onClick:()=>st(tt.ref_id,!0),children:jsxRuntimeExports.jsx(MdCancel,{color:colors.primaryRed,fontSize:24})})})})})}),jsxRuntimeExports.jsx(StyledTableCell,{children:jsxRuntimeExports.jsx(IconButton$1,{onClick:lt=>et(lt,tt.ref_id),children:jsxRuntimeExports.jsx(SettingsIcon,{})})})]},tt.topic)},IconWrapper$2=styled$4(Flex)` width: 20px; height: 20px; border-radius: 50%; @@ -5585,7 +5652,34 @@ function print() { __p += __j.call(arguments, '') } & + & { margin-left: 4px; } -`,TopicSources=()=>{const[tt,et]=reactExports.useState(!0),[nt,rt,it,ot,at,st,lt]=useTopicsStore(bt=>[bt.data,bt.ids,bt.total,bt.setTopics,bt.filters,bt.setFilters,bt.terminate]),{open:ct}=useModal("editTopic"),[ut,ht]=reactExports.useState(null),dt=reactExports.useRef([]);reactExports.useEffect(()=>{rt.length&&(dt.current=rt)},[rt]),reactExports.useEffect(()=>{(async()=>{try{et(!0),await ot()}catch{console.log("err")}finally{et(!1)}})()},[ot,at]);const pt=()=>{st({page:at.page+1})};reactExports.useEffect(()=>()=>{lt()},[lt]);const mt=bt=>{st({sortBy:bt})},gt=()=>{ht(null)},yt=bt=>{ht(bt),ct()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Wrapper$j,{direction:"column",justify:"flex-end",children:[jsxRuntimeExports.jsxs(Heading$4,{align:"flex-start",direction:"row",justify:"space-between",children:[jsxRuntimeExports.jsx(Text$1,{className:"title",children:"Topics"}),jsxRuntimeExports.jsxs(Button$2,{disabled:tt,onClick:()=>st({muted:!at.muted}),size:"medium",children:[at.muted?"Show Unmuted":"Show Muted",tt&&jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.BLUE_PRESS_STATE,size:10})]})]}),jsxRuntimeExports.jsxs(ActionsWrapper,{children:[jsxRuntimeExports.jsx(Search$1,{}),jsxRuntimeExports.jsx(Filter,{currentFilter:at.sortBy,onChangeFilter:mt})]}),jsxRuntimeExports.jsx(TableWrapper,{align:"center",justify:tt?"center":"flex-start",children:tt&&!nt?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white}):jsxRuntimeExports.jsx(Table,{data:nt?rt.map(bt=>nt[bt]):[],setSelectedTopic:yt,showMuted:at.muted})}),it>rt.length?jsxRuntimeExports.jsxs(Button$2,{className:"load-more",disabled:tt,onClick:pt,children:["Load more",tt&&jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.BLUE_PRESS_STATE,size:10})]}):null]}),ut&&jsxRuntimeExports.jsx(EditTopicModal,{onClose:gt,topic:ut})]})},Wrapper$j=styled$4(Flex)` +`,TopicRow=reactExports.memo(TableRowComponent),Table=({showMuted:tt,onTopicEdit:et})=>{const[nt,rt]=React$1.useState(null),[it,ot]=React$1.useState(""),[at,st]=useTopicsStore(pt=>[pt.data,pt.ids]),lt=reactExports.useCallback((pt,mt)=>{rt(pt.currentTarget),ot(mt)},[]),ct=()=>{rt(null)},ut=pt=>{et(it,pt),ct()},ht=!!nt,dt=ht?"simple-popover":void 0;return at?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(MaterialTable,{component:"table",children:[jsxRuntimeExports.jsx(StyledTableHead,{children:jsxRuntimeExports.jsxs(TableRow$1,{component:"tr",children:[jsxRuntimeExports.jsx(StyledTableCell,{className:"empty"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Type"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Edge Count"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Edge list"}),jsxRuntimeExports.jsx(StyledTableCell,{children:"Date"}),jsxRuntimeExports.jsx(StyledTableCell,{children:tt?"Unmute":"Mute"}),jsxRuntimeExports.jsx(StyledTableCell,{})]})}),at&&jsxRuntimeExports.jsx("tbody",{children:st==null?void 0:st.map(pt=>jsxRuntimeExports.jsx(TopicRow,{onClick:lt,topic:at[pt]},pt))})]}),it?jsxRuntimeExports.jsxs(PopoverWrapper,{anchorEl:nt,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:dt,onClose:ct,open:ht,transformOrigin:{vertical:"top",horizontal:"right"},children:[jsxRuntimeExports.jsx(PopoverOption,{onClick:()=>ut("editTopic"),children:"Rename"}),at[it].edgeList.includes(IS_ALIAS)?null:jsxRuntimeExports.jsx(PopoverOption,{onClick:()=>ut("mergeTopic"),children:"Merge"})]}):null]}):jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Text$1,{children:"There is not any results for selected filters"}),jsxRuntimeExports.jsx(FilterOffIcon,{})]})},PopoverOption=styled$4(Flex).attrs({direction:"row",px:16,py:8})` + cursor: pointer; + background: ${colors.BUTTON1}; + color: ${colors.white}; + + &:hover { + background: ${colors.BUTTON1_HOVER}; + color: ${colors.GRAY3}; + } + + & + & { + border-top: 1px solid ${colors.black}; + } +`,PopoverWrapper=styled$4(Popover$1)` + && { + z-index: 9999; + } + .MuiPaper-root { + min-width: 149px; + color: ${colors.GRAY3}; + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); + border-radius: 6px; + z-index: 1; + font-family: Barlow; + font-size: 14px; + font-weight: 500; + } +`,TopicSources=()=>{const[tt,et]=reactExports.useState(!0),[nt,rt,it,ot,at,st,lt]=useTopicsStore(xt=>[xt.data,xt.ids,xt.total,xt.setTopics,xt.filters,xt.setFilters,xt.terminate]),{open:ct}=useModal("editTopic"),{open:ut}=useModal("mergeTopic"),[ht,dt]=reactExports.useState(null),pt={editTopic:ct,mergeTopic:ut},mt=reactExports.useRef([]);reactExports.useEffect(()=>{rt.length&&(mt.current=rt)},[rt]),reactExports.useEffect(()=>{(async()=>{try{et(!0),await ot()}catch{console.log("err")}finally{et(!1)}})()},[ot,at]);const gt=()=>{st({page:at.page+1})};reactExports.useEffect(()=>()=>{lt()},[lt]);const yt=xt=>{st({sortBy:xt})},bt=()=>{dt(null)},wt=(xt,kt)=>{nt&&(dt(nt[xt]),typeof pt[kt]=="function"&&pt[kt]())};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Wrapper$j,{direction:"column",justify:"flex-end",children:[jsxRuntimeExports.jsxs(Heading$4,{align:"flex-start",direction:"row",justify:"space-between",children:[jsxRuntimeExports.jsx(Text$1,{className:"title",children:"Topics"}),jsxRuntimeExports.jsxs(Button$2,{disabled:tt,onClick:()=>st({muted:!at.muted}),size:"medium",children:[at.muted?"Show Unmuted":"Show Muted",tt&&jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.BLUE_PRESS_STATE,size:10})]})]}),jsxRuntimeExports.jsxs(ActionsWrapper,{children:[jsxRuntimeExports.jsx(Search$1,{}),jsxRuntimeExports.jsx(Filter,{currentFilter:at.sortBy,onChangeFilter:yt})]}),jsxRuntimeExports.jsx(TableWrapper,{align:"center",justify:tt?"center":"flex-start",children:tt&&!nt?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Table,{onTopicEdit:wt,showMuted:at.muted}),it>rt.length?jsxRuntimeExports.jsxs(Button$2,{className:"load-more",disabled:tt,onClick:gt,children:["Load more",tt&&jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.BLUE_PRESS_STATE,size:10})]}):null]})})]}),ht&&jsxRuntimeExports.jsx(MergeTopicModal,{onClose:bt,topic:ht}),ht&&jsxRuntimeExports.jsx(EditTopicModal,{onClose:bt,topic:ht})]})},Wrapper$j=styled$4(Flex)` flex: 1; .title { @@ -5791,8 +5885,8 @@ function print() { __p += __j.call(arguments, '') } `));return wt},[ct,dt,ut,ht,ot]),yt=reactExports.useMemo(()=>gt?{minDate:gt.date("1900-01-01T00:00:00.000"),maxDate:gt.date("2099-12-31T00:00:00.000")}:null,[gt]),bt=reactExports.useMemo(()=>({utils:gt,defaultDates:yt,localeText:mt}),[yt,gt,mt]);return jsxRuntimeExports.jsx(MuiPickersAdapterContext.Provider,{value:bt,children:lt})},getPickersLocalization=tt=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:_extends$u({},tt)}}}}),enUSPickers={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:tt=>tt==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(tt,et,nt)=>`Select ${tt}. ${et===null?"No time selected":`Selected time is ${nt.format(et,"fullTime")}`}`,hoursClockNumberText:tt=>`${tt} hours`,minutesClockNumberText:tt=>`${tt} minutes`,secondsClockNumberText:tt=>`${tt} seconds`,selectViewText:tt=>`Select ${tt}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:tt=>`Week ${tt}`,calendarWeekNumberText:tt=>`${tt}`,openDatePickerDialogue:(tt,et)=>tt!==null&&et.isValid(tt)?`Choose date, selected date is ${et.format(tt,"fullDate")}`:"Choose date",openTimePickerDialogue:(tt,et)=>tt!==null&&et.isValid(tt)?`Choose time, selected time is ${et.format(tt,"fullTime")}`:"Choose time",fieldClearLabel:"Clear value",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:tt=>"Y".repeat(tt.digitAmount),fieldMonthPlaceholder:tt=>tt.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:tt=>tt.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa"},DEFAULT_LOCALE=enUSPickers;getPickersLocalization(enUSPickers);const useLocalizationContext=()=>{const tt=reactExports.useContext(MuiPickersAdapterContext);if(tt===null)throw new Error(["MUI: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` `));if(tt.utils===null)throw new Error(["MUI: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(` `));const et=reactExports.useMemo(()=>_extends$u({},DEFAULT_LOCALE,tt.localeText),[tt.localeText]);return reactExports.useMemo(()=>_extends$u({},tt,{localeText:et}),[tt,et])},useUtils=()=>useLocalizationContext().utils,useDefaultDates=()=>useLocalizationContext().defaultDates,useLocaleText=()=>useLocalizationContext().localeText,useNow=tt=>{const et=useUtils(),nt=reactExports.useRef();return nt.current===void 0&&(nt.current=et.dateWithTimezone(void 0,tt)),nt.current},ArrowDropDownIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),ArrowLeftIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),ArrowRightIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),CalendarIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar");createSvgIcon(jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),jsxRuntimeExports.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");createSvgIcon(jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),jsxRuntimeExports.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");const ClearIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function getPickersArrowSwitcherUtilityClass(tt){return generateUtilityClass("MuiPickersArrowSwitcher",tt)}generateUtilityClasses("MuiPickersArrowSwitcher",["root","spacer","button"]);const _excluded$E=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel"],_excluded2$b=["ownerState"],_excluded3$3=["ownerState"],PickersArrowSwitcherRoot=styled$1("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex"}),PickersArrowSwitcherSpacer=styled$1("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(tt,et)=>et.spacer})(({theme:tt})=>({width:tt.spacing(3)})),PickersArrowSwitcherButton=styled$1(IconButton$1,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(tt,et)=>et.button})(({ownerState:tt})=>_extends$u({},tt.hidden&&{visibility:"hidden"})),useUtilityClasses$f=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],spacer:["spacer"],button:["button"]},getPickersArrowSwitcherUtilityClass,et)},PickersArrowSwitcher=reactExports.forwardRef(function(et,nt){var rt,it,ot,at;const lt=useTheme().direction==="rtl",ct=useThemeProps({props:et,name:"MuiPickersArrowSwitcher"}),{children:ut,className:ht,slots:dt,slotProps:pt,isNextDisabled:mt,isNextHidden:gt,onGoToNext:yt,nextLabel:bt,isPreviousDisabled:wt,isPreviousHidden:xt,onGoToPrevious:kt,previousLabel:St}=ct,Tt=_objectWithoutPropertiesLoose$k(ct,_excluded$E),At=ct,Et=useUtilityClasses$f(At),Ct={isDisabled:mt,isHidden:gt,goTo:yt,label:bt},Lt={isDisabled:wt,isHidden:xt,goTo:kt,label:St},jt=(rt=dt==null?void 0:dt.previousIconButton)!=null?rt:PickersArrowSwitcherButton,Rt=useSlotProps({elementType:jt,externalSlotProps:pt==null?void 0:pt.previousIconButton,additionalProps:{size:"medium",title:Lt.label,"aria-label":Lt.label,disabled:Lt.isDisabled,edge:"end",onClick:Lt.goTo},ownerState:_extends$u({},At,{hidden:Lt.isHidden}),className:Et.button}),$t=(it=dt==null?void 0:dt.nextIconButton)!=null?it:PickersArrowSwitcherButton,vt=useSlotProps({elementType:$t,externalSlotProps:pt==null?void 0:pt.nextIconButton,additionalProps:{size:"medium",title:Ct.label,"aria-label":Ct.label,disabled:Ct.isDisabled,edge:"start",onClick:Ct.goTo},ownerState:_extends$u({},At,{hidden:Ct.isHidden}),className:Et.button}),It=(ot=dt==null?void 0:dt.leftArrowIcon)!=null?ot:ArrowLeftIcon,Ot=useSlotProps({elementType:It,externalSlotProps:pt==null?void 0:pt.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),Wt=_objectWithoutPropertiesLoose$k(Ot,_excluded2$b),zt=(at=dt==null?void 0:dt.rightArrowIcon)!=null?at:ArrowRightIcon,Ft=useSlotProps({elementType:zt,externalSlotProps:pt==null?void 0:pt.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),Nt=_objectWithoutPropertiesLoose$k(Ft,_excluded3$3);return jsxRuntimeExports.jsxs(PickersArrowSwitcherRoot,_extends$u({ref:nt,className:clsx(Et.root,ht),ownerState:At},Tt,{children:[jsxRuntimeExports.jsx(jt,_extends$u({},Rt,{children:lt?jsxRuntimeExports.jsx(zt,_extends$u({},Nt)):jsxRuntimeExports.jsx(It,_extends$u({},Wt))})),ut?jsxRuntimeExports.jsx(Typography$1,{variant:"subtitle1",component:"span",children:ut}):jsxRuntimeExports.jsx(PickersArrowSwitcherSpacer,{className:Et.spacer,ownerState:At}),jsxRuntimeExports.jsx($t,_extends$u({},vt,{children:lt?jsxRuntimeExports.jsx(It,_extends$u({},Wt)):jsxRuntimeExports.jsx(zt,_extends$u({},Nt))}))]}))}),areViewsEqual=(tt,et)=>tt.length!==et.length?!1:et.every(nt=>tt.includes(nt)),applyDefaultViewProps=({openTo:tt,defaultOpenTo:et,views:nt,defaultViews:rt})=>{const it=nt??rt;let ot;if(tt!=null)ot=tt;else if(it.includes(et))ot=et;else if(it.length>0)ot=it[0];else throw new Error("MUI: The `views` prop must contain at least one view");return{views:it,openTo:ot}},timeViews=["hours","minutes","seconds"],isTimeView=tt=>timeViews.includes(tt),getSecondsInDay=(tt,et)=>et.getHours(tt)*3600+et.getMinutes(tt)*60+et.getSeconds(tt),createIsAfterIgnoreDatePart=(tt,et)=>(nt,rt)=>tt?et.isAfter(nt,rt):getSecondsInDay(nt,et)>getSecondsInDay(rt,et);function useViews({onChange:tt,onViewChange:et,openTo:nt,view:rt,views:it,autoFocus:ot,focusedView:at,onFocusedViewChange:st}){var lt,ct;const ut=reactExports.useRef(nt),ht=reactExports.useRef(it),dt=reactExports.useRef(it.includes(nt)?nt:it[0]),[pt,mt]=useControlled({name:"useViews",state:"view",controlled:rt,default:dt.current}),gt=reactExports.useRef(ot?pt:null),[yt,bt]=useControlled({name:"useViews",state:"focusedView",controlled:at,default:gt.current});reactExports.useEffect(()=>{(ut.current&&ut.current!==nt||ht.current&&ht.current.some(Lt=>!it.includes(Lt)))&&(mt(it.includes(nt)?nt:it[0]),ht.current=it,ut.current=nt)},[nt,mt,pt,it]);const wt=it.indexOf(pt),xt=(lt=it[wt-1])!=null?lt:null,kt=(ct=it[wt+1])!=null?ct:null,St=useEventCallback((Lt,jt)=>{bt(jt?Lt:Rt=>Lt===Rt?null:Rt),st==null||st(Lt,jt)}),Tt=useEventCallback(Lt=>{Lt!==pt&&(mt(Lt),St(Lt,!0),et&&et(Lt))}),At=useEventCallback(()=>{kt&&Tt(kt),St(kt,!0)}),Et=useEventCallback((Lt,jt,Rt)=>{const $t=jt==="finish",vt=Rt?it.indexOf(Rt){tt(Lt,jt?"partial":"finish",Rt),jt&&(Tt(jt),St(jt,!0))});return{view:pt,setView:Tt,focusedView:yt,setFocusedView:St,nextView:kt,previousView:xt,defaultView:dt.current,goToNextView:At,setValueAndGoToNextView:Et,setValueAndGoToView:Ct}}function useNextMonthDisabled(tt,{disableFuture:et,maxDate:nt,timezone:rt}){const it=useUtils();return reactExports.useMemo(()=>{const ot=it.dateWithTimezone(void 0,rt),at=it.startOfMonth(et&&it.isBefore(ot,nt)?ot:nt);return!it.isAfter(at,tt)},[et,nt,tt,it,rt])}function usePreviousMonthDisabled(tt,{disablePast:et,minDate:nt,timezone:rt}){const it=useUtils();return reactExports.useMemo(()=>{const ot=it.dateWithTimezone(void 0,rt),at=it.startOfMonth(et&&it.isAfter(ot,nt)?ot:nt);return!it.isBefore(at,tt)},[et,nt,tt,it,rt])}const DAY_SIZE=36,DAY_MARGIN=2,DIALOG_WIDTH=320,MAX_CALENDAR_HEIGHT=280,VIEW_HEIGHT=334,PickerViewRoot=styled$1("div")({overflow:"hidden",width:DIALOG_WIDTH,maxHeight:VIEW_HEIGHT,display:"flex",flexDirection:"column",margin:"0 auto"}),findClosestEnabledDate=({date:tt,disableFuture:et,disablePast:nt,maxDate:rt,minDate:it,isDateDisabled:ot,utils:at,timezone:st})=>{const lt=at.startOfDay(at.dateWithTimezone(void 0,st));nt&&at.isBefore(it,lt)&&(it=lt),et&&at.isAfter(rt,lt)&&(rt=lt);let ct=tt,ut=tt;for(at.isBefore(tt,it)&&(ct=it,ut=null),at.isAfter(tt,rt)&&(ut&&(ut=rt),ct=null);ct||ut;){if(ct&&at.isAfter(ct,rt)&&(ct=null),ut&&at.isBefore(ut,it)&&(ut=null),ct){if(!ot(ct))return ct;ct=at.addDays(ct,1)}if(ut){if(!ot(ut))return ut;ut=at.addDays(ut,-1)}}return null},replaceInvalidDateByNull=(tt,et)=>et==null||!tt.isValid(et)?null:et,applyDefaultDate=(tt,et,nt)=>et==null||!tt.isValid(et)?nt:et,areDatesEqual$1=(tt,et,nt)=>!tt.isValid(et)&&et!=null&&!tt.isValid(nt)&&nt!=null?!0:tt.isEqual(et,nt),getMonthsInYear=(tt,et)=>{const rt=[tt.startOfYear(et)];for(;rt.length<12;){const it=rt[rt.length-1];rt.push(tt.addMonths(it,1))}return rt},mergeDateAndTime=(tt,et,nt)=>{let rt=et;return rt=tt.setHours(rt,tt.getHours(nt)),rt=tt.setMinutes(rt,tt.getMinutes(nt)),rt=tt.setSeconds(rt,tt.getSeconds(nt)),rt},getTodayDate=(tt,et,nt)=>nt==="date"?tt.startOfDay(tt.dateWithTimezone(void 0,et)):tt.dateWithTimezone(void 0,et),dateViews=["year","month","day"],isDatePickerView=tt=>dateViews.includes(tt),resolveDateFormat=(tt,{format:et,views:nt},rt)=>{if(et!=null)return et;const it=tt.formats;return areViewsEqual(nt,["year"])?it.year:areViewsEqual(nt,["month"])?it.month:areViewsEqual(nt,["day"])?it.dayOfMonth:areViewsEqual(nt,["month","year"])?`${it.month} ${it.year}`:areViewsEqual(nt,["day","month"])?`${it.month} ${it.dayOfMonth}`:rt?/en/.test(tt.getCurrentLocaleCode())?it.normalDateWithWeekday:it.normalDate:it.keyboardDate},getWeekdays=(tt,et)=>{const nt=tt.startOfWeek(et);return[0,1,2,3,4,5,6].map(rt=>tt.addDays(nt,rt))},useValueWithTimezone=({timezone:tt,value:et,defaultValue:nt,onChange:rt,valueManager:it})=>{var ot,at;const st=useUtils(),lt=reactExports.useRef(nt),ct=(ot=et??lt.current)!=null?ot:it.emptyValue,ut=reactExports.useMemo(()=>it.getTimezone(st,ct),[st,it,ct]),ht=useEventCallback(gt=>ut==null?gt:it.setTimezone(st,ut,gt)),dt=(at=tt??ut)!=null?at:"default",pt=reactExports.useMemo(()=>it.setTimezone(st,dt,ct),[it,st,dt,ct]),mt=useEventCallback((gt,...yt)=>{const bt=ht(gt);rt==null||rt(bt,...yt)});return{value:pt,handleValueChange:mt,timezone:dt}},useControlledValueWithTimezone=({name:tt,timezone:et,value:nt,defaultValue:rt,onChange:it,valueManager:ot})=>{const[at,st]=useControlled({name:tt,state:"value",controlled:nt,default:rt??ot.emptyValue}),lt=useEventCallback((ct,...ut)=>{st(ct),it==null||it(ct,...ut)});return useValueWithTimezone({timezone:et,value:at,defaultValue:void 0,onChange:lt,valueManager:ot})},SECTION_TYPE_GRANULARITY={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},getSectionTypeGranularity=tt=>Math.max(...tt.map(et=>{var nt;return(nt=SECTION_TYPE_GRANULARITY[et.type])!=null?nt:1})),roundDate=(tt,et,nt)=>{if(et===SECTION_TYPE_GRANULARITY.year)return tt.startOfYear(nt);if(et===SECTION_TYPE_GRANULARITY.month)return tt.startOfMonth(nt);if(et===SECTION_TYPE_GRANULARITY.day)return tt.startOfDay(nt);let rt=nt;return et{var ot;let at=it?it():roundDate(et,nt,getTodayDate(et,rt));tt.minDate!=null&&et.isAfterDay(tt.minDate,at)&&(at=roundDate(et,nt,tt.minDate)),tt.maxDate!=null&&et.isBeforeDay(tt.maxDate,at)&&(at=roundDate(et,nt,tt.maxDate));const st=createIsAfterIgnoreDatePart((ot=tt.disableIgnoringDatePartForTimeValidation)!=null?ot:!1,et);return tt.minTime!=null&&st(tt.minTime,at)&&(at=roundDate(et,nt,tt.disableIgnoringDatePartForTimeValidation?tt.minTime:mergeDateAndTime(et,at,tt.minTime))),tt.maxTime!=null&&st(at,tt.maxTime)&&(at=roundDate(et,nt,tt.disableIgnoringDatePartForTimeValidation?tt.maxTime:mergeDateAndTime(et,at,tt.maxTime))),at},getDateSectionConfigFromFormatToken=(tt,et)=>{const nt=tt.formatTokenMap[et];if(nt==null)throw new Error([`MUI: The token "${et}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` -`));return typeof nt=="string"?{type:nt,contentType:nt==="meridiem"?"letter":"digit",maxLength:void 0}:{type:nt.sectionType,contentType:nt.contentType,maxLength:nt.maxLength}},getDeltaFromKeyCode=tt=>{switch(tt){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},getDaysInWeekStr=(tt,et,nt)=>{const rt=[],it=tt.dateWithTimezone(void 0,et),ot=tt.startOfWeek(it),at=tt.endOfWeek(it);let st=ot;for(;tt.isBefore(st,at);)rt.push(st),st=tt.addDays(st,1);return rt.map(lt=>tt.formatByString(lt,nt))},getLetterEditingOptions=(tt,et,nt,rt)=>{switch(nt){case"month":return getMonthsInYear(tt,tt.dateWithTimezone(void 0,et)).map(it=>tt.formatByString(it,rt));case"weekDay":return getDaysInWeekStr(tt,et,rt);case"meridiem":{const it=tt.dateWithTimezone(void 0,et);return[tt.startOfDay(it),tt.endOfDay(it)].map(ot=>tt.formatByString(ot,rt))}default:return[]}},cleanLeadingZeros=(tt,et,nt)=>{let rt=et;for(rt=Number(rt).toString();rt.length{if(it.type==="day"&&it.contentType==="digit-with-letter"){const at=tt.setDate(rt.longestMonth,nt);return tt.formatByString(at,it.format)}const ot=nt.toString();return it.hasLeadingZerosInInput?cleanLeadingZeros(tt,ot,it.maxLength):ot},adjustSectionValue=(tt,et,nt,rt,it,ot,at)=>{const st=getDeltaFromKeyCode(rt),lt=rt==="Home",ct=rt==="End",ut=nt.value===""||lt||ct,ht=()=>{const pt=it[nt.type]({currentDate:ot,format:nt.format,contentType:nt.contentType}),mt=wt=>cleanDigitSectionValue(tt,et,wt,pt,nt),gt=nt.type==="minutes"&&at!=null&&at.minutesStep?at.minutesStep:1;let bt=parseInt(nt.value,10)+st*gt;if(ut){if(nt.type==="year"&&!ct&&!lt)return tt.formatByString(tt.dateWithTimezone(void 0,et),nt.format);st>0||lt?bt=pt.minimum:bt=pt.maximum}return bt%gt!==0&&((st<0||lt)&&(bt+=gt-(gt+bt)%gt),(st>0||ct)&&(bt-=bt%gt)),bt>pt.maximum?mt(pt.minimum+(bt-pt.maximum-1)%(pt.maximum-pt.minimum+1)):bt{const pt=getLetterEditingOptions(tt,et,nt.type,nt.format);if(pt.length===0)return nt.value;if(ut)return st>0||lt?pt[0]:pt[pt.length-1];const gt=(pt.indexOf(nt.value)+pt.length+st)%pt.length;return pt[gt]};return nt.contentType==="digit"||nt.contentType==="digit-with-letter"?ht():dt()},getSectionVisibleValue=(tt,et)=>{let nt=tt.value||tt.placeholder;const rt=et==="non-input"?tt.hasLeadingZerosInFormat:tt.hasLeadingZerosInInput;return et==="non-input"&&tt.hasLeadingZerosInInput&&!tt.hasLeadingZerosInFormat&&(nt=Number(nt).toString()),["input-rtl","input-ltr"].includes(et)&&tt.contentType==="digit"&&!rt&&nt.length===1&&(nt=`${nt}‎`),et==="input-rtl"&&(nt=`⁨${nt}⁩`),nt},cleanString=tt=>tt.replace(/[\u2066\u2067\u2068\u2069]/g,""),addPositionPropertiesToSections=(tt,et)=>{let nt=0,rt=et?1:0;const it=[];for(let ot=0;ot{switch(rt.type){case"year":return nt.fieldYearPlaceholder({digitAmount:tt.formatByString(tt.dateWithTimezone(void 0,et),it).length});case"month":return nt.fieldMonthPlaceholder({contentType:rt.contentType});case"day":return nt.fieldDayPlaceholder();case"weekDay":return nt.fieldWeekDayPlaceholder({contentType:rt.contentType});case"hours":return nt.fieldHoursPlaceholder();case"minutes":return nt.fieldMinutesPlaceholder();case"seconds":return nt.fieldSecondsPlaceholder();case"meridiem":return nt.fieldMeridiemPlaceholder();default:return it}},changeSectionValueFormat=(tt,et,nt,rt)=>tt.formatByString(tt.parse(et,nt),rt),isFourDigitYearFormat=(tt,et,nt)=>tt.formatByString(tt.dateWithTimezone(void 0,et),nt).length===4,doesSectionFormatHaveLeadingZeros=(tt,et,nt,rt,it)=>{if(nt!=="digit")return!1;const ot=tt.dateWithTimezone(void 0,et);switch(rt){case"year":return isFourDigitYearFormat(tt,et,it)?tt.formatByString(tt.setYear(ot,1),it)==="0001":tt.formatByString(tt.setYear(ot,2001),it)==="01";case"month":return tt.formatByString(tt.startOfYear(ot),it).length>1;case"day":return tt.formatByString(tt.startOfMonth(ot),it).length>1;case"weekDay":return tt.formatByString(tt.startOfWeek(ot),it).length>1;case"hours":return tt.formatByString(tt.setHours(ot,1),it).length>1;case"minutes":return tt.formatByString(tt.setMinutes(ot,1),it).length>1;case"seconds":return tt.formatByString(tt.setSeconds(ot,1),it).length>1;default:throw new Error("Invalid section type")}},getEscapedPartsFromFormat=(tt,et)=>{const nt=[],{start:rt,end:it}=tt.escapedCharacters,ot=new RegExp(`(\\${rt}[^\\${it}]*\\${it})+`,"g");let at=null;for(;at=ot.exec(et);)nt.push({start:at.index,end:ot.lastIndex-1});return nt},splitFormatIntoSections=(tt,et,nt,rt,it,ot,at,st)=>{let lt="";const ct=[],ut=tt.date(),ht=xt=>{if(xt==="")return null;const kt=getDateSectionConfigFromFormatToken(tt,xt),St=doesSectionFormatHaveLeadingZeros(tt,et,kt.contentType,kt.type,xt),Tt=at?St:kt.contentType==="digit",At=it!=null&&tt.isValid(it);let Et=At?tt.formatByString(it,xt):"",Ct=null;if(Tt)if(St)Ct=Et===""?tt.formatByString(ut,xt).length:Et.length;else{if(kt.maxLength==null)throw new Error(`MUI: The token ${xt} should have a 'maxDigitNumber' property on it's adapter`);Ct=kt.maxLength,At&&(Et=cleanLeadingZeros(tt,Et,Ct))}return ct.push(_extends$u({},kt,{format:xt,maxLength:Ct,value:Et,placeholder:getSectionPlaceholder(tt,et,nt,kt,xt),hasLeadingZeros:St,hasLeadingZerosInFormat:St,hasLeadingZerosInInput:Tt,startSeparator:ct.length===0?lt:"",endSeparator:"",modified:!1})),null};let dt=10,pt=rt,mt=tt.expandFormat(rt);for(;mt!==pt;)if(pt=mt,mt=tt.expandFormat(pt),dt-=1,dt<0)throw new Error("MUI: The format expansion seems to be enter in an infinite loop. Please open an issue with the format passed to the picker component");const gt=mt,yt=getEscapedPartsFromFormat(tt,gt),bt=new RegExp(`^(${Object.keys(tt.formatTokenMap).sort((xt,kt)=>kt.length-xt.length).join("|")})`,"g");let wt="";for(let xt=0;xtCt.start<=xt&&Ct.end>=xt),St=gt[xt],Tt=kt!=null,At=`${wt}${gt.slice(xt)}`,Et=bt.test(At);!Tt&&St.match(/([A-Za-z]+)/)&&Et?(wt=At.slice(0,bt.lastIndex),xt+=bt.lastIndex-1):Tt&&(kt==null?void 0:kt.start)===xt||(kt==null?void 0:kt.end)===xt||(ht(wt),wt="",ct.length===0?lt+=St:ct[ct.length-1].endSeparator+=St)}return ht(wt),ct.map(xt=>{const kt=St=>{let Tt=St;return st&&Tt!==null&&Tt.includes(" ")&&(Tt=`⁩${Tt}⁦`),ot==="spacious"&&["/",".","-"].includes(Tt)&&(Tt=` ${Tt} `),Tt};return xt.startSeparator=kt(xt.startSeparator),xt.endSeparator=kt(xt.endSeparator),xt})},getDateFromDateSections=(tt,et)=>{const nt=et.some(st=>st.type==="day"),rt=[],it=[];for(let st=0;st{const rt=tt.map(it=>{const ot=getSectionVisibleValue(it,et?"input-rtl":"input-ltr");return`${it.startSeparator}${ot}${it.endSeparator}`}).join("");return et?`⁦${rt}⁩`:rt},getSectionsBoundaries=(tt,et)=>{const nt=tt.dateWithTimezone(void 0,et),rt=tt.endOfYear(nt),it=tt.endOfDay(nt),{maxDaysInMonth:ot,longestMonth:at}=getMonthsInYear(tt,nt).reduce((st,lt)=>{const ct=tt.getDaysInMonth(lt);return ct>st.maxDaysInMonth?{maxDaysInMonth:ct,longestMonth:lt}:st},{maxDaysInMonth:0,longestMonth:null});return{year:({format:st})=>({minimum:0,maximum:isFourDigitYearFormat(tt,et,st)?9999:99}),month:()=>({minimum:1,maximum:tt.getMonth(rt)+1}),day:({currentDate:st})=>({minimum:1,maximum:st!=null&&tt.isValid(st)?tt.getDaysInMonth(st):ot,longestMonth:at}),weekDay:({format:st,contentType:lt})=>{if(lt==="digit"){const ct=getDaysInWeekStr(tt,et,st).map(Number);return{minimum:Math.min(...ct),maximum:Math.max(...ct)}}return{minimum:1,maximum:7}},hours:({format:st})=>{const lt=tt.getHours(it);return tt.formatByString(tt.endOfDay(nt),st)!==lt.toString()?{minimum:1,maximum:Number(tt.formatByString(tt.startOfDay(nt),st))}:{minimum:0,maximum:lt}},minutes:()=>({minimum:0,maximum:tt.getMinutes(it)}),seconds:()=>({minimum:0,maximum:tt.getSeconds(it)}),meridiem:()=>({minimum:0,maximum:0})}},transferDateSectionValue=(tt,et,nt,rt,it)=>{switch(nt.type){case"year":return tt.setYear(it,tt.getYear(rt));case"month":return tt.setMonth(it,tt.getMonth(rt));case"weekDay":{const ot=getDaysInWeekStr(tt,et,nt.format),at=tt.formatByString(rt,nt.format),st=ot.indexOf(at),ct=ot.indexOf(nt.value)-st;return tt.addDays(rt,ct)}case"day":return tt.setDate(it,tt.getDate(rt));case"meridiem":{const ot=tt.getHours(rt)<12,at=tt.getHours(it);return ot&&at>=12?tt.addHours(it,-12):!ot&&at<12?tt.addHours(it,12):it}case"hours":return tt.setHours(it,tt.getHours(rt));case"minutes":return tt.setMinutes(it,tt.getMinutes(rt));case"seconds":return tt.setSeconds(it,tt.getSeconds(rt));default:return it}},reliableSectionModificationOrder={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8},mergeDateIntoReferenceDate=(tt,et,nt,rt,it,ot)=>[...rt].sort((at,st)=>reliableSectionModificationOrder[at.type]-reliableSectionModificationOrder[st.type]).reduce((at,st)=>!ot||st.modified?transferDateSectionValue(tt,et,st,nt,at):at,it),isAndroid=()=>navigator.userAgent.toLowerCase().indexOf("android")>-1,getSectionOrder=(tt,et)=>{const nt={};if(!et)return tt.forEach((lt,ct)=>{const ut=ct===0?null:ct-1,ht=ct===tt.length-1?null:ct+1;nt[ct]={leftIndex:ut,rightIndex:ht}}),{neighbors:nt,startIndex:0,endIndex:tt.length-1};const rt={},it={};let ot=0,at=0,st=tt.length-1;for(;st>=0;){at=tt.findIndex((lt,ct)=>{var ut;return ct>=ot&&((ut=lt.endSeparator)==null?void 0:ut.includes(" "))&<.endSeparator!==" / "}),at===-1&&(at=tt.length-1);for(let lt=at;lt>=ot;lt-=1)it[lt]=st,rt[st]=lt,st-=1;ot=at+1}return tt.forEach((lt,ct)=>{const ut=it[ct],ht=ut===0?null:rt[ut-1],dt=ut===tt.length-1?null:rt[ut+1];nt[ct]={leftIndex:ht,rightIndex:dt}}),{neighbors:nt,startIndex:rt[0],endIndex:rt[tt.length-1]}},_excluded$D=["value","referenceDate"],singleItemValueManager={emptyValue:null,getTodayValue:getTodayDate,getInitialReferenceValue:tt=>{let{value:et,referenceDate:nt}=tt,rt=_objectWithoutPropertiesLoose$k(tt,_excluded$D);return et!=null&&rt.utils.isValid(et)?et:nt??getDefaultReferenceDate(rt)},cleanValue:replaceInvalidDateByNull,areValuesEqual:areDatesEqual$1,isSameError:(tt,et)=>tt===et,hasError:tt=>tt!=null,defaultErrorState:null,getTimezone:(tt,et)=>et==null||!tt.isValid(et)?null:tt.getTimezone(et),setTimezone:(tt,et,nt)=>nt==null?null:tt.setTimezone(nt,et)},singleItemFieldValueManager={updateReferenceValue:(tt,et,nt)=>et==null||!tt.isValid(et)?nt:et,getSectionsFromValue:(tt,et,nt,rt,it)=>!tt.isValid(et)&&!!nt?nt:addPositionPropertiesToSections(it(et),rt),getValueStrFromSections:createDateStrForInputFromSections,getActiveDateManager:(tt,et)=>({date:et.value,referenceDate:et.referenceValue,getSections:nt=>nt,getNewValuesFromNewActiveDate:nt=>({value:nt,referenceValue:nt==null||!tt.isValid(nt)?et.referenceValue:nt})}),parseValueStr:(tt,et,nt)=>nt(tt.trim(),et)},uncapitalizeObjectKeys=tt=>{if(tt!==void 0)return Object.keys(tt).reduce((et,nt)=>_extends$u({},et,{[`${nt.slice(0,1).toLowerCase()}${nt.slice(1)}`]:tt[nt]}),{})};function getPickersDayUtilityClass(tt){return generateUtilityClass("MuiPickersDay",tt)}const pickersDayClasses=generateUtilityClasses("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),_excluded$C=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],useUtilityClasses$e=tt=>{const{selected:et,disableMargin:nt,disableHighlightToday:rt,today:it,disabled:ot,outsideCurrentMonth:at,showDaysOutsideCurrentMonth:st,classes:lt}=tt,ct=at&&!st;return composeClasses({root:["root",et&&!ct&&"selected",ot&&"disabled",!nt&&"dayWithMargin",!rt&&it&&"today",at&&st&&"dayOutsideMonth",ct&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},getPickersDayUtilityClass,lt)},styleArg=({theme:tt,ownerState:et})=>_extends$u({},tt.typography.caption,{width:DAY_SIZE,height:DAY_SIZE,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.short}),color:(tt.vars||tt).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.focusOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.focusOpacity),[`&.${pickersDayClasses.selected}`]:{willChange:"background-color",backgroundColor:(tt.vars||tt).palette.primary.dark}},[`&.${pickersDayClasses.selected}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.main,fontWeight:tt.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(tt.vars||tt).palette.primary.dark}},[`&.${pickersDayClasses.disabled}:not(.${pickersDayClasses.selected})`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${pickersDayClasses.disabled}&.${pickersDayClasses.selected}`]:{opacity:.6}},!et.disableMargin&&{margin:`0 ${DAY_MARGIN}px`},et.outsideCurrentMonth&&et.showDaysOutsideCurrentMonth&&{color:(tt.vars||tt).palette.text.secondary},!et.disableHighlightToday&&et.today&&{[`&:not(.${pickersDayClasses.selected})`]:{border:`1px solid ${(tt.vars||tt).palette.text.secondary}`}}),overridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disableMargin&&et.dayWithMargin,!nt.disableHighlightToday&&nt.today&&et.today,!nt.outsideCurrentMonth&&nt.showDaysOutsideCurrentMonth&&et.dayOutsideMonth,nt.outsideCurrentMonth&&!nt.showDaysOutsideCurrentMonth&&et.hiddenDaySpacingFiller]},PickersDayRoot=styled$1(ButtonBase$1,{name:"MuiPickersDay",slot:"Root",overridesResolver})(styleArg),PickersDayFiller=styled$1("div",{name:"MuiPickersDay",slot:"Root",overridesResolver})(({theme:tt,ownerState:et})=>_extends$u({},styleArg({theme:tt,ownerState:et}),{opacity:0,pointerEvents:"none"})),noop$5=()=>{},PickersDayRaw=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiPickersDay"}),{autoFocus:it=!1,className:ot,day:at,disabled:st=!1,disableHighlightToday:lt=!1,disableMargin:ct=!1,isAnimating:ut,onClick:ht,onDaySelect:dt,onFocus:pt=noop$5,onBlur:mt=noop$5,onKeyDown:gt=noop$5,onMouseDown:yt=noop$5,onMouseEnter:bt=noop$5,outsideCurrentMonth:wt,selected:xt=!1,showDaysOutsideCurrentMonth:kt=!1,children:St,today:Tt=!1}=rt,At=_objectWithoutPropertiesLoose$k(rt,_excluded$C),Et=_extends$u({},rt,{autoFocus:it,disabled:st,disableHighlightToday:lt,disableMargin:ct,selected:xt,showDaysOutsideCurrentMonth:kt,today:Tt}),Ct=useUtilityClasses$e(Et),Lt=useUtils(),jt=reactExports.useRef(null),Rt=useForkRef(jt,nt);useEnhancedEffect$1(()=>{it&&!st&&!ut&&!wt&&jt.current.focus()},[it,st,ut,wt]);const $t=It=>{yt(It),wt&&It.preventDefault()},vt=It=>{st||dt(at),wt&&It.currentTarget.focus(),ht&&ht(It)};return wt&&!kt?jsxRuntimeExports.jsx(PickersDayFiller,{className:clsx(Ct.root,Ct.hiddenDaySpacingFiller,ot),ownerState:Et,role:At.role}):jsxRuntimeExports.jsx(PickersDayRoot,_extends$u({className:clsx(Ct.root,ot),ref:Rt,centerRipple:!0,disabled:st,tabIndex:xt?0:-1,onKeyDown:It=>gt(It,at),onFocus:It=>pt(It,at),onBlur:It=>mt(It,at),onMouseEnter:It=>bt(It,at),onClick:vt,onMouseDown:$t},At,{ownerState:Et,children:St||Lt.format(at,"dayOfMonth")}))}),PickersDay=reactExports.memo(PickersDayRaw);function useValidation(tt,et,nt,rt){const{value:it,onError:ot}=tt,at=useLocalizationContext(),st=reactExports.useRef(rt),lt=et({adapter:at,value:it,props:tt});return reactExports.useEffect(()=>{ot&&!nt(lt,st.current)&&ot(lt,it),st.current=lt},[nt,ot,st,lt,it]),lt}const useFieldState=tt=>{const et=useUtils(),nt=useLocaleText(),rt=useLocalizationContext(),ot=useTheme().direction==="rtl",{valueManager:at,fieldValueManager:st,valueType:lt,validator:ct,internalProps:ut,internalProps:{value:ht,defaultValue:dt,referenceDate:pt,onChange:mt,format:gt,formatDensity:yt="dense",selectedSections:bt,onSelectedSectionsChange:wt,shouldRespectLeadingZeros:xt=!1,timezone:kt}}=tt,{timezone:St,value:Tt,handleValueChange:At}=useValueWithTimezone({timezone:kt,value:ht,defaultValue:dt,onChange:mt,valueManager:at}),Et=reactExports.useMemo(()=>getSectionsBoundaries(et,St),[et,St]),Ct=reactExports.useCallback((Qt,an=null)=>st.getSectionsFromValue(et,Qt,an,ot,Yt=>splitFormatIntoSections(et,St,nt,gt,Yt,yt,xt,ot)),[st,gt,nt,ot,xt,et,yt,St]),Lt=reactExports.useMemo(()=>st.getValueStrFromSections(Ct(at.emptyValue),ot),[st,Ct,at.emptyValue,ot]),[jt,Rt]=reactExports.useState(()=>{const Qt=Ct(Tt),an={sections:Qt,value:Tt,referenceValue:at.emptyValue,tempValueStrAndroid:null},Yt=getSectionTypeGranularity(Qt),nn=at.getInitialReferenceValue({referenceDate:pt,value:Tt,utils:et,props:ut,granularity:Yt,timezone:St});return _extends$u({},an,{referenceValue:nn})}),[$t,vt]=useControlled({controlled:bt,default:null,name:"useField",state:"selectedSectionIndexes"}),It=Qt=>{vt(Qt),wt==null||wt(Qt),Rt(an=>_extends$u({},an,{selectedSectionQuery:null}))},Ot=reactExports.useMemo(()=>{if($t==null)return null;if($t==="all")return{startIndex:0,endIndex:jt.sections.length-1,shouldSelectBoundarySelectors:!0};if(typeof $t=="number")return{startIndex:$t,endIndex:$t};if(typeof $t=="string"){const Qt=jt.sections.findIndex(an=>an.type===$t);return{startIndex:Qt,endIndex:Qt}}return $t},[$t,jt.sections]),Wt=({value:Qt,referenceValue:an,sections:Yt})=>{if(Rt(tn=>_extends$u({},tn,{sections:Yt,value:Qt,referenceValue:an,tempValueStrAndroid:null})),at.areValuesEqual(et,jt.value,Qt))return;const nn={validationError:ct({adapter:rt,value:Qt,props:_extends$u({},ut,{value:Qt,timezone:St})})};At(Qt,nn)},zt=(Qt,an)=>{const Yt=[...jt.sections];return Yt[Qt]=_extends$u({},Yt[Qt],{value:an,modified:!0}),addPositionPropertiesToSections(Yt,ot)},Ft=()=>{Wt({value:at.emptyValue,referenceValue:jt.referenceValue,sections:Ct(at.emptyValue)})},Nt=()=>{if(Ot==null)return;const Qt=jt.sections[Ot.startIndex],an=st.getActiveDateManager(et,jt,Qt),nn=an.getSections(jt.sections).filter(rn=>rn.value!=="").length===(Qt.value===""?0:1),tn=zt(Ot.startIndex,""),dn=nn?null:et.date(new Date("")),wn=an.getNewValuesFromNewActiveDate(dn);(dn!=null&&!et.isValid(dn))!=(an.date!=null&&!et.isValid(an.date))?Wt(_extends$u({},wn,{sections:tn})):Rt(rn=>_extends$u({},rn,wn,{sections:tn,tempValueStrAndroid:null}))},Ut=Qt=>{const an=(tn,dn)=>{const wn=et.parse(tn,gt);if(wn==null||!et.isValid(wn))return null;const rn=splitFormatIntoSections(et,St,nt,gt,wn,yt,xt,ot);return mergeDateIntoReferenceDate(et,St,wn,rn,dn,!1)},Yt=st.parseValueStr(Qt,jt.referenceValue,an),nn=st.updateReferenceValue(et,Yt,jt.referenceValue);Wt({value:Yt,referenceValue:nn,sections:Ct(Yt,jt.sections)})},Pt=({activeSection:Qt,newSectionValue:an,shouldGoToNextSection:Yt})=>{Yt&&Ot&&Ot.startIndex_extends$u({},vn,rn,{sections:tn,tempValueStrAndroid:null}))},Ht=Qt=>Rt(an=>_extends$u({},an,{tempValueStrAndroid:Qt}));return reactExports.useEffect(()=>{const Qt=Ct(jt.value);Rt(an=>_extends$u({},an,{sections:Qt}))},[gt,et.locale]),reactExports.useEffect(()=>{let Qt=!1;at.areValuesEqual(et,jt.value,Tt)?Qt=at.getTimezone(et,jt.value)!==at.getTimezone(et,Tt):Qt=!0,Qt&&Rt(an=>_extends$u({},an,{value:Tt,referenceValue:st.updateReferenceValue(et,Tt,an.referenceValue),sections:Ct(Tt)}))},[Tt]),{state:jt,selectedSectionIndexes:Ot,setSelectedSections:It,clearValue:Ft,clearActiveSection:Nt,updateSectionValue:Pt,updateValueFromValueStr:Ut,setTempAndroidValueStr:Ht,sectionsValueBoundaries:Et,placeholder:Lt,timezone:St}},QUERY_LIFE_DURATION_MS=5e3,isQueryResponseWithoutValue=tt=>tt.saveQuery!=null,useFieldCharacterEditing=({sections:tt,updateSectionValue:et,sectionsValueBoundaries:nt,setTempAndroidValueStr:rt,timezone:it})=>{const ot=useUtils(),[at,st]=reactExports.useState(null),lt=useEventCallback(()=>st(null));reactExports.useEffect(()=>{var pt;at!=null&&((pt=tt[at.sectionIndex])==null?void 0:pt.type)!==at.sectionType&<()},[tt,at,lt]),reactExports.useEffect(()=>{if(at!=null){const pt=setTimeout(()=>lt(),QUERY_LIFE_DURATION_MS);return()=>{window.clearTimeout(pt)}}return()=>{}},[at,lt]);const ct=({keyPressed:pt,sectionIndex:mt},gt,yt)=>{const bt=pt.toLowerCase(),wt=tt[mt];if(at!=null&&(!yt||yt(at.value))&&at.sectionIndex===mt){const kt=`${at.value}${bt}`,St=gt(kt,wt);if(!isQueryResponseWithoutValue(St))return st({sectionIndex:mt,value:kt,sectionType:wt.type}),St}const xt=gt(bt,wt);return isQueryResponseWithoutValue(xt)&&!xt.saveQuery?(lt(),null):(st({sectionIndex:mt,value:bt,sectionType:wt.type}),isQueryResponseWithoutValue(xt)?null:xt)},ut=pt=>{const mt=(bt,wt,xt)=>{const kt=wt.filter(St=>St.toLowerCase().startsWith(xt));return kt.length===0?{saveQuery:!1}:{sectionValue:kt[0],shouldGoToNextSection:kt.length===1}},gt=(bt,wt,xt,kt)=>{const St=Tt=>getLetterEditingOptions(ot,it,wt.type,Tt);if(wt.contentType==="letter")return mt(wt.format,St(wt.format),bt);if(xt&&kt!=null&&getDateSectionConfigFromFormatToken(ot,xt).contentType==="letter"){const Tt=St(xt),At=mt(xt,Tt,bt);return isQueryResponseWithoutValue(At)?{saveQuery:!1}:_extends$u({},At,{sectionValue:kt(At.sectionValue,Tt)})}return{saveQuery:!1}};return ct(pt,(bt,wt)=>{switch(wt.type){case"month":{const xt=kt=>changeSectionValueFormat(ot,kt,ot.formats.month,wt.format);return gt(bt,wt,ot.formats.month,xt)}case"weekDay":{const xt=(kt,St)=>St.indexOf(kt).toString();return gt(bt,wt,ot.formats.weekday,xt)}case"meridiem":return gt(bt,wt);default:return{saveQuery:!1}}})},ht=pt=>{const mt=(yt,bt)=>{const wt=+`${yt}`,xt=nt[bt.type]({currentDate:null,format:bt.format,contentType:bt.contentType});if(wt>xt.maximum)return{saveQuery:!1};if(wtxt.maximum||yt.length===xt.maximum.toString().length;return{sectionValue:cleanDigitSectionValue(ot,it,wt,xt,bt),shouldGoToNextSection:kt}};return ct(pt,(yt,bt)=>{if(bt.contentType==="digit"||bt.contentType==="digit-with-letter")return mt(yt,bt);if(bt.type==="month"){const wt=doesSectionFormatHaveLeadingZeros(ot,it,"digit","month","MM"),xt=mt(yt,{type:bt.type,format:"MM",hasLeadingZerosInFormat:wt,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(isQueryResponseWithoutValue(xt))return xt;const kt=changeSectionValueFormat(ot,xt.sectionValue,"MM",bt.format);return _extends$u({},xt,{sectionValue:kt})}if(bt.type==="weekDay"){const wt=mt(yt,bt);if(isQueryResponseWithoutValue(wt))return wt;const xt=getDaysInWeekStr(ot,it,bt.format)[Number(wt.sectionValue)-1];return _extends$u({},wt,{sectionValue:xt})}return{saveQuery:!1}},yt=>!Number.isNaN(Number(yt)))};return{applyCharacterEditing:useEventCallback(pt=>{const mt=tt[pt.sectionIndex],yt=!Number.isNaN(Number(pt.keyPressed))?ht(pt):ut(pt);yt==null?rt(null):et({activeSection:mt,newSectionValue:yt.sectionValue,shouldGoToNextSection:yt.shouldGoToNextSection})}),resetCharacterQuery:lt}};function arrayIncludes$2(tt,et){return Array.isArray(et)?et.every(nt=>tt.indexOf(nt)!==-1):tt.indexOf(et)!==-1}const onSpaceOrEnter=(tt,et)=>nt=>{(nt.key==="Enter"||nt.key===" ")&&(tt(nt),nt.preventDefault(),nt.stopPropagation()),et&&et(nt)},getActiveElement=(tt=document)=>{const et=tt.activeElement;return et?et.shadowRoot?getActiveElement(et.shadowRoot):et:null},DEFAULT_DESKTOP_MODE_MEDIA_QUERY="@media (pointer: fine)",_excluded$B=["onClick","onKeyDown","onFocus","onBlur","onMouseUp","onPaste","error","clearable","onClear","disabled"],useField=tt=>{const et=useUtils(),{state:nt,selectedSectionIndexes:rt,setSelectedSections:it,clearValue:ot,clearActiveSection:at,updateSectionValue:st,updateValueFromValueStr:lt,setTempAndroidValueStr:ct,sectionsValueBoundaries:ut,placeholder:ht,timezone:dt}=useFieldState(tt),{inputRef:pt,internalProps:mt,internalProps:{readOnly:gt=!1,unstableFieldRef:yt,minutesStep:bt},forwardedProps:{onClick:wt,onKeyDown:xt,onFocus:kt,onBlur:St,onMouseUp:Tt,onPaste:At,error:Et,clearable:Ct,onClear:Lt,disabled:jt},fieldValueManager:Rt,valueManager:$t,validator:vt}=tt,It=_objectWithoutPropertiesLoose$k(tt.forwardedProps,_excluded$B),{applyCharacterEditing:Ot,resetCharacterQuery:Wt}=useFieldCharacterEditing({sections:nt.sections,updateSectionValue:st,sectionsValueBoundaries:ut,setTempAndroidValueStr:ct,timezone:dt}),zt=reactExports.useRef(null),Ft=useForkRef(pt,zt),Nt=reactExports.useRef(void 0),Pt=useTheme().direction==="rtl",Ht=reactExports.useMemo(()=>getSectionOrder(nt.sections,Pt),[nt.sections,Pt]),Qt=()=>{var Tn;if(gt){it(null);return}const In=(Tn=zt.current.selectionStart)!=null?Tn:0;let yn;In<=nt.sections[0].startInInput||In>=nt.sections[nt.sections.length-1].endInInput?yn=1:yn=nt.sections.findIndex(fn=>fn.startInInput-fn.startSeparator.length>In);const hn=yn===-1?nt.sections.length-1:yn-1;it(hn)},an=useEventCallback((Tn,...In)=>{Tn.isDefaultPrevented()||(wt==null||wt(Tn,...In),Qt())}),Yt=useEventCallback(Tn=>{Tt==null||Tt(Tn),Tn.preventDefault()}),nn=useEventCallback((...Tn)=>{kt==null||kt(...Tn);const In=zt.current;window.clearTimeout(Nt.current),Nt.current=setTimeout(()=>{!In||In!==zt.current||rt!=null||gt||(In.value.length&&Number(In.selectionEnd)-Number(In.selectionStart)===In.value.length?it("all"):Qt())})}),tn=useEventCallback((...Tn)=>{St==null||St(...Tn),it(null)}),dn=useEventCallback(Tn=>{if(At==null||At(Tn),gt){Tn.preventDefault();return}const In=Tn.clipboardData.getData("text");if(rt&&rt.startIndex===rt.endIndex){const yn=nt.sections[rt.startIndex],hn=/^[a-zA-Z]+$/.test(In),fn=/^[0-9]+$/.test(In),xn=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(In);if(yn.contentType==="letter"&&hn||yn.contentType==="digit"&&fn||yn.contentType==="digit-with-letter"&&xn)return;if(hn||fn){Tn.preventDefault();return}}Tn.preventDefault(),Wt(),lt(In)}),wn=useEventCallback(Tn=>{if(gt)return;const In=Tn.target.value;if(In===""){Wt(),ot();return}const yn=Tn.nativeEvent.data,hn=yn&&yn.length>1,fn=hn?yn:In,xn=cleanString(fn);if(rt==null||hn){lt(hn?yn:xn);return}let jn;if(rt.startIndex===0&&rt.endIndex===nt.sections.length-1&&xn.length===1)jn=xn;else{const cn=cleanString(Rt.getValueStrFromSections(nt.sections,Pt));let Xt=-1,Kt=-1;for(let Bn=0;Bnkn.end)return;const On=xn.length-cn.length+kn.end-cleanString(kn.endSeparator||"").length;jn=xn.slice(kn.start+cleanString(kn.startSeparator||"").length,On)}if(jn.length===0){isAndroid()?ct(fn):(Wt(),at());return}Ot({keyPressed:jn,sectionIndex:rt.startIndex})}),rn=useEventCallback(Tn=>{switch(xt==null||xt(Tn),!0){case(Tn.key==="a"&&(Tn.ctrlKey||Tn.metaKey)):{Tn.preventDefault(),it("all");break}case Tn.key==="ArrowRight":{if(Tn.preventDefault(),rt==null)it(Ht.startIndex);else if(rt.startIndex!==rt.endIndex)it(rt.endIndex);else{const In=Ht.neighbors[rt.startIndex].rightIndex;In!==null&&it(In)}break}case Tn.key==="ArrowLeft":{if(Tn.preventDefault(),rt==null)it(Ht.endIndex);else if(rt.startIndex!==rt.endIndex)it(rt.startIndex);else{const In=Ht.neighbors[rt.startIndex].leftIndex;In!==null&&it(In)}break}case Tn.key==="Delete":{if(Tn.preventDefault(),gt)break;rt==null||rt.startIndex===0&&rt.endIndex===nt.sections.length-1?ot():at(),Wt();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(Tn.key):{if(Tn.preventDefault(),gt||rt==null)break;const In=nt.sections[rt.startIndex],yn=Rt.getActiveDateManager(et,nt,In),hn=adjustSectionValue(et,dt,In,Tn.key,ut,yn.date,{minutesStep:bt});st({activeSection:In,newSectionValue:hn,shouldGoToNextSection:!1});break}}});useEnhancedEffect$1(()=>{if(!zt.current)return;if(rt==null){zt.current.scrollLeft&&(zt.current.scrollLeft=0);return}const Tn=nt.sections[rt.startIndex],In=nt.sections[rt.endIndex];let yn=Tn.startInInput,hn=In.endInInput;if(rt.shouldSelectBoundarySelectors&&(yn-=Tn.startSeparator.length,hn+=In.endSeparator.length),yn!==zt.current.selectionStart||hn!==zt.current.selectionEnd){const fn=zt.current.scrollTop;zt.current===getActiveElement(document)&&zt.current.setSelectionRange(yn,hn),zt.current.scrollTop=fn}});const Jt=useValidation(_extends$u({},mt,{value:nt.value,timezone:dt}),vt,$t.isSameError,$t.defaultErrorState),vn=reactExports.useMemo(()=>Et!==void 0?Et:$t.hasError(Jt),[$t,Jt,Et]);reactExports.useEffect(()=>{!vn&&!rt&&Wt()},[nt.referenceValue,rt,vn]),reactExports.useEffect(()=>(zt.current&&zt.current===document.activeElement&&it("all"),()=>window.clearTimeout(Nt.current)),[]),reactExports.useEffect(()=>{nt.tempValueStrAndroid!=null&&rt!=null&&(Wt(),at())},[nt.tempValueStrAndroid]);const Cn=reactExports.useMemo(()=>{var Tn;return(Tn=nt.tempValueStrAndroid)!=null?Tn:Rt.getValueStrFromSections(nt.sections,Pt)},[nt.sections,Rt,nt.tempValueStrAndroid,Pt]),$n=reactExports.useMemo(()=>rt==null||nt.sections[rt.startIndex].contentType==="letter"?"text":"numeric",[rt,nt.sections]),Nn=zt.current&&zt.current===getActiveElement(document),En=$t.areValuesEqual(et,nt.value,$t.emptyValue),sn=!Nn&&En;reactExports.useImperativeHandle(yt,()=>({getSections:()=>nt.sections,getActiveSectionIndex:()=>{var Tn,In;const yn=(Tn=zt.current.selectionStart)!=null?Tn:0,hn=(In=zt.current.selectionEnd)!=null?In:0;if(yn===0&&hn===0)return null;const fn=yn<=nt.sections[0].startInInput?1:nt.sections.findIndex(xn=>xn.startInInput-xn.startSeparator.length>yn);return fn===-1?nt.sections.length-1:fn-1},setSelectedSections:Tn=>it(Tn)}));const pn=useEventCallback((Tn,...In)=>{var yn;Tn.preventDefault(),Lt==null||Lt(Tn,...In),ot(),zt==null||(yn=zt.current)==null||yn.focus(),it(0)});return _extends$u({placeholder:ht,autoComplete:"off",disabled:!!jt},It,{value:sn?"":Cn,inputMode:$n,readOnly:gt,onClick:an,onFocus:nn,onBlur:tn,onPaste:dn,onChange:wn,onKeyDown:rn,onMouseUp:Yt,onClear:pn,error:vn,ref:Ft,clearable:!!(Ct&&!En&&!gt&&!jt)})},validateDate=({props:tt,value:et,adapter:nt})=>{if(et===null)return null;const{shouldDisableDate:rt,shouldDisableMonth:it,shouldDisableYear:ot,disablePast:at,disableFuture:st,timezone:lt}=tt,ct=nt.utils.dateWithTimezone(void 0,lt),ut=applyDefaultDate(nt.utils,tt.minDate,nt.defaultDates.minDate),ht=applyDefaultDate(nt.utils,tt.maxDate,nt.defaultDates.maxDate);switch(!0){case!nt.utils.isValid(et):return"invalidDate";case!!(rt&&rt(et)):return"shouldDisableDate";case!!(it&&it(et)):return"shouldDisableMonth";case!!(ot&&ot(et)):return"shouldDisableYear";case!!(st&&nt.utils.isAfterDay(et,ct)):return"disableFuture";case!!(at&&nt.utils.isBeforeDay(et,ct)):return"disablePast";case!!(ut&&nt.utils.isBeforeDay(et,ut)):return"minDate";case!!(ht&&nt.utils.isAfterDay(et,ht)):return"maxDate";default:return null}},DATE_VALIDATION_PROP_NAMES=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],TIME_VALIDATION_PROP_NAMES=["disablePast","disableFuture","minTime","maxTime","shouldDisableClock","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],DATE_TIME_VALIDATION_PROP_NAMES=["minDateTime","maxDateTime"],VALIDATION_PROP_NAMES=[...DATE_VALIDATION_PROP_NAMES,...TIME_VALIDATION_PROP_NAMES,...DATE_TIME_VALIDATION_PROP_NAMES],extractValidationProps=tt=>VALIDATION_PROP_NAMES.reduce((et,nt)=>(tt.hasOwnProperty(nt)&&(et[nt]=tt[nt]),et),{}),SHARED_FIELD_INTERNAL_PROP_NAMES=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","readOnly","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef"],splitFieldInternalAndForwardedProps=(tt,et)=>{const nt=_extends$u({},tt),rt={},it=ot=>{nt.hasOwnProperty(ot)&&(rt[ot]=nt[ot],delete nt[ot])};return SHARED_FIELD_INTERNAL_PROP_NAMES.forEach(it),et==="date"?DATE_VALIDATION_PROP_NAMES.forEach(it):et==="time"?TIME_VALIDATION_PROP_NAMES.forEach(it):et==="date-time"&&(DATE_VALIDATION_PROP_NAMES.forEach(it),TIME_VALIDATION_PROP_NAMES.forEach(it),DATE_TIME_VALIDATION_PROP_NAMES.forEach(it)),{forwardedProps:nt,internalProps:rt}},useDefaultizedDateField=tt=>{var et,nt,rt;const it=useUtils(),ot=useDefaultDates();return _extends$u({},tt,{disablePast:(et=tt.disablePast)!=null?et:!1,disableFuture:(nt=tt.disableFuture)!=null?nt:!1,format:(rt=tt.format)!=null?rt:it.formats.keyboardDate,minDate:applyDefaultDate(it,tt.minDate,ot.minDate),maxDate:applyDefaultDate(it,tt.maxDate,ot.maxDate)})},useDateField=({props:tt,inputRef:et})=>{const nt=useDefaultizedDateField(tt),{forwardedProps:rt,internalProps:it}=splitFieldInternalAndForwardedProps(nt,"date");return useField({inputRef:et,forwardedProps:rt,internalProps:it,valueManager:singleItemValueManager,fieldValueManager:singleItemFieldValueManager,validator:validateDate,valueType:"date"})},PickersModalDialogRoot=styled$1(MuiDialog)({[`& .${dialogClasses$1.container}`]:{outline:0},[`& .${dialogClasses$1.paper}`]:{outline:0,minWidth:DIALOG_WIDTH}}),PickersModalDialogContent=styled$1(DialogContent$1)({"&:first-of-type":{padding:0}});function PickersModalDialog(tt){var et,nt;const{children:rt,onDismiss:it,open:ot,slots:at,slotProps:st}=tt,lt=(et=at==null?void 0:at.dialog)!=null?et:PickersModalDialogRoot,ct=(nt=at==null?void 0:at.mobileTransition)!=null?nt:Fade$1;return jsxRuntimeExports.jsx(lt,_extends$u({open:ot,onClose:it},st==null?void 0:st.dialog,{TransitionComponent:ct,TransitionProps:st==null?void 0:st.mobileTransition,PaperComponent:at==null?void 0:at.mobilePaper,PaperProps:st==null?void 0:st.mobilePaper,children:jsxRuntimeExports.jsx(PickersModalDialogContent,{children:rt})}))}function getPickersPopperUtilityClass(tt){return generateUtilityClass("MuiPickersPopper",tt)}generateUtilityClasses("MuiPickersPopper",["root","paper"]);const PREFERS_REDUCED_MOTION="@media (prefers-reduced-motion: reduce)",mobileVersionMatches=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),androidVersion=mobileVersionMatches&&mobileVersionMatches[1]?parseInt(mobileVersionMatches[1],10):null,iOSVersion=mobileVersionMatches&&mobileVersionMatches[2]?parseInt(mobileVersionMatches[2],10):null,slowAnimationDevices=androidVersion&&androidVersion<10||iOSVersion&&iOSVersion<13||!1,useDefaultReduceAnimations=()=>useMediaQuery(PREFERS_REDUCED_MOTION,{defaultMatches:!1})||slowAnimationDevices,_excluded$A=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],useUtilityClasses$d=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"]},getPickersPopperUtilityClass,et)},PickersPopperRoot=styled$1(MuiPopper,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(tt,et)=>et.root})(({theme:tt})=>({zIndex:tt.zIndex.modal})),PickersPopperPaper=styled$1(Paper$1,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(tt,et)=>et.paper})(({ownerState:tt})=>_extends$u({outline:0,transformOrigin:"top center"},tt.placement.includes("top")&&{transformOrigin:"bottom center"}));function clickedRootScrollbar(tt,et){return et.documentElement.clientWidth{if(!tt)return;function lt(){ot.current=!0}return document.addEventListener("mousedown",lt,!0),document.addEventListener("touchstart",lt,!0),()=>{document.removeEventListener("mousedown",lt,!0),document.removeEventListener("touchstart",lt,!0),ot.current=!1}},[tt]);const at=useEventCallback(lt=>{if(!ot.current)return;const ct=rt.current;rt.current=!1;const ut=ownerDocument(it.current);if(!it.current||"clientX"in lt&&clickedRootScrollbar(lt,ut))return;if(nt.current){nt.current=!1;return}let ht;lt.composedPath?ht=lt.composedPath().indexOf(it.current)>-1:ht=!ut.documentElement.contains(lt.target)||it.current.contains(lt.target),!ht&&!ct&&et(lt)}),st=()=>{rt.current=!0};return reactExports.useEffect(()=>{if(tt){const lt=ownerDocument(it.current),ct=()=>{nt.current=!0};return lt.addEventListener("touchstart",at),lt.addEventListener("touchmove",ct),()=>{lt.removeEventListener("touchstart",at),lt.removeEventListener("touchmove",ct)}}},[tt,at]),reactExports.useEffect(()=>{if(tt){const lt=ownerDocument(it.current);return lt.addEventListener("click",at),()=>{lt.removeEventListener("click",at),rt.current=!1}}},[tt,at]),[it,st,st]}const PickersPopperPaperWrapper=reactExports.forwardRef((tt,et)=>{const{PaperComponent:nt,popperPlacement:rt,ownerState:it,children:ot,paperSlotProps:at,paperClasses:st,onPaperClick:lt,onPaperTouchStart:ct}=tt,ut=_objectWithoutPropertiesLoose$k(tt,_excluded$A),ht=_extends$u({},it,{placement:rt}),dt=useSlotProps({elementType:nt,externalSlotProps:at,additionalProps:{tabIndex:-1,elevation:8,ref:et},className:st,ownerState:ht});return jsxRuntimeExports.jsx(nt,_extends$u({},ut,dt,{onClick:pt=>{var mt;lt(pt),(mt=dt.onClick)==null||mt.call(dt,pt)},onTouchStart:pt=>{var mt;ct(pt),(mt=dt.onTouchStart)==null||mt.call(dt,pt)},ownerState:ht,children:ot}))});function PickersPopper(tt){var et,nt,rt,it;const ot=useThemeProps({props:tt,name:"MuiPickersPopper"}),{anchorEl:at,children:st,containerRef:lt=null,shouldRestoreFocus:ct,onBlur:ut,onDismiss:ht,open:dt,role:pt,placement:mt,slots:gt,slotProps:yt,reduceAnimations:bt}=ot;reactExports.useEffect(()=>{function Ft(Nt){dt&&(Nt.key==="Escape"||Nt.key==="Esc")&&ht()}return document.addEventListener("keydown",Ft),()=>{document.removeEventListener("keydown",Ft)}},[ht,dt]);const wt=reactExports.useRef(null);reactExports.useEffect(()=>{pt==="tooltip"||ct&&!ct()||(dt?wt.current=getActiveElement(document):wt.current&&wt.current instanceof HTMLElement&&setTimeout(()=>{wt.current instanceof HTMLElement&&wt.current.focus()}))},[dt,pt,ct]);const[xt,kt,St]=useClickAwayListener(dt,ut??ht),Tt=reactExports.useRef(null),At=useForkRef(Tt,lt),Et=useForkRef(At,xt),Ct=ot,Lt=useUtilityClasses$d(Ct),jt=useDefaultReduceAnimations(),Rt=bt??jt,$t=Ft=>{Ft.key==="Escape"&&(Ft.stopPropagation(),ht())},vt=((et=gt==null?void 0:gt.desktopTransition)!=null?et:Rt)?Fade$1:Grow$1,It=(nt=gt==null?void 0:gt.desktopTrapFocus)!=null?nt:FocusTrap,Ot=(rt=gt==null?void 0:gt.desktopPaper)!=null?rt:PickersPopperPaper,Wt=(it=gt==null?void 0:gt.popper)!=null?it:PickersPopperRoot,zt=useSlotProps({elementType:Wt,externalSlotProps:yt==null?void 0:yt.popper,additionalProps:{transition:!0,role:pt,open:dt,anchorEl:at,placement:mt,onKeyDown:$t},className:Lt.root,ownerState:ot});return jsxRuntimeExports.jsx(Wt,_extends$u({},zt,{children:({TransitionProps:Ft,placement:Nt})=>jsxRuntimeExports.jsx(It,_extends$u({open:dt,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:pt==="tooltip",isEnabled:()=>!0},yt==null?void 0:yt.desktopTrapFocus,{children:jsxRuntimeExports.jsx(vt,_extends$u({},Ft,yt==null?void 0:yt.desktopTransition,{children:jsxRuntimeExports.jsx(PickersPopperPaperWrapper,{PaperComponent:Ot,ownerState:Ct,popperPlacement:Nt,ref:Et,onPaperClick:kt,onPaperTouchStart:St,paperClasses:Lt.paper,paperSlotProps:yt==null?void 0:yt.desktopPaper,children:st})}))}))}))}function getPickersToolbarUtilityClass(tt){return generateUtilityClass("MuiPickersToolbar",tt)}generateUtilityClasses("MuiPickersToolbar",["root","content"]);const useUtilityClasses$c=tt=>{const{classes:et,isLandscape:nt}=tt;return composeClasses({root:["root"],content:["content"],penIconButton:["penIconButton",nt&&"penIconButtonLandscape"]},getPickersToolbarUtilityClass,et)},PickersToolbarRoot=styled$1("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(tt,et)=>et.root})(({theme:tt,ownerState:et})=>_extends$u({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:tt.spacing(2,3)},et.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),PickersToolbarContent=styled$1("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(tt,et)=>et.content})(({ownerState:tt})=>{var et;return{display:"flex",flexWrap:"wrap",width:"100%",justifyContent:tt.isLandscape?"flex-start":"space-between",flexDirection:tt.isLandscape?(et=tt.landscapeDirection)!=null?et:"column":"row",flex:1,alignItems:tt.isLandscape?"flex-start":"center"}}),PickersToolbar=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiPickersToolbar"}),{children:it,className:ot,toolbarTitle:at,hidden:st,titleId:lt}=rt,ct=rt,ut=useUtilityClasses$c(ct);return st?null:jsxRuntimeExports.jsxs(PickersToolbarRoot,{ref:nt,className:clsx(ut.root,ot),ownerState:ct,children:[jsxRuntimeExports.jsx(Typography$1,{color:"text.secondary",variant:"overline",id:lt,children:at}),jsxRuntimeExports.jsx(PickersToolbarContent,{className:ut.content,ownerState:ct,children:it})]})}),useOpenState=({open:tt,onOpen:et,onClose:nt})=>{const rt=reactExports.useRef(typeof tt=="boolean").current,[it,ot]=reactExports.useState(!1);reactExports.useEffect(()=>{if(rt){if(typeof tt!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");ot(tt)}},[rt,tt]);const at=reactExports.useCallback(st=>{rt||ot(st),st&&et&&et(),!st&&nt&&nt()},[rt,et,nt]);return{isOpen:it,setIsOpen:at}},shouldPublishValue=tt=>{const{action:et,hasChanged:nt,dateState:rt,isControlled:it}=tt,ot=!it&&!rt.hasBeenModifiedSinceMount;return et.name==="setValueFromField"?!0:et.name==="setValueFromAction"?ot&&["accept","today","clear"].includes(et.pickerAction)?!0:nt(rt.lastPublishedValue):et.name==="setValueFromView"&&et.selectionState!=="shallow"||et.name==="setValueFromShortcut"?ot?!0:nt(rt.lastPublishedValue):!1},shouldCommitValue=tt=>{const{action:et,hasChanged:nt,dateState:rt,isControlled:it,closeOnSelect:ot}=tt,at=!it&&!rt.hasBeenModifiedSinceMount;return et.name==="setValueFromAction"?at&&["accept","today","clear"].includes(et.pickerAction)?!0:nt(rt.lastCommittedValue):et.name==="setValueFromView"&&et.selectionState==="finish"&&ot?at?!0:nt(rt.lastCommittedValue):et.name==="setValueFromShortcut"?et.changeImportance==="accept"&&nt(rt.lastCommittedValue):!1},shouldClosePicker=tt=>{const{action:et,closeOnSelect:nt}=tt;return et.name==="setValueFromAction"?!0:et.name==="setValueFromView"?et.selectionState==="finish"&&nt:et.name==="setValueFromShortcut"?et.changeImportance==="accept":!1},usePickerValue=({props:tt,valueManager:et,valueType:nt,wrapperVariant:rt,validator:it})=>{const{onAccept:ot,onChange:at,value:st,defaultValue:lt,closeOnSelect:ct=rt==="desktop",selectedSections:ut,onSelectedSectionsChange:ht,timezone:dt}=tt,{current:pt}=reactExports.useRef(lt),{current:mt}=reactExports.useRef(st!==void 0),gt=useUtils(),yt=useLocalizationContext(),[bt,wt]=useControlled({controlled:ut,default:null,name:"usePickerValue",state:"selectedSections"}),{isOpen:xt,setIsOpen:kt}=useOpenState(tt),[St,Tt]=reactExports.useState(()=>{let nn;return st!==void 0?nn=st:pt!==void 0?nn=pt:nn=et.emptyValue,{draft:nn,lastPublishedValue:nn,lastCommittedValue:nn,lastControlledValue:st,hasBeenModifiedSinceMount:!1}}),{timezone:At,handleValueChange:Et}=useValueWithTimezone({timezone:dt,value:st,defaultValue:pt,onChange:at,valueManager:et});useValidation(_extends$u({},tt,{value:St.draft,timezone:At}),it,et.isSameError,et.defaultErrorState);const Ct=useEventCallback(nn=>{const tn={action:nn,dateState:St,hasChanged:Jt=>!et.areValuesEqual(gt,nn.value,Jt),isControlled:mt,closeOnSelect:ct},dn=shouldPublishValue(tn),wn=shouldCommitValue(tn),rn=shouldClosePicker(tn);if(Tt(Jt=>_extends$u({},Jt,{draft:nn.value,lastPublishedValue:dn?nn.value:Jt.lastPublishedValue,lastCommittedValue:wn?nn.value:Jt.lastCommittedValue,hasBeenModifiedSinceMount:!0})),dn){const vn={validationError:nn.name==="setValueFromField"?nn.context.validationError:it({adapter:yt,value:nn.value,props:_extends$u({},tt,{value:nn.value,timezone:At})})};nn.name==="setValueFromShortcut"&&nn.shortcut!=null&&(vn.shortcut=nn.shortcut),Et(nn.value,vn)}wn&&ot&&ot(nn.value),rn&&kt(!1)});if(st!==void 0&&(St.lastControlledValue===void 0||!et.areValuesEqual(gt,St.lastControlledValue,st))){const nn=et.areValuesEqual(gt,St.draft,st);Tt(tn=>_extends$u({},tn,{lastControlledValue:st},nn?{}:{lastCommittedValue:st,lastPublishedValue:st,draft:st,hasBeenModifiedSinceMount:!0}))}const Lt=useEventCallback(()=>{Ct({value:et.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),jt=useEventCallback(()=>{Ct({value:St.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),Rt=useEventCallback(()=>{Ct({value:St.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),$t=useEventCallback(()=>{Ct({value:St.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),vt=useEventCallback(()=>{Ct({value:et.getTodayValue(gt,At,nt),name:"setValueFromAction",pickerAction:"today"})}),It=useEventCallback(()=>kt(!0)),Ot=useEventCallback(()=>kt(!1)),Wt=useEventCallback((nn,tn="partial")=>Ct({name:"setValueFromView",value:nn,selectionState:tn})),zt=useEventCallback((nn,tn,dn)=>Ct({name:"setValueFromShortcut",value:nn,changeImportance:tn??"accept",shortcut:dn})),Ft=useEventCallback((nn,tn)=>Ct({name:"setValueFromField",value:nn,context:tn})),Nt=useEventCallback(nn=>{wt(nn),ht==null||ht(nn)}),Ut={onClear:Lt,onAccept:jt,onDismiss:Rt,onCancel:$t,onSetToday:vt,onOpen:It,onClose:Ot},Pt={value:St.draft,onChange:Ft,selectedSections:bt,onSelectedSectionsChange:Nt},Ht=reactExports.useMemo(()=>et.cleanValue(gt,St.draft),[gt,et,St.draft]),Qt={value:Ht,onChange:Wt,onClose:Ot,open:xt,onSelectedSectionsChange:Nt},Yt=_extends$u({},Ut,{value:Ht,onChange:Wt,onSelectShortcut:zt,isValid:nn=>{const tn=it({adapter:yt,value:nn,props:_extends$u({},tt,{value:nn,timezone:At})});return!et.hasError(tn)}});return{open:xt,fieldProps:Pt,viewProps:Qt,layoutProps:Yt,actions:Ut}},_excluded$z=["className","sx"],usePickerViews=({props:tt,propsFromPickerValue:et,additionalViewProps:nt,inputRef:rt,autoFocusView:it})=>{const{onChange:ot,open:at,onSelectedSectionsChange:st,onClose:lt}=et,{views:ct,openTo:ut,onViewChange:ht,disableOpenPicker:dt,viewRenderers:pt,timezone:mt}=tt,gt=_objectWithoutPropertiesLoose$k(tt,_excluded$z),{view:yt,setView:bt,defaultView:wt,focusedView:xt,setFocusedView:kt,setValueAndGoToNextView:St}=useViews({view:void 0,views:ct,openTo:ut,onChange:ot,onViewChange:ht,autoFocus:it}),{hasUIView:Tt,viewModeLookup:At}=reactExports.useMemo(()=>ct.reduce((vt,It)=>{let Ot;return dt?Ot="field":pt[It]!=null?Ot="UI":Ot="field",vt.viewModeLookup[It]=Ot,Ot==="UI"&&(vt.hasUIView=!0),vt},{hasUIView:!1,viewModeLookup:{}}),[dt,pt,ct]),Et=reactExports.useMemo(()=>ct.reduce((vt,It)=>pt[It]!=null&&isTimeView(It)?vt+1:vt,0),[pt,ct]),Ct=At[yt],Lt=useEventCallback(()=>Ct==="UI"),[jt,Rt]=reactExports.useState(Ct==="UI"?yt:null);return jt!==yt&&At[yt]==="UI"&&Rt(yt),useEnhancedEffect$1(()=>{Ct==="field"&&at&&(lt(),setTimeout(()=>{rt==null||rt.current.focus(),st(yt)}))},[yt]),useEnhancedEffect$1(()=>{if(!at)return;let vt=yt;Ct==="field"&&jt!=null&&(vt=jt),vt!==wt&&At[vt]==="UI"&&At[wt]==="UI"&&(vt=wt),vt!==yt&&bt(vt),kt(vt,!0)},[at]),{hasUIView:Tt,shouldRestoreFocus:Lt,layoutProps:{views:ct,view:jt,onViewChange:bt},renderCurrentView:()=>{if(jt==null)return null;const vt=pt[jt];return vt==null?null:vt(_extends$u({},gt,nt,et,{views:ct,timezone:mt,onChange:St,view:jt,onViewChange:bt,focusedView:xt,onFocusedViewChange:kt,showViewSwitcher:Et>1,timeViewsCount:Et}))}}};function getOrientation(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const useIsLandscape=(tt,et)=>{const[nt,rt]=reactExports.useState(getOrientation);return useEnhancedEffect$1(()=>{const ot=()=>{rt(getOrientation())};return window.addEventListener("orientationchange",ot),()=>{window.removeEventListener("orientationchange",ot)}},[]),arrayIncludes$2(tt,["hours","minutes","seconds"])?!1:(et||nt)==="landscape"},usePickerLayoutProps=({props:tt,propsFromPickerValue:et,propsFromPickerViews:nt,wrapperVariant:rt})=>{const{orientation:it}=tt,ot=useIsLandscape(nt.views,it);return{layoutProps:_extends$u({},nt,et,{isLandscape:ot,wrapperVariant:rt,disabled:tt.disabled,readOnly:tt.readOnly})}},buildWarning=(tt,et="warning")=>{let nt=!1;const rt=Array.isArray(tt)?tt.join(` -`):tt;return()=>{nt||(nt=!0,et==="error"?console.error(rt):console.warn(rt))}};buildWarning(["The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.","You can replace it with the `textField` component slot in most cases.","For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5)."]);const usePicker=({props:tt,valueManager:et,valueType:nt,wrapperVariant:rt,inputRef:it,additionalViewProps:ot,validator:at,autoFocusView:st})=>{const lt=usePickerValue({props:tt,valueManager:et,valueType:nt,wrapperVariant:rt,validator:at}),ct=usePickerViews({props:tt,inputRef:it,additionalViewProps:ot,autoFocusView:st,propsFromPickerValue:lt.viewProps}),ut=usePickerLayoutProps({props:tt,wrapperVariant:rt,propsFromPickerValue:lt.layoutProps,propsFromPickerViews:ct.layoutProps});return{open:lt.open,actions:lt.actions,fieldProps:lt.fieldProps,renderCurrentView:ct.renderCurrentView,hasUIView:ct.hasUIView,shouldRestoreFocus:ct.shouldRestoreFocus,layoutProps:ut.layoutProps}};function getPickersLayoutUtilityClass(tt){return generateUtilityClass("MuiPickersLayout",tt)}const pickersLayoutClasses=generateUtilityClasses("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","shortcuts"]),_excluded$y=["onAccept","onClear","onCancel","onSetToday","actions"];function PickersActionBar(tt){const{onAccept:et,onClear:nt,onCancel:rt,onSetToday:it,actions:ot}=tt,at=_objectWithoutPropertiesLoose$k(tt,_excluded$y),st=useLocaleText();if(ot==null||ot.length===0)return null;const lt=ot==null?void 0:ot.map(ct=>{switch(ct){case"clear":return jsxRuntimeExports.jsx(Button$2,{onClick:nt,children:st.clearButtonLabel},ct);case"cancel":return jsxRuntimeExports.jsx(Button$2,{onClick:rt,children:st.cancelButtonLabel},ct);case"accept":return jsxRuntimeExports.jsx(Button$2,{onClick:et,children:st.okButtonLabel},ct);case"today":return jsxRuntimeExports.jsx(Button$2,{onClick:it,children:st.todayButtonLabel},ct);default:return null}});return jsxRuntimeExports.jsx(DialogActions$1,_extends$u({},at,{children:lt}))}const _excluded$x=["items","changeImportance","isLandscape","onChange","isValid"],_excluded2$a=["getValue"];function PickersShortcuts(tt){const{items:et,changeImportance:nt,onChange:rt,isValid:it}=tt,ot=_objectWithoutPropertiesLoose$k(tt,_excluded$x);if(et==null||et.length===0)return null;const at=et.map(st=>{let{getValue:lt}=st,ct=_objectWithoutPropertiesLoose$k(st,_excluded2$a);const ut=lt({isValid:it});return{label:ct.label,onClick:()=>{rt(ut,nt,ct)},disabled:!it(ut)}});return jsxRuntimeExports.jsx(List$1,_extends$u({dense:!0,sx:[{maxHeight:VIEW_HEIGHT,maxWidth:200,overflow:"auto"},...Array.isArray(ot.sx)?ot.sx:[ot.sx]]},ot,{children:at.map(st=>jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(Chip$1,_extends$u({},st))},st.label))}))}function toolbarHasView(tt){return tt.view!==null}const useUtilityClasses$b=tt=>{const{classes:et,isLandscape:nt}=tt;return composeClasses({root:["root",nt&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},getPickersLayoutUtilityClass,et)},usePickerLayout=tt=>{var et,nt;const{wrapperVariant:rt,onAccept:it,onClear:ot,onCancel:at,onSetToday:st,view:lt,views:ct,onViewChange:ut,value:ht,onChange:dt,onSelectShortcut:pt,isValid:mt,isLandscape:gt,disabled:yt,readOnly:bt,children:wt,components:xt,componentsProps:kt,slots:St,slotProps:Tt}=tt,At=St??uncapitalizeObjectKeys(xt),Et=Tt??kt,Ct=useUtilityClasses$b(tt),Lt=(et=At==null?void 0:At.actionBar)!=null?et:PickersActionBar,jt=useSlotProps({elementType:Lt,externalSlotProps:Et==null?void 0:Et.actionBar,additionalProps:{onAccept:it,onClear:ot,onCancel:at,onSetToday:st,actions:rt==="desktop"?[]:["cancel","accept"],className:Ct.actionBar},ownerState:_extends$u({},tt,{wrapperVariant:rt})}),Rt=jsxRuntimeExports.jsx(Lt,_extends$u({},jt)),$t=At==null?void 0:At.toolbar,vt=useSlotProps({elementType:$t,externalSlotProps:Et==null?void 0:Et.toolbar,additionalProps:{isLandscape:gt,onChange:dt,value:ht,view:lt,onViewChange:ut,views:ct,disabled:yt,readOnly:bt,className:Ct.toolbar},ownerState:_extends$u({},tt,{wrapperVariant:rt})}),It=toolbarHasView(vt)&&$t?jsxRuntimeExports.jsx($t,_extends$u({},vt)):null,Ot=wt,Wt=At==null?void 0:At.tabs,zt=lt&&Wt?jsxRuntimeExports.jsx(Wt,_extends$u({view:lt,onViewChange:ut},Et==null?void 0:Et.tabs)):null,Ft=(nt=At==null?void 0:At.shortcuts)!=null?nt:PickersShortcuts,Nt=useSlotProps({elementType:Ft,externalSlotProps:Et==null?void 0:Et.shortcuts,additionalProps:{isValid:mt,isLandscape:gt,onChange:pt,className:Ct.shortcuts},ownerState:{isValid:mt,isLandscape:gt,onChange:pt,className:Ct.shortcuts,wrapperVariant:rt}}),Ut=lt&&Ft?jsxRuntimeExports.jsx(Ft,_extends$u({},Nt)):null;return{toolbar:It,content:Ot,tabs:zt,actionBar:Rt,shortcuts:Ut}},usePickerLayout$1=usePickerLayout,useUtilityClasses$a=tt=>{const{isLandscape:et,classes:nt}=tt;return composeClasses({root:["root",et&&"landscape"],contentWrapper:["contentWrapper"]},getPickersLayoutUtilityClass,nt)},PickersLayoutRoot=styled$1("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(tt,et)=>et.root})(({theme:tt,ownerState:et})=>({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${pickersLayoutClasses.toolbar}`]:et.isLandscape?{gridColumn:tt.direction==="rtl"?3:1,gridRow:"2 / 3"}:{gridColumn:"2 / 4",gridRow:1},[`.${pickersLayoutClasses.shortcuts}`]:et.isLandscape?{gridColumn:"2 / 4",gridRow:1}:{gridColumn:tt.direction==="rtl"?3:1,gridRow:"2 / 3"},[`& .${pickersLayoutClasses.actionBar}`]:{gridColumn:"1 / 4",gridRow:3}}));PickersLayoutRoot.propTypes={as:PropTypes.elementType,ownerState:PropTypes.shape({isLandscape:PropTypes.bool.isRequired}).isRequired,sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object])};const PickersLayoutContentWrapper=styled$1("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(tt,et)=>et.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),PickersLayout=function(et){const nt=useThemeProps({props:et,name:"MuiPickersLayout"}),{toolbar:rt,content:it,tabs:ot,actionBar:at,shortcuts:st}=usePickerLayout$1(nt),{sx:lt,className:ct,isLandscape:ut,ref:ht,wrapperVariant:dt}=nt,pt=nt,mt=useUtilityClasses$a(pt);return jsxRuntimeExports.jsxs(PickersLayoutRoot,{ref:ht,sx:lt,className:clsx(ct,mt.root),ownerState:pt,children:[ut?st:rt,ut?rt:st,jsxRuntimeExports.jsx(PickersLayoutContentWrapper,{className:mt.contentWrapper,children:dt==="desktop"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[it,ot]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ot,it]})}),at]})},getPickersSlideTransitionUtilityClass=tt=>generateUtilityClass("MuiPickersSlideTransition",tt),pickersSlideTransitionClasses=generateUtilityClasses("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),_excluded$w=["children","className","reduceAnimations","slideDirection","transKey","classes"],useUtilityClasses$9=tt=>{const{classes:et,slideDirection:nt}=tt,rt={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${nt}`],exitActive:[`slideExitActiveLeft-${nt}`]};return composeClasses(rt,getPickersSlideTransitionUtilityClass,et)},PickersSlideTransitionRoot=styled$1(TransitionGroup$1,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(tt,et)=>[et.root,{[`.${pickersSlideTransitionClasses["slideEnter-left"]}`]:et["slideEnter-left"]},{[`.${pickersSlideTransitionClasses["slideEnter-right"]}`]:et["slideEnter-right"]},{[`.${pickersSlideTransitionClasses.slideEnterActive}`]:et.slideEnterActive},{[`.${pickersSlideTransitionClasses.slideExit}`]:et.slideExit},{[`.${pickersSlideTransitionClasses["slideExitActiveLeft-left"]}`]:et["slideExitActiveLeft-left"]},{[`.${pickersSlideTransitionClasses["slideExitActiveLeft-right"]}`]:et["slideExitActiveLeft-right"]}]})(({theme:tt})=>{const et=tt.transitions.create("transform",{duration:tt.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${pickersSlideTransitionClasses["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${pickersSlideTransitionClasses["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${pickersSlideTransitionClasses.slideEnterActive}`]:{transform:"translate(0%)",transition:et},[`& .${pickersSlideTransitionClasses.slideExit}`]:{transform:"translate(0%)"},[`& .${pickersSlideTransitionClasses["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:et,zIndex:0},[`& .${pickersSlideTransitionClasses["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:et,zIndex:0}}});function PickersSlideTransition(tt){const et=useThemeProps({props:tt,name:"MuiPickersSlideTransition"}),{children:nt,className:rt,reduceAnimations:it,transKey:ot}=et,at=_objectWithoutPropertiesLoose$k(et,_excluded$w),st=useUtilityClasses$9(et),lt=useTheme();if(it)return jsxRuntimeExports.jsx("div",{className:clsx(st.root,rt),children:nt});const ct={exit:st.exit,enterActive:st.enterActive,enter:st.enter,exitActive:st.exitActive};return jsxRuntimeExports.jsx(PickersSlideTransitionRoot,{className:clsx(st.root,rt),childFactory:ut=>reactExports.cloneElement(ut,{classNames:ct}),role:"presentation",children:jsxRuntimeExports.jsx(CSSTransition$1,_extends$u({mountOnEnter:!0,unmountOnExit:!0,timeout:lt.transitions.duration.complex,classNames:ct},at,{children:nt}),ot)})}const useIsDateDisabled=({shouldDisableDate:tt,shouldDisableMonth:et,shouldDisableYear:nt,minDate:rt,maxDate:it,disableFuture:ot,disablePast:at,timezone:st})=>{const lt=useLocalizationContext();return reactExports.useCallback(ct=>validateDate({adapter:lt,value:ct,props:{shouldDisableDate:tt,shouldDisableMonth:et,shouldDisableYear:nt,minDate:rt,maxDate:it,disableFuture:ot,disablePast:at,timezone:st}})!==null,[lt,tt,et,nt,rt,it,ot,at,st])},getDayCalendarUtilityClass=tt=>generateUtilityClass("MuiDayCalendar",tt);generateUtilityClasses("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const _excluded$v=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],_excluded2$9=["ownerState"],useUtilityClasses$8=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},getDayCalendarUtilityClass,et)},weeksContainerHeight=(DAY_SIZE+DAY_MARGIN*2)*6,PickersCalendarDayRoot=styled$1("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),PickersCalendarDayHeader=styled$1("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(tt,et)=>et.header})({display:"flex",justifyContent:"center",alignItems:"center"}),PickersCalendarWeekDayLabel=styled$1(Typography$1,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(tt,et)=>et.weekDayLabel})(({theme:tt})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(tt.vars||tt).palette.text.secondary})),PickersCalendarWeekNumberLabel=styled$1(Typography$1,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(tt,et)=>et.weekNumberLabel})(({theme:tt})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:tt.palette.text.disabled})),PickersCalendarWeekNumber=styled$1(Typography$1,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(tt,et)=>et.weekNumber})(({theme:tt})=>_extends$u({},tt.typography.caption,{width:DAY_SIZE,height:DAY_SIZE,padding:0,margin:`0 ${DAY_MARGIN}px`,color:tt.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),PickersCalendarLoadingContainer=styled$1("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(tt,et)=>et.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:weeksContainerHeight}),PickersCalendarSlideTransition=styled$1(PickersSlideTransition,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(tt,et)=>et.slideTransition})({minHeight:weeksContainerHeight}),PickersCalendarWeekContainer=styled$1("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(tt,et)=>et.monthContainer})({overflow:"hidden"}),PickersCalendarWeek=styled$1("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(tt,et)=>et.weekContainer})({margin:`${DAY_MARGIN}px 0`,display:"flex",justifyContent:"center"});function WrappedDay(tt){var et,nt,rt;let{parentProps:it,day:ot,focusableDay:at,selectedDays:st,isDateDisabled:lt,currentMonthNumber:ct,isViewFocused:ut}=tt,ht=_objectWithoutPropertiesLoose$k(tt,_excluded$v);const{disabled:dt,disableHighlightToday:pt,isMonthSwitchingAnimating:mt,showDaysOutsideCurrentMonth:gt,components:yt,componentsProps:bt,slots:wt,slotProps:xt,timezone:kt}=it,St=useUtils(),Tt=useNow(kt),At=at!==null&&St.isSameDay(ot,at),Et=st.some(Wt=>St.isSameDay(Wt,ot)),Ct=St.isSameDay(ot,Tt),Lt=(et=(nt=wt==null?void 0:wt.day)!=null?nt:yt==null?void 0:yt.Day)!=null?et:PickersDay,jt=useSlotProps({elementType:Lt,externalSlotProps:(rt=xt==null?void 0:xt.day)!=null?rt:bt==null?void 0:bt.day,additionalProps:_extends$u({disableHighlightToday:pt,showDaysOutsideCurrentMonth:gt,role:"gridcell",isAnimating:mt,"data-timestamp":St.toJsDate(ot).valueOf()},ht),ownerState:_extends$u({},it,{day:ot,selected:Et})}),Rt=_objectWithoutPropertiesLoose$k(jt,_excluded2$9),$t=reactExports.useMemo(()=>dt||lt(ot),[dt,lt,ot]),vt=reactExports.useMemo(()=>St.getMonth(ot)!==ct,[St,ot,ct]),It=reactExports.useMemo(()=>{const Wt=St.startOfMonth(St.setMonth(ot,ct));return gt?St.isSameDay(ot,St.startOfWeek(Wt)):St.isSameDay(ot,Wt)},[ct,ot,gt,St]),Ot=reactExports.useMemo(()=>{const Wt=St.endOfMonth(St.setMonth(ot,ct));return gt?St.isSameDay(ot,St.endOfWeek(Wt)):St.isSameDay(ot,Wt)},[ct,ot,gt,St]);return jsxRuntimeExports.jsx(Lt,_extends$u({},Rt,{day:ot,disabled:$t,autoFocus:ut&&At,today:Ct,outsideCurrentMonth:vt,isFirstVisibleCell:It,isLastVisibleCell:Ot,selected:Et,tabIndex:At?0:-1,"aria-selected":Et,"aria-current":Ct?"date":void 0}))}function DayCalendar(tt){const et=useThemeProps({props:tt,name:"MuiDayCalendar"}),{onFocusedDayChange:nt,className:rt,currentMonth:it,selectedDays:ot,focusedDay:at,loading:st,onSelectedDaysChange:lt,onMonthSwitchingAnimationEnd:ct,readOnly:ut,reduceAnimations:ht,renderLoading:dt=()=>jsxRuntimeExports.jsx("span",{children:"..."}),slideDirection:pt,TransitionProps:mt,disablePast:gt,disableFuture:yt,minDate:bt,maxDate:wt,shouldDisableDate:xt,shouldDisableMonth:kt,shouldDisableYear:St,dayOfWeekFormatter:Tt,hasFocus:At,onFocusedViewChange:Et,gridLabelId:Ct,displayWeekNumber:Lt,fixedWeekNumber:jt,autoFocus:Rt,timezone:$t}=et,vt=useNow($t),It=useUtils(),Ot=useUtilityClasses$8(et),zt=useTheme().direction==="rtl",Ft=Tt||((sn,pn)=>It.format(pn,"weekdayShort").charAt(0).toUpperCase()),Nt=useIsDateDisabled({shouldDisableDate:xt,shouldDisableMonth:kt,shouldDisableYear:St,minDate:bt,maxDate:wt,disablePast:gt,disableFuture:yt,timezone:$t}),Ut=useLocaleText(),[Pt,Ht]=useControlled({name:"DayCalendar",state:"hasFocus",controlled:At,default:Rt??!1}),[Qt,an]=reactExports.useState(()=>at||vt),Yt=useEventCallback(sn=>{ut||lt(sn)}),nn=sn=>{Nt(sn)||(nt(sn),an(sn),Et==null||Et(!0),Ht(!0))},tn=useEventCallback((sn,pn)=>{switch(sn.key){case"ArrowUp":nn(It.addDays(pn,-7)),sn.preventDefault();break;case"ArrowDown":nn(It.addDays(pn,7)),sn.preventDefault();break;case"ArrowLeft":{const Tn=It.addDays(pn,zt?1:-1),In=It.addMonths(pn,zt?1:-1),yn=findClosestEnabledDate({utils:It,date:Tn,minDate:zt?Tn:It.startOfMonth(In),maxDate:zt?It.endOfMonth(In):Tn,isDateDisabled:Nt,timezone:$t});nn(yn||Tn),sn.preventDefault();break}case"ArrowRight":{const Tn=It.addDays(pn,zt?-1:1),In=It.addMonths(pn,zt?-1:1),yn=findClosestEnabledDate({utils:It,date:Tn,minDate:zt?It.startOfMonth(In):Tn,maxDate:zt?Tn:It.endOfMonth(In),isDateDisabled:Nt,timezone:$t});nn(yn||Tn),sn.preventDefault();break}case"Home":nn(It.startOfWeek(pn)),sn.preventDefault();break;case"End":nn(It.endOfWeek(pn)),sn.preventDefault();break;case"PageUp":nn(It.addMonths(pn,1)),sn.preventDefault();break;case"PageDown":nn(It.addMonths(pn,-1)),sn.preventDefault();break}}),dn=useEventCallback((sn,pn)=>nn(pn)),wn=useEventCallback((sn,pn)=>{Pt&&It.isSameDay(Qt,pn)&&(Et==null||Et(!1))}),rn=It.getMonth(it),Jt=reactExports.useMemo(()=>ot.filter(sn=>!!sn).map(sn=>It.startOfDay(sn)),[It,ot]),vn=rn,Cn=reactExports.useMemo(()=>reactExports.createRef(),[vn]),$n=It.startOfWeek(vt),Nn=reactExports.useMemo(()=>{const sn=It.startOfMonth(it),pn=It.endOfMonth(it);return Nt(Qt)||It.isAfterDay(Qt,pn)||It.isBeforeDay(Qt,sn)?findClosestEnabledDate({utils:It,date:Qt,minDate:sn,maxDate:pn,disablePast:gt,disableFuture:yt,isDateDisabled:Nt,timezone:$t}):Qt},[it,yt,gt,Qt,Nt,It,$t]),En=reactExports.useMemo(()=>{const sn=It.setTimezone(it,$t),pn=It.getWeekArray(sn);let Tn=It.addMonths(sn,1);for(;jt&&pn.length{pn.length{var Tn;const In=It.format(sn,"weekdayShort");return jsxRuntimeExports.jsx(PickersCalendarWeekDayLabel,{variant:"caption",role:"columnheader","aria-label":It.format(It.addDays($n,pn),"weekday"),className:Ot.weekDayLabel,children:(Tn=Ft==null?void 0:Ft(In,sn))!=null?Tn:In},In+pn.toString())})]}),st?jsxRuntimeExports.jsx(PickersCalendarLoadingContainer,{className:Ot.loadingContainer,children:dt()}):jsxRuntimeExports.jsx(PickersCalendarSlideTransition,_extends$u({transKey:vn,onExited:ct,reduceAnimations:ht,slideDirection:pt,className:clsx(rt,Ot.slideTransition)},mt,{nodeRef:Cn,children:jsxRuntimeExports.jsx(PickersCalendarWeekContainer,{ref:Cn,role:"rowgroup",className:Ot.monthContainer,children:En.map((sn,pn)=>jsxRuntimeExports.jsxs(PickersCalendarWeek,{role:"row",className:Ot.weekContainer,"aria-rowindex":pn+1,children:[Lt&&jsxRuntimeExports.jsx(PickersCalendarWeekNumber,{className:Ot.weekNumber,role:"rowheader","aria-label":Ut.calendarWeekNumberAriaLabelText(It.getWeekNumber(sn[0])),children:Ut.calendarWeekNumberText(It.getWeekNumber(sn[0]))}),sn.map((Tn,In)=>jsxRuntimeExports.jsx(WrappedDay,{parentProps:et,day:Tn,selectedDays:Jt,focusableDay:Nn,onKeyDown:tn,onFocus:dn,onBlur:wn,onDaySelect:Yt,isDateDisabled:Nt,currentMonthNumber:rn,isViewFocused:Pt,"aria-colindex":In+1},Tn.toString()))]},`week-${sn[0]}`))})}))]})}const createCalendarStateReducer=(tt,et,nt)=>(rt,it)=>{switch(it.type){case"changeMonth":return _extends$u({},rt,{slideDirection:it.direction,currentMonth:it.newMonth,isMonthSwitchingAnimating:!tt});case"finishMonthSwitchingAnimation":return _extends$u({},rt,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(rt.focusedDay!=null&&it.focusedDay!=null&&nt.isSameDay(it.focusedDay,rt.focusedDay))return rt;const ot=it.focusedDay!=null&&!et&&!nt.isSameMonth(rt.currentMonth,it.focusedDay);return _extends$u({},rt,{focusedDay:it.focusedDay,isMonthSwitchingAnimating:ot&&!tt&&!it.withoutMonthSwitchingAnimation,currentMonth:ot?nt.startOfMonth(it.focusedDay):rt.currentMonth,slideDirection:it.focusedDay!=null&&nt.isAfterDay(it.focusedDay,rt.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},useCalendarState=tt=>{const{value:et,referenceDate:nt,defaultCalendarMonth:rt,disableFuture:it,disablePast:ot,disableSwitchToMonthOnDayFocus:at=!1,maxDate:st,minDate:lt,onMonthChange:ct,reduceAnimations:ut,shouldDisableDate:ht,timezone:dt}=tt,pt=useNow(dt),mt=useUtils(),gt=reactExports.useRef(createCalendarStateReducer(!!ut,at,mt)).current,yt=reactExports.useMemo(()=>{let Et=null;return nt?Et=nt:rt&&(Et=mt.startOfMonth(rt)),singleItemValueManager.getInitialReferenceValue({value:et,utils:mt,timezone:dt,props:tt,referenceDate:Et,granularity:SECTION_TYPE_GRANULARITY.day})},[]),[bt,wt]=reactExports.useReducer(gt,{isMonthSwitchingAnimating:!1,focusedDay:et||pt,currentMonth:mt.startOfMonth(yt),slideDirection:"left"}),xt=reactExports.useCallback(Et=>{wt(_extends$u({type:"changeMonth"},Et)),ct&&ct(Et.newMonth)},[ct]),kt=reactExports.useCallback(Et=>{const Ct=Et;mt.isSameMonth(Ct,bt.currentMonth)||xt({newMonth:mt.startOfMonth(Ct),direction:mt.isAfterDay(Ct,bt.currentMonth)?"left":"right"})},[bt.currentMonth,xt,mt]),St=useIsDateDisabled({shouldDisableDate:ht,minDate:lt,maxDate:st,disableFuture:it,disablePast:ot,timezone:dt}),Tt=reactExports.useCallback(()=>{wt({type:"finishMonthSwitchingAnimation"})},[]),At=useEventCallback((Et,Ct)=>{St(Et)||wt({type:"changeFocusedDay",focusedDay:Et,withoutMonthSwitchingAnimation:Ct})});return{referenceDate:yt,calendarState:bt,changeMonth:kt,changeFocusedDay:At,isDateDisabled:St,onMonthSwitchingAnimationEnd:Tt,handleChangeMonth:xt}},_excluded$u=["ownerState"],useClearableField=({clearable:tt,fieldProps:et,InputProps:nt,onClear:rt,slots:it,slotProps:ot,components:at,componentsProps:st})=>{var lt,ct,ut,ht,dt,pt;const mt=useLocaleText(),gt=(lt=(ct=it==null?void 0:it.clearButton)!=null?ct:at==null?void 0:at.ClearButton)!=null?lt:IconButton$1,yt=useSlotProps({elementType:gt,externalSlotProps:(ut=ot==null?void 0:ot.clearButton)!=null?ut:st==null?void 0:st.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:mt.fieldClearLabel}}),bt=_objectWithoutPropertiesLoose$k(yt,_excluded$u),wt=(ht=(dt=it==null?void 0:it.clearIcon)!=null?dt:at==null?void 0:at.ClearIcon)!=null?ht:ClearIcon,xt=useSlotProps({elementType:wt,externalSlotProps:(pt=ot==null?void 0:ot.clearIcon)!=null?pt:st==null?void 0:st.clearIcon,ownerState:{}}),kt=_extends$u({},nt,{endAdornment:tt?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(MuiInputAdornment,{position:"end",sx:{marginRight:nt!=null&&nt.endAdornment?-1:-1.5},children:jsxRuntimeExports.jsx(gt,_extends$u({},bt,{onClick:rt,children:jsxRuntimeExports.jsx(wt,_extends$u({fontSize:"small"},xt))}))}),nt==null?void 0:nt.endAdornment]}):nt==null?void 0:nt.endAdornment}),St=_extends$u({},et,{sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(et.sx)?et.sx:[et.sx]]});return{InputProps:kt,fieldProps:St}},_excluded$t=["components","componentsProps","slots","slotProps","InputProps","inputProps"],_excluded2$8=["inputRef"],_excluded3$2=["ref","onPaste","onKeyDown","inputMode","readOnly","clearable","onClear"],DateField=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useThemeProps({props:et,name:"MuiDateField"}),{components:st,componentsProps:lt,slots:ct,slotProps:ut,InputProps:ht,inputProps:dt}=at,pt=_objectWithoutPropertiesLoose$k(at,_excluded$t),mt=at,gt=(rt=(it=ct==null?void 0:ct.textField)!=null?it:st==null?void 0:st.TextField)!=null?rt:MuiTextField,yt=useSlotProps({elementType:gt,externalSlotProps:(ot=ut==null?void 0:ut.textField)!=null?ot:lt==null?void 0:lt.textField,externalForwardedProps:pt,ownerState:mt}),{inputRef:bt}=yt,wt=_objectWithoutPropertiesLoose$k(yt,_excluded2$8);wt.inputProps=_extends$u({},dt,wt.inputProps),wt.InputProps=_extends$u({},ht,wt.InputProps);const xt=useDateField({props:wt,inputRef:bt}),{ref:kt,onPaste:St,onKeyDown:Tt,inputMode:At,readOnly:Et,clearable:Ct,onClear:Lt}=xt,jt=_objectWithoutPropertiesLoose$k(xt,_excluded3$2),{InputProps:Rt,fieldProps:$t}=useClearableField({onClear:Lt,clearable:Ct,fieldProps:jt,InputProps:jt.InputProps,slots:ct,slotProps:ut,components:st,componentsProps:lt});return jsxRuntimeExports.jsx(gt,_extends$u({ref:nt},$t,{InputProps:_extends$u({},Rt,{readOnly:Et}),inputProps:_extends$u({},jt.inputProps,{inputMode:At,onPaste:St,onKeyDown:Tt,ref:kt})}))}),getPickersFadeTransitionGroupUtilityClass=tt=>generateUtilityClass("MuiPickersFadeTransitionGroup",tt);generateUtilityClasses("MuiPickersFadeTransitionGroup",["root"]);const useUtilityClasses$7=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getPickersFadeTransitionGroupUtilityClass,et)},PickersFadeTransitionGroupRoot=styled$1(TransitionGroup$1,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"block",position:"relative"});function PickersFadeTransitionGroup(tt){const et=useThemeProps({props:tt,name:"MuiPickersFadeTransitionGroup"}),{children:nt,className:rt,reduceAnimations:it,transKey:ot}=et,at=useUtilityClasses$7(et),st=useTheme();return it?nt:jsxRuntimeExports.jsx(PickersFadeTransitionGroupRoot,{className:clsx(at.root,rt),children:jsxRuntimeExports.jsx(Fade$1,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:st.transitions.duration.enteringScreen,enter:st.transitions.duration.enteringScreen,exit:0},children:nt},ot)})}function getPickersMonthUtilityClass(tt){return generateUtilityClass("MuiPickersMonth",tt)}const pickersMonthClasses=generateUtilityClasses("MuiPickersMonth",["root","monthButton","disabled","selected"]),_excluded$s=["autoFocus","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow"],useUtilityClasses$6=tt=>{const{disabled:et,selected:nt,classes:rt}=tt;return composeClasses({root:["root"],monthButton:["monthButton",et&&"disabled",nt&&"selected"]},getPickersMonthUtilityClass,rt)},PickersMonthRoot=styled$1("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(tt,et)=>[et.root]})(({ownerState:tt})=>({flexBasis:tt.monthsPerRow===3?"33.3%":"25%",display:"flex",alignItems:"center",justifyContent:"center"})),PickersMonthButton=styled$1("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(tt,et)=>[et.monthButton,{[`&.${pickersMonthClasses.disabled}`]:et.disabled},{[`&.${pickersMonthClasses.selected}`]:et.selected}]})(({theme:tt})=>_extends$u({color:"unset",backgroundColor:"transparent",border:0,outline:0},tt.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity)},"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${pickersMonthClasses.disabled}`]:{color:(tt.vars||tt).palette.text.secondary},[`&.${pickersMonthClasses.selected}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.main,"&:focus, &:hover":{backgroundColor:(tt.vars||tt).palette.primary.dark}}})),PickersMonth=reactExports.memo(function(et){const nt=useThemeProps({props:et,name:"MuiPickersMonth"}),{autoFocus:rt,children:it,disabled:ot,selected:at,value:st,tabIndex:lt,onClick:ct,onKeyDown:ut,onFocus:ht,onBlur:dt,"aria-current":pt,"aria-label":mt}=nt,gt=_objectWithoutPropertiesLoose$k(nt,_excluded$s),yt=reactExports.useRef(null),bt=useUtilityClasses$6(nt);return useEnhancedEffect$1(()=>{if(rt){var wt;(wt=yt.current)==null||wt.focus()}},[rt]),jsxRuntimeExports.jsx(PickersMonthRoot,_extends$u({className:bt.root,ownerState:nt},gt,{children:jsxRuntimeExports.jsx(PickersMonthButton,{ref:yt,disabled:ot,type:"button",role:"radio",tabIndex:ot?-1:lt,"aria-current":pt,"aria-checked":at,"aria-label":mt,onClick:wt=>ct(wt,st),onKeyDown:wt=>ut(wt,st),onFocus:wt=>ht(wt,st),onBlur:wt=>dt(wt,st),className:bt.monthButton,ownerState:nt,children:it})}))});function getMonthCalendarUtilityClass(tt){return generateUtilityClass("MuiMonthCalendar",tt)}generateUtilityClasses("MuiMonthCalendar",["root"]);const _excluded$r=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId"],useUtilityClasses$5=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getMonthCalendarUtilityClass,et)};function useMonthCalendarDefaultizedProps(tt,et){const nt=useUtils(),rt=useDefaultDates(),it=useThemeProps({props:tt,name:et});return _extends$u({disableFuture:!1,disablePast:!1},it,{minDate:applyDefaultDate(nt,it.minDate,rt.minDate),maxDate:applyDefaultDate(nt,it.maxDate,rt.maxDate)})}const MonthCalendarRoot=styled$1("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:DIALOG_WIDTH,boxSizing:"border-box"}),MonthCalendar=reactExports.forwardRef(function(et,nt){const rt=useMonthCalendarDefaultizedProps(et,"MuiMonthCalendar"),{className:it,value:ot,defaultValue:at,referenceDate:st,disabled:lt,disableFuture:ct,disablePast:ut,maxDate:ht,minDate:dt,onChange:pt,shouldDisableMonth:mt,readOnly:gt,disableHighlightToday:yt,autoFocus:bt=!1,onMonthFocus:wt,hasFocus:xt,onFocusedViewChange:kt,monthsPerRow:St=3,timezone:Tt,gridLabelId:At}=rt,Et=_objectWithoutPropertiesLoose$k(rt,_excluded$r),{value:Ct,handleValueChange:Lt,timezone:jt}=useControlledValueWithTimezone({name:"MonthCalendar",timezone:Tt,value:ot,defaultValue:at,onChange:pt,valueManager:singleItemValueManager}),Rt=useNow(jt),$t=useTheme$2(),vt=useUtils(),It=reactExports.useMemo(()=>singleItemValueManager.getInitialReferenceValue({value:Ct,utils:vt,props:rt,timezone:jt,referenceDate:st,granularity:SECTION_TYPE_GRANULARITY.month}),[]),Ot=rt,Wt=useUtilityClasses$5(Ot),zt=reactExports.useMemo(()=>vt.getMonth(Rt),[vt,Rt]),Ft=reactExports.useMemo(()=>Ct!=null?vt.getMonth(Ct):yt?null:vt.getMonth(It),[Ct,vt,yt,It]),[Nt,Ut]=reactExports.useState(()=>Ft||zt),[Pt,Ht]=useControlled({name:"MonthCalendar",state:"hasFocus",controlled:xt,default:bt??!1}),Qt=useEventCallback(rn=>{Ht(rn),kt&&kt(rn)}),an=reactExports.useCallback(rn=>{const Jt=vt.startOfMonth(ut&&vt.isAfter(Rt,dt)?Rt:dt),vn=vt.startOfMonth(ct&&vt.isBefore(Rt,ht)?Rt:ht),Cn=vt.startOfMonth(rn);return vt.isBefore(Cn,Jt)||vt.isAfter(Cn,vn)?!0:mt?mt(Cn):!1},[ct,ut,ht,dt,Rt,mt,vt]),Yt=useEventCallback((rn,Jt)=>{if(gt)return;const vn=vt.setMonth(Ct??It,Jt);Lt(vn)}),nn=useEventCallback(rn=>{an(vt.setMonth(Ct??It,rn))||(Ut(rn),Qt(!0),wt&&wt(rn))});reactExports.useEffect(()=>{Ut(rn=>Ft!==null&&rn!==Ft?Ft:rn)},[Ft]);const tn=useEventCallback((rn,Jt)=>{switch(rn.key){case"ArrowUp":nn((12+Jt-3)%12),rn.preventDefault();break;case"ArrowDown":nn((12+Jt+3)%12),rn.preventDefault();break;case"ArrowLeft":nn((12+Jt+($t.direction==="ltr"?-1:1))%12),rn.preventDefault();break;case"ArrowRight":nn((12+Jt+($t.direction==="ltr"?1:-1))%12),rn.preventDefault();break}}),dn=useEventCallback((rn,Jt)=>{nn(Jt)}),wn=useEventCallback((rn,Jt)=>{Nt===Jt&&Qt(!1)});return jsxRuntimeExports.jsx(MonthCalendarRoot,_extends$u({ref:nt,className:clsx(Wt.root,it),ownerState:Ot,role:"radiogroup","aria-labelledby":At},Et,{children:getMonthsInYear(vt,Ct??It).map(rn=>{const Jt=vt.getMonth(rn),vn=vt.format(rn,"monthShort"),Cn=vt.format(rn,"month"),$n=Jt===Ft,Nn=lt||an(rn);return jsxRuntimeExports.jsx(PickersMonth,{selected:$n,value:Jt,onClick:Yt,onKeyDown:tn,autoFocus:Pt&&Jt===Nt,disabled:Nn,tabIndex:Jt===Nt?0:-1,onFocus:dn,onBlur:wn,"aria-current":zt===Jt?"date":void 0,"aria-label":Cn,monthsPerRow:St,children:vn},vn)})}))});function getPickersYearUtilityClass(tt){return generateUtilityClass("MuiPickersYear",tt)}const pickersYearClasses=generateUtilityClasses("MuiPickersYear",["root","yearButton","selected","disabled"]),_excluded$q=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow"],useUtilityClasses$4=tt=>{const{disabled:et,selected:nt,classes:rt}=tt;return composeClasses({root:["root"],yearButton:["yearButton",et&&"disabled",nt&&"selected"]},getPickersYearUtilityClass,rt)},PickersYearRoot=styled$1("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(tt,et)=>[et.root]})(({ownerState:tt})=>({flexBasis:tt.yearsPerRow===3?"33.3%":"25%",display:"flex",alignItems:"center",justifyContent:"center"})),PickersYearButton=styled$1("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(tt,et)=>[et.yearButton,{[`&.${pickersYearClasses.disabled}`]:et.disabled},{[`&.${pickersYearClasses.selected}`]:et.selected}]})(({theme:tt})=>_extends$u({color:"unset",backgroundColor:"transparent",border:0,outline:0},tt.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.focusOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.focusOpacity)},"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${pickersYearClasses.disabled}`]:{color:(tt.vars||tt).palette.text.secondary},[`&.${pickersYearClasses.selected}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.main,"&:focus, &:hover":{backgroundColor:(tt.vars||tt).palette.primary.dark}}})),PickersYear=reactExports.memo(function(et){const nt=useThemeProps({props:et,name:"MuiPickersYear"}),{autoFocus:rt,className:it,children:ot,disabled:at,selected:st,value:lt,tabIndex:ct,onClick:ut,onKeyDown:ht,onFocus:dt,onBlur:pt,"aria-current":mt}=nt,gt=_objectWithoutPropertiesLoose$k(nt,_excluded$q),yt=reactExports.useRef(null),bt=useUtilityClasses$4(nt);return reactExports.useEffect(()=>{rt&&yt.current.focus()},[rt]),jsxRuntimeExports.jsx(PickersYearRoot,_extends$u({className:clsx(bt.root,it),ownerState:nt},gt,{children:jsxRuntimeExports.jsx(PickersYearButton,{ref:yt,disabled:at,type:"button",role:"radio",tabIndex:at?-1:ct,"aria-current":mt,"aria-checked":st,onClick:wt=>ut(wt,lt),onKeyDown:wt=>ht(wt,lt),onFocus:wt=>dt(wt,lt),onBlur:wt=>pt(wt,lt),className:bt.yearButton,ownerState:nt,children:ot})}))});function getYearCalendarUtilityClass(tt){return generateUtilityClass("MuiYearCalendar",tt)}generateUtilityClasses("MuiYearCalendar",["root"]);const _excluded$p=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsPerRow","timezone","gridLabelId"],useUtilityClasses$3=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getYearCalendarUtilityClass,et)};function useYearCalendarDefaultizedProps(tt,et){var nt;const rt=useUtils(),it=useDefaultDates(),ot=useThemeProps({props:tt,name:et});return _extends$u({disablePast:!1,disableFuture:!1},ot,{yearsPerRow:(nt=ot.yearsPerRow)!=null?nt:3,minDate:applyDefaultDate(rt,ot.minDate,it.minDate),maxDate:applyDefaultDate(rt,ot.maxDate,it.maxDate)})}const YearCalendarRoot=styled$1("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:DIALOG_WIDTH,maxHeight:MAX_CALENDAR_HEIGHT,boxSizing:"border-box",position:"relative"}),YearCalendar=reactExports.forwardRef(function(et,nt){const rt=useYearCalendarDefaultizedProps(et,"MuiYearCalendar"),{autoFocus:it,className:ot,value:at,defaultValue:st,referenceDate:lt,disabled:ct,disableFuture:ut,disablePast:ht,maxDate:dt,minDate:pt,onChange:mt,readOnly:gt,shouldDisableYear:yt,disableHighlightToday:bt,onYearFocus:wt,hasFocus:xt,onFocusedViewChange:kt,yearsPerRow:St,timezone:Tt,gridLabelId:At}=rt,Et=_objectWithoutPropertiesLoose$k(rt,_excluded$p),{value:Ct,handleValueChange:Lt,timezone:jt}=useControlledValueWithTimezone({name:"YearCalendar",timezone:Tt,value:at,defaultValue:st,onChange:mt,valueManager:singleItemValueManager}),Rt=useNow(jt),$t=useTheme$2(),vt=useUtils(),It=reactExports.useMemo(()=>singleItemValueManager.getInitialReferenceValue({value:Ct,utils:vt,props:rt,timezone:jt,referenceDate:lt,granularity:SECTION_TYPE_GRANULARITY.year}),[]),Ot=rt,Wt=useUtilityClasses$3(Ot),zt=reactExports.useMemo(()=>vt.getYear(Rt),[vt,Rt]),Ft=reactExports.useMemo(()=>Ct!=null?vt.getYear(Ct):bt?null:vt.getYear(It),[Ct,vt,bt,It]),[Nt,Ut]=reactExports.useState(()=>Ft||zt),[Pt,Ht]=useControlled({name:"YearCalendar",state:"hasFocus",controlled:xt,default:it??!1}),Qt=useEventCallback(vn=>{Ht(vn),kt&&kt(vn)}),an=reactExports.useCallback(vn=>{if(ht&&vt.isBeforeYear(vn,Rt)||ut&&vt.isAfterYear(vn,Rt)||pt&&vt.isBeforeYear(vn,pt)||dt&&vt.isAfterYear(vn,dt))return!0;if(!yt)return!1;const Cn=vt.startOfYear(vn);return yt(Cn)},[ut,ht,dt,pt,Rt,yt,vt]),Yt=useEventCallback((vn,Cn)=>{if(gt)return;const $n=vt.setYear(Ct??It,Cn);Lt($n)}),nn=useEventCallback(vn=>{an(vt.setYear(Ct??It,vn))||(Ut(vn),Qt(!0),wt==null||wt(vn))});reactExports.useEffect(()=>{Ut(vn=>Ft!==null&&vn!==Ft?Ft:vn)},[Ft]);const tn=useEventCallback((vn,Cn)=>{switch(vn.key){case"ArrowUp":nn(Cn-St),vn.preventDefault();break;case"ArrowDown":nn(Cn+St),vn.preventDefault();break;case"ArrowLeft":nn(Cn+($t.direction==="ltr"?-1:1)),vn.preventDefault();break;case"ArrowRight":nn(Cn+($t.direction==="ltr"?1:-1)),vn.preventDefault();break}}),dn=useEventCallback((vn,Cn)=>{nn(Cn)}),wn=useEventCallback((vn,Cn)=>{Nt===Cn&&Qt(!1)}),rn=reactExports.useRef(null),Jt=useForkRef(nt,rn);return reactExports.useEffect(()=>{if(it||rn.current===null)return;const vn=rn.current.querySelector('[tabindex="0"]');if(!vn)return;const Cn=vn.offsetHeight,$n=vn.offsetTop,Nn=rn.current.clientHeight,En=rn.current.scrollTop,sn=$n+Cn;Cn>Nn||$n{const Cn=vt.getYear(vn),$n=Cn===Ft,Nn=ct||an(vn);return jsxRuntimeExports.jsx(PickersYear,{selected:$n,value:Cn,onClick:Yt,onKeyDown:tn,autoFocus:Pt&&Cn===Nt,disabled:Nn,tabIndex:Cn===Nt?0:-1,onFocus:dn,onBlur:wn,"aria-current":zt===Cn?"date":void 0,yearsPerRow:St,children:vt.format(vn,"year")},vt.format(vn,"year"))})}))}),getPickersCalendarHeaderUtilityClass=tt=>generateUtilityClass("MuiPickersCalendarHeader",tt),pickersCalendarHeaderClasses=generateUtilityClasses("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),_excluded$o=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone"],_excluded2$7=["ownerState"],useUtilityClasses$2=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},getPickersCalendarHeaderUtilityClass,et)},PickersCalendarHeaderRoot=styled$1("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),PickersCalendarHeaderLabelContainer=styled$1("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(tt,et)=>et.labelContainer})(({theme:tt})=>_extends$u({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},tt.typography.body1,{fontWeight:tt.typography.fontWeightMedium})),PickersCalendarHeaderLabel=styled$1("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(tt,et)=>et.label})({marginRight:6}),PickersCalendarHeaderSwitchViewButton=styled$1(IconButton$1,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(tt,et)=>et.switchViewButton})(({ownerState:tt})=>_extends$u({marginRight:"auto"},tt.view==="year"&&{[`.${pickersCalendarHeaderClasses.switchViewIcon}`]:{transform:"rotate(180deg)"}})),PickersCalendarHeaderSwitchViewIcon=styled$1(ArrowDropDownIcon,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(tt,et)=>et.switchViewIcon})(({theme:tt})=>({willChange:"transform",transition:tt.transitions.create("transform"),transform:"rotate(0deg)"})),PickersCalendarHeader=reactExports.forwardRef(function(et,nt){var rt,it;const ot=useLocaleText(),at=useUtils(),st=useThemeProps({props:et,name:"MuiPickersCalendarHeader"}),{slots:lt,slotProps:ct,currentMonth:ut,disabled:ht,disableFuture:dt,disablePast:pt,maxDate:mt,minDate:gt,onMonthChange:yt,onViewChange:bt,view:wt,reduceAnimations:xt,views:kt,labelId:St,className:Tt,timezone:At}=st,Et=_objectWithoutPropertiesLoose$k(st,_excluded$o),Ct=st,Lt=useUtilityClasses$2(st),jt=(rt=lt==null?void 0:lt.switchViewButton)!=null?rt:PickersCalendarHeaderSwitchViewButton,Rt=useSlotProps({elementType:jt,externalSlotProps:ct==null?void 0:ct.switchViewButton,additionalProps:{size:"small","aria-label":ot.calendarViewSwitchingButtonAriaLabel(wt)},ownerState:Ct,className:Lt.switchViewButton}),$t=(it=lt==null?void 0:lt.switchViewIcon)!=null?it:PickersCalendarHeaderSwitchViewIcon,vt=useSlotProps({elementType:$t,externalSlotProps:ct==null?void 0:ct.switchViewIcon,ownerState:void 0,className:Lt.switchViewIcon}),It=_objectWithoutPropertiesLoose$k(vt,_excluded2$7),Ot=()=>yt(at.addMonths(ut,1),"left"),Wt=()=>yt(at.addMonths(ut,-1),"right"),zt=useNextMonthDisabled(ut,{disableFuture:dt,maxDate:mt,timezone:At}),Ft=usePreviousMonthDisabled(ut,{disablePast:pt,minDate:gt,timezone:At}),Nt=()=>{if(!(kt.length===1||!bt||ht))if(kt.length===2)bt(kt.find(Ut=>Ut!==wt)||kt[0]);else{const Ut=kt.indexOf(wt)!==0?0:1;bt(kt[Ut])}};return kt.length===1&&kt[0]==="year"?null:jsxRuntimeExports.jsxs(PickersCalendarHeaderRoot,_extends$u({},Et,{ownerState:Ct,className:clsx(Tt,Lt.root),ref:nt,children:[jsxRuntimeExports.jsxs(PickersCalendarHeaderLabelContainer,{role:"presentation",onClick:Nt,ownerState:Ct,"aria-live":"polite",className:Lt.labelContainer,children:[jsxRuntimeExports.jsx(PickersFadeTransitionGroup,{reduceAnimations:xt,transKey:at.format(ut,"monthAndYear"),children:jsxRuntimeExports.jsx(PickersCalendarHeaderLabel,{id:St,ownerState:Ct,className:Lt.label,children:at.format(ut,"monthAndYear")})}),kt.length>1&&!ht&&jsxRuntimeExports.jsx(jt,_extends$u({},Rt,{children:jsxRuntimeExports.jsx($t,_extends$u({},It))}))]}),jsxRuntimeExports.jsx(Fade$1,{in:wt==="day",children:jsxRuntimeExports.jsx(PickersArrowSwitcher,{slots:lt,slotProps:ct,onGoToPrevious:Wt,isPreviousDisabled:Ft,previousLabel:ot.previousMonth,onGoToNext:Ot,isNextDisabled:zt,nextLabel:ot.nextMonth})})]}))}),getDateCalendarUtilityClass=tt=>generateUtilityClass("MuiDateCalendar",tt);generateUtilityClasses("MuiDateCalendar",["root","viewTransitionContainer"]);const _excluded$n=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","components","componentsProps","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsPerRow","monthsPerRow","timezone"],useUtilityClasses$1=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},getDateCalendarUtilityClass,et)};function useDateCalendarDefaultizedProps(tt,et){var nt,rt,it,ot,at,st,lt;const ct=useUtils(),ut=useDefaultDates(),ht=useDefaultReduceAnimations(),dt=useThemeProps({props:tt,name:et});return _extends$u({},dt,{loading:(nt=dt.loading)!=null?nt:!1,disablePast:(rt=dt.disablePast)!=null?rt:!1,disableFuture:(it=dt.disableFuture)!=null?it:!1,openTo:(ot=dt.openTo)!=null?ot:"day",views:(at=dt.views)!=null?at:["year","day"],reduceAnimations:(st=dt.reduceAnimations)!=null?st:ht,renderLoading:(lt=dt.renderLoading)!=null?lt:()=>jsxRuntimeExports.jsx("span",{children:"..."}),minDate:applyDefaultDate(ct,dt.minDate,ut.minDate),maxDate:applyDefaultDate(ct,dt.maxDate,ut.maxDate)})}const DateCalendarRoot=styled$1(PickerViewRoot,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",flexDirection:"column",height:VIEW_HEIGHT}),DateCalendarViewTransitionContainer=styled$1(PickersFadeTransitionGroup,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(tt,et)=>et.viewTransitionContainer})({}),DateCalendar=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useUtils(),st=useId(),lt=useDateCalendarDefaultizedProps(et,"MuiDateCalendar"),{autoFocus:ct,onViewChange:ut,value:ht,defaultValue:dt,referenceDate:pt,disableFuture:mt,disablePast:gt,defaultCalendarMonth:yt,onChange:bt,onYearChange:wt,onMonthChange:xt,reduceAnimations:kt,shouldDisableDate:St,shouldDisableMonth:Tt,shouldDisableYear:At,view:Et,views:Ct,openTo:Lt,className:jt,disabled:Rt,readOnly:$t,minDate:vt,maxDate:It,disableHighlightToday:Ot,focusedView:Wt,onFocusedViewChange:zt,showDaysOutsideCurrentMonth:Ft,fixedWeekNumber:Nt,dayOfWeekFormatter:Ut,components:Pt,componentsProps:Ht,slots:Qt,slotProps:an,loading:Yt,renderLoading:nn,displayWeekNumber:tn,yearsPerRow:dn,monthsPerRow:wn,timezone:rn}=lt,Jt=_objectWithoutPropertiesLoose$k(lt,_excluded$n),{value:vn,handleValueChange:Cn,timezone:$n}=useControlledValueWithTimezone({name:"DateCalendar",timezone:rn,value:ht,defaultValue:dt,onChange:bt,valueManager:singleItemValueManager}),{view:Nn,setView:En,focusedView:sn,setFocusedView:pn,goToNextView:Tn,setValueAndGoToNextView:In}=useViews({view:Et,views:Ct,openTo:Lt,onChange:Cn,onViewChange:ut,autoFocus:ct,focusedView:Wt,onFocusedViewChange:zt}),{referenceDate:yn,calendarState:hn,changeFocusedDay:fn,changeMonth:xn,handleChangeMonth:jn,isDateDisabled:cn,onMonthSwitchingAnimationEnd:Xt}=useCalendarState({value:vn,defaultCalendarMonth:yt,referenceDate:pt,reduceAnimations:kt,onMonthChange:xt,minDate:vt,maxDate:It,shouldDisableDate:St,disablePast:gt,disableFuture:mt,timezone:$n}),Kt=Rt&&vn||vt,kn=Rt&&vn||It,Mn=`${st}-grid-label`,On=sn!==null,Bn=(rt=(it=Qt==null?void 0:Qt.calendarHeader)!=null?it:Pt==null?void 0:Pt.CalendarHeader)!=null?rt:PickersCalendarHeader,Xn=useSlotProps({elementType:Bn,externalSlotProps:(ot=an==null?void 0:an.calendarHeader)!=null?ot:Ht==null?void 0:Ht.calendarHeader,additionalProps:{views:Ct,view:Nn,currentMonth:hn.currentMonth,onViewChange:En,onMonthChange:(Er,Ir)=>jn({newMonth:Er,direction:Ir}),minDate:Kt,maxDate:kn,disabled:Rt,disablePast:gt,disableFuture:mt,reduceAnimations:kt,timezone:$n,labelId:Mn,slots:Qt,slotProps:an},ownerState:lt}),Vn=useEventCallback(Er=>{const Ir=at.startOfMonth(Er),Gr=at.endOfMonth(Er),Or=cn(Er)?findClosestEnabledDate({utils:at,date:Er,minDate:at.isBefore(vt,Ir)?Ir:vt,maxDate:at.isAfter(It,Gr)?Gr:It,disablePast:gt,disableFuture:mt,isDateDisabled:cn,timezone:$n}):Er;Or?(In(Or,"finish"),xt==null||xt(Ir)):(Tn(),xn(Ir)),fn(Or,!0)}),Gn=useEventCallback(Er=>{const Ir=at.startOfYear(Er),Gr=at.endOfYear(Er),Or=cn(Er)?findClosestEnabledDate({utils:at,date:Er,minDate:at.isBefore(vt,Ir)?Ir:vt,maxDate:at.isAfter(It,Gr)?Gr:It,disablePast:gt,disableFuture:mt,isDateDisabled:cn,timezone:$n}):Er;Or?(In(Or,"finish"),wt==null||wt(Or)):(Tn(),xn(Ir)),fn(Or,!0)}),zn=useEventCallback(Er=>Cn(Er&&mergeDateAndTime(at,Er,vn??yn),"finish"));reactExports.useEffect(()=>{vn!=null&&at.isValid(vn)&&xn(vn)},[vn]);const Zn=lt,Wn=useUtilityClasses$1(Zn),fr={disablePast:gt,disableFuture:mt,maxDate:It,minDate:vt},ur={disableHighlightToday:Ot,readOnly:$t,disabled:Rt,timezone:$n,gridLabelId:Mn},wr=reactExports.useRef(Nn);reactExports.useEffect(()=>{wr.current!==Nn&&(sn===wr.current&&pn(Nn,!0),wr.current=Nn)},[sn,pn,Nn]);const Xr=reactExports.useMemo(()=>[vn],[vn]);return jsxRuntimeExports.jsxs(DateCalendarRoot,_extends$u({ref:nt,className:clsx(Wn.root,jt),ownerState:Zn},Jt,{children:[jsxRuntimeExports.jsx(Bn,_extends$u({},Xn)),jsxRuntimeExports.jsx(DateCalendarViewTransitionContainer,{reduceAnimations:kt,className:Wn.viewTransitionContainer,transKey:Nn,ownerState:Zn,children:jsxRuntimeExports.jsxs("div",{children:[Nn==="year"&&jsxRuntimeExports.jsx(YearCalendar,_extends$u({},fr,ur,{value:vn,onChange:Gn,shouldDisableYear:At,hasFocus:On,onFocusedViewChange:Er=>pn("year",Er),yearsPerRow:dn,referenceDate:yn})),Nn==="month"&&jsxRuntimeExports.jsx(MonthCalendar,_extends$u({},fr,ur,{hasFocus:On,className:jt,value:vn,onChange:Vn,shouldDisableMonth:Tt,onFocusedViewChange:Er=>pn("month",Er),monthsPerRow:wn,referenceDate:yn})),Nn==="day"&&jsxRuntimeExports.jsx(DayCalendar,_extends$u({},hn,fr,ur,{onMonthSwitchingAnimationEnd:Xt,onFocusedDayChange:fn,reduceAnimations:kt,selectedDays:Xr,onSelectedDaysChange:zn,shouldDisableDate:St,shouldDisableMonth:Tt,shouldDisableYear:At,hasFocus:On,onFocusedViewChange:Er=>pn("day",Er),showDaysOutsideCurrentMonth:Ft,fixedWeekNumber:Nt,dayOfWeekFormatter:Ut,displayWeekNumber:tn,components:Pt,componentsProps:Ht,slots:Qt,slotProps:an,loading:Yt,renderLoading:nn}))]})})]}))});function getDatePickerToolbarUtilityClass(tt){return generateUtilityClass("MuiDatePickerToolbar",tt)}generateUtilityClasses("MuiDatePickerToolbar",["root","title"]);const _excluded$m=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views"],useUtilityClasses=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],title:["title"]},getDatePickerToolbarUtilityClass,et)},DatePickerToolbarRoot=styled$1(PickersToolbar,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),DatePickerToolbarTitle=styled$1(Typography$1,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(tt,et)=>et.title})(({ownerState:tt})=>_extends$u({},tt.isLandscape&&{margin:"auto 16px auto auto"})),DatePickerToolbar=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDatePickerToolbar"}),{value:it,isLandscape:ot,toolbarFormat:at,toolbarPlaceholder:st="––",views:lt}=rt,ct=_objectWithoutPropertiesLoose$k(rt,_excluded$m),ut=useUtils(),ht=useLocaleText(),dt=useUtilityClasses(rt),pt=reactExports.useMemo(()=>{if(!it)return st;const gt=resolveDateFormat(ut,{format:at,views:lt},!0);return ut.formatByString(it,gt)},[it,at,st,ut,lt]),mt=rt;return jsxRuntimeExports.jsx(DatePickerToolbarRoot,_extends$u({ref:nt,toolbarTitle:ht.datePickerToolbarTitle,isLandscape:ot,className:dt.root},ct,{children:jsxRuntimeExports.jsx(DatePickerToolbarTitle,{variant:"h4",align:ot?"left":"center",ownerState:mt,className:dt.title,children:pt})}))});function useDatePickerDefaultizedProps(tt,et){var nt,rt,it,ot;const at=useUtils(),st=useDefaultDates(),lt=useThemeProps({props:tt,name:et}),ct=reactExports.useMemo(()=>{var ht;return((ht=lt.localeText)==null?void 0:ht.toolbarTitle)==null?lt.localeText:_extends$u({},lt.localeText,{datePickerToolbarTitle:lt.localeText.toolbarTitle})},[lt.localeText]),ut=(nt=lt.slots)!=null?nt:uncapitalizeObjectKeys(lt.components);return _extends$u({},lt,{localeText:ct},applyDefaultViewProps({views:lt.views,openTo:lt.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:(rt=lt.disableFuture)!=null?rt:!1,disablePast:(it=lt.disablePast)!=null?it:!1,minDate:applyDefaultDate(at,lt.minDate,st.minDate),maxDate:applyDefaultDate(at,lt.maxDate,st.maxDate),slots:_extends$u({toolbar:DatePickerToolbar},ut),slotProps:(ot=lt.slotProps)!=null?ot:lt.componentsProps})}const _excluded$l=["props","getOpenDialogAriaText"],_excluded2$6=["ownerState"],_excluded3$1=["ownerState"],useDesktopPicker=tt=>{var et,nt,rt,it,ot;let{props:at,getOpenDialogAriaText:st}=tt,lt=_objectWithoutPropertiesLoose$k(tt,_excluded$l);const{slots:ct,slotProps:ut,className:ht,sx:dt,format:pt,formatDensity:mt,timezone:gt,label:yt,inputRef:bt,readOnly:wt,disabled:xt,autoFocus:kt,localeText:St,reduceAnimations:Tt}=at,At=useUtils(),Et=reactExports.useRef(null),Ct=reactExports.useRef(null),Lt=useId(),jt=(et=ut==null||(nt=ut.toolbar)==null?void 0:nt.hidden)!=null?et:!1,{open:Rt,actions:$t,hasUIView:vt,layoutProps:It,renderCurrentView:Ot,shouldRestoreFocus:Wt,fieldProps:zt}=usePicker(_extends$u({},lt,{props:at,inputRef:Et,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),Ft=(rt=ct.inputAdornment)!=null?rt:MuiInputAdornment,Nt=useSlotProps({elementType:Ft,externalSlotProps:ut==null?void 0:ut.inputAdornment,additionalProps:{position:"end"},ownerState:at}),Ut=_objectWithoutPropertiesLoose$k(Nt,_excluded2$6),Pt=(it=ct.openPickerButton)!=null?it:IconButton$1,Ht=useSlotProps({elementType:Pt,externalSlotProps:ut==null?void 0:ut.openPickerButton,additionalProps:{disabled:xt||wt,onClick:Rt?$t.onClose:$t.onOpen,"aria-label":st(zt.value,At),edge:Ut.position},ownerState:at}),Qt=_objectWithoutPropertiesLoose$k(Ht,_excluded3$1),an=ct.openPickerIcon,Yt=ct.field,nn=useSlotProps({elementType:Yt,externalSlotProps:ut==null?void 0:ut.field,additionalProps:_extends$u({},zt,jt&&{id:Lt},{readOnly:wt,disabled:xt,className:ht,sx:dt,format:pt,formatDensity:mt,timezone:gt,label:yt,autoFocus:kt&&!at.open,focused:Rt?!0:void 0}),ownerState:at});vt&&(nn.InputProps=_extends$u({},nn.InputProps,{ref:Ct,[`${Ut.position}Adornment`]:jsxRuntimeExports.jsx(Ft,_extends$u({},Ut,{children:jsxRuntimeExports.jsx(Pt,_extends$u({},Qt,{children:jsxRuntimeExports.jsx(an,_extends$u({},ut==null?void 0:ut.openPickerIcon))}))}))}));const tn=_extends$u({textField:ct.textField,clearIcon:ct.clearIcon,clearButton:ct.clearButton},nn.slots),dn=(ot=ct.layout)!=null?ot:PickersLayout,wn=useForkRef(Et,nn.inputRef,bt);let rn=Lt;jt&&(yt?rn=`${Lt}-label`:rn=void 0);const Jt=_extends$u({},ut,{toolbar:_extends$u({},ut==null?void 0:ut.toolbar,{titleId:Lt}),popper:_extends$u({"aria-labelledby":rn},ut==null?void 0:ut.popper)});return{renderPicker:()=>jsxRuntimeExports.jsxs(LocalizationProvider,{localeText:St,children:[jsxRuntimeExports.jsx(Yt,_extends$u({},nn,{slots:tn,slotProps:Jt,inputRef:wn})),jsxRuntimeExports.jsx(PickersPopper,_extends$u({role:"dialog",placement:"bottom-start",anchorEl:Ct.current},$t,{open:Rt,slots:ct,slotProps:Jt,shouldRestoreFocus:Wt,reduceAnimations:Tt,children:jsxRuntimeExports.jsx(dn,_extends$u({},It,Jt==null?void 0:Jt.layout,{slots:ct,slotProps:Jt,children:Ot()}))}))]})}},renderDateViewCalendar=({view:tt,onViewChange:et,views:nt,focusedView:rt,onFocusedViewChange:it,value:ot,defaultValue:at,referenceDate:st,onChange:lt,className:ct,classes:ut,disableFuture:ht,disablePast:dt,minDate:pt,maxDate:mt,shouldDisableDate:gt,shouldDisableMonth:yt,shouldDisableYear:bt,reduceAnimations:wt,onMonthChange:xt,monthsPerRow:kt,onYearChange:St,yearsPerRow:Tt,defaultCalendarMonth:At,components:Et,componentsProps:Ct,slots:Lt,slotProps:jt,loading:Rt,renderLoading:$t,disableHighlightToday:vt,readOnly:It,disabled:Ot,showDaysOutsideCurrentMonth:Wt,dayOfWeekFormatter:zt,sx:Ft,autoFocus:Nt,fixedWeekNumber:Ut,displayWeekNumber:Pt,timezone:Ht})=>jsxRuntimeExports.jsx(DateCalendar,{view:tt,onViewChange:et,views:nt.filter(isDatePickerView),focusedView:rt&&isDatePickerView(rt)?rt:null,onFocusedViewChange:it,value:ot,defaultValue:at,referenceDate:st,onChange:lt,className:ct,classes:ut,disableFuture:ht,disablePast:dt,minDate:pt,maxDate:mt,shouldDisableDate:gt,shouldDisableMonth:yt,shouldDisableYear:bt,reduceAnimations:wt,onMonthChange:xt,monthsPerRow:kt,onYearChange:St,yearsPerRow:Tt,defaultCalendarMonth:At,components:Et,componentsProps:Ct,slots:Lt,slotProps:jt,loading:Rt,renderLoading:$t,disableHighlightToday:vt,readOnly:It,disabled:Ot,showDaysOutsideCurrentMonth:Wt,dayOfWeekFormatter:zt,sx:Ft,autoFocus:Nt,fixedWeekNumber:Ut,displayWeekNumber:Pt,timezone:Ht}),DesktopDatePicker=reactExports.forwardRef(function(et,nt){var rt,it,ot,at;const st=useLocaleText(),lt=useUtils(),ct=useDatePickerDefaultizedProps(et,"MuiDesktopDatePicker"),ut=_extends$u({day:renderDateViewCalendar,month:renderDateViewCalendar,year:renderDateViewCalendar},ct.viewRenderers),ht=_extends$u({},ct,{viewRenderers:ut,format:resolveDateFormat(lt,ct,!1),yearsPerRow:(rt=ct.yearsPerRow)!=null?rt:4,slots:_extends$u({openPickerIcon:CalendarIcon,field:DateField},ct.slots),slotProps:_extends$u({},ct.slotProps,{field:pt=>{var mt;return _extends$u({},resolveComponentProps((mt=ct.slotProps)==null?void 0:mt.field,pt),extractValidationProps(ct),{ref:nt})},toolbar:_extends$u({hidden:!0},(it=ct.slotProps)==null?void 0:it.toolbar)})}),{renderPicker:dt}=useDesktopPicker({props:ht,valueManager:singleItemValueManager,valueType:"date",getOpenDialogAriaText:(ot=(at=ht.localeText)==null?void 0:at.openDatePickerDialogue)!=null?ot:st.openDatePickerDialogue,validator:validateDate});return dt()});DesktopDatePicker.propTypes={autoFocus:PropTypes.bool,className:PropTypes.string,closeOnSelect:PropTypes.bool,components:PropTypes.object,componentsProps:PropTypes.object,dayOfWeekFormatter:PropTypes.func,defaultCalendarMonth:PropTypes.any,defaultValue:PropTypes.any,disabled:PropTypes.bool,disableFuture:PropTypes.bool,disableHighlightToday:PropTypes.bool,disableOpenPicker:PropTypes.bool,disablePast:PropTypes.bool,displayWeekNumber:PropTypes.bool,fixedWeekNumber:PropTypes.number,format:PropTypes.string,formatDensity:PropTypes.oneOf(["dense","spacious"]),inputRef:refType$1,label:PropTypes.node,loading:PropTypes.bool,localeText:PropTypes.object,maxDate:PropTypes.any,minDate:PropTypes.any,monthsPerRow:PropTypes.oneOf([3,4]),onAccept:PropTypes.func,onChange:PropTypes.func,onClose:PropTypes.func,onError:PropTypes.func,onMonthChange:PropTypes.func,onOpen:PropTypes.func,onSelectedSectionsChange:PropTypes.func,onViewChange:PropTypes.func,onYearChange:PropTypes.func,open:PropTypes.bool,openTo:PropTypes.oneOf(["day","month","year"]),orientation:PropTypes.oneOf(["landscape","portrait"]),readOnly:PropTypes.bool,reduceAnimations:PropTypes.bool,referenceDate:PropTypes.any,renderLoading:PropTypes.func,selectedSections:PropTypes.oneOfType([PropTypes.oneOf(["all","day","hours","meridiem","minutes","month","seconds","weekDay","year"]),PropTypes.number,PropTypes.shape({endIndex:PropTypes.number.isRequired,startIndex:PropTypes.number.isRequired})]),shouldDisableDate:PropTypes.func,shouldDisableMonth:PropTypes.func,shouldDisableYear:PropTypes.func,showDaysOutsideCurrentMonth:PropTypes.bool,slotProps:PropTypes.object,slots:PropTypes.object,sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object]),timezone:PropTypes.string,value:PropTypes.any,view:PropTypes.oneOf(["day","month","year"]),viewRenderers:PropTypes.shape({day:PropTypes.func,month:PropTypes.func,year:PropTypes.func}),views:PropTypes.arrayOf(PropTypes.oneOf(["day","month","year"]).isRequired),yearsPerRow:PropTypes.oneOf([3,4])};const _excluded$k=["props","getOpenDialogAriaText"],useMobilePicker=tt=>{var et,nt,rt;let{props:it,getOpenDialogAriaText:ot}=tt,at=_objectWithoutPropertiesLoose$k(tt,_excluded$k);const{slots:st,slotProps:lt,className:ct,sx:ut,format:ht,formatDensity:dt,timezone:pt,label:mt,inputRef:gt,readOnly:yt,disabled:bt,localeText:wt}=it,xt=useUtils(),kt=reactExports.useRef(null),St=useId(),Tt=(et=lt==null||(nt=lt.toolbar)==null?void 0:nt.hidden)!=null?et:!1,{open:At,actions:Et,layoutProps:Ct,renderCurrentView:Lt,fieldProps:jt}=usePicker(_extends$u({},at,{props:it,inputRef:kt,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),Rt=st.field,$t=useSlotProps({elementType:Rt,externalSlotProps:lt==null?void 0:lt.field,additionalProps:_extends$u({},jt,Tt&&{id:St},!(bt||yt)&&{onClick:Et.onOpen,onKeyDown:onSpaceOrEnter(Et.onOpen)},{readOnly:yt??!0,disabled:bt,className:ct,sx:ut,format:ht,formatDensity:dt,timezone:pt,label:mt}),ownerState:it});$t.inputProps=_extends$u({},$t.inputProps,{"aria-label":ot(jt.value,xt)});const vt=_extends$u({textField:st.textField},$t.slots),It=(rt=st.layout)!=null?rt:PickersLayout,Ot=useForkRef(kt,$t.inputRef,gt);let Wt=St;Tt&&(mt?Wt=`${St}-label`:Wt=void 0);const zt=_extends$u({},lt,{toolbar:_extends$u({},lt==null?void 0:lt.toolbar,{titleId:St}),mobilePaper:_extends$u({"aria-labelledby":Wt},lt==null?void 0:lt.mobilePaper)});return{renderPicker:()=>jsxRuntimeExports.jsxs(LocalizationProvider,{localeText:wt,children:[jsxRuntimeExports.jsx(Rt,_extends$u({},$t,{slots:vt,slotProps:zt,inputRef:Ot})),jsxRuntimeExports.jsx(PickersModalDialog,_extends$u({},Et,{open:At,slots:st,slotProps:zt,children:jsxRuntimeExports.jsx(It,_extends$u({},Ct,zt==null?void 0:zt.layout,{slots:st,slotProps:zt,children:Lt()}))}))]})}},MobileDatePicker=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useLocaleText(),st=useUtils(),lt=useDatePickerDefaultizedProps(et,"MuiMobileDatePicker"),ct=_extends$u({day:renderDateViewCalendar,month:renderDateViewCalendar,year:renderDateViewCalendar},lt.viewRenderers),ut=_extends$u({},lt,{viewRenderers:ct,format:resolveDateFormat(st,lt,!1),slots:_extends$u({field:DateField},lt.slots),slotProps:_extends$u({},lt.slotProps,{field:dt=>{var pt;return _extends$u({},resolveComponentProps((pt=lt.slotProps)==null?void 0:pt.field,dt),extractValidationProps(lt),{ref:nt})},toolbar:_extends$u({hidden:!1},(rt=lt.slotProps)==null?void 0:rt.toolbar)})}),{renderPicker:ht}=useMobilePicker({props:ut,valueManager:singleItemValueManager,valueType:"date",getOpenDialogAriaText:(it=(ot=ut.localeText)==null?void 0:ot.openDatePickerDialogue)!=null?it:at.openDatePickerDialogue,validator:validateDate});return ht()});MobileDatePicker.propTypes={autoFocus:PropTypes.bool,className:PropTypes.string,closeOnSelect:PropTypes.bool,components:PropTypes.object,componentsProps:PropTypes.object,dayOfWeekFormatter:PropTypes.func,defaultCalendarMonth:PropTypes.any,defaultValue:PropTypes.any,disabled:PropTypes.bool,disableFuture:PropTypes.bool,disableHighlightToday:PropTypes.bool,disableOpenPicker:PropTypes.bool,disablePast:PropTypes.bool,displayWeekNumber:PropTypes.bool,fixedWeekNumber:PropTypes.number,format:PropTypes.string,formatDensity:PropTypes.oneOf(["dense","spacious"]),inputRef:refType$1,label:PropTypes.node,loading:PropTypes.bool,localeText:PropTypes.object,maxDate:PropTypes.any,minDate:PropTypes.any,monthsPerRow:PropTypes.oneOf([3,4]),onAccept:PropTypes.func,onChange:PropTypes.func,onClose:PropTypes.func,onError:PropTypes.func,onMonthChange:PropTypes.func,onOpen:PropTypes.func,onSelectedSectionsChange:PropTypes.func,onViewChange:PropTypes.func,onYearChange:PropTypes.func,open:PropTypes.bool,openTo:PropTypes.oneOf(["day","month","year"]),orientation:PropTypes.oneOf(["landscape","portrait"]),readOnly:PropTypes.bool,reduceAnimations:PropTypes.bool,referenceDate:PropTypes.any,renderLoading:PropTypes.func,selectedSections:PropTypes.oneOfType([PropTypes.oneOf(["all","day","hours","meridiem","minutes","month","seconds","weekDay","year"]),PropTypes.number,PropTypes.shape({endIndex:PropTypes.number.isRequired,startIndex:PropTypes.number.isRequired})]),shouldDisableDate:PropTypes.func,shouldDisableMonth:PropTypes.func,shouldDisableYear:PropTypes.func,showDaysOutsideCurrentMonth:PropTypes.bool,slotProps:PropTypes.object,slots:PropTypes.object,sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object]),timezone:PropTypes.string,value:PropTypes.any,view:PropTypes.oneOf(["day","month","year"]),viewRenderers:PropTypes.shape({day:PropTypes.func,month:PropTypes.func,year:PropTypes.func}),views:PropTypes.arrayOf(PropTypes.oneOf(["day","month","year"]).isRequired),yearsPerRow:PropTypes.oneOf([3,4])};const _excluded$j=["desktopModeMediaQuery"],DatePicker=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDatePicker"}),{desktopModeMediaQuery:it=DEFAULT_DESKTOP_MODE_MEDIA_QUERY}=rt,ot=_objectWithoutPropertiesLoose$k(rt,_excluded$j);return useMediaQuery(it,{defaultMatches:!0})?jsxRuntimeExports.jsx(DesktopDatePicker,_extends$u({ref:nt},ot)):jsxRuntimeExports.jsx(MobileDatePicker,_extends$u({ref:nt},ot))});var classnames={exports:{}};/*! +`));return typeof nt=="string"?{type:nt,contentType:nt==="meridiem"?"letter":"digit",maxLength:void 0}:{type:nt.sectionType,contentType:nt.contentType,maxLength:nt.maxLength}},getDeltaFromKeyCode=tt=>{switch(tt){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},getDaysInWeekStr=(tt,et,nt)=>{const rt=[],it=tt.dateWithTimezone(void 0,et),ot=tt.startOfWeek(it),at=tt.endOfWeek(it);let st=ot;for(;tt.isBefore(st,at);)rt.push(st),st=tt.addDays(st,1);return rt.map(lt=>tt.formatByString(lt,nt))},getLetterEditingOptions=(tt,et,nt,rt)=>{switch(nt){case"month":return getMonthsInYear(tt,tt.dateWithTimezone(void 0,et)).map(it=>tt.formatByString(it,rt));case"weekDay":return getDaysInWeekStr(tt,et,rt);case"meridiem":{const it=tt.dateWithTimezone(void 0,et);return[tt.startOfDay(it),tt.endOfDay(it)].map(ot=>tt.formatByString(ot,rt))}default:return[]}},cleanLeadingZeros=(tt,et,nt)=>{let rt=et;for(rt=Number(rt).toString();rt.length{if(it.type==="day"&&it.contentType==="digit-with-letter"){const at=tt.setDate(rt.longestMonth,nt);return tt.formatByString(at,it.format)}const ot=nt.toString();return it.hasLeadingZerosInInput?cleanLeadingZeros(tt,ot,it.maxLength):ot},adjustSectionValue=(tt,et,nt,rt,it,ot,at)=>{const st=getDeltaFromKeyCode(rt),lt=rt==="Home",ct=rt==="End",ut=nt.value===""||lt||ct,ht=()=>{const pt=it[nt.type]({currentDate:ot,format:nt.format,contentType:nt.contentType}),mt=wt=>cleanDigitSectionValue(tt,et,wt,pt,nt),gt=nt.type==="minutes"&&at!=null&&at.minutesStep?at.minutesStep:1;let bt=parseInt(nt.value,10)+st*gt;if(ut){if(nt.type==="year"&&!ct&&!lt)return tt.formatByString(tt.dateWithTimezone(void 0,et),nt.format);st>0||lt?bt=pt.minimum:bt=pt.maximum}return bt%gt!==0&&((st<0||lt)&&(bt+=gt-(gt+bt)%gt),(st>0||ct)&&(bt-=bt%gt)),bt>pt.maximum?mt(pt.minimum+(bt-pt.maximum-1)%(pt.maximum-pt.minimum+1)):bt{const pt=getLetterEditingOptions(tt,et,nt.type,nt.format);if(pt.length===0)return nt.value;if(ut)return st>0||lt?pt[0]:pt[pt.length-1];const gt=(pt.indexOf(nt.value)+pt.length+st)%pt.length;return pt[gt]};return nt.contentType==="digit"||nt.contentType==="digit-with-letter"?ht():dt()},getSectionVisibleValue=(tt,et)=>{let nt=tt.value||tt.placeholder;const rt=et==="non-input"?tt.hasLeadingZerosInFormat:tt.hasLeadingZerosInInput;return et==="non-input"&&tt.hasLeadingZerosInInput&&!tt.hasLeadingZerosInFormat&&(nt=Number(nt).toString()),["input-rtl","input-ltr"].includes(et)&&tt.contentType==="digit"&&!rt&&nt.length===1&&(nt=`${nt}‎`),et==="input-rtl"&&(nt=`⁨${nt}⁩`),nt},cleanString=tt=>tt.replace(/[\u2066\u2067\u2068\u2069]/g,""),addPositionPropertiesToSections=(tt,et)=>{let nt=0,rt=et?1:0;const it=[];for(let ot=0;ot{switch(rt.type){case"year":return nt.fieldYearPlaceholder({digitAmount:tt.formatByString(tt.dateWithTimezone(void 0,et),it).length});case"month":return nt.fieldMonthPlaceholder({contentType:rt.contentType});case"day":return nt.fieldDayPlaceholder();case"weekDay":return nt.fieldWeekDayPlaceholder({contentType:rt.contentType});case"hours":return nt.fieldHoursPlaceholder();case"minutes":return nt.fieldMinutesPlaceholder();case"seconds":return nt.fieldSecondsPlaceholder();case"meridiem":return nt.fieldMeridiemPlaceholder();default:return it}},changeSectionValueFormat=(tt,et,nt,rt)=>tt.formatByString(tt.parse(et,nt),rt),isFourDigitYearFormat=(tt,et,nt)=>tt.formatByString(tt.dateWithTimezone(void 0,et),nt).length===4,doesSectionFormatHaveLeadingZeros=(tt,et,nt,rt,it)=>{if(nt!=="digit")return!1;const ot=tt.dateWithTimezone(void 0,et);switch(rt){case"year":return isFourDigitYearFormat(tt,et,it)?tt.formatByString(tt.setYear(ot,1),it)==="0001":tt.formatByString(tt.setYear(ot,2001),it)==="01";case"month":return tt.formatByString(tt.startOfYear(ot),it).length>1;case"day":return tt.formatByString(tt.startOfMonth(ot),it).length>1;case"weekDay":return tt.formatByString(tt.startOfWeek(ot),it).length>1;case"hours":return tt.formatByString(tt.setHours(ot,1),it).length>1;case"minutes":return tt.formatByString(tt.setMinutes(ot,1),it).length>1;case"seconds":return tt.formatByString(tt.setSeconds(ot,1),it).length>1;default:throw new Error("Invalid section type")}},getEscapedPartsFromFormat=(tt,et)=>{const nt=[],{start:rt,end:it}=tt.escapedCharacters,ot=new RegExp(`(\\${rt}[^\\${it}]*\\${it})+`,"g");let at=null;for(;at=ot.exec(et);)nt.push({start:at.index,end:ot.lastIndex-1});return nt},splitFormatIntoSections=(tt,et,nt,rt,it,ot,at,st)=>{let lt="";const ct=[],ut=tt.date(),ht=xt=>{if(xt==="")return null;const kt=getDateSectionConfigFromFormatToken(tt,xt),St=doesSectionFormatHaveLeadingZeros(tt,et,kt.contentType,kt.type,xt),Tt=at?St:kt.contentType==="digit",At=it!=null&&tt.isValid(it);let Et=At?tt.formatByString(it,xt):"",Ct=null;if(Tt)if(St)Ct=Et===""?tt.formatByString(ut,xt).length:Et.length;else{if(kt.maxLength==null)throw new Error(`MUI: The token ${xt} should have a 'maxDigitNumber' property on it's adapter`);Ct=kt.maxLength,At&&(Et=cleanLeadingZeros(tt,Et,Ct))}return ct.push(_extends$u({},kt,{format:xt,maxLength:Ct,value:Et,placeholder:getSectionPlaceholder(tt,et,nt,kt,xt),hasLeadingZeros:St,hasLeadingZerosInFormat:St,hasLeadingZerosInInput:Tt,startSeparator:ct.length===0?lt:"",endSeparator:"",modified:!1})),null};let dt=10,pt=rt,mt=tt.expandFormat(rt);for(;mt!==pt;)if(pt=mt,mt=tt.expandFormat(pt),dt-=1,dt<0)throw new Error("MUI: The format expansion seems to be enter in an infinite loop. Please open an issue with the format passed to the picker component");const gt=mt,yt=getEscapedPartsFromFormat(tt,gt),bt=new RegExp(`^(${Object.keys(tt.formatTokenMap).sort((xt,kt)=>kt.length-xt.length).join("|")})`,"g");let wt="";for(let xt=0;xtCt.start<=xt&&Ct.end>=xt),St=gt[xt],Tt=kt!=null,At=`${wt}${gt.slice(xt)}`,Et=bt.test(At);!Tt&&St.match(/([A-Za-z]+)/)&&Et?(wt=At.slice(0,bt.lastIndex),xt+=bt.lastIndex-1):Tt&&(kt==null?void 0:kt.start)===xt||(kt==null?void 0:kt.end)===xt||(ht(wt),wt="",ct.length===0?lt+=St:ct[ct.length-1].endSeparator+=St)}return ht(wt),ct.map(xt=>{const kt=St=>{let Tt=St;return st&&Tt!==null&&Tt.includes(" ")&&(Tt=`⁩${Tt}⁦`),ot==="spacious"&&["/",".","-"].includes(Tt)&&(Tt=` ${Tt} `),Tt};return xt.startSeparator=kt(xt.startSeparator),xt.endSeparator=kt(xt.endSeparator),xt})},getDateFromDateSections=(tt,et)=>{const nt=et.some(st=>st.type==="day"),rt=[],it=[];for(let st=0;st{const rt=tt.map(it=>{const ot=getSectionVisibleValue(it,et?"input-rtl":"input-ltr");return`${it.startSeparator}${ot}${it.endSeparator}`}).join("");return et?`⁦${rt}⁩`:rt},getSectionsBoundaries=(tt,et)=>{const nt=tt.dateWithTimezone(void 0,et),rt=tt.endOfYear(nt),it=tt.endOfDay(nt),{maxDaysInMonth:ot,longestMonth:at}=getMonthsInYear(tt,nt).reduce((st,lt)=>{const ct=tt.getDaysInMonth(lt);return ct>st.maxDaysInMonth?{maxDaysInMonth:ct,longestMonth:lt}:st},{maxDaysInMonth:0,longestMonth:null});return{year:({format:st})=>({minimum:0,maximum:isFourDigitYearFormat(tt,et,st)?9999:99}),month:()=>({minimum:1,maximum:tt.getMonth(rt)+1}),day:({currentDate:st})=>({minimum:1,maximum:st!=null&&tt.isValid(st)?tt.getDaysInMonth(st):ot,longestMonth:at}),weekDay:({format:st,contentType:lt})=>{if(lt==="digit"){const ct=getDaysInWeekStr(tt,et,st).map(Number);return{minimum:Math.min(...ct),maximum:Math.max(...ct)}}return{minimum:1,maximum:7}},hours:({format:st})=>{const lt=tt.getHours(it);return tt.formatByString(tt.endOfDay(nt),st)!==lt.toString()?{minimum:1,maximum:Number(tt.formatByString(tt.startOfDay(nt),st))}:{minimum:0,maximum:lt}},minutes:()=>({minimum:0,maximum:tt.getMinutes(it)}),seconds:()=>({minimum:0,maximum:tt.getSeconds(it)}),meridiem:()=>({minimum:0,maximum:0})}},transferDateSectionValue=(tt,et,nt,rt,it)=>{switch(nt.type){case"year":return tt.setYear(it,tt.getYear(rt));case"month":return tt.setMonth(it,tt.getMonth(rt));case"weekDay":{const ot=getDaysInWeekStr(tt,et,nt.format),at=tt.formatByString(rt,nt.format),st=ot.indexOf(at),ct=ot.indexOf(nt.value)-st;return tt.addDays(rt,ct)}case"day":return tt.setDate(it,tt.getDate(rt));case"meridiem":{const ot=tt.getHours(rt)<12,at=tt.getHours(it);return ot&&at>=12?tt.addHours(it,-12):!ot&&at<12?tt.addHours(it,12):it}case"hours":return tt.setHours(it,tt.getHours(rt));case"minutes":return tt.setMinutes(it,tt.getMinutes(rt));case"seconds":return tt.setSeconds(it,tt.getSeconds(rt));default:return it}},reliableSectionModificationOrder={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8},mergeDateIntoReferenceDate=(tt,et,nt,rt,it,ot)=>[...rt].sort((at,st)=>reliableSectionModificationOrder[at.type]-reliableSectionModificationOrder[st.type]).reduce((at,st)=>!ot||st.modified?transferDateSectionValue(tt,et,st,nt,at):at,it),isAndroid=()=>navigator.userAgent.toLowerCase().indexOf("android")>-1,getSectionOrder=(tt,et)=>{const nt={};if(!et)return tt.forEach((lt,ct)=>{const ut=ct===0?null:ct-1,ht=ct===tt.length-1?null:ct+1;nt[ct]={leftIndex:ut,rightIndex:ht}}),{neighbors:nt,startIndex:0,endIndex:tt.length-1};const rt={},it={};let ot=0,at=0,st=tt.length-1;for(;st>=0;){at=tt.findIndex((lt,ct)=>{var ut;return ct>=ot&&((ut=lt.endSeparator)==null?void 0:ut.includes(" "))&<.endSeparator!==" / "}),at===-1&&(at=tt.length-1);for(let lt=at;lt>=ot;lt-=1)it[lt]=st,rt[st]=lt,st-=1;ot=at+1}return tt.forEach((lt,ct)=>{const ut=it[ct],ht=ut===0?null:rt[ut-1],dt=ut===tt.length-1?null:rt[ut+1];nt[ct]={leftIndex:ht,rightIndex:dt}}),{neighbors:nt,startIndex:rt[0],endIndex:rt[tt.length-1]}},_excluded$D=["value","referenceDate"],singleItemValueManager={emptyValue:null,getTodayValue:getTodayDate,getInitialReferenceValue:tt=>{let{value:et,referenceDate:nt}=tt,rt=_objectWithoutPropertiesLoose$k(tt,_excluded$D);return et!=null&&rt.utils.isValid(et)?et:nt??getDefaultReferenceDate(rt)},cleanValue:replaceInvalidDateByNull,areValuesEqual:areDatesEqual$1,isSameError:(tt,et)=>tt===et,hasError:tt=>tt!=null,defaultErrorState:null,getTimezone:(tt,et)=>et==null||!tt.isValid(et)?null:tt.getTimezone(et),setTimezone:(tt,et,nt)=>nt==null?null:tt.setTimezone(nt,et)},singleItemFieldValueManager={updateReferenceValue:(tt,et,nt)=>et==null||!tt.isValid(et)?nt:et,getSectionsFromValue:(tt,et,nt,rt,it)=>!tt.isValid(et)&&!!nt?nt:addPositionPropertiesToSections(it(et),rt),getValueStrFromSections:createDateStrForInputFromSections,getActiveDateManager:(tt,et)=>({date:et.value,referenceDate:et.referenceValue,getSections:nt=>nt,getNewValuesFromNewActiveDate:nt=>({value:nt,referenceValue:nt==null||!tt.isValid(nt)?et.referenceValue:nt})}),parseValueStr:(tt,et,nt)=>nt(tt.trim(),et)},uncapitalizeObjectKeys=tt=>{if(tt!==void 0)return Object.keys(tt).reduce((et,nt)=>_extends$u({},et,{[`${nt.slice(0,1).toLowerCase()}${nt.slice(1)}`]:tt[nt]}),{})};function getPickersDayUtilityClass(tt){return generateUtilityClass("MuiPickersDay",tt)}const pickersDayClasses=generateUtilityClasses("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),_excluded$C=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],useUtilityClasses$e=tt=>{const{selected:et,disableMargin:nt,disableHighlightToday:rt,today:it,disabled:ot,outsideCurrentMonth:at,showDaysOutsideCurrentMonth:st,classes:lt}=tt,ct=at&&!st;return composeClasses({root:["root",et&&!ct&&"selected",ot&&"disabled",!nt&&"dayWithMargin",!rt&&it&&"today",at&&st&&"dayOutsideMonth",ct&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},getPickersDayUtilityClass,lt)},styleArg=({theme:tt,ownerState:et})=>_extends$u({},tt.typography.caption,{width:DAY_SIZE,height:DAY_SIZE,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.short}),color:(tt.vars||tt).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.focusOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.focusOpacity),[`&.${pickersDayClasses.selected}`]:{willChange:"background-color",backgroundColor:(tt.vars||tt).palette.primary.dark}},[`&.${pickersDayClasses.selected}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.main,fontWeight:tt.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(tt.vars||tt).palette.primary.dark}},[`&.${pickersDayClasses.disabled}:not(.${pickersDayClasses.selected})`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${pickersDayClasses.disabled}&.${pickersDayClasses.selected}`]:{opacity:.6}},!et.disableMargin&&{margin:`0 ${DAY_MARGIN}px`},et.outsideCurrentMonth&&et.showDaysOutsideCurrentMonth&&{color:(tt.vars||tt).palette.text.secondary},!et.disableHighlightToday&&et.today&&{[`&:not(.${pickersDayClasses.selected})`]:{border:`1px solid ${(tt.vars||tt).palette.text.secondary}`}}),overridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disableMargin&&et.dayWithMargin,!nt.disableHighlightToday&&nt.today&&et.today,!nt.outsideCurrentMonth&&nt.showDaysOutsideCurrentMonth&&et.dayOutsideMonth,nt.outsideCurrentMonth&&!nt.showDaysOutsideCurrentMonth&&et.hiddenDaySpacingFiller]},PickersDayRoot=styled$1(ButtonBase$1,{name:"MuiPickersDay",slot:"Root",overridesResolver})(styleArg),PickersDayFiller=styled$1("div",{name:"MuiPickersDay",slot:"Root",overridesResolver})(({theme:tt,ownerState:et})=>_extends$u({},styleArg({theme:tt,ownerState:et}),{opacity:0,pointerEvents:"none"})),noop$5=()=>{},PickersDayRaw=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiPickersDay"}),{autoFocus:it=!1,className:ot,day:at,disabled:st=!1,disableHighlightToday:lt=!1,disableMargin:ct=!1,isAnimating:ut,onClick:ht,onDaySelect:dt,onFocus:pt=noop$5,onBlur:mt=noop$5,onKeyDown:gt=noop$5,onMouseDown:yt=noop$5,onMouseEnter:bt=noop$5,outsideCurrentMonth:wt,selected:xt=!1,showDaysOutsideCurrentMonth:kt=!1,children:St,today:Tt=!1}=rt,At=_objectWithoutPropertiesLoose$k(rt,_excluded$C),Et=_extends$u({},rt,{autoFocus:it,disabled:st,disableHighlightToday:lt,disableMargin:ct,selected:xt,showDaysOutsideCurrentMonth:kt,today:Tt}),Ct=useUtilityClasses$e(Et),Lt=useUtils(),jt=reactExports.useRef(null),Rt=useForkRef(jt,nt);useEnhancedEffect$1(()=>{it&&!st&&!ut&&!wt&&jt.current.focus()},[it,st,ut,wt]);const $t=It=>{yt(It),wt&&It.preventDefault()},vt=It=>{st||dt(at),wt&&It.currentTarget.focus(),ht&&ht(It)};return wt&&!kt?jsxRuntimeExports.jsx(PickersDayFiller,{className:clsx(Ct.root,Ct.hiddenDaySpacingFiller,ot),ownerState:Et,role:At.role}):jsxRuntimeExports.jsx(PickersDayRoot,_extends$u({className:clsx(Ct.root,ot),ref:Rt,centerRipple:!0,disabled:st,tabIndex:xt?0:-1,onKeyDown:It=>gt(It,at),onFocus:It=>pt(It,at),onBlur:It=>mt(It,at),onMouseEnter:It=>bt(It,at),onClick:vt,onMouseDown:$t},At,{ownerState:Et,children:St||Lt.format(at,"dayOfMonth")}))}),PickersDay=reactExports.memo(PickersDayRaw);function useValidation(tt,et,nt,rt){const{value:it,onError:ot}=tt,at=useLocalizationContext(),st=reactExports.useRef(rt),lt=et({adapter:at,value:it,props:tt});return reactExports.useEffect(()=>{ot&&!nt(lt,st.current)&&ot(lt,it),st.current=lt},[nt,ot,st,lt,it]),lt}const useFieldState=tt=>{const et=useUtils(),nt=useLocaleText(),rt=useLocalizationContext(),ot=useTheme().direction==="rtl",{valueManager:at,fieldValueManager:st,valueType:lt,validator:ct,internalProps:ut,internalProps:{value:ht,defaultValue:dt,referenceDate:pt,onChange:mt,format:gt,formatDensity:yt="dense",selectedSections:bt,onSelectedSectionsChange:wt,shouldRespectLeadingZeros:xt=!1,timezone:kt}}=tt,{timezone:St,value:Tt,handleValueChange:At}=useValueWithTimezone({timezone:kt,value:ht,defaultValue:dt,onChange:mt,valueManager:at}),Et=reactExports.useMemo(()=>getSectionsBoundaries(et,St),[et,St]),Ct=reactExports.useCallback((Qt,an=null)=>st.getSectionsFromValue(et,Qt,an,ot,Yt=>splitFormatIntoSections(et,St,nt,gt,Yt,yt,xt,ot)),[st,gt,nt,ot,xt,et,yt,St]),Lt=reactExports.useMemo(()=>st.getValueStrFromSections(Ct(at.emptyValue),ot),[st,Ct,at.emptyValue,ot]),[jt,Rt]=reactExports.useState(()=>{const Qt=Ct(Tt),an={sections:Qt,value:Tt,referenceValue:at.emptyValue,tempValueStrAndroid:null},Yt=getSectionTypeGranularity(Qt),nn=at.getInitialReferenceValue({referenceDate:pt,value:Tt,utils:et,props:ut,granularity:Yt,timezone:St});return _extends$u({},an,{referenceValue:nn})}),[$t,vt]=useControlled({controlled:bt,default:null,name:"useField",state:"selectedSectionIndexes"}),It=Qt=>{vt(Qt),wt==null||wt(Qt),Rt(an=>_extends$u({},an,{selectedSectionQuery:null}))},Ot=reactExports.useMemo(()=>{if($t==null)return null;if($t==="all")return{startIndex:0,endIndex:jt.sections.length-1,shouldSelectBoundarySelectors:!0};if(typeof $t=="number")return{startIndex:$t,endIndex:$t};if(typeof $t=="string"){const Qt=jt.sections.findIndex(an=>an.type===$t);return{startIndex:Qt,endIndex:Qt}}return $t},[$t,jt.sections]),Wt=({value:Qt,referenceValue:an,sections:Yt})=>{if(Rt(tn=>_extends$u({},tn,{sections:Yt,value:Qt,referenceValue:an,tempValueStrAndroid:null})),at.areValuesEqual(et,jt.value,Qt))return;const nn={validationError:ct({adapter:rt,value:Qt,props:_extends$u({},ut,{value:Qt,timezone:St})})};At(Qt,nn)},zt=(Qt,an)=>{const Yt=[...jt.sections];return Yt[Qt]=_extends$u({},Yt[Qt],{value:an,modified:!0}),addPositionPropertiesToSections(Yt,ot)},Ft=()=>{Wt({value:at.emptyValue,referenceValue:jt.referenceValue,sections:Ct(at.emptyValue)})},Nt=()=>{if(Ot==null)return;const Qt=jt.sections[Ot.startIndex],an=st.getActiveDateManager(et,jt,Qt),nn=an.getSections(jt.sections).filter(rn=>rn.value!=="").length===(Qt.value===""?0:1),tn=zt(Ot.startIndex,""),dn=nn?null:et.date(new Date("")),wn=an.getNewValuesFromNewActiveDate(dn);(dn!=null&&!et.isValid(dn))!=(an.date!=null&&!et.isValid(an.date))?Wt(_extends$u({},wn,{sections:tn})):Rt(rn=>_extends$u({},rn,wn,{sections:tn,tempValueStrAndroid:null}))},Ut=Qt=>{const an=(tn,dn)=>{const wn=et.parse(tn,gt);if(wn==null||!et.isValid(wn))return null;const rn=splitFormatIntoSections(et,St,nt,gt,wn,yt,xt,ot);return mergeDateIntoReferenceDate(et,St,wn,rn,dn,!1)},Yt=st.parseValueStr(Qt,jt.referenceValue,an),nn=st.updateReferenceValue(et,Yt,jt.referenceValue);Wt({value:Yt,referenceValue:nn,sections:Ct(Yt,jt.sections)})},Pt=({activeSection:Qt,newSectionValue:an,shouldGoToNextSection:Yt})=>{Yt&&Ot&&Ot.startIndex_extends$u({},vn,rn,{sections:tn,tempValueStrAndroid:null}))},Ht=Qt=>Rt(an=>_extends$u({},an,{tempValueStrAndroid:Qt}));return reactExports.useEffect(()=>{const Qt=Ct(jt.value);Rt(an=>_extends$u({},an,{sections:Qt}))},[gt,et.locale]),reactExports.useEffect(()=>{let Qt=!1;at.areValuesEqual(et,jt.value,Tt)?Qt=at.getTimezone(et,jt.value)!==at.getTimezone(et,Tt):Qt=!0,Qt&&Rt(an=>_extends$u({},an,{value:Tt,referenceValue:st.updateReferenceValue(et,Tt,an.referenceValue),sections:Ct(Tt)}))},[Tt]),{state:jt,selectedSectionIndexes:Ot,setSelectedSections:It,clearValue:Ft,clearActiveSection:Nt,updateSectionValue:Pt,updateValueFromValueStr:Ut,setTempAndroidValueStr:Ht,sectionsValueBoundaries:Et,placeholder:Lt,timezone:St}},QUERY_LIFE_DURATION_MS=5e3,isQueryResponseWithoutValue=tt=>tt.saveQuery!=null,useFieldCharacterEditing=({sections:tt,updateSectionValue:et,sectionsValueBoundaries:nt,setTempAndroidValueStr:rt,timezone:it})=>{const ot=useUtils(),[at,st]=reactExports.useState(null),lt=useEventCallback(()=>st(null));reactExports.useEffect(()=>{var pt;at!=null&&((pt=tt[at.sectionIndex])==null?void 0:pt.type)!==at.sectionType&<()},[tt,at,lt]),reactExports.useEffect(()=>{if(at!=null){const pt=setTimeout(()=>lt(),QUERY_LIFE_DURATION_MS);return()=>{window.clearTimeout(pt)}}return()=>{}},[at,lt]);const ct=({keyPressed:pt,sectionIndex:mt},gt,yt)=>{const bt=pt.toLowerCase(),wt=tt[mt];if(at!=null&&(!yt||yt(at.value))&&at.sectionIndex===mt){const kt=`${at.value}${bt}`,St=gt(kt,wt);if(!isQueryResponseWithoutValue(St))return st({sectionIndex:mt,value:kt,sectionType:wt.type}),St}const xt=gt(bt,wt);return isQueryResponseWithoutValue(xt)&&!xt.saveQuery?(lt(),null):(st({sectionIndex:mt,value:bt,sectionType:wt.type}),isQueryResponseWithoutValue(xt)?null:xt)},ut=pt=>{const mt=(bt,wt,xt)=>{const kt=wt.filter(St=>St.toLowerCase().startsWith(xt));return kt.length===0?{saveQuery:!1}:{sectionValue:kt[0],shouldGoToNextSection:kt.length===1}},gt=(bt,wt,xt,kt)=>{const St=Tt=>getLetterEditingOptions(ot,it,wt.type,Tt);if(wt.contentType==="letter")return mt(wt.format,St(wt.format),bt);if(xt&&kt!=null&&getDateSectionConfigFromFormatToken(ot,xt).contentType==="letter"){const Tt=St(xt),At=mt(xt,Tt,bt);return isQueryResponseWithoutValue(At)?{saveQuery:!1}:_extends$u({},At,{sectionValue:kt(At.sectionValue,Tt)})}return{saveQuery:!1}};return ct(pt,(bt,wt)=>{switch(wt.type){case"month":{const xt=kt=>changeSectionValueFormat(ot,kt,ot.formats.month,wt.format);return gt(bt,wt,ot.formats.month,xt)}case"weekDay":{const xt=(kt,St)=>St.indexOf(kt).toString();return gt(bt,wt,ot.formats.weekday,xt)}case"meridiem":return gt(bt,wt);default:return{saveQuery:!1}}})},ht=pt=>{const mt=(yt,bt)=>{const wt=+`${yt}`,xt=nt[bt.type]({currentDate:null,format:bt.format,contentType:bt.contentType});if(wt>xt.maximum)return{saveQuery:!1};if(wtxt.maximum||yt.length===xt.maximum.toString().length;return{sectionValue:cleanDigitSectionValue(ot,it,wt,xt,bt),shouldGoToNextSection:kt}};return ct(pt,(yt,bt)=>{if(bt.contentType==="digit"||bt.contentType==="digit-with-letter")return mt(yt,bt);if(bt.type==="month"){const wt=doesSectionFormatHaveLeadingZeros(ot,it,"digit","month","MM"),xt=mt(yt,{type:bt.type,format:"MM",hasLeadingZerosInFormat:wt,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(isQueryResponseWithoutValue(xt))return xt;const kt=changeSectionValueFormat(ot,xt.sectionValue,"MM",bt.format);return _extends$u({},xt,{sectionValue:kt})}if(bt.type==="weekDay"){const wt=mt(yt,bt);if(isQueryResponseWithoutValue(wt))return wt;const xt=getDaysInWeekStr(ot,it,bt.format)[Number(wt.sectionValue)-1];return _extends$u({},wt,{sectionValue:xt})}return{saveQuery:!1}},yt=>!Number.isNaN(Number(yt)))};return{applyCharacterEditing:useEventCallback(pt=>{const mt=tt[pt.sectionIndex],yt=!Number.isNaN(Number(pt.keyPressed))?ht(pt):ut(pt);yt==null?rt(null):et({activeSection:mt,newSectionValue:yt.sectionValue,shouldGoToNextSection:yt.shouldGoToNextSection})}),resetCharacterQuery:lt}};function arrayIncludes$2(tt,et){return Array.isArray(et)?et.every(nt=>tt.indexOf(nt)!==-1):tt.indexOf(et)!==-1}const onSpaceOrEnter=(tt,et)=>nt=>{(nt.key==="Enter"||nt.key===" ")&&(tt(nt),nt.preventDefault(),nt.stopPropagation()),et&&et(nt)},getActiveElement=(tt=document)=>{const et=tt.activeElement;return et?et.shadowRoot?getActiveElement(et.shadowRoot):et:null},DEFAULT_DESKTOP_MODE_MEDIA_QUERY="@media (pointer: fine)",_excluded$B=["onClick","onKeyDown","onFocus","onBlur","onMouseUp","onPaste","error","clearable","onClear","disabled"],useField=tt=>{const et=useUtils(),{state:nt,selectedSectionIndexes:rt,setSelectedSections:it,clearValue:ot,clearActiveSection:at,updateSectionValue:st,updateValueFromValueStr:lt,setTempAndroidValueStr:ct,sectionsValueBoundaries:ut,placeholder:ht,timezone:dt}=useFieldState(tt),{inputRef:pt,internalProps:mt,internalProps:{readOnly:gt=!1,unstableFieldRef:yt,minutesStep:bt},forwardedProps:{onClick:wt,onKeyDown:xt,onFocus:kt,onBlur:St,onMouseUp:Tt,onPaste:At,error:Et,clearable:Ct,onClear:Lt,disabled:jt},fieldValueManager:Rt,valueManager:$t,validator:vt}=tt,It=_objectWithoutPropertiesLoose$k(tt.forwardedProps,_excluded$B),{applyCharacterEditing:Ot,resetCharacterQuery:Wt}=useFieldCharacterEditing({sections:nt.sections,updateSectionValue:st,sectionsValueBoundaries:ut,setTempAndroidValueStr:ct,timezone:dt}),zt=reactExports.useRef(null),Ft=useForkRef(pt,zt),Nt=reactExports.useRef(void 0),Pt=useTheme().direction==="rtl",Ht=reactExports.useMemo(()=>getSectionOrder(nt.sections,Pt),[nt.sections,Pt]),Qt=()=>{var Tn;if(gt){it(null);return}const In=(Tn=zt.current.selectionStart)!=null?Tn:0;let yn;In<=nt.sections[0].startInInput||In>=nt.sections[nt.sections.length-1].endInInput?yn=1:yn=nt.sections.findIndex(fn=>fn.startInInput-fn.startSeparator.length>In);const hn=yn===-1?nt.sections.length-1:yn-1;it(hn)},an=useEventCallback((Tn,...In)=>{Tn.isDefaultPrevented()||(wt==null||wt(Tn,...In),Qt())}),Yt=useEventCallback(Tn=>{Tt==null||Tt(Tn),Tn.preventDefault()}),nn=useEventCallback((...Tn)=>{kt==null||kt(...Tn);const In=zt.current;window.clearTimeout(Nt.current),Nt.current=setTimeout(()=>{!In||In!==zt.current||rt!=null||gt||(In.value.length&&Number(In.selectionEnd)-Number(In.selectionStart)===In.value.length?it("all"):Qt())})}),tn=useEventCallback((...Tn)=>{St==null||St(...Tn),it(null)}),dn=useEventCallback(Tn=>{if(At==null||At(Tn),gt){Tn.preventDefault();return}const In=Tn.clipboardData.getData("text");if(rt&&rt.startIndex===rt.endIndex){const yn=nt.sections[rt.startIndex],hn=/^[a-zA-Z]+$/.test(In),fn=/^[0-9]+$/.test(In),xn=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(In);if(yn.contentType==="letter"&&hn||yn.contentType==="digit"&&fn||yn.contentType==="digit-with-letter"&&xn)return;if(hn||fn){Tn.preventDefault();return}}Tn.preventDefault(),Wt(),lt(In)}),wn=useEventCallback(Tn=>{if(gt)return;const In=Tn.target.value;if(In===""){Wt(),ot();return}const yn=Tn.nativeEvent.data,hn=yn&&yn.length>1,fn=hn?yn:In,xn=cleanString(fn);if(rt==null||hn){lt(hn?yn:xn);return}let jn;if(rt.startIndex===0&&rt.endIndex===nt.sections.length-1&&xn.length===1)jn=xn;else{const cn=cleanString(Rt.getValueStrFromSections(nt.sections,Pt));let Xt=-1,Kt=-1;for(let Bn=0;Bnkn.end)return;const On=xn.length-cn.length+kn.end-cleanString(kn.endSeparator||"").length;jn=xn.slice(kn.start+cleanString(kn.startSeparator||"").length,On)}if(jn.length===0){isAndroid()?ct(fn):(Wt(),at());return}Ot({keyPressed:jn,sectionIndex:rt.startIndex})}),rn=useEventCallback(Tn=>{switch(xt==null||xt(Tn),!0){case(Tn.key==="a"&&(Tn.ctrlKey||Tn.metaKey)):{Tn.preventDefault(),it("all");break}case Tn.key==="ArrowRight":{if(Tn.preventDefault(),rt==null)it(Ht.startIndex);else if(rt.startIndex!==rt.endIndex)it(rt.endIndex);else{const In=Ht.neighbors[rt.startIndex].rightIndex;In!==null&&it(In)}break}case Tn.key==="ArrowLeft":{if(Tn.preventDefault(),rt==null)it(Ht.endIndex);else if(rt.startIndex!==rt.endIndex)it(rt.startIndex);else{const In=Ht.neighbors[rt.startIndex].leftIndex;In!==null&&it(In)}break}case Tn.key==="Delete":{if(Tn.preventDefault(),gt)break;rt==null||rt.startIndex===0&&rt.endIndex===nt.sections.length-1?ot():at(),Wt();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(Tn.key):{if(Tn.preventDefault(),gt||rt==null)break;const In=nt.sections[rt.startIndex],yn=Rt.getActiveDateManager(et,nt,In),hn=adjustSectionValue(et,dt,In,Tn.key,ut,yn.date,{minutesStep:bt});st({activeSection:In,newSectionValue:hn,shouldGoToNextSection:!1});break}}});useEnhancedEffect$1(()=>{if(!zt.current)return;if(rt==null){zt.current.scrollLeft&&(zt.current.scrollLeft=0);return}const Tn=nt.sections[rt.startIndex],In=nt.sections[rt.endIndex];let yn=Tn.startInInput,hn=In.endInInput;if(rt.shouldSelectBoundarySelectors&&(yn-=Tn.startSeparator.length,hn+=In.endSeparator.length),yn!==zt.current.selectionStart||hn!==zt.current.selectionEnd){const fn=zt.current.scrollTop;zt.current===getActiveElement(document)&&zt.current.setSelectionRange(yn,hn),zt.current.scrollTop=fn}});const Zt=useValidation(_extends$u({},mt,{value:nt.value,timezone:dt}),vt,$t.isSameError,$t.defaultErrorState),vn=reactExports.useMemo(()=>Et!==void 0?Et:$t.hasError(Zt),[$t,Zt,Et]);reactExports.useEffect(()=>{!vn&&!rt&&Wt()},[nt.referenceValue,rt,vn]),reactExports.useEffect(()=>(zt.current&&zt.current===document.activeElement&&it("all"),()=>window.clearTimeout(Nt.current)),[]),reactExports.useEffect(()=>{nt.tempValueStrAndroid!=null&&rt!=null&&(Wt(),at())},[nt.tempValueStrAndroid]);const Cn=reactExports.useMemo(()=>{var Tn;return(Tn=nt.tempValueStrAndroid)!=null?Tn:Rt.getValueStrFromSections(nt.sections,Pt)},[nt.sections,Rt,nt.tempValueStrAndroid,Pt]),$n=reactExports.useMemo(()=>rt==null||nt.sections[rt.startIndex].contentType==="letter"?"text":"numeric",[rt,nt.sections]),Nn=zt.current&&zt.current===getActiveElement(document),En=$t.areValuesEqual(et,nt.value,$t.emptyValue),sn=!Nn&&En;reactExports.useImperativeHandle(yt,()=>({getSections:()=>nt.sections,getActiveSectionIndex:()=>{var Tn,In;const yn=(Tn=zt.current.selectionStart)!=null?Tn:0,hn=(In=zt.current.selectionEnd)!=null?In:0;if(yn===0&&hn===0)return null;const fn=yn<=nt.sections[0].startInInput?1:nt.sections.findIndex(xn=>xn.startInInput-xn.startSeparator.length>yn);return fn===-1?nt.sections.length-1:fn-1},setSelectedSections:Tn=>it(Tn)}));const pn=useEventCallback((Tn,...In)=>{var yn;Tn.preventDefault(),Lt==null||Lt(Tn,...In),ot(),zt==null||(yn=zt.current)==null||yn.focus(),it(0)});return _extends$u({placeholder:ht,autoComplete:"off",disabled:!!jt},It,{value:sn?"":Cn,inputMode:$n,readOnly:gt,onClick:an,onFocus:nn,onBlur:tn,onPaste:dn,onChange:wn,onKeyDown:rn,onMouseUp:Yt,onClear:pn,error:vn,ref:Ft,clearable:!!(Ct&&!En&&!gt&&!jt)})},validateDate=({props:tt,value:et,adapter:nt})=>{if(et===null)return null;const{shouldDisableDate:rt,shouldDisableMonth:it,shouldDisableYear:ot,disablePast:at,disableFuture:st,timezone:lt}=tt,ct=nt.utils.dateWithTimezone(void 0,lt),ut=applyDefaultDate(nt.utils,tt.minDate,nt.defaultDates.minDate),ht=applyDefaultDate(nt.utils,tt.maxDate,nt.defaultDates.maxDate);switch(!0){case!nt.utils.isValid(et):return"invalidDate";case!!(rt&&rt(et)):return"shouldDisableDate";case!!(it&&it(et)):return"shouldDisableMonth";case!!(ot&&ot(et)):return"shouldDisableYear";case!!(st&&nt.utils.isAfterDay(et,ct)):return"disableFuture";case!!(at&&nt.utils.isBeforeDay(et,ct)):return"disablePast";case!!(ut&&nt.utils.isBeforeDay(et,ut)):return"minDate";case!!(ht&&nt.utils.isAfterDay(et,ht)):return"maxDate";default:return null}},DATE_VALIDATION_PROP_NAMES=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],TIME_VALIDATION_PROP_NAMES=["disablePast","disableFuture","minTime","maxTime","shouldDisableClock","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],DATE_TIME_VALIDATION_PROP_NAMES=["minDateTime","maxDateTime"],VALIDATION_PROP_NAMES=[...DATE_VALIDATION_PROP_NAMES,...TIME_VALIDATION_PROP_NAMES,...DATE_TIME_VALIDATION_PROP_NAMES],extractValidationProps=tt=>VALIDATION_PROP_NAMES.reduce((et,nt)=>(tt.hasOwnProperty(nt)&&(et[nt]=tt[nt]),et),{}),SHARED_FIELD_INTERNAL_PROP_NAMES=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","readOnly","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef"],splitFieldInternalAndForwardedProps=(tt,et)=>{const nt=_extends$u({},tt),rt={},it=ot=>{nt.hasOwnProperty(ot)&&(rt[ot]=nt[ot],delete nt[ot])};return SHARED_FIELD_INTERNAL_PROP_NAMES.forEach(it),et==="date"?DATE_VALIDATION_PROP_NAMES.forEach(it):et==="time"?TIME_VALIDATION_PROP_NAMES.forEach(it):et==="date-time"&&(DATE_VALIDATION_PROP_NAMES.forEach(it),TIME_VALIDATION_PROP_NAMES.forEach(it),DATE_TIME_VALIDATION_PROP_NAMES.forEach(it)),{forwardedProps:nt,internalProps:rt}},useDefaultizedDateField=tt=>{var et,nt,rt;const it=useUtils(),ot=useDefaultDates();return _extends$u({},tt,{disablePast:(et=tt.disablePast)!=null?et:!1,disableFuture:(nt=tt.disableFuture)!=null?nt:!1,format:(rt=tt.format)!=null?rt:it.formats.keyboardDate,minDate:applyDefaultDate(it,tt.minDate,ot.minDate),maxDate:applyDefaultDate(it,tt.maxDate,ot.maxDate)})},useDateField=({props:tt,inputRef:et})=>{const nt=useDefaultizedDateField(tt),{forwardedProps:rt,internalProps:it}=splitFieldInternalAndForwardedProps(nt,"date");return useField({inputRef:et,forwardedProps:rt,internalProps:it,valueManager:singleItemValueManager,fieldValueManager:singleItemFieldValueManager,validator:validateDate,valueType:"date"})},PickersModalDialogRoot=styled$1(MuiDialog)({[`& .${dialogClasses$1.container}`]:{outline:0},[`& .${dialogClasses$1.paper}`]:{outline:0,minWidth:DIALOG_WIDTH}}),PickersModalDialogContent=styled$1(DialogContent$1)({"&:first-of-type":{padding:0}});function PickersModalDialog(tt){var et,nt;const{children:rt,onDismiss:it,open:ot,slots:at,slotProps:st}=tt,lt=(et=at==null?void 0:at.dialog)!=null?et:PickersModalDialogRoot,ct=(nt=at==null?void 0:at.mobileTransition)!=null?nt:Fade$1;return jsxRuntimeExports.jsx(lt,_extends$u({open:ot,onClose:it},st==null?void 0:st.dialog,{TransitionComponent:ct,TransitionProps:st==null?void 0:st.mobileTransition,PaperComponent:at==null?void 0:at.mobilePaper,PaperProps:st==null?void 0:st.mobilePaper,children:jsxRuntimeExports.jsx(PickersModalDialogContent,{children:rt})}))}function getPickersPopperUtilityClass(tt){return generateUtilityClass("MuiPickersPopper",tt)}generateUtilityClasses("MuiPickersPopper",["root","paper"]);const PREFERS_REDUCED_MOTION="@media (prefers-reduced-motion: reduce)",mobileVersionMatches=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),androidVersion=mobileVersionMatches&&mobileVersionMatches[1]?parseInt(mobileVersionMatches[1],10):null,iOSVersion=mobileVersionMatches&&mobileVersionMatches[2]?parseInt(mobileVersionMatches[2],10):null,slowAnimationDevices=androidVersion&&androidVersion<10||iOSVersion&&iOSVersion<13||!1,useDefaultReduceAnimations=()=>useMediaQuery(PREFERS_REDUCED_MOTION,{defaultMatches:!1})||slowAnimationDevices,_excluded$A=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],useUtilityClasses$d=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"]},getPickersPopperUtilityClass,et)},PickersPopperRoot=styled$1(MuiPopper,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(tt,et)=>et.root})(({theme:tt})=>({zIndex:tt.zIndex.modal})),PickersPopperPaper=styled$1(Paper$1,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(tt,et)=>et.paper})(({ownerState:tt})=>_extends$u({outline:0,transformOrigin:"top center"},tt.placement.includes("top")&&{transformOrigin:"bottom center"}));function clickedRootScrollbar(tt,et){return et.documentElement.clientWidth{if(!tt)return;function lt(){ot.current=!0}return document.addEventListener("mousedown",lt,!0),document.addEventListener("touchstart",lt,!0),()=>{document.removeEventListener("mousedown",lt,!0),document.removeEventListener("touchstart",lt,!0),ot.current=!1}},[tt]);const at=useEventCallback(lt=>{if(!ot.current)return;const ct=rt.current;rt.current=!1;const ut=ownerDocument(it.current);if(!it.current||"clientX"in lt&&clickedRootScrollbar(lt,ut))return;if(nt.current){nt.current=!1;return}let ht;lt.composedPath?ht=lt.composedPath().indexOf(it.current)>-1:ht=!ut.documentElement.contains(lt.target)||it.current.contains(lt.target),!ht&&!ct&&et(lt)}),st=()=>{rt.current=!0};return reactExports.useEffect(()=>{if(tt){const lt=ownerDocument(it.current),ct=()=>{nt.current=!0};return lt.addEventListener("touchstart",at),lt.addEventListener("touchmove",ct),()=>{lt.removeEventListener("touchstart",at),lt.removeEventListener("touchmove",ct)}}},[tt,at]),reactExports.useEffect(()=>{if(tt){const lt=ownerDocument(it.current);return lt.addEventListener("click",at),()=>{lt.removeEventListener("click",at),rt.current=!1}}},[tt,at]),[it,st,st]}const PickersPopperPaperWrapper=reactExports.forwardRef((tt,et)=>{const{PaperComponent:nt,popperPlacement:rt,ownerState:it,children:ot,paperSlotProps:at,paperClasses:st,onPaperClick:lt,onPaperTouchStart:ct}=tt,ut=_objectWithoutPropertiesLoose$k(tt,_excluded$A),ht=_extends$u({},it,{placement:rt}),dt=useSlotProps({elementType:nt,externalSlotProps:at,additionalProps:{tabIndex:-1,elevation:8,ref:et},className:st,ownerState:ht});return jsxRuntimeExports.jsx(nt,_extends$u({},ut,dt,{onClick:pt=>{var mt;lt(pt),(mt=dt.onClick)==null||mt.call(dt,pt)},onTouchStart:pt=>{var mt;ct(pt),(mt=dt.onTouchStart)==null||mt.call(dt,pt)},ownerState:ht,children:ot}))});function PickersPopper(tt){var et,nt,rt,it;const ot=useThemeProps({props:tt,name:"MuiPickersPopper"}),{anchorEl:at,children:st,containerRef:lt=null,shouldRestoreFocus:ct,onBlur:ut,onDismiss:ht,open:dt,role:pt,placement:mt,slots:gt,slotProps:yt,reduceAnimations:bt}=ot;reactExports.useEffect(()=>{function Ft(Nt){dt&&(Nt.key==="Escape"||Nt.key==="Esc")&&ht()}return document.addEventListener("keydown",Ft),()=>{document.removeEventListener("keydown",Ft)}},[ht,dt]);const wt=reactExports.useRef(null);reactExports.useEffect(()=>{pt==="tooltip"||ct&&!ct()||(dt?wt.current=getActiveElement(document):wt.current&&wt.current instanceof HTMLElement&&setTimeout(()=>{wt.current instanceof HTMLElement&&wt.current.focus()}))},[dt,pt,ct]);const[xt,kt,St]=useClickAwayListener(dt,ut??ht),Tt=reactExports.useRef(null),At=useForkRef(Tt,lt),Et=useForkRef(At,xt),Ct=ot,Lt=useUtilityClasses$d(Ct),jt=useDefaultReduceAnimations(),Rt=bt??jt,$t=Ft=>{Ft.key==="Escape"&&(Ft.stopPropagation(),ht())},vt=((et=gt==null?void 0:gt.desktopTransition)!=null?et:Rt)?Fade$1:Grow$1,It=(nt=gt==null?void 0:gt.desktopTrapFocus)!=null?nt:FocusTrap,Ot=(rt=gt==null?void 0:gt.desktopPaper)!=null?rt:PickersPopperPaper,Wt=(it=gt==null?void 0:gt.popper)!=null?it:PickersPopperRoot,zt=useSlotProps({elementType:Wt,externalSlotProps:yt==null?void 0:yt.popper,additionalProps:{transition:!0,role:pt,open:dt,anchorEl:at,placement:mt,onKeyDown:$t},className:Lt.root,ownerState:ot});return jsxRuntimeExports.jsx(Wt,_extends$u({},zt,{children:({TransitionProps:Ft,placement:Nt})=>jsxRuntimeExports.jsx(It,_extends$u({open:dt,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:pt==="tooltip",isEnabled:()=>!0},yt==null?void 0:yt.desktopTrapFocus,{children:jsxRuntimeExports.jsx(vt,_extends$u({},Ft,yt==null?void 0:yt.desktopTransition,{children:jsxRuntimeExports.jsx(PickersPopperPaperWrapper,{PaperComponent:Ot,ownerState:Ct,popperPlacement:Nt,ref:Et,onPaperClick:kt,onPaperTouchStart:St,paperClasses:Lt.paper,paperSlotProps:yt==null?void 0:yt.desktopPaper,children:st})}))}))}))}function getPickersToolbarUtilityClass(tt){return generateUtilityClass("MuiPickersToolbar",tt)}generateUtilityClasses("MuiPickersToolbar",["root","content"]);const useUtilityClasses$c=tt=>{const{classes:et,isLandscape:nt}=tt;return composeClasses({root:["root"],content:["content"],penIconButton:["penIconButton",nt&&"penIconButtonLandscape"]},getPickersToolbarUtilityClass,et)},PickersToolbarRoot=styled$1("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(tt,et)=>et.root})(({theme:tt,ownerState:et})=>_extends$u({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:tt.spacing(2,3)},et.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),PickersToolbarContent=styled$1("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(tt,et)=>et.content})(({ownerState:tt})=>{var et;return{display:"flex",flexWrap:"wrap",width:"100%",justifyContent:tt.isLandscape?"flex-start":"space-between",flexDirection:tt.isLandscape?(et=tt.landscapeDirection)!=null?et:"column":"row",flex:1,alignItems:tt.isLandscape?"flex-start":"center"}}),PickersToolbar=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiPickersToolbar"}),{children:it,className:ot,toolbarTitle:at,hidden:st,titleId:lt}=rt,ct=rt,ut=useUtilityClasses$c(ct);return st?null:jsxRuntimeExports.jsxs(PickersToolbarRoot,{ref:nt,className:clsx(ut.root,ot),ownerState:ct,children:[jsxRuntimeExports.jsx(Typography$1,{color:"text.secondary",variant:"overline",id:lt,children:at}),jsxRuntimeExports.jsx(PickersToolbarContent,{className:ut.content,ownerState:ct,children:it})]})}),useOpenState=({open:tt,onOpen:et,onClose:nt})=>{const rt=reactExports.useRef(typeof tt=="boolean").current,[it,ot]=reactExports.useState(!1);reactExports.useEffect(()=>{if(rt){if(typeof tt!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");ot(tt)}},[rt,tt]);const at=reactExports.useCallback(st=>{rt||ot(st),st&&et&&et(),!st&&nt&&nt()},[rt,et,nt]);return{isOpen:it,setIsOpen:at}},shouldPublishValue=tt=>{const{action:et,hasChanged:nt,dateState:rt,isControlled:it}=tt,ot=!it&&!rt.hasBeenModifiedSinceMount;return et.name==="setValueFromField"?!0:et.name==="setValueFromAction"?ot&&["accept","today","clear"].includes(et.pickerAction)?!0:nt(rt.lastPublishedValue):et.name==="setValueFromView"&&et.selectionState!=="shallow"||et.name==="setValueFromShortcut"?ot?!0:nt(rt.lastPublishedValue):!1},shouldCommitValue=tt=>{const{action:et,hasChanged:nt,dateState:rt,isControlled:it,closeOnSelect:ot}=tt,at=!it&&!rt.hasBeenModifiedSinceMount;return et.name==="setValueFromAction"?at&&["accept","today","clear"].includes(et.pickerAction)?!0:nt(rt.lastCommittedValue):et.name==="setValueFromView"&&et.selectionState==="finish"&&ot?at?!0:nt(rt.lastCommittedValue):et.name==="setValueFromShortcut"?et.changeImportance==="accept"&&nt(rt.lastCommittedValue):!1},shouldClosePicker=tt=>{const{action:et,closeOnSelect:nt}=tt;return et.name==="setValueFromAction"?!0:et.name==="setValueFromView"?et.selectionState==="finish"&&nt:et.name==="setValueFromShortcut"?et.changeImportance==="accept":!1},usePickerValue=({props:tt,valueManager:et,valueType:nt,wrapperVariant:rt,validator:it})=>{const{onAccept:ot,onChange:at,value:st,defaultValue:lt,closeOnSelect:ct=rt==="desktop",selectedSections:ut,onSelectedSectionsChange:ht,timezone:dt}=tt,{current:pt}=reactExports.useRef(lt),{current:mt}=reactExports.useRef(st!==void 0),gt=useUtils(),yt=useLocalizationContext(),[bt,wt]=useControlled({controlled:ut,default:null,name:"usePickerValue",state:"selectedSections"}),{isOpen:xt,setIsOpen:kt}=useOpenState(tt),[St,Tt]=reactExports.useState(()=>{let nn;return st!==void 0?nn=st:pt!==void 0?nn=pt:nn=et.emptyValue,{draft:nn,lastPublishedValue:nn,lastCommittedValue:nn,lastControlledValue:st,hasBeenModifiedSinceMount:!1}}),{timezone:At,handleValueChange:Et}=useValueWithTimezone({timezone:dt,value:st,defaultValue:pt,onChange:at,valueManager:et});useValidation(_extends$u({},tt,{value:St.draft,timezone:At}),it,et.isSameError,et.defaultErrorState);const Ct=useEventCallback(nn=>{const tn={action:nn,dateState:St,hasChanged:Zt=>!et.areValuesEqual(gt,nn.value,Zt),isControlled:mt,closeOnSelect:ct},dn=shouldPublishValue(tn),wn=shouldCommitValue(tn),rn=shouldClosePicker(tn);if(Tt(Zt=>_extends$u({},Zt,{draft:nn.value,lastPublishedValue:dn?nn.value:Zt.lastPublishedValue,lastCommittedValue:wn?nn.value:Zt.lastCommittedValue,hasBeenModifiedSinceMount:!0})),dn){const vn={validationError:nn.name==="setValueFromField"?nn.context.validationError:it({adapter:yt,value:nn.value,props:_extends$u({},tt,{value:nn.value,timezone:At})})};nn.name==="setValueFromShortcut"&&nn.shortcut!=null&&(vn.shortcut=nn.shortcut),Et(nn.value,vn)}wn&&ot&&ot(nn.value),rn&&kt(!1)});if(st!==void 0&&(St.lastControlledValue===void 0||!et.areValuesEqual(gt,St.lastControlledValue,st))){const nn=et.areValuesEqual(gt,St.draft,st);Tt(tn=>_extends$u({},tn,{lastControlledValue:st},nn?{}:{lastCommittedValue:st,lastPublishedValue:st,draft:st,hasBeenModifiedSinceMount:!0}))}const Lt=useEventCallback(()=>{Ct({value:et.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),jt=useEventCallback(()=>{Ct({value:St.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),Rt=useEventCallback(()=>{Ct({value:St.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),$t=useEventCallback(()=>{Ct({value:St.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),vt=useEventCallback(()=>{Ct({value:et.getTodayValue(gt,At,nt),name:"setValueFromAction",pickerAction:"today"})}),It=useEventCallback(()=>kt(!0)),Ot=useEventCallback(()=>kt(!1)),Wt=useEventCallback((nn,tn="partial")=>Ct({name:"setValueFromView",value:nn,selectionState:tn})),zt=useEventCallback((nn,tn,dn)=>Ct({name:"setValueFromShortcut",value:nn,changeImportance:tn??"accept",shortcut:dn})),Ft=useEventCallback((nn,tn)=>Ct({name:"setValueFromField",value:nn,context:tn})),Nt=useEventCallback(nn=>{wt(nn),ht==null||ht(nn)}),Ut={onClear:Lt,onAccept:jt,onDismiss:Rt,onCancel:$t,onSetToday:vt,onOpen:It,onClose:Ot},Pt={value:St.draft,onChange:Ft,selectedSections:bt,onSelectedSectionsChange:Nt},Ht=reactExports.useMemo(()=>et.cleanValue(gt,St.draft),[gt,et,St.draft]),Qt={value:Ht,onChange:Wt,onClose:Ot,open:xt,onSelectedSectionsChange:Nt},Yt=_extends$u({},Ut,{value:Ht,onChange:Wt,onSelectShortcut:zt,isValid:nn=>{const tn=it({adapter:yt,value:nn,props:_extends$u({},tt,{value:nn,timezone:At})});return!et.hasError(tn)}});return{open:xt,fieldProps:Pt,viewProps:Qt,layoutProps:Yt,actions:Ut}},_excluded$z=["className","sx"],usePickerViews=({props:tt,propsFromPickerValue:et,additionalViewProps:nt,inputRef:rt,autoFocusView:it})=>{const{onChange:ot,open:at,onSelectedSectionsChange:st,onClose:lt}=et,{views:ct,openTo:ut,onViewChange:ht,disableOpenPicker:dt,viewRenderers:pt,timezone:mt}=tt,gt=_objectWithoutPropertiesLoose$k(tt,_excluded$z),{view:yt,setView:bt,defaultView:wt,focusedView:xt,setFocusedView:kt,setValueAndGoToNextView:St}=useViews({view:void 0,views:ct,openTo:ut,onChange:ot,onViewChange:ht,autoFocus:it}),{hasUIView:Tt,viewModeLookup:At}=reactExports.useMemo(()=>ct.reduce((vt,It)=>{let Ot;return dt?Ot="field":pt[It]!=null?Ot="UI":Ot="field",vt.viewModeLookup[It]=Ot,Ot==="UI"&&(vt.hasUIView=!0),vt},{hasUIView:!1,viewModeLookup:{}}),[dt,pt,ct]),Et=reactExports.useMemo(()=>ct.reduce((vt,It)=>pt[It]!=null&&isTimeView(It)?vt+1:vt,0),[pt,ct]),Ct=At[yt],Lt=useEventCallback(()=>Ct==="UI"),[jt,Rt]=reactExports.useState(Ct==="UI"?yt:null);return jt!==yt&&At[yt]==="UI"&&Rt(yt),useEnhancedEffect$1(()=>{Ct==="field"&&at&&(lt(),setTimeout(()=>{rt==null||rt.current.focus(),st(yt)}))},[yt]),useEnhancedEffect$1(()=>{if(!at)return;let vt=yt;Ct==="field"&&jt!=null&&(vt=jt),vt!==wt&&At[vt]==="UI"&&At[wt]==="UI"&&(vt=wt),vt!==yt&&bt(vt),kt(vt,!0)},[at]),{hasUIView:Tt,shouldRestoreFocus:Lt,layoutProps:{views:ct,view:jt,onViewChange:bt},renderCurrentView:()=>{if(jt==null)return null;const vt=pt[jt];return vt==null?null:vt(_extends$u({},gt,nt,et,{views:ct,timezone:mt,onChange:St,view:jt,onViewChange:bt,focusedView:xt,onFocusedViewChange:kt,showViewSwitcher:Et>1,timeViewsCount:Et}))}}};function getOrientation(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const useIsLandscape=(tt,et)=>{const[nt,rt]=reactExports.useState(getOrientation);return useEnhancedEffect$1(()=>{const ot=()=>{rt(getOrientation())};return window.addEventListener("orientationchange",ot),()=>{window.removeEventListener("orientationchange",ot)}},[]),arrayIncludes$2(tt,["hours","minutes","seconds"])?!1:(et||nt)==="landscape"},usePickerLayoutProps=({props:tt,propsFromPickerValue:et,propsFromPickerViews:nt,wrapperVariant:rt})=>{const{orientation:it}=tt,ot=useIsLandscape(nt.views,it);return{layoutProps:_extends$u({},nt,et,{isLandscape:ot,wrapperVariant:rt,disabled:tt.disabled,readOnly:tt.readOnly})}},buildWarning=(tt,et="warning")=>{let nt=!1;const rt=Array.isArray(tt)?tt.join(` +`):tt;return()=>{nt||(nt=!0,et==="error"?console.error(rt):console.warn(rt))}};buildWarning(["The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.","You can replace it with the `textField` component slot in most cases.","For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5)."]);const usePicker=({props:tt,valueManager:et,valueType:nt,wrapperVariant:rt,inputRef:it,additionalViewProps:ot,validator:at,autoFocusView:st})=>{const lt=usePickerValue({props:tt,valueManager:et,valueType:nt,wrapperVariant:rt,validator:at}),ct=usePickerViews({props:tt,inputRef:it,additionalViewProps:ot,autoFocusView:st,propsFromPickerValue:lt.viewProps}),ut=usePickerLayoutProps({props:tt,wrapperVariant:rt,propsFromPickerValue:lt.layoutProps,propsFromPickerViews:ct.layoutProps});return{open:lt.open,actions:lt.actions,fieldProps:lt.fieldProps,renderCurrentView:ct.renderCurrentView,hasUIView:ct.hasUIView,shouldRestoreFocus:ct.shouldRestoreFocus,layoutProps:ut.layoutProps}};function getPickersLayoutUtilityClass(tt){return generateUtilityClass("MuiPickersLayout",tt)}const pickersLayoutClasses=generateUtilityClasses("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","shortcuts"]),_excluded$y=["onAccept","onClear","onCancel","onSetToday","actions"];function PickersActionBar(tt){const{onAccept:et,onClear:nt,onCancel:rt,onSetToday:it,actions:ot}=tt,at=_objectWithoutPropertiesLoose$k(tt,_excluded$y),st=useLocaleText();if(ot==null||ot.length===0)return null;const lt=ot==null?void 0:ot.map(ct=>{switch(ct){case"clear":return jsxRuntimeExports.jsx(Button$2,{onClick:nt,children:st.clearButtonLabel},ct);case"cancel":return jsxRuntimeExports.jsx(Button$2,{onClick:rt,children:st.cancelButtonLabel},ct);case"accept":return jsxRuntimeExports.jsx(Button$2,{onClick:et,children:st.okButtonLabel},ct);case"today":return jsxRuntimeExports.jsx(Button$2,{onClick:it,children:st.todayButtonLabel},ct);default:return null}});return jsxRuntimeExports.jsx(DialogActions$1,_extends$u({},at,{children:lt}))}const _excluded$x=["items","changeImportance","isLandscape","onChange","isValid"],_excluded2$a=["getValue"];function PickersShortcuts(tt){const{items:et,changeImportance:nt,onChange:rt,isValid:it}=tt,ot=_objectWithoutPropertiesLoose$k(tt,_excluded$x);if(et==null||et.length===0)return null;const at=et.map(st=>{let{getValue:lt}=st,ct=_objectWithoutPropertiesLoose$k(st,_excluded2$a);const ut=lt({isValid:it});return{label:ct.label,onClick:()=>{rt(ut,nt,ct)},disabled:!it(ut)}});return jsxRuntimeExports.jsx(List$1,_extends$u({dense:!0,sx:[{maxHeight:VIEW_HEIGHT,maxWidth:200,overflow:"auto"},...Array.isArray(ot.sx)?ot.sx:[ot.sx]]},ot,{children:at.map(st=>jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(Chip$1,_extends$u({},st))},st.label))}))}function toolbarHasView(tt){return tt.view!==null}const useUtilityClasses$b=tt=>{const{classes:et,isLandscape:nt}=tt;return composeClasses({root:["root",nt&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},getPickersLayoutUtilityClass,et)},usePickerLayout=tt=>{var et,nt;const{wrapperVariant:rt,onAccept:it,onClear:ot,onCancel:at,onSetToday:st,view:lt,views:ct,onViewChange:ut,value:ht,onChange:dt,onSelectShortcut:pt,isValid:mt,isLandscape:gt,disabled:yt,readOnly:bt,children:wt,components:xt,componentsProps:kt,slots:St,slotProps:Tt}=tt,At=St??uncapitalizeObjectKeys(xt),Et=Tt??kt,Ct=useUtilityClasses$b(tt),Lt=(et=At==null?void 0:At.actionBar)!=null?et:PickersActionBar,jt=useSlotProps({elementType:Lt,externalSlotProps:Et==null?void 0:Et.actionBar,additionalProps:{onAccept:it,onClear:ot,onCancel:at,onSetToday:st,actions:rt==="desktop"?[]:["cancel","accept"],className:Ct.actionBar},ownerState:_extends$u({},tt,{wrapperVariant:rt})}),Rt=jsxRuntimeExports.jsx(Lt,_extends$u({},jt)),$t=At==null?void 0:At.toolbar,vt=useSlotProps({elementType:$t,externalSlotProps:Et==null?void 0:Et.toolbar,additionalProps:{isLandscape:gt,onChange:dt,value:ht,view:lt,onViewChange:ut,views:ct,disabled:yt,readOnly:bt,className:Ct.toolbar},ownerState:_extends$u({},tt,{wrapperVariant:rt})}),It=toolbarHasView(vt)&&$t?jsxRuntimeExports.jsx($t,_extends$u({},vt)):null,Ot=wt,Wt=At==null?void 0:At.tabs,zt=lt&&Wt?jsxRuntimeExports.jsx(Wt,_extends$u({view:lt,onViewChange:ut},Et==null?void 0:Et.tabs)):null,Ft=(nt=At==null?void 0:At.shortcuts)!=null?nt:PickersShortcuts,Nt=useSlotProps({elementType:Ft,externalSlotProps:Et==null?void 0:Et.shortcuts,additionalProps:{isValid:mt,isLandscape:gt,onChange:pt,className:Ct.shortcuts},ownerState:{isValid:mt,isLandscape:gt,onChange:pt,className:Ct.shortcuts,wrapperVariant:rt}}),Ut=lt&&Ft?jsxRuntimeExports.jsx(Ft,_extends$u({},Nt)):null;return{toolbar:It,content:Ot,tabs:zt,actionBar:Rt,shortcuts:Ut}},usePickerLayout$1=usePickerLayout,useUtilityClasses$a=tt=>{const{isLandscape:et,classes:nt}=tt;return composeClasses({root:["root",et&&"landscape"],contentWrapper:["contentWrapper"]},getPickersLayoutUtilityClass,nt)},PickersLayoutRoot=styled$1("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(tt,et)=>et.root})(({theme:tt,ownerState:et})=>({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${pickersLayoutClasses.toolbar}`]:et.isLandscape?{gridColumn:tt.direction==="rtl"?3:1,gridRow:"2 / 3"}:{gridColumn:"2 / 4",gridRow:1},[`.${pickersLayoutClasses.shortcuts}`]:et.isLandscape?{gridColumn:"2 / 4",gridRow:1}:{gridColumn:tt.direction==="rtl"?3:1,gridRow:"2 / 3"},[`& .${pickersLayoutClasses.actionBar}`]:{gridColumn:"1 / 4",gridRow:3}}));PickersLayoutRoot.propTypes={as:PropTypes.elementType,ownerState:PropTypes.shape({isLandscape:PropTypes.bool.isRequired}).isRequired,sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object])};const PickersLayoutContentWrapper=styled$1("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(tt,et)=>et.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),PickersLayout=function(et){const nt=useThemeProps({props:et,name:"MuiPickersLayout"}),{toolbar:rt,content:it,tabs:ot,actionBar:at,shortcuts:st}=usePickerLayout$1(nt),{sx:lt,className:ct,isLandscape:ut,ref:ht,wrapperVariant:dt}=nt,pt=nt,mt=useUtilityClasses$a(pt);return jsxRuntimeExports.jsxs(PickersLayoutRoot,{ref:ht,sx:lt,className:clsx(ct,mt.root),ownerState:pt,children:[ut?st:rt,ut?rt:st,jsxRuntimeExports.jsx(PickersLayoutContentWrapper,{className:mt.contentWrapper,children:dt==="desktop"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[it,ot]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ot,it]})}),at]})},getPickersSlideTransitionUtilityClass=tt=>generateUtilityClass("MuiPickersSlideTransition",tt),pickersSlideTransitionClasses=generateUtilityClasses("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),_excluded$w=["children","className","reduceAnimations","slideDirection","transKey","classes"],useUtilityClasses$9=tt=>{const{classes:et,slideDirection:nt}=tt,rt={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${nt}`],exitActive:[`slideExitActiveLeft-${nt}`]};return composeClasses(rt,getPickersSlideTransitionUtilityClass,et)},PickersSlideTransitionRoot=styled$1(TransitionGroup$1,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(tt,et)=>[et.root,{[`.${pickersSlideTransitionClasses["slideEnter-left"]}`]:et["slideEnter-left"]},{[`.${pickersSlideTransitionClasses["slideEnter-right"]}`]:et["slideEnter-right"]},{[`.${pickersSlideTransitionClasses.slideEnterActive}`]:et.slideEnterActive},{[`.${pickersSlideTransitionClasses.slideExit}`]:et.slideExit},{[`.${pickersSlideTransitionClasses["slideExitActiveLeft-left"]}`]:et["slideExitActiveLeft-left"]},{[`.${pickersSlideTransitionClasses["slideExitActiveLeft-right"]}`]:et["slideExitActiveLeft-right"]}]})(({theme:tt})=>{const et=tt.transitions.create("transform",{duration:tt.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${pickersSlideTransitionClasses["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${pickersSlideTransitionClasses["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${pickersSlideTransitionClasses.slideEnterActive}`]:{transform:"translate(0%)",transition:et},[`& .${pickersSlideTransitionClasses.slideExit}`]:{transform:"translate(0%)"},[`& .${pickersSlideTransitionClasses["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:et,zIndex:0},[`& .${pickersSlideTransitionClasses["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:et,zIndex:0}}});function PickersSlideTransition(tt){const et=useThemeProps({props:tt,name:"MuiPickersSlideTransition"}),{children:nt,className:rt,reduceAnimations:it,transKey:ot}=et,at=_objectWithoutPropertiesLoose$k(et,_excluded$w),st=useUtilityClasses$9(et),lt=useTheme();if(it)return jsxRuntimeExports.jsx("div",{className:clsx(st.root,rt),children:nt});const ct={exit:st.exit,enterActive:st.enterActive,enter:st.enter,exitActive:st.exitActive};return jsxRuntimeExports.jsx(PickersSlideTransitionRoot,{className:clsx(st.root,rt),childFactory:ut=>reactExports.cloneElement(ut,{classNames:ct}),role:"presentation",children:jsxRuntimeExports.jsx(CSSTransition$1,_extends$u({mountOnEnter:!0,unmountOnExit:!0,timeout:lt.transitions.duration.complex,classNames:ct},at,{children:nt}),ot)})}const useIsDateDisabled=({shouldDisableDate:tt,shouldDisableMonth:et,shouldDisableYear:nt,minDate:rt,maxDate:it,disableFuture:ot,disablePast:at,timezone:st})=>{const lt=useLocalizationContext();return reactExports.useCallback(ct=>validateDate({adapter:lt,value:ct,props:{shouldDisableDate:tt,shouldDisableMonth:et,shouldDisableYear:nt,minDate:rt,maxDate:it,disableFuture:ot,disablePast:at,timezone:st}})!==null,[lt,tt,et,nt,rt,it,ot,at,st])},getDayCalendarUtilityClass=tt=>generateUtilityClass("MuiDayCalendar",tt);generateUtilityClasses("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const _excluded$v=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],_excluded2$9=["ownerState"],useUtilityClasses$8=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},getDayCalendarUtilityClass,et)},weeksContainerHeight=(DAY_SIZE+DAY_MARGIN*2)*6,PickersCalendarDayRoot=styled$1("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),PickersCalendarDayHeader=styled$1("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(tt,et)=>et.header})({display:"flex",justifyContent:"center",alignItems:"center"}),PickersCalendarWeekDayLabel=styled$1(Typography$1,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(tt,et)=>et.weekDayLabel})(({theme:tt})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(tt.vars||tt).palette.text.secondary})),PickersCalendarWeekNumberLabel=styled$1(Typography$1,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(tt,et)=>et.weekNumberLabel})(({theme:tt})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:tt.palette.text.disabled})),PickersCalendarWeekNumber=styled$1(Typography$1,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(tt,et)=>et.weekNumber})(({theme:tt})=>_extends$u({},tt.typography.caption,{width:DAY_SIZE,height:DAY_SIZE,padding:0,margin:`0 ${DAY_MARGIN}px`,color:tt.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),PickersCalendarLoadingContainer=styled$1("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(tt,et)=>et.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:weeksContainerHeight}),PickersCalendarSlideTransition=styled$1(PickersSlideTransition,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(tt,et)=>et.slideTransition})({minHeight:weeksContainerHeight}),PickersCalendarWeekContainer=styled$1("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(tt,et)=>et.monthContainer})({overflow:"hidden"}),PickersCalendarWeek=styled$1("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(tt,et)=>et.weekContainer})({margin:`${DAY_MARGIN}px 0`,display:"flex",justifyContent:"center"});function WrappedDay(tt){var et,nt,rt;let{parentProps:it,day:ot,focusableDay:at,selectedDays:st,isDateDisabled:lt,currentMonthNumber:ct,isViewFocused:ut}=tt,ht=_objectWithoutPropertiesLoose$k(tt,_excluded$v);const{disabled:dt,disableHighlightToday:pt,isMonthSwitchingAnimating:mt,showDaysOutsideCurrentMonth:gt,components:yt,componentsProps:bt,slots:wt,slotProps:xt,timezone:kt}=it,St=useUtils(),Tt=useNow(kt),At=at!==null&&St.isSameDay(ot,at),Et=st.some(Wt=>St.isSameDay(Wt,ot)),Ct=St.isSameDay(ot,Tt),Lt=(et=(nt=wt==null?void 0:wt.day)!=null?nt:yt==null?void 0:yt.Day)!=null?et:PickersDay,jt=useSlotProps({elementType:Lt,externalSlotProps:(rt=xt==null?void 0:xt.day)!=null?rt:bt==null?void 0:bt.day,additionalProps:_extends$u({disableHighlightToday:pt,showDaysOutsideCurrentMonth:gt,role:"gridcell",isAnimating:mt,"data-timestamp":St.toJsDate(ot).valueOf()},ht),ownerState:_extends$u({},it,{day:ot,selected:Et})}),Rt=_objectWithoutPropertiesLoose$k(jt,_excluded2$9),$t=reactExports.useMemo(()=>dt||lt(ot),[dt,lt,ot]),vt=reactExports.useMemo(()=>St.getMonth(ot)!==ct,[St,ot,ct]),It=reactExports.useMemo(()=>{const Wt=St.startOfMonth(St.setMonth(ot,ct));return gt?St.isSameDay(ot,St.startOfWeek(Wt)):St.isSameDay(ot,Wt)},[ct,ot,gt,St]),Ot=reactExports.useMemo(()=>{const Wt=St.endOfMonth(St.setMonth(ot,ct));return gt?St.isSameDay(ot,St.endOfWeek(Wt)):St.isSameDay(ot,Wt)},[ct,ot,gt,St]);return jsxRuntimeExports.jsx(Lt,_extends$u({},Rt,{day:ot,disabled:$t,autoFocus:ut&&At,today:Ct,outsideCurrentMonth:vt,isFirstVisibleCell:It,isLastVisibleCell:Ot,selected:Et,tabIndex:At?0:-1,"aria-selected":Et,"aria-current":Ct?"date":void 0}))}function DayCalendar(tt){const et=useThemeProps({props:tt,name:"MuiDayCalendar"}),{onFocusedDayChange:nt,className:rt,currentMonth:it,selectedDays:ot,focusedDay:at,loading:st,onSelectedDaysChange:lt,onMonthSwitchingAnimationEnd:ct,readOnly:ut,reduceAnimations:ht,renderLoading:dt=()=>jsxRuntimeExports.jsx("span",{children:"..."}),slideDirection:pt,TransitionProps:mt,disablePast:gt,disableFuture:yt,minDate:bt,maxDate:wt,shouldDisableDate:xt,shouldDisableMonth:kt,shouldDisableYear:St,dayOfWeekFormatter:Tt,hasFocus:At,onFocusedViewChange:Et,gridLabelId:Ct,displayWeekNumber:Lt,fixedWeekNumber:jt,autoFocus:Rt,timezone:$t}=et,vt=useNow($t),It=useUtils(),Ot=useUtilityClasses$8(et),zt=useTheme().direction==="rtl",Ft=Tt||((sn,pn)=>It.format(pn,"weekdayShort").charAt(0).toUpperCase()),Nt=useIsDateDisabled({shouldDisableDate:xt,shouldDisableMonth:kt,shouldDisableYear:St,minDate:bt,maxDate:wt,disablePast:gt,disableFuture:yt,timezone:$t}),Ut=useLocaleText(),[Pt,Ht]=useControlled({name:"DayCalendar",state:"hasFocus",controlled:At,default:Rt??!1}),[Qt,an]=reactExports.useState(()=>at||vt),Yt=useEventCallback(sn=>{ut||lt(sn)}),nn=sn=>{Nt(sn)||(nt(sn),an(sn),Et==null||Et(!0),Ht(!0))},tn=useEventCallback((sn,pn)=>{switch(sn.key){case"ArrowUp":nn(It.addDays(pn,-7)),sn.preventDefault();break;case"ArrowDown":nn(It.addDays(pn,7)),sn.preventDefault();break;case"ArrowLeft":{const Tn=It.addDays(pn,zt?1:-1),In=It.addMonths(pn,zt?1:-1),yn=findClosestEnabledDate({utils:It,date:Tn,minDate:zt?Tn:It.startOfMonth(In),maxDate:zt?It.endOfMonth(In):Tn,isDateDisabled:Nt,timezone:$t});nn(yn||Tn),sn.preventDefault();break}case"ArrowRight":{const Tn=It.addDays(pn,zt?-1:1),In=It.addMonths(pn,zt?-1:1),yn=findClosestEnabledDate({utils:It,date:Tn,minDate:zt?It.startOfMonth(In):Tn,maxDate:zt?Tn:It.endOfMonth(In),isDateDisabled:Nt,timezone:$t});nn(yn||Tn),sn.preventDefault();break}case"Home":nn(It.startOfWeek(pn)),sn.preventDefault();break;case"End":nn(It.endOfWeek(pn)),sn.preventDefault();break;case"PageUp":nn(It.addMonths(pn,1)),sn.preventDefault();break;case"PageDown":nn(It.addMonths(pn,-1)),sn.preventDefault();break}}),dn=useEventCallback((sn,pn)=>nn(pn)),wn=useEventCallback((sn,pn)=>{Pt&&It.isSameDay(Qt,pn)&&(Et==null||Et(!1))}),rn=It.getMonth(it),Zt=reactExports.useMemo(()=>ot.filter(sn=>!!sn).map(sn=>It.startOfDay(sn)),[It,ot]),vn=rn,Cn=reactExports.useMemo(()=>reactExports.createRef(),[vn]),$n=It.startOfWeek(vt),Nn=reactExports.useMemo(()=>{const sn=It.startOfMonth(it),pn=It.endOfMonth(it);return Nt(Qt)||It.isAfterDay(Qt,pn)||It.isBeforeDay(Qt,sn)?findClosestEnabledDate({utils:It,date:Qt,minDate:sn,maxDate:pn,disablePast:gt,disableFuture:yt,isDateDisabled:Nt,timezone:$t}):Qt},[it,yt,gt,Qt,Nt,It,$t]),En=reactExports.useMemo(()=>{const sn=It.setTimezone(it,$t),pn=It.getWeekArray(sn);let Tn=It.addMonths(sn,1);for(;jt&&pn.length{pn.length{var Tn;const In=It.format(sn,"weekdayShort");return jsxRuntimeExports.jsx(PickersCalendarWeekDayLabel,{variant:"caption",role:"columnheader","aria-label":It.format(It.addDays($n,pn),"weekday"),className:Ot.weekDayLabel,children:(Tn=Ft==null?void 0:Ft(In,sn))!=null?Tn:In},In+pn.toString())})]}),st?jsxRuntimeExports.jsx(PickersCalendarLoadingContainer,{className:Ot.loadingContainer,children:dt()}):jsxRuntimeExports.jsx(PickersCalendarSlideTransition,_extends$u({transKey:vn,onExited:ct,reduceAnimations:ht,slideDirection:pt,className:clsx(rt,Ot.slideTransition)},mt,{nodeRef:Cn,children:jsxRuntimeExports.jsx(PickersCalendarWeekContainer,{ref:Cn,role:"rowgroup",className:Ot.monthContainer,children:En.map((sn,pn)=>jsxRuntimeExports.jsxs(PickersCalendarWeek,{role:"row",className:Ot.weekContainer,"aria-rowindex":pn+1,children:[Lt&&jsxRuntimeExports.jsx(PickersCalendarWeekNumber,{className:Ot.weekNumber,role:"rowheader","aria-label":Ut.calendarWeekNumberAriaLabelText(It.getWeekNumber(sn[0])),children:Ut.calendarWeekNumberText(It.getWeekNumber(sn[0]))}),sn.map((Tn,In)=>jsxRuntimeExports.jsx(WrappedDay,{parentProps:et,day:Tn,selectedDays:Zt,focusableDay:Nn,onKeyDown:tn,onFocus:dn,onBlur:wn,onDaySelect:Yt,isDateDisabled:Nt,currentMonthNumber:rn,isViewFocused:Pt,"aria-colindex":In+1},Tn.toString()))]},`week-${sn[0]}`))})}))]})}const createCalendarStateReducer=(tt,et,nt)=>(rt,it)=>{switch(it.type){case"changeMonth":return _extends$u({},rt,{slideDirection:it.direction,currentMonth:it.newMonth,isMonthSwitchingAnimating:!tt});case"finishMonthSwitchingAnimation":return _extends$u({},rt,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(rt.focusedDay!=null&&it.focusedDay!=null&&nt.isSameDay(it.focusedDay,rt.focusedDay))return rt;const ot=it.focusedDay!=null&&!et&&!nt.isSameMonth(rt.currentMonth,it.focusedDay);return _extends$u({},rt,{focusedDay:it.focusedDay,isMonthSwitchingAnimating:ot&&!tt&&!it.withoutMonthSwitchingAnimation,currentMonth:ot?nt.startOfMonth(it.focusedDay):rt.currentMonth,slideDirection:it.focusedDay!=null&&nt.isAfterDay(it.focusedDay,rt.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},useCalendarState=tt=>{const{value:et,referenceDate:nt,defaultCalendarMonth:rt,disableFuture:it,disablePast:ot,disableSwitchToMonthOnDayFocus:at=!1,maxDate:st,minDate:lt,onMonthChange:ct,reduceAnimations:ut,shouldDisableDate:ht,timezone:dt}=tt,pt=useNow(dt),mt=useUtils(),gt=reactExports.useRef(createCalendarStateReducer(!!ut,at,mt)).current,yt=reactExports.useMemo(()=>{let Et=null;return nt?Et=nt:rt&&(Et=mt.startOfMonth(rt)),singleItemValueManager.getInitialReferenceValue({value:et,utils:mt,timezone:dt,props:tt,referenceDate:Et,granularity:SECTION_TYPE_GRANULARITY.day})},[]),[bt,wt]=reactExports.useReducer(gt,{isMonthSwitchingAnimating:!1,focusedDay:et||pt,currentMonth:mt.startOfMonth(yt),slideDirection:"left"}),xt=reactExports.useCallback(Et=>{wt(_extends$u({type:"changeMonth"},Et)),ct&&ct(Et.newMonth)},[ct]),kt=reactExports.useCallback(Et=>{const Ct=Et;mt.isSameMonth(Ct,bt.currentMonth)||xt({newMonth:mt.startOfMonth(Ct),direction:mt.isAfterDay(Ct,bt.currentMonth)?"left":"right"})},[bt.currentMonth,xt,mt]),St=useIsDateDisabled({shouldDisableDate:ht,minDate:lt,maxDate:st,disableFuture:it,disablePast:ot,timezone:dt}),Tt=reactExports.useCallback(()=>{wt({type:"finishMonthSwitchingAnimation"})},[]),At=useEventCallback((Et,Ct)=>{St(Et)||wt({type:"changeFocusedDay",focusedDay:Et,withoutMonthSwitchingAnimation:Ct})});return{referenceDate:yt,calendarState:bt,changeMonth:kt,changeFocusedDay:At,isDateDisabled:St,onMonthSwitchingAnimationEnd:Tt,handleChangeMonth:xt}},_excluded$u=["ownerState"],useClearableField=({clearable:tt,fieldProps:et,InputProps:nt,onClear:rt,slots:it,slotProps:ot,components:at,componentsProps:st})=>{var lt,ct,ut,ht,dt,pt;const mt=useLocaleText(),gt=(lt=(ct=it==null?void 0:it.clearButton)!=null?ct:at==null?void 0:at.ClearButton)!=null?lt:IconButton$1,yt=useSlotProps({elementType:gt,externalSlotProps:(ut=ot==null?void 0:ot.clearButton)!=null?ut:st==null?void 0:st.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:mt.fieldClearLabel}}),bt=_objectWithoutPropertiesLoose$k(yt,_excluded$u),wt=(ht=(dt=it==null?void 0:it.clearIcon)!=null?dt:at==null?void 0:at.ClearIcon)!=null?ht:ClearIcon,xt=useSlotProps({elementType:wt,externalSlotProps:(pt=ot==null?void 0:ot.clearIcon)!=null?pt:st==null?void 0:st.clearIcon,ownerState:{}}),kt=_extends$u({},nt,{endAdornment:tt?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(MuiInputAdornment,{position:"end",sx:{marginRight:nt!=null&&nt.endAdornment?-1:-1.5},children:jsxRuntimeExports.jsx(gt,_extends$u({},bt,{onClick:rt,children:jsxRuntimeExports.jsx(wt,_extends$u({fontSize:"small"},xt))}))}),nt==null?void 0:nt.endAdornment]}):nt==null?void 0:nt.endAdornment}),St=_extends$u({},et,{sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(et.sx)?et.sx:[et.sx]]});return{InputProps:kt,fieldProps:St}},_excluded$t=["components","componentsProps","slots","slotProps","InputProps","inputProps"],_excluded2$8=["inputRef"],_excluded3$2=["ref","onPaste","onKeyDown","inputMode","readOnly","clearable","onClear"],DateField=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useThemeProps({props:et,name:"MuiDateField"}),{components:st,componentsProps:lt,slots:ct,slotProps:ut,InputProps:ht,inputProps:dt}=at,pt=_objectWithoutPropertiesLoose$k(at,_excluded$t),mt=at,gt=(rt=(it=ct==null?void 0:ct.textField)!=null?it:st==null?void 0:st.TextField)!=null?rt:MuiTextField,yt=useSlotProps({elementType:gt,externalSlotProps:(ot=ut==null?void 0:ut.textField)!=null?ot:lt==null?void 0:lt.textField,externalForwardedProps:pt,ownerState:mt}),{inputRef:bt}=yt,wt=_objectWithoutPropertiesLoose$k(yt,_excluded2$8);wt.inputProps=_extends$u({},dt,wt.inputProps),wt.InputProps=_extends$u({},ht,wt.InputProps);const xt=useDateField({props:wt,inputRef:bt}),{ref:kt,onPaste:St,onKeyDown:Tt,inputMode:At,readOnly:Et,clearable:Ct,onClear:Lt}=xt,jt=_objectWithoutPropertiesLoose$k(xt,_excluded3$2),{InputProps:Rt,fieldProps:$t}=useClearableField({onClear:Lt,clearable:Ct,fieldProps:jt,InputProps:jt.InputProps,slots:ct,slotProps:ut,components:st,componentsProps:lt});return jsxRuntimeExports.jsx(gt,_extends$u({ref:nt},$t,{InputProps:_extends$u({},Rt,{readOnly:Et}),inputProps:_extends$u({},jt.inputProps,{inputMode:At,onPaste:St,onKeyDown:Tt,ref:kt})}))}),getPickersFadeTransitionGroupUtilityClass=tt=>generateUtilityClass("MuiPickersFadeTransitionGroup",tt);generateUtilityClasses("MuiPickersFadeTransitionGroup",["root"]);const useUtilityClasses$7=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getPickersFadeTransitionGroupUtilityClass,et)},PickersFadeTransitionGroupRoot=styled$1(TransitionGroup$1,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"block",position:"relative"});function PickersFadeTransitionGroup(tt){const et=useThemeProps({props:tt,name:"MuiPickersFadeTransitionGroup"}),{children:nt,className:rt,reduceAnimations:it,transKey:ot}=et,at=useUtilityClasses$7(et),st=useTheme();return it?nt:jsxRuntimeExports.jsx(PickersFadeTransitionGroupRoot,{className:clsx(at.root,rt),children:jsxRuntimeExports.jsx(Fade$1,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:st.transitions.duration.enteringScreen,enter:st.transitions.duration.enteringScreen,exit:0},children:nt},ot)})}function getPickersMonthUtilityClass(tt){return generateUtilityClass("MuiPickersMonth",tt)}const pickersMonthClasses=generateUtilityClasses("MuiPickersMonth",["root","monthButton","disabled","selected"]),_excluded$s=["autoFocus","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow"],useUtilityClasses$6=tt=>{const{disabled:et,selected:nt,classes:rt}=tt;return composeClasses({root:["root"],monthButton:["monthButton",et&&"disabled",nt&&"selected"]},getPickersMonthUtilityClass,rt)},PickersMonthRoot=styled$1("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(tt,et)=>[et.root]})(({ownerState:tt})=>({flexBasis:tt.monthsPerRow===3?"33.3%":"25%",display:"flex",alignItems:"center",justifyContent:"center"})),PickersMonthButton=styled$1("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(tt,et)=>[et.monthButton,{[`&.${pickersMonthClasses.disabled}`]:et.disabled},{[`&.${pickersMonthClasses.selected}`]:et.selected}]})(({theme:tt})=>_extends$u({color:"unset",backgroundColor:"transparent",border:0,outline:0},tt.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity)},"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${pickersMonthClasses.disabled}`]:{color:(tt.vars||tt).palette.text.secondary},[`&.${pickersMonthClasses.selected}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.main,"&:focus, &:hover":{backgroundColor:(tt.vars||tt).palette.primary.dark}}})),PickersMonth=reactExports.memo(function(et){const nt=useThemeProps({props:et,name:"MuiPickersMonth"}),{autoFocus:rt,children:it,disabled:ot,selected:at,value:st,tabIndex:lt,onClick:ct,onKeyDown:ut,onFocus:ht,onBlur:dt,"aria-current":pt,"aria-label":mt}=nt,gt=_objectWithoutPropertiesLoose$k(nt,_excluded$s),yt=reactExports.useRef(null),bt=useUtilityClasses$6(nt);return useEnhancedEffect$1(()=>{if(rt){var wt;(wt=yt.current)==null||wt.focus()}},[rt]),jsxRuntimeExports.jsx(PickersMonthRoot,_extends$u({className:bt.root,ownerState:nt},gt,{children:jsxRuntimeExports.jsx(PickersMonthButton,{ref:yt,disabled:ot,type:"button",role:"radio",tabIndex:ot?-1:lt,"aria-current":pt,"aria-checked":at,"aria-label":mt,onClick:wt=>ct(wt,st),onKeyDown:wt=>ut(wt,st),onFocus:wt=>ht(wt,st),onBlur:wt=>dt(wt,st),className:bt.monthButton,ownerState:nt,children:it})}))});function getMonthCalendarUtilityClass(tt){return generateUtilityClass("MuiMonthCalendar",tt)}generateUtilityClasses("MuiMonthCalendar",["root"]);const _excluded$r=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId"],useUtilityClasses$5=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getMonthCalendarUtilityClass,et)};function useMonthCalendarDefaultizedProps(tt,et){const nt=useUtils(),rt=useDefaultDates(),it=useThemeProps({props:tt,name:et});return _extends$u({disableFuture:!1,disablePast:!1},it,{minDate:applyDefaultDate(nt,it.minDate,rt.minDate),maxDate:applyDefaultDate(nt,it.maxDate,rt.maxDate)})}const MonthCalendarRoot=styled$1("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:DIALOG_WIDTH,boxSizing:"border-box"}),MonthCalendar=reactExports.forwardRef(function(et,nt){const rt=useMonthCalendarDefaultizedProps(et,"MuiMonthCalendar"),{className:it,value:ot,defaultValue:at,referenceDate:st,disabled:lt,disableFuture:ct,disablePast:ut,maxDate:ht,minDate:dt,onChange:pt,shouldDisableMonth:mt,readOnly:gt,disableHighlightToday:yt,autoFocus:bt=!1,onMonthFocus:wt,hasFocus:xt,onFocusedViewChange:kt,monthsPerRow:St=3,timezone:Tt,gridLabelId:At}=rt,Et=_objectWithoutPropertiesLoose$k(rt,_excluded$r),{value:Ct,handleValueChange:Lt,timezone:jt}=useControlledValueWithTimezone({name:"MonthCalendar",timezone:Tt,value:ot,defaultValue:at,onChange:pt,valueManager:singleItemValueManager}),Rt=useNow(jt),$t=useTheme$2(),vt=useUtils(),It=reactExports.useMemo(()=>singleItemValueManager.getInitialReferenceValue({value:Ct,utils:vt,props:rt,timezone:jt,referenceDate:st,granularity:SECTION_TYPE_GRANULARITY.month}),[]),Ot=rt,Wt=useUtilityClasses$5(Ot),zt=reactExports.useMemo(()=>vt.getMonth(Rt),[vt,Rt]),Ft=reactExports.useMemo(()=>Ct!=null?vt.getMonth(Ct):yt?null:vt.getMonth(It),[Ct,vt,yt,It]),[Nt,Ut]=reactExports.useState(()=>Ft||zt),[Pt,Ht]=useControlled({name:"MonthCalendar",state:"hasFocus",controlled:xt,default:bt??!1}),Qt=useEventCallback(rn=>{Ht(rn),kt&&kt(rn)}),an=reactExports.useCallback(rn=>{const Zt=vt.startOfMonth(ut&&vt.isAfter(Rt,dt)?Rt:dt),vn=vt.startOfMonth(ct&&vt.isBefore(Rt,ht)?Rt:ht),Cn=vt.startOfMonth(rn);return vt.isBefore(Cn,Zt)||vt.isAfter(Cn,vn)?!0:mt?mt(Cn):!1},[ct,ut,ht,dt,Rt,mt,vt]),Yt=useEventCallback((rn,Zt)=>{if(gt)return;const vn=vt.setMonth(Ct??It,Zt);Lt(vn)}),nn=useEventCallback(rn=>{an(vt.setMonth(Ct??It,rn))||(Ut(rn),Qt(!0),wt&&wt(rn))});reactExports.useEffect(()=>{Ut(rn=>Ft!==null&&rn!==Ft?Ft:rn)},[Ft]);const tn=useEventCallback((rn,Zt)=>{switch(rn.key){case"ArrowUp":nn((12+Zt-3)%12),rn.preventDefault();break;case"ArrowDown":nn((12+Zt+3)%12),rn.preventDefault();break;case"ArrowLeft":nn((12+Zt+($t.direction==="ltr"?-1:1))%12),rn.preventDefault();break;case"ArrowRight":nn((12+Zt+($t.direction==="ltr"?1:-1))%12),rn.preventDefault();break}}),dn=useEventCallback((rn,Zt)=>{nn(Zt)}),wn=useEventCallback((rn,Zt)=>{Nt===Zt&&Qt(!1)});return jsxRuntimeExports.jsx(MonthCalendarRoot,_extends$u({ref:nt,className:clsx(Wt.root,it),ownerState:Ot,role:"radiogroup","aria-labelledby":At},Et,{children:getMonthsInYear(vt,Ct??It).map(rn=>{const Zt=vt.getMonth(rn),vn=vt.format(rn,"monthShort"),Cn=vt.format(rn,"month"),$n=Zt===Ft,Nn=lt||an(rn);return jsxRuntimeExports.jsx(PickersMonth,{selected:$n,value:Zt,onClick:Yt,onKeyDown:tn,autoFocus:Pt&&Zt===Nt,disabled:Nn,tabIndex:Zt===Nt?0:-1,onFocus:dn,onBlur:wn,"aria-current":zt===Zt?"date":void 0,"aria-label":Cn,monthsPerRow:St,children:vn},vn)})}))});function getPickersYearUtilityClass(tt){return generateUtilityClass("MuiPickersYear",tt)}const pickersYearClasses=generateUtilityClasses("MuiPickersYear",["root","yearButton","selected","disabled"]),_excluded$q=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow"],useUtilityClasses$4=tt=>{const{disabled:et,selected:nt,classes:rt}=tt;return composeClasses({root:["root"],yearButton:["yearButton",et&&"disabled",nt&&"selected"]},getPickersYearUtilityClass,rt)},PickersYearRoot=styled$1("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(tt,et)=>[et.root]})(({ownerState:tt})=>({flexBasis:tt.yearsPerRow===3?"33.3%":"25%",display:"flex",alignItems:"center",justifyContent:"center"})),PickersYearButton=styled$1("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(tt,et)=>[et.yearButton,{[`&.${pickersYearClasses.disabled}`]:et.disabled},{[`&.${pickersYearClasses.selected}`]:et.selected}]})(({theme:tt})=>_extends$u({color:"unset",backgroundColor:"transparent",border:0,outline:0},tt.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.focusOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.focusOpacity)},"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${pickersYearClasses.disabled}`]:{color:(tt.vars||tt).palette.text.secondary},[`&.${pickersYearClasses.selected}`]:{color:(tt.vars||tt).palette.primary.contrastText,backgroundColor:(tt.vars||tt).palette.primary.main,"&:focus, &:hover":{backgroundColor:(tt.vars||tt).palette.primary.dark}}})),PickersYear=reactExports.memo(function(et){const nt=useThemeProps({props:et,name:"MuiPickersYear"}),{autoFocus:rt,className:it,children:ot,disabled:at,selected:st,value:lt,tabIndex:ct,onClick:ut,onKeyDown:ht,onFocus:dt,onBlur:pt,"aria-current":mt}=nt,gt=_objectWithoutPropertiesLoose$k(nt,_excluded$q),yt=reactExports.useRef(null),bt=useUtilityClasses$4(nt);return reactExports.useEffect(()=>{rt&&yt.current.focus()},[rt]),jsxRuntimeExports.jsx(PickersYearRoot,_extends$u({className:clsx(bt.root,it),ownerState:nt},gt,{children:jsxRuntimeExports.jsx(PickersYearButton,{ref:yt,disabled:at,type:"button",role:"radio",tabIndex:at?-1:ct,"aria-current":mt,"aria-checked":st,onClick:wt=>ut(wt,lt),onKeyDown:wt=>ht(wt,lt),onFocus:wt=>dt(wt,lt),onBlur:wt=>pt(wt,lt),className:bt.yearButton,ownerState:nt,children:ot})}))});function getYearCalendarUtilityClass(tt){return generateUtilityClass("MuiYearCalendar",tt)}generateUtilityClasses("MuiYearCalendar",["root"]);const _excluded$p=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsPerRow","timezone","gridLabelId"],useUtilityClasses$3=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getYearCalendarUtilityClass,et)};function useYearCalendarDefaultizedProps(tt,et){var nt;const rt=useUtils(),it=useDefaultDates(),ot=useThemeProps({props:tt,name:et});return _extends$u({disablePast:!1,disableFuture:!1},ot,{yearsPerRow:(nt=ot.yearsPerRow)!=null?nt:3,minDate:applyDefaultDate(rt,ot.minDate,it.minDate),maxDate:applyDefaultDate(rt,ot.maxDate,it.maxDate)})}const YearCalendarRoot=styled$1("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:DIALOG_WIDTH,maxHeight:MAX_CALENDAR_HEIGHT,boxSizing:"border-box",position:"relative"}),YearCalendar=reactExports.forwardRef(function(et,nt){const rt=useYearCalendarDefaultizedProps(et,"MuiYearCalendar"),{autoFocus:it,className:ot,value:at,defaultValue:st,referenceDate:lt,disabled:ct,disableFuture:ut,disablePast:ht,maxDate:dt,minDate:pt,onChange:mt,readOnly:gt,shouldDisableYear:yt,disableHighlightToday:bt,onYearFocus:wt,hasFocus:xt,onFocusedViewChange:kt,yearsPerRow:St,timezone:Tt,gridLabelId:At}=rt,Et=_objectWithoutPropertiesLoose$k(rt,_excluded$p),{value:Ct,handleValueChange:Lt,timezone:jt}=useControlledValueWithTimezone({name:"YearCalendar",timezone:Tt,value:at,defaultValue:st,onChange:mt,valueManager:singleItemValueManager}),Rt=useNow(jt),$t=useTheme$2(),vt=useUtils(),It=reactExports.useMemo(()=>singleItemValueManager.getInitialReferenceValue({value:Ct,utils:vt,props:rt,timezone:jt,referenceDate:lt,granularity:SECTION_TYPE_GRANULARITY.year}),[]),Ot=rt,Wt=useUtilityClasses$3(Ot),zt=reactExports.useMemo(()=>vt.getYear(Rt),[vt,Rt]),Ft=reactExports.useMemo(()=>Ct!=null?vt.getYear(Ct):bt?null:vt.getYear(It),[Ct,vt,bt,It]),[Nt,Ut]=reactExports.useState(()=>Ft||zt),[Pt,Ht]=useControlled({name:"YearCalendar",state:"hasFocus",controlled:xt,default:it??!1}),Qt=useEventCallback(vn=>{Ht(vn),kt&&kt(vn)}),an=reactExports.useCallback(vn=>{if(ht&&vt.isBeforeYear(vn,Rt)||ut&&vt.isAfterYear(vn,Rt)||pt&&vt.isBeforeYear(vn,pt)||dt&&vt.isAfterYear(vn,dt))return!0;if(!yt)return!1;const Cn=vt.startOfYear(vn);return yt(Cn)},[ut,ht,dt,pt,Rt,yt,vt]),Yt=useEventCallback((vn,Cn)=>{if(gt)return;const $n=vt.setYear(Ct??It,Cn);Lt($n)}),nn=useEventCallback(vn=>{an(vt.setYear(Ct??It,vn))||(Ut(vn),Qt(!0),wt==null||wt(vn))});reactExports.useEffect(()=>{Ut(vn=>Ft!==null&&vn!==Ft?Ft:vn)},[Ft]);const tn=useEventCallback((vn,Cn)=>{switch(vn.key){case"ArrowUp":nn(Cn-St),vn.preventDefault();break;case"ArrowDown":nn(Cn+St),vn.preventDefault();break;case"ArrowLeft":nn(Cn+($t.direction==="ltr"?-1:1)),vn.preventDefault();break;case"ArrowRight":nn(Cn+($t.direction==="ltr"?1:-1)),vn.preventDefault();break}}),dn=useEventCallback((vn,Cn)=>{nn(Cn)}),wn=useEventCallback((vn,Cn)=>{Nt===Cn&&Qt(!1)}),rn=reactExports.useRef(null),Zt=useForkRef(nt,rn);return reactExports.useEffect(()=>{if(it||rn.current===null)return;const vn=rn.current.querySelector('[tabindex="0"]');if(!vn)return;const Cn=vn.offsetHeight,$n=vn.offsetTop,Nn=rn.current.clientHeight,En=rn.current.scrollTop,sn=$n+Cn;Cn>Nn||$n{const Cn=vt.getYear(vn),$n=Cn===Ft,Nn=ct||an(vn);return jsxRuntimeExports.jsx(PickersYear,{selected:$n,value:Cn,onClick:Yt,onKeyDown:tn,autoFocus:Pt&&Cn===Nt,disabled:Nn,tabIndex:Cn===Nt?0:-1,onFocus:dn,onBlur:wn,"aria-current":zt===Cn?"date":void 0,yearsPerRow:St,children:vt.format(vn,"year")},vt.format(vn,"year"))})}))}),getPickersCalendarHeaderUtilityClass=tt=>generateUtilityClass("MuiPickersCalendarHeader",tt),pickersCalendarHeaderClasses=generateUtilityClasses("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),_excluded$o=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone"],_excluded2$7=["ownerState"],useUtilityClasses$2=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},getPickersCalendarHeaderUtilityClass,et)},PickersCalendarHeaderRoot=styled$1("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),PickersCalendarHeaderLabelContainer=styled$1("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(tt,et)=>et.labelContainer})(({theme:tt})=>_extends$u({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},tt.typography.body1,{fontWeight:tt.typography.fontWeightMedium})),PickersCalendarHeaderLabel=styled$1("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(tt,et)=>et.label})({marginRight:6}),PickersCalendarHeaderSwitchViewButton=styled$1(IconButton$1,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(tt,et)=>et.switchViewButton})(({ownerState:tt})=>_extends$u({marginRight:"auto"},tt.view==="year"&&{[`.${pickersCalendarHeaderClasses.switchViewIcon}`]:{transform:"rotate(180deg)"}})),PickersCalendarHeaderSwitchViewIcon=styled$1(ArrowDropDownIcon,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(tt,et)=>et.switchViewIcon})(({theme:tt})=>({willChange:"transform",transition:tt.transitions.create("transform"),transform:"rotate(0deg)"})),PickersCalendarHeader=reactExports.forwardRef(function(et,nt){var rt,it;const ot=useLocaleText(),at=useUtils(),st=useThemeProps({props:et,name:"MuiPickersCalendarHeader"}),{slots:lt,slotProps:ct,currentMonth:ut,disabled:ht,disableFuture:dt,disablePast:pt,maxDate:mt,minDate:gt,onMonthChange:yt,onViewChange:bt,view:wt,reduceAnimations:xt,views:kt,labelId:St,className:Tt,timezone:At}=st,Et=_objectWithoutPropertiesLoose$k(st,_excluded$o),Ct=st,Lt=useUtilityClasses$2(st),jt=(rt=lt==null?void 0:lt.switchViewButton)!=null?rt:PickersCalendarHeaderSwitchViewButton,Rt=useSlotProps({elementType:jt,externalSlotProps:ct==null?void 0:ct.switchViewButton,additionalProps:{size:"small","aria-label":ot.calendarViewSwitchingButtonAriaLabel(wt)},ownerState:Ct,className:Lt.switchViewButton}),$t=(it=lt==null?void 0:lt.switchViewIcon)!=null?it:PickersCalendarHeaderSwitchViewIcon,vt=useSlotProps({elementType:$t,externalSlotProps:ct==null?void 0:ct.switchViewIcon,ownerState:void 0,className:Lt.switchViewIcon}),It=_objectWithoutPropertiesLoose$k(vt,_excluded2$7),Ot=()=>yt(at.addMonths(ut,1),"left"),Wt=()=>yt(at.addMonths(ut,-1),"right"),zt=useNextMonthDisabled(ut,{disableFuture:dt,maxDate:mt,timezone:At}),Ft=usePreviousMonthDisabled(ut,{disablePast:pt,minDate:gt,timezone:At}),Nt=()=>{if(!(kt.length===1||!bt||ht))if(kt.length===2)bt(kt.find(Ut=>Ut!==wt)||kt[0]);else{const Ut=kt.indexOf(wt)!==0?0:1;bt(kt[Ut])}};return kt.length===1&&kt[0]==="year"?null:jsxRuntimeExports.jsxs(PickersCalendarHeaderRoot,_extends$u({},Et,{ownerState:Ct,className:clsx(Tt,Lt.root),ref:nt,children:[jsxRuntimeExports.jsxs(PickersCalendarHeaderLabelContainer,{role:"presentation",onClick:Nt,ownerState:Ct,"aria-live":"polite",className:Lt.labelContainer,children:[jsxRuntimeExports.jsx(PickersFadeTransitionGroup,{reduceAnimations:xt,transKey:at.format(ut,"monthAndYear"),children:jsxRuntimeExports.jsx(PickersCalendarHeaderLabel,{id:St,ownerState:Ct,className:Lt.label,children:at.format(ut,"monthAndYear")})}),kt.length>1&&!ht&&jsxRuntimeExports.jsx(jt,_extends$u({},Rt,{children:jsxRuntimeExports.jsx($t,_extends$u({},It))}))]}),jsxRuntimeExports.jsx(Fade$1,{in:wt==="day",children:jsxRuntimeExports.jsx(PickersArrowSwitcher,{slots:lt,slotProps:ct,onGoToPrevious:Wt,isPreviousDisabled:Ft,previousLabel:ot.previousMonth,onGoToNext:Ot,isNextDisabled:zt,nextLabel:ot.nextMonth})})]}))}),getDateCalendarUtilityClass=tt=>generateUtilityClass("MuiDateCalendar",tt);generateUtilityClasses("MuiDateCalendar",["root","viewTransitionContainer"]);const _excluded$n=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","components","componentsProps","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsPerRow","monthsPerRow","timezone"],useUtilityClasses$1=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},getDateCalendarUtilityClass,et)};function useDateCalendarDefaultizedProps(tt,et){var nt,rt,it,ot,at,st,lt;const ct=useUtils(),ut=useDefaultDates(),ht=useDefaultReduceAnimations(),dt=useThemeProps({props:tt,name:et});return _extends$u({},dt,{loading:(nt=dt.loading)!=null?nt:!1,disablePast:(rt=dt.disablePast)!=null?rt:!1,disableFuture:(it=dt.disableFuture)!=null?it:!1,openTo:(ot=dt.openTo)!=null?ot:"day",views:(at=dt.views)!=null?at:["year","day"],reduceAnimations:(st=dt.reduceAnimations)!=null?st:ht,renderLoading:(lt=dt.renderLoading)!=null?lt:()=>jsxRuntimeExports.jsx("span",{children:"..."}),minDate:applyDefaultDate(ct,dt.minDate,ut.minDate),maxDate:applyDefaultDate(ct,dt.maxDate,ut.maxDate)})}const DateCalendarRoot=styled$1(PickerViewRoot,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"flex",flexDirection:"column",height:VIEW_HEIGHT}),DateCalendarViewTransitionContainer=styled$1(PickersFadeTransitionGroup,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(tt,et)=>et.viewTransitionContainer})({}),DateCalendar=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useUtils(),st=useId(),lt=useDateCalendarDefaultizedProps(et,"MuiDateCalendar"),{autoFocus:ct,onViewChange:ut,value:ht,defaultValue:dt,referenceDate:pt,disableFuture:mt,disablePast:gt,defaultCalendarMonth:yt,onChange:bt,onYearChange:wt,onMonthChange:xt,reduceAnimations:kt,shouldDisableDate:St,shouldDisableMonth:Tt,shouldDisableYear:At,view:Et,views:Ct,openTo:Lt,className:jt,disabled:Rt,readOnly:$t,minDate:vt,maxDate:It,disableHighlightToday:Ot,focusedView:Wt,onFocusedViewChange:zt,showDaysOutsideCurrentMonth:Ft,fixedWeekNumber:Nt,dayOfWeekFormatter:Ut,components:Pt,componentsProps:Ht,slots:Qt,slotProps:an,loading:Yt,renderLoading:nn,displayWeekNumber:tn,yearsPerRow:dn,monthsPerRow:wn,timezone:rn}=lt,Zt=_objectWithoutPropertiesLoose$k(lt,_excluded$n),{value:vn,handleValueChange:Cn,timezone:$n}=useControlledValueWithTimezone({name:"DateCalendar",timezone:rn,value:ht,defaultValue:dt,onChange:bt,valueManager:singleItemValueManager}),{view:Nn,setView:En,focusedView:sn,setFocusedView:pn,goToNextView:Tn,setValueAndGoToNextView:In}=useViews({view:Et,views:Ct,openTo:Lt,onChange:Cn,onViewChange:ut,autoFocus:ct,focusedView:Wt,onFocusedViewChange:zt}),{referenceDate:yn,calendarState:hn,changeFocusedDay:fn,changeMonth:xn,handleChangeMonth:jn,isDateDisabled:cn,onMonthSwitchingAnimationEnd:Xt}=useCalendarState({value:vn,defaultCalendarMonth:yt,referenceDate:pt,reduceAnimations:kt,onMonthChange:xt,minDate:vt,maxDate:It,shouldDisableDate:St,disablePast:gt,disableFuture:mt,timezone:$n}),Kt=Rt&&vn||vt,kn=Rt&&vn||It,Mn=`${st}-grid-label`,On=sn!==null,Bn=(rt=(it=Qt==null?void 0:Qt.calendarHeader)!=null?it:Pt==null?void 0:Pt.CalendarHeader)!=null?rt:PickersCalendarHeader,Xn=useSlotProps({elementType:Bn,externalSlotProps:(ot=an==null?void 0:an.calendarHeader)!=null?ot:Ht==null?void 0:Ht.calendarHeader,additionalProps:{views:Ct,view:Nn,currentMonth:hn.currentMonth,onViewChange:En,onMonthChange:(Er,Ir)=>jn({newMonth:Er,direction:Ir}),minDate:Kt,maxDate:kn,disabled:Rt,disablePast:gt,disableFuture:mt,reduceAnimations:kt,timezone:$n,labelId:Mn,slots:Qt,slotProps:an},ownerState:lt}),Vn=useEventCallback(Er=>{const Ir=at.startOfMonth(Er),Gr=at.endOfMonth(Er),Or=cn(Er)?findClosestEnabledDate({utils:at,date:Er,minDate:at.isBefore(vt,Ir)?Ir:vt,maxDate:at.isAfter(It,Gr)?Gr:It,disablePast:gt,disableFuture:mt,isDateDisabled:cn,timezone:$n}):Er;Or?(In(Or,"finish"),xt==null||xt(Ir)):(Tn(),xn(Ir)),fn(Or,!0)}),Gn=useEventCallback(Er=>{const Ir=at.startOfYear(Er),Gr=at.endOfYear(Er),Or=cn(Er)?findClosestEnabledDate({utils:at,date:Er,minDate:at.isBefore(vt,Ir)?Ir:vt,maxDate:at.isAfter(It,Gr)?Gr:It,disablePast:gt,disableFuture:mt,isDateDisabled:cn,timezone:$n}):Er;Or?(In(Or,"finish"),wt==null||wt(Or)):(Tn(),xn(Ir)),fn(Or,!0)}),zn=useEventCallback(Er=>Cn(Er&&mergeDateAndTime(at,Er,vn??yn),"finish"));reactExports.useEffect(()=>{vn!=null&&at.isValid(vn)&&xn(vn)},[vn]);const Jn=lt,Wn=useUtilityClasses$1(Jn),fr={disablePast:gt,disableFuture:mt,maxDate:It,minDate:vt},ur={disableHighlightToday:Ot,readOnly:$t,disabled:Rt,timezone:$n,gridLabelId:Mn},wr=reactExports.useRef(Nn);reactExports.useEffect(()=>{wr.current!==Nn&&(sn===wr.current&&pn(Nn,!0),wr.current=Nn)},[sn,pn,Nn]);const Xr=reactExports.useMemo(()=>[vn],[vn]);return jsxRuntimeExports.jsxs(DateCalendarRoot,_extends$u({ref:nt,className:clsx(Wn.root,jt),ownerState:Jn},Zt,{children:[jsxRuntimeExports.jsx(Bn,_extends$u({},Xn)),jsxRuntimeExports.jsx(DateCalendarViewTransitionContainer,{reduceAnimations:kt,className:Wn.viewTransitionContainer,transKey:Nn,ownerState:Jn,children:jsxRuntimeExports.jsxs("div",{children:[Nn==="year"&&jsxRuntimeExports.jsx(YearCalendar,_extends$u({},fr,ur,{value:vn,onChange:Gn,shouldDisableYear:At,hasFocus:On,onFocusedViewChange:Er=>pn("year",Er),yearsPerRow:dn,referenceDate:yn})),Nn==="month"&&jsxRuntimeExports.jsx(MonthCalendar,_extends$u({},fr,ur,{hasFocus:On,className:jt,value:vn,onChange:Vn,shouldDisableMonth:Tt,onFocusedViewChange:Er=>pn("month",Er),monthsPerRow:wn,referenceDate:yn})),Nn==="day"&&jsxRuntimeExports.jsx(DayCalendar,_extends$u({},hn,fr,ur,{onMonthSwitchingAnimationEnd:Xt,onFocusedDayChange:fn,reduceAnimations:kt,selectedDays:Xr,onSelectedDaysChange:zn,shouldDisableDate:St,shouldDisableMonth:Tt,shouldDisableYear:At,hasFocus:On,onFocusedViewChange:Er=>pn("day",Er),showDaysOutsideCurrentMonth:Ft,fixedWeekNumber:Nt,dayOfWeekFormatter:Ut,displayWeekNumber:tn,components:Pt,componentsProps:Ht,slots:Qt,slotProps:an,loading:Yt,renderLoading:nn}))]})})]}))});function getDatePickerToolbarUtilityClass(tt){return generateUtilityClass("MuiDatePickerToolbar",tt)}generateUtilityClasses("MuiDatePickerToolbar",["root","title"]);const _excluded$m=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views"],useUtilityClasses=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],title:["title"]},getDatePickerToolbarUtilityClass,et)},DatePickerToolbarRoot=styled$1(PickersToolbar,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),DatePickerToolbarTitle=styled$1(Typography$1,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(tt,et)=>et.title})(({ownerState:tt})=>_extends$u({},tt.isLandscape&&{margin:"auto 16px auto auto"})),DatePickerToolbar=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDatePickerToolbar"}),{value:it,isLandscape:ot,toolbarFormat:at,toolbarPlaceholder:st="––",views:lt}=rt,ct=_objectWithoutPropertiesLoose$k(rt,_excluded$m),ut=useUtils(),ht=useLocaleText(),dt=useUtilityClasses(rt),pt=reactExports.useMemo(()=>{if(!it)return st;const gt=resolveDateFormat(ut,{format:at,views:lt},!0);return ut.formatByString(it,gt)},[it,at,st,ut,lt]),mt=rt;return jsxRuntimeExports.jsx(DatePickerToolbarRoot,_extends$u({ref:nt,toolbarTitle:ht.datePickerToolbarTitle,isLandscape:ot,className:dt.root},ct,{children:jsxRuntimeExports.jsx(DatePickerToolbarTitle,{variant:"h4",align:ot?"left":"center",ownerState:mt,className:dt.title,children:pt})}))});function useDatePickerDefaultizedProps(tt,et){var nt,rt,it,ot;const at=useUtils(),st=useDefaultDates(),lt=useThemeProps({props:tt,name:et}),ct=reactExports.useMemo(()=>{var ht;return((ht=lt.localeText)==null?void 0:ht.toolbarTitle)==null?lt.localeText:_extends$u({},lt.localeText,{datePickerToolbarTitle:lt.localeText.toolbarTitle})},[lt.localeText]),ut=(nt=lt.slots)!=null?nt:uncapitalizeObjectKeys(lt.components);return _extends$u({},lt,{localeText:ct},applyDefaultViewProps({views:lt.views,openTo:lt.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:(rt=lt.disableFuture)!=null?rt:!1,disablePast:(it=lt.disablePast)!=null?it:!1,minDate:applyDefaultDate(at,lt.minDate,st.minDate),maxDate:applyDefaultDate(at,lt.maxDate,st.maxDate),slots:_extends$u({toolbar:DatePickerToolbar},ut),slotProps:(ot=lt.slotProps)!=null?ot:lt.componentsProps})}const _excluded$l=["props","getOpenDialogAriaText"],_excluded2$6=["ownerState"],_excluded3$1=["ownerState"],useDesktopPicker=tt=>{var et,nt,rt,it,ot;let{props:at,getOpenDialogAriaText:st}=tt,lt=_objectWithoutPropertiesLoose$k(tt,_excluded$l);const{slots:ct,slotProps:ut,className:ht,sx:dt,format:pt,formatDensity:mt,timezone:gt,label:yt,inputRef:bt,readOnly:wt,disabled:xt,autoFocus:kt,localeText:St,reduceAnimations:Tt}=at,At=useUtils(),Et=reactExports.useRef(null),Ct=reactExports.useRef(null),Lt=useId(),jt=(et=ut==null||(nt=ut.toolbar)==null?void 0:nt.hidden)!=null?et:!1,{open:Rt,actions:$t,hasUIView:vt,layoutProps:It,renderCurrentView:Ot,shouldRestoreFocus:Wt,fieldProps:zt}=usePicker(_extends$u({},lt,{props:at,inputRef:Et,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),Ft=(rt=ct.inputAdornment)!=null?rt:MuiInputAdornment,Nt=useSlotProps({elementType:Ft,externalSlotProps:ut==null?void 0:ut.inputAdornment,additionalProps:{position:"end"},ownerState:at}),Ut=_objectWithoutPropertiesLoose$k(Nt,_excluded2$6),Pt=(it=ct.openPickerButton)!=null?it:IconButton$1,Ht=useSlotProps({elementType:Pt,externalSlotProps:ut==null?void 0:ut.openPickerButton,additionalProps:{disabled:xt||wt,onClick:Rt?$t.onClose:$t.onOpen,"aria-label":st(zt.value,At),edge:Ut.position},ownerState:at}),Qt=_objectWithoutPropertiesLoose$k(Ht,_excluded3$1),an=ct.openPickerIcon,Yt=ct.field,nn=useSlotProps({elementType:Yt,externalSlotProps:ut==null?void 0:ut.field,additionalProps:_extends$u({},zt,jt&&{id:Lt},{readOnly:wt,disabled:xt,className:ht,sx:dt,format:pt,formatDensity:mt,timezone:gt,label:yt,autoFocus:kt&&!at.open,focused:Rt?!0:void 0}),ownerState:at});vt&&(nn.InputProps=_extends$u({},nn.InputProps,{ref:Ct,[`${Ut.position}Adornment`]:jsxRuntimeExports.jsx(Ft,_extends$u({},Ut,{children:jsxRuntimeExports.jsx(Pt,_extends$u({},Qt,{children:jsxRuntimeExports.jsx(an,_extends$u({},ut==null?void 0:ut.openPickerIcon))}))}))}));const tn=_extends$u({textField:ct.textField,clearIcon:ct.clearIcon,clearButton:ct.clearButton},nn.slots),dn=(ot=ct.layout)!=null?ot:PickersLayout,wn=useForkRef(Et,nn.inputRef,bt);let rn=Lt;jt&&(yt?rn=`${Lt}-label`:rn=void 0);const Zt=_extends$u({},ut,{toolbar:_extends$u({},ut==null?void 0:ut.toolbar,{titleId:Lt}),popper:_extends$u({"aria-labelledby":rn},ut==null?void 0:ut.popper)});return{renderPicker:()=>jsxRuntimeExports.jsxs(LocalizationProvider,{localeText:St,children:[jsxRuntimeExports.jsx(Yt,_extends$u({},nn,{slots:tn,slotProps:Zt,inputRef:wn})),jsxRuntimeExports.jsx(PickersPopper,_extends$u({role:"dialog",placement:"bottom-start",anchorEl:Ct.current},$t,{open:Rt,slots:ct,slotProps:Zt,shouldRestoreFocus:Wt,reduceAnimations:Tt,children:jsxRuntimeExports.jsx(dn,_extends$u({},It,Zt==null?void 0:Zt.layout,{slots:ct,slotProps:Zt,children:Ot()}))}))]})}},renderDateViewCalendar=({view:tt,onViewChange:et,views:nt,focusedView:rt,onFocusedViewChange:it,value:ot,defaultValue:at,referenceDate:st,onChange:lt,className:ct,classes:ut,disableFuture:ht,disablePast:dt,minDate:pt,maxDate:mt,shouldDisableDate:gt,shouldDisableMonth:yt,shouldDisableYear:bt,reduceAnimations:wt,onMonthChange:xt,monthsPerRow:kt,onYearChange:St,yearsPerRow:Tt,defaultCalendarMonth:At,components:Et,componentsProps:Ct,slots:Lt,slotProps:jt,loading:Rt,renderLoading:$t,disableHighlightToday:vt,readOnly:It,disabled:Ot,showDaysOutsideCurrentMonth:Wt,dayOfWeekFormatter:zt,sx:Ft,autoFocus:Nt,fixedWeekNumber:Ut,displayWeekNumber:Pt,timezone:Ht})=>jsxRuntimeExports.jsx(DateCalendar,{view:tt,onViewChange:et,views:nt.filter(isDatePickerView),focusedView:rt&&isDatePickerView(rt)?rt:null,onFocusedViewChange:it,value:ot,defaultValue:at,referenceDate:st,onChange:lt,className:ct,classes:ut,disableFuture:ht,disablePast:dt,minDate:pt,maxDate:mt,shouldDisableDate:gt,shouldDisableMonth:yt,shouldDisableYear:bt,reduceAnimations:wt,onMonthChange:xt,monthsPerRow:kt,onYearChange:St,yearsPerRow:Tt,defaultCalendarMonth:At,components:Et,componentsProps:Ct,slots:Lt,slotProps:jt,loading:Rt,renderLoading:$t,disableHighlightToday:vt,readOnly:It,disabled:Ot,showDaysOutsideCurrentMonth:Wt,dayOfWeekFormatter:zt,sx:Ft,autoFocus:Nt,fixedWeekNumber:Ut,displayWeekNumber:Pt,timezone:Ht}),DesktopDatePicker=reactExports.forwardRef(function(et,nt){var rt,it,ot,at;const st=useLocaleText(),lt=useUtils(),ct=useDatePickerDefaultizedProps(et,"MuiDesktopDatePicker"),ut=_extends$u({day:renderDateViewCalendar,month:renderDateViewCalendar,year:renderDateViewCalendar},ct.viewRenderers),ht=_extends$u({},ct,{viewRenderers:ut,format:resolveDateFormat(lt,ct,!1),yearsPerRow:(rt=ct.yearsPerRow)!=null?rt:4,slots:_extends$u({openPickerIcon:CalendarIcon,field:DateField},ct.slots),slotProps:_extends$u({},ct.slotProps,{field:pt=>{var mt;return _extends$u({},resolveComponentProps((mt=ct.slotProps)==null?void 0:mt.field,pt),extractValidationProps(ct),{ref:nt})},toolbar:_extends$u({hidden:!0},(it=ct.slotProps)==null?void 0:it.toolbar)})}),{renderPicker:dt}=useDesktopPicker({props:ht,valueManager:singleItemValueManager,valueType:"date",getOpenDialogAriaText:(ot=(at=ht.localeText)==null?void 0:at.openDatePickerDialogue)!=null?ot:st.openDatePickerDialogue,validator:validateDate});return dt()});DesktopDatePicker.propTypes={autoFocus:PropTypes.bool,className:PropTypes.string,closeOnSelect:PropTypes.bool,components:PropTypes.object,componentsProps:PropTypes.object,dayOfWeekFormatter:PropTypes.func,defaultCalendarMonth:PropTypes.any,defaultValue:PropTypes.any,disabled:PropTypes.bool,disableFuture:PropTypes.bool,disableHighlightToday:PropTypes.bool,disableOpenPicker:PropTypes.bool,disablePast:PropTypes.bool,displayWeekNumber:PropTypes.bool,fixedWeekNumber:PropTypes.number,format:PropTypes.string,formatDensity:PropTypes.oneOf(["dense","spacious"]),inputRef:refType$1,label:PropTypes.node,loading:PropTypes.bool,localeText:PropTypes.object,maxDate:PropTypes.any,minDate:PropTypes.any,monthsPerRow:PropTypes.oneOf([3,4]),onAccept:PropTypes.func,onChange:PropTypes.func,onClose:PropTypes.func,onError:PropTypes.func,onMonthChange:PropTypes.func,onOpen:PropTypes.func,onSelectedSectionsChange:PropTypes.func,onViewChange:PropTypes.func,onYearChange:PropTypes.func,open:PropTypes.bool,openTo:PropTypes.oneOf(["day","month","year"]),orientation:PropTypes.oneOf(["landscape","portrait"]),readOnly:PropTypes.bool,reduceAnimations:PropTypes.bool,referenceDate:PropTypes.any,renderLoading:PropTypes.func,selectedSections:PropTypes.oneOfType([PropTypes.oneOf(["all","day","hours","meridiem","minutes","month","seconds","weekDay","year"]),PropTypes.number,PropTypes.shape({endIndex:PropTypes.number.isRequired,startIndex:PropTypes.number.isRequired})]),shouldDisableDate:PropTypes.func,shouldDisableMonth:PropTypes.func,shouldDisableYear:PropTypes.func,showDaysOutsideCurrentMonth:PropTypes.bool,slotProps:PropTypes.object,slots:PropTypes.object,sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object]),timezone:PropTypes.string,value:PropTypes.any,view:PropTypes.oneOf(["day","month","year"]),viewRenderers:PropTypes.shape({day:PropTypes.func,month:PropTypes.func,year:PropTypes.func}),views:PropTypes.arrayOf(PropTypes.oneOf(["day","month","year"]).isRequired),yearsPerRow:PropTypes.oneOf([3,4])};const _excluded$k=["props","getOpenDialogAriaText"],useMobilePicker=tt=>{var et,nt,rt;let{props:it,getOpenDialogAriaText:ot}=tt,at=_objectWithoutPropertiesLoose$k(tt,_excluded$k);const{slots:st,slotProps:lt,className:ct,sx:ut,format:ht,formatDensity:dt,timezone:pt,label:mt,inputRef:gt,readOnly:yt,disabled:bt,localeText:wt}=it,xt=useUtils(),kt=reactExports.useRef(null),St=useId(),Tt=(et=lt==null||(nt=lt.toolbar)==null?void 0:nt.hidden)!=null?et:!1,{open:At,actions:Et,layoutProps:Ct,renderCurrentView:Lt,fieldProps:jt}=usePicker(_extends$u({},at,{props:it,inputRef:kt,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),Rt=st.field,$t=useSlotProps({elementType:Rt,externalSlotProps:lt==null?void 0:lt.field,additionalProps:_extends$u({},jt,Tt&&{id:St},!(bt||yt)&&{onClick:Et.onOpen,onKeyDown:onSpaceOrEnter(Et.onOpen)},{readOnly:yt??!0,disabled:bt,className:ct,sx:ut,format:ht,formatDensity:dt,timezone:pt,label:mt}),ownerState:it});$t.inputProps=_extends$u({},$t.inputProps,{"aria-label":ot(jt.value,xt)});const vt=_extends$u({textField:st.textField},$t.slots),It=(rt=st.layout)!=null?rt:PickersLayout,Ot=useForkRef(kt,$t.inputRef,gt);let Wt=St;Tt&&(mt?Wt=`${St}-label`:Wt=void 0);const zt=_extends$u({},lt,{toolbar:_extends$u({},lt==null?void 0:lt.toolbar,{titleId:St}),mobilePaper:_extends$u({"aria-labelledby":Wt},lt==null?void 0:lt.mobilePaper)});return{renderPicker:()=>jsxRuntimeExports.jsxs(LocalizationProvider,{localeText:wt,children:[jsxRuntimeExports.jsx(Rt,_extends$u({},$t,{slots:vt,slotProps:zt,inputRef:Ot})),jsxRuntimeExports.jsx(PickersModalDialog,_extends$u({},Et,{open:At,slots:st,slotProps:zt,children:jsxRuntimeExports.jsx(It,_extends$u({},Ct,zt==null?void 0:zt.layout,{slots:st,slotProps:zt,children:Lt()}))}))]})}},MobileDatePicker=reactExports.forwardRef(function(et,nt){var rt,it,ot;const at=useLocaleText(),st=useUtils(),lt=useDatePickerDefaultizedProps(et,"MuiMobileDatePicker"),ct=_extends$u({day:renderDateViewCalendar,month:renderDateViewCalendar,year:renderDateViewCalendar},lt.viewRenderers),ut=_extends$u({},lt,{viewRenderers:ct,format:resolveDateFormat(st,lt,!1),slots:_extends$u({field:DateField},lt.slots),slotProps:_extends$u({},lt.slotProps,{field:dt=>{var pt;return _extends$u({},resolveComponentProps((pt=lt.slotProps)==null?void 0:pt.field,dt),extractValidationProps(lt),{ref:nt})},toolbar:_extends$u({hidden:!1},(rt=lt.slotProps)==null?void 0:rt.toolbar)})}),{renderPicker:ht}=useMobilePicker({props:ut,valueManager:singleItemValueManager,valueType:"date",getOpenDialogAriaText:(it=(ot=ut.localeText)==null?void 0:ot.openDatePickerDialogue)!=null?it:at.openDatePickerDialogue,validator:validateDate});return ht()});MobileDatePicker.propTypes={autoFocus:PropTypes.bool,className:PropTypes.string,closeOnSelect:PropTypes.bool,components:PropTypes.object,componentsProps:PropTypes.object,dayOfWeekFormatter:PropTypes.func,defaultCalendarMonth:PropTypes.any,defaultValue:PropTypes.any,disabled:PropTypes.bool,disableFuture:PropTypes.bool,disableHighlightToday:PropTypes.bool,disableOpenPicker:PropTypes.bool,disablePast:PropTypes.bool,displayWeekNumber:PropTypes.bool,fixedWeekNumber:PropTypes.number,format:PropTypes.string,formatDensity:PropTypes.oneOf(["dense","spacious"]),inputRef:refType$1,label:PropTypes.node,loading:PropTypes.bool,localeText:PropTypes.object,maxDate:PropTypes.any,minDate:PropTypes.any,monthsPerRow:PropTypes.oneOf([3,4]),onAccept:PropTypes.func,onChange:PropTypes.func,onClose:PropTypes.func,onError:PropTypes.func,onMonthChange:PropTypes.func,onOpen:PropTypes.func,onSelectedSectionsChange:PropTypes.func,onViewChange:PropTypes.func,onYearChange:PropTypes.func,open:PropTypes.bool,openTo:PropTypes.oneOf(["day","month","year"]),orientation:PropTypes.oneOf(["landscape","portrait"]),readOnly:PropTypes.bool,reduceAnimations:PropTypes.bool,referenceDate:PropTypes.any,renderLoading:PropTypes.func,selectedSections:PropTypes.oneOfType([PropTypes.oneOf(["all","day","hours","meridiem","minutes","month","seconds","weekDay","year"]),PropTypes.number,PropTypes.shape({endIndex:PropTypes.number.isRequired,startIndex:PropTypes.number.isRequired})]),shouldDisableDate:PropTypes.func,shouldDisableMonth:PropTypes.func,shouldDisableYear:PropTypes.func,showDaysOutsideCurrentMonth:PropTypes.bool,slotProps:PropTypes.object,slots:PropTypes.object,sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object]),timezone:PropTypes.string,value:PropTypes.any,view:PropTypes.oneOf(["day","month","year"]),viewRenderers:PropTypes.shape({day:PropTypes.func,month:PropTypes.func,year:PropTypes.func}),views:PropTypes.arrayOf(PropTypes.oneOf(["day","month","year"]).isRequired),yearsPerRow:PropTypes.oneOf([3,4])};const _excluded$j=["desktopModeMediaQuery"],DatePicker=reactExports.forwardRef(function(et,nt){const rt=useThemeProps({props:et,name:"MuiDatePicker"}),{desktopModeMediaQuery:it=DEFAULT_DESKTOP_MODE_MEDIA_QUERY}=rt,ot=_objectWithoutPropertiesLoose$k(rt,_excluded$j);return useMediaQuery(it,{defaultMatches:!0})?jsxRuntimeExports.jsx(DesktopDatePicker,_extends$u({ref:nt},ot)):jsxRuntimeExports.jsx(MobileDatePicker,_extends$u({ref:nt},ot))});var classnames={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames @@ -5821,7 +5915,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho height and width.`,Ot,Wt,at,lt,ut,ht,nt),reactExports.cloneElement(pt,{width:Ot,height:Wt})},[nt,pt,lt,dt,ht,ut,At,at]);reactExports.useEffect(function(){var vt=Lt();vt&&Et(vt)},[Lt]);var $t=_objectSpread$r(_objectSpread$r({},kt),{},{width:at,height:lt,minWidth:ut,minHeight:ht,maxHeight:dt});return React$1.createElement(ResizeDetector,{handleWidth:!0,handleHeight:!0,onResize:jt,targetRef:Ct,refreshMode:gt>0?"debounce":void 0,refreshRate:gt},React$1.createElement("div",_extends$n({},yt!=null?{id:"".concat(yt)}:{},{className:classNames("recharts-responsive-container",bt),style:$t,ref:Ct}),Rt))}),Cell=function(et){return null};Cell.displayName="Cell";function _typeof$s(tt){"@babel/helpers - typeof";return _typeof$s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$s(tt)}function ownKeys$q(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);et&&(rt=rt.filter(function(it){return Object.getOwnPropertyDescriptor(tt,it).enumerable})),nt.push.apply(nt,rt)}return nt}function _objectSpread$q(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt=0&&et===+et?"".concat(et,"px"):et}function camelToMiddleLine(tt){var et=tt.split(""),nt=et.reduce(function(rt,it){return it===it.toUpperCase()?[].concat(_toConsumableArray$9(rt),["-",it.toLowerCase()]):[].concat(_toConsumableArray$9(rt),[it])},[]);return nt.join("")}var getStyleString=function(et){return Object.keys(et).reduce(function(nt,rt){return"".concat(nt).concat(camelToMiddleLine(rt),":").concat(autoCompleteStyle(rt,et[rt]),";")},"")},getStringSize=function(et){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(et==null||Global.isSsr)return{width:0,height:0};var rt="".concat(et),it=getStyleString(nt),ot="".concat(rt,"-").concat(it);if(stringCache.widthCache[ot])return stringCache.widthCache[ot];try{var at=document.getElementById(MEASUREMENT_SPAN_ID);at||(at=document.createElement("span"),at.setAttribute("id",MEASUREMENT_SPAN_ID),at.setAttribute("aria-hidden","true"),document.body.appendChild(at));var st=_objectSpread$q(_objectSpread$q({},SPAN_STYLE),nt);Object.keys(st).map(function(ut){return at.style[ut]=st[ut],ut}),at.textContent=rt;var lt=at.getBoundingClientRect(),ct={width:lt.width,height:lt.height};return stringCache.widthCache[ot]=ct,++stringCache.cacheCount>MAX_CACHE_NUM&&(stringCache.cacheCount=0,stringCache.widthCache={}),ct}catch{return{width:0,height:0}}},getOffset=function(et){var nt=et.ownerDocument.documentElement,rt={top:0,left:0};return typeof et.getBoundingClientRect<"u"&&(rt=et.getBoundingClientRect()),{top:rt.top+window.pageYOffset-nt.clientTop,left:rt.left+window.pageXOffset-nt.clientLeft}},calculateChartCoordinate=function(et,nt){return{chartX:Math.round(et.pageX-nt.left),chartY:Math.round(et.pageY-nt.top)}};function _typeof$r(tt){"@babel/helpers - typeof";return _typeof$r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$r(tt)}function _slicedToArray$8(tt,et){return _arrayWithHoles$8(tt)||_iterableToArrayLimit$8(tt,et)||_unsupportedIterableToArray$g(tt,et)||_nonIterableRest$8()}function _nonIterableRest$8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$g(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$g(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$g(tt,et)}}function _arrayLikeToArray$g(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}function _objectWithoutPropertiesLoose$c(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}function _slicedToArray$7(tt,et){return _arrayWithHoles$7(tt)||_iterableToArrayLimit$7(tt,et)||_unsupportedIterableToArray$f(tt,et)||_nonIterableRest$7()}function _nonIterableRest$7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$f(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$f(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$f(tt,et)}}function _arrayLikeToArray$f(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt0&&arguments[0]!==void 0?arguments[0]:[];return It.reduce(function(Ot,Wt){var zt=Wt.word,Ft=Wt.width,Nt=Ot[Ot.length-1];if(Nt&&(it==null||ot||Nt.width+Ft+rtWt.width?Ot:Wt})};if(!ut)return pt;for(var gt="…",yt=function(It){var Ot=ht.slice(0,It),Wt=calculateWordWidths({breakAll:ct,style:lt,children:Ot+gt}).wordsWithComputedWidth,zt=dt(Wt),Ft=zt.length>at||mt(zt).width>Number(it);return[Ft,zt]},bt=0,wt=ht.length-1,xt=0,kt;bt<=wt&&xt<=ht.length-1;){var St=Math.floor((bt+wt)/2),Tt=St-1,At=yt(Tt),Et=_slicedToArray$7(At,2),Ct=Et[0],Lt=Et[1],jt=yt(St),Rt=_slicedToArray$7(jt,1),$t=Rt[0];if(!Ct&&!$t&&(bt=St+1),Ct&&$t&&(wt=St-1),!Ct&&$t){kt=Lt;break}xt++}return kt||pt},getWordsWithoutCalculate=function(et){var nt=_isNil(et)?[]:et.toString().split(BREAKING_SPACES);return[{words:nt}]},getWordsByLines=function(et){var nt=et.width,rt=et.scaleToFit,it=et.children,ot=et.style,at=et.breakAll,st=et.maxLines;if((nt||rt)&&!Global.isSsr){var lt,ct,ut=calculateWordWidths({breakAll:at,children:it,style:ot});if(ut){var ht=ut.wordsWithComputedWidth,dt=ut.spaceWidth;lt=ht,ct=dt}else return getWordsWithoutCalculate(it);return calculateWordsByLines({breakAll:at,children:it,maxLines:st,style:ot},lt,ct,nt,rt)}return getWordsWithoutCalculate(it)},DEFAULT_FILL="#808080",Text=function(et){var nt=et.x,rt=nt===void 0?0:nt,it=et.y,ot=it===void 0?0:it,at=et.lineHeight,st=at===void 0?"1em":at,lt=et.capHeight,ct=lt===void 0?"0.71em":lt,ut=et.scaleToFit,ht=ut===void 0?!1:ut,dt=et.textAnchor,pt=dt===void 0?"start":dt,mt=et.verticalAnchor,gt=mt===void 0?"end":mt,yt=et.fill,bt=yt===void 0?DEFAULT_FILL:yt,wt=_objectWithoutProperties$c(et,_excluded$c),xt=reactExports.useMemo(function(){return getWordsByLines({breakAll:wt.breakAll,children:wt.children,maxLines:wt.maxLines,scaleToFit:ht,style:wt.style,width:wt.width})},[wt.breakAll,wt.children,wt.maxLines,ht,wt.style,wt.width]),kt=wt.dx,St=wt.dy,Tt=wt.angle,At=wt.className,Et=wt.breakAll,Ct=_objectWithoutProperties$c(wt,_excluded2$4);if(!isNumOrStr(rt)||!isNumOrStr(ot))return null;var Lt=rt+(isNumber(kt)?kt:0),jt=ot+(isNumber(St)?St:0),Rt;switch(gt){case"start":Rt=reduceCSSCalc("calc(".concat(ct,")"));break;case"middle":Rt=reduceCSSCalc("calc(".concat((xt.length-1)/2," * -").concat(st," + (").concat(ct," / 2))"));break;default:Rt=reduceCSSCalc("calc(".concat(xt.length-1," * -").concat(st,")"));break}var $t=[];if(ht){var vt=xt[0].width,It=wt.width;$t.push("scale(".concat((isNumber(It)?It/vt:1)/vt,")"))}return Tt&&$t.push("rotate(".concat(Tt,", ").concat(Lt,", ").concat(jt,")")),$t.length&&(Ct.transform=$t.join(" ")),React$1.createElement("text",_extends$m({},filterProps(Ct,!0),{x:Lt,y:jt,className:classNames("recharts-text",At),textAnchor:pt,fill:bt.includes("url")?DEFAULT_FILL:bt}),xt.map(function(Ot,Wt){return React$1.createElement("tspan",{x:Lt,dy:Wt===0?Rt:st,key:Wt},Ot.words.join(Et?"":" "))}))},baseIsEqual=_baseIsEqual;function isEqual$1(tt,et){return baseIsEqual(tt,et)}var isEqual_1=isEqual$1;const _isEqual=getDefaultExportFromCjs(isEqual_1);var isSymbol=isSymbol_1;function baseExtremum$2(tt,et,nt){for(var rt=-1,it=tt.length;++rtet}var _baseGt=baseGt$1,baseExtremum$1=_baseExtremum,baseGt=_baseGt,identity$7=identity_1;function max$1(tt){return tt&&tt.length?baseExtremum$1(tt,identity$7,baseGt):void 0}var max_1=max$1;const _max=getDefaultExportFromCjs(max_1);function baseLt$1(tt,et){return ttet?1:tt>=et?0:NaN}function descending(tt,et){return tt==null||et==null?NaN:ettt?1:et>=tt?0:NaN}function bisector(tt){let et,nt,rt;tt.length!==2?(et=ascending$1,nt=(st,lt)=>ascending$1(tt(st),lt),rt=(st,lt)=>tt(st)-lt):(et=tt===ascending$1||tt===descending?tt:zero$1,nt=tt,rt=tt);function it(st,lt,ct=0,ut=st.length){if(ct>>1;nt(st[ht],lt)<0?ct=ht+1:ut=ht}while(ct>>1;nt(st[ht],lt)<=0?ct=ht+1:ut=ht}while(ctct&&rt(st[ht-1],lt)>-rt(st[ht],lt)?ht-1:ht}return{left:it,center:at,right:ot}}function zero$1(){return 0}function number$3(tt){return tt===null?NaN:+tt}function*numbers(tt,et){if(et===void 0)for(let nt of tt)nt!=null&&(nt=+nt)>=nt&&(yield nt);else{let nt=-1;for(let rt of tt)(rt=et(rt,++nt,tt))!=null&&(rt=+rt)>=rt&&(yield rt)}}const ascendingBisect=bisector(ascending$1),bisectRight=ascendingBisect.right;bisector(number$3).center;const bisect=bisectRight;class InternMap extends Map{constructor(et,nt=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:nt}}),et!=null)for(const[rt,it]of et)this.set(rt,it)}get(et){return super.get(intern_get(this,et))}has(et){return super.has(intern_get(this,et))}set(et,nt){return super.set(intern_set(this,et),nt)}delete(et){return super.delete(intern_delete(this,et))}}function intern_get({_intern:tt,_key:et},nt){const rt=et(nt);return tt.has(rt)?tt.get(rt):nt}function intern_set({_intern:tt,_key:et},nt){const rt=et(nt);return tt.has(rt)?tt.get(rt):(tt.set(rt,nt),nt)}function intern_delete({_intern:tt,_key:et},nt){const rt=et(nt);return tt.has(rt)&&(nt=tt.get(rt),tt.delete(rt)),nt}function keyof(tt){return tt!==null&&typeof tt=="object"?tt.valueOf():tt}function compareDefined(tt=ascending$1){if(tt===ascending$1)return ascendingDefined;if(typeof tt!="function")throw new TypeError("compare is not a function");return(et,nt)=>{const rt=tt(et,nt);return rt||rt===0?rt:(tt(nt,nt)===0)-(tt(et,et)===0)}}function ascendingDefined(tt,et){return(tt==null||!(tt>=tt))-(et==null||!(et>=et))||(ttet?1:0)}const e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function tickSpec(tt,et,nt){const rt=(et-tt)/Math.max(0,nt),it=Math.floor(Math.log10(rt)),ot=rt/Math.pow(10,it),at=ot>=e10?10:ot>=e5?5:ot>=e2?2:1;let st,lt,ct;return it<0?(ct=Math.pow(10,-it)/at,st=Math.round(tt*ct),lt=Math.round(et*ct),st/ctet&&--lt,ct=-ct):(ct=Math.pow(10,it)*at,st=Math.round(tt/ct),lt=Math.round(et/ct),st*ctet&&--lt),lt0))return[];if(tt===et)return[tt];const rt=et=it))return[];const st=ot-it+1,lt=new Array(st);if(rt)if(at<0)for(let ct=0;ct=rt)&&(nt=rt);else{let rt=-1;for(let it of tt)(it=et(it,++rt,tt))!=null&&(nt=it)&&(nt=it)}return nt}function min(tt,et){let nt;if(et===void 0)for(const rt of tt)rt!=null&&(nt>rt||nt===void 0&&rt>=rt)&&(nt=rt);else{let rt=-1;for(let it of tt)(it=et(it,++rt,tt))!=null&&(nt>it||nt===void 0&&it>=it)&&(nt=it)}return nt}function quickselect(tt,et,nt=0,rt=1/0,it){if(et=Math.floor(et),nt=Math.floor(Math.max(0,nt)),rt=Math.floor(Math.min(tt.length-1,rt)),!(nt<=et&&et<=rt))return tt;for(it=it===void 0?ascendingDefined:compareDefined(it);rt>nt;){if(rt-nt>600){const lt=rt-nt+1,ct=et-nt+1,ut=Math.log(lt),ht=.5*Math.exp(2*ut/3),dt=.5*Math.sqrt(ut*ht*(lt-ht)/lt)*(ct-lt/2<0?-1:1),pt=Math.max(nt,Math.floor(et-ct*ht/lt+dt)),mt=Math.min(rt,Math.floor(et+(lt-ct)*ht/lt+dt));quickselect(tt,et,pt,mt,it)}const ot=tt[et];let at=nt,st=rt;for(swap(tt,nt,et),it(tt[rt],ot)>0&&swap(tt,nt,rt);at0;)--st}it(tt[nt],ot)===0?swap(tt,nt,st):(++st,swap(tt,st,rt)),st<=et&&(nt=st+1),et<=st&&(rt=st-1)}return tt}function swap(tt,et,nt){const rt=tt[et];tt[et]=tt[nt],tt[nt]=rt}function quantile$1(tt,et,nt){if(tt=Float64Array.from(numbers(tt,nt)),!(!(rt=tt.length)||isNaN(et=+et))){if(et<=0||rt<2)return min(tt);if(et>=1)return max(tt);var rt,it=(rt-1)*et,ot=Math.floor(it),at=max(quickselect(tt,ot).subarray(0,ot+1)),st=min(tt.subarray(ot+1));return at+(st-at)*(it-ot)}}function quantileSorted(tt,et,nt=number$3){if(!(!(rt=tt.length)||isNaN(et=+et))){if(et<=0||rt<2)return+nt(tt[0],0,tt);if(et>=1)return+nt(tt[rt-1],rt-1,tt);var rt,it=(rt-1)*et,ot=Math.floor(it),at=+nt(tt[ot],ot,tt),st=+nt(tt[ot+1],ot+1,tt);return at+(st-at)*(it-ot)}}function range$2(tt,et,nt){tt=+tt,et=+et,nt=(it=arguments.length)<2?(et=tt,tt=0,1):it<3?1:+nt;for(var rt=-1,it=Math.max(0,Math.ceil((et-tt)/nt))|0,ot=new Array(it);++rt>8&15|et>>4&240,et>>4&15|et&240,(et&15)<<4|et&15,1):nt===8?rgba(et>>24&255,et>>16&255,et>>8&255,(et&255)/255):nt===4?rgba(et>>12&15|et>>8&240,et>>8&15|et>>4&240,et>>4&15|et&240,((et&15)<<4|et&15)/255):null):(et=reRgbInteger.exec(tt))?new Rgb(et[1],et[2],et[3],1):(et=reRgbPercent.exec(tt))?new Rgb(et[1]*255/100,et[2]*255/100,et[3]*255/100,1):(et=reRgbaInteger.exec(tt))?rgba(et[1],et[2],et[3],et[4]):(et=reRgbaPercent.exec(tt))?rgba(et[1]*255/100,et[2]*255/100,et[3]*255/100,et[4]):(et=reHslPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,1):(et=reHslaPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,et[4]):named.hasOwnProperty(tt)?rgbn(named[tt]):tt==="transparent"?new Rgb(NaN,NaN,NaN,0):null}function rgbn(tt){return new Rgb(tt>>16&255,tt>>8&255,tt&255,1)}function rgba(tt,et,nt,rt){return rt<=0&&(tt=et=nt=NaN),new Rgb(tt,et,nt,rt)}function rgbConvert(tt){return tt instanceof Color||(tt=color(tt)),tt?(tt=tt.rgb(),new Rgb(tt.r,tt.g,tt.b,tt.opacity)):new Rgb}function rgb(tt,et,nt,rt){return arguments.length===1?rgbConvert(tt):new Rgb(tt,et,nt,rt??1)}function Rgb(tt,et,nt,rt){this.r=+tt,this.g=+et,this.b=+nt,this.opacity=+rt}define(Rgb,rgb,extend(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:rgb_formatHex8,formatRgb:rgb_formatRgb,toString:rgb_formatRgb}));function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatHex8(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity)?1:this.opacity)*255)}`}function rgb_formatRgb(){const tt=clampa(this.opacity);return`${tt===1?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${tt===1?")":`, ${tt})`}`}function clampa(tt){return isNaN(tt)?1:Math.max(0,Math.min(1,tt))}function clampi(tt){return Math.max(0,Math.min(255,Math.round(tt)||0))}function hex(tt){return tt=clampi(tt),(tt<16?"0":"")+tt.toString(16)}function hsla(tt,et,nt,rt){return rt<=0?tt=et=nt=NaN:nt<=0||nt>=1?tt=et=NaN:et<=0&&(tt=NaN),new Hsl(tt,et,nt,rt)}function hslConvert(tt){if(tt instanceof Hsl)return new Hsl(tt.h,tt.s,tt.l,tt.opacity);if(tt instanceof Color||(tt=color(tt)),!tt)return new Hsl;if(tt instanceof Hsl)return tt;tt=tt.rgb();var et=tt.r/255,nt=tt.g/255,rt=tt.b/255,it=Math.min(et,nt,rt),ot=Math.max(et,nt,rt),at=NaN,st=ot-it,lt=(ot+it)/2;return st?(et===ot?at=(nt-rt)/st+(nt0&<<1?0:at,new Hsl(at,st,lt,tt.opacity)}function hsl(tt,et,nt,rt){return arguments.length===1?hslConvert(tt):new Hsl(tt,et,nt,rt??1)}function Hsl(tt,et,nt,rt){this.h=+tt,this.s=+et,this.l=+nt,this.opacity=+rt}define(Hsl,hsl,extend(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},rgb(){var tt=this.h%360+(this.h<0)*360,et=isNaN(tt)||isNaN(this.s)?0:this.s,nt=this.l,rt=nt+(nt<.5?nt:1-nt)*et,it=2*nt-rt;return new Rgb(hsl2rgb(tt>=240?tt-240:tt+120,it,rt),hsl2rgb(tt,it,rt),hsl2rgb(tt<120?tt+240:tt-120,it,rt),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const tt=clampa(this.opacity);return`${tt===1?"hsl(":"hsla("}${clamph(this.h)}, ${clampt(this.s)*100}%, ${clampt(this.l)*100}%${tt===1?")":`, ${tt})`}`}}));function clamph(tt){return tt=(tt||0)%360,tt<0?tt+360:tt}function clampt(tt){return Math.max(0,Math.min(1,tt||0))}function hsl2rgb(tt,et,nt){return(tt<60?et+(nt-et)*tt/60:tt<180?nt:tt<240?et+(nt-et)*(240-tt)/60:et)*255}const constant$3=tt=>()=>tt;function linear$1(tt,et){return function(nt){return tt+nt*et}}function exponential(tt,et,nt){return tt=Math.pow(tt,nt),et=Math.pow(et,nt)-tt,nt=1/nt,function(rt){return Math.pow(tt+rt*et,nt)}}function gamma(tt){return(tt=+tt)==1?nogamma:function(et,nt){return nt-et?exponential(et,nt,tt):constant$3(isNaN(et)?nt:et)}}function nogamma(tt,et){var nt=et-tt;return nt?linear$1(tt,nt):constant$3(isNaN(tt)?et:tt)}const interpolateRgb=function tt(et){var nt=gamma(et);function rt(it,ot){var at=nt((it=rgb(it)).r,(ot=rgb(ot)).r),st=nt(it.g,ot.g),lt=nt(it.b,ot.b),ct=nogamma(it.opacity,ot.opacity);return function(ut){return it.r=at(ut),it.g=st(ut),it.b=lt(ut),it.opacity=ct(ut),it+""}}return rt.gamma=tt,rt}(1);function numberArray(tt,et){et||(et=[]);var nt=tt?Math.min(et.length,tt.length):0,rt=et.slice(),it;return function(ot){for(it=0;itnt&&(ot=et.slice(nt,ot),st[at]?st[at]+=ot:st[++at]=ot),(rt=rt[0])===(it=it[0])?st[at]?st[at]+=it:st[++at]=it:(st[++at]=null,lt.push({i:at,x:interpolateNumber$1(rt,it)})),nt=reB.lastIndex;return nt180?ut+=360:ut-ct>180&&(ct+=360),dt.push({i:ht.push(it(ht)+"rotate(",null,rt)-2,x:interpolateNumber$1(ct,ut)})):ut&&ht.push(it(ht)+"rotate("+ut+rt)}function st(ct,ut,ht,dt){ct!==ut?dt.push({i:ht.push(it(ht)+"skewX(",null,rt)-2,x:interpolateNumber$1(ct,ut)}):ut&&ht.push(it(ht)+"skewX("+ut+rt)}function lt(ct,ut,ht,dt,pt,mt){if(ct!==ht||ut!==dt){var gt=pt.push(it(pt)+"scale(",null,",",null,")");mt.push({i:gt-4,x:interpolateNumber$1(ct,ht)},{i:gt-2,x:interpolateNumber$1(ut,dt)})}else(ht!==1||dt!==1)&&pt.push(it(pt)+"scale("+ht+","+dt+")")}return function(ct,ut){var ht=[],dt=[];return ct=tt(ct),ut=tt(ut),ot(ct.translateX,ct.translateY,ut.translateX,ut.translateY,ht,dt),at(ct.rotate,ut.rotate,ht,dt),st(ct.skewX,ut.skewX,ht,dt),lt(ct.scaleX,ct.scaleY,ut.scaleX,ut.scaleY,ht,dt),ct=ut=null,function(pt){for(var mt=-1,gt=dt.length,yt;++mtet&&(nt=tt,tt=et,et=nt),function(rt){return Math.max(tt,Math.min(et,rt))}}function bimap(tt,et,nt){var rt=tt[0],it=tt[1],ot=et[0],at=et[1];return it2?polymap:bimap,lt=ct=null,ht}function ht(dt){return dt==null||isNaN(dt=+dt)?ot:(lt||(lt=st(tt.map(rt),et,nt)))(rt(at(dt)))}return ht.invert=function(dt){return at(it((ct||(ct=st(et,tt.map(rt),interpolateNumber$1)))(dt)))},ht.domain=function(dt){return arguments.length?(tt=Array.from(dt,number$2),ut()):tt.slice()},ht.range=function(dt){return arguments.length?(et=Array.from(dt),ut()):et.slice()},ht.rangeRound=function(dt){return et=Array.from(dt),nt=interpolateRound,ut()},ht.clamp=function(dt){return arguments.length?(at=dt?!0:identity$4,ut()):at!==identity$4},ht.interpolate=function(dt){return arguments.length?(nt=dt,ut()):nt},ht.unknown=function(dt){return arguments.length?(ot=dt,ht):ot},function(dt,pt){return rt=dt,it=pt,ut()}}function continuous(){return transformer$2()(identity$4,identity$4)}function formatDecimal(tt){return Math.abs(tt=Math.round(tt))>=1e21?tt.toLocaleString("en").replace(/,/g,""):tt.toString(10)}function formatDecimalParts(tt,et){if((nt=(tt=et?tt.toExponential(et-1):tt.toExponential()).indexOf("e"))<0)return null;var nt,rt=tt.slice(0,nt);return[rt.length>1?rt[0]+rt.slice(2):rt,+tt.slice(nt+1)]}function exponent(tt){return tt=formatDecimalParts(Math.abs(tt)),tt?tt[1]:NaN}function formatGroup(tt,et){return function(nt,rt){for(var it=nt.length,ot=[],at=0,st=tt[0],lt=0;it>0&&st>0&&(lt+st+1>rt&&(st=Math.max(1,rt-lt)),ot.push(nt.substring(it-=st,it+st)),!((lt+=st+1)>rt));)st=tt[at=(at+1)%tt.length];return ot.reverse().join(et)}}function formatNumerals(tt){return function(et){return et.replace(/[0-9]/g,function(nt){return tt[+nt]})}}var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(tt){if(!(et=re.exec(tt)))throw new Error("invalid format: "+tt);var et;return new FormatSpecifier({fill:et[1],align:et[2],sign:et[3],symbol:et[4],zero:et[5],width:et[6],comma:et[7],precision:et[8]&&et[8].slice(1),trim:et[9],type:et[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(tt){this.fill=tt.fill===void 0?" ":tt.fill+"",this.align=tt.align===void 0?">":tt.align+"",this.sign=tt.sign===void 0?"-":tt.sign+"",this.symbol=tt.symbol===void 0?"":tt.symbol+"",this.zero=!!tt.zero,this.width=tt.width===void 0?void 0:+tt.width,this.comma=!!tt.comma,this.precision=tt.precision===void 0?void 0:+tt.precision,this.trim=!!tt.trim,this.type=tt.type===void 0?"":tt.type+""}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function formatTrim(tt){e:for(var et=tt.length,nt=1,rt=-1,it;nt0&&(rt=0);break}return rt>0?tt.slice(0,rt)+tt.slice(it+1):tt}var prefixExponent;function formatPrefixAuto(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var rt=nt[0],it=nt[1],ot=it-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(it/3)))*3)+1,at=rt.length;return ot===at?rt:ot>at?rt+new Array(ot-at+1).join("0"):ot>0?rt.slice(0,ot)+"."+rt.slice(ot):"0."+new Array(1-ot).join("0")+formatDecimalParts(tt,Math.max(0,et+ot-1))[0]}function formatRounded(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var rt=nt[0],it=nt[1];return it<0?"0."+new Array(-it).join("0")+rt:rt.length>it+1?rt.slice(0,it+1)+"."+rt.slice(it+1):rt+new Array(it-rt.length+2).join("0")}const formatTypes={"%":(tt,et)=>(tt*100).toFixed(et),b:tt=>Math.round(tt).toString(2),c:tt=>tt+"",d:formatDecimal,e:(tt,et)=>tt.toExponential(et),f:(tt,et)=>tt.toFixed(et),g:(tt,et)=>tt.toPrecision(et),o:tt=>Math.round(tt).toString(8),p:(tt,et)=>formatRounded(tt*100,et),r:formatRounded,s:formatPrefixAuto,X:tt=>Math.round(tt).toString(16).toUpperCase(),x:tt=>Math.round(tt).toString(16)};function identity$3(tt){return tt}var map$1=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale$1(tt){var et=tt.grouping===void 0||tt.thousands===void 0?identity$3:formatGroup(map$1.call(tt.grouping,Number),tt.thousands+""),nt=tt.currency===void 0?"":tt.currency[0]+"",rt=tt.currency===void 0?"":tt.currency[1]+"",it=tt.decimal===void 0?".":tt.decimal+"",ot=tt.numerals===void 0?identity$3:formatNumerals(map$1.call(tt.numerals,String)),at=tt.percent===void 0?"%":tt.percent+"",st=tt.minus===void 0?"−":tt.minus+"",lt=tt.nan===void 0?"NaN":tt.nan+"";function ct(ht){ht=formatSpecifier(ht);var dt=ht.fill,pt=ht.align,mt=ht.sign,gt=ht.symbol,yt=ht.zero,bt=ht.width,wt=ht.comma,xt=ht.precision,kt=ht.trim,St=ht.type;St==="n"?(wt=!0,St="g"):formatTypes[St]||(xt===void 0&&(xt=12),kt=!0,St="g"),(yt||dt==="0"&&pt==="=")&&(yt=!0,dt="0",pt="=");var Tt=gt==="$"?nt:gt==="#"&&/[boxX]/.test(St)?"0"+St.toLowerCase():"",At=gt==="$"?rt:/[%p]/.test(St)?at:"",Et=formatTypes[St],Ct=/[defgprs%]/.test(St);xt=xt===void 0?6:/[gprs]/.test(St)?Math.max(1,Math.min(21,xt)):Math.max(0,Math.min(20,xt));function Lt(jt){var Rt=Tt,$t=At,vt,It,Ot;if(St==="c")$t=Et(jt)+$t,jt="";else{jt=+jt;var Wt=jt<0||1/jt<0;if(jt=isNaN(jt)?lt:Et(Math.abs(jt),xt),kt&&(jt=formatTrim(jt)),Wt&&+jt==0&&mt!=="+"&&(Wt=!1),Rt=(Wt?mt==="("?mt:st:mt==="-"||mt==="("?"":mt)+Rt,$t=(St==="s"?prefixes[8+prefixExponent/3]:"")+$t+(Wt&&mt==="("?")":""),Ct){for(vt=-1,It=jt.length;++vtOt||Ot>57){$t=(Ot===46?it+jt.slice(vt+1):jt.slice(vt))+$t,jt=jt.slice(0,vt);break}}}wt&&!yt&&(jt=et(jt,1/0));var zt=Rt.length+jt.length+$t.length,Ft=zt>1)+Rt+jt+$t+Ft.slice(zt);break;default:jt=Ft+Rt+jt+$t;break}return ot(jt)}return Lt.toString=function(){return ht+""},Lt}function ut(ht,dt){var pt=ct((ht=formatSpecifier(ht),ht.type="f",ht)),mt=Math.max(-8,Math.min(8,Math.floor(exponent(dt)/3)))*3,gt=Math.pow(10,-mt),yt=prefixes[8+mt/3];return function(bt){return pt(gt*bt)+yt}}return{format:ct,formatPrefix:ut}}var locale$1,format,formatPrefix;defaultLocale$1({thousands:",",grouping:[3],currency:["$",""]});function defaultLocale$1(tt){return locale$1=formatLocale$1(tt),format=locale$1.format,formatPrefix=locale$1.formatPrefix,locale$1}function precisionFixed(tt){return Math.max(0,-exponent(Math.abs(tt)))}function precisionPrefix(tt,et){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(et)/3)))*3-exponent(Math.abs(tt)))}function precisionRound(tt,et){return tt=Math.abs(tt),et=Math.abs(et)-tt,Math.max(0,exponent(et)-exponent(tt))+1}function tickFormat(tt,et,nt,rt){var it=tickStep(tt,et,nt),ot;switch(rt=formatSpecifier(rt??",f"),rt.type){case"s":{var at=Math.max(Math.abs(tt),Math.abs(et));return rt.precision==null&&!isNaN(ot=precisionPrefix(it,at))&&(rt.precision=ot),formatPrefix(rt,at)}case"":case"e":case"g":case"p":case"r":{rt.precision==null&&!isNaN(ot=precisionRound(it,Math.max(Math.abs(tt),Math.abs(et))))&&(rt.precision=ot-(rt.type==="e"));break}case"f":case"%":{rt.precision==null&&!isNaN(ot=precisionFixed(it))&&(rt.precision=ot-(rt.type==="%")*2);break}}return format(rt)}function linearish(tt){var et=tt.domain;return tt.ticks=function(nt){var rt=et();return ticks(rt[0],rt[rt.length-1],nt??10)},tt.tickFormat=function(nt,rt){var it=et();return tickFormat(it[0],it[it.length-1],nt??10,rt)},tt.nice=function(nt){nt==null&&(nt=10);var rt=et(),it=0,ot=rt.length-1,at=rt[it],st=rt[ot],lt,ct,ut=10;for(st0;){if(ct=tickIncrement(at,st,nt),ct===lt)return rt[it]=at,rt[ot]=st,et(rt);if(ct>0)at=Math.floor(at/ct)*ct,st=Math.ceil(st/ct)*ct;else if(ct<0)at=Math.ceil(at*ct)/ct,st=Math.floor(st*ct)/ct;else break;lt=ct}return tt},tt}function linear(){var tt=continuous();return tt.copy=function(){return copy$1(tt,linear())},initRange.apply(tt,arguments),linearish(tt)}function identity$2(tt){var et;function nt(rt){return rt==null||isNaN(rt=+rt)?et:rt}return nt.invert=nt,nt.domain=nt.range=function(rt){return arguments.length?(tt=Array.from(rt,number$2),nt):tt.slice()},nt.unknown=function(rt){return arguments.length?(et=rt,nt):et},nt.copy=function(){return identity$2(tt).unknown(et)},tt=arguments.length?Array.from(tt,number$2):[0,1],linearish(nt)}function nice(tt,et){tt=tt.slice();var nt=0,rt=tt.length-1,it=tt[nt],ot=tt[rt],at;return otMath.pow(tt,et)}function logp(tt){return tt===Math.E?Math.log:tt===10&&Math.log10||tt===2&&Math.log2||(tt=Math.log(tt),et=>Math.log(et)/tt)}function reflect(tt){return(et,nt)=>-tt(-et,nt)}function loggish(tt){const et=tt(transformLog,transformExp),nt=et.domain;let rt=10,it,ot;function at(){return it=logp(rt),ot=powp(rt),nt()[0]<0?(it=reflect(it),ot=reflect(ot),tt(transformLogn,transformExpn)):tt(transformLog,transformExp),et}return et.base=function(st){return arguments.length?(rt=+st,at()):rt},et.domain=function(st){return arguments.length?(nt(st),at()):nt()},et.ticks=st=>{const lt=nt();let ct=lt[0],ut=lt[lt.length-1];const ht=ut0){for(;dt<=pt;++dt)for(mt=1;mtut)break;bt.push(gt)}}else for(;dt<=pt;++dt)for(mt=rt-1;mt>=1;--mt)if(gt=dt>0?mt/ot(-dt):mt*ot(dt),!(gtut)break;bt.push(gt)}bt.length*2{if(st==null&&(st=10),lt==null&&(lt=rt===10?"s":","),typeof lt!="function"&&(!(rt%1)&&(lt=formatSpecifier(lt)).precision==null&&(lt.trim=!0),lt=format(lt)),st===1/0)return lt;const ct=Math.max(1,rt*st/et.ticks().length);return ut=>{let ht=ut/ot(Math.round(it(ut)));return ht*rtnt(nice(nt(),{floor:st=>ot(Math.floor(it(st))),ceil:st=>ot(Math.ceil(it(st)))})),et}function log(){const tt=loggish(transformer$2()).domain([1,10]);return tt.copy=()=>copy$1(tt,log()).base(tt.base()),initRange.apply(tt,arguments),tt}function transformSymlog(tt){return function(et){return Math.sign(et)*Math.log1p(Math.abs(et/tt))}}function transformSymexp(tt){return function(et){return Math.sign(et)*Math.expm1(Math.abs(et))*tt}}function symlogish(tt){var et=1,nt=tt(transformSymlog(et),transformSymexp(et));return nt.constant=function(rt){return arguments.length?tt(transformSymlog(et=+rt),transformSymexp(et)):et},linearish(nt)}function symlog(){var tt=symlogish(transformer$2());return tt.copy=function(){return copy$1(tt,symlog()).constant(tt.constant())},initRange.apply(tt,arguments)}function transformPow(tt){return function(et){return et<0?-Math.pow(-et,tt):Math.pow(et,tt)}}function transformSqrt(tt){return tt<0?-Math.sqrt(-tt):Math.sqrt(tt)}function transformSquare(tt){return tt<0?-tt*tt:tt*tt}function powish(tt){var et=tt(identity$4,identity$4),nt=1;function rt(){return nt===1?tt(identity$4,identity$4):nt===.5?tt(transformSqrt,transformSquare):tt(transformPow(nt),transformPow(1/nt))}return et.exponent=function(it){return arguments.length?(nt=+it,rt()):nt},linearish(et)}function pow(){var tt=powish(transformer$2());return tt.copy=function(){return copy$1(tt,pow()).exponent(tt.exponent())},initRange.apply(tt,arguments),tt}function sqrt(){return pow.apply(null,arguments).exponent(.5)}function square(tt){return Math.sign(tt)*tt*tt}function unsquare(tt){return Math.sign(tt)*Math.sqrt(Math.abs(tt))}function radial(){var tt=continuous(),et=[0,1],nt=!1,rt;function it(ot){var at=unsquare(tt(ot));return isNaN(at)?rt:nt?Math.round(at):at}return it.invert=function(ot){return tt.invert(square(ot))},it.domain=function(ot){return arguments.length?(tt.domain(ot),it):tt.domain()},it.range=function(ot){return arguments.length?(tt.range((et=Array.from(ot,number$2)).map(square)),it):et.slice()},it.rangeRound=function(ot){return it.range(ot).round(!0)},it.round=function(ot){return arguments.length?(nt=!!ot,it):nt},it.clamp=function(ot){return arguments.length?(tt.clamp(ot),it):tt.clamp()},it.unknown=function(ot){return arguments.length?(rt=ot,it):rt},it.copy=function(){return radial(tt.domain(),et).round(nt).clamp(tt.clamp()).unknown(rt)},initRange.apply(it,arguments),linearish(it)}function quantile(){var tt=[],et=[],nt=[],rt;function it(){var at=0,st=Math.max(1,et.length);for(nt=new Array(st-1);++at0?nt[st-1]:tt[0],st=nt?[rt[nt-1],et]:[rt[ct-1],rt[ct]]},at.unknown=function(lt){return arguments.length&&(ot=lt),at},at.thresholds=function(){return rt.slice()},at.copy=function(){return quantize().domain([tt,et]).range(it).unknown(ot)},initRange.apply(linearish(at),arguments)}function threshold(){var tt=[.5],et=[0,1],nt,rt=1;function it(ot){return ot!=null&&ot<=ot?et[bisect(tt,ot,0,rt)]:nt}return it.domain=function(ot){return arguments.length?(tt=Array.from(ot),rt=Math.min(tt.length,et.length-1),it):tt.slice()},it.range=function(ot){return arguments.length?(et=Array.from(ot),rt=Math.min(tt.length,et.length-1),it):et.slice()},it.invertExtent=function(ot){var at=et.indexOf(ot);return[tt[at-1],tt[at]]},it.unknown=function(ot){return arguments.length?(nt=ot,it):nt},it.copy=function(){return threshold().domain(tt).range(et).unknown(nt)},initRange.apply(it,arguments)}const t0=new Date,t1=new Date;function timeInterval(tt,et,nt,rt){function it(ot){return tt(ot=arguments.length===0?new Date:new Date(+ot)),ot}return it.floor=ot=>(tt(ot=new Date(+ot)),ot),it.ceil=ot=>(tt(ot=new Date(ot-1)),et(ot,1),tt(ot),ot),it.round=ot=>{const at=it(ot),st=it.ceil(ot);return ot-at(et(ot=new Date(+ot),at==null?1:Math.floor(at)),ot),it.range=(ot,at,st)=>{const lt=[];if(ot=it.ceil(ot),st=st==null?1:Math.floor(st),!(ot0))return lt;let ct;do lt.push(ct=new Date(+ot)),et(ot,st),tt(ot);while(cttimeInterval(at=>{if(at>=at)for(;tt(at),!ot(at);)at.setTime(at-1)},(at,st)=>{if(at>=at)if(st<0)for(;++st<=0;)for(;et(at,-1),!ot(at););else for(;--st>=0;)for(;et(at,1),!ot(at););}),nt&&(it.count=(ot,at)=>(t0.setTime(+ot),t1.setTime(+at),tt(t0),tt(t1),Math.floor(nt(t0,t1))),it.every=ot=>(ot=Math.floor(ot),!isFinite(ot)||!(ot>0)?null:ot>1?it.filter(rt?at=>rt(at)%ot===0:at=>it.count(0,at)%ot===0):it)),it}const millisecond=timeInterval(()=>{},(tt,et)=>{tt.setTime(+tt+et)},(tt,et)=>et-tt);millisecond.every=tt=>(tt=Math.floor(tt),!isFinite(tt)||!(tt>0)?null:tt>1?timeInterval(et=>{et.setTime(Math.floor(et/tt)*tt)},(et,nt)=>{et.setTime(+et+nt*tt)},(et,nt)=>(nt-et)/tt):millisecond);millisecond.range;const durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,second=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds())},(tt,et)=>{tt.setTime(+tt+et*durationSecond)},(tt,et)=>(et-tt)/durationSecond,tt=>tt.getUTCSeconds());second.range;const timeMinute=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getMinutes());timeMinute.range;const utcMinute=timeInterval(tt=>{tt.setUTCSeconds(0,0)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getUTCMinutes());utcMinute.range;const timeHour=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond-tt.getMinutes()*durationMinute)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getHours());timeHour.range;const utcHour=timeInterval(tt=>{tt.setUTCMinutes(0,0,0)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getUTCHours());utcHour.range;const timeDay=timeInterval(tt=>tt.setHours(0,0,0,0),(tt,et)=>tt.setDate(tt.getDate()+et),(tt,et)=>(et-tt-(et.getTimezoneOffset()-tt.getTimezoneOffset())*durationMinute)/durationDay,tt=>tt.getDate()-1);timeDay.range;const utcDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>tt.getUTCDate()-1);utcDay.range;const unixDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>Math.floor(tt/durationDay));unixDay.range;function timeWeekday(tt){return timeInterval(et=>{et.setDate(et.getDate()-(et.getDay()+7-tt)%7),et.setHours(0,0,0,0)},(et,nt)=>{et.setDate(et.getDate()+nt*7)},(et,nt)=>(nt-et-(nt.getTimezoneOffset()-et.getTimezoneOffset())*durationMinute)/durationWeek)}const timeSunday=timeWeekday(0),timeMonday=timeWeekday(1),timeTuesday=timeWeekday(2),timeWednesday=timeWeekday(3),timeThursday=timeWeekday(4),timeFriday=timeWeekday(5),timeSaturday=timeWeekday(6);timeSunday.range;timeMonday.range;timeTuesday.range;timeWednesday.range;timeThursday.range;timeFriday.range;timeSaturday.range;function utcWeekday(tt){return timeInterval(et=>{et.setUTCDate(et.getUTCDate()-(et.getUTCDay()+7-tt)%7),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCDate(et.getUTCDate()+nt*7)},(et,nt)=>(nt-et)/durationWeek)}const utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6);utcSunday.range;utcMonday.range;utcTuesday.range;utcWednesday.range;utcThursday.range;utcFriday.range;utcSaturday.range;const timeMonth=timeInterval(tt=>{tt.setDate(1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setMonth(tt.getMonth()+et)},(tt,et)=>et.getMonth()-tt.getMonth()+(et.getFullYear()-tt.getFullYear())*12,tt=>tt.getMonth());timeMonth.range;const utcMonth=timeInterval(tt=>{tt.setUTCDate(1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCMonth(tt.getUTCMonth()+et)},(tt,et)=>et.getUTCMonth()-tt.getUTCMonth()+(et.getUTCFullYear()-tt.getUTCFullYear())*12,tt=>tt.getUTCMonth());utcMonth.range;const timeYear=timeInterval(tt=>{tt.setMonth(0,1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setFullYear(tt.getFullYear()+et)},(tt,et)=>et.getFullYear()-tt.getFullYear(),tt=>tt.getFullYear());timeYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setFullYear(Math.floor(et.getFullYear()/tt)*tt),et.setMonth(0,1),et.setHours(0,0,0,0)},(et,nt)=>{et.setFullYear(et.getFullYear()+nt*tt)});timeYear.range;const utcYear=timeInterval(tt=>{tt.setUTCMonth(0,1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCFullYear(tt.getUTCFullYear()+et)},(tt,et)=>et.getUTCFullYear()-tt.getUTCFullYear(),tt=>tt.getUTCFullYear());utcYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setUTCFullYear(Math.floor(et.getUTCFullYear()/tt)*tt),et.setUTCMonth(0,1),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCFullYear(et.getUTCFullYear()+nt*tt)});utcYear.range;function ticker(tt,et,nt,rt,it,ot){const at=[[second,1,durationSecond],[second,5,5*durationSecond],[second,15,15*durationSecond],[second,30,30*durationSecond],[ot,1,durationMinute],[ot,5,5*durationMinute],[ot,15,15*durationMinute],[ot,30,30*durationMinute],[it,1,durationHour],[it,3,3*durationHour],[it,6,6*durationHour],[it,12,12*durationHour],[rt,1,durationDay],[rt,2,2*durationDay],[nt,1,durationWeek],[et,1,durationMonth],[et,3,3*durationMonth],[tt,1,durationYear]];function st(ct,ut,ht){const dt=utyt).right(at,dt);if(pt===at.length)return tt.every(tickStep(ct/durationYear,ut/durationYear,ht));if(pt===0)return millisecond.every(Math.max(tickStep(ct,ut,ht),1));const[mt,gt]=at[dt/at[pt-1][2]53)return null;"w"in Jt||(Jt.w=1),"Z"in Jt?(Cn=utcDate(newDate(Jt.y,0,1)),$n=Cn.getUTCDay(),Cn=$n>4||$n===0?utcMonday.ceil(Cn):utcMonday(Cn),Cn=utcDay.offset(Cn,(Jt.V-1)*7),Jt.y=Cn.getUTCFullYear(),Jt.m=Cn.getUTCMonth(),Jt.d=Cn.getUTCDate()+(Jt.w+6)%7):(Cn=localDate(newDate(Jt.y,0,1)),$n=Cn.getDay(),Cn=$n>4||$n===0?timeMonday.ceil(Cn):timeMonday(Cn),Cn=timeDay.offset(Cn,(Jt.V-1)*7),Jt.y=Cn.getFullYear(),Jt.m=Cn.getMonth(),Jt.d=Cn.getDate()+(Jt.w+6)%7)}else("W"in Jt||"U"in Jt)&&("w"in Jt||(Jt.w="u"in Jt?Jt.u%7:"W"in Jt?1:0),$n="Z"in Jt?utcDate(newDate(Jt.y,0,1)).getUTCDay():localDate(newDate(Jt.y,0,1)).getDay(),Jt.m=0,Jt.d="W"in Jt?(Jt.w+6)%7+Jt.W*7-($n+5)%7:Jt.w+Jt.U*7-($n+6)%7);return"Z"in Jt?(Jt.H+=Jt.Z/100|0,Jt.M+=Jt.Z%100,utcDate(Jt)):localDate(Jt)}}function Et(dn,wn,rn,Jt){for(var vn=0,Cn=wn.length,$n=rn.length,Nn,En;vn=$n)return-1;if(Nn=wn.charCodeAt(vn++),Nn===37){if(Nn=wn.charAt(vn++),En=St[Nn in pads?wn.charAt(vn++):Nn],!En||(Jt=En(dn,rn,Jt))<0)return-1}else if(Nn!=rn.charCodeAt(Jt++))return-1}return Jt}function Ct(dn,wn,rn){var Jt=ct.exec(wn.slice(rn));return Jt?(dn.p=ut.get(Jt[0].toLowerCase()),rn+Jt[0].length):-1}function Lt(dn,wn,rn){var Jt=pt.exec(wn.slice(rn));return Jt?(dn.w=mt.get(Jt[0].toLowerCase()),rn+Jt[0].length):-1}function jt(dn,wn,rn){var Jt=ht.exec(wn.slice(rn));return Jt?(dn.w=dt.get(Jt[0].toLowerCase()),rn+Jt[0].length):-1}function Rt(dn,wn,rn){var Jt=bt.exec(wn.slice(rn));return Jt?(dn.m=wt.get(Jt[0].toLowerCase()),rn+Jt[0].length):-1}function $t(dn,wn,rn){var Jt=gt.exec(wn.slice(rn));return Jt?(dn.m=yt.get(Jt[0].toLowerCase()),rn+Jt[0].length):-1}function vt(dn,wn,rn){return Et(dn,et,wn,rn)}function It(dn,wn,rn){return Et(dn,nt,wn,rn)}function Ot(dn,wn,rn){return Et(dn,rt,wn,rn)}function Wt(dn){return at[dn.getDay()]}function zt(dn){return ot[dn.getDay()]}function Ft(dn){return lt[dn.getMonth()]}function Nt(dn){return st[dn.getMonth()]}function Ut(dn){return it[+(dn.getHours()>=12)]}function Pt(dn){return 1+~~(dn.getMonth()/3)}function Ht(dn){return at[dn.getUTCDay()]}function Qt(dn){return ot[dn.getUTCDay()]}function an(dn){return lt[dn.getUTCMonth()]}function Yt(dn){return st[dn.getUTCMonth()]}function nn(dn){return it[+(dn.getUTCHours()>=12)]}function tn(dn){return 1+~~(dn.getUTCMonth()/3)}return{format:function(dn){var wn=Tt(dn+="",xt);return wn.toString=function(){return dn},wn},parse:function(dn){var wn=At(dn+="",!1);return wn.toString=function(){return dn},wn},utcFormat:function(dn){var wn=Tt(dn+="",kt);return wn.toString=function(){return dn},wn},utcParse:function(dn){var wn=At(dn+="",!0);return wn.toString=function(){return dn},wn}}}var pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function pad(tt,et,nt){var rt=tt<0?"-":"",it=(rt?-tt:tt)+"",ot=it.length;return rt+(ot[et.toLowerCase(),nt]))}function parseWeekdayNumberSunday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+1));return rt?(tt.w=+rt[0],nt+rt[0].length):-1}function parseWeekdayNumberMonday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+1));return rt?(tt.u=+rt[0],nt+rt[0].length):-1}function parseWeekNumberSunday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.U=+rt[0],nt+rt[0].length):-1}function parseWeekNumberISO(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.V=+rt[0],nt+rt[0].length):-1}function parseWeekNumberMonday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.W=+rt[0],nt+rt[0].length):-1}function parseFullYear(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+4));return rt?(tt.y=+rt[0],nt+rt[0].length):-1}function parseYear(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.y=+rt[0]+(+rt[0]>68?1900:2e3),nt+rt[0].length):-1}function parseZone(tt,et,nt){var rt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(et.slice(nt,nt+6));return rt?(tt.Z=rt[1]?0:-(rt[2]+(rt[3]||"00")),nt+rt[0].length):-1}function parseQuarter(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+1));return rt?(tt.q=rt[0]*3-3,nt+rt[0].length):-1}function parseMonthNumber(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.m=rt[0]-1,nt+rt[0].length):-1}function parseDayOfMonth(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.d=+rt[0],nt+rt[0].length):-1}function parseDayOfYear(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+3));return rt?(tt.m=0,tt.d=+rt[0],nt+rt[0].length):-1}function parseHour24(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.H=+rt[0],nt+rt[0].length):-1}function parseMinutes(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.M=+rt[0],nt+rt[0].length):-1}function parseSeconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.S=+rt[0],nt+rt[0].length):-1}function parseMilliseconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+3));return rt?(tt.L=+rt[0],nt+rt[0].length):-1}function parseMicroseconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+6));return rt?(tt.L=Math.floor(rt[0]/1e3),nt+rt[0].length):-1}function parseLiteralPercent(tt,et,nt){var rt=percentRe.exec(et.slice(nt,nt+1));return rt?nt+rt[0].length:-1}function parseUnixTimestamp(tt,et,nt){var rt=numberRe.exec(et.slice(nt));return rt?(tt.Q=+rt[0],nt+rt[0].length):-1}function parseUnixTimestampSeconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt));return rt?(tt.s=+rt[0],nt+rt[0].length):-1}function formatDayOfMonth(tt,et){return pad(tt.getDate(),et,2)}function formatHour24(tt,et){return pad(tt.getHours(),et,2)}function formatHour12(tt,et){return pad(tt.getHours()%12||12,et,2)}function formatDayOfYear(tt,et){return pad(1+timeDay.count(timeYear(tt),tt),et,3)}function formatMilliseconds(tt,et){return pad(tt.getMilliseconds(),et,3)}function formatMicroseconds(tt,et){return formatMilliseconds(tt,et)+"000"}function formatMonthNumber(tt,et){return pad(tt.getMonth()+1,et,2)}function formatMinutes(tt,et){return pad(tt.getMinutes(),et,2)}function formatSeconds(tt,et){return pad(tt.getSeconds(),et,2)}function formatWeekdayNumberMonday(tt){var et=tt.getDay();return et===0?7:et}function formatWeekNumberSunday(tt,et){return pad(timeSunday.count(timeYear(tt)-1,tt),et,2)}function dISO(tt){var et=tt.getDay();return et>=4||et===0?timeThursday(tt):timeThursday.ceil(tt)}function formatWeekNumberISO(tt,et){return tt=dISO(tt),pad(timeThursday.count(timeYear(tt),tt)+(timeYear(tt).getDay()===4),et,2)}function formatWeekdayNumberSunday(tt){return tt.getDay()}function formatWeekNumberMonday(tt,et){return pad(timeMonday.count(timeYear(tt)-1,tt),et,2)}function formatYear(tt,et){return pad(tt.getFullYear()%100,et,2)}function formatYearISO(tt,et){return tt=dISO(tt),pad(tt.getFullYear()%100,et,2)}function formatFullYear(tt,et){return pad(tt.getFullYear()%1e4,et,4)}function formatFullYearISO(tt,et){var nt=tt.getDay();return tt=nt>=4||nt===0?timeThursday(tt):timeThursday.ceil(tt),pad(tt.getFullYear()%1e4,et,4)}function formatZone(tt){var et=tt.getTimezoneOffset();return(et>0?"-":(et*=-1,"+"))+pad(et/60|0,"0",2)+pad(et%60,"0",2)}function formatUTCDayOfMonth(tt,et){return pad(tt.getUTCDate(),et,2)}function formatUTCHour24(tt,et){return pad(tt.getUTCHours(),et,2)}function formatUTCHour12(tt,et){return pad(tt.getUTCHours()%12||12,et,2)}function formatUTCDayOfYear(tt,et){return pad(1+utcDay.count(utcYear(tt),tt),et,3)}function formatUTCMilliseconds(tt,et){return pad(tt.getUTCMilliseconds(),et,3)}function formatUTCMicroseconds(tt,et){return formatUTCMilliseconds(tt,et)+"000"}function formatUTCMonthNumber(tt,et){return pad(tt.getUTCMonth()+1,et,2)}function formatUTCMinutes(tt,et){return pad(tt.getUTCMinutes(),et,2)}function formatUTCSeconds(tt,et){return pad(tt.getUTCSeconds(),et,2)}function formatUTCWeekdayNumberMonday(tt){var et=tt.getUTCDay();return et===0?7:et}function formatUTCWeekNumberSunday(tt,et){return pad(utcSunday.count(utcYear(tt)-1,tt),et,2)}function UTCdISO(tt){var et=tt.getUTCDay();return et>=4||et===0?utcThursday(tt):utcThursday.ceil(tt)}function formatUTCWeekNumberISO(tt,et){return tt=UTCdISO(tt),pad(utcThursday.count(utcYear(tt),tt)+(utcYear(tt).getUTCDay()===4),et,2)}function formatUTCWeekdayNumberSunday(tt){return tt.getUTCDay()}function formatUTCWeekNumberMonday(tt,et){return pad(utcMonday.count(utcYear(tt)-1,tt),et,2)}function formatUTCYear(tt,et){return pad(tt.getUTCFullYear()%100,et,2)}function formatUTCYearISO(tt,et){return tt=UTCdISO(tt),pad(tt.getUTCFullYear()%100,et,2)}function formatUTCFullYear(tt,et){return pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCFullYearISO(tt,et){var nt=tt.getUTCDay();return tt=nt>=4||nt===0?utcThursday(tt):utcThursday.ceil(tt),pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(tt){return+tt}function formatUnixTimestampSeconds(tt){return Math.floor(+tt/1e3)}var locale,timeFormat,utcFormat;defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function defaultLocale(tt){return locale=formatLocale(tt),timeFormat=locale.format,locale.parse,utcFormat=locale.utcFormat,locale.utcParse,locale}function date(tt){return new Date(tt)}function number$1(tt){return tt instanceof Date?+tt:+new Date(+tt)}function calendar(tt,et,nt,rt,it,ot,at,st,lt,ct){var ut=continuous(),ht=ut.invert,dt=ut.domain,pt=ct(".%L"),mt=ct(":%S"),gt=ct("%I:%M"),yt=ct("%I %p"),bt=ct("%a %d"),wt=ct("%b %d"),xt=ct("%B"),kt=ct("%Y");function St(Tt){return(lt(Tt)et(it/(tt.length-1)))},nt.quantiles=function(rt){return Array.from({length:rt+1},(it,ot)=>quantile$1(tt,ot/rt))},nt.copy=function(){return sequentialQuantile(et).domain(tt)},initInterpolator.apply(nt,arguments)}function transformer(){var tt=0,et=.5,nt=1,rt=1,it,ot,at,st,lt,ct=identity$4,ut,ht=!1,dt;function pt(gt){return isNaN(gt=+gt)?dt:(gt=.5+((gt=+ut(gt))-ot)*(rt*gttt.e^ot.s<0?1:-1;for(rt=ot.d.length,it=tt.d.length,et=0,nt=rttt.d[et]^ot.s<0?1:-1;return rt===it?0:rt>it^ot.s<0?1:-1};P.decimalPlaces=P.dp=function(){var tt=this,et=tt.d.length-1,nt=(et-tt.e)*LOG_BASE;if(et=tt.d[et],et)for(;et%10==0;et/=10)nt--;return nt<0?0:nt};P.dividedBy=P.div=function(tt){return divide(this,new this.constructor(tt))};P.dividedToIntegerBy=P.idiv=function(tt){var et=this,nt=et.constructor;return round(divide(et,new nt(tt),0,1),nt.precision)};P.equals=P.eq=function(tt){return!this.cmp(tt)};P.exponent=function(){return getBase10Exponent(this)};P.greaterThan=P.gt=function(tt){return this.cmp(tt)>0};P.greaterThanOrEqualTo=P.gte=function(tt){return this.cmp(tt)>=0};P.isInteger=P.isint=function(){return this.e>this.d.length-2};P.isNegative=P.isneg=function(){return this.s<0};P.isPositive=P.ispos=function(){return this.s>0};P.isZero=function(){return this.s===0};P.lessThan=P.lt=function(tt){return this.cmp(tt)<0};P.lessThanOrEqualTo=P.lte=function(tt){return this.cmp(tt)<1};P.logarithm=P.log=function(tt){var et,nt=this,rt=nt.constructor,it=rt.precision,ot=it+5;if(tt===void 0)tt=new rt(10);else if(tt=new rt(tt),tt.s<1||tt.eq(ONE))throw Error(decimalError+"NaN");if(nt.s<1)throw Error(decimalError+(nt.s?"NaN":"-Infinity"));return nt.eq(ONE)?new rt(0):(external=!1,et=divide(ln(nt,ot),ln(tt,ot),ot),external=!0,round(et,it))};P.minus=P.sub=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?subtract(et,tt):add(et,(tt.s=-tt.s,tt))};P.modulo=P.mod=function(tt){var et,nt=this,rt=nt.constructor,it=rt.precision;if(tt=new rt(tt),!tt.s)throw Error(decimalError+"NaN");return nt.s?(external=!1,et=divide(nt,tt,0,1).times(tt),external=!0,nt.minus(et)):round(new rt(nt),it)};P.naturalExponential=P.exp=function(){return exp(this)};P.naturalLogarithm=P.ln=function(){return ln(this)};P.negated=P.neg=function(){var tt=new this.constructor(this);return tt.s=-tt.s||0,tt};P.plus=P.add=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?add(et,tt):subtract(et,(tt.s=-tt.s,tt))};P.precision=P.sd=function(tt){var et,nt,rt,it=this;if(tt!==void 0&&tt!==!!tt&&tt!==1&&tt!==0)throw Error(invalidArgument+tt);if(et=getBase10Exponent(it)+1,rt=it.d.length-1,nt=rt*LOG_BASE+1,rt=it.d[rt],rt){for(;rt%10==0;rt/=10)nt--;for(rt=it.d[0];rt>=10;rt/=10)nt++}return tt&&et>nt?et:nt};P.squareRoot=P.sqrt=function(){var tt,et,nt,rt,it,ot,at,st=this,lt=st.constructor;if(st.s<1){if(!st.s)return new lt(0);throw Error(decimalError+"NaN")}for(tt=getBase10Exponent(st),external=!1,it=Math.sqrt(+st),it==0||it==1/0?(et=digitsToString(st.d),(et.length+tt)%2==0&&(et+="0"),it=Math.sqrt(et),tt=mathfloor((tt+1)/2)-(tt<0||tt%2),it==1/0?et="5e"+tt:(et=it.toExponential(),et=et.slice(0,et.indexOf("e")+1)+tt),rt=new lt(et)):rt=new lt(it.toString()),nt=lt.precision,it=at=nt+3;;)if(ot=rt,rt=ot.plus(divide(st,ot,at+2)).times(.5),digitsToString(ot.d).slice(0,at)===(et=digitsToString(rt.d)).slice(0,at)){if(et=et.slice(at-3,at+1),it==at&&et=="4999"){if(round(ot,nt+1,0),ot.times(ot).eq(st)){rt=ot;break}}else if(et!="9999")break;at+=4}return external=!0,round(rt,nt)};P.times=P.mul=function(tt){var et,nt,rt,it,ot,at,st,lt,ct,ut=this,ht=ut.constructor,dt=ut.d,pt=(tt=new ht(tt)).d;if(!ut.s||!tt.s)return new ht(0);for(tt.s*=ut.s,nt=ut.e+tt.e,lt=dt.length,ct=pt.length,lt=0;){for(et=0,it=lt+rt;it>rt;)st=ot[it]+pt[rt]*dt[it-rt-1]+et,ot[it--]=st%BASE|0,et=st/BASE|0;ot[it]=(ot[it]+et)%BASE|0}for(;!ot[--at];)ot.pop();return et?++nt:ot.shift(),tt.d=ot,tt.e=nt,external?round(tt,ht.precision):tt};P.toDecimalPlaces=P.todp=function(tt,et){var nt=this,rt=nt.constructor;return nt=new rt(nt),tt===void 0?nt:(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=rt.rounding:checkInt32(et,0,8),round(nt,tt+getBase10Exponent(nt)+1,et))};P.toExponential=function(tt,et){var nt,rt=this,it=rt.constructor;return tt===void 0?nt=toString(rt,!0):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=it.rounding:checkInt32(et,0,8),rt=round(new it(rt),tt+1,et),nt=toString(rt,!0,tt+1)),nt};P.toFixed=function(tt,et){var nt,rt,it=this,ot=it.constructor;return tt===void 0?toString(it):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),rt=round(new ot(it),tt+getBase10Exponent(it)+1,et),nt=toString(rt.abs(),!1,tt+getBase10Exponent(rt)+1),it.isneg()&&!it.isZero()?"-"+nt:nt)};P.toInteger=P.toint=function(){var tt=this,et=tt.constructor;return round(new et(tt),getBase10Exponent(tt)+1,et.rounding)};P.toNumber=function(){return+this};P.toPower=P.pow=function(tt){var et,nt,rt,it,ot,at,st=this,lt=st.constructor,ct=12,ut=+(tt=new lt(tt));if(!tt.s)return new lt(ONE);if(st=new lt(st),!st.s){if(tt.s<1)throw Error(decimalError+"Infinity");return st}if(st.eq(ONE))return st;if(rt=lt.precision,tt.eq(ONE))return round(st,rt);if(et=tt.e,nt=tt.d.length-1,at=et>=nt,ot=st.s,at){if((nt=ut<0?-ut:ut)<=MAX_SAFE_INTEGER){for(it=new lt(ONE),et=Math.ceil(rt/LOG_BASE+4),external=!1;nt%2&&(it=it.times(st),truncate(it.d,et)),nt=mathfloor(nt/2),nt!==0;)st=st.times(st),truncate(st.d,et);return external=!0,tt.s<0?new lt(ONE).div(it):round(it,rt)}}else if(ot<0)throw Error(decimalError+"NaN");return ot=ot<0&&tt.d[Math.max(et,nt)]&1?-1:1,st.s=1,external=!1,it=tt.times(ln(st,rt+ct)),external=!0,it=exp(it),it.s=ot,it};P.toPrecision=function(tt,et){var nt,rt,it=this,ot=it.constructor;return tt===void 0?(nt=getBase10Exponent(it),rt=toString(it,nt<=ot.toExpNeg||nt>=ot.toExpPos)):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),it=round(new ot(it),tt,et),nt=getBase10Exponent(it),rt=toString(it,tt<=nt||nt<=ot.toExpNeg,tt)),rt};P.toSignificantDigits=P.tosd=function(tt,et){var nt=this,rt=nt.constructor;return tt===void 0?(tt=rt.precision,et=rt.rounding):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=rt.rounding:checkInt32(et,0,8)),round(new rt(nt),tt,et)};P.toString=P.valueOf=P.val=P.toJSON=P[Symbol.for("nodejs.util.inspect.custom")]=function(){var tt=this,et=getBase10Exponent(tt),nt=tt.constructor;return toString(tt,et<=nt.toExpNeg||et>=nt.toExpPos)};function add(tt,et){var nt,rt,it,ot,at,st,lt,ct,ut=tt.constructor,ht=ut.precision;if(!tt.s||!et.s)return et.s||(et=new ut(tt)),external?round(et,ht):et;if(lt=tt.d,ct=et.d,at=tt.e,it=et.e,lt=lt.slice(),ot=at-it,ot){for(ot<0?(rt=lt,ot=-ot,st=ct.length):(rt=ct,it=at,st=lt.length),at=Math.ceil(ht/LOG_BASE),st=at>st?at+1:st+1,ot>st&&(ot=st,rt.length=1),rt.reverse();ot--;)rt.push(0);rt.reverse()}for(st=lt.length,ot=ct.length,st-ot<0&&(ot=st,rt=ct,ct=lt,lt=rt),nt=0;ot;)nt=(lt[--ot]=lt[ot]+ct[ot]+nt)/BASE|0,lt[ot]%=BASE;for(nt&&(lt.unshift(nt),++it),st=lt.length;lt[--st]==0;)lt.pop();return et.d=lt,et.e=it,external?round(et,ht):et}function checkInt32(tt,et,nt){if(tt!==~~tt||ttnt)throw Error(invalidArgument+tt)}function digitsToString(tt){var et,nt,rt,it=tt.length-1,ot="",at=tt[0];if(it>0){for(ot+=at,et=1;etat?1:-1;else for(st=lt=0;stit[st]?1:-1;break}return lt}function nt(rt,it,ot){for(var at=0;ot--;)rt[ot]-=at,at=rt[ot]1;)rt.shift()}return function(rt,it,ot,at){var st,lt,ct,ut,ht,dt,pt,mt,gt,yt,bt,wt,xt,kt,St,Tt,At,Et,Ct=rt.constructor,Lt=rt.s==it.s?1:-1,jt=rt.d,Rt=it.d;if(!rt.s)return new Ct(rt);if(!it.s)throw Error(decimalError+"Division by zero");for(lt=rt.e-it.e,At=Rt.length,St=jt.length,pt=new Ct(Lt),mt=pt.d=[],ct=0;Rt[ct]==(jt[ct]||0);)++ct;if(Rt[ct]>(jt[ct]||0)&&--lt,ot==null?wt=ot=Ct.precision:at?wt=ot+(getBase10Exponent(rt)-getBase10Exponent(it))+1:wt=ot,wt<0)return new Ct(0);if(wt=wt/LOG_BASE+2|0,ct=0,At==1)for(ut=0,Rt=Rt[0],wt++;(ct1&&(Rt=tt(Rt,ut),jt=tt(jt,ut),At=Rt.length,St=jt.length),kt=At,gt=jt.slice(0,At),yt=gt.length;yt=BASE/2&&++Tt;do ut=0,st=et(Rt,gt,At,yt),st<0?(bt=gt[0],At!=yt&&(bt=bt*BASE+(gt[1]||0)),ut=bt/Tt|0,ut>1?(ut>=BASE&&(ut=BASE-1),ht=tt(Rt,ut),dt=ht.length,yt=gt.length,st=et(ht,gt,dt,yt),st==1&&(ut--,nt(ht,At16)throw Error(exponentOutOfRange+getBase10Exponent(tt));if(!tt.s)return new ut(ONE);for(et==null?(external=!1,st=ht):st=et,at=new ut(.03125);tt.abs().gte(.1);)tt=tt.times(at),ct+=5;for(rt=Math.log(mathpow(2,ct))/Math.LN10*2+5|0,st+=rt,nt=it=ot=new ut(ONE),ut.precision=st;;){if(it=round(it.times(tt),st),nt=nt.times(++lt),at=ot.plus(divide(it,nt,st)),digitsToString(at.d).slice(0,st)===digitsToString(ot.d).slice(0,st)){for(;ct--;)ot=round(ot.times(ot),st);return ut.precision=ht,et==null?(external=!0,round(ot,ht)):ot}ot=at}}function getBase10Exponent(tt){for(var et=tt.e*LOG_BASE,nt=tt.d[0];nt>=10;nt/=10)et++;return et}function getLn10(tt,et,nt){if(et>tt.LN10.sd())throw external=!0,nt&&(tt.precision=nt),Error(decimalError+"LN10 precision limit exceeded");return round(new tt(tt.LN10),et)}function getZeroString(tt){for(var et="";tt--;)et+="0";return et}function ln(tt,et){var nt,rt,it,ot,at,st,lt,ct,ut,ht=1,dt=10,pt=tt,mt=pt.d,gt=pt.constructor,yt=gt.precision;if(pt.s<1)throw Error(decimalError+(pt.s?"NaN":"-Infinity"));if(pt.eq(ONE))return new gt(0);if(et==null?(external=!1,ct=yt):ct=et,pt.eq(10))return et==null&&(external=!0),getLn10(gt,ct);if(ct+=dt,gt.precision=ct,nt=digitsToString(mt),rt=nt.charAt(0),ot=getBase10Exponent(pt),Math.abs(ot)<15e14){for(;rt<7&&rt!=1||rt==1&&nt.charAt(1)>3;)pt=pt.times(tt),nt=digitsToString(pt.d),rt=nt.charAt(0),ht++;ot=getBase10Exponent(pt),rt>1?(pt=new gt("0."+nt),ot++):pt=new gt(rt+"."+nt.slice(1))}else return lt=getLn10(gt,ct+2,yt).times(ot+""),pt=ln(new gt(rt+"."+nt.slice(1)),ct-dt).plus(lt),gt.precision=yt,et==null?(external=!0,round(pt,yt)):pt;for(st=at=pt=divide(pt.minus(ONE),pt.plus(ONE),ct),ut=round(pt.times(pt),ct),it=3;;){if(at=round(at.times(ut),ct),lt=st.plus(divide(at,new gt(it),ct)),digitsToString(lt.d).slice(0,ct)===digitsToString(st.d).slice(0,ct))return st=st.times(2),ot!==0&&(st=st.plus(getLn10(gt,ct+2,yt).times(ot+""))),st=divide(st,new gt(ht),ct),gt.precision=yt,et==null?(external=!0,round(st,yt)):st;st=lt,it+=2}}function parseDecimal(tt,et){var nt,rt,it;for((nt=et.indexOf("."))>-1&&(et=et.replace(".","")),(rt=et.search(/e/i))>0?(nt<0&&(nt=rt),nt+=+et.slice(rt+1),et=et.substring(0,rt)):nt<0&&(nt=et.length),rt=0;et.charCodeAt(rt)===48;)++rt;for(it=et.length;et.charCodeAt(it-1)===48;)--it;if(et=et.slice(rt,it),et){if(it-=rt,nt=nt-rt-1,tt.e=mathfloor(nt/LOG_BASE),tt.d=[],rt=(nt+1)%LOG_BASE,nt<0&&(rt+=LOG_BASE),rtMAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+nt)}else tt.s=0,tt.e=0,tt.d=[0];return tt}function round(tt,et,nt){var rt,it,ot,at,st,lt,ct,ut,ht=tt.d;for(at=1,ot=ht[0];ot>=10;ot/=10)at++;if(rt=et-at,rt<0)rt+=LOG_BASE,it=et,ct=ht[ut=0];else{if(ut=Math.ceil((rt+1)/LOG_BASE),ot=ht.length,ut>=ot)return tt;for(ct=ot=ht[ut],at=1;ot>=10;ot/=10)at++;rt%=LOG_BASE,it=rt-LOG_BASE+at}if(nt!==void 0&&(ot=mathpow(10,at-it-1),st=ct/ot%10|0,lt=et<0||ht[ut+1]!==void 0||ct%ot,lt=nt<4?(st||lt)&&(nt==0||nt==(tt.s<0?3:2)):st>5||st==5&&(nt==4||lt||nt==6&&(rt>0?it>0?ct/mathpow(10,at-it):0:ht[ut-1])%10&1||nt==(tt.s<0?8:7))),et<1||!ht[0])return lt?(ot=getBase10Exponent(tt),ht.length=1,et=et-ot-1,ht[0]=mathpow(10,(LOG_BASE-et%LOG_BASE)%LOG_BASE),tt.e=mathfloor(-et/LOG_BASE)||0):(ht.length=1,ht[0]=tt.e=tt.s=0),tt;if(rt==0?(ht.length=ut,ot=1,ut--):(ht.length=ut+1,ot=mathpow(10,LOG_BASE-rt),ht[ut]=it>0?(ct/mathpow(10,at-it)%mathpow(10,it)|0)*ot:0),lt)for(;;)if(ut==0){(ht[0]+=ot)==BASE&&(ht[0]=1,++tt.e);break}else{if(ht[ut]+=ot,ht[ut]!=BASE)break;ht[ut--]=0,ot=1}for(rt=ht.length;ht[--rt]===0;)ht.pop();if(external&&(tt.e>MAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+getBase10Exponent(tt));return tt}function subtract(tt,et){var nt,rt,it,ot,at,st,lt,ct,ut,ht,dt=tt.constructor,pt=dt.precision;if(!tt.s||!et.s)return et.s?et.s=-et.s:et=new dt(tt),external?round(et,pt):et;if(lt=tt.d,ht=et.d,rt=et.e,ct=tt.e,lt=lt.slice(),at=ct-rt,at){for(ut=at<0,ut?(nt=lt,at=-at,st=ht.length):(nt=ht,rt=ct,st=lt.length),it=Math.max(Math.ceil(pt/LOG_BASE),st)+2,at>it&&(at=it,nt.length=1),nt.reverse(),it=at;it--;)nt.push(0);nt.reverse()}else{for(it=lt.length,st=ht.length,ut=it0;--it)lt[st++]=0;for(it=ht.length;it>at;){if(lt[--it]0?ot=ot.charAt(0)+"."+ot.slice(1)+getZeroString(rt):at>1&&(ot=ot.charAt(0)+"."+ot.slice(1)),ot=ot+(it<0?"e":"e+")+it):it<0?(ot="0."+getZeroString(-it-1)+ot,nt&&(rt=nt-at)>0&&(ot+=getZeroString(rt))):it>=at?(ot+=getZeroString(it+1-at),nt&&(rt=nt-it-1)>0&&(ot=ot+"."+getZeroString(rt))):((rt=it+1)0&&(it+1===at&&(ot+="."),ot+=getZeroString(rt))),tt.s<0?"-"+ot:ot}function truncate(tt,et){if(tt.length>et)return tt.length=et,!0}function clone(tt){var et,nt,rt;function it(ot){var at=this;if(!(at instanceof it))return new it(ot);if(at.constructor=it,ot instanceof it){at.s=ot.s,at.e=ot.e,at.d=(ot=ot.d)?ot.slice():ot;return}if(typeof ot=="number"){if(ot*0!==0)throw Error(invalidArgument+ot);if(ot>0)at.s=1;else if(ot<0)ot=-ot,at.s=-1;else{at.s=0,at.e=0,at.d=[0];return}if(ot===~~ot&&ot<1e7){at.e=0,at.d=[ot];return}return parseDecimal(at,ot.toString())}else if(typeof ot!="string")throw Error(invalidArgument+ot);if(ot.charCodeAt(0)===45?(ot=ot.slice(1),at.s=-1):at.s=1,isDecimal.test(ot))parseDecimal(at,ot);else throw Error(invalidArgument+ot)}if(it.prototype=P,it.ROUND_UP=0,it.ROUND_DOWN=1,it.ROUND_CEIL=2,it.ROUND_FLOOR=3,it.ROUND_HALF_UP=4,it.ROUND_HALF_DOWN=5,it.ROUND_HALF_EVEN=6,it.ROUND_HALF_CEIL=7,it.ROUND_HALF_FLOOR=8,it.clone=clone,it.config=it.set=config,tt===void 0&&(tt={}),tt)for(rt=["precision","rounding","toExpNeg","toExpPos","LN10"],et=0;et=it[et+1]&&rt<=it[et+2])this[nt]=rt;else throw Error(invalidArgument+nt+": "+rt);if((rt=tt[nt="LN10"])!==void 0)if(rt==Math.LN10)this[nt]=new this(rt);else throw Error(invalidArgument+nt+": "+rt);return this}var Decimal=clone(defaults);ONE=new Decimal(1);const Decimal$1=Decimal;function _toConsumableArray$8(tt){return _arrayWithoutHoles$8(tt)||_iterableToArray$8(tt)||_unsupportedIterableToArray$e(tt)||_nonIterableSpread$8()}function _nonIterableSpread$8(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$f(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$f(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$f(tt,et)}}function _arrayLikeToArray$f(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt0&&arguments[0]!==void 0?arguments[0]:[];return It.reduce(function(Ot,Wt){var zt=Wt.word,Ft=Wt.width,Nt=Ot[Ot.length-1];if(Nt&&(it==null||ot||Nt.width+Ft+rtWt.width?Ot:Wt})};if(!ut)return pt;for(var gt="…",yt=function(It){var Ot=ht.slice(0,It),Wt=calculateWordWidths({breakAll:ct,style:lt,children:Ot+gt}).wordsWithComputedWidth,zt=dt(Wt),Ft=zt.length>at||mt(zt).width>Number(it);return[Ft,zt]},bt=0,wt=ht.length-1,xt=0,kt;bt<=wt&&xt<=ht.length-1;){var St=Math.floor((bt+wt)/2),Tt=St-1,At=yt(Tt),Et=_slicedToArray$7(At,2),Ct=Et[0],Lt=Et[1],jt=yt(St),Rt=_slicedToArray$7(jt,1),$t=Rt[0];if(!Ct&&!$t&&(bt=St+1),Ct&&$t&&(wt=St-1),!Ct&&$t){kt=Lt;break}xt++}return kt||pt},getWordsWithoutCalculate=function(et){var nt=_isNil(et)?[]:et.toString().split(BREAKING_SPACES);return[{words:nt}]},getWordsByLines=function(et){var nt=et.width,rt=et.scaleToFit,it=et.children,ot=et.style,at=et.breakAll,st=et.maxLines;if((nt||rt)&&!Global.isSsr){var lt,ct,ut=calculateWordWidths({breakAll:at,children:it,style:ot});if(ut){var ht=ut.wordsWithComputedWidth,dt=ut.spaceWidth;lt=ht,ct=dt}else return getWordsWithoutCalculate(it);return calculateWordsByLines({breakAll:at,children:it,maxLines:st,style:ot},lt,ct,nt,rt)}return getWordsWithoutCalculate(it)},DEFAULT_FILL="#808080",Text=function(et){var nt=et.x,rt=nt===void 0?0:nt,it=et.y,ot=it===void 0?0:it,at=et.lineHeight,st=at===void 0?"1em":at,lt=et.capHeight,ct=lt===void 0?"0.71em":lt,ut=et.scaleToFit,ht=ut===void 0?!1:ut,dt=et.textAnchor,pt=dt===void 0?"start":dt,mt=et.verticalAnchor,gt=mt===void 0?"end":mt,yt=et.fill,bt=yt===void 0?DEFAULT_FILL:yt,wt=_objectWithoutProperties$c(et,_excluded$c),xt=reactExports.useMemo(function(){return getWordsByLines({breakAll:wt.breakAll,children:wt.children,maxLines:wt.maxLines,scaleToFit:ht,style:wt.style,width:wt.width})},[wt.breakAll,wt.children,wt.maxLines,ht,wt.style,wt.width]),kt=wt.dx,St=wt.dy,Tt=wt.angle,At=wt.className,Et=wt.breakAll,Ct=_objectWithoutProperties$c(wt,_excluded2$4);if(!isNumOrStr(rt)||!isNumOrStr(ot))return null;var Lt=rt+(isNumber(kt)?kt:0),jt=ot+(isNumber(St)?St:0),Rt;switch(gt){case"start":Rt=reduceCSSCalc("calc(".concat(ct,")"));break;case"middle":Rt=reduceCSSCalc("calc(".concat((xt.length-1)/2," * -").concat(st," + (").concat(ct," / 2))"));break;default:Rt=reduceCSSCalc("calc(".concat(xt.length-1," * -").concat(st,")"));break}var $t=[];if(ht){var vt=xt[0].width,It=wt.width;$t.push("scale(".concat((isNumber(It)?It/vt:1)/vt,")"))}return Tt&&$t.push("rotate(".concat(Tt,", ").concat(Lt,", ").concat(jt,")")),$t.length&&(Ct.transform=$t.join(" ")),React$1.createElement("text",_extends$m({},filterProps(Ct,!0),{x:Lt,y:jt,className:classNames("recharts-text",At),textAnchor:pt,fill:bt.includes("url")?DEFAULT_FILL:bt}),xt.map(function(Ot,Wt){return React$1.createElement("tspan",{x:Lt,dy:Wt===0?Rt:st,key:Wt},Ot.words.join(Et?"":" "))}))},baseIsEqual=_baseIsEqual;function isEqual$1(tt,et){return baseIsEqual(tt,et)}var isEqual_1=isEqual$1;const _isEqual=getDefaultExportFromCjs(isEqual_1);var isSymbol=isSymbol_1;function baseExtremum$2(tt,et,nt){for(var rt=-1,it=tt.length;++rtet}var _baseGt=baseGt$1,baseExtremum$1=_baseExtremum,baseGt=_baseGt,identity$7=identity_1;function max$1(tt){return tt&&tt.length?baseExtremum$1(tt,identity$7,baseGt):void 0}var max_1=max$1;const _max=getDefaultExportFromCjs(max_1);function baseLt$1(tt,et){return ttet?1:tt>=et?0:NaN}function descending(tt,et){return tt==null||et==null?NaN:ettt?1:et>=tt?0:NaN}function bisector(tt){let et,nt,rt;tt.length!==2?(et=ascending$1,nt=(st,lt)=>ascending$1(tt(st),lt),rt=(st,lt)=>tt(st)-lt):(et=tt===ascending$1||tt===descending?tt:zero$1,nt=tt,rt=tt);function it(st,lt,ct=0,ut=st.length){if(ct>>1;nt(st[ht],lt)<0?ct=ht+1:ut=ht}while(ct>>1;nt(st[ht],lt)<=0?ct=ht+1:ut=ht}while(ctct&&rt(st[ht-1],lt)>-rt(st[ht],lt)?ht-1:ht}return{left:it,center:at,right:ot}}function zero$1(){return 0}function number$3(tt){return tt===null?NaN:+tt}function*numbers(tt,et){if(et===void 0)for(let nt of tt)nt!=null&&(nt=+nt)>=nt&&(yield nt);else{let nt=-1;for(let rt of tt)(rt=et(rt,++nt,tt))!=null&&(rt=+rt)>=rt&&(yield rt)}}const ascendingBisect=bisector(ascending$1),bisectRight=ascendingBisect.right;bisector(number$3).center;const bisect=bisectRight;class InternMap extends Map{constructor(et,nt=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:nt}}),et!=null)for(const[rt,it]of et)this.set(rt,it)}get(et){return super.get(intern_get(this,et))}has(et){return super.has(intern_get(this,et))}set(et,nt){return super.set(intern_set(this,et),nt)}delete(et){return super.delete(intern_delete(this,et))}}function intern_get({_intern:tt,_key:et},nt){const rt=et(nt);return tt.has(rt)?tt.get(rt):nt}function intern_set({_intern:tt,_key:et},nt){const rt=et(nt);return tt.has(rt)?tt.get(rt):(tt.set(rt,nt),nt)}function intern_delete({_intern:tt,_key:et},nt){const rt=et(nt);return tt.has(rt)&&(nt=tt.get(rt),tt.delete(rt)),nt}function keyof(tt){return tt!==null&&typeof tt=="object"?tt.valueOf():tt}function compareDefined(tt=ascending$1){if(tt===ascending$1)return ascendingDefined;if(typeof tt!="function")throw new TypeError("compare is not a function");return(et,nt)=>{const rt=tt(et,nt);return rt||rt===0?rt:(tt(nt,nt)===0)-(tt(et,et)===0)}}function ascendingDefined(tt,et){return(tt==null||!(tt>=tt))-(et==null||!(et>=et))||(ttet?1:0)}const e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function tickSpec(tt,et,nt){const rt=(et-tt)/Math.max(0,nt),it=Math.floor(Math.log10(rt)),ot=rt/Math.pow(10,it),at=ot>=e10?10:ot>=e5?5:ot>=e2?2:1;let st,lt,ct;return it<0?(ct=Math.pow(10,-it)/at,st=Math.round(tt*ct),lt=Math.round(et*ct),st/ctet&&--lt,ct=-ct):(ct=Math.pow(10,it)*at,st=Math.round(tt/ct),lt=Math.round(et/ct),st*ctet&&--lt),lt0))return[];if(tt===et)return[tt];const rt=et=it))return[];const st=ot-it+1,lt=new Array(st);if(rt)if(at<0)for(let ct=0;ct=rt)&&(nt=rt);else{let rt=-1;for(let it of tt)(it=et(it,++rt,tt))!=null&&(nt=it)&&(nt=it)}return nt}function min(tt,et){let nt;if(et===void 0)for(const rt of tt)rt!=null&&(nt>rt||nt===void 0&&rt>=rt)&&(nt=rt);else{let rt=-1;for(let it of tt)(it=et(it,++rt,tt))!=null&&(nt>it||nt===void 0&&it>=it)&&(nt=it)}return nt}function quickselect(tt,et,nt=0,rt=1/0,it){if(et=Math.floor(et),nt=Math.floor(Math.max(0,nt)),rt=Math.floor(Math.min(tt.length-1,rt)),!(nt<=et&&et<=rt))return tt;for(it=it===void 0?ascendingDefined:compareDefined(it);rt>nt;){if(rt-nt>600){const lt=rt-nt+1,ct=et-nt+1,ut=Math.log(lt),ht=.5*Math.exp(2*ut/3),dt=.5*Math.sqrt(ut*ht*(lt-ht)/lt)*(ct-lt/2<0?-1:1),pt=Math.max(nt,Math.floor(et-ct*ht/lt+dt)),mt=Math.min(rt,Math.floor(et+(lt-ct)*ht/lt+dt));quickselect(tt,et,pt,mt,it)}const ot=tt[et];let at=nt,st=rt;for(swap(tt,nt,et),it(tt[rt],ot)>0&&swap(tt,nt,rt);at0;)--st}it(tt[nt],ot)===0?swap(tt,nt,st):(++st,swap(tt,st,rt)),st<=et&&(nt=st+1),et<=st&&(rt=st-1)}return tt}function swap(tt,et,nt){const rt=tt[et];tt[et]=tt[nt],tt[nt]=rt}function quantile$1(tt,et,nt){if(tt=Float64Array.from(numbers(tt,nt)),!(!(rt=tt.length)||isNaN(et=+et))){if(et<=0||rt<2)return min(tt);if(et>=1)return max(tt);var rt,it=(rt-1)*et,ot=Math.floor(it),at=max(quickselect(tt,ot).subarray(0,ot+1)),st=min(tt.subarray(ot+1));return at+(st-at)*(it-ot)}}function quantileSorted(tt,et,nt=number$3){if(!(!(rt=tt.length)||isNaN(et=+et))){if(et<=0||rt<2)return+nt(tt[0],0,tt);if(et>=1)return+nt(tt[rt-1],rt-1,tt);var rt,it=(rt-1)*et,ot=Math.floor(it),at=+nt(tt[ot],ot,tt),st=+nt(tt[ot+1],ot+1,tt);return at+(st-at)*(it-ot)}}function range$2(tt,et,nt){tt=+tt,et=+et,nt=(it=arguments.length)<2?(et=tt,tt=0,1):it<3?1:+nt;for(var rt=-1,it=Math.max(0,Math.ceil((et-tt)/nt))|0,ot=new Array(it);++rt>8&15|et>>4&240,et>>4&15|et&240,(et&15)<<4|et&15,1):nt===8?rgba(et>>24&255,et>>16&255,et>>8&255,(et&255)/255):nt===4?rgba(et>>12&15|et>>8&240,et>>8&15|et>>4&240,et>>4&15|et&240,((et&15)<<4|et&15)/255):null):(et=reRgbInteger.exec(tt))?new Rgb(et[1],et[2],et[3],1):(et=reRgbPercent.exec(tt))?new Rgb(et[1]*255/100,et[2]*255/100,et[3]*255/100,1):(et=reRgbaInteger.exec(tt))?rgba(et[1],et[2],et[3],et[4]):(et=reRgbaPercent.exec(tt))?rgba(et[1]*255/100,et[2]*255/100,et[3]*255/100,et[4]):(et=reHslPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,1):(et=reHslaPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,et[4]):named.hasOwnProperty(tt)?rgbn(named[tt]):tt==="transparent"?new Rgb(NaN,NaN,NaN,0):null}function rgbn(tt){return new Rgb(tt>>16&255,tt>>8&255,tt&255,1)}function rgba(tt,et,nt,rt){return rt<=0&&(tt=et=nt=NaN),new Rgb(tt,et,nt,rt)}function rgbConvert(tt){return tt instanceof Color||(tt=color(tt)),tt?(tt=tt.rgb(),new Rgb(tt.r,tt.g,tt.b,tt.opacity)):new Rgb}function rgb(tt,et,nt,rt){return arguments.length===1?rgbConvert(tt):new Rgb(tt,et,nt,rt??1)}function Rgb(tt,et,nt,rt){this.r=+tt,this.g=+et,this.b=+nt,this.opacity=+rt}define(Rgb,rgb,extend(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:rgb_formatHex8,formatRgb:rgb_formatRgb,toString:rgb_formatRgb}));function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatHex8(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity)?1:this.opacity)*255)}`}function rgb_formatRgb(){const tt=clampa(this.opacity);return`${tt===1?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${tt===1?")":`, ${tt})`}`}function clampa(tt){return isNaN(tt)?1:Math.max(0,Math.min(1,tt))}function clampi(tt){return Math.max(0,Math.min(255,Math.round(tt)||0))}function hex(tt){return tt=clampi(tt),(tt<16?"0":"")+tt.toString(16)}function hsla(tt,et,nt,rt){return rt<=0?tt=et=nt=NaN:nt<=0||nt>=1?tt=et=NaN:et<=0&&(tt=NaN),new Hsl(tt,et,nt,rt)}function hslConvert(tt){if(tt instanceof Hsl)return new Hsl(tt.h,tt.s,tt.l,tt.opacity);if(tt instanceof Color||(tt=color(tt)),!tt)return new Hsl;if(tt instanceof Hsl)return tt;tt=tt.rgb();var et=tt.r/255,nt=tt.g/255,rt=tt.b/255,it=Math.min(et,nt,rt),ot=Math.max(et,nt,rt),at=NaN,st=ot-it,lt=(ot+it)/2;return st?(et===ot?at=(nt-rt)/st+(nt0&<<1?0:at,new Hsl(at,st,lt,tt.opacity)}function hsl(tt,et,nt,rt){return arguments.length===1?hslConvert(tt):new Hsl(tt,et,nt,rt??1)}function Hsl(tt,et,nt,rt){this.h=+tt,this.s=+et,this.l=+nt,this.opacity=+rt}define(Hsl,hsl,extend(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},rgb(){var tt=this.h%360+(this.h<0)*360,et=isNaN(tt)||isNaN(this.s)?0:this.s,nt=this.l,rt=nt+(nt<.5?nt:1-nt)*et,it=2*nt-rt;return new Rgb(hsl2rgb(tt>=240?tt-240:tt+120,it,rt),hsl2rgb(tt,it,rt),hsl2rgb(tt<120?tt+240:tt-120,it,rt),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const tt=clampa(this.opacity);return`${tt===1?"hsl(":"hsla("}${clamph(this.h)}, ${clampt(this.s)*100}%, ${clampt(this.l)*100}%${tt===1?")":`, ${tt})`}`}}));function clamph(tt){return tt=(tt||0)%360,tt<0?tt+360:tt}function clampt(tt){return Math.max(0,Math.min(1,tt||0))}function hsl2rgb(tt,et,nt){return(tt<60?et+(nt-et)*tt/60:tt<180?nt:tt<240?et+(nt-et)*(240-tt)/60:et)*255}const constant$3=tt=>()=>tt;function linear$1(tt,et){return function(nt){return tt+nt*et}}function exponential(tt,et,nt){return tt=Math.pow(tt,nt),et=Math.pow(et,nt)-tt,nt=1/nt,function(rt){return Math.pow(tt+rt*et,nt)}}function gamma(tt){return(tt=+tt)==1?nogamma:function(et,nt){return nt-et?exponential(et,nt,tt):constant$3(isNaN(et)?nt:et)}}function nogamma(tt,et){var nt=et-tt;return nt?linear$1(tt,nt):constant$3(isNaN(tt)?et:tt)}const interpolateRgb=function tt(et){var nt=gamma(et);function rt(it,ot){var at=nt((it=rgb(it)).r,(ot=rgb(ot)).r),st=nt(it.g,ot.g),lt=nt(it.b,ot.b),ct=nogamma(it.opacity,ot.opacity);return function(ut){return it.r=at(ut),it.g=st(ut),it.b=lt(ut),it.opacity=ct(ut),it+""}}return rt.gamma=tt,rt}(1);function numberArray(tt,et){et||(et=[]);var nt=tt?Math.min(et.length,tt.length):0,rt=et.slice(),it;return function(ot){for(it=0;itnt&&(ot=et.slice(nt,ot),st[at]?st[at]+=ot:st[++at]=ot),(rt=rt[0])===(it=it[0])?st[at]?st[at]+=it:st[++at]=it:(st[++at]=null,lt.push({i:at,x:interpolateNumber$1(rt,it)})),nt=reB.lastIndex;return nt180?ut+=360:ut-ct>180&&(ct+=360),dt.push({i:ht.push(it(ht)+"rotate(",null,rt)-2,x:interpolateNumber$1(ct,ut)})):ut&&ht.push(it(ht)+"rotate("+ut+rt)}function st(ct,ut,ht,dt){ct!==ut?dt.push({i:ht.push(it(ht)+"skewX(",null,rt)-2,x:interpolateNumber$1(ct,ut)}):ut&&ht.push(it(ht)+"skewX("+ut+rt)}function lt(ct,ut,ht,dt,pt,mt){if(ct!==ht||ut!==dt){var gt=pt.push(it(pt)+"scale(",null,",",null,")");mt.push({i:gt-4,x:interpolateNumber$1(ct,ht)},{i:gt-2,x:interpolateNumber$1(ut,dt)})}else(ht!==1||dt!==1)&&pt.push(it(pt)+"scale("+ht+","+dt+")")}return function(ct,ut){var ht=[],dt=[];return ct=tt(ct),ut=tt(ut),ot(ct.translateX,ct.translateY,ut.translateX,ut.translateY,ht,dt),at(ct.rotate,ut.rotate,ht,dt),st(ct.skewX,ut.skewX,ht,dt),lt(ct.scaleX,ct.scaleY,ut.scaleX,ut.scaleY,ht,dt),ct=ut=null,function(pt){for(var mt=-1,gt=dt.length,yt;++mtet&&(nt=tt,tt=et,et=nt),function(rt){return Math.max(tt,Math.min(et,rt))}}function bimap(tt,et,nt){var rt=tt[0],it=tt[1],ot=et[0],at=et[1];return it2?polymap:bimap,lt=ct=null,ht}function ht(dt){return dt==null||isNaN(dt=+dt)?ot:(lt||(lt=st(tt.map(rt),et,nt)))(rt(at(dt)))}return ht.invert=function(dt){return at(it((ct||(ct=st(et,tt.map(rt),interpolateNumber$1)))(dt)))},ht.domain=function(dt){return arguments.length?(tt=Array.from(dt,number$2),ut()):tt.slice()},ht.range=function(dt){return arguments.length?(et=Array.from(dt),ut()):et.slice()},ht.rangeRound=function(dt){return et=Array.from(dt),nt=interpolateRound,ut()},ht.clamp=function(dt){return arguments.length?(at=dt?!0:identity$4,ut()):at!==identity$4},ht.interpolate=function(dt){return arguments.length?(nt=dt,ut()):nt},ht.unknown=function(dt){return arguments.length?(ot=dt,ht):ot},function(dt,pt){return rt=dt,it=pt,ut()}}function continuous(){return transformer$2()(identity$4,identity$4)}function formatDecimal(tt){return Math.abs(tt=Math.round(tt))>=1e21?tt.toLocaleString("en").replace(/,/g,""):tt.toString(10)}function formatDecimalParts(tt,et){if((nt=(tt=et?tt.toExponential(et-1):tt.toExponential()).indexOf("e"))<0)return null;var nt,rt=tt.slice(0,nt);return[rt.length>1?rt[0]+rt.slice(2):rt,+tt.slice(nt+1)]}function exponent(tt){return tt=formatDecimalParts(Math.abs(tt)),tt?tt[1]:NaN}function formatGroup(tt,et){return function(nt,rt){for(var it=nt.length,ot=[],at=0,st=tt[0],lt=0;it>0&&st>0&&(lt+st+1>rt&&(st=Math.max(1,rt-lt)),ot.push(nt.substring(it-=st,it+st)),!((lt+=st+1)>rt));)st=tt[at=(at+1)%tt.length];return ot.reverse().join(et)}}function formatNumerals(tt){return function(et){return et.replace(/[0-9]/g,function(nt){return tt[+nt]})}}var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(tt){if(!(et=re.exec(tt)))throw new Error("invalid format: "+tt);var et;return new FormatSpecifier({fill:et[1],align:et[2],sign:et[3],symbol:et[4],zero:et[5],width:et[6],comma:et[7],precision:et[8]&&et[8].slice(1),trim:et[9],type:et[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(tt){this.fill=tt.fill===void 0?" ":tt.fill+"",this.align=tt.align===void 0?">":tt.align+"",this.sign=tt.sign===void 0?"-":tt.sign+"",this.symbol=tt.symbol===void 0?"":tt.symbol+"",this.zero=!!tt.zero,this.width=tt.width===void 0?void 0:+tt.width,this.comma=!!tt.comma,this.precision=tt.precision===void 0?void 0:+tt.precision,this.trim=!!tt.trim,this.type=tt.type===void 0?"":tt.type+""}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function formatTrim(tt){e:for(var et=tt.length,nt=1,rt=-1,it;nt0&&(rt=0);break}return rt>0?tt.slice(0,rt)+tt.slice(it+1):tt}var prefixExponent;function formatPrefixAuto(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var rt=nt[0],it=nt[1],ot=it-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(it/3)))*3)+1,at=rt.length;return ot===at?rt:ot>at?rt+new Array(ot-at+1).join("0"):ot>0?rt.slice(0,ot)+"."+rt.slice(ot):"0."+new Array(1-ot).join("0")+formatDecimalParts(tt,Math.max(0,et+ot-1))[0]}function formatRounded(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var rt=nt[0],it=nt[1];return it<0?"0."+new Array(-it).join("0")+rt:rt.length>it+1?rt.slice(0,it+1)+"."+rt.slice(it+1):rt+new Array(it-rt.length+2).join("0")}const formatTypes={"%":(tt,et)=>(tt*100).toFixed(et),b:tt=>Math.round(tt).toString(2),c:tt=>tt+"",d:formatDecimal,e:(tt,et)=>tt.toExponential(et),f:(tt,et)=>tt.toFixed(et),g:(tt,et)=>tt.toPrecision(et),o:tt=>Math.round(tt).toString(8),p:(tt,et)=>formatRounded(tt*100,et),r:formatRounded,s:formatPrefixAuto,X:tt=>Math.round(tt).toString(16).toUpperCase(),x:tt=>Math.round(tt).toString(16)};function identity$3(tt){return tt}var map$1=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale$1(tt){var et=tt.grouping===void 0||tt.thousands===void 0?identity$3:formatGroup(map$1.call(tt.grouping,Number),tt.thousands+""),nt=tt.currency===void 0?"":tt.currency[0]+"",rt=tt.currency===void 0?"":tt.currency[1]+"",it=tt.decimal===void 0?".":tt.decimal+"",ot=tt.numerals===void 0?identity$3:formatNumerals(map$1.call(tt.numerals,String)),at=tt.percent===void 0?"%":tt.percent+"",st=tt.minus===void 0?"−":tt.minus+"",lt=tt.nan===void 0?"NaN":tt.nan+"";function ct(ht){ht=formatSpecifier(ht);var dt=ht.fill,pt=ht.align,mt=ht.sign,gt=ht.symbol,yt=ht.zero,bt=ht.width,wt=ht.comma,xt=ht.precision,kt=ht.trim,St=ht.type;St==="n"?(wt=!0,St="g"):formatTypes[St]||(xt===void 0&&(xt=12),kt=!0,St="g"),(yt||dt==="0"&&pt==="=")&&(yt=!0,dt="0",pt="=");var Tt=gt==="$"?nt:gt==="#"&&/[boxX]/.test(St)?"0"+St.toLowerCase():"",At=gt==="$"?rt:/[%p]/.test(St)?at:"",Et=formatTypes[St],Ct=/[defgprs%]/.test(St);xt=xt===void 0?6:/[gprs]/.test(St)?Math.max(1,Math.min(21,xt)):Math.max(0,Math.min(20,xt));function Lt(jt){var Rt=Tt,$t=At,vt,It,Ot;if(St==="c")$t=Et(jt)+$t,jt="";else{jt=+jt;var Wt=jt<0||1/jt<0;if(jt=isNaN(jt)?lt:Et(Math.abs(jt),xt),kt&&(jt=formatTrim(jt)),Wt&&+jt==0&&mt!=="+"&&(Wt=!1),Rt=(Wt?mt==="("?mt:st:mt==="-"||mt==="("?"":mt)+Rt,$t=(St==="s"?prefixes[8+prefixExponent/3]:"")+$t+(Wt&&mt==="("?")":""),Ct){for(vt=-1,It=jt.length;++vtOt||Ot>57){$t=(Ot===46?it+jt.slice(vt+1):jt.slice(vt))+$t,jt=jt.slice(0,vt);break}}}wt&&!yt&&(jt=et(jt,1/0));var zt=Rt.length+jt.length+$t.length,Ft=zt>1)+Rt+jt+$t+Ft.slice(zt);break;default:jt=Ft+Rt+jt+$t;break}return ot(jt)}return Lt.toString=function(){return ht+""},Lt}function ut(ht,dt){var pt=ct((ht=formatSpecifier(ht),ht.type="f",ht)),mt=Math.max(-8,Math.min(8,Math.floor(exponent(dt)/3)))*3,gt=Math.pow(10,-mt),yt=prefixes[8+mt/3];return function(bt){return pt(gt*bt)+yt}}return{format:ct,formatPrefix:ut}}var locale$1,format,formatPrefix;defaultLocale$1({thousands:",",grouping:[3],currency:["$",""]});function defaultLocale$1(tt){return locale$1=formatLocale$1(tt),format=locale$1.format,formatPrefix=locale$1.formatPrefix,locale$1}function precisionFixed(tt){return Math.max(0,-exponent(Math.abs(tt)))}function precisionPrefix(tt,et){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(et)/3)))*3-exponent(Math.abs(tt)))}function precisionRound(tt,et){return tt=Math.abs(tt),et=Math.abs(et)-tt,Math.max(0,exponent(et)-exponent(tt))+1}function tickFormat(tt,et,nt,rt){var it=tickStep(tt,et,nt),ot;switch(rt=formatSpecifier(rt??",f"),rt.type){case"s":{var at=Math.max(Math.abs(tt),Math.abs(et));return rt.precision==null&&!isNaN(ot=precisionPrefix(it,at))&&(rt.precision=ot),formatPrefix(rt,at)}case"":case"e":case"g":case"p":case"r":{rt.precision==null&&!isNaN(ot=precisionRound(it,Math.max(Math.abs(tt),Math.abs(et))))&&(rt.precision=ot-(rt.type==="e"));break}case"f":case"%":{rt.precision==null&&!isNaN(ot=precisionFixed(it))&&(rt.precision=ot-(rt.type==="%")*2);break}}return format(rt)}function linearish(tt){var et=tt.domain;return tt.ticks=function(nt){var rt=et();return ticks(rt[0],rt[rt.length-1],nt??10)},tt.tickFormat=function(nt,rt){var it=et();return tickFormat(it[0],it[it.length-1],nt??10,rt)},tt.nice=function(nt){nt==null&&(nt=10);var rt=et(),it=0,ot=rt.length-1,at=rt[it],st=rt[ot],lt,ct,ut=10;for(st0;){if(ct=tickIncrement(at,st,nt),ct===lt)return rt[it]=at,rt[ot]=st,et(rt);if(ct>0)at=Math.floor(at/ct)*ct,st=Math.ceil(st/ct)*ct;else if(ct<0)at=Math.ceil(at*ct)/ct,st=Math.floor(st*ct)/ct;else break;lt=ct}return tt},tt}function linear(){var tt=continuous();return tt.copy=function(){return copy$1(tt,linear())},initRange.apply(tt,arguments),linearish(tt)}function identity$2(tt){var et;function nt(rt){return rt==null||isNaN(rt=+rt)?et:rt}return nt.invert=nt,nt.domain=nt.range=function(rt){return arguments.length?(tt=Array.from(rt,number$2),nt):tt.slice()},nt.unknown=function(rt){return arguments.length?(et=rt,nt):et},nt.copy=function(){return identity$2(tt).unknown(et)},tt=arguments.length?Array.from(tt,number$2):[0,1],linearish(nt)}function nice(tt,et){tt=tt.slice();var nt=0,rt=tt.length-1,it=tt[nt],ot=tt[rt],at;return otMath.pow(tt,et)}function logp(tt){return tt===Math.E?Math.log:tt===10&&Math.log10||tt===2&&Math.log2||(tt=Math.log(tt),et=>Math.log(et)/tt)}function reflect(tt){return(et,nt)=>-tt(-et,nt)}function loggish(tt){const et=tt(transformLog,transformExp),nt=et.domain;let rt=10,it,ot;function at(){return it=logp(rt),ot=powp(rt),nt()[0]<0?(it=reflect(it),ot=reflect(ot),tt(transformLogn,transformExpn)):tt(transformLog,transformExp),et}return et.base=function(st){return arguments.length?(rt=+st,at()):rt},et.domain=function(st){return arguments.length?(nt(st),at()):nt()},et.ticks=st=>{const lt=nt();let ct=lt[0],ut=lt[lt.length-1];const ht=ut0){for(;dt<=pt;++dt)for(mt=1;mtut)break;bt.push(gt)}}else for(;dt<=pt;++dt)for(mt=rt-1;mt>=1;--mt)if(gt=dt>0?mt/ot(-dt):mt*ot(dt),!(gtut)break;bt.push(gt)}bt.length*2{if(st==null&&(st=10),lt==null&&(lt=rt===10?"s":","),typeof lt!="function"&&(!(rt%1)&&(lt=formatSpecifier(lt)).precision==null&&(lt.trim=!0),lt=format(lt)),st===1/0)return lt;const ct=Math.max(1,rt*st/et.ticks().length);return ut=>{let ht=ut/ot(Math.round(it(ut)));return ht*rtnt(nice(nt(),{floor:st=>ot(Math.floor(it(st))),ceil:st=>ot(Math.ceil(it(st)))})),et}function log(){const tt=loggish(transformer$2()).domain([1,10]);return tt.copy=()=>copy$1(tt,log()).base(tt.base()),initRange.apply(tt,arguments),tt}function transformSymlog(tt){return function(et){return Math.sign(et)*Math.log1p(Math.abs(et/tt))}}function transformSymexp(tt){return function(et){return Math.sign(et)*Math.expm1(Math.abs(et))*tt}}function symlogish(tt){var et=1,nt=tt(transformSymlog(et),transformSymexp(et));return nt.constant=function(rt){return arguments.length?tt(transformSymlog(et=+rt),transformSymexp(et)):et},linearish(nt)}function symlog(){var tt=symlogish(transformer$2());return tt.copy=function(){return copy$1(tt,symlog()).constant(tt.constant())},initRange.apply(tt,arguments)}function transformPow(tt){return function(et){return et<0?-Math.pow(-et,tt):Math.pow(et,tt)}}function transformSqrt(tt){return tt<0?-Math.sqrt(-tt):Math.sqrt(tt)}function transformSquare(tt){return tt<0?-tt*tt:tt*tt}function powish(tt){var et=tt(identity$4,identity$4),nt=1;function rt(){return nt===1?tt(identity$4,identity$4):nt===.5?tt(transformSqrt,transformSquare):tt(transformPow(nt),transformPow(1/nt))}return et.exponent=function(it){return arguments.length?(nt=+it,rt()):nt},linearish(et)}function pow(){var tt=powish(transformer$2());return tt.copy=function(){return copy$1(tt,pow()).exponent(tt.exponent())},initRange.apply(tt,arguments),tt}function sqrt(){return pow.apply(null,arguments).exponent(.5)}function square(tt){return Math.sign(tt)*tt*tt}function unsquare(tt){return Math.sign(tt)*Math.sqrt(Math.abs(tt))}function radial(){var tt=continuous(),et=[0,1],nt=!1,rt;function it(ot){var at=unsquare(tt(ot));return isNaN(at)?rt:nt?Math.round(at):at}return it.invert=function(ot){return tt.invert(square(ot))},it.domain=function(ot){return arguments.length?(tt.domain(ot),it):tt.domain()},it.range=function(ot){return arguments.length?(tt.range((et=Array.from(ot,number$2)).map(square)),it):et.slice()},it.rangeRound=function(ot){return it.range(ot).round(!0)},it.round=function(ot){return arguments.length?(nt=!!ot,it):nt},it.clamp=function(ot){return arguments.length?(tt.clamp(ot),it):tt.clamp()},it.unknown=function(ot){return arguments.length?(rt=ot,it):rt},it.copy=function(){return radial(tt.domain(),et).round(nt).clamp(tt.clamp()).unknown(rt)},initRange.apply(it,arguments),linearish(it)}function quantile(){var tt=[],et=[],nt=[],rt;function it(){var at=0,st=Math.max(1,et.length);for(nt=new Array(st-1);++at0?nt[st-1]:tt[0],st=nt?[rt[nt-1],et]:[rt[ct-1],rt[ct]]},at.unknown=function(lt){return arguments.length&&(ot=lt),at},at.thresholds=function(){return rt.slice()},at.copy=function(){return quantize().domain([tt,et]).range(it).unknown(ot)},initRange.apply(linearish(at),arguments)}function threshold(){var tt=[.5],et=[0,1],nt,rt=1;function it(ot){return ot!=null&&ot<=ot?et[bisect(tt,ot,0,rt)]:nt}return it.domain=function(ot){return arguments.length?(tt=Array.from(ot),rt=Math.min(tt.length,et.length-1),it):tt.slice()},it.range=function(ot){return arguments.length?(et=Array.from(ot),rt=Math.min(tt.length,et.length-1),it):et.slice()},it.invertExtent=function(ot){var at=et.indexOf(ot);return[tt[at-1],tt[at]]},it.unknown=function(ot){return arguments.length?(nt=ot,it):nt},it.copy=function(){return threshold().domain(tt).range(et).unknown(nt)},initRange.apply(it,arguments)}const t0=new Date,t1=new Date;function timeInterval(tt,et,nt,rt){function it(ot){return tt(ot=arguments.length===0?new Date:new Date(+ot)),ot}return it.floor=ot=>(tt(ot=new Date(+ot)),ot),it.ceil=ot=>(tt(ot=new Date(ot-1)),et(ot,1),tt(ot),ot),it.round=ot=>{const at=it(ot),st=it.ceil(ot);return ot-at(et(ot=new Date(+ot),at==null?1:Math.floor(at)),ot),it.range=(ot,at,st)=>{const lt=[];if(ot=it.ceil(ot),st=st==null?1:Math.floor(st),!(ot0))return lt;let ct;do lt.push(ct=new Date(+ot)),et(ot,st),tt(ot);while(cttimeInterval(at=>{if(at>=at)for(;tt(at),!ot(at);)at.setTime(at-1)},(at,st)=>{if(at>=at)if(st<0)for(;++st<=0;)for(;et(at,-1),!ot(at););else for(;--st>=0;)for(;et(at,1),!ot(at););}),nt&&(it.count=(ot,at)=>(t0.setTime(+ot),t1.setTime(+at),tt(t0),tt(t1),Math.floor(nt(t0,t1))),it.every=ot=>(ot=Math.floor(ot),!isFinite(ot)||!(ot>0)?null:ot>1?it.filter(rt?at=>rt(at)%ot===0:at=>it.count(0,at)%ot===0):it)),it}const millisecond=timeInterval(()=>{},(tt,et)=>{tt.setTime(+tt+et)},(tt,et)=>et-tt);millisecond.every=tt=>(tt=Math.floor(tt),!isFinite(tt)||!(tt>0)?null:tt>1?timeInterval(et=>{et.setTime(Math.floor(et/tt)*tt)},(et,nt)=>{et.setTime(+et+nt*tt)},(et,nt)=>(nt-et)/tt):millisecond);millisecond.range;const durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,second=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds())},(tt,et)=>{tt.setTime(+tt+et*durationSecond)},(tt,et)=>(et-tt)/durationSecond,tt=>tt.getUTCSeconds());second.range;const timeMinute=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getMinutes());timeMinute.range;const utcMinute=timeInterval(tt=>{tt.setUTCSeconds(0,0)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getUTCMinutes());utcMinute.range;const timeHour=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond-tt.getMinutes()*durationMinute)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getHours());timeHour.range;const utcHour=timeInterval(tt=>{tt.setUTCMinutes(0,0,0)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getUTCHours());utcHour.range;const timeDay=timeInterval(tt=>tt.setHours(0,0,0,0),(tt,et)=>tt.setDate(tt.getDate()+et),(tt,et)=>(et-tt-(et.getTimezoneOffset()-tt.getTimezoneOffset())*durationMinute)/durationDay,tt=>tt.getDate()-1);timeDay.range;const utcDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>tt.getUTCDate()-1);utcDay.range;const unixDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>Math.floor(tt/durationDay));unixDay.range;function timeWeekday(tt){return timeInterval(et=>{et.setDate(et.getDate()-(et.getDay()+7-tt)%7),et.setHours(0,0,0,0)},(et,nt)=>{et.setDate(et.getDate()+nt*7)},(et,nt)=>(nt-et-(nt.getTimezoneOffset()-et.getTimezoneOffset())*durationMinute)/durationWeek)}const timeSunday=timeWeekday(0),timeMonday=timeWeekday(1),timeTuesday=timeWeekday(2),timeWednesday=timeWeekday(3),timeThursday=timeWeekday(4),timeFriday=timeWeekday(5),timeSaturday=timeWeekday(6);timeSunday.range;timeMonday.range;timeTuesday.range;timeWednesday.range;timeThursday.range;timeFriday.range;timeSaturday.range;function utcWeekday(tt){return timeInterval(et=>{et.setUTCDate(et.getUTCDate()-(et.getUTCDay()+7-tt)%7),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCDate(et.getUTCDate()+nt*7)},(et,nt)=>(nt-et)/durationWeek)}const utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6);utcSunday.range;utcMonday.range;utcTuesday.range;utcWednesday.range;utcThursday.range;utcFriday.range;utcSaturday.range;const timeMonth=timeInterval(tt=>{tt.setDate(1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setMonth(tt.getMonth()+et)},(tt,et)=>et.getMonth()-tt.getMonth()+(et.getFullYear()-tt.getFullYear())*12,tt=>tt.getMonth());timeMonth.range;const utcMonth=timeInterval(tt=>{tt.setUTCDate(1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCMonth(tt.getUTCMonth()+et)},(tt,et)=>et.getUTCMonth()-tt.getUTCMonth()+(et.getUTCFullYear()-tt.getUTCFullYear())*12,tt=>tt.getUTCMonth());utcMonth.range;const timeYear=timeInterval(tt=>{tt.setMonth(0,1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setFullYear(tt.getFullYear()+et)},(tt,et)=>et.getFullYear()-tt.getFullYear(),tt=>tt.getFullYear());timeYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setFullYear(Math.floor(et.getFullYear()/tt)*tt),et.setMonth(0,1),et.setHours(0,0,0,0)},(et,nt)=>{et.setFullYear(et.getFullYear()+nt*tt)});timeYear.range;const utcYear=timeInterval(tt=>{tt.setUTCMonth(0,1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCFullYear(tt.getUTCFullYear()+et)},(tt,et)=>et.getUTCFullYear()-tt.getUTCFullYear(),tt=>tt.getUTCFullYear());utcYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setUTCFullYear(Math.floor(et.getUTCFullYear()/tt)*tt),et.setUTCMonth(0,1),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCFullYear(et.getUTCFullYear()+nt*tt)});utcYear.range;function ticker(tt,et,nt,rt,it,ot){const at=[[second,1,durationSecond],[second,5,5*durationSecond],[second,15,15*durationSecond],[second,30,30*durationSecond],[ot,1,durationMinute],[ot,5,5*durationMinute],[ot,15,15*durationMinute],[ot,30,30*durationMinute],[it,1,durationHour],[it,3,3*durationHour],[it,6,6*durationHour],[it,12,12*durationHour],[rt,1,durationDay],[rt,2,2*durationDay],[nt,1,durationWeek],[et,1,durationMonth],[et,3,3*durationMonth],[tt,1,durationYear]];function st(ct,ut,ht){const dt=utyt).right(at,dt);if(pt===at.length)return tt.every(tickStep(ct/durationYear,ut/durationYear,ht));if(pt===0)return millisecond.every(Math.max(tickStep(ct,ut,ht),1));const[mt,gt]=at[dt/at[pt-1][2]53)return null;"w"in Zt||(Zt.w=1),"Z"in Zt?(Cn=utcDate(newDate(Zt.y,0,1)),$n=Cn.getUTCDay(),Cn=$n>4||$n===0?utcMonday.ceil(Cn):utcMonday(Cn),Cn=utcDay.offset(Cn,(Zt.V-1)*7),Zt.y=Cn.getUTCFullYear(),Zt.m=Cn.getUTCMonth(),Zt.d=Cn.getUTCDate()+(Zt.w+6)%7):(Cn=localDate(newDate(Zt.y,0,1)),$n=Cn.getDay(),Cn=$n>4||$n===0?timeMonday.ceil(Cn):timeMonday(Cn),Cn=timeDay.offset(Cn,(Zt.V-1)*7),Zt.y=Cn.getFullYear(),Zt.m=Cn.getMonth(),Zt.d=Cn.getDate()+(Zt.w+6)%7)}else("W"in Zt||"U"in Zt)&&("w"in Zt||(Zt.w="u"in Zt?Zt.u%7:"W"in Zt?1:0),$n="Z"in Zt?utcDate(newDate(Zt.y,0,1)).getUTCDay():localDate(newDate(Zt.y,0,1)).getDay(),Zt.m=0,Zt.d="W"in Zt?(Zt.w+6)%7+Zt.W*7-($n+5)%7:Zt.w+Zt.U*7-($n+6)%7);return"Z"in Zt?(Zt.H+=Zt.Z/100|0,Zt.M+=Zt.Z%100,utcDate(Zt)):localDate(Zt)}}function Et(dn,wn,rn,Zt){for(var vn=0,Cn=wn.length,$n=rn.length,Nn,En;vn=$n)return-1;if(Nn=wn.charCodeAt(vn++),Nn===37){if(Nn=wn.charAt(vn++),En=St[Nn in pads?wn.charAt(vn++):Nn],!En||(Zt=En(dn,rn,Zt))<0)return-1}else if(Nn!=rn.charCodeAt(Zt++))return-1}return Zt}function Ct(dn,wn,rn){var Zt=ct.exec(wn.slice(rn));return Zt?(dn.p=ut.get(Zt[0].toLowerCase()),rn+Zt[0].length):-1}function Lt(dn,wn,rn){var Zt=pt.exec(wn.slice(rn));return Zt?(dn.w=mt.get(Zt[0].toLowerCase()),rn+Zt[0].length):-1}function jt(dn,wn,rn){var Zt=ht.exec(wn.slice(rn));return Zt?(dn.w=dt.get(Zt[0].toLowerCase()),rn+Zt[0].length):-1}function Rt(dn,wn,rn){var Zt=bt.exec(wn.slice(rn));return Zt?(dn.m=wt.get(Zt[0].toLowerCase()),rn+Zt[0].length):-1}function $t(dn,wn,rn){var Zt=gt.exec(wn.slice(rn));return Zt?(dn.m=yt.get(Zt[0].toLowerCase()),rn+Zt[0].length):-1}function vt(dn,wn,rn){return Et(dn,et,wn,rn)}function It(dn,wn,rn){return Et(dn,nt,wn,rn)}function Ot(dn,wn,rn){return Et(dn,rt,wn,rn)}function Wt(dn){return at[dn.getDay()]}function zt(dn){return ot[dn.getDay()]}function Ft(dn){return lt[dn.getMonth()]}function Nt(dn){return st[dn.getMonth()]}function Ut(dn){return it[+(dn.getHours()>=12)]}function Pt(dn){return 1+~~(dn.getMonth()/3)}function Ht(dn){return at[dn.getUTCDay()]}function Qt(dn){return ot[dn.getUTCDay()]}function an(dn){return lt[dn.getUTCMonth()]}function Yt(dn){return st[dn.getUTCMonth()]}function nn(dn){return it[+(dn.getUTCHours()>=12)]}function tn(dn){return 1+~~(dn.getUTCMonth()/3)}return{format:function(dn){var wn=Tt(dn+="",xt);return wn.toString=function(){return dn},wn},parse:function(dn){var wn=At(dn+="",!1);return wn.toString=function(){return dn},wn},utcFormat:function(dn){var wn=Tt(dn+="",kt);return wn.toString=function(){return dn},wn},utcParse:function(dn){var wn=At(dn+="",!0);return wn.toString=function(){return dn},wn}}}var pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function pad(tt,et,nt){var rt=tt<0?"-":"",it=(rt?-tt:tt)+"",ot=it.length;return rt+(ot[et.toLowerCase(),nt]))}function parseWeekdayNumberSunday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+1));return rt?(tt.w=+rt[0],nt+rt[0].length):-1}function parseWeekdayNumberMonday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+1));return rt?(tt.u=+rt[0],nt+rt[0].length):-1}function parseWeekNumberSunday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.U=+rt[0],nt+rt[0].length):-1}function parseWeekNumberISO(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.V=+rt[0],nt+rt[0].length):-1}function parseWeekNumberMonday(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.W=+rt[0],nt+rt[0].length):-1}function parseFullYear(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+4));return rt?(tt.y=+rt[0],nt+rt[0].length):-1}function parseYear(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.y=+rt[0]+(+rt[0]>68?1900:2e3),nt+rt[0].length):-1}function parseZone(tt,et,nt){var rt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(et.slice(nt,nt+6));return rt?(tt.Z=rt[1]?0:-(rt[2]+(rt[3]||"00")),nt+rt[0].length):-1}function parseQuarter(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+1));return rt?(tt.q=rt[0]*3-3,nt+rt[0].length):-1}function parseMonthNumber(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.m=rt[0]-1,nt+rt[0].length):-1}function parseDayOfMonth(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.d=+rt[0],nt+rt[0].length):-1}function parseDayOfYear(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+3));return rt?(tt.m=0,tt.d=+rt[0],nt+rt[0].length):-1}function parseHour24(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.H=+rt[0],nt+rt[0].length):-1}function parseMinutes(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.M=+rt[0],nt+rt[0].length):-1}function parseSeconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+2));return rt?(tt.S=+rt[0],nt+rt[0].length):-1}function parseMilliseconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+3));return rt?(tt.L=+rt[0],nt+rt[0].length):-1}function parseMicroseconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt,nt+6));return rt?(tt.L=Math.floor(rt[0]/1e3),nt+rt[0].length):-1}function parseLiteralPercent(tt,et,nt){var rt=percentRe.exec(et.slice(nt,nt+1));return rt?nt+rt[0].length:-1}function parseUnixTimestamp(tt,et,nt){var rt=numberRe.exec(et.slice(nt));return rt?(tt.Q=+rt[0],nt+rt[0].length):-1}function parseUnixTimestampSeconds(tt,et,nt){var rt=numberRe.exec(et.slice(nt));return rt?(tt.s=+rt[0],nt+rt[0].length):-1}function formatDayOfMonth(tt,et){return pad(tt.getDate(),et,2)}function formatHour24(tt,et){return pad(tt.getHours(),et,2)}function formatHour12(tt,et){return pad(tt.getHours()%12||12,et,2)}function formatDayOfYear(tt,et){return pad(1+timeDay.count(timeYear(tt),tt),et,3)}function formatMilliseconds(tt,et){return pad(tt.getMilliseconds(),et,3)}function formatMicroseconds(tt,et){return formatMilliseconds(tt,et)+"000"}function formatMonthNumber(tt,et){return pad(tt.getMonth()+1,et,2)}function formatMinutes(tt,et){return pad(tt.getMinutes(),et,2)}function formatSeconds(tt,et){return pad(tt.getSeconds(),et,2)}function formatWeekdayNumberMonday(tt){var et=tt.getDay();return et===0?7:et}function formatWeekNumberSunday(tt,et){return pad(timeSunday.count(timeYear(tt)-1,tt),et,2)}function dISO(tt){var et=tt.getDay();return et>=4||et===0?timeThursday(tt):timeThursday.ceil(tt)}function formatWeekNumberISO(tt,et){return tt=dISO(tt),pad(timeThursday.count(timeYear(tt),tt)+(timeYear(tt).getDay()===4),et,2)}function formatWeekdayNumberSunday(tt){return tt.getDay()}function formatWeekNumberMonday(tt,et){return pad(timeMonday.count(timeYear(tt)-1,tt),et,2)}function formatYear(tt,et){return pad(tt.getFullYear()%100,et,2)}function formatYearISO(tt,et){return tt=dISO(tt),pad(tt.getFullYear()%100,et,2)}function formatFullYear(tt,et){return pad(tt.getFullYear()%1e4,et,4)}function formatFullYearISO(tt,et){var nt=tt.getDay();return tt=nt>=4||nt===0?timeThursday(tt):timeThursday.ceil(tt),pad(tt.getFullYear()%1e4,et,4)}function formatZone(tt){var et=tt.getTimezoneOffset();return(et>0?"-":(et*=-1,"+"))+pad(et/60|0,"0",2)+pad(et%60,"0",2)}function formatUTCDayOfMonth(tt,et){return pad(tt.getUTCDate(),et,2)}function formatUTCHour24(tt,et){return pad(tt.getUTCHours(),et,2)}function formatUTCHour12(tt,et){return pad(tt.getUTCHours()%12||12,et,2)}function formatUTCDayOfYear(tt,et){return pad(1+utcDay.count(utcYear(tt),tt),et,3)}function formatUTCMilliseconds(tt,et){return pad(tt.getUTCMilliseconds(),et,3)}function formatUTCMicroseconds(tt,et){return formatUTCMilliseconds(tt,et)+"000"}function formatUTCMonthNumber(tt,et){return pad(tt.getUTCMonth()+1,et,2)}function formatUTCMinutes(tt,et){return pad(tt.getUTCMinutes(),et,2)}function formatUTCSeconds(tt,et){return pad(tt.getUTCSeconds(),et,2)}function formatUTCWeekdayNumberMonday(tt){var et=tt.getUTCDay();return et===0?7:et}function formatUTCWeekNumberSunday(tt,et){return pad(utcSunday.count(utcYear(tt)-1,tt),et,2)}function UTCdISO(tt){var et=tt.getUTCDay();return et>=4||et===0?utcThursday(tt):utcThursday.ceil(tt)}function formatUTCWeekNumberISO(tt,et){return tt=UTCdISO(tt),pad(utcThursday.count(utcYear(tt),tt)+(utcYear(tt).getUTCDay()===4),et,2)}function formatUTCWeekdayNumberSunday(tt){return tt.getUTCDay()}function formatUTCWeekNumberMonday(tt,et){return pad(utcMonday.count(utcYear(tt)-1,tt),et,2)}function formatUTCYear(tt,et){return pad(tt.getUTCFullYear()%100,et,2)}function formatUTCYearISO(tt,et){return tt=UTCdISO(tt),pad(tt.getUTCFullYear()%100,et,2)}function formatUTCFullYear(tt,et){return pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCFullYearISO(tt,et){var nt=tt.getUTCDay();return tt=nt>=4||nt===0?utcThursday(tt):utcThursday.ceil(tt),pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(tt){return+tt}function formatUnixTimestampSeconds(tt){return Math.floor(+tt/1e3)}var locale,timeFormat,utcFormat;defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function defaultLocale(tt){return locale=formatLocale(tt),timeFormat=locale.format,locale.parse,utcFormat=locale.utcFormat,locale.utcParse,locale}function date(tt){return new Date(tt)}function number$1(tt){return tt instanceof Date?+tt:+new Date(+tt)}function calendar(tt,et,nt,rt,it,ot,at,st,lt,ct){var ut=continuous(),ht=ut.invert,dt=ut.domain,pt=ct(".%L"),mt=ct(":%S"),gt=ct("%I:%M"),yt=ct("%I %p"),bt=ct("%a %d"),wt=ct("%b %d"),xt=ct("%B"),kt=ct("%Y");function St(Tt){return(lt(Tt)et(it/(tt.length-1)))},nt.quantiles=function(rt){return Array.from({length:rt+1},(it,ot)=>quantile$1(tt,ot/rt))},nt.copy=function(){return sequentialQuantile(et).domain(tt)},initInterpolator.apply(nt,arguments)}function transformer(){var tt=0,et=.5,nt=1,rt=1,it,ot,at,st,lt,ct=identity$4,ut,ht=!1,dt;function pt(gt){return isNaN(gt=+gt)?dt:(gt=.5+((gt=+ut(gt))-ot)*(rt*gttt.e^ot.s<0?1:-1;for(rt=ot.d.length,it=tt.d.length,et=0,nt=rttt.d[et]^ot.s<0?1:-1;return rt===it?0:rt>it^ot.s<0?1:-1};P.decimalPlaces=P.dp=function(){var tt=this,et=tt.d.length-1,nt=(et-tt.e)*LOG_BASE;if(et=tt.d[et],et)for(;et%10==0;et/=10)nt--;return nt<0?0:nt};P.dividedBy=P.div=function(tt){return divide(this,new this.constructor(tt))};P.dividedToIntegerBy=P.idiv=function(tt){var et=this,nt=et.constructor;return round(divide(et,new nt(tt),0,1),nt.precision)};P.equals=P.eq=function(tt){return!this.cmp(tt)};P.exponent=function(){return getBase10Exponent(this)};P.greaterThan=P.gt=function(tt){return this.cmp(tt)>0};P.greaterThanOrEqualTo=P.gte=function(tt){return this.cmp(tt)>=0};P.isInteger=P.isint=function(){return this.e>this.d.length-2};P.isNegative=P.isneg=function(){return this.s<0};P.isPositive=P.ispos=function(){return this.s>0};P.isZero=function(){return this.s===0};P.lessThan=P.lt=function(tt){return this.cmp(tt)<0};P.lessThanOrEqualTo=P.lte=function(tt){return this.cmp(tt)<1};P.logarithm=P.log=function(tt){var et,nt=this,rt=nt.constructor,it=rt.precision,ot=it+5;if(tt===void 0)tt=new rt(10);else if(tt=new rt(tt),tt.s<1||tt.eq(ONE))throw Error(decimalError+"NaN");if(nt.s<1)throw Error(decimalError+(nt.s?"NaN":"-Infinity"));return nt.eq(ONE)?new rt(0):(external=!1,et=divide(ln(nt,ot),ln(tt,ot),ot),external=!0,round(et,it))};P.minus=P.sub=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?subtract(et,tt):add(et,(tt.s=-tt.s,tt))};P.modulo=P.mod=function(tt){var et,nt=this,rt=nt.constructor,it=rt.precision;if(tt=new rt(tt),!tt.s)throw Error(decimalError+"NaN");return nt.s?(external=!1,et=divide(nt,tt,0,1).times(tt),external=!0,nt.minus(et)):round(new rt(nt),it)};P.naturalExponential=P.exp=function(){return exp(this)};P.naturalLogarithm=P.ln=function(){return ln(this)};P.negated=P.neg=function(){var tt=new this.constructor(this);return tt.s=-tt.s||0,tt};P.plus=P.add=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?add(et,tt):subtract(et,(tt.s=-tt.s,tt))};P.precision=P.sd=function(tt){var et,nt,rt,it=this;if(tt!==void 0&&tt!==!!tt&&tt!==1&&tt!==0)throw Error(invalidArgument+tt);if(et=getBase10Exponent(it)+1,rt=it.d.length-1,nt=rt*LOG_BASE+1,rt=it.d[rt],rt){for(;rt%10==0;rt/=10)nt--;for(rt=it.d[0];rt>=10;rt/=10)nt++}return tt&&et>nt?et:nt};P.squareRoot=P.sqrt=function(){var tt,et,nt,rt,it,ot,at,st=this,lt=st.constructor;if(st.s<1){if(!st.s)return new lt(0);throw Error(decimalError+"NaN")}for(tt=getBase10Exponent(st),external=!1,it=Math.sqrt(+st),it==0||it==1/0?(et=digitsToString(st.d),(et.length+tt)%2==0&&(et+="0"),it=Math.sqrt(et),tt=mathfloor((tt+1)/2)-(tt<0||tt%2),it==1/0?et="5e"+tt:(et=it.toExponential(),et=et.slice(0,et.indexOf("e")+1)+tt),rt=new lt(et)):rt=new lt(it.toString()),nt=lt.precision,it=at=nt+3;;)if(ot=rt,rt=ot.plus(divide(st,ot,at+2)).times(.5),digitsToString(ot.d).slice(0,at)===(et=digitsToString(rt.d)).slice(0,at)){if(et=et.slice(at-3,at+1),it==at&&et=="4999"){if(round(ot,nt+1,0),ot.times(ot).eq(st)){rt=ot;break}}else if(et!="9999")break;at+=4}return external=!0,round(rt,nt)};P.times=P.mul=function(tt){var et,nt,rt,it,ot,at,st,lt,ct,ut=this,ht=ut.constructor,dt=ut.d,pt=(tt=new ht(tt)).d;if(!ut.s||!tt.s)return new ht(0);for(tt.s*=ut.s,nt=ut.e+tt.e,lt=dt.length,ct=pt.length,lt=0;){for(et=0,it=lt+rt;it>rt;)st=ot[it]+pt[rt]*dt[it-rt-1]+et,ot[it--]=st%BASE|0,et=st/BASE|0;ot[it]=(ot[it]+et)%BASE|0}for(;!ot[--at];)ot.pop();return et?++nt:ot.shift(),tt.d=ot,tt.e=nt,external?round(tt,ht.precision):tt};P.toDecimalPlaces=P.todp=function(tt,et){var nt=this,rt=nt.constructor;return nt=new rt(nt),tt===void 0?nt:(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=rt.rounding:checkInt32(et,0,8),round(nt,tt+getBase10Exponent(nt)+1,et))};P.toExponential=function(tt,et){var nt,rt=this,it=rt.constructor;return tt===void 0?nt=toString(rt,!0):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=it.rounding:checkInt32(et,0,8),rt=round(new it(rt),tt+1,et),nt=toString(rt,!0,tt+1)),nt};P.toFixed=function(tt,et){var nt,rt,it=this,ot=it.constructor;return tt===void 0?toString(it):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),rt=round(new ot(it),tt+getBase10Exponent(it)+1,et),nt=toString(rt.abs(),!1,tt+getBase10Exponent(rt)+1),it.isneg()&&!it.isZero()?"-"+nt:nt)};P.toInteger=P.toint=function(){var tt=this,et=tt.constructor;return round(new et(tt),getBase10Exponent(tt)+1,et.rounding)};P.toNumber=function(){return+this};P.toPower=P.pow=function(tt){var et,nt,rt,it,ot,at,st=this,lt=st.constructor,ct=12,ut=+(tt=new lt(tt));if(!tt.s)return new lt(ONE);if(st=new lt(st),!st.s){if(tt.s<1)throw Error(decimalError+"Infinity");return st}if(st.eq(ONE))return st;if(rt=lt.precision,tt.eq(ONE))return round(st,rt);if(et=tt.e,nt=tt.d.length-1,at=et>=nt,ot=st.s,at){if((nt=ut<0?-ut:ut)<=MAX_SAFE_INTEGER){for(it=new lt(ONE),et=Math.ceil(rt/LOG_BASE+4),external=!1;nt%2&&(it=it.times(st),truncate(it.d,et)),nt=mathfloor(nt/2),nt!==0;)st=st.times(st),truncate(st.d,et);return external=!0,tt.s<0?new lt(ONE).div(it):round(it,rt)}}else if(ot<0)throw Error(decimalError+"NaN");return ot=ot<0&&tt.d[Math.max(et,nt)]&1?-1:1,st.s=1,external=!1,it=tt.times(ln(st,rt+ct)),external=!0,it=exp(it),it.s=ot,it};P.toPrecision=function(tt,et){var nt,rt,it=this,ot=it.constructor;return tt===void 0?(nt=getBase10Exponent(it),rt=toString(it,nt<=ot.toExpNeg||nt>=ot.toExpPos)):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),it=round(new ot(it),tt,et),nt=getBase10Exponent(it),rt=toString(it,tt<=nt||nt<=ot.toExpNeg,tt)),rt};P.toSignificantDigits=P.tosd=function(tt,et){var nt=this,rt=nt.constructor;return tt===void 0?(tt=rt.precision,et=rt.rounding):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=rt.rounding:checkInt32(et,0,8)),round(new rt(nt),tt,et)};P.toString=P.valueOf=P.val=P.toJSON=P[Symbol.for("nodejs.util.inspect.custom")]=function(){var tt=this,et=getBase10Exponent(tt),nt=tt.constructor;return toString(tt,et<=nt.toExpNeg||et>=nt.toExpPos)};function add(tt,et){var nt,rt,it,ot,at,st,lt,ct,ut=tt.constructor,ht=ut.precision;if(!tt.s||!et.s)return et.s||(et=new ut(tt)),external?round(et,ht):et;if(lt=tt.d,ct=et.d,at=tt.e,it=et.e,lt=lt.slice(),ot=at-it,ot){for(ot<0?(rt=lt,ot=-ot,st=ct.length):(rt=ct,it=at,st=lt.length),at=Math.ceil(ht/LOG_BASE),st=at>st?at+1:st+1,ot>st&&(ot=st,rt.length=1),rt.reverse();ot--;)rt.push(0);rt.reverse()}for(st=lt.length,ot=ct.length,st-ot<0&&(ot=st,rt=ct,ct=lt,lt=rt),nt=0;ot;)nt=(lt[--ot]=lt[ot]+ct[ot]+nt)/BASE|0,lt[ot]%=BASE;for(nt&&(lt.unshift(nt),++it),st=lt.length;lt[--st]==0;)lt.pop();return et.d=lt,et.e=it,external?round(et,ht):et}function checkInt32(tt,et,nt){if(tt!==~~tt||ttnt)throw Error(invalidArgument+tt)}function digitsToString(tt){var et,nt,rt,it=tt.length-1,ot="",at=tt[0];if(it>0){for(ot+=at,et=1;etat?1:-1;else for(st=lt=0;stit[st]?1:-1;break}return lt}function nt(rt,it,ot){for(var at=0;ot--;)rt[ot]-=at,at=rt[ot]1;)rt.shift()}return function(rt,it,ot,at){var st,lt,ct,ut,ht,dt,pt,mt,gt,yt,bt,wt,xt,kt,St,Tt,At,Et,Ct=rt.constructor,Lt=rt.s==it.s?1:-1,jt=rt.d,Rt=it.d;if(!rt.s)return new Ct(rt);if(!it.s)throw Error(decimalError+"Division by zero");for(lt=rt.e-it.e,At=Rt.length,St=jt.length,pt=new Ct(Lt),mt=pt.d=[],ct=0;Rt[ct]==(jt[ct]||0);)++ct;if(Rt[ct]>(jt[ct]||0)&&--lt,ot==null?wt=ot=Ct.precision:at?wt=ot+(getBase10Exponent(rt)-getBase10Exponent(it))+1:wt=ot,wt<0)return new Ct(0);if(wt=wt/LOG_BASE+2|0,ct=0,At==1)for(ut=0,Rt=Rt[0],wt++;(ct1&&(Rt=tt(Rt,ut),jt=tt(jt,ut),At=Rt.length,St=jt.length),kt=At,gt=jt.slice(0,At),yt=gt.length;yt=BASE/2&&++Tt;do ut=0,st=et(Rt,gt,At,yt),st<0?(bt=gt[0],At!=yt&&(bt=bt*BASE+(gt[1]||0)),ut=bt/Tt|0,ut>1?(ut>=BASE&&(ut=BASE-1),ht=tt(Rt,ut),dt=ht.length,yt=gt.length,st=et(ht,gt,dt,yt),st==1&&(ut--,nt(ht,At16)throw Error(exponentOutOfRange+getBase10Exponent(tt));if(!tt.s)return new ut(ONE);for(et==null?(external=!1,st=ht):st=et,at=new ut(.03125);tt.abs().gte(.1);)tt=tt.times(at),ct+=5;for(rt=Math.log(mathpow(2,ct))/Math.LN10*2+5|0,st+=rt,nt=it=ot=new ut(ONE),ut.precision=st;;){if(it=round(it.times(tt),st),nt=nt.times(++lt),at=ot.plus(divide(it,nt,st)),digitsToString(at.d).slice(0,st)===digitsToString(ot.d).slice(0,st)){for(;ct--;)ot=round(ot.times(ot),st);return ut.precision=ht,et==null?(external=!0,round(ot,ht)):ot}ot=at}}function getBase10Exponent(tt){for(var et=tt.e*LOG_BASE,nt=tt.d[0];nt>=10;nt/=10)et++;return et}function getLn10(tt,et,nt){if(et>tt.LN10.sd())throw external=!0,nt&&(tt.precision=nt),Error(decimalError+"LN10 precision limit exceeded");return round(new tt(tt.LN10),et)}function getZeroString(tt){for(var et="";tt--;)et+="0";return et}function ln(tt,et){var nt,rt,it,ot,at,st,lt,ct,ut,ht=1,dt=10,pt=tt,mt=pt.d,gt=pt.constructor,yt=gt.precision;if(pt.s<1)throw Error(decimalError+(pt.s?"NaN":"-Infinity"));if(pt.eq(ONE))return new gt(0);if(et==null?(external=!1,ct=yt):ct=et,pt.eq(10))return et==null&&(external=!0),getLn10(gt,ct);if(ct+=dt,gt.precision=ct,nt=digitsToString(mt),rt=nt.charAt(0),ot=getBase10Exponent(pt),Math.abs(ot)<15e14){for(;rt<7&&rt!=1||rt==1&&nt.charAt(1)>3;)pt=pt.times(tt),nt=digitsToString(pt.d),rt=nt.charAt(0),ht++;ot=getBase10Exponent(pt),rt>1?(pt=new gt("0."+nt),ot++):pt=new gt(rt+"."+nt.slice(1))}else return lt=getLn10(gt,ct+2,yt).times(ot+""),pt=ln(new gt(rt+"."+nt.slice(1)),ct-dt).plus(lt),gt.precision=yt,et==null?(external=!0,round(pt,yt)):pt;for(st=at=pt=divide(pt.minus(ONE),pt.plus(ONE),ct),ut=round(pt.times(pt),ct),it=3;;){if(at=round(at.times(ut),ct),lt=st.plus(divide(at,new gt(it),ct)),digitsToString(lt.d).slice(0,ct)===digitsToString(st.d).slice(0,ct))return st=st.times(2),ot!==0&&(st=st.plus(getLn10(gt,ct+2,yt).times(ot+""))),st=divide(st,new gt(ht),ct),gt.precision=yt,et==null?(external=!0,round(st,yt)):st;st=lt,it+=2}}function parseDecimal(tt,et){var nt,rt,it;for((nt=et.indexOf("."))>-1&&(et=et.replace(".","")),(rt=et.search(/e/i))>0?(nt<0&&(nt=rt),nt+=+et.slice(rt+1),et=et.substring(0,rt)):nt<0&&(nt=et.length),rt=0;et.charCodeAt(rt)===48;)++rt;for(it=et.length;et.charCodeAt(it-1)===48;)--it;if(et=et.slice(rt,it),et){if(it-=rt,nt=nt-rt-1,tt.e=mathfloor(nt/LOG_BASE),tt.d=[],rt=(nt+1)%LOG_BASE,nt<0&&(rt+=LOG_BASE),rtMAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+nt)}else tt.s=0,tt.e=0,tt.d=[0];return tt}function round(tt,et,nt){var rt,it,ot,at,st,lt,ct,ut,ht=tt.d;for(at=1,ot=ht[0];ot>=10;ot/=10)at++;if(rt=et-at,rt<0)rt+=LOG_BASE,it=et,ct=ht[ut=0];else{if(ut=Math.ceil((rt+1)/LOG_BASE),ot=ht.length,ut>=ot)return tt;for(ct=ot=ht[ut],at=1;ot>=10;ot/=10)at++;rt%=LOG_BASE,it=rt-LOG_BASE+at}if(nt!==void 0&&(ot=mathpow(10,at-it-1),st=ct/ot%10|0,lt=et<0||ht[ut+1]!==void 0||ct%ot,lt=nt<4?(st||lt)&&(nt==0||nt==(tt.s<0?3:2)):st>5||st==5&&(nt==4||lt||nt==6&&(rt>0?it>0?ct/mathpow(10,at-it):0:ht[ut-1])%10&1||nt==(tt.s<0?8:7))),et<1||!ht[0])return lt?(ot=getBase10Exponent(tt),ht.length=1,et=et-ot-1,ht[0]=mathpow(10,(LOG_BASE-et%LOG_BASE)%LOG_BASE),tt.e=mathfloor(-et/LOG_BASE)||0):(ht.length=1,ht[0]=tt.e=tt.s=0),tt;if(rt==0?(ht.length=ut,ot=1,ut--):(ht.length=ut+1,ot=mathpow(10,LOG_BASE-rt),ht[ut]=it>0?(ct/mathpow(10,at-it)%mathpow(10,it)|0)*ot:0),lt)for(;;)if(ut==0){(ht[0]+=ot)==BASE&&(ht[0]=1,++tt.e);break}else{if(ht[ut]+=ot,ht[ut]!=BASE)break;ht[ut--]=0,ot=1}for(rt=ht.length;ht[--rt]===0;)ht.pop();if(external&&(tt.e>MAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+getBase10Exponent(tt));return tt}function subtract(tt,et){var nt,rt,it,ot,at,st,lt,ct,ut,ht,dt=tt.constructor,pt=dt.precision;if(!tt.s||!et.s)return et.s?et.s=-et.s:et=new dt(tt),external?round(et,pt):et;if(lt=tt.d,ht=et.d,rt=et.e,ct=tt.e,lt=lt.slice(),at=ct-rt,at){for(ut=at<0,ut?(nt=lt,at=-at,st=ht.length):(nt=ht,rt=ct,st=lt.length),it=Math.max(Math.ceil(pt/LOG_BASE),st)+2,at>it&&(at=it,nt.length=1),nt.reverse(),it=at;it--;)nt.push(0);nt.reverse()}else{for(it=lt.length,st=ht.length,ut=it0;--it)lt[st++]=0;for(it=ht.length;it>at;){if(lt[--it]0?ot=ot.charAt(0)+"."+ot.slice(1)+getZeroString(rt):at>1&&(ot=ot.charAt(0)+"."+ot.slice(1)),ot=ot+(it<0?"e":"e+")+it):it<0?(ot="0."+getZeroString(-it-1)+ot,nt&&(rt=nt-at)>0&&(ot+=getZeroString(rt))):it>=at?(ot+=getZeroString(it+1-at),nt&&(rt=nt-it-1)>0&&(ot=ot+"."+getZeroString(rt))):((rt=it+1)0&&(it+1===at&&(ot+="."),ot+=getZeroString(rt))),tt.s<0?"-"+ot:ot}function truncate(tt,et){if(tt.length>et)return tt.length=et,!0}function clone(tt){var et,nt,rt;function it(ot){var at=this;if(!(at instanceof it))return new it(ot);if(at.constructor=it,ot instanceof it){at.s=ot.s,at.e=ot.e,at.d=(ot=ot.d)?ot.slice():ot;return}if(typeof ot=="number"){if(ot*0!==0)throw Error(invalidArgument+ot);if(ot>0)at.s=1;else if(ot<0)ot=-ot,at.s=-1;else{at.s=0,at.e=0,at.d=[0];return}if(ot===~~ot&&ot<1e7){at.e=0,at.d=[ot];return}return parseDecimal(at,ot.toString())}else if(typeof ot!="string")throw Error(invalidArgument+ot);if(ot.charCodeAt(0)===45?(ot=ot.slice(1),at.s=-1):at.s=1,isDecimal.test(ot))parseDecimal(at,ot);else throw Error(invalidArgument+ot)}if(it.prototype=P,it.ROUND_UP=0,it.ROUND_DOWN=1,it.ROUND_CEIL=2,it.ROUND_FLOOR=3,it.ROUND_HALF_UP=4,it.ROUND_HALF_DOWN=5,it.ROUND_HALF_EVEN=6,it.ROUND_HALF_CEIL=7,it.ROUND_HALF_FLOOR=8,it.clone=clone,it.config=it.set=config,tt===void 0&&(tt={}),tt)for(rt=["precision","rounding","toExpNeg","toExpPos","LN10"],et=0;et=it[et+1]&&rt<=it[et+2])this[nt]=rt;else throw Error(invalidArgument+nt+": "+rt);if((rt=tt[nt="LN10"])!==void 0)if(rt==Math.LN10)this[nt]=new this(rt);else throw Error(invalidArgument+nt+": "+rt);return this}var Decimal=clone(defaults);ONE=new Decimal(1);const Decimal$1=Decimal;function _toConsumableArray$8(tt){return _arrayWithoutHoles$8(tt)||_iterableToArray$8(tt)||_unsupportedIterableToArray$e(tt)||_nonIterableSpread$8()}function _nonIterableSpread$8(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$e(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$e(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$e(tt,et)}}function _iterableToArray$8(tt){if(typeof Symbol<"u"&&Symbol.iterator in Object(tt))return Array.from(tt)}function _arrayWithoutHoles$8(tt){if(Array.isArray(tt))return _arrayLikeToArray$e(tt)}function _arrayLikeToArray$e(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt=et?nt.apply(void 0,it):tt(et-at,curry0(function(){for(var st=arguments.length,lt=new Array(st),ct=0;cttt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt"u"||!(Symbol.iterator in Object(tt)))){var nt=[],rt=!0,it=!1,ot=void 0;try{for(var at=tt[Symbol.iterator](),st;!(rt=(st=at.next()).done)&&(nt.push(st.value),!(et&&nt.length===et));rt=!0);}catch(lt){it=!0,ot=lt}finally{try{!rt&&at.return!=null&&at.return()}finally{if(it)throw ot}}return nt}}function _arrayWithHoles$6(tt){if(Array.isArray(tt))return tt}function getValidInterval(tt){var et=_slicedToArray$6(tt,2),nt=et[0],rt=et[1],it=nt,ot=rt;return nt>rt&&(it=rt,ot=nt),[it,ot]}function getFormatStep(tt,et,nt){if(tt.lte(0))return new Decimal$1(0);var rt=Arithmetic.getDigitCount(tt.toNumber()),it=new Decimal$1(10).pow(rt),ot=tt.div(it),at=rt!==1?.05:.1,st=new Decimal$1(Math.ceil(ot.div(at).toNumber())).add(nt).mul(at),lt=st.mul(it);return et?lt:new Decimal$1(Math.ceil(lt))}function getTickOfSingleValue(tt,et,nt){var rt=1,it=new Decimal$1(tt);if(!it.isint()&&nt){var ot=Math.abs(tt);ot<1?(rt=new Decimal$1(10).pow(Arithmetic.getDigitCount(tt)-1),it=new Decimal$1(Math.floor(it.div(rt).toNumber())).mul(rt)):ot>1&&(it=new Decimal$1(Math.floor(tt)))}else tt===0?it=new Decimal$1(Math.floor((et-1)/2)):nt||(it=new Decimal$1(Math.floor(tt)));var at=Math.floor((et-1)/2),st=compose(map(function(lt){return it.add(new Decimal$1(lt-at).mul(rt)).toNumber()}),range$1);return st(0,et)}function calculateStep(tt,et,nt,rt){var it=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((et-tt)/(nt-1)))return{step:new Decimal$1(0),tickMin:new Decimal$1(0),tickMax:new Decimal$1(0)};var ot=getFormatStep(new Decimal$1(et).sub(tt).div(nt-1),rt,it),at;tt<=0&&et>=0?at=new Decimal$1(0):(at=new Decimal$1(tt).add(et).div(2),at=at.sub(new Decimal$1(at).mod(ot)));var st=Math.ceil(at.sub(tt).div(ot).toNumber()),lt=Math.ceil(new Decimal$1(et).sub(at).div(ot).toNumber()),ct=st+lt+1;return ct>nt?calculateStep(tt,et,nt,rt,it+1):(ct0?lt+(nt-ct):lt,st=et>0?st:st+(nt-ct)),{step:ot,tickMin:at.sub(new Decimal$1(st).mul(ot)),tickMax:at.add(new Decimal$1(lt).mul(ot))})}function getNiceTickValuesFn(tt){var et=_slicedToArray$6(tt,2),nt=et[0],rt=et[1],it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,at=Math.max(it,2),st=getValidInterval([nt,rt]),lt=_slicedToArray$6(st,2),ct=lt[0],ut=lt[1];if(ct===-1/0||ut===1/0){var ht=ut===1/0?[ct].concat(_toConsumableArray$7(range$1(0,it-1).map(function(){return 1/0}))):[].concat(_toConsumableArray$7(range$1(0,it-1).map(function(){return-1/0})),[ut]);return nt>rt?reverse(ht):ht}if(ct===ut)return getTickOfSingleValue(ct,it,ot);var dt=calculateStep(ct,ut,at,ot),pt=dt.step,mt=dt.tickMin,gt=dt.tickMax,yt=Arithmetic.rangeStep(mt,gt.add(new Decimal$1(.1).mul(pt)),pt);return nt>rt?reverse(yt):yt}function getTickValuesFixedDomainFn(tt,et){var nt=_slicedToArray$6(tt,2),rt=nt[0],it=nt[1],ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,at=getValidInterval([rt,it]),st=_slicedToArray$6(at,2),lt=st[0],ct=st[1];if(lt===-1/0||ct===1/0)return[rt,it];if(lt===ct)return[lt];var ut=Math.max(et,2),ht=getFormatStep(new Decimal$1(ct).sub(lt).div(ut-1),ot,0),dt=[].concat(_toConsumableArray$7(Arithmetic.rangeStep(new Decimal$1(lt),new Decimal$1(ct).sub(new Decimal$1(.99).mul(ht)),ht)),[ct]);return rt>it?reverse(dt):dt}var getNiceTickValues=memoize(getNiceTickValuesFn),getTickValuesFixedDomain=memoize(getTickValuesFixedDomainFn),_excluded$b=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function _extends$l(){return _extends$l=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$3(tt){return _getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$3(tt)}function _defineProperty$4(tt,et,nt){return et=_toPropertyKey$3(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$3(tt){var et=_toPrimitive$3(tt,"string");return _typeof$4(et)==="symbol"?et:String(et)}function _toPrimitive$3(tt,et){if(_typeof$4(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var rt=nt.call(tt,et||"default");if(_typeof$4(rt)!=="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Line=function(tt){_inherits$3(nt,tt);var et=_createSuper$3(nt);function nt(){var rt;_classCallCheck$4(this,nt);for(var it=arguments.length,ot=new Array(it),at=0;atdt){mt=[].concat(_toConsumableArray$3(ct.slice(0,gt)),[dt-yt]);break}var bt=mt.length%2===0?[0,pt]:[pt];return[].concat(_toConsumableArray$3(nt.repeat(ct,ht)),_toConsumableArray$3(mt),bt).map(function(wt){return"".concat(wt,"px")}).join(", ")}),_defineProperty$4(_assertThisInitialized$3(rt),"id",uniqueId("recharts-line-")),_defineProperty$4(_assertThisInitialized$3(rt),"pathRef",function(st){rt.mainCurve=st}),_defineProperty$4(_assertThisInitialized$3(rt),"handleAnimationEnd",function(){rt.setState({isAnimationFinished:!0}),rt.props.onAnimationEnd&&rt.props.onAnimationEnd()}),_defineProperty$4(_assertThisInitialized$3(rt),"handleAnimationStart",function(){rt.setState({isAnimationFinished:!1}),rt.props.onAnimationStart&&rt.props.onAnimationStart()}),rt}return _createClass$4(nt,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var it=this.getTotalLength();this.setState({totalLength:it})}}},{key:"getTotalLength",value:function(){var it=this.mainCurve;try{return it&&it.getTotalLength&&it.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(it,ot){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var at=this.props,st=at.points,lt=at.xAxis,ct=at.yAxis,ut=at.layout,ht=at.children,dt=findAllByType(ht,ErrorBar);if(!dt)return null;var pt=function(yt,bt){return{x:yt.x,y:yt.y,value:yt.value,errorVal:getValueByDataKey(yt.payload,bt)}},mt={clipPath:it?"url(#clipPath-".concat(ot,")"):null};return React$1.createElement(Layer,mt,dt.map(function(gt,yt){return React$1.cloneElement(gt,{key:"bar-".concat(yt),data:st,xAxis:lt,yAxis:ct,layout:ut,dataPointFormatter:pt})}))}},{key:"renderDots",value:function(it,ot,at){var st=this.props.isAnimationActive;if(st&&!this.state.isAnimationFinished)return null;var lt=this.props,ct=lt.dot,ut=lt.points,ht=lt.dataKey,dt=filterProps(this.props),pt=filterProps(ct,!0),mt=ut.map(function(yt,bt){var wt=_objectSpread$3(_objectSpread$3(_objectSpread$3({key:"dot-".concat(bt),r:3},dt),pt),{},{value:yt.value,dataKey:ht,cx:yt.x,cy:yt.y,index:bt,payload:yt.payload});return nt.renderDotItem(ct,wt)}),gt={clipPath:it?"url(#clipPath-".concat(ot?"":"dots-").concat(at,")"):null};return React$1.createElement(Layer,_extends$4({className:"recharts-line-dots",key:"dots"},gt),mt)}},{key:"renderCurveStatically",value:function(it,ot,at,st){var lt=this.props,ct=lt.type,ut=lt.layout,ht=lt.connectNulls;lt.ref;var dt=_objectWithoutProperties$2(lt,_excluded$2),pt=_objectSpread$3(_objectSpread$3(_objectSpread$3({},filterProps(dt,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:ot?"url(#clipPath-".concat(at,")"):null,points:it},st),{},{type:ct,layout:ut,connectNulls:ht});return React$1.createElement(Curve,_extends$4({},pt,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(it,ot){var at=this,st=this.props,lt=st.points,ct=st.strokeDasharray,ut=st.isAnimationActive,ht=st.animationBegin,dt=st.animationDuration,pt=st.animationEasing,mt=st.animationId,gt=st.animateNewValues,yt=st.width,bt=st.height,wt=this.state,xt=wt.prevPoints,kt=wt.totalLength;return React$1.createElement(Animate,{begin:ht,duration:dt,isActive:ut,easing:pt,from:{t:0},to:{t:1},key:"line-".concat(mt),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(St){var Tt=St.t;if(xt){var At=xt.length/lt.length,Et=lt.map(function($t,vt){var It=Math.floor(vt*At);if(xt[It]){var Ot=xt[It],Wt=interpolateNumber$2(Ot.x,$t.x),zt=interpolateNumber$2(Ot.y,$t.y);return _objectSpread$3(_objectSpread$3({},$t),{},{x:Wt(Tt),y:zt(Tt)})}if(gt){var Ft=interpolateNumber$2(yt*2,$t.x),Nt=interpolateNumber$2(bt/2,$t.y);return _objectSpread$3(_objectSpread$3({},$t),{},{x:Ft(Tt),y:Nt(Tt)})}return _objectSpread$3(_objectSpread$3({},$t),{},{x:$t.x,y:$t.y})});return at.renderCurveStatically(Et,it,ot)}var Ct=interpolateNumber$2(0,kt),Lt=Ct(Tt),jt;if(ct){var Rt="".concat(ct).split(/[,\s]+/gim).map(function($t){return parseFloat($t)});jt=at.getStrokeDasharray(Lt,kt,Rt)}else jt=at.generateSimpleStrokeDasharray(kt,Lt);return at.renderCurveStatically(lt,it,ot,{strokeDasharray:jt})})}},{key:"renderCurve",value:function(it,ot){var at=this.props,st=at.points,lt=at.isAnimationActive,ct=this.state,ut=ct.prevPoints,ht=ct.totalLength;return lt&&st&&st.length&&(!ut&&ht>0||!_isEqual(ut,st))?this.renderCurveWithAnimation(it,ot):this.renderCurveStatically(st,it,ot)}},{key:"render",value:function(){var it,ot=this.props,at=ot.hide,st=ot.dot,lt=ot.points,ct=ot.className,ut=ot.xAxis,ht=ot.yAxis,dt=ot.top,pt=ot.left,mt=ot.width,gt=ot.height,yt=ot.isAnimationActive,bt=ot.id;if(at||!lt||!lt.length)return null;var wt=this.state.isAnimationFinished,xt=lt.length===1,kt=classNames("recharts-line",ct),St=ut&&ut.allowDataOverflow,Tt=ht&&ht.allowDataOverflow,At=St||Tt,Et=_isNil(bt)?this.id:bt,Ct=(it=filterProps(st))!==null&&it!==void 0?it:{r:3,strokeWidth:2},Lt=Ct.r,jt=Lt===void 0?3:Lt,Rt=Ct.strokeWidth,$t=Rt===void 0?2:Rt,vt=isDotProps(st)?st:{},It=vt.clipDot,Ot=It===void 0?!0:It,Wt=jt*2+$t;return React$1.createElement(Layer,{className:kt},St||Tt?React$1.createElement("defs",null,React$1.createElement("clipPath",{id:"clipPath-".concat(Et)},React$1.createElement("rect",{x:St?pt:pt-mt/2,y:Tt?dt:dt-gt/2,width:St?mt:mt*2,height:Tt?gt:gt*2})),!Ot&&React$1.createElement("clipPath",{id:"clipPath-dots-".concat(Et)},React$1.createElement("rect",{x:pt-Wt/2,y:dt-Wt/2,width:mt+Wt,height:gt+Wt}))):null,!xt&&this.renderCurve(At,Et),this.renderErrorBar(At,Et),(xt||st)&&this.renderDots(At,Ot,Et),(!yt||wt)&&LabelList.renderCallByParent(this.props,lt))}}],[{key:"getDerivedStateFromProps",value:function(it,ot){return it.animationId!==ot.prevAnimationId?{prevAnimationId:it.animationId,curPoints:it.points,prevPoints:ot.curPoints}:it.points!==ot.curPoints?{curPoints:it.points}:null}},{key:"repeat",value:function(it,ot){for(var at=it.length%2!==0?[].concat(_toConsumableArray$3(it),[0]):it,st=[],lt=0;lt=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}function _objectWithoutPropertiesLoose$1(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}function ScatterSymbol(tt){var et=tt.option,nt=tt.isActive,rt=_objectWithoutProperties$1(tt,_excluded$1);return typeof et=="string"?React$1.createElement(Shape,_extends$3({option:React$1.createElement(Symbols,_extends$3({type:et},rt)),isActive:nt,shapeType:"symbols"},rt)):React$1.createElement(Shape,_extends$3({option:et,isActive:nt,shapeType:"symbols"},rt))}function _typeof$3(tt){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$3(tt)}function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$2(tt){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$2(tt)}function _defineProperty$3(tt,et,nt){return et=_toPropertyKey$2(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$2(tt){var et=_toPrimitive$2(tt,"string");return _typeof$3(et)==="symbol"?et:String(et)}function _toPrimitive$2(tt,et){if(_typeof$3(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var rt=nt.call(tt,et||"default");if(_typeof$3(rt)!=="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Scatter=function(tt){_inherits$2(nt,tt);var et=_createSuper$2(nt);function nt(){var rt;_classCallCheck$3(this,nt);for(var it=arguments.length,ot=new Array(it),at=0;at-1?it[ot?et[at]:at]:void 0}}var _createFind=createFind$1,toFinite=toFinite_1;function toInteger$1(tt){var et=toFinite(tt),nt=et%1;return et===et?nt?et-nt:et:0}var toInteger_1=toInteger$1,baseFindIndex=_baseFindIndex,baseIteratee=_baseIteratee,toInteger=toInteger_1,nativeMax=Math.max;function findIndex$1(tt,et,nt){var rt=tt==null?0:tt.length;if(!rt)return-1;var it=nt==null?0:toInteger(nt);return it<0&&(it=nativeMax(rt+it,0)),baseFindIndex(tt,baseIteratee(et),it)}var findIndex_1=findIndex$1,createFind=_createFind,findIndex=findIndex_1,find$1=createFind(findIndex),find_1=find$1;const _find=getDefaultExportFromCjs(find_1);var prefix="Invariant failed";function invariant(tt,et){if(!tt)throw new Error(prefix)}function getRadialCursorPoints(tt){var et=tt.cx,nt=tt.cy,rt=tt.radius,it=tt.startAngle,ot=tt.endAngle,at=polarToCartesian(et,nt,rt,it),st=polarToCartesian(et,nt,rt,ot);return{points:[at,st],cx:et,cy:nt,radius:rt,startAngle:it,endAngle:ot}}function _toConsumableArray$2(tt){return _arrayWithoutHoles$2(tt)||_iterableToArray$2(tt)||_unsupportedIterableToArray$4(tt)||_nonIterableSpread$2()}function _nonIterableSpread$2(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$4(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$4(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$4(tt,et)}}function _iterableToArray$2(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$2(tt){if(Array.isArray(tt))return _arrayLikeToArray$4(tt)}function _arrayLikeToArray$4(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}function _objectWithoutPropertiesLoose(tt,et){if(tt==null)return{};var nt={},rt=Object.keys(tt),it,ot;for(ot=0;ot=0)&&(nt[it]=tt[it]);return nt}function _classCallCheck$1(tt,et){if(!(tt instanceof et))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(tt,et){for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$1(tt){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$1(tt)}function _toConsumableArray$1(tt){return _arrayWithoutHoles$1(tt)||_iterableToArray$1(tt)||_unsupportedIterableToArray$3(tt)||_nonIterableSpread$1()}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$3(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$3(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$3(tt,et)}}function _iterableToArray$1(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$1(tt){if(Array.isArray(tt))return _arrayLikeToArray$3(tt)}function _arrayLikeToArray$3(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt0?st:rt&&rt.props&&rt.props.data&&rt.props.data.length>0?rt.props.data:et&&et.length&&isNumber(ot)&&isNumber(at)?et.slice(ot,at+1):[]};function getDefaultDomainByAxisType(tt){return tt==="number"?[0,"auto"]:void 0}var getTooltipContent=function(et,nt,rt,it){var ot=et.graphicalItems,at=et.tooltipAxis,st=getDisplayedData(nt,et);return rt<0||!ot||!ot.length||rt>=st.length?null:ot.reduce(function(lt,ct){var ut=ct.props.hide;if(ut)return lt;var ht=ct.props.data,dt=ht===void 0?nt:ht,pt;if(at.dataKey&&!at.allowDuplicatedCategory){var mt=dt===void 0?st:dt;pt=findEntryInArray(mt,at.dataKey,it)}else pt=dt&&dt[rt]||st[rt];return pt?[].concat(_toConsumableArray$1(lt),[getTooltipItem(ct,pt)]):lt},[])},getTooltipData=function(et,nt,rt,it){var ot=it||{x:et.chartX,y:et.chartY},at=calculateTooltipPos(ot,rt),st=et.orderedTooltipTicks,lt=et.tooltipAxis,ct=et.tooltipTicks,ut=calculateActiveTickIndex(at,st,ct,lt);if(ut>=0&&ct){var ht=ct[ut]&&ct[ut].value,dt=getTooltipContent(et,nt,ut,ht),pt=getActiveCoordinate(rt,st,ut,ot);return{activeTooltipIndex:ut,activeLabel:ht,activePayload:dt,activeCoordinate:pt}}return null},getAxisMapByAxes=function(et,nt){var rt=nt.axes,it=nt.graphicalItems,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=et.stackOffset,pt=isCategoricalAxis(ut,ot),mt=rt.reduce(function(gt,yt){var bt,wt=yt.props,xt=wt.type,kt=wt.dataKey,St=wt.allowDataOverflow,Tt=wt.allowDuplicatedCategory,At=wt.scale,Et=wt.ticks,Ct=wt.includeHidden,Lt=yt.props[at];if(gt[Lt])return gt;var jt=getDisplayedData(et.data,{graphicalItems:it.filter(function(Ht){return Ht.props[at]===Lt}),dataStartIndex:lt,dataEndIndex:ct}),Rt=jt.length,$t,vt,It;isDomainSpecifiedByUser(yt.props.domain,St,xt)&&($t=parseSpecifiedDomain(yt.props.domain,null,St),pt&&(xt==="number"||At!=="auto")&&(It=getDomainOfDataByKey(jt,kt,"category")));var Ot=getDefaultDomainByAxisType(xt);if(!$t||$t.length===0){var Wt,zt=(Wt=yt.props.domain)!==null&&Wt!==void 0?Wt:Ot;if(kt){if($t=getDomainOfDataByKey(jt,kt,xt),xt==="category"&&pt){var Ft=hasDuplicate($t);Tt&&Ft?(vt=$t,$t=_range(0,Rt)):Tt||($t=parseDomainOfCategoryAxis(zt,$t,yt).reduce(function(Ht,Qt){return Ht.indexOf(Qt)>=0?Ht:[].concat(_toConsumableArray$1(Ht),[Qt])},[]))}else if(xt==="category")Tt?$t=$t.filter(function(Ht){return Ht!==""&&!_isNil(Ht)}):$t=parseDomainOfCategoryAxis(zt,$t,yt).reduce(function(Ht,Qt){return Ht.indexOf(Qt)>=0||Qt===""||_isNil(Qt)?Ht:[].concat(_toConsumableArray$1(Ht),[Qt])},[]);else if(xt==="number"){var Nt=parseErrorBarsOfAxis(jt,it.filter(function(Ht){return Ht.props[at]===Lt&&(Ct||!Ht.props.hide)}),kt,ot,ut);Nt&&($t=Nt)}pt&&(xt==="number"||At!=="auto")&&(It=getDomainOfDataByKey(jt,kt,"category"))}else pt?$t=_range(0,Rt):st&&st[Lt]&&st[Lt].hasStack&&xt==="number"?$t=dt==="expand"?[0,1]:getDomainOfStackGroups(st[Lt].stackGroups,lt,ct):$t=getDomainOfItemsWithSameAxis(jt,it.filter(function(Ht){return Ht.props[at]===Lt&&(Ct||!Ht.props.hide)}),xt,ut,!0);if(xt==="number")$t=detectReferenceElementsDomain(ht,$t,Lt,ot,Et),zt&&($t=parseSpecifiedDomain(zt,$t,St));else if(xt==="category"&&zt){var Ut=zt,Pt=$t.every(function(Ht){return Ut.indexOf(Ht)>=0});Pt&&($t=Ut)}}return _objectSpread$1(_objectSpread$1({},gt),{},_defineProperty$1({},Lt,_objectSpread$1(_objectSpread$1({},yt.props),{},{axisType:ot,domain:$t,categoricalDomain:It,duplicateDomain:vt,originalDomain:(bt=yt.props.domain)!==null&&bt!==void 0?bt:Ot,isCategorical:pt,layout:ut})))},{});return mt},getAxisMapByItems=function(et,nt){var rt=nt.graphicalItems,it=nt.Axis,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=getDisplayedData(et.data,{graphicalItems:rt,dataStartIndex:lt,dataEndIndex:ct}),pt=dt.length,mt=isCategoricalAxis(ut,ot),gt=-1,yt=rt.reduce(function(bt,wt){var xt=wt.props[at],kt=getDefaultDomainByAxisType("number");if(!bt[xt]){gt++;var St;return mt?St=_range(0,pt):st&&st[xt]&&st[xt].hasStack?(St=getDomainOfStackGroups(st[xt].stackGroups,lt,ct),St=detectReferenceElementsDomain(ht,St,xt,ot)):(St=parseSpecifiedDomain(kt,getDomainOfItemsWithSameAxis(dt,rt.filter(function(Tt){return Tt.props[at]===xt&&!Tt.props.hide}),"number",ut),it.defaultProps.allowDataOverflow),St=detectReferenceElementsDomain(ht,St,xt,ot)),_objectSpread$1(_objectSpread$1({},bt),{},_defineProperty$1({},xt,_objectSpread$1(_objectSpread$1({axisType:ot},it.defaultProps),{},{hide:!0,orientation:_get(ORIENT_MAP,"".concat(ot,".").concat(gt%2),null),domain:St,originalDomain:kt,isCategorical:mt,layout:ut})))}return bt},{});return yt},getAxisMap=function(et,nt){var rt=nt.axisType,it=rt===void 0?"xAxis":rt,ot=nt.AxisComp,at=nt.graphicalItems,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.children,ht="".concat(it,"Id"),dt=findAllByType(ut,ot),pt={};return dt&&dt.length?pt=getAxisMapByAxes(et,{axes:dt,graphicalItems:at,axisType:it,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct}):at&&at.length&&(pt=getAxisMapByItems(et,{Axis:ot,graphicalItems:at,axisType:it,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct})),pt},tooltipTicksGenerator=function(et){var nt=getAnyElementOfObject(et),rt=getTicksOfAxis(nt,!1,!0);return{tooltipTicks:rt,orderedTooltipTicks:_sortBy(rt,function(it){return it.coordinate}),tooltipAxis:nt,tooltipAxisBandSize:getBandSizeOfAxis(nt,rt)}},createDefaultState=function(et){var nt,rt,it=et.children,ot=et.defaultShowTooltip,at=findChildByType(it,Brush),st=at&&at.props&&at.props.startIndex||0,lt=(at==null||(nt=at.props)===null||nt===void 0?void 0:nt.endIndex)!==void 0?at==null||(rt=at.props)===null||rt===void 0?void 0:rt.endIndex:et.data&&et.data.length-1||0;return{chartX:0,chartY:0,dataStartIndex:st,dataEndIndex:lt,activeTooltipIndex:-1,isTooltipActive:_isNil(ot)?!1:ot}},hasGraphicalBarItem=function(et){return!et||!et.length?!1:et.some(function(nt){var rt=getDisplayName(nt&&nt.type);return rt&&rt.indexOf("Bar")>=0})},getAxisNameByLayout=function(et){return et==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:et==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:et==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function(et,nt){var rt=et.props,it=et.graphicalItems,ot=et.xAxisMap,at=ot===void 0?{}:ot,st=et.yAxisMap,lt=st===void 0?{}:st,ct=rt.width,ut=rt.height,ht=rt.children,dt=rt.margin||{},pt=findChildByType(ht,Brush),mt=findChildByType(ht,Legend),gt=Object.keys(lt).reduce(function(xt,kt){var St=lt[kt],Tt=St.orientation;return!St.mirror&&!St.hide?_objectSpread$1(_objectSpread$1({},xt),{},_defineProperty$1({},Tt,xt[Tt]+St.width)):xt},{left:dt.left||0,right:dt.right||0}),yt=Object.keys(at).reduce(function(xt,kt){var St=at[kt],Tt=St.orientation;return!St.mirror&&!St.hide?_objectSpread$1(_objectSpread$1({},xt),{},_defineProperty$1({},Tt,_get(xt,"".concat(Tt))+St.height)):xt},{top:dt.top||0,bottom:dt.bottom||0}),bt=_objectSpread$1(_objectSpread$1({},yt),gt),wt=bt.bottom;return pt&&(bt.bottom+=pt.props.height||Brush.defaultProps.height),mt&&nt&&(bt=appendOffsetOfLegend(bt,it,rt,nt)),_objectSpread$1(_objectSpread$1({brushBottom:wt},bt),{},{width:ct-bt.left-bt.right,height:ut-bt.top-bt.bottom})},generateCategoricalChart=function(et){var nt,rt=et.chartName,it=et.GraphicalChild,ot=et.defaultTooltipEventType,at=ot===void 0?"axis":ot,st=et.validateTooltipEventTypes,lt=st===void 0?["axis"]:st,ct=et.axisComponents,ut=et.legendContent,ht=et.formatAxisMap,dt=et.defaultProps,pt=function(yt,bt){var wt=bt.graphicalItems,xt=bt.stackGroups,kt=bt.offset,St=bt.updateId,Tt=bt.dataStartIndex,At=bt.dataEndIndex,Et=yt.barSize,Ct=yt.layout,Lt=yt.barGap,jt=yt.barCategoryGap,Rt=yt.maxBarSize,$t=getAxisNameByLayout(Ct),vt=$t.numericAxisName,It=$t.cateAxisName,Ot=hasGraphicalBarItem(wt),Wt=Ot&&getBarSizeList({barSize:Et,stackGroups:xt}),zt=[];return wt.forEach(function(Ft,Nt){var Ut=getDisplayedData(yt.data,{dataStartIndex:Tt,dataEndIndex:At},Ft),Pt=Ft.props,Ht=Pt.dataKey,Qt=Pt.maxBarSize,an=Ft.props["".concat(vt,"Id")],Yt=Ft.props["".concat(It,"Id")],nn={},tn=ct.reduce(function(In,yn){var hn,fn=bt["".concat(yn.axisType,"Map")],xn=Ft.props["".concat(yn.axisType,"Id")];fn&&fn[xn]||yn.axisType==="zAxis"||invariant(!1);var jn=fn[xn];return _objectSpread$1(_objectSpread$1({},In),{},(hn={},_defineProperty$1(hn,yn.axisType,jn),_defineProperty$1(hn,"".concat(yn.axisType,"Ticks"),getTicksOfAxis(jn)),hn))},nn),dn=tn[It],wn=tn["".concat(It,"Ticks")],rn=xt&&xt[an]&&xt[an].hasStack&&getStackedDataOfItem(Ft,xt[an].stackGroups),Jt=getDisplayName(Ft.type).indexOf("Bar")>=0,vn=getBandSizeOfAxis(dn,wn),Cn=[];if(Jt){var $n,Nn,En=_isNil(Qt)?Rt:Qt,sn=($n=(Nn=getBandSizeOfAxis(dn,wn,!0))!==null&&Nn!==void 0?Nn:En)!==null&&$n!==void 0?$n:0;Cn=getBarPosition({barGap:Lt,barCategoryGap:jt,bandSize:sn!==vn?sn:vn,sizeList:Wt[Yt],maxBarSize:En}),sn!==vn&&(Cn=Cn.map(function(In){return _objectSpread$1(_objectSpread$1({},In),{},{position:_objectSpread$1(_objectSpread$1({},In.position),{},{offset:In.position.offset-sn/2})})}))}var pn=Ft&&Ft.type&&Ft.type.getComposedData;if(pn){var Tn;zt.push({props:_objectSpread$1(_objectSpread$1({},pn(_objectSpread$1(_objectSpread$1({},tn),{},{displayedData:Ut,props:yt,dataKey:Ht,item:Ft,bandSize:vn,barPosition:Cn,offset:kt,stackedData:rn,layout:Ct,dataStartIndex:Tt,dataEndIndex:At}))),{},(Tn={key:Ft.key||"item-".concat(Nt)},_defineProperty$1(Tn,vt,tn[vt]),_defineProperty$1(Tn,It,tn[It]),_defineProperty$1(Tn,"animationId",St),Tn)),childIndex:parseChildIndex(Ft,yt.children),item:Ft})}}),zt},mt=function(yt,bt){var wt=yt.props,xt=yt.dataStartIndex,kt=yt.dataEndIndex,St=yt.updateId;if(!validateWidthHeight({props:wt}))return null;var Tt=wt.children,At=wt.layout,Et=wt.stackOffset,Ct=wt.data,Lt=wt.reverseStackOrder,jt=getAxisNameByLayout(At),Rt=jt.numericAxisName,$t=jt.cateAxisName,vt=findAllByType(Tt,it),It=getStackGroupsByAxisId(Ct,vt,"".concat(Rt,"Id"),"".concat($t,"Id"),Et,Lt),Ot=ct.reduce(function(Ut,Pt){var Ht="".concat(Pt.axisType,"Map");return _objectSpread$1(_objectSpread$1({},Ut),{},_defineProperty$1({},Ht,getAxisMap(wt,_objectSpread$1(_objectSpread$1({},Pt),{},{graphicalItems:vt,stackGroups:Pt.axisType===Rt&&It,dataStartIndex:xt,dataEndIndex:kt}))))},{}),Wt=calculateOffset(_objectSpread$1(_objectSpread$1({},Ot),{},{props:wt,graphicalItems:vt}),bt==null?void 0:bt.legendBBox);Object.keys(Ot).forEach(function(Ut){Ot[Ut]=ht(wt,Ot[Ut],Wt,Ut.replace("Map",""),rt)});var zt=Ot["".concat($t,"Map")],Ft=tooltipTicksGenerator(zt),Nt=pt(wt,_objectSpread$1(_objectSpread$1({},Ot),{},{dataStartIndex:xt,dataEndIndex:kt,updateId:St,graphicalItems:vt,stackGroups:It,offset:Wt}));return _objectSpread$1(_objectSpread$1({formattedGraphicalItems:Nt,graphicalItems:vt,offset:Wt,stackGroups:It},Ft),Ot)};return nt=function(gt){_inherits$1(bt,gt);var yt=_createSuper$1(bt);function bt(wt){var xt;return _classCallCheck$1(this,bt),xt=yt.call(this,wt),_defineProperty$1(_assertThisInitialized$1(xt),"accessibilityManager",new AccessibilityManager),_defineProperty$1(_assertThisInitialized$1(xt),"clearDefer",function(){xt.cancelDefer&&(xt.cancelDefer(),xt.cancelDefer=null)}),_defineProperty$1(_assertThisInitialized$1(xt),"handleLegendBBoxUpdate",function(kt){if(kt){var St=xt.state,Tt=St.dataStartIndex,At=St.dataEndIndex,Et=St.updateId;xt.setState(_objectSpread$1({legendBBox:kt},mt({props:xt.props,dataStartIndex:Tt,dataEndIndex:At,updateId:Et},_objectSpread$1(_objectSpread$1({},xt.state),{},{legendBBox:kt}))))}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleReceiveSyncEvent",function(kt,St,Tt){var At=xt.props.syncId;At===kt&&St!==xt.uniqueChartId&&(xt.clearDefer(),xt.cancelDefer=deferer(xt.applySyncEvent.bind(_assertThisInitialized$1(xt),Tt)))}),_defineProperty$1(_assertThisInitialized$1(xt),"handleBrushChange",function(kt){var St=kt.startIndex,Tt=kt.endIndex;if(St!==xt.state.dataStartIndex||Tt!==xt.state.dataEndIndex){var At=xt.state.updateId;xt.setState(function(){return _objectSpread$1({dataStartIndex:St,dataEndIndex:Tt},mt({props:xt.props,dataStartIndex:St,dataEndIndex:Tt,updateId:At},xt.state))}),xt.triggerSyncEvent({dataStartIndex:St,dataEndIndex:Tt})}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseEnter",function(kt){var St=xt.props.onMouseEnter,Tt=xt.getMouseInfo(kt);if(Tt){var At=_objectSpread$1(_objectSpread$1({},Tt),{},{isTooltipActive:!0});xt.setState(At),xt.triggerSyncEvent(At),_isFunction$1(St)&&St(At,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"triggeredAfterMouseMove",function(kt){var St=xt.props.onMouseMove,Tt=xt.getMouseInfo(kt),At=Tt?_objectSpread$1(_objectSpread$1({},Tt),{},{isTooltipActive:!0}):{isTooltipActive:!1};xt.setState(At),xt.triggerSyncEvent(At),_isFunction$1(St)&&St(At,kt)}),_defineProperty$1(_assertThisInitialized$1(xt),"handleItemMouseEnter",function(kt){xt.setState(function(){return{isTooltipActive:!0,activeItem:kt,activePayload:kt.tooltipPayload,activeCoordinate:kt.tooltipPosition||{x:kt.cx,y:kt.cy}}})}),_defineProperty$1(_assertThisInitialized$1(xt),"handleItemMouseLeave",function(){xt.setState(function(){return{isTooltipActive:!1}})}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseMove",function(kt){kt&&_isFunction$1(kt.persist)&&kt.persist(),xt.triggeredAfterMouseMove(kt)}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseLeave",function(kt){var St=xt.props.onMouseLeave,Tt={isTooltipActive:!1};xt.setState(Tt),xt.triggerSyncEvent(Tt),_isFunction$1(St)&&St(Tt,kt),xt.cancelThrottledTriggerAfterMouseMove()}),_defineProperty$1(_assertThisInitialized$1(xt),"handleOuterEvent",function(kt){var St=getReactEventByType(kt),Tt=_get(xt.props,"".concat(St));if(St&&_isFunction$1(Tt)){var At;/.*touch.*/i.test(St)?At=xt.getMouseInfo(kt.changedTouches[0]):At=xt.getMouseInfo(kt);var Et=Tt;Et(At,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleClick",function(kt){var St=xt.props.onClick,Tt=xt.getMouseInfo(kt);if(Tt){var At=_objectSpread$1(_objectSpread$1({},Tt),{},{isTooltipActive:!0});xt.setState(At),xt.triggerSyncEvent(At),_isFunction$1(St)&&St(At,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseDown",function(kt){var St=xt.props.onMouseDown;if(_isFunction$1(St)){var Tt=xt.getMouseInfo(kt);St(Tt,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseUp",function(kt){var St=xt.props.onMouseUp;if(_isFunction$1(St)){var Tt=xt.getMouseInfo(kt);St(Tt,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleTouchMove",function(kt){kt.changedTouches!=null&&kt.changedTouches.length>0&&xt.handleMouseMove(kt.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(xt),"handleTouchStart",function(kt){kt.changedTouches!=null&&kt.changedTouches.length>0&&xt.handleMouseDown(kt.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(xt),"handleTouchEnd",function(kt){kt.changedTouches!=null&&kt.changedTouches.length>0&&xt.handleMouseUp(kt.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(xt),"verticalCoordinatesGenerator",function(kt,St){var Tt=kt.xAxis,At=kt.width,Et=kt.height,Ct=kt.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$1(_objectSpread$1(_objectSpread$1({},CartesianAxis.defaultProps),Tt),{},{ticks:getTicksOfAxis(Tt,!0),viewBox:{x:0,y:0,width:At,height:Et}})),Ct.left,Ct.left+Ct.width,St)}),_defineProperty$1(_assertThisInitialized$1(xt),"horizontalCoordinatesGenerator",function(kt,St){var Tt=kt.yAxis,At=kt.width,Et=kt.height,Ct=kt.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$1(_objectSpread$1(_objectSpread$1({},CartesianAxis.defaultProps),Tt),{},{ticks:getTicksOfAxis(Tt,!0),viewBox:{x:0,y:0,width:At,height:Et}})),Ct.top,Ct.top+Ct.height,St)}),_defineProperty$1(_assertThisInitialized$1(xt),"axesTicksGenerator",function(kt){return getTicksOfAxis(kt,!0)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderCursor",function(kt){var St=xt.state,Tt=St.isTooltipActive,At=St.activeCoordinate,Et=St.activePayload,Ct=St.offset,Lt=St.activeTooltipIndex,jt=St.tooltipAxisBandSize,Rt=xt.getTooltipEventType();if(!kt||!kt.props.cursor||!Tt||!At||rt!=="ScatterChart"&&Rt!=="axis")return null;var $t=xt.props.layout,vt,It=Curve;if(rt==="ScatterChart")vt=At,It=Cross;else if(rt==="BarChart")vt=getCursorRectangle($t,At,Ct,jt),It=Rectangle;else if($t==="radial"){var Ot=getRadialCursorPoints(At),Wt=Ot.cx,zt=Ot.cy,Ft=Ot.radius,Nt=Ot.startAngle,Ut=Ot.endAngle;vt={cx:Wt,cy:zt,startAngle:Nt,endAngle:Ut,innerRadius:Ft,outerRadius:Ft},It=Sector}else vt={points:getCursorPoints($t,At,Ct)},It=Curve;var Pt=kt.key||"_recharts-cursor",Ht=_objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({stroke:"#ccc",pointerEvents:"none"},Ct),vt),filterProps(kt.props.cursor)),{},{payload:Et,payloadIndex:Lt,key:Pt,className:"recharts-tooltip-cursor"});return reactExports.isValidElement(kt.props.cursor)?reactExports.cloneElement(kt.props.cursor,Ht):reactExports.createElement(It,Ht)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderPolarAxis",function(kt,St,Tt){var At=_get(kt,"type.axisType"),Et=_get(xt.state,"".concat(At,"Map")),Ct=Et&&Et[kt.props["".concat(At,"Id")]];return reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1({},Ct),{},{className:At,key:kt.key||"".concat(St,"-").concat(Tt),ticks:getTicksOfAxis(Ct,!0)}))}),_defineProperty$1(_assertThisInitialized$1(xt),"renderXAxis",function(kt,St,Tt){var At=xt.state.xAxisMap,Et=At[kt.props.xAxisId];return xt.renderAxis(Et,kt,St,Tt)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderYAxis",function(kt,St,Tt){var At=xt.state.yAxisMap,Et=At[kt.props.yAxisId];return xt.renderAxis(Et,kt,St,Tt)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderGrid",function(kt){var St=xt.state,Tt=St.xAxisMap,At=St.yAxisMap,Et=St.offset,Ct=xt.props,Lt=Ct.width,jt=Ct.height,Rt=getAnyElementOfObject(Tt),$t=_find(At,function(Ot){return _every(Ot.domain,isFinit)}),vt=$t||getAnyElementOfObject(At),It=kt.props||{};return reactExports.cloneElement(kt,{key:kt.key||"grid",x:isNumber(It.x)?It.x:Et.left,y:isNumber(It.y)?It.y:Et.top,width:isNumber(It.width)?It.width:Et.width,height:isNumber(It.height)?It.height:Et.height,xAxis:Rt,yAxis:vt,offset:Et,chartWidth:Lt,chartHeight:jt,verticalCoordinatesGenerator:It.verticalCoordinatesGenerator||xt.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:It.horizontalCoordinatesGenerator||xt.horizontalCoordinatesGenerator})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderPolarGrid",function(kt){var St=kt.props,Tt=St.radialLines,At=St.polarAngles,Et=St.polarRadius,Ct=xt.state,Lt=Ct.radiusAxisMap,jt=Ct.angleAxisMap,Rt=getAnyElementOfObject(Lt),$t=getAnyElementOfObject(jt),vt=$t.cx,It=$t.cy,Ot=$t.innerRadius,Wt=$t.outerRadius;return reactExports.cloneElement(kt,{polarAngles:_isArray$1(At)?At:getTicksOfAxis($t,!0).map(function(zt){return zt.coordinate}),polarRadius:_isArray$1(Et)?Et:getTicksOfAxis(Rt,!0).map(function(zt){return zt.coordinate}),cx:vt,cy:It,innerRadius:Ot,outerRadius:Wt,key:kt.key||"polar-grid",radialLines:Tt})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderLegend",function(){var kt=xt.state.formattedGraphicalItems,St=xt.props,Tt=St.children,At=St.width,Et=St.height,Ct=xt.props.margin||{},Lt=At-(Ct.left||0)-(Ct.right||0),jt=getLegendProps({children:Tt,formattedGraphicalItems:kt,legendWidth:Lt,legendContent:ut});if(!jt)return null;var Rt=jt.item,$t=_objectWithoutProperties(jt,_excluded);return reactExports.cloneElement(Rt,_objectSpread$1(_objectSpread$1({},$t),{},{chartWidth:At,chartHeight:Et,margin:Ct,onBBoxUpdate:xt.handleLegendBBoxUpdate}))}),_defineProperty$1(_assertThisInitialized$1(xt),"renderTooltip",function(){var kt=xt.props.children,St=findChildByType(kt,Tooltip);if(!St)return null;var Tt=xt.state,At=Tt.isTooltipActive,Et=Tt.activeCoordinate,Ct=Tt.activePayload,Lt=Tt.activeLabel,jt=Tt.offset;return reactExports.cloneElement(St,{viewBox:_objectSpread$1(_objectSpread$1({},jt),{},{x:jt.left,y:jt.top}),active:At,label:Lt,payload:At?Ct:[],coordinate:Et})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderBrush",function(kt){var St=xt.props,Tt=St.margin,At=St.data,Et=xt.state,Ct=Et.offset,Lt=Et.dataStartIndex,jt=Et.dataEndIndex,Rt=Et.updateId;return reactExports.cloneElement(kt,{key:kt.key||"_recharts-brush",onChange:combineEventHandlers(xt.handleBrushChange,null,kt.props.onChange),data:At,x:isNumber(kt.props.x)?kt.props.x:Ct.left,y:isNumber(kt.props.y)?kt.props.y:Ct.top+Ct.height+Ct.brushBottom-(Tt.bottom||0),width:isNumber(kt.props.width)?kt.props.width:Ct.width,startIndex:Lt,endIndex:jt,updateId:"brush-".concat(Rt)})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderReferenceElement",function(kt,St,Tt){if(!kt)return null;var At=_assertThisInitialized$1(xt),Et=At.clipPathId,Ct=xt.state,Lt=Ct.xAxisMap,jt=Ct.yAxisMap,Rt=Ct.offset,$t=kt.props,vt=$t.xAxisId,It=$t.yAxisId;return reactExports.cloneElement(kt,{key:kt.key||"".concat(St,"-").concat(Tt),xAxis:Lt[vt],yAxis:jt[It],viewBox:{x:Rt.left,y:Rt.top,width:Rt.width,height:Rt.height},clipPathId:Et})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderActivePoints",function(kt){var St=kt.item,Tt=kt.activePoint,At=kt.basePoint,Et=kt.childIndex,Ct=kt.isRange,Lt=[],jt=St.props.key,Rt=St.item.props,$t=Rt.activeDot,vt=Rt.dataKey,It=_objectSpread$1(_objectSpread$1({index:Et,dataKey:vt,cx:Tt.x,cy:Tt.y,r:4,fill:getMainColorOfGraphicItem(St.item),strokeWidth:2,stroke:"#fff",payload:Tt.payload,value:Tt.value,key:"".concat(jt,"-activePoint-").concat(Et)},filterProps($t)),adaptEventHandlers($t));return Lt.push(bt.renderActiveDot($t,It)),At?Lt.push(bt.renderActiveDot($t,_objectSpread$1(_objectSpread$1({},It),{},{cx:At.x,cy:At.y,key:"".concat(jt,"-basePoint-").concat(Et)}))):Ct&&Lt.push(null),Lt}),_defineProperty$1(_assertThisInitialized$1(xt),"renderGraphicChild",function(kt,St,Tt){var At=xt.filterFormatItem(kt,St,Tt);if(!At)return null;var Et=xt.getTooltipEventType(),Ct=xt.state,Lt=Ct.isTooltipActive,jt=Ct.tooltipAxis,Rt=Ct.activeTooltipIndex,$t=Ct.activeLabel,vt=xt.props.children,It=findChildByType(vt,Tooltip),Ot=At.props,Wt=Ot.points,zt=Ot.isRange,Ft=Ot.baseLine,Nt=At.item.props,Ut=Nt.activeDot,Pt=Nt.hide,Ht=Nt.activeBar,Qt=Nt.activeShape,an=!!(!Pt&&Lt&&It&&(Ut||Ht||Qt)),Yt={};Et!=="axis"&&It&&It.props.trigger==="click"?Yt={onClick:combineEventHandlers(xt.handleItemMouseEnter,null,kt.props.onCLick)}:Et!=="axis"&&(Yt={onMouseLeave:combineEventHandlers(xt.handleItemMouseLeave,null,kt.props.onMouseLeave),onMouseEnter:combineEventHandlers(xt.handleItemMouseEnter,null,kt.props.onMouseEnter)});var nn=reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1({},At.props),Yt));function tn(Tn){return typeof jt.dataKey=="function"?jt.dataKey(Tn.payload):null}if(an)if(Rt>=0){var dn,wn;if(jt.dataKey&&!jt.allowDuplicatedCategory){var rn=typeof jt.dataKey=="function"?tn:"payload.".concat(jt.dataKey.toString());dn=findEntryInArray(Wt,rn,$t),wn=zt&&Ft&&findEntryInArray(Ft,rn,$t)}else dn=Wt==null?void 0:Wt[Rt],wn=zt&&Ft&&Ft[Rt];if(Qt||Ht){var Jt=kt.props.activeIndex!==void 0?kt.props.activeIndex:Rt;return[reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1(_objectSpread$1({},At.props),Yt),{},{activeIndex:Jt})),null,null]}if(!_isNil(dn))return[nn].concat(_toConsumableArray$1(xt.renderActivePoints({item:At,activePoint:dn,basePoint:wn,childIndex:Rt,isRange:zt})))}else{var vn,Cn=(vn=xt.getItemByXY(xt.state.activeCoordinate))!==null&&vn!==void 0?vn:{graphicalItem:nn},$n=Cn.graphicalItem,Nn=$n.item,En=Nn===void 0?kt:Nn,sn=$n.childIndex,pn=_objectSpread$1(_objectSpread$1(_objectSpread$1({},At.props),Yt),{},{activeIndex:sn});return[reactExports.cloneElement(En,pn),null,null]}return zt?[nn,null,null]:[nn,null]}),_defineProperty$1(_assertThisInitialized$1(xt),"renderCustomized",function(kt,St,Tt){return reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1({key:"recharts-customized-".concat(Tt)},xt.props),xt.state))}),xt.uniqueChartId=_isNil(wt.id)?uniqueId("recharts"):wt.id,xt.clipPathId="".concat(xt.uniqueChartId,"-clip"),wt.throttleDelay&&(xt.triggeredAfterMouseMove=_throttle(xt.triggeredAfterMouseMove,wt.throttleDelay)),xt.state={},xt}return _createClass$1(bt,[{key:"componentDidMount",value:function(){var xt,kt;_isNil(this.props.syncId)||this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(xt=this.props.margin.left)!==null&&xt!==void 0?xt:0,top:(kt=this.props.margin.top)!==null&&kt!==void 0?kt:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.handleMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(xt,kt){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==kt.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==xt.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==xt.margin){var St,Tt;this.accessibilityManager.setDetails({offset:{left:(St=this.props.margin.left)!==null&&St!==void 0?St:0,top:(Tt=this.props.margin.top)!==null&&Tt!==void 0?Tt:0}})}return null}},{key:"componentDidUpdate",value:function(xt){_isNil(xt.syncId)&&!_isNil(this.props.syncId)&&this.addListener(),!_isNil(xt.syncId)&&_isNil(this.props.syncId)&&this.removeListener()}},{key:"componentWillUnmount",value:function(){this.clearDefer(),_isNil(this.props.syncId)||this.removeListener(),this.cancelThrottledTriggerAfterMouseMove()}},{key:"cancelThrottledTriggerAfterMouseMove",value:function(){typeof this.triggeredAfterMouseMove.cancel=="function"&&this.triggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var xt=findChildByType(this.props.children,Tooltip);if(xt&&_isBoolean(xt.props.shared)){var kt=xt.props.shared?"axis":"item";return lt.indexOf(kt)>=0?kt:at}return at}},{key:"getMouseInfo",value:function(xt){var kt;if(!this.container)return null;var St=getOffset(this.container),Tt=calculateChartCoordinate(xt,St),At=this.container,Et=At==null||(kt=At.getBoundingClientRect())===null||kt===void 0?void 0:kt.width,Ct=At.offsetWidth,Lt=Et/Ct||1,jt=this.inRange(Tt.chartX,Tt.chartY,Lt);if(!jt)return null;var Rt=this.state,$t=Rt.xAxisMap,vt=Rt.yAxisMap,It=this.getTooltipEventType();if(It!=="axis"&&$t&&vt){var Ot=getAnyElementOfObject($t).scale,Wt=getAnyElementOfObject(vt).scale,zt=Ot&&Ot.invert?Ot.invert(Tt.chartX):null,Ft=Wt&&Wt.invert?Wt.invert(Tt.chartY):null;return _objectSpread$1(_objectSpread$1({},Tt),{},{xValue:zt,yValue:Ft})}var Nt=getTooltipData(this.state,this.props.data,this.props.layout,jt);return Nt?_objectSpread$1(_objectSpread$1({},Tt),Nt):null}},{key:"inRange",value:function(xt,kt){var St=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Tt=this.props.layout,At=xt/St,Et=kt/St;if(Tt==="horizontal"||Tt==="vertical"){var Ct=this.state.offset,Lt=At>=Ct.left&&At<=Ct.left+Ct.width&&Et>=Ct.top&&Et<=Ct.top+Ct.height;return Lt?{x:At,y:Et}:null}var jt=this.state,Rt=jt.angleAxisMap,$t=jt.radiusAxisMap;if(Rt&&$t){var vt=getAnyElementOfObject(Rt);return inRangeOfSector({x:At,y:Et},vt)}return null}},{key:"parseEventsOfWrapper",value:function(){var xt=this.props.children,kt=this.getTooltipEventType(),St=findChildByType(xt,Tooltip),Tt={};St&&kt==="axis"&&(St.props.trigger==="click"?Tt={onClick:this.handleClick}:Tt={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var At=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread$1(_objectSpread$1({},At),Tt)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent),eventCenter.setMaxListeners&&eventCenter._maxListeners&&eventCenter.setMaxListeners(eventCenter._maxListeners+1)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent),eventCenter.setMaxListeners&&eventCenter._maxListeners&&eventCenter.setMaxListeners(eventCenter._maxListeners-1)}},{key:"triggerSyncEvent",value:function(xt){var kt=this.props.syncId;_isNil(kt)||eventCenter.emit(SYNC_EVENT,kt,this.uniqueChartId,xt)}},{key:"applySyncEvent",value:function(xt){var kt=this.props,St=kt.layout,Tt=kt.syncMethod,At=this.state.updateId,Et=xt.dataStartIndex,Ct=xt.dataEndIndex;if(!_isNil(xt.dataStartIndex)||!_isNil(xt.dataEndIndex))this.setState(_objectSpread$1({dataStartIndex:Et,dataEndIndex:Ct},mt({props:this.props,dataStartIndex:Et,dataEndIndex:Ct,updateId:At},this.state)));else if(_isNil(xt.activeTooltipIndex))this.setState(xt);else{var Lt=xt.chartX,jt=xt.chartY,Rt=xt.activeTooltipIndex,$t=this.state,vt=$t.offset,It=$t.tooltipTicks;if(!vt)return;if(typeof Tt=="function")Rt=Tt(It,xt);else if(Tt==="value"){Rt=-1;for(var Ot=0;OtjsxRuntimeExports.jsx(Dot,{cx:tt,cy:et,fill:colors.blueTextAccent,r:2}),SentimentChart=({data:tt,width:et=500,height:nt=300})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(tt==null?void 0:tt.length)&&jsxRuntimeExports.jsxs(LineChart,{data:tt,height:nt,id:"cy-sentiment-chart",margin:{bottom:5,left:-20,right:30,top:5},width:et,children:[jsxRuntimeExports.jsx(CartesianGrid,{stroke:colors.lightBlue300,strokeDasharray:"5 5"}),jsxRuntimeExports.jsx(XAxis,{dataKey:"date",interval:Math.floor(tt.length/3),stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(YAxis,{domain:[0,10],stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(Tooltip,{}),jsxRuntimeExports.jsx(Line,{dataKey:"score",dot:jsxRuntimeExports.jsx(RenderDot$1,{}),stroke:"#8884d8",type:"monotone"})]})}),SentimentAnalysis=reactExports.memo(()=>{const tt=useAppStore(mt=>mt.currentSearch),[et,nt]=reactExports.useState(void 0),rt=hooks().startOf("day"),it=hooks().subtract(1,"year"),ot=3600*24,[at]=useUserStore(mt=>[mt.setBudget]),[st,lt]=reactExports.useState(hooks().startOf("day").subtract(20,"day")),ct=(Math.round((rt.unix()-st.unix())/ot)+1)*50,[ut,ht]=reactExports.useState(!1),dt=async()=>{tt&&(ht(!0),await executeIfProd(()=>distExports$1.enable()),getSentimentData({topic:tt,cutoff_date:String(st.unix())}).then(async mt=>{nt(mt==null?void 0:mt.data.filter(gt=>gt.date).map(gt=>({date:hooks.unix(Number(String(gt.date).split(".")[0])).format("MM/DD/YY"),score:gt.sentiment_score}))),await updateBudget(at)}).catch(console.error).finally(()=>{ht(!1)}))},pt=reactExports.useRef(null);return jsxRuntimeExports.jsxs(Stack$3,{component:"div",flexGrow:1,p:1,spacing:2,width:"100%",children:[ut&&jsxRuntimeExports.jsx(Stack$3,{alignItems:"center",component:"div",flexGrow:1,p:4,spacing:2,width:"100%",children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),!ut&&jsxRuntimeExports.jsxs(ChartWrapper$1,{ref:pt,children:[jsxRuntimeExports.jsx(SentimentChart,{data:et,height:280,width:352}),Array.isArray(et)&&!ut&&!et.length&&jsxRuntimeExports.jsx(Text$1,{children:"No data for this period"})]}),jsxRuntimeExports.jsx(DatePicker,{format:"L",label:"From",maxDate:rt,minDate:it,onChange:mt=>lt(mt??hooks()),sx:{background:colors.inputBg1,color:"text.primary"},value:st}),jsxRuntimeExports.jsx(Slider$1,{component:"div",getAriaValueText:mt=>hooks(mt).format("L"),id:"cy-sentiment-analysis-slider",marks:!0,max:rt.unix(),min:it.unix(),onChange:(mt,gt)=>{lt(hooks.unix(gt))},step:ot,value:st.unix(),valueLabelDisplay:"auto",valueLabelFormat:mt=>hooks.unix(mt).format("L")}),jsxRuntimeExports.jsxs(StyledButton$2,{className:"button",id:"cy-get-sentiment-analysis-btn",onClick:dt,children:["Create a chart for ",ct.toFixed()," SATS"]})]})}),ChartWrapper$1=styled$4.div` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$3(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$3(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$3(tt,et)}}function _iterableToArray$1(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$1(tt){if(Array.isArray(tt))return _arrayLikeToArray$3(tt)}function _arrayLikeToArray$3(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt0?st:rt&&rt.props&&rt.props.data&&rt.props.data.length>0?rt.props.data:et&&et.length&&isNumber(ot)&&isNumber(at)?et.slice(ot,at+1):[]};function getDefaultDomainByAxisType(tt){return tt==="number"?[0,"auto"]:void 0}var getTooltipContent=function(et,nt,rt,it){var ot=et.graphicalItems,at=et.tooltipAxis,st=getDisplayedData(nt,et);return rt<0||!ot||!ot.length||rt>=st.length?null:ot.reduce(function(lt,ct){var ut=ct.props.hide;if(ut)return lt;var ht=ct.props.data,dt=ht===void 0?nt:ht,pt;if(at.dataKey&&!at.allowDuplicatedCategory){var mt=dt===void 0?st:dt;pt=findEntryInArray(mt,at.dataKey,it)}else pt=dt&&dt[rt]||st[rt];return pt?[].concat(_toConsumableArray$1(lt),[getTooltipItem(ct,pt)]):lt},[])},getTooltipData=function(et,nt,rt,it){var ot=it||{x:et.chartX,y:et.chartY},at=calculateTooltipPos(ot,rt),st=et.orderedTooltipTicks,lt=et.tooltipAxis,ct=et.tooltipTicks,ut=calculateActiveTickIndex(at,st,ct,lt);if(ut>=0&&ct){var ht=ct[ut]&&ct[ut].value,dt=getTooltipContent(et,nt,ut,ht),pt=getActiveCoordinate(rt,st,ut,ot);return{activeTooltipIndex:ut,activeLabel:ht,activePayload:dt,activeCoordinate:pt}}return null},getAxisMapByAxes=function(et,nt){var rt=nt.axes,it=nt.graphicalItems,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=et.stackOffset,pt=isCategoricalAxis(ut,ot),mt=rt.reduce(function(gt,yt){var bt,wt=yt.props,xt=wt.type,kt=wt.dataKey,St=wt.allowDataOverflow,Tt=wt.allowDuplicatedCategory,At=wt.scale,Et=wt.ticks,Ct=wt.includeHidden,Lt=yt.props[at];if(gt[Lt])return gt;var jt=getDisplayedData(et.data,{graphicalItems:it.filter(function(Ht){return Ht.props[at]===Lt}),dataStartIndex:lt,dataEndIndex:ct}),Rt=jt.length,$t,vt,It;isDomainSpecifiedByUser(yt.props.domain,St,xt)&&($t=parseSpecifiedDomain(yt.props.domain,null,St),pt&&(xt==="number"||At!=="auto")&&(It=getDomainOfDataByKey(jt,kt,"category")));var Ot=getDefaultDomainByAxisType(xt);if(!$t||$t.length===0){var Wt,zt=(Wt=yt.props.domain)!==null&&Wt!==void 0?Wt:Ot;if(kt){if($t=getDomainOfDataByKey(jt,kt,xt),xt==="category"&&pt){var Ft=hasDuplicate($t);Tt&&Ft?(vt=$t,$t=_range(0,Rt)):Tt||($t=parseDomainOfCategoryAxis(zt,$t,yt).reduce(function(Ht,Qt){return Ht.indexOf(Qt)>=0?Ht:[].concat(_toConsumableArray$1(Ht),[Qt])},[]))}else if(xt==="category")Tt?$t=$t.filter(function(Ht){return Ht!==""&&!_isNil(Ht)}):$t=parseDomainOfCategoryAxis(zt,$t,yt).reduce(function(Ht,Qt){return Ht.indexOf(Qt)>=0||Qt===""||_isNil(Qt)?Ht:[].concat(_toConsumableArray$1(Ht),[Qt])},[]);else if(xt==="number"){var Nt=parseErrorBarsOfAxis(jt,it.filter(function(Ht){return Ht.props[at]===Lt&&(Ct||!Ht.props.hide)}),kt,ot,ut);Nt&&($t=Nt)}pt&&(xt==="number"||At!=="auto")&&(It=getDomainOfDataByKey(jt,kt,"category"))}else pt?$t=_range(0,Rt):st&&st[Lt]&&st[Lt].hasStack&&xt==="number"?$t=dt==="expand"?[0,1]:getDomainOfStackGroups(st[Lt].stackGroups,lt,ct):$t=getDomainOfItemsWithSameAxis(jt,it.filter(function(Ht){return Ht.props[at]===Lt&&(Ct||!Ht.props.hide)}),xt,ut,!0);if(xt==="number")$t=detectReferenceElementsDomain(ht,$t,Lt,ot,Et),zt&&($t=parseSpecifiedDomain(zt,$t,St));else if(xt==="category"&&zt){var Ut=zt,Pt=$t.every(function(Ht){return Ut.indexOf(Ht)>=0});Pt&&($t=Ut)}}return _objectSpread$1(_objectSpread$1({},gt),{},_defineProperty$1({},Lt,_objectSpread$1(_objectSpread$1({},yt.props),{},{axisType:ot,domain:$t,categoricalDomain:It,duplicateDomain:vt,originalDomain:(bt=yt.props.domain)!==null&&bt!==void 0?bt:Ot,isCategorical:pt,layout:ut})))},{});return mt},getAxisMapByItems=function(et,nt){var rt=nt.graphicalItems,it=nt.Axis,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=getDisplayedData(et.data,{graphicalItems:rt,dataStartIndex:lt,dataEndIndex:ct}),pt=dt.length,mt=isCategoricalAxis(ut,ot),gt=-1,yt=rt.reduce(function(bt,wt){var xt=wt.props[at],kt=getDefaultDomainByAxisType("number");if(!bt[xt]){gt++;var St;return mt?St=_range(0,pt):st&&st[xt]&&st[xt].hasStack?(St=getDomainOfStackGroups(st[xt].stackGroups,lt,ct),St=detectReferenceElementsDomain(ht,St,xt,ot)):(St=parseSpecifiedDomain(kt,getDomainOfItemsWithSameAxis(dt,rt.filter(function(Tt){return Tt.props[at]===xt&&!Tt.props.hide}),"number",ut),it.defaultProps.allowDataOverflow),St=detectReferenceElementsDomain(ht,St,xt,ot)),_objectSpread$1(_objectSpread$1({},bt),{},_defineProperty$1({},xt,_objectSpread$1(_objectSpread$1({axisType:ot},it.defaultProps),{},{hide:!0,orientation:_get(ORIENT_MAP,"".concat(ot,".").concat(gt%2),null),domain:St,originalDomain:kt,isCategorical:mt,layout:ut})))}return bt},{});return yt},getAxisMap=function(et,nt){var rt=nt.axisType,it=rt===void 0?"xAxis":rt,ot=nt.AxisComp,at=nt.graphicalItems,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.children,ht="".concat(it,"Id"),dt=findAllByType(ut,ot),pt={};return dt&&dt.length?pt=getAxisMapByAxes(et,{axes:dt,graphicalItems:at,axisType:it,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct}):at&&at.length&&(pt=getAxisMapByItems(et,{Axis:ot,graphicalItems:at,axisType:it,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct})),pt},tooltipTicksGenerator=function(et){var nt=getAnyElementOfObject(et),rt=getTicksOfAxis(nt,!1,!0);return{tooltipTicks:rt,orderedTooltipTicks:_sortBy(rt,function(it){return it.coordinate}),tooltipAxis:nt,tooltipAxisBandSize:getBandSizeOfAxis(nt,rt)}},createDefaultState=function(et){var nt,rt,it=et.children,ot=et.defaultShowTooltip,at=findChildByType(it,Brush),st=at&&at.props&&at.props.startIndex||0,lt=(at==null||(nt=at.props)===null||nt===void 0?void 0:nt.endIndex)!==void 0?at==null||(rt=at.props)===null||rt===void 0?void 0:rt.endIndex:et.data&&et.data.length-1||0;return{chartX:0,chartY:0,dataStartIndex:st,dataEndIndex:lt,activeTooltipIndex:-1,isTooltipActive:_isNil(ot)?!1:ot}},hasGraphicalBarItem=function(et){return!et||!et.length?!1:et.some(function(nt){var rt=getDisplayName(nt&&nt.type);return rt&&rt.indexOf("Bar")>=0})},getAxisNameByLayout=function(et){return et==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:et==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:et==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function(et,nt){var rt=et.props,it=et.graphicalItems,ot=et.xAxisMap,at=ot===void 0?{}:ot,st=et.yAxisMap,lt=st===void 0?{}:st,ct=rt.width,ut=rt.height,ht=rt.children,dt=rt.margin||{},pt=findChildByType(ht,Brush),mt=findChildByType(ht,Legend),gt=Object.keys(lt).reduce(function(xt,kt){var St=lt[kt],Tt=St.orientation;return!St.mirror&&!St.hide?_objectSpread$1(_objectSpread$1({},xt),{},_defineProperty$1({},Tt,xt[Tt]+St.width)):xt},{left:dt.left||0,right:dt.right||0}),yt=Object.keys(at).reduce(function(xt,kt){var St=at[kt],Tt=St.orientation;return!St.mirror&&!St.hide?_objectSpread$1(_objectSpread$1({},xt),{},_defineProperty$1({},Tt,_get(xt,"".concat(Tt))+St.height)):xt},{top:dt.top||0,bottom:dt.bottom||0}),bt=_objectSpread$1(_objectSpread$1({},yt),gt),wt=bt.bottom;return pt&&(bt.bottom+=pt.props.height||Brush.defaultProps.height),mt&&nt&&(bt=appendOffsetOfLegend(bt,it,rt,nt)),_objectSpread$1(_objectSpread$1({brushBottom:wt},bt),{},{width:ct-bt.left-bt.right,height:ut-bt.top-bt.bottom})},generateCategoricalChart=function(et){var nt,rt=et.chartName,it=et.GraphicalChild,ot=et.defaultTooltipEventType,at=ot===void 0?"axis":ot,st=et.validateTooltipEventTypes,lt=st===void 0?["axis"]:st,ct=et.axisComponents,ut=et.legendContent,ht=et.formatAxisMap,dt=et.defaultProps,pt=function(yt,bt){var wt=bt.graphicalItems,xt=bt.stackGroups,kt=bt.offset,St=bt.updateId,Tt=bt.dataStartIndex,At=bt.dataEndIndex,Et=yt.barSize,Ct=yt.layout,Lt=yt.barGap,jt=yt.barCategoryGap,Rt=yt.maxBarSize,$t=getAxisNameByLayout(Ct),vt=$t.numericAxisName,It=$t.cateAxisName,Ot=hasGraphicalBarItem(wt),Wt=Ot&&getBarSizeList({barSize:Et,stackGroups:xt}),zt=[];return wt.forEach(function(Ft,Nt){var Ut=getDisplayedData(yt.data,{dataStartIndex:Tt,dataEndIndex:At},Ft),Pt=Ft.props,Ht=Pt.dataKey,Qt=Pt.maxBarSize,an=Ft.props["".concat(vt,"Id")],Yt=Ft.props["".concat(It,"Id")],nn={},tn=ct.reduce(function(In,yn){var hn,fn=bt["".concat(yn.axisType,"Map")],xn=Ft.props["".concat(yn.axisType,"Id")];fn&&fn[xn]||yn.axisType==="zAxis"||invariant(!1);var jn=fn[xn];return _objectSpread$1(_objectSpread$1({},In),{},(hn={},_defineProperty$1(hn,yn.axisType,jn),_defineProperty$1(hn,"".concat(yn.axisType,"Ticks"),getTicksOfAxis(jn)),hn))},nn),dn=tn[It],wn=tn["".concat(It,"Ticks")],rn=xt&&xt[an]&&xt[an].hasStack&&getStackedDataOfItem(Ft,xt[an].stackGroups),Zt=getDisplayName(Ft.type).indexOf("Bar")>=0,vn=getBandSizeOfAxis(dn,wn),Cn=[];if(Zt){var $n,Nn,En=_isNil(Qt)?Rt:Qt,sn=($n=(Nn=getBandSizeOfAxis(dn,wn,!0))!==null&&Nn!==void 0?Nn:En)!==null&&$n!==void 0?$n:0;Cn=getBarPosition({barGap:Lt,barCategoryGap:jt,bandSize:sn!==vn?sn:vn,sizeList:Wt[Yt],maxBarSize:En}),sn!==vn&&(Cn=Cn.map(function(In){return _objectSpread$1(_objectSpread$1({},In),{},{position:_objectSpread$1(_objectSpread$1({},In.position),{},{offset:In.position.offset-sn/2})})}))}var pn=Ft&&Ft.type&&Ft.type.getComposedData;if(pn){var Tn;zt.push({props:_objectSpread$1(_objectSpread$1({},pn(_objectSpread$1(_objectSpread$1({},tn),{},{displayedData:Ut,props:yt,dataKey:Ht,item:Ft,bandSize:vn,barPosition:Cn,offset:kt,stackedData:rn,layout:Ct,dataStartIndex:Tt,dataEndIndex:At}))),{},(Tn={key:Ft.key||"item-".concat(Nt)},_defineProperty$1(Tn,vt,tn[vt]),_defineProperty$1(Tn,It,tn[It]),_defineProperty$1(Tn,"animationId",St),Tn)),childIndex:parseChildIndex(Ft,yt.children),item:Ft})}}),zt},mt=function(yt,bt){var wt=yt.props,xt=yt.dataStartIndex,kt=yt.dataEndIndex,St=yt.updateId;if(!validateWidthHeight({props:wt}))return null;var Tt=wt.children,At=wt.layout,Et=wt.stackOffset,Ct=wt.data,Lt=wt.reverseStackOrder,jt=getAxisNameByLayout(At),Rt=jt.numericAxisName,$t=jt.cateAxisName,vt=findAllByType(Tt,it),It=getStackGroupsByAxisId(Ct,vt,"".concat(Rt,"Id"),"".concat($t,"Id"),Et,Lt),Ot=ct.reduce(function(Ut,Pt){var Ht="".concat(Pt.axisType,"Map");return _objectSpread$1(_objectSpread$1({},Ut),{},_defineProperty$1({},Ht,getAxisMap(wt,_objectSpread$1(_objectSpread$1({},Pt),{},{graphicalItems:vt,stackGroups:Pt.axisType===Rt&&It,dataStartIndex:xt,dataEndIndex:kt}))))},{}),Wt=calculateOffset(_objectSpread$1(_objectSpread$1({},Ot),{},{props:wt,graphicalItems:vt}),bt==null?void 0:bt.legendBBox);Object.keys(Ot).forEach(function(Ut){Ot[Ut]=ht(wt,Ot[Ut],Wt,Ut.replace("Map",""),rt)});var zt=Ot["".concat($t,"Map")],Ft=tooltipTicksGenerator(zt),Nt=pt(wt,_objectSpread$1(_objectSpread$1({},Ot),{},{dataStartIndex:xt,dataEndIndex:kt,updateId:St,graphicalItems:vt,stackGroups:It,offset:Wt}));return _objectSpread$1(_objectSpread$1({formattedGraphicalItems:Nt,graphicalItems:vt,offset:Wt,stackGroups:It},Ft),Ot)};return nt=function(gt){_inherits$1(bt,gt);var yt=_createSuper$1(bt);function bt(wt){var xt;return _classCallCheck$1(this,bt),xt=yt.call(this,wt),_defineProperty$1(_assertThisInitialized$1(xt),"accessibilityManager",new AccessibilityManager),_defineProperty$1(_assertThisInitialized$1(xt),"clearDefer",function(){xt.cancelDefer&&(xt.cancelDefer(),xt.cancelDefer=null)}),_defineProperty$1(_assertThisInitialized$1(xt),"handleLegendBBoxUpdate",function(kt){if(kt){var St=xt.state,Tt=St.dataStartIndex,At=St.dataEndIndex,Et=St.updateId;xt.setState(_objectSpread$1({legendBBox:kt},mt({props:xt.props,dataStartIndex:Tt,dataEndIndex:At,updateId:Et},_objectSpread$1(_objectSpread$1({},xt.state),{},{legendBBox:kt}))))}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleReceiveSyncEvent",function(kt,St,Tt){var At=xt.props.syncId;At===kt&&St!==xt.uniqueChartId&&(xt.clearDefer(),xt.cancelDefer=deferer(xt.applySyncEvent.bind(_assertThisInitialized$1(xt),Tt)))}),_defineProperty$1(_assertThisInitialized$1(xt),"handleBrushChange",function(kt){var St=kt.startIndex,Tt=kt.endIndex;if(St!==xt.state.dataStartIndex||Tt!==xt.state.dataEndIndex){var At=xt.state.updateId;xt.setState(function(){return _objectSpread$1({dataStartIndex:St,dataEndIndex:Tt},mt({props:xt.props,dataStartIndex:St,dataEndIndex:Tt,updateId:At},xt.state))}),xt.triggerSyncEvent({dataStartIndex:St,dataEndIndex:Tt})}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseEnter",function(kt){var St=xt.props.onMouseEnter,Tt=xt.getMouseInfo(kt);if(Tt){var At=_objectSpread$1(_objectSpread$1({},Tt),{},{isTooltipActive:!0});xt.setState(At),xt.triggerSyncEvent(At),_isFunction$1(St)&&St(At,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"triggeredAfterMouseMove",function(kt){var St=xt.props.onMouseMove,Tt=xt.getMouseInfo(kt),At=Tt?_objectSpread$1(_objectSpread$1({},Tt),{},{isTooltipActive:!0}):{isTooltipActive:!1};xt.setState(At),xt.triggerSyncEvent(At),_isFunction$1(St)&&St(At,kt)}),_defineProperty$1(_assertThisInitialized$1(xt),"handleItemMouseEnter",function(kt){xt.setState(function(){return{isTooltipActive:!0,activeItem:kt,activePayload:kt.tooltipPayload,activeCoordinate:kt.tooltipPosition||{x:kt.cx,y:kt.cy}}})}),_defineProperty$1(_assertThisInitialized$1(xt),"handleItemMouseLeave",function(){xt.setState(function(){return{isTooltipActive:!1}})}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseMove",function(kt){kt&&_isFunction$1(kt.persist)&&kt.persist(),xt.triggeredAfterMouseMove(kt)}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseLeave",function(kt){var St=xt.props.onMouseLeave,Tt={isTooltipActive:!1};xt.setState(Tt),xt.triggerSyncEvent(Tt),_isFunction$1(St)&&St(Tt,kt),xt.cancelThrottledTriggerAfterMouseMove()}),_defineProperty$1(_assertThisInitialized$1(xt),"handleOuterEvent",function(kt){var St=getReactEventByType(kt),Tt=_get(xt.props,"".concat(St));if(St&&_isFunction$1(Tt)){var At;/.*touch.*/i.test(St)?At=xt.getMouseInfo(kt.changedTouches[0]):At=xt.getMouseInfo(kt);var Et=Tt;Et(At,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleClick",function(kt){var St=xt.props.onClick,Tt=xt.getMouseInfo(kt);if(Tt){var At=_objectSpread$1(_objectSpread$1({},Tt),{},{isTooltipActive:!0});xt.setState(At),xt.triggerSyncEvent(At),_isFunction$1(St)&&St(At,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseDown",function(kt){var St=xt.props.onMouseDown;if(_isFunction$1(St)){var Tt=xt.getMouseInfo(kt);St(Tt,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleMouseUp",function(kt){var St=xt.props.onMouseUp;if(_isFunction$1(St)){var Tt=xt.getMouseInfo(kt);St(Tt,kt)}}),_defineProperty$1(_assertThisInitialized$1(xt),"handleTouchMove",function(kt){kt.changedTouches!=null&&kt.changedTouches.length>0&&xt.handleMouseMove(kt.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(xt),"handleTouchStart",function(kt){kt.changedTouches!=null&&kt.changedTouches.length>0&&xt.handleMouseDown(kt.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(xt),"handleTouchEnd",function(kt){kt.changedTouches!=null&&kt.changedTouches.length>0&&xt.handleMouseUp(kt.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(xt),"verticalCoordinatesGenerator",function(kt,St){var Tt=kt.xAxis,At=kt.width,Et=kt.height,Ct=kt.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$1(_objectSpread$1(_objectSpread$1({},CartesianAxis.defaultProps),Tt),{},{ticks:getTicksOfAxis(Tt,!0),viewBox:{x:0,y:0,width:At,height:Et}})),Ct.left,Ct.left+Ct.width,St)}),_defineProperty$1(_assertThisInitialized$1(xt),"horizontalCoordinatesGenerator",function(kt,St){var Tt=kt.yAxis,At=kt.width,Et=kt.height,Ct=kt.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$1(_objectSpread$1(_objectSpread$1({},CartesianAxis.defaultProps),Tt),{},{ticks:getTicksOfAxis(Tt,!0),viewBox:{x:0,y:0,width:At,height:Et}})),Ct.top,Ct.top+Ct.height,St)}),_defineProperty$1(_assertThisInitialized$1(xt),"axesTicksGenerator",function(kt){return getTicksOfAxis(kt,!0)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderCursor",function(kt){var St=xt.state,Tt=St.isTooltipActive,At=St.activeCoordinate,Et=St.activePayload,Ct=St.offset,Lt=St.activeTooltipIndex,jt=St.tooltipAxisBandSize,Rt=xt.getTooltipEventType();if(!kt||!kt.props.cursor||!Tt||!At||rt!=="ScatterChart"&&Rt!=="axis")return null;var $t=xt.props.layout,vt,It=Curve;if(rt==="ScatterChart")vt=At,It=Cross;else if(rt==="BarChart")vt=getCursorRectangle($t,At,Ct,jt),It=Rectangle;else if($t==="radial"){var Ot=getRadialCursorPoints(At),Wt=Ot.cx,zt=Ot.cy,Ft=Ot.radius,Nt=Ot.startAngle,Ut=Ot.endAngle;vt={cx:Wt,cy:zt,startAngle:Nt,endAngle:Ut,innerRadius:Ft,outerRadius:Ft},It=Sector}else vt={points:getCursorPoints($t,At,Ct)},It=Curve;var Pt=kt.key||"_recharts-cursor",Ht=_objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({stroke:"#ccc",pointerEvents:"none"},Ct),vt),filterProps(kt.props.cursor)),{},{payload:Et,payloadIndex:Lt,key:Pt,className:"recharts-tooltip-cursor"});return reactExports.isValidElement(kt.props.cursor)?reactExports.cloneElement(kt.props.cursor,Ht):reactExports.createElement(It,Ht)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderPolarAxis",function(kt,St,Tt){var At=_get(kt,"type.axisType"),Et=_get(xt.state,"".concat(At,"Map")),Ct=Et&&Et[kt.props["".concat(At,"Id")]];return reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1({},Ct),{},{className:At,key:kt.key||"".concat(St,"-").concat(Tt),ticks:getTicksOfAxis(Ct,!0)}))}),_defineProperty$1(_assertThisInitialized$1(xt),"renderXAxis",function(kt,St,Tt){var At=xt.state.xAxisMap,Et=At[kt.props.xAxisId];return xt.renderAxis(Et,kt,St,Tt)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderYAxis",function(kt,St,Tt){var At=xt.state.yAxisMap,Et=At[kt.props.yAxisId];return xt.renderAxis(Et,kt,St,Tt)}),_defineProperty$1(_assertThisInitialized$1(xt),"renderGrid",function(kt){var St=xt.state,Tt=St.xAxisMap,At=St.yAxisMap,Et=St.offset,Ct=xt.props,Lt=Ct.width,jt=Ct.height,Rt=getAnyElementOfObject(Tt),$t=_find(At,function(Ot){return _every(Ot.domain,isFinit)}),vt=$t||getAnyElementOfObject(At),It=kt.props||{};return reactExports.cloneElement(kt,{key:kt.key||"grid",x:isNumber(It.x)?It.x:Et.left,y:isNumber(It.y)?It.y:Et.top,width:isNumber(It.width)?It.width:Et.width,height:isNumber(It.height)?It.height:Et.height,xAxis:Rt,yAxis:vt,offset:Et,chartWidth:Lt,chartHeight:jt,verticalCoordinatesGenerator:It.verticalCoordinatesGenerator||xt.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:It.horizontalCoordinatesGenerator||xt.horizontalCoordinatesGenerator})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderPolarGrid",function(kt){var St=kt.props,Tt=St.radialLines,At=St.polarAngles,Et=St.polarRadius,Ct=xt.state,Lt=Ct.radiusAxisMap,jt=Ct.angleAxisMap,Rt=getAnyElementOfObject(Lt),$t=getAnyElementOfObject(jt),vt=$t.cx,It=$t.cy,Ot=$t.innerRadius,Wt=$t.outerRadius;return reactExports.cloneElement(kt,{polarAngles:_isArray$1(At)?At:getTicksOfAxis($t,!0).map(function(zt){return zt.coordinate}),polarRadius:_isArray$1(Et)?Et:getTicksOfAxis(Rt,!0).map(function(zt){return zt.coordinate}),cx:vt,cy:It,innerRadius:Ot,outerRadius:Wt,key:kt.key||"polar-grid",radialLines:Tt})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderLegend",function(){var kt=xt.state.formattedGraphicalItems,St=xt.props,Tt=St.children,At=St.width,Et=St.height,Ct=xt.props.margin||{},Lt=At-(Ct.left||0)-(Ct.right||0),jt=getLegendProps({children:Tt,formattedGraphicalItems:kt,legendWidth:Lt,legendContent:ut});if(!jt)return null;var Rt=jt.item,$t=_objectWithoutProperties(jt,_excluded);return reactExports.cloneElement(Rt,_objectSpread$1(_objectSpread$1({},$t),{},{chartWidth:At,chartHeight:Et,margin:Ct,onBBoxUpdate:xt.handleLegendBBoxUpdate}))}),_defineProperty$1(_assertThisInitialized$1(xt),"renderTooltip",function(){var kt=xt.props.children,St=findChildByType(kt,Tooltip);if(!St)return null;var Tt=xt.state,At=Tt.isTooltipActive,Et=Tt.activeCoordinate,Ct=Tt.activePayload,Lt=Tt.activeLabel,jt=Tt.offset;return reactExports.cloneElement(St,{viewBox:_objectSpread$1(_objectSpread$1({},jt),{},{x:jt.left,y:jt.top}),active:At,label:Lt,payload:At?Ct:[],coordinate:Et})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderBrush",function(kt){var St=xt.props,Tt=St.margin,At=St.data,Et=xt.state,Ct=Et.offset,Lt=Et.dataStartIndex,jt=Et.dataEndIndex,Rt=Et.updateId;return reactExports.cloneElement(kt,{key:kt.key||"_recharts-brush",onChange:combineEventHandlers(xt.handleBrushChange,null,kt.props.onChange),data:At,x:isNumber(kt.props.x)?kt.props.x:Ct.left,y:isNumber(kt.props.y)?kt.props.y:Ct.top+Ct.height+Ct.brushBottom-(Tt.bottom||0),width:isNumber(kt.props.width)?kt.props.width:Ct.width,startIndex:Lt,endIndex:jt,updateId:"brush-".concat(Rt)})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderReferenceElement",function(kt,St,Tt){if(!kt)return null;var At=_assertThisInitialized$1(xt),Et=At.clipPathId,Ct=xt.state,Lt=Ct.xAxisMap,jt=Ct.yAxisMap,Rt=Ct.offset,$t=kt.props,vt=$t.xAxisId,It=$t.yAxisId;return reactExports.cloneElement(kt,{key:kt.key||"".concat(St,"-").concat(Tt),xAxis:Lt[vt],yAxis:jt[It],viewBox:{x:Rt.left,y:Rt.top,width:Rt.width,height:Rt.height},clipPathId:Et})}),_defineProperty$1(_assertThisInitialized$1(xt),"renderActivePoints",function(kt){var St=kt.item,Tt=kt.activePoint,At=kt.basePoint,Et=kt.childIndex,Ct=kt.isRange,Lt=[],jt=St.props.key,Rt=St.item.props,$t=Rt.activeDot,vt=Rt.dataKey,It=_objectSpread$1(_objectSpread$1({index:Et,dataKey:vt,cx:Tt.x,cy:Tt.y,r:4,fill:getMainColorOfGraphicItem(St.item),strokeWidth:2,stroke:"#fff",payload:Tt.payload,value:Tt.value,key:"".concat(jt,"-activePoint-").concat(Et)},filterProps($t)),adaptEventHandlers($t));return Lt.push(bt.renderActiveDot($t,It)),At?Lt.push(bt.renderActiveDot($t,_objectSpread$1(_objectSpread$1({},It),{},{cx:At.x,cy:At.y,key:"".concat(jt,"-basePoint-").concat(Et)}))):Ct&&Lt.push(null),Lt}),_defineProperty$1(_assertThisInitialized$1(xt),"renderGraphicChild",function(kt,St,Tt){var At=xt.filterFormatItem(kt,St,Tt);if(!At)return null;var Et=xt.getTooltipEventType(),Ct=xt.state,Lt=Ct.isTooltipActive,jt=Ct.tooltipAxis,Rt=Ct.activeTooltipIndex,$t=Ct.activeLabel,vt=xt.props.children,It=findChildByType(vt,Tooltip),Ot=At.props,Wt=Ot.points,zt=Ot.isRange,Ft=Ot.baseLine,Nt=At.item.props,Ut=Nt.activeDot,Pt=Nt.hide,Ht=Nt.activeBar,Qt=Nt.activeShape,an=!!(!Pt&&Lt&&It&&(Ut||Ht||Qt)),Yt={};Et!=="axis"&&It&&It.props.trigger==="click"?Yt={onClick:combineEventHandlers(xt.handleItemMouseEnter,null,kt.props.onCLick)}:Et!=="axis"&&(Yt={onMouseLeave:combineEventHandlers(xt.handleItemMouseLeave,null,kt.props.onMouseLeave),onMouseEnter:combineEventHandlers(xt.handleItemMouseEnter,null,kt.props.onMouseEnter)});var nn=reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1({},At.props),Yt));function tn(Tn){return typeof jt.dataKey=="function"?jt.dataKey(Tn.payload):null}if(an)if(Rt>=0){var dn,wn;if(jt.dataKey&&!jt.allowDuplicatedCategory){var rn=typeof jt.dataKey=="function"?tn:"payload.".concat(jt.dataKey.toString());dn=findEntryInArray(Wt,rn,$t),wn=zt&&Ft&&findEntryInArray(Ft,rn,$t)}else dn=Wt==null?void 0:Wt[Rt],wn=zt&&Ft&&Ft[Rt];if(Qt||Ht){var Zt=kt.props.activeIndex!==void 0?kt.props.activeIndex:Rt;return[reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1(_objectSpread$1({},At.props),Yt),{},{activeIndex:Zt})),null,null]}if(!_isNil(dn))return[nn].concat(_toConsumableArray$1(xt.renderActivePoints({item:At,activePoint:dn,basePoint:wn,childIndex:Rt,isRange:zt})))}else{var vn,Cn=(vn=xt.getItemByXY(xt.state.activeCoordinate))!==null&&vn!==void 0?vn:{graphicalItem:nn},$n=Cn.graphicalItem,Nn=$n.item,En=Nn===void 0?kt:Nn,sn=$n.childIndex,pn=_objectSpread$1(_objectSpread$1(_objectSpread$1({},At.props),Yt),{},{activeIndex:sn});return[reactExports.cloneElement(En,pn),null,null]}return zt?[nn,null,null]:[nn,null]}),_defineProperty$1(_assertThisInitialized$1(xt),"renderCustomized",function(kt,St,Tt){return reactExports.cloneElement(kt,_objectSpread$1(_objectSpread$1({key:"recharts-customized-".concat(Tt)},xt.props),xt.state))}),xt.uniqueChartId=_isNil(wt.id)?uniqueId("recharts"):wt.id,xt.clipPathId="".concat(xt.uniqueChartId,"-clip"),wt.throttleDelay&&(xt.triggeredAfterMouseMove=_throttle(xt.triggeredAfterMouseMove,wt.throttleDelay)),xt.state={},xt}return _createClass$1(bt,[{key:"componentDidMount",value:function(){var xt,kt;_isNil(this.props.syncId)||this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(xt=this.props.margin.left)!==null&&xt!==void 0?xt:0,top:(kt=this.props.margin.top)!==null&&kt!==void 0?kt:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.handleMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(xt,kt){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==kt.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==xt.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==xt.margin){var St,Tt;this.accessibilityManager.setDetails({offset:{left:(St=this.props.margin.left)!==null&&St!==void 0?St:0,top:(Tt=this.props.margin.top)!==null&&Tt!==void 0?Tt:0}})}return null}},{key:"componentDidUpdate",value:function(xt){_isNil(xt.syncId)&&!_isNil(this.props.syncId)&&this.addListener(),!_isNil(xt.syncId)&&_isNil(this.props.syncId)&&this.removeListener()}},{key:"componentWillUnmount",value:function(){this.clearDefer(),_isNil(this.props.syncId)||this.removeListener(),this.cancelThrottledTriggerAfterMouseMove()}},{key:"cancelThrottledTriggerAfterMouseMove",value:function(){typeof this.triggeredAfterMouseMove.cancel=="function"&&this.triggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var xt=findChildByType(this.props.children,Tooltip);if(xt&&_isBoolean(xt.props.shared)){var kt=xt.props.shared?"axis":"item";return lt.indexOf(kt)>=0?kt:at}return at}},{key:"getMouseInfo",value:function(xt){var kt;if(!this.container)return null;var St=getOffset(this.container),Tt=calculateChartCoordinate(xt,St),At=this.container,Et=At==null||(kt=At.getBoundingClientRect())===null||kt===void 0?void 0:kt.width,Ct=At.offsetWidth,Lt=Et/Ct||1,jt=this.inRange(Tt.chartX,Tt.chartY,Lt);if(!jt)return null;var Rt=this.state,$t=Rt.xAxisMap,vt=Rt.yAxisMap,It=this.getTooltipEventType();if(It!=="axis"&&$t&&vt){var Ot=getAnyElementOfObject($t).scale,Wt=getAnyElementOfObject(vt).scale,zt=Ot&&Ot.invert?Ot.invert(Tt.chartX):null,Ft=Wt&&Wt.invert?Wt.invert(Tt.chartY):null;return _objectSpread$1(_objectSpread$1({},Tt),{},{xValue:zt,yValue:Ft})}var Nt=getTooltipData(this.state,this.props.data,this.props.layout,jt);return Nt?_objectSpread$1(_objectSpread$1({},Tt),Nt):null}},{key:"inRange",value:function(xt,kt){var St=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Tt=this.props.layout,At=xt/St,Et=kt/St;if(Tt==="horizontal"||Tt==="vertical"){var Ct=this.state.offset,Lt=At>=Ct.left&&At<=Ct.left+Ct.width&&Et>=Ct.top&&Et<=Ct.top+Ct.height;return Lt?{x:At,y:Et}:null}var jt=this.state,Rt=jt.angleAxisMap,$t=jt.radiusAxisMap;if(Rt&&$t){var vt=getAnyElementOfObject(Rt);return inRangeOfSector({x:At,y:Et},vt)}return null}},{key:"parseEventsOfWrapper",value:function(){var xt=this.props.children,kt=this.getTooltipEventType(),St=findChildByType(xt,Tooltip),Tt={};St&&kt==="axis"&&(St.props.trigger==="click"?Tt={onClick:this.handleClick}:Tt={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var At=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread$1(_objectSpread$1({},At),Tt)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent),eventCenter.setMaxListeners&&eventCenter._maxListeners&&eventCenter.setMaxListeners(eventCenter._maxListeners+1)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent),eventCenter.setMaxListeners&&eventCenter._maxListeners&&eventCenter.setMaxListeners(eventCenter._maxListeners-1)}},{key:"triggerSyncEvent",value:function(xt){var kt=this.props.syncId;_isNil(kt)||eventCenter.emit(SYNC_EVENT,kt,this.uniqueChartId,xt)}},{key:"applySyncEvent",value:function(xt){var kt=this.props,St=kt.layout,Tt=kt.syncMethod,At=this.state.updateId,Et=xt.dataStartIndex,Ct=xt.dataEndIndex;if(!_isNil(xt.dataStartIndex)||!_isNil(xt.dataEndIndex))this.setState(_objectSpread$1({dataStartIndex:Et,dataEndIndex:Ct},mt({props:this.props,dataStartIndex:Et,dataEndIndex:Ct,updateId:At},this.state)));else if(_isNil(xt.activeTooltipIndex))this.setState(xt);else{var Lt=xt.chartX,jt=xt.chartY,Rt=xt.activeTooltipIndex,$t=this.state,vt=$t.offset,It=$t.tooltipTicks;if(!vt)return;if(typeof Tt=="function")Rt=Tt(It,xt);else if(Tt==="value"){Rt=-1;for(var Ot=0;OtjsxRuntimeExports.jsx(Dot,{cx:tt,cy:et,fill:colors.blueTextAccent,r:2}),SentimentChart=({data:tt,width:et=500,height:nt=300})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(tt==null?void 0:tt.length)&&jsxRuntimeExports.jsxs(LineChart,{data:tt,height:nt,id:"cy-sentiment-chart",margin:{bottom:5,left:-20,right:30,top:5},width:et,children:[jsxRuntimeExports.jsx(CartesianGrid,{stroke:colors.lightBlue300,strokeDasharray:"5 5"}),jsxRuntimeExports.jsx(XAxis,{dataKey:"date",interval:Math.floor(tt.length/3),stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(YAxis,{domain:[0,10],stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(Tooltip,{}),jsxRuntimeExports.jsx(Line,{dataKey:"score",dot:jsxRuntimeExports.jsx(RenderDot$1,{}),stroke:"#8884d8",type:"monotone"})]})}),SentimentAnalysis=reactExports.memo(()=>{const tt=useAppStore(mt=>mt.currentSearch),[et,nt]=reactExports.useState(void 0),rt=hooks().startOf("day"),it=hooks().subtract(1,"year"),ot=3600*24,[at]=useUserStore(mt=>[mt.setBudget]),[st,lt]=reactExports.useState(hooks().startOf("day").subtract(20,"day")),ct=(Math.round((rt.unix()-st.unix())/ot)+1)*50,[ut,ht]=reactExports.useState(!1),dt=async()=>{tt&&(ht(!0),await executeIfProd(()=>distExports$1.enable()),getSentimentData({topic:tt,cutoff_date:String(st.unix())}).then(async mt=>{nt(mt==null?void 0:mt.data.filter(gt=>gt.date).map(gt=>({date:hooks.unix(Number(String(gt.date).split(".")[0])).format("MM/DD/YY"),score:gt.sentiment_score}))),await updateBudget(at)}).catch(console.error).finally(()=>{ht(!1)}))},pt=reactExports.useRef(null);return jsxRuntimeExports.jsxs(Stack$3,{component:"div",flexGrow:1,p:1,spacing:2,width:"100%",children:[ut&&jsxRuntimeExports.jsx(Stack$3,{alignItems:"center",component:"div",flexGrow:1,p:4,spacing:2,width:"100%",children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),!ut&&jsxRuntimeExports.jsxs(ChartWrapper$1,{ref:pt,children:[jsxRuntimeExports.jsx(SentimentChart,{data:et,height:280,width:352}),Array.isArray(et)&&!ut&&!et.length&&jsxRuntimeExports.jsx(Text$1,{children:"No data for this period"})]}),jsxRuntimeExports.jsx(DatePicker,{format:"L",label:"From",maxDate:rt,minDate:it,onChange:mt=>lt(mt??hooks()),sx:{background:colors.inputBg1,color:"text.primary"},value:st}),jsxRuntimeExports.jsx(Slider$1,{component:"div",getAriaValueText:mt=>hooks(mt).format("L"),id:"cy-sentiment-analysis-slider",marks:!0,max:rt.unix(),min:it.unix(),onChange:(mt,gt)=>{lt(hooks.unix(gt))},step:ot,value:st.unix(),valueLabelDisplay:"auto",valueLabelFormat:mt=>hooks.unix(mt).format("L")}),jsxRuntimeExports.jsxs(StyledButton$2,{className:"button",id:"cy-get-sentiment-analysis-btn",onClick:dt,children:["Create a chart for ",ct.toFixed()," SATS"]})]})}),ChartWrapper$1=styled$4.div` flex: 1 1 auto; width: 100%; `,StyledButton$2=styled$4(Button)` height: 48px; -`,TABS=[{label:"Teach me",value:"teachMe"},{label:"Ask question",value:"askQuestion"},{label:"Sentiment Analysis",value:"sentiment"}],ActionsMenu=({onChange:tt,active:et})=>{const nt=(rt,it)=>{tt(TABS[it].value)};return et?jsxRuntimeExports.jsx(MenuWrapper,{direction:"row",id:"cy-helper-menu",maxWidth:"100%",mb:3,overflow:"auto",spacing:1,children:TABS.map((rt,it)=>jsxRuntimeExports.jsx(Chip$1,{color:rt.value===et?"primary":"default",component:"div",id:rt.value,label:rt.label,onClick:ot=>nt(ot,it)},rt.value))}):jsxRuntimeExports.jsx(Stack$3,{component:"div",flexGrow:1,id:"cy-helper-menu",justifyContent:"flex-end",mb:1,spacing:1,children:TABS.map((rt,it)=>jsxRuntimeExports.jsx(Chip$1,{component:"div",id:rt.value,label:rt.label,onClick:ot=>nt(ot,it)},rt.value))})},MenuWrapper=styled$1(Stack$3)(()=>({"&::-webkit-scrollbar":{width:"1px",height:"4px"},"&::-webkit-scrollbar-thumb":{width:"1px",height:"4px"}})),ITEM_HEIGHT=48,ITEM_PADDING_TOP=8,MenuProps={PaperProps:{style:{maxHeight:ITEM_HEIGHT*4.5+ITEM_PADDING_TOP,width:250}}},names=["Beginner","Intermediate","Advanced","Expert"],AskQuestion=()=>{const tt=useDataStore(xt=>xt.data),[et,nt]=reactExports.useState(""),[rt,it]=reactExports.useState("Beginner"),ot=useAppStore(xt=>xt.currentSearch),at=reactExports.useRef(!1),st=useSocket(),[lt]=useUserStore(xt=>[xt.setBudget]),[ct,ut,ht,dt,pt]=useTeachStore(xt=>[xt.askedQuestions,xt.askedQuestionsAnswers,xt.setAskedQuestion,xt.setAskedQuestionAnswer,xt.hasQuestionInProgress]),mt=reactExports.useCallback(xt=>{dt(xt.answer),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Response is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[dt]);reactExports.useEffect(()=>{at.current||mt&&st&&(st.on("askquestionhook",mt),at.current=!0)},[mt,st]);const gt=async()=>{et&&(ht(et),nt(""));try{const xt=tt==null?void 0:tt.nodes.filter(Tt=>Tt.text),kt=xt==null?void 0:xt.slice(0,5),St=(kt!=null&&kt.length?kt.map(Tt=>Tt.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,Tt=>`\\${Tt}`);ot&&(await distExports$1.enable(),await postAskQuestion({expertise_level:rt,question_text:et,search_term:ot,transcripts:St}),await updateBudget(lt),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing response for you"}),{type:"success"}))}catch(xt){console.error(xt)}},yt=rt&&et.trim()&&!pt,bt=xt=>{it(xt.target.value)},wt=async xt=>{if(pt){xt.preventDefault();return}xt.keyCode===13&&xt.shiftKey===!1&&yt&&(xt.preventDefault(),gt())};return jsxRuntimeExports.jsxs(AskQuestionContainer,{children:[jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(FormControl$1,{component:"div",children:[jsxRuntimeExports.jsx(StyledInput,{id:"select-label",size:"small",children:"Expertise level"}),jsxRuntimeExports.jsx(StyledSelect,{id:"demo-multiple-name",input:jsxRuntimeExports.jsx(OutlinedInput$1,{label:"Expertise level"}),labelId:"select-label",MenuProps,onChange:bt,size:"small",value:rt,children:names.map(xt=>jsxRuntimeExports.jsx(MenuItem$3,{component:"li",value:xt,children:xt},xt))})]})})}),jsxRuntimeExports.jsx(ResponsesWrapper,{children:ct==null?void 0:ct.map((xt,kt)=>jsxRuntimeExports.jsxs(Flex,{className:"response",py:12,children:[jsxRuntimeExports.jsx(Text$1,{kind:"medium",children:xt}),jsxRuntimeExports.jsx(Flex,{py:12,children:(ut==null?void 0:ut[kt])!==void 0?jsxRuntimeExports.jsx(Text$1,{color:"unreadMsgText",children:ut[kt]}):jsxRuntimeExports.jsxs(Flex,{align:"center",py:12,children:[jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(Text$1,{children:"Generating response"})})]})})]},xt))}),jsxRuntimeExports.jsxs(TextAreaWrapper,{onKeyDown:wt,py:12,tabIndex:-1,children:[jsxRuntimeExports.jsx(StyledTextarea,{disabled:pt,onChange:xt=>nt(xt.target.value),placeholder:"Enter your question",value:et}),jsxRuntimeExports.jsx(IconWrapper$1,{children:jsxRuntimeExports.jsx(MdSend,{color:yt?colors.white:colors.gray300,size:"18"})})]})]})},AskQuestionContainer=styled$4.div` +`,TABS=[{label:"Teach me",value:"teachMe"},{label:"Ask question",value:"askQuestion"},{label:"Sentiment Analysis",value:"sentiment"}],ActionsMenu=({onChange:tt,active:et})=>{const nt=(rt,it)=>{tt(TABS[it].value)};return et?jsxRuntimeExports.jsx(MenuWrapper,{direction:"row",id:"cy-helper-menu",maxWidth:"100%",mb:3,overflow:"auto",spacing:1,children:TABS.map((rt,it)=>jsxRuntimeExports.jsx(Chip$1,{color:rt.value===et?"primary":"default",component:"div",id:rt.value,label:rt.label,onClick:ot=>nt(ot,it)},rt.value))}):jsxRuntimeExports.jsx(Stack$3,{component:"div",flexGrow:1,id:"cy-helper-menu",justifyContent:"flex-end",mb:1,spacing:1,children:TABS.map((rt,it)=>jsxRuntimeExports.jsx(Chip$1,{component:"div",id:rt.value,label:rt.label,onClick:ot=>nt(ot,it)},rt.value))})},MenuWrapper=styled$1(Stack$3)(()=>({"&::-webkit-scrollbar":{width:"1px",height:"4px"},"&::-webkit-scrollbar-thumb":{width:"1px",height:"4px"}})),ITEM_HEIGHT=48,ITEM_PADDING_TOP=8,MenuProps={PaperProps:{style:{maxHeight:ITEM_HEIGHT*4.5+ITEM_PADDING_TOP,width:250}}},names=["Beginner","Intermediate","Advanced","Expert"],AskQuestion=()=>{const tt=useDataStore(xt=>xt.data),[et,nt]=reactExports.useState(""),[rt,it]=reactExports.useState("Beginner"),ot=useAppStore(xt=>xt.currentSearch),at=reactExports.useRef(!1),st=useSocket(),[lt]=useUserStore(xt=>[xt.setBudget]),[ct,ut,ht,dt,pt]=useTeachStore(xt=>[xt.askedQuestions,xt.askedQuestionsAnswers,xt.setAskedQuestion,xt.setAskedQuestionAnswer,xt.hasQuestionInProgress]),mt=reactExports.useCallback(xt=>{dt(xt.answer),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Response is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[dt]);reactExports.useEffect(()=>{at.current||mt&&st&&(st.on("askquestionhook",mt),at.current=!0)},[mt,st]);const gt=async()=>{et&&(ht(et),nt(""));try{const xt=tt==null?void 0:tt.nodes.filter(Tt=>Tt.text),kt=xt==null?void 0:xt.slice(0,5),St=(kt!=null&&kt.length?kt.map(Tt=>Tt.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,Tt=>`\\${Tt}`);ot&&(await distExports$1.enable(),await postAskQuestion({expertise_level:rt,question_text:et,search_term:ot,transcripts:St}),await updateBudget(lt),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing response for you"}),{type:"success"}))}catch(xt){console.error(xt)}},yt=rt&&et.trim()&&!pt,bt=xt=>{it(xt.target.value)},wt=async xt=>{if(pt){xt.preventDefault();return}xt.keyCode===13&&xt.shiftKey===!1&&yt&&(xt.preventDefault(),gt())};return jsxRuntimeExports.jsxs(AskQuestionContainer,{children:[jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(FormControl$1,{component:"div",children:[jsxRuntimeExports.jsx(StyledInput,{id:"select-label",size:"small",children:"Expertise level"}),jsxRuntimeExports.jsx(StyledSelect,{id:"demo-multiple-name",input:jsxRuntimeExports.jsx(OutlinedInput$1,{label:"Expertise level"}),labelId:"select-label",MenuProps,onChange:bt,size:"small",value:rt,children:names.map(xt=>jsxRuntimeExports.jsx(MenuItem$4,{component:"li",value:xt,children:xt},xt))})]})})}),jsxRuntimeExports.jsx(ResponsesWrapper,{children:ct==null?void 0:ct.map((xt,kt)=>jsxRuntimeExports.jsxs(Flex,{className:"response",py:12,children:[jsxRuntimeExports.jsx(Text$1,{kind:"medium",children:xt}),jsxRuntimeExports.jsx(Flex,{py:12,children:(ut==null?void 0:ut[kt])!==void 0?jsxRuntimeExports.jsx(Text$1,{color:"unreadMsgText",children:ut[kt]}):jsxRuntimeExports.jsxs(Flex,{align:"center",py:12,children:[jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(Text$1,{children:"Generating response"})})]})})]},xt))}),jsxRuntimeExports.jsxs(TextAreaWrapper,{onKeyDown:wt,py:12,tabIndex:-1,children:[jsxRuntimeExports.jsx(StyledTextarea,{disabled:pt,onChange:xt=>nt(xt.target.value),placeholder:"Enter your question",value:et}),jsxRuntimeExports.jsx(IconWrapper$1,{children:jsxRuntimeExports.jsx(MdSend,{color:yt?colors.white:colors.gray300,size:"18"})})]})]})},AskQuestionContainer=styled$4.div` margin-top: 20px; `,StyledTextarea=styled$4(TextareaAutosize)` background: ${colors.inputBg1}; @@ -5913,7 +6007,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .response { border-bottom: 1px solid ${colors.divider2}; } -`,emptyValue={},HelperContext=reactExports.createContext(emptyValue),useHelper=()=>reactExports.useContext(HelperContext);function cc(tt){if(typeof tt=="string"||typeof tt=="number")return""+tt;let et="";if(Array.isArray(tt))for(let nt=0,rt;nt{const nt=createStore$3(tt),rt=(it,ot=et)=>useStoreWithEqualityFn(nt,it,ot);return Object.assign(rt,nt),rt},createWithEqualityFn=(tt,et)=>tt?createWithEqualityFnImpl(tt,et):createWithEqualityFnImpl;function shallow$1(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;if(tt instanceof Map&&et instanceof Map){if(tt.size!==et.size)return!1;for(const[rt,it]of tt)if(!Object.is(it,et.get(rt)))return!1;return!0}if(tt instanceof Set&&et instanceof Set){if(tt.size!==et.size)return!1;for(const rt of tt)if(!et.has(rt))return!1;return!0}const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let rt=0;rt=0&&(et=tt.slice(0,nt))!=="xmlns"&&(tt=tt.slice(nt+1)),namespaces.hasOwnProperty(et)?{space:namespaces[et],local:tt}:tt}function creatorInherit(tt){return function(){var et=this.ownerDocument,nt=this.namespaceURI;return nt===xhtml&&et.documentElement.namespaceURI===xhtml?et.createElement(tt):et.createElementNS(nt,tt)}}function creatorFixed(tt){return function(){return this.ownerDocument.createElementNS(tt.space,tt.local)}}function creator(tt){var et=namespace(tt);return(et.local?creatorFixed:creatorInherit)(et)}function none(){}function selector(tt){return tt==null?none:function(){return this.querySelector(tt)}}function selection_select(tt){typeof tt!="function"&&(tt=selector(tt));for(var et=this._groups,nt=et.length,rt=new Array(nt),it=0;it=xt&&(xt=wt+1);!(St=yt[xt])&&++xt=0;)(at=rt[it])&&(ot&&at.compareDocumentPosition(ot)^4&&ot.parentNode.insertBefore(at,ot),ot=at);return this}function selection_sort(tt){tt||(tt=ascending);function et(ht,dt){return ht&&dt?tt(ht.__data__,dt.__data__):!ht-!dt}for(var nt=this._groups,rt=nt.length,it=new Array(rt),ot=0;otet?1:tt>=et?0:NaN}function selection_call(){var tt=arguments[0];return arguments[0]=this,tt.apply(null,arguments),this}function selection_nodes(){return Array.from(this)}function selection_node(){for(var tt=this._groups,et=0,nt=tt.length;et1?this.each((et==null?styleRemove$1:typeof et=="function"?styleFunction$1:styleConstant$1)(tt,et,nt??"")):styleValue(this.node(),tt)}function styleValue(tt,et){return tt.style.getPropertyValue(et)||defaultView(tt).getComputedStyle(tt,null).getPropertyValue(et)}function propertyRemove(tt){return function(){delete this[tt]}}function propertyConstant(tt,et){return function(){this[tt]=et}}function propertyFunction(tt,et){return function(){var nt=et.apply(this,arguments);nt==null?delete this[tt]:this[tt]=nt}}function selection_property(tt,et){return arguments.length>1?this.each((et==null?propertyRemove:typeof et=="function"?propertyFunction:propertyConstant)(tt,et)):this.node()[tt]}function classArray(tt){return tt.trim().split(/^|\s+/)}function classList(tt){return tt.classList||new ClassList(tt)}function ClassList(tt){this._node=tt,this._names=classArray(tt.getAttribute("class")||"")}ClassList.prototype={add:function(tt){var et=this._names.indexOf(tt);et<0&&(this._names.push(tt),this._node.setAttribute("class",this._names.join(" ")))},remove:function(tt){var et=this._names.indexOf(tt);et>=0&&(this._names.splice(et,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(tt){return this._names.indexOf(tt)>=0}};function classedAdd(tt,et){for(var nt=classList(tt),rt=-1,it=et.length;++rt=0&&(nt=et.slice(rt+1),et=et.slice(0,rt)),{type:et,name:nt}})}function onRemove(tt){return function(){var et=this.__on;if(et){for(var nt=0,rt=-1,it=et.length,ot;nt()=>tt;function DragEvent(tt,{sourceEvent:et,subject:nt,target:rt,identifier:it,active:ot,x:at,y:st,dx:lt,dy:ct,dispatch:ut}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},subject:{value:nt,enumerable:!0,configurable:!0},target:{value:rt,enumerable:!0,configurable:!0},identifier:{value:it,enumerable:!0,configurable:!0},active:{value:ot,enumerable:!0,configurable:!0},x:{value:at,enumerable:!0,configurable:!0},y:{value:st,enumerable:!0,configurable:!0},dx:{value:lt,enumerable:!0,configurable:!0},dy:{value:ct,enumerable:!0,configurable:!0},_:{value:ut}})}DragEvent.prototype.on=function(){var tt=this._.on.apply(this._,arguments);return tt===this._?this:tt};function defaultFilter$1(tt){return!tt.ctrlKey&&!tt.button}function defaultContainer(){return this.parentNode}function defaultSubject(tt,et){return et??{x:tt.x,y:tt.y}}function defaultTouchable$1(){return navigator.maxTouchPoints||"ontouchstart"in this}function drag(){var tt=defaultFilter$1,et=defaultContainer,nt=defaultSubject,rt=defaultTouchable$1,it={},ot=dispatch("start","drag","end"),at=0,st,lt,ct,ut,ht=0;function dt(kt){kt.on("mousedown.drag",pt).filter(rt).on("touchstart.drag",yt).on("touchmove.drag",bt,nonpassive).on("touchend.drag touchcancel.drag",wt).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function pt(kt,St){if(!(ut||!tt.call(this,kt,St))){var Tt=xt(this,et.call(this,kt,St),kt,St,"mouse");Tt&&(select(kt.view).on("mousemove.drag",mt,nonpassivecapture).on("mouseup.drag",gt,nonpassivecapture),dragDisable(kt.view),nopropagation$1(kt),ct=!1,st=kt.clientX,lt=kt.clientY,Tt("start",kt))}}function mt(kt){if(noevent$1(kt),!ct){var St=kt.clientX-st,Tt=kt.clientY-lt;ct=St*St+Tt*Tt>ht}it.mouse("drag",kt)}function gt(kt){select(kt.view).on("mousemove.drag mouseup.drag",null),yesdrag(kt.view,ct),noevent$1(kt),it.mouse("end",kt)}function yt(kt,St){if(tt.call(this,kt,St)){var Tt=kt.changedTouches,At=et.call(this,kt,St),Et=Tt.length,Ct,Lt;for(Ct=0;CtCREATED)throw new Error("too late; already scheduled");return nt}function set(tt,et){var nt=get(tt,et);if(nt.state>STARTED)throw new Error("too late; already running");return nt}function get(tt,et){var nt=tt.__transition;if(!nt||!(nt=nt[et]))throw new Error("transition not found");return nt}function create(tt,et,nt){var rt=tt.__transition,it;rt[et]=nt,nt.timer=timer$1(ot,0,nt.time);function ot(ct){nt.state=SCHEDULED,nt.timer.restart(at,nt.delay,nt.time),nt.delay<=ct&&at(ct-nt.delay)}function at(ct){var ut,ht,dt,pt;if(nt.state!==SCHEDULED)return lt();for(ut in rt)if(pt=rt[ut],pt.name===nt.name){if(pt.state===STARTED)return timeout(at);pt.state===RUNNING?(pt.state=ENDED,pt.timer.stop(),pt.on.call("interrupt",tt,tt.__data__,pt.index,pt.group),delete rt[ut]):+utSTARTING&&rt.state=0&&(et=et.slice(0,nt)),!et||et==="start"})}function onFunction(tt,et,nt){var rt,it,ot=start(et)?init:set;return function(){var at=ot(this,tt),st=at.on;st!==rt&&(it=(rt=st).copy()).on(et,nt),at.on=it}}function transition_on(tt,et){var nt=this._id;return arguments.length<2?get(this.node(),nt).on.on(tt):this.each(onFunction(nt,tt,et))}function removeFunction(tt){return function(){var et=this.parentNode;for(var nt in this.__transition)if(+nt!==tt)return;et&&et.removeChild(this)}}function transition_remove(){return this.on("end.remove",removeFunction(this._id))}function transition_select(tt){var et=this._name,nt=this._id;typeof tt!="function"&&(tt=selector(tt));for(var rt=this._groups,it=rt.length,ot=new Array(it),at=0;at()=>tt;function ZoomEvent(tt,{sourceEvent:et,target:nt,transform:rt,dispatch:it}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},target:{value:nt,enumerable:!0,configurable:!0},transform:{value:rt,enumerable:!0,configurable:!0},_:{value:it}})}function Transform(tt,et,nt){this.k=tt,this.x=et,this.y=nt}Transform.prototype={constructor:Transform,scale:function(tt){return tt===1?this:new Transform(this.k*tt,this.x,this.y)},translate:function(tt,et){return tt===0&et===0?this:new Transform(this.k,this.x+this.k*tt,this.y+this.k*et)},apply:function(tt){return[tt[0]*this.k+this.x,tt[1]*this.k+this.y]},applyX:function(tt){return tt*this.k+this.x},applyY:function(tt){return tt*this.k+this.y},invert:function(tt){return[(tt[0]-this.x)/this.k,(tt[1]-this.y)/this.k]},invertX:function(tt){return(tt-this.x)/this.k},invertY:function(tt){return(tt-this.y)/this.k},rescaleX:function(tt){return tt.copy().domain(tt.range().map(this.invertX,this).map(tt.invert,tt))},rescaleY:function(tt){return tt.copy().domain(tt.range().map(this.invertY,this).map(tt.invert,tt))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var identity=new Transform(1,0,0);Transform.prototype;function nopropagation(tt){tt.stopImmediatePropagation()}function noevent(tt){tt.preventDefault(),tt.stopImmediatePropagation()}function defaultFilter(tt){return(!tt.ctrlKey||tt.type==="wheel")&&!tt.button}function defaultExtent(){var tt=this;return tt instanceof SVGElement?(tt=tt.ownerSVGElement||tt,tt.hasAttribute("viewBox")?(tt=tt.viewBox.baseVal,[[tt.x,tt.y],[tt.x+tt.width,tt.y+tt.height]]):[[0,0],[tt.width.baseVal.value,tt.height.baseVal.value]]):[[0,0],[tt.clientWidth,tt.clientHeight]]}function defaultTransform(){return this.__zoom||identity}function defaultWheelDelta(tt){return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*(tt.ctrlKey?10:1)}function defaultTouchable(){return navigator.maxTouchPoints||"ontouchstart"in this}function defaultConstrain(tt,et,nt){var rt=tt.invertX(et[0][0])-nt[0][0],it=tt.invertX(et[1][0])-nt[1][0],ot=tt.invertY(et[0][1])-nt[0][1],at=tt.invertY(et[1][1])-nt[1][1];return tt.translate(it>rt?(rt+it)/2:Math.min(0,rt)||Math.max(0,it),at>ot?(ot+at)/2:Math.min(0,ot)||Math.max(0,at))}function zoom(){var tt=defaultFilter,et=defaultExtent,nt=defaultConstrain,rt=defaultWheelDelta,it=defaultTouchable,ot=[0,1/0],at=[[-1/0,-1/0],[1/0,1/0]],st=250,lt=interpolateZoom,ct=dispatch("start","zoom","end"),ut,ht,dt,pt=500,mt=150,gt=0,yt=10;function bt(vt){vt.property("__zoom",defaultTransform).on("wheel.zoom",Et,{passive:!1}).on("mousedown.zoom",Ct).on("dblclick.zoom",Lt).filter(it).on("touchstart.zoom",jt).on("touchmove.zoom",Rt).on("touchend.zoom touchcancel.zoom",$t).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}bt.transform=function(vt,It,Ot,Wt){var zt=vt.selection?vt.selection():vt;zt.property("__zoom",defaultTransform),vt!==zt?St(vt,It,Ot,Wt):zt.interrupt().each(function(){Tt(this,arguments).event(Wt).start().zoom(null,typeof It=="function"?It.apply(this,arguments):It).end()})},bt.scaleBy=function(vt,It,Ot,Wt){bt.scaleTo(vt,function(){var zt=this.__zoom.k,Ft=typeof It=="function"?It.apply(this,arguments):It;return zt*Ft},Ot,Wt)},bt.scaleTo=function(vt,It,Ot,Wt){bt.transform(vt,function(){var zt=et.apply(this,arguments),Ft=this.__zoom,Nt=Ot==null?kt(zt):typeof Ot=="function"?Ot.apply(this,arguments):Ot,Ut=Ft.invert(Nt),Pt=typeof It=="function"?It.apply(this,arguments):It;return nt(xt(wt(Ft,Pt),Nt,Ut),zt,at)},Ot,Wt)},bt.translateBy=function(vt,It,Ot,Wt){bt.transform(vt,function(){return nt(this.__zoom.translate(typeof It=="function"?It.apply(this,arguments):It,typeof Ot=="function"?Ot.apply(this,arguments):Ot),et.apply(this,arguments),at)},null,Wt)},bt.translateTo=function(vt,It,Ot,Wt,zt){bt.transform(vt,function(){var Ft=et.apply(this,arguments),Nt=this.__zoom,Ut=Wt==null?kt(Ft):typeof Wt=="function"?Wt.apply(this,arguments):Wt;return nt(identity.translate(Ut[0],Ut[1]).scale(Nt.k).translate(typeof It=="function"?-It.apply(this,arguments):-It,typeof Ot=="function"?-Ot.apply(this,arguments):-Ot),Ft,at)},Wt,zt)};function wt(vt,It){return It=Math.max(ot[0],Math.min(ot[1],It)),It===vt.k?vt:new Transform(It,vt.x,vt.y)}function xt(vt,It,Ot){var Wt=It[0]-Ot[0]*vt.k,zt=It[1]-Ot[1]*vt.k;return Wt===vt.x&&zt===vt.y?vt:new Transform(vt.k,Wt,zt)}function kt(vt){return[(+vt[0][0]+ +vt[1][0])/2,(+vt[0][1]+ +vt[1][1])/2]}function St(vt,It,Ot,Wt){vt.on("start.zoom",function(){Tt(this,arguments).event(Wt).start()}).on("interrupt.zoom end.zoom",function(){Tt(this,arguments).event(Wt).end()}).tween("zoom",function(){var zt=this,Ft=arguments,Nt=Tt(zt,Ft).event(Wt),Ut=et.apply(zt,Ft),Pt=Ot==null?kt(Ut):typeof Ot=="function"?Ot.apply(zt,Ft):Ot,Ht=Math.max(Ut[1][0]-Ut[0][0],Ut[1][1]-Ut[0][1]),Qt=zt.__zoom,an=typeof It=="function"?It.apply(zt,Ft):It,Yt=lt(Qt.invert(Pt).concat(Ht/Qt.k),an.invert(Pt).concat(Ht/an.k));return function(nn){if(nn===1)nn=an;else{var tn=Yt(nn),dn=Ht/tn[2];nn=new Transform(dn,Pt[0]-tn[0]*dn,Pt[1]-tn[1]*dn)}Nt.zoom(null,nn)}})}function Tt(vt,It,Ot){return!Ot&&vt.__zooming||new At(vt,It)}function At(vt,It){this.that=vt,this.args=It,this.active=0,this.sourceEvent=null,this.extent=et.apply(vt,It),this.taps=0}At.prototype={event:function(vt){return vt&&(this.sourceEvent=vt),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(vt,It){return this.mouse&&vt!=="mouse"&&(this.mouse[1]=It.invert(this.mouse[0])),this.touch0&&vt!=="touch"&&(this.touch0[1]=It.invert(this.touch0[0])),this.touch1&&vt!=="touch"&&(this.touch1[1]=It.invert(this.touch1[0])),this.that.__zoom=It,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(vt){var It=select(this.that).datum();ct.call(vt,this.that,new ZoomEvent(vt,{sourceEvent:this.sourceEvent,target:bt,type:vt,transform:this.that.__zoom,dispatch:ct}),It)}};function Et(vt,...It){if(!tt.apply(this,arguments))return;var Ot=Tt(this,It).event(vt),Wt=this.__zoom,zt=Math.max(ot[0],Math.min(ot[1],Wt.k*Math.pow(2,rt.apply(this,arguments)))),Ft=pointer(vt);if(Ot.wheel)(Ot.mouse[0][0]!==Ft[0]||Ot.mouse[0][1]!==Ft[1])&&(Ot.mouse[1]=Wt.invert(Ot.mouse[0]=Ft)),clearTimeout(Ot.wheel);else{if(Wt.k===zt)return;Ot.mouse=[Ft,Wt.invert(Ft)],interrupt(this),Ot.start()}noevent(vt),Ot.wheel=setTimeout(Nt,mt),Ot.zoom("mouse",nt(xt(wt(Wt,zt),Ot.mouse[0],Ot.mouse[1]),Ot.extent,at));function Nt(){Ot.wheel=null,Ot.end()}}function Ct(vt,...It){if(dt||!tt.apply(this,arguments))return;var Ot=vt.currentTarget,Wt=Tt(this,It,!0).event(vt),zt=select(vt.view).on("mousemove.zoom",Pt,!0).on("mouseup.zoom",Ht,!0),Ft=pointer(vt,Ot),Nt=vt.clientX,Ut=vt.clientY;dragDisable(vt.view),nopropagation(vt),Wt.mouse=[Ft,this.__zoom.invert(Ft)],interrupt(this),Wt.start();function Pt(Qt){if(noevent(Qt),!Wt.moved){var an=Qt.clientX-Nt,Yt=Qt.clientY-Ut;Wt.moved=an*an+Yt*Yt>gt}Wt.event(Qt).zoom("mouse",nt(xt(Wt.that.__zoom,Wt.mouse[0]=pointer(Qt,Ot),Wt.mouse[1]),Wt.extent,at))}function Ht(Qt){zt.on("mousemove.zoom mouseup.zoom",null),yesdrag(Qt.view,Wt.moved),noevent(Qt),Wt.event(Qt).end()}}function Lt(vt,...It){if(tt.apply(this,arguments)){var Ot=this.__zoom,Wt=pointer(vt.changedTouches?vt.changedTouches[0]:vt,this),zt=Ot.invert(Wt),Ft=Ot.k*(vt.shiftKey?.5:2),Nt=nt(xt(wt(Ot,Ft),Wt,zt),et.apply(this,It),at);noevent(vt),st>0?select(this).transition().duration(st).call(St,Nt,Wt,vt):select(this).call(bt.transform,Nt,Wt,vt)}}function jt(vt,...It){if(tt.apply(this,arguments)){var Ot=vt.touches,Wt=Ot.length,zt=Tt(this,It,vt.changedTouches.length===Wt).event(vt),Ft,Nt,Ut,Pt;for(nopropagation(vt),Nt=0;Nt"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:tt=>`Node type "${tt}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:tt=>`The old edge with id=${tt} does not exist.`,error009:tt=>`Marker type "${tt}" doesn't exist.`,error008:(tt,et)=>`Couldn't create edge for ${tt?"target":"source"} handle id: "${tt?et.targetHandle:et.sourceHandle}", edge id: ${et.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:tt=>`Edge type "${tt}" not found. Using fallback type "default".`,error012:tt=>`Node with id "${tt}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},zustandErrorMessage=errorMessages.error001();function useStore(tt,et){const nt=reactExports.useContext(StoreContext);if(nt===null)throw new Error(zustandErrorMessage);return useStoreWithEqualityFn(nt,tt,et)}const useStoreApi=()=>{const tt=reactExports.useContext(StoreContext);if(tt===null)throw new Error(zustandErrorMessage);return reactExports.useMemo(()=>({getState:tt.getState,setState:tt.setState,subscribe:tt.subscribe,destroy:tt.destroy}),[tt])},selector$g=tt=>tt.userSelectionActive?"none":"all";function Panel({position:tt,children:et,className:nt,style:rt,...it}){const ot=useStore(selector$g),at=`${tt}`.split("-");return React$1.createElement("div",{className:cc(["react-flow__panel",nt,...at]),style:{...rt,pointerEvents:ot},...it},et)}function Attribution({proOptions:tt,position:et="bottom-right"}){return tt!=null&&tt.hideAttribution?null:React$1.createElement(Panel,{position:et,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev"},React$1.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const EdgeText=({x:tt,y:et,label:nt,labelStyle:rt={},labelShowBg:it=!0,labelBgStyle:ot={},labelBgPadding:at=[2,4],labelBgBorderRadius:st=2,children:lt,className:ct,...ut})=>{const ht=reactExports.useRef(null),[dt,pt]=reactExports.useState({x:0,y:0,width:0,height:0}),mt=cc(["react-flow__edge-textwrapper",ct]);return reactExports.useEffect(()=>{if(ht.current){const gt=ht.current.getBBox();pt({x:gt.x,y:gt.y,width:gt.width,height:gt.height})}},[nt]),typeof nt>"u"||!nt?null:React$1.createElement("g",{transform:`translate(${tt-dt.width/2} ${et-dt.height/2})`,className:mt,visibility:dt.width?"visible":"hidden",...ut},it&&React$1.createElement("rect",{width:dt.width+2*at[0],x:-at[0],y:-at[1],height:dt.height+2*at[1],className:"react-flow__edge-textbg",style:ot,rx:st,ry:st}),React$1.createElement("text",{className:"react-flow__edge-text",y:dt.height/2,dy:"0.3em",ref:ht,style:rt},nt),lt)};var EdgeText$1=reactExports.memo(EdgeText);const getDimensions=tt=>({width:tt.offsetWidth,height:tt.offsetHeight}),clamp=(tt,et=0,nt=1)=>Math.min(Math.max(tt,et),nt),clampPosition=(tt={x:0,y:0},et)=>({x:clamp(tt.x,et[0][0],et[1][0]),y:clamp(tt.y,et[0][1],et[1][1])}),calcAutoPanVelocity=(tt,et,nt)=>ttnt?-clamp(Math.abs(tt-nt),1,50)/50:0,calcAutoPan=(tt,et)=>{const nt=calcAutoPanVelocity(tt.x,35,et.width-35)*20,rt=calcAutoPanVelocity(tt.y,35,et.height-35)*20;return[nt,rt]},getHostForElement=tt=>{var et;return((et=tt.getRootNode)==null?void 0:et.call(tt))||(window==null?void 0:window.document)},getBoundsOfBoxes=(tt,et)=>({x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x2,et.x2),y2:Math.max(tt.y2,et.y2)}),rectToBox=({x:tt,y:et,width:nt,height:rt})=>({x:tt,y:et,x2:tt+nt,y2:et+rt}),boxToRect=({x:tt,y:et,x2:nt,y2:rt})=>({x:tt,y:et,width:nt-tt,height:rt-et}),nodeToRect=tt=>({...tt.positionAbsolute||{x:0,y:0},width:tt.width||0,height:tt.height||0}),getOverlappingArea=(tt,et)=>{const nt=Math.max(0,Math.min(tt.x+tt.width,et.x+et.width)-Math.max(tt.x,et.x)),rt=Math.max(0,Math.min(tt.y+tt.height,et.y+et.height)-Math.max(tt.y,et.y));return Math.ceil(nt*rt)},isRectObject=tt=>isNumeric(tt.width)&&isNumeric(tt.height)&&isNumeric(tt.x)&&isNumeric(tt.y),isNumeric=tt=>!isNaN(tt)&&isFinite(tt),internalsSymbol=Symbol.for("internals"),elementSelectionKeys=["Enter"," ","Escape"],devWarn=(tt,et)=>{},isReactKeyboardEvent=tt=>"nativeEvent"in tt;function isInputDOMNode(tt){var it,ot;const et=isReactKeyboardEvent(tt)?tt.nativeEvent:tt,nt=((ot=(it=et.composedPath)==null?void 0:it.call(et))==null?void 0:ot[0])||tt.target;return["INPUT","SELECT","TEXTAREA"].includes(nt==null?void 0:nt.nodeName)||(nt==null?void 0:nt.hasAttribute("contenteditable"))||!!(nt!=null&&nt.closest(".nokey"))}const isMouseEvent=tt=>"clientX"in tt,getEventPosition=(tt,et)=>{var ot,at;const nt=isMouseEvent(tt),rt=nt?tt.clientX:(ot=tt.touches)==null?void 0:ot[0].clientX,it=nt?tt.clientY:(at=tt.touches)==null?void 0:at[0].clientY;return{x:rt-((et==null?void 0:et.left)??0),y:it-((et==null?void 0:et.top)??0)}},isMacOs=()=>{var tt;return typeof navigator<"u"&&((tt=navigator==null?void 0:navigator.userAgent)==null?void 0:tt.indexOf("Mac"))>=0},BaseEdge=({id:tt,path:et,labelX:nt,labelY:rt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt=20})=>React$1.createElement(React$1.Fragment,null,React$1.createElement("path",{id:tt,style:ut,d:et,fill:"none",className:"react-flow__edge-path",markerEnd:ht,markerStart:dt}),pt&&React$1.createElement("path",{d:et,fill:"none",strokeOpacity:0,strokeWidth:pt,className:"react-flow__edge-interaction"}),it&&isNumeric(nt)&&isNumeric(rt)?React$1.createElement(EdgeText$1,{x:nt,y:rt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct}):null);BaseEdge.displayName="BaseEdge";function getMouseHandler$1(tt,et,nt){return nt===void 0?nt:rt=>{const it=et().edges.find(ot=>ot.id===tt);it&&nt(rt,{...it})}}function getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:rt}){const it=Math.abs(nt-tt)/2,ot=nt{const[yt,bt,wt]=getSimpleBezierPath({sourceX:tt,sourceY:et,sourcePosition:it,targetX:nt,targetY:rt,targetPosition:ot});return React$1.createElement(BaseEdge,{path:yt,labelX:bt,labelY:wt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:gt})});SimpleBezierEdge.displayName="SimpleBezierEdge";const handleDirections={[Position.Left]:{x:-1,y:0},[Position.Right]:{x:1,y:0},[Position.Top]:{x:0,y:-1},[Position.Bottom]:{x:0,y:1}},getDirection=({source:tt,sourcePosition:et=Position.Bottom,target:nt})=>et===Position.Left||et===Position.Right?tt.xMath.sqrt(Math.pow(et.x-tt.x,2)+Math.pow(et.y-tt.y,2));function getPoints({source:tt,sourcePosition:et=Position.Bottom,target:nt,targetPosition:rt=Position.Top,center:it,offset:ot}){const at=handleDirections[et],st=handleDirections[rt],lt={x:tt.x+at.x*ot,y:tt.y+at.y*ot},ct={x:nt.x+st.x*ot,y:nt.y+st.y*ot},ut=getDirection({source:lt,sourcePosition:et,target:ct}),ht=ut.x!==0?"x":"y",dt=ut[ht];let pt=[],mt,gt;const yt={x:0,y:0},bt={x:0,y:0},[wt,xt,kt,St]=getEdgeCenter({sourceX:tt.x,sourceY:tt.y,targetX:nt.x,targetY:nt.y});if(at[ht]*st[ht]===-1){mt=it.x||wt,gt=it.y||xt;const At=[{x:mt,y:lt.y},{x:mt,y:ct.y}],Et=[{x:lt.x,y:gt},{x:ct.x,y:gt}];at[ht]===dt?pt=ht==="x"?At:Et:pt=ht==="x"?Et:At}else{const At=[{x:lt.x,y:ct.y}],Et=[{x:ct.x,y:lt.y}];if(ht==="x"?pt=at.x===dt?Et:At:pt=at.y===dt?At:Et,et===rt){const $t=Math.abs(tt[ht]-nt[ht]);if($t<=ot){const vt=Math.min(ot-1,ot-$t);at[ht]===dt?yt[ht]=(lt[ht]>tt[ht]?-1:1)*vt:bt[ht]=(ct[ht]>nt[ht]?-1:1)*vt}}if(et!==rt){const $t=ht==="x"?"y":"x",vt=at[ht]===st[$t],It=lt[$t]>ct[$t],Ot=lt[$t]=Rt?(mt=(Ct.x+Lt.x)/2,gt=pt[0].y):(mt=pt[0].x,gt=(Ct.y+Lt.y)/2)}return[[tt,{x:lt.x+yt.x,y:lt.y+yt.y},...pt,{x:ct.x+bt.x,y:ct.y+bt.y},nt],mt,gt,kt,St]}function getBend(tt,et,nt,rt){const it=Math.min(distance(tt,et)/2,distance(et,nt)/2,rt),{x:ot,y:at}=et;if(tt.x===ot&&ot===nt.x||tt.y===at&&at===nt.y)return`L${ot} ${at}`;if(tt.y===at){const ct=tt.x{let xt="";return wt>0&&wt{const[bt,wt,xt]=getSmoothStepPath({sourceX:tt,sourceY:et,sourcePosition:ht,targetX:nt,targetY:rt,targetPosition:dt,borderRadius:gt==null?void 0:gt.borderRadius,offset:gt==null?void 0:gt.offset});return React$1.createElement(BaseEdge,{path:bt,labelX:wt,labelY:xt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:pt,markerStart:mt,interactionWidth:yt})});SmoothStepEdge.displayName="SmoothStepEdge";const StepEdge=reactExports.memo(tt=>{var et;return React$1.createElement(SmoothStepEdge,{...tt,pathOptions:reactExports.useMemo(()=>{var nt;return{borderRadius:0,offset:(nt=tt.pathOptions)==null?void 0:nt.offset}},[(et=tt.pathOptions)==null?void 0:et.offset])})});StepEdge.displayName="StepEdge";function getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:rt}){const[it,ot,at,st]=getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:rt});return[`M ${tt},${et}L ${nt},${rt}`,it,ot,at,st]}const StraightEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:rt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})=>{const[mt,gt,yt]=getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:rt});return React$1.createElement(BaseEdge,{path:mt,labelX:gt,labelY:yt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})});StraightEdge.displayName="StraightEdge";function calculateControlOffset(tt,et){return tt>=0?.5*tt:et*25*Math.sqrt(-tt)}function getControlWithCurvature({pos:tt,x1:et,y1:nt,x2:rt,y2:it,c:ot}){switch(tt){case Position.Left:return[et-calculateControlOffset(et-rt,ot),nt];case Position.Right:return[et+calculateControlOffset(rt-et,ot),nt];case Position.Top:return[et,nt-calculateControlOffset(nt-it,ot)];case Position.Bottom:return[et,nt+calculateControlOffset(it-nt,ot)]}}function getBezierPath({sourceX:tt,sourceY:et,sourcePosition:nt=Position.Bottom,targetX:rt,targetY:it,targetPosition:ot=Position.Top,curvature:at=.25}){const[st,lt]=getControlWithCurvature({pos:nt,x1:tt,y1:et,x2:rt,y2:it,c:at}),[ct,ut]=getControlWithCurvature({pos:ot,x1:rt,y1:it,x2:tt,y2:et,c:at}),[ht,dt,pt,mt]=getBezierEdgeCenter({sourceX:tt,sourceY:et,targetX:rt,targetY:it,sourceControlX:st,sourceControlY:lt,targetControlX:ct,targetControlY:ut});return[`M${tt},${et} C${st},${lt} ${ct},${ut} ${rt},${it}`,ht,dt,pt,mt]}const BezierEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:rt,sourcePosition:it=Position.Bottom,targetPosition:ot=Position.Top,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,pathOptions:gt,interactionWidth:yt})=>{const[bt,wt,xt]=getBezierPath({sourceX:tt,sourceY:et,sourcePosition:it,targetX:nt,targetY:rt,targetPosition:ot,curvature:gt==null?void 0:gt.curvature});return React$1.createElement(BaseEdge,{path:bt,labelX:wt,labelY:xt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:yt})});BezierEdge.displayName="BezierEdge";const NodeIdContext=reactExports.createContext(null),Provider=NodeIdContext.Provider;NodeIdContext.Consumer;const useNodeId=()=>reactExports.useContext(NodeIdContext),isEdge=tt=>"id"in tt&&"source"in tt&&"target"in tt,getEdgeId=({source:tt,sourceHandle:et,target:nt,targetHandle:rt})=>`reactflow__edge-${tt}${et||""}-${nt}${rt||""}`,getMarkerId=(tt,et)=>typeof tt>"u"?"":typeof tt=="string"?tt:`${et?`${et}__`:""}${Object.keys(tt).sort().map(rt=>`${rt}=${tt[rt]}`).join("&")}`,connectionExists=(tt,et)=>et.some(nt=>nt.source===tt.source&&nt.target===tt.target&&(nt.sourceHandle===tt.sourceHandle||!nt.sourceHandle&&!tt.sourceHandle)&&(nt.targetHandle===tt.targetHandle||!nt.targetHandle&&!tt.targetHandle)),addEdge=(tt,et)=>{if(!tt.source||!tt.target)return et;let nt;return isEdge(tt)?nt={...tt}:nt={...tt,id:getEdgeId(tt)},connectionExists(nt,et)?et:et.concat(nt)},pointToRendererPoint=({x:tt,y:et},[nt,rt,it],ot,[at,st])=>{const lt={x:(tt-nt)/it,y:(et-rt)/it};return ot?{x:at*Math.round(lt.x/at),y:st*Math.round(lt.y/st)}:lt},rendererPointToPoint=({x:tt,y:et},[nt,rt,it])=>({x:tt*it+nt,y:et*it+rt}),getNodePositionWithOrigin=(tt,et=[0,0])=>{if(!tt)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const nt=(tt.width??0)*et[0],rt=(tt.height??0)*et[1],it={x:tt.position.x-nt,y:tt.position.y-rt};return{...it,positionAbsolute:tt.positionAbsolute?{x:tt.positionAbsolute.x-nt,y:tt.positionAbsolute.y-rt}:it}},getRectOfNodes=(tt,et=[0,0])=>{if(tt.length===0)return{x:0,y:0,width:0,height:0};const nt=tt.reduce((rt,it)=>{const{x:ot,y:at}=getNodePositionWithOrigin(it,et).positionAbsolute;return getBoundsOfBoxes(rt,rectToBox({x:ot,y:at,width:it.width||0,height:it.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return boxToRect(nt)},getNodesInside=(tt,et,[nt,rt,it]=[0,0,1],ot=!1,at=!1,st=[0,0])=>{const lt={x:(et.x-nt)/it,y:(et.y-rt)/it,width:et.width/it,height:et.height/it},ct=[];return tt.forEach(ut=>{const{width:ht,height:dt,selectable:pt=!0,hidden:mt=!1}=ut;if(at&&!pt||mt)return!1;const{positionAbsolute:gt}=getNodePositionWithOrigin(ut,st),yt={x:gt.x,y:gt.y,width:ht||0,height:dt||0},bt=getOverlappingArea(lt,yt),wt=typeof ht>"u"||typeof dt>"u"||ht===null||dt===null,xt=ot&&bt>0,kt=(ht||0)*(dt||0);(wt||xt||bt>=kt||ut.dragging)&&ct.push(ut)}),ct},getConnectedEdges=(tt,et)=>{const nt=tt.map(rt=>rt.id);return et.filter(rt=>nt.includes(rt.source)||nt.includes(rt.target))},getTransformForBounds=(tt,et,nt,rt,it,ot=.1)=>{const at=et/(tt.width*(1+ot)),st=nt/(tt.height*(1+ot)),lt=Math.min(at,st),ct=clamp(lt,rt,it),ut=tt.x+tt.width/2,ht=tt.y+tt.height/2,dt=et/2-ut*ct,pt=nt/2-ht*ct;return[dt,pt,ct]},getD3Transition=(tt,et=0)=>tt.transition().duration(et);function getHandles(tt,et,nt,rt){return(et[nt]||[]).reduce((it,ot)=>{var at,st;return`${tt.id}-${ot.id}-${nt}`!==rt&&it.push({id:ot.id||null,type:nt,nodeId:tt.id,x:(((at=tt.positionAbsolute)==null?void 0:at.x)??0)+ot.x+ot.width/2,y:(((st=tt.positionAbsolute)==null?void 0:st.y)??0)+ot.y+ot.height/2}),it},[])}function getClosestHandle(tt,et,nt,rt,it,ot){const{x:at,y:st}=getEventPosition(tt),ct=et.elementsFromPoint(at,st).find(mt=>mt.classList.contains("react-flow__handle"));if(ct){const mt=ct.getAttribute("data-nodeid");if(mt){const gt=getHandleType(void 0,ct),yt=ct.getAttribute("data-handleid"),bt=ot({nodeId:mt,id:yt,type:gt});if(bt)return{handle:{id:yt,type:gt,nodeId:mt,x:nt.x,y:nt.y},validHandleResult:bt}}}let ut=[],ht=1/0;if(it.forEach(mt=>{const gt=Math.sqrt((mt.x-nt.x)**2+(mt.y-nt.y)**2);if(gt<=rt){const yt=ot(mt);gt<=ht&&(gtmt.isValid),pt=ut.some(({handle:mt})=>mt.type==="target");return ut.find(({handle:mt,validHandleResult:gt})=>pt?mt.type==="target":dt?gt.isValid:!0)||ut[0]}const nullConnection={source:null,target:null,sourceHandle:null,targetHandle:null},defaultResult=()=>({handleDomNode:null,isValid:!1,connection:nullConnection,endHandle:null});function isValidHandle(tt,et,nt,rt,it,ot,at){const st=it==="target",lt=at.querySelector(`.react-flow__handle[data-id="${tt==null?void 0:tt.nodeId}-${tt==null?void 0:tt.id}-${tt==null?void 0:tt.type}"]`),ct={...defaultResult(),handleDomNode:lt};if(lt){const ut=getHandleType(void 0,lt),ht=lt.getAttribute("data-nodeid"),dt=lt.getAttribute("data-handleid"),pt=lt.classList.contains("connectable"),mt=lt.classList.contains("connectableend"),gt={source:st?ht:nt,sourceHandle:st?dt:rt,target:st?nt:ht,targetHandle:st?rt:dt};ct.connection=gt,pt&&mt&&(et===ConnectionMode.Strict?st&&ut==="source"||!st&&ut==="target":ht!==nt||dt!==rt)&&(ct.endHandle={nodeId:ht,handleId:dt,type:ut},ct.isValid=ot(gt))}return ct}function getHandleLookup({nodes:tt,nodeId:et,handleId:nt,handleType:rt}){return tt.reduce((it,ot)=>{if(ot[internalsSymbol]){const{handleBounds:at}=ot[internalsSymbol];let st=[],lt=[];at&&(st=getHandles(ot,at,"source",`${et}-${nt}-${rt}`),lt=getHandles(ot,at,"target",`${et}-${nt}-${rt}`)),it.push(...st,...lt)}return it},[])}function getHandleType(tt,et){return tt||(et!=null&&et.classList.contains("target")?"target":et!=null&&et.classList.contains("source")?"source":null)}function resetRecentHandle(tt){tt==null||tt.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function getConnectionStatus(tt,et){let nt=null;return et?nt="valid":tt&&!et&&(nt="invalid"),nt}function handlePointerDown({event:tt,handleId:et,nodeId:nt,onConnect:rt,isTarget:it,getState:ot,setState:at,isValidConnection:st,edgeUpdaterType:lt,onEdgeUpdateEnd:ct}){const ut=getHostForElement(tt.target),{connectionMode:ht,domNode:dt,autoPanOnConnect:pt,connectionRadius:mt,onConnectStart:gt,panBy:yt,getNodes:bt,cancelConnection:wt}=ot();let xt=0,kt;const{x:St,y:Tt}=getEventPosition(tt),At=ut==null?void 0:ut.elementFromPoint(St,Tt),Et=getHandleType(lt,At),Ct=dt==null?void 0:dt.getBoundingClientRect();if(!Ct||!Et)return;let Lt,jt=getEventPosition(tt,Ct),Rt=!1,$t=null,vt=!1,It=null;const Ot=getHandleLookup({nodes:bt(),nodeId:nt,handleId:et,handleType:Et}),Wt=()=>{if(!pt)return;const[Nt,Ut]=calcAutoPan(jt,Ct);yt({x:Nt,y:Ut}),xt=requestAnimationFrame(Wt)};at({connectionPosition:jt,connectionStatus:null,connectionNodeId:nt,connectionHandleId:et,connectionHandleType:Et,connectionStartHandle:{nodeId:nt,handleId:et,type:Et},connectionEndHandle:null}),gt==null||gt(tt,{nodeId:nt,handleId:et,handleType:Et});function zt(Nt){const{transform:Ut}=ot();jt=getEventPosition(Nt,Ct);const{handle:Pt,validHandleResult:Ht}=getClosestHandle(Nt,ut,pointToRendererPoint(jt,Ut,!1,[1,1]),mt,Ot,Qt=>isValidHandle(Qt,ht,nt,et,it?"target":"source",st,ut));if(kt=Pt,Rt||(Wt(),Rt=!0),It=Ht.handleDomNode,$t=Ht.connection,vt=Ht.isValid,at({connectionPosition:kt&&vt?rendererPointToPoint({x:kt.x,y:kt.y},Ut):jt,connectionStatus:getConnectionStatus(!!kt,vt),connectionEndHandle:Ht.endHandle}),!kt&&!vt&&!It)return resetRecentHandle(Lt);$t.source!==$t.target&&It&&(resetRecentHandle(Lt),Lt=It,It.classList.add("connecting","react-flow__handle-connecting"),It.classList.toggle("valid",vt),It.classList.toggle("react-flow__handle-valid",vt))}function Ft(Nt){var Ut,Pt;(kt||It)&&$t&&vt&&(rt==null||rt($t)),(Pt=(Ut=ot()).onConnectEnd)==null||Pt.call(Ut,Nt),lt&&(ct==null||ct(Nt)),resetRecentHandle(Lt),wt(),cancelAnimationFrame(xt),Rt=!1,vt=!1,$t=null,It=null,ut.removeEventListener("mousemove",zt),ut.removeEventListener("mouseup",Ft),ut.removeEventListener("touchmove",zt),ut.removeEventListener("touchend",Ft)}ut.addEventListener("mousemove",zt),ut.addEventListener("mouseup",Ft),ut.addEventListener("touchmove",zt),ut.addEventListener("touchend",Ft)}const alwaysValid=()=>!0,selector$f=tt=>({connectionStartHandle:tt.connectionStartHandle,connectOnClick:tt.connectOnClick,noPanClassName:tt.noPanClassName}),connectingSelector=(tt,et,nt)=>rt=>{const{connectionStartHandle:it,connectionEndHandle:ot,connectionClickStartHandle:at}=rt;return{connecting:(it==null?void 0:it.nodeId)===tt&&(it==null?void 0:it.handleId)===et&&(it==null?void 0:it.type)===nt||(ot==null?void 0:ot.nodeId)===tt&&(ot==null?void 0:ot.handleId)===et&&(ot==null?void 0:ot.type)===nt,clickConnecting:(at==null?void 0:at.nodeId)===tt&&(at==null?void 0:at.handleId)===et&&(at==null?void 0:at.type)===nt}},Handle=reactExports.forwardRef(({type:tt="source",position:et=Position.Top,isValidConnection:nt,isConnectable:rt=!0,isConnectableStart:it=!0,isConnectableEnd:ot=!0,id:at,onConnect:st,children:lt,className:ct,onMouseDown:ut,onTouchStart:ht,...dt},pt)=>{var Ct,Lt;const mt=at||null,gt=tt==="target",yt=useStoreApi(),bt=useNodeId(),{connectOnClick:wt,noPanClassName:xt}=useStore(selector$f,shallow$1),{connecting:kt,clickConnecting:St}=useStore(connectingSelector(bt,mt,tt),shallow$1);bt||(Lt=(Ct=yt.getState()).onError)==null||Lt.call(Ct,"010",errorMessages.error010());const Tt=jt=>{const{defaultEdgeOptions:Rt,onConnect:$t,hasDefaultEdges:vt}=yt.getState(),It={...Rt,...jt};if(vt){const{edges:Ot,setEdges:Wt}=yt.getState();Wt(addEdge(It,Ot))}$t==null||$t(It),st==null||st(It)},At=jt=>{if(!bt)return;const Rt=isMouseEvent(jt);it&&(Rt&&jt.button===0||!Rt)&&handlePointerDown({event:jt,handleId:mt,nodeId:bt,onConnect:Tt,isTarget:gt,getState:yt.getState,setState:yt.setState,isValidConnection:nt||yt.getState().isValidConnection||alwaysValid}),Rt?ut==null||ut(jt):ht==null||ht(jt)},Et=jt=>{const{onClickConnectStart:Rt,onClickConnectEnd:$t,connectionClickStartHandle:vt,connectionMode:It,isValidConnection:Ot}=yt.getState();if(!bt||!vt&&!it)return;if(!vt){Rt==null||Rt(jt,{nodeId:bt,handleId:mt,handleType:tt}),yt.setState({connectionClickStartHandle:{nodeId:bt,type:tt,handleId:mt}});return}const Wt=getHostForElement(jt.target),zt=nt||Ot||alwaysValid,{connection:Ft,isValid:Nt}=isValidHandle({nodeId:bt,id:mt,type:tt},It,vt.nodeId,vt.handleId||null,vt.type,zt,Wt);Nt&&Tt(Ft),$t==null||$t(jt),yt.setState({connectionClickStartHandle:null})};return React$1.createElement("div",{"data-handleid":mt,"data-nodeid":bt,"data-handlepos":et,"data-id":`${bt}-${mt}-${tt}`,className:cc(["react-flow__handle",`react-flow__handle-${et}`,"nodrag",xt,ct,{source:!gt,target:gt,connectable:rt,connectablestart:it,connectableend:ot,connecting:St,connectionindicator:rt&&(it&&!kt||ot&&kt)}]),onMouseDown:At,onTouchStart:At,onClick:wt?Et:void 0,ref:pt,...dt},lt)});Handle.displayName="Handle";var Handle$1=reactExports.memo(Handle);const DefaultNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top,sourcePosition:rt=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:rt,isConnectable:et}));DefaultNode.displayName="DefaultNode";var DefaultNode$1=reactExports.memo(DefaultNode);const InputNode=({data:tt,isConnectable:et,sourcePosition:nt=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:nt,isConnectable:et}));InputNode.displayName="InputNode";var InputNode$1=reactExports.memo(InputNode);const OutputNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label);OutputNode.displayName="OutputNode";var OutputNode$1=reactExports.memo(OutputNode);const GroupNode=()=>null;GroupNode.displayName="GroupNode";const selector$e=tt=>({selectedNodes:tt.getNodes().filter(et=>et.selected),selectedEdges:tt.edges.filter(et=>et.selected)}),selectId=tt=>tt.id;function areEqual(tt,et){return shallow$1(tt.selectedNodes.map(selectId),et.selectedNodes.map(selectId))&&shallow$1(tt.selectedEdges.map(selectId),et.selectedEdges.map(selectId))}const SelectionListener=reactExports.memo(({onSelectionChange:tt})=>{const et=useStoreApi(),{selectedNodes:nt,selectedEdges:rt}=useStore(selector$e,areEqual);return reactExports.useEffect(()=>{var ot,at;const it={nodes:nt,edges:rt};tt==null||tt(it),(at=(ot=et.getState()).onSelectionChange)==null||at.call(ot,it)},[nt,rt,tt]),null});SelectionListener.displayName="SelectionListener";const changeSelector=tt=>!!tt.onSelectionChange;function Wrapper$1$1({onSelectionChange:tt}){const et=useStore(changeSelector);return tt||et?React$1.createElement(SelectionListener,{onSelectionChange:tt}):null}const selector$d=tt=>({setNodes:tt.setNodes,setEdges:tt.setEdges,setDefaultNodesAndEdges:tt.setDefaultNodesAndEdges,setMinZoom:tt.setMinZoom,setMaxZoom:tt.setMaxZoom,setTranslateExtent:tt.setTranslateExtent,setNodeExtent:tt.setNodeExtent,reset:tt.reset});function useStoreUpdater(tt,et){reactExports.useEffect(()=>{typeof tt<"u"&&et(tt)},[tt])}function useDirectStoreUpdater(tt,et,nt){reactExports.useEffect(()=>{typeof et<"u"&&nt({[tt]:et})},[et])}const StoreUpdater=({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:rt,onConnect:it,onConnectStart:ot,onConnectEnd:at,onClickConnectStart:st,onClickConnectEnd:lt,nodesDraggable:ct,nodesConnectable:ut,nodesFocusable:ht,edgesFocusable:dt,edgesUpdatable:pt,elevateNodesOnSelect:mt,minZoom:gt,maxZoom:yt,nodeExtent:bt,onNodesChange:wt,onEdgesChange:xt,elementsSelectable:kt,connectionMode:St,snapGrid:Tt,snapToGrid:At,translateExtent:Et,connectOnClick:Ct,defaultEdgeOptions:Lt,fitView:jt,fitViewOptions:Rt,onNodesDelete:$t,onEdgesDelete:vt,onNodeDrag:It,onNodeDragStart:Ot,onNodeDragStop:Wt,onSelectionDrag:zt,onSelectionDragStart:Ft,onSelectionDragStop:Nt,noPanClassName:Ut,nodeOrigin:Pt,rfId:Ht,autoPanOnConnect:Qt,autoPanOnNodeDrag:an,onError:Yt,connectionRadius:nn,isValidConnection:tn,nodeDragThreshold:dn})=>{const{setNodes:wn,setEdges:rn,setDefaultNodesAndEdges:Jt,setMinZoom:vn,setMaxZoom:Cn,setTranslateExtent:$n,setNodeExtent:Nn,reset:En}=useStore(selector$d,shallow$1),sn=useStoreApi();return reactExports.useEffect(()=>{const pn=rt==null?void 0:rt.map(Tn=>({...Tn,...Lt}));return Jt(nt,pn),()=>{En()}},[]),useDirectStoreUpdater("defaultEdgeOptions",Lt,sn.setState),useDirectStoreUpdater("connectionMode",St,sn.setState),useDirectStoreUpdater("onConnect",it,sn.setState),useDirectStoreUpdater("onConnectStart",ot,sn.setState),useDirectStoreUpdater("onConnectEnd",at,sn.setState),useDirectStoreUpdater("onClickConnectStart",st,sn.setState),useDirectStoreUpdater("onClickConnectEnd",lt,sn.setState),useDirectStoreUpdater("nodesDraggable",ct,sn.setState),useDirectStoreUpdater("nodesConnectable",ut,sn.setState),useDirectStoreUpdater("nodesFocusable",ht,sn.setState),useDirectStoreUpdater("edgesFocusable",dt,sn.setState),useDirectStoreUpdater("edgesUpdatable",pt,sn.setState),useDirectStoreUpdater("elementsSelectable",kt,sn.setState),useDirectStoreUpdater("elevateNodesOnSelect",mt,sn.setState),useDirectStoreUpdater("snapToGrid",At,sn.setState),useDirectStoreUpdater("snapGrid",Tt,sn.setState),useDirectStoreUpdater("onNodesChange",wt,sn.setState),useDirectStoreUpdater("onEdgesChange",xt,sn.setState),useDirectStoreUpdater("connectOnClick",Ct,sn.setState),useDirectStoreUpdater("fitViewOnInit",jt,sn.setState),useDirectStoreUpdater("fitViewOnInitOptions",Rt,sn.setState),useDirectStoreUpdater("onNodesDelete",$t,sn.setState),useDirectStoreUpdater("onEdgesDelete",vt,sn.setState),useDirectStoreUpdater("onNodeDrag",It,sn.setState),useDirectStoreUpdater("onNodeDragStart",Ot,sn.setState),useDirectStoreUpdater("onNodeDragStop",Wt,sn.setState),useDirectStoreUpdater("onSelectionDrag",zt,sn.setState),useDirectStoreUpdater("onSelectionDragStart",Ft,sn.setState),useDirectStoreUpdater("onSelectionDragStop",Nt,sn.setState),useDirectStoreUpdater("noPanClassName",Ut,sn.setState),useDirectStoreUpdater("nodeOrigin",Pt,sn.setState),useDirectStoreUpdater("rfId",Ht,sn.setState),useDirectStoreUpdater("autoPanOnConnect",Qt,sn.setState),useDirectStoreUpdater("autoPanOnNodeDrag",an,sn.setState),useDirectStoreUpdater("onError",Yt,sn.setState),useDirectStoreUpdater("connectionRadius",nn,sn.setState),useDirectStoreUpdater("isValidConnection",tn,sn.setState),useDirectStoreUpdater("nodeDragThreshold",dn,sn.setState),useStoreUpdater(tt,wn),useStoreUpdater(et,rn),useStoreUpdater(gt,vn),useStoreUpdater(yt,Cn),useStoreUpdater(Et,$n),useStoreUpdater(bt,Nn),null},style$1={display:"none"},ariaLiveStyle={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ARIA_NODE_DESC_KEY="react-flow__node-desc",ARIA_EDGE_DESC_KEY="react-flow__edge-desc",ARIA_LIVE_MESSAGE="react-flow__aria-live",selector$c=tt=>tt.ariaLiveMessage;function AriaLiveMessage({rfId:tt}){const et=useStore(selector$c);return React$1.createElement("div",{id:`${ARIA_LIVE_MESSAGE}-${tt}`,"aria-live":"assertive","aria-atomic":"true",style:ariaLiveStyle},et)}function A11yDescriptions({rfId:tt,disableKeyboardA11y:et}){return React$1.createElement(React$1.Fragment,null,React$1.createElement("div",{id:`${ARIA_NODE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select a node.",!et&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),React$1.createElement("div",{id:`${ARIA_EDGE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!et&&React$1.createElement(AriaLiveMessage,{rfId:tt}))}var useKeyPress=(tt=null,et={actInsideInputWithModifier:!0})=>{const[nt,rt]=reactExports.useState(!1),it=reactExports.useRef(!1),ot=reactExports.useRef(new Set([])),[at,st]=reactExports.useMemo(()=>{if(tt!==null){const ct=(Array.isArray(tt)?tt:[tt]).filter(ht=>typeof ht=="string").map(ht=>ht.split("+")),ut=ct.reduce((ht,dt)=>ht.concat(...dt),[]);return[ct,ut]}return[[],[]]},[tt]);return reactExports.useEffect(()=>{const lt=typeof document<"u"?document:null,ct=(et==null?void 0:et.target)||lt;if(tt!==null){const ut=pt=>{if(it.current=pt.ctrlKey||pt.metaKey||pt.shiftKey,(!it.current||it.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);ot.current.add(pt[gt]),isMatchingKey(at,ot.current,!1)&&(pt.preventDefault(),rt(!0))},ht=pt=>{if((!it.current||it.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);isMatchingKey(at,ot.current,!0)?(rt(!1),ot.current.clear()):ot.current.delete(pt[gt]),pt.key==="Meta"&&ot.current.clear(),it.current=!1},dt=()=>{ot.current.clear(),rt(!1)};return ct==null||ct.addEventListener("keydown",ut),ct==null||ct.addEventListener("keyup",ht),window.addEventListener("blur",dt),()=>{ct==null||ct.removeEventListener("keydown",ut),ct==null||ct.removeEventListener("keyup",ht),window.removeEventListener("blur",dt)}}},[tt,rt]),nt};function isMatchingKey(tt,et,nt){return tt.filter(rt=>nt||rt.length===et.size).some(rt=>rt.every(it=>et.has(it)))}function useKeyOrCode(tt,et){return et.includes(tt)?"code":"key"}function calculateXYZPosition(tt,et,nt,rt){var at,st;if(!tt.parentNode)return nt;const it=et.get(tt.parentNode),ot=getNodePositionWithOrigin(it,rt);return calculateXYZPosition(it,et,{x:(nt.x??0)+ot.x,y:(nt.y??0)+ot.y,z:(((at=it[internalsSymbol])==null?void 0:at.z)??0)>(nt.z??0)?((st=it[internalsSymbol])==null?void 0:st.z)??0:nt.z??0},rt)}function updateAbsoluteNodePositions(tt,et,nt){tt.forEach(rt=>{var it;if(rt.parentNode&&!tt.has(rt.parentNode))throw new Error(`Parent node ${rt.parentNode} not found`);if(rt.parentNode||nt!=null&&nt[rt.id]){const{x:ot,y:at,z:st}=calculateXYZPosition(rt,tt,{...rt.position,z:((it=rt[internalsSymbol])==null?void 0:it.z)??0},et);rt.positionAbsolute={x:ot,y:at},rt[internalsSymbol].z=st,nt!=null&&nt[rt.id]&&(rt[internalsSymbol].isParent=!0)}})}function createNodeInternals(tt,et,nt,rt){const it=new Map,ot={},at=rt?1e3:0;return tt.forEach(st=>{var ht;const lt=(isNumeric(st.zIndex)?st.zIndex:0)+(st.selected?at:0),ct=et.get(st.id),ut={width:ct==null?void 0:ct.width,height:ct==null?void 0:ct.height,...st,positionAbsolute:{x:st.position.x,y:st.position.y}};st.parentNode&&(ut.parentNode=st.parentNode,ot[st.parentNode]=!0),Object.defineProperty(ut,internalsSymbol,{enumerable:!1,value:{handleBounds:(ht=ct==null?void 0:ct[internalsSymbol])==null?void 0:ht.handleBounds,z:lt}}),it.set(st.id,ut)}),updateAbsoluteNodePositions(it,nt,ot),it}function fitView(tt,et={}){const{getNodes:nt,width:rt,height:it,minZoom:ot,maxZoom:at,d3Zoom:st,d3Selection:lt,fitViewOnInitDone:ct,fitViewOnInit:ut,nodeOrigin:ht}=tt(),dt=et.initial&&!ct&&ut;if(st&<&&(dt||!et.initial)){const mt=nt().filter(yt=>{var wt;const bt=et.includeHiddenNodes?yt.width&&yt.height:!yt.hidden;return(wt=et.nodes)!=null&&wt.length?bt&&et.nodes.some(xt=>xt.id===yt.id):bt}),gt=mt.every(yt=>yt.width&&yt.height);if(mt.length>0&>){const yt=getRectOfNodes(mt,ht),[bt,wt,xt]=getTransformForBounds(yt,rt,it,et.minZoom??ot,et.maxZoom??at,et.padding??.1),kt=identity.translate(bt,wt).scale(xt);return typeof et.duration=="number"&&et.duration>0?st.transform(getD3Transition(lt,et.duration),kt):st.transform(lt,kt),!0}}return!1}function handleControlledNodeSelectionChange(tt,et){return tt.forEach(nt=>{const rt=et.get(nt.id);rt&&et.set(rt.id,{...rt,[internalsSymbol]:rt[internalsSymbol],selected:nt.selected})}),new Map(et)}function handleControlledEdgeSelectionChange(tt,et){return et.map(nt=>{const rt=tt.find(it=>it.id===nt.id);return rt&&(nt.selected=rt.selected),nt})}function updateNodesAndEdgesSelections({changedNodes:tt,changedEdges:et,get:nt,set:rt}){const{nodeInternals:it,edges:ot,onNodesChange:at,onEdgesChange:st,hasDefaultNodes:lt,hasDefaultEdges:ct}=nt();tt!=null&&tt.length&&(lt&&rt({nodeInternals:handleControlledNodeSelectionChange(tt,it)}),at==null||at(tt)),et!=null&&et.length&&(ct&&rt({edges:handleControlledEdgeSelectionChange(et,ot)}),st==null||st(et))}const noop$1=()=>{},initialViewportHelper={zoomIn:noop$1,zoomOut:noop$1,zoomTo:noop$1,getZoom:()=>1,setViewport:noop$1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:noop$1,fitBounds:noop$1,project:tt=>tt,viewportInitialized:!1},selector$b=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection}),useViewportHelper=()=>{const tt=useStoreApi(),{d3Zoom:et,d3Selection:nt}=useStore(selector$b,shallow$1);return reactExports.useMemo(()=>nt&&et?{zoomIn:it=>et.scaleBy(getD3Transition(nt,it==null?void 0:it.duration),1.2),zoomOut:it=>et.scaleBy(getD3Transition(nt,it==null?void 0:it.duration),1/1.2),zoomTo:(it,ot)=>et.scaleTo(getD3Transition(nt,ot==null?void 0:ot.duration),it),getZoom:()=>tt.getState().transform[2],setViewport:(it,ot)=>{const[at,st,lt]=tt.getState().transform,ct=identity.translate(it.x??at,it.y??st).scale(it.zoom??lt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),ct)},getViewport:()=>{const[it,ot,at]=tt.getState().transform;return{x:it,y:ot,zoom:at}},fitView:it=>fitView(tt.getState,it),setCenter:(it,ot,at)=>{const{width:st,height:lt,maxZoom:ct}=tt.getState(),ut=typeof(at==null?void 0:at.zoom)<"u"?at.zoom:ct,ht=st/2-it*ut,dt=lt/2-ot*ut,pt=identity.translate(ht,dt).scale(ut);et.transform(getD3Transition(nt,at==null?void 0:at.duration),pt)},fitBounds:(it,ot)=>{const{width:at,height:st,minZoom:lt,maxZoom:ct}=tt.getState(),[ut,ht,dt]=getTransformForBounds(it,at,st,lt,ct,(ot==null?void 0:ot.padding)??.1),pt=identity.translate(ut,ht).scale(dt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),pt)},project:it=>{const{transform:ot,snapToGrid:at,snapGrid:st}=tt.getState();return pointToRendererPoint(it,ot,at,st)},viewportInitialized:!0}:initialViewportHelper,[et,nt])};function useReactFlow(){const tt=useViewportHelper(),et=useStoreApi(),nt=reactExports.useCallback(()=>et.getState().getNodes().map(gt=>({...gt})),[]),rt=reactExports.useCallback(gt=>et.getState().nodeInternals.get(gt),[]),it=reactExports.useCallback(()=>{const{edges:gt=[]}=et.getState();return gt.map(yt=>({...yt}))},[]),ot=reactExports.useCallback(gt=>{const{edges:yt=[]}=et.getState();return yt.find(bt=>bt.id===gt)},[]),at=reactExports.useCallback(gt=>{const{getNodes:yt,setNodes:bt,hasDefaultNodes:wt,onNodesChange:xt}=et.getState(),kt=yt(),St=typeof gt=="function"?gt(kt):gt;if(wt)bt(St);else if(xt){const Tt=St.length===0?kt.map(At=>({type:"remove",id:At.id})):St.map(At=>({item:At,type:"reset"}));xt(Tt)}},[]),st=reactExports.useCallback(gt=>{const{edges:yt=[],setEdges:bt,hasDefaultEdges:wt,onEdgesChange:xt}=et.getState(),kt=typeof gt=="function"?gt(yt):gt;if(wt)bt(kt);else if(xt){const St=kt.length===0?yt.map(Tt=>({type:"remove",id:Tt.id})):kt.map(Tt=>({item:Tt,type:"reset"}));xt(St)}},[]),lt=reactExports.useCallback(gt=>{const yt=Array.isArray(gt)?gt:[gt],{getNodes:bt,setNodes:wt,hasDefaultNodes:xt,onNodesChange:kt}=et.getState();if(xt){const Tt=[...bt(),...yt];wt(Tt)}else if(kt){const St=yt.map(Tt=>({item:Tt,type:"add"}));kt(St)}},[]),ct=reactExports.useCallback(gt=>{const yt=Array.isArray(gt)?gt:[gt],{edges:bt=[],setEdges:wt,hasDefaultEdges:xt,onEdgesChange:kt}=et.getState();if(xt)wt([...bt,...yt]);else if(kt){const St=yt.map(Tt=>({item:Tt,type:"add"}));kt(St)}},[]),ut=reactExports.useCallback(()=>{const{getNodes:gt,edges:yt=[],transform:bt}=et.getState(),[wt,xt,kt]=bt;return{nodes:gt().map(St=>({...St})),edges:yt.map(St=>({...St})),viewport:{x:wt,y:xt,zoom:kt}}},[]),ht=reactExports.useCallback(({nodes:gt,edges:yt})=>{const{nodeInternals:bt,getNodes:wt,edges:xt,hasDefaultNodes:kt,hasDefaultEdges:St,onNodesDelete:Tt,onEdgesDelete:At,onNodesChange:Et,onEdgesChange:Ct}=et.getState(),Lt=(gt||[]).map(It=>It.id),jt=(yt||[]).map(It=>It.id),Rt=wt().reduce((It,Ot)=>{const Wt=!Lt.includes(Ot.id)&&Ot.parentNode&&It.find(Ft=>Ft.id===Ot.parentNode);return(typeof Ot.deletable=="boolean"?Ot.deletable:!0)&&(Lt.includes(Ot.id)||Wt)&&It.push(Ot),It},[]),$t=xt.filter(It=>typeof It.deletable=="boolean"?It.deletable:!0),vt=$t.filter(It=>jt.includes(It.id));if(Rt||vt){const It=getConnectedEdges(Rt,$t),Ot=[...vt,...It],Wt=Ot.reduce((zt,Ft)=>(zt.includes(Ft.id)||zt.push(Ft.id),zt),[]);if((St||kt)&&(St&&et.setState({edges:xt.filter(zt=>!Wt.includes(zt.id))}),kt&&(Rt.forEach(zt=>{bt.delete(zt.id)}),et.setState({nodeInternals:new Map(bt)}))),Wt.length>0&&(At==null||At(Ot),Ct&&Ct(Wt.map(zt=>({id:zt,type:"remove"})))),Rt.length>0&&(Tt==null||Tt(Rt),Et)){const zt=Rt.map(Ft=>({id:Ft.id,type:"remove"}));Et(zt)}}},[]),dt=reactExports.useCallback(gt=>{const yt=isRectObject(gt),bt=yt?null:et.getState().nodeInternals.get(gt.id);return[yt?gt:nodeToRect(bt),bt,yt]},[]),pt=reactExports.useCallback((gt,yt=!0,bt)=>{const[wt,xt,kt]=dt(gt);return wt?(bt||et.getState().getNodes()).filter(St=>{if(!kt&&(St.id===xt.id||!St.positionAbsolute))return!1;const Tt=nodeToRect(St),At=getOverlappingArea(Tt,wt);return yt&&At>0||At>=gt.width*gt.height}):[]},[]),mt=reactExports.useCallback((gt,yt,bt=!0)=>{const[wt]=dt(gt);if(!wt)return!1;const xt=getOverlappingArea(wt,yt);return bt&&xt>0||xt>=gt.width*gt.height},[]);return reactExports.useMemo(()=>({...tt,getNodes:nt,getNode:rt,getEdges:it,getEdge:ot,setNodes:at,setEdges:st,addNodes:lt,addEdges:ct,toObject:ut,deleteElements:ht,getIntersectingNodes:pt,isNodeIntersecting:mt}),[tt,nt,rt,it,ot,at,st,lt,ct,ut,ht,pt,mt])}const deleteKeyOptions={actInsideInputWithModifier:!1};var useGlobalKeyHandler=({deleteKeyCode:tt,multiSelectionKeyCode:et})=>{const nt=useStoreApi(),{deleteElements:rt}=useReactFlow(),it=useKeyPress(tt,deleteKeyOptions),ot=useKeyPress(et);reactExports.useEffect(()=>{if(it){const{edges:at,getNodes:st}=nt.getState(),lt=st().filter(ut=>ut.selected),ct=at.filter(ut=>ut.selected);rt({nodes:lt,edges:ct}),nt.setState({nodesSelectionActive:!1})}},[it]),reactExports.useEffect(()=>{nt.setState({multiSelectionActive:ot})},[ot])};function useResizeHandler(tt){const et=useStoreApi();reactExports.useEffect(()=>{let nt;const rt=()=>{var ot,at;if(!tt.current)return;const it=getDimensions(tt.current);(it.height===0||it.width===0)&&((at=(ot=et.getState()).onError)==null||at.call(ot,"004",errorMessages.error004())),et.setState({width:it.width||500,height:it.height||500})};return rt(),window.addEventListener("resize",rt),tt.current&&(nt=new ResizeObserver(()=>rt()),nt.observe(tt.current)),()=>{window.removeEventListener("resize",rt),nt&&tt.current&&nt.unobserve(tt.current)}},[])}const containerStyle={position:"absolute",width:"100%",height:"100%",top:0,left:0},viewChanged=(tt,et)=>tt.x!==et.x||tt.y!==et.y||tt.zoom!==et.k,eventToFlowTransform=tt=>({x:tt.x,y:tt.y,zoom:tt.k}),isWrappedWithClass=(tt,et)=>tt.target.closest(`.${et}`),isRightClickPan=(tt,et)=>et===2&&Array.isArray(tt)&&tt.includes(2),wheelDelta=tt=>{const et=tt.ctrlKey&&isMacOs()?10:1;return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*et},selector$a=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection,d3ZoomHandler:tt.d3ZoomHandler,userSelectionActive:tt.userSelectionActive}),ZoomPane=({onMove:tt,onMoveStart:et,onMoveEnd:nt,onPaneContextMenu:rt,zoomOnScroll:it=!0,zoomOnPinch:ot=!0,panOnScroll:at=!1,panOnScrollSpeed:st=.5,panOnScrollMode:lt=PanOnScrollMode.Free,zoomOnDoubleClick:ct=!0,elementsSelectable:ut,panOnDrag:ht=!0,defaultViewport:dt,translateExtent:pt,minZoom:mt,maxZoom:gt,zoomActivationKeyCode:yt,preventScrolling:bt=!0,children:wt,noWheelClassName:xt,noPanClassName:kt})=>{const St=reactExports.useRef(),Tt=useStoreApi(),At=reactExports.useRef(!1),Et=reactExports.useRef(!1),Ct=reactExports.useRef(null),Lt=reactExports.useRef({x:0,y:0,zoom:0}),{d3Zoom:jt,d3Selection:Rt,d3ZoomHandler:$t,userSelectionActive:vt}=useStore(selector$a,shallow$1),It=useKeyPress(yt),Ot=reactExports.useRef(0),Wt=reactExports.useRef(!1),zt=reactExports.useRef();return useResizeHandler(Ct),reactExports.useEffect(()=>{if(Ct.current){const Ft=Ct.current.getBoundingClientRect(),Nt=zoom().scaleExtent([mt,gt]).translateExtent(pt),Ut=select(Ct.current).call(Nt),Pt=identity.translate(dt.x,dt.y).scale(clamp(dt.zoom,mt,gt)),Ht=[[0,0],[Ft.width,Ft.height]],Qt=Nt.constrain()(Pt,Ht,pt);Nt.transform(Ut,Qt),Nt.wheelDelta(wheelDelta),Tt.setState({d3Zoom:Nt,d3Selection:Ut,d3ZoomHandler:Ut.on("wheel.zoom"),transform:[Qt.x,Qt.y,Qt.k],domNode:Ct.current.closest(".react-flow")})}},[]),reactExports.useEffect(()=>{Rt&&jt&&(at&&!It&&!vt?Rt.on("wheel.zoom",Ft=>{if(isWrappedWithClass(Ft,xt))return!1;Ft.preventDefault(),Ft.stopImmediatePropagation();const Nt=Rt.property("__zoom").k||1,Ut=isMacOs();if(Ft.ctrlKey&&ot&&Ut){const dn=pointer(Ft),wn=wheelDelta(Ft),rn=Nt*Math.pow(2,wn);jt.scaleTo(Rt,rn,dn,Ft);return}const Pt=Ft.deltaMode===1?20:1;let Ht=lt===PanOnScrollMode.Vertical?0:Ft.deltaX*Pt,Qt=lt===PanOnScrollMode.Horizontal?0:Ft.deltaY*Pt;!Ut&&Ft.shiftKey&<!==PanOnScrollMode.Vertical&&(Ht=Ft.deltaY*Pt,Qt=0),jt.translateBy(Rt,-(Ht/Nt)*st,-(Qt/Nt)*st,{internal:!0});const an=eventToFlowTransform(Rt.property("__zoom")),{onViewportChangeStart:Yt,onViewportChange:nn,onViewportChangeEnd:tn}=Tt.getState();clearTimeout(zt.current),Wt.current||(Wt.current=!0,et==null||et(Ft,an),Yt==null||Yt(an)),Wt.current&&(tt==null||tt(Ft,an),nn==null||nn(an),zt.current=setTimeout(()=>{nt==null||nt(Ft,an),tn==null||tn(an),Wt.current=!1},150))},{passive:!1}):typeof $t<"u"&&Rt.on("wheel.zoom",function(Ft,Nt){if(!bt||isWrappedWithClass(Ft,xt))return null;Ft.preventDefault(),$t.call(this,Ft,Nt)},{passive:!1}))},[vt,at,lt,Rt,jt,$t,It,ot,bt,xt,et,tt,nt]),reactExports.useEffect(()=>{jt&&jt.on("start",Ft=>{var Pt,Ht;if(!Ft.sourceEvent||Ft.sourceEvent.internal)return null;Ot.current=(Pt=Ft.sourceEvent)==null?void 0:Pt.button;const{onViewportChangeStart:Nt}=Tt.getState(),Ut=eventToFlowTransform(Ft.transform);At.current=!0,Lt.current=Ut,((Ht=Ft.sourceEvent)==null?void 0:Ht.type)==="mousedown"&&Tt.setState({paneDragging:!0}),Nt==null||Nt(Ut),et==null||et(Ft.sourceEvent,Ut)})},[jt,et]),reactExports.useEffect(()=>{jt&&(vt&&!At.current?jt.on("zoom",null):vt||jt.on("zoom",Ft=>{var Ut;const{onViewportChange:Nt}=Tt.getState();if(Tt.setState({transform:[Ft.transform.x,Ft.transform.y,Ft.transform.k]}),Et.current=!!(rt&&isRightClickPan(ht,Ot.current??0)),(tt||Nt)&&!((Ut=Ft.sourceEvent)!=null&&Ut.internal)){const Pt=eventToFlowTransform(Ft.transform);Nt==null||Nt(Pt),tt==null||tt(Ft.sourceEvent,Pt)}}))},[vt,jt,tt,ht,rt]),reactExports.useEffect(()=>{jt&&jt.on("end",Ft=>{if(!Ft.sourceEvent||Ft.sourceEvent.internal)return null;const{onViewportChangeEnd:Nt}=Tt.getState();if(At.current=!1,Tt.setState({paneDragging:!1}),rt&&isRightClickPan(ht,Ot.current??0)&&!Et.current&&rt(Ft.sourceEvent),Et.current=!1,(nt||Nt)&&viewChanged(Lt.current,Ft.transform)){const Ut=eventToFlowTransform(Ft.transform);Lt.current=Ut,clearTimeout(St.current),St.current=setTimeout(()=>{Nt==null||Nt(Ut),nt==null||nt(Ft.sourceEvent,Ut)},at?150:0)}})},[jt,at,ht,nt,rt]),reactExports.useEffect(()=>{jt&&jt.filter(Ft=>{const Nt=It||it,Ut=ot&&Ft.ctrlKey;if((ht===!0||Array.isArray(ht)&&ht.includes(1))&&Ft.button===1&&Ft.type==="mousedown"&&(isWrappedWithClass(Ft,"react-flow__node")||isWrappedWithClass(Ft,"react-flow__edge")))return!0;if(!ht&&!Nt&&!at&&!ct&&!ot||vt||!ct&&Ft.type==="dblclick"||isWrappedWithClass(Ft,xt)&&Ft.type==="wheel"||isWrappedWithClass(Ft,kt)&&(Ft.type!=="wheel"||at&&Ft.type==="wheel")||!ot&&Ft.ctrlKey&&Ft.type==="wheel"||!Nt&&!at&&!Ut&&Ft.type==="wheel"||!ht&&(Ft.type==="mousedown"||Ft.type==="touchstart")||Array.isArray(ht)&&!ht.includes(Ft.button)&&(Ft.type==="mousedown"||Ft.type==="touchstart"))return!1;const Pt=Array.isArray(ht)&&ht.includes(Ft.button)||!Ft.button||Ft.button<=1;return(!Ft.ctrlKey||Ft.type==="wheel")&&Pt})},[vt,jt,it,ot,at,ct,ht,ut,It]),React$1.createElement("div",{className:"react-flow__renderer",ref:Ct,style:containerStyle},wt)},selector$9=tt=>({userSelectionActive:tt.userSelectionActive,userSelectionRect:tt.userSelectionRect});function UserSelection(){const{userSelectionActive:tt,userSelectionRect:et}=useStore(selector$9,shallow$1);return tt&&et?React$1.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:et.width,height:et.height,transform:`translate(${et.x}px, ${et.y}px)`}}):null}function handleParentExpand(tt,et){const nt=tt.find(rt=>rt.id===et.parentNode);if(nt){const rt=et.position.x+et.width-nt.width,it=et.position.y+et.height-nt.height;if(rt>0||it>0||et.position.x<0||et.position.y<0){if(nt.style={...nt.style},nt.style.width=nt.style.width??nt.width,nt.style.height=nt.style.height??nt.height,rt>0&&(nt.style.width+=rt),it>0&&(nt.style.height+=it),et.position.x<0){const ot=Math.abs(et.position.x);nt.position.x=nt.position.x-ot,nt.style.width+=ot,et.position.x=0}if(et.position.y<0){const ot=Math.abs(et.position.y);nt.position.y=nt.position.y-ot,nt.style.height+=ot,et.position.y=0}nt.width=nt.style.width,nt.height=nt.style.height}}}function applyChanges(tt,et){if(tt.some(rt=>rt.type==="reset"))return tt.filter(rt=>rt.type==="reset").map(rt=>rt.item);const nt=tt.filter(rt=>rt.type==="add").map(rt=>rt.item);return et.reduce((rt,it)=>{const ot=tt.filter(st=>st.id===it.id);if(ot.length===0)return rt.push(it),rt;const at={...it};for(const st of ot)if(st)switch(st.type){case"select":{at.selected=st.selected;break}case"position":{typeof st.position<"u"&&(at.position=st.position),typeof st.positionAbsolute<"u"&&(at.positionAbsolute=st.positionAbsolute),typeof st.dragging<"u"&&(at.dragging=st.dragging),at.expandParent&&handleParentExpand(rt,at);break}case"dimensions":{typeof st.dimensions<"u"&&(at.width=st.dimensions.width,at.height=st.dimensions.height),typeof st.updateStyle<"u"&&(at.style={...at.style||{},...st.dimensions}),typeof st.resizing=="boolean"&&(at.resizing=st.resizing),at.expandParent&&handleParentExpand(rt,at);break}case"remove":return rt}return rt.push(at),rt},nt)}function applyNodeChanges(tt,et){return applyChanges(tt,et)}const createSelectionChange=(tt,et)=>({id:tt,type:"select",selected:et});function getSelectionChanges(tt,et){return tt.reduce((nt,rt)=>{const it=et.includes(rt.id);return!rt.selected&&it?(rt.selected=!0,nt.push(createSelectionChange(rt.id,!0))):rt.selected&&!it&&(rt.selected=!1,nt.push(createSelectionChange(rt.id,!1))),nt},[])}const wrapHandler=(tt,et)=>nt=>{nt.target===et.current&&(tt==null||tt(nt))},selector$8=tt=>({userSelectionActive:tt.userSelectionActive,elementsSelectable:tt.elementsSelectable,dragging:tt.paneDragging}),Pane=reactExports.memo(({isSelecting:tt,selectionMode:et=SelectionMode.Full,panOnDrag:nt,onSelectionStart:rt,onSelectionEnd:it,onPaneClick:ot,onPaneContextMenu:at,onPaneScroll:st,onPaneMouseEnter:lt,onPaneMouseMove:ct,onPaneMouseLeave:ut,children:ht})=>{const dt=reactExports.useRef(null),pt=useStoreApi(),mt=reactExports.useRef(0),gt=reactExports.useRef(0),yt=reactExports.useRef(),{userSelectionActive:bt,elementsSelectable:wt,dragging:xt}=useStore(selector$8,shallow$1),kt=()=>{pt.setState({userSelectionActive:!1,userSelectionRect:null}),mt.current=0,gt.current=0},St=$t=>{ot==null||ot($t),pt.getState().resetSelectedElements(),pt.setState({nodesSelectionActive:!1})},Tt=$t=>{if(Array.isArray(nt)&&(nt!=null&&nt.includes(2))){$t.preventDefault();return}at==null||at($t)},At=st?$t=>st($t):void 0,Et=$t=>{const{resetSelectedElements:vt,domNode:It}=pt.getState();if(yt.current=It==null?void 0:It.getBoundingClientRect(),!wt||!tt||$t.button!==0||$t.target!==dt.current||!yt.current)return;const{x:Ot,y:Wt}=getEventPosition($t,yt.current);vt(),pt.setState({userSelectionRect:{width:0,height:0,startX:Ot,startY:Wt,x:Ot,y:Wt}}),rt==null||rt($t)},Ct=$t=>{const{userSelectionRect:vt,nodeInternals:It,edges:Ot,transform:Wt,onNodesChange:zt,onEdgesChange:Ft,nodeOrigin:Nt,getNodes:Ut}=pt.getState();if(!tt||!yt.current||!vt)return;pt.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Pt=getEventPosition($t,yt.current),Ht=vt.startX??0,Qt=vt.startY??0,an={...vt,x:Pt.xwn.id),dn=nn.map(wn=>wn.id);if(mt.current!==dn.length){mt.current=dn.length;const wn=getSelectionChanges(Yt,dn);wn.length&&(zt==null||zt(wn))}if(gt.current!==tn.length){gt.current=tn.length;const wn=getSelectionChanges(Ot,tn);wn.length&&(Ft==null||Ft(wn))}pt.setState({userSelectionRect:an})},Lt=$t=>{if($t.button!==0)return;const{userSelectionRect:vt}=pt.getState();!bt&&vt&&$t.target===dt.current&&(St==null||St($t)),pt.setState({nodesSelectionActive:mt.current>0}),kt(),it==null||it($t)},jt=$t=>{bt&&(pt.setState({nodesSelectionActive:mt.current>0}),it==null||it($t)),kt()},Rt=wt&&(tt||bt);return React$1.createElement("div",{className:cc(["react-flow__pane",{dragging:xt,selection:tt}]),onClick:Rt?void 0:wrapHandler(St,dt),onContextMenu:wrapHandler(Tt,dt),onWheel:wrapHandler(At,dt),onMouseEnter:Rt?void 0:lt,onMouseDown:Rt?Et:void 0,onMouseMove:Rt?Ct:ct,onMouseUp:Rt?Lt:void 0,onMouseLeave:Rt?jt:ut,ref:dt,style:containerStyle},ht,React$1.createElement(UserSelection,null))});Pane.displayName="Pane";function isParentSelected(tt,et){if(!tt.parentNode)return!1;const nt=et.get(tt.parentNode);return nt?nt.selected?!0:isParentSelected(nt,et):!1}function hasSelector(tt,et,nt){let rt=tt;do{if(rt!=null&&rt.matches(et))return!0;if(rt===nt.current)return!1;rt=rt.parentElement}while(rt);return!1}function getDragItems(tt,et,nt,rt){return Array.from(tt.values()).filter(it=>(it.selected||it.id===rt)&&(!it.parentNode||!isParentSelected(it,tt))&&(it.draggable||et&&typeof it.draggable>"u")).map(it=>{var ot,at;return{id:it.id,position:it.position||{x:0,y:0},positionAbsolute:it.positionAbsolute||{x:0,y:0},distance:{x:nt.x-(((ot=it.positionAbsolute)==null?void 0:ot.x)??0),y:nt.y-(((at=it.positionAbsolute)==null?void 0:at.y)??0)},delta:{x:0,y:0},extent:it.extent,parentNode:it.parentNode,width:it.width,height:it.height,expandParent:it.expandParent}})}function clampNodeExtent(tt,et){return!et||et==="parent"?et:[et[0],[et[1][0]-(tt.width||0),et[1][1]-(tt.height||0)]]}function calcNextPosition(tt,et,nt,rt,it=[0,0],ot){const at=clampNodeExtent(tt,tt.extent||rt);let st=at;if(tt.extent==="parent"&&!tt.expandParent)if(tt.parentNode&&tt.width&&tt.height){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,it).positionAbsolute;st=ut&&isNumeric(ht)&&isNumeric(dt)&&isNumeric(ut.width)&&isNumeric(ut.height)?[[ht+tt.width*it[0],dt+tt.height*it[1]],[ht+ut.width-tt.width+tt.width*it[0],dt+ut.height-tt.height+tt.height*it[1]]]:st}else ot==null||ot("005",errorMessages.error005()),st=at;else if(tt.extent&&tt.parentNode&&tt.extent!=="parent"){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,it).positionAbsolute;st=[[tt.extent[0][0]+ht,tt.extent[0][1]+dt],[tt.extent[1][0]+ht,tt.extent[1][1]+dt]]}let lt={x:0,y:0};if(tt.parentNode){const ut=nt.get(tt.parentNode);lt=getNodePositionWithOrigin(ut,it).positionAbsolute}const ct=st&&st!=="parent"?clampPosition(et,st):et;return{position:{x:ct.x-lt.x,y:ct.y-lt.y},positionAbsolute:ct}}function getEventHandlerParams({nodeId:tt,dragItems:et,nodeInternals:nt}){const rt=et.map(it=>({...nt.get(it.id),position:it.position,positionAbsolute:it.positionAbsolute}));return[tt?rt.find(it=>it.id===tt):rt[0],rt]}const getHandleBounds=(tt,et,nt,rt)=>{const it=et.querySelectorAll(tt);if(!it||!it.length)return null;const ot=Array.from(it),at=et.getBoundingClientRect(),st={x:at.width*rt[0],y:at.height*rt[1]};return ot.map(lt=>{const ct=lt.getBoundingClientRect();return{id:lt.getAttribute("data-handleid"),position:lt.getAttribute("data-handlepos"),x:(ct.left-at.left-st.x)/nt,y:(ct.top-at.top-st.y)/nt,...getDimensions(lt)}})};function getMouseHandler(tt,et,nt){return nt===void 0?nt:rt=>{const it=et().nodeInternals.get(tt);it&&nt(rt,{...it})}}function handleNodeClick({id:tt,store:et,unselect:nt=!1,nodeRef:rt}){const{addSelectedNodes:it,unselectNodesAndEdges:ot,multiSelectionActive:at,nodeInternals:st,onError:lt}=et.getState(),ct=st.get(tt);if(!ct){lt==null||lt("012",errorMessages.error012(tt));return}et.setState({nodesSelectionActive:!1}),ct.selected?(nt||ct.selected&&at)&&(ot({nodes:[ct],edges:[]}),requestAnimationFrame(()=>{var ut;return(ut=rt==null?void 0:rt.current)==null?void 0:ut.blur()})):it([tt])}function useGetPointerPosition(){const tt=useStoreApi();return reactExports.useCallback(({sourceEvent:nt})=>{const{transform:rt,snapGrid:it,snapToGrid:ot}=tt.getState(),at=nt.touches?nt.touches[0].clientX:nt.clientX,st=nt.touches?nt.touches[0].clientY:nt.clientY,lt={x:(at-rt[0])/rt[2],y:(st-rt[1])/rt[2]};return{xSnapped:ot?it[0]*Math.round(lt.x/it[0]):lt.x,ySnapped:ot?it[1]*Math.round(lt.y/it[1]):lt.y,...lt}},[])}function wrapSelectionDragFunc(tt){return(et,nt,rt)=>tt==null?void 0:tt(et,rt)}function useDrag({nodeRef:tt,disabled:et=!1,noDragClassName:nt,handleSelector:rt,nodeId:it,isSelectable:ot,selectNodesOnDrag:at}){const st=useStoreApi(),[lt,ct]=reactExports.useState(!1),ut=reactExports.useRef([]),ht=reactExports.useRef({x:null,y:null}),dt=reactExports.useRef(0),pt=reactExports.useRef(null),mt=reactExports.useRef({x:0,y:0}),gt=reactExports.useRef(null),yt=reactExports.useRef(!1),bt=reactExports.useRef(!1),wt=useGetPointerPosition();return reactExports.useEffect(()=>{if(tt!=null&&tt.current){const xt=select(tt.current),kt=({x:At,y:Et})=>{const{nodeInternals:Ct,onNodeDrag:Lt,onSelectionDrag:jt,updateNodePositions:Rt,nodeExtent:$t,snapGrid:vt,snapToGrid:It,nodeOrigin:Ot,onError:Wt}=st.getState();ht.current={x:At,y:Et};let zt=!1,Ft={x:0,y:0,x2:0,y2:0};if(ut.current.length>1&&$t){const Ut=getRectOfNodes(ut.current,Ot);Ft=rectToBox(Ut)}if(ut.current=ut.current.map(Ut=>{const Pt={x:At-Ut.distance.x,y:Et-Ut.distance.y};It&&(Pt.x=vt[0]*Math.round(Pt.x/vt[0]),Pt.y=vt[1]*Math.round(Pt.y/vt[1]));const Ht=[[$t[0][0],$t[0][1]],[$t[1][0],$t[1][1]]];ut.current.length>1&&$t&&!Ut.extent&&(Ht[0][0]=Ut.positionAbsolute.x-Ft.x+$t[0][0],Ht[1][0]=Ut.positionAbsolute.x+(Ut.width??0)-Ft.x2+$t[1][0],Ht[0][1]=Ut.positionAbsolute.y-Ft.y+$t[0][1],Ht[1][1]=Ut.positionAbsolute.y+(Ut.height??0)-Ft.y2+$t[1][1]);const Qt=calcNextPosition(Ut,Pt,Ct,Ht,Ot,Wt);return zt=zt||Ut.position.x!==Qt.position.x||Ut.position.y!==Qt.position.y,Ut.position=Qt.position,Ut.positionAbsolute=Qt.positionAbsolute,Ut}),!zt)return;Rt(ut.current,!0,!0),ct(!0);const Nt=it?Lt:wrapSelectionDragFunc(jt);if(Nt&>.current){const[Ut,Pt]=getEventHandlerParams({nodeId:it,dragItems:ut.current,nodeInternals:Ct});Nt(gt.current,Ut,Pt)}},St=()=>{if(!pt.current)return;const[At,Et]=calcAutoPan(mt.current,pt.current);if(At!==0||Et!==0){const{transform:Ct,panBy:Lt}=st.getState();ht.current.x=(ht.current.x??0)-At/Ct[2],ht.current.y=(ht.current.y??0)-Et/Ct[2],Lt({x:At,y:Et})&&kt(ht.current)}dt.current=requestAnimationFrame(St)},Tt=At=>{var Ot;const{nodeInternals:Et,multiSelectionActive:Ct,nodesDraggable:Lt,unselectNodesAndEdges:jt,onNodeDragStart:Rt,onSelectionDragStart:$t}=st.getState();bt.current=!0;const vt=it?Rt:wrapSelectionDragFunc($t);(!at||!ot)&&!Ct&&it&&((Ot=Et.get(it))!=null&&Ot.selected||jt()),it&&ot&&at&&handleNodeClick({id:it,store:st,nodeRef:tt});const It=wt(At);if(ht.current=It,ut.current=getDragItems(Et,Lt,It,it),vt&&ut.current){const[Wt,zt]=getEventHandlerParams({nodeId:it,dragItems:ut.current,nodeInternals:Et});vt(At.sourceEvent,Wt,zt)}};if(et)xt.on(".drag",null);else{const At=drag().on("start",Et=>{const{domNode:Ct,nodeDragThreshold:Lt}=st.getState();Lt===0&&Tt(Et);const jt=wt(Et);ht.current=jt,pt.current=(Ct==null?void 0:Ct.getBoundingClientRect())||null,mt.current=getEventPosition(Et.sourceEvent,pt.current)}).on("drag",Et=>{var Rt,$t;const Ct=wt(Et),{autoPanOnNodeDrag:Lt,nodeDragThreshold:jt}=st.getState();if(!yt.current&&bt.current&&Lt&&(yt.current=!0,St()),!bt.current){const vt=Ct.xSnapped-(((Rt=ht==null?void 0:ht.current)==null?void 0:Rt.x)??0),It=Ct.ySnapped-((($t=ht==null?void 0:ht.current)==null?void 0:$t.y)??0);Math.sqrt(vt*vt+It*It)>jt&&Tt(Et)}(ht.current.x!==Ct.xSnapped||ht.current.y!==Ct.ySnapped)&&ut.current&&bt.current&&(gt.current=Et.sourceEvent,mt.current=getEventPosition(Et.sourceEvent,pt.current),kt(Ct))}).on("end",Et=>{if(bt.current&&(ct(!1),yt.current=!1,bt.current=!1,cancelAnimationFrame(dt.current),ut.current)){const{updateNodePositions:Ct,nodeInternals:Lt,onNodeDragStop:jt,onSelectionDragStop:Rt}=st.getState(),$t=it?jt:wrapSelectionDragFunc(Rt);if(Ct(ut.current,!1,!1),$t){const[vt,It]=getEventHandlerParams({nodeId:it,dragItems:ut.current,nodeInternals:Lt});$t(Et.sourceEvent,vt,It)}}}).filter(Et=>{const Ct=Et.target;return!Et.button&&(!nt||!hasSelector(Ct,`.${nt}`,tt))&&(!rt||hasSelector(Ct,rt,tt))});return xt.call(At),()=>{xt.on(".drag",null)}}}},[tt,et,nt,rt,ot,st,it,at,wt]),lt}function useUpdateNodePositions(){const tt=useStoreApi();return reactExports.useCallback(nt=>{const{nodeInternals:rt,nodeExtent:it,updateNodePositions:ot,getNodes:at,snapToGrid:st,snapGrid:lt,onError:ct,nodesDraggable:ut}=tt.getState(),ht=at().filter(wt=>wt.selected&&(wt.draggable||ut&&typeof wt.draggable>"u")),dt=st?lt[0]:5,pt=st?lt[1]:5,mt=nt.isShiftPressed?4:1,gt=nt.x*dt*mt,yt=nt.y*pt*mt,bt=ht.map(wt=>{if(wt.positionAbsolute){const xt={x:wt.positionAbsolute.x+gt,y:wt.positionAbsolute.y+yt};st&&(xt.x=lt[0]*Math.round(xt.x/lt[0]),xt.y=lt[1]*Math.round(xt.y/lt[1]));const{positionAbsolute:kt,position:St}=calcNextPosition(wt,xt,rt,it,void 0,ct);wt.position=St,wt.positionAbsolute=kt}return wt});ot(bt,!0,!1)},[])}const arrowKeyDiffs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var wrapNode=tt=>{const et=({id:nt,type:rt,data:it,xPos:ot,yPos:at,xPosOrigin:st,yPosOrigin:lt,selected:ct,onClick:ut,onMouseEnter:ht,onMouseMove:dt,onMouseLeave:pt,onContextMenu:mt,onDoubleClick:gt,style:yt,className:bt,isDraggable:wt,isSelectable:xt,isConnectable:kt,isFocusable:St,selectNodesOnDrag:Tt,sourcePosition:At,targetPosition:Et,hidden:Ct,resizeObserver:Lt,dragHandle:jt,zIndex:Rt,isParent:$t,noDragClassName:vt,noPanClassName:It,initialized:Ot,disableKeyboardA11y:Wt,ariaLabel:zt,rfId:Ft})=>{const Nt=useStoreApi(),Ut=reactExports.useRef(null),Pt=reactExports.useRef(At),Ht=reactExports.useRef(Et),Qt=reactExports.useRef(rt),an=xt||wt||ut||ht||dt||pt,Yt=useUpdateNodePositions(),nn=getMouseHandler(nt,Nt.getState,ht),tn=getMouseHandler(nt,Nt.getState,dt),dn=getMouseHandler(nt,Nt.getState,pt),wn=getMouseHandler(nt,Nt.getState,mt),rn=getMouseHandler(nt,Nt.getState,gt),Jt=$n=>{const{nodeDragThreshold:Nn}=Nt.getState();if(xt&&(!Tt||!wt||Nn>0)&&handleNodeClick({id:nt,store:Nt,nodeRef:Ut}),ut){const En=Nt.getState().nodeInternals.get(nt);En&&ut($n,{...En})}},vn=$n=>{if(!isInputDOMNode($n))if(elementSelectionKeys.includes($n.key)&&xt){const Nn=$n.key==="Escape";handleNodeClick({id:nt,store:Nt,unselect:Nn,nodeRef:Ut})}else!Wt&&wt&&ct&&Object.prototype.hasOwnProperty.call(arrowKeyDiffs,$n.key)&&(Nt.setState({ariaLiveMessage:`Moved selected node ${$n.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~ot}, y: ${~~at}`}),Yt({x:arrowKeyDiffs[$n.key].x,y:arrowKeyDiffs[$n.key].y,isShiftPressed:$n.shiftKey}))};reactExports.useEffect(()=>{if(Ut.current&&!Ct){const $n=Ut.current;return Lt==null||Lt.observe($n),()=>Lt==null?void 0:Lt.unobserve($n)}},[Ct]),reactExports.useEffect(()=>{const $n=Qt.current!==rt,Nn=Pt.current!==At,En=Ht.current!==Et;Ut.current&&($n||Nn||En)&&($n&&(Qt.current=rt),Nn&&(Pt.current=At),En&&(Ht.current=Et),Nt.getState().updateNodeDimensions([{id:nt,nodeElement:Ut.current,forceUpdate:!0}]))},[nt,rt,At,Et]);const Cn=useDrag({nodeRef:Ut,disabled:Ct||!wt,noDragClassName:vt,handleSelector:jt,nodeId:nt,isSelectable:xt,selectNodesOnDrag:Tt});return Ct?null:React$1.createElement("div",{className:cc(["react-flow__node",`react-flow__node-${rt}`,{[It]:wt},bt,{selected:ct,selectable:xt,parent:$t,dragging:Cn}]),ref:Ut,style:{zIndex:Rt,transform:`translate(${st}px,${lt}px)`,pointerEvents:an?"all":"none",visibility:Ot?"visible":"hidden",...yt},"data-id":nt,"data-testid":`rf__node-${nt}`,onMouseEnter:nn,onMouseMove:tn,onMouseLeave:dn,onContextMenu:wn,onClick:Jt,onDoubleClick:rn,onKeyDown:St?vn:void 0,tabIndex:St?0:void 0,role:St?"button":void 0,"aria-describedby":Wt?void 0:`${ARIA_NODE_DESC_KEY}-${Ft}`,"aria-label":zt},React$1.createElement(Provider,{value:nt},React$1.createElement(tt,{id:nt,data:it,type:rt,xPos:ot,yPos:at,selected:ct,isConnectable:kt,sourcePosition:At,targetPosition:Et,dragging:Cn,dragHandle:jt,zIndex:Rt})))};return et.displayName="NodeWrapper",reactExports.memo(et)};const selector$7=tt=>{const et=tt.getNodes().filter(nt=>nt.selected);return{...getRectOfNodes(et,tt.nodeOrigin),transformString:`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`,userSelectionActive:tt.userSelectionActive}};function NodesSelection({onSelectionContextMenu:tt,noPanClassName:et,disableKeyboardA11y:nt}){const rt=useStoreApi(),{width:it,height:ot,x:at,y:st,transformString:lt,userSelectionActive:ct}=useStore(selector$7,shallow$1),ut=useUpdateNodePositions(),ht=reactExports.useRef(null);if(reactExports.useEffect(()=>{var mt;nt||(mt=ht.current)==null||mt.focus({preventScroll:!0})},[nt]),useDrag({nodeRef:ht}),ct||!it||!ot)return null;const dt=tt?mt=>{const gt=rt.getState().getNodes().filter(yt=>yt.selected);tt(mt,gt)}:void 0,pt=mt=>{Object.prototype.hasOwnProperty.call(arrowKeyDiffs,mt.key)&&ut({x:arrowKeyDiffs[mt.key].x,y:arrowKeyDiffs[mt.key].y,isShiftPressed:mt.shiftKey})};return React$1.createElement("div",{className:cc(["react-flow__nodesselection","react-flow__container",et]),style:{transform:lt}},React$1.createElement("div",{ref:ht,className:"react-flow__nodesselection-rect",onContextMenu:dt,tabIndex:nt?void 0:-1,onKeyDown:nt?void 0:pt,style:{width:it,height:ot,top:st,left:at}}))}var NodesSelection$1=reactExports.memo(NodesSelection);const selector$6=tt=>tt.nodesSelectionActive,FlowRenderer=({children:tt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:rt,onPaneMouseLeave:it,onPaneContextMenu:ot,onPaneScroll:at,deleteKeyCode:st,onMove:lt,onMoveStart:ct,onMoveEnd:ut,selectionKeyCode:ht,selectionOnDrag:dt,selectionMode:pt,onSelectionStart:mt,onSelectionEnd:gt,multiSelectionKeyCode:yt,panActivationKeyCode:bt,zoomActivationKeyCode:wt,elementsSelectable:xt,zoomOnScroll:kt,zoomOnPinch:St,panOnScroll:Tt,panOnScrollSpeed:At,panOnScrollMode:Et,zoomOnDoubleClick:Ct,panOnDrag:Lt,defaultViewport:jt,translateExtent:Rt,minZoom:$t,maxZoom:vt,preventScrolling:It,onSelectionContextMenu:Ot,noWheelClassName:Wt,noPanClassName:zt,disableKeyboardA11y:Ft})=>{const Nt=useStore(selector$6),Ut=useKeyPress(ht),Ht=useKeyPress(bt)||Lt,Qt=Ut||dt&&Ht!==!0;return useGlobalKeyHandler({deleteKeyCode:st,multiSelectionKeyCode:yt}),React$1.createElement(ZoomPane,{onMove:lt,onMoveStart:ct,onMoveEnd:ut,onPaneContextMenu:ot,elementsSelectable:xt,zoomOnScroll:kt,zoomOnPinch:St,panOnScroll:Tt,panOnScrollSpeed:At,panOnScrollMode:Et,zoomOnDoubleClick:Ct,panOnDrag:!Ut&&Ht,defaultViewport:jt,translateExtent:Rt,minZoom:$t,maxZoom:vt,zoomActivationKeyCode:wt,preventScrolling:It,noWheelClassName:Wt,noPanClassName:zt},React$1.createElement(Pane,{onSelectionStart:mt,onSelectionEnd:gt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:rt,onPaneMouseLeave:it,onPaneContextMenu:ot,onPaneScroll:at,panOnDrag:Ht,isSelecting:!!Qt,selectionMode:pt},tt,Nt&&React$1.createElement(NodesSelection$1,{onSelectionContextMenu:Ot,noPanClassName:zt,disableKeyboardA11y:Ft})))};FlowRenderer.displayName="FlowRenderer";var FlowRenderer$1=reactExports.memo(FlowRenderer);function useVisibleNodes(tt){return useStore(reactExports.useCallback(nt=>tt?getNodesInside(nt.nodeInternals,{x:0,y:0,width:nt.width,height:nt.height},nt.transform,!0):nt.getNodes(),[tt]))}function createNodeTypes(tt){const et={input:wrapNode(tt.input||InputNode$1),default:wrapNode(tt.default||DefaultNode$1),output:wrapNode(tt.output||OutputNode$1),group:wrapNode(tt.group||GroupNode)},nt={},rt=Object.keys(tt).filter(it=>!["input","default","output","group"].includes(it)).reduce((it,ot)=>(it[ot]=wrapNode(tt[ot]||DefaultNode$1),it),nt);return{...et,...rt}}const getPositionWithOrigin=({x:tt,y:et,width:nt,height:rt,origin:it})=>!nt||!rt?{x:tt,y:et}:it[0]<0||it[1]<0||it[0]>1||it[1]>1?{x:tt,y:et}:{x:tt-nt*it[0],y:et-rt*it[1]},selector$5=tt=>({nodesDraggable:tt.nodesDraggable,nodesConnectable:tt.nodesConnectable,nodesFocusable:tt.nodesFocusable,elementsSelectable:tt.elementsSelectable,updateNodeDimensions:tt.updateNodeDimensions,onError:tt.onError}),NodeRenderer=tt=>{const{nodesDraggable:et,nodesConnectable:nt,nodesFocusable:rt,elementsSelectable:it,updateNodeDimensions:ot,onError:at}=useStore(selector$5,shallow$1),st=useVisibleNodes(tt.onlyRenderVisibleElements),lt=reactExports.useRef(),ct=reactExports.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const ut=new ResizeObserver(ht=>{const dt=ht.map(pt=>({id:pt.target.getAttribute("data-id"),nodeElement:pt.target,forceUpdate:!0}));ot(dt)});return lt.current=ut,ut},[]);return reactExports.useEffect(()=>()=>{var ut;(ut=lt==null?void 0:lt.current)==null||ut.disconnect()},[]),React$1.createElement("div",{className:"react-flow__nodes",style:containerStyle},st.map(ut=>{var St,Tt;let ht=ut.type||"default";tt.nodeTypes[ht]||(at==null||at("003",errorMessages.error003(ht)),ht="default");const dt=tt.nodeTypes[ht]||tt.nodeTypes.default,pt=!!(ut.draggable||et&&typeof ut.draggable>"u"),mt=!!(ut.selectable||it&&typeof ut.selectable>"u"),gt=!!(ut.connectable||nt&&typeof ut.connectable>"u"),yt=!!(ut.focusable||rt&&typeof ut.focusable>"u"),bt=tt.nodeExtent?clampPosition(ut.positionAbsolute,tt.nodeExtent):ut.positionAbsolute,wt=(bt==null?void 0:bt.x)??0,xt=(bt==null?void 0:bt.y)??0,kt=getPositionWithOrigin({x:wt,y:xt,width:ut.width??0,height:ut.height??0,origin:tt.nodeOrigin});return React$1.createElement(dt,{key:ut.id,id:ut.id,className:ut.className,style:ut.style,type:ht,data:ut.data,sourcePosition:ut.sourcePosition||Position.Bottom,targetPosition:ut.targetPosition||Position.Top,hidden:ut.hidden,xPos:wt,yPos:xt,xPosOrigin:kt.x,yPosOrigin:kt.y,selectNodesOnDrag:tt.selectNodesOnDrag,onClick:tt.onNodeClick,onMouseEnter:tt.onNodeMouseEnter,onMouseMove:tt.onNodeMouseMove,onMouseLeave:tt.onNodeMouseLeave,onContextMenu:tt.onNodeContextMenu,onDoubleClick:tt.onNodeDoubleClick,selected:!!ut.selected,isDraggable:pt,isSelectable:mt,isConnectable:gt,isFocusable:yt,resizeObserver:ct,dragHandle:ut.dragHandle,zIndex:((St=ut[internalsSymbol])==null?void 0:St.z)??0,isParent:!!((Tt=ut[internalsSymbol])!=null&&Tt.isParent),noDragClassName:tt.noDragClassName,noPanClassName:tt.noPanClassName,initialized:!!ut.width&&!!ut.height,rfId:tt.rfId,disableKeyboardA11y:tt.disableKeyboardA11y,ariaLabel:ut.ariaLabel})}))};NodeRenderer.displayName="NodeRenderer";var NodeRenderer$1=reactExports.memo(NodeRenderer);const shiftX=(tt,et,nt)=>nt===Position.Left?tt-et:nt===Position.Right?tt+et:tt,shiftY=(tt,et,nt)=>nt===Position.Top?tt-et:nt===Position.Bottom?tt+et:tt,EdgeUpdaterClassName="react-flow__edgeupdater",EdgeAnchor=({position:tt,centerX:et,centerY:nt,radius:rt=10,onMouseDown:it,onMouseEnter:ot,onMouseOut:at,type:st})=>React$1.createElement("circle",{onMouseDown:it,onMouseEnter:ot,onMouseOut:at,className:cc([EdgeUpdaterClassName,`${EdgeUpdaterClassName}-${st}`]),cx:shiftX(et,rt,tt),cy:shiftY(nt,rt,tt),r:rt,stroke:"transparent",fill:"transparent"}),alwaysValidConnection=()=>!0;var wrapEdge=tt=>{const et=({id:nt,className:rt,type:it,data:ot,onClick:at,onEdgeDoubleClick:st,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,style:yt,source:bt,target:wt,sourceX:xt,sourceY:kt,targetX:St,targetY:Tt,sourcePosition:At,targetPosition:Et,elementsSelectable:Ct,hidden:Lt,sourceHandleId:jt,targetHandleId:Rt,onContextMenu:$t,onMouseEnter:vt,onMouseMove:It,onMouseLeave:Ot,edgeUpdaterRadius:Wt,onEdgeUpdate:zt,onEdgeUpdateStart:Ft,onEdgeUpdateEnd:Nt,markerEnd:Ut,markerStart:Pt,rfId:Ht,ariaLabel:Qt,isFocusable:an,isUpdatable:Yt,pathOptions:nn,interactionWidth:tn})=>{const dn=reactExports.useRef(null),[wn,rn]=reactExports.useState(!1),[Jt,vn]=reactExports.useState(!1),Cn=useStoreApi(),$n=reactExports.useMemo(()=>`url(#${getMarkerId(Pt,Ht)})`,[Pt,Ht]),Nn=reactExports.useMemo(()=>`url(#${getMarkerId(Ut,Ht)})`,[Ut,Ht]);if(Lt)return null;const En=kn=>{var Gn;const{edges:Mn,addSelectedEdges:On,unselectNodesAndEdges:Bn,multiSelectionActive:Xn}=Cn.getState(),Vn=Mn.find(zn=>zn.id===nt);Vn&&(Ct&&(Cn.setState({nodesSelectionActive:!1}),Vn.selected&&Xn?(Bn({nodes:[],edges:[Vn]}),(Gn=dn.current)==null||Gn.blur()):On([nt])),at&&at(kn,Vn))},sn=getMouseHandler$1(nt,Cn.getState,st),pn=getMouseHandler$1(nt,Cn.getState,$t),Tn=getMouseHandler$1(nt,Cn.getState,vt),In=getMouseHandler$1(nt,Cn.getState,It),yn=getMouseHandler$1(nt,Cn.getState,Ot),hn=(kn,Mn)=>{if(kn.button!==0)return;const{edges:On,isValidConnection:Bn}=Cn.getState(),Xn=Mn?wt:bt,Vn=(Mn?Rt:jt)||null,Gn=Mn?"target":"source",zn=Bn||alwaysValidConnection,Zn=Mn,Wn=On.find(wr=>wr.id===nt);vn(!0),Ft==null||Ft(kn,Wn,Gn);const fr=wr=>{vn(!1),Nt==null||Nt(wr,Wn,Gn)};handlePointerDown({event:kn,handleId:Vn,nodeId:Xn,onConnect:wr=>zt==null?void 0:zt(Wn,wr),isTarget:Zn,getState:Cn.getState,setState:Cn.setState,isValidConnection:zn,edgeUpdaterType:Gn,onEdgeUpdateEnd:fr})},fn=kn=>hn(kn,!0),xn=kn=>hn(kn,!1),jn=()=>rn(!0),cn=()=>rn(!1),Xt=!Ct&&!at,Kt=kn=>{var Mn;if(elementSelectionKeys.includes(kn.key)&&Ct){const{unselectNodesAndEdges:On,addSelectedEdges:Bn,edges:Xn}=Cn.getState();kn.key==="Escape"?((Mn=dn.current)==null||Mn.blur(),On({edges:[Xn.find(Gn=>Gn.id===nt)]})):Bn([nt])}};return React$1.createElement("g",{className:cc(["react-flow__edge",`react-flow__edge-${it}`,rt,{selected:lt,animated:ct,inactive:Xt,updating:wn}]),onClick:En,onDoubleClick:sn,onContextMenu:pn,onMouseEnter:Tn,onMouseMove:In,onMouseLeave:yn,onKeyDown:an?Kt:void 0,tabIndex:an?0:void 0,role:an?"button":"img","data-testid":`rf__edge-${nt}`,"aria-label":Qt===null?void 0:Qt||`Edge from ${bt} to ${wt}`,"aria-describedby":an?`${ARIA_EDGE_DESC_KEY}-${Ht}`:void 0,ref:dn},!Jt&&React$1.createElement(tt,{id:nt,source:bt,target:wt,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,data:ot,style:yt,sourceX:xt,sourceY:kt,targetX:St,targetY:Tt,sourcePosition:At,targetPosition:Et,sourceHandleId:jt,targetHandleId:Rt,markerStart:$n,markerEnd:Nn,pathOptions:nn,interactionWidth:tn}),Yt&&React$1.createElement(React$1.Fragment,null,(Yt==="source"||Yt===!0)&&React$1.createElement(EdgeAnchor,{position:At,centerX:xt,centerY:kt,radius:Wt,onMouseDown:fn,onMouseEnter:jn,onMouseOut:cn,type:"source"}),(Yt==="target"||Yt===!0)&&React$1.createElement(EdgeAnchor,{position:Et,centerX:St,centerY:Tt,radius:Wt,onMouseDown:xn,onMouseEnter:jn,onMouseOut:cn,type:"target"})))};return et.displayName="EdgeWrapper",reactExports.memo(et)};function createEdgeTypes(tt){const et={default:wrapEdge(tt.default||BezierEdge),straight:wrapEdge(tt.bezier||StraightEdge),step:wrapEdge(tt.step||StepEdge),smoothstep:wrapEdge(tt.step||SmoothStepEdge),simplebezier:wrapEdge(tt.simplebezier||SimpleBezierEdge)},nt={},rt=Object.keys(tt).filter(it=>!["default","bezier"].includes(it)).reduce((it,ot)=>(it[ot]=wrapEdge(tt[ot]||BezierEdge),it),nt);return{...et,...rt}}function getHandlePosition(tt,et,nt=null){const rt=((nt==null?void 0:nt.x)||0)+et.x,it=((nt==null?void 0:nt.y)||0)+et.y,ot=(nt==null?void 0:nt.width)||et.width,at=(nt==null?void 0:nt.height)||et.height;switch(tt){case Position.Top:return{x:rt+ot/2,y:it};case Position.Right:return{x:rt+ot,y:it+at/2};case Position.Bottom:return{x:rt+ot/2,y:it+at};case Position.Left:return{x:rt,y:it+at/2}}}function getHandle(tt,et){return tt?tt.length===1||!et?tt[0]:et&&tt.find(nt=>nt.id===et)||null:null}const getEdgePositions=(tt,et,nt,rt,it,ot)=>{const at=getHandlePosition(nt,tt,et),st=getHandlePosition(ot,rt,it);return{sourceX:at.x,sourceY:at.y,targetX:st.x,targetY:st.y}};function isEdgeVisible({sourcePos:tt,targetPos:et,sourceWidth:nt,sourceHeight:rt,targetWidth:it,targetHeight:ot,width:at,height:st,transform:lt}){const ct={x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x+nt,et.x+it),y2:Math.max(tt.y+rt,et.y+ot)};ct.x===ct.x2&&(ct.x2+=1),ct.y===ct.y2&&(ct.y2+=1);const ut=rectToBox({x:(0-lt[0])/lt[2],y:(0-lt[1])/lt[2],width:at/lt[2],height:st/lt[2]}),ht=Math.max(0,Math.min(ut.x2,ct.x2)-Math.max(ut.x,ct.x)),dt=Math.max(0,Math.min(ut.y2,ct.y2)-Math.max(ut.y,ct.y));return Math.ceil(ht*dt)>0}function getNodeData(tt){var rt,it,ot,at,st;const et=((rt=tt==null?void 0:tt[internalsSymbol])==null?void 0:rt.handleBounds)||null,nt=et&&(tt==null?void 0:tt.width)&&(tt==null?void 0:tt.height)&&typeof((it=tt==null?void 0:tt.positionAbsolute)==null?void 0:it.x)<"u"&&typeof((ot=tt==null?void 0:tt.positionAbsolute)==null?void 0:ot.y)<"u";return[{x:((at=tt==null?void 0:tt.positionAbsolute)==null?void 0:at.x)||0,y:((st=tt==null?void 0:tt.positionAbsolute)==null?void 0:st.y)||0,width:(tt==null?void 0:tt.width)||0,height:(tt==null?void 0:tt.height)||0},et,!!nt]}const defaultEdgeTree=[{level:0,isMaxLevel:!0,edges:[]}];function groupEdgesByZLevel(tt,et,nt=!1){let rt=-1;const it=tt.reduce((at,st)=>{var ut,ht;const lt=isNumeric(st.zIndex);let ct=lt?st.zIndex:0;if(nt){const dt=et.get(st.target),pt=et.get(st.source),mt=st.selected||(dt==null?void 0:dt.selected)||(pt==null?void 0:pt.selected),gt=Math.max(((ut=pt==null?void 0:pt[internalsSymbol])==null?void 0:ut.z)||0,((ht=dt==null?void 0:dt[internalsSymbol])==null?void 0:ht.z)||0,1e3);ct=(lt?st.zIndex:0)+(mt?gt:0)}return at[ct]?at[ct].push(st):at[ct]=[st],rt=ct>rt?ct:rt,at},{}),ot=Object.entries(it).map(([at,st])=>{const lt=+at;return{edges:st,level:lt,isMaxLevel:lt===rt}});return ot.length===0?defaultEdgeTree:ot}function useVisibleEdges(tt,et,nt){const rt=useStore(reactExports.useCallback(it=>tt?it.edges.filter(ot=>{const at=et.get(ot.source),st=et.get(ot.target);return(at==null?void 0:at.width)&&(at==null?void 0:at.height)&&(st==null?void 0:st.width)&&(st==null?void 0:st.height)&&isEdgeVisible({sourcePos:at.positionAbsolute||{x:0,y:0},targetPos:st.positionAbsolute||{x:0,y:0},sourceWidth:at.width,sourceHeight:at.height,targetWidth:st.width,targetHeight:st.height,width:it.width,height:it.height,transform:it.transform})}):it.edges,[tt,et]));return groupEdgesByZLevel(rt,et,nt)}const ArrowSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),ArrowClosedSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,fill:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),MarkerSymbols={[MarkerType.Arrow]:ArrowSymbol,[MarkerType.ArrowClosed]:ArrowClosedSymbol};function useMarkerSymbol(tt){const et=useStoreApi();return reactExports.useMemo(()=>{var it,ot;return Object.prototype.hasOwnProperty.call(MarkerSymbols,tt)?MarkerSymbols[tt]:((ot=(it=et.getState()).onError)==null||ot.call(it,"009",errorMessages.error009(tt)),null)},[tt])}const Marker=({id:tt,type:et,color:nt,width:rt=12.5,height:it=12.5,markerUnits:ot="strokeWidth",strokeWidth:at,orient:st="auto-start-reverse"})=>{const lt=useMarkerSymbol(et);return lt?React$1.createElement("marker",{className:"react-flow__arrowhead",id:tt,markerWidth:`${rt}`,markerHeight:`${it}`,viewBox:"-10 -10 20 20",markerUnits:ot,orient:st,refX:"0",refY:"0"},React$1.createElement(lt,{color:nt,strokeWidth:at})):null},markerSelector=({defaultColor:tt,rfId:et})=>nt=>{const rt=[];return nt.edges.reduce((it,ot)=>([ot.markerStart,ot.markerEnd].forEach(at=>{if(at&&typeof at=="object"){const st=getMarkerId(at,et);rt.includes(st)||(it.push({id:st,color:at.color||tt,...at}),rt.push(st))}}),it),[]).sort((it,ot)=>it.id.localeCompare(ot.id))},MarkerDefinitions=({defaultColor:tt,rfId:et})=>{const nt=useStore(reactExports.useCallback(markerSelector({defaultColor:tt,rfId:et}),[tt,et]),(rt,it)=>!(rt.length!==it.length||rt.some((ot,at)=>ot.id!==it[at].id)));return React$1.createElement("defs",null,nt.map(rt=>React$1.createElement(Marker,{id:rt.id,key:rt.id,type:rt.type,color:rt.color,width:rt.width,height:rt.height,markerUnits:rt.markerUnits,strokeWidth:rt.strokeWidth,orient:rt.orient})))};MarkerDefinitions.displayName="MarkerDefinitions";var MarkerDefinitions$1=reactExports.memo(MarkerDefinitions);const selector$4=tt=>({nodesConnectable:tt.nodesConnectable,edgesFocusable:tt.edgesFocusable,edgesUpdatable:tt.edgesUpdatable,elementsSelectable:tt.elementsSelectable,width:tt.width,height:tt.height,connectionMode:tt.connectionMode,nodeInternals:tt.nodeInternals,onError:tt.onError}),EdgeRenderer=({defaultMarkerColor:tt,onlyRenderVisibleElements:et,elevateEdgesOnSelect:nt,rfId:rt,edgeTypes:it,noPanClassName:ot,onEdgeUpdate:at,onEdgeContextMenu:st,onEdgeMouseEnter:lt,onEdgeMouseMove:ct,onEdgeMouseLeave:ut,onEdgeClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,children:yt})=>{const{edgesFocusable:bt,edgesUpdatable:wt,elementsSelectable:xt,width:kt,height:St,connectionMode:Tt,nodeInternals:At,onError:Et}=useStore(selector$4,shallow$1),Ct=useVisibleEdges(et,At,nt);return kt?React$1.createElement(React$1.Fragment,null,Ct.map(({level:Lt,edges:jt,isMaxLevel:Rt})=>React$1.createElement("svg",{key:Lt,style:{zIndex:Lt},width:kt,height:St,className:"react-flow__edges react-flow__container"},Rt&&React$1.createElement(MarkerDefinitions$1,{defaultColor:tt,rfId:rt}),React$1.createElement("g",null,jt.map($t=>{const[vt,It,Ot]=getNodeData(At.get($t.source)),[Wt,zt,Ft]=getNodeData(At.get($t.target));if(!Ot||!Ft)return null;let Nt=$t.type||"default";it[Nt]||(Et==null||Et("011",errorMessages.error011(Nt)),Nt="default");const Ut=it[Nt]||it.default,Pt=Tt===ConnectionMode.Strict?zt.target:(zt.target??[]).concat(zt.source??[]),Ht=getHandle(It.source,$t.sourceHandle),Qt=getHandle(Pt,$t.targetHandle),an=(Ht==null?void 0:Ht.position)||Position.Bottom,Yt=(Qt==null?void 0:Qt.position)||Position.Top,nn=!!($t.focusable||bt&&typeof $t.focusable>"u"),tn=typeof at<"u"&&($t.updatable||wt&&typeof $t.updatable>"u");if(!Ht||!Qt)return Et==null||Et("008",errorMessages.error008(Ht,$t)),null;const{sourceX:dn,sourceY:wn,targetX:rn,targetY:Jt}=getEdgePositions(vt,Ht,an,Wt,Qt,Yt);return React$1.createElement(Ut,{key:$t.id,id:$t.id,className:cc([$t.className,ot]),type:Nt,data:$t.data,selected:!!$t.selected,animated:!!$t.animated,hidden:!!$t.hidden,label:$t.label,labelStyle:$t.labelStyle,labelShowBg:$t.labelShowBg,labelBgStyle:$t.labelBgStyle,labelBgPadding:$t.labelBgPadding,labelBgBorderRadius:$t.labelBgBorderRadius,style:$t.style,source:$t.source,target:$t.target,sourceHandleId:$t.sourceHandle,targetHandleId:$t.targetHandle,markerEnd:$t.markerEnd,markerStart:$t.markerStart,sourceX:dn,sourceY:wn,targetX:rn,targetY:Jt,sourcePosition:an,targetPosition:Yt,elementsSelectable:xt,onEdgeUpdate:at,onContextMenu:st,onMouseEnter:lt,onMouseMove:ct,onMouseLeave:ut,onClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,rfId:rt,ariaLabel:$t.ariaLabel,isFocusable:nn,isUpdatable:tn,pathOptions:"pathOptions"in $t?$t.pathOptions:void 0,interactionWidth:$t.interactionWidth})})))),yt):null};EdgeRenderer.displayName="EdgeRenderer";var EdgeRenderer$1=reactExports.memo(EdgeRenderer);const selector$3=tt=>`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`;function Viewport({children:tt}){const et=useStore(selector$3);return React$1.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:et}},tt)}function useOnInitHandler(tt){const et=useReactFlow(),nt=reactExports.useRef(!1);reactExports.useEffect(()=>{!nt.current&&et.viewportInitialized&&tt&&(setTimeout(()=>tt(et),1),nt.current=!0)},[tt,et.viewportInitialized])}const oppositePosition={[Position.Left]:Position.Right,[Position.Right]:Position.Left,[Position.Top]:Position.Bottom,[Position.Bottom]:Position.Top},ConnectionLine=({nodeId:tt,handleType:et,style:nt,type:rt=ConnectionLineType.Bezier,CustomComponent:it,connectionStatus:ot})=>{var Tt,At,Et;const{fromNode:at,handleId:st,toX:lt,toY:ct,connectionMode:ut}=useStore(reactExports.useCallback(Ct=>({fromNode:Ct.nodeInternals.get(tt),handleId:Ct.connectionHandleId,toX:(Ct.connectionPosition.x-Ct.transform[0])/Ct.transform[2],toY:(Ct.connectionPosition.y-Ct.transform[1])/Ct.transform[2],connectionMode:Ct.connectionMode}),[tt]),shallow$1),ht=(Tt=at==null?void 0:at[internalsSymbol])==null?void 0:Tt.handleBounds;let dt=ht==null?void 0:ht[et];if(ut===ConnectionMode.Loose&&(dt=dt||(ht==null?void 0:ht[et==="source"?"target":"source"])),!at||!dt)return null;const pt=st?dt.find(Ct=>Ct.id===st):dt[0],mt=pt?pt.x+pt.width/2:(at.width??0)/2,gt=pt?pt.y+pt.height/2:at.height??0,yt=(((At=at.positionAbsolute)==null?void 0:At.x)??0)+mt,bt=(((Et=at.positionAbsolute)==null?void 0:Et.y)??0)+gt,wt=pt==null?void 0:pt.position,xt=wt?oppositePosition[wt]:null;if(!wt||!xt)return null;if(it)return React$1.createElement(it,{connectionLineType:rt,connectionLineStyle:nt,fromNode:at,fromHandle:pt,fromX:yt,fromY:bt,toX:lt,toY:ct,fromPosition:wt,toPosition:xt,connectionStatus:ot});let kt="";const St={sourceX:yt,sourceY:bt,sourcePosition:wt,targetX:lt,targetY:ct,targetPosition:xt};return rt===ConnectionLineType.Bezier?[kt]=getBezierPath(St):rt===ConnectionLineType.Step?[kt]=getSmoothStepPath({...St,borderRadius:0}):rt===ConnectionLineType.SmoothStep?[kt]=getSmoothStepPath(St):rt===ConnectionLineType.SimpleBezier?[kt]=getSimpleBezierPath(St):kt=`M${yt},${bt} ${lt},${ct}`,React$1.createElement("path",{d:kt,fill:"none",className:"react-flow__connection-path",style:nt})};ConnectionLine.displayName="ConnectionLine";const selector$2=tt=>({nodeId:tt.connectionNodeId,handleType:tt.connectionHandleType,nodesConnectable:tt.nodesConnectable,connectionStatus:tt.connectionStatus,width:tt.width,height:tt.height});function ConnectionLineWrapper({containerStyle:tt,style:et,type:nt,component:rt}){const{nodeId:it,handleType:ot,nodesConnectable:at,width:st,height:lt,connectionStatus:ct}=useStore(selector$2,shallow$1);return!(it&&ot&&st&&at)?null:React$1.createElement("svg",{style:tt,width:st,height:lt,className:"react-flow__edges react-flow__connectionline react-flow__container"},React$1.createElement("g",{className:cc(["react-flow__connection",ct])},React$1.createElement(ConnectionLine,{nodeId:it,handleType:ot,style:et,type:nt,CustomComponent:rt,connectionStatus:ct})))}function useNodeOrEdgeTypes(tt,et){return reactExports.useRef(null),useStoreApi(),reactExports.useMemo(()=>et(tt),[tt])}const GraphView=({nodeTypes:tt,edgeTypes:et,onMove:nt,onMoveStart:rt,onMoveEnd:it,onInit:ot,onNodeClick:at,onEdgeClick:st,onNodeDoubleClick:lt,onEdgeDoubleClick:ct,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,onSelectionContextMenu:mt,onSelectionStart:gt,onSelectionEnd:yt,connectionLineType:bt,connectionLineStyle:wt,connectionLineComponent:xt,connectionLineContainerStyle:kt,selectionKeyCode:St,selectionOnDrag:Tt,selectionMode:At,multiSelectionKeyCode:Et,panActivationKeyCode:Ct,zoomActivationKeyCode:Lt,deleteKeyCode:jt,onlyRenderVisibleElements:Rt,elementsSelectable:$t,selectNodesOnDrag:vt,defaultViewport:It,translateExtent:Ot,minZoom:Wt,maxZoom:zt,preventScrolling:Ft,defaultMarkerColor:Nt,zoomOnScroll:Ut,zoomOnPinch:Pt,panOnScroll:Ht,panOnScrollSpeed:Qt,panOnScrollMode:an,zoomOnDoubleClick:Yt,panOnDrag:nn,onPaneClick:tn,onPaneMouseEnter:dn,onPaneMouseMove:wn,onPaneMouseLeave:rn,onPaneScroll:Jt,onPaneContextMenu:vn,onEdgeUpdate:Cn,onEdgeContextMenu:$n,onEdgeMouseEnter:Nn,onEdgeMouseMove:En,onEdgeMouseLeave:sn,edgeUpdaterRadius:pn,onEdgeUpdateStart:Tn,onEdgeUpdateEnd:In,noDragClassName:yn,noWheelClassName:hn,noPanClassName:fn,elevateEdgesOnSelect:xn,disableKeyboardA11y:jn,nodeOrigin:cn,nodeExtent:Xt,rfId:Kt})=>{const kn=useNodeOrEdgeTypes(tt,createNodeTypes),Mn=useNodeOrEdgeTypes(et,createEdgeTypes);return useOnInitHandler(ot),React$1.createElement(FlowRenderer$1,{onPaneClick:tn,onPaneMouseEnter:dn,onPaneMouseMove:wn,onPaneMouseLeave:rn,onPaneContextMenu:vn,onPaneScroll:Jt,deleteKeyCode:jt,selectionKeyCode:St,selectionOnDrag:Tt,selectionMode:At,onSelectionStart:gt,onSelectionEnd:yt,multiSelectionKeyCode:Et,panActivationKeyCode:Ct,zoomActivationKeyCode:Lt,elementsSelectable:$t,onMove:nt,onMoveStart:rt,onMoveEnd:it,zoomOnScroll:Ut,zoomOnPinch:Pt,zoomOnDoubleClick:Yt,panOnScroll:Ht,panOnScrollSpeed:Qt,panOnScrollMode:an,panOnDrag:nn,defaultViewport:It,translateExtent:Ot,minZoom:Wt,maxZoom:zt,onSelectionContextMenu:mt,preventScrolling:Ft,noDragClassName:yn,noWheelClassName:hn,noPanClassName:fn,disableKeyboardA11y:jn},React$1.createElement(Viewport,null,React$1.createElement(EdgeRenderer$1,{edgeTypes:Mn,onEdgeClick:st,onEdgeDoubleClick:ct,onEdgeUpdate:Cn,onlyRenderVisibleElements:Rt,onEdgeContextMenu:$n,onEdgeMouseEnter:Nn,onEdgeMouseMove:En,onEdgeMouseLeave:sn,onEdgeUpdateStart:Tn,onEdgeUpdateEnd:In,edgeUpdaterRadius:pn,defaultMarkerColor:Nt,noPanClassName:fn,elevateEdgesOnSelect:!!xn,disableKeyboardA11y:jn,rfId:Kt},React$1.createElement(ConnectionLineWrapper,{style:wt,type:bt,component:xt,containerStyle:kt})),React$1.createElement("div",{className:"react-flow__edgelabel-renderer"}),React$1.createElement(NodeRenderer$1,{nodeTypes:kn,onNodeClick:at,onNodeDoubleClick:lt,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,selectNodesOnDrag:vt,onlyRenderVisibleElements:Rt,noPanClassName:fn,noDragClassName:yn,disableKeyboardA11y:jn,nodeOrigin:cn,nodeExtent:Xt,rfId:Kt})))};GraphView.displayName="GraphView";var GraphView$1=reactExports.memo(GraphView);const infiniteExtent=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],initialState={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:infiniteExtent,nodeExtent:infiniteExtent,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ConnectionMode.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:devWarn,isValidConnection:void 0},createRFStore=()=>createWithEqualityFn((tt,et)=>({...initialState,setNodes:nt=>{const{nodeInternals:rt,nodeOrigin:it,elevateNodesOnSelect:ot}=et();tt({nodeInternals:createNodeInternals(nt,rt,it,ot)})},getNodes:()=>Array.from(et().nodeInternals.values()),setEdges:nt=>{const{defaultEdgeOptions:rt={}}=et();tt({edges:nt.map(it=>({...rt,...it}))})},setDefaultNodesAndEdges:(nt,rt)=>{const it=typeof nt<"u",ot=typeof rt<"u",at=it?createNodeInternals(nt,new Map,et().nodeOrigin,et().elevateNodesOnSelect):new Map;tt({nodeInternals:at,edges:ot?rt:[],hasDefaultNodes:it,hasDefaultEdges:ot})},updateNodeDimensions:nt=>{const{onNodesChange:rt,nodeInternals:it,fitViewOnInit:ot,fitViewOnInitDone:at,fitViewOnInitOptions:st,domNode:lt,nodeOrigin:ct}=et(),ut=lt==null?void 0:lt.querySelector(".react-flow__viewport");if(!ut)return;const ht=window.getComputedStyle(ut),{m22:dt}=new window.DOMMatrixReadOnly(ht.transform),pt=nt.reduce((gt,yt)=>{const bt=it.get(yt.id);if(bt){const wt=getDimensions(yt.nodeElement);!!(wt.width&&wt.height&&(bt.width!==wt.width||bt.height!==wt.height||yt.forceUpdate))&&(it.set(bt.id,{...bt,[internalsSymbol]:{...bt[internalsSymbol],handleBounds:{source:getHandleBounds(".source",yt.nodeElement,dt,ct),target:getHandleBounds(".target",yt.nodeElement,dt,ct)}},...wt}),gt.push({id:bt.id,type:"dimensions",dimensions:wt}))}return gt},[]);updateAbsoluteNodePositions(it,ct);const mt=at||ot&&!at&&fitView(et,{initial:!0,...st});tt({nodeInternals:new Map(it),fitViewOnInitDone:mt}),(pt==null?void 0:pt.length)>0&&(rt==null||rt(pt))},updateNodePositions:(nt,rt=!0,it=!1)=>{const{triggerNodeChanges:ot}=et(),at=nt.map(st=>{const lt={id:st.id,type:"position",dragging:it};return rt&&(lt.positionAbsolute=st.positionAbsolute,lt.position=st.position),lt});ot(at)},triggerNodeChanges:nt=>{const{onNodesChange:rt,nodeInternals:it,hasDefaultNodes:ot,nodeOrigin:at,getNodes:st,elevateNodesOnSelect:lt}=et();if(nt!=null&&nt.length){if(ot){const ct=applyNodeChanges(nt,st()),ut=createNodeInternals(ct,it,at,lt);tt({nodeInternals:ut})}rt==null||rt(nt)}},addSelectedNodes:nt=>{const{multiSelectionActive:rt,edges:it,getNodes:ot}=et();let at,st=null;rt?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(ot(),nt),st=getSelectionChanges(it,[])),updateNodesAndEdgesSelections({changedNodes:at,changedEdges:st,get:et,set:tt})},addSelectedEdges:nt=>{const{multiSelectionActive:rt,edges:it,getNodes:ot}=et();let at,st=null;rt?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(it,nt),st=getSelectionChanges(ot(),[])),updateNodesAndEdgesSelections({changedNodes:st,changedEdges:at,get:et,set:tt})},unselectNodesAndEdges:({nodes:nt,edges:rt}={})=>{const{edges:it,getNodes:ot}=et(),at=nt||ot(),st=rt||it,lt=at.map(ut=>(ut.selected=!1,createSelectionChange(ut.id,!1))),ct=st.map(ut=>createSelectionChange(ut.id,!1));updateNodesAndEdgesSelections({changedNodes:lt,changedEdges:ct,get:et,set:tt})},setMinZoom:nt=>{const{d3Zoom:rt,maxZoom:it}=et();rt==null||rt.scaleExtent([nt,it]),tt({minZoom:nt})},setMaxZoom:nt=>{const{d3Zoom:rt,minZoom:it}=et();rt==null||rt.scaleExtent([it,nt]),tt({maxZoom:nt})},setTranslateExtent:nt=>{var rt;(rt=et().d3Zoom)==null||rt.translateExtent(nt),tt({translateExtent:nt})},resetSelectedElements:()=>{const{edges:nt,getNodes:rt}=et(),ot=rt().filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1)),at=nt.filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1));updateNodesAndEdgesSelections({changedNodes:ot,changedEdges:at,get:et,set:tt})},setNodeExtent:nt=>{const{nodeInternals:rt}=et();rt.forEach(it=>{it.positionAbsolute=clampPosition(it.position,nt)}),tt({nodeExtent:nt,nodeInternals:new Map(rt)})},panBy:nt=>{const{transform:rt,width:it,height:ot,d3Zoom:at,d3Selection:st,translateExtent:lt}=et();if(!at||!st||!nt.x&&!nt.y)return!1;const ct=identity.translate(rt[0]+nt.x,rt[1]+nt.y).scale(rt[2]),ut=[[0,0],[it,ot]],ht=at==null?void 0:at.constrain()(ct,ut,lt);return at.transform(st,ht),rt[0]!==ht.x||rt[1]!==ht.y||rt[2]!==ht.k},cancelConnection:()=>tt({connectionNodeId:initialState.connectionNodeId,connectionHandleId:initialState.connectionHandleId,connectionHandleType:initialState.connectionHandleType,connectionStatus:initialState.connectionStatus,connectionStartHandle:initialState.connectionStartHandle,connectionEndHandle:initialState.connectionEndHandle}),reset:()=>tt({...initialState})}),Object.is),ReactFlowProvider=({children:tt})=>{const et=reactExports.useRef(null);return et.current||(et.current=createRFStore()),React$1.createElement(Provider$1,{value:et.current},tt)};ReactFlowProvider.displayName="ReactFlowProvider";const Wrapper$f=({children:tt})=>reactExports.useContext(StoreContext)?React$1.createElement(React$1.Fragment,null,tt):React$1.createElement(ReactFlowProvider,null,tt);Wrapper$f.displayName="ReactFlowWrapper";const defaultNodeTypes={input:InputNode$1,default:DefaultNode$1,output:OutputNode$1,group:GroupNode},defaultEdgeTypes={default:BezierEdge,straight:StraightEdge,step:StepEdge,smoothstep:SmoothStepEdge,simplebezier:SimpleBezierEdge},initNodeOrigin=[0,0],initSnapGrid=[15,15],initDefaultViewport={x:0,y:0,zoom:1},wrapperStyle={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ReactFlow=reactExports.forwardRef(({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:rt,className:it,nodeTypes:ot=defaultNodeTypes,edgeTypes:at=defaultEdgeTypes,onNodeClick:st,onEdgeClick:lt,onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:yt,onClickConnectEnd:bt,onNodeMouseEnter:wt,onNodeMouseMove:xt,onNodeMouseLeave:kt,onNodeContextMenu:St,onNodeDoubleClick:Tt,onNodeDragStart:At,onNodeDrag:Et,onNodeDragStop:Ct,onNodesDelete:Lt,onEdgesDelete:jt,onSelectionChange:Rt,onSelectionDragStart:$t,onSelectionDrag:vt,onSelectionDragStop:It,onSelectionContextMenu:Ot,onSelectionStart:Wt,onSelectionEnd:zt,connectionMode:Ft=ConnectionMode.Strict,connectionLineType:Nt=ConnectionLineType.Bezier,connectionLineStyle:Ut,connectionLineComponent:Pt,connectionLineContainerStyle:Ht,deleteKeyCode:Qt="Backspace",selectionKeyCode:an="Shift",selectionOnDrag:Yt=!1,selectionMode:nn=SelectionMode.Full,panActivationKeyCode:tn="Space",multiSelectionKeyCode:dn=isMacOs()?"Meta":"Control",zoomActivationKeyCode:wn=isMacOs()?"Meta":"Control",snapToGrid:rn=!1,snapGrid:Jt=initSnapGrid,onlyRenderVisibleElements:vn=!1,selectNodesOnDrag:Cn=!0,nodesDraggable:$n,nodesConnectable:Nn,nodesFocusable:En,nodeOrigin:sn=initNodeOrigin,edgesFocusable:pn,edgesUpdatable:Tn,elementsSelectable:In,defaultViewport:yn=initDefaultViewport,minZoom:hn=.5,maxZoom:fn=2,translateExtent:xn=infiniteExtent,preventScrolling:jn=!0,nodeExtent:cn,defaultMarkerColor:Xt="#b1b1b7",zoomOnScroll:Kt=!0,zoomOnPinch:kn=!0,panOnScroll:Mn=!1,panOnScrollSpeed:On=.5,panOnScrollMode:Bn=PanOnScrollMode.Free,zoomOnDoubleClick:Xn=!0,panOnDrag:Vn=!0,onPaneClick:Gn,onPaneMouseEnter:zn,onPaneMouseMove:Zn,onPaneMouseLeave:Wn,onPaneScroll:fr,onPaneContextMenu:ur,children:wr,onEdgeUpdate:Xr,onEdgeContextMenu:Er,onEdgeDoubleClick:Ir,onEdgeMouseEnter:Gr,onEdgeMouseMove:Or,onEdgeMouseLeave:Lr,onEdgeUpdateStart:oo,onEdgeUpdateEnd:qr,edgeUpdaterRadius:jr=10,onNodesChange:mo,onEdgesChange:_n,noDragClassName:Pn="nodrag",noWheelClassName:un="nowheel",noPanClassName:Zt="nopan",fitView:Sn=!1,fitViewOptions:Dn,connectOnClick:Fn=!0,attributionPosition:Yn,proOptions:tr,defaultEdgeOptions:ar,elevateNodesOnSelect:lr=!0,elevateEdgesOnSelect:Vr=!1,disableKeyboardA11y:vr=!1,autoPanOnConnect:Nr=!0,autoPanOnNodeDrag:Hr=!0,connectionRadius:eo=20,isValidConnection:Zr,onError:Jr,style:br,id:Pr,nodeDragThreshold:Fr,...Mr},Cr)=>{const Dr=Pr||"1";return React$1.createElement("div",{...Mr,style:{...br,...wrapperStyle},ref:Cr,className:cc(["react-flow",it]),"data-testid":"rf__wrapper",id:Pr},React$1.createElement(Wrapper$f,null,React$1.createElement(GraphView$1,{onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onNodeClick:st,onEdgeClick:lt,onNodeMouseEnter:wt,onNodeMouseMove:xt,onNodeMouseLeave:kt,onNodeContextMenu:St,onNodeDoubleClick:Tt,nodeTypes:ot,edgeTypes:at,connectionLineType:Nt,connectionLineStyle:Ut,connectionLineComponent:Pt,connectionLineContainerStyle:Ht,selectionKeyCode:an,selectionOnDrag:Yt,selectionMode:nn,deleteKeyCode:Qt,multiSelectionKeyCode:dn,panActivationKeyCode:tn,zoomActivationKeyCode:wn,onlyRenderVisibleElements:vn,selectNodesOnDrag:Cn,defaultViewport:yn,translateExtent:xn,minZoom:hn,maxZoom:fn,preventScrolling:jn,zoomOnScroll:Kt,zoomOnPinch:kn,zoomOnDoubleClick:Xn,panOnScroll:Mn,panOnScrollSpeed:On,panOnScrollMode:Bn,panOnDrag:Vn,onPaneClick:Gn,onPaneMouseEnter:zn,onPaneMouseMove:Zn,onPaneMouseLeave:Wn,onPaneScroll:fr,onPaneContextMenu:ur,onSelectionContextMenu:Ot,onSelectionStart:Wt,onSelectionEnd:zt,onEdgeUpdate:Xr,onEdgeContextMenu:Er,onEdgeDoubleClick:Ir,onEdgeMouseEnter:Gr,onEdgeMouseMove:Or,onEdgeMouseLeave:Lr,onEdgeUpdateStart:oo,onEdgeUpdateEnd:qr,edgeUpdaterRadius:jr,defaultMarkerColor:Xt,noDragClassName:Pn,noWheelClassName:un,noPanClassName:Zt,elevateEdgesOnSelect:Vr,rfId:Dr,disableKeyboardA11y:vr,nodeOrigin:sn,nodeExtent:cn}),React$1.createElement(StoreUpdater,{nodes:tt,edges:et,defaultNodes:nt,defaultEdges:rt,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:yt,onClickConnectEnd:bt,nodesDraggable:$n,nodesConnectable:Nn,nodesFocusable:En,edgesFocusable:pn,edgesUpdatable:Tn,elementsSelectable:In,elevateNodesOnSelect:lr,minZoom:hn,maxZoom:fn,nodeExtent:cn,onNodesChange:mo,onEdgesChange:_n,snapToGrid:rn,snapGrid:Jt,connectionMode:Ft,translateExtent:xn,connectOnClick:Fn,defaultEdgeOptions:ar,fitView:Sn,fitViewOptions:Dn,onNodesDelete:Lt,onEdgesDelete:jt,onNodeDragStart:At,onNodeDrag:Et,onNodeDragStop:Ct,onSelectionDrag:vt,onSelectionDragStart:$t,onSelectionDragStop:It,noPanClassName:Zt,nodeOrigin:sn,rfId:Dr,autoPanOnConnect:Nr,autoPanOnNodeDrag:Hr,onError:Jr,connectionRadius:eo,isValidConnection:Zr,nodeDragThreshold:Fr}),React$1.createElement(Wrapper$1$1,{onSelectionChange:Rt}),wr,React$1.createElement(Attribution,{proOptions:tr,position:Yn}),React$1.createElement(A11yDescriptions,{rfId:Dr,disableKeyboardA11y:vr})))});ReactFlow.displayName="ReactFlow";const style="",TeachMe=()=>{const[tt,et]=useDataStore(mt=>[mt.data,mt.setTeachMe]),[nt,rt]=useAppStore(mt=>[mt.currentSearch,mt.setSidebarOpen]),[it]=useUserStore(mt=>[mt.setBudget]),ot=reactExports.useRef(!1),at=useSocket(),[st,lt,ct,ut]=useTeachStore(mt=>[mt.setTeachMeAnswer,mt.setHasTeachingInProgress,mt.setInstagraphAnswer,mt.setHasInstagraphInProgress]),ht=reactExports.useCallback(mt=>{st(mt.tutorial),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Tutorial is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[st]),dt=reactExports.useCallback(mt=>{ct(mt),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Instagraph is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[ct]);reactExports.useEffect(()=>{ot.current||(ht&&at&&(at.on("teachmehook",ht),ot.current=!0),dt&&at&&(at.on("instagraphhook",dt),ot.current=!0))},[at,ht,dt]);const pt=async()=>{if(nt){lt(!0),ut(!0),rt(!0),et(!0);try{const mt=tt==null?void 0:tt.nodes.filter(bt=>bt.text),gt=mt==null?void 0:mt.slice(0,5),yt=(gt!=null&>.length?gt.map(bt=>bt.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,bt=>`\\${bt}`);await distExports$1.enable(),await postTeachMe({term:nt,transcripts:yt}),await updateBudget(it),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing tutorial for you"}),{type:"success"}),await postInstagraph({term:nt,transcripts:yt}),await updateBudget(it),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing an instagraph for you"}),{type:"success"})}catch{lt(!1),ut(!1)}}};return jsxRuntimeExports.jsx(ButtonStyled$1,{onClick:()=>pt(),children:"Teach me"})},TeachMeLoader=({text:tt})=>jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"center",py:12,children:[jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(Text$1,{children:tt})})]}),TeachMeText=()=>{const[tt,et,nt,rt]=useTeachStore(ot=>[ot.teachMeAnswer,ot.hasTeachingInProgress,ot.instgraphAnswser,ot.hasInstagraphInProgress]),it=!rt&&!!(nt!=null&&nt.edges)&&!!(nt!=null&&nt.nodes);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[it?jsxRuntimeExports.jsx(ReactFlow,{edges:nt==null?void 0:nt.edges,nodes:nt==null?void 0:nt.nodes}):jsxRuntimeExports.jsx(TeachMeLoader,{text:"Generating instagraph"}),et?jsxRuntimeExports.jsx(TeachMeLoader,{text:"Generating tutorial"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TeachMeAnswerFlex,{children:jsxRuntimeExports.jsx(Text$1,{children:tt})}),jsxRuntimeExports.jsx(AskQuestion,{})]})]})},ButtonStyled$1=styled$4(Button$2)``,TeachMeAnswerFlex=styled$4(Flex)` +`,emptyValue={},HelperContext=reactExports.createContext(emptyValue),useHelper=()=>reactExports.useContext(HelperContext);function cc(tt){if(typeof tt=="string"||typeof tt=="number")return""+tt;let et="";if(Array.isArray(tt))for(let nt=0,rt;nt{const nt=createStore$3(tt),rt=(it,ot=et)=>useStoreWithEqualityFn(nt,it,ot);return Object.assign(rt,nt),rt},createWithEqualityFn=(tt,et)=>tt?createWithEqualityFnImpl(tt,et):createWithEqualityFnImpl;function shallow$1(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;if(tt instanceof Map&&et instanceof Map){if(tt.size!==et.size)return!1;for(const[rt,it]of tt)if(!Object.is(it,et.get(rt)))return!1;return!0}if(tt instanceof Set&&et instanceof Set){if(tt.size!==et.size)return!1;for(const rt of tt)if(!et.has(rt))return!1;return!0}const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let rt=0;rt=0&&(et=tt.slice(0,nt))!=="xmlns"&&(tt=tt.slice(nt+1)),namespaces.hasOwnProperty(et)?{space:namespaces[et],local:tt}:tt}function creatorInherit(tt){return function(){var et=this.ownerDocument,nt=this.namespaceURI;return nt===xhtml&&et.documentElement.namespaceURI===xhtml?et.createElement(tt):et.createElementNS(nt,tt)}}function creatorFixed(tt){return function(){return this.ownerDocument.createElementNS(tt.space,tt.local)}}function creator(tt){var et=namespace(tt);return(et.local?creatorFixed:creatorInherit)(et)}function none(){}function selector(tt){return tt==null?none:function(){return this.querySelector(tt)}}function selection_select(tt){typeof tt!="function"&&(tt=selector(tt));for(var et=this._groups,nt=et.length,rt=new Array(nt),it=0;it=xt&&(xt=wt+1);!(St=yt[xt])&&++xt=0;)(at=rt[it])&&(ot&&at.compareDocumentPosition(ot)^4&&ot.parentNode.insertBefore(at,ot),ot=at);return this}function selection_sort(tt){tt||(tt=ascending);function et(ht,dt){return ht&&dt?tt(ht.__data__,dt.__data__):!ht-!dt}for(var nt=this._groups,rt=nt.length,it=new Array(rt),ot=0;otet?1:tt>=et?0:NaN}function selection_call(){var tt=arguments[0];return arguments[0]=this,tt.apply(null,arguments),this}function selection_nodes(){return Array.from(this)}function selection_node(){for(var tt=this._groups,et=0,nt=tt.length;et1?this.each((et==null?styleRemove$1:typeof et=="function"?styleFunction$1:styleConstant$1)(tt,et,nt??"")):styleValue(this.node(),tt)}function styleValue(tt,et){return tt.style.getPropertyValue(et)||defaultView(tt).getComputedStyle(tt,null).getPropertyValue(et)}function propertyRemove(tt){return function(){delete this[tt]}}function propertyConstant(tt,et){return function(){this[tt]=et}}function propertyFunction(tt,et){return function(){var nt=et.apply(this,arguments);nt==null?delete this[tt]:this[tt]=nt}}function selection_property(tt,et){return arguments.length>1?this.each((et==null?propertyRemove:typeof et=="function"?propertyFunction:propertyConstant)(tt,et)):this.node()[tt]}function classArray(tt){return tt.trim().split(/^|\s+/)}function classList(tt){return tt.classList||new ClassList(tt)}function ClassList(tt){this._node=tt,this._names=classArray(tt.getAttribute("class")||"")}ClassList.prototype={add:function(tt){var et=this._names.indexOf(tt);et<0&&(this._names.push(tt),this._node.setAttribute("class",this._names.join(" ")))},remove:function(tt){var et=this._names.indexOf(tt);et>=0&&(this._names.splice(et,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(tt){return this._names.indexOf(tt)>=0}};function classedAdd(tt,et){for(var nt=classList(tt),rt=-1,it=et.length;++rt=0&&(nt=et.slice(rt+1),et=et.slice(0,rt)),{type:et,name:nt}})}function onRemove(tt){return function(){var et=this.__on;if(et){for(var nt=0,rt=-1,it=et.length,ot;nt()=>tt;function DragEvent(tt,{sourceEvent:et,subject:nt,target:rt,identifier:it,active:ot,x:at,y:st,dx:lt,dy:ct,dispatch:ut}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},subject:{value:nt,enumerable:!0,configurable:!0},target:{value:rt,enumerable:!0,configurable:!0},identifier:{value:it,enumerable:!0,configurable:!0},active:{value:ot,enumerable:!0,configurable:!0},x:{value:at,enumerable:!0,configurable:!0},y:{value:st,enumerable:!0,configurable:!0},dx:{value:lt,enumerable:!0,configurable:!0},dy:{value:ct,enumerable:!0,configurable:!0},_:{value:ut}})}DragEvent.prototype.on=function(){var tt=this._.on.apply(this._,arguments);return tt===this._?this:tt};function defaultFilter$1(tt){return!tt.ctrlKey&&!tt.button}function defaultContainer(){return this.parentNode}function defaultSubject(tt,et){return et??{x:tt.x,y:tt.y}}function defaultTouchable$1(){return navigator.maxTouchPoints||"ontouchstart"in this}function drag(){var tt=defaultFilter$1,et=defaultContainer,nt=defaultSubject,rt=defaultTouchable$1,it={},ot=dispatch("start","drag","end"),at=0,st,lt,ct,ut,ht=0;function dt(kt){kt.on("mousedown.drag",pt).filter(rt).on("touchstart.drag",yt).on("touchmove.drag",bt,nonpassive).on("touchend.drag touchcancel.drag",wt).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function pt(kt,St){if(!(ut||!tt.call(this,kt,St))){var Tt=xt(this,et.call(this,kt,St),kt,St,"mouse");Tt&&(select(kt.view).on("mousemove.drag",mt,nonpassivecapture).on("mouseup.drag",gt,nonpassivecapture),dragDisable(kt.view),nopropagation$1(kt),ct=!1,st=kt.clientX,lt=kt.clientY,Tt("start",kt))}}function mt(kt){if(noevent$1(kt),!ct){var St=kt.clientX-st,Tt=kt.clientY-lt;ct=St*St+Tt*Tt>ht}it.mouse("drag",kt)}function gt(kt){select(kt.view).on("mousemove.drag mouseup.drag",null),yesdrag(kt.view,ct),noevent$1(kt),it.mouse("end",kt)}function yt(kt,St){if(tt.call(this,kt,St)){var Tt=kt.changedTouches,At=et.call(this,kt,St),Et=Tt.length,Ct,Lt;for(Ct=0;CtCREATED)throw new Error("too late; already scheduled");return nt}function set(tt,et){var nt=get(tt,et);if(nt.state>STARTED)throw new Error("too late; already running");return nt}function get(tt,et){var nt=tt.__transition;if(!nt||!(nt=nt[et]))throw new Error("transition not found");return nt}function create(tt,et,nt){var rt=tt.__transition,it;rt[et]=nt,nt.timer=timer$1(ot,0,nt.time);function ot(ct){nt.state=SCHEDULED,nt.timer.restart(at,nt.delay,nt.time),nt.delay<=ct&&at(ct-nt.delay)}function at(ct){var ut,ht,dt,pt;if(nt.state!==SCHEDULED)return lt();for(ut in rt)if(pt=rt[ut],pt.name===nt.name){if(pt.state===STARTED)return timeout(at);pt.state===RUNNING?(pt.state=ENDED,pt.timer.stop(),pt.on.call("interrupt",tt,tt.__data__,pt.index,pt.group),delete rt[ut]):+utSTARTING&&rt.state=0&&(et=et.slice(0,nt)),!et||et==="start"})}function onFunction(tt,et,nt){var rt,it,ot=start(et)?init:set;return function(){var at=ot(this,tt),st=at.on;st!==rt&&(it=(rt=st).copy()).on(et,nt),at.on=it}}function transition_on(tt,et){var nt=this._id;return arguments.length<2?get(this.node(),nt).on.on(tt):this.each(onFunction(nt,tt,et))}function removeFunction(tt){return function(){var et=this.parentNode;for(var nt in this.__transition)if(+nt!==tt)return;et&&et.removeChild(this)}}function transition_remove(){return this.on("end.remove",removeFunction(this._id))}function transition_select(tt){var et=this._name,nt=this._id;typeof tt!="function"&&(tt=selector(tt));for(var rt=this._groups,it=rt.length,ot=new Array(it),at=0;at()=>tt;function ZoomEvent(tt,{sourceEvent:et,target:nt,transform:rt,dispatch:it}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},target:{value:nt,enumerable:!0,configurable:!0},transform:{value:rt,enumerable:!0,configurable:!0},_:{value:it}})}function Transform(tt,et,nt){this.k=tt,this.x=et,this.y=nt}Transform.prototype={constructor:Transform,scale:function(tt){return tt===1?this:new Transform(this.k*tt,this.x,this.y)},translate:function(tt,et){return tt===0&et===0?this:new Transform(this.k,this.x+this.k*tt,this.y+this.k*et)},apply:function(tt){return[tt[0]*this.k+this.x,tt[1]*this.k+this.y]},applyX:function(tt){return tt*this.k+this.x},applyY:function(tt){return tt*this.k+this.y},invert:function(tt){return[(tt[0]-this.x)/this.k,(tt[1]-this.y)/this.k]},invertX:function(tt){return(tt-this.x)/this.k},invertY:function(tt){return(tt-this.y)/this.k},rescaleX:function(tt){return tt.copy().domain(tt.range().map(this.invertX,this).map(tt.invert,tt))},rescaleY:function(tt){return tt.copy().domain(tt.range().map(this.invertY,this).map(tt.invert,tt))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var identity=new Transform(1,0,0);Transform.prototype;function nopropagation(tt){tt.stopImmediatePropagation()}function noevent(tt){tt.preventDefault(),tt.stopImmediatePropagation()}function defaultFilter(tt){return(!tt.ctrlKey||tt.type==="wheel")&&!tt.button}function defaultExtent(){var tt=this;return tt instanceof SVGElement?(tt=tt.ownerSVGElement||tt,tt.hasAttribute("viewBox")?(tt=tt.viewBox.baseVal,[[tt.x,tt.y],[tt.x+tt.width,tt.y+tt.height]]):[[0,0],[tt.width.baseVal.value,tt.height.baseVal.value]]):[[0,0],[tt.clientWidth,tt.clientHeight]]}function defaultTransform(){return this.__zoom||identity}function defaultWheelDelta(tt){return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*(tt.ctrlKey?10:1)}function defaultTouchable(){return navigator.maxTouchPoints||"ontouchstart"in this}function defaultConstrain(tt,et,nt){var rt=tt.invertX(et[0][0])-nt[0][0],it=tt.invertX(et[1][0])-nt[1][0],ot=tt.invertY(et[0][1])-nt[0][1],at=tt.invertY(et[1][1])-nt[1][1];return tt.translate(it>rt?(rt+it)/2:Math.min(0,rt)||Math.max(0,it),at>ot?(ot+at)/2:Math.min(0,ot)||Math.max(0,at))}function zoom(){var tt=defaultFilter,et=defaultExtent,nt=defaultConstrain,rt=defaultWheelDelta,it=defaultTouchable,ot=[0,1/0],at=[[-1/0,-1/0],[1/0,1/0]],st=250,lt=interpolateZoom,ct=dispatch("start","zoom","end"),ut,ht,dt,pt=500,mt=150,gt=0,yt=10;function bt(vt){vt.property("__zoom",defaultTransform).on("wheel.zoom",Et,{passive:!1}).on("mousedown.zoom",Ct).on("dblclick.zoom",Lt).filter(it).on("touchstart.zoom",jt).on("touchmove.zoom",Rt).on("touchend.zoom touchcancel.zoom",$t).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}bt.transform=function(vt,It,Ot,Wt){var zt=vt.selection?vt.selection():vt;zt.property("__zoom",defaultTransform),vt!==zt?St(vt,It,Ot,Wt):zt.interrupt().each(function(){Tt(this,arguments).event(Wt).start().zoom(null,typeof It=="function"?It.apply(this,arguments):It).end()})},bt.scaleBy=function(vt,It,Ot,Wt){bt.scaleTo(vt,function(){var zt=this.__zoom.k,Ft=typeof It=="function"?It.apply(this,arguments):It;return zt*Ft},Ot,Wt)},bt.scaleTo=function(vt,It,Ot,Wt){bt.transform(vt,function(){var zt=et.apply(this,arguments),Ft=this.__zoom,Nt=Ot==null?kt(zt):typeof Ot=="function"?Ot.apply(this,arguments):Ot,Ut=Ft.invert(Nt),Pt=typeof It=="function"?It.apply(this,arguments):It;return nt(xt(wt(Ft,Pt),Nt,Ut),zt,at)},Ot,Wt)},bt.translateBy=function(vt,It,Ot,Wt){bt.transform(vt,function(){return nt(this.__zoom.translate(typeof It=="function"?It.apply(this,arguments):It,typeof Ot=="function"?Ot.apply(this,arguments):Ot),et.apply(this,arguments),at)},null,Wt)},bt.translateTo=function(vt,It,Ot,Wt,zt){bt.transform(vt,function(){var Ft=et.apply(this,arguments),Nt=this.__zoom,Ut=Wt==null?kt(Ft):typeof Wt=="function"?Wt.apply(this,arguments):Wt;return nt(identity.translate(Ut[0],Ut[1]).scale(Nt.k).translate(typeof It=="function"?-It.apply(this,arguments):-It,typeof Ot=="function"?-Ot.apply(this,arguments):-Ot),Ft,at)},Wt,zt)};function wt(vt,It){return It=Math.max(ot[0],Math.min(ot[1],It)),It===vt.k?vt:new Transform(It,vt.x,vt.y)}function xt(vt,It,Ot){var Wt=It[0]-Ot[0]*vt.k,zt=It[1]-Ot[1]*vt.k;return Wt===vt.x&&zt===vt.y?vt:new Transform(vt.k,Wt,zt)}function kt(vt){return[(+vt[0][0]+ +vt[1][0])/2,(+vt[0][1]+ +vt[1][1])/2]}function St(vt,It,Ot,Wt){vt.on("start.zoom",function(){Tt(this,arguments).event(Wt).start()}).on("interrupt.zoom end.zoom",function(){Tt(this,arguments).event(Wt).end()}).tween("zoom",function(){var zt=this,Ft=arguments,Nt=Tt(zt,Ft).event(Wt),Ut=et.apply(zt,Ft),Pt=Ot==null?kt(Ut):typeof Ot=="function"?Ot.apply(zt,Ft):Ot,Ht=Math.max(Ut[1][0]-Ut[0][0],Ut[1][1]-Ut[0][1]),Qt=zt.__zoom,an=typeof It=="function"?It.apply(zt,Ft):It,Yt=lt(Qt.invert(Pt).concat(Ht/Qt.k),an.invert(Pt).concat(Ht/an.k));return function(nn){if(nn===1)nn=an;else{var tn=Yt(nn),dn=Ht/tn[2];nn=new Transform(dn,Pt[0]-tn[0]*dn,Pt[1]-tn[1]*dn)}Nt.zoom(null,nn)}})}function Tt(vt,It,Ot){return!Ot&&vt.__zooming||new At(vt,It)}function At(vt,It){this.that=vt,this.args=It,this.active=0,this.sourceEvent=null,this.extent=et.apply(vt,It),this.taps=0}At.prototype={event:function(vt){return vt&&(this.sourceEvent=vt),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(vt,It){return this.mouse&&vt!=="mouse"&&(this.mouse[1]=It.invert(this.mouse[0])),this.touch0&&vt!=="touch"&&(this.touch0[1]=It.invert(this.touch0[0])),this.touch1&&vt!=="touch"&&(this.touch1[1]=It.invert(this.touch1[0])),this.that.__zoom=It,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(vt){var It=select(this.that).datum();ct.call(vt,this.that,new ZoomEvent(vt,{sourceEvent:this.sourceEvent,target:bt,type:vt,transform:this.that.__zoom,dispatch:ct}),It)}};function Et(vt,...It){if(!tt.apply(this,arguments))return;var Ot=Tt(this,It).event(vt),Wt=this.__zoom,zt=Math.max(ot[0],Math.min(ot[1],Wt.k*Math.pow(2,rt.apply(this,arguments)))),Ft=pointer(vt);if(Ot.wheel)(Ot.mouse[0][0]!==Ft[0]||Ot.mouse[0][1]!==Ft[1])&&(Ot.mouse[1]=Wt.invert(Ot.mouse[0]=Ft)),clearTimeout(Ot.wheel);else{if(Wt.k===zt)return;Ot.mouse=[Ft,Wt.invert(Ft)],interrupt(this),Ot.start()}noevent(vt),Ot.wheel=setTimeout(Nt,mt),Ot.zoom("mouse",nt(xt(wt(Wt,zt),Ot.mouse[0],Ot.mouse[1]),Ot.extent,at));function Nt(){Ot.wheel=null,Ot.end()}}function Ct(vt,...It){if(dt||!tt.apply(this,arguments))return;var Ot=vt.currentTarget,Wt=Tt(this,It,!0).event(vt),zt=select(vt.view).on("mousemove.zoom",Pt,!0).on("mouseup.zoom",Ht,!0),Ft=pointer(vt,Ot),Nt=vt.clientX,Ut=vt.clientY;dragDisable(vt.view),nopropagation(vt),Wt.mouse=[Ft,this.__zoom.invert(Ft)],interrupt(this),Wt.start();function Pt(Qt){if(noevent(Qt),!Wt.moved){var an=Qt.clientX-Nt,Yt=Qt.clientY-Ut;Wt.moved=an*an+Yt*Yt>gt}Wt.event(Qt).zoom("mouse",nt(xt(Wt.that.__zoom,Wt.mouse[0]=pointer(Qt,Ot),Wt.mouse[1]),Wt.extent,at))}function Ht(Qt){zt.on("mousemove.zoom mouseup.zoom",null),yesdrag(Qt.view,Wt.moved),noevent(Qt),Wt.event(Qt).end()}}function Lt(vt,...It){if(tt.apply(this,arguments)){var Ot=this.__zoom,Wt=pointer(vt.changedTouches?vt.changedTouches[0]:vt,this),zt=Ot.invert(Wt),Ft=Ot.k*(vt.shiftKey?.5:2),Nt=nt(xt(wt(Ot,Ft),Wt,zt),et.apply(this,It),at);noevent(vt),st>0?select(this).transition().duration(st).call(St,Nt,Wt,vt):select(this).call(bt.transform,Nt,Wt,vt)}}function jt(vt,...It){if(tt.apply(this,arguments)){var Ot=vt.touches,Wt=Ot.length,zt=Tt(this,It,vt.changedTouches.length===Wt).event(vt),Ft,Nt,Ut,Pt;for(nopropagation(vt),Nt=0;Nt"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:tt=>`Node type "${tt}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:tt=>`The old edge with id=${tt} does not exist.`,error009:tt=>`Marker type "${tt}" doesn't exist.`,error008:(tt,et)=>`Couldn't create edge for ${tt?"target":"source"} handle id: "${tt?et.targetHandle:et.sourceHandle}", edge id: ${et.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:tt=>`Edge type "${tt}" not found. Using fallback type "default".`,error012:tt=>`Node with id "${tt}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},zustandErrorMessage=errorMessages.error001();function useStore(tt,et){const nt=reactExports.useContext(StoreContext);if(nt===null)throw new Error(zustandErrorMessage);return useStoreWithEqualityFn(nt,tt,et)}const useStoreApi=()=>{const tt=reactExports.useContext(StoreContext);if(tt===null)throw new Error(zustandErrorMessage);return reactExports.useMemo(()=>({getState:tt.getState,setState:tt.setState,subscribe:tt.subscribe,destroy:tt.destroy}),[tt])},selector$g=tt=>tt.userSelectionActive?"none":"all";function Panel({position:tt,children:et,className:nt,style:rt,...it}){const ot=useStore(selector$g),at=`${tt}`.split("-");return React$1.createElement("div",{className:cc(["react-flow__panel",nt,...at]),style:{...rt,pointerEvents:ot},...it},et)}function Attribution({proOptions:tt,position:et="bottom-right"}){return tt!=null&&tt.hideAttribution?null:React$1.createElement(Panel,{position:et,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev"},React$1.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const EdgeText=({x:tt,y:et,label:nt,labelStyle:rt={},labelShowBg:it=!0,labelBgStyle:ot={},labelBgPadding:at=[2,4],labelBgBorderRadius:st=2,children:lt,className:ct,...ut})=>{const ht=reactExports.useRef(null),[dt,pt]=reactExports.useState({x:0,y:0,width:0,height:0}),mt=cc(["react-flow__edge-textwrapper",ct]);return reactExports.useEffect(()=>{if(ht.current){const gt=ht.current.getBBox();pt({x:gt.x,y:gt.y,width:gt.width,height:gt.height})}},[nt]),typeof nt>"u"||!nt?null:React$1.createElement("g",{transform:`translate(${tt-dt.width/2} ${et-dt.height/2})`,className:mt,visibility:dt.width?"visible":"hidden",...ut},it&&React$1.createElement("rect",{width:dt.width+2*at[0],x:-at[0],y:-at[1],height:dt.height+2*at[1],className:"react-flow__edge-textbg",style:ot,rx:st,ry:st}),React$1.createElement("text",{className:"react-flow__edge-text",y:dt.height/2,dy:"0.3em",ref:ht,style:rt},nt),lt)};var EdgeText$1=reactExports.memo(EdgeText);const getDimensions=tt=>({width:tt.offsetWidth,height:tt.offsetHeight}),clamp=(tt,et=0,nt=1)=>Math.min(Math.max(tt,et),nt),clampPosition=(tt={x:0,y:0},et)=>({x:clamp(tt.x,et[0][0],et[1][0]),y:clamp(tt.y,et[0][1],et[1][1])}),calcAutoPanVelocity=(tt,et,nt)=>ttnt?-clamp(Math.abs(tt-nt),1,50)/50:0,calcAutoPan=(tt,et)=>{const nt=calcAutoPanVelocity(tt.x,35,et.width-35)*20,rt=calcAutoPanVelocity(tt.y,35,et.height-35)*20;return[nt,rt]},getHostForElement=tt=>{var et;return((et=tt.getRootNode)==null?void 0:et.call(tt))||(window==null?void 0:window.document)},getBoundsOfBoxes=(tt,et)=>({x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x2,et.x2),y2:Math.max(tt.y2,et.y2)}),rectToBox=({x:tt,y:et,width:nt,height:rt})=>({x:tt,y:et,x2:tt+nt,y2:et+rt}),boxToRect=({x:tt,y:et,x2:nt,y2:rt})=>({x:tt,y:et,width:nt-tt,height:rt-et}),nodeToRect=tt=>({...tt.positionAbsolute||{x:0,y:0},width:tt.width||0,height:tt.height||0}),getOverlappingArea=(tt,et)=>{const nt=Math.max(0,Math.min(tt.x+tt.width,et.x+et.width)-Math.max(tt.x,et.x)),rt=Math.max(0,Math.min(tt.y+tt.height,et.y+et.height)-Math.max(tt.y,et.y));return Math.ceil(nt*rt)},isRectObject=tt=>isNumeric(tt.width)&&isNumeric(tt.height)&&isNumeric(tt.x)&&isNumeric(tt.y),isNumeric=tt=>!isNaN(tt)&&isFinite(tt),internalsSymbol=Symbol.for("internals"),elementSelectionKeys=["Enter"," ","Escape"],devWarn=(tt,et)=>{},isReactKeyboardEvent=tt=>"nativeEvent"in tt;function isInputDOMNode(tt){var it,ot;const et=isReactKeyboardEvent(tt)?tt.nativeEvent:tt,nt=((ot=(it=et.composedPath)==null?void 0:it.call(et))==null?void 0:ot[0])||tt.target;return["INPUT","SELECT","TEXTAREA"].includes(nt==null?void 0:nt.nodeName)||(nt==null?void 0:nt.hasAttribute("contenteditable"))||!!(nt!=null&&nt.closest(".nokey"))}const isMouseEvent=tt=>"clientX"in tt,getEventPosition=(tt,et)=>{var ot,at;const nt=isMouseEvent(tt),rt=nt?tt.clientX:(ot=tt.touches)==null?void 0:ot[0].clientX,it=nt?tt.clientY:(at=tt.touches)==null?void 0:at[0].clientY;return{x:rt-((et==null?void 0:et.left)??0),y:it-((et==null?void 0:et.top)??0)}},isMacOs=()=>{var tt;return typeof navigator<"u"&&((tt=navigator==null?void 0:navigator.userAgent)==null?void 0:tt.indexOf("Mac"))>=0},BaseEdge=({id:tt,path:et,labelX:nt,labelY:rt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt=20})=>React$1.createElement(React$1.Fragment,null,React$1.createElement("path",{id:tt,style:ut,d:et,fill:"none",className:"react-flow__edge-path",markerEnd:ht,markerStart:dt}),pt&&React$1.createElement("path",{d:et,fill:"none",strokeOpacity:0,strokeWidth:pt,className:"react-flow__edge-interaction"}),it&&isNumeric(nt)&&isNumeric(rt)?React$1.createElement(EdgeText$1,{x:nt,y:rt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct}):null);BaseEdge.displayName="BaseEdge";function getMouseHandler$1(tt,et,nt){return nt===void 0?nt:rt=>{const it=et().edges.find(ot=>ot.id===tt);it&&nt(rt,{...it})}}function getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:rt}){const it=Math.abs(nt-tt)/2,ot=nt{const[yt,bt,wt]=getSimpleBezierPath({sourceX:tt,sourceY:et,sourcePosition:it,targetX:nt,targetY:rt,targetPosition:ot});return React$1.createElement(BaseEdge,{path:yt,labelX:bt,labelY:wt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:gt})});SimpleBezierEdge.displayName="SimpleBezierEdge";const handleDirections={[Position.Left]:{x:-1,y:0},[Position.Right]:{x:1,y:0},[Position.Top]:{x:0,y:-1},[Position.Bottom]:{x:0,y:1}},getDirection=({source:tt,sourcePosition:et=Position.Bottom,target:nt})=>et===Position.Left||et===Position.Right?tt.xMath.sqrt(Math.pow(et.x-tt.x,2)+Math.pow(et.y-tt.y,2));function getPoints({source:tt,sourcePosition:et=Position.Bottom,target:nt,targetPosition:rt=Position.Top,center:it,offset:ot}){const at=handleDirections[et],st=handleDirections[rt],lt={x:tt.x+at.x*ot,y:tt.y+at.y*ot},ct={x:nt.x+st.x*ot,y:nt.y+st.y*ot},ut=getDirection({source:lt,sourcePosition:et,target:ct}),ht=ut.x!==0?"x":"y",dt=ut[ht];let pt=[],mt,gt;const yt={x:0,y:0},bt={x:0,y:0},[wt,xt,kt,St]=getEdgeCenter({sourceX:tt.x,sourceY:tt.y,targetX:nt.x,targetY:nt.y});if(at[ht]*st[ht]===-1){mt=it.x||wt,gt=it.y||xt;const At=[{x:mt,y:lt.y},{x:mt,y:ct.y}],Et=[{x:lt.x,y:gt},{x:ct.x,y:gt}];at[ht]===dt?pt=ht==="x"?At:Et:pt=ht==="x"?Et:At}else{const At=[{x:lt.x,y:ct.y}],Et=[{x:ct.x,y:lt.y}];if(ht==="x"?pt=at.x===dt?Et:At:pt=at.y===dt?At:Et,et===rt){const $t=Math.abs(tt[ht]-nt[ht]);if($t<=ot){const vt=Math.min(ot-1,ot-$t);at[ht]===dt?yt[ht]=(lt[ht]>tt[ht]?-1:1)*vt:bt[ht]=(ct[ht]>nt[ht]?-1:1)*vt}}if(et!==rt){const $t=ht==="x"?"y":"x",vt=at[ht]===st[$t],It=lt[$t]>ct[$t],Ot=lt[$t]=Rt?(mt=(Ct.x+Lt.x)/2,gt=pt[0].y):(mt=pt[0].x,gt=(Ct.y+Lt.y)/2)}return[[tt,{x:lt.x+yt.x,y:lt.y+yt.y},...pt,{x:ct.x+bt.x,y:ct.y+bt.y},nt],mt,gt,kt,St]}function getBend(tt,et,nt,rt){const it=Math.min(distance(tt,et)/2,distance(et,nt)/2,rt),{x:ot,y:at}=et;if(tt.x===ot&&ot===nt.x||tt.y===at&&at===nt.y)return`L${ot} ${at}`;if(tt.y===at){const ct=tt.x{let xt="";return wt>0&&wt{const[bt,wt,xt]=getSmoothStepPath({sourceX:tt,sourceY:et,sourcePosition:ht,targetX:nt,targetY:rt,targetPosition:dt,borderRadius:gt==null?void 0:gt.borderRadius,offset:gt==null?void 0:gt.offset});return React$1.createElement(BaseEdge,{path:bt,labelX:wt,labelY:xt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:pt,markerStart:mt,interactionWidth:yt})});SmoothStepEdge.displayName="SmoothStepEdge";const StepEdge=reactExports.memo(tt=>{var et;return React$1.createElement(SmoothStepEdge,{...tt,pathOptions:reactExports.useMemo(()=>{var nt;return{borderRadius:0,offset:(nt=tt.pathOptions)==null?void 0:nt.offset}},[(et=tt.pathOptions)==null?void 0:et.offset])})});StepEdge.displayName="StepEdge";function getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:rt}){const[it,ot,at,st]=getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:rt});return[`M ${tt},${et}L ${nt},${rt}`,it,ot,at,st]}const StraightEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:rt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})=>{const[mt,gt,yt]=getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:rt});return React$1.createElement(BaseEdge,{path:mt,labelX:gt,labelY:yt,label:it,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})});StraightEdge.displayName="StraightEdge";function calculateControlOffset(tt,et){return tt>=0?.5*tt:et*25*Math.sqrt(-tt)}function getControlWithCurvature({pos:tt,x1:et,y1:nt,x2:rt,y2:it,c:ot}){switch(tt){case Position.Left:return[et-calculateControlOffset(et-rt,ot),nt];case Position.Right:return[et+calculateControlOffset(rt-et,ot),nt];case Position.Top:return[et,nt-calculateControlOffset(nt-it,ot)];case Position.Bottom:return[et,nt+calculateControlOffset(it-nt,ot)]}}function getBezierPath({sourceX:tt,sourceY:et,sourcePosition:nt=Position.Bottom,targetX:rt,targetY:it,targetPosition:ot=Position.Top,curvature:at=.25}){const[st,lt]=getControlWithCurvature({pos:nt,x1:tt,y1:et,x2:rt,y2:it,c:at}),[ct,ut]=getControlWithCurvature({pos:ot,x1:rt,y1:it,x2:tt,y2:et,c:at}),[ht,dt,pt,mt]=getBezierEdgeCenter({sourceX:tt,sourceY:et,targetX:rt,targetY:it,sourceControlX:st,sourceControlY:lt,targetControlX:ct,targetControlY:ut});return[`M${tt},${et} C${st},${lt} ${ct},${ut} ${rt},${it}`,ht,dt,pt,mt]}const BezierEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:rt,sourcePosition:it=Position.Bottom,targetPosition:ot=Position.Top,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,pathOptions:gt,interactionWidth:yt})=>{const[bt,wt,xt]=getBezierPath({sourceX:tt,sourceY:et,sourcePosition:it,targetX:nt,targetY:rt,targetPosition:ot,curvature:gt==null?void 0:gt.curvature});return React$1.createElement(BaseEdge,{path:bt,labelX:wt,labelY:xt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:yt})});BezierEdge.displayName="BezierEdge";const NodeIdContext=reactExports.createContext(null),Provider=NodeIdContext.Provider;NodeIdContext.Consumer;const useNodeId=()=>reactExports.useContext(NodeIdContext),isEdge=tt=>"id"in tt&&"source"in tt&&"target"in tt,getEdgeId=({source:tt,sourceHandle:et,target:nt,targetHandle:rt})=>`reactflow__edge-${tt}${et||""}-${nt}${rt||""}`,getMarkerId=(tt,et)=>typeof tt>"u"?"":typeof tt=="string"?tt:`${et?`${et}__`:""}${Object.keys(tt).sort().map(rt=>`${rt}=${tt[rt]}`).join("&")}`,connectionExists=(tt,et)=>et.some(nt=>nt.source===tt.source&&nt.target===tt.target&&(nt.sourceHandle===tt.sourceHandle||!nt.sourceHandle&&!tt.sourceHandle)&&(nt.targetHandle===tt.targetHandle||!nt.targetHandle&&!tt.targetHandle)),addEdge=(tt,et)=>{if(!tt.source||!tt.target)return et;let nt;return isEdge(tt)?nt={...tt}:nt={...tt,id:getEdgeId(tt)},connectionExists(nt,et)?et:et.concat(nt)},pointToRendererPoint=({x:tt,y:et},[nt,rt,it],ot,[at,st])=>{const lt={x:(tt-nt)/it,y:(et-rt)/it};return ot?{x:at*Math.round(lt.x/at),y:st*Math.round(lt.y/st)}:lt},rendererPointToPoint=({x:tt,y:et},[nt,rt,it])=>({x:tt*it+nt,y:et*it+rt}),getNodePositionWithOrigin=(tt,et=[0,0])=>{if(!tt)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const nt=(tt.width??0)*et[0],rt=(tt.height??0)*et[1],it={x:tt.position.x-nt,y:tt.position.y-rt};return{...it,positionAbsolute:tt.positionAbsolute?{x:tt.positionAbsolute.x-nt,y:tt.positionAbsolute.y-rt}:it}},getRectOfNodes=(tt,et=[0,0])=>{if(tt.length===0)return{x:0,y:0,width:0,height:0};const nt=tt.reduce((rt,it)=>{const{x:ot,y:at}=getNodePositionWithOrigin(it,et).positionAbsolute;return getBoundsOfBoxes(rt,rectToBox({x:ot,y:at,width:it.width||0,height:it.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return boxToRect(nt)},getNodesInside=(tt,et,[nt,rt,it]=[0,0,1],ot=!1,at=!1,st=[0,0])=>{const lt={x:(et.x-nt)/it,y:(et.y-rt)/it,width:et.width/it,height:et.height/it},ct=[];return tt.forEach(ut=>{const{width:ht,height:dt,selectable:pt=!0,hidden:mt=!1}=ut;if(at&&!pt||mt)return!1;const{positionAbsolute:gt}=getNodePositionWithOrigin(ut,st),yt={x:gt.x,y:gt.y,width:ht||0,height:dt||0},bt=getOverlappingArea(lt,yt),wt=typeof ht>"u"||typeof dt>"u"||ht===null||dt===null,xt=ot&&bt>0,kt=(ht||0)*(dt||0);(wt||xt||bt>=kt||ut.dragging)&&ct.push(ut)}),ct},getConnectedEdges=(tt,et)=>{const nt=tt.map(rt=>rt.id);return et.filter(rt=>nt.includes(rt.source)||nt.includes(rt.target))},getTransformForBounds=(tt,et,nt,rt,it,ot=.1)=>{const at=et/(tt.width*(1+ot)),st=nt/(tt.height*(1+ot)),lt=Math.min(at,st),ct=clamp(lt,rt,it),ut=tt.x+tt.width/2,ht=tt.y+tt.height/2,dt=et/2-ut*ct,pt=nt/2-ht*ct;return[dt,pt,ct]},getD3Transition=(tt,et=0)=>tt.transition().duration(et);function getHandles(tt,et,nt,rt){return(et[nt]||[]).reduce((it,ot)=>{var at,st;return`${tt.id}-${ot.id}-${nt}`!==rt&&it.push({id:ot.id||null,type:nt,nodeId:tt.id,x:(((at=tt.positionAbsolute)==null?void 0:at.x)??0)+ot.x+ot.width/2,y:(((st=tt.positionAbsolute)==null?void 0:st.y)??0)+ot.y+ot.height/2}),it},[])}function getClosestHandle(tt,et,nt,rt,it,ot){const{x:at,y:st}=getEventPosition(tt),ct=et.elementsFromPoint(at,st).find(mt=>mt.classList.contains("react-flow__handle"));if(ct){const mt=ct.getAttribute("data-nodeid");if(mt){const gt=getHandleType(void 0,ct),yt=ct.getAttribute("data-handleid"),bt=ot({nodeId:mt,id:yt,type:gt});if(bt)return{handle:{id:yt,type:gt,nodeId:mt,x:nt.x,y:nt.y},validHandleResult:bt}}}let ut=[],ht=1/0;if(it.forEach(mt=>{const gt=Math.sqrt((mt.x-nt.x)**2+(mt.y-nt.y)**2);if(gt<=rt){const yt=ot(mt);gt<=ht&&(gtmt.isValid),pt=ut.some(({handle:mt})=>mt.type==="target");return ut.find(({handle:mt,validHandleResult:gt})=>pt?mt.type==="target":dt?gt.isValid:!0)||ut[0]}const nullConnection={source:null,target:null,sourceHandle:null,targetHandle:null},defaultResult=()=>({handleDomNode:null,isValid:!1,connection:nullConnection,endHandle:null});function isValidHandle(tt,et,nt,rt,it,ot,at){const st=it==="target",lt=at.querySelector(`.react-flow__handle[data-id="${tt==null?void 0:tt.nodeId}-${tt==null?void 0:tt.id}-${tt==null?void 0:tt.type}"]`),ct={...defaultResult(),handleDomNode:lt};if(lt){const ut=getHandleType(void 0,lt),ht=lt.getAttribute("data-nodeid"),dt=lt.getAttribute("data-handleid"),pt=lt.classList.contains("connectable"),mt=lt.classList.contains("connectableend"),gt={source:st?ht:nt,sourceHandle:st?dt:rt,target:st?nt:ht,targetHandle:st?rt:dt};ct.connection=gt,pt&&mt&&(et===ConnectionMode.Strict?st&&ut==="source"||!st&&ut==="target":ht!==nt||dt!==rt)&&(ct.endHandle={nodeId:ht,handleId:dt,type:ut},ct.isValid=ot(gt))}return ct}function getHandleLookup({nodes:tt,nodeId:et,handleId:nt,handleType:rt}){return tt.reduce((it,ot)=>{if(ot[internalsSymbol]){const{handleBounds:at}=ot[internalsSymbol];let st=[],lt=[];at&&(st=getHandles(ot,at,"source",`${et}-${nt}-${rt}`),lt=getHandles(ot,at,"target",`${et}-${nt}-${rt}`)),it.push(...st,...lt)}return it},[])}function getHandleType(tt,et){return tt||(et!=null&&et.classList.contains("target")?"target":et!=null&&et.classList.contains("source")?"source":null)}function resetRecentHandle(tt){tt==null||tt.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function getConnectionStatus(tt,et){let nt=null;return et?nt="valid":tt&&!et&&(nt="invalid"),nt}function handlePointerDown({event:tt,handleId:et,nodeId:nt,onConnect:rt,isTarget:it,getState:ot,setState:at,isValidConnection:st,edgeUpdaterType:lt,onEdgeUpdateEnd:ct}){const ut=getHostForElement(tt.target),{connectionMode:ht,domNode:dt,autoPanOnConnect:pt,connectionRadius:mt,onConnectStart:gt,panBy:yt,getNodes:bt,cancelConnection:wt}=ot();let xt=0,kt;const{x:St,y:Tt}=getEventPosition(tt),At=ut==null?void 0:ut.elementFromPoint(St,Tt),Et=getHandleType(lt,At),Ct=dt==null?void 0:dt.getBoundingClientRect();if(!Ct||!Et)return;let Lt,jt=getEventPosition(tt,Ct),Rt=!1,$t=null,vt=!1,It=null;const Ot=getHandleLookup({nodes:bt(),nodeId:nt,handleId:et,handleType:Et}),Wt=()=>{if(!pt)return;const[Nt,Ut]=calcAutoPan(jt,Ct);yt({x:Nt,y:Ut}),xt=requestAnimationFrame(Wt)};at({connectionPosition:jt,connectionStatus:null,connectionNodeId:nt,connectionHandleId:et,connectionHandleType:Et,connectionStartHandle:{nodeId:nt,handleId:et,type:Et},connectionEndHandle:null}),gt==null||gt(tt,{nodeId:nt,handleId:et,handleType:Et});function zt(Nt){const{transform:Ut}=ot();jt=getEventPosition(Nt,Ct);const{handle:Pt,validHandleResult:Ht}=getClosestHandle(Nt,ut,pointToRendererPoint(jt,Ut,!1,[1,1]),mt,Ot,Qt=>isValidHandle(Qt,ht,nt,et,it?"target":"source",st,ut));if(kt=Pt,Rt||(Wt(),Rt=!0),It=Ht.handleDomNode,$t=Ht.connection,vt=Ht.isValid,at({connectionPosition:kt&&vt?rendererPointToPoint({x:kt.x,y:kt.y},Ut):jt,connectionStatus:getConnectionStatus(!!kt,vt),connectionEndHandle:Ht.endHandle}),!kt&&!vt&&!It)return resetRecentHandle(Lt);$t.source!==$t.target&&It&&(resetRecentHandle(Lt),Lt=It,It.classList.add("connecting","react-flow__handle-connecting"),It.classList.toggle("valid",vt),It.classList.toggle("react-flow__handle-valid",vt))}function Ft(Nt){var Ut,Pt;(kt||It)&&$t&&vt&&(rt==null||rt($t)),(Pt=(Ut=ot()).onConnectEnd)==null||Pt.call(Ut,Nt),lt&&(ct==null||ct(Nt)),resetRecentHandle(Lt),wt(),cancelAnimationFrame(xt),Rt=!1,vt=!1,$t=null,It=null,ut.removeEventListener("mousemove",zt),ut.removeEventListener("mouseup",Ft),ut.removeEventListener("touchmove",zt),ut.removeEventListener("touchend",Ft)}ut.addEventListener("mousemove",zt),ut.addEventListener("mouseup",Ft),ut.addEventListener("touchmove",zt),ut.addEventListener("touchend",Ft)}const alwaysValid=()=>!0,selector$f=tt=>({connectionStartHandle:tt.connectionStartHandle,connectOnClick:tt.connectOnClick,noPanClassName:tt.noPanClassName}),connectingSelector=(tt,et,nt)=>rt=>{const{connectionStartHandle:it,connectionEndHandle:ot,connectionClickStartHandle:at}=rt;return{connecting:(it==null?void 0:it.nodeId)===tt&&(it==null?void 0:it.handleId)===et&&(it==null?void 0:it.type)===nt||(ot==null?void 0:ot.nodeId)===tt&&(ot==null?void 0:ot.handleId)===et&&(ot==null?void 0:ot.type)===nt,clickConnecting:(at==null?void 0:at.nodeId)===tt&&(at==null?void 0:at.handleId)===et&&(at==null?void 0:at.type)===nt}},Handle=reactExports.forwardRef(({type:tt="source",position:et=Position.Top,isValidConnection:nt,isConnectable:rt=!0,isConnectableStart:it=!0,isConnectableEnd:ot=!0,id:at,onConnect:st,children:lt,className:ct,onMouseDown:ut,onTouchStart:ht,...dt},pt)=>{var Ct,Lt;const mt=at||null,gt=tt==="target",yt=useStoreApi(),bt=useNodeId(),{connectOnClick:wt,noPanClassName:xt}=useStore(selector$f,shallow$1),{connecting:kt,clickConnecting:St}=useStore(connectingSelector(bt,mt,tt),shallow$1);bt||(Lt=(Ct=yt.getState()).onError)==null||Lt.call(Ct,"010",errorMessages.error010());const Tt=jt=>{const{defaultEdgeOptions:Rt,onConnect:$t,hasDefaultEdges:vt}=yt.getState(),It={...Rt,...jt};if(vt){const{edges:Ot,setEdges:Wt}=yt.getState();Wt(addEdge(It,Ot))}$t==null||$t(It),st==null||st(It)},At=jt=>{if(!bt)return;const Rt=isMouseEvent(jt);it&&(Rt&&jt.button===0||!Rt)&&handlePointerDown({event:jt,handleId:mt,nodeId:bt,onConnect:Tt,isTarget:gt,getState:yt.getState,setState:yt.setState,isValidConnection:nt||yt.getState().isValidConnection||alwaysValid}),Rt?ut==null||ut(jt):ht==null||ht(jt)},Et=jt=>{const{onClickConnectStart:Rt,onClickConnectEnd:$t,connectionClickStartHandle:vt,connectionMode:It,isValidConnection:Ot}=yt.getState();if(!bt||!vt&&!it)return;if(!vt){Rt==null||Rt(jt,{nodeId:bt,handleId:mt,handleType:tt}),yt.setState({connectionClickStartHandle:{nodeId:bt,type:tt,handleId:mt}});return}const Wt=getHostForElement(jt.target),zt=nt||Ot||alwaysValid,{connection:Ft,isValid:Nt}=isValidHandle({nodeId:bt,id:mt,type:tt},It,vt.nodeId,vt.handleId||null,vt.type,zt,Wt);Nt&&Tt(Ft),$t==null||$t(jt),yt.setState({connectionClickStartHandle:null})};return React$1.createElement("div",{"data-handleid":mt,"data-nodeid":bt,"data-handlepos":et,"data-id":`${bt}-${mt}-${tt}`,className:cc(["react-flow__handle",`react-flow__handle-${et}`,"nodrag",xt,ct,{source:!gt,target:gt,connectable:rt,connectablestart:it,connectableend:ot,connecting:St,connectionindicator:rt&&(it&&!kt||ot&&kt)}]),onMouseDown:At,onTouchStart:At,onClick:wt?Et:void 0,ref:pt,...dt},lt)});Handle.displayName="Handle";var Handle$1=reactExports.memo(Handle);const DefaultNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top,sourcePosition:rt=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:rt,isConnectable:et}));DefaultNode.displayName="DefaultNode";var DefaultNode$1=reactExports.memo(DefaultNode);const InputNode=({data:tt,isConnectable:et,sourcePosition:nt=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:nt,isConnectable:et}));InputNode.displayName="InputNode";var InputNode$1=reactExports.memo(InputNode);const OutputNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label);OutputNode.displayName="OutputNode";var OutputNode$1=reactExports.memo(OutputNode);const GroupNode=()=>null;GroupNode.displayName="GroupNode";const selector$e=tt=>({selectedNodes:tt.getNodes().filter(et=>et.selected),selectedEdges:tt.edges.filter(et=>et.selected)}),selectId=tt=>tt.id;function areEqual(tt,et){return shallow$1(tt.selectedNodes.map(selectId),et.selectedNodes.map(selectId))&&shallow$1(tt.selectedEdges.map(selectId),et.selectedEdges.map(selectId))}const SelectionListener=reactExports.memo(({onSelectionChange:tt})=>{const et=useStoreApi(),{selectedNodes:nt,selectedEdges:rt}=useStore(selector$e,areEqual);return reactExports.useEffect(()=>{var ot,at;const it={nodes:nt,edges:rt};tt==null||tt(it),(at=(ot=et.getState()).onSelectionChange)==null||at.call(ot,it)},[nt,rt,tt]),null});SelectionListener.displayName="SelectionListener";const changeSelector=tt=>!!tt.onSelectionChange;function Wrapper$1$1({onSelectionChange:tt}){const et=useStore(changeSelector);return tt||et?React$1.createElement(SelectionListener,{onSelectionChange:tt}):null}const selector$d=tt=>({setNodes:tt.setNodes,setEdges:tt.setEdges,setDefaultNodesAndEdges:tt.setDefaultNodesAndEdges,setMinZoom:tt.setMinZoom,setMaxZoom:tt.setMaxZoom,setTranslateExtent:tt.setTranslateExtent,setNodeExtent:tt.setNodeExtent,reset:tt.reset});function useStoreUpdater(tt,et){reactExports.useEffect(()=>{typeof tt<"u"&&et(tt)},[tt])}function useDirectStoreUpdater(tt,et,nt){reactExports.useEffect(()=>{typeof et<"u"&&nt({[tt]:et})},[et])}const StoreUpdater=({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:rt,onConnect:it,onConnectStart:ot,onConnectEnd:at,onClickConnectStart:st,onClickConnectEnd:lt,nodesDraggable:ct,nodesConnectable:ut,nodesFocusable:ht,edgesFocusable:dt,edgesUpdatable:pt,elevateNodesOnSelect:mt,minZoom:gt,maxZoom:yt,nodeExtent:bt,onNodesChange:wt,onEdgesChange:xt,elementsSelectable:kt,connectionMode:St,snapGrid:Tt,snapToGrid:At,translateExtent:Et,connectOnClick:Ct,defaultEdgeOptions:Lt,fitView:jt,fitViewOptions:Rt,onNodesDelete:$t,onEdgesDelete:vt,onNodeDrag:It,onNodeDragStart:Ot,onNodeDragStop:Wt,onSelectionDrag:zt,onSelectionDragStart:Ft,onSelectionDragStop:Nt,noPanClassName:Ut,nodeOrigin:Pt,rfId:Ht,autoPanOnConnect:Qt,autoPanOnNodeDrag:an,onError:Yt,connectionRadius:nn,isValidConnection:tn,nodeDragThreshold:dn})=>{const{setNodes:wn,setEdges:rn,setDefaultNodesAndEdges:Zt,setMinZoom:vn,setMaxZoom:Cn,setTranslateExtent:$n,setNodeExtent:Nn,reset:En}=useStore(selector$d,shallow$1),sn=useStoreApi();return reactExports.useEffect(()=>{const pn=rt==null?void 0:rt.map(Tn=>({...Tn,...Lt}));return Zt(nt,pn),()=>{En()}},[]),useDirectStoreUpdater("defaultEdgeOptions",Lt,sn.setState),useDirectStoreUpdater("connectionMode",St,sn.setState),useDirectStoreUpdater("onConnect",it,sn.setState),useDirectStoreUpdater("onConnectStart",ot,sn.setState),useDirectStoreUpdater("onConnectEnd",at,sn.setState),useDirectStoreUpdater("onClickConnectStart",st,sn.setState),useDirectStoreUpdater("onClickConnectEnd",lt,sn.setState),useDirectStoreUpdater("nodesDraggable",ct,sn.setState),useDirectStoreUpdater("nodesConnectable",ut,sn.setState),useDirectStoreUpdater("nodesFocusable",ht,sn.setState),useDirectStoreUpdater("edgesFocusable",dt,sn.setState),useDirectStoreUpdater("edgesUpdatable",pt,sn.setState),useDirectStoreUpdater("elementsSelectable",kt,sn.setState),useDirectStoreUpdater("elevateNodesOnSelect",mt,sn.setState),useDirectStoreUpdater("snapToGrid",At,sn.setState),useDirectStoreUpdater("snapGrid",Tt,sn.setState),useDirectStoreUpdater("onNodesChange",wt,sn.setState),useDirectStoreUpdater("onEdgesChange",xt,sn.setState),useDirectStoreUpdater("connectOnClick",Ct,sn.setState),useDirectStoreUpdater("fitViewOnInit",jt,sn.setState),useDirectStoreUpdater("fitViewOnInitOptions",Rt,sn.setState),useDirectStoreUpdater("onNodesDelete",$t,sn.setState),useDirectStoreUpdater("onEdgesDelete",vt,sn.setState),useDirectStoreUpdater("onNodeDrag",It,sn.setState),useDirectStoreUpdater("onNodeDragStart",Ot,sn.setState),useDirectStoreUpdater("onNodeDragStop",Wt,sn.setState),useDirectStoreUpdater("onSelectionDrag",zt,sn.setState),useDirectStoreUpdater("onSelectionDragStart",Ft,sn.setState),useDirectStoreUpdater("onSelectionDragStop",Nt,sn.setState),useDirectStoreUpdater("noPanClassName",Ut,sn.setState),useDirectStoreUpdater("nodeOrigin",Pt,sn.setState),useDirectStoreUpdater("rfId",Ht,sn.setState),useDirectStoreUpdater("autoPanOnConnect",Qt,sn.setState),useDirectStoreUpdater("autoPanOnNodeDrag",an,sn.setState),useDirectStoreUpdater("onError",Yt,sn.setState),useDirectStoreUpdater("connectionRadius",nn,sn.setState),useDirectStoreUpdater("isValidConnection",tn,sn.setState),useDirectStoreUpdater("nodeDragThreshold",dn,sn.setState),useStoreUpdater(tt,wn),useStoreUpdater(et,rn),useStoreUpdater(gt,vn),useStoreUpdater(yt,Cn),useStoreUpdater(Et,$n),useStoreUpdater(bt,Nn),null},style$1={display:"none"},ariaLiveStyle={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ARIA_NODE_DESC_KEY="react-flow__node-desc",ARIA_EDGE_DESC_KEY="react-flow__edge-desc",ARIA_LIVE_MESSAGE="react-flow__aria-live",selector$c=tt=>tt.ariaLiveMessage;function AriaLiveMessage({rfId:tt}){const et=useStore(selector$c);return React$1.createElement("div",{id:`${ARIA_LIVE_MESSAGE}-${tt}`,"aria-live":"assertive","aria-atomic":"true",style:ariaLiveStyle},et)}function A11yDescriptions({rfId:tt,disableKeyboardA11y:et}){return React$1.createElement(React$1.Fragment,null,React$1.createElement("div",{id:`${ARIA_NODE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select a node.",!et&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),React$1.createElement("div",{id:`${ARIA_EDGE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!et&&React$1.createElement(AriaLiveMessage,{rfId:tt}))}var useKeyPress=(tt=null,et={actInsideInputWithModifier:!0})=>{const[nt,rt]=reactExports.useState(!1),it=reactExports.useRef(!1),ot=reactExports.useRef(new Set([])),[at,st]=reactExports.useMemo(()=>{if(tt!==null){const ct=(Array.isArray(tt)?tt:[tt]).filter(ht=>typeof ht=="string").map(ht=>ht.split("+")),ut=ct.reduce((ht,dt)=>ht.concat(...dt),[]);return[ct,ut]}return[[],[]]},[tt]);return reactExports.useEffect(()=>{const lt=typeof document<"u"?document:null,ct=(et==null?void 0:et.target)||lt;if(tt!==null){const ut=pt=>{if(it.current=pt.ctrlKey||pt.metaKey||pt.shiftKey,(!it.current||it.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);ot.current.add(pt[gt]),isMatchingKey(at,ot.current,!1)&&(pt.preventDefault(),rt(!0))},ht=pt=>{if((!it.current||it.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);isMatchingKey(at,ot.current,!0)?(rt(!1),ot.current.clear()):ot.current.delete(pt[gt]),pt.key==="Meta"&&ot.current.clear(),it.current=!1},dt=()=>{ot.current.clear(),rt(!1)};return ct==null||ct.addEventListener("keydown",ut),ct==null||ct.addEventListener("keyup",ht),window.addEventListener("blur",dt),()=>{ct==null||ct.removeEventListener("keydown",ut),ct==null||ct.removeEventListener("keyup",ht),window.removeEventListener("blur",dt)}}},[tt,rt]),nt};function isMatchingKey(tt,et,nt){return tt.filter(rt=>nt||rt.length===et.size).some(rt=>rt.every(it=>et.has(it)))}function useKeyOrCode(tt,et){return et.includes(tt)?"code":"key"}function calculateXYZPosition(tt,et,nt,rt){var at,st;if(!tt.parentNode)return nt;const it=et.get(tt.parentNode),ot=getNodePositionWithOrigin(it,rt);return calculateXYZPosition(it,et,{x:(nt.x??0)+ot.x,y:(nt.y??0)+ot.y,z:(((at=it[internalsSymbol])==null?void 0:at.z)??0)>(nt.z??0)?((st=it[internalsSymbol])==null?void 0:st.z)??0:nt.z??0},rt)}function updateAbsoluteNodePositions(tt,et,nt){tt.forEach(rt=>{var it;if(rt.parentNode&&!tt.has(rt.parentNode))throw new Error(`Parent node ${rt.parentNode} not found`);if(rt.parentNode||nt!=null&&nt[rt.id]){const{x:ot,y:at,z:st}=calculateXYZPosition(rt,tt,{...rt.position,z:((it=rt[internalsSymbol])==null?void 0:it.z)??0},et);rt.positionAbsolute={x:ot,y:at},rt[internalsSymbol].z=st,nt!=null&&nt[rt.id]&&(rt[internalsSymbol].isParent=!0)}})}function createNodeInternals(tt,et,nt,rt){const it=new Map,ot={},at=rt?1e3:0;return tt.forEach(st=>{var ht;const lt=(isNumeric(st.zIndex)?st.zIndex:0)+(st.selected?at:0),ct=et.get(st.id),ut={width:ct==null?void 0:ct.width,height:ct==null?void 0:ct.height,...st,positionAbsolute:{x:st.position.x,y:st.position.y}};st.parentNode&&(ut.parentNode=st.parentNode,ot[st.parentNode]=!0),Object.defineProperty(ut,internalsSymbol,{enumerable:!1,value:{handleBounds:(ht=ct==null?void 0:ct[internalsSymbol])==null?void 0:ht.handleBounds,z:lt}}),it.set(st.id,ut)}),updateAbsoluteNodePositions(it,nt,ot),it}function fitView(tt,et={}){const{getNodes:nt,width:rt,height:it,minZoom:ot,maxZoom:at,d3Zoom:st,d3Selection:lt,fitViewOnInitDone:ct,fitViewOnInit:ut,nodeOrigin:ht}=tt(),dt=et.initial&&!ct&&ut;if(st&<&&(dt||!et.initial)){const mt=nt().filter(yt=>{var wt;const bt=et.includeHiddenNodes?yt.width&&yt.height:!yt.hidden;return(wt=et.nodes)!=null&&wt.length?bt&&et.nodes.some(xt=>xt.id===yt.id):bt}),gt=mt.every(yt=>yt.width&&yt.height);if(mt.length>0&>){const yt=getRectOfNodes(mt,ht),[bt,wt,xt]=getTransformForBounds(yt,rt,it,et.minZoom??ot,et.maxZoom??at,et.padding??.1),kt=identity.translate(bt,wt).scale(xt);return typeof et.duration=="number"&&et.duration>0?st.transform(getD3Transition(lt,et.duration),kt):st.transform(lt,kt),!0}}return!1}function handleControlledNodeSelectionChange(tt,et){return tt.forEach(nt=>{const rt=et.get(nt.id);rt&&et.set(rt.id,{...rt,[internalsSymbol]:rt[internalsSymbol],selected:nt.selected})}),new Map(et)}function handleControlledEdgeSelectionChange(tt,et){return et.map(nt=>{const rt=tt.find(it=>it.id===nt.id);return rt&&(nt.selected=rt.selected),nt})}function updateNodesAndEdgesSelections({changedNodes:tt,changedEdges:et,get:nt,set:rt}){const{nodeInternals:it,edges:ot,onNodesChange:at,onEdgesChange:st,hasDefaultNodes:lt,hasDefaultEdges:ct}=nt();tt!=null&&tt.length&&(lt&&rt({nodeInternals:handleControlledNodeSelectionChange(tt,it)}),at==null||at(tt)),et!=null&&et.length&&(ct&&rt({edges:handleControlledEdgeSelectionChange(et,ot)}),st==null||st(et))}const noop$1=()=>{},initialViewportHelper={zoomIn:noop$1,zoomOut:noop$1,zoomTo:noop$1,getZoom:()=>1,setViewport:noop$1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:noop$1,fitBounds:noop$1,project:tt=>tt,viewportInitialized:!1},selector$b=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection}),useViewportHelper=()=>{const tt=useStoreApi(),{d3Zoom:et,d3Selection:nt}=useStore(selector$b,shallow$1);return reactExports.useMemo(()=>nt&&et?{zoomIn:it=>et.scaleBy(getD3Transition(nt,it==null?void 0:it.duration),1.2),zoomOut:it=>et.scaleBy(getD3Transition(nt,it==null?void 0:it.duration),1/1.2),zoomTo:(it,ot)=>et.scaleTo(getD3Transition(nt,ot==null?void 0:ot.duration),it),getZoom:()=>tt.getState().transform[2],setViewport:(it,ot)=>{const[at,st,lt]=tt.getState().transform,ct=identity.translate(it.x??at,it.y??st).scale(it.zoom??lt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),ct)},getViewport:()=>{const[it,ot,at]=tt.getState().transform;return{x:it,y:ot,zoom:at}},fitView:it=>fitView(tt.getState,it),setCenter:(it,ot,at)=>{const{width:st,height:lt,maxZoom:ct}=tt.getState(),ut=typeof(at==null?void 0:at.zoom)<"u"?at.zoom:ct,ht=st/2-it*ut,dt=lt/2-ot*ut,pt=identity.translate(ht,dt).scale(ut);et.transform(getD3Transition(nt,at==null?void 0:at.duration),pt)},fitBounds:(it,ot)=>{const{width:at,height:st,minZoom:lt,maxZoom:ct}=tt.getState(),[ut,ht,dt]=getTransformForBounds(it,at,st,lt,ct,(ot==null?void 0:ot.padding)??.1),pt=identity.translate(ut,ht).scale(dt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),pt)},project:it=>{const{transform:ot,snapToGrid:at,snapGrid:st}=tt.getState();return pointToRendererPoint(it,ot,at,st)},viewportInitialized:!0}:initialViewportHelper,[et,nt])};function useReactFlow(){const tt=useViewportHelper(),et=useStoreApi(),nt=reactExports.useCallback(()=>et.getState().getNodes().map(gt=>({...gt})),[]),rt=reactExports.useCallback(gt=>et.getState().nodeInternals.get(gt),[]),it=reactExports.useCallback(()=>{const{edges:gt=[]}=et.getState();return gt.map(yt=>({...yt}))},[]),ot=reactExports.useCallback(gt=>{const{edges:yt=[]}=et.getState();return yt.find(bt=>bt.id===gt)},[]),at=reactExports.useCallback(gt=>{const{getNodes:yt,setNodes:bt,hasDefaultNodes:wt,onNodesChange:xt}=et.getState(),kt=yt(),St=typeof gt=="function"?gt(kt):gt;if(wt)bt(St);else if(xt){const Tt=St.length===0?kt.map(At=>({type:"remove",id:At.id})):St.map(At=>({item:At,type:"reset"}));xt(Tt)}},[]),st=reactExports.useCallback(gt=>{const{edges:yt=[],setEdges:bt,hasDefaultEdges:wt,onEdgesChange:xt}=et.getState(),kt=typeof gt=="function"?gt(yt):gt;if(wt)bt(kt);else if(xt){const St=kt.length===0?yt.map(Tt=>({type:"remove",id:Tt.id})):kt.map(Tt=>({item:Tt,type:"reset"}));xt(St)}},[]),lt=reactExports.useCallback(gt=>{const yt=Array.isArray(gt)?gt:[gt],{getNodes:bt,setNodes:wt,hasDefaultNodes:xt,onNodesChange:kt}=et.getState();if(xt){const Tt=[...bt(),...yt];wt(Tt)}else if(kt){const St=yt.map(Tt=>({item:Tt,type:"add"}));kt(St)}},[]),ct=reactExports.useCallback(gt=>{const yt=Array.isArray(gt)?gt:[gt],{edges:bt=[],setEdges:wt,hasDefaultEdges:xt,onEdgesChange:kt}=et.getState();if(xt)wt([...bt,...yt]);else if(kt){const St=yt.map(Tt=>({item:Tt,type:"add"}));kt(St)}},[]),ut=reactExports.useCallback(()=>{const{getNodes:gt,edges:yt=[],transform:bt}=et.getState(),[wt,xt,kt]=bt;return{nodes:gt().map(St=>({...St})),edges:yt.map(St=>({...St})),viewport:{x:wt,y:xt,zoom:kt}}},[]),ht=reactExports.useCallback(({nodes:gt,edges:yt})=>{const{nodeInternals:bt,getNodes:wt,edges:xt,hasDefaultNodes:kt,hasDefaultEdges:St,onNodesDelete:Tt,onEdgesDelete:At,onNodesChange:Et,onEdgesChange:Ct}=et.getState(),Lt=(gt||[]).map(It=>It.id),jt=(yt||[]).map(It=>It.id),Rt=wt().reduce((It,Ot)=>{const Wt=!Lt.includes(Ot.id)&&Ot.parentNode&&It.find(Ft=>Ft.id===Ot.parentNode);return(typeof Ot.deletable=="boolean"?Ot.deletable:!0)&&(Lt.includes(Ot.id)||Wt)&&It.push(Ot),It},[]),$t=xt.filter(It=>typeof It.deletable=="boolean"?It.deletable:!0),vt=$t.filter(It=>jt.includes(It.id));if(Rt||vt){const It=getConnectedEdges(Rt,$t),Ot=[...vt,...It],Wt=Ot.reduce((zt,Ft)=>(zt.includes(Ft.id)||zt.push(Ft.id),zt),[]);if((St||kt)&&(St&&et.setState({edges:xt.filter(zt=>!Wt.includes(zt.id))}),kt&&(Rt.forEach(zt=>{bt.delete(zt.id)}),et.setState({nodeInternals:new Map(bt)}))),Wt.length>0&&(At==null||At(Ot),Ct&&Ct(Wt.map(zt=>({id:zt,type:"remove"})))),Rt.length>0&&(Tt==null||Tt(Rt),Et)){const zt=Rt.map(Ft=>({id:Ft.id,type:"remove"}));Et(zt)}}},[]),dt=reactExports.useCallback(gt=>{const yt=isRectObject(gt),bt=yt?null:et.getState().nodeInternals.get(gt.id);return[yt?gt:nodeToRect(bt),bt,yt]},[]),pt=reactExports.useCallback((gt,yt=!0,bt)=>{const[wt,xt,kt]=dt(gt);return wt?(bt||et.getState().getNodes()).filter(St=>{if(!kt&&(St.id===xt.id||!St.positionAbsolute))return!1;const Tt=nodeToRect(St),At=getOverlappingArea(Tt,wt);return yt&&At>0||At>=gt.width*gt.height}):[]},[]),mt=reactExports.useCallback((gt,yt,bt=!0)=>{const[wt]=dt(gt);if(!wt)return!1;const xt=getOverlappingArea(wt,yt);return bt&&xt>0||xt>=gt.width*gt.height},[]);return reactExports.useMemo(()=>({...tt,getNodes:nt,getNode:rt,getEdges:it,getEdge:ot,setNodes:at,setEdges:st,addNodes:lt,addEdges:ct,toObject:ut,deleteElements:ht,getIntersectingNodes:pt,isNodeIntersecting:mt}),[tt,nt,rt,it,ot,at,st,lt,ct,ut,ht,pt,mt])}const deleteKeyOptions={actInsideInputWithModifier:!1};var useGlobalKeyHandler=({deleteKeyCode:tt,multiSelectionKeyCode:et})=>{const nt=useStoreApi(),{deleteElements:rt}=useReactFlow(),it=useKeyPress(tt,deleteKeyOptions),ot=useKeyPress(et);reactExports.useEffect(()=>{if(it){const{edges:at,getNodes:st}=nt.getState(),lt=st().filter(ut=>ut.selected),ct=at.filter(ut=>ut.selected);rt({nodes:lt,edges:ct}),nt.setState({nodesSelectionActive:!1})}},[it]),reactExports.useEffect(()=>{nt.setState({multiSelectionActive:ot})},[ot])};function useResizeHandler(tt){const et=useStoreApi();reactExports.useEffect(()=>{let nt;const rt=()=>{var ot,at;if(!tt.current)return;const it=getDimensions(tt.current);(it.height===0||it.width===0)&&((at=(ot=et.getState()).onError)==null||at.call(ot,"004",errorMessages.error004())),et.setState({width:it.width||500,height:it.height||500})};return rt(),window.addEventListener("resize",rt),tt.current&&(nt=new ResizeObserver(()=>rt()),nt.observe(tt.current)),()=>{window.removeEventListener("resize",rt),nt&&tt.current&&nt.unobserve(tt.current)}},[])}const containerStyle={position:"absolute",width:"100%",height:"100%",top:0,left:0},viewChanged=(tt,et)=>tt.x!==et.x||tt.y!==et.y||tt.zoom!==et.k,eventToFlowTransform=tt=>({x:tt.x,y:tt.y,zoom:tt.k}),isWrappedWithClass=(tt,et)=>tt.target.closest(`.${et}`),isRightClickPan=(tt,et)=>et===2&&Array.isArray(tt)&&tt.includes(2),wheelDelta=tt=>{const et=tt.ctrlKey&&isMacOs()?10:1;return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*et},selector$a=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection,d3ZoomHandler:tt.d3ZoomHandler,userSelectionActive:tt.userSelectionActive}),ZoomPane=({onMove:tt,onMoveStart:et,onMoveEnd:nt,onPaneContextMenu:rt,zoomOnScroll:it=!0,zoomOnPinch:ot=!0,panOnScroll:at=!1,panOnScrollSpeed:st=.5,panOnScrollMode:lt=PanOnScrollMode.Free,zoomOnDoubleClick:ct=!0,elementsSelectable:ut,panOnDrag:ht=!0,defaultViewport:dt,translateExtent:pt,minZoom:mt,maxZoom:gt,zoomActivationKeyCode:yt,preventScrolling:bt=!0,children:wt,noWheelClassName:xt,noPanClassName:kt})=>{const St=reactExports.useRef(),Tt=useStoreApi(),At=reactExports.useRef(!1),Et=reactExports.useRef(!1),Ct=reactExports.useRef(null),Lt=reactExports.useRef({x:0,y:0,zoom:0}),{d3Zoom:jt,d3Selection:Rt,d3ZoomHandler:$t,userSelectionActive:vt}=useStore(selector$a,shallow$1),It=useKeyPress(yt),Ot=reactExports.useRef(0),Wt=reactExports.useRef(!1),zt=reactExports.useRef();return useResizeHandler(Ct),reactExports.useEffect(()=>{if(Ct.current){const Ft=Ct.current.getBoundingClientRect(),Nt=zoom().scaleExtent([mt,gt]).translateExtent(pt),Ut=select(Ct.current).call(Nt),Pt=identity.translate(dt.x,dt.y).scale(clamp(dt.zoom,mt,gt)),Ht=[[0,0],[Ft.width,Ft.height]],Qt=Nt.constrain()(Pt,Ht,pt);Nt.transform(Ut,Qt),Nt.wheelDelta(wheelDelta),Tt.setState({d3Zoom:Nt,d3Selection:Ut,d3ZoomHandler:Ut.on("wheel.zoom"),transform:[Qt.x,Qt.y,Qt.k],domNode:Ct.current.closest(".react-flow")})}},[]),reactExports.useEffect(()=>{Rt&&jt&&(at&&!It&&!vt?Rt.on("wheel.zoom",Ft=>{if(isWrappedWithClass(Ft,xt))return!1;Ft.preventDefault(),Ft.stopImmediatePropagation();const Nt=Rt.property("__zoom").k||1,Ut=isMacOs();if(Ft.ctrlKey&&ot&&Ut){const dn=pointer(Ft),wn=wheelDelta(Ft),rn=Nt*Math.pow(2,wn);jt.scaleTo(Rt,rn,dn,Ft);return}const Pt=Ft.deltaMode===1?20:1;let Ht=lt===PanOnScrollMode.Vertical?0:Ft.deltaX*Pt,Qt=lt===PanOnScrollMode.Horizontal?0:Ft.deltaY*Pt;!Ut&&Ft.shiftKey&<!==PanOnScrollMode.Vertical&&(Ht=Ft.deltaY*Pt,Qt=0),jt.translateBy(Rt,-(Ht/Nt)*st,-(Qt/Nt)*st,{internal:!0});const an=eventToFlowTransform(Rt.property("__zoom")),{onViewportChangeStart:Yt,onViewportChange:nn,onViewportChangeEnd:tn}=Tt.getState();clearTimeout(zt.current),Wt.current||(Wt.current=!0,et==null||et(Ft,an),Yt==null||Yt(an)),Wt.current&&(tt==null||tt(Ft,an),nn==null||nn(an),zt.current=setTimeout(()=>{nt==null||nt(Ft,an),tn==null||tn(an),Wt.current=!1},150))},{passive:!1}):typeof $t<"u"&&Rt.on("wheel.zoom",function(Ft,Nt){if(!bt||isWrappedWithClass(Ft,xt))return null;Ft.preventDefault(),$t.call(this,Ft,Nt)},{passive:!1}))},[vt,at,lt,Rt,jt,$t,It,ot,bt,xt,et,tt,nt]),reactExports.useEffect(()=>{jt&&jt.on("start",Ft=>{var Pt,Ht;if(!Ft.sourceEvent||Ft.sourceEvent.internal)return null;Ot.current=(Pt=Ft.sourceEvent)==null?void 0:Pt.button;const{onViewportChangeStart:Nt}=Tt.getState(),Ut=eventToFlowTransform(Ft.transform);At.current=!0,Lt.current=Ut,((Ht=Ft.sourceEvent)==null?void 0:Ht.type)==="mousedown"&&Tt.setState({paneDragging:!0}),Nt==null||Nt(Ut),et==null||et(Ft.sourceEvent,Ut)})},[jt,et]),reactExports.useEffect(()=>{jt&&(vt&&!At.current?jt.on("zoom",null):vt||jt.on("zoom",Ft=>{var Ut;const{onViewportChange:Nt}=Tt.getState();if(Tt.setState({transform:[Ft.transform.x,Ft.transform.y,Ft.transform.k]}),Et.current=!!(rt&&isRightClickPan(ht,Ot.current??0)),(tt||Nt)&&!((Ut=Ft.sourceEvent)!=null&&Ut.internal)){const Pt=eventToFlowTransform(Ft.transform);Nt==null||Nt(Pt),tt==null||tt(Ft.sourceEvent,Pt)}}))},[vt,jt,tt,ht,rt]),reactExports.useEffect(()=>{jt&&jt.on("end",Ft=>{if(!Ft.sourceEvent||Ft.sourceEvent.internal)return null;const{onViewportChangeEnd:Nt}=Tt.getState();if(At.current=!1,Tt.setState({paneDragging:!1}),rt&&isRightClickPan(ht,Ot.current??0)&&!Et.current&&rt(Ft.sourceEvent),Et.current=!1,(nt||Nt)&&viewChanged(Lt.current,Ft.transform)){const Ut=eventToFlowTransform(Ft.transform);Lt.current=Ut,clearTimeout(St.current),St.current=setTimeout(()=>{Nt==null||Nt(Ut),nt==null||nt(Ft.sourceEvent,Ut)},at?150:0)}})},[jt,at,ht,nt,rt]),reactExports.useEffect(()=>{jt&&jt.filter(Ft=>{const Nt=It||it,Ut=ot&&Ft.ctrlKey;if((ht===!0||Array.isArray(ht)&&ht.includes(1))&&Ft.button===1&&Ft.type==="mousedown"&&(isWrappedWithClass(Ft,"react-flow__node")||isWrappedWithClass(Ft,"react-flow__edge")))return!0;if(!ht&&!Nt&&!at&&!ct&&!ot||vt||!ct&&Ft.type==="dblclick"||isWrappedWithClass(Ft,xt)&&Ft.type==="wheel"||isWrappedWithClass(Ft,kt)&&(Ft.type!=="wheel"||at&&Ft.type==="wheel")||!ot&&Ft.ctrlKey&&Ft.type==="wheel"||!Nt&&!at&&!Ut&&Ft.type==="wheel"||!ht&&(Ft.type==="mousedown"||Ft.type==="touchstart")||Array.isArray(ht)&&!ht.includes(Ft.button)&&(Ft.type==="mousedown"||Ft.type==="touchstart"))return!1;const Pt=Array.isArray(ht)&&ht.includes(Ft.button)||!Ft.button||Ft.button<=1;return(!Ft.ctrlKey||Ft.type==="wheel")&&Pt})},[vt,jt,it,ot,at,ct,ht,ut,It]),React$1.createElement("div",{className:"react-flow__renderer",ref:Ct,style:containerStyle},wt)},selector$9=tt=>({userSelectionActive:tt.userSelectionActive,userSelectionRect:tt.userSelectionRect});function UserSelection(){const{userSelectionActive:tt,userSelectionRect:et}=useStore(selector$9,shallow$1);return tt&&et?React$1.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:et.width,height:et.height,transform:`translate(${et.x}px, ${et.y}px)`}}):null}function handleParentExpand(tt,et){const nt=tt.find(rt=>rt.id===et.parentNode);if(nt){const rt=et.position.x+et.width-nt.width,it=et.position.y+et.height-nt.height;if(rt>0||it>0||et.position.x<0||et.position.y<0){if(nt.style={...nt.style},nt.style.width=nt.style.width??nt.width,nt.style.height=nt.style.height??nt.height,rt>0&&(nt.style.width+=rt),it>0&&(nt.style.height+=it),et.position.x<0){const ot=Math.abs(et.position.x);nt.position.x=nt.position.x-ot,nt.style.width+=ot,et.position.x=0}if(et.position.y<0){const ot=Math.abs(et.position.y);nt.position.y=nt.position.y-ot,nt.style.height+=ot,et.position.y=0}nt.width=nt.style.width,nt.height=nt.style.height}}}function applyChanges(tt,et){if(tt.some(rt=>rt.type==="reset"))return tt.filter(rt=>rt.type==="reset").map(rt=>rt.item);const nt=tt.filter(rt=>rt.type==="add").map(rt=>rt.item);return et.reduce((rt,it)=>{const ot=tt.filter(st=>st.id===it.id);if(ot.length===0)return rt.push(it),rt;const at={...it};for(const st of ot)if(st)switch(st.type){case"select":{at.selected=st.selected;break}case"position":{typeof st.position<"u"&&(at.position=st.position),typeof st.positionAbsolute<"u"&&(at.positionAbsolute=st.positionAbsolute),typeof st.dragging<"u"&&(at.dragging=st.dragging),at.expandParent&&handleParentExpand(rt,at);break}case"dimensions":{typeof st.dimensions<"u"&&(at.width=st.dimensions.width,at.height=st.dimensions.height),typeof st.updateStyle<"u"&&(at.style={...at.style||{},...st.dimensions}),typeof st.resizing=="boolean"&&(at.resizing=st.resizing),at.expandParent&&handleParentExpand(rt,at);break}case"remove":return rt}return rt.push(at),rt},nt)}function applyNodeChanges(tt,et){return applyChanges(tt,et)}const createSelectionChange=(tt,et)=>({id:tt,type:"select",selected:et});function getSelectionChanges(tt,et){return tt.reduce((nt,rt)=>{const it=et.includes(rt.id);return!rt.selected&&it?(rt.selected=!0,nt.push(createSelectionChange(rt.id,!0))):rt.selected&&!it&&(rt.selected=!1,nt.push(createSelectionChange(rt.id,!1))),nt},[])}const wrapHandler=(tt,et)=>nt=>{nt.target===et.current&&(tt==null||tt(nt))},selector$8=tt=>({userSelectionActive:tt.userSelectionActive,elementsSelectable:tt.elementsSelectable,dragging:tt.paneDragging}),Pane=reactExports.memo(({isSelecting:tt,selectionMode:et=SelectionMode.Full,panOnDrag:nt,onSelectionStart:rt,onSelectionEnd:it,onPaneClick:ot,onPaneContextMenu:at,onPaneScroll:st,onPaneMouseEnter:lt,onPaneMouseMove:ct,onPaneMouseLeave:ut,children:ht})=>{const dt=reactExports.useRef(null),pt=useStoreApi(),mt=reactExports.useRef(0),gt=reactExports.useRef(0),yt=reactExports.useRef(),{userSelectionActive:bt,elementsSelectable:wt,dragging:xt}=useStore(selector$8,shallow$1),kt=()=>{pt.setState({userSelectionActive:!1,userSelectionRect:null}),mt.current=0,gt.current=0},St=$t=>{ot==null||ot($t),pt.getState().resetSelectedElements(),pt.setState({nodesSelectionActive:!1})},Tt=$t=>{if(Array.isArray(nt)&&(nt!=null&&nt.includes(2))){$t.preventDefault();return}at==null||at($t)},At=st?$t=>st($t):void 0,Et=$t=>{const{resetSelectedElements:vt,domNode:It}=pt.getState();if(yt.current=It==null?void 0:It.getBoundingClientRect(),!wt||!tt||$t.button!==0||$t.target!==dt.current||!yt.current)return;const{x:Ot,y:Wt}=getEventPosition($t,yt.current);vt(),pt.setState({userSelectionRect:{width:0,height:0,startX:Ot,startY:Wt,x:Ot,y:Wt}}),rt==null||rt($t)},Ct=$t=>{const{userSelectionRect:vt,nodeInternals:It,edges:Ot,transform:Wt,onNodesChange:zt,onEdgesChange:Ft,nodeOrigin:Nt,getNodes:Ut}=pt.getState();if(!tt||!yt.current||!vt)return;pt.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Pt=getEventPosition($t,yt.current),Ht=vt.startX??0,Qt=vt.startY??0,an={...vt,x:Pt.xwn.id),dn=nn.map(wn=>wn.id);if(mt.current!==dn.length){mt.current=dn.length;const wn=getSelectionChanges(Yt,dn);wn.length&&(zt==null||zt(wn))}if(gt.current!==tn.length){gt.current=tn.length;const wn=getSelectionChanges(Ot,tn);wn.length&&(Ft==null||Ft(wn))}pt.setState({userSelectionRect:an})},Lt=$t=>{if($t.button!==0)return;const{userSelectionRect:vt}=pt.getState();!bt&&vt&&$t.target===dt.current&&(St==null||St($t)),pt.setState({nodesSelectionActive:mt.current>0}),kt(),it==null||it($t)},jt=$t=>{bt&&(pt.setState({nodesSelectionActive:mt.current>0}),it==null||it($t)),kt()},Rt=wt&&(tt||bt);return React$1.createElement("div",{className:cc(["react-flow__pane",{dragging:xt,selection:tt}]),onClick:Rt?void 0:wrapHandler(St,dt),onContextMenu:wrapHandler(Tt,dt),onWheel:wrapHandler(At,dt),onMouseEnter:Rt?void 0:lt,onMouseDown:Rt?Et:void 0,onMouseMove:Rt?Ct:ct,onMouseUp:Rt?Lt:void 0,onMouseLeave:Rt?jt:ut,ref:dt,style:containerStyle},ht,React$1.createElement(UserSelection,null))});Pane.displayName="Pane";function isParentSelected(tt,et){if(!tt.parentNode)return!1;const nt=et.get(tt.parentNode);return nt?nt.selected?!0:isParentSelected(nt,et):!1}function hasSelector(tt,et,nt){let rt=tt;do{if(rt!=null&&rt.matches(et))return!0;if(rt===nt.current)return!1;rt=rt.parentElement}while(rt);return!1}function getDragItems(tt,et,nt,rt){return Array.from(tt.values()).filter(it=>(it.selected||it.id===rt)&&(!it.parentNode||!isParentSelected(it,tt))&&(it.draggable||et&&typeof it.draggable>"u")).map(it=>{var ot,at;return{id:it.id,position:it.position||{x:0,y:0},positionAbsolute:it.positionAbsolute||{x:0,y:0},distance:{x:nt.x-(((ot=it.positionAbsolute)==null?void 0:ot.x)??0),y:nt.y-(((at=it.positionAbsolute)==null?void 0:at.y)??0)},delta:{x:0,y:0},extent:it.extent,parentNode:it.parentNode,width:it.width,height:it.height,expandParent:it.expandParent}})}function clampNodeExtent(tt,et){return!et||et==="parent"?et:[et[0],[et[1][0]-(tt.width||0),et[1][1]-(tt.height||0)]]}function calcNextPosition(tt,et,nt,rt,it=[0,0],ot){const at=clampNodeExtent(tt,tt.extent||rt);let st=at;if(tt.extent==="parent"&&!tt.expandParent)if(tt.parentNode&&tt.width&&tt.height){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,it).positionAbsolute;st=ut&&isNumeric(ht)&&isNumeric(dt)&&isNumeric(ut.width)&&isNumeric(ut.height)?[[ht+tt.width*it[0],dt+tt.height*it[1]],[ht+ut.width-tt.width+tt.width*it[0],dt+ut.height-tt.height+tt.height*it[1]]]:st}else ot==null||ot("005",errorMessages.error005()),st=at;else if(tt.extent&&tt.parentNode&&tt.extent!=="parent"){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,it).positionAbsolute;st=[[tt.extent[0][0]+ht,tt.extent[0][1]+dt],[tt.extent[1][0]+ht,tt.extent[1][1]+dt]]}let lt={x:0,y:0};if(tt.parentNode){const ut=nt.get(tt.parentNode);lt=getNodePositionWithOrigin(ut,it).positionAbsolute}const ct=st&&st!=="parent"?clampPosition(et,st):et;return{position:{x:ct.x-lt.x,y:ct.y-lt.y},positionAbsolute:ct}}function getEventHandlerParams({nodeId:tt,dragItems:et,nodeInternals:nt}){const rt=et.map(it=>({...nt.get(it.id),position:it.position,positionAbsolute:it.positionAbsolute}));return[tt?rt.find(it=>it.id===tt):rt[0],rt]}const getHandleBounds=(tt,et,nt,rt)=>{const it=et.querySelectorAll(tt);if(!it||!it.length)return null;const ot=Array.from(it),at=et.getBoundingClientRect(),st={x:at.width*rt[0],y:at.height*rt[1]};return ot.map(lt=>{const ct=lt.getBoundingClientRect();return{id:lt.getAttribute("data-handleid"),position:lt.getAttribute("data-handlepos"),x:(ct.left-at.left-st.x)/nt,y:(ct.top-at.top-st.y)/nt,...getDimensions(lt)}})};function getMouseHandler(tt,et,nt){return nt===void 0?nt:rt=>{const it=et().nodeInternals.get(tt);it&&nt(rt,{...it})}}function handleNodeClick({id:tt,store:et,unselect:nt=!1,nodeRef:rt}){const{addSelectedNodes:it,unselectNodesAndEdges:ot,multiSelectionActive:at,nodeInternals:st,onError:lt}=et.getState(),ct=st.get(tt);if(!ct){lt==null||lt("012",errorMessages.error012(tt));return}et.setState({nodesSelectionActive:!1}),ct.selected?(nt||ct.selected&&at)&&(ot({nodes:[ct],edges:[]}),requestAnimationFrame(()=>{var ut;return(ut=rt==null?void 0:rt.current)==null?void 0:ut.blur()})):it([tt])}function useGetPointerPosition(){const tt=useStoreApi();return reactExports.useCallback(({sourceEvent:nt})=>{const{transform:rt,snapGrid:it,snapToGrid:ot}=tt.getState(),at=nt.touches?nt.touches[0].clientX:nt.clientX,st=nt.touches?nt.touches[0].clientY:nt.clientY,lt={x:(at-rt[0])/rt[2],y:(st-rt[1])/rt[2]};return{xSnapped:ot?it[0]*Math.round(lt.x/it[0]):lt.x,ySnapped:ot?it[1]*Math.round(lt.y/it[1]):lt.y,...lt}},[])}function wrapSelectionDragFunc(tt){return(et,nt,rt)=>tt==null?void 0:tt(et,rt)}function useDrag({nodeRef:tt,disabled:et=!1,noDragClassName:nt,handleSelector:rt,nodeId:it,isSelectable:ot,selectNodesOnDrag:at}){const st=useStoreApi(),[lt,ct]=reactExports.useState(!1),ut=reactExports.useRef([]),ht=reactExports.useRef({x:null,y:null}),dt=reactExports.useRef(0),pt=reactExports.useRef(null),mt=reactExports.useRef({x:0,y:0}),gt=reactExports.useRef(null),yt=reactExports.useRef(!1),bt=reactExports.useRef(!1),wt=useGetPointerPosition();return reactExports.useEffect(()=>{if(tt!=null&&tt.current){const xt=select(tt.current),kt=({x:At,y:Et})=>{const{nodeInternals:Ct,onNodeDrag:Lt,onSelectionDrag:jt,updateNodePositions:Rt,nodeExtent:$t,snapGrid:vt,snapToGrid:It,nodeOrigin:Ot,onError:Wt}=st.getState();ht.current={x:At,y:Et};let zt=!1,Ft={x:0,y:0,x2:0,y2:0};if(ut.current.length>1&&$t){const Ut=getRectOfNodes(ut.current,Ot);Ft=rectToBox(Ut)}if(ut.current=ut.current.map(Ut=>{const Pt={x:At-Ut.distance.x,y:Et-Ut.distance.y};It&&(Pt.x=vt[0]*Math.round(Pt.x/vt[0]),Pt.y=vt[1]*Math.round(Pt.y/vt[1]));const Ht=[[$t[0][0],$t[0][1]],[$t[1][0],$t[1][1]]];ut.current.length>1&&$t&&!Ut.extent&&(Ht[0][0]=Ut.positionAbsolute.x-Ft.x+$t[0][0],Ht[1][0]=Ut.positionAbsolute.x+(Ut.width??0)-Ft.x2+$t[1][0],Ht[0][1]=Ut.positionAbsolute.y-Ft.y+$t[0][1],Ht[1][1]=Ut.positionAbsolute.y+(Ut.height??0)-Ft.y2+$t[1][1]);const Qt=calcNextPosition(Ut,Pt,Ct,Ht,Ot,Wt);return zt=zt||Ut.position.x!==Qt.position.x||Ut.position.y!==Qt.position.y,Ut.position=Qt.position,Ut.positionAbsolute=Qt.positionAbsolute,Ut}),!zt)return;Rt(ut.current,!0,!0),ct(!0);const Nt=it?Lt:wrapSelectionDragFunc(jt);if(Nt&>.current){const[Ut,Pt]=getEventHandlerParams({nodeId:it,dragItems:ut.current,nodeInternals:Ct});Nt(gt.current,Ut,Pt)}},St=()=>{if(!pt.current)return;const[At,Et]=calcAutoPan(mt.current,pt.current);if(At!==0||Et!==0){const{transform:Ct,panBy:Lt}=st.getState();ht.current.x=(ht.current.x??0)-At/Ct[2],ht.current.y=(ht.current.y??0)-Et/Ct[2],Lt({x:At,y:Et})&&kt(ht.current)}dt.current=requestAnimationFrame(St)},Tt=At=>{var Ot;const{nodeInternals:Et,multiSelectionActive:Ct,nodesDraggable:Lt,unselectNodesAndEdges:jt,onNodeDragStart:Rt,onSelectionDragStart:$t}=st.getState();bt.current=!0;const vt=it?Rt:wrapSelectionDragFunc($t);(!at||!ot)&&!Ct&&it&&((Ot=Et.get(it))!=null&&Ot.selected||jt()),it&&ot&&at&&handleNodeClick({id:it,store:st,nodeRef:tt});const It=wt(At);if(ht.current=It,ut.current=getDragItems(Et,Lt,It,it),vt&&ut.current){const[Wt,zt]=getEventHandlerParams({nodeId:it,dragItems:ut.current,nodeInternals:Et});vt(At.sourceEvent,Wt,zt)}};if(et)xt.on(".drag",null);else{const At=drag().on("start",Et=>{const{domNode:Ct,nodeDragThreshold:Lt}=st.getState();Lt===0&&Tt(Et);const jt=wt(Et);ht.current=jt,pt.current=(Ct==null?void 0:Ct.getBoundingClientRect())||null,mt.current=getEventPosition(Et.sourceEvent,pt.current)}).on("drag",Et=>{var Rt,$t;const Ct=wt(Et),{autoPanOnNodeDrag:Lt,nodeDragThreshold:jt}=st.getState();if(!yt.current&&bt.current&&Lt&&(yt.current=!0,St()),!bt.current){const vt=Ct.xSnapped-(((Rt=ht==null?void 0:ht.current)==null?void 0:Rt.x)??0),It=Ct.ySnapped-((($t=ht==null?void 0:ht.current)==null?void 0:$t.y)??0);Math.sqrt(vt*vt+It*It)>jt&&Tt(Et)}(ht.current.x!==Ct.xSnapped||ht.current.y!==Ct.ySnapped)&&ut.current&&bt.current&&(gt.current=Et.sourceEvent,mt.current=getEventPosition(Et.sourceEvent,pt.current),kt(Ct))}).on("end",Et=>{if(bt.current&&(ct(!1),yt.current=!1,bt.current=!1,cancelAnimationFrame(dt.current),ut.current)){const{updateNodePositions:Ct,nodeInternals:Lt,onNodeDragStop:jt,onSelectionDragStop:Rt}=st.getState(),$t=it?jt:wrapSelectionDragFunc(Rt);if(Ct(ut.current,!1,!1),$t){const[vt,It]=getEventHandlerParams({nodeId:it,dragItems:ut.current,nodeInternals:Lt});$t(Et.sourceEvent,vt,It)}}}).filter(Et=>{const Ct=Et.target;return!Et.button&&(!nt||!hasSelector(Ct,`.${nt}`,tt))&&(!rt||hasSelector(Ct,rt,tt))});return xt.call(At),()=>{xt.on(".drag",null)}}}},[tt,et,nt,rt,ot,st,it,at,wt]),lt}function useUpdateNodePositions(){const tt=useStoreApi();return reactExports.useCallback(nt=>{const{nodeInternals:rt,nodeExtent:it,updateNodePositions:ot,getNodes:at,snapToGrid:st,snapGrid:lt,onError:ct,nodesDraggable:ut}=tt.getState(),ht=at().filter(wt=>wt.selected&&(wt.draggable||ut&&typeof wt.draggable>"u")),dt=st?lt[0]:5,pt=st?lt[1]:5,mt=nt.isShiftPressed?4:1,gt=nt.x*dt*mt,yt=nt.y*pt*mt,bt=ht.map(wt=>{if(wt.positionAbsolute){const xt={x:wt.positionAbsolute.x+gt,y:wt.positionAbsolute.y+yt};st&&(xt.x=lt[0]*Math.round(xt.x/lt[0]),xt.y=lt[1]*Math.round(xt.y/lt[1]));const{positionAbsolute:kt,position:St}=calcNextPosition(wt,xt,rt,it,void 0,ct);wt.position=St,wt.positionAbsolute=kt}return wt});ot(bt,!0,!1)},[])}const arrowKeyDiffs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var wrapNode=tt=>{const et=({id:nt,type:rt,data:it,xPos:ot,yPos:at,xPosOrigin:st,yPosOrigin:lt,selected:ct,onClick:ut,onMouseEnter:ht,onMouseMove:dt,onMouseLeave:pt,onContextMenu:mt,onDoubleClick:gt,style:yt,className:bt,isDraggable:wt,isSelectable:xt,isConnectable:kt,isFocusable:St,selectNodesOnDrag:Tt,sourcePosition:At,targetPosition:Et,hidden:Ct,resizeObserver:Lt,dragHandle:jt,zIndex:Rt,isParent:$t,noDragClassName:vt,noPanClassName:It,initialized:Ot,disableKeyboardA11y:Wt,ariaLabel:zt,rfId:Ft})=>{const Nt=useStoreApi(),Ut=reactExports.useRef(null),Pt=reactExports.useRef(At),Ht=reactExports.useRef(Et),Qt=reactExports.useRef(rt),an=xt||wt||ut||ht||dt||pt,Yt=useUpdateNodePositions(),nn=getMouseHandler(nt,Nt.getState,ht),tn=getMouseHandler(nt,Nt.getState,dt),dn=getMouseHandler(nt,Nt.getState,pt),wn=getMouseHandler(nt,Nt.getState,mt),rn=getMouseHandler(nt,Nt.getState,gt),Zt=$n=>{const{nodeDragThreshold:Nn}=Nt.getState();if(xt&&(!Tt||!wt||Nn>0)&&handleNodeClick({id:nt,store:Nt,nodeRef:Ut}),ut){const En=Nt.getState().nodeInternals.get(nt);En&&ut($n,{...En})}},vn=$n=>{if(!isInputDOMNode($n))if(elementSelectionKeys.includes($n.key)&&xt){const Nn=$n.key==="Escape";handleNodeClick({id:nt,store:Nt,unselect:Nn,nodeRef:Ut})}else!Wt&&wt&&ct&&Object.prototype.hasOwnProperty.call(arrowKeyDiffs,$n.key)&&(Nt.setState({ariaLiveMessage:`Moved selected node ${$n.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~ot}, y: ${~~at}`}),Yt({x:arrowKeyDiffs[$n.key].x,y:arrowKeyDiffs[$n.key].y,isShiftPressed:$n.shiftKey}))};reactExports.useEffect(()=>{if(Ut.current&&!Ct){const $n=Ut.current;return Lt==null||Lt.observe($n),()=>Lt==null?void 0:Lt.unobserve($n)}},[Ct]),reactExports.useEffect(()=>{const $n=Qt.current!==rt,Nn=Pt.current!==At,En=Ht.current!==Et;Ut.current&&($n||Nn||En)&&($n&&(Qt.current=rt),Nn&&(Pt.current=At),En&&(Ht.current=Et),Nt.getState().updateNodeDimensions([{id:nt,nodeElement:Ut.current,forceUpdate:!0}]))},[nt,rt,At,Et]);const Cn=useDrag({nodeRef:Ut,disabled:Ct||!wt,noDragClassName:vt,handleSelector:jt,nodeId:nt,isSelectable:xt,selectNodesOnDrag:Tt});return Ct?null:React$1.createElement("div",{className:cc(["react-flow__node",`react-flow__node-${rt}`,{[It]:wt},bt,{selected:ct,selectable:xt,parent:$t,dragging:Cn}]),ref:Ut,style:{zIndex:Rt,transform:`translate(${st}px,${lt}px)`,pointerEvents:an?"all":"none",visibility:Ot?"visible":"hidden",...yt},"data-id":nt,"data-testid":`rf__node-${nt}`,onMouseEnter:nn,onMouseMove:tn,onMouseLeave:dn,onContextMenu:wn,onClick:Zt,onDoubleClick:rn,onKeyDown:St?vn:void 0,tabIndex:St?0:void 0,role:St?"button":void 0,"aria-describedby":Wt?void 0:`${ARIA_NODE_DESC_KEY}-${Ft}`,"aria-label":zt},React$1.createElement(Provider,{value:nt},React$1.createElement(tt,{id:nt,data:it,type:rt,xPos:ot,yPos:at,selected:ct,isConnectable:kt,sourcePosition:At,targetPosition:Et,dragging:Cn,dragHandle:jt,zIndex:Rt})))};return et.displayName="NodeWrapper",reactExports.memo(et)};const selector$7=tt=>{const et=tt.getNodes().filter(nt=>nt.selected);return{...getRectOfNodes(et,tt.nodeOrigin),transformString:`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`,userSelectionActive:tt.userSelectionActive}};function NodesSelection({onSelectionContextMenu:tt,noPanClassName:et,disableKeyboardA11y:nt}){const rt=useStoreApi(),{width:it,height:ot,x:at,y:st,transformString:lt,userSelectionActive:ct}=useStore(selector$7,shallow$1),ut=useUpdateNodePositions(),ht=reactExports.useRef(null);if(reactExports.useEffect(()=>{var mt;nt||(mt=ht.current)==null||mt.focus({preventScroll:!0})},[nt]),useDrag({nodeRef:ht}),ct||!it||!ot)return null;const dt=tt?mt=>{const gt=rt.getState().getNodes().filter(yt=>yt.selected);tt(mt,gt)}:void 0,pt=mt=>{Object.prototype.hasOwnProperty.call(arrowKeyDiffs,mt.key)&&ut({x:arrowKeyDiffs[mt.key].x,y:arrowKeyDiffs[mt.key].y,isShiftPressed:mt.shiftKey})};return React$1.createElement("div",{className:cc(["react-flow__nodesselection","react-flow__container",et]),style:{transform:lt}},React$1.createElement("div",{ref:ht,className:"react-flow__nodesselection-rect",onContextMenu:dt,tabIndex:nt?void 0:-1,onKeyDown:nt?void 0:pt,style:{width:it,height:ot,top:st,left:at}}))}var NodesSelection$1=reactExports.memo(NodesSelection);const selector$6=tt=>tt.nodesSelectionActive,FlowRenderer=({children:tt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:rt,onPaneMouseLeave:it,onPaneContextMenu:ot,onPaneScroll:at,deleteKeyCode:st,onMove:lt,onMoveStart:ct,onMoveEnd:ut,selectionKeyCode:ht,selectionOnDrag:dt,selectionMode:pt,onSelectionStart:mt,onSelectionEnd:gt,multiSelectionKeyCode:yt,panActivationKeyCode:bt,zoomActivationKeyCode:wt,elementsSelectable:xt,zoomOnScroll:kt,zoomOnPinch:St,panOnScroll:Tt,panOnScrollSpeed:At,panOnScrollMode:Et,zoomOnDoubleClick:Ct,panOnDrag:Lt,defaultViewport:jt,translateExtent:Rt,minZoom:$t,maxZoom:vt,preventScrolling:It,onSelectionContextMenu:Ot,noWheelClassName:Wt,noPanClassName:zt,disableKeyboardA11y:Ft})=>{const Nt=useStore(selector$6),Ut=useKeyPress(ht),Ht=useKeyPress(bt)||Lt,Qt=Ut||dt&&Ht!==!0;return useGlobalKeyHandler({deleteKeyCode:st,multiSelectionKeyCode:yt}),React$1.createElement(ZoomPane,{onMove:lt,onMoveStart:ct,onMoveEnd:ut,onPaneContextMenu:ot,elementsSelectable:xt,zoomOnScroll:kt,zoomOnPinch:St,panOnScroll:Tt,panOnScrollSpeed:At,panOnScrollMode:Et,zoomOnDoubleClick:Ct,panOnDrag:!Ut&&Ht,defaultViewport:jt,translateExtent:Rt,minZoom:$t,maxZoom:vt,zoomActivationKeyCode:wt,preventScrolling:It,noWheelClassName:Wt,noPanClassName:zt},React$1.createElement(Pane,{onSelectionStart:mt,onSelectionEnd:gt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:rt,onPaneMouseLeave:it,onPaneContextMenu:ot,onPaneScroll:at,panOnDrag:Ht,isSelecting:!!Qt,selectionMode:pt},tt,Nt&&React$1.createElement(NodesSelection$1,{onSelectionContextMenu:Ot,noPanClassName:zt,disableKeyboardA11y:Ft})))};FlowRenderer.displayName="FlowRenderer";var FlowRenderer$1=reactExports.memo(FlowRenderer);function useVisibleNodes(tt){return useStore(reactExports.useCallback(nt=>tt?getNodesInside(nt.nodeInternals,{x:0,y:0,width:nt.width,height:nt.height},nt.transform,!0):nt.getNodes(),[tt]))}function createNodeTypes(tt){const et={input:wrapNode(tt.input||InputNode$1),default:wrapNode(tt.default||DefaultNode$1),output:wrapNode(tt.output||OutputNode$1),group:wrapNode(tt.group||GroupNode)},nt={},rt=Object.keys(tt).filter(it=>!["input","default","output","group"].includes(it)).reduce((it,ot)=>(it[ot]=wrapNode(tt[ot]||DefaultNode$1),it),nt);return{...et,...rt}}const getPositionWithOrigin=({x:tt,y:et,width:nt,height:rt,origin:it})=>!nt||!rt?{x:tt,y:et}:it[0]<0||it[1]<0||it[0]>1||it[1]>1?{x:tt,y:et}:{x:tt-nt*it[0],y:et-rt*it[1]},selector$5=tt=>({nodesDraggable:tt.nodesDraggable,nodesConnectable:tt.nodesConnectable,nodesFocusable:tt.nodesFocusable,elementsSelectable:tt.elementsSelectable,updateNodeDimensions:tt.updateNodeDimensions,onError:tt.onError}),NodeRenderer=tt=>{const{nodesDraggable:et,nodesConnectable:nt,nodesFocusable:rt,elementsSelectable:it,updateNodeDimensions:ot,onError:at}=useStore(selector$5,shallow$1),st=useVisibleNodes(tt.onlyRenderVisibleElements),lt=reactExports.useRef(),ct=reactExports.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const ut=new ResizeObserver(ht=>{const dt=ht.map(pt=>({id:pt.target.getAttribute("data-id"),nodeElement:pt.target,forceUpdate:!0}));ot(dt)});return lt.current=ut,ut},[]);return reactExports.useEffect(()=>()=>{var ut;(ut=lt==null?void 0:lt.current)==null||ut.disconnect()},[]),React$1.createElement("div",{className:"react-flow__nodes",style:containerStyle},st.map(ut=>{var St,Tt;let ht=ut.type||"default";tt.nodeTypes[ht]||(at==null||at("003",errorMessages.error003(ht)),ht="default");const dt=tt.nodeTypes[ht]||tt.nodeTypes.default,pt=!!(ut.draggable||et&&typeof ut.draggable>"u"),mt=!!(ut.selectable||it&&typeof ut.selectable>"u"),gt=!!(ut.connectable||nt&&typeof ut.connectable>"u"),yt=!!(ut.focusable||rt&&typeof ut.focusable>"u"),bt=tt.nodeExtent?clampPosition(ut.positionAbsolute,tt.nodeExtent):ut.positionAbsolute,wt=(bt==null?void 0:bt.x)??0,xt=(bt==null?void 0:bt.y)??0,kt=getPositionWithOrigin({x:wt,y:xt,width:ut.width??0,height:ut.height??0,origin:tt.nodeOrigin});return React$1.createElement(dt,{key:ut.id,id:ut.id,className:ut.className,style:ut.style,type:ht,data:ut.data,sourcePosition:ut.sourcePosition||Position.Bottom,targetPosition:ut.targetPosition||Position.Top,hidden:ut.hidden,xPos:wt,yPos:xt,xPosOrigin:kt.x,yPosOrigin:kt.y,selectNodesOnDrag:tt.selectNodesOnDrag,onClick:tt.onNodeClick,onMouseEnter:tt.onNodeMouseEnter,onMouseMove:tt.onNodeMouseMove,onMouseLeave:tt.onNodeMouseLeave,onContextMenu:tt.onNodeContextMenu,onDoubleClick:tt.onNodeDoubleClick,selected:!!ut.selected,isDraggable:pt,isSelectable:mt,isConnectable:gt,isFocusable:yt,resizeObserver:ct,dragHandle:ut.dragHandle,zIndex:((St=ut[internalsSymbol])==null?void 0:St.z)??0,isParent:!!((Tt=ut[internalsSymbol])!=null&&Tt.isParent),noDragClassName:tt.noDragClassName,noPanClassName:tt.noPanClassName,initialized:!!ut.width&&!!ut.height,rfId:tt.rfId,disableKeyboardA11y:tt.disableKeyboardA11y,ariaLabel:ut.ariaLabel})}))};NodeRenderer.displayName="NodeRenderer";var NodeRenderer$1=reactExports.memo(NodeRenderer);const shiftX=(tt,et,nt)=>nt===Position.Left?tt-et:nt===Position.Right?tt+et:tt,shiftY=(tt,et,nt)=>nt===Position.Top?tt-et:nt===Position.Bottom?tt+et:tt,EdgeUpdaterClassName="react-flow__edgeupdater",EdgeAnchor=({position:tt,centerX:et,centerY:nt,radius:rt=10,onMouseDown:it,onMouseEnter:ot,onMouseOut:at,type:st})=>React$1.createElement("circle",{onMouseDown:it,onMouseEnter:ot,onMouseOut:at,className:cc([EdgeUpdaterClassName,`${EdgeUpdaterClassName}-${st}`]),cx:shiftX(et,rt,tt),cy:shiftY(nt,rt,tt),r:rt,stroke:"transparent",fill:"transparent"}),alwaysValidConnection=()=>!0;var wrapEdge=tt=>{const et=({id:nt,className:rt,type:it,data:ot,onClick:at,onEdgeDoubleClick:st,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,style:yt,source:bt,target:wt,sourceX:xt,sourceY:kt,targetX:St,targetY:Tt,sourcePosition:At,targetPosition:Et,elementsSelectable:Ct,hidden:Lt,sourceHandleId:jt,targetHandleId:Rt,onContextMenu:$t,onMouseEnter:vt,onMouseMove:It,onMouseLeave:Ot,edgeUpdaterRadius:Wt,onEdgeUpdate:zt,onEdgeUpdateStart:Ft,onEdgeUpdateEnd:Nt,markerEnd:Ut,markerStart:Pt,rfId:Ht,ariaLabel:Qt,isFocusable:an,isUpdatable:Yt,pathOptions:nn,interactionWidth:tn})=>{const dn=reactExports.useRef(null),[wn,rn]=reactExports.useState(!1),[Zt,vn]=reactExports.useState(!1),Cn=useStoreApi(),$n=reactExports.useMemo(()=>`url(#${getMarkerId(Pt,Ht)})`,[Pt,Ht]),Nn=reactExports.useMemo(()=>`url(#${getMarkerId(Ut,Ht)})`,[Ut,Ht]);if(Lt)return null;const En=kn=>{var Gn;const{edges:Mn,addSelectedEdges:On,unselectNodesAndEdges:Bn,multiSelectionActive:Xn}=Cn.getState(),Vn=Mn.find(zn=>zn.id===nt);Vn&&(Ct&&(Cn.setState({nodesSelectionActive:!1}),Vn.selected&&Xn?(Bn({nodes:[],edges:[Vn]}),(Gn=dn.current)==null||Gn.blur()):On([nt])),at&&at(kn,Vn))},sn=getMouseHandler$1(nt,Cn.getState,st),pn=getMouseHandler$1(nt,Cn.getState,$t),Tn=getMouseHandler$1(nt,Cn.getState,vt),In=getMouseHandler$1(nt,Cn.getState,It),yn=getMouseHandler$1(nt,Cn.getState,Ot),hn=(kn,Mn)=>{if(kn.button!==0)return;const{edges:On,isValidConnection:Bn}=Cn.getState(),Xn=Mn?wt:bt,Vn=(Mn?Rt:jt)||null,Gn=Mn?"target":"source",zn=Bn||alwaysValidConnection,Jn=Mn,Wn=On.find(wr=>wr.id===nt);vn(!0),Ft==null||Ft(kn,Wn,Gn);const fr=wr=>{vn(!1),Nt==null||Nt(wr,Wn,Gn)};handlePointerDown({event:kn,handleId:Vn,nodeId:Xn,onConnect:wr=>zt==null?void 0:zt(Wn,wr),isTarget:Jn,getState:Cn.getState,setState:Cn.setState,isValidConnection:zn,edgeUpdaterType:Gn,onEdgeUpdateEnd:fr})},fn=kn=>hn(kn,!0),xn=kn=>hn(kn,!1),jn=()=>rn(!0),cn=()=>rn(!1),Xt=!Ct&&!at,Kt=kn=>{var Mn;if(elementSelectionKeys.includes(kn.key)&&Ct){const{unselectNodesAndEdges:On,addSelectedEdges:Bn,edges:Xn}=Cn.getState();kn.key==="Escape"?((Mn=dn.current)==null||Mn.blur(),On({edges:[Xn.find(Gn=>Gn.id===nt)]})):Bn([nt])}};return React$1.createElement("g",{className:cc(["react-flow__edge",`react-flow__edge-${it}`,rt,{selected:lt,animated:ct,inactive:Xt,updating:wn}]),onClick:En,onDoubleClick:sn,onContextMenu:pn,onMouseEnter:Tn,onMouseMove:In,onMouseLeave:yn,onKeyDown:an?Kt:void 0,tabIndex:an?0:void 0,role:an?"button":"img","data-testid":`rf__edge-${nt}`,"aria-label":Qt===null?void 0:Qt||`Edge from ${bt} to ${wt}`,"aria-describedby":an?`${ARIA_EDGE_DESC_KEY}-${Ht}`:void 0,ref:dn},!Zt&&React$1.createElement(tt,{id:nt,source:bt,target:wt,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,data:ot,style:yt,sourceX:xt,sourceY:kt,targetX:St,targetY:Tt,sourcePosition:At,targetPosition:Et,sourceHandleId:jt,targetHandleId:Rt,markerStart:$n,markerEnd:Nn,pathOptions:nn,interactionWidth:tn}),Yt&&React$1.createElement(React$1.Fragment,null,(Yt==="source"||Yt===!0)&&React$1.createElement(EdgeAnchor,{position:At,centerX:xt,centerY:kt,radius:Wt,onMouseDown:fn,onMouseEnter:jn,onMouseOut:cn,type:"source"}),(Yt==="target"||Yt===!0)&&React$1.createElement(EdgeAnchor,{position:Et,centerX:St,centerY:Tt,radius:Wt,onMouseDown:xn,onMouseEnter:jn,onMouseOut:cn,type:"target"})))};return et.displayName="EdgeWrapper",reactExports.memo(et)};function createEdgeTypes(tt){const et={default:wrapEdge(tt.default||BezierEdge),straight:wrapEdge(tt.bezier||StraightEdge),step:wrapEdge(tt.step||StepEdge),smoothstep:wrapEdge(tt.step||SmoothStepEdge),simplebezier:wrapEdge(tt.simplebezier||SimpleBezierEdge)},nt={},rt=Object.keys(tt).filter(it=>!["default","bezier"].includes(it)).reduce((it,ot)=>(it[ot]=wrapEdge(tt[ot]||BezierEdge),it),nt);return{...et,...rt}}function getHandlePosition(tt,et,nt=null){const rt=((nt==null?void 0:nt.x)||0)+et.x,it=((nt==null?void 0:nt.y)||0)+et.y,ot=(nt==null?void 0:nt.width)||et.width,at=(nt==null?void 0:nt.height)||et.height;switch(tt){case Position.Top:return{x:rt+ot/2,y:it};case Position.Right:return{x:rt+ot,y:it+at/2};case Position.Bottom:return{x:rt+ot/2,y:it+at};case Position.Left:return{x:rt,y:it+at/2}}}function getHandle(tt,et){return tt?tt.length===1||!et?tt[0]:et&&tt.find(nt=>nt.id===et)||null:null}const getEdgePositions=(tt,et,nt,rt,it,ot)=>{const at=getHandlePosition(nt,tt,et),st=getHandlePosition(ot,rt,it);return{sourceX:at.x,sourceY:at.y,targetX:st.x,targetY:st.y}};function isEdgeVisible({sourcePos:tt,targetPos:et,sourceWidth:nt,sourceHeight:rt,targetWidth:it,targetHeight:ot,width:at,height:st,transform:lt}){const ct={x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x+nt,et.x+it),y2:Math.max(tt.y+rt,et.y+ot)};ct.x===ct.x2&&(ct.x2+=1),ct.y===ct.y2&&(ct.y2+=1);const ut=rectToBox({x:(0-lt[0])/lt[2],y:(0-lt[1])/lt[2],width:at/lt[2],height:st/lt[2]}),ht=Math.max(0,Math.min(ut.x2,ct.x2)-Math.max(ut.x,ct.x)),dt=Math.max(0,Math.min(ut.y2,ct.y2)-Math.max(ut.y,ct.y));return Math.ceil(ht*dt)>0}function getNodeData(tt){var rt,it,ot,at,st;const et=((rt=tt==null?void 0:tt[internalsSymbol])==null?void 0:rt.handleBounds)||null,nt=et&&(tt==null?void 0:tt.width)&&(tt==null?void 0:tt.height)&&typeof((it=tt==null?void 0:tt.positionAbsolute)==null?void 0:it.x)<"u"&&typeof((ot=tt==null?void 0:tt.positionAbsolute)==null?void 0:ot.y)<"u";return[{x:((at=tt==null?void 0:tt.positionAbsolute)==null?void 0:at.x)||0,y:((st=tt==null?void 0:tt.positionAbsolute)==null?void 0:st.y)||0,width:(tt==null?void 0:tt.width)||0,height:(tt==null?void 0:tt.height)||0},et,!!nt]}const defaultEdgeTree=[{level:0,isMaxLevel:!0,edges:[]}];function groupEdgesByZLevel(tt,et,nt=!1){let rt=-1;const it=tt.reduce((at,st)=>{var ut,ht;const lt=isNumeric(st.zIndex);let ct=lt?st.zIndex:0;if(nt){const dt=et.get(st.target),pt=et.get(st.source),mt=st.selected||(dt==null?void 0:dt.selected)||(pt==null?void 0:pt.selected),gt=Math.max(((ut=pt==null?void 0:pt[internalsSymbol])==null?void 0:ut.z)||0,((ht=dt==null?void 0:dt[internalsSymbol])==null?void 0:ht.z)||0,1e3);ct=(lt?st.zIndex:0)+(mt?gt:0)}return at[ct]?at[ct].push(st):at[ct]=[st],rt=ct>rt?ct:rt,at},{}),ot=Object.entries(it).map(([at,st])=>{const lt=+at;return{edges:st,level:lt,isMaxLevel:lt===rt}});return ot.length===0?defaultEdgeTree:ot}function useVisibleEdges(tt,et,nt){const rt=useStore(reactExports.useCallback(it=>tt?it.edges.filter(ot=>{const at=et.get(ot.source),st=et.get(ot.target);return(at==null?void 0:at.width)&&(at==null?void 0:at.height)&&(st==null?void 0:st.width)&&(st==null?void 0:st.height)&&isEdgeVisible({sourcePos:at.positionAbsolute||{x:0,y:0},targetPos:st.positionAbsolute||{x:0,y:0},sourceWidth:at.width,sourceHeight:at.height,targetWidth:st.width,targetHeight:st.height,width:it.width,height:it.height,transform:it.transform})}):it.edges,[tt,et]));return groupEdgesByZLevel(rt,et,nt)}const ArrowSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),ArrowClosedSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,fill:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),MarkerSymbols={[MarkerType.Arrow]:ArrowSymbol,[MarkerType.ArrowClosed]:ArrowClosedSymbol};function useMarkerSymbol(tt){const et=useStoreApi();return reactExports.useMemo(()=>{var it,ot;return Object.prototype.hasOwnProperty.call(MarkerSymbols,tt)?MarkerSymbols[tt]:((ot=(it=et.getState()).onError)==null||ot.call(it,"009",errorMessages.error009(tt)),null)},[tt])}const Marker=({id:tt,type:et,color:nt,width:rt=12.5,height:it=12.5,markerUnits:ot="strokeWidth",strokeWidth:at,orient:st="auto-start-reverse"})=>{const lt=useMarkerSymbol(et);return lt?React$1.createElement("marker",{className:"react-flow__arrowhead",id:tt,markerWidth:`${rt}`,markerHeight:`${it}`,viewBox:"-10 -10 20 20",markerUnits:ot,orient:st,refX:"0",refY:"0"},React$1.createElement(lt,{color:nt,strokeWidth:at})):null},markerSelector=({defaultColor:tt,rfId:et})=>nt=>{const rt=[];return nt.edges.reduce((it,ot)=>([ot.markerStart,ot.markerEnd].forEach(at=>{if(at&&typeof at=="object"){const st=getMarkerId(at,et);rt.includes(st)||(it.push({id:st,color:at.color||tt,...at}),rt.push(st))}}),it),[]).sort((it,ot)=>it.id.localeCompare(ot.id))},MarkerDefinitions=({defaultColor:tt,rfId:et})=>{const nt=useStore(reactExports.useCallback(markerSelector({defaultColor:tt,rfId:et}),[tt,et]),(rt,it)=>!(rt.length!==it.length||rt.some((ot,at)=>ot.id!==it[at].id)));return React$1.createElement("defs",null,nt.map(rt=>React$1.createElement(Marker,{id:rt.id,key:rt.id,type:rt.type,color:rt.color,width:rt.width,height:rt.height,markerUnits:rt.markerUnits,strokeWidth:rt.strokeWidth,orient:rt.orient})))};MarkerDefinitions.displayName="MarkerDefinitions";var MarkerDefinitions$1=reactExports.memo(MarkerDefinitions);const selector$4=tt=>({nodesConnectable:tt.nodesConnectable,edgesFocusable:tt.edgesFocusable,edgesUpdatable:tt.edgesUpdatable,elementsSelectable:tt.elementsSelectable,width:tt.width,height:tt.height,connectionMode:tt.connectionMode,nodeInternals:tt.nodeInternals,onError:tt.onError}),EdgeRenderer=({defaultMarkerColor:tt,onlyRenderVisibleElements:et,elevateEdgesOnSelect:nt,rfId:rt,edgeTypes:it,noPanClassName:ot,onEdgeUpdate:at,onEdgeContextMenu:st,onEdgeMouseEnter:lt,onEdgeMouseMove:ct,onEdgeMouseLeave:ut,onEdgeClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,children:yt})=>{const{edgesFocusable:bt,edgesUpdatable:wt,elementsSelectable:xt,width:kt,height:St,connectionMode:Tt,nodeInternals:At,onError:Et}=useStore(selector$4,shallow$1),Ct=useVisibleEdges(et,At,nt);return kt?React$1.createElement(React$1.Fragment,null,Ct.map(({level:Lt,edges:jt,isMaxLevel:Rt})=>React$1.createElement("svg",{key:Lt,style:{zIndex:Lt},width:kt,height:St,className:"react-flow__edges react-flow__container"},Rt&&React$1.createElement(MarkerDefinitions$1,{defaultColor:tt,rfId:rt}),React$1.createElement("g",null,jt.map($t=>{const[vt,It,Ot]=getNodeData(At.get($t.source)),[Wt,zt,Ft]=getNodeData(At.get($t.target));if(!Ot||!Ft)return null;let Nt=$t.type||"default";it[Nt]||(Et==null||Et("011",errorMessages.error011(Nt)),Nt="default");const Ut=it[Nt]||it.default,Pt=Tt===ConnectionMode.Strict?zt.target:(zt.target??[]).concat(zt.source??[]),Ht=getHandle(It.source,$t.sourceHandle),Qt=getHandle(Pt,$t.targetHandle),an=(Ht==null?void 0:Ht.position)||Position.Bottom,Yt=(Qt==null?void 0:Qt.position)||Position.Top,nn=!!($t.focusable||bt&&typeof $t.focusable>"u"),tn=typeof at<"u"&&($t.updatable||wt&&typeof $t.updatable>"u");if(!Ht||!Qt)return Et==null||Et("008",errorMessages.error008(Ht,$t)),null;const{sourceX:dn,sourceY:wn,targetX:rn,targetY:Zt}=getEdgePositions(vt,Ht,an,Wt,Qt,Yt);return React$1.createElement(Ut,{key:$t.id,id:$t.id,className:cc([$t.className,ot]),type:Nt,data:$t.data,selected:!!$t.selected,animated:!!$t.animated,hidden:!!$t.hidden,label:$t.label,labelStyle:$t.labelStyle,labelShowBg:$t.labelShowBg,labelBgStyle:$t.labelBgStyle,labelBgPadding:$t.labelBgPadding,labelBgBorderRadius:$t.labelBgBorderRadius,style:$t.style,source:$t.source,target:$t.target,sourceHandleId:$t.sourceHandle,targetHandleId:$t.targetHandle,markerEnd:$t.markerEnd,markerStart:$t.markerStart,sourceX:dn,sourceY:wn,targetX:rn,targetY:Zt,sourcePosition:an,targetPosition:Yt,elementsSelectable:xt,onEdgeUpdate:at,onContextMenu:st,onMouseEnter:lt,onMouseMove:ct,onMouseLeave:ut,onClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,rfId:rt,ariaLabel:$t.ariaLabel,isFocusable:nn,isUpdatable:tn,pathOptions:"pathOptions"in $t?$t.pathOptions:void 0,interactionWidth:$t.interactionWidth})})))),yt):null};EdgeRenderer.displayName="EdgeRenderer";var EdgeRenderer$1=reactExports.memo(EdgeRenderer);const selector$3=tt=>`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`;function Viewport({children:tt}){const et=useStore(selector$3);return React$1.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:et}},tt)}function useOnInitHandler(tt){const et=useReactFlow(),nt=reactExports.useRef(!1);reactExports.useEffect(()=>{!nt.current&&et.viewportInitialized&&tt&&(setTimeout(()=>tt(et),1),nt.current=!0)},[tt,et.viewportInitialized])}const oppositePosition={[Position.Left]:Position.Right,[Position.Right]:Position.Left,[Position.Top]:Position.Bottom,[Position.Bottom]:Position.Top},ConnectionLine=({nodeId:tt,handleType:et,style:nt,type:rt=ConnectionLineType.Bezier,CustomComponent:it,connectionStatus:ot})=>{var Tt,At,Et;const{fromNode:at,handleId:st,toX:lt,toY:ct,connectionMode:ut}=useStore(reactExports.useCallback(Ct=>({fromNode:Ct.nodeInternals.get(tt),handleId:Ct.connectionHandleId,toX:(Ct.connectionPosition.x-Ct.transform[0])/Ct.transform[2],toY:(Ct.connectionPosition.y-Ct.transform[1])/Ct.transform[2],connectionMode:Ct.connectionMode}),[tt]),shallow$1),ht=(Tt=at==null?void 0:at[internalsSymbol])==null?void 0:Tt.handleBounds;let dt=ht==null?void 0:ht[et];if(ut===ConnectionMode.Loose&&(dt=dt||(ht==null?void 0:ht[et==="source"?"target":"source"])),!at||!dt)return null;const pt=st?dt.find(Ct=>Ct.id===st):dt[0],mt=pt?pt.x+pt.width/2:(at.width??0)/2,gt=pt?pt.y+pt.height/2:at.height??0,yt=(((At=at.positionAbsolute)==null?void 0:At.x)??0)+mt,bt=(((Et=at.positionAbsolute)==null?void 0:Et.y)??0)+gt,wt=pt==null?void 0:pt.position,xt=wt?oppositePosition[wt]:null;if(!wt||!xt)return null;if(it)return React$1.createElement(it,{connectionLineType:rt,connectionLineStyle:nt,fromNode:at,fromHandle:pt,fromX:yt,fromY:bt,toX:lt,toY:ct,fromPosition:wt,toPosition:xt,connectionStatus:ot});let kt="";const St={sourceX:yt,sourceY:bt,sourcePosition:wt,targetX:lt,targetY:ct,targetPosition:xt};return rt===ConnectionLineType.Bezier?[kt]=getBezierPath(St):rt===ConnectionLineType.Step?[kt]=getSmoothStepPath({...St,borderRadius:0}):rt===ConnectionLineType.SmoothStep?[kt]=getSmoothStepPath(St):rt===ConnectionLineType.SimpleBezier?[kt]=getSimpleBezierPath(St):kt=`M${yt},${bt} ${lt},${ct}`,React$1.createElement("path",{d:kt,fill:"none",className:"react-flow__connection-path",style:nt})};ConnectionLine.displayName="ConnectionLine";const selector$2=tt=>({nodeId:tt.connectionNodeId,handleType:tt.connectionHandleType,nodesConnectable:tt.nodesConnectable,connectionStatus:tt.connectionStatus,width:tt.width,height:tt.height});function ConnectionLineWrapper({containerStyle:tt,style:et,type:nt,component:rt}){const{nodeId:it,handleType:ot,nodesConnectable:at,width:st,height:lt,connectionStatus:ct}=useStore(selector$2,shallow$1);return!(it&&ot&&st&&at)?null:React$1.createElement("svg",{style:tt,width:st,height:lt,className:"react-flow__edges react-flow__connectionline react-flow__container"},React$1.createElement("g",{className:cc(["react-flow__connection",ct])},React$1.createElement(ConnectionLine,{nodeId:it,handleType:ot,style:et,type:nt,CustomComponent:rt,connectionStatus:ct})))}function useNodeOrEdgeTypes(tt,et){return reactExports.useRef(null),useStoreApi(),reactExports.useMemo(()=>et(tt),[tt])}const GraphView=({nodeTypes:tt,edgeTypes:et,onMove:nt,onMoveStart:rt,onMoveEnd:it,onInit:ot,onNodeClick:at,onEdgeClick:st,onNodeDoubleClick:lt,onEdgeDoubleClick:ct,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,onSelectionContextMenu:mt,onSelectionStart:gt,onSelectionEnd:yt,connectionLineType:bt,connectionLineStyle:wt,connectionLineComponent:xt,connectionLineContainerStyle:kt,selectionKeyCode:St,selectionOnDrag:Tt,selectionMode:At,multiSelectionKeyCode:Et,panActivationKeyCode:Ct,zoomActivationKeyCode:Lt,deleteKeyCode:jt,onlyRenderVisibleElements:Rt,elementsSelectable:$t,selectNodesOnDrag:vt,defaultViewport:It,translateExtent:Ot,minZoom:Wt,maxZoom:zt,preventScrolling:Ft,defaultMarkerColor:Nt,zoomOnScroll:Ut,zoomOnPinch:Pt,panOnScroll:Ht,panOnScrollSpeed:Qt,panOnScrollMode:an,zoomOnDoubleClick:Yt,panOnDrag:nn,onPaneClick:tn,onPaneMouseEnter:dn,onPaneMouseMove:wn,onPaneMouseLeave:rn,onPaneScroll:Zt,onPaneContextMenu:vn,onEdgeUpdate:Cn,onEdgeContextMenu:$n,onEdgeMouseEnter:Nn,onEdgeMouseMove:En,onEdgeMouseLeave:sn,edgeUpdaterRadius:pn,onEdgeUpdateStart:Tn,onEdgeUpdateEnd:In,noDragClassName:yn,noWheelClassName:hn,noPanClassName:fn,elevateEdgesOnSelect:xn,disableKeyboardA11y:jn,nodeOrigin:cn,nodeExtent:Xt,rfId:Kt})=>{const kn=useNodeOrEdgeTypes(tt,createNodeTypes),Mn=useNodeOrEdgeTypes(et,createEdgeTypes);return useOnInitHandler(ot),React$1.createElement(FlowRenderer$1,{onPaneClick:tn,onPaneMouseEnter:dn,onPaneMouseMove:wn,onPaneMouseLeave:rn,onPaneContextMenu:vn,onPaneScroll:Zt,deleteKeyCode:jt,selectionKeyCode:St,selectionOnDrag:Tt,selectionMode:At,onSelectionStart:gt,onSelectionEnd:yt,multiSelectionKeyCode:Et,panActivationKeyCode:Ct,zoomActivationKeyCode:Lt,elementsSelectable:$t,onMove:nt,onMoveStart:rt,onMoveEnd:it,zoomOnScroll:Ut,zoomOnPinch:Pt,zoomOnDoubleClick:Yt,panOnScroll:Ht,panOnScrollSpeed:Qt,panOnScrollMode:an,panOnDrag:nn,defaultViewport:It,translateExtent:Ot,minZoom:Wt,maxZoom:zt,onSelectionContextMenu:mt,preventScrolling:Ft,noDragClassName:yn,noWheelClassName:hn,noPanClassName:fn,disableKeyboardA11y:jn},React$1.createElement(Viewport,null,React$1.createElement(EdgeRenderer$1,{edgeTypes:Mn,onEdgeClick:st,onEdgeDoubleClick:ct,onEdgeUpdate:Cn,onlyRenderVisibleElements:Rt,onEdgeContextMenu:$n,onEdgeMouseEnter:Nn,onEdgeMouseMove:En,onEdgeMouseLeave:sn,onEdgeUpdateStart:Tn,onEdgeUpdateEnd:In,edgeUpdaterRadius:pn,defaultMarkerColor:Nt,noPanClassName:fn,elevateEdgesOnSelect:!!xn,disableKeyboardA11y:jn,rfId:Kt},React$1.createElement(ConnectionLineWrapper,{style:wt,type:bt,component:xt,containerStyle:kt})),React$1.createElement("div",{className:"react-flow__edgelabel-renderer"}),React$1.createElement(NodeRenderer$1,{nodeTypes:kn,onNodeClick:at,onNodeDoubleClick:lt,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,selectNodesOnDrag:vt,onlyRenderVisibleElements:Rt,noPanClassName:fn,noDragClassName:yn,disableKeyboardA11y:jn,nodeOrigin:cn,nodeExtent:Xt,rfId:Kt})))};GraphView.displayName="GraphView";var GraphView$1=reactExports.memo(GraphView);const infiniteExtent=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],initialState={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:infiniteExtent,nodeExtent:infiniteExtent,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ConnectionMode.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:devWarn,isValidConnection:void 0},createRFStore=()=>createWithEqualityFn((tt,et)=>({...initialState,setNodes:nt=>{const{nodeInternals:rt,nodeOrigin:it,elevateNodesOnSelect:ot}=et();tt({nodeInternals:createNodeInternals(nt,rt,it,ot)})},getNodes:()=>Array.from(et().nodeInternals.values()),setEdges:nt=>{const{defaultEdgeOptions:rt={}}=et();tt({edges:nt.map(it=>({...rt,...it}))})},setDefaultNodesAndEdges:(nt,rt)=>{const it=typeof nt<"u",ot=typeof rt<"u",at=it?createNodeInternals(nt,new Map,et().nodeOrigin,et().elevateNodesOnSelect):new Map;tt({nodeInternals:at,edges:ot?rt:[],hasDefaultNodes:it,hasDefaultEdges:ot})},updateNodeDimensions:nt=>{const{onNodesChange:rt,nodeInternals:it,fitViewOnInit:ot,fitViewOnInitDone:at,fitViewOnInitOptions:st,domNode:lt,nodeOrigin:ct}=et(),ut=lt==null?void 0:lt.querySelector(".react-flow__viewport");if(!ut)return;const ht=window.getComputedStyle(ut),{m22:dt}=new window.DOMMatrixReadOnly(ht.transform),pt=nt.reduce((gt,yt)=>{const bt=it.get(yt.id);if(bt){const wt=getDimensions(yt.nodeElement);!!(wt.width&&wt.height&&(bt.width!==wt.width||bt.height!==wt.height||yt.forceUpdate))&&(it.set(bt.id,{...bt,[internalsSymbol]:{...bt[internalsSymbol],handleBounds:{source:getHandleBounds(".source",yt.nodeElement,dt,ct),target:getHandleBounds(".target",yt.nodeElement,dt,ct)}},...wt}),gt.push({id:bt.id,type:"dimensions",dimensions:wt}))}return gt},[]);updateAbsoluteNodePositions(it,ct);const mt=at||ot&&!at&&fitView(et,{initial:!0,...st});tt({nodeInternals:new Map(it),fitViewOnInitDone:mt}),(pt==null?void 0:pt.length)>0&&(rt==null||rt(pt))},updateNodePositions:(nt,rt=!0,it=!1)=>{const{triggerNodeChanges:ot}=et(),at=nt.map(st=>{const lt={id:st.id,type:"position",dragging:it};return rt&&(lt.positionAbsolute=st.positionAbsolute,lt.position=st.position),lt});ot(at)},triggerNodeChanges:nt=>{const{onNodesChange:rt,nodeInternals:it,hasDefaultNodes:ot,nodeOrigin:at,getNodes:st,elevateNodesOnSelect:lt}=et();if(nt!=null&&nt.length){if(ot){const ct=applyNodeChanges(nt,st()),ut=createNodeInternals(ct,it,at,lt);tt({nodeInternals:ut})}rt==null||rt(nt)}},addSelectedNodes:nt=>{const{multiSelectionActive:rt,edges:it,getNodes:ot}=et();let at,st=null;rt?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(ot(),nt),st=getSelectionChanges(it,[])),updateNodesAndEdgesSelections({changedNodes:at,changedEdges:st,get:et,set:tt})},addSelectedEdges:nt=>{const{multiSelectionActive:rt,edges:it,getNodes:ot}=et();let at,st=null;rt?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(it,nt),st=getSelectionChanges(ot(),[])),updateNodesAndEdgesSelections({changedNodes:st,changedEdges:at,get:et,set:tt})},unselectNodesAndEdges:({nodes:nt,edges:rt}={})=>{const{edges:it,getNodes:ot}=et(),at=nt||ot(),st=rt||it,lt=at.map(ut=>(ut.selected=!1,createSelectionChange(ut.id,!1))),ct=st.map(ut=>createSelectionChange(ut.id,!1));updateNodesAndEdgesSelections({changedNodes:lt,changedEdges:ct,get:et,set:tt})},setMinZoom:nt=>{const{d3Zoom:rt,maxZoom:it}=et();rt==null||rt.scaleExtent([nt,it]),tt({minZoom:nt})},setMaxZoom:nt=>{const{d3Zoom:rt,minZoom:it}=et();rt==null||rt.scaleExtent([it,nt]),tt({maxZoom:nt})},setTranslateExtent:nt=>{var rt;(rt=et().d3Zoom)==null||rt.translateExtent(nt),tt({translateExtent:nt})},resetSelectedElements:()=>{const{edges:nt,getNodes:rt}=et(),ot=rt().filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1)),at=nt.filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1));updateNodesAndEdgesSelections({changedNodes:ot,changedEdges:at,get:et,set:tt})},setNodeExtent:nt=>{const{nodeInternals:rt}=et();rt.forEach(it=>{it.positionAbsolute=clampPosition(it.position,nt)}),tt({nodeExtent:nt,nodeInternals:new Map(rt)})},panBy:nt=>{const{transform:rt,width:it,height:ot,d3Zoom:at,d3Selection:st,translateExtent:lt}=et();if(!at||!st||!nt.x&&!nt.y)return!1;const ct=identity.translate(rt[0]+nt.x,rt[1]+nt.y).scale(rt[2]),ut=[[0,0],[it,ot]],ht=at==null?void 0:at.constrain()(ct,ut,lt);return at.transform(st,ht),rt[0]!==ht.x||rt[1]!==ht.y||rt[2]!==ht.k},cancelConnection:()=>tt({connectionNodeId:initialState.connectionNodeId,connectionHandleId:initialState.connectionHandleId,connectionHandleType:initialState.connectionHandleType,connectionStatus:initialState.connectionStatus,connectionStartHandle:initialState.connectionStartHandle,connectionEndHandle:initialState.connectionEndHandle}),reset:()=>tt({...initialState})}),Object.is),ReactFlowProvider=({children:tt})=>{const et=reactExports.useRef(null);return et.current||(et.current=createRFStore()),React$1.createElement(Provider$1,{value:et.current},tt)};ReactFlowProvider.displayName="ReactFlowProvider";const Wrapper$f=({children:tt})=>reactExports.useContext(StoreContext)?React$1.createElement(React$1.Fragment,null,tt):React$1.createElement(ReactFlowProvider,null,tt);Wrapper$f.displayName="ReactFlowWrapper";const defaultNodeTypes={input:InputNode$1,default:DefaultNode$1,output:OutputNode$1,group:GroupNode},defaultEdgeTypes={default:BezierEdge,straight:StraightEdge,step:StepEdge,smoothstep:SmoothStepEdge,simplebezier:SimpleBezierEdge},initNodeOrigin=[0,0],initSnapGrid=[15,15],initDefaultViewport={x:0,y:0,zoom:1},wrapperStyle={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ReactFlow=reactExports.forwardRef(({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:rt,className:it,nodeTypes:ot=defaultNodeTypes,edgeTypes:at=defaultEdgeTypes,onNodeClick:st,onEdgeClick:lt,onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:yt,onClickConnectEnd:bt,onNodeMouseEnter:wt,onNodeMouseMove:xt,onNodeMouseLeave:kt,onNodeContextMenu:St,onNodeDoubleClick:Tt,onNodeDragStart:At,onNodeDrag:Et,onNodeDragStop:Ct,onNodesDelete:Lt,onEdgesDelete:jt,onSelectionChange:Rt,onSelectionDragStart:$t,onSelectionDrag:vt,onSelectionDragStop:It,onSelectionContextMenu:Ot,onSelectionStart:Wt,onSelectionEnd:zt,connectionMode:Ft=ConnectionMode.Strict,connectionLineType:Nt=ConnectionLineType.Bezier,connectionLineStyle:Ut,connectionLineComponent:Pt,connectionLineContainerStyle:Ht,deleteKeyCode:Qt="Backspace",selectionKeyCode:an="Shift",selectionOnDrag:Yt=!1,selectionMode:nn=SelectionMode.Full,panActivationKeyCode:tn="Space",multiSelectionKeyCode:dn=isMacOs()?"Meta":"Control",zoomActivationKeyCode:wn=isMacOs()?"Meta":"Control",snapToGrid:rn=!1,snapGrid:Zt=initSnapGrid,onlyRenderVisibleElements:vn=!1,selectNodesOnDrag:Cn=!0,nodesDraggable:$n,nodesConnectable:Nn,nodesFocusable:En,nodeOrigin:sn=initNodeOrigin,edgesFocusable:pn,edgesUpdatable:Tn,elementsSelectable:In,defaultViewport:yn=initDefaultViewport,minZoom:hn=.5,maxZoom:fn=2,translateExtent:xn=infiniteExtent,preventScrolling:jn=!0,nodeExtent:cn,defaultMarkerColor:Xt="#b1b1b7",zoomOnScroll:Kt=!0,zoomOnPinch:kn=!0,panOnScroll:Mn=!1,panOnScrollSpeed:On=.5,panOnScrollMode:Bn=PanOnScrollMode.Free,zoomOnDoubleClick:Xn=!0,panOnDrag:Vn=!0,onPaneClick:Gn,onPaneMouseEnter:zn,onPaneMouseMove:Jn,onPaneMouseLeave:Wn,onPaneScroll:fr,onPaneContextMenu:ur,children:wr,onEdgeUpdate:Xr,onEdgeContextMenu:Er,onEdgeDoubleClick:Ir,onEdgeMouseEnter:Gr,onEdgeMouseMove:Or,onEdgeMouseLeave:Lr,onEdgeUpdateStart:oo,onEdgeUpdateEnd:qr,edgeUpdaterRadius:jr=10,onNodesChange:mo,onEdgesChange:_n,noDragClassName:Pn="nodrag",noWheelClassName:un="nowheel",noPanClassName:Jt="nopan",fitView:Sn=!1,fitViewOptions:Dn,connectOnClick:Fn=!0,attributionPosition:Yn,proOptions:tr,defaultEdgeOptions:ar,elevateNodesOnSelect:lr=!0,elevateEdgesOnSelect:Vr=!1,disableKeyboardA11y:vr=!1,autoPanOnConnect:Nr=!0,autoPanOnNodeDrag:Hr=!0,connectionRadius:eo=20,isValidConnection:Jr,onError:Zr,style:br,id:Pr,nodeDragThreshold:Fr,...Mr},Cr)=>{const Dr=Pr||"1";return React$1.createElement("div",{...Mr,style:{...br,...wrapperStyle},ref:Cr,className:cc(["react-flow",it]),"data-testid":"rf__wrapper",id:Pr},React$1.createElement(Wrapper$f,null,React$1.createElement(GraphView$1,{onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onNodeClick:st,onEdgeClick:lt,onNodeMouseEnter:wt,onNodeMouseMove:xt,onNodeMouseLeave:kt,onNodeContextMenu:St,onNodeDoubleClick:Tt,nodeTypes:ot,edgeTypes:at,connectionLineType:Nt,connectionLineStyle:Ut,connectionLineComponent:Pt,connectionLineContainerStyle:Ht,selectionKeyCode:an,selectionOnDrag:Yt,selectionMode:nn,deleteKeyCode:Qt,multiSelectionKeyCode:dn,panActivationKeyCode:tn,zoomActivationKeyCode:wn,onlyRenderVisibleElements:vn,selectNodesOnDrag:Cn,defaultViewport:yn,translateExtent:xn,minZoom:hn,maxZoom:fn,preventScrolling:jn,zoomOnScroll:Kt,zoomOnPinch:kn,zoomOnDoubleClick:Xn,panOnScroll:Mn,panOnScrollSpeed:On,panOnScrollMode:Bn,panOnDrag:Vn,onPaneClick:Gn,onPaneMouseEnter:zn,onPaneMouseMove:Jn,onPaneMouseLeave:Wn,onPaneScroll:fr,onPaneContextMenu:ur,onSelectionContextMenu:Ot,onSelectionStart:Wt,onSelectionEnd:zt,onEdgeUpdate:Xr,onEdgeContextMenu:Er,onEdgeDoubleClick:Ir,onEdgeMouseEnter:Gr,onEdgeMouseMove:Or,onEdgeMouseLeave:Lr,onEdgeUpdateStart:oo,onEdgeUpdateEnd:qr,edgeUpdaterRadius:jr,defaultMarkerColor:Xt,noDragClassName:Pn,noWheelClassName:un,noPanClassName:Jt,elevateEdgesOnSelect:Vr,rfId:Dr,disableKeyboardA11y:vr,nodeOrigin:sn,nodeExtent:cn}),React$1.createElement(StoreUpdater,{nodes:tt,edges:et,defaultNodes:nt,defaultEdges:rt,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:yt,onClickConnectEnd:bt,nodesDraggable:$n,nodesConnectable:Nn,nodesFocusable:En,edgesFocusable:pn,edgesUpdatable:Tn,elementsSelectable:In,elevateNodesOnSelect:lr,minZoom:hn,maxZoom:fn,nodeExtent:cn,onNodesChange:mo,onEdgesChange:_n,snapToGrid:rn,snapGrid:Zt,connectionMode:Ft,translateExtent:xn,connectOnClick:Fn,defaultEdgeOptions:ar,fitView:Sn,fitViewOptions:Dn,onNodesDelete:Lt,onEdgesDelete:jt,onNodeDragStart:At,onNodeDrag:Et,onNodeDragStop:Ct,onSelectionDrag:vt,onSelectionDragStart:$t,onSelectionDragStop:It,noPanClassName:Jt,nodeOrigin:sn,rfId:Dr,autoPanOnConnect:Nr,autoPanOnNodeDrag:Hr,onError:Zr,connectionRadius:eo,isValidConnection:Jr,nodeDragThreshold:Fr}),React$1.createElement(Wrapper$1$1,{onSelectionChange:Rt}),wr,React$1.createElement(Attribution,{proOptions:tr,position:Yn}),React$1.createElement(A11yDescriptions,{rfId:Dr,disableKeyboardA11y:vr})))});ReactFlow.displayName="ReactFlow";const style="",TeachMe=()=>{const[tt,et]=useDataStore(mt=>[mt.data,mt.setTeachMe]),[nt,rt]=useAppStore(mt=>[mt.currentSearch,mt.setSidebarOpen]),[it]=useUserStore(mt=>[mt.setBudget]),ot=reactExports.useRef(!1),at=useSocket(),[st,lt,ct,ut]=useTeachStore(mt=>[mt.setTeachMeAnswer,mt.setHasTeachingInProgress,mt.setInstagraphAnswer,mt.setHasInstagraphInProgress]),ht=reactExports.useCallback(mt=>{st(mt.tutorial),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Tutorial is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[st]),dt=reactExports.useCallback(mt=>{ct(mt),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Instagraph is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[ct]);reactExports.useEffect(()=>{ot.current||(ht&&at&&(at.on("teachmehook",ht),ot.current=!0),dt&&at&&(at.on("instagraphhook",dt),ot.current=!0))},[at,ht,dt]);const pt=async()=>{if(nt){lt(!0),ut(!0),rt(!0),et(!0);try{const mt=tt==null?void 0:tt.nodes.filter(bt=>bt.text),gt=mt==null?void 0:mt.slice(0,5),yt=(gt!=null&>.length?gt.map(bt=>bt.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,bt=>`\\${bt}`);await distExports$1.enable(),await postTeachMe({term:nt,transcripts:yt}),await updateBudget(it),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing tutorial for you"}),{type:"success"}),await postInstagraph({term:nt,transcripts:yt}),await updateBudget(it),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing an instagraph for you"}),{type:"success"})}catch{lt(!1),ut(!1)}}};return jsxRuntimeExports.jsx(ButtonStyled$1,{onClick:()=>pt(),children:"Teach me"})},TeachMeLoader=({text:tt})=>jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"center",py:12,children:[jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(Text$1,{children:tt})})]}),TeachMeText=()=>{const[tt,et,nt,rt]=useTeachStore(ot=>[ot.teachMeAnswer,ot.hasTeachingInProgress,ot.instgraphAnswser,ot.hasInstagraphInProgress]),it=!rt&&!!(nt!=null&&nt.edges)&&!!(nt!=null&&nt.nodes);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[it?jsxRuntimeExports.jsx(ReactFlow,{edges:nt==null?void 0:nt.edges,nodes:nt==null?void 0:nt.nodes}):jsxRuntimeExports.jsx(TeachMeLoader,{text:"Generating instagraph"}),et?jsxRuntimeExports.jsx(TeachMeLoader,{text:"Generating tutorial"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TeachMeAnswerFlex,{children:jsxRuntimeExports.jsx(Text$1,{children:tt})}),jsxRuntimeExports.jsx(AskQuestion,{})]})]})},ButtonStyled$1=styled$4(Button$2)``,TeachMeAnswerFlex=styled$4(Flex)` padding-left: 10px; padding-right: 10px; `,MENU_WIDTH$2=400,ComponentsMapper$1={askQuestion:jsxRuntimeExports.jsx(AskQuestion,{}),teachMe:jsxRuntimeExports.jsx(TeachMe,{}),sentiment:jsxRuntimeExports.jsx(SentimentAnalysis,{})},heightMap={askQuestion:400,sentiment:600,teachMe:400,default:200},HelperContent=()=>{const{isShow:tt,setIsShow:et}=useHelper(),[nt,rt]=reactExports.useState(null);return jsxRuntimeExports.jsx(ContentWrapper$1,{children:jsxRuntimeExports.jsx(Fade$1,{in:tt,mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsxs(Stack$3,{bgcolor:colors.listBg,component:Paper$1,elevation:2,height:heightMap[nt??"default"],p:2,pb:4,pt:4,sx:{transition:({transitions:it})=>`${it.create(["height","opacity"])}!important`,overflowY:"auto",overflowX:"hidden"},width:{xs:"calc(100vw - 8px * 4)",sm:MENU_WIDTH$2},children:[jsxRuntimeExports.jsx(CloseButton$3,{onClick:()=>{rt(null),et(it=>!it)}}),jsxRuntimeExports.jsx(ActionsMenu,{active:nt,onChange:rt}),nt&&ComponentsMapper$1[nt]]})})})},ContentWrapper$1=styled$1("div")(()=>({position:"absolute",bottom:"1rem",right:"1rem"})),CloseButton$3=styled$1(tt=>jsxRuntimeExports.jsx(IconButton$1,{component:"button",size:"small",...tt,children:jsxRuntimeExports.jsx(MdClose,{})}))(()=>({position:"absolute",right:"0.5rem",top:"0.5rem"})),dpr=window.devicePixelRatio||1,pi=Math.PI,points=12,radius=200*dpr,h=600*dpr,w=600*dpr,center={x:w/2*dpr,y:h/2*dpr},rangeMin=3,rangeMax=25,createBtn=tt=>{var at;const et=(at=tt.current)==null?void 0:at.getContext("2d"),nt=tt.current;if(!et||!nt)return null;const rt=getGradients(et);et.scale(dpr,dpr),nt.width=w*dpr,nt.height=h*dpr;const it=getCircles(rt),ot=setInterval(()=>{swingCircle(et,it,rt)},16);return()=>clearInterval(ot)};function cycle(tt,et){return(tt%et+et)%et}function swingCircle(tt,et,nt){tt.clearRect(0,0,w*dpr,h*dpr),tt.globalAlpha=.9,tt.globalCompositeOperation="screen";for(let rt=0;rt{const nt=reactExports.useRef(null);return reactExports.useEffect(()=>{const rt=createBtn(nt);return()=>{rt==null||rt()}},[]),jsxRuntimeExports.jsxs(ButtonContainer,{...et,children:[tt&&jsxRuntimeExports.jsx("div",{className:"children",children:tt}),jsxRuntimeExports.jsx(Canvas,{ref:nt})]})},ButtonContainer=styled$1(ButtonBase$1)(()=>({width:48,height:48,"& .children":{zIndex:1}})),Canvas=styled$1("canvas")(()=>({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:70,height:70})),OpenHelperBtn=()=>{const{setIsShow:tt}=useHelper(),[et]=useAppStore(it=>[it.sidebarIsOpen]),nt=reactExports.useRef(null),rt=useAppStore(it=>it.currentSearch);return reactExports.useEffect(()=>{const it=createBtn(nt);return()=>{it==null||it()}},[]),rt?jsxRuntimeExports.jsx(FabContainer,{sidebarIsOpen:et,children:jsxRuntimeExports.jsx(SiriLikeButton,{id:"cy-siri-btn",onClick:()=>tt(it=>!it)})}):null},FabContainer=styled$1("div")(({sidebarIsOpen:tt,theme:et})=>({position:"absolute",bottom:"2rem",transition:et.transitions.create(["right"]),right:tt?"calc((100% - 400px) / 2)":"50%",transform:"translate(50%)"})),Helper=()=>{const[tt,et]=reactExports.useState(!1),nt=reactExports.useMemo(()=>({isShow:tt,setIsShow:et}),[tt]);return jsxRuntimeExports.jsxs(HelperContext.Provider,{value:nt,children:[jsxRuntimeExports.jsx(OpenHelperBtn,{}),jsxRuntimeExports.jsx(HelperContent,{})]})},AddContentIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_25",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_25)",children:jsxRuntimeExports.jsx("path",{d:"M11.25 12.75V16C11.25 16.2125 11.3219 16.3906 11.4657 16.5343C11.6095 16.6781 11.7877 16.75 12.0003 16.75C12.2129 16.75 12.391 16.6781 12.5346 16.5343C12.6782 16.3906 12.75 16.2125 12.75 16V12.75H16C16.2125 12.75 16.3906 12.6781 16.5344 12.5343C16.6781 12.3904 16.75 12.2122 16.75 11.9997C16.75 11.7871 16.6781 11.609 16.5344 11.4654C16.3906 11.3218 16.2125 11.25 16 11.25H12.75V7.99998C12.75 7.78748 12.6781 7.60935 12.5343 7.4656C12.3905 7.32187 12.2123 7.25 11.9997 7.25C11.7871 7.25 11.609 7.32187 11.4654 7.4656C11.3218 7.60935 11.25 7.78748 11.25 7.99998V11.25H8.00001C7.78751 11.25 7.60939 11.3219 7.46566 11.4657C7.32191 11.6095 7.25003 11.7877 7.25003 12.0003C7.25003 12.2129 7.32191 12.391 7.46566 12.5346C7.60939 12.6782 7.78751 12.75 8.00001 12.75H11.25ZM12.0017 21.5C10.6877 21.5 9.45271 21.2506 8.29658 20.752C7.14043 20.2533 6.13475 19.5765 5.27953 18.7217C4.4243 17.8669 3.74724 16.8616 3.24836 15.706C2.74947 14.5504 2.50003 13.3156 2.50003 12.0017C2.50003 10.6877 2.74936 9.45268 3.24803 8.29655C3.7467 7.1404 4.42345 6.13472 5.27828 5.2795C6.13313 4.42427 7.13837 3.74721 8.29401 3.24833C9.44962 2.74944 10.6844 2.5 11.9983 2.5C13.3123 2.5 14.5473 2.74933 15.7034 3.248C16.8596 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.1331 20.2528 7.13834 20.7517 8.29398C21.2505 9.44959 21.5 10.6844 21.5 11.9983C21.5 13.3122 21.2506 14.5473 20.752 15.7034C20.2533 16.8596 19.5766 17.8652 18.7217 18.7205C17.8669 19.5757 16.8616 20.2527 15.706 20.7516C14.5504 21.2505 13.3156 21.5 12.0017 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76664 19.225 7.87498 17.675 6.32498C16.125 4.77498 14.2333 3.99998 12 3.99998C9.76667 3.99998 7.87501 4.77498 6.32501 6.32498C4.77501 7.87498 4.00001 9.76664 4.00001 12C4.00001 14.2333 4.77501 16.125 6.32501 17.675C7.87501 19.225 9.76667 20 12 20Z",fill:"currentColor"})})]}),AddSourceIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_27",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_27)",children:jsxRuntimeExports.jsx("path",{d:"M5.30773 20.5C4.81061 20.5 4.38506 20.3229 4.03106 19.9689C3.67704 19.6149 3.50003 19.1894 3.50003 18.6923V5.3077C3.50003 4.81058 3.67704 4.38503 4.03106 4.03103C4.38506 3.67701 4.81061 3.5 5.30773 3.5H18.6923C19.1894 3.5 19.615 3.67701 19.969 4.03103C20.323 4.38503 20.5 4.81058 20.5 5.3077V11.6327C20.2538 11.5275 20.0074 11.4384 19.7606 11.3654C19.5138 11.2923 19.2603 11.234 19 11.1904V5.3077C19 5.23077 18.968 5.16024 18.9039 5.09613C18.8397 5.03203 18.7692 4.99998 18.6923 4.99998H5.30773C5.2308 4.99998 5.16027 5.03203 5.09616 5.09613C5.03206 5.16024 5.00001 5.23077 5.00001 5.3077V18.6923C5.00001 18.7692 5.03206 18.8397 5.09616 18.9038C5.16027 18.9679 5.2308 19 5.30773 19H11.1654C11.2026 19.2769 11.2577 19.5387 11.3308 19.7855C11.4038 20.0323 11.4929 20.2705 11.5981 20.5H5.30773ZM5.00001 19V4.99998V11.1904V11.1154V19ZM7.25003 15.8849C7.25003 16.0975 7.32191 16.2756 7.46566 16.4192C7.60939 16.5628 7.78751 16.6346 8.00001 16.6346H11.2673C11.3109 16.3743 11.3757 16.1208 11.4616 15.874C11.5475 15.6272 11.641 15.3808 11.7423 15.1346H8.00001C7.78751 15.1346 7.60939 15.2065 7.46566 15.3503C7.32191 15.4941 7.25003 15.6723 7.25003 15.8849ZM7.25003 12.0003C7.25003 12.2129 7.32191 12.391 7.46566 12.5346C7.60939 12.6782 7.78751 12.75 8.00001 12.75H13.5904C14.0212 12.3846 14.4808 12.0785 14.9692 11.8317C15.4577 11.5849 15.9807 11.4096 16.5384 11.3058C16.4259 11.281 16.3009 11.2655 16.1634 11.2593C16.0259 11.2531 15.901 11.25 15.7885 11.25H8.00001C7.78751 11.25 7.60939 11.3219 7.46566 11.4657C7.32191 11.6095 7.25003 11.7877 7.25003 12.0003ZM7.25003 8.1157C7.25003 8.3283 7.32191 8.50639 7.46566 8.64998C7.60939 8.79356 7.78751 8.86535 8.00001 8.86535H16C16.2125 8.86535 16.3906 8.79344 16.5344 8.64963C16.6781 8.50583 16.75 8.32763 16.75 8.11503C16.75 7.90244 16.6781 7.72436 16.5344 7.58078C16.3906 7.43718 16.2125 7.36538 16 7.36538H8.00001C7.78751 7.36538 7.60939 7.43728 7.46566 7.5811C7.32191 7.72492 7.25003 7.90312 7.25003 8.1157ZM18 22.5576C16.7513 22.5576 15.6891 22.1198 14.8135 21.2442C13.9378 20.3685 13.5 19.3064 13.5 18.0577C13.5 16.809 13.9378 15.7468 14.8135 14.8712C15.6891 13.9955 16.7513 13.5577 18 13.5577C19.2487 13.5577 20.3109 13.9955 21.1865 14.8712C22.0622 15.7468 22.5 16.809 22.5 18.0577C22.5 19.3064 22.0622 20.3685 21.1865 21.2442C20.3109 22.1198 19.2487 22.5576 18 22.5576ZM17.5577 18.5V20.5577C17.5577 20.6756 17.6019 20.7788 17.6904 20.8673C17.7788 20.9557 17.8821 21 18 21C18.118 21 18.2212 20.9557 18.3096 20.8673C18.3981 20.7788 18.4423 20.6756 18.4423 20.5577V18.5H20.5C20.618 18.5 20.7212 18.4557 20.8096 18.3673C20.8981 18.2788 20.9423 18.1756 20.9423 18.0577C20.9423 17.9397 20.8981 17.8365 20.8096 17.748C20.7212 17.6596 20.618 17.6154 20.5 17.6154H18.4423V15.5577C18.4423 15.4397 18.3981 15.3365 18.3096 15.2481C18.2212 15.1596 18.118 15.1154 18 15.1154C17.8821 15.1154 17.7788 15.1596 17.6904 15.2481C17.6019 15.3365 17.5577 15.4397 17.5577 15.5577V17.6154H15.5C15.3821 17.6154 15.2788 17.6596 15.1904 17.748C15.1019 17.8365 15.0577 17.9397 15.0577 18.0577C15.0577 18.1756 15.1019 18.2788 15.1904 18.3673C15.2788 18.4557 15.3821 18.5 15.5 18.5H17.5577Z",fill:"currentColor"})})]}),SourcesTableIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_26",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_26)",children:jsxRuntimeExports.jsx("path",{d:"M10.0577 18.7499C9.84521 18.7499 9.66708 18.678 9.52333 18.5342C9.3796 18.3904 9.30773 18.2122 9.30773 17.9996C9.30773 17.787 9.3796 17.609 9.52333 17.4654C9.66708 17.3218 9.84521 17.25 10.0577 17.25H19.75C19.9625 17.25 20.1406 17.3219 20.2844 17.4657C20.4281 17.6095 20.5 17.7877 20.5 18.0003C20.5 18.2129 20.4281 18.391 20.2844 18.5346C20.1406 18.6782 19.9625 18.7499 19.75 18.7499H10.0577ZM10.0577 12.7499C9.84521 12.7499 9.66708 12.678 9.52333 12.5342C9.3796 12.3904 9.30773 12.2122 9.30773 11.9996C9.30773 11.787 9.3796 11.609 9.52333 11.4654C9.66708 11.3218 9.84521 11.25 10.0577 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2844 11.4657C20.4281 11.6095 20.5 11.7877 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2844 12.5346C20.1406 12.6782 19.9625 12.7499 19.75 12.7499H10.0577ZM10.0577 6.74995C9.84521 6.74995 9.66708 6.67805 9.52333 6.53425C9.3796 6.39043 9.30773 6.21223 9.30773 5.99965C9.30773 5.78705 9.3796 5.60896 9.52333 5.46537C9.66708 5.32179 9.84521 5.25 10.0577 5.25H19.75C19.9625 5.25 20.1406 5.3219 20.2844 5.4657C20.4281 5.60951 20.5 5.78771 20.5 6.0003C20.5 6.2129 20.4281 6.39099 20.2844 6.53457C20.1406 6.67816 19.9625 6.74995 19.75 6.74995H10.0577ZM5.16348 19.6634C4.70603 19.6634 4.31443 19.5005 3.98868 19.1748C3.66291 18.849 3.50003 18.4574 3.50003 18C3.50003 17.5425 3.66291 17.1509 3.98868 16.8252C4.31443 16.4994 4.70603 16.3365 5.16348 16.3365C5.62093 16.3365 6.01253 16.4994 6.33828 16.8252C6.66403 17.1509 6.82691 17.5425 6.82691 18C6.82691 18.4574 6.66403 18.849 6.33828 19.1748C6.01253 19.5005 5.62093 19.6634 5.16348 19.6634ZM5.16348 13.6634C4.70603 13.6634 4.31443 13.5005 3.98868 13.1748C3.66291 12.849 3.50003 12.4574 3.50003 12C3.50003 11.5425 3.66291 11.1509 3.98868 10.8252C4.31443 10.4994 4.70603 10.3365 5.16348 10.3365C5.62093 10.3365 6.01253 10.4994 6.33828 10.8252C6.66403 11.1509 6.82691 11.5425 6.82691 12C6.82691 12.4574 6.66403 12.849 6.33828 13.1748C6.01253 13.5005 5.62093 13.6634 5.16348 13.6634ZM5.16348 7.6634C4.70603 7.6634 4.31443 7.50052 3.98868 7.17477C3.66291 6.84902 3.50003 6.45742 3.50003 5.99997C3.50003 5.54252 3.66291 5.15092 3.98868 4.82517C4.31443 4.49942 4.70603 4.33655 5.16348 4.33655C5.62093 4.33655 6.01253 4.49942 6.33828 4.82517C6.66403 5.15092 6.82691 5.54252 6.82691 5.99997C6.82691 6.45742 6.66403 6.84902 6.33828 7.17477C6.01253 7.50052 5.62093 7.6634 5.16348 7.6634Z",fill:"currentColor"})})]}),MainToolbar=()=>{const[tt]=useAppStore(ot=>[ot.setSecondarySidebarActiveTab]),{open:et}=useModal("sourcesTable"),{open:nt}=useModal("addContent"),{open:rt}=useModal("addSource"),it=ot=>{tt(ot)};return jsxRuntimeExports.jsxs(Wrapper$e,{children:[jsxRuntimeExports.jsx(LogoButton,{onClick:()=>it("about"),children:jsxRuntimeExports.jsx("img",{alt:"Second brain",src:"logo.svg"})}),jsxRuntimeExports.jsxs(ActionButton,{onClick:nt,children:[jsxRuntimeExports.jsx(IconWrapper,{children:jsxRuntimeExports.jsx(AddContentIcon,{})}),jsxRuntimeExports.jsx(Text$1,{children:"Add Content"})]}),jsxRuntimeExports.jsxs(ActionButton,{onClick:rt,children:[jsxRuntimeExports.jsx(IconWrapper,{children:jsxRuntimeExports.jsx(AddSourceIcon,{})}),jsxRuntimeExports.jsx(Text$1,{children:"Add Source"})]}),jsxRuntimeExports.jsxs(ActionButton,{id:"cy-open-soure-table",onClick:et,children:[jsxRuntimeExports.jsx(IconWrapper,{children:jsxRuntimeExports.jsx(SourcesTableIcon,{})}),jsxRuntimeExports.jsx(Text$1,{children:"Source Table"})]}),jsxRuntimeExports.jsxs(ActionButton,{children:[jsxRuntimeExports.jsx(IconWrapper,{children:jsxRuntimeExports.jsx(SettingsIcon,{})}),jsxRuntimeExports.jsx(Text$1,{children:"Settings"})]})]})},Wrapper$e=styled$4(Flex).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` @@ -6721,8 +6815,8 @@ ${({disabled:tt})=>tt&&Ae` `,Twitter=()=>jsxRuntimeExports.jsx("div",{children:"Twitter"});var lib={},players={},utils={},loadScript=function tt(et,nt,rt){var it=document.head||document.getElementsByTagName("head")[0],ot=document.createElement("script");typeof nt=="function"&&(rt=nt,nt={}),nt=nt||{},rt=rt||function(){},ot.type=nt.type||"text/javascript",ot.charset=nt.charset||"utf8",ot.async="async"in nt?!!nt.async:!0,ot.src=et,nt.attrs&&setAttributes(ot,nt.attrs),nt.text&&(ot.text=""+nt.text);var at="onload"in ot?stdOnEnd:ieOnEnd;at(ot,rt),ot.onload||stdOnEnd(ot,rt),it.appendChild(ot)};function setAttributes(tt,et){for(var nt in et)tt.setAttribute(nt,et[nt])}function stdOnEnd(tt,et){tt.onload=function(){this.onerror=this.onload=null,et(null,tt)},tt.onerror=function(){this.onerror=this.onload=null,et(new Error("Failed to load "+this.src),tt)}}function ieOnEnd(tt,et){tt.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,et(null,tt))}}var isMergeableObject=function tt(et){return isNonNullObject(et)&&!isSpecial(et)};function isNonNullObject(tt){return!!tt&&typeof tt=="object"}function isSpecial(tt){var et=Object.prototype.toString.call(tt);return et==="[object RegExp]"||et==="[object Date]"||isReactElement(tt)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(tt){return tt.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(tt){return Array.isArray(tt)?[]:{}}function cloneUnlessOtherwiseSpecified(tt,et){return et.clone!==!1&&et.isMergeableObject(tt)?deepmerge(emptyTarget(tt),tt,et):tt}function defaultArrayMerge(tt,et,nt){return tt.concat(et).map(function(rt){return cloneUnlessOtherwiseSpecified(rt,nt)})}function getMergeFunction(tt,et){if(!et.customMerge)return deepmerge;var nt=et.customMerge(tt);return typeof nt=="function"?nt:deepmerge}function getEnumerableOwnPropertySymbols(tt){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(tt).filter(function(et){return Object.propertyIsEnumerable.call(tt,et)}):[]}function getKeys(tt){return Object.keys(tt).concat(getEnumerableOwnPropertySymbols(tt))}function propertyIsOnObject(tt,et){try{return et in tt}catch{return!1}}function propertyIsUnsafe(tt,et){return propertyIsOnObject(tt,et)&&!(Object.hasOwnProperty.call(tt,et)&&Object.propertyIsEnumerable.call(tt,et))}function mergeObject(tt,et,nt){var rt={};return nt.isMergeableObject(tt)&&getKeys(tt).forEach(function(it){rt[it]=cloneUnlessOtherwiseSpecified(tt[it],nt)}),getKeys(et).forEach(function(it){propertyIsUnsafe(tt,it)||(propertyIsOnObject(tt,it)&&nt.isMergeableObject(et[it])?rt[it]=getMergeFunction(it,nt)(tt[it],et[it],nt):rt[it]=cloneUnlessOtherwiseSpecified(et[it],nt))}),rt}function deepmerge(tt,et,nt){nt=nt||{},nt.arrayMerge=nt.arrayMerge||defaultArrayMerge,nt.isMergeableObject=nt.isMergeableObject||isMergeableObject,nt.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var rt=Array.isArray(et),it=Array.isArray(tt),ot=rt===it;return ot?rt?nt.arrayMerge(tt,et,nt):mergeObject(tt,et,nt):cloneUnlessOtherwiseSpecified(et,nt)}deepmerge.all=function tt(et,nt){if(!Array.isArray(et))throw new Error("first argument should be an array");return et.reduce(function(rt,it){return deepmerge(rt,it,nt)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;Object.defineProperty(utils,"__esModule",{value:!0});utils.parseStartTime=parseStartTime;utils.parseEndTime=parseEndTime;utils.randomString=randomString;utils.queryString=queryString;utils.getSDK=getSDK;utils.getConfig=getConfig;utils.omit=omit;utils.callPlayer=callPlayer;utils.isMediaStream=isMediaStream;utils.isBlobUrl=isBlobUrl;utils.supportsWebKitPresentationMode=supportsWebKitPresentationMode;var _loadScript=_interopRequireDefault$2(loadScript),_deepmerge$1=_interopRequireDefault$2(cjs);function _interopRequireDefault$2(tt){return tt&&tt.__esModule?tt:{default:tt}}function _slicedToArray(tt,et){return _arrayWithHoles(tt)||_iterableToArrayLimit(tt,et)||_unsupportedIterableToArray$2(tt,et)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$2(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$2(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$2(tt,et)}}function _arrayLikeToArray$2(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt"u"||!(Symbol.iterator in Object(tt)))){var nt=[],rt=!0,it=!1,ot=void 0;try{for(var at=tt[Symbol.iterator](),st;!(rt=(st=at.next()).done)&&(nt.push(st.value),!(et&&nt.length===et));rt=!0);}catch(lt){it=!0,ot=lt}finally{try{!rt&&at.return!=null&&at.return()}finally{if(it)throw ot}}return nt}}function _arrayWithHoles(tt){if(Array.isArray(tt))return tt}var MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(tt,et){if(!(tt instanceof Array)){var nt=tt.match(et);if(nt){var rt=nt[1];if(rt.match(MATCH_START_STAMP))return parseTimeString(rt);if(MATCH_NUMERIC.test(rt))return parseInt(rt)}}}function parseTimeString(tt){for(var et=0,nt=MATCH_START_STAMP.exec(tt);nt!==null;){var rt=nt,it=_slicedToArray(rt,3),ot=it[1],at=it[2];at==="h"&&(et+=parseInt(ot,10)*60*60),at==="m"&&(et+=parseInt(ot,10)*60),at==="s"&&(et+=parseInt(ot,10)),nt=MATCH_START_STAMP.exec(tt)}return et}function parseStartTime(tt){return parseTimeParam(tt,MATCH_START_QUERY)}function parseEndTime(tt){return parseTimeParam(tt,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(tt){return Object.keys(tt).map(function(et){return"".concat(et,"=").concat(tt[et])}).join("&")}function getGlobal(tt){return window[tt]?window[tt]:window.exports&&window.exports[tt]?window.exports[tt]:window.module&&window.module.exports&&window.module.exports[tt]?window.module.exports[tt]:null}var requests={};function getSDK(tt,et){var nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,rt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0},it=arguments.length>4&&arguments[4]!==void 0?arguments[4]:_loadScript.default,ot=getGlobal(et);return ot&&rt(ot)?Promise.resolve(ot):new Promise(function(at,st){if(requests[tt]){requests[tt].push({resolve:at,reject:st});return}requests[tt]=[{resolve:at,reject:st}];var lt=function(ht){requests[tt].forEach(function(dt){return dt.resolve(ht)})};if(nt){var ct=window[nt];window[nt]=function(){ct&&ct(),lt(getGlobal(et))}}it(tt,function(ut){ut?(requests[tt].forEach(function(ht){return ht.reject(ut)}),requests[tt]=null):nt||lt(getGlobal(et))})})}function getConfig(tt,et){return(0,_deepmerge$1.default)(et.config,tt.config)}function omit(tt){for(var et,nt=arguments.length,rt=new Array(nt>1?nt-1:0),it=1;it1?rt-1:0),ot=1;ot0&&arguments[0]!==void 0?arguments[0]:document.createElement("video"),et=/iPhone|iPod/.test(navigator.userAgent)===!1;return tt.webkitSupportsPresentationMode&&typeof tt.webkitSetPresentationMode=="function"&&et}var patterns={};Object.defineProperty(patterns,"__esModule",{value:!0});patterns.canPlay=patterns.FLV_EXTENSIONS=patterns.DASH_EXTENSIONS=patterns.HLS_EXTENSIONS=patterns.VIDEO_EXTENSIONS=patterns.AUDIO_EXTENSIONS=patterns.MATCH_URL_KALTURA=patterns.MATCH_URL_VIDYARD=patterns.MATCH_URL_MIXCLOUD=patterns.MATCH_URL_DAILYMOTION=patterns.MATCH_URL_TWITCH_CHANNEL=patterns.MATCH_URL_TWITCH_VIDEO=patterns.MATCH_URL_WISTIA=patterns.MATCH_URL_STREAMABLE=patterns.MATCH_URL_FACEBOOK_WATCH=patterns.MATCH_URL_FACEBOOK=patterns.MATCH_URL_VIMEO=patterns.MATCH_URL_SOUNDCLOUD=patterns.MATCH_URL_YOUTUBE=void 0;var _utils$1=utils;function _createForOfIteratorHelper(tt,et){var nt;if(typeof Symbol>"u"||tt[Symbol.iterator]==null){if(Array.isArray(tt)||(nt=_unsupportedIterableToArray$1(tt))||et&&tt&&typeof tt.length=="number"){nt&&(tt=nt);var rt=0,it=function(){};return{s:it,n:function(){return rt>=tt.length?{done:!0}:{done:!1,value:tt[rt++]}},e:function(ct){throw ct},f:it}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ot=!0,at=!1,st;return{s:function(){nt=tt[Symbol.iterator]()},n:function(){var ct=nt.next();return ot=ct.done,ct},e:function(ct){at=!0,st=ct},f:function(){try{!ot&&nt.return!=null&&nt.return()}finally{if(at)throw st}}}}function _unsupportedIterableToArray$1(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$1(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$1(tt,et)}}function _arrayLikeToArray$1(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);ntzt.length)&&(Ft=zt.length);for(var Nt=0,Ut=new Array(Ft);Nt"u"||!(Symbol.iterator in Object(zt)))){var Nt=[],Ut=!0,Pt=!1,Ht=void 0;try{for(var Qt=zt[Symbol.iterator](),an;!(Ut=(an=Qt.next()).done)&&(Nt.push(an.value),!(Ft&&Nt.length===Ft));Ut=!0);}catch(Yt){Pt=!0,Ht=Yt}finally{try{!Ut&&Qt.return!=null&&Qt.return()}finally{if(Pt)throw Ht}}return Nt}}function mt(zt){if(Array.isArray(zt))return zt}function gt(zt,Ft){if(!(zt instanceof Ft))throw new TypeError("Cannot call a class as a function")}function yt(zt,Ft){for(var Nt=0;Nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Et(zt){return Et=Object.setPrototypeOf?Object.getPrototypeOf:function(Nt){return Nt.__proto__||Object.getPrototypeOf(Nt)},Et(zt)}function Ct(zt,Ft,Nt){return Ft in zt?Object.defineProperty(zt,Ft,{value:Nt,enumerable:!0,configurable:!0,writable:!0}):zt[Ft]=Nt,zt}var Lt="https://www.youtube.com/iframe_api",jt="YT",Rt="onYouTubeIframeAPIReady",$t=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,vt=/user\/([a-zA-Z0-9_-]+)\/?/,It=/youtube-nocookie\.com/,Ot="https://www.youtube-nocookie.com",Wt=function(zt){wt(Nt,zt);var Ft=kt(Nt);function Nt(){var Ut;gt(this,Nt);for(var Pt=arguments.length,Ht=new Array(Pt),Qt=0;Qt1&&arguments[1]!==void 0?arguments[1]:!1;this.callPlayer("seekTo",Pt),!Ht&&!this.props.playing&&this.pause()}},{key:"setVolume",value:function(Pt){this.callPlayer("setVolume",Pt*100)}},{key:"setPlaybackRate",value:function(Pt){this.callPlayer("setPlaybackRate",Pt)}},{key:"setLoop",value:function(Pt){this.callPlayer("setLoop",Pt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var Pt=this.props.display,Ht={width:"100%",height:"100%",display:Pt};return nt.default.createElement("div",{style:Ht},nt.default.createElement("div",{ref:this.ref}))}}]),Nt}(nt.Component);tt.default=Wt,Ct(Wt,"displayName","YouTube"),Ct(Wt,"canPlay",it.canPlay.youtube)}(YouTube$1)),YouTube$1}var SoundCloud={},hasRequiredSoundCloud;function requireSoundCloud(){return hasRequiredSoundCloud||(hasRequiredSoundCloud=1,function(tt){function et(At){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ct){return typeof Ct}:et=function(Ct){return Ct&&typeof Symbol=="function"&&Ct.constructor===Symbol&&Ct!==Symbol.prototype?"symbol":typeof Ct},et(At)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var At=new WeakMap;return ot=function(){return At},At}function at(At){if(At&&At.__esModule)return At;if(At===null||et(At)!=="object"&&typeof At!="function")return{default:At};var Et=ot();if(Et&&Et.has(At))return Et.get(At);var Ct={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var jt in At)if(Object.prototype.hasOwnProperty.call(At,jt)){var Rt=Lt?Object.getOwnPropertyDescriptor(At,jt):null;Rt&&(Rt.get||Rt.set)?Object.defineProperty(Ct,jt,Rt):Ct[jt]=At[jt]}return Ct.default=At,Et&&Et.set(At,Ct),Ct}function st(At,Et){var Ct=Object.keys(At);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(At);Et&&(Lt=Lt.filter(function(jt){return Object.getOwnPropertyDescriptor(At,jt).enumerable})),Ct.push.apply(Ct,Lt)}return Ct}function lt(At){for(var Et=1;Et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(At){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ct){return Ct.__proto__||Object.getPrototypeOf(Ct)},wt(At)}function xt(At,Et,Ct){return Et in At?Object.defineProperty(At,Et,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):At[Et]=Ct,At}var kt="https://w.soundcloud.com/player/api.js",St="SC",Tt=function(At){dt(Ct,At);var Et=mt(Ct);function Ct(){var Lt;ct(this,Ct);for(var jt=arguments.length,Rt=new Array(jt),$t=0;$t1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seekTo",jt*1e3),Rt||this.pause()}},{key:"setVolume",value:function(jt){this.callPlayer("setVolume",jt*100)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var jt=this.props.display,Rt={width:"100%",height:"100%",display:jt};return nt.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:Rt,frameBorder:0,allow:"autoplay"})}}]),Ct}(nt.Component);tt.default=Tt,xt(Tt,"displayName","SoundCloud"),xt(Tt,"canPlay",it.canPlay.soundcloud),xt(Tt,"loopOnEnded",!0)}(SoundCloud)),SoundCloud}var Vimeo={},hasRequiredVimeo;function requireVimeo(){return hasRequiredVimeo||(hasRequiredVimeo=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://player.vimeo.com/api/player.js",St="Vimeo",Tt=function(Ct){return Ct.replace("/manage/videos","")},At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"setMuted",value:function(Rt){this.callPlayer("setMuted",Rt)}},{key:"setLoop",value:function(Rt){this.callPlayer("setLoop",Rt)}},{key:"setPlaybackRate",value:function(Rt){this.callPlayer("setPlaybackRate",Rt)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var Rt=this.props.display,$t={width:"100%",height:"100%",overflow:"hidden",display:Rt};return nt.default.createElement("div",{key:this.props.url,ref:this.ref,style:$t})}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Vimeo"),xt(At,"canPlay",it.canPlay.vimeo),xt(At,"forceLoad",!0)}(Vimeo)),Vimeo}var Facebook={},hasRequiredFacebook;function requireFacebook(){return hasRequiredFacebook||(hasRequiredFacebook=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(){return st=Object.assign||function(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function bt(Et){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},bt(Et)}function wt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var xt="https://connect.facebook.net/en_US/sdk.js",kt="FB",St="fbAsyncInit",Tt="facebook-player-",At=function(Et){ht(Lt,Et);var Ct=pt(Lt);function Lt(){var jt;lt(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt=this.props.config.attributes,$t={width:"100%",height:"100%"};return nt.default.createElement("div",st({style:$t,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"},Rt))}}]),Lt}(nt.Component);tt.default=At,wt(At,"displayName","Facebook"),wt(At,"canPlay",it.canPlay.facebook),wt(At,"loopOnEnded",!0)}(Facebook)),Facebook}var Streamable={},hasRequiredStreamable;function requireStreamable(){return hasRequiredStreamable||(hasRequiredStreamable=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(At){return typeof At}:et=function(At){return At&&typeof Symbol=="function"&&At.constructor===Symbol&&At!==Symbol.prototype?"symbol":typeof At},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return ot=function(){return St},St}function at(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Tt=ot();if(Tt&&Tt.has(St))return Tt.get(St);var At={},Et=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ct in St)if(Object.prototype.hasOwnProperty.call(St,Ct)){var Lt=Et?Object.getOwnPropertyDescriptor(St,Ct):null;Lt&&(Lt.get||Lt.set)?Object.defineProperty(At,Ct,Lt):At[Ct]=St[Ct]}return At.default=St,Tt&&Tt.set(St,At),At}function st(St,Tt){if(!(St instanceof Tt))throw new TypeError("Cannot call a class as a function")}function lt(St,Tt){for(var At=0;At"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(St){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(At){return At.__proto__||Object.getPrototypeOf(At)},yt(St)}function bt(St,Tt,At){return Tt in St?Object.defineProperty(St,Tt,{value:At,enumerable:!0,configurable:!0,writable:!0}):St[Tt]=At,St}var wt="https://cdn.embed.ly/player-0.1.0.min.js",xt="playerjs",kt=function(St){ut(At,St);var Tt=dt(At);function At(){var Et;st(this,At);for(var Ct=arguments.length,Lt=new Array(Ct),jt=0;jt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",Ct),Lt||this.pause()}},{key:"setVolume",value:function(Ct){this.callPlayer("setVolume",Ct*100)}},{key:"setLoop",value:function(Ct){this.callPlayer("setLoop",Ct)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var Ct=this.props.url.match(it.MATCH_URL_STREAMABLE)[1],Lt={width:"100%",height:"100%"};return nt.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(Ct),frameBorder:"0",scrolling:"no",style:Lt,allow:"encrypted-media; autoplay; fullscreen;"})}}]),At}(nt.Component);tt.default=kt,bt(kt,"displayName","Streamable"),bt(kt,"canPlay",it.canPlay.streamable)}(Streamable)),Streamable}var Wistia={},hasRequiredWistia;function requireWistia(){return hasRequiredWistia||(hasRequiredWistia=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://fast.wistia.com/assets/external/E-v1.js",St="Wistia",Tt="wistia-player-",At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("time",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("volume",Rt)}},{key:"setPlaybackRate",value:function(Rt){this.callPlayer("playbackRate",Rt)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt=this.props.url,$t=Rt&&Rt.match(it.MATCH_URL_WISTIA)[1],vt="wistia_embed wistia_async_".concat($t),It={width:"100%",height:"100%"};return nt.default.createElement("div",{id:this.playerID,key:$t,className:vt,style:It})}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Wistia"),xt(At,"canPlay",it.canPlay.wistia),xt(At,"loopOnEnded",!0)}(Wistia)),Wistia}var Twitch={},hasRequiredTwitch;function requireTwitch(){return hasRequiredTwitch||(hasRequiredTwitch=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://player.twitch.tv/js/embed/v1.js",St="Twitch",Tt="twitch-player-",At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt={width:"100%",height:"100%"};return nt.default.createElement("div",{style:Rt,id:this.playerID})}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Twitch"),xt(At,"canPlay",it.canPlay.twitch),xt(At,"loopOnEnded",!0)}(Twitch)),Twitch}var DailyMotion={},hasRequiredDailyMotion;function requireDailyMotion(){return hasRequiredDailyMotion||(hasRequiredDailyMotion=1,function(tt){function et(vt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ot){return typeof Ot}:et=function(Ot){return Ot&&typeof Symbol=="function"&&Ot.constructor===Symbol&&Ot!==Symbol.prototype?"symbol":typeof Ot},et(vt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var vt=new WeakMap;return ot=function(){return vt},vt}function at(vt){if(vt&&vt.__esModule)return vt;if(vt===null||et(vt)!=="object"&&typeof vt!="function")return{default:vt};var It=ot();if(It&&It.has(vt))return It.get(vt);var Ot={},Wt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var zt in vt)if(Object.prototype.hasOwnProperty.call(vt,zt)){var Ft=Wt?Object.getOwnPropertyDescriptor(vt,zt):null;Ft&&(Ft.get||Ft.set)?Object.defineProperty(Ot,zt,Ft):Ot[zt]=vt[zt]}return Ot.default=vt,It&&It.set(vt,Ot),Ot}function st(vt,It){var Ot=Object.keys(vt);if(Object.getOwnPropertySymbols){var Wt=Object.getOwnPropertySymbols(vt);It&&(Wt=Wt.filter(function(zt){return Object.getOwnPropertyDescriptor(vt,zt).enumerable})),Ot.push.apply(Ot,Wt)}return Ot}function lt(vt){for(var It=1;Itvt.length)&&(It=vt.length);for(var Ot=0,Wt=new Array(It);Ot"u"||!(Symbol.iterator in Object(vt)))){var Ot=[],Wt=!0,zt=!1,Ft=void 0;try{for(var Nt=vt[Symbol.iterator](),Ut;!(Wt=(Ut=Nt.next()).done)&&(Ot.push(Ut.value),!(It&&Ot.length===It));Wt=!0);}catch(Pt){zt=!0,Ft=Pt}finally{try{!Wt&&Nt.return!=null&&Nt.return()}finally{if(zt)throw Ft}}return Ot}}function mt(vt){if(Array.isArray(vt))return vt}function gt(vt,It){if(!(vt instanceof It))throw new TypeError("Cannot call a class as a function")}function yt(vt,It){for(var Ot=0;Ot"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Et(vt){return Et=Object.setPrototypeOf?Object.getPrototypeOf:function(Ot){return Ot.__proto__||Object.getPrototypeOf(Ot)},Et(vt)}function Ct(vt,It,Ot){return It in vt?Object.defineProperty(vt,It,{value:Ot,enumerable:!0,configurable:!0,writable:!0}):vt[It]=Ot,vt}var Lt="https://api.dmcdn.net/all.js",jt="DM",Rt="dmAsyncInit",$t=function(vt){wt(Ot,vt);var It=kt(Ot);function Ot(){var Wt;gt(this,Ot);for(var zt=arguments.length,Ft=new Array(zt),Nt=0;Nt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",zt),Ft||this.pause()}},{key:"setVolume",value:function(zt){this.callPlayer("setVolume",zt)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var zt=this.props.display,Ft={width:"100%",height:"100%",display:zt};return nt.default.createElement("div",{style:Ft},nt.default.createElement("div",{ref:this.ref}))}}]),Ot}(nt.Component);tt.default=$t,Ct($t,"displayName","DailyMotion"),Ct($t,"canPlay",it.canPlay.dailymotion),Ct($t,"loopOnEnded",!0)}(DailyMotion)),DailyMotion}var Mixcloud={},hasRequiredMixcloud;function requireMixcloud(){return hasRequiredMixcloud||(hasRequiredMixcloud=1,function(tt){function et(At){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ct){return typeof Ct}:et=function(Ct){return Ct&&typeof Symbol=="function"&&Ct.constructor===Symbol&&Ct!==Symbol.prototype?"symbol":typeof Ct},et(At)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var At=new WeakMap;return ot=function(){return At},At}function at(At){if(At&&At.__esModule)return At;if(At===null||et(At)!=="object"&&typeof At!="function")return{default:At};var Et=ot();if(Et&&Et.has(At))return Et.get(At);var Ct={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var jt in At)if(Object.prototype.hasOwnProperty.call(At,jt)){var Rt=Lt?Object.getOwnPropertyDescriptor(At,jt):null;Rt&&(Rt.get||Rt.set)?Object.defineProperty(Ct,jt,Rt):Ct[jt]=At[jt]}return Ct.default=At,Et&&Et.set(At,Ct),Ct}function st(At,Et){var Ct=Object.keys(At);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(At);Et&&(Lt=Lt.filter(function(jt){return Object.getOwnPropertyDescriptor(At,jt).enumerable})),Ct.push.apply(Ct,Lt)}return Ct}function lt(At){for(var Et=1;Et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(At){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ct){return Ct.__proto__||Object.getPrototypeOf(Ct)},wt(At)}function xt(At,Et,Ct){return Et in At?Object.defineProperty(At,Et,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):At[Et]=Ct,At}var kt="https://widget.mixcloud.com/media/js/widgetApi.js",St="Mixcloud",Tt=function(At){dt(Ct,At);var Et=mt(Ct);function Ct(){var Lt;ct(this,Ct);for(var jt=arguments.length,Rt=new Array(jt),$t=0;$t1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",jt),Rt||this.pause()}},{key:"setVolume",value:function(jt){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var jt=this.props,Rt=jt.url,$t=jt.config,vt=Rt.match(it.MATCH_URL_MIXCLOUD)[1],It={width:"100%",height:"100%"},Ot=(0,rt.queryString)(lt(lt({},$t.options),{},{feed:"/".concat(vt,"/")}));return nt.default.createElement("iframe",{key:vt,ref:this.ref,style:It,src:"https://www.mixcloud.com/widget/iframe/?".concat(Ot),frameBorder:"0",allow:"autoplay"})}}]),Ct}(nt.Component);tt.default=Tt,xt(Tt,"displayName","Mixcloud"),xt(Tt,"canPlay",it.canPlay.mixcloud),xt(Tt,"loopOnEnded",!0)}(Mixcloud)),Mixcloud}var Vidyard={},hasRequiredVidyard;function requireVidyard(){return hasRequiredVidyard||(hasRequiredVidyard=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://play.vidyard.com/embed/v4.js",St="VidyardV4",Tt="onVidyardAPI",At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"setPlaybackRate",value:function(Rt){this.callPlayer("setPlaybackSpeed",Rt)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.callPlayer("currentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt=this.props.display,$t={width:"100%",height:"100%",display:Rt};return nt.default.createElement("div",{style:$t},nt.default.createElement("div",{ref:this.ref}))}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Vidyard"),xt(At,"canPlay",it.canPlay.vidyard)}(Vidyard)),Vidyard}var Kaltura={},hasRequiredKaltura;function requireKaltura(){return hasRequiredKaltura||(hasRequiredKaltura=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(At){return typeof At}:et=function(At){return At&&typeof Symbol=="function"&&At.constructor===Symbol&&At!==Symbol.prototype?"symbol":typeof At},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return ot=function(){return St},St}function at(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Tt=ot();if(Tt&&Tt.has(St))return Tt.get(St);var At={},Et=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ct in St)if(Object.prototype.hasOwnProperty.call(St,Ct)){var Lt=Et?Object.getOwnPropertyDescriptor(St,Ct):null;Lt&&(Lt.get||Lt.set)?Object.defineProperty(At,Ct,Lt):At[Ct]=St[Ct]}return At.default=St,Tt&&Tt.set(St,At),At}function st(St,Tt){if(!(St instanceof Tt))throw new TypeError("Cannot call a class as a function")}function lt(St,Tt){for(var At=0;At"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(St){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(At){return At.__proto__||Object.getPrototypeOf(At)},yt(St)}function bt(St,Tt,At){return Tt in St?Object.defineProperty(St,Tt,{value:At,enumerable:!0,configurable:!0,writable:!0}):St[Tt]=At,St}var wt="https://cdn.embed.ly/player-0.1.0.min.js",xt="playerjs",kt=function(St){ut(At,St);var Tt=dt(At);function At(){var Et;st(this,At);for(var Ct=arguments.length,Lt=new Array(Ct),jt=0;jt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",Ct),Lt||this.pause()}},{key:"setVolume",value:function(Ct){this.callPlayer("setVolume",Ct)}},{key:"setLoop",value:function(Ct){this.callPlayer("setLoop",Ct)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var Ct={width:"100%",height:"100%"};return nt.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:Ct,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}]),At}(nt.Component);tt.default=kt,bt(kt,"displayName","Kaltura"),bt(kt,"canPlay",it.canPlay.kaltura)}(Kaltura)),Kaltura}var FilePlayer={},hasRequiredFilePlayer;function requireFilePlayer(){return hasRequiredFilePlayer||(hasRequiredFilePlayer=1,function(tt){function et(Wt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ft){return typeof Ft}:et=function(Ft){return Ft&&typeof Symbol=="function"&&Ft.constructor===Symbol&&Ft!==Symbol.prototype?"symbol":typeof Ft},et(Wt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Wt=new WeakMap;return ot=function(){return Wt},Wt}function at(Wt){if(Wt&&Wt.__esModule)return Wt;if(Wt===null||et(Wt)!=="object"&&typeof Wt!="function")return{default:Wt};var zt=ot();if(zt&&zt.has(Wt))return zt.get(Wt);var Ft={},Nt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ut in Wt)if(Object.prototype.hasOwnProperty.call(Wt,Ut)){var Pt=Nt?Object.getOwnPropertyDescriptor(Wt,Ut):null;Pt&&(Pt.get||Pt.set)?Object.defineProperty(Ft,Ut,Pt):Ft[Ut]=Wt[Ut]}return Ft.default=Wt,zt&&zt.set(Wt,Ft),Ft}function st(){return st=Object.assign||function(Wt){for(var zt=1;zt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function bt(Wt){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ft){return Ft.__proto__||Object.getPrototypeOf(Ft)},bt(Wt)}function wt(Wt,zt,Ft){return zt in Wt?Object.defineProperty(Wt,zt,{value:Ft,enumerable:!0,configurable:!0,writable:!0}):Wt[zt]=Ft,Wt}var xt=typeof navigator<"u",kt=xt&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,St=xt&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||kt)&&!window.MSStream,Tt=xt&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,At="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",Et="Hls",Ct="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",Lt="dashjs",jt="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",Rt="flvjs",$t=/www\.dropbox\.com\/.+/,vt=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,It="https://videodelivery.net/{id}/manifest/video.m3u8",Ot=function(Wt){ht(Ft,Wt);var zt=pt(Ft);function Ft(){var Nt;lt(this,Ft);for(var Ut=arguments.length,Pt=new Array(Ut),Ht=0;Ht1&&arguments[1]!==void 0?arguments[1]:!0;this.player.currentTime=Ut,Pt||this.pause()}},{key:"setVolume",value:function(Ut){this.player.volume=Ut}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,rt.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,rt.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(Ut){try{this.player.playbackRate=Ut}catch(Pt){this.props.onError(Pt)}}},{key:"getDuration",value:function(){if(!this.player)return null;var Ut=this.player,Pt=Ut.duration,Ht=Ut.seekable;return Pt===1/0&&Ht.length>0?Ht.end(Ht.length-1):Pt}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var Ut=this.player.buffered;if(Ut.length===0)return 0;var Pt=Ut.end(Ut.length-1),Ht=this.getDuration();return Pt>Ht?Ht:Pt}},{key:"getSource",value:function(Ut){var Pt=this.shouldUseHLS(Ut),Ht=this.shouldUseDASH(Ut),Qt=this.shouldUseFLV(Ut);if(!(Ut instanceof Array||(0,rt.isMediaStream)(Ut)||Pt||Ht||Qt))return $t.test(Ut)?Ut.replace("www.dropbox.com","dl.dropboxusercontent.com"):Ut}},{key:"render",value:function(){var Ut=this.props,Pt=Ut.url,Ht=Ut.playing,Qt=Ut.loop,an=Ut.controls,Yt=Ut.muted,nn=Ut.config,tn=Ut.width,dn=Ut.height,wn=this.shouldUseAudio(this.props),rn=wn?"audio":"video",Jt={width:tn==="auto"?tn:"100%",height:dn==="auto"?dn:"100%"};return nt.default.createElement(rn,st({ref:this.ref,src:this.getSource(Pt),style:Jt,preload:"auto",autoPlay:Ht||void 0,controls:an,muted:Yt,loop:Qt},nn.attributes),Pt instanceof Array&&Pt.map(this.renderSourceElement),nn.tracks.map(this.renderTrack))}}]),Ft}(nt.Component);tt.default=Ot,wt(Ot,"displayName","FilePlayer"),wt(Ot,"canPlay",it.canPlay.file)}(FilePlayer)),FilePlayer}(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var et=reactExports,nt=utils,rt=patterns;function it(lt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?it=function(ut){return typeof ut}:it=function(ut){return ut&&typeof Symbol=="function"&&ut.constructor===Symbol&&ut!==Symbol.prototype?"symbol":typeof ut},it(lt)}function ot(){if(typeof WeakMap!="function")return null;var lt=new WeakMap;return ot=function(){return lt},lt}function at(lt){if(lt&<.__esModule)return lt;if(lt===null||it(lt)!=="object"&&typeof lt!="function")return{default:lt};var ct=ot();if(ct&&ct.has(lt))return ct.get(lt);var ut={},ht=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var dt in lt)if(Object.prototype.hasOwnProperty.call(lt,dt)){var pt=ht?Object.getOwnPropertyDescriptor(lt,dt):null;pt&&(pt.get||pt.set)?Object.defineProperty(ut,dt,pt):ut[dt]=lt[dt]}return ut.default=lt,ct&&ct.set(lt,ut),ut}var st=[{key:"youtube",name:"YouTube",canPlay:rt.canPlay.youtube,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireYouTube())})})},{key:"soundcloud",name:"SoundCloud",canPlay:rt.canPlay.soundcloud,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireSoundCloud())})})},{key:"vimeo",name:"Vimeo",canPlay:rt.canPlay.vimeo,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireVimeo())})})},{key:"facebook",name:"Facebook",canPlay:rt.canPlay.facebook,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireFacebook())})})},{key:"streamable",name:"Streamable",canPlay:rt.canPlay.streamable,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireStreamable())})})},{key:"wistia",name:"Wistia",canPlay:rt.canPlay.wistia,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireWistia())})})},{key:"twitch",name:"Twitch",canPlay:rt.canPlay.twitch,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireTwitch())})})},{key:"dailymotion",name:"DailyMotion",canPlay:rt.canPlay.dailymotion,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireDailyMotion())})})},{key:"mixcloud",name:"Mixcloud",canPlay:rt.canPlay.mixcloud,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireMixcloud())})})},{key:"vidyard",name:"Vidyard",canPlay:rt.canPlay.vidyard,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireVidyard())})})},{key:"kaltura",name:"Kaltura",canPlay:rt.canPlay.kaltura,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireKaltura())})})},{key:"file",name:"FilePlayer",canPlay:rt.canPlay.file,canEnablePIP:function(ct){return rt.canPlay.file(ct)&&(document.pictureInPictureEnabled||(0,nt.supportsWebKitPresentationMode)())&&!rt.AUDIO_EXTENSIONS.test(ct)},lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireFilePlayer())})})}];tt.default=st})(players);var ReactPlayer$1={},safeIsNaN=Number.isNaN||function tt(et){return typeof et=="number"&&et!==et};function isEqual(tt,et){return!!(tt===et||safeIsNaN(tt)&&safeIsNaN(et))}function areInputsEqual(tt,et){if(tt.length!==et.length)return!1;for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function xt(At){return xt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ct){return Ct.__proto__||Object.getPrototypeOf(Ct)},xt(At)}function kt(At,Et,Ct){return Et in At?Object.defineProperty(At,Et,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):At[Et]=Ct,At}var St=5e3,Tt=function(At){pt(Ct,At);var Et=gt(Ct);function Ct(){var Lt;ut(this,Ct);for(var jt=arguments.length,Rt=new Array(jt),$t=0;$t0&&jt<1;if(It){var Ot=this.player.getDuration();if(!Ot){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(Ot*jt,$t);return}this.player.seekTo(jt,$t)}},{key:"render",value:function(){var jt=this.props.activePlayer;return jt?nt.default.createElement(jt,ct({},this.props,{onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}]),Ct}(nt.Component);tt.default=Tt,kt(Tt,"displayName","Player"),kt(Tt,"propTypes",it.propTypes),kt(Tt,"defaultProps",it.defaultProps)})(Player);var Preview$1={},hasRequiredPreview;function requirePreview(){return hasRequiredPreview||(hasRequiredPreview=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(At){return typeof At}:et=function(At){return At&&typeof Symbol=="function"&&At.constructor===Symbol&&At!==Symbol.prototype?"symbol":typeof At},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=it(reactExports);function rt(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return rt=function(){return St},St}function it(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Tt=rt();if(Tt&&Tt.has(St))return Tt.get(St);var At={},Et=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ct in St)if(Object.prototype.hasOwnProperty.call(St,Ct)){var Lt=Et?Object.getOwnPropertyDescriptor(St,Ct):null;Lt&&(Lt.get||Lt.set)?Object.defineProperty(At,Ct,Lt):At[Ct]=St[Ct]}return At.default=St,Tt&&Tt.set(St,At),At}function ot(St,Tt){var At=Object.keys(St);if(Object.getOwnPropertySymbols){var Et=Object.getOwnPropertySymbols(St);Tt&&(Et=Et.filter(function(Ct){return Object.getOwnPropertyDescriptor(St,Ct).enumerable})),At.push.apply(At,Et)}return At}function at(St){for(var Tt=1;Tt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(St){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(At){return At.__proto__||Object.getPrototypeOf(At)},yt(St)}function bt(St,Tt,At){return Tt in St?Object.defineProperty(St,Tt,{value:At,enumerable:!0,configurable:!0,writable:!0}):St[Tt]=At,St}var wt="64px",xt={},kt=function(St){ut(At,St);var Tt=dt(At);function At(){var Et;st(this,At);for(var Ct=arguments.length,Lt=new Array(Ct),jt=0;jtzt.length)&&(Ft=zt.length);for(var Nt=0,Ut=new Array(Ft);Nt"u"||!(Symbol.iterator in Object(zt)))){var Nt=[],Ut=!0,Pt=!1,Ht=void 0;try{for(var Qt=zt[Symbol.iterator](),an;!(Ut=(an=Qt.next()).done)&&(Nt.push(an.value),!(Ft&&Nt.length===Ft));Ut=!0);}catch(Yt){Pt=!0,Ht=Yt}finally{try{!Ut&&Qt.return!=null&&Qt.return()}finally{if(Pt)throw Ht}}return Nt}}function mt(zt){if(Array.isArray(zt))return zt}function gt(zt,Ft){if(!(zt instanceof Ft))throw new TypeError("Cannot call a class as a function")}function yt(zt,Ft){for(var Nt=0;Nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Et(zt){return Et=Object.setPrototypeOf?Object.getPrototypeOf:function(Nt){return Nt.__proto__||Object.getPrototypeOf(Nt)},Et(zt)}function Ct(zt,Ft,Nt){return Ft in zt?Object.defineProperty(zt,Ft,{value:Nt,enumerable:!0,configurable:!0,writable:!0}):zt[Ft]=Nt,zt}var Lt="https://www.youtube.com/iframe_api",jt="YT",Rt="onYouTubeIframeAPIReady",$t=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,vt=/user\/([a-zA-Z0-9_-]+)\/?/,It=/youtube-nocookie\.com/,Ot="https://www.youtube-nocookie.com",Wt=function(zt){wt(Nt,zt);var Ft=kt(Nt);function Nt(){var Ut;gt(this,Nt);for(var Pt=arguments.length,Ht=new Array(Pt),Qt=0;Qt1&&arguments[1]!==void 0?arguments[1]:!1;this.callPlayer("seekTo",Pt),!Ht&&!this.props.playing&&this.pause()}},{key:"setVolume",value:function(Pt){this.callPlayer("setVolume",Pt*100)}},{key:"setPlaybackRate",value:function(Pt){this.callPlayer("setPlaybackRate",Pt)}},{key:"setLoop",value:function(Pt){this.callPlayer("setLoop",Pt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var Pt=this.props.display,Ht={width:"100%",height:"100%",display:Pt};return nt.default.createElement("div",{style:Ht},nt.default.createElement("div",{ref:this.ref}))}}]),Nt}(nt.Component);tt.default=Wt,Ct(Wt,"displayName","YouTube"),Ct(Wt,"canPlay",it.canPlay.youtube)}(YouTube$1)),YouTube$1}var SoundCloud={},hasRequiredSoundCloud;function requireSoundCloud(){return hasRequiredSoundCloud||(hasRequiredSoundCloud=1,function(tt){function et(At){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ct){return typeof Ct}:et=function(Ct){return Ct&&typeof Symbol=="function"&&Ct.constructor===Symbol&&Ct!==Symbol.prototype?"symbol":typeof Ct},et(At)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var At=new WeakMap;return ot=function(){return At},At}function at(At){if(At&&At.__esModule)return At;if(At===null||et(At)!=="object"&&typeof At!="function")return{default:At};var Et=ot();if(Et&&Et.has(At))return Et.get(At);var Ct={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var jt in At)if(Object.prototype.hasOwnProperty.call(At,jt)){var Rt=Lt?Object.getOwnPropertyDescriptor(At,jt):null;Rt&&(Rt.get||Rt.set)?Object.defineProperty(Ct,jt,Rt):Ct[jt]=At[jt]}return Ct.default=At,Et&&Et.set(At,Ct),Ct}function st(At,Et){var Ct=Object.keys(At);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(At);Et&&(Lt=Lt.filter(function(jt){return Object.getOwnPropertyDescriptor(At,jt).enumerable})),Ct.push.apply(Ct,Lt)}return Ct}function lt(At){for(var Et=1;Et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(At){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ct){return Ct.__proto__||Object.getPrototypeOf(Ct)},wt(At)}function xt(At,Et,Ct){return Et in At?Object.defineProperty(At,Et,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):At[Et]=Ct,At}var kt="https://w.soundcloud.com/player/api.js",St="SC",Tt=function(At){dt(Ct,At);var Et=mt(Ct);function Ct(){var Lt;ct(this,Ct);for(var jt=arguments.length,Rt=new Array(jt),$t=0;$t1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seekTo",jt*1e3),Rt||this.pause()}},{key:"setVolume",value:function(jt){this.callPlayer("setVolume",jt*100)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var jt=this.props.display,Rt={width:"100%",height:"100%",display:jt};return nt.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:Rt,frameBorder:0,allow:"autoplay"})}}]),Ct}(nt.Component);tt.default=Tt,xt(Tt,"displayName","SoundCloud"),xt(Tt,"canPlay",it.canPlay.soundcloud),xt(Tt,"loopOnEnded",!0)}(SoundCloud)),SoundCloud}var Vimeo={},hasRequiredVimeo;function requireVimeo(){return hasRequiredVimeo||(hasRequiredVimeo=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://player.vimeo.com/api/player.js",St="Vimeo",Tt=function(Ct){return Ct.replace("/manage/videos","")},At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"setMuted",value:function(Rt){this.callPlayer("setMuted",Rt)}},{key:"setLoop",value:function(Rt){this.callPlayer("setLoop",Rt)}},{key:"setPlaybackRate",value:function(Rt){this.callPlayer("setPlaybackRate",Rt)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var Rt=this.props.display,$t={width:"100%",height:"100%",overflow:"hidden",display:Rt};return nt.default.createElement("div",{key:this.props.url,ref:this.ref,style:$t})}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Vimeo"),xt(At,"canPlay",it.canPlay.vimeo),xt(At,"forceLoad",!0)}(Vimeo)),Vimeo}var Facebook={},hasRequiredFacebook;function requireFacebook(){return hasRequiredFacebook||(hasRequiredFacebook=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(){return st=Object.assign||function(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function bt(Et){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},bt(Et)}function wt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var xt="https://connect.facebook.net/en_US/sdk.js",kt="FB",St="fbAsyncInit",Tt="facebook-player-",At=function(Et){ht(Lt,Et);var Ct=pt(Lt);function Lt(){var jt;lt(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt=this.props.config.attributes,$t={width:"100%",height:"100%"};return nt.default.createElement("div",st({style:$t,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"},Rt))}}]),Lt}(nt.Component);tt.default=At,wt(At,"displayName","Facebook"),wt(At,"canPlay",it.canPlay.facebook),wt(At,"loopOnEnded",!0)}(Facebook)),Facebook}var Streamable={},hasRequiredStreamable;function requireStreamable(){return hasRequiredStreamable||(hasRequiredStreamable=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(At){return typeof At}:et=function(At){return At&&typeof Symbol=="function"&&At.constructor===Symbol&&At!==Symbol.prototype?"symbol":typeof At},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return ot=function(){return St},St}function at(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Tt=ot();if(Tt&&Tt.has(St))return Tt.get(St);var At={},Et=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ct in St)if(Object.prototype.hasOwnProperty.call(St,Ct)){var Lt=Et?Object.getOwnPropertyDescriptor(St,Ct):null;Lt&&(Lt.get||Lt.set)?Object.defineProperty(At,Ct,Lt):At[Ct]=St[Ct]}return At.default=St,Tt&&Tt.set(St,At),At}function st(St,Tt){if(!(St instanceof Tt))throw new TypeError("Cannot call a class as a function")}function lt(St,Tt){for(var At=0;At"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(St){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(At){return At.__proto__||Object.getPrototypeOf(At)},yt(St)}function bt(St,Tt,At){return Tt in St?Object.defineProperty(St,Tt,{value:At,enumerable:!0,configurable:!0,writable:!0}):St[Tt]=At,St}var wt="https://cdn.embed.ly/player-0.1.0.min.js",xt="playerjs",kt=function(St){ut(At,St);var Tt=dt(At);function At(){var Et;st(this,At);for(var Ct=arguments.length,Lt=new Array(Ct),jt=0;jt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",Ct),Lt||this.pause()}},{key:"setVolume",value:function(Ct){this.callPlayer("setVolume",Ct*100)}},{key:"setLoop",value:function(Ct){this.callPlayer("setLoop",Ct)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var Ct=this.props.url.match(it.MATCH_URL_STREAMABLE)[1],Lt={width:"100%",height:"100%"};return nt.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(Ct),frameBorder:"0",scrolling:"no",style:Lt,allow:"encrypted-media; autoplay; fullscreen;"})}}]),At}(nt.Component);tt.default=kt,bt(kt,"displayName","Streamable"),bt(kt,"canPlay",it.canPlay.streamable)}(Streamable)),Streamable}var Wistia={},hasRequiredWistia;function requireWistia(){return hasRequiredWistia||(hasRequiredWistia=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://fast.wistia.com/assets/external/E-v1.js",St="Wistia",Tt="wistia-player-",At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("time",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("volume",Rt)}},{key:"setPlaybackRate",value:function(Rt){this.callPlayer("playbackRate",Rt)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt=this.props.url,$t=Rt&&Rt.match(it.MATCH_URL_WISTIA)[1],vt="wistia_embed wistia_async_".concat($t),It={width:"100%",height:"100%"};return nt.default.createElement("div",{id:this.playerID,key:$t,className:vt,style:It})}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Wistia"),xt(At,"canPlay",it.canPlay.wistia),xt(At,"loopOnEnded",!0)}(Wistia)),Wistia}var Twitch={},hasRequiredTwitch;function requireTwitch(){return hasRequiredTwitch||(hasRequiredTwitch=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://player.twitch.tv/js/embed/v1.js",St="Twitch",Tt="twitch-player-",At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt={width:"100%",height:"100%"};return nt.default.createElement("div",{style:Rt,id:this.playerID})}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Twitch"),xt(At,"canPlay",it.canPlay.twitch),xt(At,"loopOnEnded",!0)}(Twitch)),Twitch}var DailyMotion={},hasRequiredDailyMotion;function requireDailyMotion(){return hasRequiredDailyMotion||(hasRequiredDailyMotion=1,function(tt){function et(vt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ot){return typeof Ot}:et=function(Ot){return Ot&&typeof Symbol=="function"&&Ot.constructor===Symbol&&Ot!==Symbol.prototype?"symbol":typeof Ot},et(vt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var vt=new WeakMap;return ot=function(){return vt},vt}function at(vt){if(vt&&vt.__esModule)return vt;if(vt===null||et(vt)!=="object"&&typeof vt!="function")return{default:vt};var It=ot();if(It&&It.has(vt))return It.get(vt);var Ot={},Wt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var zt in vt)if(Object.prototype.hasOwnProperty.call(vt,zt)){var Ft=Wt?Object.getOwnPropertyDescriptor(vt,zt):null;Ft&&(Ft.get||Ft.set)?Object.defineProperty(Ot,zt,Ft):Ot[zt]=vt[zt]}return Ot.default=vt,It&&It.set(vt,Ot),Ot}function st(vt,It){var Ot=Object.keys(vt);if(Object.getOwnPropertySymbols){var Wt=Object.getOwnPropertySymbols(vt);It&&(Wt=Wt.filter(function(zt){return Object.getOwnPropertyDescriptor(vt,zt).enumerable})),Ot.push.apply(Ot,Wt)}return Ot}function lt(vt){for(var It=1;Itvt.length)&&(It=vt.length);for(var Ot=0,Wt=new Array(It);Ot"u"||!(Symbol.iterator in Object(vt)))){var Ot=[],Wt=!0,zt=!1,Ft=void 0;try{for(var Nt=vt[Symbol.iterator](),Ut;!(Wt=(Ut=Nt.next()).done)&&(Ot.push(Ut.value),!(It&&Ot.length===It));Wt=!0);}catch(Pt){zt=!0,Ft=Pt}finally{try{!Wt&&Nt.return!=null&&Nt.return()}finally{if(zt)throw Ft}}return Ot}}function mt(vt){if(Array.isArray(vt))return vt}function gt(vt,It){if(!(vt instanceof It))throw new TypeError("Cannot call a class as a function")}function yt(vt,It){for(var Ot=0;Ot"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Et(vt){return Et=Object.setPrototypeOf?Object.getPrototypeOf:function(Ot){return Ot.__proto__||Object.getPrototypeOf(Ot)},Et(vt)}function Ct(vt,It,Ot){return It in vt?Object.defineProperty(vt,It,{value:Ot,enumerable:!0,configurable:!0,writable:!0}):vt[It]=Ot,vt}var Lt="https://api.dmcdn.net/all.js",jt="DM",Rt="dmAsyncInit",$t=function(vt){wt(Ot,vt);var It=kt(Ot);function Ot(){var Wt;gt(this,Ot);for(var zt=arguments.length,Ft=new Array(zt),Nt=0;Nt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",zt),Ft||this.pause()}},{key:"setVolume",value:function(zt){this.callPlayer("setVolume",zt)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var zt=this.props.display,Ft={width:"100%",height:"100%",display:zt};return nt.default.createElement("div",{style:Ft},nt.default.createElement("div",{ref:this.ref}))}}]),Ot}(nt.Component);tt.default=$t,Ct($t,"displayName","DailyMotion"),Ct($t,"canPlay",it.canPlay.dailymotion),Ct($t,"loopOnEnded",!0)}(DailyMotion)),DailyMotion}var Mixcloud={},hasRequiredMixcloud;function requireMixcloud(){return hasRequiredMixcloud||(hasRequiredMixcloud=1,function(tt){function et(At){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ct){return typeof Ct}:et=function(Ct){return Ct&&typeof Symbol=="function"&&Ct.constructor===Symbol&&Ct!==Symbol.prototype?"symbol":typeof Ct},et(At)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var At=new WeakMap;return ot=function(){return At},At}function at(At){if(At&&At.__esModule)return At;if(At===null||et(At)!=="object"&&typeof At!="function")return{default:At};var Et=ot();if(Et&&Et.has(At))return Et.get(At);var Ct={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var jt in At)if(Object.prototype.hasOwnProperty.call(At,jt)){var Rt=Lt?Object.getOwnPropertyDescriptor(At,jt):null;Rt&&(Rt.get||Rt.set)?Object.defineProperty(Ct,jt,Rt):Ct[jt]=At[jt]}return Ct.default=At,Et&&Et.set(At,Ct),Ct}function st(At,Et){var Ct=Object.keys(At);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(At);Et&&(Lt=Lt.filter(function(jt){return Object.getOwnPropertyDescriptor(At,jt).enumerable})),Ct.push.apply(Ct,Lt)}return Ct}function lt(At){for(var Et=1;Et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(At){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ct){return Ct.__proto__||Object.getPrototypeOf(Ct)},wt(At)}function xt(At,Et,Ct){return Et in At?Object.defineProperty(At,Et,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):At[Et]=Ct,At}var kt="https://widget.mixcloud.com/media/js/widgetApi.js",St="Mixcloud",Tt=function(At){dt(Ct,At);var Et=mt(Ct);function Ct(){var Lt;ct(this,Ct);for(var jt=arguments.length,Rt=new Array(jt),$t=0;$t1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",jt),Rt||this.pause()}},{key:"setVolume",value:function(jt){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var jt=this.props,Rt=jt.url,$t=jt.config,vt=Rt.match(it.MATCH_URL_MIXCLOUD)[1],It={width:"100%",height:"100%"},Ot=(0,rt.queryString)(lt(lt({},$t.options),{},{feed:"/".concat(vt,"/")}));return nt.default.createElement("iframe",{key:vt,ref:this.ref,style:It,src:"https://www.mixcloud.com/widget/iframe/?".concat(Ot),frameBorder:"0",allow:"autoplay"})}}]),Ct}(nt.Component);tt.default=Tt,xt(Tt,"displayName","Mixcloud"),xt(Tt,"canPlay",it.canPlay.mixcloud),xt(Tt,"loopOnEnded",!0)}(Mixcloud)),Mixcloud}var Vidyard={},hasRequiredVidyard;function requireVidyard(){return hasRequiredVidyard||(hasRequiredVidyard=1,function(tt){function et(Et){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Lt){return typeof Lt}:et=function(Lt){return Lt&&typeof Symbol=="function"&&Lt.constructor===Symbol&&Lt!==Symbol.prototype?"symbol":typeof Lt},et(Et)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Et=new WeakMap;return ot=function(){return Et},Et}function at(Et){if(Et&&Et.__esModule)return Et;if(Et===null||et(Et)!=="object"&&typeof Et!="function")return{default:Et};var Ct=ot();if(Ct&&Ct.has(Et))return Ct.get(Et);var Lt={},jt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Rt in Et)if(Object.prototype.hasOwnProperty.call(Et,Rt)){var $t=jt?Object.getOwnPropertyDescriptor(Et,Rt):null;$t&&($t.get||$t.set)?Object.defineProperty(Lt,Rt,$t):Lt[Rt]=Et[Rt]}return Lt.default=Et,Ct&&Ct.set(Et,Lt),Lt}function st(Et,Ct){var Lt=Object.keys(Et);if(Object.getOwnPropertySymbols){var jt=Object.getOwnPropertySymbols(Et);Ct&&(jt=jt.filter(function(Rt){return Object.getOwnPropertyDescriptor(Et,Rt).enumerable})),Lt.push.apply(Lt,jt)}return Lt}function lt(Et){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Et){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Lt){return Lt.__proto__||Object.getPrototypeOf(Lt)},wt(Et)}function xt(Et,Ct,Lt){return Ct in Et?Object.defineProperty(Et,Ct,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Et[Ct]=Lt,Et}var kt="https://play.vidyard.com/embed/v4.js",St="VidyardV4",Tt="onVidyardAPI",At=function(Et){dt(Lt,Et);var Ct=mt(Lt);function Lt(){var jt;ct(this,Lt);for(var Rt=arguments.length,$t=new Array(Rt),vt=0;vt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Rt),$t||this.pause()}},{key:"setVolume",value:function(Rt){this.callPlayer("setVolume",Rt)}},{key:"setPlaybackRate",value:function(Rt){this.callPlayer("setPlaybackSpeed",Rt)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.callPlayer("currentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Rt=this.props.display,$t={width:"100%",height:"100%",display:Rt};return nt.default.createElement("div",{style:$t},nt.default.createElement("div",{ref:this.ref}))}}]),Lt}(nt.Component);tt.default=At,xt(At,"displayName","Vidyard"),xt(At,"canPlay",it.canPlay.vidyard)}(Vidyard)),Vidyard}var Kaltura={},hasRequiredKaltura;function requireKaltura(){return hasRequiredKaltura||(hasRequiredKaltura=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(At){return typeof At}:et=function(At){return At&&typeof Symbol=="function"&&At.constructor===Symbol&&At!==Symbol.prototype?"symbol":typeof At},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return ot=function(){return St},St}function at(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Tt=ot();if(Tt&&Tt.has(St))return Tt.get(St);var At={},Et=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ct in St)if(Object.prototype.hasOwnProperty.call(St,Ct)){var Lt=Et?Object.getOwnPropertyDescriptor(St,Ct):null;Lt&&(Lt.get||Lt.set)?Object.defineProperty(At,Ct,Lt):At[Ct]=St[Ct]}return At.default=St,Tt&&Tt.set(St,At),At}function st(St,Tt){if(!(St instanceof Tt))throw new TypeError("Cannot call a class as a function")}function lt(St,Tt){for(var At=0;At"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(St){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(At){return At.__proto__||Object.getPrototypeOf(At)},yt(St)}function bt(St,Tt,At){return Tt in St?Object.defineProperty(St,Tt,{value:At,enumerable:!0,configurable:!0,writable:!0}):St[Tt]=At,St}var wt="https://cdn.embed.ly/player-0.1.0.min.js",xt="playerjs",kt=function(St){ut(At,St);var Tt=dt(At);function At(){var Et;st(this,At);for(var Ct=arguments.length,Lt=new Array(Ct),jt=0;jt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",Ct),Lt||this.pause()}},{key:"setVolume",value:function(Ct){this.callPlayer("setVolume",Ct)}},{key:"setLoop",value:function(Ct){this.callPlayer("setLoop",Ct)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var Ct={width:"100%",height:"100%"};return nt.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:Ct,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}]),At}(nt.Component);tt.default=kt,bt(kt,"displayName","Kaltura"),bt(kt,"canPlay",it.canPlay.kaltura)}(Kaltura)),Kaltura}var FilePlayer={},hasRequiredFilePlayer;function requireFilePlayer(){return hasRequiredFilePlayer||(hasRequiredFilePlayer=1,function(tt){function et(Wt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ft){return typeof Ft}:et=function(Ft){return Ft&&typeof Symbol=="function"&&Ft.constructor===Symbol&&Ft!==Symbol.prototype?"symbol":typeof Ft},et(Wt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),rt=utils,it=patterns;function ot(){if(typeof WeakMap!="function")return null;var Wt=new WeakMap;return ot=function(){return Wt},Wt}function at(Wt){if(Wt&&Wt.__esModule)return Wt;if(Wt===null||et(Wt)!=="object"&&typeof Wt!="function")return{default:Wt};var zt=ot();if(zt&&zt.has(Wt))return zt.get(Wt);var Ft={},Nt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ut in Wt)if(Object.prototype.hasOwnProperty.call(Wt,Ut)){var Pt=Nt?Object.getOwnPropertyDescriptor(Wt,Ut):null;Pt&&(Pt.get||Pt.set)?Object.defineProperty(Ft,Ut,Pt):Ft[Ut]=Wt[Ut]}return Ft.default=Wt,zt&&zt.set(Wt,Ft),Ft}function st(){return st=Object.assign||function(Wt){for(var zt=1;zt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function bt(Wt){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ft){return Ft.__proto__||Object.getPrototypeOf(Ft)},bt(Wt)}function wt(Wt,zt,Ft){return zt in Wt?Object.defineProperty(Wt,zt,{value:Ft,enumerable:!0,configurable:!0,writable:!0}):Wt[zt]=Ft,Wt}var xt=typeof navigator<"u",kt=xt&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,St=xt&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||kt)&&!window.MSStream,Tt=xt&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,At="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",Et="Hls",Ct="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",Lt="dashjs",jt="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",Rt="flvjs",$t=/www\.dropbox\.com\/.+/,vt=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,It="https://videodelivery.net/{id}/manifest/video.m3u8",Ot=function(Wt){ht(Ft,Wt);var zt=pt(Ft);function Ft(){var Nt;lt(this,Ft);for(var Ut=arguments.length,Pt=new Array(Ut),Ht=0;Ht1&&arguments[1]!==void 0?arguments[1]:!0;this.player.currentTime=Ut,Pt||this.pause()}},{key:"setVolume",value:function(Ut){this.player.volume=Ut}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,rt.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,rt.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(Ut){try{this.player.playbackRate=Ut}catch(Pt){this.props.onError(Pt)}}},{key:"getDuration",value:function(){if(!this.player)return null;var Ut=this.player,Pt=Ut.duration,Ht=Ut.seekable;return Pt===1/0&&Ht.length>0?Ht.end(Ht.length-1):Pt}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var Ut=this.player.buffered;if(Ut.length===0)return 0;var Pt=Ut.end(Ut.length-1),Ht=this.getDuration();return Pt>Ht?Ht:Pt}},{key:"getSource",value:function(Ut){var Pt=this.shouldUseHLS(Ut),Ht=this.shouldUseDASH(Ut),Qt=this.shouldUseFLV(Ut);if(!(Ut instanceof Array||(0,rt.isMediaStream)(Ut)||Pt||Ht||Qt))return $t.test(Ut)?Ut.replace("www.dropbox.com","dl.dropboxusercontent.com"):Ut}},{key:"render",value:function(){var Ut=this.props,Pt=Ut.url,Ht=Ut.playing,Qt=Ut.loop,an=Ut.controls,Yt=Ut.muted,nn=Ut.config,tn=Ut.width,dn=Ut.height,wn=this.shouldUseAudio(this.props),rn=wn?"audio":"video",Zt={width:tn==="auto"?tn:"100%",height:dn==="auto"?dn:"100%"};return nt.default.createElement(rn,st({ref:this.ref,src:this.getSource(Pt),style:Zt,preload:"auto",autoPlay:Ht||void 0,controls:an,muted:Yt,loop:Qt},nn.attributes),Pt instanceof Array&&Pt.map(this.renderSourceElement),nn.tracks.map(this.renderTrack))}}]),Ft}(nt.Component);tt.default=Ot,wt(Ot,"displayName","FilePlayer"),wt(Ot,"canPlay",it.canPlay.file)}(FilePlayer)),FilePlayer}(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var et=reactExports,nt=utils,rt=patterns;function it(lt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?it=function(ut){return typeof ut}:it=function(ut){return ut&&typeof Symbol=="function"&&ut.constructor===Symbol&&ut!==Symbol.prototype?"symbol":typeof ut},it(lt)}function ot(){if(typeof WeakMap!="function")return null;var lt=new WeakMap;return ot=function(){return lt},lt}function at(lt){if(lt&<.__esModule)return lt;if(lt===null||it(lt)!=="object"&&typeof lt!="function")return{default:lt};var ct=ot();if(ct&&ct.has(lt))return ct.get(lt);var ut={},ht=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var dt in lt)if(Object.prototype.hasOwnProperty.call(lt,dt)){var pt=ht?Object.getOwnPropertyDescriptor(lt,dt):null;pt&&(pt.get||pt.set)?Object.defineProperty(ut,dt,pt):ut[dt]=lt[dt]}return ut.default=lt,ct&&ct.set(lt,ut),ut}var st=[{key:"youtube",name:"YouTube",canPlay:rt.canPlay.youtube,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireYouTube())})})},{key:"soundcloud",name:"SoundCloud",canPlay:rt.canPlay.soundcloud,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireSoundCloud())})})},{key:"vimeo",name:"Vimeo",canPlay:rt.canPlay.vimeo,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireVimeo())})})},{key:"facebook",name:"Facebook",canPlay:rt.canPlay.facebook,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireFacebook())})})},{key:"streamable",name:"Streamable",canPlay:rt.canPlay.streamable,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireStreamable())})})},{key:"wistia",name:"Wistia",canPlay:rt.canPlay.wistia,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireWistia())})})},{key:"twitch",name:"Twitch",canPlay:rt.canPlay.twitch,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireTwitch())})})},{key:"dailymotion",name:"DailyMotion",canPlay:rt.canPlay.dailymotion,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireDailyMotion())})})},{key:"mixcloud",name:"Mixcloud",canPlay:rt.canPlay.mixcloud,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireMixcloud())})})},{key:"vidyard",name:"Vidyard",canPlay:rt.canPlay.vidyard,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireVidyard())})})},{key:"kaltura",name:"Kaltura",canPlay:rt.canPlay.kaltura,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireKaltura())})})},{key:"file",name:"FilePlayer",canPlay:rt.canPlay.file,canEnablePIP:function(ct){return rt.canPlay.file(ct)&&(document.pictureInPictureEnabled||(0,nt.supportsWebKitPresentationMode)())&&!rt.AUDIO_EXTENSIONS.test(ct)},lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireFilePlayer())})})}];tt.default=st})(players);var ReactPlayer$1={},safeIsNaN=Number.isNaN||function tt(et){return typeof et=="number"&&et!==et};function isEqual(tt,et){return!!(tt===et||safeIsNaN(tt)&&safeIsNaN(et))}function areInputsEqual(tt,et){if(tt.length!==et.length)return!1;for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function xt(At){return xt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ct){return Ct.__proto__||Object.getPrototypeOf(Ct)},xt(At)}function kt(At,Et,Ct){return Et in At?Object.defineProperty(At,Et,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):At[Et]=Ct,At}var St=5e3,Tt=function(At){pt(Ct,At);var Et=gt(Ct);function Ct(){var Lt;ut(this,Ct);for(var jt=arguments.length,Rt=new Array(jt),$t=0;$t0&&jt<1;if(It){var Ot=this.player.getDuration();if(!Ot){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(Ot*jt,$t);return}this.player.seekTo(jt,$t)}},{key:"render",value:function(){var jt=this.props.activePlayer;return jt?nt.default.createElement(jt,ct({},this.props,{onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}]),Ct}(nt.Component);tt.default=Tt,kt(Tt,"displayName","Player"),kt(Tt,"propTypes",it.propTypes),kt(Tt,"defaultProps",it.defaultProps)})(Player);var Preview$1={},hasRequiredPreview;function requirePreview(){return hasRequiredPreview||(hasRequiredPreview=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(At){return typeof At}:et=function(At){return At&&typeof Symbol=="function"&&At.constructor===Symbol&&At!==Symbol.prototype?"symbol":typeof At},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=it(reactExports);function rt(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return rt=function(){return St},St}function it(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Tt=rt();if(Tt&&Tt.has(St))return Tt.get(St);var At={},Et=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ct in St)if(Object.prototype.hasOwnProperty.call(St,Ct)){var Lt=Et?Object.getOwnPropertyDescriptor(St,Ct):null;Lt&&(Lt.get||Lt.set)?Object.defineProperty(At,Ct,Lt):At[Ct]=St[Ct]}return At.default=St,Tt&&Tt.set(St,At),At}function ot(St,Tt){var At=Object.keys(St);if(Object.getOwnPropertySymbols){var Et=Object.getOwnPropertySymbols(St);Tt&&(Et=Et.filter(function(Ct){return Object.getOwnPropertyDescriptor(St,Ct).enumerable})),At.push.apply(At,Et)}return At}function at(St){for(var Tt=1;Tt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(St){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(At){return At.__proto__||Object.getPrototypeOf(At)},yt(St)}function bt(St,Tt,At){return Tt in St?Object.defineProperty(St,Tt,{value:At,enumerable:!0,configurable:!0,writable:!0}):St[Tt]=At,St}var wt="64px",xt={},kt=function(St){ut(At,St);var Tt=dt(At);function At(){var Et;st(this,At);for(var Ct=arguments.length,Lt=new Array(Ct),jt=0;jttt.length)&&(et=tt.length);for(var nt=0,rt=new Array(et);nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _getPrototypeOf(tt){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf(tt)}function _defineProperty(tt,et,nt){return et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _getRequireWildcardCache(){if(typeof WeakMap!="function")return null;var tt=new WeakMap;return _getRequireWildcardCache=function(){return tt},tt}function _interopRequireWildcard(tt){if(tt&&tt.__esModule)return tt;if(tt===null||_typeof(tt)!=="object"&&typeof tt!="function")return{default:tt};var et=_getRequireWildcardCache();if(et&&et.has(tt))return et.get(tt);var nt={},rt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var it in tt)if(Object.prototype.hasOwnProperty.call(tt,it)){var ot=rt?Object.getOwnPropertyDescriptor(tt,it):null;ot&&(ot.get||ot.set)?Object.defineProperty(nt,it,ot):nt[it]=tt[it]}return nt.default=tt,et&&et.set(tt,nt),nt}var Preview=(0,_react.lazy)(function(){return Promise.resolve().then(function(){return _interopRequireWildcard(requirePreview())})}),IS_BROWSER=typeof window<"u"&&window.document,IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?_react.Suspense:function(){return null},customPlayers=[],createReactPlayer=function tt(et,nt){var rt,it;return it=rt=function(ot){_inherits(st,ot);var at=_createSuper(st);function st(){var lt;_classCallCheck(this,st);for(var ct=arguments.length,ut=new Array(ct),ht=0;ht0&&arguments[0]!==void 0?arguments[0]:"player";return lt.player?lt.player.getInternalPlayer(dt):null}),_defineProperty(_assertThisInitialized(lt),"seekTo",function(dt,pt,mt){if(!lt.player)return null;lt.player.seekTo(dt,pt,mt)}),_defineProperty(_assertThisInitialized(lt),"handleReady",function(){lt.props.onReady(_assertThisInitialized(lt))}),_defineProperty(_assertThisInitialized(lt),"getActivePlayer",(0,_memoizeOne.default)(function(dt){for(var pt=0,mt=[].concat(customPlayers,_toConsumableArray(et));pt{const tt=useDataStore(xt=>xt.selectedNode),et=reactExports.useRef(null),nt=reactExports.useRef(null),{link:rt,timestamp:it,image_url:ot,date:at,boost:st,node_type:lt,type:ct,id:ut,show_title:ht,episode_title:dt,ref_id:pt}=tt||{},[mt,gt]=reactExports.useState(st||0),[yt,bt]=reactExports.useState(!1),wt=videoTimetoSeconds(it||"");return reactExports.useEffect(()=>{var kt;const xt=et.current;yt&&(xt==null||xt.seekTo(wt),(kt=xt==null?void 0:xt.getInternalPlayer())==null||kt.play()),nt.current&&nt.current.scrollTo({top:0,behavior:"auto"})},[yt,et,wt]),tt?jsxRuntimeExports.jsxs(Wrapper$4,{children:[jsxRuntimeExports.jsx(PlayerWrapper,{children:jsxRuntimeExports.jsx(Flex,{direction:"row",children:jsxRuntimeExports.jsx(ReactPlayer,{ref:et,controls:!0,height:"200px",onReady:()=>bt(!0),url:rt,width:"100%"})})}),jsxRuntimeExports.jsx(StyledEpisode,{boostCount:mt||0,date:at||0,episodeTitle:formatDescription(dt),id:ut,imageUrl:ot||"video_default.svg",isSelectedView:!0,link:rt,onClick:()=>null,showTitle:ht,type:lt||ct}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsxs("div",{ref:nt,style:{overflow:"auto",flex:1,width:"100%"},children:[jsxRuntimeExports.jsxs(BoostWrapper,{children:[jsxRuntimeExports.jsx(BoostAmt,{amt:mt}),jsxRuntimeExports.jsx(Booster,{content:tt,count:mt,refId:pt,updateCount:gt})]}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsx(TextWrapper,{children:jsxRuntimeExports.jsx(Description,{node:tt,stateless:!0})}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsx(TextWrapper,{children:jsxRuntimeExports.jsx(Transcript,{node:tt,stateless:!0},ut)})]})]}):null},Wrapper$4=styled$4(Flex)` flex: 1; min-height: 100%; @@ -6761,7 +6855,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &:active { } -`,ScrollWrapper$1=styled$4(Flex)(()=>({height:"100%",width:"100%"})),CollapseButton$1=styled$4(Flex).attrs({align:"center",justify:"center",p:8})(({theme:tt})=>({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),ChevronRightIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"chevron_right",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1247_21809",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1247_21809)",children:jsxRuntimeExports.jsx("path",{id:"chevron_right_2",d:"M9.44998 8.99998L6.52498 6.07498C6.38748 5.93748 6.31873 5.76248 6.31873 5.54998C6.31873 5.33748 6.38748 5.16248 6.52498 5.02498C6.66248 4.88748 6.83748 4.81873 7.04998 4.81873C7.26248 4.81873 7.43748 4.88748 7.57498 5.02498L11.025 8.47498C11.1 8.54997 11.1531 8.63123 11.1844 8.71873C11.2156 8.80623 11.2312 8.89998 11.2312 8.99998C11.2312 9.09998 11.2156 9.19373 11.1844 9.28123C11.1531 9.36873 11.1 9.44998 11.025 9.52497L7.57498 12.975C7.43748 13.1125 7.26248 13.1812 7.04998 13.1812C6.83748 13.1812 6.66248 13.1125 6.52498 12.975C6.38748 12.8375 6.31873 12.6625 6.31873 12.45C6.31873 12.2375 6.38748 12.0625 6.52498 11.925L9.44998 8.99998Z",fill:"currentColor"})})]})}),Tab=()=>{const tt=useAppStore(et=>et.setSidebarOpen);return jsxRuntimeExports.jsx(ExpandButton,{onClick:()=>{tt(!0)},children:jsxRuntimeExports.jsx(ChevronRightIcon,{})})},ExpandButton=styled$4(Flex).attrs({align:"center",justify:"center",p:8})(({theme:tt})=>({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"64px"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),SentimentDataIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_28",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_28)",children:jsxRuntimeExports.jsx("path",{d:"M3 20.75L2.91345 19.4327L4.74998 17.6058V20.75H3ZM7.25003 20.75V15.1058L8.74998 13.6058V20.75H7.25003ZM11.25 20.75V13.6058L12.75 15.1308V20.75H11.25ZM15.25 20.75V15.1308L16.75 13.6308V20.75H15.25ZM19.25 20.75V11.1058L20.75 9.60583V20.75H19.25ZM3.25003 15.2192V13.1058L10 6.35581L14 10.3558L20.75 3.60583V5.71924L14 12.4692L10 8.46921L3.25003 15.2192Z",fill:"currentColor"})})]}),TRENDING_TOPICS=["Drivechain","Ordinals","L402","Nostr","AI"],Trending=({onSubmit:tt})=>{const[et,nt]=reactExports.useState(!1),[rt,it]=useDataStore(st=>[st.trendingTopics,st.setTrendingTopics]),{setValue:ot}=useFormContext();reactExports.useEffect(()=>{const st=async()=>{nt(!0);try{const lt=await getTrends();lt.length&&it(lt.map(ct=>ct.topic))}catch{it(TRENDING_TOPICS)}finally{nt(!1)}};rt.length||st()},[rt,it]);const at=st=>{ot("search",st),tt==null||tt()};return jsxRuntimeExports.jsxs(Wrapper$2,{children:[jsxRuntimeExports.jsxs("div",{className:"heading",children:[jsxRuntimeExports.jsx("span",{className:"heading__title",children:"Trending Topics"}),jsxRuntimeExports.jsx("span",{className:"heading__icon",children:et?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.PRIMARY_BLUE,size:16}):jsxRuntimeExports.jsx(SentimentDataIcon,{})})]}),jsxRuntimeExports.jsx("ul",{className:"list",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:rt.map(st=>jsxRuntimeExports.jsxs(Flex,{className:"list-item",onClick:()=>at(st),children:["#",st]},st))})})]})},Wrapper$2=styled$4(Flex)` +`,ScrollWrapper$1=styled$4(Flex)(()=>({height:"100%",width:"100%"})),CollapseButton$1=styled$4(Flex).attrs({align:"center",justify:"center",p:8})(({theme:tt})=>({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),ChevronRightIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"chevron_right",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1247_21809",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1247_21809)",children:jsxRuntimeExports.jsx("path",{id:"chevron_right_2",d:"M9.44998 8.99998L6.52498 6.07498C6.38748 5.93748 6.31873 5.76248 6.31873 5.54998C6.31873 5.33748 6.38748 5.16248 6.52498 5.02498C6.66248 4.88748 6.83748 4.81873 7.04998 4.81873C7.26248 4.81873 7.43748 4.88748 7.57498 5.02498L11.025 8.47498C11.1 8.54997 11.1531 8.63123 11.1844 8.71873C11.2156 8.80623 11.2312 8.89998 11.2312 8.99998C11.2312 9.09998 11.2156 9.19373 11.1844 9.28123C11.1531 9.36873 11.1 9.44998 11.025 9.52497L7.57498 12.975C7.43748 13.1125 7.26248 13.1812 7.04998 13.1812C6.83748 13.1812 6.66248 13.1125 6.52498 12.975C6.38748 12.8375 6.31873 12.6625 6.31873 12.45C6.31873 12.2375 6.38748 12.0625 6.52498 11.925L9.44998 8.99998Z",fill:"currentColor"})})]})}),Tab=()=>{const tt=useAppStore(et=>et.setSidebarOpen);return jsxRuntimeExports.jsx(ExpandButton,{onClick:()=>{tt(!0)},children:jsxRuntimeExports.jsx(ChevronRightIcon,{})})},ExpandButton=styled$4(Flex).attrs({align:"center",justify:"center",p:8})(({theme:tt})=>({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"64px"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),SentimentDataIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_28",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_28)",children:jsxRuntimeExports.jsx("path",{d:"M3 20.75L2.91345 19.4327L4.74998 17.6058V20.75H3ZM7.25003 20.75V15.1058L8.74998 13.6058V20.75H7.25003ZM11.25 20.75V13.6058L12.75 15.1308V20.75H11.25ZM15.25 20.75V15.1308L16.75 13.6308V20.75H15.25ZM19.25 20.75V11.1058L20.75 9.60583V20.75H19.25ZM3.25003 15.2192V13.1058L10 6.35581L14 10.3558L20.75 3.60583V5.71924L14 12.4692L10 8.46921L3.25003 15.2192Z",fill:"currentColor"})})]}),BriefDescription=({text:tt,onClose:et})=>{const{close:nt}=useModal("briefDescription"),rt=()=>{et(),nt()};return jsxRuntimeExports.jsx(BaseModal,{id:"briefDescription",kind:"regular",onClose:rt,preventOutsideClose:!0,children:jsxRuntimeExports.jsx(Flex,{py:16,children:jsxRuntimeExports.jsx(StyledText,{children:tt})})})},StyledText=styled$4(Text$1)` + font-size: 18px; + font-weight: 400; + font-family: 'Barlow'; +`,TRENDING_TOPICS=["Drivechain","Ordinals","L402","Nostr","AI"],Trending=({onSubmit:tt})=>{const[et,nt]=reactExports.useState(!1),[rt,it]=reactExports.useState(""),{open:ot}=useModal("briefDescription"),[at,st]=useDataStore(ht=>[ht.trendingTopics,ht.setTrendingTopics]),{setValue:lt}=useFormContext();reactExports.useEffect(()=>{const ht=async()=>{nt(!0);try{const dt=await getTrends();dt.length&&st(dt)}catch{st(TRENDING_TOPICS.map(pt=>({topic:pt,count:0})))}finally{nt(!1)}};at.length||ht()},[at,st]);const ct=ht=>{lt("search",ht),tt==null||tt()},ut=(ht,dt)=>{ht.stopPropagation(),dt!=null&&dt.tldr&&(it(dt.tldr),ot())};return jsxRuntimeExports.jsxs(Wrapper$2,{children:[jsxRuntimeExports.jsxs("div",{className:"heading",children:[jsxRuntimeExports.jsx("span",{className:"heading__title",children:"Trending Topics"}),jsxRuntimeExports.jsx("span",{className:"heading__icon",children:et?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.PRIMARY_BLUE,size:16}):jsxRuntimeExports.jsx(SentimentDataIcon,{})})]}),jsxRuntimeExports.jsx("ul",{className:"list",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:at.map(ht=>jsxRuntimeExports.jsxs(Flex,{align:"center",className:"list-item",direction:"row",justify:"space-between",onClick:()=>ct(ht.topic),children:[jsxRuntimeExports.jsxs("span",{children:["#",ht.topic]}),ht.tldr&&jsxRuntimeExports.jsx(Button$2,{onClick:dt=>ut(dt,ht),children:"TLDR"})]},ht.topic))})}),jsxRuntimeExports.jsx(BriefDescription,{onClose:()=>it(""),text:rt})]})},Wrapper$2=styled$4(Flex)` .heading { color: ${colors.GRAY6}; padding: 0 24px 9px 24px; diff --git a/build/index.html b/build/index.html index 32afb74b3..e86520c76 100644 --- a/build/index.html +++ b/build/index.html @@ -22,7 +22,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Second Brain - + diff --git a/src/components/App/SideBar/Trending/BriefDescriptionModal/index.tsx b/src/components/App/SideBar/Trending/BriefDescriptionModal/index.tsx new file mode 100644 index 000000000..eaf2e98c7 --- /dev/null +++ b/src/components/App/SideBar/Trending/BriefDescriptionModal/index.tsx @@ -0,0 +1,34 @@ +import { FC } from 'react' +import styled from 'styled-components' +import { BaseModal } from '~/components/Modal' +import { Flex } from '~/components/common/Flex' +import { Text } from '~/components/common/Text' +import { useModal } from '~/stores/useModalStore' + +type Props = { + text: string + onClose: () => void +} + +export const BriefDescription: FC = ({ text, onClose }) => { + const { close } = useModal('briefDescription') + + const handleClose = () => { + onClose() + close() + } + + return ( + + + {text} + + + ) +} + +const StyledText = styled(Text)` + font-size: 18px; + font-weight: 400; + font-family: 'Barlow'; +` diff --git a/src/components/App/SideBar/Trending/index.tsx b/src/components/App/SideBar/Trending/index.tsx index 5969e75c7..c1ee82da9 100644 --- a/src/components/App/SideBar/Trending/index.tsx +++ b/src/components/App/SideBar/Trending/index.tsx @@ -1,4 +1,4 @@ -import { Skeleton } from '@mui/material' +import { Button, Skeleton } from '@mui/material' import { useEffect, useState } from 'react' import { useFormContext } from 'react-hook-form' import { ClipLoader } from 'react-spinners' @@ -7,8 +7,10 @@ import SentimentDataIcon from '~/components/Icons/SentimentDataIcon' import { Flex } from '~/components/common/Flex' import { getTrends } from '~/network/fetchGraphData' import { useDataStore } from '~/stores/useDataStore' +import { useModal } from '~/stores/useModalStore' import { Trending as TrendingType } from '~/types' import { colors } from '~/utils/colors' +import { BriefDescription } from './BriefDescriptionModal' const TRENDING_TOPICS = ['Drivechain', 'Ordinals', 'L402', 'Nostr', 'AI'] @@ -18,6 +20,8 @@ type Props = { export const Trending = ({ onSubmit }: Props) => { const [loading, setLoading] = useState(false) + const [briefDescription, setBriefDescription] = useState('') + const { open } = useModal('briefDescription') const [trendingTopics, setTrendingTopics] = useDataStore((s) => [s.trendingTopics, s.setTrendingTopics]) @@ -31,10 +35,10 @@ export const Trending = ({ onSubmit }: Props) => { const res = await getTrends() if (res.length) { - setTrendingTopics(res.map((i: TrendingType) => i.topic)) + setTrendingTopics(res) } } catch (err) { - setTrendingTopics(TRENDING_TOPICS) + setTrendingTopics(TRENDING_TOPICS.map((i) => ({ topic: i, count: 0 }))) } finally { setLoading(false) } @@ -50,6 +54,15 @@ export const Trending = ({ onSubmit }: Props) => { onSubmit?.() } + const showModal = (e: React.MouseEvent, trending: TrendingType) => { + e.stopPropagation() + + if (trending?.tldr) { + setBriefDescription(trending.tldr) + open() + } + } + return (
@@ -70,13 +83,22 @@ export const Trending = ({ onSubmit }: Props) => { ) : ( <> {trendingTopics.map((i) => ( - selectTrending(i)}> - #{i} + selectTrending(i.topic)} + > + #{i.topic} + {i.tldr && } ))} )} + setBriefDescription('')} text={briefDescription} /> ) } diff --git a/src/components/App/SideBar/index.tsx b/src/components/App/SideBar/index.tsx index 3a1bdb2d2..ad8c13831 100644 --- a/src/components/App/SideBar/index.tsx +++ b/src/components/App/SideBar/index.tsx @@ -1,6 +1,6 @@ import { Slide } from '@mui/material' import clsx from 'clsx' -import { forwardRef, useEffect, useRef, useState } from 'react' +import React, { forwardRef, useEffect, useRef, useState } from 'react' import { useFormContext } from 'react-hook-form' import { ClipLoader } from 'react-spinners' import styled from 'styled-components' diff --git a/src/components/BaseTextInput/types/index.ts b/src/components/BaseTextInput/types/index.ts index 727960a22..cfc0c6f65 100644 --- a/src/components/BaseTextInput/types/index.ts +++ b/src/components/BaseTextInput/types/index.ts @@ -1,4 +1,4 @@ -import { KeyboardEvent, MutableRefObject } from 'react' +import { FocusEvent, KeyboardEvent, MutableRefObject } from 'react' import { ColorName } from '~/utils/colors' import { AutoComplete } from '../tokens/autoComplete' @@ -25,7 +25,7 @@ export type BaseTextInputProps = { name: string onBlur?: () => void onChange?: (value: string) => void - onFocus?: () => void + onFocus?: (event: FocusEvent) => void onKeyDown?: (event: KeyboardEvent) => void onSubmitEditing?: (value: string) => void placeholder?: string diff --git a/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/Title/Autocomplete/index.tsx b/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/Title/Autocomplete/index.tsx new file mode 100644 index 000000000..62209d5fa --- /dev/null +++ b/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/Title/Autocomplete/index.tsx @@ -0,0 +1,192 @@ +import { Divider, IconButton, InputBase, Paper, Popper } from '@mui/material' +import clsx from 'clsx' +import { debounce } from 'lodash' +import React, { useEffect, useMemo, useRef, useState } from 'react' +import { ClipLoader } from 'react-spinners' +import styled from 'styled-components' +import ClearIcon from '~/components/Icons/ClearIcon' +import SearchIcon from '~/components/Icons/SearchIcon' +import { ALPHABETICALLY } from '~/components/SourcesTableModal/SourcesView/constants' +import { Flex } from '~/components/common/Flex' +import { getTopicsData } from '~/network/fetchSourcesData' +import { FetchTopicResponse, Topic } from '~/types' +import { colors } from '~/utils/colors' + +type Props = { + onSelect: (topic: Topic | null) => void + selectedTopic: Topic | null +} + +export const DropdownSearch: React.FC = ({ onSelect, selectedTopic }) => { + const [isPopperOpen, setIsPopperOpen] = useState(false) + const [search, setSearch] = useState('') + const [options, setOptions] = useState([]) + const [optionsIsLoading, setOptionsIsLoading] = useState(false) + const inputRef = useRef(null) + + useEffect(() => () => setOptions([]), [setOptions]) + + const handleSearch = async (val: string) => { + const filters = { + muted: 'False', + sort_by: ALPHABETICALLY, + search: val, + skip: '0', + limit: '1000', + } + + setOptionsIsLoading(true) + + try { + const responseData: FetchTopicResponse = await getTopicsData(filters) + + setOptions(responseData.data) + } catch (error) { + setOptions([]) + } finally { + setOptionsIsLoading(false) + } + } + + const debouncedSearch = useMemo(() => debounce(handleSearch, 300), []) + + const handleSelectChange = (val: Topic) => { + onSelect(val) + } + + const handleChange = (e: string) => { + setSearch(e) + + if (!e) { + setOptions([]) + + return + } + + if (e.length > 2) { + debouncedSearch(e) + } + } + + return selectedTopic ? ( + +
{selectedTopic.topic}
+ onSelect(null)}> + + +
+ ) : ( + <> + e.preventDefault()} + sx={{ p: '2px 4px', display: 'flex', alignItems: 'center', width: 200 }} + > + handleChange(e.target.value)} + onFocus={() => setIsPopperOpen(true)} + placeholder="Search" + size="small" + sx={{ ml: 1, flex: 1 }} + value={search} + /> + {search && ( + <> + handleChange('')} type="button"> + + + + + )} + + {optionsIsLoading ? : } + + + {inputRef.current && options.length ? ( + + <> + {options.map((option) => ( + handleSelectChange(option)} + > + {option.topic} + + ))} + + + ) : null} + + ) +} + +const MenuItem = styled(Flex).attrs({ + direction: 'row', + align: 'center', +})` + font-family: Barlow; + font-size: 13px; + font-style: normal; + font-weight: 500; + overflow: hidden; + width: 200px; + color: ${colors.GRAY3}; + margin-bottom: 4px; + cursor: pointer; + &.active { + color: ${colors.white}; + } + &:hover { + color: ${colors.white}; + } + + .icon { + margin-right: 8px; + width: 9px; + font-size: 10px; + } +` + +const StyledPopover = styled(Popper)` + && { + z-index: 99999; + background: ${colors.BUTTON1}; + min-width: 200px; + padding: 16px; + color: ${colors.GRAY3}; + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); + border-radius: 6px; + max-height: 200px; + overflow: auto; + } +` + +const SelectedValue = styled(Flex).attrs({ + direction: 'row', + justify: 'flex-start', + align: 'center', +})` + .value { + overflow: hidden; + text-overflow: ellipsis; + } + .icon { + margin-left: 8px; + width: 20px; + height: 20px; + color: ${colors.white}; + background: ${colors.primaryBlue}; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + } +` + +const StyledButton = styled(IconButton)` + font-size: 24px; +` diff --git a/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/Title/index.tsx b/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/Title/index.tsx new file mode 100644 index 000000000..3d6ad2f0c --- /dev/null +++ b/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/Title/index.tsx @@ -0,0 +1,58 @@ +import { FC } from 'react' +import styled from 'styled-components' +import { Flex } from '~/components/common/Flex' +import { Text } from '~/components/common/Text' +import { Topic } from '~/types' +import { colors } from '~/utils/colors' +import { DropdownSearch } from './Autocomplete' + +type Props = { + from: string + onSelect: (topic: Topic | null) => void + selectedTopic: Topic | null +} + +export const TitleEditor: FC = ({ from, onSelect, selectedTopic }) => ( + + + + Merge topic + + + + + +
From
+
{from}
+
+ +
To
+ +
+
+
+) + +const StyledText = styled(Text)` + font-size: 22px; + font-weight: 600; + font-family: 'Barlow'; +` + +const Content = styled(Flex).attrs({ + align: 'flex-start', + direction: 'row', + justify: 'flex-start', +})` + color: ${colors.white}; + .label { + margin-bottom: 8px; + font-weight: 500; + font-size: 14px; + color: ${colors.GRAY3}; + } +` + +const SectionWrapper = styled(Flex)` + flex: 1 1 100%; +` diff --git a/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/index.tsx b/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/index.tsx new file mode 100644 index 000000000..110a11e24 --- /dev/null +++ b/src/components/SourcesTableModal/SourcesView/Topics/MergeTopicModal/index.tsx @@ -0,0 +1,91 @@ +import { Button } from '@mui/material' +import { FC, useEffect, useState } from 'react' +import { FormProvider, useForm } from 'react-hook-form' +import { ClipLoader } from 'react-spinners' +import { BaseModal } from '~/components/Modal' +import { postMergeTopics } from '~/network/fetchSourcesData' +import { useModal } from '~/stores/useModalStore' +import { useTopicsStore } from '~/stores/useTopicsStore' +import { Topic } from '~/types' +import { colors } from '~/utils/colors' +import { IS_ALIAS } from '../../constants' +import { TitleEditor } from './Title' + +type Props = { + topic: Topic + onClose: () => void +} + +export type FormData = { + topic: string +} + +export const MergeTopicModal: FC = ({ topic, onClose }) => { + const { close } = useModal('mergeTopic') + const [data, ids, total] = useTopicsStore((s) => [s.data, s.ids, s.total]) + const form = useForm({ mode: 'onChange' }) + const { watch, setValue, reset } = form + const [loading, setLoading] = useState(false) + const [selectedTopic, setSelectedTopic] = useState(null) + + useEffect(() => { + if (topic) { + setValue('topic', topic?.topic) + } + + return () => { + reset() + } + }, [topic, setValue, reset]) + + const topicValue = watch('topic') + + const closeHandler = () => { + onClose() + close() + } + + const handleSave = async () => { + if (!selectedTopic || !data) { + return + } + + setLoading(true) + + try { + await postMergeTopics({ from: topic.ref_id, to: selectedTopic?.ref_id }) + + const { ref_id: id } = topic + + data[id] = { ...data[id], edgeList: [IS_ALIAS], edgeCount: data[id].edgeCount - 1 } + + useTopicsStore.setState({ ids: ids.filter((i) => i !== selectedTopic.ref_id), total: total - 1 }) + + if (data) { + const newData = { ...data } + + newData[topic?.ref_id].topic = topicValue.trim() + + useTopicsStore.setState({ data: newData }) + } + + closeHandler() + } catch (error) { + console.warn(error) + } finally { + setLoading(false) + } + } + + return ( + + + + + + + ) +} diff --git a/src/components/SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx b/src/components/SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx new file mode 100644 index 000000000..f5221ed04 --- /dev/null +++ b/src/components/SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx @@ -0,0 +1,96 @@ +import { IconButton } from '@mui/material' +import React, { FC, memo, useState } from 'react' +import { MdCancel, MdCheckCircle } from 'react-icons/md' +import { ClipLoader } from 'react-spinners' +import styled from 'styled-components' +import SettingsIcon from '~/components/Icons/SettingsIcon' +import { Flex } from '~/components/common/Flex' +import { putNodeData } from '~/network/fetchSourcesData' +import { useTopicsStore } from '~/stores/useTopicsStore' +import { Topic } from '~/types' +import { colors } from '~/utils/colors' +import { StyledTableCell, StyledTableRow } from '../../common' + +type TTableRaw = { + topic: Topic + onClick: (event: React.MouseEvent, refId: string) => void +} + +const TableRowComponent: FC = ({ topic, onClick }) => { + const [ids, total] = useTopicsStore((s) => [s.ids, s.total]) + const [loading, setLoading] = useState(false) + + const date = topic.date_added_to_graph.toString() + + const handleMute = async (refId: string, shouldMute: boolean) => { + setLoading(true) + + try { + await putNodeData({ ref_id: refId, node_name: 'muted_topic', node_value: shouldMute }) + useTopicsStore.setState({ ids: ids.filter((i) => i !== refId), total: total - 1 }) + } catch (error) { + console.warn(error) + } + } + + return ( + + + {topic.topic} + {topic.edgeCount} + + {topic.edgeList.map((edge: string) => ( + {edge} + ))} + + + {new Date(Number(date) * 1000).toDateString()} + + + + +
+ {loading ? ( + + ) : ( + <> + {topic.muted_topic ? ( + handleMute(topic.ref_id, false)}> + + + ) : ( + handleMute(topic.ref_id, true)}> + + + )} + + )} +
+
+
+ + onClick(e, topic.ref_id)}> + + + +
+ ) +} + +const IconWrapper = styled(Flex)` + width: 20px; + height: 20px; + border-radius: 50%; + cursor: pointer; + background: transparent; + color: ${colors.lightBlue500}; + &.centered { + margin: 0 auto; + } + + & + & { + margin-left: 4px; + } +` + +export const TopicRow = memo(TableRowComponent) diff --git a/src/components/SourcesTableModal/SourcesView/Topics/Table/index.tsx b/src/components/SourcesTableModal/SourcesView/Topics/Table/index.tsx index 68b2b158a..3ef90bede 100644 --- a/src/components/SourcesTableModal/SourcesView/Topics/Table/index.tsx +++ b/src/components/SourcesTableModal/SourcesView/Topics/Table/index.tsx @@ -1,123 +1,117 @@ -import { IconButton, Table as MaterialTable, TableRow } from '@mui/material' +import { Table as MaterialTable, Popover, TableRow } from '@mui/material' // import moment from 'moment' -import React, { useState } from 'react' -import { MdCancel, MdCheckCircle } from 'react-icons/md' -import { ClipLoader } from 'react-spinners' +import React, { useCallback } from 'react' import styled from 'styled-components' import FilterOffIcon from '~/components/Icons/FilterOffIcon' -import SettingsIcon from '~/components/Icons/SettingsIcon' import { Flex } from '~/components/common/Flex' import { Text } from '~/components/common/Text' -import { putNodeData } from '~/network/fetchSourcesData' import { useTopicsStore } from '~/stores/useTopicsStore' -import { Topic } from '~/types' import { colors } from '~/utils/colors' -import { StyledTableCell, StyledTableHead, StyledTableRow } from '../../common' +import { StyledTableCell, StyledTableHead } from '../../common' +import { IS_ALIAS } from '../../constants' import { TopicTableProps } from '../../types' +import { TopicRow } from './TableRow' -const Table: React.FC = ({ data, showMuted, setSelectedTopic }) => { - const [ids, total] = useTopicsStore((s) => [s.ids, s.total]) - const [loadingId, setLoadingId] = useState('') +export const Table: React.FC = ({ showMuted, onTopicEdit }) => { + const [anchorEl, setAnchorEl] = React.useState(null) + const [selectedRefId, setSelectedRefId] = React.useState('') - const handleMute = async (refId: string, shouldMute: boolean) => { - if (data?.length) { - setLoadingId(refId) + const [data, ids] = useTopicsStore((s) => [s.data, s.ids]) - try { - await putNodeData({ ref_id: refId, node_name: 'muted_topic', node_value: shouldMute }) - useTopicsStore.setState({ ids: ids.filter((i) => i !== refId), total: total - 1 }) - } catch (error) { - console.warn(error) - } - } + const handleClick = useCallback((event: React.MouseEvent, refId: string) => { + setAnchorEl(event.currentTarget) + setSelectedRefId(refId) + }, []) + + const handleClose = () => { + setAnchorEl(null) + } + + const handlePopoverAction = (action: string) => { + onTopicEdit(selectedRefId, action) + handleClose() } - return !data?.length ? ( + const open = Boolean(anchorEl) + const id = open ? 'simple-popover' : undefined + + return !data ? ( There is not any results for selected filters ) : ( - - - - - Type - Edge Count - Edge list - Date - {showMuted ? 'Unmute' : 'Mute'} - - - - {data?.length && ( - - {data?.map((i: Topic) => { - const date = i.date_added_to_graph.toString() - - return ( - - - {i.topic} - {i.edgeCount} - - {i.edgeList.map((topic) => ( - {topic} - ))} - - - {new Date(Number(date) * 1000).toDateString()} - - - - -
- {loadingId === i.ref_id ? ( - - ) : ( - <> - {i.muted_topic ? ( - handleMute(i.ref_id, false)}> - - - ) : ( - handleMute(i.ref_id, true)}> - - - )} - - )} -
-
-
- - setSelectedTopic(i)}> - - - -
- ) - })} - - )} -
+ <> + + + + + Type + Edge Count + Edge list + Date + {showMuted ? 'Unmute' : 'Mute'} + + + + {data && ( + + {ids?.map((i: string) => ( + + ))} + + )} + + {selectedRefId ? ( + + handlePopoverAction('editTopic')}>Rename + {!data[selectedRefId].edgeList.includes(IS_ALIAS) ? ( + handlePopoverAction('mergeTopic')}>Merge + ) : null} + + ) : null} + ) } -export default Table - -const IconWrapper = styled(Flex)` - width: 20px; - height: 20px; - border-radius: 50%; +const PopoverOption = styled(Flex).attrs({ + direction: 'row', + px: 16, + py: 8, +})` cursor: pointer; - background: transparent; - color: ${colors.lightBlue500}; - &.centered { - margin: 0 auto; + background: ${colors.BUTTON1}; + color: ${colors.white}; + + &:hover { + background: ${colors.BUTTON1_HOVER}; + color: ${colors.GRAY3}; } & + & { - margin-left: 4px; + border-top: 1px solid ${colors.black}; + } +` + +const PopoverWrapper = styled(Popover)` + && { + z-index: 9999; + } + .MuiPaper-root { + min-width: 149px; + color: ${colors.GRAY3}; + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); + border-radius: 6px; + z-index: 1; + font-family: Barlow; + font-size: 14px; + font-weight: 500; } ` diff --git a/src/components/SourcesTableModal/SourcesView/Topics/index.tsx b/src/components/SourcesTableModal/SourcesView/Topics/index.tsx index ddb6b7e64..a3214a46e 100644 --- a/src/components/SourcesTableModal/SourcesView/Topics/index.tsx +++ b/src/components/SourcesTableModal/SourcesView/Topics/index.tsx @@ -10,9 +10,10 @@ import { Topic } from '~/types' import { colors } from '~/utils/colors' import { Heading } from '../common' import { EditTopicModal } from './EditTopicModal' +import { MergeTopicModal } from './MergeTopicModal' import { Search } from './Search' import { Filter } from './Sort' -import Table from './Table' +import { Table } from './Table' export const TopicSources = () => { const [loading, setLoading] = useState(true) @@ -27,9 +28,15 @@ export const TopicSources = () => { s.terminate, ]) - const { open } = useModal('editTopic') + const { open: openEditTopic } = useModal('editTopic') + const { open: openMergeTopic } = useModal('mergeTopic') const [selectedTopic, setSelectedTopic] = useState(null) + const topicActions: Record void> = { + editTopic: openEditTopic, + mergeTopic: openMergeTopic, + } + const topicsIdRef = useRef([]) useEffect(() => { @@ -72,9 +79,16 @@ export const TopicSources = () => { setSelectedTopic(null) } - const onTopicSelect = (topic: Topic) => { - setSelectedTopic(topic) - open() + const onTopicEdit = (topicId: string, action: string) => { + if (!data) { + return + } + + setSelectedTopic(data[topicId]) + + if (typeof topicActions[action] === 'function') { + topicActions[action]() + } } return ( @@ -98,22 +112,20 @@ export const TopicSources = () => { {loading && !data ? ( ) : ( - data[id]) : []} - setSelectedTopic={onTopicSelect} - showMuted={filters.muted} - /> + <> +
+ {total > ids.length ? ( + + ) : null} + )} - - {total > ids.length ? ( - - ) : null} + {selectedTopic && } {selectedTopic && } ) diff --git a/src/components/SourcesTableModal/SourcesView/constants.ts b/src/components/SourcesTableModal/SourcesView/constants.ts index 0b23911cf..b1cf875b0 100644 --- a/src/components/SourcesTableModal/SourcesView/constants.ts +++ b/src/components/SourcesTableModal/SourcesView/constants.ts @@ -22,3 +22,5 @@ export const SORT_MAPPING: Option = { } export const TWITTER_LINK = 'https://twitter.com' + +export const IS_ALIAS = 'IS_ALIAS' diff --git a/src/components/SourcesTableModal/SourcesView/types.ts b/src/components/SourcesTableModal/SourcesView/types.ts index 7f428bed7..99a9bebea 100644 --- a/src/components/SourcesTableModal/SourcesView/types.ts +++ b/src/components/SourcesTableModal/SourcesView/types.ts @@ -1,13 +1,12 @@ -import { Sources, Topic } from '~/types' +import { Sources } from '~/types' export type Props = { data: Sources[] | undefined } export type TopicTableProps = { - data: Topic[] | null showMuted?: boolean - setSelectedTopic: (topic: Topic) => void + onTopicEdit: (id: string, action: string) => void } export type TdProps = { diff --git a/src/network/fetchSourcesData/index.ts b/src/network/fetchSourcesData/index.ts index b89b45150..6891ec401 100644 --- a/src/network/fetchSourcesData/index.ts +++ b/src/network/fetchSourcesData/index.ts @@ -16,6 +16,12 @@ export type TAboutParams = { search_term?: string } +export type TMergeTopicsParams = { + /* eslint-disable camelcase */ + from: string + to: string +} + export type TtopicsParams = { muted?: string skip?: string @@ -57,6 +63,12 @@ export const postAboutData = async (data: TAboutParams) => { return response } +export const postMergeTopics = async (data: TMergeTopicsParams) => { + const response = await api.post('/curation/merge', JSON.stringify(data)) + + return response +} + export const triggerRadarJob = async () => api.get(`/radar/trigger-job`) export const putRadarData = async (id: string, data: RadarRequest) => { diff --git a/src/stores/useDataStore/index.ts b/src/stores/useDataStore/index.ts index 4718c7efc..36d35a2c4 100644 --- a/src/stores/useDataStore/index.ts +++ b/src/stores/useDataStore/index.ts @@ -2,7 +2,7 @@ import create from 'zustand' import { nodesAreRelatives } from '~/components/Universe/constants' import { isChileGraph } from '~/constants' import { fetchGraphData } from '~/network/fetchGraphData' -import { GraphData, NodeExtended, NodeType, Sources } from '~/types' +import { GraphData, NodeExtended, NodeType, Sources, Trending } from '~/types' import { saveSearchTerm } from '~/utils/relayHelper/index' export type GraphStyle = 'split' | 'force' | 'sphere' | 'earth' @@ -32,9 +32,9 @@ type DataStore = { showTeachMe: boolean hideNodeDetails: boolean sidebarFilter: string - trendingTopics: string[] + trendingTopics: Trending[] - setTrendingTopics: (trendingTopics: string[]) => void + setTrendingTopics: (trendingTopics: Trending[]) => void setSidebarFilter: (filter: string) => void setScrollEventsDisabled: (scrollEventsDisabled: boolean) => void setCategoryFilter: (categoryFilter: NodeType | null) => void diff --git a/src/stores/useModalStore/index.ts b/src/stores/useModalStore/index.ts index 9243c99d6..13afea151 100644 --- a/src/stores/useModalStore/index.ts +++ b/src/stores/useModalStore/index.ts @@ -1,6 +1,12 @@ import { create } from 'zustand' -export type AvailableModals = 'budgetExplanation' | 'sourcesTable' | 'addContent' | 'editTopic' +export type AvailableModals = + | 'budgetExplanation' + | 'sourcesTable' + | 'addContent' + | 'editTopic' + | 'mergeTopic' + | 'briefDescription' type ModalStore = { currentModals: Record @@ -15,6 +21,8 @@ const defaultData = { sourcesTable: false, addContent: false, editTopic: false, + mergeTopic: false, + briefDescription: false, }, } diff --git a/src/stores/useTopicsStore/index.ts b/src/stores/useTopicsStore/index.ts index 0fbafee87..2f2d474ba 100644 --- a/src/stores/useTopicsStore/index.ts +++ b/src/stores/useTopicsStore/index.ts @@ -32,6 +32,10 @@ export const useTopicsStore = create((set, get) => ({ const payload = prepareTopicFilters(filters) + if (filters.page < 1) { + set({ data: null, ids: [], total: 0 }) + } + const responseData: FetchTopicResponse = await getTopicsData(payload) const newData: Record = filters.page > 0 ? data || {} : {} @@ -53,5 +57,5 @@ const prepareTopicFilters = (filters: TopicFilter): TtopicsParams => ({ skip: String(filters.page * filters.pageSize), limit: String(filters.pageSize), sort_by: filters.sortBy, - ...(filters.search ? { search: filters.search || '' } : {}), + search: filters.search || '', }) diff --git a/src/types/index.ts b/src/types/index.ts index 92208ef44..459071669 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -145,6 +145,7 @@ export type Sentiment = { export type Trending = { count: number topic: string + tldr?: string } export type Sources = {