@wormhole-foundation/wormhole-connect 2.1.0-beta.1-development → 2.1.0-beta.2-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/assets/{ccip-j5QHovIT.js → ccip-DfI9A4kL.js} +1 -1
  2. package/dist/assets/{evm-B5I5ieRn.js → evm-CYICYl2d.js} +3 -3
  3. package/dist/assets/index-26ve8f2n.js +531 -0
  4. package/dist/assets/index-NqsKKz5-.js +14 -0
  5. package/dist/assets/index.es-CephYdxr.js +47 -0
  6. package/dist/assets/{solana-c_vE3Ye5.js → solana-DXbD7wpn.js} +2 -2
  7. package/dist/assets/{solanaEmbed.esm-Bx0ME0S1.js → solanaEmbed.esm-CcwIvLto.js} +10 -10
  8. package/dist/main.js +3 -3
  9. package/lib/{aptos-CzT6f7Ba.js → aptos-7G9wZkGW.js} +2 -2
  10. package/lib/{aptos-wFa1-xae.mjs → aptos-BlOWGpyT.mjs} +2 -2
  11. package/lib/{aptos-CqfHXKy7.js → aptos-CYxRBLR_.js} +1 -1
  12. package/lib/{aptos-DxhN-FI3.mjs → aptos-Ckopfy7I.mjs} +5 -5
  13. package/lib/{base64-C_XWimVd.js → base64-CFR5QWTY.js} +1 -1
  14. package/lib/{base64-L1vzz0KI.mjs → base64-HSuzVIKw.mjs} +1 -1
  15. package/lib/{ccip-z81HbzxN.mjs → ccip-Bntg_vPp.mjs} +1 -1
  16. package/lib/{ccip-D6aPw5Ue.js → ccip-CVUhxB0q.js} +1 -1
  17. package/lib/{chunk-IMTC3J2M-CazR2ogu.mjs → chunk-IMTC3J2M-BADDWO3l.mjs} +3 -3
  18. package/lib/{chunk-IMTC3J2M-WMj1Jt5m.js → chunk-IMTC3J2M-ByR5Yjf4.js} +1 -1
  19. package/lib/{events-D4Mv_WYU.js → events-jATx_JnD.js} +1 -1
  20. package/lib/{events-BrdIAbQL.mjs → events-lD3LhLH0.mjs} +1 -1
  21. package/lib/{evm-CB6zu7io.mjs → evm-BW0CHBCG.mjs} +5 -5
  22. package/lib/{evm-Fk4wBAda.js → evm-Bh1Y4eUx.js} +1 -1
  23. package/lib/{evm-CULALpUt.mjs → evm-ColKfWEz.mjs} +10 -6
  24. package/lib/{evm-BJL8RjTB.js → evm-z5yFHxM9.js} +3 -3
  25. package/lib/{index-D2y7My6x.mjs → index-2fBRXVP8.mjs} +2 -2
  26. package/lib/{index-Cuov-W4s.js → index-8-70GvMi.js} +1 -1
  27. package/lib/{index-Xy8XaqU-.js → index-8JCep4IW.js} +1 -1
  28. package/lib/{index-BTmEJpYG.mjs → index-B9GU1bLs.mjs} +1 -1
  29. package/lib/{index-CS3t6bxx.mjs → index-BXkdaYu_.mjs} +1 -1
  30. package/lib/{index-DEpSdwA-.mjs → index-BZ0W_BZS.mjs} +2 -2
  31. package/lib/{index-CtpCK8QC.js → index-BcdbCktu.js} +1 -1
  32. package/lib/{index-BnVRRJvv.js → index-BhexWYVn.js} +1 -1
  33. package/lib/{index-BT_eiQVC.js → index-C-OIv0gT.js} +1 -1
  34. package/lib/{index-CAqS4koK.js → index-C6WDEDwO.js} +1 -1
  35. package/lib/{index-BqaYMlOq.mjs → index-CAUvtNGE.mjs} +3 -3
  36. package/lib/{index-DpfI-2hT.mjs → index-CBxgME-2.mjs} +2 -2
  37. package/lib/{index-Dtg6idl8.js → index-CCUy1jes.js} +1 -1
  38. package/lib/{index-DGcrnWdu.mjs → index-CYBM2IeY.mjs} +13 -12
  39. package/lib/{index-DJJ3umH8.mjs → index-CcFpkXPM.mjs} +2 -2
  40. package/lib/{index-BqCducVx.mjs → index-CfnNi3Zd.mjs} +3 -3
  41. package/lib/{index-DdRe9fUB.mjs → index-Cl6LSKsg.mjs} +1 -1
  42. package/lib/{index-DtqIOAjg.mjs → index-CxQ-swIQ.mjs} +1 -1
  43. package/lib/index-Cxw9PIcl.js +531 -0
  44. package/lib/{index-CGdGYg5B.mjs → index-D0XcjaUl.mjs} +2 -2
  45. package/lib/{index-B9FwYN90.js → index-D7IcLxQc.js} +1 -1
  46. package/lib/index-DAzDpd7U.js +14 -0
  47. package/lib/{index-jC1hUxPJ.mjs → index-DB_r424l.mjs} +1 -1
  48. package/lib/{index-C_2eG0Va.mjs → index-DECw2aR6.mjs} +1 -1
  49. package/lib/{index-CuPOodtE.js → index-DGgQSMuG.js} +1 -1
  50. package/lib/{index-BsmdxKnE.mjs → index-DIAuhm70.mjs} +3008 -3525
  51. package/lib/{index-CuWt4RaJ.js → index-DOXMkFA4.js} +1 -1
  52. package/lib/{index-BGZONAdj.js → index-DQVQrflZ.js} +1 -1
  53. package/lib/{index-GM4m48QO.js → index-DUXnbpVg.js} +1 -1
  54. package/lib/{index-DUGwXho3.js → index-DZvLy2Dr.js} +3 -3
  55. package/lib/{index-BsYhqVq_.js → index-DjkMeATf.js} +1 -1
  56. package/lib/{index-C0MgLwy8.js → index-DleO04Ea.js} +1 -1
  57. package/lib/{index-HeldZ3mJ.mjs → index-InC6In6o.mjs} +2 -2
  58. package/lib/{index-CkUMgihl.js → index-V7kxzAZX.js} +1 -1
  59. package/lib/{index-B5TOuhBB.js → index-WLqZ1uO7.js} +1 -1
  60. package/lib/{index-Cf2BEUjb.mjs → index-gd_dleYk.mjs} +1 -1
  61. package/lib/{index-CayMgbM_.js → index-l0NqjNj9.js} +1 -1
  62. package/lib/{index-wAClTIQn.mjs → index-lEBTHIqm.mjs} +2 -2
  63. package/lib/{index-DsYAlD9Y.mjs → index-lHA40g0z.mjs} +2 -2
  64. package/lib/index-oPxOJfPK.mjs +3236 -0
  65. package/lib/{index-ChzkRsG0.js → index-rFhS51F6.js} +1 -1
  66. package/lib/{index-DXIpHh2N.mjs → index-y_DeeCWD.mjs} +4 -4
  67. package/lib/index.es-Doowrf9a.js +46 -0
  68. package/lib/index.es-YqKQxHG6.mjs +7725 -0
  69. package/lib/index.js +1 -1
  70. package/lib/index.mjs +1 -1
  71. package/lib/{signer-BBJR-S7u.mjs → signer-CfU9wW3f.mjs} +1 -1
  72. package/lib/{signer-D8m72nd4.js → signer-eoVHaZz7.js} +1 -1
  73. package/lib/{solana-DB5vwgKO.mjs → solana-CHUnEnef.mjs} +4 -4
  74. package/lib/{solana-tZZpsxE8.js → solana-C_d_AKET.js} +1 -1
  75. package/lib/solana-SFHXHGL2.js +1 -0
  76. package/lib/{solana-DdLCPKF2.mjs → solana-y-l38J4U.mjs} +5 -5
  77. package/lib/{solanaEmbed.esm-TpsYEDsw.js → solanaEmbed.esm-B4tNQ7S7.js} +10 -10
  78. package/lib/{solanaEmbed.esm-ANGjgiaN.mjs → solanaEmbed.esm-DVOHg5WI.mjs} +1559 -1560
  79. package/lib/{sui-BFNsLy1t.mjs → sui-1fbLRIUL.mjs} +5 -5
  80. package/lib/{sui-UELhAZj0.js → sui-BN1m6APK.js} +1 -1
  81. package/lib/{sui-DKw9LmTC.mjs → sui-D9frS9ki.mjs} +1 -1
  82. package/lib/{sui-D9F11hKw.js → sui-K20aVxqE.js} +2 -2
  83. package/package.json +5 -1
  84. package/dist/assets/index-BUd_4Lqz.js +0 -14
  85. package/dist/assets/index-Db_i6Hbk.js +0 -531
  86. package/dist/assets/index.es-BYwyqXqm.js +0 -47
  87. package/lib/index-5EBn2EJL.mjs +0 -2709
  88. package/lib/index-CYpOkqEl.js +0 -14
  89. package/lib/index-Cst2493l.js +0 -531
  90. package/lib/index.es-DG7BWZ8R.js +0 -46
  91. package/lib/index.es-IbuqEs8_.mjs +0 -8242
  92. package/lib/solana-521ACL4P.js +0 -1
@@ -1,16 +1,16 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-DUGwXho3.js"),M1=require("./events-D4Mv_WYU.js");function Rs(e){"@babel/helpers - typeof";return Rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rs(e)}function x1(e,t){if(Rs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(Rs(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D1(e){var t=x1(e,"string");return Rs(t)=="symbol"?t:t+""}var gc={exports:{}},Wb=H.requireEvents().EventEmitter,Sl,Ug;function j1(){if(Ug)return Sl;Ug=1;function e(x,v){var C=Object.keys(x);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(x);v&&(B=B.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),C.push.apply(C,B)}return C}function t(x){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?e(Object(C),!0).forEach(function(B){r(x,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(C)):e(Object(C)).forEach(function(B){Object.defineProperty(x,B,Object.getOwnPropertyDescriptor(C,B))})}return x}function r(x,v,C){return v=f(v),v in x?Object.defineProperty(x,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[v]=C,x}function o(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function s(x,v){for(var C=0;C<v.length;C++){var B=v[C];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(x,f(B.key),B)}}function u(x,v,C){return v&&s(x.prototype,v),Object.defineProperty(x,"prototype",{writable:!1}),x}function f(x){var v=h(x,"string");return typeof v=="symbol"?v:String(v)}function h(x,v){if(typeof x!="object"||x===null)return x;var C=x[Symbol.toPrimitive];if(C!==void 0){var B=C.call(x,v);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}var l=H.bufferPolyfill,p=l.Buffer,b=H.require$$3,w=b.inspect,I=w&&w.custom||"inspect";function A(x,v,C){p.prototype.copy.call(x,v,C)}return Sl=function(){function x(){o(this,x),this.head=null,this.tail=null,this.length=0}return u(x,[{key:"push",value:function(C){var B={data:C,next:null};this.length>0?this.tail.next=B:this.head=B,this.tail=B,++this.length}},{key:"unshift",value:function(C){var B={data:C,next:this.head};this.length===0&&(this.tail=B),this.head=B,++this.length}},{key:"shift",value:function(){if(this.length!==0){var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(C){if(this.length===0)return"";for(var B=this.head,P=""+B.data;B=B.next;)P+=C+B.data;return P}},{key:"concat",value:function(C){if(this.length===0)return p.alloc(0);for(var B=p.allocUnsafe(C>>>0),P=this.head,S=0;P;)A(P.data,B,S),S+=P.data.length,P=P.next;return B}},{key:"consume",value:function(C,B){var P;return C<this.head.data.length?(P=this.head.data.slice(0,C),this.head.data=this.head.data.slice(C)):C===this.head.data.length?P=this.shift():P=B?this._getString(C):this._getBuffer(C),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(C){var B=this.head,P=1,S=B.data;for(C-=S.length;B=B.next;){var m=B.data,j=C>m.length?m.length:C;if(j===m.length?S+=m:S+=m.slice(0,C),C-=j,C===0){j===m.length?(++P,B.next?this.head=B.next:this.head=this.tail=null):(this.head=B,B.data=m.slice(j));break}++P}return this.length-=P,S}},{key:"_getBuffer",value:function(C){var B=p.allocUnsafe(C),P=this.head,S=1;for(P.data.copy(B),C-=P.data.length;P=P.next;){var m=P.data,j=C>m.length?m.length:C;if(m.copy(B,B.length-C,0,j),C-=j,C===0){j===m.length?(++S,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=m.slice(j));break}++S}return this.length-=S,B}},{key:I,value:function(C,B){return w(this,t(t({},B),{},{depth:0,customInspect:!1}))}}]),x}(),Sl}function U1(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,H.dist.process.nextTick(pc,this,e)):H.dist.process.nextTick(pc,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(u){!t&&u?r._writableState?r._writableState.errorEmitted?H.dist.process.nextTick(su,r):(r._writableState.errorEmitted=!0,H.dist.process.nextTick(kg,r,u)):H.dist.process.nextTick(kg,r,u):t?(H.dist.process.nextTick(su,r),t(u)):H.dist.process.nextTick(su,r)}),this)}function kg(e,t){pc(e,t),su(e)}function su(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function k1(){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 pc(e,t){e.emit("error",t)}function F1(e,t){var r=e._readableState,o=e._writableState;r&&r.autoDestroy||o&&o.autoDestroy?e.destroy(t):e.emit("error",t)}var qb={destroy:U1,undestroy:k1,errorOrDestroy:F1},Vi={};function H1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Gb={};function Wr(e,t,r){r||(r=Error);function o(u,f,h){return typeof t=="string"?t:t(u,f,h)}var s=function(u){H1(f,u);function f(h,l,p){return u.call(this,o(h,l,p))||this}return f}(r);s.prototype.name=r.name,s.prototype.code=e,Gb[e]=s}function Fg(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(o){return String(o)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function W1(e,t,r){return e.substr(0,t.length)===t}function q1(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function G1(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Wr("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Wr("ERR_INVALID_ARG_TYPE",function(e,t,r){var o;typeof t=="string"&&W1(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be";var s;if(q1(e," argument"))s="The ".concat(e," ").concat(o," ").concat(Fg(t,"type"));else{var u=G1(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(Fg(t,"type"))}return s+=". Received type ".concat(typeof r),s},TypeError);Wr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Wr("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Wr("ERR_STREAM_PREMATURE_CLOSE","Premature close");Wr("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Wr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Wr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Wr("ERR_STREAM_WRITE_AFTER_END","write after end");Wr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Wr("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Wr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Vi.codes=Gb;var V1=Vi.codes.ERR_INVALID_OPT_VALUE;function z1(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function K1(e,t,r,o){var s=z1(t,o,r);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var u=o?r:"highWaterMark";throw new V1(u,s)}return Math.floor(s)}return e.objectMode?16:16*1024}var Vb={getHighWaterMark:K1},Rl,Hg;function zb(){if(Hg)return Rl;Hg=1,Rl=ue;function e(R){var O=this;this.next=null,this.entry=null,this.finish=function(){be(O,R)}}var t;ue.WritableState=Q;var r={deprecate:H.requireBrowser()},o=Wb,s=H.bufferPolyfill.Buffer,u=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(R){return s.from(R)}function h(R){return s.isBuffer(R)||R instanceof u}var l=qb,p=Vb,b=p.getHighWaterMark,w=Vi.codes,I=w.ERR_INVALID_ARG_TYPE,A=w.ERR_METHOD_NOT_IMPLEMENTED,x=w.ERR_MULTIPLE_CALLBACK,v=w.ERR_STREAM_CANNOT_PIPE,C=w.ERR_STREAM_DESTROYED,B=w.ERR_STREAM_NULL_VALUES,P=w.ERR_STREAM_WRITE_AFTER_END,S=w.ERR_UNKNOWN_ENCODING,m=l.errorOrDestroy;H.requireInherits_browser()(ue,o);function j(){}function Q(R,O,q){t=t||Oo(),R=R||{},typeof q!="boolean"&&(q=O instanceof t),this.objectMode=!!R.objectMode,q&&(this.objectMode=this.objectMode||!!R.writableObjectMode),this.highWaterMark=b(this,R,"writableHighWaterMark",q),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var oe=R.decodeStrings===!1;this.decodeStrings=!oe,this.defaultEncoding=R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){Y(O,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}Q.prototype.getBuffer=function(){for(var O=this.bufferedRequest,q=[];O;)q.push(O),O=O.next;return q},function(){try{Object.defineProperty(Q.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ce;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ce=Function.prototype[Symbol.hasInstance],Object.defineProperty(ue,Symbol.hasInstance,{value:function(O){return ce.call(this,O)?!0:this!==ue?!1:O&&O._writableState instanceof Q}})):ce=function(O){return O instanceof this};function ue(R){t=t||Oo();var O=this instanceof t;if(!O&&!ce.call(ue,this))return new ue(R);this._writableState=new Q(R,this,O),this.writable=!0,R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final)),o.call(this)}ue.prototype.pipe=function(){m(this,new v)};function te(R,O){var q=new P;m(R,q),H.dist.process.nextTick(O,q)}function Se(R,O,q,oe){var ye;return q===null?ye=new B:typeof q!="string"&&!O.objectMode&&(ye=new I("chunk",["string","Buffer"],q)),ye?(m(R,ye),H.dist.process.nextTick(oe,ye),!1):!0}ue.prototype.write=function(R,O,q){var oe=this._writableState,ye=!1,d=!oe.objectMode&&h(R);return d&&!s.isBuffer(R)&&(R=f(R)),typeof O=="function"&&(q=O,O=null),d?O="buffer":O||(O=oe.defaultEncoding),typeof q!="function"&&(q=j),oe.ending?te(this,q):(d||Se(this,oe,R,q))&&(oe.pendingcb++,ye=F(this,oe,d,R,O,q)),ye},ue.prototype.cork=function(){this._writableState.corked++},ue.prototype.uncork=function(){var R=this._writableState;R.corked&&(R.corked--,!R.writing&&!R.corked&&!R.bufferProcessing&&R.bufferedRequest&&W(this,R))},ue.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new S(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(ue.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function me(R,O,q){return!R.objectMode&&R.decodeStrings!==!1&&typeof O=="string"&&(O=s.from(O,q)),O}Object.defineProperty(ue.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(R,O,q,oe,ye,d){if(!q){var g=me(O,oe,ye);oe!==g&&(q=!0,ye="buffer",oe=g)}var _=O.objectMode?1:oe.length;O.length+=_;var E=O.length<O.highWaterMark;if(E||(O.needDrain=!0),O.writing||O.corked){var J=O.lastBufferedRequest;O.lastBufferedRequest={chunk:oe,encoding:ye,isBuf:q,callback:d,next:null},J?J.next=O.lastBufferedRequest:O.bufferedRequest=O.lastBufferedRequest,O.bufferedRequestCount+=1}else U(R,O,!1,_,oe,ye,d);return E}function U(R,O,q,oe,ye,d,g){O.writelen=oe,O.writecb=g,O.writing=!0,O.sync=!0,O.destroyed?O.onwrite(new C("write")):q?R._writev(ye,O.onwrite):R._write(ye,d,O.onwrite),O.sync=!1}function $(R,O,q,oe,ye){--O.pendingcb,q?(H.dist.process.nextTick(ye,oe),H.dist.process.nextTick(re,R,O),R._writableState.errorEmitted=!0,m(R,oe)):(ye(oe),R._writableState.errorEmitted=!0,m(R,oe),re(R,O))}function G(R){R.writing=!1,R.writecb=null,R.length-=R.writelen,R.writelen=0}function Y(R,O){var q=R._writableState,oe=q.sync,ye=q.writecb;if(typeof ye!="function")throw new x;if(G(q),O)$(R,q,oe,O,ye);else{var d=K(q)||R.destroyed;!d&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest&&W(R,q),oe?H.dist.process.nextTick(V,R,q,d,ye):V(R,q,d,ye)}}function V(R,O,q,oe){q||ne(R,O),O.pendingcb--,oe(),re(R,O)}function ne(R,O){O.length===0&&O.needDrain&&(O.needDrain=!1,R.emit("drain"))}function W(R,O){O.bufferProcessing=!0;var q=O.bufferedRequest;if(R._writev&&q&&q.next){var oe=O.bufferedRequestCount,ye=new Array(oe),d=O.corkedRequestsFree;d.entry=q;for(var g=0,_=!0;q;)ye[g]=q,q.isBuf||(_=!1),q=q.next,g+=1;ye.allBuffers=_,U(R,O,!0,O.length,ye,"",d.finish),O.pendingcb++,O.lastBufferedRequest=null,d.next?(O.corkedRequestsFree=d.next,d.next=null):O.corkedRequestsFree=new e(O),O.bufferedRequestCount=0}else{for(;q;){var E=q.chunk,J=q.encoding,ie=q.callback,se=O.objectMode?1:E.length;if(U(R,O,!1,se,E,J,ie),q=q.next,O.bufferedRequestCount--,O.writing)break}q===null&&(O.lastBufferedRequest=null)}O.bufferedRequest=q,O.bufferProcessing=!1}ue.prototype._write=function(R,O,q){q(new A("_write()"))},ue.prototype._writev=null,ue.prototype.end=function(R,O,q){var oe=this._writableState;return typeof R=="function"?(q=R,R=null,O=null):typeof O=="function"&&(q=O,O=null),R!=null&&this.write(R,O),oe.corked&&(oe.corked=1,this.uncork()),oe.ending||_e(this,oe,q),this},Object.defineProperty(ue.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function K(R){return R.ending&&R.length===0&&R.bufferedRequest===null&&!R.finished&&!R.writing}function ae(R,O){R._final(function(q){O.pendingcb--,q&&m(R,q),O.prefinished=!0,R.emit("prefinish"),re(R,O)})}function de(R,O){!O.prefinished&&!O.finalCalled&&(typeof R._final=="function"&&!O.destroyed?(O.pendingcb++,O.finalCalled=!0,H.dist.process.nextTick(ae,R,O)):(O.prefinished=!0,R.emit("prefinish")))}function re(R,O){var q=K(O);if(q&&(de(R,O),O.pendingcb===0&&(O.finished=!0,R.emit("finish"),O.autoDestroy))){var oe=R._readableState;(!oe||oe.autoDestroy&&oe.endEmitted)&&R.destroy()}return q}function _e(R,O,q){O.ending=!0,re(R,O),q&&(O.finished?H.dist.process.nextTick(q):R.once("finish",q)),O.ended=!0,R.writable=!1}function be(R,O,q){var oe=R.entry;for(R.entry=null;oe;){var ye=oe.callback;O.pendingcb--,ye(q),oe=oe.next}O.corkedRequestsFree.next=R}return Object.defineProperty(ue.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),ue.prototype.destroy=l.destroy,ue.prototype._undestroy=l.undestroy,ue.prototype._destroy=function(R,O){O(R)},Rl}var Al,Wg;function Oo(){if(Wg)return Al;Wg=1;var e=Object.keys||function(p){var b=[];for(var w in p)b.push(w);return b};Al=f;var t=Jb(),r=zb();H.requireInherits_browser()(f,t);for(var o=e(r.prototype),s=0;s<o.length;s++){var u=o[s];f.prototype[u]||(f.prototype[u]=r.prototype[u])}function f(p){if(!(this instanceof f))return new f(p);t.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",h)))}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function h(){this._writableState.ended||H.dist.process.nextTick(l,this)}function l(p){p.end()}return Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),Al}var qg=Vi.codes.ERR_STREAM_PREMATURE_CLOSE;function J1(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];e.apply(this,o)}}}function Y1(){}function X1(e){return e.setHeader&&typeof e.abort=="function"}function Kb(e,t,r){if(typeof t=="function")return Kb(e,null,t);t||(t={}),r=J1(r||Y1);var o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||h()},f=e._writableState&&e._writableState.finished,h=function(){s=!1,f=!0,o||r.call(e)},l=e._readableState&&e._readableState.endEmitted,p=function(){o=!1,l=!0,s||r.call(e)},b=function(x){r.call(e,x)},w=function(){var x;if(o&&!l)return(!e._readableState||!e._readableState.ended)&&(x=new qg),r.call(e,x);if(s&&!f)return(!e._writableState||!e._writableState.ended)&&(x=new qg),r.call(e,x)},I=function(){e.req.on("finish",h)};return X1(e)?(e.on("complete",h),e.on("abort",w),e.req?I():e.on("request",I)):s&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",p),e.on("finish",h),t.error!==!1&&e.on("error",b),e.on("close",w),function(){e.removeListener("complete",h),e.removeListener("abort",w),e.removeListener("request",I),e.req&&e.req.removeListener("finish",h),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",h),e.removeListener("end",p),e.removeListener("error",b),e.removeListener("close",w)}}var Wc=Kb,Tl,Gg;function Z1(){if(Gg)return Tl;Gg=1;var e;function t(S,m,j){return m=r(m),m in S?Object.defineProperty(S,m,{value:j,enumerable:!0,configurable:!0,writable:!0}):S[m]=j,S}function r(S){var m=o(S,"string");return typeof m=="symbol"?m:String(m)}function o(S,m){if(typeof S!="object"||S===null)return S;var j=S[Symbol.toPrimitive];if(j!==void 0){var Q=j.call(S,m);if(typeof Q!="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(S)}var s=Wc,u=Symbol("lastResolve"),f=Symbol("lastReject"),h=Symbol("error"),l=Symbol("ended"),p=Symbol("lastPromise"),b=Symbol("handlePromise"),w=Symbol("stream");function I(S,m){return{value:S,done:m}}function A(S){var m=S[u];if(m!==null){var j=S[w].read();j!==null&&(S[p]=null,S[u]=null,S[f]=null,m(I(j,!1)))}}function x(S){H.dist.process.nextTick(A,S)}function v(S,m){return function(j,Q){S.then(function(){if(m[l]){j(I(void 0,!0));return}m[b](j,Q)},Q)}}var C=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((e={get stream(){return this[w]},next:function(){var m=this,j=this[h];if(j!==null)return Promise.reject(j);if(this[l])return Promise.resolve(I(void 0,!0));if(this[w].destroyed)return new Promise(function(te,Se){H.dist.process.nextTick(function(){m[h]?Se(m[h]):te(I(void 0,!0))})});var Q=this[p],ce;if(Q)ce=new Promise(v(Q,this));else{var ue=this[w].read();if(ue!==null)return Promise.resolve(I(ue,!1));ce=new Promise(this[b])}return this[p]=ce,ce}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var m=this;return new Promise(function(j,Q){m[w].destroy(null,function(ce){if(ce){Q(ce);return}j(I(void 0,!0))})})}),e),C),P=function(m){var j,Q=Object.create(B,(j={},t(j,w,{value:m,writable:!0}),t(j,u,{value:null,writable:!0}),t(j,f,{value:null,writable:!0}),t(j,h,{value:null,writable:!0}),t(j,l,{value:m._readableState.endEmitted,writable:!0}),t(j,b,{value:function(ue,te){var Se=Q[w].read();Se?(Q[p]=null,Q[u]=null,Q[f]=null,ue(I(Se,!1))):(Q[u]=ue,Q[f]=te)},writable:!0}),j));return Q[p]=null,s(m,function(ce){if(ce&&ce.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ue=Q[f];ue!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,ue(ce)),Q[h]=ce;return}var te=Q[u];te!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,te(I(void 0,!0))),Q[l]=!0}),m.on("readable",x.bind(null,Q)),Q};return Tl=P,Tl}var Il,Vg;function Q1(){return Vg||(Vg=1,Il=function(){throw new Error("Readable.from is not available in the browser")}),Il}var Ol,zg;function Jb(){if(zg)return Ol;zg=1,Ol=te;var e;te.ReadableState=ue,H.requireEvents().EventEmitter;var t=function(g,_){return g.listeners(_).length},r=Wb,o=H.bufferPolyfill.Buffer,s=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(d){return o.from(d)}function f(d){return o.isBuffer(d)||d instanceof s}var h=H.require$$3,l;h&&h.debuglog?l=h.debuglog("stream"):l=function(){};var p=j1(),b=qb,w=Vb,I=w.getHighWaterMark,A=Vi.codes,x=A.ERR_INVALID_ARG_TYPE,v=A.ERR_STREAM_PUSH_AFTER_EOF,C=A.ERR_METHOD_NOT_IMPLEMENTED,B=A.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,S,m;H.requireInherits_browser()(te,r);var j=b.errorOrDestroy,Q=["error","close","destroy","pause","resume"];function ce(d,g,_){if(typeof d.prependListener=="function")return d.prependListener(g,_);!d._events||!d._events[g]?d.on(g,_):Array.isArray(d._events[g])?d._events[g].unshift(_):d._events[g]=[_,d._events[g]]}function ue(d,g,_){e=e||Oo(),d=d||{},typeof _!="boolean"&&(_=g instanceof e),this.objectMode=!!d.objectMode,_&&(this.objectMode=this.objectMode||!!d.readableObjectMode),this.highWaterMark=I(this,d,"readableHighWaterMark",_),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.destroyed=!1,this.defaultEncoding=d.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,d.encoding&&(P||(P=H.requireString_decoder().StringDecoder),this.decoder=new P(d.encoding),this.encoding=d.encoding)}function te(d){if(e=e||Oo(),!(this instanceof te))return new te(d);var g=this instanceof e;this._readableState=new ue(d,this,g),this.readable=!0,d&&(typeof d.read=="function"&&(this._read=d.read),typeof d.destroy=="function"&&(this._destroy=d.destroy)),r.call(this)}Object.defineProperty(te.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(g){this._readableState&&(this._readableState.destroyed=g)}}),te.prototype.destroy=b.destroy,te.prototype._undestroy=b.undestroy,te.prototype._destroy=function(d,g){g(d)},te.prototype.push=function(d,g){var _=this._readableState,E;return _.objectMode?E=!0:typeof d=="string"&&(g=g||_.defaultEncoding,g!==_.encoding&&(d=o.from(d,g),g=""),E=!0),Se(this,d,g,!1,E)},te.prototype.unshift=function(d){return Se(this,d,null,!0,!1)};function Se(d,g,_,E,J){l("readableAddChunk",g);var ie=d._readableState;if(g===null)ie.reading=!1,Y(d,ie);else{var se;if(J||(se=F(ie,g)),se)j(d,se);else if(ie.objectMode||g&&g.length>0)if(typeof g!="string"&&!ie.objectMode&&Object.getPrototypeOf(g)!==o.prototype&&(g=u(g)),E)ie.endEmitted?j(d,new B):me(d,ie,g,!0);else if(ie.ended)j(d,new v);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!_?(g=ie.decoder.write(g),ie.objectMode||g.length!==0?me(d,ie,g,!1):W(d,ie)):me(d,ie,g,!1)}else E||(ie.reading=!1,W(d,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function me(d,g,_,E){g.flowing&&g.length===0&&!g.sync?(g.awaitDrain=0,d.emit("data",_)):(g.length+=g.objectMode?1:_.length,E?g.buffer.unshift(_):g.buffer.push(_),g.needReadable&&V(d)),W(d,g)}function F(d,g){var _;return!f(g)&&typeof g!="string"&&g!==void 0&&!d.objectMode&&(_=new x("chunk",["string","Buffer","Uint8Array"],g)),_}te.prototype.isPaused=function(){return this._readableState.flowing===!1},te.prototype.setEncoding=function(d){P||(P=H.requireString_decoder().StringDecoder);var g=new P(d);this._readableState.decoder=g,this._readableState.encoding=this._readableState.decoder.encoding;for(var _=this._readableState.buffer.head,E="";_!==null;)E+=g.write(_.data),_=_.next;return this._readableState.buffer.clear(),E!==""&&this._readableState.buffer.push(E),this._readableState.length=E.length,this};var U=1073741824;function $(d){return d>=U?d=U:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++),d}function G(d,g){return d<=0||g.length===0&&g.ended?0:g.objectMode?1:d!==d?g.flowing&&g.length?g.buffer.head.data.length:g.length:(d>g.highWaterMark&&(g.highWaterMark=$(d)),d<=g.length?d:g.ended?g.length:(g.needReadable=!0,0))}te.prototype.read=function(d){l("read",d),d=parseInt(d,10);var g=this._readableState,_=d;if(d!==0&&(g.emittedReadable=!1),d===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return l("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?q(this):V(this),null;if(d=G(d,g),d===0&&g.ended)return g.length===0&&q(this),null;var E=g.needReadable;l("need readable",E),(g.length===0||g.length-d<g.highWaterMark)&&(E=!0,l("length less than watermark",E)),g.ended||g.reading?(E=!1,l("reading or ended",E)):E&&(l("do read"),g.reading=!0,g.sync=!0,g.length===0&&(g.needReadable=!0),this._read(g.highWaterMark),g.sync=!1,g.reading||(d=G(_,g)));var J;return d>0?J=O(d,g):J=null,J===null?(g.needReadable=g.length<=g.highWaterMark,d=0):(g.length-=d,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),_!==d&&g.ended&&q(this)),J!==null&&this.emit("data",J),J};function Y(d,g){if(l("onEofChunk"),!g.ended){if(g.decoder){var _=g.decoder.end();_&&_.length&&(g.buffer.push(_),g.length+=g.objectMode?1:_.length)}g.ended=!0,g.sync?V(d):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,ne(d)))}}function V(d){var g=d._readableState;l("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(l("emitReadable",g.flowing),g.emittedReadable=!0,H.dist.process.nextTick(ne,d))}function ne(d){var g=d._readableState;l("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(d.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,R(d)}function W(d,g){g.readingMore||(g.readingMore=!0,H.dist.process.nextTick(K,d,g))}function K(d,g){for(;!g.reading&&!g.ended&&(g.length<g.highWaterMark||g.flowing&&g.length===0);){var _=g.length;if(l("maybeReadMore read 0"),d.read(0),_===g.length)break}g.readingMore=!1}te.prototype._read=function(d){j(this,new C("_read()"))},te.prototype.pipe=function(d,g){var _=this,E=this._readableState;switch(E.pipesCount){case 0:E.pipes=d;break;case 1:E.pipes=[E.pipes,d];break;default:E.pipes.push(d);break}E.pipesCount+=1,l("pipe count=%d opts=%j",E.pipesCount,g);var J=(!g||g.end!==!1)&&d!==H.dist.process.stdout&&d!==H.dist.process.stderr,ie=J?Ie:_t;E.endEmitted?H.dist.process.nextTick(ie):_.once("end",ie),d.on("unpipe",se);function se(Ye,Ve){l("onunpipe"),Ye===_&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,Ue())}function Ie(){l("onend"),d.end()}var Be=ae(_);d.on("drain",Be);var Ce=!1;function Ue(){l("cleanup"),d.removeListener("close",bt),d.removeListener("finish",et),d.removeListener("drain",Be),d.removeListener("error",He),d.removeListener("unpipe",se),_.removeListener("end",Ie),_.removeListener("end",_t),_.removeListener("data",Re),Ce=!0,E.awaitDrain&&(!d._writableState||d._writableState.needDrain)&&Be()}_.on("data",Re);function Re(Ye){l("ondata");var Ve=d.write(Ye);l("dest.write",Ve),Ve===!1&&((E.pipesCount===1&&E.pipes===d||E.pipesCount>1&&ye(E.pipes,d)!==-1)&&!Ce&&(l("false write response, pause",E.awaitDrain),E.awaitDrain++),_.pause())}function He(Ye){l("onerror",Ye),_t(),d.removeListener("error",He),t(d,"error")===0&&j(d,Ye)}ce(d,"error",He);function bt(){d.removeListener("finish",et),_t()}d.once("close",bt);function et(){l("onfinish"),d.removeListener("close",bt),_t()}d.once("finish",et);function _t(){l("unpipe"),_.unpipe(d)}return d.emit("pipe",_),E.flowing||(l("pipe resume"),_.resume()),d};function ae(d){return function(){var _=d._readableState;l("pipeOnDrain",_.awaitDrain),_.awaitDrain&&_.awaitDrain--,_.awaitDrain===0&&t(d,"data")&&(_.flowing=!0,R(d))}}te.prototype.unpipe=function(d){var g=this._readableState,_={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return d&&d!==g.pipes?this:(d||(d=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,d&&d.emit("unpipe",this,_),this);if(!d){var E=g.pipes,J=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var ie=0;ie<J;ie++)E[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var se=ye(g.pipes,d);return se===-1?this:(g.pipes.splice(se,1),g.pipesCount-=1,g.pipesCount===1&&(g.pipes=g.pipes[0]),d.emit("unpipe",this,_),this)},te.prototype.on=function(d,g){var _=r.prototype.on.call(this,d,g),E=this._readableState;return d==="data"?(E.readableListening=this.listenerCount("readable")>0,E.flowing!==!1&&this.resume()):d==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,l("on readable",E.length,E.reading),E.length?V(this):E.reading||H.dist.process.nextTick(re,this)),_},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(d,g){var _=r.prototype.removeListener.call(this,d,g);return d==="readable"&&H.dist.process.nextTick(de,this),_},te.prototype.removeAllListeners=function(d){var g=r.prototype.removeAllListeners.apply(this,arguments);return(d==="readable"||d===void 0)&&H.dist.process.nextTick(de,this),g};function de(d){var g=d._readableState;g.readableListening=d.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:d.listenerCount("data")>0&&d.resume()}function re(d){l("readable nexttick read 0"),d.read(0)}te.prototype.resume=function(){var d=this._readableState;return d.flowing||(l("resume"),d.flowing=!d.readableListening,_e(this,d)),d.paused=!1,this};function _e(d,g){g.resumeScheduled||(g.resumeScheduled=!0,H.dist.process.nextTick(be,d,g))}function be(d,g){l("resume",g.reading),g.reading||d.read(0),g.resumeScheduled=!1,d.emit("resume"),R(d),g.flowing&&!g.reading&&d.read(0)}te.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function R(d){var g=d._readableState;for(l("flow",g.flowing);g.flowing&&d.read()!==null;);}te.prototype.wrap=function(d){var g=this,_=this._readableState,E=!1;d.on("end",function(){if(l("wrapped end"),_.decoder&&!_.ended){var se=_.decoder.end();se&&se.length&&g.push(se)}g.push(null)}),d.on("data",function(se){if(l("wrapped data"),_.decoder&&(se=_.decoder.write(se)),!(_.objectMode&&se==null)&&!(!_.objectMode&&(!se||!se.length))){var Ie=g.push(se);Ie||(E=!0,d.pause())}});for(var J in d)this[J]===void 0&&typeof d[J]=="function"&&(this[J]=function(Ie){return function(){return d[Ie].apply(d,arguments)}}(J));for(var ie=0;ie<Q.length;ie++)d.on(Q[ie],this.emit.bind(this,Q[ie]));return this._read=function(se){l("wrapped _read",se),E&&(E=!1,d.resume())},this},typeof Symbol=="function"&&(te.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=Z1()),S(this)}),Object.defineProperty(te.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(te.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(te.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(g){this._readableState&&(this._readableState.flowing=g)}}),te._fromList=O,Object.defineProperty(te.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(d,g){if(g.length===0)return null;var _;return g.objectMode?_=g.buffer.shift():!d||d>=g.length?(g.decoder?_=g.buffer.join(""):g.buffer.length===1?_=g.buffer.first():_=g.buffer.concat(g.length),g.buffer.clear()):_=g.buffer.consume(d,g.decoder),_}function q(d){var g=d._readableState;l("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,H.dist.process.nextTick(oe,g,d))}function oe(d,g){if(l("endReadableNT",d.endEmitted,d.length),!d.endEmitted&&d.length===0&&(d.endEmitted=!0,g.readable=!1,g.emit("end"),d.autoDestroy)){var _=g._writableState;(!_||_.autoDestroy&&_.finished)&&g.destroy()}}typeof Symbol=="function"&&(te.from=function(d,g){return m===void 0&&(m=Q1()),m(te,d,g)});function ye(d,g){for(var _=0,E=d.length;_<E;_++)if(d[_]===g)return _;return-1}return Ol}var Yb=Jn,Su=Vi.codes,eA=Su.ERR_METHOD_NOT_IMPLEMENTED,tA=Su.ERR_MULTIPLE_CALLBACK,rA=Su.ERR_TRANSFORM_ALREADY_TRANSFORMING,nA=Su.ERR_TRANSFORM_WITH_LENGTH_0,Ru=Oo();H.requireInherits_browser()(Jn,Ru);function iA(e,t){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(o===null)return this.emit("error",new tA);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),o(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function Jn(e){if(!(this instanceof Jn))return new Jn(e);Ru.call(this,e),this._transformState={afterTransform:iA.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",oA)}function oA(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Kg(e,t,r)}):Kg(this,null,null)}Jn.prototype.push=function(e,t){return this._transformState.needTransform=!1,Ru.prototype.push.call(this,e,t)};Jn.prototype._transform=function(e,t,r){r(new eA("_transform()"))};Jn.prototype._write=function(e,t,r){var o=this._transformState;if(o.writecb=r,o.writechunk=e,o.writeencoding=t,!o.transforming){var s=this._readableState;(o.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}};Jn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Jn.prototype._destroy=function(e,t){Ru.prototype._destroy.call(this,e,function(r){t(r)})};function Kg(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new nA;if(e._transformState.transforming)throw new rA;return e.push(null)}var sA=As,Xb=Yb;H.requireInherits_browser()(As,Xb);function As(e){if(!(this instanceof As))return new As(e);Xb.call(this,e)}As.prototype._transform=function(e,t,r){r(null,e)};var Cl;function aA(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Zb=Vi.codes,uA=Zb.ERR_MISSING_ARGS,fA=Zb.ERR_STREAM_DESTROYED;function Jg(e){if(e)throw e}function lA(e){return e.setHeader&&typeof e.abort=="function"}function cA(e,t,r,o){o=aA(o);var s=!1;e.on("close",function(){s=!0}),Cl===void 0&&(Cl=Wc),Cl(e,{readable:t,writable:r},function(f){if(f)return o(f);s=!0,o()});var u=!1;return function(f){if(!s&&!u){if(u=!0,lA(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();o(f||new fA("pipe"))}}}function Yg(e){e()}function dA(e,t){return e.pipe(t)}function hA(e){return!e.length||typeof e[e.length-1]!="function"?Jg:e.pop()}function gA(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=hA(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new uA("streams");var s,u=t.map(function(f,h){var l=h<t.length-1,p=h>0;return cA(f,l,p,function(b){s||(s=b),b&&u.forEach(Yg),!l&&(u.forEach(Yg),o(s))})});return t.reduce(dA)}var pA=gA;(function(e,t){t=e.exports=Jb(),t.Stream=t,t.Readable=t,t.Writable=zb(),t.Duplex=Oo(),t.Transform=Yb,t.PassThrough=sA,t.finished=Wc,t.pipeline=pA})(gc,gc.exports);var Qb=gc.exports;const{Transform:vN}=Qb,{Transform:SN}=Qb;var e_={};const Xg=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];e_.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],h=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],p=e[7]^e[17]^e[27]^e[37]^e[47],b=e[8]^e[18]^e[28]^e[38]^e[48],w=e[9]^e[19]^e[29]^e[39]^e[49];let I=b^(s<<1|u>>>31),A=w^(u<<1|s>>>31);const x=e[0]^I,v=e[1]^A,C=e[10]^I,B=e[11]^A,P=e[20]^I,S=e[21]^A,m=e[30]^I,j=e[31]^A,Q=e[40]^I,ce=e[41]^A;I=r^(f<<1|h>>>31),A=o^(h<<1|f>>>31);const ue=e[2]^I,te=e[3]^A,Se=e[12]^I,me=e[13]^A,F=e[22]^I,U=e[23]^A,$=e[32]^I,G=e[33]^A,Y=e[42]^I,V=e[43]^A;I=s^(l<<1|p>>>31),A=u^(p<<1|l>>>31);const ne=e[4]^I,W=e[5]^A,K=e[14]^I,ae=e[15]^A,de=e[24]^I,re=e[25]^A,_e=e[34]^I,be=e[35]^A,R=e[44]^I,O=e[45]^A;I=f^(b<<1|w>>>31),A=h^(w<<1|b>>>31);const q=e[6]^I,oe=e[7]^A,ye=e[16]^I,d=e[17]^A,g=e[26]^I,_=e[27]^A,E=e[36]^I,J=e[37]^A,ie=e[46]^I,se=e[47]^A;I=l^(r<<1|o>>>31),A=p^(o<<1|r>>>31);const Ie=e[8]^I,Be=e[9]^A,Ce=e[18]^I,Ue=e[19]^A,Re=e[28]^I,He=e[29]^A,bt=e[38]^I,et=e[39]^A,_t=e[48]^I,Ye=e[49]^A,Ve=x,Dt=v,Lt=B<<4|C>>>28,at=C<<4|B>>>28,Bt=P<<3|S>>>29,fr=S<<3|P>>>29,er=j<<9|m>>>23,kt=m<<9|j>>>23,lr=Q<<18|ce>>>14,zr=ce<<18|Q>>>14,Kr=ue<<1|te>>>31,sn=te<<1|ue>>>31,an=me<<12|Se>>>20,tr=Se<<12|me>>>20,Or=F<<10|U>>>22,rr=U<<10|F>>>22,Ln=G<<13|$>>>19,Jr=$<<13|G>>>19,un=Y<<2|V>>>30,N=V<<2|Y>>>30,D=W<<30|ne>>>2,Ee=ne<<30|W>>>2,ve=K<<6|ae>>>26,Te=ae<<6|K>>>26,yt=re<<11|de>>>21,St=de<<11|re>>>21,fn=_e<<15|be>>>17,Pt=be<<15|_e>>>17,ln=O<<29|R>>>3,Pn=R<<29|O>>>3,cn=q<<28|oe>>>4,dn=oe<<28|q>>>4,Yr=d<<23|ye>>>9,Gt=ye<<23|d>>>9,Cr=g<<25|_>>>7,yr=_<<25|g>>>7,nr=E<<21|J>>>11,Ft=J<<21|E>>>11,Ti=se<<24|ie>>>8,Ii=ie<<24|se>>>8,Bn=Ie<<27|Be>>>5,hn=Be<<27|Ie>>>5,gn=Ce<<20|Ue>>>12,Lr=Ue<<20|Ce>>>12,Oi=He<<7|Re>>>25,pn=Re<<7|He>>>25,ti=bt<<8|et>>>24,ri=et<<8|bt>>>24,ni=_t<<14|Ye>>>18,ii=Ye<<14|_t>>>18;e[0]=Ve^~an&yt,e[1]=Dt^~tr&St,e[10]=cn^~gn&Bt,e[11]=dn^~Lr&fr,e[20]=Kr^~ve&Cr,e[21]=sn^~Te&yr,e[30]=Bn^~Lt&Or,e[31]=hn^~at&rr,e[40]=D^~Yr&Oi,e[41]=Ee^~Gt&pn,e[2]=an^~yt&nr,e[3]=tr^~St&Ft,e[12]=gn^~Bt&Ln,e[13]=Lr^~fr&Jr,e[22]=ve^~Cr&ti,e[23]=Te^~yr&ri,e[32]=Lt^~Or&fn,e[33]=at^~rr&Pt,e[42]=Yr^~Oi&er,e[43]=Gt^~pn&kt,e[4]=yt^~nr&ni,e[5]=St^~Ft&ii,e[14]=Bt^~Ln&ln,e[15]=fr^~Jr&Pn,e[24]=Cr^~ti&lr,e[25]=yr^~ri&zr,e[34]=Or^~fn&Ti,e[35]=rr^~Pt&Ii,e[44]=Oi^~er&un,e[45]=pn^~kt&N,e[6]=nr^~ni&Ve,e[7]=Ft^~ii&Dt,e[16]=Ln^~ln&cn,e[17]=Jr^~Pn&dn,e[26]=ti^~lr&Kr,e[27]=ri^~zr&sn,e[36]=fn^~Ti&Bn,e[37]=Pt^~Ii&hn,e[46]=er^~un&D,e[47]=kt^~N&Ee,e[8]=ni^~Ve&an,e[9]=ii^~Dt&tr,e[18]=ln^~cn&gn,e[19]=Pn^~dn&Lr,e[28]=lr^~Kr&ve,e[29]=zr^~sn&Te,e[38]=Ti^~Bn&Lt,e[39]=Ii^~hn&at,e[48]=un^~D&Yr,e[49]=N^~Ee&Gt,e[0]^=Xg[t*2],e[1]^=Xg[t*2+1]}};const cu=e_;function Ns(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Ns.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Ns.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(cu.p1600(this.state),this.count=0)};Ns.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&cu.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),cu.p1600(this.state),this.count=0,this.squeezing=!0};Ns.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=H.dist.Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(cu.p1600(this.state),this.count=0);return t};Ns.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var bA=_A;function _A(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const yA=H.getDefaultExportFromCjs(bA);var bc={exports:{}},Ll,Zg;function wA(){if(Zg)return Ll;Zg=1;var e=1e3,t=e*60,r=t*60,o=r*24,s=o*7,u=o*365.25;Ll=function(b,w){w=w||{};var I=typeof b;if(I==="string"&&b.length>0)return f(b);if(I==="number"&&isFinite(b))return w.long?l(b):h(b);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(b))};function f(b){if(b=String(b),!(b.length>100)){var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(b);if(w){var I=parseFloat(w[1]),A=(w[2]||"ms").toLowerCase();switch(A){case"years":case"year":case"yrs":case"yr":case"y":return I*u;case"weeks":case"week":case"w":return I*s;case"days":case"day":case"d":return I*o;case"hours":case"hour":case"hrs":case"hr":case"h":return I*r;case"minutes":case"minute":case"mins":case"min":case"m":return I*t;case"seconds":case"second":case"secs":case"sec":case"s":return I*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return I;default:return}}}}function h(b){var w=Math.abs(b);return w>=o?Math.round(b/o)+"d":w>=r?Math.round(b/r)+"h":w>=t?Math.round(b/t)+"m":w>=e?Math.round(b/e)+"s":b+"ms"}function l(b){var w=Math.abs(b);return w>=o?p(b,w,o,"day"):w>=r?p(b,w,r,"hour"):w>=t?p(b,w,t,"minute"):w>=e?p(b,w,e,"second"):b+" ms"}function p(b,w,I,A){var x=w>=I*1.5;return Math.round(b/I)+" "+A+(x?"s":"")}return Ll}function mA(e){r.debug=r,r.default=r,r.coerce=l,r.disable=f,r.enable=s,r.enabled=h,r.humanize=wA(),r.destroy=p,Object.keys(e).forEach(b=>{r[b]=e[b]}),r.names=[],r.skips=[],r.formatters={};function t(b){let w=0;for(let I=0;I<b.length;I++)w=(w<<5)-w+b.charCodeAt(I),w|=0;return r.colors[Math.abs(w)%r.colors.length]}r.selectColor=t;function r(b){let w,I=null,A,x;function v(...C){if(!v.enabled)return;const B=v,P=Number(new Date),S=P-(w||P);B.diff=S,B.prev=w,B.curr=P,w=P,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let m=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(Q,ce)=>{if(Q==="%%")return"%";m++;const ue=r.formatters[ce];if(typeof ue=="function"){const te=C[m];Q=ue.call(B,te),C.splice(m,1),m--}return Q}),r.formatArgs.call(B,C),(B.log||r.log).apply(B,C)}return v.namespace=b,v.useColors=r.useColors(),v.color=r.selectColor(b),v.extend=o,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>I!==null?I:(A!==r.namespaces&&(A=r.namespaces,x=r.enabled(b)),x),set:C=>{I=C}}),typeof r.init=="function"&&r.init(v),v}function o(b,w){const I=r(this.namespace+(typeof w>"u"?":":w)+b);return I.log=this.log,I}function s(b){r.save(b),r.namespaces=b,r.names=[],r.skips=[];const w=(typeof b=="string"?b:"").trim().replace(" ",",").split(",").filter(Boolean);for(const I of w)I[0]==="-"?r.skips.push(I.slice(1)):r.names.push(I)}function u(b,w){let I=0,A=0,x=-1,v=0;for(;I<b.length;)if(A<w.length&&(w[A]===b[I]||w[A]==="*"))w[A]==="*"?(x=A,v=I,A++):(I++,A++);else if(x!==-1)A=x+1,v++,I=v;else return!1;for(;A<w.length&&w[A]==="*";)A++;return A===w.length}function f(){const b=[...r.names,...r.skips.map(w=>"-"+w)].join(",");return r.enable(""),b}function h(b){for(const w of r.skips)if(u(b,w))return!1;for(const w of r.names)if(u(b,w))return!0;return!1}function l(b){return b instanceof Error?b.stack||b.message:b}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var EA=mA;(function(e,t){t.formatArgs=o,t.save=s,t.load=u,t.useColors=r,t.storage=f(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;l.splice(1,0,p,"color: inherit");let b=0,w=0;l[0].replace(/%[a-zA-Z%]/g,I=>{I!=="%%"&&(b++,I==="%c"&&(w=b))}),l.splice(w,0,p)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function u(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof H.dist.process<"u"&&"env"in H.dist.process&&(l=H.dist.process.env.DEBUG),l}function f(){try{return localStorage}catch{}}e.exports=EA(t);const{formatters:h}=e.exports;h.j=function(l){try{return JSON.stringify(l)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(bc,bc.exports);var vA=bc.exports,nn={},Ei={},qc=Ts;Ts.default=Ts;Ts.stable=n_;Ts.stableStringify=n_;var du="[...]",t_="[Circular]",Wi=[],Fi=[];function r_(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Ts(e,t,r,o){typeof o>"u"&&(o=r_()),_c(e,"",0,[],void 0,0,o);var s;try{Fi.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,i_(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Wi.length!==0;){var u=Wi.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function Ro(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);s.get!==void 0?s.configurable?(Object.defineProperty(o,r,{value:e}),Wi.push([o,r,t,s])):Fi.push([t,r,e]):(o[r]=e,Wi.push([o,r,t]))}function _c(e,t,r,o,s,u,f){u+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;h<o.length;h++)if(o[h]===e){Ro(t_,e,t,s);return}if(typeof f.depthLimit<"u"&&u>f.depthLimit){Ro(du,e,t,s);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){Ro(du,e,t,s);return}if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)_c(e[h],h,h,o,e,u,f);else{var l=Object.keys(e);for(h=0;h<l.length;h++){var p=l[h];_c(e[p],p,h,o,e,u,f)}}o.pop()}}function SA(e,t){return e<t?-1:e>t?1:0}function n_(e,t,r,o){typeof o>"u"&&(o=r_());var s=yc(e,"",0,[],void 0,0,o)||e,u;try{Fi.length===0?u=JSON.stringify(s,t,r):u=JSON.stringify(s,i_(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Wi.length!==0;){var f=Wi.pop();f.length===4?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return u}function yc(e,t,r,o,s,u,f){u+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;h<o.length;h++)if(o[h]===e){Ro(t_,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof f.depthLimit<"u"&&u>f.depthLimit){Ro(du,e,t,s);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){Ro(du,e,t,s);return}if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)yc(e[h],h,h,o,e,u,f);else{var l={},p=Object.keys(e).sort(SA);for(h=0;h<p.length;h++){var b=p[h];yc(e[b],b,h,o,e,u,f),l[b]=e[b]}if(typeof s<"u")Wi.push([s,t,e]),s[t]=l;else return l}o.pop()}}function i_(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Fi.length>0)for(var o=0;o<Fi.length;o++){var s=Fi[o];if(s[1]===t&&s[0]===r){r=s[2],Fi.splice(o,1);break}}return e.call(this,t,r)}}const RA=H.getDefaultExportFromCjs(qc);Object.defineProperty(Ei,"__esModule",{value:!0});Ei.EthereumProviderError=Ei.EthereumRpcError=void 0;const AA=qc;class o_ extends Error{constructor(t,r,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,o!==void 0&&(this.data=o)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return AA.default(this.serialize(),OA,2)}}Ei.EthereumRpcError=o_;let TA=class extends o_{constructor(t,r,o){if(!IA(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,o)}};Ei.EthereumProviderError=TA;function IA(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function OA(e,t){if(t!=="[Circular]")return t}var Gc={},vi={};Object.defineProperty(vi,"__esModule",{value:!0});vi.errorValues=vi.errorCodes=void 0;vi.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};vi.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=vi,r=Ei,o=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",u={code:o,message:f(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function f(I,A=s){if(Number.isInteger(I)){const x=I.toString();if(w(t.errorValues,x))return t.errorValues[x].message;if(p(I))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return A}e.getMessageFromCode=f;function h(I){if(!Number.isInteger(I))return!1;const A=I.toString();return!!(t.errorValues[A]||p(I))}e.isValidCode=h;function l(I,{fallbackError:A=u,shouldIncludeStack:x=!1}={}){var v,C;if(!A||!Number.isInteger(A.code)||typeof A.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(I instanceof r.EthereumRpcError)return I.serialize();const B={};if(I&&typeof I=="object"&&!Array.isArray(I)&&w(I,"code")&&h(I.code)){const S=I;B.code=S.code,S.message&&typeof S.message=="string"?(B.message=S.message,w(S,"data")&&(B.data=S.data)):(B.message=f(B.code),B.data={originalError:b(I)})}else{B.code=A.code;const S=(v=I)===null||v===void 0?void 0:v.message;B.message=S&&typeof S=="string"?S:A.message,B.data={originalError:b(I)}}const P=(C=I)===null||C===void 0?void 0:C.stack;return x&&I&&P&&typeof P=="string"&&(B.stack=P),B}e.serializeError=l;function p(I){return I>=-32099&&I<=-32e3}function b(I){return I&&typeof I=="object"&&!Array.isArray(I)?Object.assign({},I):I}function w(I,A){return Object.prototype.hasOwnProperty.call(I,A)}})(Gc);var Au={};Object.defineProperty(Au,"__esModule",{value:!0});Au.ethErrors=void 0;const Vc=Ei,s_=Gc,Yt=vi;Au.ethErrors={rpc:{parse:e=>jr(Yt.errorCodes.rpc.parse,e),invalidRequest:e=>jr(Yt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>jr(Yt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>jr(Yt.errorCodes.rpc.methodNotFound,e),internal:e=>jr(Yt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return jr(t,e)},invalidInput:e=>jr(Yt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>jr(Yt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>jr(Yt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>jr(Yt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>jr(Yt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>jr(Yt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>ds(Yt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>ds(Yt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>ds(Yt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>ds(Yt.errorCodes.provider.disconnected,e),chainDisconnected:e=>ds(Yt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:o}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Vc.EthereumProviderError(t,r,o)}}};function jr(e,t){const[r,o]=a_(t);return new Vc.EthereumRpcError(e,r||s_.getMessageFromCode(e),o)}function ds(e,t){const[r,o]=a_(t);return new Vc.EthereumProviderError(e,r||s_.getMessageFromCode(e),o)}function a_(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ei;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Gc;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const o=Au;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const s=vi;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(nn);function Ne(e,t,r){return(t=D1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zc={exports:{}},Pl={exports:{}};let CA=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let o=0;o<t.length;o++)r+=` ${t[o].stack}
2
- `;super(r),this.name="AggregateError",this.errors=t}};var vt={AggregateError:CA,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array},u_={exports:{}},f_={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,o]){const s=t.shift();return o==="f"?s.toFixed(6):o==="j"?JSON.stringify(s):o==="s"&&typeof s=="object"?`${s.constructor!==Object?s.constructor.name:""} {}`.trim():s.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}};const{format:LA,inspect:hu}=f_,{AggregateError:PA}=vt,BA=globalThis.AggregateError||PA,NA=Symbol("kIsNodeError"),$A=["string","function","number","object","Function","Object","boolean","bigint","symbol"],MA=/^([A-Z][a-z0-9]*)+$/,xA="__node_internal_",Tu={};function Hi(e,t){if(!e)throw new Tu.ERR_INTERNAL_ASSERTION(t)}function Qg(e){let t="",r=e.length;const o=e[0]==="-"?1:0;for(;r>=o+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function DA(e,t,r){if(typeof t=="function")return Hi(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return Hi(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),r.length===0?t:LA(t,...r)}function qt(e,t,r){r||(r=Error);class o extends r{constructor(...u){super(DA(e,t,u))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[NA]=!0,Tu[e]=o}function ep(e){const t=xA+e.name;return Object.defineProperty(e,"name",{value:t}),e}function jA(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new BA([t,e],t.message);return r.code=t.code,r}return e||t}let UA=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Tu.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};qt("ERR_ASSERTION","%s",Error);qt("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Hi(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let o="The ";e.endsWith(" argument")?o+=`${e} `:o+=`"${e}" ${e.includes(".")?"property":"argument"} `,o+="must be ";const s=[],u=[],f=[];for(const l of t)Hi(typeof l=="string","All expected entries have to be of type string"),$A.includes(l)?s.push(l.toLowerCase()):MA.test(l)?u.push(l):(Hi(l!=="object",'The value "object" should be written as "Object"'),f.push(l));if(u.length>0){const l=s.indexOf("object");l!==-1&&(s.splice(s,l,1),u.push("Object"))}if(s.length>0){switch(s.length){case 1:o+=`of type ${s[0]}`;break;case 2:o+=`one of type ${s[0]} or ${s[1]}`;break;default:{const l=s.pop();o+=`one of type ${s.join(", ")}, or ${l}`}}(u.length>0||f.length>0)&&(o+=" or ")}if(u.length>0){switch(u.length){case 1:o+=`an instance of ${u[0]}`;break;case 2:o+=`an instance of ${u[0]} or ${u[1]}`;break;default:{const l=u.pop();o+=`an instance of ${u.join(", ")}, or ${l}`}}f.length>0&&(o+=" or ")}switch(f.length){case 0:break;case 1:f[0].toLowerCase()!==f[0]&&(o+="an "),o+=`${f[0]}`;break;case 2:o+=`one of ${f[0]} or ${f[1]}`;break;default:{const l=f.pop();o+=`one of ${f.join(", ")}, or ${l}`}}if(r==null)o+=`. Received ${r}`;else if(typeof r=="function"&&r.name)o+=`. Received function ${r.name}`;else if(typeof r=="object"){var h;if((h=r.constructor)!==null&&h!==void 0&&h.name)o+=`. Received an instance of ${r.constructor.name}`;else{const l=hu(r,{depth:-1});o+=`. Received ${l}`}}else{let l=hu(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),o+=`. Received type ${typeof r} (${l})`}return o},TypeError);qt("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let o=hu(t);return o.length>128&&(o=o.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${o}`},TypeError);qt("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var o;const s=r!=null&&(o=r.constructor)!==null&&o!==void 0&&o.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${s}.`},TypeError);qt("ERR_MISSING_ARGS",(...e)=>{Hi(e.length>0,"At least one arg needs to be specified");let t;const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(o=>`"${o}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const o=e.pop();t+=`The ${e.join(", ")}, and ${o} arguments`}break}return`${t} must be specified`},TypeError);qt("ERR_OUT_OF_RANGE",(e,t,r)=>{Hi(t,'Missing "range" argument');let o;if(Number.isInteger(r)&&Math.abs(r)>2**32)o=Qg(String(r));else if(typeof r=="bigint"){o=String(r);const s=BigInt(2)**BigInt(32);(r>s||r<-s)&&(o=Qg(o)),o+="n"}else o=hu(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${o}`},RangeError);qt("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);qt("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);qt("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);qt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);qt("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);qt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);qt("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);qt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);qt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);qt("ERR_STREAM_WRITE_AFTER_END","write after end",Error);qt("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var ur={AbortError:UA,aggregateTwoErrors:ep(jA),hideStackFrames:ep,codes:Tu},hs={exports:{}},tp;function Is(){if(tp)return hs.exports;tp=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return hs.exports=e,hs.exports.AbortSignal=t,hs.exports.default=e,hs.exports}(function(e){const t=H.bufferPolyfill,{format:r,inspect:o}=f_,{codes:{ERR_INVALID_ARG_TYPE:s}}=ur,{kResistStopPropagation:u,AggregateError:f,SymbolDispose:h}=vt,l=globalThis.AbortSignal||Is().AbortSignal,p=globalThis.AbortController||Is().AbortController,b=Object.getPrototypeOf(async function(){}).constructor,w=globalThis.Blob||t.Blob,I=typeof w<"u"?function(C){return C instanceof w}:function(C){return!1},A=(v,C)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new s(C,"AbortSignal",v)},x=(v,C)=>{if(typeof v!="function")throw new s(C,"Function",v)};e.exports={AggregateError:f,kEmptyObject:Object.freeze({}),once(v){let C=!1;return function(...B){C||(C=!0,v.apply(this,B))}},createDeferredPromise:function(){let v,C;return{promise:new Promise((P,S)=>{v=P,C=S}),resolve:v,reject:C}},promisify(v){return new Promise((C,B)=>{v((P,...S)=>P?B(P):C(...S))})},debuglog(){return function(){}},format:r,inspect:o,types:{isAsyncFunction(v){return v instanceof b},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:I,deprecate(v,C){return v},addAbortListener:H.requireEvents().addAbortListener||function(C,B){if(C===void 0)throw new s("signal","AbortSignal",C);A(C,"signal"),x(B,"listener");let P;return C.aborted?queueMicrotask(()=>B()):(C.addEventListener("abort",B,{__proto__:null,once:!0,[u]:!0}),P=()=>{C.removeEventListener("abort",B)}),{__proto__:null,[h](){var S;(S=P)===null||S===void 0||S()}}},AbortSignalAny:l.any||function(C){if(C.length===1)return C[0];const B=new p,P=()=>B.abort();return C.forEach(S=>{A(S,"signals"),S.addEventListener("abort",P,{once:!0})}),B.signal.addEventListener("abort",()=>{C.forEach(S=>S.removeEventListener("abort",P))},{once:!0}),B.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(u_);var br=u_.exports,Kc={};const{ArrayIsArray:l_,ArrayPrototypeIncludes:kA,ArrayPrototypeJoin:FA,ArrayPrototypeMap:HA,NumberIsInteger:Jc,NumberIsNaN:IN,NumberMAX_SAFE_INTEGER:WA,NumberMIN_SAFE_INTEGER:qA,NumberParseInt:ON,ObjectPrototypeHasOwnProperty:GA,RegExpPrototypeExec:CN,String:VA,StringPrototypeToUpperCase:LN,StringPrototypeTrim:PN}=vt,{hideStackFrames:qr,codes:{ERR_SOCKET_BAD_PORT:BN,ERR_INVALID_ARG_TYPE:Gr,ERR_INVALID_ARG_VALUE:c_,ERR_OUT_OF_RANGE:Co,ERR_UNKNOWN_SIGNAL:NN}}=ur,{normalizeEncoding:$N}=br,{isAsyncFunction:zA,isArrayBufferView:KA}=br.types,JA=qr((e,t,r=qA,o=WA)=>{if(typeof e!="number")throw new Gr(t,"number",e);if(!Jc(e))throw new Co(t,"an integer",e);if(e<r||e>o)throw new Co(t,`>= ${r} && <= ${o}`,e)});qr((e,t,r=-2147483648,o=2147483647)=>{if(typeof e!="number")throw new Gr(t,"number",e);if(!Jc(e))throw new Co(t,"an integer",e);if(e<r||e>o)throw new Co(t,`>= ${r} && <= ${o}`,e)});qr((e,t,r=!1)=>{if(typeof e!="number")throw new Gr(t,"number",e);if(!Jc(e))throw new Co(t,"an integer",e);const o=r?1:0,s=4294967295;if(e<o||e>s)throw new Co(t,`>= ${o} && <= ${s}`,e)});qr((e,t,r)=>{if(!kA(r,e)){const s="must be one of: "+FA(HA(r,u=>typeof u=="string"?`'${u}'`:VA(u)),", ");throw new c_(t,e,s)}});function YA(e,t){if(typeof e!="boolean")throw new Gr(t,"boolean",e)}function Bl(e,t,r){return e==null||!GA(e,t)?r:e[t]}const XA=qr((e,t,r=null)=>{const o=Bl(r,"allowArray",!1),s=Bl(r,"allowFunction",!1);if(!Bl(r,"nullable",!1)&&e===null||!o&&l_(e)||typeof e!="object"&&(!s||typeof e!="function"))throw new Gr(t,"Object",e)});qr((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new Gr(t,"a dictionary",e)});qr((e,t,r=0)=>{if(!l_(e))throw new Gr(t,"Array",e);if(e.length<r){const o=`must be longer than ${r}`;throw new c_(t,e,o)}});qr((e,t="buffer")=>{if(!KA(e))throw new Gr(t,["Buffer","TypedArray","DataView"],e)});const ZA=qr((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Gr(t,"AbortSignal",e)}),QA=qr((e,t)=>{if(typeof e!="function")throw new Gr(t,"Function",e)});qr((e,t)=>{if(typeof e!="function"||zA(e))throw new Gr(t,"Function",e)});qr((e,t)=>{if(e!==void 0)throw new Gr(t,"undefined",e)});var $s={validateBoolean:YA,validateFunction:QA,validateInteger:JA,validateObject:XA,validateAbortSignal:ZA},Yc={exports:{}};const{SymbolAsyncIterator:rp,SymbolIterator:np,SymbolFor:zi}=vt,d_=zi("nodejs.stream.destroyed"),eT=zi("nodejs.stream.errored"),ip=zi("nodejs.stream.readable"),op=zi("nodejs.stream.writable"),tT=zi("nodejs.stream.disturbed"),rT=zi("nodejs.webstream.isClosedPromise"),nT=zi("nodejs.webstream.controllerErrorFunction");function Xc(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Iu(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function iT(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function Cn(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function h_(e){return!!(e&&!Cn(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function g_(e){return!!(e&&!Cn(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function p_(e){return!!(e&&!Cn(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function oT(e){return h_(e)||g_(e)||p_(e)}function sT(e,t){return e==null?!1:t===!0?typeof e[rp]=="function":t===!1?typeof e[np]=="function":typeof e[rp]=="function"||typeof e[np]=="function"}function Ou(e){if(!Cn(e))return null;const t=e._writableState,r=e._readableState,o=t||r;return!!(e.destroyed||e[d_]||o!=null&&o.destroyed)}function aT(e){if(!Iu(e))return null;if(e.writableEnded===!0)return!0;const t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function uT(e,t){if(!Iu(e))return null;if(e.writableFinished===!0)return!0;const r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function b_(e,t){if(!Xc(e))return null;const r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function __(e){return e&&e[ip]!=null?e[ip]:typeof(e==null?void 0:e.readable)!="boolean"?null:Ou(e)?!1:Xc(e)&&e.readable&&!b_(e)}function y_(e){return e&&e[op]!=null?e[op]:typeof(e==null?void 0:e.writable)!="boolean"?null:Ou(e)?!1:Iu(e)&&e.writable&&!aT(e)}function fT(e,t){return Cn(e)?Ou(e)?!0:!((t==null?void 0:t.readable)!==!1&&__(e)||(t==null?void 0:t.writable)!==!1&&y_(e)):null}function lT(e){var t,r;return Cn(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function cT(e){var t,r;return Cn(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function dT(e){if(!Cn(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&w_(e)?e._closed:null}function w_(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function hT(e){return typeof e._sent100=="boolean"&&w_(e)}function gT(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function pT(e){if(!Cn(e))return null;const t=e._writableState,r=e._readableState,o=t||r;return!o&&hT(e)||!!(o&&o.autoDestroy&&o.emitClose&&o.closed===!1)}function bT(e){var t;return!!(e&&((t=e[tT])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function _T(e){var t,r,o,s,u,f,h,l,p,b;return!!(e&&((t=(r=(o=(s=(u=(f=e[eT])!==null&&f!==void 0?f:e.readableErrored)!==null&&u!==void 0?u:e.writableErrored)!==null&&s!==void 0?s:(h=e._readableState)===null||h===void 0?void 0:h.errorEmitted)!==null&&o!==void 0?o:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(p=e._readableState)===null||p===void 0?void 0:p.errored)!==null&&t!==void 0?t:!((b=e._writableState)===null||b===void 0)&&b.errored))}var ei={isDestroyed:Ou,kIsDestroyed:d_,isDisturbed:bT,isErrored:_T,isReadable:__,kIsClosedPromise:rT,kControllerErrorFunction:nT,isClosed:dT,isDuplexNodeStream:iT,isFinished:fT,isIterable:sT,isReadableNodeStream:Xc,isReadableStream:h_,isReadableFinished:b_,isReadableErrored:cT,isNodeStream:Cn,isWebStream:oT,isWritable:y_,isWritableNodeStream:Iu,isWritableStream:g_,isWritableFinished:uT,isWritableErrored:lT,isServerRequest:gT,willEmitClose:pT,isTransformStream:p_};const _i=H.browserExports,{AbortError:m_,codes:yT}=ur,{ERR_INVALID_ARG_TYPE:wT,ERR_STREAM_PREMATURE_CLOSE:sp}=yT,{kEmptyObject:wc,once:mc}=br,{validateAbortSignal:mT,validateFunction:ET,validateObject:vT,validateBoolean:ST}=$s,{Promise:RT,PromisePrototypeThen:AT,SymbolDispose:E_}=vt,{isClosed:TT,isReadable:ap,isReadableNodeStream:Nl,isReadableStream:IT,isReadableFinished:up,isReadableErrored:fp,isWritable:lp,isWritableNodeStream:cp,isWritableStream:OT,isWritableFinished:dp,isWritableErrored:hp,isNodeStream:CT,willEmitClose:LT,kIsClosedPromise:PT}=ei;let Ao;function BT(e){return e.setHeader&&typeof e.abort=="function"}const Ec=()=>{};function v_(e,t,r){var o,s;if(arguments.length===2?(r=t,t=wc):t==null?t=wc:vT(t,"options"),ET(r,"callback"),mT(t.signal,"options.signal"),r=mc(r),IT(e)||OT(e))return NT(e,t,r);if(!CT(e))throw new wT("stream",["ReadableStream","WritableStream","Stream"],e);const u=(o=t.readable)!==null&&o!==void 0?o:Nl(e),f=(s=t.writable)!==null&&s!==void 0?s:cp(e),h=e._writableState,l=e._readableState,p=()=>{e.writable||I()};let b=LT(e)&&Nl(e)===u&&cp(e)===f,w=dp(e,!1);const I=()=>{w=!0,e.destroyed&&(b=!1),!(b&&(!e.readable||u))&&(!u||A)&&r.call(e)};let A=up(e,!1);const x=()=>{A=!0,e.destroyed&&(b=!1),!(b&&(!e.writable||f))&&(!f||w)&&r.call(e)},v=j=>{r.call(e,j)};let C=TT(e);const B=()=>{C=!0;const j=hp(e)||fp(e);if(j&&typeof j!="boolean")return r.call(e,j);if(u&&!A&&Nl(e,!0)&&!up(e,!1))return r.call(e,new sp);if(f&&!w&&!dp(e,!1))return r.call(e,new sp);r.call(e)},P=()=>{C=!0;const j=hp(e)||fp(e);if(j&&typeof j!="boolean")return r.call(e,j);r.call(e)},S=()=>{e.req.on("finish",I)};BT(e)?(e.on("complete",I),b||e.on("abort",B),e.req?S():e.on("request",S)):f&&!h&&(e.on("end",p),e.on("close",p)),!b&&typeof e.aborted=="boolean"&&e.on("aborted",B),e.on("end",x),e.on("finish",I),t.error!==!1&&e.on("error",v),e.on("close",B),C?_i.nextTick(B):h!=null&&h.errorEmitted||l!=null&&l.errorEmitted?b||_i.nextTick(P):(!u&&(!b||ap(e))&&(w||lp(e)===!1)||!f&&(!b||lp(e))&&(A||ap(e)===!1)||l&&e.req&&e.aborted)&&_i.nextTick(P);const m=()=>{r=Ec,e.removeListener("aborted",B),e.removeListener("complete",I),e.removeListener("abort",B),e.removeListener("request",S),e.req&&e.req.removeListener("finish",I),e.removeListener("end",p),e.removeListener("close",p),e.removeListener("finish",I),e.removeListener("end",x),e.removeListener("error",v),e.removeListener("close",B)};if(t.signal&&!C){const j=()=>{const Q=r;m(),Q.call(e,new m_(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)_i.nextTick(j);else{Ao=Ao||br.addAbortListener;const Q=Ao(t.signal,j),ce=r;r=mc((...ue)=>{Q[E_](),ce.apply(e,ue)})}}return m}function NT(e,t,r){let o=!1,s=Ec;if(t.signal)if(s=()=>{o=!0,r.call(e,new m_(void 0,{cause:t.signal.reason}))},t.signal.aborted)_i.nextTick(s);else{Ao=Ao||br.addAbortListener;const f=Ao(t.signal,s),h=r;r=mc((...l)=>{f[E_](),h.apply(e,l)})}const u=(...f)=>{o||_i.nextTick(()=>r.apply(e,f))};return AT(e[PT].promise,u,u),Ec}function $T(e,t){var r;let o=!1;return t===null&&(t=wc),(r=t)!==null&&r!==void 0&&r.cleanup&&(ST(t.cleanup,"cleanup"),o=t.cleanup),new RT((s,u)=>{const f=v_(e,t,h=>{o&&f(),h?u(h):s()})})}Yc.exports=v_;Yc.exports.finished=$T;var Ri=Yc.exports;const Tn=H.browserExports,{aggregateTwoErrors:MT,codes:{ERR_MULTIPLE_CALLBACK:xT},AbortError:DT}=ur,{Symbol:S_}=vt,{kIsDestroyed:jT,isDestroyed:UT,isFinished:kT,isServerRequest:FT}=ei,R_=S_("kDestroy"),vc=S_("kConstruct");function A_(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function HT(e,t){const r=this._readableState,o=this._writableState,s=o||r;return o!=null&&o.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(A_(e,o,r),o&&(o.destroyed=!0),r&&(r.destroyed=!0),s.constructed?gp(this,e,t):this.once(R_,function(u){gp(this,MT(u,e),t)}),this)}function gp(e,t,r){let o=!1;function s(u){if(o)return;o=!0;const f=e._readableState,h=e._writableState;A_(u,h,f),h&&(h.closed=!0),f&&(f.closed=!0),typeof r=="function"&&r(u),u?Tn.nextTick(WT,e,u):Tn.nextTick(T_,e)}try{e._destroy(t||null,s)}catch(u){s(u)}}function WT(e,t){Sc(e,t),T_(e)}function T_(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function Sc(e,t){const r=e._readableState,o=e._writableState;o!=null&&o.errorEmitted||r!=null&&r.errorEmitted||(o&&(o.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function qT(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function Rc(e,t,r){const o=e._readableState,s=e._writableState;if(s!=null&&s.destroyed||o!=null&&o.destroyed)return this;o!=null&&o.autoDestroy||s!=null&&s.autoDestroy?e.destroy(t):t&&(t.stack,s&&!s.errored&&(s.errored=t),o&&!o.errored&&(o.errored=t),r?Tn.nextTick(Sc,e,t):Sc(e,t))}function GT(e,t){if(typeof e._construct!="function")return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(vc,t),!(e.listenerCount(vc)>1)&&Tn.nextTick(VT,e)}function VT(e){let t=!1;function r(o){if(t){Rc(e,o??new xT);return}t=!0;const s=e._readableState,u=e._writableState,f=u||s;s&&(s.constructed=!0),u&&(u.constructed=!0),f.destroyed?e.emit(R_,o):o?Rc(e,o,!0):Tn.nextTick(zT,e)}try{e._construct(o=>{Tn.nextTick(r,o)})}catch(o){Tn.nextTick(r,o)}}function zT(e){e.emit(vc)}function pp(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function I_(e){e.emit("close")}function KT(e,t){e.emit("error",t),Tn.nextTick(I_,e)}function JT(e,t){!e||UT(e)||(!t&&!kT(e)&&(t=new DT),FT(e)?(e.socket=null,e.destroy(t)):pp(e)?e.abort():pp(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Tn.nextTick(KT,e,t):Tn.nextTick(I_,e),e.destroyed||(e[jT]=!0))}var Do={construct:GT,destroyer:JT,destroy:HT,undestroy:qT,errorOrDestroy:Rc};const{ArrayIsArray:YT,ObjectSetPrototypeOf:O_}=vt,{EventEmitter:Cu}=H.requireEvents();function Lu(e){Cu.call(this,e)}O_(Lu.prototype,Cu.prototype);O_(Lu,Cu);Lu.prototype.pipe=function(e,t){const r=this;function o(b){e.writable&&e.write(b)===!1&&r.pause&&r.pause()}r.on("data",o);function s(){r.readable&&r.resume&&r.resume()}e.on("drain",s),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",f),r.on("close",h));let u=!1;function f(){u||(u=!0,e.end())}function h(){u||(u=!0,typeof e.destroy=="function"&&e.destroy())}function l(b){p(),Cu.listenerCount(this,"error")===0&&this.emit("error",b)}Ac(r,"error",l),Ac(e,"error",l);function p(){r.removeListener("data",o),e.removeListener("drain",s),r.removeListener("end",f),r.removeListener("close",h),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",p),r.removeListener("close",p),e.removeListener("close",p)}return r.on("end",p),r.on("close",p),e.on("close",p),e.emit("pipe",r),e};function Ac(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):YT(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var Zc={Stream:Lu,prependListener:Ac},C_={exports:{}};(function(e){const{SymbolDispose:t}=vt,{AbortError:r,codes:o}=ur,{isNodeStream:s,isWebStream:u,kControllerErrorFunction:f}=ei,h=Ri,{ERR_INVALID_ARG_TYPE:l}=o;let p;const b=(w,I)=>{if(typeof w!="object"||!("aborted"in w))throw new l(I,"AbortSignal",w)};e.exports.addAbortSignal=function(I,A){if(b(I,"signal"),!s(A)&&!u(A))throw new l("stream",["ReadableStream","WritableStream","Stream"],A);return e.exports.addAbortSignalNoValidate(I,A)},e.exports.addAbortSignalNoValidate=function(w,I){if(typeof w!="object"||!("aborted"in w))return I;const A=s(I)?()=>{I.destroy(new r(void 0,{cause:w.reason}))}:()=>{I[f](new r(void 0,{cause:w.reason}))};if(w.aborted)A();else{p=p||br.addAbortListener;const x=p(w,A);h(I,x[t])}return I}})(C_);var Pu=C_.exports;const{StringPrototypeSlice:bp,SymbolIterator:XT,TypedArrayPrototypeSet:Ka,Uint8Array:ZT}=vt,{Buffer:$l}=H.bufferPolyfill,{inspect:QT}=br;var eI=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){const r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,o=""+r.data;for(;(r=r.next)!==null;)o+=t+r.data;return o}concat(t){if(this.length===0)return $l.alloc(0);const r=$l.allocUnsafe(t>>>0);let o=this.head,s=0;for(;o;)Ka(r,o.data,s),s+=o.data.length,o=o.next;return r}consume(t,r){const o=this.head.data;if(t<o.length){const s=o.slice(0,t);return this.head.data=o.slice(t),s}return t===o.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[XT](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",o=this.head,s=0;do{const u=o.data;if(t>u.length)r+=u,t-=u.length;else{t===u.length?(r+=u,++s,o.next?this.head=o.next:this.head=this.tail=null):(r+=bp(u,0,t),this.head=o,o.data=bp(u,t));break}++s}while((o=o.next)!==null);return this.length-=s,r}_getBuffer(t){const r=$l.allocUnsafe(t),o=t;let s=this.head,u=0;do{const f=s.data;if(t>f.length)Ka(r,f,o-t),t-=f.length;else{t===f.length?(Ka(r,f,o-t),++u,s.next?this.head=s.next:this.head=this.tail=null):(Ka(r,new ZT(f.buffer,f.byteOffset,t),o-t),this.head=s,s.data=f.slice(t));break}++u}while((s=s.next)!==null);return this.length-=u,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return QT(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:tI,NumberIsInteger:rI}=vt,{validateInteger:nI}=$s,{ERR_INVALID_ARG_VALUE:iI}=ur.codes;let L_=16*1024,P_=16;function oI(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function B_(e){return e?P_:L_}function sI(e,t){nI(t,"value",0),e?P_=t:L_=t}function aI(e,t,r,o){const s=oI(t,o,r);if(s!=null){if(!rI(s)||s<0){const u=o?`options.${r}`:"options.highWaterMark";throw new iI(u,s)}return tI(s)}return B_(e.objectMode)}var Bu={getHighWaterMark:aI,getDefaultHighWaterMark:B_,setDefaultHighWaterMark:sI};const _p=H.browserExports,{PromisePrototypeThen:uI,SymbolAsyncIterator:yp,SymbolIterator:wp}=vt,{Buffer:fI}=H.bufferPolyfill,{ERR_INVALID_ARG_TYPE:lI,ERR_STREAM_NULL_VALUES:cI}=ur.codes;function dI(e,t,r){let o;if(typeof t=="string"||t instanceof fI)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let s;if(t&&t[yp])s=!0,o=t[yp]();else if(t&&t[wp])s=!1,o=t[wp]();else throw new lI("iterable",["Iterable"],t);const u=new e({objectMode:!0,highWaterMark:1,...r});let f=!1;u._read=function(){f||(f=!0,l())},u._destroy=function(p,b){uI(h(p),()=>_p.nextTick(b,p),w=>_p.nextTick(b,w||p))};async function h(p){const b=p!=null,w=typeof o.throw=="function";if(b&&w){const{value:I,done:A}=await o.throw(p);if(await I,A)return}if(typeof o.return=="function"){const{value:I}=await o.return();await I}}async function l(){for(;;){try{const{value:p,done:b}=s?await o.next():o.next();if(b)u.push(null);else{const w=p&&typeof p.then=="function"?await p:p;if(w===null)throw f=!1,new cI;if(u.push(w))continue;f=!1}}catch(p){u.destroy(p)}break}}return u}var N_=dI,Ml,mp;function Nu(){if(mp)return Ml;mp=1;const e=H.browserExports,{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:f,ObjectSetPrototypeOf:h,Promise:l,SafeSet:p,SymbolAsyncDispose:b,SymbolAsyncIterator:w,Symbol:I}=vt;Ml=Re,Re.ReadableState=Ue;const{EventEmitter:A}=H.requireEvents(),{Stream:x,prependListener:v}=Zc,{Buffer:C}=H.bufferPolyfill,{addAbortSignal:B}=Pu,P=Ri;let S=br.debuglog("stream",N=>{S=N});const m=eI,j=Do,{getHighWaterMark:Q,getDefaultHighWaterMark:ce}=Bu,{aggregateTwoErrors:ue,codes:{ERR_INVALID_ARG_TYPE:te,ERR_METHOD_NOT_IMPLEMENTED:Se,ERR_OUT_OF_RANGE:me,ERR_STREAM_PUSH_AFTER_EOF:F,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:U},AbortError:$}=ur,{validateObject:G}=$s,Y=I("kPaused"),{StringDecoder:V}=H.requireString_decoder(),ne=N_;h(Re.prototype,x.prototype),h(Re,x);const W=()=>{},{errorOrDestroy:K}=j,ae=1,de=2,re=4,_e=8,be=16,R=32,O=64,q=128,oe=256,ye=512,d=1024,g=2048,_=4096,E=8192,J=16384,ie=32768,se=65536,Ie=1<<17,Be=1<<18;function Ce(N){return{enumerable:!1,get(){return(this.state&N)!==0},set(D){D?this.state|=N:this.state&=~N}}}u(Ue.prototype,{objectMode:Ce(ae),ended:Ce(de),endEmitted:Ce(re),reading:Ce(_e),constructed:Ce(be),sync:Ce(R),needReadable:Ce(O),emittedReadable:Ce(q),readableListening:Ce(oe),resumeScheduled:Ce(ye),errorEmitted:Ce(d),emitClose:Ce(g),autoDestroy:Ce(_),destroyed:Ce(E),closed:Ce(J),closeEmitted:Ce(ie),multiAwaitDrain:Ce(se),readingMore:Ce(Ie),dataEmitted:Ce(Be)});function Ue(N,D,Ee){typeof Ee!="boolean"&&(Ee=D instanceof Yn()),this.state=g|_|be|R,N&&N.objectMode&&(this.state|=ae),Ee&&N&&N.readableObjectMode&&(this.state|=ae),this.highWaterMark=N?Q(this,N,"readableHighWaterMark",Ee):ce(!1),this.buffer=new m,this.length=0,this.pipes=[],this.flowing=null,this[Y]=null,N&&N.emitClose===!1&&(this.state&=-2049),N&&N.autoDestroy===!1&&(this.state&=-4097),this.errored=null,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,N&&N.encoding&&(this.decoder=new V(N.encoding),this.encoding=N.encoding)}function Re(N){if(!(this instanceof Re))return new Re(N);const D=this instanceof Yn();this._readableState=new Ue(N,this,D),N&&(typeof N.read=="function"&&(this._read=N.read),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.construct=="function"&&(this._construct=N.construct),N.signal&&!D&&B(N.signal,this)),x.call(this,N),j.construct(this,()=>{this._readableState.needReadable&&at(this,this._readableState)})}Re.prototype.destroy=j.destroy,Re.prototype._undestroy=j.undestroy,Re.prototype._destroy=function(N,D){D(N)},Re.prototype[A.captureRejectionSymbol]=function(N){this.destroy(N)},Re.prototype[b]=function(){let N;return this.destroyed||(N=this.readableEnded?null:new $,this.destroy(N)),new l((D,Ee)=>P(this,ve=>ve&&ve!==N?Ee(ve):D(null)))},Re.prototype.push=function(N,D){return He(this,N,D,!1)},Re.prototype.unshift=function(N,D){return He(this,N,D,!0)};function He(N,D,Ee,ve){S("readableAddChunk",D);const Te=N._readableState;let yt;if(Te.state&ae||(typeof D=="string"?(Ee=Ee||Te.defaultEncoding,Te.encoding!==Ee&&(ve&&Te.encoding?D=C.from(D,Ee).toString(Te.encoding):(D=C.from(D,Ee),Ee=""))):D instanceof C?Ee="":x._isUint8Array(D)?(D=x._uint8ArrayToBuffer(D),Ee=""):D!=null&&(yt=new te("chunk",["string","Buffer","Uint8Array"],D))),yt)K(N,yt);else if(D===null)Te.state&=-9,Ve(N,Te);else if(Te.state&ae||D&&D.length>0)if(ve)if(Te.state&re)K(N,new U);else{if(Te.destroyed||Te.errored)return!1;bt(N,Te,D,!0)}else if(Te.ended)K(N,new F);else{if(Te.destroyed||Te.errored)return!1;Te.state&=-9,Te.decoder&&!Ee?(D=Te.decoder.write(D),Te.objectMode||D.length!==0?bt(N,Te,D,!1):at(N,Te)):bt(N,Te,D,!1)}else ve||(Te.state&=-9,at(N,Te));return!Te.ended&&(Te.length<Te.highWaterMark||Te.length===0)}function bt(N,D,Ee,ve){D.flowing&&D.length===0&&!D.sync&&N.listenerCount("data")>0?(D.state&se?D.awaitDrainWriters.clear():D.awaitDrainWriters=null,D.dataEmitted=!0,N.emit("data",Ee)):(D.length+=D.objectMode?1:Ee.length,ve?D.buffer.unshift(Ee):D.buffer.push(Ee),D.state&O&&Dt(N)),at(N,D)}Re.prototype.isPaused=function(){const N=this._readableState;return N[Y]===!0||N.flowing===!1},Re.prototype.setEncoding=function(N){const D=new V(N);this._readableState.decoder=D,this._readableState.encoding=this._readableState.decoder.encoding;const Ee=this._readableState.buffer;let ve="";for(const Te of Ee)ve+=D.write(Te);return Ee.clear(),ve!==""&&Ee.push(ve),this._readableState.length=ve.length,this};const et=1073741824;function _t(N){if(N>et)throw new me("size","<= 1GiB",N);return N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++,N}function Ye(N,D){return N<=0||D.length===0&&D.ended?0:D.state&ae?1:o(N)?D.flowing&&D.length?D.buffer.first().length:D.length:N<=D.length?N:D.ended?D.length:0}Re.prototype.read=function(N){S("read",N),N===void 0?N=NaN:r(N)||(N=s(N,10));const D=this._readableState,Ee=N;if(N>D.highWaterMark&&(D.highWaterMark=_t(N)),N!==0&&(D.state&=-129),N===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return S("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?Or(this):Dt(this),null;if(N=Ye(N,D),N===0&&D.ended)return D.length===0&&Or(this),null;let ve=(D.state&O)!==0;if(S("need readable",ve),(D.length===0||D.length-N<D.highWaterMark)&&(ve=!0,S("length less than watermark",ve)),D.ended||D.reading||D.destroyed||D.errored||!D.constructed)ve=!1,S("reading, ended or constructing",ve);else if(ve){S("do read"),D.state|=_e|R,D.length===0&&(D.state|=O);try{this._read(D.highWaterMark)}catch(yt){K(this,yt)}D.state&=-33,D.reading||(N=Ye(Ee,D))}let Te;return N>0?Te=tr(N,D):Te=null,Te===null?(D.needReadable=D.length<=D.highWaterMark,N=0):(D.length-=N,D.multiAwaitDrain?D.awaitDrainWriters.clear():D.awaitDrainWriters=null),D.length===0&&(D.ended||(D.needReadable=!0),Ee!==N&&D.ended&&Or(this)),Te!==null&&!D.errorEmitted&&!D.closeEmitted&&(D.dataEmitted=!0,this.emit("data",Te)),Te};function Ve(N,D){if(S("onEofChunk"),!D.ended){if(D.decoder){const Ee=D.decoder.end();Ee&&Ee.length&&(D.buffer.push(Ee),D.length+=D.objectMode?1:Ee.length)}D.ended=!0,D.sync?Dt(N):(D.needReadable=!1,D.emittedReadable=!0,Lt(N))}}function Dt(N){const D=N._readableState;S("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(S("emitReadable",D.flowing),D.emittedReadable=!0,e.nextTick(Lt,N))}function Lt(N){const D=N._readableState;S("emitReadable_",D.destroyed,D.length,D.ended),!D.destroyed&&!D.errored&&(D.length||D.ended)&&(N.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,Kr(N)}function at(N,D){!D.readingMore&&D.constructed&&(D.readingMore=!0,e.nextTick(Bt,N,D))}function Bt(N,D){for(;!D.reading&&!D.ended&&(D.length<D.highWaterMark||D.flowing&&D.length===0);){const Ee=D.length;if(S("maybeReadMore read 0"),N.read(0),Ee===D.length)break}D.readingMore=!1}Re.prototype._read=function(N){throw new Se("_read()")},Re.prototype.pipe=function(N,D){const Ee=this,ve=this._readableState;ve.pipes.length===1&&(ve.multiAwaitDrain||(ve.multiAwaitDrain=!0,ve.awaitDrainWriters=new p(ve.awaitDrainWriters?[ve.awaitDrainWriters]:[]))),ve.pipes.push(N),S("pipe count=%d opts=%j",ve.pipes.length,D);const yt=(!D||D.end!==!1)&&N!==e.stdout&&N!==e.stderr?fn:yr;ve.endEmitted?e.nextTick(yt):Ee.once("end",yt),N.on("unpipe",St);function St(nr,Ft){S("onunpipe"),nr===Ee&&Ft&&Ft.hasUnpiped===!1&&(Ft.hasUnpiped=!0,Pn())}function fn(){S("onend"),N.end()}let Pt,ln=!1;function Pn(){S("cleanup"),N.removeListener("close",Gt),N.removeListener("finish",Cr),Pt&&N.removeListener("drain",Pt),N.removeListener("error",Yr),N.removeListener("unpipe",St),Ee.removeListener("end",fn),Ee.removeListener("end",yr),Ee.removeListener("data",dn),ln=!0,Pt&&ve.awaitDrainWriters&&(!N._writableState||N._writableState.needDrain)&&Pt()}function cn(){ln||(ve.pipes.length===1&&ve.pipes[0]===N?(S("false write response, pause",0),ve.awaitDrainWriters=N,ve.multiAwaitDrain=!1):ve.pipes.length>1&&ve.pipes.includes(N)&&(S("false write response, pause",ve.awaitDrainWriters.size),ve.awaitDrainWriters.add(N)),Ee.pause()),Pt||(Pt=fr(Ee,N),N.on("drain",Pt))}Ee.on("data",dn);function dn(nr){S("ondata");const Ft=N.write(nr);S("dest.write",Ft),Ft===!1&&cn()}function Yr(nr){if(S("onerror",nr),yr(),N.removeListener("error",Yr),N.listenerCount("error")===0){const Ft=N._writableState||N._readableState;Ft&&!Ft.errorEmitted?K(N,nr):N.emit("error",nr)}}v(N,"error",Yr);function Gt(){N.removeListener("finish",Cr),yr()}N.once("close",Gt);function Cr(){S("onfinish"),N.removeListener("close",Gt),yr()}N.once("finish",Cr);function yr(){S("unpipe"),Ee.unpipe(N)}return N.emit("pipe",Ee),N.writableNeedDrain===!0?cn():ve.flowing||(S("pipe resume"),Ee.resume()),N};function fr(N,D){return function(){const ve=N._readableState;ve.awaitDrainWriters===D?(S("pipeOnDrain",1),ve.awaitDrainWriters=null):ve.multiAwaitDrain&&(S("pipeOnDrain",ve.awaitDrainWriters.size),ve.awaitDrainWriters.delete(D)),(!ve.awaitDrainWriters||ve.awaitDrainWriters.size===0)&&N.listenerCount("data")&&N.resume()}}Re.prototype.unpipe=function(N){const D=this._readableState,Ee={hasUnpiped:!1};if(D.pipes.length===0)return this;if(!N){const Te=D.pipes;D.pipes=[],this.pause();for(let yt=0;yt<Te.length;yt++)Te[yt].emit("unpipe",this,{hasUnpiped:!1});return this}const ve=t(D.pipes,N);return ve===-1?this:(D.pipes.splice(ve,1),D.pipes.length===0&&this.pause(),N.emit("unpipe",this,Ee),this)},Re.prototype.on=function(N,D){const Ee=x.prototype.on.call(this,N,D),ve=this._readableState;return N==="data"?(ve.readableListening=this.listenerCount("readable")>0,ve.flowing!==!1&&this.resume()):N==="readable"&&!ve.endEmitted&&!ve.readableListening&&(ve.readableListening=ve.needReadable=!0,ve.flowing=!1,ve.emittedReadable=!1,S("on readable",ve.length,ve.reading),ve.length?Dt(this):ve.reading||e.nextTick(kt,this)),Ee},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(N,D){const Ee=x.prototype.removeListener.call(this,N,D);return N==="readable"&&e.nextTick(er,this),Ee},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(N){const D=x.prototype.removeAllListeners.apply(this,arguments);return(N==="readable"||N===void 0)&&e.nextTick(er,this),D};function er(N){const D=N._readableState;D.readableListening=N.listenerCount("readable")>0,D.resumeScheduled&&D[Y]===!1?D.flowing=!0:N.listenerCount("data")>0?N.resume():D.readableListening||(D.flowing=null)}function kt(N){S("readable nexttick read 0"),N.read(0)}Re.prototype.resume=function(){const N=this._readableState;return N.flowing||(S("resume"),N.flowing=!N.readableListening,lr(this,N)),N[Y]=!1,this};function lr(N,D){D.resumeScheduled||(D.resumeScheduled=!0,e.nextTick(zr,N,D))}function zr(N,D){S("resume",D.reading),D.reading||N.read(0),D.resumeScheduled=!1,N.emit("resume"),Kr(N),D.flowing&&!D.reading&&N.read(0)}Re.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Y]=!0,this};function Kr(N){const D=N._readableState;for(S("flow",D.flowing);D.flowing&&N.read()!==null;);}Re.prototype.wrap=function(N){let D=!1;N.on("data",ve=>{!this.push(ve)&&N.pause&&(D=!0,N.pause())}),N.on("end",()=>{this.push(null)}),N.on("error",ve=>{K(this,ve)}),N.on("close",()=>{this.destroy()}),N.on("destroy",()=>{this.destroy()}),this._read=()=>{D&&N.resume&&(D=!1,N.resume())};const Ee=f(N);for(let ve=1;ve<Ee.length;ve++){const Te=Ee[ve];this[Te]===void 0&&typeof N[Te]=="function"&&(this[Te]=N[Te].bind(N))}return this},Re.prototype[w]=function(){return sn(this)},Re.prototype.iterator=function(N){return N!==void 0&&G(N,"options"),sn(this,N)};function sn(N,D){typeof N.read!="function"&&(N=Re.wrap(N,{objectMode:!0}));const Ee=an(N,D);return Ee.stream=N,Ee}async function*an(N,D){let Ee=W;function ve(St){this===N?(Ee(),Ee=W):Ee=St}N.on("readable",ve);let Te;const yt=P(N,{writable:!1},St=>{Te=St?ue(Te,St):null,Ee(),Ee=W});try{for(;;){const St=N.destroyed?null:N.read();if(St!==null)yield St;else{if(Te)throw Te;if(Te===null)return;await new l(ve)}}}catch(St){throw Te=ue(Te,St),Te}finally{(Te||(D==null?void 0:D.destroyOnReturn)!==!1)&&(Te===void 0||N._readableState.autoDestroy)?j.destroyer(N,null):(N.off("readable",ve),yt())}}u(Re.prototype,{readable:{__proto__:null,get(){const N=this._readableState;return!!N&&N.readable!==!1&&!N.destroyed&&!N.errorEmitted&&!N.endEmitted},set(N){this._readableState&&(this._readableState.readable=!!N)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(N){this._readableState&&(this._readableState.flowing=N)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(N){this._readableState&&(this._readableState.destroyed=N)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(Ue.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Y]!==!1},set(N){this[Y]=!!N}}}),Re._fromList=tr;function tr(N,D){if(D.length===0)return null;let Ee;return D.objectMode?Ee=D.buffer.shift():!N||N>=D.length?(D.decoder?Ee=D.buffer.join(""):D.buffer.length===1?Ee=D.buffer.first():Ee=D.buffer.concat(D.length),D.buffer.clear()):Ee=D.buffer.consume(N,D.decoder),Ee}function Or(N){const D=N._readableState;S("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,e.nextTick(rr,D,N))}function rr(N,D){if(S("endReadableNT",N.endEmitted,N.length),!N.errored&&!N.closeEmitted&&!N.endEmitted&&N.length===0){if(N.endEmitted=!0,D.emit("end"),D.writable&&D.allowHalfOpen===!1)e.nextTick(Ln,D);else if(N.autoDestroy){const Ee=D._writableState;(!Ee||Ee.autoDestroy&&(Ee.finished||Ee.writable===!1))&&D.destroy()}}}function Ln(N){N.writable&&!N.writableEnded&&!N.destroyed&&N.end()}Re.from=function(N,D){return ne(Re,N,D)};let Jr;function un(){return Jr===void 0&&(Jr={}),Jr}return Re.fromWeb=function(N,D){return un().newStreamReadableFromReadableStream(N,D)},Re.toWeb=function(N,D){return un().newReadableStreamFromStreamReadable(N,D)},Re.wrap=function(N,D){var Ee,ve;return new Re({objectMode:(Ee=(ve=N.readableObjectMode)!==null&&ve!==void 0?ve:N.objectMode)!==null&&Ee!==void 0?Ee:!0,...D,destroy(Te,yt){j.destroyer(N,Te),yt(Te)}}).wrap(N)},Ml}var xl,Ep;function Qc(){if(Ep)return xl;Ep=1;const e=H.browserExports,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:f,StringPrototypeToLowerCase:h,Symbol:l,SymbolHasInstance:p}=vt;xl=G,G.WritableState=U;const{EventEmitter:b}=H.requireEvents(),w=Zc.Stream,{Buffer:I}=H.bufferPolyfill,A=Do,{addAbortSignal:x}=Pu,{getHighWaterMark:v,getDefaultHighWaterMark:C}=Bu,{ERR_INVALID_ARG_TYPE:B,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:m,ERR_STREAM_DESTROYED:j,ERR_STREAM_ALREADY_FINISHED:Q,ERR_STREAM_NULL_VALUES:ce,ERR_STREAM_WRITE_AFTER_END:ue,ERR_UNKNOWN_ENCODING:te}=ur.codes,{errorOrDestroy:Se}=A;f(G.prototype,w.prototype),f(G,w);function me(){}const F=l("kOnFinished");function U(_,E,J){typeof J!="boolean"&&(J=E instanceof Yn()),this.objectMode=!!(_&&_.objectMode),J&&(this.objectMode=this.objectMode||!!(_&&_.writableObjectMode)),this.highWaterMark=_?v(this,_,"writableHighWaterMark",J):C(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ie=!!(_&&_.decodeStrings===!1);this.decodeStrings=!ie,this.defaultEncoding=_&&_.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=K.bind(void 0,E),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!_||_.emitClose!==!1,this.autoDestroy=!_||_.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[F]=[]}function $(_){_.buffered=[],_.bufferedIndex=0,_.allBuffers=!0,_.allNoop=!0}U.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},s(U.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function G(_){const E=this instanceof Yn();if(!E&&!o(G,this))return new G(_);this._writableState=new U(_,this,E),_&&(typeof _.write=="function"&&(this._write=_.write),typeof _.writev=="function"&&(this._writev=_.writev),typeof _.destroy=="function"&&(this._destroy=_.destroy),typeof _.final=="function"&&(this._final=_.final),typeof _.construct=="function"&&(this._construct=_.construct),_.signal&&x(_.signal,this)),w.call(this,_),A.construct(this,()=>{const J=this._writableState;J.writing||_e(this,J),q(this,J)})}s(G,p,{__proto__:null,value:function(_){return o(this,_)?!0:this!==G?!1:_&&_._writableState instanceof U}}),G.prototype.pipe=function(){Se(this,new m)};function Y(_,E,J,ie){const se=_._writableState;if(typeof J=="function")ie=J,J=se.defaultEncoding;else{if(!J)J=se.defaultEncoding;else if(J!=="buffer"&&!I.isEncoding(J))throw new te(J);typeof ie!="function"&&(ie=me)}if(E===null)throw new ce;if(!se.objectMode)if(typeof E=="string")se.decodeStrings!==!1&&(E=I.from(E,J),J="buffer");else if(E instanceof I)J="buffer";else if(w._isUint8Array(E))E=w._uint8ArrayToBuffer(E),J="buffer";else throw new B("chunk",["string","Buffer","Uint8Array"],E);let Ie;return se.ending?Ie=new ue:se.destroyed&&(Ie=new j("write")),Ie?(e.nextTick(ie,Ie),Se(_,Ie,!0),Ie):(se.pendingcb++,V(_,se,E,J,ie))}G.prototype.write=function(_,E,J){return Y(this,_,E,J)===!0},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){const _=this._writableState;_.corked&&(_.corked--,_.writing||_e(this,_))},G.prototype.setDefaultEncoding=function(E){if(typeof E=="string"&&(E=h(E)),!I.isEncoding(E))throw new te(E);return this._writableState.defaultEncoding=E,this};function V(_,E,J,ie,se){const Ie=E.objectMode?1:J.length;E.length+=Ie;const Be=E.length<E.highWaterMark;return Be||(E.needDrain=!0),E.writing||E.corked||E.errored||!E.constructed?(E.buffered.push({chunk:J,encoding:ie,callback:se}),E.allBuffers&&ie!=="buffer"&&(E.allBuffers=!1),E.allNoop&&se!==me&&(E.allNoop=!1)):(E.writelen=Ie,E.writecb=se,E.writing=!0,E.sync=!0,_._write(J,ie,E.onwrite),E.sync=!1),Be&&!E.errored&&!E.destroyed}function ne(_,E,J,ie,se,Ie,Be){E.writelen=ie,E.writecb=Be,E.writing=!0,E.sync=!0,E.destroyed?E.onwrite(new j("write")):J?_._writev(se,E.onwrite):_._write(se,Ie,E.onwrite),E.sync=!1}function W(_,E,J,ie){--E.pendingcb,ie(J),re(E),Se(_,J)}function K(_,E){const J=_._writableState,ie=J.sync,se=J.writecb;if(typeof se!="function"){Se(_,new S);return}J.writing=!1,J.writecb=null,J.length-=J.writelen,J.writelen=0,E?(E.stack,J.errored||(J.errored=E),_._readableState&&!_._readableState.errored&&(_._readableState.errored=E),ie?e.nextTick(W,_,J,E,se):W(_,J,E,se)):(J.buffered.length>J.bufferedIndex&&_e(_,J),ie?J.afterWriteTickInfo!==null&&J.afterWriteTickInfo.cb===se?J.afterWriteTickInfo.count++:(J.afterWriteTickInfo={count:1,cb:se,stream:_,state:J},e.nextTick(ae,J.afterWriteTickInfo)):de(_,J,1,se))}function ae({stream:_,state:E,count:J,cb:ie}){return E.afterWriteTickInfo=null,de(_,E,J,ie)}function de(_,E,J,ie){for(!E.ending&&!_.destroyed&&E.length===0&&E.needDrain&&(E.needDrain=!1,_.emit("drain"));J-- >0;)E.pendingcb--,ie();E.destroyed&&re(E),q(_,E)}function re(_){if(_.writing)return;for(let se=_.bufferedIndex;se<_.buffered.length;++se){var E;const{chunk:Ie,callback:Be}=_.buffered[se],Ce=_.objectMode?1:Ie.length;_.length-=Ce,Be((E=_.errored)!==null&&E!==void 0?E:new j("write"))}const J=_[F].splice(0);for(let se=0;se<J.length;se++){var ie;J[se]((ie=_.errored)!==null&&ie!==void 0?ie:new j("end"))}$(_)}function _e(_,E){if(E.corked||E.bufferProcessing||E.destroyed||!E.constructed)return;const{buffered:J,bufferedIndex:ie,objectMode:se}=E,Ie=J.length-ie;if(!Ie)return;let Be=ie;if(E.bufferProcessing=!0,Ie>1&&_._writev){E.pendingcb-=Ie-1;const Ce=E.allNoop?me:Re=>{for(let He=Be;He<J.length;++He)J[He].callback(Re)},Ue=E.allNoop&&Be===0?J:t(J,Be);Ue.allBuffers=E.allBuffers,ne(_,E,!0,E.length,Ue,"",Ce),$(E)}else{do{const{chunk:Ce,encoding:Ue,callback:Re}=J[Be];J[Be++]=null;const He=se?1:Ce.length;ne(_,E,!1,He,Ce,Ue,Re)}while(Be<J.length&&!E.writing);Be===J.length?$(E):Be>256?(J.splice(0,Be),E.bufferedIndex=0):E.bufferedIndex=Be}E.bufferProcessing=!1}G.prototype._write=function(_,E,J){if(this._writev)this._writev([{chunk:_,encoding:E}],J);else throw new P("_write()")},G.prototype._writev=null,G.prototype.end=function(_,E,J){const ie=this._writableState;typeof _=="function"?(J=_,_=null,E=null):typeof E=="function"&&(J=E,E=null);let se;if(_!=null){const Ie=Y(this,_,E);Ie instanceof r&&(se=Ie)}return ie.corked&&(ie.corked=1,this.uncork()),se||(!ie.errored&&!ie.ending?(ie.ending=!0,q(this,ie,!0),ie.ended=!0):ie.finished?se=new Q("end"):ie.destroyed&&(se=new j("end"))),typeof J=="function"&&(se||ie.finished?e.nextTick(J,se):ie[F].push(J)),this};function be(_){return _.ending&&!_.destroyed&&_.constructed&&_.length===0&&!_.errored&&_.buffered.length===0&&!_.finished&&!_.writing&&!_.errorEmitted&&!_.closeEmitted}function R(_,E){let J=!1;function ie(se){if(J){Se(_,se??S());return}if(J=!0,E.pendingcb--,se){const Ie=E[F].splice(0);for(let Be=0;Be<Ie.length;Be++)Ie[Be](se);Se(_,se,E.sync)}else be(E)&&(E.prefinished=!0,_.emit("prefinish"),E.pendingcb++,e.nextTick(oe,_,E))}E.sync=!0,E.pendingcb++;try{_._final(ie)}catch(se){ie(se)}E.sync=!1}function O(_,E){!E.prefinished&&!E.finalCalled&&(typeof _._final=="function"&&!E.destroyed?(E.finalCalled=!0,R(_,E)):(E.prefinished=!0,_.emit("prefinish")))}function q(_,E,J){be(E)&&(O(_,E),E.pendingcb===0&&(J?(E.pendingcb++,e.nextTick((ie,se)=>{be(se)?oe(ie,se):se.pendingcb--},_,E)):be(E)&&(E.pendingcb++,oe(_,E))))}function oe(_,E){E.pendingcb--,E.finished=!0;const J=E[F].splice(0);for(let ie=0;ie<J.length;ie++)J[ie]();if(_.emit("finish"),E.autoDestroy){const ie=_._readableState;(!ie||ie.autoDestroy&&(ie.endEmitted||ie.readable===!1))&&_.destroy()}}u(G.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(_){this._writableState&&(this._writableState.destroyed=_)}},writable:{__proto__:null,get(){const _=this._writableState;return!!_&&_.writable!==!1&&!_.destroyed&&!_.errored&&!_.ending&&!_.ended},set(_){this._writableState&&(this._writableState.writable=!!_)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const _=this._writableState;return _?!_.destroyed&&!_.ending&&_.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ye=A.destroy;G.prototype.destroy=function(_,E){const J=this._writableState;return!J.destroyed&&(J.bufferedIndex<J.buffered.length||J[F].length)&&e.nextTick(re,J),ye.call(this,_,E),this},G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(_,E){E(_)},G.prototype[b.captureRejectionSymbol]=function(_){this.destroy(_)};let d;function g(){return d===void 0&&(d={}),d}return G.fromWeb=function(_,E){return g().newStreamWritableFromWritableStream(_,E)},G.toWeb=function(_){return g().newWritableStreamFromStreamWritable(_)},xl}var Dl,vp;function hI(){if(vp)return Dl;vp=1;const e=H.browserExports,t=H.bufferPolyfill,{isReadable:r,isWritable:o,isIterable:s,isNodeStream:u,isReadableNodeStream:f,isWritableNodeStream:h,isDuplexNodeStream:l,isReadableStream:p,isWritableStream:b}=ei,w=Ri,{AbortError:I,codes:{ERR_INVALID_ARG_TYPE:A,ERR_INVALID_RETURN_VALUE:x}}=ur,{destroyer:v}=Do,C=Yn(),B=Nu(),P=Qc(),{createDeferredPromise:S}=br,m=N_,j=globalThis.Blob||t.Blob,Q=typeof j<"u"?function(U){return U instanceof j}:function(U){return!1},ce=globalThis.AbortController||Is().AbortController,{FunctionPrototypeCall:ue}=vt;class te extends C{constructor(U){super(U),(U==null?void 0:U.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(U==null?void 0:U.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Dl=function F(U,$){if(l(U))return U;if(f(U))return me({readable:U});if(h(U))return me({writable:U});if(u(U))return me({writable:!1,readable:!1});if(p(U))return me({readable:B.fromWeb(U)});if(b(U))return me({writable:P.fromWeb(U)});if(typeof U=="function"){const{value:Y,write:V,final:ne,destroy:W}=Se(U);if(s(Y))return m(te,Y,{objectMode:!0,write:V,final:ne,destroy:W});const K=Y==null?void 0:Y.then;if(typeof K=="function"){let ae;const de=ue(K,Y,re=>{if(re!=null)throw new x("nully","body",re)},re=>{v(ae,re)});return ae=new te({objectMode:!0,readable:!1,write:V,final(re){ne(async()=>{try{await de,e.nextTick(re,null)}catch(_e){e.nextTick(re,_e)}})},destroy:W})}throw new x("Iterable, AsyncIterable or AsyncFunction",$,Y)}if(Q(U))return F(U.arrayBuffer());if(s(U))return m(te,U,{objectMode:!0,writable:!1});if(p(U==null?void 0:U.readable)&&b(U==null?void 0:U.writable))return te.fromWeb(U);if(typeof(U==null?void 0:U.writable)=="object"||typeof(U==null?void 0:U.readable)=="object"){const Y=U!=null&&U.readable?f(U==null?void 0:U.readable)?U==null?void 0:U.readable:F(U.readable):void 0,V=U!=null&&U.writable?h(U==null?void 0:U.writable)?U==null?void 0:U.writable:F(U.writable):void 0;return me({readable:Y,writable:V})}const G=U==null?void 0:U.then;if(typeof G=="function"){let Y;return ue(G,U,V=>{V!=null&&Y.push(V),Y.push(null)},V=>{v(Y,V)}),Y=new te({objectMode:!0,writable:!1,read(){}})}throw new A($,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],U)};function Se(F){let{promise:U,resolve:$}=S();const G=new ce,Y=G.signal;return{value:F(async function*(){for(;;){const ne=U;U=null;const{chunk:W,done:K,cb:ae}=await ne;if(e.nextTick(ae),K)return;if(Y.aborted)throw new I(void 0,{cause:Y.reason});({promise:U,resolve:$}=S()),yield W}}(),{signal:Y}),write(ne,W,K){const ae=$;$=null,ae({chunk:ne,done:!1,cb:K})},final(ne){const W=$;$=null,W({done:!0,cb:ne})},destroy(ne,W){G.abort(),W(ne)}}}function me(F){const U=F.readable&&typeof F.readable.read!="function"?B.wrap(F.readable):F.readable,$=F.writable;let G=!!r(U),Y=!!o($),V,ne,W,K,ae;function de(re){const _e=K;K=null,_e?_e(re):re&&ae.destroy(re)}return ae=new te({readableObjectMode:!!(U!=null&&U.readableObjectMode),writableObjectMode:!!($!=null&&$.writableObjectMode),readable:G,writable:Y}),Y&&(w($,re=>{Y=!1,re&&v(U,re),de(re)}),ae._write=function(re,_e,be){$.write(re,_e)?be():V=be},ae._final=function(re){$.end(),ne=re},$.on("drain",function(){if(V){const re=V;V=null,re()}}),$.on("finish",function(){if(ne){const re=ne;ne=null,re()}})),G&&(w(U,re=>{G=!1,re&&v(U,re),de(re)}),U.on("readable",function(){if(W){const re=W;W=null,re()}}),U.on("end",function(){ae.push(null)}),ae._read=function(){for(;;){const re=U.read();if(re===null){W=ae._read;return}if(!ae.push(re))return}}),ae._destroy=function(re,_e){!re&&K!==null&&(re=new I),W=null,V=null,ne=null,K===null?_e(re):(K=_e,v($,re),v(U,re))},ae}return Dl}var jl,Sp;function Yn(){if(Sp)return jl;Sp=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:o}=vt;jl=f;const s=Nu(),u=Qc();o(f.prototype,s.prototype),o(f,s);{const b=r(u.prototype);for(let w=0;w<b.length;w++){const I=b[w];f.prototype[I]||(f.prototype[I]=u.prototype[I])}}function f(b){if(!(this instanceof f))return new f(b);s.call(this,b),u.call(this,b),b?(this.allowHalfOpen=b.allowHalfOpen!==!1,b.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),b.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(f.prototype,{writable:{__proto__:null,...t(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(u.prototype,"writableLength")},writableFinished:{__proto__:null,...t(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(b){this._readableState&&this._writableState&&(this._readableState.destroyed=b,this._writableState.destroyed=b)}}});let h;function l(){return h===void 0&&(h={}),h}f.fromWeb=function(b,w){return l().newStreamDuplexFromReadableWritablePair(b,w)},f.toWeb=function(b){return l().newReadableWritablePairFromDuplex(b)};let p;return f.from=function(b){return p||(p=hI()),p(b,"body")},jl}const{ObjectSetPrototypeOf:$_,Symbol:gI}=vt;var M_=Xn;const{ERR_METHOD_NOT_IMPLEMENTED:pI}=ur.codes,ed=Yn(),{getHighWaterMark:bI}=Bu;$_(Xn.prototype,ed.prototype);$_(Xn,ed);const Es=gI("kCallback");function Xn(e){if(!(this instanceof Xn))return new Xn(e);const t=e?bI(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),ed.call(this,e),this._readableState.sync=!1,this[Es]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",_I)}function Tc(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function _I(){this._final!==Tc&&Tc.call(this)}Xn.prototype._final=Tc;Xn.prototype._transform=function(e,t,r){throw new pI("_transform()")};Xn.prototype._write=function(e,t,r){const o=this._readableState,s=this._writableState,u=o.length;this._transform(e,t,(f,h)=>{if(f){r(f);return}h!=null&&this.push(h),s.ended||u===o.length||o.length<o.highWaterMark?r():this[Es]=r})};Xn.prototype._read=function(){if(this[Es]){const e=this[Es];this[Es]=null,e()}};const{ObjectSetPrototypeOf:x_}=vt;var D_=Lo;const td=M_;x_(Lo.prototype,td.prototype);x_(Lo,td);function Lo(e){if(!(this instanceof Lo))return new Lo(e);td.call(this,e)}Lo.prototype._transform=function(e,t,r){r(null,e)};const ms=H.browserExports,{ArrayIsArray:yI,Promise:wI,SymbolAsyncIterator:mI,SymbolDispose:EI}=vt,gu=Ri,{once:vI}=br,SI=Do,Rp=Yn(),{aggregateTwoErrors:RI,codes:{ERR_INVALID_ARG_TYPE:Ic,ERR_INVALID_RETURN_VALUE:Ul,ERR_MISSING_ARGS:AI,ERR_STREAM_DESTROYED:TI,ERR_STREAM_PREMATURE_CLOSE:II},AbortError:OI}=ur,{validateFunction:CI,validateAbortSignal:LI}=$s,{isIterable:ki,isReadable:kl,isReadableNodeStream:au,isNodeStream:Ap,isTransformStream:vo,isWebStream:PI,isReadableStream:Fl,isReadableFinished:BI}=ei,NI=globalThis.AbortController||Is().AbortController;let Hl,Wl,ql;function Tp(e,t,r){let o=!1;e.on("close",()=>{o=!0});const s=gu(e,{readable:t,writable:r},u=>{o=!u});return{destroy:u=>{o||(o=!0,SI.destroyer(e,u||new TI("pipe")))},cleanup:s}}function $I(e){return CI(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Gl(e){if(ki(e))return e;if(au(e))return MI(e);throw new Ic("val",["Readable","Iterable","AsyncIterable"],e)}async function*MI(e){Wl||(Wl=Nu()),yield*Wl.prototype[mI].call(e)}async function Ja(e,t,r,{end:o}){let s,u=null;const f=p=>{if(p&&(s=p),u){const b=u;u=null,b()}},h=()=>new wI((p,b)=>{s?b(s):u=()=>{s?b(s):p()}});t.on("drain",f);const l=gu(t,{readable:!1},f);try{t.writableNeedDrain&&await h();for await(const p of e)t.write(p)||await h();o&&(t.end(),await h()),r()}catch(p){r(s!==p?RI(s,p):p)}finally{l(),t.off("drain",f)}}async function Vl(e,t,r,{end:o}){vo(t)&&(t=t.writable);const s=t.getWriter();try{for await(const u of e)await s.ready,s.write(u).catch(()=>{});await s.ready,o&&await s.close(),r()}catch(u){try{await s.abort(u),r(u)}catch(f){r(f)}}}function xI(...e){return j_(e,vI($I(e)))}function j_(e,t,r){if(e.length===1&&yI(e[0])&&(e=e[0]),e.length<2)throw new AI("streams");const o=new NI,s=o.signal,u=r==null?void 0:r.signal,f=[];LI(u,"options.signal");function h(){x(new OI)}ql=ql||br.addAbortListener;let l;u&&(l=ql(u,h));let p,b;const w=[];let I=0;function A(P){x(P,--I===0)}function x(P,S){var m;if(P&&(!p||p.code==="ERR_STREAM_PREMATURE_CLOSE")&&(p=P),!(!p&&!S)){for(;w.length;)w.shift()(p);(m=l)===null||m===void 0||m[EI](),o.abort(),S&&(p||f.forEach(j=>j()),ms.nextTick(t,p,b))}}let v;for(let P=0;P<e.length;P++){const S=e[P],m=P<e.length-1,j=P>0,Q=m||(r==null?void 0:r.end)!==!1,ce=P===e.length-1;if(Ap(S)){let ue=function(te){te&&te.name!=="AbortError"&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"&&A(te)};if(Q){const{destroy:te,cleanup:Se}=Tp(S,m,j);w.push(te),kl(S)&&ce&&f.push(Se)}S.on("error",ue),kl(S)&&ce&&f.push(()=>{S.removeListener("error",ue)})}if(P===0)if(typeof S=="function"){if(v=S({signal:s}),!ki(v))throw new Ul("Iterable, AsyncIterable or Stream","source",v)}else ki(S)||au(S)||vo(S)?v=S:v=Rp.from(S);else if(typeof S=="function"){if(vo(v)){var C;v=Gl((C=v)===null||C===void 0?void 0:C.readable)}else v=Gl(v);if(v=S(v,{signal:s}),m){if(!ki(v,!0))throw new Ul("AsyncIterable",`transform[${P-1}]`,v)}else{var B;Hl||(Hl=D_);const ue=new Hl({objectMode:!0}),te=(B=v)===null||B===void 0?void 0:B.then;if(typeof te=="function")I++,te.call(v,F=>{b=F,F!=null&&ue.write(F),Q&&ue.end(),ms.nextTick(A)},F=>{ue.destroy(F),ms.nextTick(A,F)});else if(ki(v,!0))I++,Ja(v,ue,A,{end:Q});else if(Fl(v)||vo(v)){const F=v.readable||v;I++,Ja(F,ue,A,{end:Q})}else throw new Ul("AsyncIterable or Promise","destination",v);v=ue;const{destroy:Se,cleanup:me}=Tp(v,!1,!0);w.push(Se),ce&&f.push(me)}}else if(Ap(S)){if(au(v)){I+=2;const ue=DI(v,S,A,{end:Q});kl(S)&&ce&&f.push(ue)}else if(vo(v)||Fl(v)){const ue=v.readable||v;I++,Ja(ue,S,A,{end:Q})}else if(ki(v))I++,Ja(v,S,A,{end:Q});else throw new Ic("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=S}else if(PI(S)){if(au(v))I++,Vl(Gl(v),S,A,{end:Q});else if(Fl(v)||ki(v))I++,Vl(v,S,A,{end:Q});else if(vo(v))I++,Vl(v.readable,S,A,{end:Q});else throw new Ic("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=S}else v=Rp.from(S)}return(s!=null&&s.aborted||u!=null&&u.aborted)&&ms.nextTick(h),v}function DI(e,t,r,{end:o}){let s=!1;if(t.on("close",()=>{s||r(new II)}),e.pipe(t,{end:!1}),o){let u=function(){s=!0,t.end()};BI(e)?ms.nextTick(u):e.once("end",u)}else r();return gu(e,{readable:!0,writable:!1},u=>{const f=e._readableState;u&&u.code==="ERR_STREAM_PREMATURE_CLOSE"&&f&&f.ended&&!f.errored&&!f.errorEmitted?e.once("end",r).once("error",r):r(u)}),gu(t,{readable:!1,writable:!0},r)}var rd={pipelineImpl:j_,pipeline:xI};const{pipeline:jI}=rd,Ya=Yn(),{destroyer:UI}=Do,{isNodeStream:Xa,isReadable:Ip,isWritable:Op,isWebStream:zl,isTransformStream:Ui,isWritableStream:Cp,isReadableStream:Lp}=ei,{AbortError:kI,codes:{ERR_INVALID_ARG_VALUE:Pp,ERR_MISSING_ARGS:FI}}=ur,HI=Ri;var U_=function(...t){if(t.length===0)throw new FI("streams");if(t.length===1)return Ya.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=Ya.from(t[0])),typeof t[t.length-1]=="function"){const A=t.length-1;t[A]=Ya.from(t[A])}for(let A=0;A<t.length;++A)if(!(!Xa(t[A])&&!zl(t[A]))){if(A<t.length-1&&!(Ip(t[A])||Lp(t[A])||Ui(t[A])))throw new Pp(`streams[${A}]`,r[A],"must be readable");if(A>0&&!(Op(t[A])||Cp(t[A])||Ui(t[A])))throw new Pp(`streams[${A}]`,r[A],"must be writable")}let o,s,u,f,h;function l(A){const x=f;f=null,x?x(A):A?h.destroy(A):!I&&!w&&h.destroy()}const p=t[0],b=jI(t,l),w=!!(Op(p)||Cp(p)||Ui(p)),I=!!(Ip(b)||Lp(b)||Ui(b));if(h=new Ya({writableObjectMode:!!(p!=null&&p.writableObjectMode),readableObjectMode:!!(b!=null&&b.readableObjectMode),writable:w,readable:I}),w){if(Xa(p))h._write=function(x,v,C){p.write(x,v)?C():o=C},h._final=function(x){p.end(),s=x},p.on("drain",function(){if(o){const x=o;o=null,x()}});else if(zl(p)){const v=(Ui(p)?p.writable:p).getWriter();h._write=async function(C,B,P){try{await v.ready,v.write(C).catch(()=>{}),P()}catch(S){P(S)}},h._final=async function(C){try{await v.ready,v.close().catch(()=>{}),s=C}catch(B){C(B)}}}const A=Ui(b)?b.readable:b;HI(A,()=>{if(s){const x=s;s=null,x()}})}if(I){if(Xa(b))b.on("readable",function(){if(u){const A=u;u=null,A()}}),b.on("end",function(){h.push(null)}),h._read=function(){for(;;){const A=b.read();if(A===null){u=h._read;return}if(!h.push(A))return}};else if(zl(b)){const x=(Ui(b)?b.readable:b).getReader();h._read=async function(){for(;;)try{const{value:v,done:C}=await x.read();if(!h.push(v))return;if(C){h.push(null);return}}catch{return}}}}return h._destroy=function(A,x){!A&&f!==null&&(A=new kI),u=null,o=null,s=null,f===null?x(A):(f=x,Xa(b)&&UI(b,A))},h};const WI=globalThis.AbortController||Is().AbortController,{codes:{ERR_INVALID_ARG_VALUE:qI,ERR_INVALID_ARG_TYPE:Ms,ERR_MISSING_ARGS:GI,ERR_OUT_OF_RANGE:VI},AbortError:On}=ur,{validateAbortSignal:Ki,validateInteger:Bp,validateObject:Ji}=$s,zI=vt.Symbol("kWeak"),KI=vt.Symbol("kResistStopPropagation"),{finished:JI}=Ri,YI=U_,{addAbortSignalNoValidate:XI}=Pu,{isWritable:ZI,isNodeStream:QI}=ei,{deprecate:eO}=br,{ArrayPrototypePush:tO,Boolean:rO,MathFloor:Np,Number:nO,NumberIsNaN:iO,Promise:$p,PromiseReject:Mp,PromiseResolve:oO,PromisePrototypeThen:xp,Symbol:k_}=vt,pu=k_("kEmpty"),Dp=k_("kEof");function sO(e,t){if(t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal"),QI(e)&&!ZI(e))throw new qI("stream",e,"must be writable");const r=YI(this,e);return t!=null&&t.signal&&XI(t.signal,r),r}function $u(e,t){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=Np(t.concurrency));let o=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(o=Np(t.highWaterMark)),Bp(r,"options.concurrency",1),Bp(o,"options.highWaterMark",0),o+=r,(async function*(){const u=br.AbortSignalAny([t==null?void 0:t.signal].filter(rO)),f=this,h=[],l={signal:u};let p,b,w=!1,I=0;function A(){w=!0,x()}function x(){I-=1,v()}function v(){b&&!w&&I<r&&h.length<o&&(b(),b=null)}async function C(){try{for await(let B of f){if(w)return;if(u.aborted)throw new On;try{if(B=e(B,l),B===pu)continue;B=oO(B)}catch(P){B=Mp(P)}I+=1,xp(B,x,A),h.push(B),p&&(p(),p=null),!w&&(h.length>=o||I>=r)&&await new $p(P=>{b=P})}h.push(Dp)}catch(B){const P=Mp(B);xp(P,x,A),h.push(P)}finally{w=!0,p&&(p(),p=null)}}C();try{for(;;){for(;h.length>0;){const B=await h[0];if(B===Dp)return;if(u.aborted)throw new On;B!==pu&&(yield B),h.shift(),v()}await new $p(B=>{p=B})}}finally{w=!0,b&&(b(),b=null)}}).call(this)}function aO(e=void 0){return e!=null&&Ji(e,"options"),(e==null?void 0:e.signal)!=null&&Ki(e.signal,"options.signal"),(async function*(){let r=0;for await(const s of this){var o;if(e!=null&&(o=e.signal)!==null&&o!==void 0&&o.aborted)throw new On({cause:e.signal.reason});yield[r++,s]}}).call(this)}async function F_(e,t=void 0){for await(const r of nd.call(this,e,t))return!0;return!1}async function uO(e,t=void 0){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);return!await F_.call(this,async(...r)=>!await e(...r),t)}async function fO(e,t){for await(const r of nd.call(this,e,t))return r}async function lO(e,t){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);async function r(o,s){return await e(o,s),pu}for await(const o of $u.call(this,r,t));}function nd(e,t){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);async function r(o,s){return await e(o,s)?o:pu}return $u.call(this,r,t)}class cO extends GI{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function dO(e,t,r){var o;if(typeof e!="function")throw new Ms("reducer",["Function","AsyncFunction"],e);r!=null&&Ji(r,"options"),(r==null?void 0:r.signal)!=null&&Ki(r.signal,"options.signal");let s=arguments.length>1;if(r!=null&&(o=r.signal)!==null&&o!==void 0&&o.aborted){const p=new On(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await JI(this.destroy(p)),p}const u=new WI,f=u.signal;if(r!=null&&r.signal){const p={once:!0,[zI]:this,[KI]:!0};r.signal.addEventListener("abort",()=>u.abort(),p)}let h=!1;try{for await(const p of this){var l;if(h=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new On;s?t=await e(t,p,{signal:f}):(t=p,s=!0)}if(!h&&!s)throw new cO}finally{u.abort()}return t}async function hO(e){e!=null&&Ji(e,"options"),(e==null?void 0:e.signal)!=null&&Ki(e.signal,"options.signal");const t=[];for await(const o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new On(void 0,{cause:e.signal.reason});tO(t,o)}return t}function gO(e,t){const r=$u.call(this,e,t);return(async function*(){for await(const s of r)yield*s}).call(this)}function H_(e){if(e=nO(e),iO(e))return 0;if(e<0)throw new VI("number",">= 0",e);return e}function pO(e,t=void 0){return t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal"),e=H_(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new On;for await(const u of this){var s;if(t!=null&&(s=t.signal)!==null&&s!==void 0&&s.aborted)throw new On;e--<=0&&(yield u)}}).call(this)}function bO(e,t=void 0){return t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal"),e=H_(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new On;for await(const u of this){var s;if(t!=null&&(s=t.signal)!==null&&s!==void 0&&s.aborted)throw new On;if(e-- >0&&(yield u),e<=0)return}}).call(this)}Kc.streamReturningOperators={asIndexedPairs:eO(aO,"readable.asIndexedPairs will be removed in a future version."),drop:pO,filter:nd,flatMap:gO,map:$u,take:bO,compose:sO};Kc.promiseReturningOperators={every:uO,forEach:lO,reduce:dO,toArray:hO,some:F_,find:fO};var Kl,jp;function W_(){if(jp)return Kl;jp=1;const{ArrayPrototypePop:e,Promise:t}=vt,{isIterable:r,isNodeStream:o,isWebStream:s}=ei,{pipelineImpl:u}=rd,{finished:f}=Ri;q_();function h(...l){return new t((p,b)=>{let w,I;const A=l[l.length-1];if(A&&typeof A=="object"&&!o(A)&&!r(A)&&!s(A)){const x=e(l);w=x.signal,I=x.end}u(l,(x,v)=>{x?b(x):p(v)},{signal:w,end:I})})}return Kl={finished:f,pipeline:h},Kl}var Up;function q_(){if(Up)return Pl.exports;Up=1;const{Buffer:e}=H.bufferPolyfill,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:o}=vt,{promisify:{custom:s}}=br,{streamReturningOperators:u,promiseReturningOperators:f}=Kc,{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=ur,l=U_,{setDefaultHighWaterMark:p,getDefaultHighWaterMark:b}=Bu,{pipeline:w}=rd,{destroyer:I}=Do,A=Ri,x=W_(),v=ei,C=Pl.exports=Zc.Stream;C.isDestroyed=v.isDestroyed,C.isDisturbed=v.isDisturbed,C.isErrored=v.isErrored,C.isReadable=v.isReadable,C.isWritable=v.isWritable,C.Readable=Nu();for(const P of r(u)){let m=function(...j){if(new.target)throw h();return C.Readable.from(o(S,this,j))};const S=u[P];t(m,"name",{__proto__:null,value:S.name}),t(m,"length",{__proto__:null,value:S.length}),t(C.Readable.prototype,P,{__proto__:null,value:m,enumerable:!1,configurable:!0,writable:!0})}for(const P of r(f)){let m=function(...j){if(new.target)throw h();return o(S,this,j)};const S=f[P];t(m,"name",{__proto__:null,value:S.name}),t(m,"length",{__proto__:null,value:S.length}),t(C.Readable.prototype,P,{__proto__:null,value:m,enumerable:!1,configurable:!0,writable:!0})}C.Writable=Qc(),C.Duplex=Yn(),C.Transform=M_,C.PassThrough=D_,C.pipeline=w;const{addAbortSignal:B}=Pu;return C.addAbortSignal=B,C.finished=A,C.destroy=I,C.compose=l,C.setDefaultHighWaterMark=p,C.getDefaultHighWaterMark=b,t(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return x}}),t(w,s,{__proto__:null,enumerable:!0,get(){return x.pipeline}}),t(A,s,{__proto__:null,enumerable:!0,get(){return x.finished}}),C.Stream=C,C._isUint8Array=function(S){return S instanceof Uint8Array},C._uint8ArrayToBuffer=function(S){return e.from(S.buffer,S.byteOffset,S.byteLength)},Pl.exports}zc.exports;(function(e){const t=q_(),r=W_(),o=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=o,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(zc);zc.exports;var _O={},qi={},id={},Wt={};class G_ extends TypeError{constructor(t,r){let o;const{message:s,explanation:u,...f}=t,{path:h}=t,l=h.length===0?s:`At path: ${h.join(".")} -- ${s}`;super(u??l),u!=null&&(this.cause=l),Object.assign(this,f),this.name=this.constructor.name,this.failures=()=>o??(o=[t,...r()])}}function yO(e){return Hr(e)&&typeof e[Symbol.iterator]=="function"}function Hr(e){return typeof e=="object"&&e!=null}function kp(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function xt(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function wO(e){const{done:t,value:r}=e.next();return t?void 0:r}function mO(e,t,r,o){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:u}=t,{type:f}=r,{refinement:h,message:l=`Expected a value of type \`${f}\`${h?` with refinement \`${h}\``:""}, but received: \`${xt(o)}\``}=e;return{value:o,type:f,refinement:h,key:s[s.length-1],path:s,branch:u,...e,message:l}}function*Oc(e,t,r,o){yO(e)||(e=[e]);for(const s of e){const u=mO(s,t,r,o);u&&(yield u)}}function*od(e,t,r={}){const{path:o=[],branch:s=[e],coerce:u=!1,mask:f=!1}=r,h={path:o,branch:s};if(u&&(e=t.coercer(e,h),f&&t.type!=="type"&&Hr(t.schema)&&Hr(e)&&!Array.isArray(e)))for(const p in e)t.schema[p]===void 0&&delete e[p];let l="valid";for(const p of t.validator(e,h))p.explanation=r.message,l="not_valid",yield[p,void 0];for(let[p,b,w]of t.entries(e,h)){const I=od(b,w,{path:p===void 0?o:[...o,p],branch:p===void 0?s:[...s,b],coerce:u,mask:f,message:r.message});for(const A of I)A[0]?(l=A[0].refinement!=null?"not_refined":"not_valid",yield[A[0],void 0]):u&&(b=A[1],p===void 0?e=b:e instanceof Map?e.set(p,b):e instanceof Set?e.add(b):Hr(e)&&(b!==void 0||p in e)&&(e[p]=b))}if(l!=="not_valid")for(const p of t.refiner(e,h))p.explanation=r.message,l="not_refined",yield[p,void 0];l==="valid"&&(yield[void 0,e])}class Ct{constructor(t){const{type:r,schema:o,validator:s,refiner:u,coercer:f=l=>l,entries:h=function*(){}}=t;this.type=r,this.schema=o,this.entries=h,this.coercer=f,s?this.validator=(l,p)=>{const b=s(l,p);return Oc(b,p,this,l)}:this.validator=()=>[],u?this.refiner=(l,p)=>{const b=u(l,p);return Oc(b,p,this,l)}:this.refiner=()=>[]}assert(t,r){return V_(t,this,r)}create(t,r){return z_(t,this,r)}is(t){return sd(t,this)}mask(t,r){return K_(t,this,r)}validate(t,r={}){return jo(t,this,r)}}function V_(e,t,r){const o=jo(e,t,{message:r});if(o[0])throw o[0]}function z_(e,t,r){const o=jo(e,t,{coerce:!0,message:r});if(o[0])throw o[0];return o[1]}function K_(e,t,r){const o=jo(e,t,{coerce:!0,mask:!0,message:r});if(o[0])throw o[0];return o[1]}function sd(e,t){return!jo(e,t)[0]}function jo(e,t,r={}){const o=od(e,t,r),s=wO(o);return s[0]?[new G_(s[0],function*(){for(const f of o)f[0]&&(yield f[0])}),void 0]:[void 0,s[1]]}function EO(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),o=Object.assign({},...r);return t?Ds(o):xs(o)}function _r(e,t){return new Ct({type:e,schema:null,validator:t})}function vO(e,t){return new Ct({...e,refiner:(r,o)=>r===void 0||e.refiner(r,o),validator(r,o){return r===void 0?!0:(t(r,o),e.validator(r,o))}})}function SO(e){return new Ct({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function RO(e){let t;return new Ct({type:"lazy",schema:null,*entries(r,o){t??(t=e()),yield*t.entries(r,o)},validator(r,o){return t??(t=e()),t.validator(r,o)},coercer(r,o){return t??(t=e()),t.coercer(r,o)},refiner(r,o){return t??(t=e()),t.refiner(r,o)}})}function AO(e,t){const{schema:r}=e,o={...r};for(const s of t)delete o[s];switch(e.type){case"type":return Ds(o);default:return xs(o)}}function TO(e){const t=e instanceof Ct,r=t?{...e.schema}:{...e};for(const o in r)r[o]=J_(r[o]);return t&&e.type==="type"?Ds(r):xs(r)}function IO(e,t){const{schema:r}=e,o={};for(const s of t)o[s]=r[s];switch(e.type){case"type":return Ds(o);default:return xs(o)}}function OO(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),_r(e,t)}function CO(){return _r("any",()=>!0)}function LO(e){return new Ct({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,o]of t.entries())yield[r,o,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${xt(t)}`}})}function PO(){return _r("bigint",e=>typeof e=="bigint")}function BO(){return _r("boolean",e=>typeof e=="boolean")}function NO(){return _r("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${xt(e)}`)}function $O(e){const t={},r=e.map(o=>xt(o)).join();for(const o of e)t[o]=o;return new Ct({type:"enums",schema:t,validator(o){return e.includes(o)||`Expected one of \`${r}\`, but received: ${xt(o)}`}})}function MO(){return _r("func",e=>typeof e=="function"||`Expected a function, but received: ${xt(e)}`)}function xO(e){return _r("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${xt(t)}`)}function DO(){return _r("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${xt(e)}`)}function jO(e){return new Ct({type:"intersection",schema:null,*entries(t,r){for(const o of e)yield*o.entries(t,r)},*validator(t,r){for(const o of e)yield*o.validator(t,r)},*refiner(t,r){for(const o of e)yield*o.refiner(t,r)}})}function UO(e){const t=xt(e),r=typeof e;return new Ct({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(o){return o===e||`Expected the literal \`${t}\`, but received: ${xt(o)}`}})}function kO(e,t){return new Ct({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[o,s]of r.entries())yield[o,o,e],yield[o,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${xt(r)}`}})}function ad(){return _r("never",()=>!1)}function FO(e){return new Ct({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function HO(){return _r("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${xt(e)}`)}function xs(e){const t=e?Object.keys(e):[],r=ad();return new Ct({type:"object",schema:e||null,*entries(o){if(e&&Hr(o)){const s=new Set(Object.keys(o));for(const u of t)s.delete(u),yield[u,o[u],e[u]];for(const u of s)yield[u,o[u],r]}},validator(o){return Hr(o)||`Expected an object, but received: ${xt(o)}`},coercer(o){return Hr(o)?{...o}:o}})}function J_(e){return new Ct({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function WO(e,t){return new Ct({type:"record",schema:null,*entries(r){if(Hr(r))for(const o in r){const s=r[o];yield[o,o,e],yield[o,s,t]}},validator(r){return Hr(r)||`Expected an object, but received: ${xt(r)}`}})}function qO(){return _r("regexp",e=>e instanceof RegExp)}function GO(e){return new Ct({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${xt(t)}`}})}function Y_(){return _r("string",e=>typeof e=="string"||`Expected a string, but received: ${xt(e)}`)}function VO(e){const t=ad();return new Ct({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const o=Math.max(e.length,r.length);for(let s=0;s<o;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${xt(r)}`}})}function Ds(e){const t=Object.keys(e);return new Ct({type:"type",schema:e,*entries(r){if(Hr(r))for(const o of t)yield[o,r[o],e[o]]},validator(r){return Hr(r)||`Expected an object, but received: ${xt(r)}`},coercer(r){return Hr(r)?{...r}:r}})}function zO(e){const t=e.map(r=>r.type).join(" | ");return new Ct({type:"union",schema:null,coercer(r){for(const o of e){const[s,u]=o.validate(r,{coerce:!0});if(!s)return u}return r},validator(r,o){const s=[];for(const u of e){const[...f]=od(r,u,o),[h]=f;if(h[0])for(const[l]of f)l&&s.push(l);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${xt(r)}`,...s]}})}function X_(){return _r("unknown",()=>!0)}function ud(e,t,r){return new Ct({...e,coercer:(o,s)=>sd(o,t)?e.coercer(r(o,s),s):e.coercer(o,s)})}function KO(e,t,r={}){return ud(e,X_(),o=>{const s=typeof t=="function"?t():t;if(o===void 0)return s;if(!r.strict&&kp(o)&&kp(s)){const u={...o};let f=!1;for(const h in s)u[h]===void 0&&(u[h]=s[h],f=!0);if(f)return u}return o})}function JO(e){return ud(e,Y_(),t=>t.trim())}function YO(e){return Yi(e,"empty",t=>{const r=Z_(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Z_(e){return e instanceof Map||e instanceof Set?e.size:e.length}function XO(e,t,r={}){const{exclusive:o}=r;return Yi(e,"max",s=>o?s<t:s<=t||`Expected a ${e.type} less than ${o?"":"or equal to "}${t} but received \`${s}\``)}function ZO(e,t,r={}){const{exclusive:o}=r;return Yi(e,"min",s=>o?s>t:s>=t||`Expected a ${e.type} greater than ${o?"":"or equal to "}${t} but received \`${s}\``)}function QO(e){return Yi(e,"nonempty",t=>Z_(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function e2(e,t){return Yi(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function t2(e,t,r=t){const o=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Yi(e,"size",u=>{if(typeof u=="number"||u instanceof Date)return t<=u&&u<=r||`${o} ${s} but received \`${u}\``;if(u instanceof Map||u instanceof Set){const{size:f}=u;return t<=f&&f<=r||`${o} with a size ${s} but received one with a size of \`${f}\``}else{const{length:f}=u;return t<=f&&f<=r||`${o} with a length ${s} but received one with a length of \`${f}\``}})}function Yi(e,t,r){return new Ct({...e,*refiner(o,s){yield*e.refiner(o,s);const u=r(o,s),f=Oc(u,s,e,o);for(const h of f)yield{...h,refinement:t}}})}const r2=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ct,StructError:G_,any:CO,array:LO,assert:V_,assign:EO,bigint:PO,boolean:BO,coerce:ud,create:z_,date:NO,defaulted:KO,define:_r,deprecated:vO,dynamic:SO,empty:YO,enums:$O,func:MO,instance:xO,integer:DO,intersection:jO,is:sd,lazy:RO,literal:UO,map:kO,mask:K_,max:XO,min:ZO,never:ad,nonempty:QO,nullable:FO,number:HO,object:xs,omit:AO,optional:J_,partial:TO,pattern:e2,pick:IO,record:WO,refine:Yi,regexp:qO,set:GO,size:t2,string:Y_,struct:OO,trimmed:JO,tuple:VO,type:Ds,union:zO,unknown:X_,validate:jo},Symbol.toStringTag,{value:"Module"})),Xi=H.getAugmentedNamespace(r2);Object.defineProperty(Wt,"__esModule",{value:!0});Wt.assertExhaustive=Wt.assertStruct=Wt.assert=Wt.AssertionError=void 0;const n2=Xi;function i2(e){return typeof e=="object"&&e!==null&&"message"in e}function o2(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function s2(e){const t=i2(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Q_(e,t){return o2(e)?new e({message:t}):e({message:t})}class fd extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Wt.AssertionError=fd;function a2(e,t="Assertion failed.",r=fd){if(!e)throw t instanceof Error?t:Q_(r,t)}Wt.assert=a2;function u2(e,t,r="Assertion failed",o=fd){try{(0,n2.assert)(e,t)}catch(s){throw Q_(o,`${r}: ${s2(s)}.`)}}Wt.assertStruct=u2;function f2(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Wt.assertExhaustive=f2;var js={};Object.defineProperty(js,"__esModule",{value:!0});js.base64=void 0;const l2=Xi,c2=Wt,d2=(e,t={})=>{var r,o;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,u=(o=t.characterSet)!==null&&o!==void 0?o:"base64";let f;u==="base64"?f=String.raw`[A-Za-z0-9+\/]`:((0,c2.assert)(u==="base64url"),f=String.raw`[-_A-Za-z0-9]`);let h;return s?h=new RegExp(`^(?:${f}{4})*(?:${f}{3}=|${f}{2}==)?$`,"u"):h=new RegExp(`^(?:${f}{4})*(?:${f}{2,3}|${f}{3}=|${f}{2}==)?$`,"u"),(0,l2.pattern)(e,h)};js.base64=d2;var Ze={},Us={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Xi,r=Wt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function o(p){return(0,t.is)(p,e.HexStruct)}e.isHexString=o;function s(p){return(0,t.is)(p,e.StrictHexStruct)}e.isStrictHexString=s;function u(p){(0,r.assert)(o(p),"Value must be a hexadecimal string.")}e.assertIsHexString=u;function f(p){(0,r.assert)(s(p),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=f;function h(p){return p.startsWith("0x")?p:p.startsWith("0X")?`0x${p.substring(2)}`:`0x${p}`}e.add0x=h;function l(p){return p.startsWith("0x")||p.startsWith("0X")?p.substring(2):p}e.remove0x=l})(Us);Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createDataView=Ze.concatBytes=Ze.valueToBytes=Ze.stringToBytes=Ze.numberToBytes=Ze.signedBigIntToBytes=Ze.bigIntToBytes=Ze.hexToBytes=Ze.bytesToString=Ze.bytesToNumber=Ze.bytesToSignedBigInt=Ze.bytesToBigInt=Ze.bytesToHex=Ze.assertIsBytes=Ze.isBytes=void 0;const Ir=Wt,Cc=Us,Fp=48,Hp=58,Wp=87;function h2(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const g2=h2();function ld(e){return e instanceof Uint8Array}Ze.isBytes=ld;function Uo(e){(0,Ir.assert)(ld(e),"Value must be a Uint8Array.")}Ze.assertIsBytes=Uo;function ey(e){if(Uo(e),e.length===0)return"0x";const t=g2(),r=new Array(e.length);for(let o=0;o<e.length;o++)r[o]=t[e[o]];return(0,Cc.add0x)(r.join(""))}Ze.bytesToHex=ey;function ty(e){Uo(e);const t=ey(e);return BigInt(t)}Ze.bytesToBigInt=ty;function p2(e){Uo(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}Ze.bytesToSignedBigInt=p2;function b2(e){Uo(e);const t=ty(e);return(0,Ir.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}Ze.bytesToNumber=b2;function _2(e){return Uo(e),new TextDecoder().decode(e)}Ze.bytesToString=_2;function Mu(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Cc.assertIsHexString)(e);const r=(0,Cc.remove0x)(e).toLowerCase(),o=r.length%2===0?r:`0${r}`,s=new Uint8Array(o.length/2);for(let u=0;u<s.length;u++){const f=o.charCodeAt(u*2),h=o.charCodeAt(u*2+1),l=f-(f<Hp?Fp:Wp),p=h-(h<Hp?Fp:Wp);s[u]=l*16+p}return s}Ze.hexToBytes=Mu;function ry(e){(0,Ir.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ir.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Mu(t)}Ze.bigIntToBytes=ry;function y2(e,t){(0,Ir.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function w2(e,t){(0,Ir.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ir.assert)(typeof t=="number","Byte length must be a number."),(0,Ir.assert)(t>0,"Byte length must be greater than 0."),(0,Ir.assert)(y2(e,t),"Byte length is too small to represent the given value.");let r=e;const o=new Uint8Array(t);for(let s=0;s<o.length;s++)o[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return o.reverse()}Ze.signedBigIntToBytes=w2;function ny(e){(0,Ir.assert)(typeof e=="number","Value must be a number."),(0,Ir.assert)(e>=0,"Value must be a non-negative number."),(0,Ir.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Mu(t)}Ze.numberToBytes=ny;function iy(e){return(0,Ir.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}Ze.stringToBytes=iy;function oy(e){if(typeof e=="bigint")return ry(e);if(typeof e=="number")return ny(e);if(typeof e=="string")return e.startsWith("0x")?Mu(e):iy(e);if(ld(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}Ze.valueToBytes=oy;function m2(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const u=oy(e[s]);t[s]=u,r+=u.length}const o=new Uint8Array(r);for(let s=0,u=0;s<t.length;s++)o.set(t[s],u),u+=t[s].length;return o}Ze.concatBytes=m2;function E2(e){if(typeof H.dist.Buffer<"u"&&e instanceof H.dist.Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}Ze.createDataView=E2;var xu={};Object.defineProperty(xu,"__esModule",{value:!0});xu.ChecksumStruct=void 0;const qp=Xi,v2=js;xu.ChecksumStruct=(0,qp.size)((0,v2.base64)((0,qp.string)(),{paddingRequired:!0}),44,44);var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.createHex=vn.createBytes=vn.createBigInt=vn.createNumber=void 0;const Et=Xi,S2=Wt,sy=Ze,Du=Us,ay=(0,Et.union)([(0,Et.number)(),(0,Et.bigint)(),(0,Et.string)(),Du.StrictHexStruct]),R2=(0,Et.coerce)((0,Et.number)(),ay,Number),A2=(0,Et.coerce)((0,Et.bigint)(),ay,BigInt);(0,Et.union)([Du.StrictHexStruct,(0,Et.instance)(Uint8Array)]);const T2=(0,Et.coerce)((0,Et.instance)(Uint8Array),(0,Et.union)([Du.StrictHexStruct]),sy.hexToBytes),I2=(0,Et.coerce)(Du.StrictHexStruct,(0,Et.instance)(Uint8Array),sy.bytesToHex);function O2(e){try{const t=(0,Et.create)(e,R2);return(0,S2.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Et.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}vn.createNumber=O2;function C2(e){try{return(0,Et.create)(e,A2)}catch(t){throw t instanceof Et.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}vn.createBigInt=C2;function L2(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Et.create)(e,T2)}catch(t){throw t instanceof Et.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}vn.createBytes=L2;function P2(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Et.create)(e,I2)}catch(t){throw t instanceof Et.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}vn.createHex=P2;var Po={},uy=H.commonjsGlobal&&H.commonjsGlobal.__classPrivateFieldSet||function(e,t,r,o,s){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},ar=H.commonjsGlobal&&H.commonjsGlobal.__classPrivateFieldGet||function(e,t,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(e):o?o.value:t.get(e)},tn,wn;Object.defineProperty(Po,"__esModule",{value:!0});Po.FrozenSet=Po.FrozenMap=void 0;class cd{constructor(t){tn.set(this,void 0),uy(this,tn,new Map(t),"f"),Object.freeze(this)}get size(){return ar(this,tn,"f").size}[(tn=new WeakMap,Symbol.iterator)](){return ar(this,tn,"f")[Symbol.iterator]()}entries(){return ar(this,tn,"f").entries()}forEach(t,r){return ar(this,tn,"f").forEach((o,s,u)=>t.call(r,o,s,this))}get(t){return ar(this,tn,"f").get(t)}has(t){return ar(this,tn,"f").has(t)}keys(){return ar(this,tn,"f").keys()}values(){return ar(this,tn,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Po.FrozenMap=cd;class dd{constructor(t){wn.set(this,void 0),uy(this,wn,new Set(t),"f"),Object.freeze(this)}get size(){return ar(this,wn,"f").size}[(wn=new WeakMap,Symbol.iterator)](){return ar(this,wn,"f")[Symbol.iterator]()}entries(){return ar(this,wn,"f").entries()}forEach(t,r){return ar(this,wn,"f").forEach((o,s,u)=>t.call(r,o,s,this))}has(t){return ar(this,wn,"f").has(t)}keys(){return ar(this,wn,"f").keys()}values(){return ar(this,wn,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Po.FrozenSet=dd;Object.freeze(cd);Object.freeze(cd.prototype);Object.freeze(dd);Object.freeze(dd.prototype);var fy={};Object.defineProperty(fy,"__esModule",{value:!0});var ly={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Xi,r=Wt,o=()=>(0,t.define)("finite number",j=>(0,t.is)(j,(0,t.number)())&&Number.isFinite(j));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),o(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(j,Q)=>{function ce(ue,te){const me=[...te.validator(ue,Q)];return me.length>0?me:!0}try{const ue=ce(j,e.UnsafeJsonStruct);return ue!==!0?ue:ce(JSON.parse(JSON.stringify(j)),e.UnsafeJsonStruct)}catch(ue){return ue instanceof RangeError?"Circular reference detected":!1}});function s(j){return(0,t.is)(j,e.JsonStruct)}e.isValidJson=s;function u(j){(0,r.assertStruct)(j,e.JsonStruct,"Invalid JSON value");const Q=JSON.stringify(j);return new TextEncoder().encode(Q).byteLength}e.getJsonSize=u,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function f(j){return(0,t.is)(j,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=f;function h(j,Q){(0,r.assertStruct)(j,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",Q)}e.assertIsJsonRpcNotification=h;function l(j){return(0,t.is)(j,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function p(j,Q){(0,r.assertStruct)(j,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",Q)}e.assertIsJsonRpcRequest=p,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function b(j){return(0,t.is)(j,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=b;function w(j,Q){(0,r.assertStruct)(j,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",Q)}e.assertIsPendingJsonRpcResponse=w;function I(j){return(0,t.is)(j,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=I;function A(j,Q){(0,r.assertStruct)(j,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",Q)}e.assertIsJsonRpcResponse=A;function x(j){return(0,t.is)(j,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=x;function v(j,Q){(0,r.assertStruct)(j,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",Q)}e.assertIsJsonRpcSuccess=v;function C(j){return(0,t.is)(j,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=C;function B(j,Q){(0,r.assertStruct)(j,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",Q)}e.assertIsJsonRpcFailure=B;function P(j){return(0,t.is)(j,e.JsonRpcErrorStruct)}e.isJsonRpcError=P;function S(j,Q){(0,r.assertStruct)(j,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",Q)}e.assertIsJsonRpcError=S;function m(j){const{permitEmptyString:Q,permitFractions:ce,permitNull:ue}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},j);return Se=>!!(typeof Se=="number"&&(ce||Number.isInteger(Se))||typeof Se=="string"&&(Q||Se.length>0)||ue&&Se===null)}e.getJsonRpcIdValidator=m})(ly);var cy={};Object.defineProperty(cy,"__esModule",{value:!0});var Bo={},B2=H.commonjsGlobal&&H.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.createModuleLogger=Bo.createProjectLogger=void 0;const N2=B2(vA),$2=(0,N2.default)("metamask");function M2(e){return $2.extend(e)}Bo.createProjectLogger=M2;function x2(e,t){return e.extend(t)}Bo.createModuleLogger=x2;var dy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(p){return Array.isArray(p)&&p.length>0}e.isNonEmptyArray=t;function r(p){return p==null}e.isNullOrUndefined=r;function o(p){return!!p&&typeof p=="object"&&!Array.isArray(p)}e.isObject=o;const s=(p,b)=>Object.hasOwnProperty.call(p,b);e.hasProperty=s,function(p){p[p.Null=4]="Null",p[p.Comma=1]="Comma",p[p.Wrapper=1]="Wrapper",p[p.True=4]="True",p[p.False=5]="False",p[p.Quote=1]="Quote",p[p.Colon=1]="Colon",p[p.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function u(p){if(typeof p!="object"||p===null)return!1;try{let b=p;for(;Object.getPrototypeOf(b)!==null;)b=Object.getPrototypeOf(b);return Object.getPrototypeOf(p)===b}catch{return!1}}e.isPlainObject=u;function f(p){return p.charCodeAt(0)<=127}e.isASCII=f;function h(p){var b;return p.split("").reduce((I,A)=>f(A)?I+1:I+2,0)+((b=p.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&b!==void 0?b:[]).length}e.calculateStringSize=h;function l(p){return p.toString().length}e.calculateNumberSize=l})(dy);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.hexToBigInt=Sn.hexToNumber=Sn.bigIntToHex=Sn.numberToHex=void 0;const To=Wt,Os=Us,D2=e=>((0,To.assert)(typeof e=="number","Value must be a number."),(0,To.assert)(e>=0,"Value must be a non-negative number."),(0,To.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Os.add0x)(e.toString(16)));Sn.numberToHex=D2;const j2=e=>((0,To.assert)(typeof e=="bigint","Value must be a bigint."),(0,To.assert)(e>=0,"Value must be a non-negative bigint."),(0,Os.add0x)(e.toString(16)));Sn.bigIntToHex=j2;const U2=e=>{(0,Os.assertIsHexString)(e);const t=parseInt(e,16);return(0,To.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Sn.hexToNumber=U2;const k2=e=>((0,Os.assertIsHexString)(e),BigInt((0,Os.add0x)(e)));Sn.hexToBigInt=k2;var hy={};Object.defineProperty(hy,"__esModule",{value:!0});var gy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(u){u[u.Millisecond=1]="Millisecond",u[u.Second=1e3]="Second",u[u.Minute=6e4]="Minute",u[u.Hour=36e5]="Hour",u[u.Day=864e5]="Day",u[u.Week=6048e5]="Week",u[u.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=u=>Number.isInteger(u)&&u>=0,r=(u,f)=>{if(!t(u))throw new Error(`"${f}" must be a non-negative integer. Received: "${u}".`)};function o(u,f){return r(u,"count"),u*f}e.inMilliseconds=o;function s(u){return r(u,"timestamp"),Date.now()-u}e.timeSince=s})(gy);var py={};Object.defineProperty(py,"__esModule",{value:!0});var by={},Lc={exports:{}};const F2="2.0.0",_y=256,H2=Number.MAX_SAFE_INTEGER||9007199254740991,W2=16,q2=_y-6,G2=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ju={MAX_LENGTH:_y,MAX_SAFE_COMPONENT_LENGTH:W2,MAX_SAFE_BUILD_LENGTH:q2,MAX_SAFE_INTEGER:H2,RELEASE_TYPES:G2,SEMVER_SPEC_VERSION:F2,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const V2=typeof H.dist.process=="object"&&H.dist.process.env&&H.dist.process.env.NODE_DEBUG&&/\bsemver\b/i.test(H.dist.process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Uu=V2;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:s}=ju,u=Uu;t=e.exports={};const f=t.re=[],h=t.safeRe=[],l=t.src=[],p=t.safeSrc=[],b=t.t={};let w=0;const I="[a-zA-Z0-9-]",A=[["\\s",1],["\\d",s],[I,o]],x=C=>{for(const[B,P]of A)C=C.split(`${B}*`).join(`${B}{0,${P}}`).split(`${B}+`).join(`${B}{1,${P}}`);return C},v=(C,B,P)=>{const S=x(B),m=w++;u(C,m,B),b[C]=m,l[m]=B,p[m]=S,f[m]=new RegExp(B,P?"g":void 0),h[m]=new RegExp(S,P?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${I}*`),v("MAINVERSION",`(${l[b.NUMERICIDENTIFIER]})\\.(${l[b.NUMERICIDENTIFIER]})\\.(${l[b.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${l[b.NUMERICIDENTIFIERLOOSE]})\\.(${l[b.NUMERICIDENTIFIERLOOSE]})\\.(${l[b.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${l[b.NUMERICIDENTIFIER]}|${l[b.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${l[b.NUMERICIDENTIFIERLOOSE]}|${l[b.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${l[b.PRERELEASEIDENTIFIER]}(?:\\.${l[b.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${l[b.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[b.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${I}+`),v("BUILD",`(?:\\+(${l[b.BUILDIDENTIFIER]}(?:\\.${l[b.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${l[b.MAINVERSION]}${l[b.PRERELEASE]}?${l[b.BUILD]}?`),v("FULL",`^${l[b.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${l[b.MAINVERSIONLOOSE]}${l[b.PRERELEASELOOSE]}?${l[b.BUILD]}?`),v("LOOSE",`^${l[b.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${l[b.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${l[b.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${l[b.XRANGEIDENTIFIER]})(?:\\.(${l[b.XRANGEIDENTIFIER]})(?:\\.(${l[b.XRANGEIDENTIFIER]})(?:${l[b.PRERELEASE]})?${l[b.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${l[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[b.XRANGEIDENTIFIERLOOSE]})(?:${l[b.PRERELEASELOOSE]})?${l[b.BUILD]}?)?)?`),v("XRANGE",`^${l[b.GTLT]}\\s*${l[b.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${l[b.GTLT]}\\s*${l[b.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),v("COERCE",`${l[b.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",l[b.COERCEPLAIN]+`(?:${l[b.PRERELEASE]})?(?:${l[b.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",l[b.COERCE],!0),v("COERCERTLFULL",l[b.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${l[b.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${l[b.LONETILDE]}${l[b.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${l[b.LONETILDE]}${l[b.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${l[b.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${l[b.LONECARET]}${l[b.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${l[b.LONECARET]}${l[b.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${l[b.GTLT]}\\s*(${l[b.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${l[b.GTLT]}\\s*(${l[b.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${l[b.GTLT]}\\s*(${l[b.LOOSEPLAIN]}|${l[b.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${l[b.XRANGEPLAIN]})\\s+-\\s+(${l[b.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${l[b.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[b.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Lc,Lc.exports);var ks=Lc.exports;const z2=Object.freeze({loose:!0}),K2=Object.freeze({}),J2=e=>e?typeof e!="object"?z2:e:K2;var hd=J2;const Gp=/^[0-9]+$/,yy=(e,t)=>{const r=Gp.test(e),o=Gp.test(t);return r&&o&&(e=+e,t=+t),e===t?0:r&&!o?-1:o&&!r?1:e<t?-1:1},Y2=(e,t)=>yy(t,e);var wy={compareIdentifiers:yy,rcompareIdentifiers:Y2};const Za=Uu,{MAX_LENGTH:Vp,MAX_SAFE_INTEGER:Qa}=ju,{safeRe:zp,safeSrc:Kp,t:eu}=ks,X2=hd,{compareIdentifiers:wo}=wy;let Z2=class mn{constructor(t,r){if(r=X2(r),t instanceof mn){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Vp)throw new TypeError(`version is longer than ${Vp} characters`);Za("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const o=t.trim().match(r.loose?zp[eu.LOOSE]:zp[eu.FULL]);if(!o)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Qa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Qa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Qa||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const u=+s;if(u>=0&&u<Qa)return u}return s}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Za("SemVer.compare",this.version,this.options,t),!(t instanceof mn)){if(typeof t=="string"&&t===this.version)return 0;t=new mn(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof mn||(t=new mn(t,this.options)),wo(this.major,t.major)||wo(this.minor,t.minor)||wo(this.patch,t.patch)}comparePre(t){if(t instanceof mn||(t=new mn(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const o=this.prerelease[r],s=t.prerelease[r];if(Za("prerelease compare",r,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return wo(o,s)}while(++r)}compareBuild(t){t instanceof mn||(t=new mn(t,this.options));let r=0;do{const o=this.build[r],s=t.build[r];if(Za("build compare",r,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return wo(o,s)}while(++r)}inc(t,r,o){if(t.startsWith("pre")){if(!r&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const s=new RegExp(`^${this.options.loose?Kp[eu.PRERELEASELOOSE]:Kp[eu.PRERELEASE]}$`),u=`-${r}`.match(s);if(!u||u[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,o),this.inc("pre",r,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,o),this.inc("pre",r,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let u=this.prerelease.length;for(;--u>=0;)typeof this.prerelease[u]=="number"&&(this.prerelease[u]++,u=-2);if(u===-1){if(r===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let u=[r,s];o===!1&&(u=[r]),wo(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=u):this.prerelease=u}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Fs=Z2;const Jp=Fs,Q2=(e,t,r=!1)=>{if(e instanceof Jp)return e;try{return new Jp(e,t)}catch(o){if(!r)return null;throw o}};var eC=Q2;const tC=eC,rC=(e,t)=>{const r=tC(e,t);return r?r.version:null};var nC=rC;const Yp=Fs,iC=(e,t,r)=>new Yp(e,r).compare(new Yp(t,r));var ko=iC;const oC=ko,sC=(e,t,r)=>oC(e,t,r)>0;var gd=sC;const aC=ko,uC=(e,t,r)=>aC(e,t,r)<0;var my=uC;const fC=ko,lC=(e,t,r)=>fC(e,t,r)===0;var cC=lC;const dC=ko,hC=(e,t,r)=>dC(e,t,r)!==0;var gC=hC;const pC=ko,bC=(e,t,r)=>pC(e,t,r)>=0;var Ey=bC;const _C=ko,yC=(e,t,r)=>_C(e,t,r)<=0;var vy=yC;const wC=cC,mC=gC,EC=gd,vC=Ey,SC=my,RC=vy,AC=(e,t,r,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return wC(e,r,o);case"!=":return mC(e,r,o);case">":return EC(e,r,o);case">=":return vC(e,r,o);case"<":return SC(e,r,o);case"<=":return RC(e,r,o);default:throw new TypeError(`Invalid operator: ${t}`)}};var TC=AC;const{safeRe:xN,t:DN}=ks;class IC{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var OC=IC,Jl,Xp;function on(){if(Xp)return Jl;Xp=1;const e=/\s+/g;class t{constructor(G,Y){if(Y=s(Y),G instanceof t)return G.loose===!!Y.loose&&G.includePrerelease===!!Y.includePrerelease?G:new t(G.raw,Y);if(G instanceof u)return this.raw=G.value,this.set=[[G]],this.formatted=void 0,this;if(this.options=Y,this.loose=!!Y.loose,this.includePrerelease=!!Y.includePrerelease,this.raw=G.trim().replace(e," "),this.set=this.raw.split("||").map(V=>this.parseRange(V.trim())).filter(V=>V.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const V=this.set[0];if(this.set=this.set.filter(ne=>!v(ne[0])),this.set.length===0)this.set=[V];else if(this.set.length>1){for(const ne of this.set)if(ne.length===1&&C(ne[0])){this.set=[ne];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let G=0;G<this.set.length;G++){G>0&&(this.formatted+="||");const Y=this.set[G];for(let V=0;V<Y.length;V++)V>0&&(this.formatted+=" "),this.formatted+=Y[V].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(G){const V=((this.options.includePrerelease&&A)|(this.options.loose&&x))+":"+G,ne=o.get(V);if(ne)return ne;const W=this.options.loose,K=W?l[p.HYPHENRANGELOOSE]:l[p.HYPHENRANGE];G=G.replace(K,F(this.options.includePrerelease)),f("hyphen replace",G),G=G.replace(l[p.COMPARATORTRIM],b),f("comparator trim",G),G=G.replace(l[p.TILDETRIM],w),f("tilde trim",G),G=G.replace(l[p.CARETTRIM],I),f("caret trim",G);let ae=G.split(" ").map(be=>P(be,this.options)).join(" ").split(/\s+/).map(be=>me(be,this.options));W&&(ae=ae.filter(be=>(f("loose invalid filter",be,this.options),!!be.match(l[p.COMPARATORLOOSE])))),f("range list",ae);const de=new Map,re=ae.map(be=>new u(be,this.options));for(const be of re){if(v(be))return[be];de.set(be.value,be)}de.size>1&&de.has("")&&de.delete("");const _e=[...de.values()];return o.set(V,_e),_e}intersects(G,Y){if(!(G instanceof t))throw new TypeError("a Range is required");return this.set.some(V=>B(V,Y)&&G.set.some(ne=>B(ne,Y)&&V.every(W=>ne.every(K=>W.intersects(K,Y)))))}test(G){if(!G)return!1;if(typeof G=="string")try{G=new h(G,this.options)}catch{return!1}for(let Y=0;Y<this.set.length;Y++)if(U(this.set[Y],G,this.options))return!0;return!1}}Jl=t;const r=OC,o=new r,s=hd,u=ku(),f=Uu,h=Fs,{safeRe:l,t:p,comparatorTrimReplace:b,tildeTrimReplace:w,caretTrimReplace:I}=ks,{FLAG_INCLUDE_PRERELEASE:A,FLAG_LOOSE:x}=ju,v=$=>$.value==="<0.0.0-0",C=$=>$.value==="",B=($,G)=>{let Y=!0;const V=$.slice();let ne=V.pop();for(;Y&&V.length;)Y=V.every(W=>ne.intersects(W,G)),ne=V.pop();return Y},P=($,G)=>(f("comp",$,G),$=Q($,G),f("caret",$),$=m($,G),f("tildes",$),$=ue($,G),f("xrange",$),$=Se($,G),f("stars",$),$),S=$=>!$||$.toLowerCase()==="x"||$==="*",m=($,G)=>$.trim().split(/\s+/).map(Y=>j(Y,G)).join(" "),j=($,G)=>{const Y=G.loose?l[p.TILDELOOSE]:l[p.TILDE];return $.replace(Y,(V,ne,W,K,ae)=>{f("tilde",$,V,ne,W,K,ae);let de;return S(ne)?de="":S(W)?de=`>=${ne}.0.0 <${+ne+1}.0.0-0`:S(K)?de=`>=${ne}.${W}.0 <${ne}.${+W+1}.0-0`:ae?(f("replaceTilde pr",ae),de=`>=${ne}.${W}.${K}-${ae} <${ne}.${+W+1}.0-0`):de=`>=${ne}.${W}.${K} <${ne}.${+W+1}.0-0`,f("tilde return",de),de})},Q=($,G)=>$.trim().split(/\s+/).map(Y=>ce(Y,G)).join(" "),ce=($,G)=>{f("caret",$,G);const Y=G.loose?l[p.CARETLOOSE]:l[p.CARET],V=G.includePrerelease?"-0":"";return $.replace(Y,(ne,W,K,ae,de)=>{f("caret",$,ne,W,K,ae,de);let re;return S(W)?re="":S(K)?re=`>=${W}.0.0${V} <${+W+1}.0.0-0`:S(ae)?W==="0"?re=`>=${W}.${K}.0${V} <${W}.${+K+1}.0-0`:re=`>=${W}.${K}.0${V} <${+W+1}.0.0-0`:de?(f("replaceCaret pr",de),W==="0"?K==="0"?re=`>=${W}.${K}.${ae}-${de} <${W}.${K}.${+ae+1}-0`:re=`>=${W}.${K}.${ae}-${de} <${W}.${+K+1}.0-0`:re=`>=${W}.${K}.${ae}-${de} <${+W+1}.0.0-0`):(f("no pr"),W==="0"?K==="0"?re=`>=${W}.${K}.${ae}${V} <${W}.${K}.${+ae+1}-0`:re=`>=${W}.${K}.${ae}${V} <${W}.${+K+1}.0-0`:re=`>=${W}.${K}.${ae} <${+W+1}.0.0-0`),f("caret return",re),re})},ue=($,G)=>(f("replaceXRanges",$,G),$.split(/\s+/).map(Y=>te(Y,G)).join(" ")),te=($,G)=>{$=$.trim();const Y=G.loose?l[p.XRANGELOOSE]:l[p.XRANGE];return $.replace(Y,(V,ne,W,K,ae,de)=>{f("xRange",$,V,ne,W,K,ae,de);const re=S(W),_e=re||S(K),be=_e||S(ae),R=be;return ne==="="&&R&&(ne=""),de=G.includePrerelease?"-0":"",re?ne===">"||ne==="<"?V="<0.0.0-0":V="*":ne&&R?(_e&&(K=0),ae=0,ne===">"?(ne=">=",_e?(W=+W+1,K=0,ae=0):(K=+K+1,ae=0)):ne==="<="&&(ne="<",_e?W=+W+1:K=+K+1),ne==="<"&&(de="-0"),V=`${ne+W}.${K}.${ae}${de}`):_e?V=`>=${W}.0.0${de} <${+W+1}.0.0-0`:be&&(V=`>=${W}.${K}.0${de} <${W}.${+K+1}.0-0`),f("xRange return",V),V})},Se=($,G)=>(f("replaceStars",$,G),$.trim().replace(l[p.STAR],"")),me=($,G)=>(f("replaceGTE0",$,G),$.trim().replace(l[G.includePrerelease?p.GTE0PRE:p.GTE0],"")),F=$=>(G,Y,V,ne,W,K,ae,de,re,_e,be,R)=>(S(V)?Y="":S(ne)?Y=`>=${V}.0.0${$?"-0":""}`:S(W)?Y=`>=${V}.${ne}.0${$?"-0":""}`:K?Y=`>=${Y}`:Y=`>=${Y}${$?"-0":""}`,S(re)?de="":S(_e)?de=`<${+re+1}.0.0-0`:S(be)?de=`<${re}.${+_e+1}.0-0`:R?de=`<=${re}.${_e}.${be}-${R}`:$?de=`<${re}.${_e}.${+be+1}-0`:de=`<=${de}`,`${Y} ${de}`.trim()),U=($,G,Y)=>{for(let V=0;V<$.length;V++)if(!$[V].test(G))return!1;if(G.prerelease.length&&!Y.includePrerelease){for(let V=0;V<$.length;V++)if(f($[V].semver),$[V].semver!==u.ANY&&$[V].semver.prerelease.length>0){const ne=$[V].semver;if(ne.major===G.major&&ne.minor===G.minor&&ne.patch===G.patch)return!0}return!1}return!0};return Jl}var Yl,Zp;function ku(){if(Zp)return Yl;Zp=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(b,w){if(w=r(w),b instanceof t){if(b.loose===!!w.loose)return b;b=b.value}b=b.trim().split(/\s+/).join(" "),f("comparator",b,w),this.options=w,this.loose=!!w.loose,this.parse(b),this.semver===e?this.value="":this.value=this.operator+this.semver.version,f("comp",this)}parse(b){const w=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],I=b.match(w);if(!I)throw new TypeError(`Invalid comparator: ${b}`);this.operator=I[1]!==void 0?I[1]:"",this.operator==="="&&(this.operator=""),I[2]?this.semver=new h(I[2],this.options.loose):this.semver=e}toString(){return this.value}test(b){if(f("Comparator.test",b,this.options.loose),this.semver===e||b===e)return!0;if(typeof b=="string")try{b=new h(b,this.options)}catch{return!1}return u(b,this.operator,this.semver,this.options)}intersects(b,w){if(!(b instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(b.value,w).test(this.value):b.operator===""?b.value===""?!0:new l(this.value,w).test(b.semver):(w=r(w),w.includePrerelease&&(this.value==="<0.0.0-0"||b.value==="<0.0.0-0")||!w.includePrerelease&&(this.value.startsWith("<0.0.0")||b.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&b.operator.startsWith(">")||this.operator.startsWith("<")&&b.operator.startsWith("<")||this.semver.version===b.semver.version&&this.operator.includes("=")&&b.operator.includes("=")||u(this.semver,"<",b.semver,w)&&this.operator.startsWith(">")&&b.operator.startsWith("<")||u(this.semver,">",b.semver,w)&&this.operator.startsWith("<")&&b.operator.startsWith(">")))}}Yl=t;const r=hd,{safeRe:o,t:s}=ks,u=TC,f=Uu,h=Fs,l=on();return Yl}const CC=on(),LC=(e,t,r)=>{try{t=new CC(t,r)}catch{return!1}return t.test(e)};var Sy=LC;on();on();on();on();const PC=on(),BC=(e,t)=>{try{return new PC(e,t).range||"*"}catch{return null}};var NC=BC;const $C=Fs,Ry=ku(),{ANY:MC}=Ry,xC=on(),DC=Sy,Qp=gd,eb=my,jC=vy,UC=Ey,kC=(e,t,r,o)=>{e=new $C(e,o),t=new xC(t,o);let s,u,f,h,l;switch(r){case">":s=Qp,u=jC,f=eb,h=">",l=">=";break;case"<":s=eb,u=UC,f=Qp,h="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(DC(e,t,o))return!1;for(let p=0;p<t.set.length;++p){const b=t.set[p];let w=null,I=null;if(b.forEach(A=>{A.semver===MC&&(A=new Ry(">=0.0.0")),w=w||A,I=I||A,s(A.semver,w.semver,o)?w=A:f(A.semver,I.semver,o)&&(I=A)}),w.operator===h||w.operator===l||(!I.operator||I.operator===h)&&u(e,I.semver))return!1;if(I.operator===l&&f(e,I.semver))return!1}return!0};var FC=kC;const HC=FC,WC=(e,t,r)=>HC(e,t,">",r);var qC=WC;on();on();const pd=ku(),{ANY:jN}=pd;new pd(">=0.0.0-0");new pd(">=0.0.0");const Xl=ks,tb=ju,rb=wy,GC=nC,VC=gd;ku();on();const zC=Sy,KC=NC,JC=qC;var YC={valid:GC,gt:VC,satisfies:zC,validRange:KC,gtr:JC,re:Xl.re,src:Xl.src,tokens:Xl.t,SEMVER_SPEC_VERSION:tb.SEMVER_SPEC_VERSION,RELEASE_TYPES:tb.RELEASE_TYPES,compareIdentifiers:rb.compareIdentifiers,rcompareIdentifiers:rb.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=YC,r=Xi,o=Wt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",w=>(0,t.valid)(w)===null?`Expected SemVer version, got "${w}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",w=>(0,t.validRange)(w)===null?`Expected SemVer range, got "${w}"`:!0);function s(w){return(0,r.is)(w,e.VersionStruct)}e.isValidSemVerVersion=s;function u(w){return(0,r.is)(w,e.VersionRangeStruct)}e.isValidSemVerRange=u;function f(w){(0,o.assertStruct)(w,e.VersionStruct)}e.assertIsSemVerVersion=f;function h(w){(0,o.assertStruct)(w,e.VersionRangeStruct)}e.assertIsSemVerRange=h;function l(w,I){return(0,t.gt)(w,I)}e.gtVersion=l;function p(w,I){return(0,t.gtr)(w,I)}e.gtRange=p;function b(w,I){return(0,t.satisfies)(w,I,{includePrerelease:!0})}e.satisfiesVersionRange=b})(by);(function(e){var t=H.commonjsGlobal&&H.commonjsGlobal.__createBinding||(Object.create?function(o,s,u,f){f===void 0&&(f=u);var h=Object.getOwnPropertyDescriptor(s,u);(!h||("get"in h?!s.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(o,f,h)}:function(o,s,u,f){f===void 0&&(f=u),o[f]=s[u]}),r=H.commonjsGlobal&&H.commonjsGlobal.__exportStar||function(o,s){for(var u in o)u!=="default"&&!Object.prototype.hasOwnProperty.call(s,u)&&t(s,o,u)};Object.defineProperty(e,"__esModule",{value:!0}),r(Wt,e),r(js,e),r(Ze,e),r(xu,e),r(vn,e),r(Po,e),r(fy,e),r(Us,e),r(ly,e),r(cy,e),r(Bo,e),r(dy,e),r(Sn,e),r(hy,e),r(gy,e),r(py,e),r(by,e)})(id);var Fu={},Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.errorValues=Si.errorCodes=void 0;Si.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Si.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeCause=e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=id,r=Si,o=r.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",u={code:o,message:f(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function f(A,x=s){if(h(A)){const v=A.toString();if((0,t.hasProperty)(r.errorValues,v))return r.errorValues[v].message;if(b(A))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return x}e.getMessageFromCode=f;function h(A){return Number.isInteger(A)}e.isValidCode=h;function l(A,{fallbackError:x=u,shouldIncludeStack:v=!0}={}){if(!(0,t.isJsonRpcError)(x))throw new Error("Must provide fallback error with integer number code and string message.");const C=p(A,x);return v||delete C.stack,C}e.serializeError=l;function p(A,x){if(A&&typeof A=="object"&&"serialize"in A&&typeof A.serialize=="function")return A.serialize();if((0,t.isJsonRpcError)(A))return A;const v=w(A);return{...x,data:{cause:v}}}function b(A){return A>=-32099&&A<=-32e3}function w(A){return Array.isArray(A)?A.map(x=>(0,t.isValidJson)(x)?x:(0,t.isObject)(x)?I(x):null):(0,t.isObject)(A)?I(A):(0,t.isValidJson)(A)?A:null}e.serializeCause=w;function I(A){return Object.getOwnPropertyNames(A).reduce((x,v)=>{const C=A[v];return(0,t.isValidJson)(C)&&(x[v]=C),x},{})}})(Fu);var XC=H.commonjsGlobal&&H.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qi,"__esModule",{value:!0});qi.EthereumProviderError=qi.JsonRpcError=void 0;const ZC=id,QC=XC(qc),eL=Fu;class Ay extends Error{constructor(t,r,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a non-empty string.');super(r),this.code=t,o!==void 0&&(this.data=o)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data,(0,ZC.isPlainObject)(this.data)&&(t.data.cause=(0,eL.serializeCause)(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return(0,QC.default)(this.serialize(),nL,2)}}qi.JsonRpcError=Ay;class tL extends Ay{constructor(t,r,o){if(!rL(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,o)}}qi.EthereumProviderError=tL;function rL(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function nL(e,t){if(t!=="[Circular]")return t}var No={};Object.defineProperty(No,"__esModule",{value:!0});No.providerErrors=No.rpcErrors=void 0;const bd=qi,Xt=Si,Ty=Fu;No.rpcErrors={parse:e=>Ur(Xt.errorCodes.rpc.parse,e),invalidRequest:e=>Ur(Xt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ur(Xt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ur(Xt.errorCodes.rpc.methodNotFound,e),internal:e=>Ur(Xt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ur(t,e)},invalidInput:e=>Ur(Xt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ur(Xt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ur(Xt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ur(Xt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ur(Xt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ur(Xt.errorCodes.rpc.limitExceeded,e)};No.providerErrors={userRejectedRequest:e=>gs(Xt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gs(Xt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gs(Xt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gs(Xt.errorCodes.provider.disconnected,e),chainDisconnected:e=>gs(Xt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:o}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new bd.EthereumProviderError(t,r,o)}};function Ur(e,t){const[r,o]=Iy(t);return new bd.JsonRpcError(e,r??(0,Ty.getMessageFromCode)(e),o)}function gs(e,t){const[r,o]=Iy(t);return new bd.EthereumProviderError(e,r??(0,Ty.getMessageFromCode)(e),o)}function Iy(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorCodes=e.providerErrors=e.rpcErrors=e.getMessageFromCode=e.serializeError=e.serializeCause=e.EthereumProviderError=e.JsonRpcError=void 0;var t=qi;Object.defineProperty(e,"JsonRpcError",{enumerable:!0,get:function(){return t.JsonRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});var r=Fu;Object.defineProperty(e,"serializeCause",{enumerable:!0,get:function(){return r.serializeCause}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});var o=No;Object.defineProperty(e,"rpcErrors",{enumerable:!0,get:function(){return o.rpcErrors}}),Object.defineProperty(e,"providerErrors",{enumerable:!0,get:function(){return o.providerErrors}});var s=Si;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(_O);var _d={exports:{}},iL=Oy;function Oy(e,t){if(e&&t)return Oy(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(o){r[o]=e[o]}),r;function r(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];var u=e.apply(this,o),f=o[o.length-1];return typeof u=="function"&&u!==f&&Object.keys(f).forEach(function(h){u[h]=f[h]}),u}}var Cy=iL;_d.exports=Cy(uu);_d.exports.strict=Cy(Ly);uu.proto=uu(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return uu(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Ly(this)},configurable:!0})});function uu(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Ly(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}var yd=_d.exports;const oL=H.getDefaultExportFromCjs(yd);var sL=yd,aL=function(){},uL=function(e){return e.setHeader&&typeof e.abort=="function"},fL=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},Py=function(e,t,r){if(typeof t=="function")return Py(e,null,t);t||(t={}),r=sL(r||aL);var o=e._writableState,s=e._readableState,u=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,h=!1,l=function(){e.writable||p()},p=function(){f=!1,u||r.call(e)},b=function(){u=!1,f||r.call(e)},w=function(C){r.call(e,C?new Error("exited with error code: "+C):null)},I=function(C){r.call(e,C)},A=function(){H.dist.process.nextTick(x)},x=function(){if(!h){if(u&&!(s&&s.ended&&!s.destroyed))return r.call(e,new Error("premature close"));if(f&&!(o&&o.ended&&!o.destroyed))return r.call(e,new Error("premature close"))}},v=function(){e.req.on("finish",p)};return uL(e)?(e.on("complete",p),e.on("abort",A),e.req?v():e.on("request",v)):f&&!o&&(e.on("end",l),e.on("close",l)),fL(e)&&e.on("exit",w),e.on("end",b),e.on("finish",p),t.error!==!1&&e.on("error",I),e.on("close",A),function(){h=!0,e.removeListener("complete",p),e.removeListener("abort",A),e.removeListener("request",v),e.req&&e.req.removeListener("finish",p),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",p),e.removeListener("exit",w),e.removeListener("end",b),e.removeListener("error",I),e.removeListener("close",A)}},By=Py;const nb=H.getDefaultExportFromCjs(By);var lL=yd,cL=By,fu;try{fu=H.require$$3}catch{}var Cs=function(){},dL=/^v?\.0/.test(H.dist.process.version),Hu=function(e){return typeof e=="function"},hL=function(e){return!dL||!fu?!1:(e instanceof(fu.ReadStream||Cs)||e instanceof(fu.WriteStream||Cs))&&Hu(e.close)},gL=function(e){return e.setHeader&&Hu(e.abort)},pL=function(e,t,r,o){o=lL(o);var s=!1;e.on("close",function(){s=!0}),cL(e,{readable:t,writable:r},function(f){if(f)return o(f);s=!0,o()});var u=!1;return function(f){if(!s&&!u){if(u=!0,hL(e))return e.close(Cs);if(gL(e))return e.abort();if(Hu(e.destroy))return e.destroy();o(f||new Error("stream was destroyed"))}}},ib=function(e){e()},bL=function(e,t){return e.pipe(t)},_L=function(){var e=Array.prototype.slice.call(arguments),t=Hu(e[e.length-1]||Cs)&&e.pop()||Cs;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,o=e.map(function(s,u){var f=u<e.length-1,h=u>0;return pL(s,f,h,function(l){r||(r=l),l&&o.forEach(ib),!f&&(o.forEach(ib),t(r))})});return e.reduce(bL)},yL=_L;const ob=H.getDefaultExportFromCjs(yL);var wL={},Wu={},qu={},Ny={},$o={},mi={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.output=Ot.exists=Ot.hash=Ot.bytes=Ot.bool=Ot.number=Ot.isBytes=void 0;function bu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}Ot.number=bu;function $y(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}Ot.bool=$y;function My(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}Ot.isBytes=My;function wd(e,...t){if(!My(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}Ot.bytes=wd;function xy(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");bu(e.outputLen),bu(e.blockLen)}Ot.hash=xy;function Dy(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Ot.exists=Dy;function jy(e,t){wd(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Ot.output=jy;const mL={number:bu,bool:$y,bytes:wd,hash:xy,exists:Dy,output:jy};Ot.default=mL;var Zn={},Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});Gu.crypto=void 0;Gu.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.byteSwap32=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=e.isBytes=void 0;const t=Gu,r=Ot;function o(F){return F instanceof Uint8Array||F!=null&&typeof F=="object"&&F.constructor.name==="Uint8Array"}e.isBytes=o;const s=F=>new Uint8Array(F.buffer,F.byteOffset,F.byteLength);e.u8=s;const u=F=>new Uint32Array(F.buffer,F.byteOffset,Math.floor(F.byteLength/4));e.u32=u;const f=F=>new DataView(F.buffer,F.byteOffset,F.byteLength);e.createView=f;const h=(F,U)=>F<<32-U|F>>>U;e.rotr=h;const l=(F,U)=>F<<U|F>>>32-U>>>0;e.rotl=l,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const p=F=>F<<24&4278190080|F<<8&16711680|F>>>8&65280|F>>>24&255;e.byteSwap=p,e.byteSwapIfBE=e.isLE?F=>F:F=>(0,e.byteSwap)(F);function b(F){for(let U=0;U<F.length;U++)F[U]=(0,e.byteSwap)(F[U])}e.byteSwap32=b;const w=Array.from({length:256},(F,U)=>U.toString(16).padStart(2,"0"));function I(F){(0,r.bytes)(F);let U="";for(let $=0;$<F.length;$++)U+=w[F[$]];return U}e.bytesToHex=I;const A={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function x(F){if(F>=A._0&&F<=A._9)return F-A._0;if(F>=A._A&&F<=A._F)return F-(A._A-10);if(F>=A._a&&F<=A._f)return F-(A._a-10)}function v(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);const U=F.length,$=U/2;if(U%2)throw new Error("padded hex string expected, got unpadded hex of length "+U);const G=new Uint8Array($);for(let Y=0,V=0;Y<$;Y++,V+=2){const ne=x(F.charCodeAt(V)),W=x(F.charCodeAt(V+1));if(ne===void 0||W===void 0){const K=F[V]+F[V+1];throw new Error('hex string expected, got non-hex character "'+K+'" at index '+V)}G[Y]=ne*16+W}return G}e.hexToBytes=v;const C=async()=>{};e.nextTick=C;async function B(F,U,$){let G=Date.now();for(let Y=0;Y<F;Y++){$(Y);const V=Date.now()-G;V>=0&&V<U||(await(0,e.nextTick)(),G+=V)}}e.asyncLoop=B;function P(F){if(typeof F!="string")throw new Error(`utf8ToBytes expected string, got ${typeof F}`);return new Uint8Array(new TextEncoder().encode(F))}e.utf8ToBytes=P;function S(F){return typeof F=="string"&&(F=P(F)),(0,r.bytes)(F),F}e.toBytes=S;function m(...F){let U=0;for(let G=0;G<F.length;G++){const Y=F[G];(0,r.bytes)(Y),U+=Y.length}const $=new Uint8Array(U);for(let G=0,Y=0;G<F.length;G++){const V=F[G];$.set(V,Y),Y+=V.length}return $}e.concatBytes=m;class j{clone(){return this._cloneInto()}}e.Hash=j;const Q={}.toString;function ce(F,U){if(U!==void 0&&Q.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(F,U)}e.checkOpts=ce;function ue(F){const U=G=>F().update(S(G)).digest(),$=F();return U.outputLen=$.outputLen,U.blockLen=$.blockLen,U.create=()=>F(),U}e.wrapConstructor=ue;function te(F){const U=(G,Y)=>F(Y).update(S(G)).digest(),$=F({});return U.outputLen=$.outputLen,U.blockLen=$.blockLen,U.create=G=>F(G),U}e.wrapConstructorWithOpts=te;function Se(F){const U=(G,Y)=>F(Y).update(S(G)).digest(),$=F({});return U.outputLen=$.outputLen,U.blockLen=$.blockLen,U.create=G=>F(G),U}e.wrapXOFConstructorWithOpts=Se;function me(F=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(F));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=me})(Zn);Object.defineProperty(mi,"__esModule",{value:!0});mi.HashMD=mi.Maj=mi.Chi=void 0;const Zl=Ot,ps=Zn;function EL(e,t,r,o){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,o);const s=BigInt(32),u=BigInt(4294967295),f=Number(r>>s&u),h=Number(r&u),l=o?4:0,p=o?0:4;e.setUint32(t+l,f,o),e.setUint32(t+p,h,o)}const vL=(e,t,r)=>e&t^~e&r;mi.Chi=vL;const SL=(e,t,r)=>e&t^e&r^t&r;mi.Maj=SL;class RL extends ps.Hash{constructor(t,r,o,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=o,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,ps.createView)(this.buffer)}update(t){(0,Zl.exists)(this);const{view:r,buffer:o,blockLen:s}=this;t=(0,ps.toBytes)(t);const u=t.length;for(let f=0;f<u;){const h=Math.min(s-this.pos,u-f);if(h===s){const l=(0,ps.createView)(t);for(;s<=u-f;f+=s)this.process(l,f);continue}o.set(t.subarray(f,f+h),this.pos),this.pos+=h,f+=h,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,Zl.exists)(this),(0,Zl.output)(t,this),this.finished=!0;const{buffer:r,view:o,blockLen:s,isLE:u}=this;let{pos:f}=this;r[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>s-f&&(this.process(o,0),f=0);for(let w=f;w<s;w++)r[w]=0;EL(o,s-8,BigInt(this.length*8),u),this.process(o,0);const h=(0,ps.createView)(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=l/4,b=this.get();if(p>b.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w<p;w++)h.setUint32(4*w,b[w],u)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const o=t.slice(0,r);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:o,length:s,finished:u,destroyed:f,pos:h}=this;return t.length=s,t.pos=h,t.finished=u,t.destroyed=f,s%r&&t.buffer.set(o),t}}mi.HashMD=RL;Object.defineProperty($o,"__esModule",{value:!0});$o.sha224=$o.sha256=void 0;const Ql=mi,kr=Zn,AL=new Uint32Array([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]),pi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bi=new Uint32Array(64);class Uy extends Ql.HashMD{constructor(){super(64,32,8,!1),this.A=pi[0]|0,this.B=pi[1]|0,this.C=pi[2]|0,this.D=pi[3]|0,this.E=pi[4]|0,this.F=pi[5]|0,this.G=pi[6]|0,this.H=pi[7]|0}get(){const{A:t,B:r,C:o,D:s,E:u,F:f,G:h,H:l}=this;return[t,r,o,s,u,f,h,l]}set(t,r,o,s,u,f,h,l){this.A=t|0,this.B=r|0,this.C=o|0,this.D=s|0,this.E=u|0,this.F=f|0,this.G=h|0,this.H=l|0}process(t,r){for(let w=0;w<16;w++,r+=4)bi[w]=t.getUint32(r,!1);for(let w=16;w<64;w++){const I=bi[w-15],A=bi[w-2],x=(0,kr.rotr)(I,7)^(0,kr.rotr)(I,18)^I>>>3,v=(0,kr.rotr)(A,17)^(0,kr.rotr)(A,19)^A>>>10;bi[w]=v+bi[w-7]+x+bi[w-16]|0}let{A:o,B:s,C:u,D:f,E:h,F:l,G:p,H:b}=this;for(let w=0;w<64;w++){const I=(0,kr.rotr)(h,6)^(0,kr.rotr)(h,11)^(0,kr.rotr)(h,25),A=b+I+(0,Ql.Chi)(h,l,p)+AL[w]+bi[w]|0,v=((0,kr.rotr)(o,2)^(0,kr.rotr)(o,13)^(0,kr.rotr)(o,22))+(0,Ql.Maj)(o,s,u)|0;b=p,p=l,l=h,h=f+A|0,f=u,u=s,s=o,o=A+v|0}o=o+this.A|0,s=s+this.B|0,u=u+this.C|0,f=f+this.D|0,h=h+this.E|0,l=l+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(o,s,u,f,h,l,p,b)}roundClean(){bi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class TL extends Uy{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}$o.sha256=(0,kr.wrapConstructor)(()=>new Uy);$o.sha224=(0,kr.wrapConstructor)(()=>new TL);var Vu={},ky={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=Ot,r=Zn;class o extends r.Hash{constructor(f,h){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(f);const l=(0,r.toBytes)(h);if(this.iHash=f.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const p=this.blockLen,b=new Uint8Array(p);b.set(l.length>p?f.create().update(l).digest():l);for(let w=0;w<b.length;w++)b[w]^=54;this.iHash.update(b),this.oHash=f.create();for(let w=0;w<b.length;w++)b[w]^=106;this.oHash.update(b),b.fill(0)}update(f){return(0,t.exists)(this),this.iHash.update(f),this}digestInto(f){(0,t.exists)(this),(0,t.bytes)(f,this.outputLen),this.finished=!0,this.iHash.digestInto(f),this.oHash.update(f),this.oHash.digestInto(f),this.destroy()}digest(){const f=new Uint8Array(this.oHash.outputLen);return this.digestInto(f),f}_cloneInto(f){f||(f=Object.create(Object.getPrototypeOf(this),{}));const{oHash:h,iHash:l,finished:p,destroyed:b,blockLen:w,outputLen:I}=this;return f=f,f.finished=p,f.destroyed=b,f.blockLen=w,f.outputLen=I,f.oHash=h._cloneInto(f.oHash),f.iHash=l._cloneInto(f.iHash),f}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=o;const s=(u,f,h)=>new o(u,f).update(h).digest();e.hmac=s,e.hmac.create=(u,f)=>new o(u,f)})(ky);var md={},zu={},pt={},ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.bitMask=void 0;ot.isBytes=Ju;ot.abytes=Yu;ot.bytesToHex=Ed;ot.numberToHexUnpadded=Hy;ot.hexToNumber=vd;ot.hexToBytes=Xu;ot.bytesToNumberBE=CL;ot.bytesToNumberLE=LL;ot.numberToBytesBE=Wy;ot.numberToBytesLE=PL;ot.numberToVarBytesBE=BL;ot.ensureBytes=NL;ot.concatBytes=qy;ot.equalBytes=$L;ot.utf8ToBytes=ML;ot.bitLen=xL;ot.bitGet=DL;ot.bitSet=jL;ot.createHmacDrbg=kL;ot.validateObject=HL;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fy=BigInt(0),Ku=BigInt(1),IL=BigInt(2);function Ju(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Yu(e){if(!Ju(e))throw new Error("Uint8Array expected")}const OL=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ed(e){Yu(e);let t="";for(let r=0;r<e.length;r++)t+=OL[e[r]];return t}function Hy(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function vd(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const Gn={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function sb(e){if(e>=Gn._0&&e<=Gn._9)return e-Gn._0;if(e>=Gn._A&&e<=Gn._F)return e-(Gn._A-10);if(e>=Gn._a&&e<=Gn._f)return e-(Gn._a-10)}function Xu(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const o=new Uint8Array(r);for(let s=0,u=0;s<r;s++,u+=2){const f=sb(e.charCodeAt(u)),h=sb(e.charCodeAt(u+1));if(f===void 0||h===void 0){const l=e[u]+e[u+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+u)}o[s]=f*16+h}return o}function CL(e){return vd(Ed(e))}function LL(e){return Yu(e),vd(Ed(Uint8Array.from(e).reverse()))}function Wy(e,t){return Xu(e.toString(16).padStart(t*2,"0"))}function PL(e,t){return Wy(e,t).reverse()}function BL(e){return Xu(Hy(e))}function NL(e,t,r){let o;if(typeof t=="string")try{o=Xu(t)}catch(u){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${u}`)}else if(Ju(t))o=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=o.length;if(typeof r=="number"&&s!==r)throw new Error(`${e} expected ${r} bytes, got ${s}`);return o}function qy(...e){let t=0;for(let o=0;o<e.length;o++){const s=e[o];Yu(s),t+=s.length}const r=new Uint8Array(t);for(let o=0,s=0;o<e.length;o++){const u=e[o];r.set(u,s),s+=u.length}return r}function $L(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e[o]^t[o];return r===0}function ML(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function xL(e){let t;for(t=0;e>Fy;e>>=Ku,t+=1);return t}function DL(e,t){return e>>BigInt(t)&Ku}function jL(e,t,r){return e|(r?Ku:Fy)<<BigInt(t)}const UL=e=>(IL<<BigInt(e-1))-Ku;ot.bitMask=UL;const ec=e=>new Uint8Array(e),ab=e=>Uint8Array.from(e);function kL(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let o=ec(e),s=ec(e),u=0;const f=()=>{o.fill(1),s.fill(0),u=0},h=(...w)=>r(s,o,...w),l=(w=ec())=>{s=h(ab([0]),w),o=h(),w.length!==0&&(s=h(ab([1]),w),o=h())},p=()=>{if(u++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const I=[];for(;w<t;){o=h();const A=o.slice();I.push(A),w+=o.length}return qy(...I)};return(w,I)=>{f(),l(w);let A;for(;!(A=I(p()));)l();return f(),A}}const FL={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Ju(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function HL(e,t,r={}){const o=(s,u,f)=>{const h=FL[u];if(typeof h!="function")throw new Error(`Invalid validator "${u}", expected function`);const l=e[s];if(!(f&&l===void 0)&&!h(l,e))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${u}`)};for(const[s,u]of Object.entries(t))o(s,u,!1);for(const[s,u]of Object.entries(r))o(s,u,!0);return e}Object.defineProperty(pt,"__esModule",{value:!0});pt.isNegativeLE=void 0;pt.mod=Ar;pt.pow=Gy;pt.pow2=qL;pt.invert=_u;pt.tonelliShanks=Vy;pt.FpSqrt=zy;pt.validateField=zL;pt.FpPow=Ky;pt.FpInvertBatch=Jy;pt.FpDiv=KL;pt.FpIsSquare=JL;pt.nLength=Sd;pt.Field=YL;pt.FpSqrtOdd=XL;pt.FpSqrtEven=ZL;pt.hashToPrivateScalar=QL;pt.getFieldBytesLength=Rd;pt.getMinHashLength=Yy;pt.mapHashToField=eP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tr=ot,Ut=BigInt(0),gt=BigInt(1),wi=BigInt(2),WL=BigInt(3),Pc=BigInt(4),ub=BigInt(5),fb=BigInt(8);BigInt(9);BigInt(16);function Ar(e,t){const r=e%t;return r>=Ut?r:t+r}function Gy(e,t,r){if(r<=Ut||t<Ut)throw new Error("Expected power/modulo > 0");if(r===gt)return Ut;let o=gt;for(;t>Ut;)t&gt&&(o=o*e%r),e=e*e%r,t>>=gt;return o}function qL(e,t,r){let o=e;for(;t-- >Ut;)o*=o,o%=r;return o}function _u(e,t){if(e===Ut||t<=Ut)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Ar(e,t),o=t,s=Ut,u=gt;for(;r!==Ut;){const h=o/r,l=o%r,p=s-u*h;o=r,r=l,s=u,u=p}if(o!==gt)throw new Error("invert: does not exist");return Ar(s,t)}function Vy(e){const t=(e-gt)/wi;let r,o,s;for(r=e-gt,o=0;r%wi===Ut;r/=wi,o++);for(s=wi;s<e&&Gy(s,t,e)!==e-gt;s++);if(o===1){const f=(e+gt)/Pc;return function(l,p){const b=l.pow(p,f);if(!l.eql(l.sqr(b),p))throw new Error("Cannot find square root");return b}}const u=(r+gt)/wi;return function(h,l){if(h.pow(l,t)===h.neg(h.ONE))throw new Error("Cannot find square root");let p=o,b=h.pow(h.mul(h.ONE,s),r),w=h.pow(l,u),I=h.pow(l,r);for(;!h.eql(I,h.ONE);){if(h.eql(I,h.ZERO))return h.ZERO;let A=1;for(let v=h.sqr(I);A<p&&!h.eql(v,h.ONE);A++)v=h.sqr(v);const x=h.pow(b,gt<<BigInt(p-A-1));b=h.sqr(x),w=h.mul(w,x),I=h.mul(I,b),p=A}return w}}function zy(e){if(e%Pc===WL){const t=(e+gt)/Pc;return function(o,s){const u=o.pow(s,t);if(!o.eql(o.sqr(u),s))throw new Error("Cannot find square root");return u}}if(e%fb===ub){const t=(e-ub)/fb;return function(o,s){const u=o.mul(s,wi),f=o.pow(u,t),h=o.mul(s,f),l=o.mul(o.mul(h,wi),f),p=o.mul(h,o.sub(l,o.ONE));if(!o.eql(o.sqr(p),s))throw new Error("Cannot find square root");return p}}return Vy(e)}const GL=(e,t)=>(Ar(e,t)&gt)===gt;pt.isNegativeLE=GL;const VL=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zL(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=VL.reduce((o,s)=>(o[s]="function",o),t);return(0,Tr.validateObject)(e,r)}function Ky(e,t,r){if(r<Ut)throw new Error("Expected power > 0");if(r===Ut)return e.ONE;if(r===gt)return t;let o=e.ONE,s=t;for(;r>Ut;)r&gt&&(o=e.mul(o,s)),s=e.sqr(s),r>>=gt;return o}function Jy(e,t){const r=new Array(t.length),o=t.reduce((u,f,h)=>e.is0(f)?u:(r[h]=u,e.mul(u,f)),e.ONE),s=e.inv(o);return t.reduceRight((u,f,h)=>e.is0(f)?u:(r[h]=e.mul(u,r[h]),e.mul(u,f)),s),r}function KL(e,t,r){return e.mul(t,typeof r=="bigint"?_u(r,e.ORDER):e.inv(r))}function JL(e){const t=(e.ORDER-gt)/wi;return r=>{const o=e.pow(r,t);return e.eql(o,e.ZERO)||e.eql(o,e.ONE)}}function Sd(e,t){const r=t!==void 0?t:e.toString(2).length,o=Math.ceil(r/8);return{nBitLength:r,nByteLength:o}}function YL(e,t,r=!1,o={}){if(e<=Ut)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:u}=Sd(e,t);if(u>2048)throw new Error("Field lengths over 2048 bytes are not supported");const f=zy(e),h=Object.freeze({ORDER:e,BITS:s,BYTES:u,MASK:(0,Tr.bitMask)(s),ZERO:Ut,ONE:gt,create:l=>Ar(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return Ut<=l&&l<e},is0:l=>l===Ut,isOdd:l=>(l&gt)===gt,neg:l=>Ar(-l,e),eql:(l,p)=>l===p,sqr:l=>Ar(l*l,e),add:(l,p)=>Ar(l+p,e),sub:(l,p)=>Ar(l-p,e),mul:(l,p)=>Ar(l*p,e),pow:(l,p)=>Ky(h,l,p),div:(l,p)=>Ar(l*_u(p,e),e),sqrN:l=>l*l,addN:(l,p)=>l+p,subN:(l,p)=>l-p,mulN:(l,p)=>l*p,inv:l=>_u(l,e),sqrt:o.sqrt||(l=>f(h,l)),invertBatch:l=>Jy(h,l),cmov:(l,p,b)=>b?p:l,toBytes:l=>r?(0,Tr.numberToBytesLE)(l,u):(0,Tr.numberToBytesBE)(l,u),fromBytes:l=>{if(l.length!==u)throw new Error(`Fp.fromBytes: expected ${u}, got ${l.length}`);return r?(0,Tr.bytesToNumberLE)(l):(0,Tr.bytesToNumberBE)(l)}});return Object.freeze(h)}function XL(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}function ZL(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function QL(e,t,r=!1){e=(0,Tr.ensureBytes)("privateHash",e);const o=e.length,s=Sd(t).nByteLength+8;if(s<24||o<s||o>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${o}`);const u=r?(0,Tr.bytesToNumberLE)(e):(0,Tr.bytesToNumberBE)(e);return Ar(u,t-gt)+gt}function Rd(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Yy(e){const t=Rd(e);return t+Math.ceil(t/2)}function eP(e,t,r=!1){const o=e.length,s=Rd(t),u=Yy(t);if(o<16||o<u||o>1024)throw new Error(`expected ${u}-1024 bytes of input, got ${o}`);const f=r?(0,Tr.bytesToNumberBE)(e):(0,Tr.bytesToNumberLE)(e),h=Ar(f,t-gt)+gt;return r?(0,Tr.numberToBytesLE)(h,s):(0,Tr.numberToBytesBE)(h,s)}Object.defineProperty(zu,"__esModule",{value:!0});zu.wNAF=nP;zu.validateBasic=iP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const lb=pt,tP=ot,rP=BigInt(0),tc=BigInt(1);function nP(e,t){const r=(s,u)=>{const f=u.negate();return s?f:u},o=s=>{const u=Math.ceil(t/s)+1,f=2**(s-1);return{windows:u,windowSize:f}};return{constTimeNegate:r,unsafeLadder(s,u){let f=e.ZERO,h=s;for(;u>rP;)u&tc&&(f=f.add(h)),h=h.double(),u>>=tc;return f},precomputeWindow(s,u){const{windows:f,windowSize:h}=o(u),l=[];let p=s,b=p;for(let w=0;w<f;w++){b=p,l.push(b);for(let I=1;I<h;I++)b=b.add(p),l.push(b);p=b.double()}return l},wNAF(s,u,f){const{windows:h,windowSize:l}=o(s);let p=e.ZERO,b=e.BASE;const w=BigInt(2**s-1),I=2**s,A=BigInt(s);for(let x=0;x<h;x++){const v=x*l;let C=Number(f&w);f>>=A,C>l&&(C-=I,f+=tc);const B=v,P=v+Math.abs(C)-1,S=x%2!==0,m=C<0;C===0?b=b.add(r(S,u[B])):p=p.add(r(m,u[P]))}return{p,f:b}},wNAFCached(s,u,f,h){const l=s._WINDOW_SIZE||1;let p=u.get(s);return p||(p=this.precomputeWindow(s,l),l!==1&&u.set(s,h(p))),this.wNAF(l,p,f)}}}function iP(e){return(0,lb.validateField)(e.Fp),(0,tP.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,lb.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=A,e.weierstrass=v,e.SWUFpSqrtRatio=C,e.mapToCurveSimpleSWU=B;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=zu,r=pt,o=ot,s=ot;function u(P){const S=(0,t.validateBasic)(P);o.validateObject(S,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:m,Fp:j,a:Q}=S;if(m){if(!j.eql(Q,j.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof m!="object"||typeof m.beta!="bigint"||typeof m.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...S})}const{bytesToNumberBE:f,hexToBytes:h}=o;e.DER={Err:class extends Error{constructor(S=""){super(S)}},_parseInt(P){const{Err:S}=e.DER;if(P.length<2||P[0]!==2)throw new S("Invalid signature integer tag");const m=P[1],j=P.subarray(2,m+2);if(!m||j.length!==m)throw new S("Invalid signature integer: wrong length");if(j[0]&128)throw new S("Invalid signature integer: negative");if(j[0]===0&&!(j[1]&128))throw new S("Invalid signature integer: unnecessary leading zero");return{d:f(j),l:P.subarray(m+2)}},toSig(P){const{Err:S}=e.DER,m=typeof P=="string"?h(P):P;o.abytes(m);let j=m.length;if(j<2||m[0]!=48)throw new S("Invalid signature tag");if(m[1]!==j-2)throw new S("Invalid signature: incorrect length");const{d:Q,l:ce}=e.DER._parseInt(m.subarray(2)),{d:ue,l:te}=e.DER._parseInt(ce);if(te.length)throw new S("Invalid signature: left bytes after parsing");return{r:Q,s:ue}},hexFromSig(P){const S=me=>Number.parseInt(me[0],16)&8?"00"+me:me,m=me=>{const F=me.toString(16);return F.length&1?`0${F}`:F},j=S(m(P.s)),Q=S(m(P.r)),ce=j.length/2,ue=Q.length/2,te=m(ce),Se=m(ue);return`30${m(ue+ce+4)}02${Se}${Q}02${te}${j}`}};const l=BigInt(0),p=BigInt(1),b=BigInt(2),w=BigInt(3),I=BigInt(4);function A(P){const S=u(P),{Fp:m}=S,j=S.toBytes||((Y,V,ne)=>{const W=V.toAffine();return o.concatBytes(Uint8Array.from([4]),m.toBytes(W.x),m.toBytes(W.y))}),Q=S.fromBytes||(Y=>{const V=Y.subarray(1),ne=m.fromBytes(V.subarray(0,m.BYTES)),W=m.fromBytes(V.subarray(m.BYTES,2*m.BYTES));return{x:ne,y:W}});function ce(Y){const{a:V,b:ne}=S,W=m.sqr(Y),K=m.mul(W,Y);return m.add(m.add(K,m.mul(Y,V)),ne)}if(!m.eql(m.sqr(S.Gy),ce(S.Gx)))throw new Error("bad generator point: equation left != right");function ue(Y){return typeof Y=="bigint"&&l<Y&&Y<S.n}function te(Y){if(!ue(Y))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function Se(Y){const{allowedPrivateKeyLengths:V,nByteLength:ne,wrapPrivateKey:W,n:K}=S;if(V&&typeof Y!="bigint"){if(o.isBytes(Y)&&(Y=o.bytesToHex(Y)),typeof Y!="string"||!V.includes(Y.length))throw new Error("Invalid key");Y=Y.padStart(ne*2,"0")}let ae;try{ae=typeof Y=="bigint"?Y:o.bytesToNumberBE((0,s.ensureBytes)("private key",Y,ne))}catch{throw new Error(`private key must be ${ne} bytes, hex or bigint, not ${typeof Y}`)}return W&&(ae=r.mod(ae,K)),te(ae),ae}const me=new Map;function F(Y){if(!(Y instanceof U))throw new Error("ProjectivePoint expected")}class U{constructor(V,ne,W){if(this.px=V,this.py=ne,this.pz=W,V==null||!m.isValid(V))throw new Error("x required");if(ne==null||!m.isValid(ne))throw new Error("y required");if(W==null||!m.isValid(W))throw new Error("z required")}static fromAffine(V){const{x:ne,y:W}=V||{};if(!V||!m.isValid(ne)||!m.isValid(W))throw new Error("invalid affine point");if(V instanceof U)throw new Error("projective point not allowed");const K=ae=>m.eql(ae,m.ZERO);return K(ne)&&K(W)?U.ZERO:new U(ne,W,m.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(V){const ne=m.invertBatch(V.map(W=>W.pz));return V.map((W,K)=>W.toAffine(ne[K])).map(U.fromAffine)}static fromHex(V){const ne=U.fromAffine(Q((0,s.ensureBytes)("pointHex",V)));return ne.assertValidity(),ne}static fromPrivateKey(V){return U.BASE.multiply(Se(V))}_setWindowSize(V){this._WINDOW_SIZE=V,me.delete(this)}assertValidity(){if(this.is0()){if(S.allowInfinityPoint&&!m.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:V,y:ne}=this.toAffine();if(!m.isValid(V)||!m.isValid(ne))throw new Error("bad point: x or y not FE");const W=m.sqr(ne),K=ce(V);if(!m.eql(W,K))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:V}=this.toAffine();if(m.isOdd)return!m.isOdd(V);throw new Error("Field doesn't support isOdd")}equals(V){F(V);const{px:ne,py:W,pz:K}=this,{px:ae,py:de,pz:re}=V,_e=m.eql(m.mul(ne,re),m.mul(ae,K)),be=m.eql(m.mul(W,re),m.mul(de,K));return _e&&be}negate(){return new U(this.px,m.neg(this.py),this.pz)}double(){const{a:V,b:ne}=S,W=m.mul(ne,w),{px:K,py:ae,pz:de}=this;let re=m.ZERO,_e=m.ZERO,be=m.ZERO,R=m.mul(K,K),O=m.mul(ae,ae),q=m.mul(de,de),oe=m.mul(K,ae);return oe=m.add(oe,oe),be=m.mul(K,de),be=m.add(be,be),re=m.mul(V,be),_e=m.mul(W,q),_e=m.add(re,_e),re=m.sub(O,_e),_e=m.add(O,_e),_e=m.mul(re,_e),re=m.mul(oe,re),be=m.mul(W,be),q=m.mul(V,q),oe=m.sub(R,q),oe=m.mul(V,oe),oe=m.add(oe,be),be=m.add(R,R),R=m.add(be,R),R=m.add(R,q),R=m.mul(R,oe),_e=m.add(_e,R),q=m.mul(ae,de),q=m.add(q,q),R=m.mul(q,oe),re=m.sub(re,R),be=m.mul(q,O),be=m.add(be,be),be=m.add(be,be),new U(re,_e,be)}add(V){F(V);const{px:ne,py:W,pz:K}=this,{px:ae,py:de,pz:re}=V;let _e=m.ZERO,be=m.ZERO,R=m.ZERO;const O=S.a,q=m.mul(S.b,w);let oe=m.mul(ne,ae),ye=m.mul(W,de),d=m.mul(K,re),g=m.add(ne,W),_=m.add(ae,de);g=m.mul(g,_),_=m.add(oe,ye),g=m.sub(g,_),_=m.add(ne,K);let E=m.add(ae,re);return _=m.mul(_,E),E=m.add(oe,d),_=m.sub(_,E),E=m.add(W,K),_e=m.add(de,re),E=m.mul(E,_e),_e=m.add(ye,d),E=m.sub(E,_e),R=m.mul(O,_),_e=m.mul(q,d),R=m.add(_e,R),_e=m.sub(ye,R),R=m.add(ye,R),be=m.mul(_e,R),ye=m.add(oe,oe),ye=m.add(ye,oe),d=m.mul(O,d),_=m.mul(q,_),ye=m.add(ye,d),d=m.sub(oe,d),d=m.mul(O,d),_=m.add(_,d),oe=m.mul(ye,_),be=m.add(be,oe),oe=m.mul(E,_),_e=m.mul(g,_e),_e=m.sub(_e,oe),oe=m.mul(g,ye),R=m.mul(E,R),R=m.add(R,oe),new U(_e,be,R)}subtract(V){return this.add(V.negate())}is0(){return this.equals(U.ZERO)}wNAF(V){return G.wNAFCached(this,me,V,ne=>{const W=m.invertBatch(ne.map(K=>K.pz));return ne.map((K,ae)=>K.toAffine(W[ae])).map(U.fromAffine)})}multiplyUnsafe(V){const ne=U.ZERO;if(V===l)return ne;if(te(V),V===p)return this;const{endo:W}=S;if(!W)return G.unsafeLadder(this,V);let{k1neg:K,k1:ae,k2neg:de,k2:re}=W.splitScalar(V),_e=ne,be=ne,R=this;for(;ae>l||re>l;)ae&p&&(_e=_e.add(R)),re&p&&(be=be.add(R)),R=R.double(),ae>>=p,re>>=p;return K&&(_e=_e.negate()),de&&(be=be.negate()),be=new U(m.mul(be.px,W.beta),be.py,be.pz),_e.add(be)}multiply(V){te(V);let ne=V,W,K;const{endo:ae}=S;if(ae){const{k1neg:de,k1:re,k2neg:_e,k2:be}=ae.splitScalar(ne);let{p:R,f:O}=this.wNAF(re),{p:q,f:oe}=this.wNAF(be);R=G.constTimeNegate(de,R),q=G.constTimeNegate(_e,q),q=new U(m.mul(q.px,ae.beta),q.py,q.pz),W=R.add(q),K=O.add(oe)}else{const{p:de,f:re}=this.wNAF(ne);W=de,K=re}return U.normalizeZ([W,K])[0]}multiplyAndAddUnsafe(V,ne,W){const K=U.BASE,ae=(re,_e)=>_e===l||_e===p||!re.equals(K)?re.multiplyUnsafe(_e):re.multiply(_e),de=ae(this,ne).add(ae(V,W));return de.is0()?void 0:de}toAffine(V){const{px:ne,py:W,pz:K}=this,ae=this.is0();V==null&&(V=ae?m.ONE:m.inv(K));const de=m.mul(ne,V),re=m.mul(W,V),_e=m.mul(K,V);if(ae)return{x:m.ZERO,y:m.ZERO};if(!m.eql(_e,m.ONE))throw new Error("invZ was invalid");return{x:de,y:re}}isTorsionFree(){const{h:V,isTorsionFree:ne}=S;if(V===p)return!0;if(ne)return ne(U,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:V,clearCofactor:ne}=S;return V===p?this:ne?ne(U,this):this.multiplyUnsafe(S.h)}toRawBytes(V=!0){return this.assertValidity(),j(U,this,V)}toHex(V=!0){return o.bytesToHex(this.toRawBytes(V))}}U.BASE=new U(S.Gx,S.Gy,m.ONE),U.ZERO=new U(m.ZERO,m.ONE,m.ZERO);const $=S.nBitLength,G=(0,t.wNAF)(U,S.endo?Math.ceil($/2):$);return{CURVE:S,ProjectivePoint:U,normPrivateKeyToScalar:Se,weierstrassEquation:ce,isWithinCurveOrder:ue}}function x(P){const S=(0,t.validateBasic)(P);return o.validateObject(S,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...S})}function v(P){const S=x(P),{Fp:m,n:j}=S,Q=m.BYTES+1,ce=2*m.BYTES+1;function ue(_){return l<_&&_<m.ORDER}function te(_){return r.mod(_,j)}function Se(_){return r.invert(_,j)}const{ProjectivePoint:me,normPrivateKeyToScalar:F,weierstrassEquation:U,isWithinCurveOrder:$}=A({...S,toBytes(_,E,J){const ie=E.toAffine(),se=m.toBytes(ie.x),Ie=o.concatBytes;return J?Ie(Uint8Array.from([E.hasEvenY()?2:3]),se):Ie(Uint8Array.from([4]),se,m.toBytes(ie.y))},fromBytes(_){const E=_.length,J=_[0],ie=_.subarray(1);if(E===Q&&(J===2||J===3)){const se=o.bytesToNumberBE(ie);if(!ue(se))throw new Error("Point is not on curve");const Ie=U(se);let Be;try{Be=m.sqrt(Ie)}catch(Re){const He=Re instanceof Error?": "+Re.message:"";throw new Error("Point is not on curve"+He)}const Ce=(Be&p)===p;return(J&1)===1!==Ce&&(Be=m.neg(Be)),{x:se,y:Be}}else if(E===ce&&J===4){const se=m.fromBytes(ie.subarray(0,m.BYTES)),Ie=m.fromBytes(ie.subarray(m.BYTES,2*m.BYTES));return{x:se,y:Ie}}else throw new Error(`Point of length ${E} was invalid. Expected ${Q} compressed bytes or ${ce} uncompressed bytes`)}}),G=_=>o.bytesToHex(o.numberToBytesBE(_,S.nByteLength));function Y(_){const E=j>>p;return _>E}function V(_){return Y(_)?te(-_):_}const ne=(_,E,J)=>o.bytesToNumberBE(_.slice(E,J));class W{constructor(E,J,ie){this.r=E,this.s=J,this.recovery=ie,this.assertValidity()}static fromCompact(E){const J=S.nByteLength;return E=(0,s.ensureBytes)("compactSignature",E,J*2),new W(ne(E,0,J),ne(E,J,2*J))}static fromDER(E){const{r:J,s:ie}=e.DER.toSig((0,s.ensureBytes)("DER",E));return new W(J,ie)}assertValidity(){if(!$(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!$(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new W(this.r,this.s,E)}recoverPublicKey(E){const{r:J,s:ie,recovery:se}=this,Ie=be((0,s.ensureBytes)("msgHash",E));if(se==null||![0,1,2,3].includes(se))throw new Error("recovery id invalid");const Be=se===2||se===3?J+S.n:J;if(Be>=m.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ce=se&1?"03":"02",Ue=me.fromHex(Ce+G(Be)),Re=Se(Be),He=te(-Ie*Re),bt=te(ie*Re),et=me.BASE.multiplyAndAddUnsafe(Ue,He,bt);if(!et)throw new Error("point at infinify");return et.assertValidity(),et}hasHighS(){return Y(this.s)}normalizeS(){return this.hasHighS()?new W(this.r,te(-this.s),this.recovery):this}toDERRawBytes(){return o.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return o.hexToBytes(this.toCompactHex())}toCompactHex(){return G(this.r)+G(this.s)}}const K={isValidPrivateKey(_){try{return F(_),!0}catch{return!1}},normPrivateKeyToScalar:F,randomPrivateKey:()=>{const _=r.getMinHashLength(S.n);return r.mapHashToField(S.randomBytes(_),S.n)},precompute(_=8,E=me.BASE){return E._setWindowSize(_),E.multiply(BigInt(3)),E}};function ae(_,E=!0){return me.fromPrivateKey(_).toRawBytes(E)}function de(_){const E=o.isBytes(_),J=typeof _=="string",ie=(E||J)&&_.length;return E?ie===Q||ie===ce:J?ie===2*Q||ie===2*ce:_ instanceof me}function re(_,E,J=!0){if(de(_))throw new Error("first arg must be private key");if(!de(E))throw new Error("second arg must be public key");return me.fromHex(E).multiply(F(_)).toRawBytes(J)}const _e=S.bits2int||function(_){const E=o.bytesToNumberBE(_),J=_.length*8-S.nBitLength;return J>0?E>>BigInt(J):E},be=S.bits2int_modN||function(_){return te(_e(_))},R=o.bitMask(S.nBitLength);function O(_){if(typeof _!="bigint")throw new Error("bigint expected");if(!(l<=_&&_<R))throw new Error(`bigint expected < 2^${S.nBitLength}`);return o.numberToBytesBE(_,S.nByteLength)}function q(_,E,J=oe){if(["recovered","canonical"].some(Ye=>Ye in J))throw new Error("sign() legacy options not supported");const{hash:ie,randomBytes:se}=S;let{lowS:Ie,prehash:Be,extraEntropy:Ce}=J;Ie==null&&(Ie=!0),_=(0,s.ensureBytes)("msgHash",_),Be&&(_=(0,s.ensureBytes)("prehashed msgHash",ie(_)));const Ue=be(_),Re=F(E),He=[O(Re),O(Ue)];if(Ce!=null&&Ce!==!1){const Ye=Ce===!0?se(m.BYTES):Ce;He.push((0,s.ensureBytes)("extraEntropy",Ye))}const bt=o.concatBytes(...He),et=Ue;function _t(Ye){const Ve=_e(Ye);if(!$(Ve))return;const Dt=Se(Ve),Lt=me.BASE.multiply(Ve).toAffine(),at=te(Lt.x);if(at===l)return;const Bt=te(Dt*te(et+at*Re));if(Bt===l)return;let fr=(Lt.x===at?0:2)|Number(Lt.y&p),er=Bt;return Ie&&Y(Bt)&&(er=V(Bt),fr^=1),new W(at,er,fr)}return{seed:bt,k2sig:_t}}const oe={lowS:S.lowS,prehash:!1},ye={lowS:S.lowS,prehash:!1};function d(_,E,J=oe){const{seed:ie,k2sig:se}=q(_,E,J),Ie=S;return o.createHmacDrbg(Ie.hash.outputLen,Ie.nByteLength,Ie.hmac)(ie,se)}me.BASE._setWindowSize(8);function g(_,E,J,ie=ye){var Lt;const se=_;if(E=(0,s.ensureBytes)("msgHash",E),J=(0,s.ensureBytes)("publicKey",J),"strict"in ie)throw new Error("options.strict was renamed to lowS");const{lowS:Ie,prehash:Be}=ie;let Ce,Ue;try{if(typeof se=="string"||o.isBytes(se))try{Ce=W.fromDER(se)}catch(at){if(!(at instanceof e.DER.Err))throw at;Ce=W.fromCompact(se)}else if(typeof se=="object"&&typeof se.r=="bigint"&&typeof se.s=="bigint"){const{r:at,s:Bt}=se;Ce=new W(at,Bt)}else throw new Error("PARSE");Ue=me.fromHex(J)}catch(at){if(at.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ie&&Ce.hasHighS())return!1;Be&&(E=S.hash(E));const{r:Re,s:He}=Ce,bt=be(E),et=Se(He),_t=te(bt*et),Ye=te(Re*et),Ve=(Lt=me.BASE.multiplyAndAddUnsafe(Ue,_t,Ye))==null?void 0:Lt.toAffine();return Ve?te(Ve.x)===Re:!1}return{CURVE:S,getPublicKey:ae,getSharedSecret:re,sign:d,verify:g,ProjectivePoint:me,Signature:W,utils:K}}function C(P,S){const m=P.ORDER;let j=l;for(let Y=m-p;Y%b===l;Y/=b)j+=p;const Q=j,ce=b<<Q-p-p,ue=ce*b,te=(m-p)/ue,Se=(te-p)/b,me=ue-p,F=ce,U=P.pow(S,te),$=P.pow(S,(te+p)/b);let G=(Y,V)=>{let ne=U,W=P.pow(V,me),K=P.sqr(W);K=P.mul(K,V);let ae=P.mul(Y,K);ae=P.pow(ae,Se),ae=P.mul(ae,W),W=P.mul(ae,V),K=P.mul(ae,Y);let de=P.mul(K,W);ae=P.pow(de,F);let re=P.eql(ae,P.ONE);W=P.mul(K,$),ae=P.mul(de,ne),K=P.cmov(W,K,re),de=P.cmov(ae,de,re);for(let _e=Q;_e>p;_e--){let be=_e-b;be=b<<be-p;let R=P.pow(de,be);const O=P.eql(R,P.ONE);W=P.mul(K,ne),ne=P.mul(ne,ne),R=P.mul(de,ne),K=P.cmov(W,K,O),de=P.cmov(R,de,O)}return{isValid:re,value:K}};if(P.ORDER%I===w){const Y=(P.ORDER-w)/I,V=P.sqrt(P.neg(S));G=(ne,W)=>{let K=P.sqr(W);const ae=P.mul(ne,W);K=P.mul(K,ae);let de=P.pow(K,Y);de=P.mul(de,ae);const re=P.mul(de,V),_e=P.mul(P.sqr(de),W),be=P.eql(_e,ne);let R=P.cmov(re,de,be);return{isValid:be,value:R}}}return G}function B(P,S){if(r.validateField(P),!P.isValid(S.A)||!P.isValid(S.B)||!P.isValid(S.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const m=C(P,S.Z);if(!P.isOdd)throw new Error("Fp.isOdd is not implemented!");return j=>{let Q,ce,ue,te,Se,me,F,U;Q=P.sqr(j),Q=P.mul(Q,S.Z),ce=P.sqr(Q),ce=P.add(ce,Q),ue=P.add(ce,P.ONE),ue=P.mul(ue,S.B),te=P.cmov(S.Z,P.neg(ce),!P.eql(ce,P.ZERO)),te=P.mul(te,S.A),ce=P.sqr(ue),me=P.sqr(te),Se=P.mul(me,S.A),ce=P.add(ce,Se),ce=P.mul(ce,ue),me=P.mul(me,te),Se=P.mul(me,S.B),ce=P.add(ce,Se),F=P.mul(Q,ue);const{isValid:$,value:G}=m(ce,me);U=P.mul(Q,j),U=P.mul(U,G),F=P.cmov(F,ue,$),U=P.cmov(U,G,$);const Y=P.isOdd(j)===P.isOdd(U);return U=P.cmov(P.neg(U),U,Y),F=P.div(F,te),{x:F,y:U}}}})(md);Object.defineProperty(Vu,"__esModule",{value:!0});Vu.getHash=Xy;Vu.createCurve=aP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oP=ky,cb=Zn,sP=md;function Xy(e){return{hash:e,hmac:(t,...r)=>(0,oP.hmac)(e,t,(0,cb.concatBytes)(...r)),randomBytes:cb.randomBytes}}function aP(e,t){const r=o=>(0,sP.weierstrass)({...e,...Xy(o)});return Object.freeze({...r(t),create:r})}var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.expand_message_xmd=Zy;Zi.expand_message_xof=Qy;Zi.hash_to_field=Bc;Zi.isogenyMap=cP;Zi.createHasher=dP;const uP=pt,Zt=ot,fP=Zt.bytesToNumberBE;function yi(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let o=t-1;o>=0;o--)r[o]=e&255,e>>>=8;return new Uint8Array(r)}function lP(e,t){const r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e[o]^t[o];return r}function Ad(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Zy(e,t,r,o){(0,Zt.abytes)(e),(0,Zt.abytes)(t),Ad(r),t.length>255&&(t=o((0,Zt.concatBytes)((0,Zt.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:u}=o,f=Math.ceil(r/s);if(f>255)throw new Error("Invalid xmd length");const h=(0,Zt.concatBytes)(t,yi(t.length,1)),l=yi(0,u),p=yi(r,2),b=new Array(f),w=o((0,Zt.concatBytes)(l,e,p,yi(0,1),h));b[0]=o((0,Zt.concatBytes)(w,yi(1,1),h));for(let A=1;A<=f;A++){const x=[lP(w,b[A-1]),yi(A+1,1),h];b[A]=o((0,Zt.concatBytes)(...x))}return(0,Zt.concatBytes)(...b).slice(0,r)}function Qy(e,t,r,o,s){if((0,Zt.abytes)(e),(0,Zt.abytes)(t),Ad(r),t.length>255){const u=Math.ceil(2*o/8);t=s.create({dkLen:u}).update((0,Zt.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:r}).update(e).update(yi(r,2)).update(t).update(yi(t.length,1)).digest()}function Bc(e,t,r){(0,Zt.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:o,k:s,m:u,hash:f,expand:h,DST:l}=r;(0,Zt.abytes)(e),Ad(t);const p=typeof l=="string"?(0,Zt.utf8ToBytes)(l):l,b=o.toString(2).length,w=Math.ceil((b+s)/8),I=t*u*w;let A;if(h==="xmd")A=Zy(e,p,I,f);else if(h==="xof")A=Qy(e,p,I,s,f);else if(h==="_internal_pass")A=e;else throw new Error('expand must be "xmd" or "xof"');const x=new Array(t);for(let v=0;v<t;v++){const C=new Array(u);for(let B=0;B<u;B++){const P=w*(B+v*u),S=A.subarray(P,P+w);C[B]=(0,uP.mod)(fP(S),o)}x[v]=C}return x}function cP(e,t){const r=t.map(o=>Array.from(o).reverse());return(o,s)=>{const[u,f,h,l]=r.map(p=>p.reduce((b,w)=>e.add(e.mul(b,o),w)));return o=e.div(u,f),s=e.mul(s,e.div(h,l)),{x:o,y:s}}}function dP(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(o,s){const u=Bc(o,2,{...r,DST:r.DST,...s}),f=e.fromAffine(t(u[0])),h=e.fromAffine(t(u[1])),l=f.add(h).clearCofactor();return l.assertValidity(),l},encodeToCurve(o,s){const u=Bc(o,1,{...r,DST:r.encodeDST,...s}),f=e.fromAffine(t(u[0])).clearCofactor();return f.assertValidity(),f},mapToCurve(o){if(!Array.isArray(o))throw new Error("mapToCurve: expected array of bigints");for(const u of o)if(typeof u!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${u} in array`);const s=e.fromAffine(t(o)).clearCofactor();return s.assertValidity(),s}}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=$o,r=Zn,o=Vu,s=Zi,u=pt,f=ot,h=md,l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),p=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),b=BigInt(1),w=BigInt(2),I=(W,K)=>(W+K/w)/K;function A(W){const K=l,ae=BigInt(3),de=BigInt(6),re=BigInt(11),_e=BigInt(22),be=BigInt(23),R=BigInt(44),O=BigInt(88),q=W*W*W%K,oe=q*q*W%K,ye=(0,u.pow2)(oe,ae,K)*oe%K,d=(0,u.pow2)(ye,ae,K)*oe%K,g=(0,u.pow2)(d,w,K)*q%K,_=(0,u.pow2)(g,re,K)*g%K,E=(0,u.pow2)(_,_e,K)*_%K,J=(0,u.pow2)(E,R,K)*E%K,ie=(0,u.pow2)(J,O,K)*J%K,se=(0,u.pow2)(ie,R,K)*E%K,Ie=(0,u.pow2)(se,ae,K)*oe%K,Be=(0,u.pow2)(Ie,be,K)*_%K,Ce=(0,u.pow2)(Be,de,K)*q%K,Ue=(0,u.pow2)(Ce,w,K);if(!x.eql(x.sqr(Ue),W))throw new Error("Cannot find square root");return Ue}const x=(0,u.Field)(l,void 0,void 0,{sqrt:A});e.secp256k1=(0,o.createCurve)({a:BigInt(0),b:BigInt(7),Fp:x,n:p,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:W=>{const K=p,ae=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),de=-b*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),re=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),_e=ae,be=BigInt("0x100000000000000000000000000000000"),R=I(_e*W,K),O=I(-de*W,K);let q=(0,u.mod)(W-R*ae-O*re,K),oe=(0,u.mod)(-R*de-O*_e,K);const ye=q>be,d=oe>be;if(ye&&(q=K-q),d&&(oe=K-oe),q>be||oe>be)throw new Error("splitScalar: Endomorphism failed, k="+W);return{k1neg:ye,k1:q,k2neg:d,k2:oe}}}},t.sha256);const v=BigInt(0),C=W=>typeof W=="bigint"&&v<W&&W<l,B=W=>typeof W=="bigint"&&v<W&&W<p,P={};function S(W,...K){let ae=P[W];if(ae===void 0){const de=(0,t.sha256)(Uint8Array.from(W,re=>re.charCodeAt(0)));ae=(0,f.concatBytes)(de,de),P[W]=ae}return(0,t.sha256)((0,f.concatBytes)(ae,...K))}const m=W=>W.toRawBytes(!0).slice(1),j=W=>(0,f.numberToBytesBE)(W,32),Q=W=>(0,u.mod)(W,l),ce=W=>(0,u.mod)(W,p),ue=e.secp256k1.ProjectivePoint,te=(W,K,ae)=>ue.BASE.multiplyAndAddUnsafe(W,K,ae);function Se(W){let K=e.secp256k1.utils.normPrivateKeyToScalar(W),ae=ue.fromPrivateKey(K);return{scalar:ae.hasEvenY()?K:ce(-K),bytes:m(ae)}}function me(W){if(!C(W))throw new Error("bad x: need 0 < x < p");const K=Q(W*W),ae=Q(K*W+BigInt(7));let de=A(ae);de%w!==v&&(de=Q(-de));const re=new ue(W,de,b);return re.assertValidity(),re}function F(...W){return ce((0,f.bytesToNumberBE)(S("BIP0340/challenge",...W)))}function U(W){return Se(W).bytes}function $(W,K,ae=(0,r.randomBytes)(32)){const de=(0,f.ensureBytes)("message",W),{bytes:re,scalar:_e}=Se(K),be=(0,f.ensureBytes)("auxRand",ae,32),R=j(_e^(0,f.bytesToNumberBE)(S("BIP0340/aux",be))),O=S("BIP0340/nonce",R,re,de),q=ce((0,f.bytesToNumberBE)(O));if(q===v)throw new Error("sign failed: k is zero");const{bytes:oe,scalar:ye}=Se(q),d=F(oe,re,de),g=new Uint8Array(64);if(g.set(oe,0),g.set(j(ce(ye+d*_e)),32),!G(g,de,re))throw new Error("sign: Invalid signature produced");return g}function G(W,K,ae){const de=(0,f.ensureBytes)("signature",W,64),re=(0,f.ensureBytes)("message",K),_e=(0,f.ensureBytes)("publicKey",ae,32);try{const be=me((0,f.bytesToNumberBE)(_e)),R=(0,f.bytesToNumberBE)(de.subarray(0,32));if(!C(R))return!1;const O=(0,f.bytesToNumberBE)(de.subarray(32,64));if(!B(O))return!1;const q=F(j(R),m(be),re),oe=te(be,O,ce(-q));return!(!oe||!oe.hasEvenY()||oe.toAffine().x!==R)}catch{return!1}}e.schnorr={getPublicKey:U,sign:$,verify:G,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:me,pointToBytes:m,numberToBytesBE:f.numberToBytesBE,bytesToNumberBE:f.bytesToNumberBE,taggedHash:S,mod:u.mod}};const Y=(0,s.isogenyMap)(x,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(W=>W.map(K=>BigInt(K)))),V=(0,h.mapToCurveSimpleSWU)(x,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:x.create(BigInt("-11"))}),ne=(0,s.createHasher)(e.secp256k1.ProjectivePoint,W=>{const{x:K,y:ae}=V(x.create(W[0]));return Y(K,ae)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:x.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=ne.hashToCurve,e.encodeToCurve=ne.encodeToCurve})(Ny);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=Ny;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(qu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=H.bufferPolyfill,r=qu;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16})(Wu);var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});Zu.GWEI_TO_WEI=void 0;Zu.GWEI_TO_WEI=BigInt(1e9);var Td={},Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RLP=Rn.utils=Rn.decode=Rn.encode=void 0;function Id(e){if(Array.isArray(e)){const r=[];let o=0;for(let s=0;s<e.length;s++){const u=Id(e[s]);r.push(u),o+=u.length}return $c(hb(o,192),...r)}const t=o0(e);return t.length===1&&t[0]<128?t:$c(hb(t.length,128),t)}Rn.encode=Id;function mo(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function db(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return r0(t0(e))}function hb(e,t){if(e<56)return Uint8Array.from([e+t]);const r=Mc(e),o=r.length/2,s=Mc(t+55+o);return Uint8Array.from(yu(s+r))}function e0(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const r=o0(e),o=Nc(r);if(t)return o;if(o.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return o.data}Rn.decode=e0;function Nc(e){let t,r,o,s,u;const f=[],h=e[0];if(h<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(h<=183){if(t=h-127,h===128?o=Uint8Array.from([]):o=mo(e,1,t),t===2&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}else if(h<=191){if(r=h-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=db(mo(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=mo(e,r,t+r),{data:o,remainder:e.slice(t+r)}}else if(h<=247){for(t=h-191,s=mo(e,1,t);s.length;)u=Nc(s),f.push(u.data),s=u.remainder;return{data:f,remainder:e.slice(t)}}else{if(r=h-246,t=db(mo(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const l=r+t;if(l>e.length)throw new Error("invalid RLP: total length is larger than the data");for(s=mo(e,r,l);s.length;)u=Nc(s),f.push(u.data),s=u.remainder;return{data:f,remainder:e.slice(l)}}}const hP=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function t0(e){let t="";for(let r=0;r<e.length;r++)t+=hP[e[r]];return t}function r0(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function yu(e){if(typeof e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const o=r*2;t[r]=r0(e.slice(o,o+2))}return t}function $c(...e){if(e.length===1)return e[0];const t=e.reduce((o,s)=>o+s.length,0),r=new Uint8Array(t);for(let o=0,s=0;o<e.length;o++){const u=e[o];r.set(u,s),s+=u.length}return r}function n0(e){return new TextEncoder().encode(e)}function Mc(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function gP(e){return e.length%2?`0${e}`:e}function i0(e){return e.length>=2&&e[0]==="0"&&e[1]==="x"}function pP(e){return typeof e!="string"?e:i0(e)?e.slice(2):e}function o0(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return i0(e)?yu(gP(pP(e))):n0(e);if(typeof e=="number"||typeof e=="bigint")return e?yu(Mc(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}Rn.utils={bytesToHex:t0,concatBytes:$c,hexToBytes:yu,utf8ToBytes:n0};Rn.RLP={encode:Id,decode:e0};var rn={},dt={},je={};Object.defineProperty(je,"__esModule",{value:!0});je.add5L=je.add5H=je.add4H=je.add4L=je.add3H=je.add3L=je.add=je.rotlBL=je.rotlBH=je.rotlSL=je.rotlSH=je.rotr32L=je.rotr32H=je.rotrBL=je.rotrBH=je.rotrSL=je.rotrSH=je.shrSL=je.shrSH=je.toBig=je.split=je.fromBig=void 0;const tu=BigInt(2**32-1),xc=BigInt(32);function Od(e,t=!1){return t?{h:Number(e&tu),l:Number(e>>xc&tu)}:{h:Number(e>>xc&tu)|0,l:Number(e&tu)|0}}je.fromBig=Od;function s0(e,t=!1){let r=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:u,l:f}=Od(e[s],t);[r[s],o[s]]=[u,f]}return[r,o]}je.split=s0;const a0=(e,t)=>BigInt(e>>>0)<<xc|BigInt(t>>>0);je.toBig=a0;const u0=(e,t,r)=>e>>>r;je.shrSH=u0;const f0=(e,t,r)=>e<<32-r|t>>>r;je.shrSL=f0;const l0=(e,t,r)=>e>>>r|t<<32-r;je.rotrSH=l0;const c0=(e,t,r)=>e<<32-r|t>>>r;je.rotrSL=c0;const d0=(e,t,r)=>e<<64-r|t>>>r-32;je.rotrBH=d0;const h0=(e,t,r)=>e>>>r-32|t<<64-r;je.rotrBL=h0;const g0=(e,t)=>t;je.rotr32H=g0;const p0=(e,t)=>e;je.rotr32L=p0;const b0=(e,t,r)=>e<<r|t>>>32-r;je.rotlSH=b0;const _0=(e,t,r)=>t<<r|e>>>32-r;je.rotlSL=_0;const y0=(e,t,r)=>t<<r-32|e>>>64-r;je.rotlBH=y0;const w0=(e,t,r)=>e<<r-32|t>>>64-r;je.rotlBL=w0;function m0(e,t,r,o){const s=(t>>>0)+(o>>>0);return{h:e+r+(s/2**32|0)|0,l:s|0}}je.add=m0;const E0=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);je.add3L=E0;const v0=(e,t,r,o)=>t+r+o+(e/2**32|0)|0;je.add3H=v0;const S0=(e,t,r,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0);je.add4L=S0;const R0=(e,t,r,o,s)=>t+r+o+s+(e/2**32|0)|0;je.add4H=R0;const A0=(e,t,r,o,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0)+(s>>>0);je.add5L=A0;const T0=(e,t,r,o,s,u)=>t+r+o+s+u+(e/2**32|0)|0;je.add5H=T0;const bP={fromBig:Od,split:s0,toBig:a0,shrSH:u0,shrSL:f0,rotrSH:l0,rotrSL:c0,rotrBH:d0,rotrBL:h0,rotr32H:g0,rotr32L:p0,rotlSH:b0,rotlSL:_0,rotlBH:y0,rotlBL:w0,add:m0,add3L:E0,add3H:v0,add4L:S0,add4H:R0,add5H:T0,add5L:A0};je.default=bP;Object.defineProperty(dt,"__esModule",{value:!0});dt.shake256=dt.shake128=dt.keccak_512=dt.keccak_384=dt.keccak_256=dt.keccak_224=dt.sha3_512=dt.sha3_384=dt.sha3_256=dt.sha3_224=dt.Keccak=dt.keccakP=void 0;const Eo=Ot,Ls=je,Vn=Zn,I0=[],O0=[],C0=[],_P=BigInt(0),bs=BigInt(1),yP=BigInt(2),wP=BigInt(7),mP=BigInt(256),EP=BigInt(113);for(let e=0,t=bs,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],I0.push(2*(5*o+r)),O0.push((e+1)*(e+2)/2%64);let s=_P;for(let u=0;u<7;u++)t=(t<<bs^(t>>wP)*EP)%mP,t&yP&&(s^=bs<<(bs<<BigInt(u))-bs);C0.push(s)}const[vP,SP]=(0,Ls.split)(C0,!0),gb=(e,t,r)=>r>32?(0,Ls.rotlBH)(e,t,r):(0,Ls.rotlSH)(e,t,r),pb=(e,t,r)=>r>32?(0,Ls.rotlBL)(e,t,r):(0,Ls.rotlSL)(e,t,r);function L0(e,t=24){const r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let f=0;f<10;f++)r[f]=e[f]^e[f+10]^e[f+20]^e[f+30]^e[f+40];for(let f=0;f<10;f+=2){const h=(f+8)%10,l=(f+2)%10,p=r[l],b=r[l+1],w=gb(p,b,1)^r[h],I=pb(p,b,1)^r[h+1];for(let A=0;A<50;A+=10)e[f+A]^=w,e[f+A+1]^=I}let s=e[2],u=e[3];for(let f=0;f<24;f++){const h=O0[f],l=gb(s,u,h),p=pb(s,u,h),b=I0[f];s=e[b],u=e[b+1],e[b]=l,e[b+1]=p}for(let f=0;f<50;f+=10){for(let h=0;h<10;h++)r[h]=e[f+h];for(let h=0;h<10;h++)e[f+h]^=~r[(h+2)%10]&r[(h+4)%10]}e[0]^=vP[o],e[1]^=SP[o]}r.fill(0)}dt.keccakP=L0;class Hs extends Vn.Hash{constructor(t,r,o,s=!1,u=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=o,this.enableXOF=s,this.rounds=u,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Eo.number)(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Vn.u32)(this.state)}keccak(){Vn.isLE||(0,Vn.byteSwap32)(this.state32),L0(this.state32,this.rounds),Vn.isLE||(0,Vn.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Eo.exists)(this);const{blockLen:r,state:o}=this;t=(0,Vn.toBytes)(t);const s=t.length;for(let u=0;u<s;){const f=Math.min(r-this.pos,s-u);for(let h=0;h<f;h++)o[this.pos++]^=t[u++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:o,blockLen:s}=this;t[o]^=r,r&128&&o===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){(0,Eo.exists)(this,!1),(0,Eo.bytes)(t),this.finish();const r=this.state,{blockLen:o}=this;for(let s=0,u=t.length;s<u;){this.posOut>=o&&this.keccak();const f=Math.min(o-this.posOut,u-s);t.set(r.subarray(this.posOut,this.posOut+f),s),this.posOut+=f,s+=f}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Eo.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Eo.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:o,outputLen:s,rounds:u,enableXOF:f}=this;return t||(t=new Hs(r,o,s,f,u)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=u,t.suffix=o,t.outputLen=s,t.enableXOF=f,t.destroyed=this.destroyed,t}}dt.Keccak=Hs;const Ai=(e,t,r)=>(0,Vn.wrapConstructor)(()=>new Hs(t,e,r));dt.sha3_224=Ai(6,144,224/8);dt.sha3_256=Ai(6,136,256/8);dt.sha3_384=Ai(6,104,384/8);dt.sha3_512=Ai(6,72,512/8);dt.keccak_224=Ai(1,144,224/8);dt.keccak_256=Ai(1,136,256/8);dt.keccak_384=Ai(1,104,384/8);dt.keccak_512=Ai(1,72,512/8);const P0=(e,t,r)=>(0,Vn.wrapXOFConstructorWithOpts)((o={})=>new Hs(t,e,o.dkLen===void 0?r:o.dkLen,!0));dt.shake128=P0(31,168,128/8);dt.shake256=P0(31,136,256/8);var wu={exports:{}};wu.exports;(function(e,t){var r=H.commonjsGlobal&&H.commonjsGlobal.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0,t.bytesToUtf8=l,t.hexToBytes=p,t.equalsBytes=b,t.wrapHash=w;const o=r(Ot),s=Zn,u=o.default.bool;t.assertBool=u;const f=o.default.bytes;t.assertBytes=f;var h=Zn;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return h.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return h.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return h.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return h.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return h.utf8ToBytes}});function l(I){if(!(I instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof I}`);return new TextDecoder().decode(I)}function p(I){const A=I.startsWith("0x")?I.substring(2):I;return(0,s.hexToBytes)(A)}function b(I,A){if(I.length!==A.length)return!1;for(let x=0;x<I.length;x++)if(I[x]!==A[x])return!1;return!0}function w(I){return A=>(o.default.bytes(A),I(A))}t.crypto=(()=>{const I=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,A=typeof H.commonjsRequire=="function"&&H.commonjsRequire.bind(e);return{node:A&&!I?A("crypto"):void 0,web:I}})()})(wu,wu.exports);var B0=wu.exports;Object.defineProperty(rn,"__esModule",{value:!0});rn.keccak512=rn.keccak384=rn.keccak256=rn.keccak224=void 0;const Ps=dt,Qu=B0;rn.keccak224=(0,Qu.wrapHash)(Ps.keccak_224);rn.keccak256=(()=>{const e=(0,Qu.wrapHash)(Ps.keccak_256);return e.create=Ps.keccak_256.create,e})();rn.keccak384=(0,Qu.wrapHash)(Ps.keccak_384);rn.keccak512=(0,Qu.wrapHash)(Ps.keccak_512);var Qi={},Fr={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.isHexString=ht.getKeys=ht.fromAscii=ht.fromUtf8=ht.toAscii=ht.arrayContainsArray=ht.getBinarySize=ht.padToEven=ht.stripHexPrefix=ht.isHexPrefixed=void 0;function N0(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}ht.isHexPrefixed=N0;const RP=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return N0(e)?e.slice(2):e};ht.stripHexPrefix=RP;function $0(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}ht.padToEven=$0;function AP(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return H.dist.Buffer.byteLength(e,"utf8")}ht.getBinarySize=AP;function TP(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](o=>e.indexOf(o)>=0)}ht.arrayContainsArray=TP;function IP(e){let t="",r=0;const o=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<o;r+=2){const s=parseInt(e.substr(r,2),16);t+=String.fromCharCode(s)}return t}ht.toAscii=IP;function OP(e){const t=H.dist.Buffer.from(e,"utf8");return`0x${$0(t.toString("hex")).replace(/^0+|0+$/g,"")}`}ht.fromUtf8=OP;function CP(e){let t="";for(let r=0;r<e.length;r++){const s=e.charCodeAt(r).toString(16);t+=s.length<2?`0${s}`:s}return`0x${t}`}ht.fromAscii=CP;function LP(e,t,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const o=[];for(let s=0;s<e.length;s++){let u=e[s][t];if(r===!0&&!u)u="";else if(typeof u!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof u}`);o.push(u)}return o}ht.getKeys=LP;function PP(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}ht.isHexString=PP;Object.defineProperty(Fr,"__esModule",{value:!0});Fr.assertIsString=Fr.assertIsArray=Fr.assertIsBuffer=Fr.assertIsHexString=void 0;const BP=ht,NP=function(e){if(!(0,BP.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};Fr.assertIsHexString=NP;const $P=function(e){if(!H.dist.Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Fr.assertIsBuffer=$P;const MP=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};Fr.assertIsArray=MP;const xP=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};Fr.assertIsString=xP;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=Fr,r=ht,o=function($){if(!Number.isSafeInteger($)||$<0)throw new Error(`Received an invalid integer type: ${$}`);return`0x${$.toString(16)}`};e.intToHex=o;const s=function($){const G=(0,e.intToHex)($);return H.dist.Buffer.from((0,r.padToEven)(G.slice(2)),"hex")};e.intToBuffer=s;const u=function($){return H.dist.Buffer.allocUnsafe($).fill(0)};e.zeros=u;const f=function($,G,Y){const V=(0,e.zeros)(G);return Y?$.length<G?($.copy(V),V):$.slice(0,G):$.length<G?($.copy(V,G-$.length),V):$.slice(-G)},h=function($,G){return(0,t.assertIsBuffer)($),f($,G,!1)};e.setLengthLeft=h;const l=function($,G){return(0,t.assertIsBuffer)($),f($,G,!0)};e.setLengthRight=l;const p=function($){let G=$[0];for(;$.length>0&&G.toString()==="0";)$=$.slice(1),G=$[0];return $},b=function($){return(0,t.assertIsBuffer)($),p($)};e.unpadBuffer=b;const w=function($){return(0,t.assertIsArray)($),p($)};e.unpadArray=w;const I=function($){return(0,t.assertIsHexString)($),$=(0,r.stripHexPrefix)($),"0x"+p($)};e.unpadHexString=I;const A=function($){if($==null)return H.dist.Buffer.allocUnsafe(0);if(H.dist.Buffer.isBuffer($)||Array.isArray($)||$ instanceof Uint8Array)return H.dist.Buffer.from($);if(typeof $=="string"){if(!(0,r.isHexString)($))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${$}`);return H.dist.Buffer.from((0,r.padToEven)((0,r.stripHexPrefix)($)),"hex")}if(typeof $=="number")return(0,e.intToBuffer)($);if(typeof $=="bigint"){if($<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${$}`);let G=$.toString(16);return G.length%2&&(G="0"+G),H.dist.Buffer.from(G,"hex")}if($.toArray)return H.dist.Buffer.from($.toArray());if($.toBuffer)return H.dist.Buffer.from($.toBuffer());throw new Error("invalid type")};e.toBuffer=A;const x=function($){return $=(0,e.toBuffer)($),"0x"+$.toString("hex")};e.bufferToHex=x;function v($){const G=(0,e.bufferToHex)($);return BigInt(G==="0x"?0:G)}e.bufferToBigInt=v;function C($){return(0,e.toBuffer)("0x"+$.toString(16))}e.bigIntToBuffer=C;const B=function($){const G=Number(v($));if(!Number.isSafeInteger(G))throw new Error("Number exceeds 53 bits");return G};e.bufferToInt=B;const P=function($){return BigInt.asIntN(256,v($))};e.fromSigned=P;const S=function($){return C(BigInt.asUintN(256,$))};e.toUnsigned=S;const m=function($){return typeof $!="string"||(0,r.isHexPrefixed)($)?$:"0x"+$};e.addHexPrefix=m;function j($,G=50){const Y=H.dist.Buffer.isBuffer($)?$.toString("hex"):$;return Y.length<=G?Y:Y.slice(0,G)+"…"}e.short=j;const Q=function($){const G=/^(00)+|(00)+$/g;if($=(0,r.stripHexPrefix)($),$.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return H.dist.Buffer.from($.replace(G,""),"hex").toString("utf8")};e.toUtf8=Q;const ce=function($){if(H.dist.Buffer.isBuffer($))return`0x${$.toString("hex")}`;if($ instanceof Array){const G=[];for(let Y=0;Y<$.length;Y++)G.push((0,e.baToJSON)($[Y]));return G}};e.baToJSON=ce;const ue=function($){for(const[G,Y]of Object.entries($))if(Y!==void 0&&Y.length>0&&Y[0]===0)throw new Error(`${G} cannot have leading zeroes, received: ${Y.toString("hex")}`)};e.validateNoLeadingZeroes=ue;function te($){return Array.isArray($)?$.map(G=>te(G)):H.dist.Buffer.from($)}e.arrToBufArr=te;function Se($){return Array.isArray($)?$.map(G=>Se(G)):Uint8Array.from($??[])}e.bufArrToArr=Se;const me=$=>"0x"+$.toString(16);e.bigIntToHex=me;function F($){return(0,e.unpadBuffer)(C($))}e.bigIntToUnpaddedBuffer=F;function U($){return(0,e.unpadBuffer)((0,e.intToBuffer)($))}e.intToUnpaddedBuffer=U})(Qi);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=Rn,r=rn,o=qu,s=B0,u=Qi,f=Wu,h=Fr,l=ht,p=BigInt(0);class b{constructor(U=p,$=p,G=f.KECCAK256_RLP,Y=f.KECCAK256_NULL){this.nonce=U,this.balance=$,this.storageRoot=G,this.codeHash=Y,this._validate()}static fromAccountData(U){const{nonce:$,balance:G,storageRoot:Y,codeHash:V}=U;return new b($!==void 0?(0,u.bufferToBigInt)((0,u.toBuffer)($)):void 0,G!==void 0?(0,u.bufferToBigInt)((0,u.toBuffer)(G)):void 0,Y!==void 0?(0,u.toBuffer)(Y):void 0,V!==void 0?(0,u.toBuffer)(V):void 0)}static fromRlpSerializedAccount(U){const $=(0,u.arrToBufArr)(t.RLP.decode(Uint8Array.from(U)));if(!Array.isArray($))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray($)}static fromValuesArray(U){const[$,G,Y,V]=U;return new b((0,u.bufferToBigInt)($),(0,u.bufferToBigInt)(G),Y,V)}_validate(){if(this.nonce<p)throw new Error("nonce must be greater than zero");if(this.balance<p)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[(0,u.bigIntToUnpaddedBuffer)(this.nonce),(0,u.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return H.dist.Buffer.from(t.RLP.encode((0,u.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(f.KECCAK256_NULL)}isEmpty(){return this.balance===p&&this.nonce===p&&this.codeHash.equals(f.KECCAK256_NULL)}}e.Account=b;const w=function(F){try{(0,h.assertIsString)(F)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(F)};e.isValidAddress=w;const I=function(F,U){(0,h.assertIsHexString)(F);const $=(0,l.stripHexPrefix)(F).toLowerCase();let G="";U!==void 0&&(G=(0,u.bufferToBigInt)((0,u.toBuffer)(U)).toString()+"0x");const Y=H.dist.Buffer.from(G+$,"utf8"),V=(0,s.bytesToHex)((0,r.keccak256)(Y));let ne="0x";for(let W=0;W<$.length;W++)parseInt(V[W],16)>=8?ne+=$[W].toUpperCase():ne+=$[W];return ne};e.toChecksumAddress=I;const A=function(F,U){return(0,e.isValidAddress)(F)&&(0,e.toChecksumAddress)(F,U)===F};e.isValidChecksumAddress=A;const x=function(F,U){return(0,h.assertIsBuffer)(F),(0,h.assertIsBuffer)(U),(0,u.bufferToBigInt)(U)===BigInt(0)?H.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,u.bufArrToArr)([F,null])))).slice(-20):H.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,u.bufArrToArr)([F,U])))).slice(-20)};e.generateAddress=x;const v=function(F,U,$){if((0,h.assertIsBuffer)(F),(0,h.assertIsBuffer)(U),(0,h.assertIsBuffer)($),F.length!==20)throw new Error("Expected from to be of length 20");if(U.length!==32)throw new Error("Expected salt to be of length 32");const G=(0,r.keccak256)(H.dist.Buffer.concat([H.dist.Buffer.from("ff","hex"),F,U,(0,r.keccak256)($)]));return(0,u.toBuffer)(G).slice(-20)};e.generateAddress2=v;const C=function(F){return o.secp256k1.utils.isValidPrivateKey(F)};e.isValidPrivate=C;const B=function(F,U=!1){if((0,h.assertIsBuffer)(F),F.length===64)try{return o.secp256k1.ProjectivePoint.fromHex(H.dist.Buffer.concat([H.dist.Buffer.from([4]),F])),!0}catch{return!1}if(!U)return!1;try{return o.secp256k1.ProjectivePoint.fromHex(F),!0}catch{return!1}};e.isValidPublic=B;const P=function(F,U=!1){if((0,h.assertIsBuffer)(F),U&&F.length!==64&&(F=H.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromHex(F).toRawBytes(!1).slice(1))),F.length!==64)throw new Error("Expected pubKey to be of length 64");return H.dist.Buffer.from((0,r.keccak256)(F)).slice(-20)};e.pubToAddress=P,e.publicToAddress=e.pubToAddress;const S=function(F){return(0,h.assertIsBuffer)(F),H.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromPrivateKey(F).toRawBytes(!1).slice(1))};e.privateToPublic=S;const m=function(F){return(0,e.publicToAddress)((0,e.privateToPublic)(F))};e.privateToAddress=m;const j=function(F){return(0,h.assertIsBuffer)(F),F.length!==64&&(F=H.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromHex(F).toRawBytes(!1).slice(1))),F};e.importPublic=j;const Q=function(){const U=(0,u.zeros)(20);return(0,u.bufferToHex)(U)};e.zeroAddress=Q;const ce=function(F){try{(0,h.assertIsString)(F)}catch{return!1}return(0,e.zeroAddress)()===F};e.isZeroAddress=ce;function ue(F){const[U,$,G,Y]=F;return[U,$,(0,u.arrToBufArr)(G).length===0?f.KECCAK256_RLP:G,(0,u.arrToBufArr)(Y).length===0?f.KECCAK256_NULL:Y]}e.accountBodyFromSlim=ue;const te=new Uint8Array(0);function Se(F){const[U,$,G,Y]=F;return[U,$,(0,u.arrToBufArr)(G).equals(f.KECCAK256_RLP)?te:G,(0,u.arrToBufArr)(Y).equals(f.KECCAK256_NULL)?te:Y]}e.accountBodyToSlim=Se;function me(F,U=!0){const $=U?ue(F):F;return(0,u.arrToBufArr)(t.RLP.encode($))}e.accountBodyToRLP=me})(Td);var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Address=void 0;const _s=Td,ru=Qi;class zn{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new zn((0,ru.zeros)(20))}static fromString(t){if(!(0,_s.isValidAddress)(t))throw new Error("Invalid address");return new zn((0,ru.toBuffer)(t))}static fromPublicKey(t){if(!H.dist.Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const r=(0,_s.pubToAddress)(t);return new zn(r)}static fromPrivateKey(t){if(!H.dist.Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const r=(0,_s.privateToAddress)(t);return new zn(r)}static generate(t,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new zn((0,_s.generateAddress)(t.buf,(0,ru.bigIntToBuffer)(r)))}static generate2(t,r,o){if(!H.dist.Buffer.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!H.dist.Buffer.isBuffer(o))throw new Error("Expected initCode to be a Buffer");return new zn((0,_s.generateAddress2)(t.buf,r,o))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(zn.zero())}isPrecompileOrSystemAddress(){const t=(0,ru.bufferToBigInt)(this.buf),r=BigInt(0),o=BigInt("0xffff");return t>=r&&t<=o}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return H.dist.Buffer.from(this.buf)}}Ws.Address=zn;var ef={},Cd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=Qi,r=ht;var o;(function(u){u[u.Number=0]="Number",u[u.BigInt=1]="BigInt",u[u.Buffer=2]="Buffer",u[u.PrefixedHexString=3]="PrefixedHexString"})(o=e.TypeOutput||(e.TypeOutput={}));function s(u,f){if(u===null)return null;if(u===void 0)return;if(typeof u=="string"&&!(0,r.isHexString)(u))throw new Error(`A string must be provided with a 0x-prefix, given: ${u}`);if(typeof u=="number"&&!Number.isSafeInteger(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const h=(0,t.toBuffer)(u);switch(f){case o.Buffer:return h;case o.BigInt:return(0,t.bufferToBigInt)(h);case o.Number:{const l=(0,t.bufferToBigInt)(h);if(l>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(l)}case o.PrefixedHexString:return(0,t.bufferToHex)(h);default:throw new Error("unknown outputType")}}e.toType=s})(Cd);Object.defineProperty(ef,"__esModule",{value:!0});ef.Withdrawal=void 0;const bb=Ws,rc=Qi,At=Cd;class vs{constructor(t,r,o,s){this.index=t,this.validatorIndex=r,this.address=o,this.amount=s}static fromWithdrawalData(t){const{index:r,validatorIndex:o,address:s,amount:u}=t,f=(0,At.toType)(r,At.TypeOutput.BigInt),h=(0,At.toType)(o,At.TypeOutput.BigInt),l=new bb.Address((0,At.toType)(s,At.TypeOutput.Buffer)),p=(0,At.toType)(u,At.TypeOutput.BigInt);return new vs(f,h,l,p)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[r,o,s,u]=t;return vs.fromWithdrawalData({index:r,validatorIndex:o,address:s,amount:u})}static toBufferArray(t){const{index:r,validatorIndex:o,address:s,amount:u}=t,f=(0,At.toType)(r,At.TypeOutput.BigInt)===BigInt(0)?H.dist.Buffer.alloc(0):(0,At.toType)(r,At.TypeOutput.Buffer),h=(0,At.toType)(o,At.TypeOutput.BigInt)===BigInt(0)?H.dist.Buffer.alloc(0):(0,At.toType)(o,At.TypeOutput.Buffer);let l;s instanceof bb.Address?l=s.buf:l=(0,At.toType)(s,At.TypeOutput.Buffer);const p=(0,At.toType)(u,At.TypeOutput.BigInt)===BigInt(0)?H.dist.Buffer.alloc(0):(0,At.toType)(u,At.TypeOutput.Buffer);return[f,h,l,p]}raw(){return vs.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,rc.bigIntToHex)(this.index),validatorIndex:(0,rc.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,rc.bigIntToHex)(this.amount)}}}ef.Withdrawal=vs;var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.hashPersonalMessage=Qt.isValidSignature=Qt.fromRpcSig=Qt.toCompactSig=Qt.toRpcSig=Qt.ecrecover=Qt.ecsign=void 0;const DP=rn,M0=qu,pr=Qi,nc=Wu,jP=Fr;function UP(e,t,r){const o=M0.secp256k1.sign(e,t),s=o.toCompactRawBytes(),u=H.dist.Buffer.from(s.slice(0,32)),f=H.dist.Buffer.from(s.slice(32,64)),h=r===void 0?BigInt(o.recovery+27):BigInt(o.recovery+35)+BigInt(r)*BigInt(2);return{r:u,s:f,v:h}}Qt.ecsign=UP;function tf(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function rf(e){return e===BigInt(0)||e===BigInt(1)}const kP=function(e,t,r,o,s){const u=H.dist.Buffer.concat([(0,pr.setLengthLeft)(r,32),(0,pr.setLengthLeft)(o,32)],64),f=tf(t,s);if(!rf(f))throw new Error("Invalid signature v value");const l=M0.secp256k1.Signature.fromCompact(u).addRecoveryBit(Number(f)).recoverPublicKey(e);return H.dist.Buffer.from(l.toRawBytes(!1).slice(1))};Qt.ecrecover=kP;const FP=function(e,t,r,o){const s=tf(e,o);if(!rf(s))throw new Error("Invalid signature v value");return(0,pr.bufferToHex)(H.dist.Buffer.concat([(0,pr.setLengthLeft)(t,32),(0,pr.setLengthLeft)(r,32),(0,pr.toBuffer)(e)]))};Qt.toRpcSig=FP;const HP=function(e,t,r,o){const s=tf(e,o);if(!rf(s))throw new Error("Invalid signature v value");let u=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(u=H.dist.Buffer.from(r),u[0]|=128),(0,pr.bufferToHex)(H.dist.Buffer.concat([(0,pr.setLengthLeft)(t,32),(0,pr.setLengthLeft)(u,32)]))};Qt.toCompactSig=HP;const WP=function(e){const t=(0,pr.toBuffer)(e);let r,o,s;if(t.length>=65)r=t.slice(0,32),o=t.slice(32,64),s=(0,pr.bufferToBigInt)(t.slice(64));else if(t.length===64)r=t.slice(0,32),o=t.slice(32,64),s=BigInt((0,pr.bufferToInt)(t.slice(32,33))>>7),o[0]&=127;else throw new Error("Invalid signature length");return s<27&&(s=s+BigInt(27)),{v:s,r,s:o}};Qt.fromRpcSig=WP;const qP=function(e,t,r,o=!0,s){if(t.length!==32||r.length!==32||!rf(tf(e,s)))return!1;const u=(0,pr.bufferToBigInt)(t),f=(0,pr.bufferToBigInt)(r);return!(u===BigInt(0)||u>=nc.SECP256K1_ORDER||f===BigInt(0)||f>=nc.SECP256K1_ORDER||o&&f>=nc.SECP256K1_ORDER_DIV_2)};Qt.isValidSignature=qP;const GP=function(e){(0,jP.assertIsBuffer)(e);const t=H.dist.Buffer.from(`Ethereum Signed Message:
3
- ${e.length}`,"utf-8");return H.dist.Buffer.from((0,DP.keccak256)(H.dist.Buffer.concat([t,e])))};Qt.hashPersonalMessage=GP;var x0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=f=>f.length>0&&f[f.length-1]===16;e.hasTerminator=t;const r=(f,h)=>{for(let l=0,p=0;p<f.length;l+=1,p+=2)h[l]=f[p]<<4|f[p+1]};e.nibblesToBytes=r;const o=f=>{let h=0;(0,e.hasTerminator)(f)&&(h=1,f=f.subarray(0,f.length-1));const l=new Uint8Array(f.length/2+1);return l[0]=h<<5,(f.length&1)===1&&(l[0]|=16,l[0]|=f[0],f=f.subarray(1)),(0,e.nibblesToBytes)(f,l.subarray(1)),l};e.nibblesToCompactBytes=o;const s=f=>{const h=f.length*2+1,l=new Uint8Array(h);for(let p=0;p<f.length;p++){const b=f[p];l[p*2]=b/16,l[p*2+1]=b%16}return l[h-1]=16,l};e.bytesToNibbles=s;const u=f=>{if(f.length===0)return f;let h=(0,e.bytesToNibbles)(f);h[0]<2&&(h=h.subarray(0,h.length-1));const l=2-(h[0]&1);return h.subarray(l)};e.compactBytesToNibbles=u})(x0);var nf={};Object.defineProperty(nf,"__esModule",{value:!0});nf.AsyncEventEmitter=void 0;const VP=H.requireEvents();async function zP(e,t,r){let o;for await(const s of t)try{s.length<2?s.call(e,r):await new Promise((u,f)=>{s.call(e,r,h=>{h?f(h):u()})})}catch(u){o=u}if(o)throw o}class KP extends VP.EventEmitter{emit(t,...r){let[o,s]=r;const u=this;let f=u._events[t]??[];return s===void 0&&typeof o=="function"&&(s=o,o=void 0),(t==="newListener"||t==="removeListener")&&(o={event:o,fn:s},s=void 0),f=Array.isArray(f)?f:[f],zP(u,f.slice(),o).then(s).catch(s),u.listenerCount(t)>0}once(t,r){const o=this;let s;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?s=function(u,f){o.removeListener(t,s),r(u,f)}:s=function(u){o.removeListener(t,s),r(u,s)},o.on(t,s),o}first(t,r){let o=this._events[t]??[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(o)||(this._events[t]=o=[o]),o.unshift(r),this}before(t,r,o){return this.beforeOrAfter(t,r,o)}after(t,r,o){return this.beforeOrAfter(t,r,o,"after")}beforeOrAfter(t,r,o,s){let u=this._events[t]??[],f,h;const l=s==="after"?1:0;if(typeof o!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(u)||(this._events[t]=u=[u]),h=u.length,f=u.length;f--;)if(u[f]===r){h=f+l;break}return u.splice(h,0,o),this}on(t,r){return super.on(t,r)}addListener(t,r){return super.addListener(t,r)}prependListener(t,r){return super.prependListener(t,r)}prependOnceListener(t,r){return super.prependOnceListener(t,r)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,r){return super.removeListener(t,r)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}nf.AsyncEventEmitter=KP;var of={};Object.defineProperty(of,"__esModule",{value:!0});of.Lock=void 0;class JP{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(t=>this.promiseResolverQueue.push(t))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}of.Lock=JP;var Mo={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.InvalidStatusCodeError=Gi.InvalidCertError=void 0;const D0=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class Dc extends Error{constructor(t,r){super(t),this.fingerprint256=r}}Gi.InvalidCertError=Dc;class Ld extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}Gi.InvalidStatusCodeError=Ld;function j0(e,t){if(!t||t==="text"||t==="json")try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return r;try{return JSON.parse(r)}catch(o){if(t==="json")throw o;return r}}catch(r){if(t==="text"||t==="json")throw r}return e}let _b={};function jc(e,t){var I;let r={...D0,...t};const o=H.streamHttp,s=H.httpsBrowserifyExports,u=H.lib,{promisify:f}=H.util,{resolve:h}=H.urlExports,l=!!/^https/.test(e);let p={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const b=A=>A.replace(/:| /g,"").toLowerCase();if(r.keepAlive){const A={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},x=[l,l&&((I=r.sslPinnedCertificates)==null?void 0:I.map(v=>b(v)).sort())].join();p.agent=_b[x]||(_b[x]=new(l?s:o).Agent(A))}r.type==="json"&&(p.headers["Content-Type"]="application/json"),r.data&&(r.method||(p.method="POST"),p.body=r.type==="json"?JSON.stringify(r.data):r.data),p.headers={...p.headers,...r.headers},r.sslAllowSelfSigned&&(p.rejectUnauthorized=!1);const w=async A=>{const x=A.statusCode;if(r.redirect&&300<=x&&x<400&&A.headers.location){if(r._redirectCount==10)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await jc(h(e,A.headers.location),r)}if(r.expectStatusCode&&x!==r.expectStatusCode)throw A.resume(),new Ld(x);let v=[];for await(const S of A)v.push(S);let C=H.dist.Buffer.concat(v);const B=A.headers["content-encoding"];B==="br"&&(C=await f(u.brotliDecompress)(C)),(B==="gzip"||B==="deflate")&&(C=await f(u.unzip)(C));const P=j0(C,r.type);return r.full?{headers:A.headers,status:x,body:P}:P};return new Promise((A,x)=>{var S;const v=async m=>{if(m&&m.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await jc(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(j){j&&j.fingerprint256&&(m=new Dc(`Self-signed SSL certificate: ${j.fingerprint256}`,j.fingerprint256))}x(m)},C=(l?s:o).request(e,p,m=>{m.on("error",v),(async()=>{try{A(await w(m))}catch(j){x(j)}})()});C.on("error",v);const B=(S=r.sslPinnedCertificates)==null?void 0:S.map(m=>b(m)),P=m=>{var Q;const j=b(((Q=m.getPeerCertificate())==null?void 0:Q.fingerprint256)||"");if(!(!j&&m.isSessionReused())&&!B.includes(j))return C.emit("error",new Dc(`Invalid SSL certificate: ${j} Expected: ${B}`,j)),C.abort()};r.sslPinnedCertificates&&C.on("socket",m=>{m.listeners("secureConnect").map(Q=>(Q.name||"").replace("bound ","")).includes("mfetchSecureConnect")||m.on("secureConnect",P.bind(null,m))}),r.keepAlive&&C.setNoDelay(!0),p.body&&C.write(p.body),C.end()})}const YP=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),XP=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map(e=>e.toLowerCase()));async function ZP(e,t){let r={...D0,...t};const o=new Headers;r.type==="json"&&o.set("Content-Type","application/json");let s=new URL(e);if(s.username){const l=btoa(`${s.username}:${s.password}`);o.set("Authorization",`Basic ${l}`),s.username="",s.password=""}e=""+s;for(let l in r.headers){const p=l.toLowerCase();(YP.has(p)||r.cors&&!XP.has(p))&&o.set(l,r.headers[l])}let u={headers:o,redirect:r.redirect?"follow":"manual"};r.referrer||(u.referrerPolicy="no-referrer"),r.cors&&(u.mode="cors"),r.data&&(r.method||(u.method="POST"),u.body=r.type==="json"?JSON.stringify(r.data):r.data);const f=await fetch(e,u);if(r.expectStatusCode&&f.status!==r.expectStatusCode)throw new Ld(f.status);const h=j0(new Uint8Array(await f.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(f.headers.entries()),status:f.status,body:h}:h}const QP=!!(typeof H.dist.process=="object"&&H.dist.process.versions&&H.dist.process.versions.node&&H.dist.process.versions.v8);function eB(e,t){return(QP?jc:ZP)(e,t)}Gi.default=eB;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.getProvider=Mo.fetchFromProvider=void 0;const tB=Gi,rB=async(e,t)=>(await(0,tB.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;Mo.fetchFromProvider=rB;const nB=e=>{var t;if(typeof e=="string")return e;if(((t=e==null?void 0:e.connection)==null?void 0:t.url)!==void 0)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};Mo.getProvider=nB;(function(e){var t=H.commonjsGlobal&&H.commonjsGlobal.__createBinding||(Object.create?function(s,u,f,h){h===void 0&&(h=f);var l=Object.getOwnPropertyDescriptor(u,f);(!l||("get"in l?!u.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return u[f]}}),Object.defineProperty(s,h,l)}:function(s,u,f,h){h===void 0&&(h=f),s[h]=u[f]}),r=H.commonjsGlobal&&H.commonjsGlobal.__exportStar||function(s,u){for(var f in s)f!=="default"&&!Object.prototype.hasOwnProperty.call(u,f)&&t(u,s,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,r(Wu,e),r(Zu,e),r(Td,e),r(Ws,e),r(ef,e),r(Qt,e),r(Qi,e),r(Cd,e),r(x0,e),r(nf,e);var o=ht;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return o.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),r(of,e),r(Mo,e)})(wL);var U0={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():t.log=r()})(H.commonjsGlobal,function(){var t=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],u={},f=null;function h(v,C){var B=v[C];if(typeof B.bind=="function")return B.bind(v);try{return Function.prototype.bind.call(B,v)}catch{return function(){return Function.prototype.apply.apply(B,[v,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function p(v){return v==="debug"&&(v="log"),typeof console===r?!1:v==="trace"&&o?l:console[v]!==void 0?h(console,v):console.log!==void 0?h(console,"log"):t}function b(){for(var v=this.getLevel(),C=0;C<s.length;C++){var B=s[C];this[B]=C<v?t:this.methodFactory(B,v,this.name)}if(this.log=this.debug,typeof console===r&&v<this.levels.SILENT)return"No console available for logging"}function w(v){return function(){typeof console!==r&&(b.call(this),this[v].apply(this,arguments))}}function I(v,C,B){return p(v)||w.apply(this,arguments)}function A(v,C){var B=this,P,S,m,j="loglevel";typeof v=="string"?j+=":"+v:typeof v=="symbol"&&(j=void 0);function Q(me){var F=(s[me]||"silent").toUpperCase();if(!(typeof window===r||!j)){try{window.localStorage[j]=F;return}catch{}try{window.document.cookie=encodeURIComponent(j)+"="+F+";"}catch{}}}function ce(){var me;if(!(typeof window===r||!j)){try{me=window.localStorage[j]}catch{}if(typeof me===r)try{var F=window.document.cookie,U=encodeURIComponent(j),$=F.indexOf(U+"=");$!==-1&&(me=/^([^;]+)/.exec(F.slice($+U.length+1))[1])}catch{}return B.levels[me]===void 0&&(me=void 0),me}}function ue(){if(!(typeof window===r||!j)){try{window.localStorage.removeItem(j)}catch{}try{window.document.cookie=encodeURIComponent(j)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function te(me){var F=me;if(typeof F=="string"&&B.levels[F.toUpperCase()]!==void 0&&(F=B.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=B.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+me)}B.name=v,B.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},B.methodFactory=C||I,B.getLevel=function(){return m??S??P},B.setLevel=function(me,F){return m=te(me),F!==!1&&Q(m),b.call(B)},B.setDefaultLevel=function(me){S=te(me),ce()||B.setLevel(me,!1)},B.resetLevel=function(){m=null,ue(),b.call(B)},B.enableAll=function(me){B.setLevel(B.levels.TRACE,me)},B.disableAll=function(me){B.setLevel(B.levels.SILENT,me)},B.rebuild=function(){if(f!==B&&(P=te(f.getLevel())),b.call(B),f===B)for(var me in u)u[me].rebuild()},P=te(f?f.getLevel():"WARN");var Se=ce();Se!=null&&(m=te(Se)),b.call(B)}f=new A,f.getLogger=function(C){if(typeof C!="symbol"&&typeof C!="string"||C==="")throw new TypeError("You must supply a name when creating a logger.");var B=u[C];return B||(B=u[C]=new A(C,f.methodFactory)),B};var x=typeof window!==r?window.log:void 0;return f.noConflict=function(){return typeof window!==r&&window.log===f&&(window.log=x),f},f.getLoggers=function(){return u},f.default=f,f})})(U0);var k0=U0.exports;const mu=H.getDefaultExportFromCjs(k0);var Eu={exports:{}};Eu.exports;(function(e,t){var r=200,o="__lodash_hash_undefined__",s=800,u=16,f=9007199254740991,h="[object Arguments]",l="[object Array]",p="[object AsyncFunction]",b="[object Boolean]",w="[object Date]",I="[object Error]",A="[object Function]",x="[object GeneratorFunction]",v="[object Map]",C="[object Number]",B="[object Null]",P="[object Object]",S="[object Proxy]",m="[object RegExp]",j="[object Set]",Q="[object String]",ce="[object Undefined]",ue="[object WeakMap]",te="[object ArrayBuffer]",Se="[object DataView]",me="[object Float32Array]",F="[object Float64Array]",U="[object Int8Array]",$="[object Int16Array]",G="[object Int32Array]",Y="[object Uint8Array]",V="[object Uint8ClampedArray]",ne="[object Uint16Array]",W="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,re={};re[me]=re[F]=re[U]=re[$]=re[G]=re[Y]=re[V]=re[ne]=re[W]=!0,re[h]=re[l]=re[te]=re[b]=re[Se]=re[w]=re[I]=re[A]=re[v]=re[C]=re[P]=re[m]=re[j]=re[Q]=re[ue]=!1;var _e=typeof H.commonjsGlobal=="object"&&H.commonjsGlobal&&H.commonjsGlobal.Object===Object&&H.commonjsGlobal,be=typeof self=="object"&&self&&self.Object===Object&&self,R=_e||be||Function("return this")(),O=t&&!t.nodeType&&t,q=O&&!0&&e&&!e.nodeType&&e,oe=q&&q.exports===O,ye=oe&&_e.process,d=function(){try{var M=q&&q.require&&q.require("util").types;return M||ye&&ye.binding&&ye.binding("util")}catch{}}(),g=d&&d.isTypedArray;function _(M,X,le){switch(le.length){case 0:return M.call(X);case 1:return M.call(X,le[0]);case 2:return M.call(X,le[0],le[1]);case 3:return M.call(X,le[0],le[1],le[2])}return M.apply(X,le)}function E(M,X){for(var le=-1,Le=Array(M);++le<M;)Le[le]=X(le);return Le}function J(M){return function(X){return M(X)}}function ie(M,X){return M==null?void 0:M[X]}function se(M,X){return function(le){return M(X(le))}}var Ie=Array.prototype,Be=Function.prototype,Ce=Object.prototype,Ue=R["__core-js_shared__"],Re=Be.toString,He=Ce.hasOwnProperty,bt=function(){var M=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||"");return M?"Symbol(src)_1."+M:""}(),et=Ce.toString,_t=Re.call(Object),Ye=RegExp("^"+Re.call(He).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=oe?R.Buffer:void 0,Dt=R.Symbol,Lt=R.Uint8Array;Ve&&Ve.allocUnsafe;var at=se(Object.getPrototypeOf,Object),Bt=Object.create,fr=Ce.propertyIsEnumerable,er=Ie.splice,kt=Dt?Dt.toStringTag:void 0,lr=function(){try{var M=Wo(Object,"defineProperty");return M({},"",{}),M}catch{}}(),zr=Ve?Ve.isBuffer:void 0,Kr=Math.max,sn=Date.now,an=Wo(R,"Map"),tr=Wo(Object,"create"),Or=function(){function M(){}return function(X){if(!Nn(X))return{};if(Bt)return Bt(X);M.prototype=X;var le=new M;return M.prototype=void 0,le}}();function rr(M){var X=-1,le=M==null?0:M.length;for(this.clear();++X<le;){var Le=M[X];this.set(Le[0],Le[1])}}function Ln(){this.__data__=tr?tr(null):{},this.size=0}function Jr(M){var X=this.has(M)&&delete this.__data__[M];return this.size-=X?1:0,X}function un(M){var X=this.__data__;if(tr){var le=X[M];return le===o?void 0:le}return He.call(X,M)?X[M]:void 0}function N(M){var X=this.__data__;return tr?X[M]!==void 0:He.call(X,M)}function D(M,X){var le=this.__data__;return this.size+=this.has(M)?0:1,le[M]=tr&&X===void 0?o:X,this}rr.prototype.clear=Ln,rr.prototype.delete=Jr,rr.prototype.get=un,rr.prototype.has=N,rr.prototype.set=D;function Ee(M){var X=-1,le=M==null?0:M.length;for(this.clear();++X<le;){var Le=M[X];this.set(Le[0],Le[1])}}function ve(){this.__data__=[],this.size=0}function Te(M){var X=this.__data__,le=gn(X,M);if(le<0)return!1;var Le=X.length-1;return le==Le?X.pop():er.call(X,le,1),--this.size,!0}function yt(M){var X=this.__data__,le=gn(X,M);return le<0?void 0:X[le][1]}function St(M){return gn(this.__data__,M)>-1}function fn(M,X){var le=this.__data__,Le=gn(le,M);return Le<0?(++this.size,le.push([M,X])):le[Le][1]=X,this}Ee.prototype.clear=ve,Ee.prototype.delete=Te,Ee.prototype.get=yt,Ee.prototype.has=St,Ee.prototype.set=fn;function Pt(M){var X=-1,le=M==null?0:M.length;for(this.clear();++X<le;){var Le=M[X];this.set(Le[0],Le[1])}}function ln(){this.size=0,this.__data__={hash:new rr,map:new(an||Ee),string:new rr}}function Pn(M){var X=Ci(this,M).delete(M);return this.size-=X?1:0,X}function cn(M){return Ci(this,M).get(M)}function dn(M){return Ci(this,M).has(M)}function Yr(M,X){var le=Ci(this,M),Le=le.size;return le.set(M,X),this.size+=le.size==Le?0:1,this}Pt.prototype.clear=ln,Pt.prototype.delete=Pn,Pt.prototype.get=cn,Pt.prototype.has=dn,Pt.prototype.set=Yr;function Gt(M){var X=this.__data__=new Ee(M);this.size=X.size}function Cr(){this.__data__=new Ee,this.size=0}function yr(M){var X=this.__data__,le=X.delete(M);return this.size=X.size,le}function nr(M){return this.__data__.get(M)}function Ft(M){return this.__data__.has(M)}function Ti(M,X){var le=this.__data__;if(le instanceof Ee){var Le=le.__data__;if(!an||Le.length<r-1)return Le.push([M,X]),this.size=++le.size,this;le=this.__data__=new Pt(Le)}return le.set(M,X),this.size=le.size,this}Gt.prototype.clear=Cr,Gt.prototype.delete=yr,Gt.prototype.get=nr,Gt.prototype.has=Ft,Gt.prototype.set=Ti;function Ii(M,X){var le=zo(M),Le=!le&&Vo(M),Ke=!le&&!Le&&oa(M),tt=!le&&!Le&&!Ke&&aa(M),ct=le||Le||Ke||tt,De=ct?E(M.length,String):[],st=De.length;for(var Nt in M)ct&&(Nt=="length"||Ke&&(Nt=="offset"||Nt=="parent")||tt&&(Nt=="buffer"||Nt=="byteLength"||Nt=="byteOffset")||ro(Nt,st))||De.push(Nt);return De}function Bn(M,X,le){(le!==void 0&&!Li(M[X],le)||le===void 0&&!(X in M))&&Lr(M,X,le)}function hn(M,X,le){var Le=M[X];(!(He.call(M,X)&&Li(Le,le))||le===void 0&&!(X in M))&&Lr(M,X,le)}function gn(M,X){for(var le=M.length;le--;)if(Li(M[le][0],X))return le;return-1}function Lr(M,X,le){X=="__proto__"&&lr?lr(M,X,{configurable:!0,enumerable:!0,value:le,writable:!0}):M[X]=le}var Oi=to();function pn(M){return M==null?M===void 0?ce:B:kt&&kt in Object(M)?Ys(M):Qs(M)}function ti(M){return $n(M)&&pn(M)==h}function ri(M){if(!Nn(M)||qo(M))return!1;var X=Jo(M)?Ye:ae;return X.test(na(M))}function ni(M){return $n(M)&&sa(M.length)&&!!re[pn(M)]}function ii(M){if(!Nn(M))return oi(M);var X=no(M),le=[];for(var Le in M)Le=="constructor"&&(X||!He.call(M,Le))||le.push(Le);return le}function Gs(M,X,le,Le,Ke){M!==X&&Oi(X,function(tt,ct){if(Ke||(Ke=new Gt),Nn(tt))cf(M,X,ct,le,Gs,Le,Ke);else{var De=Le?Le(Go(M,ct),tt,ct+"",M,X,Ke):void 0;De===void 0&&(De=tt),Bn(M,ct,De)}},ua)}function cf(M,X,le,Le,Ke,tt,ct){var De=Go(M,le),st=Go(X,le),Nt=ct.get(st);if(Nt){Bn(M,le,Nt);return}var Vt=tt?tt(De,st,le+"",M,X,ct):void 0,Mn=Vt===void 0;if(Mn){var zt=zo(st),io=!zt&&oa(st),Yo=!zt&&!io&&aa(st);Vt=st,zt||io||Yo?zo(De)?Vt=De:ia(De)?Vt=Ho(De):io?(Mn=!1,Vt=Vs(st)):Yo?(Mn=!1,Vt=Ks(st)):Vt=[]:bf(st)||Vo(st)?(Vt=De,Vo(De)?Vt=_f(De):(!Nn(De)||Jo(De))&&(Vt=Xs(st))):Mn=!1}Mn&&(ct.set(st,Vt),Ke(Vt,st,Le,tt,ct),ct.delete(st)),Bn(M,le,Vt)}function df(M,X){return ta(ea(M,X,nt),M+"")}var hf=lr?function(M,X){return lr(M,"toString",{configurable:!0,enumerable:!1,value:ut(X),writable:!0})}:nt;function Vs(M,X){return M.slice()}function zs(M){var X=new M.constructor(M.byteLength);return new Lt(X).set(new Lt(M)),X}function Ks(M,X){var le=zs(M.buffer);return new M.constructor(le,M.byteOffset,M.length)}function Ho(M,X){var le=-1,Le=M.length;for(X||(X=Array(Le));++le<Le;)X[le]=M[le];return X}function gf(M,X,le,Le){var Ke=!le;le||(le={});for(var tt=-1,ct=X.length;++tt<ct;){var De=X[tt],st=void 0;st===void 0&&(st=M[De]),Ke?Lr(le,De,st):hn(le,De,st)}return le}function Js(M){return df(function(X,le){var Le=-1,Ke=le.length,tt=Ke>1?le[Ke-1]:void 0,ct=Ke>2?le[2]:void 0;for(tt=M.length>3&&typeof tt=="function"?(Ke--,tt):void 0,ct&&pf(le[0],le[1],ct)&&(tt=Ke<3?void 0:tt,Ke=1),X=Object(X);++Le<Ke;){var De=le[Le];De&&M(X,De,Le,tt)}return X})}function to(M){return function(X,le,Le){for(var Ke=-1,tt=Object(X),ct=Le(X),De=ct.length;De--;){var st=ct[++Ke];if(le(tt[st],st,tt)===!1)break}return X}}function Ci(M,X){var le=M.__data__;return Zs(X)?le[typeof X=="string"?"string":"hash"]:le.map}function Wo(M,X){var le=ie(M,X);return ri(le)?le:void 0}function Ys(M){var X=He.call(M,kt),le=M[kt];try{M[kt]=void 0;var Le=!0}catch{}var Ke=et.call(M);return Le&&(X?M[kt]=le:delete M[kt]),Ke}function Xs(M){return typeof M.constructor=="function"&&!no(M)?Or(at(M)):{}}function ro(M,X){var le=typeof M;return X=X??f,!!X&&(le=="number"||le!="symbol"&&de.test(M))&&M>-1&&M%1==0&&M<X}function pf(M,X,le){if(!Nn(le))return!1;var Le=typeof X;return(Le=="number"?Ko(le)&&ro(X,le.length):Le=="string"&&X in le)?Li(le[X],M):!1}function Zs(M){var X=typeof M;return X=="string"||X=="number"||X=="symbol"||X=="boolean"?M!=="__proto__":M===null}function qo(M){return!!bt&&bt in M}function no(M){var X=M&&M.constructor,le=typeof X=="function"&&X.prototype||Ce;return M===le}function oi(M){var X=[];if(M!=null)for(var le in Object(M))X.push(le);return X}function Qs(M){return et.call(M)}function ea(M,X,le){return X=Kr(X===void 0?M.length-1:X,0),function(){for(var Le=arguments,Ke=-1,tt=Kr(Le.length-X,0),ct=Array(tt);++Ke<tt;)ct[Ke]=Le[X+Ke];Ke=-1;for(var De=Array(X+1);++Ke<X;)De[Ke]=Le[Ke];return De[X]=le(ct),_(M,this,De)}}function Go(M,X){if(!(X==="constructor"&&typeof M[X]=="function")&&X!="__proto__")return M[X]}var ta=ra(hf);function ra(M){var X=0,le=0;return function(){var Le=sn(),Ke=u-(Le-le);if(le=Le,Ke>0){if(++X>=s)return arguments[0]}else X=0;return M.apply(void 0,arguments)}}function na(M){if(M!=null){try{return Re.call(M)}catch{}try{return M+""}catch{}}return""}function Li(M,X){return M===X||M!==M&&X!==X}var Vo=ti(function(){return arguments}())?ti:function(M){return $n(M)&&He.call(M,"callee")&&!fr.call(M,"callee")},zo=Array.isArray;function Ko(M){return M!=null&&sa(M.length)&&!Jo(M)}function ia(M){return $n(M)&&Ko(M)}var oa=zr||wf;function Jo(M){if(!Nn(M))return!1;var X=pn(M);return X==A||X==x||X==p||X==S}function sa(M){return typeof M=="number"&&M>-1&&M%1==0&&M<=f}function Nn(M){var X=typeof M;return M!=null&&(X=="object"||X=="function")}function $n(M){return M!=null&&typeof M=="object"}function bf(M){if(!$n(M)||pn(M)!=P)return!1;var X=at(M);if(X===null)return!0;var le=He.call(X,"constructor")&&X.constructor;return typeof le=="function"&&le instanceof le&&Re.call(le)==_t}var aa=g?J(g):ni;function _f(M){return gf(M,ua(M))}function ua(M){return Ko(M)?Ii(M):ii(M)}var yf=Js(function(M,X,le){Gs(M,X,le)});function ut(M){return function(){return M}}function nt(M){return M}function wf(){return!1}e.exports=yf})(Eu,Eu.exports);Eu.exports;const iB=mu.getLogger("http-helpers");iB.setLevel(k0.levels.INFO);var vu={exports:{}};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-DZvLy2Dr.js"),$1=require("./events-jATx_JnD.js");function Rs(e){"@babel/helpers - typeof";return Rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rs(e)}function M1(e,t){if(Rs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(Rs(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function x1(e){var t=M1(e,"string");return Rs(t)=="symbol"?t:t+""}var gc={exports:{}},Hb=H.requireEvents().EventEmitter,Sl,jg;function D1(){if(jg)return Sl;jg=1;function e(x,v){var C=Object.keys(x);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(x);v&&(B=B.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),C.push.apply(C,B)}return C}function t(x){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?e(Object(C),!0).forEach(function(B){r(x,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(C)):e(Object(C)).forEach(function(B){Object.defineProperty(x,B,Object.getOwnPropertyDescriptor(C,B))})}return x}function r(x,v,C){return v=f(v),v in x?Object.defineProperty(x,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[v]=C,x}function o(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function s(x,v){for(var C=0;C<v.length;C++){var B=v[C];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(x,f(B.key),B)}}function u(x,v,C){return v&&s(x.prototype,v),Object.defineProperty(x,"prototype",{writable:!1}),x}function f(x){var v=h(x,"string");return typeof v=="symbol"?v:String(v)}function h(x,v){if(typeof x!="object"||x===null)return x;var C=x[Symbol.toPrimitive];if(C!==void 0){var B=C.call(x,v);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}var l=H.bufferPolyfill,p=l.Buffer,b=H.require$$3,w=b.inspect,I=w&&w.custom||"inspect";function A(x,v,C){p.prototype.copy.call(x,v,C)}return Sl=function(){function x(){o(this,x),this.head=null,this.tail=null,this.length=0}return u(x,[{key:"push",value:function(C){var B={data:C,next:null};this.length>0?this.tail.next=B:this.head=B,this.tail=B,++this.length}},{key:"unshift",value:function(C){var B={data:C,next:this.head};this.length===0&&(this.tail=B),this.head=B,++this.length}},{key:"shift",value:function(){if(this.length!==0){var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(C){if(this.length===0)return"";for(var B=this.head,P=""+B.data;B=B.next;)P+=C+B.data;return P}},{key:"concat",value:function(C){if(this.length===0)return p.alloc(0);for(var B=p.allocUnsafe(C>>>0),P=this.head,S=0;P;)A(P.data,B,S),S+=P.data.length,P=P.next;return B}},{key:"consume",value:function(C,B){var P;return C<this.head.data.length?(P=this.head.data.slice(0,C),this.head.data=this.head.data.slice(C)):C===this.head.data.length?P=this.shift():P=B?this._getString(C):this._getBuffer(C),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(C){var B=this.head,P=1,S=B.data;for(C-=S.length;B=B.next;){var m=B.data,j=C>m.length?m.length:C;if(j===m.length?S+=m:S+=m.slice(0,C),C-=j,C===0){j===m.length?(++P,B.next?this.head=B.next:this.head=this.tail=null):(this.head=B,B.data=m.slice(j));break}++P}return this.length-=P,S}},{key:"_getBuffer",value:function(C){var B=p.allocUnsafe(C),P=this.head,S=1;for(P.data.copy(B),C-=P.data.length;P=P.next;){var m=P.data,j=C>m.length?m.length:C;if(m.copy(B,B.length-C,0,j),C-=j,C===0){j===m.length?(++S,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=m.slice(j));break}++S}return this.length-=S,B}},{key:I,value:function(C,B){return w(this,t(t({},B),{},{depth:0,customInspect:!1}))}}]),x}(),Sl}function j1(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,H.dist.process.nextTick(pc,this,e)):H.dist.process.nextTick(pc,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(u){!t&&u?r._writableState?r._writableState.errorEmitted?H.dist.process.nextTick(su,r):(r._writableState.errorEmitted=!0,H.dist.process.nextTick(Ug,r,u)):H.dist.process.nextTick(Ug,r,u):t?(H.dist.process.nextTick(su,r),t(u)):H.dist.process.nextTick(su,r)}),this)}function Ug(e,t){pc(e,t),su(e)}function su(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function U1(){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 pc(e,t){e.emit("error",t)}function k1(e,t){var r=e._readableState,o=e._writableState;r&&r.autoDestroy||o&&o.autoDestroy?e.destroy(t):e.emit("error",t)}var Wb={destroy:j1,undestroy:U1,errorOrDestroy:k1},Vi={};function F1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var qb={};function Wr(e,t,r){r||(r=Error);function o(u,f,h){return typeof t=="string"?t:t(u,f,h)}var s=function(u){F1(f,u);function f(h,l,p){return u.call(this,o(h,l,p))||this}return f}(r);s.prototype.name=r.name,s.prototype.code=e,qb[e]=s}function kg(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(o){return String(o)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function H1(e,t,r){return e.substr(0,t.length)===t}function W1(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function q1(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Wr("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Wr("ERR_INVALID_ARG_TYPE",function(e,t,r){var o;typeof t=="string"&&H1(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be";var s;if(W1(e," argument"))s="The ".concat(e," ").concat(o," ").concat(kg(t,"type"));else{var u=q1(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(kg(t,"type"))}return s+=". Received type ".concat(typeof r),s},TypeError);Wr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Wr("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Wr("ERR_STREAM_PREMATURE_CLOSE","Premature close");Wr("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Wr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Wr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Wr("ERR_STREAM_WRITE_AFTER_END","write after end");Wr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Wr("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Wr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Vi.codes=qb;var G1=Vi.codes.ERR_INVALID_OPT_VALUE;function V1(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function z1(e,t,r,o){var s=V1(t,o,r);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var u=o?r:"highWaterMark";throw new G1(u,s)}return Math.floor(s)}return e.objectMode?16:16*1024}var Gb={getHighWaterMark:z1},Rl,Fg;function Vb(){if(Fg)return Rl;Fg=1,Rl=ue;function e(R){var O=this;this.next=null,this.entry=null,this.finish=function(){be(O,R)}}var t;ue.WritableState=Q;var r={deprecate:H.requireBrowser()},o=Hb,s=H.bufferPolyfill.Buffer,u=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(R){return s.from(R)}function h(R){return s.isBuffer(R)||R instanceof u}var l=Wb,p=Gb,b=p.getHighWaterMark,w=Vi.codes,I=w.ERR_INVALID_ARG_TYPE,A=w.ERR_METHOD_NOT_IMPLEMENTED,x=w.ERR_MULTIPLE_CALLBACK,v=w.ERR_STREAM_CANNOT_PIPE,C=w.ERR_STREAM_DESTROYED,B=w.ERR_STREAM_NULL_VALUES,P=w.ERR_STREAM_WRITE_AFTER_END,S=w.ERR_UNKNOWN_ENCODING,m=l.errorOrDestroy;H.requireInherits_browser()(ue,o);function j(){}function Q(R,O,q){t=t||Oo(),R=R||{},typeof q!="boolean"&&(q=O instanceof t),this.objectMode=!!R.objectMode,q&&(this.objectMode=this.objectMode||!!R.writableObjectMode),this.highWaterMark=b(this,R,"writableHighWaterMark",q),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var oe=R.decodeStrings===!1;this.decodeStrings=!oe,this.defaultEncoding=R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){Y(O,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}Q.prototype.getBuffer=function(){for(var O=this.bufferedRequest,q=[];O;)q.push(O),O=O.next;return q},function(){try{Object.defineProperty(Q.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ce;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ce=Function.prototype[Symbol.hasInstance],Object.defineProperty(ue,Symbol.hasInstance,{value:function(O){return ce.call(this,O)?!0:this!==ue?!1:O&&O._writableState instanceof Q}})):ce=function(O){return O instanceof this};function ue(R){t=t||Oo();var O=this instanceof t;if(!O&&!ce.call(ue,this))return new ue(R);this._writableState=new Q(R,this,O),this.writable=!0,R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final)),o.call(this)}ue.prototype.pipe=function(){m(this,new v)};function te(R,O){var q=new P;m(R,q),H.dist.process.nextTick(O,q)}function Se(R,O,q,oe){var ye;return q===null?ye=new B:typeof q!="string"&&!O.objectMode&&(ye=new I("chunk",["string","Buffer"],q)),ye?(m(R,ye),H.dist.process.nextTick(oe,ye),!1):!0}ue.prototype.write=function(R,O,q){var oe=this._writableState,ye=!1,d=!oe.objectMode&&h(R);return d&&!s.isBuffer(R)&&(R=f(R)),typeof O=="function"&&(q=O,O=null),d?O="buffer":O||(O=oe.defaultEncoding),typeof q!="function"&&(q=j),oe.ending?te(this,q):(d||Se(this,oe,R,q))&&(oe.pendingcb++,ye=F(this,oe,d,R,O,q)),ye},ue.prototype.cork=function(){this._writableState.corked++},ue.prototype.uncork=function(){var R=this._writableState;R.corked&&(R.corked--,!R.writing&&!R.corked&&!R.bufferProcessing&&R.bufferedRequest&&W(this,R))},ue.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new S(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(ue.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function me(R,O,q){return!R.objectMode&&R.decodeStrings!==!1&&typeof O=="string"&&(O=s.from(O,q)),O}Object.defineProperty(ue.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(R,O,q,oe,ye,d){if(!q){var g=me(O,oe,ye);oe!==g&&(q=!0,ye="buffer",oe=g)}var _=O.objectMode?1:oe.length;O.length+=_;var E=O.length<O.highWaterMark;if(E||(O.needDrain=!0),O.writing||O.corked){var J=O.lastBufferedRequest;O.lastBufferedRequest={chunk:oe,encoding:ye,isBuf:q,callback:d,next:null},J?J.next=O.lastBufferedRequest:O.bufferedRequest=O.lastBufferedRequest,O.bufferedRequestCount+=1}else U(R,O,!1,_,oe,ye,d);return E}function U(R,O,q,oe,ye,d,g){O.writelen=oe,O.writecb=g,O.writing=!0,O.sync=!0,O.destroyed?O.onwrite(new C("write")):q?R._writev(ye,O.onwrite):R._write(ye,d,O.onwrite),O.sync=!1}function $(R,O,q,oe,ye){--O.pendingcb,q?(H.dist.process.nextTick(ye,oe),H.dist.process.nextTick(re,R,O),R._writableState.errorEmitted=!0,m(R,oe)):(ye(oe),R._writableState.errorEmitted=!0,m(R,oe),re(R,O))}function G(R){R.writing=!1,R.writecb=null,R.length-=R.writelen,R.writelen=0}function Y(R,O){var q=R._writableState,oe=q.sync,ye=q.writecb;if(typeof ye!="function")throw new x;if(G(q),O)$(R,q,oe,O,ye);else{var d=K(q)||R.destroyed;!d&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest&&W(R,q),oe?H.dist.process.nextTick(V,R,q,d,ye):V(R,q,d,ye)}}function V(R,O,q,oe){q||ne(R,O),O.pendingcb--,oe(),re(R,O)}function ne(R,O){O.length===0&&O.needDrain&&(O.needDrain=!1,R.emit("drain"))}function W(R,O){O.bufferProcessing=!0;var q=O.bufferedRequest;if(R._writev&&q&&q.next){var oe=O.bufferedRequestCount,ye=new Array(oe),d=O.corkedRequestsFree;d.entry=q;for(var g=0,_=!0;q;)ye[g]=q,q.isBuf||(_=!1),q=q.next,g+=1;ye.allBuffers=_,U(R,O,!0,O.length,ye,"",d.finish),O.pendingcb++,O.lastBufferedRequest=null,d.next?(O.corkedRequestsFree=d.next,d.next=null):O.corkedRequestsFree=new e(O),O.bufferedRequestCount=0}else{for(;q;){var E=q.chunk,J=q.encoding,ie=q.callback,se=O.objectMode?1:E.length;if(U(R,O,!1,se,E,J,ie),q=q.next,O.bufferedRequestCount--,O.writing)break}q===null&&(O.lastBufferedRequest=null)}O.bufferedRequest=q,O.bufferProcessing=!1}ue.prototype._write=function(R,O,q){q(new A("_write()"))},ue.prototype._writev=null,ue.prototype.end=function(R,O,q){var oe=this._writableState;return typeof R=="function"?(q=R,R=null,O=null):typeof O=="function"&&(q=O,O=null),R!=null&&this.write(R,O),oe.corked&&(oe.corked=1,this.uncork()),oe.ending||_e(this,oe,q),this},Object.defineProperty(ue.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function K(R){return R.ending&&R.length===0&&R.bufferedRequest===null&&!R.finished&&!R.writing}function ae(R,O){R._final(function(q){O.pendingcb--,q&&m(R,q),O.prefinished=!0,R.emit("prefinish"),re(R,O)})}function de(R,O){!O.prefinished&&!O.finalCalled&&(typeof R._final=="function"&&!O.destroyed?(O.pendingcb++,O.finalCalled=!0,H.dist.process.nextTick(ae,R,O)):(O.prefinished=!0,R.emit("prefinish")))}function re(R,O){var q=K(O);if(q&&(de(R,O),O.pendingcb===0&&(O.finished=!0,R.emit("finish"),O.autoDestroy))){var oe=R._readableState;(!oe||oe.autoDestroy&&oe.endEmitted)&&R.destroy()}return q}function _e(R,O,q){O.ending=!0,re(R,O),q&&(O.finished?H.dist.process.nextTick(q):R.once("finish",q)),O.ended=!0,R.writable=!1}function be(R,O,q){var oe=R.entry;for(R.entry=null;oe;){var ye=oe.callback;O.pendingcb--,ye(q),oe=oe.next}O.corkedRequestsFree.next=R}return Object.defineProperty(ue.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),ue.prototype.destroy=l.destroy,ue.prototype._undestroy=l.undestroy,ue.prototype._destroy=function(R,O){O(R)},Rl}var Al,Hg;function Oo(){if(Hg)return Al;Hg=1;var e=Object.keys||function(p){var b=[];for(var w in p)b.push(w);return b};Al=f;var t=Kb(),r=Vb();H.requireInherits_browser()(f,t);for(var o=e(r.prototype),s=0;s<o.length;s++){var u=o[s];f.prototype[u]||(f.prototype[u]=r.prototype[u])}function f(p){if(!(this instanceof f))return new f(p);t.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",h)))}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function h(){this._writableState.ended||H.dist.process.nextTick(l,this)}function l(p){p.end()}return Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),Al}var Wg=Vi.codes.ERR_STREAM_PREMATURE_CLOSE;function K1(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];e.apply(this,o)}}}function J1(){}function Y1(e){return e.setHeader&&typeof e.abort=="function"}function zb(e,t,r){if(typeof t=="function")return zb(e,null,t);t||(t={}),r=K1(r||J1);var o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||h()},f=e._writableState&&e._writableState.finished,h=function(){s=!1,f=!0,o||r.call(e)},l=e._readableState&&e._readableState.endEmitted,p=function(){o=!1,l=!0,s||r.call(e)},b=function(x){r.call(e,x)},w=function(){var x;if(o&&!l)return(!e._readableState||!e._readableState.ended)&&(x=new Wg),r.call(e,x);if(s&&!f)return(!e._writableState||!e._writableState.ended)&&(x=new Wg),r.call(e,x)},I=function(){e.req.on("finish",h)};return Y1(e)?(e.on("complete",h),e.on("abort",w),e.req?I():e.on("request",I)):s&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",p),e.on("finish",h),t.error!==!1&&e.on("error",b),e.on("close",w),function(){e.removeListener("complete",h),e.removeListener("abort",w),e.removeListener("request",I),e.req&&e.req.removeListener("finish",h),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",h),e.removeListener("end",p),e.removeListener("error",b),e.removeListener("close",w)}}var Wc=zb,Tl,qg;function X1(){if(qg)return Tl;qg=1;var e;function t(S,m,j){return m=r(m),m in S?Object.defineProperty(S,m,{value:j,enumerable:!0,configurable:!0,writable:!0}):S[m]=j,S}function r(S){var m=o(S,"string");return typeof m=="symbol"?m:String(m)}function o(S,m){if(typeof S!="object"||S===null)return S;var j=S[Symbol.toPrimitive];if(j!==void 0){var Q=j.call(S,m);if(typeof Q!="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(S)}var s=Wc,u=Symbol("lastResolve"),f=Symbol("lastReject"),h=Symbol("error"),l=Symbol("ended"),p=Symbol("lastPromise"),b=Symbol("handlePromise"),w=Symbol("stream");function I(S,m){return{value:S,done:m}}function A(S){var m=S[u];if(m!==null){var j=S[w].read();j!==null&&(S[p]=null,S[u]=null,S[f]=null,m(I(j,!1)))}}function x(S){H.dist.process.nextTick(A,S)}function v(S,m){return function(j,Q){S.then(function(){if(m[l]){j(I(void 0,!0));return}m[b](j,Q)},Q)}}var C=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((e={get stream(){return this[w]},next:function(){var m=this,j=this[h];if(j!==null)return Promise.reject(j);if(this[l])return Promise.resolve(I(void 0,!0));if(this[w].destroyed)return new Promise(function(te,Se){H.dist.process.nextTick(function(){m[h]?Se(m[h]):te(I(void 0,!0))})});var Q=this[p],ce;if(Q)ce=new Promise(v(Q,this));else{var ue=this[w].read();if(ue!==null)return Promise.resolve(I(ue,!1));ce=new Promise(this[b])}return this[p]=ce,ce}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var m=this;return new Promise(function(j,Q){m[w].destroy(null,function(ce){if(ce){Q(ce);return}j(I(void 0,!0))})})}),e),C),P=function(m){var j,Q=Object.create(B,(j={},t(j,w,{value:m,writable:!0}),t(j,u,{value:null,writable:!0}),t(j,f,{value:null,writable:!0}),t(j,h,{value:null,writable:!0}),t(j,l,{value:m._readableState.endEmitted,writable:!0}),t(j,b,{value:function(ue,te){var Se=Q[w].read();Se?(Q[p]=null,Q[u]=null,Q[f]=null,ue(I(Se,!1))):(Q[u]=ue,Q[f]=te)},writable:!0}),j));return Q[p]=null,s(m,function(ce){if(ce&&ce.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ue=Q[f];ue!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,ue(ce)),Q[h]=ce;return}var te=Q[u];te!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,te(I(void 0,!0))),Q[l]=!0}),m.on("readable",x.bind(null,Q)),Q};return Tl=P,Tl}var Il,Gg;function Z1(){return Gg||(Gg=1,Il=function(){throw new Error("Readable.from is not available in the browser")}),Il}var Ol,Vg;function Kb(){if(Vg)return Ol;Vg=1,Ol=te;var e;te.ReadableState=ue,H.requireEvents().EventEmitter;var t=function(g,_){return g.listeners(_).length},r=Hb,o=H.bufferPolyfill.Buffer,s=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(d){return o.from(d)}function f(d){return o.isBuffer(d)||d instanceof s}var h=H.require$$3,l;h&&h.debuglog?l=h.debuglog("stream"):l=function(){};var p=D1(),b=Wb,w=Gb,I=w.getHighWaterMark,A=Vi.codes,x=A.ERR_INVALID_ARG_TYPE,v=A.ERR_STREAM_PUSH_AFTER_EOF,C=A.ERR_METHOD_NOT_IMPLEMENTED,B=A.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,S,m;H.requireInherits_browser()(te,r);var j=b.errorOrDestroy,Q=["error","close","destroy","pause","resume"];function ce(d,g,_){if(typeof d.prependListener=="function")return d.prependListener(g,_);!d._events||!d._events[g]?d.on(g,_):Array.isArray(d._events[g])?d._events[g].unshift(_):d._events[g]=[_,d._events[g]]}function ue(d,g,_){e=e||Oo(),d=d||{},typeof _!="boolean"&&(_=g instanceof e),this.objectMode=!!d.objectMode,_&&(this.objectMode=this.objectMode||!!d.readableObjectMode),this.highWaterMark=I(this,d,"readableHighWaterMark",_),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.destroyed=!1,this.defaultEncoding=d.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,d.encoding&&(P||(P=H.requireString_decoder().StringDecoder),this.decoder=new P(d.encoding),this.encoding=d.encoding)}function te(d){if(e=e||Oo(),!(this instanceof te))return new te(d);var g=this instanceof e;this._readableState=new ue(d,this,g),this.readable=!0,d&&(typeof d.read=="function"&&(this._read=d.read),typeof d.destroy=="function"&&(this._destroy=d.destroy)),r.call(this)}Object.defineProperty(te.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(g){this._readableState&&(this._readableState.destroyed=g)}}),te.prototype.destroy=b.destroy,te.prototype._undestroy=b.undestroy,te.prototype._destroy=function(d,g){g(d)},te.prototype.push=function(d,g){var _=this._readableState,E;return _.objectMode?E=!0:typeof d=="string"&&(g=g||_.defaultEncoding,g!==_.encoding&&(d=o.from(d,g),g=""),E=!0),Se(this,d,g,!1,E)},te.prototype.unshift=function(d){return Se(this,d,null,!0,!1)};function Se(d,g,_,E,J){l("readableAddChunk",g);var ie=d._readableState;if(g===null)ie.reading=!1,Y(d,ie);else{var se;if(J||(se=F(ie,g)),se)j(d,se);else if(ie.objectMode||g&&g.length>0)if(typeof g!="string"&&!ie.objectMode&&Object.getPrototypeOf(g)!==o.prototype&&(g=u(g)),E)ie.endEmitted?j(d,new B):me(d,ie,g,!0);else if(ie.ended)j(d,new v);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!_?(g=ie.decoder.write(g),ie.objectMode||g.length!==0?me(d,ie,g,!1):W(d,ie)):me(d,ie,g,!1)}else E||(ie.reading=!1,W(d,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function me(d,g,_,E){g.flowing&&g.length===0&&!g.sync?(g.awaitDrain=0,d.emit("data",_)):(g.length+=g.objectMode?1:_.length,E?g.buffer.unshift(_):g.buffer.push(_),g.needReadable&&V(d)),W(d,g)}function F(d,g){var _;return!f(g)&&typeof g!="string"&&g!==void 0&&!d.objectMode&&(_=new x("chunk",["string","Buffer","Uint8Array"],g)),_}te.prototype.isPaused=function(){return this._readableState.flowing===!1},te.prototype.setEncoding=function(d){P||(P=H.requireString_decoder().StringDecoder);var g=new P(d);this._readableState.decoder=g,this._readableState.encoding=this._readableState.decoder.encoding;for(var _=this._readableState.buffer.head,E="";_!==null;)E+=g.write(_.data),_=_.next;return this._readableState.buffer.clear(),E!==""&&this._readableState.buffer.push(E),this._readableState.length=E.length,this};var U=1073741824;function $(d){return d>=U?d=U:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++),d}function G(d,g){return d<=0||g.length===0&&g.ended?0:g.objectMode?1:d!==d?g.flowing&&g.length?g.buffer.head.data.length:g.length:(d>g.highWaterMark&&(g.highWaterMark=$(d)),d<=g.length?d:g.ended?g.length:(g.needReadable=!0,0))}te.prototype.read=function(d){l("read",d),d=parseInt(d,10);var g=this._readableState,_=d;if(d!==0&&(g.emittedReadable=!1),d===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return l("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?q(this):V(this),null;if(d=G(d,g),d===0&&g.ended)return g.length===0&&q(this),null;var E=g.needReadable;l("need readable",E),(g.length===0||g.length-d<g.highWaterMark)&&(E=!0,l("length less than watermark",E)),g.ended||g.reading?(E=!1,l("reading or ended",E)):E&&(l("do read"),g.reading=!0,g.sync=!0,g.length===0&&(g.needReadable=!0),this._read(g.highWaterMark),g.sync=!1,g.reading||(d=G(_,g)));var J;return d>0?J=O(d,g):J=null,J===null?(g.needReadable=g.length<=g.highWaterMark,d=0):(g.length-=d,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),_!==d&&g.ended&&q(this)),J!==null&&this.emit("data",J),J};function Y(d,g){if(l("onEofChunk"),!g.ended){if(g.decoder){var _=g.decoder.end();_&&_.length&&(g.buffer.push(_),g.length+=g.objectMode?1:_.length)}g.ended=!0,g.sync?V(d):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,ne(d)))}}function V(d){var g=d._readableState;l("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(l("emitReadable",g.flowing),g.emittedReadable=!0,H.dist.process.nextTick(ne,d))}function ne(d){var g=d._readableState;l("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(d.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,R(d)}function W(d,g){g.readingMore||(g.readingMore=!0,H.dist.process.nextTick(K,d,g))}function K(d,g){for(;!g.reading&&!g.ended&&(g.length<g.highWaterMark||g.flowing&&g.length===0);){var _=g.length;if(l("maybeReadMore read 0"),d.read(0),_===g.length)break}g.readingMore=!1}te.prototype._read=function(d){j(this,new C("_read()"))},te.prototype.pipe=function(d,g){var _=this,E=this._readableState;switch(E.pipesCount){case 0:E.pipes=d;break;case 1:E.pipes=[E.pipes,d];break;default:E.pipes.push(d);break}E.pipesCount+=1,l("pipe count=%d opts=%j",E.pipesCount,g);var J=(!g||g.end!==!1)&&d!==H.dist.process.stdout&&d!==H.dist.process.stderr,ie=J?Ie:_t;E.endEmitted?H.dist.process.nextTick(ie):_.once("end",ie),d.on("unpipe",se);function se(Ye,Ve){l("onunpipe"),Ye===_&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,Ue())}function Ie(){l("onend"),d.end()}var Be=ae(_);d.on("drain",Be);var Ce=!1;function Ue(){l("cleanup"),d.removeListener("close",bt),d.removeListener("finish",et),d.removeListener("drain",Be),d.removeListener("error",He),d.removeListener("unpipe",se),_.removeListener("end",Ie),_.removeListener("end",_t),_.removeListener("data",Re),Ce=!0,E.awaitDrain&&(!d._writableState||d._writableState.needDrain)&&Be()}_.on("data",Re);function Re(Ye){l("ondata");var Ve=d.write(Ye);l("dest.write",Ve),Ve===!1&&((E.pipesCount===1&&E.pipes===d||E.pipesCount>1&&ye(E.pipes,d)!==-1)&&!Ce&&(l("false write response, pause",E.awaitDrain),E.awaitDrain++),_.pause())}function He(Ye){l("onerror",Ye),_t(),d.removeListener("error",He),t(d,"error")===0&&j(d,Ye)}ce(d,"error",He);function bt(){d.removeListener("finish",et),_t()}d.once("close",bt);function et(){l("onfinish"),d.removeListener("close",bt),_t()}d.once("finish",et);function _t(){l("unpipe"),_.unpipe(d)}return d.emit("pipe",_),E.flowing||(l("pipe resume"),_.resume()),d};function ae(d){return function(){var _=d._readableState;l("pipeOnDrain",_.awaitDrain),_.awaitDrain&&_.awaitDrain--,_.awaitDrain===0&&t(d,"data")&&(_.flowing=!0,R(d))}}te.prototype.unpipe=function(d){var g=this._readableState,_={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return d&&d!==g.pipes?this:(d||(d=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,d&&d.emit("unpipe",this,_),this);if(!d){var E=g.pipes,J=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var ie=0;ie<J;ie++)E[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var se=ye(g.pipes,d);return se===-1?this:(g.pipes.splice(se,1),g.pipesCount-=1,g.pipesCount===1&&(g.pipes=g.pipes[0]),d.emit("unpipe",this,_),this)},te.prototype.on=function(d,g){var _=r.prototype.on.call(this,d,g),E=this._readableState;return d==="data"?(E.readableListening=this.listenerCount("readable")>0,E.flowing!==!1&&this.resume()):d==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,l("on readable",E.length,E.reading),E.length?V(this):E.reading||H.dist.process.nextTick(re,this)),_},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(d,g){var _=r.prototype.removeListener.call(this,d,g);return d==="readable"&&H.dist.process.nextTick(de,this),_},te.prototype.removeAllListeners=function(d){var g=r.prototype.removeAllListeners.apply(this,arguments);return(d==="readable"||d===void 0)&&H.dist.process.nextTick(de,this),g};function de(d){var g=d._readableState;g.readableListening=d.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:d.listenerCount("data")>0&&d.resume()}function re(d){l("readable nexttick read 0"),d.read(0)}te.prototype.resume=function(){var d=this._readableState;return d.flowing||(l("resume"),d.flowing=!d.readableListening,_e(this,d)),d.paused=!1,this};function _e(d,g){g.resumeScheduled||(g.resumeScheduled=!0,H.dist.process.nextTick(be,d,g))}function be(d,g){l("resume",g.reading),g.reading||d.read(0),g.resumeScheduled=!1,d.emit("resume"),R(d),g.flowing&&!g.reading&&d.read(0)}te.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function R(d){var g=d._readableState;for(l("flow",g.flowing);g.flowing&&d.read()!==null;);}te.prototype.wrap=function(d){var g=this,_=this._readableState,E=!1;d.on("end",function(){if(l("wrapped end"),_.decoder&&!_.ended){var se=_.decoder.end();se&&se.length&&g.push(se)}g.push(null)}),d.on("data",function(se){if(l("wrapped data"),_.decoder&&(se=_.decoder.write(se)),!(_.objectMode&&se==null)&&!(!_.objectMode&&(!se||!se.length))){var Ie=g.push(se);Ie||(E=!0,d.pause())}});for(var J in d)this[J]===void 0&&typeof d[J]=="function"&&(this[J]=function(Ie){return function(){return d[Ie].apply(d,arguments)}}(J));for(var ie=0;ie<Q.length;ie++)d.on(Q[ie],this.emit.bind(this,Q[ie]));return this._read=function(se){l("wrapped _read",se),E&&(E=!1,d.resume())},this},typeof Symbol=="function"&&(te.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=X1()),S(this)}),Object.defineProperty(te.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(te.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(te.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(g){this._readableState&&(this._readableState.flowing=g)}}),te._fromList=O,Object.defineProperty(te.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(d,g){if(g.length===0)return null;var _;return g.objectMode?_=g.buffer.shift():!d||d>=g.length?(g.decoder?_=g.buffer.join(""):g.buffer.length===1?_=g.buffer.first():_=g.buffer.concat(g.length),g.buffer.clear()):_=g.buffer.consume(d,g.decoder),_}function q(d){var g=d._readableState;l("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,H.dist.process.nextTick(oe,g,d))}function oe(d,g){if(l("endReadableNT",d.endEmitted,d.length),!d.endEmitted&&d.length===0&&(d.endEmitted=!0,g.readable=!1,g.emit("end"),d.autoDestroy)){var _=g._writableState;(!_||_.autoDestroy&&_.finished)&&g.destroy()}}typeof Symbol=="function"&&(te.from=function(d,g){return m===void 0&&(m=Z1()),m(te,d,g)});function ye(d,g){for(var _=0,E=d.length;_<E;_++)if(d[_]===g)return _;return-1}return Ol}var Jb=Jn,Su=Vi.codes,Q1=Su.ERR_METHOD_NOT_IMPLEMENTED,eA=Su.ERR_MULTIPLE_CALLBACK,tA=Su.ERR_TRANSFORM_ALREADY_TRANSFORMING,rA=Su.ERR_TRANSFORM_WITH_LENGTH_0,Ru=Oo();H.requireInherits_browser()(Jn,Ru);function nA(e,t){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(o===null)return this.emit("error",new eA);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),o(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function Jn(e){if(!(this instanceof Jn))return new Jn(e);Ru.call(this,e),this._transformState={afterTransform:nA.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",iA)}function iA(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){zg(e,t,r)}):zg(this,null,null)}Jn.prototype.push=function(e,t){return this._transformState.needTransform=!1,Ru.prototype.push.call(this,e,t)};Jn.prototype._transform=function(e,t,r){r(new Q1("_transform()"))};Jn.prototype._write=function(e,t,r){var o=this._transformState;if(o.writecb=r,o.writechunk=e,o.writeencoding=t,!o.transforming){var s=this._readableState;(o.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}};Jn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Jn.prototype._destroy=function(e,t){Ru.prototype._destroy.call(this,e,function(r){t(r)})};function zg(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new rA;if(e._transformState.transforming)throw new tA;return e.push(null)}var oA=As,Yb=Jb;H.requireInherits_browser()(As,Yb);function As(e){if(!(this instanceof As))return new As(e);Yb.call(this,e)}As.prototype._transform=function(e,t,r){r(null,e)};var Cl;function sA(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Xb=Vi.codes,aA=Xb.ERR_MISSING_ARGS,uA=Xb.ERR_STREAM_DESTROYED;function Kg(e){if(e)throw e}function fA(e){return e.setHeader&&typeof e.abort=="function"}function lA(e,t,r,o){o=sA(o);var s=!1;e.on("close",function(){s=!0}),Cl===void 0&&(Cl=Wc),Cl(e,{readable:t,writable:r},function(f){if(f)return o(f);s=!0,o()});var u=!1;return function(f){if(!s&&!u){if(u=!0,fA(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();o(f||new uA("pipe"))}}}function Jg(e){e()}function cA(e,t){return e.pipe(t)}function dA(e){return!e.length||typeof e[e.length-1]!="function"?Kg:e.pop()}function hA(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=dA(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new aA("streams");var s,u=t.map(function(f,h){var l=h<t.length-1,p=h>0;return lA(f,l,p,function(b){s||(s=b),b&&u.forEach(Jg),!l&&(u.forEach(Jg),o(s))})});return t.reduce(cA)}var gA=hA;(function(e,t){t=e.exports=Kb(),t.Stream=t,t.Readable=t,t.Writable=Vb(),t.Duplex=Oo(),t.Transform=Jb,t.PassThrough=oA,t.finished=Wc,t.pipeline=gA})(gc,gc.exports);var Zb=gc.exports;const{Transform:vN}=Zb,{Transform:SN}=Zb;var Qb={};const Yg=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Qb.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],h=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],p=e[7]^e[17]^e[27]^e[37]^e[47],b=e[8]^e[18]^e[28]^e[38]^e[48],w=e[9]^e[19]^e[29]^e[39]^e[49];let I=b^(s<<1|u>>>31),A=w^(u<<1|s>>>31);const x=e[0]^I,v=e[1]^A,C=e[10]^I,B=e[11]^A,P=e[20]^I,S=e[21]^A,m=e[30]^I,j=e[31]^A,Q=e[40]^I,ce=e[41]^A;I=r^(f<<1|h>>>31),A=o^(h<<1|f>>>31);const ue=e[2]^I,te=e[3]^A,Se=e[12]^I,me=e[13]^A,F=e[22]^I,U=e[23]^A,$=e[32]^I,G=e[33]^A,Y=e[42]^I,V=e[43]^A;I=s^(l<<1|p>>>31),A=u^(p<<1|l>>>31);const ne=e[4]^I,W=e[5]^A,K=e[14]^I,ae=e[15]^A,de=e[24]^I,re=e[25]^A,_e=e[34]^I,be=e[35]^A,R=e[44]^I,O=e[45]^A;I=f^(b<<1|w>>>31),A=h^(w<<1|b>>>31);const q=e[6]^I,oe=e[7]^A,ye=e[16]^I,d=e[17]^A,g=e[26]^I,_=e[27]^A,E=e[36]^I,J=e[37]^A,ie=e[46]^I,se=e[47]^A;I=l^(r<<1|o>>>31),A=p^(o<<1|r>>>31);const Ie=e[8]^I,Be=e[9]^A,Ce=e[18]^I,Ue=e[19]^A,Re=e[28]^I,He=e[29]^A,bt=e[38]^I,et=e[39]^A,_t=e[48]^I,Ye=e[49]^A,Ve=x,Dt=v,Lt=B<<4|C>>>28,at=C<<4|B>>>28,Bt=P<<3|S>>>29,fr=S<<3|P>>>29,er=j<<9|m>>>23,kt=m<<9|j>>>23,lr=Q<<18|ce>>>14,zr=ce<<18|Q>>>14,Kr=ue<<1|te>>>31,sn=te<<1|ue>>>31,an=me<<12|Se>>>20,tr=Se<<12|me>>>20,Or=F<<10|U>>>22,rr=U<<10|F>>>22,Ln=G<<13|$>>>19,Jr=$<<13|G>>>19,un=Y<<2|V>>>30,N=V<<2|Y>>>30,D=W<<30|ne>>>2,Ee=ne<<30|W>>>2,ve=K<<6|ae>>>26,Te=ae<<6|K>>>26,yt=re<<11|de>>>21,St=de<<11|re>>>21,fn=_e<<15|be>>>17,Pt=be<<15|_e>>>17,ln=O<<29|R>>>3,Pn=R<<29|O>>>3,cn=q<<28|oe>>>4,dn=oe<<28|q>>>4,Yr=d<<23|ye>>>9,Gt=ye<<23|d>>>9,Cr=g<<25|_>>>7,yr=_<<25|g>>>7,nr=E<<21|J>>>11,Ft=J<<21|E>>>11,Ti=se<<24|ie>>>8,Ii=ie<<24|se>>>8,Bn=Ie<<27|Be>>>5,hn=Be<<27|Ie>>>5,gn=Ce<<20|Ue>>>12,Lr=Ue<<20|Ce>>>12,Oi=He<<7|Re>>>25,pn=Re<<7|He>>>25,ti=bt<<8|et>>>24,ri=et<<8|bt>>>24,ni=_t<<14|Ye>>>18,ii=Ye<<14|_t>>>18;e[0]=Ve^~an&yt,e[1]=Dt^~tr&St,e[10]=cn^~gn&Bt,e[11]=dn^~Lr&fr,e[20]=Kr^~ve&Cr,e[21]=sn^~Te&yr,e[30]=Bn^~Lt&Or,e[31]=hn^~at&rr,e[40]=D^~Yr&Oi,e[41]=Ee^~Gt&pn,e[2]=an^~yt&nr,e[3]=tr^~St&Ft,e[12]=gn^~Bt&Ln,e[13]=Lr^~fr&Jr,e[22]=ve^~Cr&ti,e[23]=Te^~yr&ri,e[32]=Lt^~Or&fn,e[33]=at^~rr&Pt,e[42]=Yr^~Oi&er,e[43]=Gt^~pn&kt,e[4]=yt^~nr&ni,e[5]=St^~Ft&ii,e[14]=Bt^~Ln&ln,e[15]=fr^~Jr&Pn,e[24]=Cr^~ti&lr,e[25]=yr^~ri&zr,e[34]=Or^~fn&Ti,e[35]=rr^~Pt&Ii,e[44]=Oi^~er&un,e[45]=pn^~kt&N,e[6]=nr^~ni&Ve,e[7]=Ft^~ii&Dt,e[16]=Ln^~ln&cn,e[17]=Jr^~Pn&dn,e[26]=ti^~lr&Kr,e[27]=ri^~zr&sn,e[36]=fn^~Ti&Bn,e[37]=Pt^~Ii&hn,e[46]=er^~un&D,e[47]=kt^~N&Ee,e[8]=ni^~Ve&an,e[9]=ii^~Dt&tr,e[18]=ln^~cn&gn,e[19]=Pn^~dn&Lr,e[28]=lr^~Kr&ve,e[29]=zr^~sn&Te,e[38]=Ti^~Bn&Lt,e[39]=Ii^~hn&at,e[48]=un^~D&Yr,e[49]=N^~Ee&Gt,e[0]^=Yg[t*2],e[1]^=Yg[t*2+1]}};const cu=Qb;function Ns(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Ns.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Ns.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(cu.p1600(this.state),this.count=0)};Ns.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&cu.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),cu.p1600(this.state),this.count=0,this.squeezing=!0};Ns.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=H.dist.Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(cu.p1600(this.state),this.count=0);return t};Ns.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var pA=bA;function bA(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const _A=H.getDefaultExportFromCjs(pA);var bc={exports:{}},Ll,Xg;function yA(){if(Xg)return Ll;Xg=1;var e=1e3,t=e*60,r=t*60,o=r*24,s=o*7,u=o*365.25;Ll=function(b,w){w=w||{};var I=typeof b;if(I==="string"&&b.length>0)return f(b);if(I==="number"&&isFinite(b))return w.long?l(b):h(b);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(b))};function f(b){if(b=String(b),!(b.length>100)){var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(b);if(w){var I=parseFloat(w[1]),A=(w[2]||"ms").toLowerCase();switch(A){case"years":case"year":case"yrs":case"yr":case"y":return I*u;case"weeks":case"week":case"w":return I*s;case"days":case"day":case"d":return I*o;case"hours":case"hour":case"hrs":case"hr":case"h":return I*r;case"minutes":case"minute":case"mins":case"min":case"m":return I*t;case"seconds":case"second":case"secs":case"sec":case"s":return I*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return I;default:return}}}}function h(b){var w=Math.abs(b);return w>=o?Math.round(b/o)+"d":w>=r?Math.round(b/r)+"h":w>=t?Math.round(b/t)+"m":w>=e?Math.round(b/e)+"s":b+"ms"}function l(b){var w=Math.abs(b);return w>=o?p(b,w,o,"day"):w>=r?p(b,w,r,"hour"):w>=t?p(b,w,t,"minute"):w>=e?p(b,w,e,"second"):b+" ms"}function p(b,w,I,A){var x=w>=I*1.5;return Math.round(b/I)+" "+A+(x?"s":"")}return Ll}function wA(e){r.debug=r,r.default=r,r.coerce=l,r.disable=f,r.enable=s,r.enabled=h,r.humanize=yA(),r.destroy=p,Object.keys(e).forEach(b=>{r[b]=e[b]}),r.names=[],r.skips=[],r.formatters={};function t(b){let w=0;for(let I=0;I<b.length;I++)w=(w<<5)-w+b.charCodeAt(I),w|=0;return r.colors[Math.abs(w)%r.colors.length]}r.selectColor=t;function r(b){let w,I=null,A,x;function v(...C){if(!v.enabled)return;const B=v,P=Number(new Date),S=P-(w||P);B.diff=S,B.prev=w,B.curr=P,w=P,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let m=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(Q,ce)=>{if(Q==="%%")return"%";m++;const ue=r.formatters[ce];if(typeof ue=="function"){const te=C[m];Q=ue.call(B,te),C.splice(m,1),m--}return Q}),r.formatArgs.call(B,C),(B.log||r.log).apply(B,C)}return v.namespace=b,v.useColors=r.useColors(),v.color=r.selectColor(b),v.extend=o,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>I!==null?I:(A!==r.namespaces&&(A=r.namespaces,x=r.enabled(b)),x),set:C=>{I=C}}),typeof r.init=="function"&&r.init(v),v}function o(b,w){const I=r(this.namespace+(typeof w>"u"?":":w)+b);return I.log=this.log,I}function s(b){r.save(b),r.namespaces=b,r.names=[],r.skips=[];const w=(typeof b=="string"?b:"").trim().replace(" ",",").split(",").filter(Boolean);for(const I of w)I[0]==="-"?r.skips.push(I.slice(1)):r.names.push(I)}function u(b,w){let I=0,A=0,x=-1,v=0;for(;I<b.length;)if(A<w.length&&(w[A]===b[I]||w[A]==="*"))w[A]==="*"?(x=A,v=I,A++):(I++,A++);else if(x!==-1)A=x+1,v++,I=v;else return!1;for(;A<w.length&&w[A]==="*";)A++;return A===w.length}function f(){const b=[...r.names,...r.skips.map(w=>"-"+w)].join(",");return r.enable(""),b}function h(b){for(const w of r.skips)if(u(b,w))return!1;for(const w of r.names)if(u(b,w))return!0;return!1}function l(b){return b instanceof Error?b.stack||b.message:b}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var mA=wA;(function(e,t){t.formatArgs=o,t.save=s,t.load=u,t.useColors=r,t.storage=f(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;l.splice(1,0,p,"color: inherit");let b=0,w=0;l[0].replace(/%[a-zA-Z%]/g,I=>{I!=="%%"&&(b++,I==="%c"&&(w=b))}),l.splice(w,0,p)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function u(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof H.dist.process<"u"&&"env"in H.dist.process&&(l=H.dist.process.env.DEBUG),l}function f(){try{return localStorage}catch{}}e.exports=mA(t);const{formatters:h}=e.exports;h.j=function(l){try{return JSON.stringify(l)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(bc,bc.exports);var EA=bc.exports,nn={},Ei={},qc=Ts;Ts.default=Ts;Ts.stable=r_;Ts.stableStringify=r_;var du="[...]",e_="[Circular]",Wi=[],Fi=[];function t_(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Ts(e,t,r,o){typeof o>"u"&&(o=t_()),_c(e,"",0,[],void 0,0,o);var s;try{Fi.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,n_(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Wi.length!==0;){var u=Wi.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function Ro(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);s.get!==void 0?s.configurable?(Object.defineProperty(o,r,{value:e}),Wi.push([o,r,t,s])):Fi.push([t,r,e]):(o[r]=e,Wi.push([o,r,t]))}function _c(e,t,r,o,s,u,f){u+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;h<o.length;h++)if(o[h]===e){Ro(e_,e,t,s);return}if(typeof f.depthLimit<"u"&&u>f.depthLimit){Ro(du,e,t,s);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){Ro(du,e,t,s);return}if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)_c(e[h],h,h,o,e,u,f);else{var l=Object.keys(e);for(h=0;h<l.length;h++){var p=l[h];_c(e[p],p,h,o,e,u,f)}}o.pop()}}function vA(e,t){return e<t?-1:e>t?1:0}function r_(e,t,r,o){typeof o>"u"&&(o=t_());var s=yc(e,"",0,[],void 0,0,o)||e,u;try{Fi.length===0?u=JSON.stringify(s,t,r):u=JSON.stringify(s,n_(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Wi.length!==0;){var f=Wi.pop();f.length===4?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return u}function yc(e,t,r,o,s,u,f){u+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;h<o.length;h++)if(o[h]===e){Ro(e_,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof f.depthLimit<"u"&&u>f.depthLimit){Ro(du,e,t,s);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){Ro(du,e,t,s);return}if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)yc(e[h],h,h,o,e,u,f);else{var l={},p=Object.keys(e).sort(vA);for(h=0;h<p.length;h++){var b=p[h];yc(e[b],b,h,o,e,u,f),l[b]=e[b]}if(typeof s<"u")Wi.push([s,t,e]),s[t]=l;else return l}o.pop()}}function n_(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Fi.length>0)for(var o=0;o<Fi.length;o++){var s=Fi[o];if(s[1]===t&&s[0]===r){r=s[2],Fi.splice(o,1);break}}return e.call(this,t,r)}}const SA=H.getDefaultExportFromCjs(qc);Object.defineProperty(Ei,"__esModule",{value:!0});Ei.EthereumProviderError=Ei.EthereumRpcError=void 0;const RA=qc;class i_ extends Error{constructor(t,r,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,o!==void 0&&(this.data=o)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return RA.default(this.serialize(),IA,2)}}Ei.EthereumRpcError=i_;let AA=class extends i_{constructor(t,r,o){if(!TA(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,o)}};Ei.EthereumProviderError=AA;function TA(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function IA(e,t){if(t!=="[Circular]")return t}var Gc={},vi={};Object.defineProperty(vi,"__esModule",{value:!0});vi.errorValues=vi.errorCodes=void 0;vi.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};vi.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=vi,r=Ei,o=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",u={code:o,message:f(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function f(I,A=s){if(Number.isInteger(I)){const x=I.toString();if(w(t.errorValues,x))return t.errorValues[x].message;if(p(I))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return A}e.getMessageFromCode=f;function h(I){if(!Number.isInteger(I))return!1;const A=I.toString();return!!(t.errorValues[A]||p(I))}e.isValidCode=h;function l(I,{fallbackError:A=u,shouldIncludeStack:x=!1}={}){var v,C;if(!A||!Number.isInteger(A.code)||typeof A.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(I instanceof r.EthereumRpcError)return I.serialize();const B={};if(I&&typeof I=="object"&&!Array.isArray(I)&&w(I,"code")&&h(I.code)){const S=I;B.code=S.code,S.message&&typeof S.message=="string"?(B.message=S.message,w(S,"data")&&(B.data=S.data)):(B.message=f(B.code),B.data={originalError:b(I)})}else{B.code=A.code;const S=(v=I)===null||v===void 0?void 0:v.message;B.message=S&&typeof S=="string"?S:A.message,B.data={originalError:b(I)}}const P=(C=I)===null||C===void 0?void 0:C.stack;return x&&I&&P&&typeof P=="string"&&(B.stack=P),B}e.serializeError=l;function p(I){return I>=-32099&&I<=-32e3}function b(I){return I&&typeof I=="object"&&!Array.isArray(I)?Object.assign({},I):I}function w(I,A){return Object.prototype.hasOwnProperty.call(I,A)}})(Gc);var Au={};Object.defineProperty(Au,"__esModule",{value:!0});Au.ethErrors=void 0;const Vc=Ei,o_=Gc,Yt=vi;Au.ethErrors={rpc:{parse:e=>jr(Yt.errorCodes.rpc.parse,e),invalidRequest:e=>jr(Yt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>jr(Yt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>jr(Yt.errorCodes.rpc.methodNotFound,e),internal:e=>jr(Yt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return jr(t,e)},invalidInput:e=>jr(Yt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>jr(Yt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>jr(Yt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>jr(Yt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>jr(Yt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>jr(Yt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>ds(Yt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>ds(Yt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>ds(Yt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>ds(Yt.errorCodes.provider.disconnected,e),chainDisconnected:e=>ds(Yt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:o}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Vc.EthereumProviderError(t,r,o)}}};function jr(e,t){const[r,o]=s_(t);return new Vc.EthereumRpcError(e,r||o_.getMessageFromCode(e),o)}function ds(e,t){const[r,o]=s_(t);return new Vc.EthereumProviderError(e,r||o_.getMessageFromCode(e),o)}function s_(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ei;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Gc;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const o=Au;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const s=vi;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(nn);function Ne(e,t,r){return(t=x1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var OA={exports:{}},Pl={exports:{}};let CA=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let o=0;o<t.length;o++)r+=` ${t[o].stack}
2
+ `;super(r),this.name="AggregateError",this.errors=t}};var vt={AggregateError:CA,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array},a_={exports:{}},u_={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,o]){const s=t.shift();return o==="f"?s.toFixed(6):o==="j"?JSON.stringify(s):o==="s"&&typeof s=="object"?`${s.constructor!==Object?s.constructor.name:""} {}`.trim():s.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}};const{format:LA,inspect:hu}=u_,{AggregateError:PA}=vt,BA=globalThis.AggregateError||PA,NA=Symbol("kIsNodeError"),$A=["string","function","number","object","Function","Object","boolean","bigint","symbol"],MA=/^([A-Z][a-z0-9]*)+$/,xA="__node_internal_",Tu={};function Hi(e,t){if(!e)throw new Tu.ERR_INTERNAL_ASSERTION(t)}function Zg(e){let t="",r=e.length;const o=e[0]==="-"?1:0;for(;r>=o+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function DA(e,t,r){if(typeof t=="function")return Hi(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return Hi(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),r.length===0?t:LA(t,...r)}function qt(e,t,r){r||(r=Error);class o extends r{constructor(...u){super(DA(e,t,u))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[NA]=!0,Tu[e]=o}function Qg(e){const t=xA+e.name;return Object.defineProperty(e,"name",{value:t}),e}function jA(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new BA([t,e],t.message);return r.code=t.code,r}return e||t}let UA=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Tu.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};qt("ERR_ASSERTION","%s",Error);qt("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Hi(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let o="The ";e.endsWith(" argument")?o+=`${e} `:o+=`"${e}" ${e.includes(".")?"property":"argument"} `,o+="must be ";const s=[],u=[],f=[];for(const l of t)Hi(typeof l=="string","All expected entries have to be of type string"),$A.includes(l)?s.push(l.toLowerCase()):MA.test(l)?u.push(l):(Hi(l!=="object",'The value "object" should be written as "Object"'),f.push(l));if(u.length>0){const l=s.indexOf("object");l!==-1&&(s.splice(s,l,1),u.push("Object"))}if(s.length>0){switch(s.length){case 1:o+=`of type ${s[0]}`;break;case 2:o+=`one of type ${s[0]} or ${s[1]}`;break;default:{const l=s.pop();o+=`one of type ${s.join(", ")}, or ${l}`}}(u.length>0||f.length>0)&&(o+=" or ")}if(u.length>0){switch(u.length){case 1:o+=`an instance of ${u[0]}`;break;case 2:o+=`an instance of ${u[0]} or ${u[1]}`;break;default:{const l=u.pop();o+=`an instance of ${u.join(", ")}, or ${l}`}}f.length>0&&(o+=" or ")}switch(f.length){case 0:break;case 1:f[0].toLowerCase()!==f[0]&&(o+="an "),o+=`${f[0]}`;break;case 2:o+=`one of ${f[0]} or ${f[1]}`;break;default:{const l=f.pop();o+=`one of ${f.join(", ")}, or ${l}`}}if(r==null)o+=`. Received ${r}`;else if(typeof r=="function"&&r.name)o+=`. Received function ${r.name}`;else if(typeof r=="object"){var h;if((h=r.constructor)!==null&&h!==void 0&&h.name)o+=`. Received an instance of ${r.constructor.name}`;else{const l=hu(r,{depth:-1});o+=`. Received ${l}`}}else{let l=hu(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),o+=`. Received type ${typeof r} (${l})`}return o},TypeError);qt("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let o=hu(t);return o.length>128&&(o=o.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${o}`},TypeError);qt("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var o;const s=r!=null&&(o=r.constructor)!==null&&o!==void 0&&o.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${s}.`},TypeError);qt("ERR_MISSING_ARGS",(...e)=>{Hi(e.length>0,"At least one arg needs to be specified");let t;const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(o=>`"${o}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const o=e.pop();t+=`The ${e.join(", ")}, and ${o} arguments`}break}return`${t} must be specified`},TypeError);qt("ERR_OUT_OF_RANGE",(e,t,r)=>{Hi(t,'Missing "range" argument');let o;if(Number.isInteger(r)&&Math.abs(r)>2**32)o=Zg(String(r));else if(typeof r=="bigint"){o=String(r);const s=BigInt(2)**BigInt(32);(r>s||r<-s)&&(o=Zg(o)),o+="n"}else o=hu(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${o}`},RangeError);qt("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);qt("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);qt("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);qt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);qt("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);qt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);qt("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);qt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);qt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);qt("ERR_STREAM_WRITE_AFTER_END","write after end",Error);qt("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var ur={AbortError:UA,aggregateTwoErrors:Qg(jA),hideStackFrames:Qg,codes:Tu},hs={exports:{}},ep;function Is(){if(ep)return hs.exports;ep=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return hs.exports=e,hs.exports.AbortSignal=t,hs.exports.default=e,hs.exports}(function(e){const t=H.bufferPolyfill,{format:r,inspect:o}=u_,{codes:{ERR_INVALID_ARG_TYPE:s}}=ur,{kResistStopPropagation:u,AggregateError:f,SymbolDispose:h}=vt,l=globalThis.AbortSignal||Is().AbortSignal,p=globalThis.AbortController||Is().AbortController,b=Object.getPrototypeOf(async function(){}).constructor,w=globalThis.Blob||t.Blob,I=typeof w<"u"?function(C){return C instanceof w}:function(C){return!1},A=(v,C)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new s(C,"AbortSignal",v)},x=(v,C)=>{if(typeof v!="function")throw new s(C,"Function",v)};e.exports={AggregateError:f,kEmptyObject:Object.freeze({}),once(v){let C=!1;return function(...B){C||(C=!0,v.apply(this,B))}},createDeferredPromise:function(){let v,C;return{promise:new Promise((P,S)=>{v=P,C=S}),resolve:v,reject:C}},promisify(v){return new Promise((C,B)=>{v((P,...S)=>P?B(P):C(...S))})},debuglog(){return function(){}},format:r,inspect:o,types:{isAsyncFunction(v){return v instanceof b},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:I,deprecate(v,C){return v},addAbortListener:H.requireEvents().addAbortListener||function(C,B){if(C===void 0)throw new s("signal","AbortSignal",C);A(C,"signal"),x(B,"listener");let P;return C.aborted?queueMicrotask(()=>B()):(C.addEventListener("abort",B,{__proto__:null,once:!0,[u]:!0}),P=()=>{C.removeEventListener("abort",B)}),{__proto__:null,[h](){var S;(S=P)===null||S===void 0||S()}}},AbortSignalAny:l.any||function(C){if(C.length===1)return C[0];const B=new p,P=()=>B.abort();return C.forEach(S=>{A(S,"signals"),S.addEventListener("abort",P,{once:!0})}),B.signal.addEventListener("abort",()=>{C.forEach(S=>S.removeEventListener("abort",P))},{once:!0}),B.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(a_);var br=a_.exports,zc={};const{ArrayIsArray:f_,ArrayPrototypeIncludes:kA,ArrayPrototypeJoin:FA,ArrayPrototypeMap:HA,NumberIsInteger:Kc,NumberIsNaN:IN,NumberMAX_SAFE_INTEGER:WA,NumberMIN_SAFE_INTEGER:qA,NumberParseInt:ON,ObjectPrototypeHasOwnProperty:GA,RegExpPrototypeExec:CN,String:VA,StringPrototypeToUpperCase:LN,StringPrototypeTrim:PN}=vt,{hideStackFrames:qr,codes:{ERR_SOCKET_BAD_PORT:BN,ERR_INVALID_ARG_TYPE:Gr,ERR_INVALID_ARG_VALUE:l_,ERR_OUT_OF_RANGE:Co,ERR_UNKNOWN_SIGNAL:NN}}=ur,{normalizeEncoding:$N}=br,{isAsyncFunction:zA,isArrayBufferView:KA}=br.types,JA=qr((e,t,r=qA,o=WA)=>{if(typeof e!="number")throw new Gr(t,"number",e);if(!Kc(e))throw new Co(t,"an integer",e);if(e<r||e>o)throw new Co(t,`>= ${r} && <= ${o}`,e)});qr((e,t,r=-2147483648,o=2147483647)=>{if(typeof e!="number")throw new Gr(t,"number",e);if(!Kc(e))throw new Co(t,"an integer",e);if(e<r||e>o)throw new Co(t,`>= ${r} && <= ${o}`,e)});qr((e,t,r=!1)=>{if(typeof e!="number")throw new Gr(t,"number",e);if(!Kc(e))throw new Co(t,"an integer",e);const o=r?1:0,s=4294967295;if(e<o||e>s)throw new Co(t,`>= ${o} && <= ${s}`,e)});qr((e,t,r)=>{if(!kA(r,e)){const s="must be one of: "+FA(HA(r,u=>typeof u=="string"?`'${u}'`:VA(u)),", ");throw new l_(t,e,s)}});function YA(e,t){if(typeof e!="boolean")throw new Gr(t,"boolean",e)}function Bl(e,t,r){return e==null||!GA(e,t)?r:e[t]}const XA=qr((e,t,r=null)=>{const o=Bl(r,"allowArray",!1),s=Bl(r,"allowFunction",!1);if(!Bl(r,"nullable",!1)&&e===null||!o&&f_(e)||typeof e!="object"&&(!s||typeof e!="function"))throw new Gr(t,"Object",e)});qr((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new Gr(t,"a dictionary",e)});qr((e,t,r=0)=>{if(!f_(e))throw new Gr(t,"Array",e);if(e.length<r){const o=`must be longer than ${r}`;throw new l_(t,e,o)}});qr((e,t="buffer")=>{if(!KA(e))throw new Gr(t,["Buffer","TypedArray","DataView"],e)});const ZA=qr((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Gr(t,"AbortSignal",e)}),QA=qr((e,t)=>{if(typeof e!="function")throw new Gr(t,"Function",e)});qr((e,t)=>{if(typeof e!="function"||zA(e))throw new Gr(t,"Function",e)});qr((e,t)=>{if(e!==void 0)throw new Gr(t,"undefined",e)});var $s={validateBoolean:YA,validateFunction:QA,validateInteger:JA,validateObject:XA,validateAbortSignal:ZA},Jc={exports:{}};const{SymbolAsyncIterator:tp,SymbolIterator:rp,SymbolFor:zi}=vt,c_=zi("nodejs.stream.destroyed"),eT=zi("nodejs.stream.errored"),np=zi("nodejs.stream.readable"),ip=zi("nodejs.stream.writable"),tT=zi("nodejs.stream.disturbed"),rT=zi("nodejs.webstream.isClosedPromise"),nT=zi("nodejs.webstream.controllerErrorFunction");function Yc(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Iu(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function iT(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function Cn(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function d_(e){return!!(e&&!Cn(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function h_(e){return!!(e&&!Cn(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function g_(e){return!!(e&&!Cn(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function oT(e){return d_(e)||h_(e)||g_(e)}function sT(e,t){return e==null?!1:t===!0?typeof e[tp]=="function":t===!1?typeof e[rp]=="function":typeof e[tp]=="function"||typeof e[rp]=="function"}function Ou(e){if(!Cn(e))return null;const t=e._writableState,r=e._readableState,o=t||r;return!!(e.destroyed||e[c_]||o!=null&&o.destroyed)}function aT(e){if(!Iu(e))return null;if(e.writableEnded===!0)return!0;const t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function uT(e,t){if(!Iu(e))return null;if(e.writableFinished===!0)return!0;const r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function p_(e,t){if(!Yc(e))return null;const r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function b_(e){return e&&e[np]!=null?e[np]:typeof(e==null?void 0:e.readable)!="boolean"?null:Ou(e)?!1:Yc(e)&&e.readable&&!p_(e)}function __(e){return e&&e[ip]!=null?e[ip]:typeof(e==null?void 0:e.writable)!="boolean"?null:Ou(e)?!1:Iu(e)&&e.writable&&!aT(e)}function fT(e,t){return Cn(e)?Ou(e)?!0:!((t==null?void 0:t.readable)!==!1&&b_(e)||(t==null?void 0:t.writable)!==!1&&__(e)):null}function lT(e){var t,r;return Cn(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function cT(e){var t,r;return Cn(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function dT(e){if(!Cn(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&y_(e)?e._closed:null}function y_(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function hT(e){return typeof e._sent100=="boolean"&&y_(e)}function gT(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function pT(e){if(!Cn(e))return null;const t=e._writableState,r=e._readableState,o=t||r;return!o&&hT(e)||!!(o&&o.autoDestroy&&o.emitClose&&o.closed===!1)}function bT(e){var t;return!!(e&&((t=e[tT])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function _T(e){var t,r,o,s,u,f,h,l,p,b;return!!(e&&((t=(r=(o=(s=(u=(f=e[eT])!==null&&f!==void 0?f:e.readableErrored)!==null&&u!==void 0?u:e.writableErrored)!==null&&s!==void 0?s:(h=e._readableState)===null||h===void 0?void 0:h.errorEmitted)!==null&&o!==void 0?o:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(p=e._readableState)===null||p===void 0?void 0:p.errored)!==null&&t!==void 0?t:!((b=e._writableState)===null||b===void 0)&&b.errored))}var ei={isDestroyed:Ou,kIsDestroyed:c_,isDisturbed:bT,isErrored:_T,isReadable:b_,kIsClosedPromise:rT,kControllerErrorFunction:nT,isClosed:dT,isDuplexNodeStream:iT,isFinished:fT,isIterable:sT,isReadableNodeStream:Yc,isReadableStream:d_,isReadableFinished:p_,isReadableErrored:cT,isNodeStream:Cn,isWebStream:oT,isWritable:__,isWritableNodeStream:Iu,isWritableStream:h_,isWritableFinished:uT,isWritableErrored:lT,isServerRequest:gT,willEmitClose:pT,isTransformStream:g_};const _i=H.browserExports,{AbortError:w_,codes:yT}=ur,{ERR_INVALID_ARG_TYPE:wT,ERR_STREAM_PREMATURE_CLOSE:op}=yT,{kEmptyObject:wc,once:mc}=br,{validateAbortSignal:mT,validateFunction:ET,validateObject:vT,validateBoolean:ST}=$s,{Promise:RT,PromisePrototypeThen:AT,SymbolDispose:m_}=vt,{isClosed:TT,isReadable:sp,isReadableNodeStream:Nl,isReadableStream:IT,isReadableFinished:ap,isReadableErrored:up,isWritable:fp,isWritableNodeStream:lp,isWritableStream:OT,isWritableFinished:cp,isWritableErrored:dp,isNodeStream:CT,willEmitClose:LT,kIsClosedPromise:PT}=ei;let Ao;function BT(e){return e.setHeader&&typeof e.abort=="function"}const Ec=()=>{};function E_(e,t,r){var o,s;if(arguments.length===2?(r=t,t=wc):t==null?t=wc:vT(t,"options"),ET(r,"callback"),mT(t.signal,"options.signal"),r=mc(r),IT(e)||OT(e))return NT(e,t,r);if(!CT(e))throw new wT("stream",["ReadableStream","WritableStream","Stream"],e);const u=(o=t.readable)!==null&&o!==void 0?o:Nl(e),f=(s=t.writable)!==null&&s!==void 0?s:lp(e),h=e._writableState,l=e._readableState,p=()=>{e.writable||I()};let b=LT(e)&&Nl(e)===u&&lp(e)===f,w=cp(e,!1);const I=()=>{w=!0,e.destroyed&&(b=!1),!(b&&(!e.readable||u))&&(!u||A)&&r.call(e)};let A=ap(e,!1);const x=()=>{A=!0,e.destroyed&&(b=!1),!(b&&(!e.writable||f))&&(!f||w)&&r.call(e)},v=j=>{r.call(e,j)};let C=TT(e);const B=()=>{C=!0;const j=dp(e)||up(e);if(j&&typeof j!="boolean")return r.call(e,j);if(u&&!A&&Nl(e,!0)&&!ap(e,!1))return r.call(e,new op);if(f&&!w&&!cp(e,!1))return r.call(e,new op);r.call(e)},P=()=>{C=!0;const j=dp(e)||up(e);if(j&&typeof j!="boolean")return r.call(e,j);r.call(e)},S=()=>{e.req.on("finish",I)};BT(e)?(e.on("complete",I),b||e.on("abort",B),e.req?S():e.on("request",S)):f&&!h&&(e.on("end",p),e.on("close",p)),!b&&typeof e.aborted=="boolean"&&e.on("aborted",B),e.on("end",x),e.on("finish",I),t.error!==!1&&e.on("error",v),e.on("close",B),C?_i.nextTick(B):h!=null&&h.errorEmitted||l!=null&&l.errorEmitted?b||_i.nextTick(P):(!u&&(!b||sp(e))&&(w||fp(e)===!1)||!f&&(!b||fp(e))&&(A||sp(e)===!1)||l&&e.req&&e.aborted)&&_i.nextTick(P);const m=()=>{r=Ec,e.removeListener("aborted",B),e.removeListener("complete",I),e.removeListener("abort",B),e.removeListener("request",S),e.req&&e.req.removeListener("finish",I),e.removeListener("end",p),e.removeListener("close",p),e.removeListener("finish",I),e.removeListener("end",x),e.removeListener("error",v),e.removeListener("close",B)};if(t.signal&&!C){const j=()=>{const Q=r;m(),Q.call(e,new w_(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)_i.nextTick(j);else{Ao=Ao||br.addAbortListener;const Q=Ao(t.signal,j),ce=r;r=mc((...ue)=>{Q[m_](),ce.apply(e,ue)})}}return m}function NT(e,t,r){let o=!1,s=Ec;if(t.signal)if(s=()=>{o=!0,r.call(e,new w_(void 0,{cause:t.signal.reason}))},t.signal.aborted)_i.nextTick(s);else{Ao=Ao||br.addAbortListener;const f=Ao(t.signal,s),h=r;r=mc((...l)=>{f[m_](),h.apply(e,l)})}const u=(...f)=>{o||_i.nextTick(()=>r.apply(e,f))};return AT(e[PT].promise,u,u),Ec}function $T(e,t){var r;let o=!1;return t===null&&(t=wc),(r=t)!==null&&r!==void 0&&r.cleanup&&(ST(t.cleanup,"cleanup"),o=t.cleanup),new RT((s,u)=>{const f=E_(e,t,h=>{o&&f(),h?u(h):s()})})}Jc.exports=E_;Jc.exports.finished=$T;var Ri=Jc.exports;const Tn=H.browserExports,{aggregateTwoErrors:MT,codes:{ERR_MULTIPLE_CALLBACK:xT},AbortError:DT}=ur,{Symbol:v_}=vt,{kIsDestroyed:jT,isDestroyed:UT,isFinished:kT,isServerRequest:FT}=ei,S_=v_("kDestroy"),vc=v_("kConstruct");function R_(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function HT(e,t){const r=this._readableState,o=this._writableState,s=o||r;return o!=null&&o.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(R_(e,o,r),o&&(o.destroyed=!0),r&&(r.destroyed=!0),s.constructed?hp(this,e,t):this.once(S_,function(u){hp(this,MT(u,e),t)}),this)}function hp(e,t,r){let o=!1;function s(u){if(o)return;o=!0;const f=e._readableState,h=e._writableState;R_(u,h,f),h&&(h.closed=!0),f&&(f.closed=!0),typeof r=="function"&&r(u),u?Tn.nextTick(WT,e,u):Tn.nextTick(A_,e)}try{e._destroy(t||null,s)}catch(u){s(u)}}function WT(e,t){Sc(e,t),A_(e)}function A_(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function Sc(e,t){const r=e._readableState,o=e._writableState;o!=null&&o.errorEmitted||r!=null&&r.errorEmitted||(o&&(o.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function qT(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function Rc(e,t,r){const o=e._readableState,s=e._writableState;if(s!=null&&s.destroyed||o!=null&&o.destroyed)return this;o!=null&&o.autoDestroy||s!=null&&s.autoDestroy?e.destroy(t):t&&(t.stack,s&&!s.errored&&(s.errored=t),o&&!o.errored&&(o.errored=t),r?Tn.nextTick(Sc,e,t):Sc(e,t))}function GT(e,t){if(typeof e._construct!="function")return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(vc,t),!(e.listenerCount(vc)>1)&&Tn.nextTick(VT,e)}function VT(e){let t=!1;function r(o){if(t){Rc(e,o??new xT);return}t=!0;const s=e._readableState,u=e._writableState,f=u||s;s&&(s.constructed=!0),u&&(u.constructed=!0),f.destroyed?e.emit(S_,o):o?Rc(e,o,!0):Tn.nextTick(zT,e)}try{e._construct(o=>{Tn.nextTick(r,o)})}catch(o){Tn.nextTick(r,o)}}function zT(e){e.emit(vc)}function gp(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function T_(e){e.emit("close")}function KT(e,t){e.emit("error",t),Tn.nextTick(T_,e)}function JT(e,t){!e||UT(e)||(!t&&!kT(e)&&(t=new DT),FT(e)?(e.socket=null,e.destroy(t)):gp(e)?e.abort():gp(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Tn.nextTick(KT,e,t):Tn.nextTick(T_,e),e.destroyed||(e[jT]=!0))}var Do={construct:GT,destroyer:JT,destroy:HT,undestroy:qT,errorOrDestroy:Rc};const{ArrayIsArray:YT,ObjectSetPrototypeOf:I_}=vt,{EventEmitter:Cu}=H.requireEvents();function Lu(e){Cu.call(this,e)}I_(Lu.prototype,Cu.prototype);I_(Lu,Cu);Lu.prototype.pipe=function(e,t){const r=this;function o(b){e.writable&&e.write(b)===!1&&r.pause&&r.pause()}r.on("data",o);function s(){r.readable&&r.resume&&r.resume()}e.on("drain",s),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",f),r.on("close",h));let u=!1;function f(){u||(u=!0,e.end())}function h(){u||(u=!0,typeof e.destroy=="function"&&e.destroy())}function l(b){p(),Cu.listenerCount(this,"error")===0&&this.emit("error",b)}Ac(r,"error",l),Ac(e,"error",l);function p(){r.removeListener("data",o),e.removeListener("drain",s),r.removeListener("end",f),r.removeListener("close",h),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",p),r.removeListener("close",p),e.removeListener("close",p)}return r.on("end",p),r.on("close",p),e.on("close",p),e.emit("pipe",r),e};function Ac(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):YT(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var Xc={Stream:Lu,prependListener:Ac},O_={exports:{}};(function(e){const{SymbolDispose:t}=vt,{AbortError:r,codes:o}=ur,{isNodeStream:s,isWebStream:u,kControllerErrorFunction:f}=ei,h=Ri,{ERR_INVALID_ARG_TYPE:l}=o;let p;const b=(w,I)=>{if(typeof w!="object"||!("aborted"in w))throw new l(I,"AbortSignal",w)};e.exports.addAbortSignal=function(I,A){if(b(I,"signal"),!s(A)&&!u(A))throw new l("stream",["ReadableStream","WritableStream","Stream"],A);return e.exports.addAbortSignalNoValidate(I,A)},e.exports.addAbortSignalNoValidate=function(w,I){if(typeof w!="object"||!("aborted"in w))return I;const A=s(I)?()=>{I.destroy(new r(void 0,{cause:w.reason}))}:()=>{I[f](new r(void 0,{cause:w.reason}))};if(w.aborted)A();else{p=p||br.addAbortListener;const x=p(w,A);h(I,x[t])}return I}})(O_);var Pu=O_.exports;const{StringPrototypeSlice:pp,SymbolIterator:XT,TypedArrayPrototypeSet:Ka,Uint8Array:ZT}=vt,{Buffer:$l}=H.bufferPolyfill,{inspect:QT}=br;var eI=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){const r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,o=""+r.data;for(;(r=r.next)!==null;)o+=t+r.data;return o}concat(t){if(this.length===0)return $l.alloc(0);const r=$l.allocUnsafe(t>>>0);let o=this.head,s=0;for(;o;)Ka(r,o.data,s),s+=o.data.length,o=o.next;return r}consume(t,r){const o=this.head.data;if(t<o.length){const s=o.slice(0,t);return this.head.data=o.slice(t),s}return t===o.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[XT](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",o=this.head,s=0;do{const u=o.data;if(t>u.length)r+=u,t-=u.length;else{t===u.length?(r+=u,++s,o.next?this.head=o.next:this.head=this.tail=null):(r+=pp(u,0,t),this.head=o,o.data=pp(u,t));break}++s}while((o=o.next)!==null);return this.length-=s,r}_getBuffer(t){const r=$l.allocUnsafe(t),o=t;let s=this.head,u=0;do{const f=s.data;if(t>f.length)Ka(r,f,o-t),t-=f.length;else{t===f.length?(Ka(r,f,o-t),++u,s.next?this.head=s.next:this.head=this.tail=null):(Ka(r,new ZT(f.buffer,f.byteOffset,t),o-t),this.head=s,s.data=f.slice(t));break}++u}while((s=s.next)!==null);return this.length-=u,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return QT(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:tI,NumberIsInteger:rI}=vt,{validateInteger:nI}=$s,{ERR_INVALID_ARG_VALUE:iI}=ur.codes;let C_=16*1024,L_=16;function oI(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function P_(e){return e?L_:C_}function sI(e,t){nI(t,"value",0),e?L_=t:C_=t}function aI(e,t,r,o){const s=oI(t,o,r);if(s!=null){if(!rI(s)||s<0){const u=o?`options.${r}`:"options.highWaterMark";throw new iI(u,s)}return tI(s)}return P_(e.objectMode)}var Bu={getHighWaterMark:aI,getDefaultHighWaterMark:P_,setDefaultHighWaterMark:sI};const bp=H.browserExports,{PromisePrototypeThen:uI,SymbolAsyncIterator:_p,SymbolIterator:yp}=vt,{Buffer:fI}=H.bufferPolyfill,{ERR_INVALID_ARG_TYPE:lI,ERR_STREAM_NULL_VALUES:cI}=ur.codes;function dI(e,t,r){let o;if(typeof t=="string"||t instanceof fI)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let s;if(t&&t[_p])s=!0,o=t[_p]();else if(t&&t[yp])s=!1,o=t[yp]();else throw new lI("iterable",["Iterable"],t);const u=new e({objectMode:!0,highWaterMark:1,...r});let f=!1;u._read=function(){f||(f=!0,l())},u._destroy=function(p,b){uI(h(p),()=>bp.nextTick(b,p),w=>bp.nextTick(b,w||p))};async function h(p){const b=p!=null,w=typeof o.throw=="function";if(b&&w){const{value:I,done:A}=await o.throw(p);if(await I,A)return}if(typeof o.return=="function"){const{value:I}=await o.return();await I}}async function l(){for(;;){try{const{value:p,done:b}=s?await o.next():o.next();if(b)u.push(null);else{const w=p&&typeof p.then=="function"?await p:p;if(w===null)throw f=!1,new cI;if(u.push(w))continue;f=!1}}catch(p){u.destroy(p)}break}}return u}var B_=dI,Ml,wp;function Nu(){if(wp)return Ml;wp=1;const e=H.browserExports,{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:f,ObjectSetPrototypeOf:h,Promise:l,SafeSet:p,SymbolAsyncDispose:b,SymbolAsyncIterator:w,Symbol:I}=vt;Ml=Re,Re.ReadableState=Ue;const{EventEmitter:A}=H.requireEvents(),{Stream:x,prependListener:v}=Xc,{Buffer:C}=H.bufferPolyfill,{addAbortSignal:B}=Pu,P=Ri;let S=br.debuglog("stream",N=>{S=N});const m=eI,j=Do,{getHighWaterMark:Q,getDefaultHighWaterMark:ce}=Bu,{aggregateTwoErrors:ue,codes:{ERR_INVALID_ARG_TYPE:te,ERR_METHOD_NOT_IMPLEMENTED:Se,ERR_OUT_OF_RANGE:me,ERR_STREAM_PUSH_AFTER_EOF:F,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:U},AbortError:$}=ur,{validateObject:G}=$s,Y=I("kPaused"),{StringDecoder:V}=H.requireString_decoder(),ne=B_;h(Re.prototype,x.prototype),h(Re,x);const W=()=>{},{errorOrDestroy:K}=j,ae=1,de=2,re=4,_e=8,be=16,R=32,O=64,q=128,oe=256,ye=512,d=1024,g=2048,_=4096,E=8192,J=16384,ie=32768,se=65536,Ie=1<<17,Be=1<<18;function Ce(N){return{enumerable:!1,get(){return(this.state&N)!==0},set(D){D?this.state|=N:this.state&=~N}}}u(Ue.prototype,{objectMode:Ce(ae),ended:Ce(de),endEmitted:Ce(re),reading:Ce(_e),constructed:Ce(be),sync:Ce(R),needReadable:Ce(O),emittedReadable:Ce(q),readableListening:Ce(oe),resumeScheduled:Ce(ye),errorEmitted:Ce(d),emitClose:Ce(g),autoDestroy:Ce(_),destroyed:Ce(E),closed:Ce(J),closeEmitted:Ce(ie),multiAwaitDrain:Ce(se),readingMore:Ce(Ie),dataEmitted:Ce(Be)});function Ue(N,D,Ee){typeof Ee!="boolean"&&(Ee=D instanceof Yn()),this.state=g|_|be|R,N&&N.objectMode&&(this.state|=ae),Ee&&N&&N.readableObjectMode&&(this.state|=ae),this.highWaterMark=N?Q(this,N,"readableHighWaterMark",Ee):ce(!1),this.buffer=new m,this.length=0,this.pipes=[],this.flowing=null,this[Y]=null,N&&N.emitClose===!1&&(this.state&=-2049),N&&N.autoDestroy===!1&&(this.state&=-4097),this.errored=null,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,N&&N.encoding&&(this.decoder=new V(N.encoding),this.encoding=N.encoding)}function Re(N){if(!(this instanceof Re))return new Re(N);const D=this instanceof Yn();this._readableState=new Ue(N,this,D),N&&(typeof N.read=="function"&&(this._read=N.read),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.construct=="function"&&(this._construct=N.construct),N.signal&&!D&&B(N.signal,this)),x.call(this,N),j.construct(this,()=>{this._readableState.needReadable&&at(this,this._readableState)})}Re.prototype.destroy=j.destroy,Re.prototype._undestroy=j.undestroy,Re.prototype._destroy=function(N,D){D(N)},Re.prototype[A.captureRejectionSymbol]=function(N){this.destroy(N)},Re.prototype[b]=function(){let N;return this.destroyed||(N=this.readableEnded?null:new $,this.destroy(N)),new l((D,Ee)=>P(this,ve=>ve&&ve!==N?Ee(ve):D(null)))},Re.prototype.push=function(N,D){return He(this,N,D,!1)},Re.prototype.unshift=function(N,D){return He(this,N,D,!0)};function He(N,D,Ee,ve){S("readableAddChunk",D);const Te=N._readableState;let yt;if(Te.state&ae||(typeof D=="string"?(Ee=Ee||Te.defaultEncoding,Te.encoding!==Ee&&(ve&&Te.encoding?D=C.from(D,Ee).toString(Te.encoding):(D=C.from(D,Ee),Ee=""))):D instanceof C?Ee="":x._isUint8Array(D)?(D=x._uint8ArrayToBuffer(D),Ee=""):D!=null&&(yt=new te("chunk",["string","Buffer","Uint8Array"],D))),yt)K(N,yt);else if(D===null)Te.state&=-9,Ve(N,Te);else if(Te.state&ae||D&&D.length>0)if(ve)if(Te.state&re)K(N,new U);else{if(Te.destroyed||Te.errored)return!1;bt(N,Te,D,!0)}else if(Te.ended)K(N,new F);else{if(Te.destroyed||Te.errored)return!1;Te.state&=-9,Te.decoder&&!Ee?(D=Te.decoder.write(D),Te.objectMode||D.length!==0?bt(N,Te,D,!1):at(N,Te)):bt(N,Te,D,!1)}else ve||(Te.state&=-9,at(N,Te));return!Te.ended&&(Te.length<Te.highWaterMark||Te.length===0)}function bt(N,D,Ee,ve){D.flowing&&D.length===0&&!D.sync&&N.listenerCount("data")>0?(D.state&se?D.awaitDrainWriters.clear():D.awaitDrainWriters=null,D.dataEmitted=!0,N.emit("data",Ee)):(D.length+=D.objectMode?1:Ee.length,ve?D.buffer.unshift(Ee):D.buffer.push(Ee),D.state&O&&Dt(N)),at(N,D)}Re.prototype.isPaused=function(){const N=this._readableState;return N[Y]===!0||N.flowing===!1},Re.prototype.setEncoding=function(N){const D=new V(N);this._readableState.decoder=D,this._readableState.encoding=this._readableState.decoder.encoding;const Ee=this._readableState.buffer;let ve="";for(const Te of Ee)ve+=D.write(Te);return Ee.clear(),ve!==""&&Ee.push(ve),this._readableState.length=ve.length,this};const et=1073741824;function _t(N){if(N>et)throw new me("size","<= 1GiB",N);return N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++,N}function Ye(N,D){return N<=0||D.length===0&&D.ended?0:D.state&ae?1:o(N)?D.flowing&&D.length?D.buffer.first().length:D.length:N<=D.length?N:D.ended?D.length:0}Re.prototype.read=function(N){S("read",N),N===void 0?N=NaN:r(N)||(N=s(N,10));const D=this._readableState,Ee=N;if(N>D.highWaterMark&&(D.highWaterMark=_t(N)),N!==0&&(D.state&=-129),N===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return S("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?Or(this):Dt(this),null;if(N=Ye(N,D),N===0&&D.ended)return D.length===0&&Or(this),null;let ve=(D.state&O)!==0;if(S("need readable",ve),(D.length===0||D.length-N<D.highWaterMark)&&(ve=!0,S("length less than watermark",ve)),D.ended||D.reading||D.destroyed||D.errored||!D.constructed)ve=!1,S("reading, ended or constructing",ve);else if(ve){S("do read"),D.state|=_e|R,D.length===0&&(D.state|=O);try{this._read(D.highWaterMark)}catch(yt){K(this,yt)}D.state&=-33,D.reading||(N=Ye(Ee,D))}let Te;return N>0?Te=tr(N,D):Te=null,Te===null?(D.needReadable=D.length<=D.highWaterMark,N=0):(D.length-=N,D.multiAwaitDrain?D.awaitDrainWriters.clear():D.awaitDrainWriters=null),D.length===0&&(D.ended||(D.needReadable=!0),Ee!==N&&D.ended&&Or(this)),Te!==null&&!D.errorEmitted&&!D.closeEmitted&&(D.dataEmitted=!0,this.emit("data",Te)),Te};function Ve(N,D){if(S("onEofChunk"),!D.ended){if(D.decoder){const Ee=D.decoder.end();Ee&&Ee.length&&(D.buffer.push(Ee),D.length+=D.objectMode?1:Ee.length)}D.ended=!0,D.sync?Dt(N):(D.needReadable=!1,D.emittedReadable=!0,Lt(N))}}function Dt(N){const D=N._readableState;S("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(S("emitReadable",D.flowing),D.emittedReadable=!0,e.nextTick(Lt,N))}function Lt(N){const D=N._readableState;S("emitReadable_",D.destroyed,D.length,D.ended),!D.destroyed&&!D.errored&&(D.length||D.ended)&&(N.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,Kr(N)}function at(N,D){!D.readingMore&&D.constructed&&(D.readingMore=!0,e.nextTick(Bt,N,D))}function Bt(N,D){for(;!D.reading&&!D.ended&&(D.length<D.highWaterMark||D.flowing&&D.length===0);){const Ee=D.length;if(S("maybeReadMore read 0"),N.read(0),Ee===D.length)break}D.readingMore=!1}Re.prototype._read=function(N){throw new Se("_read()")},Re.prototype.pipe=function(N,D){const Ee=this,ve=this._readableState;ve.pipes.length===1&&(ve.multiAwaitDrain||(ve.multiAwaitDrain=!0,ve.awaitDrainWriters=new p(ve.awaitDrainWriters?[ve.awaitDrainWriters]:[]))),ve.pipes.push(N),S("pipe count=%d opts=%j",ve.pipes.length,D);const yt=(!D||D.end!==!1)&&N!==e.stdout&&N!==e.stderr?fn:yr;ve.endEmitted?e.nextTick(yt):Ee.once("end",yt),N.on("unpipe",St);function St(nr,Ft){S("onunpipe"),nr===Ee&&Ft&&Ft.hasUnpiped===!1&&(Ft.hasUnpiped=!0,Pn())}function fn(){S("onend"),N.end()}let Pt,ln=!1;function Pn(){S("cleanup"),N.removeListener("close",Gt),N.removeListener("finish",Cr),Pt&&N.removeListener("drain",Pt),N.removeListener("error",Yr),N.removeListener("unpipe",St),Ee.removeListener("end",fn),Ee.removeListener("end",yr),Ee.removeListener("data",dn),ln=!0,Pt&&ve.awaitDrainWriters&&(!N._writableState||N._writableState.needDrain)&&Pt()}function cn(){ln||(ve.pipes.length===1&&ve.pipes[0]===N?(S("false write response, pause",0),ve.awaitDrainWriters=N,ve.multiAwaitDrain=!1):ve.pipes.length>1&&ve.pipes.includes(N)&&(S("false write response, pause",ve.awaitDrainWriters.size),ve.awaitDrainWriters.add(N)),Ee.pause()),Pt||(Pt=fr(Ee,N),N.on("drain",Pt))}Ee.on("data",dn);function dn(nr){S("ondata");const Ft=N.write(nr);S("dest.write",Ft),Ft===!1&&cn()}function Yr(nr){if(S("onerror",nr),yr(),N.removeListener("error",Yr),N.listenerCount("error")===0){const Ft=N._writableState||N._readableState;Ft&&!Ft.errorEmitted?K(N,nr):N.emit("error",nr)}}v(N,"error",Yr);function Gt(){N.removeListener("finish",Cr),yr()}N.once("close",Gt);function Cr(){S("onfinish"),N.removeListener("close",Gt),yr()}N.once("finish",Cr);function yr(){S("unpipe"),Ee.unpipe(N)}return N.emit("pipe",Ee),N.writableNeedDrain===!0?cn():ve.flowing||(S("pipe resume"),Ee.resume()),N};function fr(N,D){return function(){const ve=N._readableState;ve.awaitDrainWriters===D?(S("pipeOnDrain",1),ve.awaitDrainWriters=null):ve.multiAwaitDrain&&(S("pipeOnDrain",ve.awaitDrainWriters.size),ve.awaitDrainWriters.delete(D)),(!ve.awaitDrainWriters||ve.awaitDrainWriters.size===0)&&N.listenerCount("data")&&N.resume()}}Re.prototype.unpipe=function(N){const D=this._readableState,Ee={hasUnpiped:!1};if(D.pipes.length===0)return this;if(!N){const Te=D.pipes;D.pipes=[],this.pause();for(let yt=0;yt<Te.length;yt++)Te[yt].emit("unpipe",this,{hasUnpiped:!1});return this}const ve=t(D.pipes,N);return ve===-1?this:(D.pipes.splice(ve,1),D.pipes.length===0&&this.pause(),N.emit("unpipe",this,Ee),this)},Re.prototype.on=function(N,D){const Ee=x.prototype.on.call(this,N,D),ve=this._readableState;return N==="data"?(ve.readableListening=this.listenerCount("readable")>0,ve.flowing!==!1&&this.resume()):N==="readable"&&!ve.endEmitted&&!ve.readableListening&&(ve.readableListening=ve.needReadable=!0,ve.flowing=!1,ve.emittedReadable=!1,S("on readable",ve.length,ve.reading),ve.length?Dt(this):ve.reading||e.nextTick(kt,this)),Ee},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(N,D){const Ee=x.prototype.removeListener.call(this,N,D);return N==="readable"&&e.nextTick(er,this),Ee},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(N){const D=x.prototype.removeAllListeners.apply(this,arguments);return(N==="readable"||N===void 0)&&e.nextTick(er,this),D};function er(N){const D=N._readableState;D.readableListening=N.listenerCount("readable")>0,D.resumeScheduled&&D[Y]===!1?D.flowing=!0:N.listenerCount("data")>0?N.resume():D.readableListening||(D.flowing=null)}function kt(N){S("readable nexttick read 0"),N.read(0)}Re.prototype.resume=function(){const N=this._readableState;return N.flowing||(S("resume"),N.flowing=!N.readableListening,lr(this,N)),N[Y]=!1,this};function lr(N,D){D.resumeScheduled||(D.resumeScheduled=!0,e.nextTick(zr,N,D))}function zr(N,D){S("resume",D.reading),D.reading||N.read(0),D.resumeScheduled=!1,N.emit("resume"),Kr(N),D.flowing&&!D.reading&&N.read(0)}Re.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Y]=!0,this};function Kr(N){const D=N._readableState;for(S("flow",D.flowing);D.flowing&&N.read()!==null;);}Re.prototype.wrap=function(N){let D=!1;N.on("data",ve=>{!this.push(ve)&&N.pause&&(D=!0,N.pause())}),N.on("end",()=>{this.push(null)}),N.on("error",ve=>{K(this,ve)}),N.on("close",()=>{this.destroy()}),N.on("destroy",()=>{this.destroy()}),this._read=()=>{D&&N.resume&&(D=!1,N.resume())};const Ee=f(N);for(let ve=1;ve<Ee.length;ve++){const Te=Ee[ve];this[Te]===void 0&&typeof N[Te]=="function"&&(this[Te]=N[Te].bind(N))}return this},Re.prototype[w]=function(){return sn(this)},Re.prototype.iterator=function(N){return N!==void 0&&G(N,"options"),sn(this,N)};function sn(N,D){typeof N.read!="function"&&(N=Re.wrap(N,{objectMode:!0}));const Ee=an(N,D);return Ee.stream=N,Ee}async function*an(N,D){let Ee=W;function ve(St){this===N?(Ee(),Ee=W):Ee=St}N.on("readable",ve);let Te;const yt=P(N,{writable:!1},St=>{Te=St?ue(Te,St):null,Ee(),Ee=W});try{for(;;){const St=N.destroyed?null:N.read();if(St!==null)yield St;else{if(Te)throw Te;if(Te===null)return;await new l(ve)}}}catch(St){throw Te=ue(Te,St),Te}finally{(Te||(D==null?void 0:D.destroyOnReturn)!==!1)&&(Te===void 0||N._readableState.autoDestroy)?j.destroyer(N,null):(N.off("readable",ve),yt())}}u(Re.prototype,{readable:{__proto__:null,get(){const N=this._readableState;return!!N&&N.readable!==!1&&!N.destroyed&&!N.errorEmitted&&!N.endEmitted},set(N){this._readableState&&(this._readableState.readable=!!N)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(N){this._readableState&&(this._readableState.flowing=N)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(N){this._readableState&&(this._readableState.destroyed=N)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(Ue.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Y]!==!1},set(N){this[Y]=!!N}}}),Re._fromList=tr;function tr(N,D){if(D.length===0)return null;let Ee;return D.objectMode?Ee=D.buffer.shift():!N||N>=D.length?(D.decoder?Ee=D.buffer.join(""):D.buffer.length===1?Ee=D.buffer.first():Ee=D.buffer.concat(D.length),D.buffer.clear()):Ee=D.buffer.consume(N,D.decoder),Ee}function Or(N){const D=N._readableState;S("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,e.nextTick(rr,D,N))}function rr(N,D){if(S("endReadableNT",N.endEmitted,N.length),!N.errored&&!N.closeEmitted&&!N.endEmitted&&N.length===0){if(N.endEmitted=!0,D.emit("end"),D.writable&&D.allowHalfOpen===!1)e.nextTick(Ln,D);else if(N.autoDestroy){const Ee=D._writableState;(!Ee||Ee.autoDestroy&&(Ee.finished||Ee.writable===!1))&&D.destroy()}}}function Ln(N){N.writable&&!N.writableEnded&&!N.destroyed&&N.end()}Re.from=function(N,D){return ne(Re,N,D)};let Jr;function un(){return Jr===void 0&&(Jr={}),Jr}return Re.fromWeb=function(N,D){return un().newStreamReadableFromReadableStream(N,D)},Re.toWeb=function(N,D){return un().newReadableStreamFromStreamReadable(N,D)},Re.wrap=function(N,D){var Ee,ve;return new Re({objectMode:(Ee=(ve=N.readableObjectMode)!==null&&ve!==void 0?ve:N.objectMode)!==null&&Ee!==void 0?Ee:!0,...D,destroy(Te,yt){j.destroyer(N,Te),yt(Te)}}).wrap(N)},Ml}var xl,mp;function Zc(){if(mp)return xl;mp=1;const e=H.browserExports,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:f,StringPrototypeToLowerCase:h,Symbol:l,SymbolHasInstance:p}=vt;xl=G,G.WritableState=U;const{EventEmitter:b}=H.requireEvents(),w=Xc.Stream,{Buffer:I}=H.bufferPolyfill,A=Do,{addAbortSignal:x}=Pu,{getHighWaterMark:v,getDefaultHighWaterMark:C}=Bu,{ERR_INVALID_ARG_TYPE:B,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:m,ERR_STREAM_DESTROYED:j,ERR_STREAM_ALREADY_FINISHED:Q,ERR_STREAM_NULL_VALUES:ce,ERR_STREAM_WRITE_AFTER_END:ue,ERR_UNKNOWN_ENCODING:te}=ur.codes,{errorOrDestroy:Se}=A;f(G.prototype,w.prototype),f(G,w);function me(){}const F=l("kOnFinished");function U(_,E,J){typeof J!="boolean"&&(J=E instanceof Yn()),this.objectMode=!!(_&&_.objectMode),J&&(this.objectMode=this.objectMode||!!(_&&_.writableObjectMode)),this.highWaterMark=_?v(this,_,"writableHighWaterMark",J):C(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ie=!!(_&&_.decodeStrings===!1);this.decodeStrings=!ie,this.defaultEncoding=_&&_.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=K.bind(void 0,E),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!_||_.emitClose!==!1,this.autoDestroy=!_||_.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[F]=[]}function $(_){_.buffered=[],_.bufferedIndex=0,_.allBuffers=!0,_.allNoop=!0}U.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},s(U.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function G(_){const E=this instanceof Yn();if(!E&&!o(G,this))return new G(_);this._writableState=new U(_,this,E),_&&(typeof _.write=="function"&&(this._write=_.write),typeof _.writev=="function"&&(this._writev=_.writev),typeof _.destroy=="function"&&(this._destroy=_.destroy),typeof _.final=="function"&&(this._final=_.final),typeof _.construct=="function"&&(this._construct=_.construct),_.signal&&x(_.signal,this)),w.call(this,_),A.construct(this,()=>{const J=this._writableState;J.writing||_e(this,J),q(this,J)})}s(G,p,{__proto__:null,value:function(_){return o(this,_)?!0:this!==G?!1:_&&_._writableState instanceof U}}),G.prototype.pipe=function(){Se(this,new m)};function Y(_,E,J,ie){const se=_._writableState;if(typeof J=="function")ie=J,J=se.defaultEncoding;else{if(!J)J=se.defaultEncoding;else if(J!=="buffer"&&!I.isEncoding(J))throw new te(J);typeof ie!="function"&&(ie=me)}if(E===null)throw new ce;if(!se.objectMode)if(typeof E=="string")se.decodeStrings!==!1&&(E=I.from(E,J),J="buffer");else if(E instanceof I)J="buffer";else if(w._isUint8Array(E))E=w._uint8ArrayToBuffer(E),J="buffer";else throw new B("chunk",["string","Buffer","Uint8Array"],E);let Ie;return se.ending?Ie=new ue:se.destroyed&&(Ie=new j("write")),Ie?(e.nextTick(ie,Ie),Se(_,Ie,!0),Ie):(se.pendingcb++,V(_,se,E,J,ie))}G.prototype.write=function(_,E,J){return Y(this,_,E,J)===!0},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){const _=this._writableState;_.corked&&(_.corked--,_.writing||_e(this,_))},G.prototype.setDefaultEncoding=function(E){if(typeof E=="string"&&(E=h(E)),!I.isEncoding(E))throw new te(E);return this._writableState.defaultEncoding=E,this};function V(_,E,J,ie,se){const Ie=E.objectMode?1:J.length;E.length+=Ie;const Be=E.length<E.highWaterMark;return Be||(E.needDrain=!0),E.writing||E.corked||E.errored||!E.constructed?(E.buffered.push({chunk:J,encoding:ie,callback:se}),E.allBuffers&&ie!=="buffer"&&(E.allBuffers=!1),E.allNoop&&se!==me&&(E.allNoop=!1)):(E.writelen=Ie,E.writecb=se,E.writing=!0,E.sync=!0,_._write(J,ie,E.onwrite),E.sync=!1),Be&&!E.errored&&!E.destroyed}function ne(_,E,J,ie,se,Ie,Be){E.writelen=ie,E.writecb=Be,E.writing=!0,E.sync=!0,E.destroyed?E.onwrite(new j("write")):J?_._writev(se,E.onwrite):_._write(se,Ie,E.onwrite),E.sync=!1}function W(_,E,J,ie){--E.pendingcb,ie(J),re(E),Se(_,J)}function K(_,E){const J=_._writableState,ie=J.sync,se=J.writecb;if(typeof se!="function"){Se(_,new S);return}J.writing=!1,J.writecb=null,J.length-=J.writelen,J.writelen=0,E?(E.stack,J.errored||(J.errored=E),_._readableState&&!_._readableState.errored&&(_._readableState.errored=E),ie?e.nextTick(W,_,J,E,se):W(_,J,E,se)):(J.buffered.length>J.bufferedIndex&&_e(_,J),ie?J.afterWriteTickInfo!==null&&J.afterWriteTickInfo.cb===se?J.afterWriteTickInfo.count++:(J.afterWriteTickInfo={count:1,cb:se,stream:_,state:J},e.nextTick(ae,J.afterWriteTickInfo)):de(_,J,1,se))}function ae({stream:_,state:E,count:J,cb:ie}){return E.afterWriteTickInfo=null,de(_,E,J,ie)}function de(_,E,J,ie){for(!E.ending&&!_.destroyed&&E.length===0&&E.needDrain&&(E.needDrain=!1,_.emit("drain"));J-- >0;)E.pendingcb--,ie();E.destroyed&&re(E),q(_,E)}function re(_){if(_.writing)return;for(let se=_.bufferedIndex;se<_.buffered.length;++se){var E;const{chunk:Ie,callback:Be}=_.buffered[se],Ce=_.objectMode?1:Ie.length;_.length-=Ce,Be((E=_.errored)!==null&&E!==void 0?E:new j("write"))}const J=_[F].splice(0);for(let se=0;se<J.length;se++){var ie;J[se]((ie=_.errored)!==null&&ie!==void 0?ie:new j("end"))}$(_)}function _e(_,E){if(E.corked||E.bufferProcessing||E.destroyed||!E.constructed)return;const{buffered:J,bufferedIndex:ie,objectMode:se}=E,Ie=J.length-ie;if(!Ie)return;let Be=ie;if(E.bufferProcessing=!0,Ie>1&&_._writev){E.pendingcb-=Ie-1;const Ce=E.allNoop?me:Re=>{for(let He=Be;He<J.length;++He)J[He].callback(Re)},Ue=E.allNoop&&Be===0?J:t(J,Be);Ue.allBuffers=E.allBuffers,ne(_,E,!0,E.length,Ue,"",Ce),$(E)}else{do{const{chunk:Ce,encoding:Ue,callback:Re}=J[Be];J[Be++]=null;const He=se?1:Ce.length;ne(_,E,!1,He,Ce,Ue,Re)}while(Be<J.length&&!E.writing);Be===J.length?$(E):Be>256?(J.splice(0,Be),E.bufferedIndex=0):E.bufferedIndex=Be}E.bufferProcessing=!1}G.prototype._write=function(_,E,J){if(this._writev)this._writev([{chunk:_,encoding:E}],J);else throw new P("_write()")},G.prototype._writev=null,G.prototype.end=function(_,E,J){const ie=this._writableState;typeof _=="function"?(J=_,_=null,E=null):typeof E=="function"&&(J=E,E=null);let se;if(_!=null){const Ie=Y(this,_,E);Ie instanceof r&&(se=Ie)}return ie.corked&&(ie.corked=1,this.uncork()),se||(!ie.errored&&!ie.ending?(ie.ending=!0,q(this,ie,!0),ie.ended=!0):ie.finished?se=new Q("end"):ie.destroyed&&(se=new j("end"))),typeof J=="function"&&(se||ie.finished?e.nextTick(J,se):ie[F].push(J)),this};function be(_){return _.ending&&!_.destroyed&&_.constructed&&_.length===0&&!_.errored&&_.buffered.length===0&&!_.finished&&!_.writing&&!_.errorEmitted&&!_.closeEmitted}function R(_,E){let J=!1;function ie(se){if(J){Se(_,se??S());return}if(J=!0,E.pendingcb--,se){const Ie=E[F].splice(0);for(let Be=0;Be<Ie.length;Be++)Ie[Be](se);Se(_,se,E.sync)}else be(E)&&(E.prefinished=!0,_.emit("prefinish"),E.pendingcb++,e.nextTick(oe,_,E))}E.sync=!0,E.pendingcb++;try{_._final(ie)}catch(se){ie(se)}E.sync=!1}function O(_,E){!E.prefinished&&!E.finalCalled&&(typeof _._final=="function"&&!E.destroyed?(E.finalCalled=!0,R(_,E)):(E.prefinished=!0,_.emit("prefinish")))}function q(_,E,J){be(E)&&(O(_,E),E.pendingcb===0&&(J?(E.pendingcb++,e.nextTick((ie,se)=>{be(se)?oe(ie,se):se.pendingcb--},_,E)):be(E)&&(E.pendingcb++,oe(_,E))))}function oe(_,E){E.pendingcb--,E.finished=!0;const J=E[F].splice(0);for(let ie=0;ie<J.length;ie++)J[ie]();if(_.emit("finish"),E.autoDestroy){const ie=_._readableState;(!ie||ie.autoDestroy&&(ie.endEmitted||ie.readable===!1))&&_.destroy()}}u(G.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(_){this._writableState&&(this._writableState.destroyed=_)}},writable:{__proto__:null,get(){const _=this._writableState;return!!_&&_.writable!==!1&&!_.destroyed&&!_.errored&&!_.ending&&!_.ended},set(_){this._writableState&&(this._writableState.writable=!!_)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const _=this._writableState;return _?!_.destroyed&&!_.ending&&_.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ye=A.destroy;G.prototype.destroy=function(_,E){const J=this._writableState;return!J.destroyed&&(J.bufferedIndex<J.buffered.length||J[F].length)&&e.nextTick(re,J),ye.call(this,_,E),this},G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(_,E){E(_)},G.prototype[b.captureRejectionSymbol]=function(_){this.destroy(_)};let d;function g(){return d===void 0&&(d={}),d}return G.fromWeb=function(_,E){return g().newStreamWritableFromWritableStream(_,E)},G.toWeb=function(_){return g().newWritableStreamFromStreamWritable(_)},xl}var Dl,Ep;function hI(){if(Ep)return Dl;Ep=1;const e=H.browserExports,t=H.bufferPolyfill,{isReadable:r,isWritable:o,isIterable:s,isNodeStream:u,isReadableNodeStream:f,isWritableNodeStream:h,isDuplexNodeStream:l,isReadableStream:p,isWritableStream:b}=ei,w=Ri,{AbortError:I,codes:{ERR_INVALID_ARG_TYPE:A,ERR_INVALID_RETURN_VALUE:x}}=ur,{destroyer:v}=Do,C=Yn(),B=Nu(),P=Zc(),{createDeferredPromise:S}=br,m=B_,j=globalThis.Blob||t.Blob,Q=typeof j<"u"?function(U){return U instanceof j}:function(U){return!1},ce=globalThis.AbortController||Is().AbortController,{FunctionPrototypeCall:ue}=vt;class te extends C{constructor(U){super(U),(U==null?void 0:U.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(U==null?void 0:U.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Dl=function F(U,$){if(l(U))return U;if(f(U))return me({readable:U});if(h(U))return me({writable:U});if(u(U))return me({writable:!1,readable:!1});if(p(U))return me({readable:B.fromWeb(U)});if(b(U))return me({writable:P.fromWeb(U)});if(typeof U=="function"){const{value:Y,write:V,final:ne,destroy:W}=Se(U);if(s(Y))return m(te,Y,{objectMode:!0,write:V,final:ne,destroy:W});const K=Y==null?void 0:Y.then;if(typeof K=="function"){let ae;const de=ue(K,Y,re=>{if(re!=null)throw new x("nully","body",re)},re=>{v(ae,re)});return ae=new te({objectMode:!0,readable:!1,write:V,final(re){ne(async()=>{try{await de,e.nextTick(re,null)}catch(_e){e.nextTick(re,_e)}})},destroy:W})}throw new x("Iterable, AsyncIterable or AsyncFunction",$,Y)}if(Q(U))return F(U.arrayBuffer());if(s(U))return m(te,U,{objectMode:!0,writable:!1});if(p(U==null?void 0:U.readable)&&b(U==null?void 0:U.writable))return te.fromWeb(U);if(typeof(U==null?void 0:U.writable)=="object"||typeof(U==null?void 0:U.readable)=="object"){const Y=U!=null&&U.readable?f(U==null?void 0:U.readable)?U==null?void 0:U.readable:F(U.readable):void 0,V=U!=null&&U.writable?h(U==null?void 0:U.writable)?U==null?void 0:U.writable:F(U.writable):void 0;return me({readable:Y,writable:V})}const G=U==null?void 0:U.then;if(typeof G=="function"){let Y;return ue(G,U,V=>{V!=null&&Y.push(V),Y.push(null)},V=>{v(Y,V)}),Y=new te({objectMode:!0,writable:!1,read(){}})}throw new A($,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],U)};function Se(F){let{promise:U,resolve:$}=S();const G=new ce,Y=G.signal;return{value:F(async function*(){for(;;){const ne=U;U=null;const{chunk:W,done:K,cb:ae}=await ne;if(e.nextTick(ae),K)return;if(Y.aborted)throw new I(void 0,{cause:Y.reason});({promise:U,resolve:$}=S()),yield W}}(),{signal:Y}),write(ne,W,K){const ae=$;$=null,ae({chunk:ne,done:!1,cb:K})},final(ne){const W=$;$=null,W({done:!0,cb:ne})},destroy(ne,W){G.abort(),W(ne)}}}function me(F){const U=F.readable&&typeof F.readable.read!="function"?B.wrap(F.readable):F.readable,$=F.writable;let G=!!r(U),Y=!!o($),V,ne,W,K,ae;function de(re){const _e=K;K=null,_e?_e(re):re&&ae.destroy(re)}return ae=new te({readableObjectMode:!!(U!=null&&U.readableObjectMode),writableObjectMode:!!($!=null&&$.writableObjectMode),readable:G,writable:Y}),Y&&(w($,re=>{Y=!1,re&&v(U,re),de(re)}),ae._write=function(re,_e,be){$.write(re,_e)?be():V=be},ae._final=function(re){$.end(),ne=re},$.on("drain",function(){if(V){const re=V;V=null,re()}}),$.on("finish",function(){if(ne){const re=ne;ne=null,re()}})),G&&(w(U,re=>{G=!1,re&&v(U,re),de(re)}),U.on("readable",function(){if(W){const re=W;W=null,re()}}),U.on("end",function(){ae.push(null)}),ae._read=function(){for(;;){const re=U.read();if(re===null){W=ae._read;return}if(!ae.push(re))return}}),ae._destroy=function(re,_e){!re&&K!==null&&(re=new I),W=null,V=null,ne=null,K===null?_e(re):(K=_e,v($,re),v(U,re))},ae}return Dl}var jl,vp;function Yn(){if(vp)return jl;vp=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:o}=vt;jl=f;const s=Nu(),u=Zc();o(f.prototype,s.prototype),o(f,s);{const b=r(u.prototype);for(let w=0;w<b.length;w++){const I=b[w];f.prototype[I]||(f.prototype[I]=u.prototype[I])}}function f(b){if(!(this instanceof f))return new f(b);s.call(this,b),u.call(this,b),b?(this.allowHalfOpen=b.allowHalfOpen!==!1,b.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),b.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(f.prototype,{writable:{__proto__:null,...t(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(u.prototype,"writableLength")},writableFinished:{__proto__:null,...t(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(b){this._readableState&&this._writableState&&(this._readableState.destroyed=b,this._writableState.destroyed=b)}}});let h;function l(){return h===void 0&&(h={}),h}f.fromWeb=function(b,w){return l().newStreamDuplexFromReadableWritablePair(b,w)},f.toWeb=function(b){return l().newReadableWritablePairFromDuplex(b)};let p;return f.from=function(b){return p||(p=hI()),p(b,"body")},jl}const{ObjectSetPrototypeOf:N_,Symbol:gI}=vt;var $_=Xn;const{ERR_METHOD_NOT_IMPLEMENTED:pI}=ur.codes,Qc=Yn(),{getHighWaterMark:bI}=Bu;N_(Xn.prototype,Qc.prototype);N_(Xn,Qc);const Es=gI("kCallback");function Xn(e){if(!(this instanceof Xn))return new Xn(e);const t=e?bI(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),Qc.call(this,e),this._readableState.sync=!1,this[Es]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",_I)}function Tc(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function _I(){this._final!==Tc&&Tc.call(this)}Xn.prototype._final=Tc;Xn.prototype._transform=function(e,t,r){throw new pI("_transform()")};Xn.prototype._write=function(e,t,r){const o=this._readableState,s=this._writableState,u=o.length;this._transform(e,t,(f,h)=>{if(f){r(f);return}h!=null&&this.push(h),s.ended||u===o.length||o.length<o.highWaterMark?r():this[Es]=r})};Xn.prototype._read=function(){if(this[Es]){const e=this[Es];this[Es]=null,e()}};const{ObjectSetPrototypeOf:M_}=vt;var x_=Lo;const ed=$_;M_(Lo.prototype,ed.prototype);M_(Lo,ed);function Lo(e){if(!(this instanceof Lo))return new Lo(e);ed.call(this,e)}Lo.prototype._transform=function(e,t,r){r(null,e)};const ms=H.browserExports,{ArrayIsArray:yI,Promise:wI,SymbolAsyncIterator:mI,SymbolDispose:EI}=vt,gu=Ri,{once:vI}=br,SI=Do,Sp=Yn(),{aggregateTwoErrors:RI,codes:{ERR_INVALID_ARG_TYPE:Ic,ERR_INVALID_RETURN_VALUE:Ul,ERR_MISSING_ARGS:AI,ERR_STREAM_DESTROYED:TI,ERR_STREAM_PREMATURE_CLOSE:II},AbortError:OI}=ur,{validateFunction:CI,validateAbortSignal:LI}=$s,{isIterable:ki,isReadable:kl,isReadableNodeStream:au,isNodeStream:Rp,isTransformStream:vo,isWebStream:PI,isReadableStream:Fl,isReadableFinished:BI}=ei,NI=globalThis.AbortController||Is().AbortController;let Hl,Wl,ql;function Ap(e,t,r){let o=!1;e.on("close",()=>{o=!0});const s=gu(e,{readable:t,writable:r},u=>{o=!u});return{destroy:u=>{o||(o=!0,SI.destroyer(e,u||new TI("pipe")))},cleanup:s}}function $I(e){return CI(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Gl(e){if(ki(e))return e;if(au(e))return MI(e);throw new Ic("val",["Readable","Iterable","AsyncIterable"],e)}async function*MI(e){Wl||(Wl=Nu()),yield*Wl.prototype[mI].call(e)}async function Ja(e,t,r,{end:o}){let s,u=null;const f=p=>{if(p&&(s=p),u){const b=u;u=null,b()}},h=()=>new wI((p,b)=>{s?b(s):u=()=>{s?b(s):p()}});t.on("drain",f);const l=gu(t,{readable:!1},f);try{t.writableNeedDrain&&await h();for await(const p of e)t.write(p)||await h();o&&(t.end(),await h()),r()}catch(p){r(s!==p?RI(s,p):p)}finally{l(),t.off("drain",f)}}async function Vl(e,t,r,{end:o}){vo(t)&&(t=t.writable);const s=t.getWriter();try{for await(const u of e)await s.ready,s.write(u).catch(()=>{});await s.ready,o&&await s.close(),r()}catch(u){try{await s.abort(u),r(u)}catch(f){r(f)}}}function xI(...e){return D_(e,vI($I(e)))}function D_(e,t,r){if(e.length===1&&yI(e[0])&&(e=e[0]),e.length<2)throw new AI("streams");const o=new NI,s=o.signal,u=r==null?void 0:r.signal,f=[];LI(u,"options.signal");function h(){x(new OI)}ql=ql||br.addAbortListener;let l;u&&(l=ql(u,h));let p,b;const w=[];let I=0;function A(P){x(P,--I===0)}function x(P,S){var m;if(P&&(!p||p.code==="ERR_STREAM_PREMATURE_CLOSE")&&(p=P),!(!p&&!S)){for(;w.length;)w.shift()(p);(m=l)===null||m===void 0||m[EI](),o.abort(),S&&(p||f.forEach(j=>j()),ms.nextTick(t,p,b))}}let v;for(let P=0;P<e.length;P++){const S=e[P],m=P<e.length-1,j=P>0,Q=m||(r==null?void 0:r.end)!==!1,ce=P===e.length-1;if(Rp(S)){let ue=function(te){te&&te.name!=="AbortError"&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"&&A(te)};if(Q){const{destroy:te,cleanup:Se}=Ap(S,m,j);w.push(te),kl(S)&&ce&&f.push(Se)}S.on("error",ue),kl(S)&&ce&&f.push(()=>{S.removeListener("error",ue)})}if(P===0)if(typeof S=="function"){if(v=S({signal:s}),!ki(v))throw new Ul("Iterable, AsyncIterable or Stream","source",v)}else ki(S)||au(S)||vo(S)?v=S:v=Sp.from(S);else if(typeof S=="function"){if(vo(v)){var C;v=Gl((C=v)===null||C===void 0?void 0:C.readable)}else v=Gl(v);if(v=S(v,{signal:s}),m){if(!ki(v,!0))throw new Ul("AsyncIterable",`transform[${P-1}]`,v)}else{var B;Hl||(Hl=x_);const ue=new Hl({objectMode:!0}),te=(B=v)===null||B===void 0?void 0:B.then;if(typeof te=="function")I++,te.call(v,F=>{b=F,F!=null&&ue.write(F),Q&&ue.end(),ms.nextTick(A)},F=>{ue.destroy(F),ms.nextTick(A,F)});else if(ki(v,!0))I++,Ja(v,ue,A,{end:Q});else if(Fl(v)||vo(v)){const F=v.readable||v;I++,Ja(F,ue,A,{end:Q})}else throw new Ul("AsyncIterable or Promise","destination",v);v=ue;const{destroy:Se,cleanup:me}=Ap(v,!1,!0);w.push(Se),ce&&f.push(me)}}else if(Rp(S)){if(au(v)){I+=2;const ue=DI(v,S,A,{end:Q});kl(S)&&ce&&f.push(ue)}else if(vo(v)||Fl(v)){const ue=v.readable||v;I++,Ja(ue,S,A,{end:Q})}else if(ki(v))I++,Ja(v,S,A,{end:Q});else throw new Ic("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=S}else if(PI(S)){if(au(v))I++,Vl(Gl(v),S,A,{end:Q});else if(Fl(v)||ki(v))I++,Vl(v,S,A,{end:Q});else if(vo(v))I++,Vl(v.readable,S,A,{end:Q});else throw new Ic("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=S}else v=Sp.from(S)}return(s!=null&&s.aborted||u!=null&&u.aborted)&&ms.nextTick(h),v}function DI(e,t,r,{end:o}){let s=!1;if(t.on("close",()=>{s||r(new II)}),e.pipe(t,{end:!1}),o){let u=function(){s=!0,t.end()};BI(e)?ms.nextTick(u):e.once("end",u)}else r();return gu(e,{readable:!0,writable:!1},u=>{const f=e._readableState;u&&u.code==="ERR_STREAM_PREMATURE_CLOSE"&&f&&f.ended&&!f.errored&&!f.errorEmitted?e.once("end",r).once("error",r):r(u)}),gu(t,{readable:!1,writable:!0},r)}var td={pipelineImpl:D_,pipeline:xI};const{pipeline:jI}=td,Ya=Yn(),{destroyer:UI}=Do,{isNodeStream:Xa,isReadable:Tp,isWritable:Ip,isWebStream:zl,isTransformStream:Ui,isWritableStream:Op,isReadableStream:Cp}=ei,{AbortError:kI,codes:{ERR_INVALID_ARG_VALUE:Lp,ERR_MISSING_ARGS:FI}}=ur,HI=Ri;var j_=function(...t){if(t.length===0)throw new FI("streams");if(t.length===1)return Ya.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=Ya.from(t[0])),typeof t[t.length-1]=="function"){const A=t.length-1;t[A]=Ya.from(t[A])}for(let A=0;A<t.length;++A)if(!(!Xa(t[A])&&!zl(t[A]))){if(A<t.length-1&&!(Tp(t[A])||Cp(t[A])||Ui(t[A])))throw new Lp(`streams[${A}]`,r[A],"must be readable");if(A>0&&!(Ip(t[A])||Op(t[A])||Ui(t[A])))throw new Lp(`streams[${A}]`,r[A],"must be writable")}let o,s,u,f,h;function l(A){const x=f;f=null,x?x(A):A?h.destroy(A):!I&&!w&&h.destroy()}const p=t[0],b=jI(t,l),w=!!(Ip(p)||Op(p)||Ui(p)),I=!!(Tp(b)||Cp(b)||Ui(b));if(h=new Ya({writableObjectMode:!!(p!=null&&p.writableObjectMode),readableObjectMode:!!(b!=null&&b.readableObjectMode),writable:w,readable:I}),w){if(Xa(p))h._write=function(x,v,C){p.write(x,v)?C():o=C},h._final=function(x){p.end(),s=x},p.on("drain",function(){if(o){const x=o;o=null,x()}});else if(zl(p)){const v=(Ui(p)?p.writable:p).getWriter();h._write=async function(C,B,P){try{await v.ready,v.write(C).catch(()=>{}),P()}catch(S){P(S)}},h._final=async function(C){try{await v.ready,v.close().catch(()=>{}),s=C}catch(B){C(B)}}}const A=Ui(b)?b.readable:b;HI(A,()=>{if(s){const x=s;s=null,x()}})}if(I){if(Xa(b))b.on("readable",function(){if(u){const A=u;u=null,A()}}),b.on("end",function(){h.push(null)}),h._read=function(){for(;;){const A=b.read();if(A===null){u=h._read;return}if(!h.push(A))return}};else if(zl(b)){const x=(Ui(b)?b.readable:b).getReader();h._read=async function(){for(;;)try{const{value:v,done:C}=await x.read();if(!h.push(v))return;if(C){h.push(null);return}}catch{return}}}}return h._destroy=function(A,x){!A&&f!==null&&(A=new kI),u=null,o=null,s=null,f===null?x(A):(f=x,Xa(b)&&UI(b,A))},h};const WI=globalThis.AbortController||Is().AbortController,{codes:{ERR_INVALID_ARG_VALUE:qI,ERR_INVALID_ARG_TYPE:Ms,ERR_MISSING_ARGS:GI,ERR_OUT_OF_RANGE:VI},AbortError:On}=ur,{validateAbortSignal:Ki,validateInteger:Pp,validateObject:Ji}=$s,zI=vt.Symbol("kWeak"),KI=vt.Symbol("kResistStopPropagation"),{finished:JI}=Ri,YI=j_,{addAbortSignalNoValidate:XI}=Pu,{isWritable:ZI,isNodeStream:QI}=ei,{deprecate:eO}=br,{ArrayPrototypePush:tO,Boolean:rO,MathFloor:Bp,Number:nO,NumberIsNaN:iO,Promise:Np,PromiseReject:$p,PromiseResolve:oO,PromisePrototypeThen:Mp,Symbol:U_}=vt,pu=U_("kEmpty"),xp=U_("kEof");function sO(e,t){if(t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal"),QI(e)&&!ZI(e))throw new qI("stream",e,"must be writable");const r=YI(this,e);return t!=null&&t.signal&&XI(t.signal,r),r}function $u(e,t){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=Bp(t.concurrency));let o=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(o=Bp(t.highWaterMark)),Pp(r,"options.concurrency",1),Pp(o,"options.highWaterMark",0),o+=r,(async function*(){const u=br.AbortSignalAny([t==null?void 0:t.signal].filter(rO)),f=this,h=[],l={signal:u};let p,b,w=!1,I=0;function A(){w=!0,x()}function x(){I-=1,v()}function v(){b&&!w&&I<r&&h.length<o&&(b(),b=null)}async function C(){try{for await(let B of f){if(w)return;if(u.aborted)throw new On;try{if(B=e(B,l),B===pu)continue;B=oO(B)}catch(P){B=$p(P)}I+=1,Mp(B,x,A),h.push(B),p&&(p(),p=null),!w&&(h.length>=o||I>=r)&&await new Np(P=>{b=P})}h.push(xp)}catch(B){const P=$p(B);Mp(P,x,A),h.push(P)}finally{w=!0,p&&(p(),p=null)}}C();try{for(;;){for(;h.length>0;){const B=await h[0];if(B===xp)return;if(u.aborted)throw new On;B!==pu&&(yield B),h.shift(),v()}await new Np(B=>{p=B})}}finally{w=!0,b&&(b(),b=null)}}).call(this)}function aO(e=void 0){return e!=null&&Ji(e,"options"),(e==null?void 0:e.signal)!=null&&Ki(e.signal,"options.signal"),(async function*(){let r=0;for await(const s of this){var o;if(e!=null&&(o=e.signal)!==null&&o!==void 0&&o.aborted)throw new On({cause:e.signal.reason});yield[r++,s]}}).call(this)}async function k_(e,t=void 0){for await(const r of rd.call(this,e,t))return!0;return!1}async function uO(e,t=void 0){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);return!await k_.call(this,async(...r)=>!await e(...r),t)}async function fO(e,t){for await(const r of rd.call(this,e,t))return r}async function lO(e,t){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);async function r(o,s){return await e(o,s),pu}for await(const o of $u.call(this,r,t));}function rd(e,t){if(typeof e!="function")throw new Ms("fn",["Function","AsyncFunction"],e);async function r(o,s){return await e(o,s)?o:pu}return $u.call(this,r,t)}class cO extends GI{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function dO(e,t,r){var o;if(typeof e!="function")throw new Ms("reducer",["Function","AsyncFunction"],e);r!=null&&Ji(r,"options"),(r==null?void 0:r.signal)!=null&&Ki(r.signal,"options.signal");let s=arguments.length>1;if(r!=null&&(o=r.signal)!==null&&o!==void 0&&o.aborted){const p=new On(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await JI(this.destroy(p)),p}const u=new WI,f=u.signal;if(r!=null&&r.signal){const p={once:!0,[zI]:this,[KI]:!0};r.signal.addEventListener("abort",()=>u.abort(),p)}let h=!1;try{for await(const p of this){var l;if(h=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new On;s?t=await e(t,p,{signal:f}):(t=p,s=!0)}if(!h&&!s)throw new cO}finally{u.abort()}return t}async function hO(e){e!=null&&Ji(e,"options"),(e==null?void 0:e.signal)!=null&&Ki(e.signal,"options.signal");const t=[];for await(const o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new On(void 0,{cause:e.signal.reason});tO(t,o)}return t}function gO(e,t){const r=$u.call(this,e,t);return(async function*(){for await(const s of r)yield*s}).call(this)}function F_(e){if(e=nO(e),iO(e))return 0;if(e<0)throw new VI("number",">= 0",e);return e}function pO(e,t=void 0){return t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal"),e=F_(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new On;for await(const u of this){var s;if(t!=null&&(s=t.signal)!==null&&s!==void 0&&s.aborted)throw new On;e--<=0&&(yield u)}}).call(this)}function bO(e,t=void 0){return t!=null&&Ji(t,"options"),(t==null?void 0:t.signal)!=null&&Ki(t.signal,"options.signal"),e=F_(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new On;for await(const u of this){var s;if(t!=null&&(s=t.signal)!==null&&s!==void 0&&s.aborted)throw new On;if(e-- >0&&(yield u),e<=0)return}}).call(this)}zc.streamReturningOperators={asIndexedPairs:eO(aO,"readable.asIndexedPairs will be removed in a future version."),drop:pO,filter:rd,flatMap:gO,map:$u,take:bO,compose:sO};zc.promiseReturningOperators={every:uO,forEach:lO,reduce:dO,toArray:hO,some:k_,find:fO};var Kl,Dp;function H_(){if(Dp)return Kl;Dp=1;const{ArrayPrototypePop:e,Promise:t}=vt,{isIterable:r,isNodeStream:o,isWebStream:s}=ei,{pipelineImpl:u}=td,{finished:f}=Ri;W_();function h(...l){return new t((p,b)=>{let w,I;const A=l[l.length-1];if(A&&typeof A=="object"&&!o(A)&&!r(A)&&!s(A)){const x=e(l);w=x.signal,I=x.end}u(l,(x,v)=>{x?b(x):p(v)},{signal:w,end:I})})}return Kl={finished:f,pipeline:h},Kl}var jp;function W_(){if(jp)return Pl.exports;jp=1;const{Buffer:e}=H.bufferPolyfill,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:o}=vt,{promisify:{custom:s}}=br,{streamReturningOperators:u,promiseReturningOperators:f}=zc,{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=ur,l=j_,{setDefaultHighWaterMark:p,getDefaultHighWaterMark:b}=Bu,{pipeline:w}=td,{destroyer:I}=Do,A=Ri,x=H_(),v=ei,C=Pl.exports=Xc.Stream;C.isDestroyed=v.isDestroyed,C.isDisturbed=v.isDisturbed,C.isErrored=v.isErrored,C.isReadable=v.isReadable,C.isWritable=v.isWritable,C.Readable=Nu();for(const P of r(u)){let m=function(...j){if(new.target)throw h();return C.Readable.from(o(S,this,j))};const S=u[P];t(m,"name",{__proto__:null,value:S.name}),t(m,"length",{__proto__:null,value:S.length}),t(C.Readable.prototype,P,{__proto__:null,value:m,enumerable:!1,configurable:!0,writable:!0})}for(const P of r(f)){let m=function(...j){if(new.target)throw h();return o(S,this,j)};const S=f[P];t(m,"name",{__proto__:null,value:S.name}),t(m,"length",{__proto__:null,value:S.length}),t(C.Readable.prototype,P,{__proto__:null,value:m,enumerable:!1,configurable:!0,writable:!0})}C.Writable=Zc(),C.Duplex=Yn(),C.Transform=$_,C.PassThrough=x_,C.pipeline=w;const{addAbortSignal:B}=Pu;return C.addAbortSignal=B,C.finished=A,C.destroy=I,C.compose=l,C.setDefaultHighWaterMark=p,C.getDefaultHighWaterMark=b,t(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return x}}),t(w,s,{__proto__:null,enumerable:!0,get(){return x.pipeline}}),t(A,s,{__proto__:null,enumerable:!0,get(){return x.finished}}),C.Stream=C,C._isUint8Array=function(S){return S instanceof Uint8Array},C._uint8ArrayToBuffer=function(S){return e.from(S.buffer,S.byteOffset,S.byteLength)},Pl.exports}(function(e){const t=W_(),r=H_(),o=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=o,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(OA);var _O={},qi={},nd={},Wt={};class q_ extends TypeError{constructor(t,r){let o;const{message:s,explanation:u,...f}=t,{path:h}=t,l=h.length===0?s:`At path: ${h.join(".")} -- ${s}`;super(u??l),u!=null&&(this.cause=l),Object.assign(this,f),this.name=this.constructor.name,this.failures=()=>o??(o=[t,...r()])}}function yO(e){return Hr(e)&&typeof e[Symbol.iterator]=="function"}function Hr(e){return typeof e=="object"&&e!=null}function Up(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function xt(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function wO(e){const{done:t,value:r}=e.next();return t?void 0:r}function mO(e,t,r,o){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:u}=t,{type:f}=r,{refinement:h,message:l=`Expected a value of type \`${f}\`${h?` with refinement \`${h}\``:""}, but received: \`${xt(o)}\``}=e;return{value:o,type:f,refinement:h,key:s[s.length-1],path:s,branch:u,...e,message:l}}function*Oc(e,t,r,o){yO(e)||(e=[e]);for(const s of e){const u=mO(s,t,r,o);u&&(yield u)}}function*id(e,t,r={}){const{path:o=[],branch:s=[e],coerce:u=!1,mask:f=!1}=r,h={path:o,branch:s};if(u&&(e=t.coercer(e,h),f&&t.type!=="type"&&Hr(t.schema)&&Hr(e)&&!Array.isArray(e)))for(const p in e)t.schema[p]===void 0&&delete e[p];let l="valid";for(const p of t.validator(e,h))p.explanation=r.message,l="not_valid",yield[p,void 0];for(let[p,b,w]of t.entries(e,h)){const I=id(b,w,{path:p===void 0?o:[...o,p],branch:p===void 0?s:[...s,b],coerce:u,mask:f,message:r.message});for(const A of I)A[0]?(l=A[0].refinement!=null?"not_refined":"not_valid",yield[A[0],void 0]):u&&(b=A[1],p===void 0?e=b:e instanceof Map?e.set(p,b):e instanceof Set?e.add(b):Hr(e)&&(b!==void 0||p in e)&&(e[p]=b))}if(l!=="not_valid")for(const p of t.refiner(e,h))p.explanation=r.message,l="not_refined",yield[p,void 0];l==="valid"&&(yield[void 0,e])}class Ct{constructor(t){const{type:r,schema:o,validator:s,refiner:u,coercer:f=l=>l,entries:h=function*(){}}=t;this.type=r,this.schema=o,this.entries=h,this.coercer=f,s?this.validator=(l,p)=>{const b=s(l,p);return Oc(b,p,this,l)}:this.validator=()=>[],u?this.refiner=(l,p)=>{const b=u(l,p);return Oc(b,p,this,l)}:this.refiner=()=>[]}assert(t,r){return G_(t,this,r)}create(t,r){return V_(t,this,r)}is(t){return od(t,this)}mask(t,r){return z_(t,this,r)}validate(t,r={}){return jo(t,this,r)}}function G_(e,t,r){const o=jo(e,t,{message:r});if(o[0])throw o[0]}function V_(e,t,r){const o=jo(e,t,{coerce:!0,message:r});if(o[0])throw o[0];return o[1]}function z_(e,t,r){const o=jo(e,t,{coerce:!0,mask:!0,message:r});if(o[0])throw o[0];return o[1]}function od(e,t){return!jo(e,t)[0]}function jo(e,t,r={}){const o=id(e,t,r),s=wO(o);return s[0]?[new q_(s[0],function*(){for(const f of o)f[0]&&(yield f[0])}),void 0]:[void 0,s[1]]}function EO(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),o=Object.assign({},...r);return t?Ds(o):xs(o)}function _r(e,t){return new Ct({type:e,schema:null,validator:t})}function vO(e,t){return new Ct({...e,refiner:(r,o)=>r===void 0||e.refiner(r,o),validator(r,o){return r===void 0?!0:(t(r,o),e.validator(r,o))}})}function SO(e){return new Ct({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function RO(e){let t;return new Ct({type:"lazy",schema:null,*entries(r,o){t??(t=e()),yield*t.entries(r,o)},validator(r,o){return t??(t=e()),t.validator(r,o)},coercer(r,o){return t??(t=e()),t.coercer(r,o)},refiner(r,o){return t??(t=e()),t.refiner(r,o)}})}function AO(e,t){const{schema:r}=e,o={...r};for(const s of t)delete o[s];switch(e.type){case"type":return Ds(o);default:return xs(o)}}function TO(e){const t=e instanceof Ct,r=t?{...e.schema}:{...e};for(const o in r)r[o]=K_(r[o]);return t&&e.type==="type"?Ds(r):xs(r)}function IO(e,t){const{schema:r}=e,o={};for(const s of t)o[s]=r[s];switch(e.type){case"type":return Ds(o);default:return xs(o)}}function OO(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),_r(e,t)}function CO(){return _r("any",()=>!0)}function LO(e){return new Ct({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,o]of t.entries())yield[r,o,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${xt(t)}`}})}function PO(){return _r("bigint",e=>typeof e=="bigint")}function BO(){return _r("boolean",e=>typeof e=="boolean")}function NO(){return _r("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${xt(e)}`)}function $O(e){const t={},r=e.map(o=>xt(o)).join();for(const o of e)t[o]=o;return new Ct({type:"enums",schema:t,validator(o){return e.includes(o)||`Expected one of \`${r}\`, but received: ${xt(o)}`}})}function MO(){return _r("func",e=>typeof e=="function"||`Expected a function, but received: ${xt(e)}`)}function xO(e){return _r("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${xt(t)}`)}function DO(){return _r("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${xt(e)}`)}function jO(e){return new Ct({type:"intersection",schema:null,*entries(t,r){for(const o of e)yield*o.entries(t,r)},*validator(t,r){for(const o of e)yield*o.validator(t,r)},*refiner(t,r){for(const o of e)yield*o.refiner(t,r)}})}function UO(e){const t=xt(e),r=typeof e;return new Ct({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(o){return o===e||`Expected the literal \`${t}\`, but received: ${xt(o)}`}})}function kO(e,t){return new Ct({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[o,s]of r.entries())yield[o,o,e],yield[o,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${xt(r)}`}})}function sd(){return _r("never",()=>!1)}function FO(e){return new Ct({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function HO(){return _r("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${xt(e)}`)}function xs(e){const t=e?Object.keys(e):[],r=sd();return new Ct({type:"object",schema:e||null,*entries(o){if(e&&Hr(o)){const s=new Set(Object.keys(o));for(const u of t)s.delete(u),yield[u,o[u],e[u]];for(const u of s)yield[u,o[u],r]}},validator(o){return Hr(o)||`Expected an object, but received: ${xt(o)}`},coercer(o){return Hr(o)?{...o}:o}})}function K_(e){return new Ct({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function WO(e,t){return new Ct({type:"record",schema:null,*entries(r){if(Hr(r))for(const o in r){const s=r[o];yield[o,o,e],yield[o,s,t]}},validator(r){return Hr(r)||`Expected an object, but received: ${xt(r)}`}})}function qO(){return _r("regexp",e=>e instanceof RegExp)}function GO(e){return new Ct({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${xt(t)}`}})}function J_(){return _r("string",e=>typeof e=="string"||`Expected a string, but received: ${xt(e)}`)}function VO(e){const t=sd();return new Ct({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const o=Math.max(e.length,r.length);for(let s=0;s<o;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${xt(r)}`}})}function Ds(e){const t=Object.keys(e);return new Ct({type:"type",schema:e,*entries(r){if(Hr(r))for(const o of t)yield[o,r[o],e[o]]},validator(r){return Hr(r)||`Expected an object, but received: ${xt(r)}`},coercer(r){return Hr(r)?{...r}:r}})}function zO(e){const t=e.map(r=>r.type).join(" | ");return new Ct({type:"union",schema:null,coercer(r){for(const o of e){const[s,u]=o.validate(r,{coerce:!0});if(!s)return u}return r},validator(r,o){const s=[];for(const u of e){const[...f]=id(r,u,o),[h]=f;if(h[0])for(const[l]of f)l&&s.push(l);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${xt(r)}`,...s]}})}function Y_(){return _r("unknown",()=>!0)}function ad(e,t,r){return new Ct({...e,coercer:(o,s)=>od(o,t)?e.coercer(r(o,s),s):e.coercer(o,s)})}function KO(e,t,r={}){return ad(e,Y_(),o=>{const s=typeof t=="function"?t():t;if(o===void 0)return s;if(!r.strict&&Up(o)&&Up(s)){const u={...o};let f=!1;for(const h in s)u[h]===void 0&&(u[h]=s[h],f=!0);if(f)return u}return o})}function JO(e){return ad(e,J_(),t=>t.trim())}function YO(e){return Yi(e,"empty",t=>{const r=X_(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function X_(e){return e instanceof Map||e instanceof Set?e.size:e.length}function XO(e,t,r={}){const{exclusive:o}=r;return Yi(e,"max",s=>o?s<t:s<=t||`Expected a ${e.type} less than ${o?"":"or equal to "}${t} but received \`${s}\``)}function ZO(e,t,r={}){const{exclusive:o}=r;return Yi(e,"min",s=>o?s>t:s>=t||`Expected a ${e.type} greater than ${o?"":"or equal to "}${t} but received \`${s}\``)}function QO(e){return Yi(e,"nonempty",t=>X_(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function e2(e,t){return Yi(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function t2(e,t,r=t){const o=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Yi(e,"size",u=>{if(typeof u=="number"||u instanceof Date)return t<=u&&u<=r||`${o} ${s} but received \`${u}\``;if(u instanceof Map||u instanceof Set){const{size:f}=u;return t<=f&&f<=r||`${o} with a size ${s} but received one with a size of \`${f}\``}else{const{length:f}=u;return t<=f&&f<=r||`${o} with a length ${s} but received one with a length of \`${f}\``}})}function Yi(e,t,r){return new Ct({...e,*refiner(o,s){yield*e.refiner(o,s);const u=r(o,s),f=Oc(u,s,e,o);for(const h of f)yield{...h,refinement:t}}})}const r2=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ct,StructError:q_,any:CO,array:LO,assert:G_,assign:EO,bigint:PO,boolean:BO,coerce:ad,create:V_,date:NO,defaulted:KO,define:_r,deprecated:vO,dynamic:SO,empty:YO,enums:$O,func:MO,instance:xO,integer:DO,intersection:jO,is:od,lazy:RO,literal:UO,map:kO,mask:z_,max:XO,min:ZO,never:sd,nonempty:QO,nullable:FO,number:HO,object:xs,omit:AO,optional:K_,partial:TO,pattern:e2,pick:IO,record:WO,refine:Yi,regexp:qO,set:GO,size:t2,string:J_,struct:OO,trimmed:JO,tuple:VO,type:Ds,union:zO,unknown:Y_,validate:jo},Symbol.toStringTag,{value:"Module"})),Xi=H.getAugmentedNamespace(r2);Object.defineProperty(Wt,"__esModule",{value:!0});Wt.assertExhaustive=Wt.assertStruct=Wt.assert=Wt.AssertionError=void 0;const n2=Xi;function i2(e){return typeof e=="object"&&e!==null&&"message"in e}function o2(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function s2(e){const t=i2(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Z_(e,t){return o2(e)?new e({message:t}):e({message:t})}class ud extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Wt.AssertionError=ud;function a2(e,t="Assertion failed.",r=ud){if(!e)throw t instanceof Error?t:Z_(r,t)}Wt.assert=a2;function u2(e,t,r="Assertion failed",o=ud){try{(0,n2.assert)(e,t)}catch(s){throw Z_(o,`${r}: ${s2(s)}.`)}}Wt.assertStruct=u2;function f2(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Wt.assertExhaustive=f2;var js={};Object.defineProperty(js,"__esModule",{value:!0});js.base64=void 0;const l2=Xi,c2=Wt,d2=(e,t={})=>{var r,o;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,u=(o=t.characterSet)!==null&&o!==void 0?o:"base64";let f;u==="base64"?f=String.raw`[A-Za-z0-9+\/]`:((0,c2.assert)(u==="base64url"),f=String.raw`[-_A-Za-z0-9]`);let h;return s?h=new RegExp(`^(?:${f}{4})*(?:${f}{3}=|${f}{2}==)?$`,"u"):h=new RegExp(`^(?:${f}{4})*(?:${f}{2,3}|${f}{3}=|${f}{2}==)?$`,"u"),(0,l2.pattern)(e,h)};js.base64=d2;var Ze={},Us={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Xi,r=Wt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function o(p){return(0,t.is)(p,e.HexStruct)}e.isHexString=o;function s(p){return(0,t.is)(p,e.StrictHexStruct)}e.isStrictHexString=s;function u(p){(0,r.assert)(o(p),"Value must be a hexadecimal string.")}e.assertIsHexString=u;function f(p){(0,r.assert)(s(p),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=f;function h(p){return p.startsWith("0x")?p:p.startsWith("0X")?`0x${p.substring(2)}`:`0x${p}`}e.add0x=h;function l(p){return p.startsWith("0x")||p.startsWith("0X")?p.substring(2):p}e.remove0x=l})(Us);Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createDataView=Ze.concatBytes=Ze.valueToBytes=Ze.stringToBytes=Ze.numberToBytes=Ze.signedBigIntToBytes=Ze.bigIntToBytes=Ze.hexToBytes=Ze.bytesToString=Ze.bytesToNumber=Ze.bytesToSignedBigInt=Ze.bytesToBigInt=Ze.bytesToHex=Ze.assertIsBytes=Ze.isBytes=void 0;const Ir=Wt,Cc=Us,kp=48,Fp=58,Hp=87;function h2(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const g2=h2();function fd(e){return e instanceof Uint8Array}Ze.isBytes=fd;function Uo(e){(0,Ir.assert)(fd(e),"Value must be a Uint8Array.")}Ze.assertIsBytes=Uo;function Q_(e){if(Uo(e),e.length===0)return"0x";const t=g2(),r=new Array(e.length);for(let o=0;o<e.length;o++)r[o]=t[e[o]];return(0,Cc.add0x)(r.join(""))}Ze.bytesToHex=Q_;function ey(e){Uo(e);const t=Q_(e);return BigInt(t)}Ze.bytesToBigInt=ey;function p2(e){Uo(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}Ze.bytesToSignedBigInt=p2;function b2(e){Uo(e);const t=ey(e);return(0,Ir.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}Ze.bytesToNumber=b2;function _2(e){return Uo(e),new TextDecoder().decode(e)}Ze.bytesToString=_2;function Mu(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Cc.assertIsHexString)(e);const r=(0,Cc.remove0x)(e).toLowerCase(),o=r.length%2===0?r:`0${r}`,s=new Uint8Array(o.length/2);for(let u=0;u<s.length;u++){const f=o.charCodeAt(u*2),h=o.charCodeAt(u*2+1),l=f-(f<Fp?kp:Hp),p=h-(h<Fp?kp:Hp);s[u]=l*16+p}return s}Ze.hexToBytes=Mu;function ty(e){(0,Ir.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ir.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Mu(t)}Ze.bigIntToBytes=ty;function y2(e,t){(0,Ir.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function w2(e,t){(0,Ir.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ir.assert)(typeof t=="number","Byte length must be a number."),(0,Ir.assert)(t>0,"Byte length must be greater than 0."),(0,Ir.assert)(y2(e,t),"Byte length is too small to represent the given value.");let r=e;const o=new Uint8Array(t);for(let s=0;s<o.length;s++)o[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return o.reverse()}Ze.signedBigIntToBytes=w2;function ry(e){(0,Ir.assert)(typeof e=="number","Value must be a number."),(0,Ir.assert)(e>=0,"Value must be a non-negative number."),(0,Ir.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Mu(t)}Ze.numberToBytes=ry;function ny(e){return(0,Ir.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}Ze.stringToBytes=ny;function iy(e){if(typeof e=="bigint")return ty(e);if(typeof e=="number")return ry(e);if(typeof e=="string")return e.startsWith("0x")?Mu(e):ny(e);if(fd(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}Ze.valueToBytes=iy;function m2(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const u=iy(e[s]);t[s]=u,r+=u.length}const o=new Uint8Array(r);for(let s=0,u=0;s<t.length;s++)o.set(t[s],u),u+=t[s].length;return o}Ze.concatBytes=m2;function E2(e){if(typeof H.dist.Buffer<"u"&&e instanceof H.dist.Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}Ze.createDataView=E2;var xu={};Object.defineProperty(xu,"__esModule",{value:!0});xu.ChecksumStruct=void 0;const Wp=Xi,v2=js;xu.ChecksumStruct=(0,Wp.size)((0,v2.base64)((0,Wp.string)(),{paddingRequired:!0}),44,44);var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.createHex=vn.createBytes=vn.createBigInt=vn.createNumber=void 0;const Et=Xi,S2=Wt,oy=Ze,Du=Us,sy=(0,Et.union)([(0,Et.number)(),(0,Et.bigint)(),(0,Et.string)(),Du.StrictHexStruct]),R2=(0,Et.coerce)((0,Et.number)(),sy,Number),A2=(0,Et.coerce)((0,Et.bigint)(),sy,BigInt);(0,Et.union)([Du.StrictHexStruct,(0,Et.instance)(Uint8Array)]);const T2=(0,Et.coerce)((0,Et.instance)(Uint8Array),(0,Et.union)([Du.StrictHexStruct]),oy.hexToBytes),I2=(0,Et.coerce)(Du.StrictHexStruct,(0,Et.instance)(Uint8Array),oy.bytesToHex);function O2(e){try{const t=(0,Et.create)(e,R2);return(0,S2.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Et.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}vn.createNumber=O2;function C2(e){try{return(0,Et.create)(e,A2)}catch(t){throw t instanceof Et.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}vn.createBigInt=C2;function L2(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Et.create)(e,T2)}catch(t){throw t instanceof Et.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}vn.createBytes=L2;function P2(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Et.create)(e,I2)}catch(t){throw t instanceof Et.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}vn.createHex=P2;var Po={},ay=H.commonjsGlobal&&H.commonjsGlobal.__classPrivateFieldSet||function(e,t,r,o,s){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},ar=H.commonjsGlobal&&H.commonjsGlobal.__classPrivateFieldGet||function(e,t,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(e):o?o.value:t.get(e)},tn,wn;Object.defineProperty(Po,"__esModule",{value:!0});Po.FrozenSet=Po.FrozenMap=void 0;class ld{constructor(t){tn.set(this,void 0),ay(this,tn,new Map(t),"f"),Object.freeze(this)}get size(){return ar(this,tn,"f").size}[(tn=new WeakMap,Symbol.iterator)](){return ar(this,tn,"f")[Symbol.iterator]()}entries(){return ar(this,tn,"f").entries()}forEach(t,r){return ar(this,tn,"f").forEach((o,s,u)=>t.call(r,o,s,this))}get(t){return ar(this,tn,"f").get(t)}has(t){return ar(this,tn,"f").has(t)}keys(){return ar(this,tn,"f").keys()}values(){return ar(this,tn,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Po.FrozenMap=ld;class cd{constructor(t){wn.set(this,void 0),ay(this,wn,new Set(t),"f"),Object.freeze(this)}get size(){return ar(this,wn,"f").size}[(wn=new WeakMap,Symbol.iterator)](){return ar(this,wn,"f")[Symbol.iterator]()}entries(){return ar(this,wn,"f").entries()}forEach(t,r){return ar(this,wn,"f").forEach((o,s,u)=>t.call(r,o,s,this))}has(t){return ar(this,wn,"f").has(t)}keys(){return ar(this,wn,"f").keys()}values(){return ar(this,wn,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Po.FrozenSet=cd;Object.freeze(ld);Object.freeze(ld.prototype);Object.freeze(cd);Object.freeze(cd.prototype);var uy={};Object.defineProperty(uy,"__esModule",{value:!0});var fy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Xi,r=Wt,o=()=>(0,t.define)("finite number",j=>(0,t.is)(j,(0,t.number)())&&Number.isFinite(j));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),o(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(j,Q)=>{function ce(ue,te){const me=[...te.validator(ue,Q)];return me.length>0?me:!0}try{const ue=ce(j,e.UnsafeJsonStruct);return ue!==!0?ue:ce(JSON.parse(JSON.stringify(j)),e.UnsafeJsonStruct)}catch(ue){return ue instanceof RangeError?"Circular reference detected":!1}});function s(j){return(0,t.is)(j,e.JsonStruct)}e.isValidJson=s;function u(j){(0,r.assertStruct)(j,e.JsonStruct,"Invalid JSON value");const Q=JSON.stringify(j);return new TextEncoder().encode(Q).byteLength}e.getJsonSize=u,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function f(j){return(0,t.is)(j,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=f;function h(j,Q){(0,r.assertStruct)(j,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",Q)}e.assertIsJsonRpcNotification=h;function l(j){return(0,t.is)(j,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function p(j,Q){(0,r.assertStruct)(j,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",Q)}e.assertIsJsonRpcRequest=p,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function b(j){return(0,t.is)(j,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=b;function w(j,Q){(0,r.assertStruct)(j,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",Q)}e.assertIsPendingJsonRpcResponse=w;function I(j){return(0,t.is)(j,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=I;function A(j,Q){(0,r.assertStruct)(j,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",Q)}e.assertIsJsonRpcResponse=A;function x(j){return(0,t.is)(j,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=x;function v(j,Q){(0,r.assertStruct)(j,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",Q)}e.assertIsJsonRpcSuccess=v;function C(j){return(0,t.is)(j,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=C;function B(j,Q){(0,r.assertStruct)(j,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",Q)}e.assertIsJsonRpcFailure=B;function P(j){return(0,t.is)(j,e.JsonRpcErrorStruct)}e.isJsonRpcError=P;function S(j,Q){(0,r.assertStruct)(j,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",Q)}e.assertIsJsonRpcError=S;function m(j){const{permitEmptyString:Q,permitFractions:ce,permitNull:ue}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},j);return Se=>!!(typeof Se=="number"&&(ce||Number.isInteger(Se))||typeof Se=="string"&&(Q||Se.length>0)||ue&&Se===null)}e.getJsonRpcIdValidator=m})(fy);var ly={};Object.defineProperty(ly,"__esModule",{value:!0});var Bo={},B2=H.commonjsGlobal&&H.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.createModuleLogger=Bo.createProjectLogger=void 0;const N2=B2(EA),$2=(0,N2.default)("metamask");function M2(e){return $2.extend(e)}Bo.createProjectLogger=M2;function x2(e,t){return e.extend(t)}Bo.createModuleLogger=x2;var cy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(p){return Array.isArray(p)&&p.length>0}e.isNonEmptyArray=t;function r(p){return p==null}e.isNullOrUndefined=r;function o(p){return!!p&&typeof p=="object"&&!Array.isArray(p)}e.isObject=o;const s=(p,b)=>Object.hasOwnProperty.call(p,b);e.hasProperty=s,function(p){p[p.Null=4]="Null",p[p.Comma=1]="Comma",p[p.Wrapper=1]="Wrapper",p[p.True=4]="True",p[p.False=5]="False",p[p.Quote=1]="Quote",p[p.Colon=1]="Colon",p[p.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function u(p){if(typeof p!="object"||p===null)return!1;try{let b=p;for(;Object.getPrototypeOf(b)!==null;)b=Object.getPrototypeOf(b);return Object.getPrototypeOf(p)===b}catch{return!1}}e.isPlainObject=u;function f(p){return p.charCodeAt(0)<=127}e.isASCII=f;function h(p){var b;return p.split("").reduce((I,A)=>f(A)?I+1:I+2,0)+((b=p.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&b!==void 0?b:[]).length}e.calculateStringSize=h;function l(p){return p.toString().length}e.calculateNumberSize=l})(cy);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.hexToBigInt=Sn.hexToNumber=Sn.bigIntToHex=Sn.numberToHex=void 0;const To=Wt,Os=Us,D2=e=>((0,To.assert)(typeof e=="number","Value must be a number."),(0,To.assert)(e>=0,"Value must be a non-negative number."),(0,To.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Os.add0x)(e.toString(16)));Sn.numberToHex=D2;const j2=e=>((0,To.assert)(typeof e=="bigint","Value must be a bigint."),(0,To.assert)(e>=0,"Value must be a non-negative bigint."),(0,Os.add0x)(e.toString(16)));Sn.bigIntToHex=j2;const U2=e=>{(0,Os.assertIsHexString)(e);const t=parseInt(e,16);return(0,To.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Sn.hexToNumber=U2;const k2=e=>((0,Os.assertIsHexString)(e),BigInt((0,Os.add0x)(e)));Sn.hexToBigInt=k2;var dy={};Object.defineProperty(dy,"__esModule",{value:!0});var hy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(u){u[u.Millisecond=1]="Millisecond",u[u.Second=1e3]="Second",u[u.Minute=6e4]="Minute",u[u.Hour=36e5]="Hour",u[u.Day=864e5]="Day",u[u.Week=6048e5]="Week",u[u.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=u=>Number.isInteger(u)&&u>=0,r=(u,f)=>{if(!t(u))throw new Error(`"${f}" must be a non-negative integer. Received: "${u}".`)};function o(u,f){return r(u,"count"),u*f}e.inMilliseconds=o;function s(u){return r(u,"timestamp"),Date.now()-u}e.timeSince=s})(hy);var gy={};Object.defineProperty(gy,"__esModule",{value:!0});var py={},Lc={exports:{}};const F2="2.0.0",by=256,H2=Number.MAX_SAFE_INTEGER||9007199254740991,W2=16,q2=by-6,G2=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ju={MAX_LENGTH:by,MAX_SAFE_COMPONENT_LENGTH:W2,MAX_SAFE_BUILD_LENGTH:q2,MAX_SAFE_INTEGER:H2,RELEASE_TYPES:G2,SEMVER_SPEC_VERSION:F2,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const V2=typeof H.dist.process=="object"&&H.dist.process.env&&H.dist.process.env.NODE_DEBUG&&/\bsemver\b/i.test(H.dist.process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Uu=V2;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:s}=ju,u=Uu;t=e.exports={};const f=t.re=[],h=t.safeRe=[],l=t.src=[],p=t.safeSrc=[],b=t.t={};let w=0;const I="[a-zA-Z0-9-]",A=[["\\s",1],["\\d",s],[I,o]],x=C=>{for(const[B,P]of A)C=C.split(`${B}*`).join(`${B}{0,${P}}`).split(`${B}+`).join(`${B}{1,${P}}`);return C},v=(C,B,P)=>{const S=x(B),m=w++;u(C,m,B),b[C]=m,l[m]=B,p[m]=S,f[m]=new RegExp(B,P?"g":void 0),h[m]=new RegExp(S,P?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${I}*`),v("MAINVERSION",`(${l[b.NUMERICIDENTIFIER]})\\.(${l[b.NUMERICIDENTIFIER]})\\.(${l[b.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${l[b.NUMERICIDENTIFIERLOOSE]})\\.(${l[b.NUMERICIDENTIFIERLOOSE]})\\.(${l[b.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${l[b.NUMERICIDENTIFIER]}|${l[b.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${l[b.NUMERICIDENTIFIERLOOSE]}|${l[b.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${l[b.PRERELEASEIDENTIFIER]}(?:\\.${l[b.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${l[b.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[b.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${I}+`),v("BUILD",`(?:\\+(${l[b.BUILDIDENTIFIER]}(?:\\.${l[b.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${l[b.MAINVERSION]}${l[b.PRERELEASE]}?${l[b.BUILD]}?`),v("FULL",`^${l[b.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${l[b.MAINVERSIONLOOSE]}${l[b.PRERELEASELOOSE]}?${l[b.BUILD]}?`),v("LOOSE",`^${l[b.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${l[b.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${l[b.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${l[b.XRANGEIDENTIFIER]})(?:\\.(${l[b.XRANGEIDENTIFIER]})(?:\\.(${l[b.XRANGEIDENTIFIER]})(?:${l[b.PRERELEASE]})?${l[b.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${l[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[b.XRANGEIDENTIFIERLOOSE]})(?:${l[b.PRERELEASELOOSE]})?${l[b.BUILD]}?)?)?`),v("XRANGE",`^${l[b.GTLT]}\\s*${l[b.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${l[b.GTLT]}\\s*${l[b.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),v("COERCE",`${l[b.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",l[b.COERCEPLAIN]+`(?:${l[b.PRERELEASE]})?(?:${l[b.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",l[b.COERCE],!0),v("COERCERTLFULL",l[b.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${l[b.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${l[b.LONETILDE]}${l[b.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${l[b.LONETILDE]}${l[b.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${l[b.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${l[b.LONECARET]}${l[b.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${l[b.LONECARET]}${l[b.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${l[b.GTLT]}\\s*(${l[b.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${l[b.GTLT]}\\s*(${l[b.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${l[b.GTLT]}\\s*(${l[b.LOOSEPLAIN]}|${l[b.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${l[b.XRANGEPLAIN]})\\s+-\\s+(${l[b.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${l[b.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[b.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Lc,Lc.exports);var ks=Lc.exports;const z2=Object.freeze({loose:!0}),K2=Object.freeze({}),J2=e=>e?typeof e!="object"?z2:e:K2;var dd=J2;const qp=/^[0-9]+$/,_y=(e,t)=>{const r=qp.test(e),o=qp.test(t);return r&&o&&(e=+e,t=+t),e===t?0:r&&!o?-1:o&&!r?1:e<t?-1:1},Y2=(e,t)=>_y(t,e);var yy={compareIdentifiers:_y,rcompareIdentifiers:Y2};const Za=Uu,{MAX_LENGTH:Gp,MAX_SAFE_INTEGER:Qa}=ju,{safeRe:Vp,safeSrc:zp,t:eu}=ks,X2=dd,{compareIdentifiers:wo}=yy;let Z2=class mn{constructor(t,r){if(r=X2(r),t instanceof mn){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Gp)throw new TypeError(`version is longer than ${Gp} characters`);Za("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const o=t.trim().match(r.loose?Vp[eu.LOOSE]:Vp[eu.FULL]);if(!o)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Qa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Qa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Qa||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const u=+s;if(u>=0&&u<Qa)return u}return s}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Za("SemVer.compare",this.version,this.options,t),!(t instanceof mn)){if(typeof t=="string"&&t===this.version)return 0;t=new mn(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof mn||(t=new mn(t,this.options)),wo(this.major,t.major)||wo(this.minor,t.minor)||wo(this.patch,t.patch)}comparePre(t){if(t instanceof mn||(t=new mn(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const o=this.prerelease[r],s=t.prerelease[r];if(Za("prerelease compare",r,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return wo(o,s)}while(++r)}compareBuild(t){t instanceof mn||(t=new mn(t,this.options));let r=0;do{const o=this.build[r],s=t.build[r];if(Za("build compare",r,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return wo(o,s)}while(++r)}inc(t,r,o){if(t.startsWith("pre")){if(!r&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const s=new RegExp(`^${this.options.loose?zp[eu.PRERELEASELOOSE]:zp[eu.PRERELEASE]}$`),u=`-${r}`.match(s);if(!u||u[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,o),this.inc("pre",r,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,o),this.inc("pre",r,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let u=this.prerelease.length;for(;--u>=0;)typeof this.prerelease[u]=="number"&&(this.prerelease[u]++,u=-2);if(u===-1){if(r===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let u=[r,s];o===!1&&(u=[r]),wo(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=u):this.prerelease=u}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Fs=Z2;const Kp=Fs,Q2=(e,t,r=!1)=>{if(e instanceof Kp)return e;try{return new Kp(e,t)}catch(o){if(!r)return null;throw o}};var eC=Q2;const tC=eC,rC=(e,t)=>{const r=tC(e,t);return r?r.version:null};var nC=rC;const Jp=Fs,iC=(e,t,r)=>new Jp(e,r).compare(new Jp(t,r));var ko=iC;const oC=ko,sC=(e,t,r)=>oC(e,t,r)>0;var hd=sC;const aC=ko,uC=(e,t,r)=>aC(e,t,r)<0;var wy=uC;const fC=ko,lC=(e,t,r)=>fC(e,t,r)===0;var cC=lC;const dC=ko,hC=(e,t,r)=>dC(e,t,r)!==0;var gC=hC;const pC=ko,bC=(e,t,r)=>pC(e,t,r)>=0;var my=bC;const _C=ko,yC=(e,t,r)=>_C(e,t,r)<=0;var Ey=yC;const wC=cC,mC=gC,EC=hd,vC=my,SC=wy,RC=Ey,AC=(e,t,r,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return wC(e,r,o);case"!=":return mC(e,r,o);case">":return EC(e,r,o);case">=":return vC(e,r,o);case"<":return SC(e,r,o);case"<=":return RC(e,r,o);default:throw new TypeError(`Invalid operator: ${t}`)}};var TC=AC;const{safeRe:xN,t:DN}=ks;class IC{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var OC=IC,Jl,Yp;function on(){if(Yp)return Jl;Yp=1;const e=/\s+/g;class t{constructor(G,Y){if(Y=s(Y),G instanceof t)return G.loose===!!Y.loose&&G.includePrerelease===!!Y.includePrerelease?G:new t(G.raw,Y);if(G instanceof u)return this.raw=G.value,this.set=[[G]],this.formatted=void 0,this;if(this.options=Y,this.loose=!!Y.loose,this.includePrerelease=!!Y.includePrerelease,this.raw=G.trim().replace(e," "),this.set=this.raw.split("||").map(V=>this.parseRange(V.trim())).filter(V=>V.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const V=this.set[0];if(this.set=this.set.filter(ne=>!v(ne[0])),this.set.length===0)this.set=[V];else if(this.set.length>1){for(const ne of this.set)if(ne.length===1&&C(ne[0])){this.set=[ne];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let G=0;G<this.set.length;G++){G>0&&(this.formatted+="||");const Y=this.set[G];for(let V=0;V<Y.length;V++)V>0&&(this.formatted+=" "),this.formatted+=Y[V].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(G){const V=((this.options.includePrerelease&&A)|(this.options.loose&&x))+":"+G,ne=o.get(V);if(ne)return ne;const W=this.options.loose,K=W?l[p.HYPHENRANGELOOSE]:l[p.HYPHENRANGE];G=G.replace(K,F(this.options.includePrerelease)),f("hyphen replace",G),G=G.replace(l[p.COMPARATORTRIM],b),f("comparator trim",G),G=G.replace(l[p.TILDETRIM],w),f("tilde trim",G),G=G.replace(l[p.CARETTRIM],I),f("caret trim",G);let ae=G.split(" ").map(be=>P(be,this.options)).join(" ").split(/\s+/).map(be=>me(be,this.options));W&&(ae=ae.filter(be=>(f("loose invalid filter",be,this.options),!!be.match(l[p.COMPARATORLOOSE])))),f("range list",ae);const de=new Map,re=ae.map(be=>new u(be,this.options));for(const be of re){if(v(be))return[be];de.set(be.value,be)}de.size>1&&de.has("")&&de.delete("");const _e=[...de.values()];return o.set(V,_e),_e}intersects(G,Y){if(!(G instanceof t))throw new TypeError("a Range is required");return this.set.some(V=>B(V,Y)&&G.set.some(ne=>B(ne,Y)&&V.every(W=>ne.every(K=>W.intersects(K,Y)))))}test(G){if(!G)return!1;if(typeof G=="string")try{G=new h(G,this.options)}catch{return!1}for(let Y=0;Y<this.set.length;Y++)if(U(this.set[Y],G,this.options))return!0;return!1}}Jl=t;const r=OC,o=new r,s=dd,u=ku(),f=Uu,h=Fs,{safeRe:l,t:p,comparatorTrimReplace:b,tildeTrimReplace:w,caretTrimReplace:I}=ks,{FLAG_INCLUDE_PRERELEASE:A,FLAG_LOOSE:x}=ju,v=$=>$.value==="<0.0.0-0",C=$=>$.value==="",B=($,G)=>{let Y=!0;const V=$.slice();let ne=V.pop();for(;Y&&V.length;)Y=V.every(W=>ne.intersects(W,G)),ne=V.pop();return Y},P=($,G)=>(f("comp",$,G),$=Q($,G),f("caret",$),$=m($,G),f("tildes",$),$=ue($,G),f("xrange",$),$=Se($,G),f("stars",$),$),S=$=>!$||$.toLowerCase()==="x"||$==="*",m=($,G)=>$.trim().split(/\s+/).map(Y=>j(Y,G)).join(" "),j=($,G)=>{const Y=G.loose?l[p.TILDELOOSE]:l[p.TILDE];return $.replace(Y,(V,ne,W,K,ae)=>{f("tilde",$,V,ne,W,K,ae);let de;return S(ne)?de="":S(W)?de=`>=${ne}.0.0 <${+ne+1}.0.0-0`:S(K)?de=`>=${ne}.${W}.0 <${ne}.${+W+1}.0-0`:ae?(f("replaceTilde pr",ae),de=`>=${ne}.${W}.${K}-${ae} <${ne}.${+W+1}.0-0`):de=`>=${ne}.${W}.${K} <${ne}.${+W+1}.0-0`,f("tilde return",de),de})},Q=($,G)=>$.trim().split(/\s+/).map(Y=>ce(Y,G)).join(" "),ce=($,G)=>{f("caret",$,G);const Y=G.loose?l[p.CARETLOOSE]:l[p.CARET],V=G.includePrerelease?"-0":"";return $.replace(Y,(ne,W,K,ae,de)=>{f("caret",$,ne,W,K,ae,de);let re;return S(W)?re="":S(K)?re=`>=${W}.0.0${V} <${+W+1}.0.0-0`:S(ae)?W==="0"?re=`>=${W}.${K}.0${V} <${W}.${+K+1}.0-0`:re=`>=${W}.${K}.0${V} <${+W+1}.0.0-0`:de?(f("replaceCaret pr",de),W==="0"?K==="0"?re=`>=${W}.${K}.${ae}-${de} <${W}.${K}.${+ae+1}-0`:re=`>=${W}.${K}.${ae}-${de} <${W}.${+K+1}.0-0`:re=`>=${W}.${K}.${ae}-${de} <${+W+1}.0.0-0`):(f("no pr"),W==="0"?K==="0"?re=`>=${W}.${K}.${ae}${V} <${W}.${K}.${+ae+1}-0`:re=`>=${W}.${K}.${ae}${V} <${W}.${+K+1}.0-0`:re=`>=${W}.${K}.${ae} <${+W+1}.0.0-0`),f("caret return",re),re})},ue=($,G)=>(f("replaceXRanges",$,G),$.split(/\s+/).map(Y=>te(Y,G)).join(" ")),te=($,G)=>{$=$.trim();const Y=G.loose?l[p.XRANGELOOSE]:l[p.XRANGE];return $.replace(Y,(V,ne,W,K,ae,de)=>{f("xRange",$,V,ne,W,K,ae,de);const re=S(W),_e=re||S(K),be=_e||S(ae),R=be;return ne==="="&&R&&(ne=""),de=G.includePrerelease?"-0":"",re?ne===">"||ne==="<"?V="<0.0.0-0":V="*":ne&&R?(_e&&(K=0),ae=0,ne===">"?(ne=">=",_e?(W=+W+1,K=0,ae=0):(K=+K+1,ae=0)):ne==="<="&&(ne="<",_e?W=+W+1:K=+K+1),ne==="<"&&(de="-0"),V=`${ne+W}.${K}.${ae}${de}`):_e?V=`>=${W}.0.0${de} <${+W+1}.0.0-0`:be&&(V=`>=${W}.${K}.0${de} <${W}.${+K+1}.0-0`),f("xRange return",V),V})},Se=($,G)=>(f("replaceStars",$,G),$.trim().replace(l[p.STAR],"")),me=($,G)=>(f("replaceGTE0",$,G),$.trim().replace(l[G.includePrerelease?p.GTE0PRE:p.GTE0],"")),F=$=>(G,Y,V,ne,W,K,ae,de,re,_e,be,R)=>(S(V)?Y="":S(ne)?Y=`>=${V}.0.0${$?"-0":""}`:S(W)?Y=`>=${V}.${ne}.0${$?"-0":""}`:K?Y=`>=${Y}`:Y=`>=${Y}${$?"-0":""}`,S(re)?de="":S(_e)?de=`<${+re+1}.0.0-0`:S(be)?de=`<${re}.${+_e+1}.0-0`:R?de=`<=${re}.${_e}.${be}-${R}`:$?de=`<${re}.${_e}.${+be+1}-0`:de=`<=${de}`,`${Y} ${de}`.trim()),U=($,G,Y)=>{for(let V=0;V<$.length;V++)if(!$[V].test(G))return!1;if(G.prerelease.length&&!Y.includePrerelease){for(let V=0;V<$.length;V++)if(f($[V].semver),$[V].semver!==u.ANY&&$[V].semver.prerelease.length>0){const ne=$[V].semver;if(ne.major===G.major&&ne.minor===G.minor&&ne.patch===G.patch)return!0}return!1}return!0};return Jl}var Yl,Xp;function ku(){if(Xp)return Yl;Xp=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(b,w){if(w=r(w),b instanceof t){if(b.loose===!!w.loose)return b;b=b.value}b=b.trim().split(/\s+/).join(" "),f("comparator",b,w),this.options=w,this.loose=!!w.loose,this.parse(b),this.semver===e?this.value="":this.value=this.operator+this.semver.version,f("comp",this)}parse(b){const w=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],I=b.match(w);if(!I)throw new TypeError(`Invalid comparator: ${b}`);this.operator=I[1]!==void 0?I[1]:"",this.operator==="="&&(this.operator=""),I[2]?this.semver=new h(I[2],this.options.loose):this.semver=e}toString(){return this.value}test(b){if(f("Comparator.test",b,this.options.loose),this.semver===e||b===e)return!0;if(typeof b=="string")try{b=new h(b,this.options)}catch{return!1}return u(b,this.operator,this.semver,this.options)}intersects(b,w){if(!(b instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(b.value,w).test(this.value):b.operator===""?b.value===""?!0:new l(this.value,w).test(b.semver):(w=r(w),w.includePrerelease&&(this.value==="<0.0.0-0"||b.value==="<0.0.0-0")||!w.includePrerelease&&(this.value.startsWith("<0.0.0")||b.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&b.operator.startsWith(">")||this.operator.startsWith("<")&&b.operator.startsWith("<")||this.semver.version===b.semver.version&&this.operator.includes("=")&&b.operator.includes("=")||u(this.semver,"<",b.semver,w)&&this.operator.startsWith(">")&&b.operator.startsWith("<")||u(this.semver,">",b.semver,w)&&this.operator.startsWith("<")&&b.operator.startsWith(">")))}}Yl=t;const r=dd,{safeRe:o,t:s}=ks,u=TC,f=Uu,h=Fs,l=on();return Yl}const CC=on(),LC=(e,t,r)=>{try{t=new CC(t,r)}catch{return!1}return t.test(e)};var vy=LC;on();on();on();on();const PC=on(),BC=(e,t)=>{try{return new PC(e,t).range||"*"}catch{return null}};var NC=BC;const $C=Fs,Sy=ku(),{ANY:MC}=Sy,xC=on(),DC=vy,Zp=hd,Qp=wy,jC=Ey,UC=my,kC=(e,t,r,o)=>{e=new $C(e,o),t=new xC(t,o);let s,u,f,h,l;switch(r){case">":s=Zp,u=jC,f=Qp,h=">",l=">=";break;case"<":s=Qp,u=UC,f=Zp,h="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(DC(e,t,o))return!1;for(let p=0;p<t.set.length;++p){const b=t.set[p];let w=null,I=null;if(b.forEach(A=>{A.semver===MC&&(A=new Sy(">=0.0.0")),w=w||A,I=I||A,s(A.semver,w.semver,o)?w=A:f(A.semver,I.semver,o)&&(I=A)}),w.operator===h||w.operator===l||(!I.operator||I.operator===h)&&u(e,I.semver))return!1;if(I.operator===l&&f(e,I.semver))return!1}return!0};var FC=kC;const HC=FC,WC=(e,t,r)=>HC(e,t,">",r);var qC=WC;on();on();const gd=ku(),{ANY:jN}=gd;new gd(">=0.0.0-0");new gd(">=0.0.0");const Xl=ks,eb=ju,tb=yy,GC=nC,VC=hd;ku();on();const zC=vy,KC=NC,JC=qC;var YC={valid:GC,gt:VC,satisfies:zC,validRange:KC,gtr:JC,re:Xl.re,src:Xl.src,tokens:Xl.t,SEMVER_SPEC_VERSION:eb.SEMVER_SPEC_VERSION,RELEASE_TYPES:eb.RELEASE_TYPES,compareIdentifiers:tb.compareIdentifiers,rcompareIdentifiers:tb.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=YC,r=Xi,o=Wt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",w=>(0,t.valid)(w)===null?`Expected SemVer version, got "${w}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",w=>(0,t.validRange)(w)===null?`Expected SemVer range, got "${w}"`:!0);function s(w){return(0,r.is)(w,e.VersionStruct)}e.isValidSemVerVersion=s;function u(w){return(0,r.is)(w,e.VersionRangeStruct)}e.isValidSemVerRange=u;function f(w){(0,o.assertStruct)(w,e.VersionStruct)}e.assertIsSemVerVersion=f;function h(w){(0,o.assertStruct)(w,e.VersionRangeStruct)}e.assertIsSemVerRange=h;function l(w,I){return(0,t.gt)(w,I)}e.gtVersion=l;function p(w,I){return(0,t.gtr)(w,I)}e.gtRange=p;function b(w,I){return(0,t.satisfies)(w,I,{includePrerelease:!0})}e.satisfiesVersionRange=b})(py);(function(e){var t=H.commonjsGlobal&&H.commonjsGlobal.__createBinding||(Object.create?function(o,s,u,f){f===void 0&&(f=u);var h=Object.getOwnPropertyDescriptor(s,u);(!h||("get"in h?!s.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(o,f,h)}:function(o,s,u,f){f===void 0&&(f=u),o[f]=s[u]}),r=H.commonjsGlobal&&H.commonjsGlobal.__exportStar||function(o,s){for(var u in o)u!=="default"&&!Object.prototype.hasOwnProperty.call(s,u)&&t(s,o,u)};Object.defineProperty(e,"__esModule",{value:!0}),r(Wt,e),r(js,e),r(Ze,e),r(xu,e),r(vn,e),r(Po,e),r(uy,e),r(Us,e),r(fy,e),r(ly,e),r(Bo,e),r(cy,e),r(Sn,e),r(dy,e),r(hy,e),r(gy,e),r(py,e)})(nd);var Fu={},Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.errorValues=Si.errorCodes=void 0;Si.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Si.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeCause=e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=nd,r=Si,o=r.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",u={code:o,message:f(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function f(A,x=s){if(h(A)){const v=A.toString();if((0,t.hasProperty)(r.errorValues,v))return r.errorValues[v].message;if(b(A))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return x}e.getMessageFromCode=f;function h(A){return Number.isInteger(A)}e.isValidCode=h;function l(A,{fallbackError:x=u,shouldIncludeStack:v=!0}={}){if(!(0,t.isJsonRpcError)(x))throw new Error("Must provide fallback error with integer number code and string message.");const C=p(A,x);return v||delete C.stack,C}e.serializeError=l;function p(A,x){if(A&&typeof A=="object"&&"serialize"in A&&typeof A.serialize=="function")return A.serialize();if((0,t.isJsonRpcError)(A))return A;const v=w(A);return{...x,data:{cause:v}}}function b(A){return A>=-32099&&A<=-32e3}function w(A){return Array.isArray(A)?A.map(x=>(0,t.isValidJson)(x)?x:(0,t.isObject)(x)?I(x):null):(0,t.isObject)(A)?I(A):(0,t.isValidJson)(A)?A:null}e.serializeCause=w;function I(A){return Object.getOwnPropertyNames(A).reduce((x,v)=>{const C=A[v];return(0,t.isValidJson)(C)&&(x[v]=C),x},{})}})(Fu);var XC=H.commonjsGlobal&&H.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qi,"__esModule",{value:!0});qi.EthereumProviderError=qi.JsonRpcError=void 0;const ZC=nd,QC=XC(qc),eL=Fu;class Ry extends Error{constructor(t,r,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a non-empty string.');super(r),this.code=t,o!==void 0&&(this.data=o)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data,(0,ZC.isPlainObject)(this.data)&&(t.data.cause=(0,eL.serializeCause)(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return(0,QC.default)(this.serialize(),nL,2)}}qi.JsonRpcError=Ry;class tL extends Ry{constructor(t,r,o){if(!rL(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,o)}}qi.EthereumProviderError=tL;function rL(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function nL(e,t){if(t!=="[Circular]")return t}var No={};Object.defineProperty(No,"__esModule",{value:!0});No.providerErrors=No.rpcErrors=void 0;const pd=qi,Xt=Si,Ay=Fu;No.rpcErrors={parse:e=>Ur(Xt.errorCodes.rpc.parse,e),invalidRequest:e=>Ur(Xt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ur(Xt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ur(Xt.errorCodes.rpc.methodNotFound,e),internal:e=>Ur(Xt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ur(t,e)},invalidInput:e=>Ur(Xt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ur(Xt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ur(Xt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ur(Xt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ur(Xt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ur(Xt.errorCodes.rpc.limitExceeded,e)};No.providerErrors={userRejectedRequest:e=>gs(Xt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gs(Xt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gs(Xt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gs(Xt.errorCodes.provider.disconnected,e),chainDisconnected:e=>gs(Xt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:o}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new pd.EthereumProviderError(t,r,o)}};function Ur(e,t){const[r,o]=Ty(t);return new pd.JsonRpcError(e,r??(0,Ay.getMessageFromCode)(e),o)}function gs(e,t){const[r,o]=Ty(t);return new pd.EthereumProviderError(e,r??(0,Ay.getMessageFromCode)(e),o)}function Ty(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorCodes=e.providerErrors=e.rpcErrors=e.getMessageFromCode=e.serializeError=e.serializeCause=e.EthereumProviderError=e.JsonRpcError=void 0;var t=qi;Object.defineProperty(e,"JsonRpcError",{enumerable:!0,get:function(){return t.JsonRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});var r=Fu;Object.defineProperty(e,"serializeCause",{enumerable:!0,get:function(){return r.serializeCause}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});var o=No;Object.defineProperty(e,"rpcErrors",{enumerable:!0,get:function(){return o.rpcErrors}}),Object.defineProperty(e,"providerErrors",{enumerable:!0,get:function(){return o.providerErrors}});var s=Si;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(_O);var bd={exports:{}},iL=Iy;function Iy(e,t){if(e&&t)return Iy(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(o){r[o]=e[o]}),r;function r(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];var u=e.apply(this,o),f=o[o.length-1];return typeof u=="function"&&u!==f&&Object.keys(f).forEach(function(h){u[h]=f[h]}),u}}var Oy=iL;bd.exports=Oy(uu);bd.exports.strict=Oy(Cy);uu.proto=uu(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return uu(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Cy(this)},configurable:!0})});function uu(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Cy(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}var _d=bd.exports;const oL=H.getDefaultExportFromCjs(_d);var sL=_d,aL=function(){},uL=function(e){return e.setHeader&&typeof e.abort=="function"},fL=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},Ly=function(e,t,r){if(typeof t=="function")return Ly(e,null,t);t||(t={}),r=sL(r||aL);var o=e._writableState,s=e._readableState,u=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,h=!1,l=function(){e.writable||p()},p=function(){f=!1,u||r.call(e)},b=function(){u=!1,f||r.call(e)},w=function(C){r.call(e,C?new Error("exited with error code: "+C):null)},I=function(C){r.call(e,C)},A=function(){H.dist.process.nextTick(x)},x=function(){if(!h){if(u&&!(s&&s.ended&&!s.destroyed))return r.call(e,new Error("premature close"));if(f&&!(o&&o.ended&&!o.destroyed))return r.call(e,new Error("premature close"))}},v=function(){e.req.on("finish",p)};return uL(e)?(e.on("complete",p),e.on("abort",A),e.req?v():e.on("request",v)):f&&!o&&(e.on("end",l),e.on("close",l)),fL(e)&&e.on("exit",w),e.on("end",b),e.on("finish",p),t.error!==!1&&e.on("error",I),e.on("close",A),function(){h=!0,e.removeListener("complete",p),e.removeListener("abort",A),e.removeListener("request",v),e.req&&e.req.removeListener("finish",p),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",p),e.removeListener("exit",w),e.removeListener("end",b),e.removeListener("error",I),e.removeListener("close",A)}},Py=Ly;const rb=H.getDefaultExportFromCjs(Py);var lL=_d,cL=Py,fu;try{fu=H.require$$3}catch{}var Cs=function(){},dL=/^v?\.0/.test(H.dist.process.version),Hu=function(e){return typeof e=="function"},hL=function(e){return!dL||!fu?!1:(e instanceof(fu.ReadStream||Cs)||e instanceof(fu.WriteStream||Cs))&&Hu(e.close)},gL=function(e){return e.setHeader&&Hu(e.abort)},pL=function(e,t,r,o){o=lL(o);var s=!1;e.on("close",function(){s=!0}),cL(e,{readable:t,writable:r},function(f){if(f)return o(f);s=!0,o()});var u=!1;return function(f){if(!s&&!u){if(u=!0,hL(e))return e.close(Cs);if(gL(e))return e.abort();if(Hu(e.destroy))return e.destroy();o(f||new Error("stream was destroyed"))}}},nb=function(e){e()},bL=function(e,t){return e.pipe(t)},_L=function(){var e=Array.prototype.slice.call(arguments),t=Hu(e[e.length-1]||Cs)&&e.pop()||Cs;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,o=e.map(function(s,u){var f=u<e.length-1,h=u>0;return pL(s,f,h,function(l){r||(r=l),l&&o.forEach(nb),!f&&(o.forEach(nb),t(r))})});return e.reduce(bL)},yL=_L;const ib=H.getDefaultExportFromCjs(yL);var wL={},Wu={},qu={},By={},$o={},mi={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.output=Ot.exists=Ot.hash=Ot.bytes=Ot.bool=Ot.number=Ot.isBytes=void 0;function bu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}Ot.number=bu;function Ny(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}Ot.bool=Ny;function $y(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}Ot.isBytes=$y;function yd(e,...t){if(!$y(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}Ot.bytes=yd;function My(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");bu(e.outputLen),bu(e.blockLen)}Ot.hash=My;function xy(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Ot.exists=xy;function Dy(e,t){yd(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Ot.output=Dy;const mL={number:bu,bool:Ny,bytes:yd,hash:My,exists:xy,output:Dy};Ot.default=mL;var Zn={},Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});Gu.crypto=void 0;Gu.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.byteSwap32=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=e.isBytes=void 0;const t=Gu,r=Ot;function o(F){return F instanceof Uint8Array||F!=null&&typeof F=="object"&&F.constructor.name==="Uint8Array"}e.isBytes=o;const s=F=>new Uint8Array(F.buffer,F.byteOffset,F.byteLength);e.u8=s;const u=F=>new Uint32Array(F.buffer,F.byteOffset,Math.floor(F.byteLength/4));e.u32=u;const f=F=>new DataView(F.buffer,F.byteOffset,F.byteLength);e.createView=f;const h=(F,U)=>F<<32-U|F>>>U;e.rotr=h;const l=(F,U)=>F<<U|F>>>32-U>>>0;e.rotl=l,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const p=F=>F<<24&4278190080|F<<8&16711680|F>>>8&65280|F>>>24&255;e.byteSwap=p,e.byteSwapIfBE=e.isLE?F=>F:F=>(0,e.byteSwap)(F);function b(F){for(let U=0;U<F.length;U++)F[U]=(0,e.byteSwap)(F[U])}e.byteSwap32=b;const w=Array.from({length:256},(F,U)=>U.toString(16).padStart(2,"0"));function I(F){(0,r.bytes)(F);let U="";for(let $=0;$<F.length;$++)U+=w[F[$]];return U}e.bytesToHex=I;const A={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function x(F){if(F>=A._0&&F<=A._9)return F-A._0;if(F>=A._A&&F<=A._F)return F-(A._A-10);if(F>=A._a&&F<=A._f)return F-(A._a-10)}function v(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);const U=F.length,$=U/2;if(U%2)throw new Error("padded hex string expected, got unpadded hex of length "+U);const G=new Uint8Array($);for(let Y=0,V=0;Y<$;Y++,V+=2){const ne=x(F.charCodeAt(V)),W=x(F.charCodeAt(V+1));if(ne===void 0||W===void 0){const K=F[V]+F[V+1];throw new Error('hex string expected, got non-hex character "'+K+'" at index '+V)}G[Y]=ne*16+W}return G}e.hexToBytes=v;const C=async()=>{};e.nextTick=C;async function B(F,U,$){let G=Date.now();for(let Y=0;Y<F;Y++){$(Y);const V=Date.now()-G;V>=0&&V<U||(await(0,e.nextTick)(),G+=V)}}e.asyncLoop=B;function P(F){if(typeof F!="string")throw new Error(`utf8ToBytes expected string, got ${typeof F}`);return new Uint8Array(new TextEncoder().encode(F))}e.utf8ToBytes=P;function S(F){return typeof F=="string"&&(F=P(F)),(0,r.bytes)(F),F}e.toBytes=S;function m(...F){let U=0;for(let G=0;G<F.length;G++){const Y=F[G];(0,r.bytes)(Y),U+=Y.length}const $=new Uint8Array(U);for(let G=0,Y=0;G<F.length;G++){const V=F[G];$.set(V,Y),Y+=V.length}return $}e.concatBytes=m;class j{clone(){return this._cloneInto()}}e.Hash=j;const Q={}.toString;function ce(F,U){if(U!==void 0&&Q.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(F,U)}e.checkOpts=ce;function ue(F){const U=G=>F().update(S(G)).digest(),$=F();return U.outputLen=$.outputLen,U.blockLen=$.blockLen,U.create=()=>F(),U}e.wrapConstructor=ue;function te(F){const U=(G,Y)=>F(Y).update(S(G)).digest(),$=F({});return U.outputLen=$.outputLen,U.blockLen=$.blockLen,U.create=G=>F(G),U}e.wrapConstructorWithOpts=te;function Se(F){const U=(G,Y)=>F(Y).update(S(G)).digest(),$=F({});return U.outputLen=$.outputLen,U.blockLen=$.blockLen,U.create=G=>F(G),U}e.wrapXOFConstructorWithOpts=Se;function me(F=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(F));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=me})(Zn);Object.defineProperty(mi,"__esModule",{value:!0});mi.HashMD=mi.Maj=mi.Chi=void 0;const Zl=Ot,ps=Zn;function EL(e,t,r,o){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,o);const s=BigInt(32),u=BigInt(4294967295),f=Number(r>>s&u),h=Number(r&u),l=o?4:0,p=o?0:4;e.setUint32(t+l,f,o),e.setUint32(t+p,h,o)}const vL=(e,t,r)=>e&t^~e&r;mi.Chi=vL;const SL=(e,t,r)=>e&t^e&r^t&r;mi.Maj=SL;class RL extends ps.Hash{constructor(t,r,o,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=o,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,ps.createView)(this.buffer)}update(t){(0,Zl.exists)(this);const{view:r,buffer:o,blockLen:s}=this;t=(0,ps.toBytes)(t);const u=t.length;for(let f=0;f<u;){const h=Math.min(s-this.pos,u-f);if(h===s){const l=(0,ps.createView)(t);for(;s<=u-f;f+=s)this.process(l,f);continue}o.set(t.subarray(f,f+h),this.pos),this.pos+=h,f+=h,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,Zl.exists)(this),(0,Zl.output)(t,this),this.finished=!0;const{buffer:r,view:o,blockLen:s,isLE:u}=this;let{pos:f}=this;r[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>s-f&&(this.process(o,0),f=0);for(let w=f;w<s;w++)r[w]=0;EL(o,s-8,BigInt(this.length*8),u),this.process(o,0);const h=(0,ps.createView)(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=l/4,b=this.get();if(p>b.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w<p;w++)h.setUint32(4*w,b[w],u)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const o=t.slice(0,r);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:o,length:s,finished:u,destroyed:f,pos:h}=this;return t.length=s,t.pos=h,t.finished=u,t.destroyed=f,s%r&&t.buffer.set(o),t}}mi.HashMD=RL;Object.defineProperty($o,"__esModule",{value:!0});$o.sha224=$o.sha256=void 0;const Ql=mi,kr=Zn,AL=new Uint32Array([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]),pi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bi=new Uint32Array(64);class jy extends Ql.HashMD{constructor(){super(64,32,8,!1),this.A=pi[0]|0,this.B=pi[1]|0,this.C=pi[2]|0,this.D=pi[3]|0,this.E=pi[4]|0,this.F=pi[5]|0,this.G=pi[6]|0,this.H=pi[7]|0}get(){const{A:t,B:r,C:o,D:s,E:u,F:f,G:h,H:l}=this;return[t,r,o,s,u,f,h,l]}set(t,r,o,s,u,f,h,l){this.A=t|0,this.B=r|0,this.C=o|0,this.D=s|0,this.E=u|0,this.F=f|0,this.G=h|0,this.H=l|0}process(t,r){for(let w=0;w<16;w++,r+=4)bi[w]=t.getUint32(r,!1);for(let w=16;w<64;w++){const I=bi[w-15],A=bi[w-2],x=(0,kr.rotr)(I,7)^(0,kr.rotr)(I,18)^I>>>3,v=(0,kr.rotr)(A,17)^(0,kr.rotr)(A,19)^A>>>10;bi[w]=v+bi[w-7]+x+bi[w-16]|0}let{A:o,B:s,C:u,D:f,E:h,F:l,G:p,H:b}=this;for(let w=0;w<64;w++){const I=(0,kr.rotr)(h,6)^(0,kr.rotr)(h,11)^(0,kr.rotr)(h,25),A=b+I+(0,Ql.Chi)(h,l,p)+AL[w]+bi[w]|0,v=((0,kr.rotr)(o,2)^(0,kr.rotr)(o,13)^(0,kr.rotr)(o,22))+(0,Ql.Maj)(o,s,u)|0;b=p,p=l,l=h,h=f+A|0,f=u,u=s,s=o,o=A+v|0}o=o+this.A|0,s=s+this.B|0,u=u+this.C|0,f=f+this.D|0,h=h+this.E|0,l=l+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(o,s,u,f,h,l,p,b)}roundClean(){bi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class TL extends jy{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}$o.sha256=(0,kr.wrapConstructor)(()=>new jy);$o.sha224=(0,kr.wrapConstructor)(()=>new TL);var Vu={},Uy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=Ot,r=Zn;class o extends r.Hash{constructor(f,h){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(f);const l=(0,r.toBytes)(h);if(this.iHash=f.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const p=this.blockLen,b=new Uint8Array(p);b.set(l.length>p?f.create().update(l).digest():l);for(let w=0;w<b.length;w++)b[w]^=54;this.iHash.update(b),this.oHash=f.create();for(let w=0;w<b.length;w++)b[w]^=106;this.oHash.update(b),b.fill(0)}update(f){return(0,t.exists)(this),this.iHash.update(f),this}digestInto(f){(0,t.exists)(this),(0,t.bytes)(f,this.outputLen),this.finished=!0,this.iHash.digestInto(f),this.oHash.update(f),this.oHash.digestInto(f),this.destroy()}digest(){const f=new Uint8Array(this.oHash.outputLen);return this.digestInto(f),f}_cloneInto(f){f||(f=Object.create(Object.getPrototypeOf(this),{}));const{oHash:h,iHash:l,finished:p,destroyed:b,blockLen:w,outputLen:I}=this;return f=f,f.finished=p,f.destroyed=b,f.blockLen=w,f.outputLen=I,f.oHash=h._cloneInto(f.oHash),f.iHash=l._cloneInto(f.iHash),f}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=o;const s=(u,f,h)=>new o(u,f).update(h).digest();e.hmac=s,e.hmac.create=(u,f)=>new o(u,f)})(Uy);var wd={},zu={},pt={},ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.bitMask=void 0;ot.isBytes=Ju;ot.abytes=Yu;ot.bytesToHex=md;ot.numberToHexUnpadded=Fy;ot.hexToNumber=Ed;ot.hexToBytes=Xu;ot.bytesToNumberBE=CL;ot.bytesToNumberLE=LL;ot.numberToBytesBE=Hy;ot.numberToBytesLE=PL;ot.numberToVarBytesBE=BL;ot.ensureBytes=NL;ot.concatBytes=Wy;ot.equalBytes=$L;ot.utf8ToBytes=ML;ot.bitLen=xL;ot.bitGet=DL;ot.bitSet=jL;ot.createHmacDrbg=kL;ot.validateObject=HL;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ky=BigInt(0),Ku=BigInt(1),IL=BigInt(2);function Ju(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Yu(e){if(!Ju(e))throw new Error("Uint8Array expected")}const OL=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function md(e){Yu(e);let t="";for(let r=0;r<e.length;r++)t+=OL[e[r]];return t}function Fy(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function Ed(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const Gn={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function ob(e){if(e>=Gn._0&&e<=Gn._9)return e-Gn._0;if(e>=Gn._A&&e<=Gn._F)return e-(Gn._A-10);if(e>=Gn._a&&e<=Gn._f)return e-(Gn._a-10)}function Xu(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const o=new Uint8Array(r);for(let s=0,u=0;s<r;s++,u+=2){const f=ob(e.charCodeAt(u)),h=ob(e.charCodeAt(u+1));if(f===void 0||h===void 0){const l=e[u]+e[u+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+u)}o[s]=f*16+h}return o}function CL(e){return Ed(md(e))}function LL(e){return Yu(e),Ed(md(Uint8Array.from(e).reverse()))}function Hy(e,t){return Xu(e.toString(16).padStart(t*2,"0"))}function PL(e,t){return Hy(e,t).reverse()}function BL(e){return Xu(Fy(e))}function NL(e,t,r){let o;if(typeof t=="string")try{o=Xu(t)}catch(u){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${u}`)}else if(Ju(t))o=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=o.length;if(typeof r=="number"&&s!==r)throw new Error(`${e} expected ${r} bytes, got ${s}`);return o}function Wy(...e){let t=0;for(let o=0;o<e.length;o++){const s=e[o];Yu(s),t+=s.length}const r=new Uint8Array(t);for(let o=0,s=0;o<e.length;o++){const u=e[o];r.set(u,s),s+=u.length}return r}function $L(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e[o]^t[o];return r===0}function ML(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function xL(e){let t;for(t=0;e>ky;e>>=Ku,t+=1);return t}function DL(e,t){return e>>BigInt(t)&Ku}function jL(e,t,r){return e|(r?Ku:ky)<<BigInt(t)}const UL=e=>(IL<<BigInt(e-1))-Ku;ot.bitMask=UL;const ec=e=>new Uint8Array(e),sb=e=>Uint8Array.from(e);function kL(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let o=ec(e),s=ec(e),u=0;const f=()=>{o.fill(1),s.fill(0),u=0},h=(...w)=>r(s,o,...w),l=(w=ec())=>{s=h(sb([0]),w),o=h(),w.length!==0&&(s=h(sb([1]),w),o=h())},p=()=>{if(u++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const I=[];for(;w<t;){o=h();const A=o.slice();I.push(A),w+=o.length}return Wy(...I)};return(w,I)=>{f(),l(w);let A;for(;!(A=I(p()));)l();return f(),A}}const FL={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Ju(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function HL(e,t,r={}){const o=(s,u,f)=>{const h=FL[u];if(typeof h!="function")throw new Error(`Invalid validator "${u}", expected function`);const l=e[s];if(!(f&&l===void 0)&&!h(l,e))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${u}`)};for(const[s,u]of Object.entries(t))o(s,u,!1);for(const[s,u]of Object.entries(r))o(s,u,!0);return e}Object.defineProperty(pt,"__esModule",{value:!0});pt.isNegativeLE=void 0;pt.mod=Ar;pt.pow=qy;pt.pow2=qL;pt.invert=_u;pt.tonelliShanks=Gy;pt.FpSqrt=Vy;pt.validateField=zL;pt.FpPow=zy;pt.FpInvertBatch=Ky;pt.FpDiv=KL;pt.FpIsSquare=JL;pt.nLength=vd;pt.Field=YL;pt.FpSqrtOdd=XL;pt.FpSqrtEven=ZL;pt.hashToPrivateScalar=QL;pt.getFieldBytesLength=Sd;pt.getMinHashLength=Jy;pt.mapHashToField=eP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tr=ot,Ut=BigInt(0),gt=BigInt(1),wi=BigInt(2),WL=BigInt(3),Pc=BigInt(4),ab=BigInt(5),ub=BigInt(8);BigInt(9);BigInt(16);function Ar(e,t){const r=e%t;return r>=Ut?r:t+r}function qy(e,t,r){if(r<=Ut||t<Ut)throw new Error("Expected power/modulo > 0");if(r===gt)return Ut;let o=gt;for(;t>Ut;)t&gt&&(o=o*e%r),e=e*e%r,t>>=gt;return o}function qL(e,t,r){let o=e;for(;t-- >Ut;)o*=o,o%=r;return o}function _u(e,t){if(e===Ut||t<=Ut)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Ar(e,t),o=t,s=Ut,u=gt;for(;r!==Ut;){const h=o/r,l=o%r,p=s-u*h;o=r,r=l,s=u,u=p}if(o!==gt)throw new Error("invert: does not exist");return Ar(s,t)}function Gy(e){const t=(e-gt)/wi;let r,o,s;for(r=e-gt,o=0;r%wi===Ut;r/=wi,o++);for(s=wi;s<e&&qy(s,t,e)!==e-gt;s++);if(o===1){const f=(e+gt)/Pc;return function(l,p){const b=l.pow(p,f);if(!l.eql(l.sqr(b),p))throw new Error("Cannot find square root");return b}}const u=(r+gt)/wi;return function(h,l){if(h.pow(l,t)===h.neg(h.ONE))throw new Error("Cannot find square root");let p=o,b=h.pow(h.mul(h.ONE,s),r),w=h.pow(l,u),I=h.pow(l,r);for(;!h.eql(I,h.ONE);){if(h.eql(I,h.ZERO))return h.ZERO;let A=1;for(let v=h.sqr(I);A<p&&!h.eql(v,h.ONE);A++)v=h.sqr(v);const x=h.pow(b,gt<<BigInt(p-A-1));b=h.sqr(x),w=h.mul(w,x),I=h.mul(I,b),p=A}return w}}function Vy(e){if(e%Pc===WL){const t=(e+gt)/Pc;return function(o,s){const u=o.pow(s,t);if(!o.eql(o.sqr(u),s))throw new Error("Cannot find square root");return u}}if(e%ub===ab){const t=(e-ab)/ub;return function(o,s){const u=o.mul(s,wi),f=o.pow(u,t),h=o.mul(s,f),l=o.mul(o.mul(h,wi),f),p=o.mul(h,o.sub(l,o.ONE));if(!o.eql(o.sqr(p),s))throw new Error("Cannot find square root");return p}}return Gy(e)}const GL=(e,t)=>(Ar(e,t)&gt)===gt;pt.isNegativeLE=GL;const VL=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zL(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=VL.reduce((o,s)=>(o[s]="function",o),t);return(0,Tr.validateObject)(e,r)}function zy(e,t,r){if(r<Ut)throw new Error("Expected power > 0");if(r===Ut)return e.ONE;if(r===gt)return t;let o=e.ONE,s=t;for(;r>Ut;)r&gt&&(o=e.mul(o,s)),s=e.sqr(s),r>>=gt;return o}function Ky(e,t){const r=new Array(t.length),o=t.reduce((u,f,h)=>e.is0(f)?u:(r[h]=u,e.mul(u,f)),e.ONE),s=e.inv(o);return t.reduceRight((u,f,h)=>e.is0(f)?u:(r[h]=e.mul(u,r[h]),e.mul(u,f)),s),r}function KL(e,t,r){return e.mul(t,typeof r=="bigint"?_u(r,e.ORDER):e.inv(r))}function JL(e){const t=(e.ORDER-gt)/wi;return r=>{const o=e.pow(r,t);return e.eql(o,e.ZERO)||e.eql(o,e.ONE)}}function vd(e,t){const r=t!==void 0?t:e.toString(2).length,o=Math.ceil(r/8);return{nBitLength:r,nByteLength:o}}function YL(e,t,r=!1,o={}){if(e<=Ut)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:u}=vd(e,t);if(u>2048)throw new Error("Field lengths over 2048 bytes are not supported");const f=Vy(e),h=Object.freeze({ORDER:e,BITS:s,BYTES:u,MASK:(0,Tr.bitMask)(s),ZERO:Ut,ONE:gt,create:l=>Ar(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return Ut<=l&&l<e},is0:l=>l===Ut,isOdd:l=>(l&gt)===gt,neg:l=>Ar(-l,e),eql:(l,p)=>l===p,sqr:l=>Ar(l*l,e),add:(l,p)=>Ar(l+p,e),sub:(l,p)=>Ar(l-p,e),mul:(l,p)=>Ar(l*p,e),pow:(l,p)=>zy(h,l,p),div:(l,p)=>Ar(l*_u(p,e),e),sqrN:l=>l*l,addN:(l,p)=>l+p,subN:(l,p)=>l-p,mulN:(l,p)=>l*p,inv:l=>_u(l,e),sqrt:o.sqrt||(l=>f(h,l)),invertBatch:l=>Ky(h,l),cmov:(l,p,b)=>b?p:l,toBytes:l=>r?(0,Tr.numberToBytesLE)(l,u):(0,Tr.numberToBytesBE)(l,u),fromBytes:l=>{if(l.length!==u)throw new Error(`Fp.fromBytes: expected ${u}, got ${l.length}`);return r?(0,Tr.bytesToNumberLE)(l):(0,Tr.bytesToNumberBE)(l)}});return Object.freeze(h)}function XL(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}function ZL(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function QL(e,t,r=!1){e=(0,Tr.ensureBytes)("privateHash",e);const o=e.length,s=vd(t).nByteLength+8;if(s<24||o<s||o>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${o}`);const u=r?(0,Tr.bytesToNumberLE)(e):(0,Tr.bytesToNumberBE)(e);return Ar(u,t-gt)+gt}function Sd(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Jy(e){const t=Sd(e);return t+Math.ceil(t/2)}function eP(e,t,r=!1){const o=e.length,s=Sd(t),u=Jy(t);if(o<16||o<u||o>1024)throw new Error(`expected ${u}-1024 bytes of input, got ${o}`);const f=r?(0,Tr.bytesToNumberBE)(e):(0,Tr.bytesToNumberLE)(e),h=Ar(f,t-gt)+gt;return r?(0,Tr.numberToBytesLE)(h,s):(0,Tr.numberToBytesBE)(h,s)}Object.defineProperty(zu,"__esModule",{value:!0});zu.wNAF=nP;zu.validateBasic=iP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fb=pt,tP=ot,rP=BigInt(0),tc=BigInt(1);function nP(e,t){const r=(s,u)=>{const f=u.negate();return s?f:u},o=s=>{const u=Math.ceil(t/s)+1,f=2**(s-1);return{windows:u,windowSize:f}};return{constTimeNegate:r,unsafeLadder(s,u){let f=e.ZERO,h=s;for(;u>rP;)u&tc&&(f=f.add(h)),h=h.double(),u>>=tc;return f},precomputeWindow(s,u){const{windows:f,windowSize:h}=o(u),l=[];let p=s,b=p;for(let w=0;w<f;w++){b=p,l.push(b);for(let I=1;I<h;I++)b=b.add(p),l.push(b);p=b.double()}return l},wNAF(s,u,f){const{windows:h,windowSize:l}=o(s);let p=e.ZERO,b=e.BASE;const w=BigInt(2**s-1),I=2**s,A=BigInt(s);for(let x=0;x<h;x++){const v=x*l;let C=Number(f&w);f>>=A,C>l&&(C-=I,f+=tc);const B=v,P=v+Math.abs(C)-1,S=x%2!==0,m=C<0;C===0?b=b.add(r(S,u[B])):p=p.add(r(m,u[P]))}return{p,f:b}},wNAFCached(s,u,f,h){const l=s._WINDOW_SIZE||1;let p=u.get(s);return p||(p=this.precomputeWindow(s,l),l!==1&&u.set(s,h(p))),this.wNAF(l,p,f)}}}function iP(e){return(0,fb.validateField)(e.Fp),(0,tP.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,fb.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=A,e.weierstrass=v,e.SWUFpSqrtRatio=C,e.mapToCurveSimpleSWU=B;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=zu,r=pt,o=ot,s=ot;function u(P){const S=(0,t.validateBasic)(P);o.validateObject(S,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:m,Fp:j,a:Q}=S;if(m){if(!j.eql(Q,j.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof m!="object"||typeof m.beta!="bigint"||typeof m.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...S})}const{bytesToNumberBE:f,hexToBytes:h}=o;e.DER={Err:class extends Error{constructor(S=""){super(S)}},_parseInt(P){const{Err:S}=e.DER;if(P.length<2||P[0]!==2)throw new S("Invalid signature integer tag");const m=P[1],j=P.subarray(2,m+2);if(!m||j.length!==m)throw new S("Invalid signature integer: wrong length");if(j[0]&128)throw new S("Invalid signature integer: negative");if(j[0]===0&&!(j[1]&128))throw new S("Invalid signature integer: unnecessary leading zero");return{d:f(j),l:P.subarray(m+2)}},toSig(P){const{Err:S}=e.DER,m=typeof P=="string"?h(P):P;o.abytes(m);let j=m.length;if(j<2||m[0]!=48)throw new S("Invalid signature tag");if(m[1]!==j-2)throw new S("Invalid signature: incorrect length");const{d:Q,l:ce}=e.DER._parseInt(m.subarray(2)),{d:ue,l:te}=e.DER._parseInt(ce);if(te.length)throw new S("Invalid signature: left bytes after parsing");return{r:Q,s:ue}},hexFromSig(P){const S=me=>Number.parseInt(me[0],16)&8?"00"+me:me,m=me=>{const F=me.toString(16);return F.length&1?`0${F}`:F},j=S(m(P.s)),Q=S(m(P.r)),ce=j.length/2,ue=Q.length/2,te=m(ce),Se=m(ue);return`30${m(ue+ce+4)}02${Se}${Q}02${te}${j}`}};const l=BigInt(0),p=BigInt(1),b=BigInt(2),w=BigInt(3),I=BigInt(4);function A(P){const S=u(P),{Fp:m}=S,j=S.toBytes||((Y,V,ne)=>{const W=V.toAffine();return o.concatBytes(Uint8Array.from([4]),m.toBytes(W.x),m.toBytes(W.y))}),Q=S.fromBytes||(Y=>{const V=Y.subarray(1),ne=m.fromBytes(V.subarray(0,m.BYTES)),W=m.fromBytes(V.subarray(m.BYTES,2*m.BYTES));return{x:ne,y:W}});function ce(Y){const{a:V,b:ne}=S,W=m.sqr(Y),K=m.mul(W,Y);return m.add(m.add(K,m.mul(Y,V)),ne)}if(!m.eql(m.sqr(S.Gy),ce(S.Gx)))throw new Error("bad generator point: equation left != right");function ue(Y){return typeof Y=="bigint"&&l<Y&&Y<S.n}function te(Y){if(!ue(Y))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function Se(Y){const{allowedPrivateKeyLengths:V,nByteLength:ne,wrapPrivateKey:W,n:K}=S;if(V&&typeof Y!="bigint"){if(o.isBytes(Y)&&(Y=o.bytesToHex(Y)),typeof Y!="string"||!V.includes(Y.length))throw new Error("Invalid key");Y=Y.padStart(ne*2,"0")}let ae;try{ae=typeof Y=="bigint"?Y:o.bytesToNumberBE((0,s.ensureBytes)("private key",Y,ne))}catch{throw new Error(`private key must be ${ne} bytes, hex or bigint, not ${typeof Y}`)}return W&&(ae=r.mod(ae,K)),te(ae),ae}const me=new Map;function F(Y){if(!(Y instanceof U))throw new Error("ProjectivePoint expected")}class U{constructor(V,ne,W){if(this.px=V,this.py=ne,this.pz=W,V==null||!m.isValid(V))throw new Error("x required");if(ne==null||!m.isValid(ne))throw new Error("y required");if(W==null||!m.isValid(W))throw new Error("z required")}static fromAffine(V){const{x:ne,y:W}=V||{};if(!V||!m.isValid(ne)||!m.isValid(W))throw new Error("invalid affine point");if(V instanceof U)throw new Error("projective point not allowed");const K=ae=>m.eql(ae,m.ZERO);return K(ne)&&K(W)?U.ZERO:new U(ne,W,m.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(V){const ne=m.invertBatch(V.map(W=>W.pz));return V.map((W,K)=>W.toAffine(ne[K])).map(U.fromAffine)}static fromHex(V){const ne=U.fromAffine(Q((0,s.ensureBytes)("pointHex",V)));return ne.assertValidity(),ne}static fromPrivateKey(V){return U.BASE.multiply(Se(V))}_setWindowSize(V){this._WINDOW_SIZE=V,me.delete(this)}assertValidity(){if(this.is0()){if(S.allowInfinityPoint&&!m.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:V,y:ne}=this.toAffine();if(!m.isValid(V)||!m.isValid(ne))throw new Error("bad point: x or y not FE");const W=m.sqr(ne),K=ce(V);if(!m.eql(W,K))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:V}=this.toAffine();if(m.isOdd)return!m.isOdd(V);throw new Error("Field doesn't support isOdd")}equals(V){F(V);const{px:ne,py:W,pz:K}=this,{px:ae,py:de,pz:re}=V,_e=m.eql(m.mul(ne,re),m.mul(ae,K)),be=m.eql(m.mul(W,re),m.mul(de,K));return _e&&be}negate(){return new U(this.px,m.neg(this.py),this.pz)}double(){const{a:V,b:ne}=S,W=m.mul(ne,w),{px:K,py:ae,pz:de}=this;let re=m.ZERO,_e=m.ZERO,be=m.ZERO,R=m.mul(K,K),O=m.mul(ae,ae),q=m.mul(de,de),oe=m.mul(K,ae);return oe=m.add(oe,oe),be=m.mul(K,de),be=m.add(be,be),re=m.mul(V,be),_e=m.mul(W,q),_e=m.add(re,_e),re=m.sub(O,_e),_e=m.add(O,_e),_e=m.mul(re,_e),re=m.mul(oe,re),be=m.mul(W,be),q=m.mul(V,q),oe=m.sub(R,q),oe=m.mul(V,oe),oe=m.add(oe,be),be=m.add(R,R),R=m.add(be,R),R=m.add(R,q),R=m.mul(R,oe),_e=m.add(_e,R),q=m.mul(ae,de),q=m.add(q,q),R=m.mul(q,oe),re=m.sub(re,R),be=m.mul(q,O),be=m.add(be,be),be=m.add(be,be),new U(re,_e,be)}add(V){F(V);const{px:ne,py:W,pz:K}=this,{px:ae,py:de,pz:re}=V;let _e=m.ZERO,be=m.ZERO,R=m.ZERO;const O=S.a,q=m.mul(S.b,w);let oe=m.mul(ne,ae),ye=m.mul(W,de),d=m.mul(K,re),g=m.add(ne,W),_=m.add(ae,de);g=m.mul(g,_),_=m.add(oe,ye),g=m.sub(g,_),_=m.add(ne,K);let E=m.add(ae,re);return _=m.mul(_,E),E=m.add(oe,d),_=m.sub(_,E),E=m.add(W,K),_e=m.add(de,re),E=m.mul(E,_e),_e=m.add(ye,d),E=m.sub(E,_e),R=m.mul(O,_),_e=m.mul(q,d),R=m.add(_e,R),_e=m.sub(ye,R),R=m.add(ye,R),be=m.mul(_e,R),ye=m.add(oe,oe),ye=m.add(ye,oe),d=m.mul(O,d),_=m.mul(q,_),ye=m.add(ye,d),d=m.sub(oe,d),d=m.mul(O,d),_=m.add(_,d),oe=m.mul(ye,_),be=m.add(be,oe),oe=m.mul(E,_),_e=m.mul(g,_e),_e=m.sub(_e,oe),oe=m.mul(g,ye),R=m.mul(E,R),R=m.add(R,oe),new U(_e,be,R)}subtract(V){return this.add(V.negate())}is0(){return this.equals(U.ZERO)}wNAF(V){return G.wNAFCached(this,me,V,ne=>{const W=m.invertBatch(ne.map(K=>K.pz));return ne.map((K,ae)=>K.toAffine(W[ae])).map(U.fromAffine)})}multiplyUnsafe(V){const ne=U.ZERO;if(V===l)return ne;if(te(V),V===p)return this;const{endo:W}=S;if(!W)return G.unsafeLadder(this,V);let{k1neg:K,k1:ae,k2neg:de,k2:re}=W.splitScalar(V),_e=ne,be=ne,R=this;for(;ae>l||re>l;)ae&p&&(_e=_e.add(R)),re&p&&(be=be.add(R)),R=R.double(),ae>>=p,re>>=p;return K&&(_e=_e.negate()),de&&(be=be.negate()),be=new U(m.mul(be.px,W.beta),be.py,be.pz),_e.add(be)}multiply(V){te(V);let ne=V,W,K;const{endo:ae}=S;if(ae){const{k1neg:de,k1:re,k2neg:_e,k2:be}=ae.splitScalar(ne);let{p:R,f:O}=this.wNAF(re),{p:q,f:oe}=this.wNAF(be);R=G.constTimeNegate(de,R),q=G.constTimeNegate(_e,q),q=new U(m.mul(q.px,ae.beta),q.py,q.pz),W=R.add(q),K=O.add(oe)}else{const{p:de,f:re}=this.wNAF(ne);W=de,K=re}return U.normalizeZ([W,K])[0]}multiplyAndAddUnsafe(V,ne,W){const K=U.BASE,ae=(re,_e)=>_e===l||_e===p||!re.equals(K)?re.multiplyUnsafe(_e):re.multiply(_e),de=ae(this,ne).add(ae(V,W));return de.is0()?void 0:de}toAffine(V){const{px:ne,py:W,pz:K}=this,ae=this.is0();V==null&&(V=ae?m.ONE:m.inv(K));const de=m.mul(ne,V),re=m.mul(W,V),_e=m.mul(K,V);if(ae)return{x:m.ZERO,y:m.ZERO};if(!m.eql(_e,m.ONE))throw new Error("invZ was invalid");return{x:de,y:re}}isTorsionFree(){const{h:V,isTorsionFree:ne}=S;if(V===p)return!0;if(ne)return ne(U,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:V,clearCofactor:ne}=S;return V===p?this:ne?ne(U,this):this.multiplyUnsafe(S.h)}toRawBytes(V=!0){return this.assertValidity(),j(U,this,V)}toHex(V=!0){return o.bytesToHex(this.toRawBytes(V))}}U.BASE=new U(S.Gx,S.Gy,m.ONE),U.ZERO=new U(m.ZERO,m.ONE,m.ZERO);const $=S.nBitLength,G=(0,t.wNAF)(U,S.endo?Math.ceil($/2):$);return{CURVE:S,ProjectivePoint:U,normPrivateKeyToScalar:Se,weierstrassEquation:ce,isWithinCurveOrder:ue}}function x(P){const S=(0,t.validateBasic)(P);return o.validateObject(S,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...S})}function v(P){const S=x(P),{Fp:m,n:j}=S,Q=m.BYTES+1,ce=2*m.BYTES+1;function ue(_){return l<_&&_<m.ORDER}function te(_){return r.mod(_,j)}function Se(_){return r.invert(_,j)}const{ProjectivePoint:me,normPrivateKeyToScalar:F,weierstrassEquation:U,isWithinCurveOrder:$}=A({...S,toBytes(_,E,J){const ie=E.toAffine(),se=m.toBytes(ie.x),Ie=o.concatBytes;return J?Ie(Uint8Array.from([E.hasEvenY()?2:3]),se):Ie(Uint8Array.from([4]),se,m.toBytes(ie.y))},fromBytes(_){const E=_.length,J=_[0],ie=_.subarray(1);if(E===Q&&(J===2||J===3)){const se=o.bytesToNumberBE(ie);if(!ue(se))throw new Error("Point is not on curve");const Ie=U(se);let Be;try{Be=m.sqrt(Ie)}catch(Re){const He=Re instanceof Error?": "+Re.message:"";throw new Error("Point is not on curve"+He)}const Ce=(Be&p)===p;return(J&1)===1!==Ce&&(Be=m.neg(Be)),{x:se,y:Be}}else if(E===ce&&J===4){const se=m.fromBytes(ie.subarray(0,m.BYTES)),Ie=m.fromBytes(ie.subarray(m.BYTES,2*m.BYTES));return{x:se,y:Ie}}else throw new Error(`Point of length ${E} was invalid. Expected ${Q} compressed bytes or ${ce} uncompressed bytes`)}}),G=_=>o.bytesToHex(o.numberToBytesBE(_,S.nByteLength));function Y(_){const E=j>>p;return _>E}function V(_){return Y(_)?te(-_):_}const ne=(_,E,J)=>o.bytesToNumberBE(_.slice(E,J));class W{constructor(E,J,ie){this.r=E,this.s=J,this.recovery=ie,this.assertValidity()}static fromCompact(E){const J=S.nByteLength;return E=(0,s.ensureBytes)("compactSignature",E,J*2),new W(ne(E,0,J),ne(E,J,2*J))}static fromDER(E){const{r:J,s:ie}=e.DER.toSig((0,s.ensureBytes)("DER",E));return new W(J,ie)}assertValidity(){if(!$(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!$(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new W(this.r,this.s,E)}recoverPublicKey(E){const{r:J,s:ie,recovery:se}=this,Ie=be((0,s.ensureBytes)("msgHash",E));if(se==null||![0,1,2,3].includes(se))throw new Error("recovery id invalid");const Be=se===2||se===3?J+S.n:J;if(Be>=m.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ce=se&1?"03":"02",Ue=me.fromHex(Ce+G(Be)),Re=Se(Be),He=te(-Ie*Re),bt=te(ie*Re),et=me.BASE.multiplyAndAddUnsafe(Ue,He,bt);if(!et)throw new Error("point at infinify");return et.assertValidity(),et}hasHighS(){return Y(this.s)}normalizeS(){return this.hasHighS()?new W(this.r,te(-this.s),this.recovery):this}toDERRawBytes(){return o.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return o.hexToBytes(this.toCompactHex())}toCompactHex(){return G(this.r)+G(this.s)}}const K={isValidPrivateKey(_){try{return F(_),!0}catch{return!1}},normPrivateKeyToScalar:F,randomPrivateKey:()=>{const _=r.getMinHashLength(S.n);return r.mapHashToField(S.randomBytes(_),S.n)},precompute(_=8,E=me.BASE){return E._setWindowSize(_),E.multiply(BigInt(3)),E}};function ae(_,E=!0){return me.fromPrivateKey(_).toRawBytes(E)}function de(_){const E=o.isBytes(_),J=typeof _=="string",ie=(E||J)&&_.length;return E?ie===Q||ie===ce:J?ie===2*Q||ie===2*ce:_ instanceof me}function re(_,E,J=!0){if(de(_))throw new Error("first arg must be private key");if(!de(E))throw new Error("second arg must be public key");return me.fromHex(E).multiply(F(_)).toRawBytes(J)}const _e=S.bits2int||function(_){const E=o.bytesToNumberBE(_),J=_.length*8-S.nBitLength;return J>0?E>>BigInt(J):E},be=S.bits2int_modN||function(_){return te(_e(_))},R=o.bitMask(S.nBitLength);function O(_){if(typeof _!="bigint")throw new Error("bigint expected");if(!(l<=_&&_<R))throw new Error(`bigint expected < 2^${S.nBitLength}`);return o.numberToBytesBE(_,S.nByteLength)}function q(_,E,J=oe){if(["recovered","canonical"].some(Ye=>Ye in J))throw new Error("sign() legacy options not supported");const{hash:ie,randomBytes:se}=S;let{lowS:Ie,prehash:Be,extraEntropy:Ce}=J;Ie==null&&(Ie=!0),_=(0,s.ensureBytes)("msgHash",_),Be&&(_=(0,s.ensureBytes)("prehashed msgHash",ie(_)));const Ue=be(_),Re=F(E),He=[O(Re),O(Ue)];if(Ce!=null&&Ce!==!1){const Ye=Ce===!0?se(m.BYTES):Ce;He.push((0,s.ensureBytes)("extraEntropy",Ye))}const bt=o.concatBytes(...He),et=Ue;function _t(Ye){const Ve=_e(Ye);if(!$(Ve))return;const Dt=Se(Ve),Lt=me.BASE.multiply(Ve).toAffine(),at=te(Lt.x);if(at===l)return;const Bt=te(Dt*te(et+at*Re));if(Bt===l)return;let fr=(Lt.x===at?0:2)|Number(Lt.y&p),er=Bt;return Ie&&Y(Bt)&&(er=V(Bt),fr^=1),new W(at,er,fr)}return{seed:bt,k2sig:_t}}const oe={lowS:S.lowS,prehash:!1},ye={lowS:S.lowS,prehash:!1};function d(_,E,J=oe){const{seed:ie,k2sig:se}=q(_,E,J),Ie=S;return o.createHmacDrbg(Ie.hash.outputLen,Ie.nByteLength,Ie.hmac)(ie,se)}me.BASE._setWindowSize(8);function g(_,E,J,ie=ye){var Lt;const se=_;if(E=(0,s.ensureBytes)("msgHash",E),J=(0,s.ensureBytes)("publicKey",J),"strict"in ie)throw new Error("options.strict was renamed to lowS");const{lowS:Ie,prehash:Be}=ie;let Ce,Ue;try{if(typeof se=="string"||o.isBytes(se))try{Ce=W.fromDER(se)}catch(at){if(!(at instanceof e.DER.Err))throw at;Ce=W.fromCompact(se)}else if(typeof se=="object"&&typeof se.r=="bigint"&&typeof se.s=="bigint"){const{r:at,s:Bt}=se;Ce=new W(at,Bt)}else throw new Error("PARSE");Ue=me.fromHex(J)}catch(at){if(at.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ie&&Ce.hasHighS())return!1;Be&&(E=S.hash(E));const{r:Re,s:He}=Ce,bt=be(E),et=Se(He),_t=te(bt*et),Ye=te(Re*et),Ve=(Lt=me.BASE.multiplyAndAddUnsafe(Ue,_t,Ye))==null?void 0:Lt.toAffine();return Ve?te(Ve.x)===Re:!1}return{CURVE:S,getPublicKey:ae,getSharedSecret:re,sign:d,verify:g,ProjectivePoint:me,Signature:W,utils:K}}function C(P,S){const m=P.ORDER;let j=l;for(let Y=m-p;Y%b===l;Y/=b)j+=p;const Q=j,ce=b<<Q-p-p,ue=ce*b,te=(m-p)/ue,Se=(te-p)/b,me=ue-p,F=ce,U=P.pow(S,te),$=P.pow(S,(te+p)/b);let G=(Y,V)=>{let ne=U,W=P.pow(V,me),K=P.sqr(W);K=P.mul(K,V);let ae=P.mul(Y,K);ae=P.pow(ae,Se),ae=P.mul(ae,W),W=P.mul(ae,V),K=P.mul(ae,Y);let de=P.mul(K,W);ae=P.pow(de,F);let re=P.eql(ae,P.ONE);W=P.mul(K,$),ae=P.mul(de,ne),K=P.cmov(W,K,re),de=P.cmov(ae,de,re);for(let _e=Q;_e>p;_e--){let be=_e-b;be=b<<be-p;let R=P.pow(de,be);const O=P.eql(R,P.ONE);W=P.mul(K,ne),ne=P.mul(ne,ne),R=P.mul(de,ne),K=P.cmov(W,K,O),de=P.cmov(R,de,O)}return{isValid:re,value:K}};if(P.ORDER%I===w){const Y=(P.ORDER-w)/I,V=P.sqrt(P.neg(S));G=(ne,W)=>{let K=P.sqr(W);const ae=P.mul(ne,W);K=P.mul(K,ae);let de=P.pow(K,Y);de=P.mul(de,ae);const re=P.mul(de,V),_e=P.mul(P.sqr(de),W),be=P.eql(_e,ne);let R=P.cmov(re,de,be);return{isValid:be,value:R}}}return G}function B(P,S){if(r.validateField(P),!P.isValid(S.A)||!P.isValid(S.B)||!P.isValid(S.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const m=C(P,S.Z);if(!P.isOdd)throw new Error("Fp.isOdd is not implemented!");return j=>{let Q,ce,ue,te,Se,me,F,U;Q=P.sqr(j),Q=P.mul(Q,S.Z),ce=P.sqr(Q),ce=P.add(ce,Q),ue=P.add(ce,P.ONE),ue=P.mul(ue,S.B),te=P.cmov(S.Z,P.neg(ce),!P.eql(ce,P.ZERO)),te=P.mul(te,S.A),ce=P.sqr(ue),me=P.sqr(te),Se=P.mul(me,S.A),ce=P.add(ce,Se),ce=P.mul(ce,ue),me=P.mul(me,te),Se=P.mul(me,S.B),ce=P.add(ce,Se),F=P.mul(Q,ue);const{isValid:$,value:G}=m(ce,me);U=P.mul(Q,j),U=P.mul(U,G),F=P.cmov(F,ue,$),U=P.cmov(U,G,$);const Y=P.isOdd(j)===P.isOdd(U);return U=P.cmov(P.neg(U),U,Y),F=P.div(F,te),{x:F,y:U}}}})(wd);Object.defineProperty(Vu,"__esModule",{value:!0});Vu.getHash=Yy;Vu.createCurve=aP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oP=Uy,lb=Zn,sP=wd;function Yy(e){return{hash:e,hmac:(t,...r)=>(0,oP.hmac)(e,t,(0,lb.concatBytes)(...r)),randomBytes:lb.randomBytes}}function aP(e,t){const r=o=>(0,sP.weierstrass)({...e,...Yy(o)});return Object.freeze({...r(t),create:r})}var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.expand_message_xmd=Xy;Zi.expand_message_xof=Zy;Zi.hash_to_field=Bc;Zi.isogenyMap=cP;Zi.createHasher=dP;const uP=pt,Zt=ot,fP=Zt.bytesToNumberBE;function yi(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let o=t-1;o>=0;o--)r[o]=e&255,e>>>=8;return new Uint8Array(r)}function lP(e,t){const r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e[o]^t[o];return r}function Rd(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Xy(e,t,r,o){(0,Zt.abytes)(e),(0,Zt.abytes)(t),Rd(r),t.length>255&&(t=o((0,Zt.concatBytes)((0,Zt.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:u}=o,f=Math.ceil(r/s);if(f>255)throw new Error("Invalid xmd length");const h=(0,Zt.concatBytes)(t,yi(t.length,1)),l=yi(0,u),p=yi(r,2),b=new Array(f),w=o((0,Zt.concatBytes)(l,e,p,yi(0,1),h));b[0]=o((0,Zt.concatBytes)(w,yi(1,1),h));for(let A=1;A<=f;A++){const x=[lP(w,b[A-1]),yi(A+1,1),h];b[A]=o((0,Zt.concatBytes)(...x))}return(0,Zt.concatBytes)(...b).slice(0,r)}function Zy(e,t,r,o,s){if((0,Zt.abytes)(e),(0,Zt.abytes)(t),Rd(r),t.length>255){const u=Math.ceil(2*o/8);t=s.create({dkLen:u}).update((0,Zt.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:r}).update(e).update(yi(r,2)).update(t).update(yi(t.length,1)).digest()}function Bc(e,t,r){(0,Zt.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:o,k:s,m:u,hash:f,expand:h,DST:l}=r;(0,Zt.abytes)(e),Rd(t);const p=typeof l=="string"?(0,Zt.utf8ToBytes)(l):l,b=o.toString(2).length,w=Math.ceil((b+s)/8),I=t*u*w;let A;if(h==="xmd")A=Xy(e,p,I,f);else if(h==="xof")A=Zy(e,p,I,s,f);else if(h==="_internal_pass")A=e;else throw new Error('expand must be "xmd" or "xof"');const x=new Array(t);for(let v=0;v<t;v++){const C=new Array(u);for(let B=0;B<u;B++){const P=w*(B+v*u),S=A.subarray(P,P+w);C[B]=(0,uP.mod)(fP(S),o)}x[v]=C}return x}function cP(e,t){const r=t.map(o=>Array.from(o).reverse());return(o,s)=>{const[u,f,h,l]=r.map(p=>p.reduce((b,w)=>e.add(e.mul(b,o),w)));return o=e.div(u,f),s=e.mul(s,e.div(h,l)),{x:o,y:s}}}function dP(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(o,s){const u=Bc(o,2,{...r,DST:r.DST,...s}),f=e.fromAffine(t(u[0])),h=e.fromAffine(t(u[1])),l=f.add(h).clearCofactor();return l.assertValidity(),l},encodeToCurve(o,s){const u=Bc(o,1,{...r,DST:r.encodeDST,...s}),f=e.fromAffine(t(u[0])).clearCofactor();return f.assertValidity(),f},mapToCurve(o){if(!Array.isArray(o))throw new Error("mapToCurve: expected array of bigints");for(const u of o)if(typeof u!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${u} in array`);const s=e.fromAffine(t(o)).clearCofactor();return s.assertValidity(),s}}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=$o,r=Zn,o=Vu,s=Zi,u=pt,f=ot,h=wd,l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),p=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),b=BigInt(1),w=BigInt(2),I=(W,K)=>(W+K/w)/K;function A(W){const K=l,ae=BigInt(3),de=BigInt(6),re=BigInt(11),_e=BigInt(22),be=BigInt(23),R=BigInt(44),O=BigInt(88),q=W*W*W%K,oe=q*q*W%K,ye=(0,u.pow2)(oe,ae,K)*oe%K,d=(0,u.pow2)(ye,ae,K)*oe%K,g=(0,u.pow2)(d,w,K)*q%K,_=(0,u.pow2)(g,re,K)*g%K,E=(0,u.pow2)(_,_e,K)*_%K,J=(0,u.pow2)(E,R,K)*E%K,ie=(0,u.pow2)(J,O,K)*J%K,se=(0,u.pow2)(ie,R,K)*E%K,Ie=(0,u.pow2)(se,ae,K)*oe%K,Be=(0,u.pow2)(Ie,be,K)*_%K,Ce=(0,u.pow2)(Be,de,K)*q%K,Ue=(0,u.pow2)(Ce,w,K);if(!x.eql(x.sqr(Ue),W))throw new Error("Cannot find square root");return Ue}const x=(0,u.Field)(l,void 0,void 0,{sqrt:A});e.secp256k1=(0,o.createCurve)({a:BigInt(0),b:BigInt(7),Fp:x,n:p,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:W=>{const K=p,ae=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),de=-b*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),re=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),_e=ae,be=BigInt("0x100000000000000000000000000000000"),R=I(_e*W,K),O=I(-de*W,K);let q=(0,u.mod)(W-R*ae-O*re,K),oe=(0,u.mod)(-R*de-O*_e,K);const ye=q>be,d=oe>be;if(ye&&(q=K-q),d&&(oe=K-oe),q>be||oe>be)throw new Error("splitScalar: Endomorphism failed, k="+W);return{k1neg:ye,k1:q,k2neg:d,k2:oe}}}},t.sha256);const v=BigInt(0),C=W=>typeof W=="bigint"&&v<W&&W<l,B=W=>typeof W=="bigint"&&v<W&&W<p,P={};function S(W,...K){let ae=P[W];if(ae===void 0){const de=(0,t.sha256)(Uint8Array.from(W,re=>re.charCodeAt(0)));ae=(0,f.concatBytes)(de,de),P[W]=ae}return(0,t.sha256)((0,f.concatBytes)(ae,...K))}const m=W=>W.toRawBytes(!0).slice(1),j=W=>(0,f.numberToBytesBE)(W,32),Q=W=>(0,u.mod)(W,l),ce=W=>(0,u.mod)(W,p),ue=e.secp256k1.ProjectivePoint,te=(W,K,ae)=>ue.BASE.multiplyAndAddUnsafe(W,K,ae);function Se(W){let K=e.secp256k1.utils.normPrivateKeyToScalar(W),ae=ue.fromPrivateKey(K);return{scalar:ae.hasEvenY()?K:ce(-K),bytes:m(ae)}}function me(W){if(!C(W))throw new Error("bad x: need 0 < x < p");const K=Q(W*W),ae=Q(K*W+BigInt(7));let de=A(ae);de%w!==v&&(de=Q(-de));const re=new ue(W,de,b);return re.assertValidity(),re}function F(...W){return ce((0,f.bytesToNumberBE)(S("BIP0340/challenge",...W)))}function U(W){return Se(W).bytes}function $(W,K,ae=(0,r.randomBytes)(32)){const de=(0,f.ensureBytes)("message",W),{bytes:re,scalar:_e}=Se(K),be=(0,f.ensureBytes)("auxRand",ae,32),R=j(_e^(0,f.bytesToNumberBE)(S("BIP0340/aux",be))),O=S("BIP0340/nonce",R,re,de),q=ce((0,f.bytesToNumberBE)(O));if(q===v)throw new Error("sign failed: k is zero");const{bytes:oe,scalar:ye}=Se(q),d=F(oe,re,de),g=new Uint8Array(64);if(g.set(oe,0),g.set(j(ce(ye+d*_e)),32),!G(g,de,re))throw new Error("sign: Invalid signature produced");return g}function G(W,K,ae){const de=(0,f.ensureBytes)("signature",W,64),re=(0,f.ensureBytes)("message",K),_e=(0,f.ensureBytes)("publicKey",ae,32);try{const be=me((0,f.bytesToNumberBE)(_e)),R=(0,f.bytesToNumberBE)(de.subarray(0,32));if(!C(R))return!1;const O=(0,f.bytesToNumberBE)(de.subarray(32,64));if(!B(O))return!1;const q=F(j(R),m(be),re),oe=te(be,O,ce(-q));return!(!oe||!oe.hasEvenY()||oe.toAffine().x!==R)}catch{return!1}}e.schnorr={getPublicKey:U,sign:$,verify:G,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:me,pointToBytes:m,numberToBytesBE:f.numberToBytesBE,bytesToNumberBE:f.bytesToNumberBE,taggedHash:S,mod:u.mod}};const Y=(0,s.isogenyMap)(x,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(W=>W.map(K=>BigInt(K)))),V=(0,h.mapToCurveSimpleSWU)(x,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:x.create(BigInt("-11"))}),ne=(0,s.createHasher)(e.secp256k1.ProjectivePoint,W=>{const{x:K,y:ae}=V(x.create(W[0]));return Y(K,ae)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:x.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=ne.hashToCurve,e.encodeToCurve=ne.encodeToCurve})(By);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=By;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(qu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=H.bufferPolyfill,r=qu;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16})(Wu);var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});Zu.GWEI_TO_WEI=void 0;Zu.GWEI_TO_WEI=BigInt(1e9);var Ad={},Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RLP=Rn.utils=Rn.decode=Rn.encode=void 0;function Td(e){if(Array.isArray(e)){const r=[];let o=0;for(let s=0;s<e.length;s++){const u=Td(e[s]);r.push(u),o+=u.length}return $c(db(o,192),...r)}const t=i0(e);return t.length===1&&t[0]<128?t:$c(db(t.length,128),t)}Rn.encode=Td;function mo(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function cb(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return t0(e0(e))}function db(e,t){if(e<56)return Uint8Array.from([e+t]);const r=Mc(e),o=r.length/2,s=Mc(t+55+o);return Uint8Array.from(yu(s+r))}function Qy(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const r=i0(e),o=Nc(r);if(t)return o;if(o.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return o.data}Rn.decode=Qy;function Nc(e){let t,r,o,s,u;const f=[],h=e[0];if(h<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(h<=183){if(t=h-127,h===128?o=Uint8Array.from([]):o=mo(e,1,t),t===2&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}else if(h<=191){if(r=h-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=cb(mo(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=mo(e,r,t+r),{data:o,remainder:e.slice(t+r)}}else if(h<=247){for(t=h-191,s=mo(e,1,t);s.length;)u=Nc(s),f.push(u.data),s=u.remainder;return{data:f,remainder:e.slice(t)}}else{if(r=h-246,t=cb(mo(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const l=r+t;if(l>e.length)throw new Error("invalid RLP: total length is larger than the data");for(s=mo(e,r,l);s.length;)u=Nc(s),f.push(u.data),s=u.remainder;return{data:f,remainder:e.slice(l)}}}const hP=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function e0(e){let t="";for(let r=0;r<e.length;r++)t+=hP[e[r]];return t}function t0(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function yu(e){if(typeof e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const o=r*2;t[r]=t0(e.slice(o,o+2))}return t}function $c(...e){if(e.length===1)return e[0];const t=e.reduce((o,s)=>o+s.length,0),r=new Uint8Array(t);for(let o=0,s=0;o<e.length;o++){const u=e[o];r.set(u,s),s+=u.length}return r}function r0(e){return new TextEncoder().encode(e)}function Mc(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function gP(e){return e.length%2?`0${e}`:e}function n0(e){return e.length>=2&&e[0]==="0"&&e[1]==="x"}function pP(e){return typeof e!="string"?e:n0(e)?e.slice(2):e}function i0(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return n0(e)?yu(gP(pP(e))):r0(e);if(typeof e=="number"||typeof e=="bigint")return e?yu(Mc(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}Rn.utils={bytesToHex:e0,concatBytes:$c,hexToBytes:yu,utf8ToBytes:r0};Rn.RLP={encode:Td,decode:Qy};var rn={},dt={},je={};Object.defineProperty(je,"__esModule",{value:!0});je.add5L=je.add5H=je.add4H=je.add4L=je.add3H=je.add3L=je.add=je.rotlBL=je.rotlBH=je.rotlSL=je.rotlSH=je.rotr32L=je.rotr32H=je.rotrBL=je.rotrBH=je.rotrSL=je.rotrSH=je.shrSL=je.shrSH=je.toBig=je.split=je.fromBig=void 0;const tu=BigInt(2**32-1),xc=BigInt(32);function Id(e,t=!1){return t?{h:Number(e&tu),l:Number(e>>xc&tu)}:{h:Number(e>>xc&tu)|0,l:Number(e&tu)|0}}je.fromBig=Id;function o0(e,t=!1){let r=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:u,l:f}=Id(e[s],t);[r[s],o[s]]=[u,f]}return[r,o]}je.split=o0;const s0=(e,t)=>BigInt(e>>>0)<<xc|BigInt(t>>>0);je.toBig=s0;const a0=(e,t,r)=>e>>>r;je.shrSH=a0;const u0=(e,t,r)=>e<<32-r|t>>>r;je.shrSL=u0;const f0=(e,t,r)=>e>>>r|t<<32-r;je.rotrSH=f0;const l0=(e,t,r)=>e<<32-r|t>>>r;je.rotrSL=l0;const c0=(e,t,r)=>e<<64-r|t>>>r-32;je.rotrBH=c0;const d0=(e,t,r)=>e>>>r-32|t<<64-r;je.rotrBL=d0;const h0=(e,t)=>t;je.rotr32H=h0;const g0=(e,t)=>e;je.rotr32L=g0;const p0=(e,t,r)=>e<<r|t>>>32-r;je.rotlSH=p0;const b0=(e,t,r)=>t<<r|e>>>32-r;je.rotlSL=b0;const _0=(e,t,r)=>t<<r-32|e>>>64-r;je.rotlBH=_0;const y0=(e,t,r)=>e<<r-32|t>>>64-r;je.rotlBL=y0;function w0(e,t,r,o){const s=(t>>>0)+(o>>>0);return{h:e+r+(s/2**32|0)|0,l:s|0}}je.add=w0;const m0=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);je.add3L=m0;const E0=(e,t,r,o)=>t+r+o+(e/2**32|0)|0;je.add3H=E0;const v0=(e,t,r,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0);je.add4L=v0;const S0=(e,t,r,o,s)=>t+r+o+s+(e/2**32|0)|0;je.add4H=S0;const R0=(e,t,r,o,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0)+(s>>>0);je.add5L=R0;const A0=(e,t,r,o,s,u)=>t+r+o+s+u+(e/2**32|0)|0;je.add5H=A0;const bP={fromBig:Id,split:o0,toBig:s0,shrSH:a0,shrSL:u0,rotrSH:f0,rotrSL:l0,rotrBH:c0,rotrBL:d0,rotr32H:h0,rotr32L:g0,rotlSH:p0,rotlSL:b0,rotlBH:_0,rotlBL:y0,add:w0,add3L:m0,add3H:E0,add4L:v0,add4H:S0,add5H:A0,add5L:R0};je.default=bP;Object.defineProperty(dt,"__esModule",{value:!0});dt.shake256=dt.shake128=dt.keccak_512=dt.keccak_384=dt.keccak_256=dt.keccak_224=dt.sha3_512=dt.sha3_384=dt.sha3_256=dt.sha3_224=dt.Keccak=dt.keccakP=void 0;const Eo=Ot,Ls=je,Vn=Zn,T0=[],I0=[],O0=[],_P=BigInt(0),bs=BigInt(1),yP=BigInt(2),wP=BigInt(7),mP=BigInt(256),EP=BigInt(113);for(let e=0,t=bs,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],T0.push(2*(5*o+r)),I0.push((e+1)*(e+2)/2%64);let s=_P;for(let u=0;u<7;u++)t=(t<<bs^(t>>wP)*EP)%mP,t&yP&&(s^=bs<<(bs<<BigInt(u))-bs);O0.push(s)}const[vP,SP]=(0,Ls.split)(O0,!0),hb=(e,t,r)=>r>32?(0,Ls.rotlBH)(e,t,r):(0,Ls.rotlSH)(e,t,r),gb=(e,t,r)=>r>32?(0,Ls.rotlBL)(e,t,r):(0,Ls.rotlSL)(e,t,r);function C0(e,t=24){const r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let f=0;f<10;f++)r[f]=e[f]^e[f+10]^e[f+20]^e[f+30]^e[f+40];for(let f=0;f<10;f+=2){const h=(f+8)%10,l=(f+2)%10,p=r[l],b=r[l+1],w=hb(p,b,1)^r[h],I=gb(p,b,1)^r[h+1];for(let A=0;A<50;A+=10)e[f+A]^=w,e[f+A+1]^=I}let s=e[2],u=e[3];for(let f=0;f<24;f++){const h=I0[f],l=hb(s,u,h),p=gb(s,u,h),b=T0[f];s=e[b],u=e[b+1],e[b]=l,e[b+1]=p}for(let f=0;f<50;f+=10){for(let h=0;h<10;h++)r[h]=e[f+h];for(let h=0;h<10;h++)e[f+h]^=~r[(h+2)%10]&r[(h+4)%10]}e[0]^=vP[o],e[1]^=SP[o]}r.fill(0)}dt.keccakP=C0;class Hs extends Vn.Hash{constructor(t,r,o,s=!1,u=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=o,this.enableXOF=s,this.rounds=u,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Eo.number)(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Vn.u32)(this.state)}keccak(){Vn.isLE||(0,Vn.byteSwap32)(this.state32),C0(this.state32,this.rounds),Vn.isLE||(0,Vn.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Eo.exists)(this);const{blockLen:r,state:o}=this;t=(0,Vn.toBytes)(t);const s=t.length;for(let u=0;u<s;){const f=Math.min(r-this.pos,s-u);for(let h=0;h<f;h++)o[this.pos++]^=t[u++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:o,blockLen:s}=this;t[o]^=r,r&128&&o===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){(0,Eo.exists)(this,!1),(0,Eo.bytes)(t),this.finish();const r=this.state,{blockLen:o}=this;for(let s=0,u=t.length;s<u;){this.posOut>=o&&this.keccak();const f=Math.min(o-this.posOut,u-s);t.set(r.subarray(this.posOut,this.posOut+f),s),this.posOut+=f,s+=f}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Eo.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Eo.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:o,outputLen:s,rounds:u,enableXOF:f}=this;return t||(t=new Hs(r,o,s,f,u)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=u,t.suffix=o,t.outputLen=s,t.enableXOF=f,t.destroyed=this.destroyed,t}}dt.Keccak=Hs;const Ai=(e,t,r)=>(0,Vn.wrapConstructor)(()=>new Hs(t,e,r));dt.sha3_224=Ai(6,144,224/8);dt.sha3_256=Ai(6,136,256/8);dt.sha3_384=Ai(6,104,384/8);dt.sha3_512=Ai(6,72,512/8);dt.keccak_224=Ai(1,144,224/8);dt.keccak_256=Ai(1,136,256/8);dt.keccak_384=Ai(1,104,384/8);dt.keccak_512=Ai(1,72,512/8);const L0=(e,t,r)=>(0,Vn.wrapXOFConstructorWithOpts)((o={})=>new Hs(t,e,o.dkLen===void 0?r:o.dkLen,!0));dt.shake128=L0(31,168,128/8);dt.shake256=L0(31,136,256/8);var wu={exports:{}};wu.exports;(function(e,t){var r=H.commonjsGlobal&&H.commonjsGlobal.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0,t.bytesToUtf8=l,t.hexToBytes=p,t.equalsBytes=b,t.wrapHash=w;const o=r(Ot),s=Zn,u=o.default.bool;t.assertBool=u;const f=o.default.bytes;t.assertBytes=f;var h=Zn;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return h.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return h.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return h.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return h.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return h.utf8ToBytes}});function l(I){if(!(I instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof I}`);return new TextDecoder().decode(I)}function p(I){const A=I.startsWith("0x")?I.substring(2):I;return(0,s.hexToBytes)(A)}function b(I,A){if(I.length!==A.length)return!1;for(let x=0;x<I.length;x++)if(I[x]!==A[x])return!1;return!0}function w(I){return A=>(o.default.bytes(A),I(A))}t.crypto=(()=>{const I=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,A=typeof H.commonjsRequire=="function"&&H.commonjsRequire.bind(e);return{node:A&&!I?A("crypto"):void 0,web:I}})()})(wu,wu.exports);var P0=wu.exports;Object.defineProperty(rn,"__esModule",{value:!0});rn.keccak512=rn.keccak384=rn.keccak256=rn.keccak224=void 0;const Ps=dt,Qu=P0;rn.keccak224=(0,Qu.wrapHash)(Ps.keccak_224);rn.keccak256=(()=>{const e=(0,Qu.wrapHash)(Ps.keccak_256);return e.create=Ps.keccak_256.create,e})();rn.keccak384=(0,Qu.wrapHash)(Ps.keccak_384);rn.keccak512=(0,Qu.wrapHash)(Ps.keccak_512);var Qi={},Fr={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.isHexString=ht.getKeys=ht.fromAscii=ht.fromUtf8=ht.toAscii=ht.arrayContainsArray=ht.getBinarySize=ht.padToEven=ht.stripHexPrefix=ht.isHexPrefixed=void 0;function B0(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}ht.isHexPrefixed=B0;const RP=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return B0(e)?e.slice(2):e};ht.stripHexPrefix=RP;function N0(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}ht.padToEven=N0;function AP(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return H.dist.Buffer.byteLength(e,"utf8")}ht.getBinarySize=AP;function TP(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](o=>e.indexOf(o)>=0)}ht.arrayContainsArray=TP;function IP(e){let t="",r=0;const o=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<o;r+=2){const s=parseInt(e.substr(r,2),16);t+=String.fromCharCode(s)}return t}ht.toAscii=IP;function OP(e){const t=H.dist.Buffer.from(e,"utf8");return`0x${N0(t.toString("hex")).replace(/^0+|0+$/g,"")}`}ht.fromUtf8=OP;function CP(e){let t="";for(let r=0;r<e.length;r++){const s=e.charCodeAt(r).toString(16);t+=s.length<2?`0${s}`:s}return`0x${t}`}ht.fromAscii=CP;function LP(e,t,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const o=[];for(let s=0;s<e.length;s++){let u=e[s][t];if(r===!0&&!u)u="";else if(typeof u!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof u}`);o.push(u)}return o}ht.getKeys=LP;function PP(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}ht.isHexString=PP;Object.defineProperty(Fr,"__esModule",{value:!0});Fr.assertIsString=Fr.assertIsArray=Fr.assertIsBuffer=Fr.assertIsHexString=void 0;const BP=ht,NP=function(e){if(!(0,BP.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};Fr.assertIsHexString=NP;const $P=function(e){if(!H.dist.Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Fr.assertIsBuffer=$P;const MP=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};Fr.assertIsArray=MP;const xP=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};Fr.assertIsString=xP;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=Fr,r=ht,o=function($){if(!Number.isSafeInteger($)||$<0)throw new Error(`Received an invalid integer type: ${$}`);return`0x${$.toString(16)}`};e.intToHex=o;const s=function($){const G=(0,e.intToHex)($);return H.dist.Buffer.from((0,r.padToEven)(G.slice(2)),"hex")};e.intToBuffer=s;const u=function($){return H.dist.Buffer.allocUnsafe($).fill(0)};e.zeros=u;const f=function($,G,Y){const V=(0,e.zeros)(G);return Y?$.length<G?($.copy(V),V):$.slice(0,G):$.length<G?($.copy(V,G-$.length),V):$.slice(-G)},h=function($,G){return(0,t.assertIsBuffer)($),f($,G,!1)};e.setLengthLeft=h;const l=function($,G){return(0,t.assertIsBuffer)($),f($,G,!0)};e.setLengthRight=l;const p=function($){let G=$[0];for(;$.length>0&&G.toString()==="0";)$=$.slice(1),G=$[0];return $},b=function($){return(0,t.assertIsBuffer)($),p($)};e.unpadBuffer=b;const w=function($){return(0,t.assertIsArray)($),p($)};e.unpadArray=w;const I=function($){return(0,t.assertIsHexString)($),$=(0,r.stripHexPrefix)($),"0x"+p($)};e.unpadHexString=I;const A=function($){if($==null)return H.dist.Buffer.allocUnsafe(0);if(H.dist.Buffer.isBuffer($)||Array.isArray($)||$ instanceof Uint8Array)return H.dist.Buffer.from($);if(typeof $=="string"){if(!(0,r.isHexString)($))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${$}`);return H.dist.Buffer.from((0,r.padToEven)((0,r.stripHexPrefix)($)),"hex")}if(typeof $=="number")return(0,e.intToBuffer)($);if(typeof $=="bigint"){if($<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${$}`);let G=$.toString(16);return G.length%2&&(G="0"+G),H.dist.Buffer.from(G,"hex")}if($.toArray)return H.dist.Buffer.from($.toArray());if($.toBuffer)return H.dist.Buffer.from($.toBuffer());throw new Error("invalid type")};e.toBuffer=A;const x=function($){return $=(0,e.toBuffer)($),"0x"+$.toString("hex")};e.bufferToHex=x;function v($){const G=(0,e.bufferToHex)($);return BigInt(G==="0x"?0:G)}e.bufferToBigInt=v;function C($){return(0,e.toBuffer)("0x"+$.toString(16))}e.bigIntToBuffer=C;const B=function($){const G=Number(v($));if(!Number.isSafeInteger(G))throw new Error("Number exceeds 53 bits");return G};e.bufferToInt=B;const P=function($){return BigInt.asIntN(256,v($))};e.fromSigned=P;const S=function($){return C(BigInt.asUintN(256,$))};e.toUnsigned=S;const m=function($){return typeof $!="string"||(0,r.isHexPrefixed)($)?$:"0x"+$};e.addHexPrefix=m;function j($,G=50){const Y=H.dist.Buffer.isBuffer($)?$.toString("hex"):$;return Y.length<=G?Y:Y.slice(0,G)+"…"}e.short=j;const Q=function($){const G=/^(00)+|(00)+$/g;if($=(0,r.stripHexPrefix)($),$.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return H.dist.Buffer.from($.replace(G,""),"hex").toString("utf8")};e.toUtf8=Q;const ce=function($){if(H.dist.Buffer.isBuffer($))return`0x${$.toString("hex")}`;if($ instanceof Array){const G=[];for(let Y=0;Y<$.length;Y++)G.push((0,e.baToJSON)($[Y]));return G}};e.baToJSON=ce;const ue=function($){for(const[G,Y]of Object.entries($))if(Y!==void 0&&Y.length>0&&Y[0]===0)throw new Error(`${G} cannot have leading zeroes, received: ${Y.toString("hex")}`)};e.validateNoLeadingZeroes=ue;function te($){return Array.isArray($)?$.map(G=>te(G)):H.dist.Buffer.from($)}e.arrToBufArr=te;function Se($){return Array.isArray($)?$.map(G=>Se(G)):Uint8Array.from($??[])}e.bufArrToArr=Se;const me=$=>"0x"+$.toString(16);e.bigIntToHex=me;function F($){return(0,e.unpadBuffer)(C($))}e.bigIntToUnpaddedBuffer=F;function U($){return(0,e.unpadBuffer)((0,e.intToBuffer)($))}e.intToUnpaddedBuffer=U})(Qi);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=Rn,r=rn,o=qu,s=P0,u=Qi,f=Wu,h=Fr,l=ht,p=BigInt(0);class b{constructor(U=p,$=p,G=f.KECCAK256_RLP,Y=f.KECCAK256_NULL){this.nonce=U,this.balance=$,this.storageRoot=G,this.codeHash=Y,this._validate()}static fromAccountData(U){const{nonce:$,balance:G,storageRoot:Y,codeHash:V}=U;return new b($!==void 0?(0,u.bufferToBigInt)((0,u.toBuffer)($)):void 0,G!==void 0?(0,u.bufferToBigInt)((0,u.toBuffer)(G)):void 0,Y!==void 0?(0,u.toBuffer)(Y):void 0,V!==void 0?(0,u.toBuffer)(V):void 0)}static fromRlpSerializedAccount(U){const $=(0,u.arrToBufArr)(t.RLP.decode(Uint8Array.from(U)));if(!Array.isArray($))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray($)}static fromValuesArray(U){const[$,G,Y,V]=U;return new b((0,u.bufferToBigInt)($),(0,u.bufferToBigInt)(G),Y,V)}_validate(){if(this.nonce<p)throw new Error("nonce must be greater than zero");if(this.balance<p)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[(0,u.bigIntToUnpaddedBuffer)(this.nonce),(0,u.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return H.dist.Buffer.from(t.RLP.encode((0,u.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(f.KECCAK256_NULL)}isEmpty(){return this.balance===p&&this.nonce===p&&this.codeHash.equals(f.KECCAK256_NULL)}}e.Account=b;const w=function(F){try{(0,h.assertIsString)(F)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(F)};e.isValidAddress=w;const I=function(F,U){(0,h.assertIsHexString)(F);const $=(0,l.stripHexPrefix)(F).toLowerCase();let G="";U!==void 0&&(G=(0,u.bufferToBigInt)((0,u.toBuffer)(U)).toString()+"0x");const Y=H.dist.Buffer.from(G+$,"utf8"),V=(0,s.bytesToHex)((0,r.keccak256)(Y));let ne="0x";for(let W=0;W<$.length;W++)parseInt(V[W],16)>=8?ne+=$[W].toUpperCase():ne+=$[W];return ne};e.toChecksumAddress=I;const A=function(F,U){return(0,e.isValidAddress)(F)&&(0,e.toChecksumAddress)(F,U)===F};e.isValidChecksumAddress=A;const x=function(F,U){return(0,h.assertIsBuffer)(F),(0,h.assertIsBuffer)(U),(0,u.bufferToBigInt)(U)===BigInt(0)?H.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,u.bufArrToArr)([F,null])))).slice(-20):H.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,u.bufArrToArr)([F,U])))).slice(-20)};e.generateAddress=x;const v=function(F,U,$){if((0,h.assertIsBuffer)(F),(0,h.assertIsBuffer)(U),(0,h.assertIsBuffer)($),F.length!==20)throw new Error("Expected from to be of length 20");if(U.length!==32)throw new Error("Expected salt to be of length 32");const G=(0,r.keccak256)(H.dist.Buffer.concat([H.dist.Buffer.from("ff","hex"),F,U,(0,r.keccak256)($)]));return(0,u.toBuffer)(G).slice(-20)};e.generateAddress2=v;const C=function(F){return o.secp256k1.utils.isValidPrivateKey(F)};e.isValidPrivate=C;const B=function(F,U=!1){if((0,h.assertIsBuffer)(F),F.length===64)try{return o.secp256k1.ProjectivePoint.fromHex(H.dist.Buffer.concat([H.dist.Buffer.from([4]),F])),!0}catch{return!1}if(!U)return!1;try{return o.secp256k1.ProjectivePoint.fromHex(F),!0}catch{return!1}};e.isValidPublic=B;const P=function(F,U=!1){if((0,h.assertIsBuffer)(F),U&&F.length!==64&&(F=H.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromHex(F).toRawBytes(!1).slice(1))),F.length!==64)throw new Error("Expected pubKey to be of length 64");return H.dist.Buffer.from((0,r.keccak256)(F)).slice(-20)};e.pubToAddress=P,e.publicToAddress=e.pubToAddress;const S=function(F){return(0,h.assertIsBuffer)(F),H.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromPrivateKey(F).toRawBytes(!1).slice(1))};e.privateToPublic=S;const m=function(F){return(0,e.publicToAddress)((0,e.privateToPublic)(F))};e.privateToAddress=m;const j=function(F){return(0,h.assertIsBuffer)(F),F.length!==64&&(F=H.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromHex(F).toRawBytes(!1).slice(1))),F};e.importPublic=j;const Q=function(){const U=(0,u.zeros)(20);return(0,u.bufferToHex)(U)};e.zeroAddress=Q;const ce=function(F){try{(0,h.assertIsString)(F)}catch{return!1}return(0,e.zeroAddress)()===F};e.isZeroAddress=ce;function ue(F){const[U,$,G,Y]=F;return[U,$,(0,u.arrToBufArr)(G).length===0?f.KECCAK256_RLP:G,(0,u.arrToBufArr)(Y).length===0?f.KECCAK256_NULL:Y]}e.accountBodyFromSlim=ue;const te=new Uint8Array(0);function Se(F){const[U,$,G,Y]=F;return[U,$,(0,u.arrToBufArr)(G).equals(f.KECCAK256_RLP)?te:G,(0,u.arrToBufArr)(Y).equals(f.KECCAK256_NULL)?te:Y]}e.accountBodyToSlim=Se;function me(F,U=!0){const $=U?ue(F):F;return(0,u.arrToBufArr)(t.RLP.encode($))}e.accountBodyToRLP=me})(Ad);var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Address=void 0;const _s=Ad,ru=Qi;class zn{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new zn((0,ru.zeros)(20))}static fromString(t){if(!(0,_s.isValidAddress)(t))throw new Error("Invalid address");return new zn((0,ru.toBuffer)(t))}static fromPublicKey(t){if(!H.dist.Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const r=(0,_s.pubToAddress)(t);return new zn(r)}static fromPrivateKey(t){if(!H.dist.Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const r=(0,_s.privateToAddress)(t);return new zn(r)}static generate(t,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new zn((0,_s.generateAddress)(t.buf,(0,ru.bigIntToBuffer)(r)))}static generate2(t,r,o){if(!H.dist.Buffer.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!H.dist.Buffer.isBuffer(o))throw new Error("Expected initCode to be a Buffer");return new zn((0,_s.generateAddress2)(t.buf,r,o))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(zn.zero())}isPrecompileOrSystemAddress(){const t=(0,ru.bufferToBigInt)(this.buf),r=BigInt(0),o=BigInt("0xffff");return t>=r&&t<=o}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return H.dist.Buffer.from(this.buf)}}Ws.Address=zn;var ef={},Od={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=Qi,r=ht;var o;(function(u){u[u.Number=0]="Number",u[u.BigInt=1]="BigInt",u[u.Buffer=2]="Buffer",u[u.PrefixedHexString=3]="PrefixedHexString"})(o=e.TypeOutput||(e.TypeOutput={}));function s(u,f){if(u===null)return null;if(u===void 0)return;if(typeof u=="string"&&!(0,r.isHexString)(u))throw new Error(`A string must be provided with a 0x-prefix, given: ${u}`);if(typeof u=="number"&&!Number.isSafeInteger(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const h=(0,t.toBuffer)(u);switch(f){case o.Buffer:return h;case o.BigInt:return(0,t.bufferToBigInt)(h);case o.Number:{const l=(0,t.bufferToBigInt)(h);if(l>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(l)}case o.PrefixedHexString:return(0,t.bufferToHex)(h);default:throw new Error("unknown outputType")}}e.toType=s})(Od);Object.defineProperty(ef,"__esModule",{value:!0});ef.Withdrawal=void 0;const pb=Ws,rc=Qi,At=Od;class vs{constructor(t,r,o,s){this.index=t,this.validatorIndex=r,this.address=o,this.amount=s}static fromWithdrawalData(t){const{index:r,validatorIndex:o,address:s,amount:u}=t,f=(0,At.toType)(r,At.TypeOutput.BigInt),h=(0,At.toType)(o,At.TypeOutput.BigInt),l=new pb.Address((0,At.toType)(s,At.TypeOutput.Buffer)),p=(0,At.toType)(u,At.TypeOutput.BigInt);return new vs(f,h,l,p)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[r,o,s,u]=t;return vs.fromWithdrawalData({index:r,validatorIndex:o,address:s,amount:u})}static toBufferArray(t){const{index:r,validatorIndex:o,address:s,amount:u}=t,f=(0,At.toType)(r,At.TypeOutput.BigInt)===BigInt(0)?H.dist.Buffer.alloc(0):(0,At.toType)(r,At.TypeOutput.Buffer),h=(0,At.toType)(o,At.TypeOutput.BigInt)===BigInt(0)?H.dist.Buffer.alloc(0):(0,At.toType)(o,At.TypeOutput.Buffer);let l;s instanceof pb.Address?l=s.buf:l=(0,At.toType)(s,At.TypeOutput.Buffer);const p=(0,At.toType)(u,At.TypeOutput.BigInt)===BigInt(0)?H.dist.Buffer.alloc(0):(0,At.toType)(u,At.TypeOutput.Buffer);return[f,h,l,p]}raw(){return vs.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,rc.bigIntToHex)(this.index),validatorIndex:(0,rc.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,rc.bigIntToHex)(this.amount)}}}ef.Withdrawal=vs;var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.hashPersonalMessage=Qt.isValidSignature=Qt.fromRpcSig=Qt.toCompactSig=Qt.toRpcSig=Qt.ecrecover=Qt.ecsign=void 0;const DP=rn,$0=qu,pr=Qi,nc=Wu,jP=Fr;function UP(e,t,r){const o=$0.secp256k1.sign(e,t),s=o.toCompactRawBytes(),u=H.dist.Buffer.from(s.slice(0,32)),f=H.dist.Buffer.from(s.slice(32,64)),h=r===void 0?BigInt(o.recovery+27):BigInt(o.recovery+35)+BigInt(r)*BigInt(2);return{r:u,s:f,v:h}}Qt.ecsign=UP;function tf(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function rf(e){return e===BigInt(0)||e===BigInt(1)}const kP=function(e,t,r,o,s){const u=H.dist.Buffer.concat([(0,pr.setLengthLeft)(r,32),(0,pr.setLengthLeft)(o,32)],64),f=tf(t,s);if(!rf(f))throw new Error("Invalid signature v value");const l=$0.secp256k1.Signature.fromCompact(u).addRecoveryBit(Number(f)).recoverPublicKey(e);return H.dist.Buffer.from(l.toRawBytes(!1).slice(1))};Qt.ecrecover=kP;const FP=function(e,t,r,o){const s=tf(e,o);if(!rf(s))throw new Error("Invalid signature v value");return(0,pr.bufferToHex)(H.dist.Buffer.concat([(0,pr.setLengthLeft)(t,32),(0,pr.setLengthLeft)(r,32),(0,pr.toBuffer)(e)]))};Qt.toRpcSig=FP;const HP=function(e,t,r,o){const s=tf(e,o);if(!rf(s))throw new Error("Invalid signature v value");let u=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(u=H.dist.Buffer.from(r),u[0]|=128),(0,pr.bufferToHex)(H.dist.Buffer.concat([(0,pr.setLengthLeft)(t,32),(0,pr.setLengthLeft)(u,32)]))};Qt.toCompactSig=HP;const WP=function(e){const t=(0,pr.toBuffer)(e);let r,o,s;if(t.length>=65)r=t.slice(0,32),o=t.slice(32,64),s=(0,pr.bufferToBigInt)(t.slice(64));else if(t.length===64)r=t.slice(0,32),o=t.slice(32,64),s=BigInt((0,pr.bufferToInt)(t.slice(32,33))>>7),o[0]&=127;else throw new Error("Invalid signature length");return s<27&&(s=s+BigInt(27)),{v:s,r,s:o}};Qt.fromRpcSig=WP;const qP=function(e,t,r,o=!0,s){if(t.length!==32||r.length!==32||!rf(tf(e,s)))return!1;const u=(0,pr.bufferToBigInt)(t),f=(0,pr.bufferToBigInt)(r);return!(u===BigInt(0)||u>=nc.SECP256K1_ORDER||f===BigInt(0)||f>=nc.SECP256K1_ORDER||o&&f>=nc.SECP256K1_ORDER_DIV_2)};Qt.isValidSignature=qP;const GP=function(e){(0,jP.assertIsBuffer)(e);const t=H.dist.Buffer.from(`Ethereum Signed Message:
3
+ ${e.length}`,"utf-8");return H.dist.Buffer.from((0,DP.keccak256)(H.dist.Buffer.concat([t,e])))};Qt.hashPersonalMessage=GP;var M0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=f=>f.length>0&&f[f.length-1]===16;e.hasTerminator=t;const r=(f,h)=>{for(let l=0,p=0;p<f.length;l+=1,p+=2)h[l]=f[p]<<4|f[p+1]};e.nibblesToBytes=r;const o=f=>{let h=0;(0,e.hasTerminator)(f)&&(h=1,f=f.subarray(0,f.length-1));const l=new Uint8Array(f.length/2+1);return l[0]=h<<5,(f.length&1)===1&&(l[0]|=16,l[0]|=f[0],f=f.subarray(1)),(0,e.nibblesToBytes)(f,l.subarray(1)),l};e.nibblesToCompactBytes=o;const s=f=>{const h=f.length*2+1,l=new Uint8Array(h);for(let p=0;p<f.length;p++){const b=f[p];l[p*2]=b/16,l[p*2+1]=b%16}return l[h-1]=16,l};e.bytesToNibbles=s;const u=f=>{if(f.length===0)return f;let h=(0,e.bytesToNibbles)(f);h[0]<2&&(h=h.subarray(0,h.length-1));const l=2-(h[0]&1);return h.subarray(l)};e.compactBytesToNibbles=u})(M0);var nf={};Object.defineProperty(nf,"__esModule",{value:!0});nf.AsyncEventEmitter=void 0;const VP=H.requireEvents();async function zP(e,t,r){let o;for await(const s of t)try{s.length<2?s.call(e,r):await new Promise((u,f)=>{s.call(e,r,h=>{h?f(h):u()})})}catch(u){o=u}if(o)throw o}class KP extends VP.EventEmitter{emit(t,...r){let[o,s]=r;const u=this;let f=u._events[t]??[];return s===void 0&&typeof o=="function"&&(s=o,o=void 0),(t==="newListener"||t==="removeListener")&&(o={event:o,fn:s},s=void 0),f=Array.isArray(f)?f:[f],zP(u,f.slice(),o).then(s).catch(s),u.listenerCount(t)>0}once(t,r){const o=this;let s;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?s=function(u,f){o.removeListener(t,s),r(u,f)}:s=function(u){o.removeListener(t,s),r(u,s)},o.on(t,s),o}first(t,r){let o=this._events[t]??[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(o)||(this._events[t]=o=[o]),o.unshift(r),this}before(t,r,o){return this.beforeOrAfter(t,r,o)}after(t,r,o){return this.beforeOrAfter(t,r,o,"after")}beforeOrAfter(t,r,o,s){let u=this._events[t]??[],f,h;const l=s==="after"?1:0;if(typeof o!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(u)||(this._events[t]=u=[u]),h=u.length,f=u.length;f--;)if(u[f]===r){h=f+l;break}return u.splice(h,0,o),this}on(t,r){return super.on(t,r)}addListener(t,r){return super.addListener(t,r)}prependListener(t,r){return super.prependListener(t,r)}prependOnceListener(t,r){return super.prependOnceListener(t,r)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,r){return super.removeListener(t,r)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}nf.AsyncEventEmitter=KP;var of={};Object.defineProperty(of,"__esModule",{value:!0});of.Lock=void 0;class JP{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(t=>this.promiseResolverQueue.push(t))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}of.Lock=JP;var Mo={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.InvalidStatusCodeError=Gi.InvalidCertError=void 0;const x0=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class Dc extends Error{constructor(t,r){super(t),this.fingerprint256=r}}Gi.InvalidCertError=Dc;class Cd extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}Gi.InvalidStatusCodeError=Cd;function D0(e,t){if(!t||t==="text"||t==="json")try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return r;try{return JSON.parse(r)}catch(o){if(t==="json")throw o;return r}}catch(r){if(t==="text"||t==="json")throw r}return e}let bb={};function jc(e,t){var I;let r={...x0,...t};const o=H.streamHttp,s=H.httpsBrowserifyExports,u=H.lib,{promisify:f}=H.util,{resolve:h}=H.urlExports,l=!!/^https/.test(e);let p={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const b=A=>A.replace(/:| /g,"").toLowerCase();if(r.keepAlive){const A={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},x=[l,l&&((I=r.sslPinnedCertificates)==null?void 0:I.map(v=>b(v)).sort())].join();p.agent=bb[x]||(bb[x]=new(l?s:o).Agent(A))}r.type==="json"&&(p.headers["Content-Type"]="application/json"),r.data&&(r.method||(p.method="POST"),p.body=r.type==="json"?JSON.stringify(r.data):r.data),p.headers={...p.headers,...r.headers},r.sslAllowSelfSigned&&(p.rejectUnauthorized=!1);const w=async A=>{const x=A.statusCode;if(r.redirect&&300<=x&&x<400&&A.headers.location){if(r._redirectCount==10)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await jc(h(e,A.headers.location),r)}if(r.expectStatusCode&&x!==r.expectStatusCode)throw A.resume(),new Cd(x);let v=[];for await(const S of A)v.push(S);let C=H.dist.Buffer.concat(v);const B=A.headers["content-encoding"];B==="br"&&(C=await f(u.brotliDecompress)(C)),(B==="gzip"||B==="deflate")&&(C=await f(u.unzip)(C));const P=D0(C,r.type);return r.full?{headers:A.headers,status:x,body:P}:P};return new Promise((A,x)=>{var S;const v=async m=>{if(m&&m.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await jc(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(j){j&&j.fingerprint256&&(m=new Dc(`Self-signed SSL certificate: ${j.fingerprint256}`,j.fingerprint256))}x(m)},C=(l?s:o).request(e,p,m=>{m.on("error",v),(async()=>{try{A(await w(m))}catch(j){x(j)}})()});C.on("error",v);const B=(S=r.sslPinnedCertificates)==null?void 0:S.map(m=>b(m)),P=m=>{var Q;const j=b(((Q=m.getPeerCertificate())==null?void 0:Q.fingerprint256)||"");if(!(!j&&m.isSessionReused())&&!B.includes(j))return C.emit("error",new Dc(`Invalid SSL certificate: ${j} Expected: ${B}`,j)),C.abort()};r.sslPinnedCertificates&&C.on("socket",m=>{m.listeners("secureConnect").map(Q=>(Q.name||"").replace("bound ","")).includes("mfetchSecureConnect")||m.on("secureConnect",P.bind(null,m))}),r.keepAlive&&C.setNoDelay(!0),p.body&&C.write(p.body),C.end()})}const YP=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),XP=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map(e=>e.toLowerCase()));async function ZP(e,t){let r={...x0,...t};const o=new Headers;r.type==="json"&&o.set("Content-Type","application/json");let s=new URL(e);if(s.username){const l=btoa(`${s.username}:${s.password}`);o.set("Authorization",`Basic ${l}`),s.username="",s.password=""}e=""+s;for(let l in r.headers){const p=l.toLowerCase();(YP.has(p)||r.cors&&!XP.has(p))&&o.set(l,r.headers[l])}let u={headers:o,redirect:r.redirect?"follow":"manual"};r.referrer||(u.referrerPolicy="no-referrer"),r.cors&&(u.mode="cors"),r.data&&(r.method||(u.method="POST"),u.body=r.type==="json"?JSON.stringify(r.data):r.data);const f=await fetch(e,u);if(r.expectStatusCode&&f.status!==r.expectStatusCode)throw new Cd(f.status);const h=D0(new Uint8Array(await f.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(f.headers.entries()),status:f.status,body:h}:h}const QP=!!(typeof H.dist.process=="object"&&H.dist.process.versions&&H.dist.process.versions.node&&H.dist.process.versions.v8);function eB(e,t){return(QP?jc:ZP)(e,t)}Gi.default=eB;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.getProvider=Mo.fetchFromProvider=void 0;const tB=Gi,rB=async(e,t)=>(await(0,tB.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;Mo.fetchFromProvider=rB;const nB=e=>{var t;if(typeof e=="string")return e;if(((t=e==null?void 0:e.connection)==null?void 0:t.url)!==void 0)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};Mo.getProvider=nB;(function(e){var t=H.commonjsGlobal&&H.commonjsGlobal.__createBinding||(Object.create?function(s,u,f,h){h===void 0&&(h=f);var l=Object.getOwnPropertyDescriptor(u,f);(!l||("get"in l?!u.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return u[f]}}),Object.defineProperty(s,h,l)}:function(s,u,f,h){h===void 0&&(h=f),s[h]=u[f]}),r=H.commonjsGlobal&&H.commonjsGlobal.__exportStar||function(s,u){for(var f in s)f!=="default"&&!Object.prototype.hasOwnProperty.call(u,f)&&t(u,s,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,r(Wu,e),r(Zu,e),r(Ad,e),r(Ws,e),r(ef,e),r(Qt,e),r(Qi,e),r(Od,e),r(M0,e),r(nf,e);var o=ht;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return o.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),r(of,e),r(Mo,e)})(wL);var j0={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():t.log=r()})(H.commonjsGlobal,function(){var t=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],u={},f=null;function h(v,C){var B=v[C];if(typeof B.bind=="function")return B.bind(v);try{return Function.prototype.bind.call(B,v)}catch{return function(){return Function.prototype.apply.apply(B,[v,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function p(v){return v==="debug"&&(v="log"),typeof console===r?!1:v==="trace"&&o?l:console[v]!==void 0?h(console,v):console.log!==void 0?h(console,"log"):t}function b(){for(var v=this.getLevel(),C=0;C<s.length;C++){var B=s[C];this[B]=C<v?t:this.methodFactory(B,v,this.name)}if(this.log=this.debug,typeof console===r&&v<this.levels.SILENT)return"No console available for logging"}function w(v){return function(){typeof console!==r&&(b.call(this),this[v].apply(this,arguments))}}function I(v,C,B){return p(v)||w.apply(this,arguments)}function A(v,C){var B=this,P,S,m,j="loglevel";typeof v=="string"?j+=":"+v:typeof v=="symbol"&&(j=void 0);function Q(me){var F=(s[me]||"silent").toUpperCase();if(!(typeof window===r||!j)){try{window.localStorage[j]=F;return}catch{}try{window.document.cookie=encodeURIComponent(j)+"="+F+";"}catch{}}}function ce(){var me;if(!(typeof window===r||!j)){try{me=window.localStorage[j]}catch{}if(typeof me===r)try{var F=window.document.cookie,U=encodeURIComponent(j),$=F.indexOf(U+"=");$!==-1&&(me=/^([^;]+)/.exec(F.slice($+U.length+1))[1])}catch{}return B.levels[me]===void 0&&(me=void 0),me}}function ue(){if(!(typeof window===r||!j)){try{window.localStorage.removeItem(j)}catch{}try{window.document.cookie=encodeURIComponent(j)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function te(me){var F=me;if(typeof F=="string"&&B.levels[F.toUpperCase()]!==void 0&&(F=B.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=B.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+me)}B.name=v,B.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},B.methodFactory=C||I,B.getLevel=function(){return m??S??P},B.setLevel=function(me,F){return m=te(me),F!==!1&&Q(m),b.call(B)},B.setDefaultLevel=function(me){S=te(me),ce()||B.setLevel(me,!1)},B.resetLevel=function(){m=null,ue(),b.call(B)},B.enableAll=function(me){B.setLevel(B.levels.TRACE,me)},B.disableAll=function(me){B.setLevel(B.levels.SILENT,me)},B.rebuild=function(){if(f!==B&&(P=te(f.getLevel())),b.call(B),f===B)for(var me in u)u[me].rebuild()},P=te(f?f.getLevel():"WARN");var Se=ce();Se!=null&&(m=te(Se)),b.call(B)}f=new A,f.getLogger=function(C){if(typeof C!="symbol"&&typeof C!="string"||C==="")throw new TypeError("You must supply a name when creating a logger.");var B=u[C];return B||(B=u[C]=new A(C,f.methodFactory)),B};var x=typeof window!==r?window.log:void 0;return f.noConflict=function(){return typeof window!==r&&window.log===f&&(window.log=x),f},f.getLoggers=function(){return u},f.default=f,f})})(j0);var U0=j0.exports;const mu=H.getDefaultExportFromCjs(U0);var Eu={exports:{}};Eu.exports;(function(e,t){var r=200,o="__lodash_hash_undefined__",s=800,u=16,f=9007199254740991,h="[object Arguments]",l="[object Array]",p="[object AsyncFunction]",b="[object Boolean]",w="[object Date]",I="[object Error]",A="[object Function]",x="[object GeneratorFunction]",v="[object Map]",C="[object Number]",B="[object Null]",P="[object Object]",S="[object Proxy]",m="[object RegExp]",j="[object Set]",Q="[object String]",ce="[object Undefined]",ue="[object WeakMap]",te="[object ArrayBuffer]",Se="[object DataView]",me="[object Float32Array]",F="[object Float64Array]",U="[object Int8Array]",$="[object Int16Array]",G="[object Int32Array]",Y="[object Uint8Array]",V="[object Uint8ClampedArray]",ne="[object Uint16Array]",W="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,re={};re[me]=re[F]=re[U]=re[$]=re[G]=re[Y]=re[V]=re[ne]=re[W]=!0,re[h]=re[l]=re[te]=re[b]=re[Se]=re[w]=re[I]=re[A]=re[v]=re[C]=re[P]=re[m]=re[j]=re[Q]=re[ue]=!1;var _e=typeof H.commonjsGlobal=="object"&&H.commonjsGlobal&&H.commonjsGlobal.Object===Object&&H.commonjsGlobal,be=typeof self=="object"&&self&&self.Object===Object&&self,R=_e||be||Function("return this")(),O=t&&!t.nodeType&&t,q=O&&!0&&e&&!e.nodeType&&e,oe=q&&q.exports===O,ye=oe&&_e.process,d=function(){try{var M=q&&q.require&&q.require("util").types;return M||ye&&ye.binding&&ye.binding("util")}catch{}}(),g=d&&d.isTypedArray;function _(M,X,le){switch(le.length){case 0:return M.call(X);case 1:return M.call(X,le[0]);case 2:return M.call(X,le[0],le[1]);case 3:return M.call(X,le[0],le[1],le[2])}return M.apply(X,le)}function E(M,X){for(var le=-1,Le=Array(M);++le<M;)Le[le]=X(le);return Le}function J(M){return function(X){return M(X)}}function ie(M,X){return M==null?void 0:M[X]}function se(M,X){return function(le){return M(X(le))}}var Ie=Array.prototype,Be=Function.prototype,Ce=Object.prototype,Ue=R["__core-js_shared__"],Re=Be.toString,He=Ce.hasOwnProperty,bt=function(){var M=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||"");return M?"Symbol(src)_1."+M:""}(),et=Ce.toString,_t=Re.call(Object),Ye=RegExp("^"+Re.call(He).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=oe?R.Buffer:void 0,Dt=R.Symbol,Lt=R.Uint8Array;Ve&&Ve.allocUnsafe;var at=se(Object.getPrototypeOf,Object),Bt=Object.create,fr=Ce.propertyIsEnumerable,er=Ie.splice,kt=Dt?Dt.toStringTag:void 0,lr=function(){try{var M=Wo(Object,"defineProperty");return M({},"",{}),M}catch{}}(),zr=Ve?Ve.isBuffer:void 0,Kr=Math.max,sn=Date.now,an=Wo(R,"Map"),tr=Wo(Object,"create"),Or=function(){function M(){}return function(X){if(!Nn(X))return{};if(Bt)return Bt(X);M.prototype=X;var le=new M;return M.prototype=void 0,le}}();function rr(M){var X=-1,le=M==null?0:M.length;for(this.clear();++X<le;){var Le=M[X];this.set(Le[0],Le[1])}}function Ln(){this.__data__=tr?tr(null):{},this.size=0}function Jr(M){var X=this.has(M)&&delete this.__data__[M];return this.size-=X?1:0,X}function un(M){var X=this.__data__;if(tr){var le=X[M];return le===o?void 0:le}return He.call(X,M)?X[M]:void 0}function N(M){var X=this.__data__;return tr?X[M]!==void 0:He.call(X,M)}function D(M,X){var le=this.__data__;return this.size+=this.has(M)?0:1,le[M]=tr&&X===void 0?o:X,this}rr.prototype.clear=Ln,rr.prototype.delete=Jr,rr.prototype.get=un,rr.prototype.has=N,rr.prototype.set=D;function Ee(M){var X=-1,le=M==null?0:M.length;for(this.clear();++X<le;){var Le=M[X];this.set(Le[0],Le[1])}}function ve(){this.__data__=[],this.size=0}function Te(M){var X=this.__data__,le=gn(X,M);if(le<0)return!1;var Le=X.length-1;return le==Le?X.pop():er.call(X,le,1),--this.size,!0}function yt(M){var X=this.__data__,le=gn(X,M);return le<0?void 0:X[le][1]}function St(M){return gn(this.__data__,M)>-1}function fn(M,X){var le=this.__data__,Le=gn(le,M);return Le<0?(++this.size,le.push([M,X])):le[Le][1]=X,this}Ee.prototype.clear=ve,Ee.prototype.delete=Te,Ee.prototype.get=yt,Ee.prototype.has=St,Ee.prototype.set=fn;function Pt(M){var X=-1,le=M==null?0:M.length;for(this.clear();++X<le;){var Le=M[X];this.set(Le[0],Le[1])}}function ln(){this.size=0,this.__data__={hash:new rr,map:new(an||Ee),string:new rr}}function Pn(M){var X=Ci(this,M).delete(M);return this.size-=X?1:0,X}function cn(M){return Ci(this,M).get(M)}function dn(M){return Ci(this,M).has(M)}function Yr(M,X){var le=Ci(this,M),Le=le.size;return le.set(M,X),this.size+=le.size==Le?0:1,this}Pt.prototype.clear=ln,Pt.prototype.delete=Pn,Pt.prototype.get=cn,Pt.prototype.has=dn,Pt.prototype.set=Yr;function Gt(M){var X=this.__data__=new Ee(M);this.size=X.size}function Cr(){this.__data__=new Ee,this.size=0}function yr(M){var X=this.__data__,le=X.delete(M);return this.size=X.size,le}function nr(M){return this.__data__.get(M)}function Ft(M){return this.__data__.has(M)}function Ti(M,X){var le=this.__data__;if(le instanceof Ee){var Le=le.__data__;if(!an||Le.length<r-1)return Le.push([M,X]),this.size=++le.size,this;le=this.__data__=new Pt(Le)}return le.set(M,X),this.size=le.size,this}Gt.prototype.clear=Cr,Gt.prototype.delete=yr,Gt.prototype.get=nr,Gt.prototype.has=Ft,Gt.prototype.set=Ti;function Ii(M,X){var le=zo(M),Le=!le&&Vo(M),Ke=!le&&!Le&&oa(M),tt=!le&&!Le&&!Ke&&aa(M),ct=le||Le||Ke||tt,De=ct?E(M.length,String):[],st=De.length;for(var Nt in M)ct&&(Nt=="length"||Ke&&(Nt=="offset"||Nt=="parent")||tt&&(Nt=="buffer"||Nt=="byteLength"||Nt=="byteOffset")||ro(Nt,st))||De.push(Nt);return De}function Bn(M,X,le){(le!==void 0&&!Li(M[X],le)||le===void 0&&!(X in M))&&Lr(M,X,le)}function hn(M,X,le){var Le=M[X];(!(He.call(M,X)&&Li(Le,le))||le===void 0&&!(X in M))&&Lr(M,X,le)}function gn(M,X){for(var le=M.length;le--;)if(Li(M[le][0],X))return le;return-1}function Lr(M,X,le){X=="__proto__"&&lr?lr(M,X,{configurable:!0,enumerable:!0,value:le,writable:!0}):M[X]=le}var Oi=to();function pn(M){return M==null?M===void 0?ce:B:kt&&kt in Object(M)?Ys(M):Qs(M)}function ti(M){return $n(M)&&pn(M)==h}function ri(M){if(!Nn(M)||qo(M))return!1;var X=Jo(M)?Ye:ae;return X.test(na(M))}function ni(M){return $n(M)&&sa(M.length)&&!!re[pn(M)]}function ii(M){if(!Nn(M))return oi(M);var X=no(M),le=[];for(var Le in M)Le=="constructor"&&(X||!He.call(M,Le))||le.push(Le);return le}function Gs(M,X,le,Le,Ke){M!==X&&Oi(X,function(tt,ct){if(Ke||(Ke=new Gt),Nn(tt))cf(M,X,ct,le,Gs,Le,Ke);else{var De=Le?Le(Go(M,ct),tt,ct+"",M,X,Ke):void 0;De===void 0&&(De=tt),Bn(M,ct,De)}},ua)}function cf(M,X,le,Le,Ke,tt,ct){var De=Go(M,le),st=Go(X,le),Nt=ct.get(st);if(Nt){Bn(M,le,Nt);return}var Vt=tt?tt(De,st,le+"",M,X,ct):void 0,Mn=Vt===void 0;if(Mn){var zt=zo(st),io=!zt&&oa(st),Yo=!zt&&!io&&aa(st);Vt=st,zt||io||Yo?zo(De)?Vt=De:ia(De)?Vt=Ho(De):io?(Mn=!1,Vt=Vs(st)):Yo?(Mn=!1,Vt=Ks(st)):Vt=[]:bf(st)||Vo(st)?(Vt=De,Vo(De)?Vt=_f(De):(!Nn(De)||Jo(De))&&(Vt=Xs(st))):Mn=!1}Mn&&(ct.set(st,Vt),Ke(Vt,st,Le,tt,ct),ct.delete(st)),Bn(M,le,Vt)}function df(M,X){return ta(ea(M,X,nt),M+"")}var hf=lr?function(M,X){return lr(M,"toString",{configurable:!0,enumerable:!1,value:ut(X),writable:!0})}:nt;function Vs(M,X){return M.slice()}function zs(M){var X=new M.constructor(M.byteLength);return new Lt(X).set(new Lt(M)),X}function Ks(M,X){var le=zs(M.buffer);return new M.constructor(le,M.byteOffset,M.length)}function Ho(M,X){var le=-1,Le=M.length;for(X||(X=Array(Le));++le<Le;)X[le]=M[le];return X}function gf(M,X,le,Le){var Ke=!le;le||(le={});for(var tt=-1,ct=X.length;++tt<ct;){var De=X[tt],st=void 0;st===void 0&&(st=M[De]),Ke?Lr(le,De,st):hn(le,De,st)}return le}function Js(M){return df(function(X,le){var Le=-1,Ke=le.length,tt=Ke>1?le[Ke-1]:void 0,ct=Ke>2?le[2]:void 0;for(tt=M.length>3&&typeof tt=="function"?(Ke--,tt):void 0,ct&&pf(le[0],le[1],ct)&&(tt=Ke<3?void 0:tt,Ke=1),X=Object(X);++Le<Ke;){var De=le[Le];De&&M(X,De,Le,tt)}return X})}function to(M){return function(X,le,Le){for(var Ke=-1,tt=Object(X),ct=Le(X),De=ct.length;De--;){var st=ct[++Ke];if(le(tt[st],st,tt)===!1)break}return X}}function Ci(M,X){var le=M.__data__;return Zs(X)?le[typeof X=="string"?"string":"hash"]:le.map}function Wo(M,X){var le=ie(M,X);return ri(le)?le:void 0}function Ys(M){var X=He.call(M,kt),le=M[kt];try{M[kt]=void 0;var Le=!0}catch{}var Ke=et.call(M);return Le&&(X?M[kt]=le:delete M[kt]),Ke}function Xs(M){return typeof M.constructor=="function"&&!no(M)?Or(at(M)):{}}function ro(M,X){var le=typeof M;return X=X??f,!!X&&(le=="number"||le!="symbol"&&de.test(M))&&M>-1&&M%1==0&&M<X}function pf(M,X,le){if(!Nn(le))return!1;var Le=typeof X;return(Le=="number"?Ko(le)&&ro(X,le.length):Le=="string"&&X in le)?Li(le[X],M):!1}function Zs(M){var X=typeof M;return X=="string"||X=="number"||X=="symbol"||X=="boolean"?M!=="__proto__":M===null}function qo(M){return!!bt&&bt in M}function no(M){var X=M&&M.constructor,le=typeof X=="function"&&X.prototype||Ce;return M===le}function oi(M){var X=[];if(M!=null)for(var le in Object(M))X.push(le);return X}function Qs(M){return et.call(M)}function ea(M,X,le){return X=Kr(X===void 0?M.length-1:X,0),function(){for(var Le=arguments,Ke=-1,tt=Kr(Le.length-X,0),ct=Array(tt);++Ke<tt;)ct[Ke]=Le[X+Ke];Ke=-1;for(var De=Array(X+1);++Ke<X;)De[Ke]=Le[Ke];return De[X]=le(ct),_(M,this,De)}}function Go(M,X){if(!(X==="constructor"&&typeof M[X]=="function")&&X!="__proto__")return M[X]}var ta=ra(hf);function ra(M){var X=0,le=0;return function(){var Le=sn(),Ke=u-(Le-le);if(le=Le,Ke>0){if(++X>=s)return arguments[0]}else X=0;return M.apply(void 0,arguments)}}function na(M){if(M!=null){try{return Re.call(M)}catch{}try{return M+""}catch{}}return""}function Li(M,X){return M===X||M!==M&&X!==X}var Vo=ti(function(){return arguments}())?ti:function(M){return $n(M)&&He.call(M,"callee")&&!fr.call(M,"callee")},zo=Array.isArray;function Ko(M){return M!=null&&sa(M.length)&&!Jo(M)}function ia(M){return $n(M)&&Ko(M)}var oa=zr||wf;function Jo(M){if(!Nn(M))return!1;var X=pn(M);return X==A||X==x||X==p||X==S}function sa(M){return typeof M=="number"&&M>-1&&M%1==0&&M<=f}function Nn(M){var X=typeof M;return M!=null&&(X=="object"||X=="function")}function $n(M){return M!=null&&typeof M=="object"}function bf(M){if(!$n(M)||pn(M)!=P)return!1;var X=at(M);if(X===null)return!0;var le=He.call(X,"constructor")&&X.constructor;return typeof le=="function"&&le instanceof le&&Re.call(le)==_t}var aa=g?J(g):ni;function _f(M){return gf(M,ua(M))}function ua(M){return Ko(M)?Ii(M):ii(M)}var yf=Js(function(M,X,le){Gs(M,X,le)});function ut(M){return function(){return M}}function nt(M){return M}function wf(){return!1}e.exports=yf})(Eu,Eu.exports);Eu.exports;const iB=mu.getLogger("http-helpers");iB.setLevel(U0.levels.INFO);var vu={exports:{}};/**
4
4
  * @license
5
5
  * Lodash <https://lodash.com/>
6
6
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
7
7
  * Released under MIT license <https://lodash.com/license>
8
8
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
9
9
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
10
- */vu.exports;(function(e,t){(function(){var r,o="4.17.21",s=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",h="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",p=500,b="__lodash_placeholder__",w=1,I=2,A=4,x=1,v=2,C=1,B=2,P=4,S=8,m=16,j=32,Q=64,ce=128,ue=256,te=512,Se=30,me="...",F=800,U=16,$=1,G=2,Y=3,V=1/0,ne=9007199254740991,W=17976931348623157e292,K=NaN,ae=4294967295,de=ae-1,re=ae>>>1,_e=[["ary",ce],["bind",C],["bindKey",B],["curry",S],["curryRight",m],["flip",te],["partial",j],["partialRight",Q],["rearg",ue]],be="[object Arguments]",R="[object Array]",O="[object AsyncFunction]",q="[object Boolean]",oe="[object Date]",ye="[object DOMException]",d="[object Error]",g="[object Function]",_="[object GeneratorFunction]",E="[object Map]",J="[object Number]",ie="[object Null]",se="[object Object]",Ie="[object Promise]",Be="[object Proxy]",Ce="[object RegExp]",Ue="[object Set]",Re="[object String]",He="[object Symbol]",bt="[object Undefined]",et="[object WeakMap]",_t="[object WeakSet]",Ye="[object ArrayBuffer]",Ve="[object DataView]",Dt="[object Float32Array]",Lt="[object Float64Array]",at="[object Int8Array]",Bt="[object Int16Array]",fr="[object Int32Array]",er="[object Uint8Array]",kt="[object Uint8ClampedArray]",lr="[object Uint16Array]",zr="[object Uint32Array]",Kr=/\b__p \+= '';/g,sn=/\b(__p \+=) '' \+/g,an=/(__e\(.*?\)|\b__t\)) \+\n'';/g,tr=/&(?:amp|lt|gt|quot|#39);/g,Or=/[&<>"']/g,rr=RegExp(tr.source),Ln=RegExp(Or.source),Jr=/<%-([\s\S]+?)%>/g,un=/<%([\s\S]+?)%>/g,N=/<%=([\s\S]+?)%>/g,D=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ee=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Te=/[\\^$.*+?()[\]{}|]/g,yt=RegExp(Te.source),St=/^\s+/,fn=/\s/,Pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ln=/\{\n\/\* \[wrapped with (.+)\] \*/,Pn=/,? & /,cn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dn=/[()=,{}\[\]\/\s]/,Yr=/\\(\\)?/g,Gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cr=/\w*$/,yr=/^[-+]0x[0-9a-f]+$/i,nr=/^0b[01]+$/i,Ft=/^\[object .+?Constructor\]$/,Ti=/^0o[0-7]+$/i,Ii=/^(?:0|[1-9]\d*)$/,Bn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hn=/($^)/,gn=/['\n\r\u2028\u2029\\]/g,Lr="\\ud800-\\udfff",Oi="\\u0300-\\u036f",pn="\\ufe20-\\ufe2f",ti="\\u20d0-\\u20ff",ri=Oi+pn+ti,ni="\\u2700-\\u27bf",ii="a-z\\xdf-\\xf6\\xf8-\\xff",Gs="\\xac\\xb1\\xd7\\xf7",cf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",df="\\u2000-\\u206f",hf=" \\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",Vs="A-Z\\xc0-\\xd6\\xd8-\\xde",zs="\\ufe0e\\ufe0f",Ks=Gs+cf+df+hf,Ho="['’]",gf="["+Lr+"]",Js="["+Ks+"]",to="["+ri+"]",Ci="\\d+",Wo="["+ni+"]",Ys="["+ii+"]",Xs="[^"+Lr+Ks+Ci+ni+ii+Vs+"]",ro="\\ud83c[\\udffb-\\udfff]",pf="(?:"+to+"|"+ro+")",Zs="[^"+Lr+"]",qo="(?:\\ud83c[\\udde6-\\uddff]){2}",no="[\\ud800-\\udbff][\\udc00-\\udfff]",oi="["+Vs+"]",Qs="\\u200d",ea="(?:"+Ys+"|"+Xs+")",Go="(?:"+oi+"|"+Xs+")",ta="(?:"+Ho+"(?:d|ll|m|re|s|t|ve))?",ra="(?:"+Ho+"(?:D|LL|M|RE|S|T|VE))?",na=pf+"?",Li="["+zs+"]?",Vo="(?:"+Qs+"(?:"+[Zs,qo,no].join("|")+")"+Li+na+")*",zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ko="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ia=Li+na+Vo,oa="(?:"+[Wo,qo,no].join("|")+")"+ia,Jo="(?:"+[Zs+to+"?",to,qo,no,gf].join("|")+")",sa=RegExp(Ho,"g"),Nn=RegExp(to,"g"),$n=RegExp(ro+"(?="+ro+")|"+Jo+ia,"g"),bf=RegExp([oi+"?"+Ys+"+"+ta+"(?="+[Js,oi,"$"].join("|")+")",Go+"+"+ra+"(?="+[Js,oi+ea,"$"].join("|")+")",oi+"?"+ea+"+"+ta,oi+"+"+ra,Ko,zo,Ci,oa].join("|"),"g"),aa=RegExp("["+Qs+Lr+ri+zs+"]"),_f=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ua=["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"],yf=-1,ut={};ut[Dt]=ut[Lt]=ut[at]=ut[Bt]=ut[fr]=ut[er]=ut[kt]=ut[lr]=ut[zr]=!0,ut[be]=ut[R]=ut[Ye]=ut[q]=ut[Ve]=ut[oe]=ut[d]=ut[g]=ut[E]=ut[J]=ut[se]=ut[Ce]=ut[Ue]=ut[Re]=ut[et]=!1;var nt={};nt[be]=nt[R]=nt[Ye]=nt[Ve]=nt[q]=nt[oe]=nt[Dt]=nt[Lt]=nt[at]=nt[Bt]=nt[fr]=nt[E]=nt[J]=nt[se]=nt[Ce]=nt[Ue]=nt[Re]=nt[He]=nt[er]=nt[kt]=nt[lr]=nt[zr]=!0,nt[d]=nt[g]=nt[et]=!1;var wf={À:"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"},M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},X={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},le={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Le=parseFloat,Ke=parseInt,tt=typeof H.commonjsGlobal=="object"&&H.commonjsGlobal&&H.commonjsGlobal.Object===Object&&H.commonjsGlobal,ct=typeof self=="object"&&self&&self.Object===Object&&self,De=tt||ct||Function("return this")(),st=t&&!t.nodeType&&t,Nt=st&&!0&&e&&!e.nodeType&&e,Vt=Nt&&Nt.exports===st,Mn=Vt&&tt.process,zt=function(){try{var Z=Nt&&Nt.require&&Nt.require("util").types;return Z||Mn&&Mn.binding&&Mn.binding("util")}catch{}}(),io=zt&&zt.isArrayBuffer,Yo=zt&&zt.isDate,xd=zt&&zt.isMap,Dd=zt&&zt.isRegExp,jd=zt&&zt.isSet,Ud=zt&&zt.isTypedArray;function wr(Z,he,fe){switch(fe.length){case 0:return Z.call(he);case 1:return Z.call(he,fe[0]);case 2:return Z.call(he,fe[0],fe[1]);case 3:return Z.call(he,fe[0],fe[1],fe[2])}return Z.apply(he,fe)}function iw(Z,he,fe,Oe){for(var ke=-1,Qe=Z==null?0:Z.length;++ke<Qe;){var $t=Z[ke];he(Oe,$t,fe($t),Z)}return Oe}function Pr(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length;++fe<Oe&&he(Z[fe],fe,Z)!==!1;);return Z}function ow(Z,he){for(var fe=Z==null?0:Z.length;fe--&&he(Z[fe],fe,Z)!==!1;);return Z}function kd(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length;++fe<Oe;)if(!he(Z[fe],fe,Z))return!1;return!0}function si(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length,ke=0,Qe=[];++fe<Oe;){var $t=Z[fe];he($t,fe,Z)&&(Qe[ke++]=$t)}return Qe}function fa(Z,he){var fe=Z==null?0:Z.length;return!!fe&&oo(Z,he,0)>-1}function mf(Z,he,fe){for(var Oe=-1,ke=Z==null?0:Z.length;++Oe<ke;)if(fe(he,Z[Oe]))return!0;return!1}function wt(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length,ke=Array(Oe);++fe<Oe;)ke[fe]=he(Z[fe],fe,Z);return ke}function ai(Z,he){for(var fe=-1,Oe=he.length,ke=Z.length;++fe<Oe;)Z[ke+fe]=he[fe];return Z}function Ef(Z,he,fe,Oe){var ke=-1,Qe=Z==null?0:Z.length;for(Oe&&Qe&&(fe=Z[++ke]);++ke<Qe;)fe=he(fe,Z[ke],ke,Z);return fe}function sw(Z,he,fe,Oe){var ke=Z==null?0:Z.length;for(Oe&&ke&&(fe=Z[--ke]);ke--;)fe=he(fe,Z[ke],ke,Z);return fe}function vf(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length;++fe<Oe;)if(he(Z[fe],fe,Z))return!0;return!1}var aw=Sf("length");function uw(Z){return Z.split("")}function fw(Z){return Z.match(cn)||[]}function Fd(Z,he,fe){var Oe;return fe(Z,function(ke,Qe,$t){if(he(ke,Qe,$t))return Oe=Qe,!1}),Oe}function la(Z,he,fe,Oe){for(var ke=Z.length,Qe=fe+(Oe?1:-1);Oe?Qe--:++Qe<ke;)if(he(Z[Qe],Qe,Z))return Qe;return-1}function oo(Z,he,fe){return he===he?Ew(Z,he,fe):la(Z,Hd,fe)}function lw(Z,he,fe,Oe){for(var ke=fe-1,Qe=Z.length;++ke<Qe;)if(Oe(Z[ke],he))return ke;return-1}function Hd(Z){return Z!==Z}function Wd(Z,he){var fe=Z==null?0:Z.length;return fe?Af(Z,he)/fe:K}function Sf(Z){return function(he){return he==null?r:he[Z]}}function Rf(Z){return function(he){return Z==null?r:Z[he]}}function qd(Z,he,fe,Oe,ke){return ke(Z,function(Qe,$t,ft){fe=Oe?(Oe=!1,Qe):he(fe,Qe,$t,ft)}),fe}function cw(Z,he){var fe=Z.length;for(Z.sort(he);fe--;)Z[fe]=Z[fe].value;return Z}function Af(Z,he){for(var fe,Oe=-1,ke=Z.length;++Oe<ke;){var Qe=he(Z[Oe]);Qe!==r&&(fe=fe===r?Qe:fe+Qe)}return fe}function Tf(Z,he){for(var fe=-1,Oe=Array(Z);++fe<Z;)Oe[fe]=he(fe);return Oe}function dw(Z,he){return wt(he,function(fe){return[fe,Z[fe]]})}function Gd(Z){return Z&&Z.slice(0,Jd(Z)+1).replace(St,"")}function mr(Z){return function(he){return Z(he)}}function If(Z,he){return wt(he,function(fe){return Z[fe]})}function Xo(Z,he){return Z.has(he)}function Vd(Z,he){for(var fe=-1,Oe=Z.length;++fe<Oe&&oo(he,Z[fe],0)>-1;);return fe}function zd(Z,he){for(var fe=Z.length;fe--&&oo(he,Z[fe],0)>-1;);return fe}function hw(Z,he){for(var fe=Z.length,Oe=0;fe--;)Z[fe]===he&&++Oe;return Oe}var gw=Rf(wf),pw=Rf(M);function bw(Z){return"\\"+le[Z]}function _w(Z,he){return Z==null?r:Z[he]}function so(Z){return aa.test(Z)}function yw(Z){return _f.test(Z)}function ww(Z){for(var he,fe=[];!(he=Z.next()).done;)fe.push(he.value);return fe}function Of(Z){var he=-1,fe=Array(Z.size);return Z.forEach(function(Oe,ke){fe[++he]=[ke,Oe]}),fe}function Kd(Z,he){return function(fe){return Z(he(fe))}}function ui(Z,he){for(var fe=-1,Oe=Z.length,ke=0,Qe=[];++fe<Oe;){var $t=Z[fe];($t===he||$t===b)&&(Z[fe]=b,Qe[ke++]=fe)}return Qe}function ca(Z){var he=-1,fe=Array(Z.size);return Z.forEach(function(Oe){fe[++he]=Oe}),fe}function mw(Z){var he=-1,fe=Array(Z.size);return Z.forEach(function(Oe){fe[++he]=[Oe,Oe]}),fe}function Ew(Z,he,fe){for(var Oe=fe-1,ke=Z.length;++Oe<ke;)if(Z[Oe]===he)return Oe;return-1}function vw(Z,he,fe){for(var Oe=fe+1;Oe--;)if(Z[Oe]===he)return Oe;return Oe}function ao(Z){return so(Z)?Rw(Z):aw(Z)}function Xr(Z){return so(Z)?Aw(Z):uw(Z)}function Jd(Z){for(var he=Z.length;he--&&fn.test(Z.charAt(he)););return he}var Sw=Rf(X);function Rw(Z){for(var he=$n.lastIndex=0;$n.test(Z);)++he;return he}function Aw(Z){return Z.match($n)||[]}function Tw(Z){return Z.match(bf)||[]}var Iw=function Z(he){he=he==null?De:uo.defaults(De.Object(),he,uo.pick(De,ua));var fe=he.Array,Oe=he.Date,ke=he.Error,Qe=he.Function,$t=he.Math,ft=he.Object,Cf=he.RegExp,Ow=he.String,Br=he.TypeError,da=fe.prototype,Cw=Qe.prototype,fo=ft.prototype,ha=he["__core-js_shared__"],ga=Cw.toString,it=fo.hasOwnProperty,Lw=0,Yd=function(){var n=/[^.]+$/.exec(ha&&ha.keys&&ha.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),pa=fo.toString,Pw=ga.call(ft),Bw=De._,Nw=Cf("^"+ga.call(it).replace(Te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ba=Vt?he.Buffer:r,fi=he.Symbol,_a=he.Uint8Array,Xd=ba?ba.allocUnsafe:r,ya=Kd(ft.getPrototypeOf,ft),Zd=ft.create,Qd=fo.propertyIsEnumerable,wa=da.splice,eh=fi?fi.isConcatSpreadable:r,Zo=fi?fi.iterator:r,Pi=fi?fi.toStringTag:r,ma=function(){try{var n=xi(ft,"defineProperty");return n({},"",{}),n}catch{}}(),$w=he.clearTimeout!==De.clearTimeout&&he.clearTimeout,Mw=Oe&&Oe.now!==De.Date.now&&Oe.now,xw=he.setTimeout!==De.setTimeout&&he.setTimeout,Ea=$t.ceil,va=$t.floor,Lf=ft.getOwnPropertySymbols,Dw=ba?ba.isBuffer:r,th=he.isFinite,jw=da.join,Uw=Kd(ft.keys,ft),Mt=$t.max,Kt=$t.min,kw=Oe.now,Fw=he.parseInt,rh=$t.random,Hw=da.reverse,Pf=xi(he,"DataView"),Qo=xi(he,"Map"),Bf=xi(he,"Promise"),lo=xi(he,"Set"),es=xi(he,"WeakMap"),ts=xi(ft,"create"),Sa=es&&new es,co={},Ww=Di(Pf),qw=Di(Qo),Gw=Di(Bf),Vw=Di(lo),zw=Di(es),Ra=fi?fi.prototype:r,rs=Ra?Ra.valueOf:r,nh=Ra?Ra.toString:r;function T(n){if(Rt(n)&&!Fe(n)&&!(n instanceof Je)){if(n instanceof Nr)return n;if(it.call(n,"__wrapped__"))return ig(n)}return new Nr(n)}var ho=function(){function n(){}return function(i){if(!mt(i))return{};if(Zd)return Zd(i);n.prototype=i;var a=new n;return n.prototype=r,a}}();function Aa(){}function Nr(n,i){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=r}T.templateSettings={escape:Jr,evaluate:un,interpolate:N,variable:"",imports:{_:T}},T.prototype=Aa.prototype,T.prototype.constructor=T,Nr.prototype=ho(Aa.prototype),Nr.prototype.constructor=Nr;function Je(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function Kw(){var n=new Je(this.__wrapped__);return n.__actions__=cr(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=cr(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=cr(this.__views__),n}function Jw(){if(this.__filtered__){var n=new Je(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Yw(){var n=this.__wrapped__.value(),i=this.__dir__,a=Fe(n),c=i<0,y=a?n.length:0,L=uE(0,y,this.__views__),k=L.start,z=L.end,ee=z-k,ge=c?z:k-1,pe=this.__iteratees__,we=pe.length,Ae=0,Pe=Kt(ee,this.__takeCount__);if(!a||!c&&y==ee&&Pe==ee)return Ih(n,this.__actions__);var Me=[];e:for(;ee--&&Ae<Pe;){ge+=i;for(var qe=-1,xe=n[ge];++qe<we;){var ze=pe[qe],Xe=ze.iteratee,Sr=ze.type,sr=Xe(xe);if(Sr==G)xe=sr;else if(!sr){if(Sr==$)continue e;break e}}Me[Ae++]=xe}return Me}Je.prototype=ho(Aa.prototype),Je.prototype.constructor=Je;function Bi(n){var i=-1,a=n==null?0:n.length;for(this.clear();++i<a;){var c=n[i];this.set(c[0],c[1])}}function Xw(){this.__data__=ts?ts(null):{},this.size=0}function Zw(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}function Qw(n){var i=this.__data__;if(ts){var a=i[n];return a===l?r:a}return it.call(i,n)?i[n]:r}function em(n){var i=this.__data__;return ts?i[n]!==r:it.call(i,n)}function tm(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=ts&&i===r?l:i,this}Bi.prototype.clear=Xw,Bi.prototype.delete=Zw,Bi.prototype.get=Qw,Bi.prototype.has=em,Bi.prototype.set=tm;function xn(n){var i=-1,a=n==null?0:n.length;for(this.clear();++i<a;){var c=n[i];this.set(c[0],c[1])}}function rm(){this.__data__=[],this.size=0}function nm(n){var i=this.__data__,a=Ta(i,n);if(a<0)return!1;var c=i.length-1;return a==c?i.pop():wa.call(i,a,1),--this.size,!0}function im(n){var i=this.__data__,a=Ta(i,n);return a<0?r:i[a][1]}function om(n){return Ta(this.__data__,n)>-1}function sm(n,i){var a=this.__data__,c=Ta(a,n);return c<0?(++this.size,a.push([n,i])):a[c][1]=i,this}xn.prototype.clear=rm,xn.prototype.delete=nm,xn.prototype.get=im,xn.prototype.has=om,xn.prototype.set=sm;function Dn(n){var i=-1,a=n==null?0:n.length;for(this.clear();++i<a;){var c=n[i];this.set(c[0],c[1])}}function am(){this.size=0,this.__data__={hash:new Bi,map:new(Qo||xn),string:new Bi}}function um(n){var i=ja(this,n).delete(n);return this.size-=i?1:0,i}function fm(n){return ja(this,n).get(n)}function lm(n){return ja(this,n).has(n)}function cm(n,i){var a=ja(this,n),c=a.size;return a.set(n,i),this.size+=a.size==c?0:1,this}Dn.prototype.clear=am,Dn.prototype.delete=um,Dn.prototype.get=fm,Dn.prototype.has=lm,Dn.prototype.set=cm;function Ni(n){var i=-1,a=n==null?0:n.length;for(this.__data__=new Dn;++i<a;)this.add(n[i])}function dm(n){return this.__data__.set(n,l),this}function hm(n){return this.__data__.has(n)}Ni.prototype.add=Ni.prototype.push=dm,Ni.prototype.has=hm;function Zr(n){var i=this.__data__=new xn(n);this.size=i.size}function gm(){this.__data__=new xn,this.size=0}function pm(n){var i=this.__data__,a=i.delete(n);return this.size=i.size,a}function bm(n){return this.__data__.get(n)}function _m(n){return this.__data__.has(n)}function ym(n,i){var a=this.__data__;if(a instanceof xn){var c=a.__data__;if(!Qo||c.length<s-1)return c.push([n,i]),this.size=++a.size,this;a=this.__data__=new Dn(c)}return a.set(n,i),this.size=a.size,this}Zr.prototype.clear=gm,Zr.prototype.delete=pm,Zr.prototype.get=bm,Zr.prototype.has=_m,Zr.prototype.set=ym;function ih(n,i){var a=Fe(n),c=!a&&ji(n),y=!a&&!c&&gi(n),L=!a&&!c&&!y&&_o(n),k=a||c||y||L,z=k?Tf(n.length,Ow):[],ee=z.length;for(var ge in n)(i||it.call(n,ge))&&!(k&&(ge=="length"||y&&(ge=="offset"||ge=="parent")||L&&(ge=="buffer"||ge=="byteLength"||ge=="byteOffset")||Fn(ge,ee)))&&z.push(ge);return z}function oh(n){var i=n.length;return i?n[Wf(0,i-1)]:r}function wm(n,i){return Ua(cr(n),$i(i,0,n.length))}function mm(n){return Ua(cr(n))}function Nf(n,i,a){(a!==r&&!Qr(n[i],a)||a===r&&!(i in n))&&jn(n,i,a)}function ns(n,i,a){var c=n[i];(!(it.call(n,i)&&Qr(c,a))||a===r&&!(i in n))&&jn(n,i,a)}function Ta(n,i){for(var a=n.length;a--;)if(Qr(n[a][0],i))return a;return-1}function Em(n,i,a,c){return li(n,function(y,L,k){i(c,y,a(y),k)}),c}function sh(n,i){return n&&_n(i,jt(i),n)}function vm(n,i){return n&&_n(i,hr(i),n)}function jn(n,i,a){i=="__proto__"&&ma?ma(n,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[i]=a}function $f(n,i){for(var a=-1,c=i.length,y=fe(c),L=n==null;++a<c;)y[a]=L?r:gl(n,i[a]);return y}function $i(n,i,a){return n===n&&(a!==r&&(n=n<=a?n:a),i!==r&&(n=n>=i?n:i)),n}function $r(n,i,a,c,y,L){var k,z=i&w,ee=i&I,ge=i&A;if(a&&(k=y?a(n,c,y,L):a(n)),k!==r)return k;if(!mt(n))return n;var pe=Fe(n);if(pe){if(k=lE(n),!z)return cr(n,k)}else{var we=Jt(n),Ae=we==g||we==_;if(gi(n))return Lh(n,z);if(we==se||we==be||Ae&&!y){if(k=ee||Ae?{}:Jh(n),!z)return ee?Qm(n,vm(k,n)):Zm(n,sh(k,n))}else{if(!nt[we])return y?n:{};k=cE(n,we,z)}}L||(L=new Zr);var Pe=L.get(n);if(Pe)return Pe;L.set(n,k),Rg(n)?n.forEach(function(xe){k.add($r(xe,i,a,xe,n,L))}):vg(n)&&n.forEach(function(xe,ze){k.set(ze,$r(xe,i,a,ze,n,L))});var Me=ge?ee?el:Qf:ee?hr:jt,qe=pe?r:Me(n);return Pr(qe||n,function(xe,ze){qe&&(ze=xe,xe=n[ze]),ns(k,ze,$r(xe,i,a,ze,n,L))}),k}function Sm(n){var i=jt(n);return function(a){return ah(a,n,i)}}function ah(n,i,a){var c=a.length;if(n==null)return!c;for(n=ft(n);c--;){var y=a[c],L=i[y],k=n[y];if(k===r&&!(y in n)||!L(k))return!1}return!0}function uh(n,i,a){if(typeof n!="function")throw new Br(f);return ls(function(){n.apply(r,a)},i)}function is(n,i,a,c){var y=-1,L=fa,k=!0,z=n.length,ee=[],ge=i.length;if(!z)return ee;a&&(i=wt(i,mr(a))),c?(L=mf,k=!1):i.length>=s&&(L=Xo,k=!1,i=new Ni(i));e:for(;++y<z;){var pe=n[y],we=a==null?pe:a(pe);if(pe=c||pe!==0?pe:0,k&&we===we){for(var Ae=ge;Ae--;)if(i[Ae]===we)continue e;ee.push(pe)}else L(i,we,c)||ee.push(pe)}return ee}var li=Mh(bn),fh=Mh(xf,!0);function Rm(n,i){var a=!0;return li(n,function(c,y,L){return a=!!i(c,y,L),a}),a}function Ia(n,i,a){for(var c=-1,y=n.length;++c<y;){var L=n[c],k=i(L);if(k!=null&&(z===r?k===k&&!vr(k):a(k,z)))var z=k,ee=L}return ee}function Am(n,i,a,c){var y=n.length;for(a=We(a),a<0&&(a=-a>y?0:y+a),c=c===r||c>y?y:We(c),c<0&&(c+=y),c=a>c?0:Tg(c);a<c;)n[a++]=i;return n}function lh(n,i){var a=[];return li(n,function(c,y,L){i(c,y,L)&&a.push(c)}),a}function Ht(n,i,a,c,y){var L=-1,k=n.length;for(a||(a=hE),y||(y=[]);++L<k;){var z=n[L];i>0&&a(z)?i>1?Ht(z,i-1,a,c,y):ai(y,z):c||(y[y.length]=z)}return y}var Mf=xh(),ch=xh(!0);function bn(n,i){return n&&Mf(n,i,jt)}function xf(n,i){return n&&ch(n,i,jt)}function Oa(n,i){return si(i,function(a){return Hn(n[a])})}function Mi(n,i){i=di(i,n);for(var a=0,c=i.length;n!=null&&a<c;)n=n[yn(i[a++])];return a&&a==c?n:r}function dh(n,i,a){var c=i(n);return Fe(n)?c:ai(c,a(n))}function ir(n){return n==null?n===r?bt:ie:Pi&&Pi in ft(n)?aE(n):mE(n)}function Df(n,i){return n>i}function Tm(n,i){return n!=null&&it.call(n,i)}function Im(n,i){return n!=null&&i in ft(n)}function Om(n,i,a){return n>=Kt(i,a)&&n<Mt(i,a)}function jf(n,i,a){for(var c=a?mf:fa,y=n[0].length,L=n.length,k=L,z=fe(L),ee=1/0,ge=[];k--;){var pe=n[k];k&&i&&(pe=wt(pe,mr(i))),ee=Kt(pe.length,ee),z[k]=!a&&(i||y>=120&&pe.length>=120)?new Ni(k&&pe):r}pe=n[0];var we=-1,Ae=z[0];e:for(;++we<y&&ge.length<ee;){var Pe=pe[we],Me=i?i(Pe):Pe;if(Pe=a||Pe!==0?Pe:0,!(Ae?Xo(Ae,Me):c(ge,Me,a))){for(k=L;--k;){var qe=z[k];if(!(qe?Xo(qe,Me):c(n[k],Me,a)))continue e}Ae&&Ae.push(Me),ge.push(Pe)}}return ge}function Cm(n,i,a,c){return bn(n,function(y,L,k){i(c,a(y),L,k)}),c}function os(n,i,a){i=di(i,n),n=Qh(n,i);var c=n==null?n:n[yn(xr(i))];return c==null?r:wr(c,n,a)}function hh(n){return Rt(n)&&ir(n)==be}function Lm(n){return Rt(n)&&ir(n)==Ye}function Pm(n){return Rt(n)&&ir(n)==oe}function ss(n,i,a,c,y){return n===i?!0:n==null||i==null||!Rt(n)&&!Rt(i)?n!==n&&i!==i:Bm(n,i,a,c,ss,y)}function Bm(n,i,a,c,y,L){var k=Fe(n),z=Fe(i),ee=k?R:Jt(n),ge=z?R:Jt(i);ee=ee==be?se:ee,ge=ge==be?se:ge;var pe=ee==se,we=ge==se,Ae=ee==ge;if(Ae&&gi(n)){if(!gi(i))return!1;k=!0,pe=!1}if(Ae&&!pe)return L||(L=new Zr),k||_o(n)?Vh(n,i,a,c,y,L):oE(n,i,ee,a,c,y,L);if(!(a&x)){var Pe=pe&&it.call(n,"__wrapped__"),Me=we&&it.call(i,"__wrapped__");if(Pe||Me){var qe=Pe?n.value():n,xe=Me?i.value():i;return L||(L=new Zr),y(qe,xe,a,c,L)}}return Ae?(L||(L=new Zr),sE(n,i,a,c,y,L)):!1}function Nm(n){return Rt(n)&&Jt(n)==E}function Uf(n,i,a,c){var y=a.length,L=y,k=!c;if(n==null)return!L;for(n=ft(n);y--;){var z=a[y];if(k&&z[2]?z[1]!==n[z[0]]:!(z[0]in n))return!1}for(;++y<L;){z=a[y];var ee=z[0],ge=n[ee],pe=z[1];if(k&&z[2]){if(ge===r&&!(ee in n))return!1}else{var we=new Zr;if(c)var Ae=c(ge,pe,ee,n,i,we);if(!(Ae===r?ss(pe,ge,x|v,c,we):Ae))return!1}}return!0}function gh(n){if(!mt(n)||pE(n))return!1;var i=Hn(n)?Nw:Ft;return i.test(Di(n))}function $m(n){return Rt(n)&&ir(n)==Ce}function Mm(n){return Rt(n)&&Jt(n)==Ue}function xm(n){return Rt(n)&&Ga(n.length)&&!!ut[ir(n)]}function ph(n){return typeof n=="function"?n:n==null?gr:typeof n=="object"?Fe(n)?yh(n[0],n[1]):_h(n):Dg(n)}function kf(n){if(!fs(n))return Uw(n);var i=[];for(var a in ft(n))it.call(n,a)&&a!="constructor"&&i.push(a);return i}function Dm(n){if(!mt(n))return wE(n);var i=fs(n),a=[];for(var c in n)c=="constructor"&&(i||!it.call(n,c))||a.push(c);return a}function Ff(n,i){return n<i}function bh(n,i){var a=-1,c=dr(n)?fe(n.length):[];return li(n,function(y,L,k){c[++a]=i(y,L,k)}),c}function _h(n){var i=rl(n);return i.length==1&&i[0][2]?Xh(i[0][0],i[0][1]):function(a){return a===n||Uf(a,n,i)}}function yh(n,i){return il(n)&&Yh(i)?Xh(yn(n),i):function(a){var c=gl(a,n);return c===r&&c===i?pl(a,n):ss(i,c,x|v)}}function Ca(n,i,a,c,y){n!==i&&Mf(i,function(L,k){if(y||(y=new Zr),mt(L))jm(n,i,k,a,Ca,c,y);else{var z=c?c(sl(n,k),L,k+"",n,i,y):r;z===r&&(z=L),Nf(n,k,z)}},hr)}function jm(n,i,a,c,y,L,k){var z=sl(n,a),ee=sl(i,a),ge=k.get(ee);if(ge){Nf(n,a,ge);return}var pe=L?L(z,ee,a+"",n,i,k):r,we=pe===r;if(we){var Ae=Fe(ee),Pe=!Ae&&gi(ee),Me=!Ae&&!Pe&&_o(ee);pe=ee,Ae||Pe||Me?Fe(z)?pe=z:Tt(z)?pe=cr(z):Pe?(we=!1,pe=Lh(ee,!0)):Me?(we=!1,pe=Ph(ee,!0)):pe=[]:cs(ee)||ji(ee)?(pe=z,ji(z)?pe=Ig(z):(!mt(z)||Hn(z))&&(pe=Jh(ee))):we=!1}we&&(k.set(ee,pe),y(pe,ee,c,L,k),k.delete(ee)),Nf(n,a,pe)}function wh(n,i){var a=n.length;if(a)return i+=i<0?a:0,Fn(i,a)?n[i]:r}function mh(n,i,a){i.length?i=wt(i,function(L){return Fe(L)?function(k){return Mi(k,L.length===1?L[0]:L)}:L}):i=[gr];var c=-1;i=wt(i,mr($e()));var y=bh(n,function(L,k,z){var ee=wt(i,function(ge){return ge(L)});return{criteria:ee,index:++c,value:L}});return cw(y,function(L,k){return Xm(L,k,a)})}function Um(n,i){return Eh(n,i,function(a,c){return pl(n,c)})}function Eh(n,i,a){for(var c=-1,y=i.length,L={};++c<y;){var k=i[c],z=Mi(n,k);a(z,k)&&as(L,di(k,n),z)}return L}function km(n){return function(i){return Mi(i,n)}}function Hf(n,i,a,c){var y=c?lw:oo,L=-1,k=i.length,z=n;for(n===i&&(i=cr(i)),a&&(z=wt(n,mr(a)));++L<k;)for(var ee=0,ge=i[L],pe=a?a(ge):ge;(ee=y(z,pe,ee,c))>-1;)z!==n&&wa.call(z,ee,1),wa.call(n,ee,1);return n}function vh(n,i){for(var a=n?i.length:0,c=a-1;a--;){var y=i[a];if(a==c||y!==L){var L=y;Fn(y)?wa.call(n,y,1):Vf(n,y)}}return n}function Wf(n,i){return n+va(rh()*(i-n+1))}function Fm(n,i,a,c){for(var y=-1,L=Mt(Ea((i-n)/(a||1)),0),k=fe(L);L--;)k[c?L:++y]=n,n+=a;return k}function qf(n,i){var a="";if(!n||i<1||i>ne)return a;do i%2&&(a+=n),i=va(i/2),i&&(n+=n);while(i);return a}function Ge(n,i){return al(Zh(n,i,gr),n+"")}function Hm(n){return oh(yo(n))}function Wm(n,i){var a=yo(n);return Ua(a,$i(i,0,a.length))}function as(n,i,a,c){if(!mt(n))return n;i=di(i,n);for(var y=-1,L=i.length,k=L-1,z=n;z!=null&&++y<L;){var ee=yn(i[y]),ge=a;if(ee==="__proto__"||ee==="constructor"||ee==="prototype")return n;if(y!=k){var pe=z[ee];ge=c?c(pe,ee,z):r,ge===r&&(ge=mt(pe)?pe:Fn(i[y+1])?[]:{})}ns(z,ee,ge),z=z[ee]}return n}var Sh=Sa?function(n,i){return Sa.set(n,i),n}:gr,qm=ma?function(n,i){return ma(n,"toString",{configurable:!0,enumerable:!1,value:_l(i),writable:!0})}:gr;function Gm(n){return Ua(yo(n))}function Mr(n,i,a){var c=-1,y=n.length;i<0&&(i=-i>y?0:y+i),a=a>y?y:a,a<0&&(a+=y),y=i>a?0:a-i>>>0,i>>>=0;for(var L=fe(y);++c<y;)L[c]=n[c+i];return L}function Vm(n,i){var a;return li(n,function(c,y,L){return a=i(c,y,L),!a}),!!a}function La(n,i,a){var c=0,y=n==null?c:n.length;if(typeof i=="number"&&i===i&&y<=re){for(;c<y;){var L=c+y>>>1,k=n[L];k!==null&&!vr(k)&&(a?k<=i:k<i)?c=L+1:y=L}return y}return Gf(n,i,gr,a)}function Gf(n,i,a,c){var y=0,L=n==null?0:n.length;if(L===0)return 0;i=a(i);for(var k=i!==i,z=i===null,ee=vr(i),ge=i===r;y<L;){var pe=va((y+L)/2),we=a(n[pe]),Ae=we!==r,Pe=we===null,Me=we===we,qe=vr(we);if(k)var xe=c||Me;else ge?xe=Me&&(c||Ae):z?xe=Me&&Ae&&(c||!Pe):ee?xe=Me&&Ae&&!Pe&&(c||!qe):Pe||qe?xe=!1:xe=c?we<=i:we<i;xe?y=pe+1:L=pe}return Kt(L,de)}function Rh(n,i){for(var a=-1,c=n.length,y=0,L=[];++a<c;){var k=n[a],z=i?i(k):k;if(!a||!Qr(z,ee)){var ee=z;L[y++]=k===0?0:k}}return L}function Ah(n){return typeof n=="number"?n:vr(n)?K:+n}function Er(n){if(typeof n=="string")return n;if(Fe(n))return wt(n,Er)+"";if(vr(n))return nh?nh.call(n):"";var i=n+"";return i=="0"&&1/n==-1/0?"-0":i}function ci(n,i,a){var c=-1,y=fa,L=n.length,k=!0,z=[],ee=z;if(a)k=!1,y=mf;else if(L>=s){var ge=i?null:nE(n);if(ge)return ca(ge);k=!1,y=Xo,ee=new Ni}else ee=i?[]:z;e:for(;++c<L;){var pe=n[c],we=i?i(pe):pe;if(pe=a||pe!==0?pe:0,k&&we===we){for(var Ae=ee.length;Ae--;)if(ee[Ae]===we)continue e;i&&ee.push(we),z.push(pe)}else y(ee,we,a)||(ee!==z&&ee.push(we),z.push(pe))}return z}function Vf(n,i){return i=di(i,n),n=Qh(n,i),n==null||delete n[yn(xr(i))]}function Th(n,i,a,c){return as(n,i,a(Mi(n,i)),c)}function Pa(n,i,a,c){for(var y=n.length,L=c?y:-1;(c?L--:++L<y)&&i(n[L],L,n););return a?Mr(n,c?0:L,c?L+1:y):Mr(n,c?L+1:0,c?y:L)}function Ih(n,i){var a=n;return a instanceof Je&&(a=a.value()),Ef(i,function(c,y){return y.func.apply(y.thisArg,ai([c],y.args))},a)}function zf(n,i,a){var c=n.length;if(c<2)return c?ci(n[0]):[];for(var y=-1,L=fe(c);++y<c;)for(var k=n[y],z=-1;++z<c;)z!=y&&(L[y]=is(L[y]||k,n[z],i,a));return ci(Ht(L,1),i,a)}function Oh(n,i,a){for(var c=-1,y=n.length,L=i.length,k={};++c<y;){var z=c<L?i[c]:r;a(k,n[c],z)}return k}function Kf(n){return Tt(n)?n:[]}function Jf(n){return typeof n=="function"?n:gr}function di(n,i){return Fe(n)?n:il(n,i)?[n]:ng(rt(n))}var zm=Ge;function hi(n,i,a){var c=n.length;return a=a===r?c:a,!i&&a>=c?n:Mr(n,i,a)}var Ch=$w||function(n){return De.clearTimeout(n)};function Lh(n,i){if(i)return n.slice();var a=n.length,c=Xd?Xd(a):new n.constructor(a);return n.copy(c),c}function Yf(n){var i=new n.constructor(n.byteLength);return new _a(i).set(new _a(n)),i}function Km(n,i){var a=i?Yf(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.byteLength)}function Jm(n){var i=new n.constructor(n.source,Cr.exec(n));return i.lastIndex=n.lastIndex,i}function Ym(n){return rs?ft(rs.call(n)):{}}function Ph(n,i){var a=i?Yf(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.length)}function Bh(n,i){if(n!==i){var a=n!==r,c=n===null,y=n===n,L=vr(n),k=i!==r,z=i===null,ee=i===i,ge=vr(i);if(!z&&!ge&&!L&&n>i||L&&k&&ee&&!z&&!ge||c&&k&&ee||!a&&ee||!y)return 1;if(!c&&!L&&!ge&&n<i||ge&&a&&y&&!c&&!L||z&&a&&y||!k&&y||!ee)return-1}return 0}function Xm(n,i,a){for(var c=-1,y=n.criteria,L=i.criteria,k=y.length,z=a.length;++c<k;){var ee=Bh(y[c],L[c]);if(ee){if(c>=z)return ee;var ge=a[c];return ee*(ge=="desc"?-1:1)}}return n.index-i.index}function Nh(n,i,a,c){for(var y=-1,L=n.length,k=a.length,z=-1,ee=i.length,ge=Mt(L-k,0),pe=fe(ee+ge),we=!c;++z<ee;)pe[z]=i[z];for(;++y<k;)(we||y<L)&&(pe[a[y]]=n[y]);for(;ge--;)pe[z++]=n[y++];return pe}function $h(n,i,a,c){for(var y=-1,L=n.length,k=-1,z=a.length,ee=-1,ge=i.length,pe=Mt(L-z,0),we=fe(pe+ge),Ae=!c;++y<pe;)we[y]=n[y];for(var Pe=y;++ee<ge;)we[Pe+ee]=i[ee];for(;++k<z;)(Ae||y<L)&&(we[Pe+a[k]]=n[y++]);return we}function cr(n,i){var a=-1,c=n.length;for(i||(i=fe(c));++a<c;)i[a]=n[a];return i}function _n(n,i,a,c){var y=!a;a||(a={});for(var L=-1,k=i.length;++L<k;){var z=i[L],ee=c?c(a[z],n[z],z,a,n):r;ee===r&&(ee=n[z]),y?jn(a,z,ee):ns(a,z,ee)}return a}function Zm(n,i){return _n(n,nl(n),i)}function Qm(n,i){return _n(n,zh(n),i)}function Ba(n,i){return function(a,c){var y=Fe(a)?iw:Em,L=i?i():{};return y(a,n,$e(c,2),L)}}function go(n){return Ge(function(i,a){var c=-1,y=a.length,L=y>1?a[y-1]:r,k=y>2?a[2]:r;for(L=n.length>3&&typeof L=="function"?(y--,L):r,k&&or(a[0],a[1],k)&&(L=y<3?r:L,y=1),i=ft(i);++c<y;){var z=a[c];z&&n(i,z,c,L)}return i})}function Mh(n,i){return function(a,c){if(a==null)return a;if(!dr(a))return n(a,c);for(var y=a.length,L=i?y:-1,k=ft(a);(i?L--:++L<y)&&c(k[L],L,k)!==!1;);return a}}function xh(n){return function(i,a,c){for(var y=-1,L=ft(i),k=c(i),z=k.length;z--;){var ee=k[n?z:++y];if(a(L[ee],ee,L)===!1)break}return i}}function eE(n,i,a){var c=i&C,y=us(n);function L(){var k=this&&this!==De&&this instanceof L?y:n;return k.apply(c?a:this,arguments)}return L}function Dh(n){return function(i){i=rt(i);var a=so(i)?Xr(i):r,c=a?a[0]:i.charAt(0),y=a?hi(a,1).join(""):i.slice(1);return c[n]()+y}}function po(n){return function(i){return Ef(Mg($g(i).replace(sa,"")),n,"")}}function us(n){return function(){var i=arguments;switch(i.length){case 0:return new n;case 1:return new n(i[0]);case 2:return new n(i[0],i[1]);case 3:return new n(i[0],i[1],i[2]);case 4:return new n(i[0],i[1],i[2],i[3]);case 5:return new n(i[0],i[1],i[2],i[3],i[4]);case 6:return new n(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new n(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var a=ho(n.prototype),c=n.apply(a,i);return mt(c)?c:a}}function tE(n,i,a){var c=us(n);function y(){for(var L=arguments.length,k=fe(L),z=L,ee=bo(y);z--;)k[z]=arguments[z];var ge=L<3&&k[0]!==ee&&k[L-1]!==ee?[]:ui(k,ee);if(L-=ge.length,L<a)return Hh(n,i,Na,y.placeholder,r,k,ge,r,r,a-L);var pe=this&&this!==De&&this instanceof y?c:n;return wr(pe,this,k)}return y}function jh(n){return function(i,a,c){var y=ft(i);if(!dr(i)){var L=$e(a,3);i=jt(i),a=function(z){return L(y[z],z,y)}}var k=n(i,a,c);return k>-1?y[L?i[k]:k]:r}}function Uh(n){return kn(function(i){var a=i.length,c=a,y=Nr.prototype.thru;for(n&&i.reverse();c--;){var L=i[c];if(typeof L!="function")throw new Br(f);if(y&&!k&&Da(L)=="wrapper")var k=new Nr([],!0)}for(c=k?c:a;++c<a;){L=i[c];var z=Da(L),ee=z=="wrapper"?tl(L):r;ee&&ol(ee[0])&&ee[1]==(ce|S|j|ue)&&!ee[4].length&&ee[9]==1?k=k[Da(ee[0])].apply(k,ee[3]):k=L.length==1&&ol(L)?k[z]():k.thru(L)}return function(){var ge=arguments,pe=ge[0];if(k&&ge.length==1&&Fe(pe))return k.plant(pe).value();for(var we=0,Ae=a?i[we].apply(this,ge):pe;++we<a;)Ae=i[we].call(this,Ae);return Ae}})}function Na(n,i,a,c,y,L,k,z,ee,ge){var pe=i&ce,we=i&C,Ae=i&B,Pe=i&(S|m),Me=i&te,qe=Ae?r:us(n);function xe(){for(var ze=arguments.length,Xe=fe(ze),Sr=ze;Sr--;)Xe[Sr]=arguments[Sr];if(Pe)var sr=bo(xe),Rr=hw(Xe,sr);if(c&&(Xe=Nh(Xe,c,y,Pe)),L&&(Xe=$h(Xe,L,k,Pe)),ze-=Rr,Pe&&ze<ge){var It=ui(Xe,sr);return Hh(n,i,Na,xe.placeholder,a,Xe,It,z,ee,ge-ze)}var en=we?a:this,qn=Ae?en[n]:n;return ze=Xe.length,z?Xe=EE(Xe,z):Me&&ze>1&&Xe.reverse(),pe&&ee<ze&&(Xe.length=ee),this&&this!==De&&this instanceof xe&&(qn=qe||us(qn)),qn.apply(en,Xe)}return xe}function kh(n,i){return function(a,c){return Cm(a,n,i(c),{})}}function $a(n,i){return function(a,c){var y;if(a===r&&c===r)return i;if(a!==r&&(y=a),c!==r){if(y===r)return c;typeof a=="string"||typeof c=="string"?(a=Er(a),c=Er(c)):(a=Ah(a),c=Ah(c)),y=n(a,c)}return y}}function Xf(n){return kn(function(i){return i=wt(i,mr($e())),Ge(function(a){var c=this;return n(i,function(y){return wr(y,c,a)})})})}function Ma(n,i){i=i===r?" ":Er(i);var a=i.length;if(a<2)return a?qf(i,n):i;var c=qf(i,Ea(n/ao(i)));return so(i)?hi(Xr(c),0,n).join(""):c.slice(0,n)}function rE(n,i,a,c){var y=i&C,L=us(n);function k(){for(var z=-1,ee=arguments.length,ge=-1,pe=c.length,we=fe(pe+ee),Ae=this&&this!==De&&this instanceof k?L:n;++ge<pe;)we[ge]=c[ge];for(;ee--;)we[ge++]=arguments[++z];return wr(Ae,y?a:this,we)}return k}function Fh(n){return function(i,a,c){return c&&typeof c!="number"&&or(i,a,c)&&(a=c=r),i=Wn(i),a===r?(a=i,i=0):a=Wn(a),c=c===r?i<a?1:-1:Wn(c),Fm(i,a,c,n)}}function xa(n){return function(i,a){return typeof i=="string"&&typeof a=="string"||(i=Dr(i),a=Dr(a)),n(i,a)}}function Hh(n,i,a,c,y,L,k,z,ee,ge){var pe=i&S,we=pe?k:r,Ae=pe?r:k,Pe=pe?L:r,Me=pe?r:L;i|=pe?j:Q,i&=~(pe?Q:j),i&P||(i&=-4);var qe=[n,i,y,Pe,we,Me,Ae,z,ee,ge],xe=a.apply(r,qe);return ol(n)&&eg(xe,qe),xe.placeholder=c,tg(xe,n,i)}function Zf(n){var i=$t[n];return function(a,c){if(a=Dr(a),c=c==null?0:Kt(We(c),292),c&&th(a)){var y=(rt(a)+"e").split("e"),L=i(y[0]+"e"+(+y[1]+c));return y=(rt(L)+"e").split("e"),+(y[0]+"e"+(+y[1]-c))}return i(a)}}var nE=lo&&1/ca(new lo([,-0]))[1]==V?function(n){return new lo(n)}:ml;function Wh(n){return function(i){var a=Jt(i);return a==E?Of(i):a==Ue?mw(i):dw(i,n(i))}}function Un(n,i,a,c,y,L,k,z){var ee=i&B;if(!ee&&typeof n!="function")throw new Br(f);var ge=c?c.length:0;if(ge||(i&=-97,c=y=r),k=k===r?k:Mt(We(k),0),z=z===r?z:We(z),ge-=y?y.length:0,i&Q){var pe=c,we=y;c=y=r}var Ae=ee?r:tl(n),Pe=[n,i,a,c,y,pe,we,L,k,z];if(Ae&&yE(Pe,Ae),n=Pe[0],i=Pe[1],a=Pe[2],c=Pe[3],y=Pe[4],z=Pe[9]=Pe[9]===r?ee?0:n.length:Mt(Pe[9]-ge,0),!z&&i&(S|m)&&(i&=-25),!i||i==C)var Me=eE(n,i,a);else i==S||i==m?Me=tE(n,i,z):(i==j||i==(C|j))&&!y.length?Me=rE(n,i,a,c):Me=Na.apply(r,Pe);var qe=Ae?Sh:eg;return tg(qe(Me,Pe),n,i)}function qh(n,i,a,c){return n===r||Qr(n,fo[a])&&!it.call(c,a)?i:n}function Gh(n,i,a,c,y,L){return mt(n)&&mt(i)&&(L.set(i,n),Ca(n,i,r,Gh,L),L.delete(i)),n}function iE(n){return cs(n)?r:n}function Vh(n,i,a,c,y,L){var k=a&x,z=n.length,ee=i.length;if(z!=ee&&!(k&&ee>z))return!1;var ge=L.get(n),pe=L.get(i);if(ge&&pe)return ge==i&&pe==n;var we=-1,Ae=!0,Pe=a&v?new Ni:r;for(L.set(n,i),L.set(i,n);++we<z;){var Me=n[we],qe=i[we];if(c)var xe=k?c(qe,Me,we,i,n,L):c(Me,qe,we,n,i,L);if(xe!==r){if(xe)continue;Ae=!1;break}if(Pe){if(!vf(i,function(ze,Xe){if(!Xo(Pe,Xe)&&(Me===ze||y(Me,ze,a,c,L)))return Pe.push(Xe)})){Ae=!1;break}}else if(!(Me===qe||y(Me,qe,a,c,L))){Ae=!1;break}}return L.delete(n),L.delete(i),Ae}function oE(n,i,a,c,y,L,k){switch(a){case Ve:if(n.byteLength!=i.byteLength||n.byteOffset!=i.byteOffset)return!1;n=n.buffer,i=i.buffer;case Ye:return!(n.byteLength!=i.byteLength||!L(new _a(n),new _a(i)));case q:case oe:case J:return Qr(+n,+i);case d:return n.name==i.name&&n.message==i.message;case Ce:case Re:return n==i+"";case E:var z=Of;case Ue:var ee=c&x;if(z||(z=ca),n.size!=i.size&&!ee)return!1;var ge=k.get(n);if(ge)return ge==i;c|=v,k.set(n,i);var pe=Vh(z(n),z(i),c,y,L,k);return k.delete(n),pe;case He:if(rs)return rs.call(n)==rs.call(i)}return!1}function sE(n,i,a,c,y,L){var k=a&x,z=Qf(n),ee=z.length,ge=Qf(i),pe=ge.length;if(ee!=pe&&!k)return!1;for(var we=ee;we--;){var Ae=z[we];if(!(k?Ae in i:it.call(i,Ae)))return!1}var Pe=L.get(n),Me=L.get(i);if(Pe&&Me)return Pe==i&&Me==n;var qe=!0;L.set(n,i),L.set(i,n);for(var xe=k;++we<ee;){Ae=z[we];var ze=n[Ae],Xe=i[Ae];if(c)var Sr=k?c(Xe,ze,Ae,i,n,L):c(ze,Xe,Ae,n,i,L);if(!(Sr===r?ze===Xe||y(ze,Xe,a,c,L):Sr)){qe=!1;break}xe||(xe=Ae=="constructor")}if(qe&&!xe){var sr=n.constructor,Rr=i.constructor;sr!=Rr&&"constructor"in n&&"constructor"in i&&!(typeof sr=="function"&&sr instanceof sr&&typeof Rr=="function"&&Rr instanceof Rr)&&(qe=!1)}return L.delete(n),L.delete(i),qe}function kn(n){return al(Zh(n,r,ag),n+"")}function Qf(n){return dh(n,jt,nl)}function el(n){return dh(n,hr,zh)}var tl=Sa?function(n){return Sa.get(n)}:ml;function Da(n){for(var i=n.name+"",a=co[i],c=it.call(co,i)?a.length:0;c--;){var y=a[c],L=y.func;if(L==null||L==n)return y.name}return i}function bo(n){var i=it.call(T,"placeholder")?T:n;return i.placeholder}function $e(){var n=T.iteratee||yl;return n=n===yl?ph:n,arguments.length?n(arguments[0],arguments[1]):n}function ja(n,i){var a=n.__data__;return gE(i)?a[typeof i=="string"?"string":"hash"]:a.map}function rl(n){for(var i=jt(n),a=i.length;a--;){var c=i[a],y=n[c];i[a]=[c,y,Yh(y)]}return i}function xi(n,i){var a=_w(n,i);return gh(a)?a:r}function aE(n){var i=it.call(n,Pi),a=n[Pi];try{n[Pi]=r;var c=!0}catch{}var y=pa.call(n);return c&&(i?n[Pi]=a:delete n[Pi]),y}var nl=Lf?function(n){return n==null?[]:(n=ft(n),si(Lf(n),function(i){return Qd.call(n,i)}))}:El,zh=Lf?function(n){for(var i=[];n;)ai(i,nl(n)),n=ya(n);return i}:El,Jt=ir;(Pf&&Jt(new Pf(new ArrayBuffer(1)))!=Ve||Qo&&Jt(new Qo)!=E||Bf&&Jt(Bf.resolve())!=Ie||lo&&Jt(new lo)!=Ue||es&&Jt(new es)!=et)&&(Jt=function(n){var i=ir(n),a=i==se?n.constructor:r,c=a?Di(a):"";if(c)switch(c){case Ww:return Ve;case qw:return E;case Gw:return Ie;case Vw:return Ue;case zw:return et}return i});function uE(n,i,a){for(var c=-1,y=a.length;++c<y;){var L=a[c],k=L.size;switch(L.type){case"drop":n+=k;break;case"dropRight":i-=k;break;case"take":i=Kt(i,n+k);break;case"takeRight":n=Mt(n,i-k);break}}return{start:n,end:i}}function fE(n){var i=n.match(ln);return i?i[1].split(Pn):[]}function Kh(n,i,a){i=di(i,n);for(var c=-1,y=i.length,L=!1;++c<y;){var k=yn(i[c]);if(!(L=n!=null&&a(n,k)))break;n=n[k]}return L||++c!=y?L:(y=n==null?0:n.length,!!y&&Ga(y)&&Fn(k,y)&&(Fe(n)||ji(n)))}function lE(n){var i=n.length,a=new n.constructor(i);return i&&typeof n[0]=="string"&&it.call(n,"index")&&(a.index=n.index,a.input=n.input),a}function Jh(n){return typeof n.constructor=="function"&&!fs(n)?ho(ya(n)):{}}function cE(n,i,a){var c=n.constructor;switch(i){case Ye:return Yf(n);case q:case oe:return new c(+n);case Ve:return Km(n,a);case Dt:case Lt:case at:case Bt:case fr:case er:case kt:case lr:case zr:return Ph(n,a);case E:return new c;case J:case Re:return new c(n);case Ce:return Jm(n);case Ue:return new c;case He:return Ym(n)}}function dE(n,i){var a=i.length;if(!a)return n;var c=a-1;return i[c]=(a>1?"& ":"")+i[c],i=i.join(a>2?", ":" "),n.replace(Pt,`{
10
+ */vu.exports;(function(e,t){(function(){var r,o="4.17.21",s=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",h="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",p=500,b="__lodash_placeholder__",w=1,I=2,A=4,x=1,v=2,C=1,B=2,P=4,S=8,m=16,j=32,Q=64,ce=128,ue=256,te=512,Se=30,me="...",F=800,U=16,$=1,G=2,Y=3,V=1/0,ne=9007199254740991,W=17976931348623157e292,K=NaN,ae=4294967295,de=ae-1,re=ae>>>1,_e=[["ary",ce],["bind",C],["bindKey",B],["curry",S],["curryRight",m],["flip",te],["partial",j],["partialRight",Q],["rearg",ue]],be="[object Arguments]",R="[object Array]",O="[object AsyncFunction]",q="[object Boolean]",oe="[object Date]",ye="[object DOMException]",d="[object Error]",g="[object Function]",_="[object GeneratorFunction]",E="[object Map]",J="[object Number]",ie="[object Null]",se="[object Object]",Ie="[object Promise]",Be="[object Proxy]",Ce="[object RegExp]",Ue="[object Set]",Re="[object String]",He="[object Symbol]",bt="[object Undefined]",et="[object WeakMap]",_t="[object WeakSet]",Ye="[object ArrayBuffer]",Ve="[object DataView]",Dt="[object Float32Array]",Lt="[object Float64Array]",at="[object Int8Array]",Bt="[object Int16Array]",fr="[object Int32Array]",er="[object Uint8Array]",kt="[object Uint8ClampedArray]",lr="[object Uint16Array]",zr="[object Uint32Array]",Kr=/\b__p \+= '';/g,sn=/\b(__p \+=) '' \+/g,an=/(__e\(.*?\)|\b__t\)) \+\n'';/g,tr=/&(?:amp|lt|gt|quot|#39);/g,Or=/[&<>"']/g,rr=RegExp(tr.source),Ln=RegExp(Or.source),Jr=/<%-([\s\S]+?)%>/g,un=/<%([\s\S]+?)%>/g,N=/<%=([\s\S]+?)%>/g,D=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ee=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Te=/[\\^$.*+?()[\]{}|]/g,yt=RegExp(Te.source),St=/^\s+/,fn=/\s/,Pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ln=/\{\n\/\* \[wrapped with (.+)\] \*/,Pn=/,? & /,cn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dn=/[()=,{}\[\]\/\s]/,Yr=/\\(\\)?/g,Gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cr=/\w*$/,yr=/^[-+]0x[0-9a-f]+$/i,nr=/^0b[01]+$/i,Ft=/^\[object .+?Constructor\]$/,Ti=/^0o[0-7]+$/i,Ii=/^(?:0|[1-9]\d*)$/,Bn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hn=/($^)/,gn=/['\n\r\u2028\u2029\\]/g,Lr="\\ud800-\\udfff",Oi="\\u0300-\\u036f",pn="\\ufe20-\\ufe2f",ti="\\u20d0-\\u20ff",ri=Oi+pn+ti,ni="\\u2700-\\u27bf",ii="a-z\\xdf-\\xf6\\xf8-\\xff",Gs="\\xac\\xb1\\xd7\\xf7",cf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",df="\\u2000-\\u206f",hf=" \\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",Vs="A-Z\\xc0-\\xd6\\xd8-\\xde",zs="\\ufe0e\\ufe0f",Ks=Gs+cf+df+hf,Ho="['’]",gf="["+Lr+"]",Js="["+Ks+"]",to="["+ri+"]",Ci="\\d+",Wo="["+ni+"]",Ys="["+ii+"]",Xs="[^"+Lr+Ks+Ci+ni+ii+Vs+"]",ro="\\ud83c[\\udffb-\\udfff]",pf="(?:"+to+"|"+ro+")",Zs="[^"+Lr+"]",qo="(?:\\ud83c[\\udde6-\\uddff]){2}",no="[\\ud800-\\udbff][\\udc00-\\udfff]",oi="["+Vs+"]",Qs="\\u200d",ea="(?:"+Ys+"|"+Xs+")",Go="(?:"+oi+"|"+Xs+")",ta="(?:"+Ho+"(?:d|ll|m|re|s|t|ve))?",ra="(?:"+Ho+"(?:D|LL|M|RE|S|T|VE))?",na=pf+"?",Li="["+zs+"]?",Vo="(?:"+Qs+"(?:"+[Zs,qo,no].join("|")+")"+Li+na+")*",zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ko="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ia=Li+na+Vo,oa="(?:"+[Wo,qo,no].join("|")+")"+ia,Jo="(?:"+[Zs+to+"?",to,qo,no,gf].join("|")+")",sa=RegExp(Ho,"g"),Nn=RegExp(to,"g"),$n=RegExp(ro+"(?="+ro+")|"+Jo+ia,"g"),bf=RegExp([oi+"?"+Ys+"+"+ta+"(?="+[Js,oi,"$"].join("|")+")",Go+"+"+ra+"(?="+[Js,oi+ea,"$"].join("|")+")",oi+"?"+ea+"+"+ta,oi+"+"+ra,Ko,zo,Ci,oa].join("|"),"g"),aa=RegExp("["+Qs+Lr+ri+zs+"]"),_f=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ua=["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"],yf=-1,ut={};ut[Dt]=ut[Lt]=ut[at]=ut[Bt]=ut[fr]=ut[er]=ut[kt]=ut[lr]=ut[zr]=!0,ut[be]=ut[R]=ut[Ye]=ut[q]=ut[Ve]=ut[oe]=ut[d]=ut[g]=ut[E]=ut[J]=ut[se]=ut[Ce]=ut[Ue]=ut[Re]=ut[et]=!1;var nt={};nt[be]=nt[R]=nt[Ye]=nt[Ve]=nt[q]=nt[oe]=nt[Dt]=nt[Lt]=nt[at]=nt[Bt]=nt[fr]=nt[E]=nt[J]=nt[se]=nt[Ce]=nt[Ue]=nt[Re]=nt[He]=nt[er]=nt[kt]=nt[lr]=nt[zr]=!0,nt[d]=nt[g]=nt[et]=!1;var wf={À:"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"},M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},X={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},le={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Le=parseFloat,Ke=parseInt,tt=typeof H.commonjsGlobal=="object"&&H.commonjsGlobal&&H.commonjsGlobal.Object===Object&&H.commonjsGlobal,ct=typeof self=="object"&&self&&self.Object===Object&&self,De=tt||ct||Function("return this")(),st=t&&!t.nodeType&&t,Nt=st&&!0&&e&&!e.nodeType&&e,Vt=Nt&&Nt.exports===st,Mn=Vt&&tt.process,zt=function(){try{var Z=Nt&&Nt.require&&Nt.require("util").types;return Z||Mn&&Mn.binding&&Mn.binding("util")}catch{}}(),io=zt&&zt.isArrayBuffer,Yo=zt&&zt.isDate,Md=zt&&zt.isMap,xd=zt&&zt.isRegExp,Dd=zt&&zt.isSet,jd=zt&&zt.isTypedArray;function wr(Z,he,fe){switch(fe.length){case 0:return Z.call(he);case 1:return Z.call(he,fe[0]);case 2:return Z.call(he,fe[0],fe[1]);case 3:return Z.call(he,fe[0],fe[1],fe[2])}return Z.apply(he,fe)}function nw(Z,he,fe,Oe){for(var ke=-1,Qe=Z==null?0:Z.length;++ke<Qe;){var $t=Z[ke];he(Oe,$t,fe($t),Z)}return Oe}function Pr(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length;++fe<Oe&&he(Z[fe],fe,Z)!==!1;);return Z}function iw(Z,he){for(var fe=Z==null?0:Z.length;fe--&&he(Z[fe],fe,Z)!==!1;);return Z}function Ud(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length;++fe<Oe;)if(!he(Z[fe],fe,Z))return!1;return!0}function si(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length,ke=0,Qe=[];++fe<Oe;){var $t=Z[fe];he($t,fe,Z)&&(Qe[ke++]=$t)}return Qe}function fa(Z,he){var fe=Z==null?0:Z.length;return!!fe&&oo(Z,he,0)>-1}function mf(Z,he,fe){for(var Oe=-1,ke=Z==null?0:Z.length;++Oe<ke;)if(fe(he,Z[Oe]))return!0;return!1}function wt(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length,ke=Array(Oe);++fe<Oe;)ke[fe]=he(Z[fe],fe,Z);return ke}function ai(Z,he){for(var fe=-1,Oe=he.length,ke=Z.length;++fe<Oe;)Z[ke+fe]=he[fe];return Z}function Ef(Z,he,fe,Oe){var ke=-1,Qe=Z==null?0:Z.length;for(Oe&&Qe&&(fe=Z[++ke]);++ke<Qe;)fe=he(fe,Z[ke],ke,Z);return fe}function ow(Z,he,fe,Oe){var ke=Z==null?0:Z.length;for(Oe&&ke&&(fe=Z[--ke]);ke--;)fe=he(fe,Z[ke],ke,Z);return fe}function vf(Z,he){for(var fe=-1,Oe=Z==null?0:Z.length;++fe<Oe;)if(he(Z[fe],fe,Z))return!0;return!1}var sw=Sf("length");function aw(Z){return Z.split("")}function uw(Z){return Z.match(cn)||[]}function kd(Z,he,fe){var Oe;return fe(Z,function(ke,Qe,$t){if(he(ke,Qe,$t))return Oe=Qe,!1}),Oe}function la(Z,he,fe,Oe){for(var ke=Z.length,Qe=fe+(Oe?1:-1);Oe?Qe--:++Qe<ke;)if(he(Z[Qe],Qe,Z))return Qe;return-1}function oo(Z,he,fe){return he===he?mw(Z,he,fe):la(Z,Fd,fe)}function fw(Z,he,fe,Oe){for(var ke=fe-1,Qe=Z.length;++ke<Qe;)if(Oe(Z[ke],he))return ke;return-1}function Fd(Z){return Z!==Z}function Hd(Z,he){var fe=Z==null?0:Z.length;return fe?Af(Z,he)/fe:K}function Sf(Z){return function(he){return he==null?r:he[Z]}}function Rf(Z){return function(he){return Z==null?r:Z[he]}}function Wd(Z,he,fe,Oe,ke){return ke(Z,function(Qe,$t,ft){fe=Oe?(Oe=!1,Qe):he(fe,Qe,$t,ft)}),fe}function lw(Z,he){var fe=Z.length;for(Z.sort(he);fe--;)Z[fe]=Z[fe].value;return Z}function Af(Z,he){for(var fe,Oe=-1,ke=Z.length;++Oe<ke;){var Qe=he(Z[Oe]);Qe!==r&&(fe=fe===r?Qe:fe+Qe)}return fe}function Tf(Z,he){for(var fe=-1,Oe=Array(Z);++fe<Z;)Oe[fe]=he(fe);return Oe}function cw(Z,he){return wt(he,function(fe){return[fe,Z[fe]]})}function qd(Z){return Z&&Z.slice(0,Kd(Z)+1).replace(St,"")}function mr(Z){return function(he){return Z(he)}}function If(Z,he){return wt(he,function(fe){return Z[fe]})}function Xo(Z,he){return Z.has(he)}function Gd(Z,he){for(var fe=-1,Oe=Z.length;++fe<Oe&&oo(he,Z[fe],0)>-1;);return fe}function Vd(Z,he){for(var fe=Z.length;fe--&&oo(he,Z[fe],0)>-1;);return fe}function dw(Z,he){for(var fe=Z.length,Oe=0;fe--;)Z[fe]===he&&++Oe;return Oe}var hw=Rf(wf),gw=Rf(M);function pw(Z){return"\\"+le[Z]}function bw(Z,he){return Z==null?r:Z[he]}function so(Z){return aa.test(Z)}function _w(Z){return _f.test(Z)}function yw(Z){for(var he,fe=[];!(he=Z.next()).done;)fe.push(he.value);return fe}function Of(Z){var he=-1,fe=Array(Z.size);return Z.forEach(function(Oe,ke){fe[++he]=[ke,Oe]}),fe}function zd(Z,he){return function(fe){return Z(he(fe))}}function ui(Z,he){for(var fe=-1,Oe=Z.length,ke=0,Qe=[];++fe<Oe;){var $t=Z[fe];($t===he||$t===b)&&(Z[fe]=b,Qe[ke++]=fe)}return Qe}function ca(Z){var he=-1,fe=Array(Z.size);return Z.forEach(function(Oe){fe[++he]=Oe}),fe}function ww(Z){var he=-1,fe=Array(Z.size);return Z.forEach(function(Oe){fe[++he]=[Oe,Oe]}),fe}function mw(Z,he,fe){for(var Oe=fe-1,ke=Z.length;++Oe<ke;)if(Z[Oe]===he)return Oe;return-1}function Ew(Z,he,fe){for(var Oe=fe+1;Oe--;)if(Z[Oe]===he)return Oe;return Oe}function ao(Z){return so(Z)?Sw(Z):sw(Z)}function Xr(Z){return so(Z)?Rw(Z):aw(Z)}function Kd(Z){for(var he=Z.length;he--&&fn.test(Z.charAt(he)););return he}var vw=Rf(X);function Sw(Z){for(var he=$n.lastIndex=0;$n.test(Z);)++he;return he}function Rw(Z){return Z.match($n)||[]}function Aw(Z){return Z.match(bf)||[]}var Tw=function Z(he){he=he==null?De:uo.defaults(De.Object(),he,uo.pick(De,ua));var fe=he.Array,Oe=he.Date,ke=he.Error,Qe=he.Function,$t=he.Math,ft=he.Object,Cf=he.RegExp,Iw=he.String,Br=he.TypeError,da=fe.prototype,Ow=Qe.prototype,fo=ft.prototype,ha=he["__core-js_shared__"],ga=Ow.toString,it=fo.hasOwnProperty,Cw=0,Jd=function(){var n=/[^.]+$/.exec(ha&&ha.keys&&ha.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),pa=fo.toString,Lw=ga.call(ft),Pw=De._,Bw=Cf("^"+ga.call(it).replace(Te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ba=Vt?he.Buffer:r,fi=he.Symbol,_a=he.Uint8Array,Yd=ba?ba.allocUnsafe:r,ya=zd(ft.getPrototypeOf,ft),Xd=ft.create,Zd=fo.propertyIsEnumerable,wa=da.splice,Qd=fi?fi.isConcatSpreadable:r,Zo=fi?fi.iterator:r,Pi=fi?fi.toStringTag:r,ma=function(){try{var n=xi(ft,"defineProperty");return n({},"",{}),n}catch{}}(),Nw=he.clearTimeout!==De.clearTimeout&&he.clearTimeout,$w=Oe&&Oe.now!==De.Date.now&&Oe.now,Mw=he.setTimeout!==De.setTimeout&&he.setTimeout,Ea=$t.ceil,va=$t.floor,Lf=ft.getOwnPropertySymbols,xw=ba?ba.isBuffer:r,eh=he.isFinite,Dw=da.join,jw=zd(ft.keys,ft),Mt=$t.max,Kt=$t.min,Uw=Oe.now,kw=he.parseInt,th=$t.random,Fw=da.reverse,Pf=xi(he,"DataView"),Qo=xi(he,"Map"),Bf=xi(he,"Promise"),lo=xi(he,"Set"),es=xi(he,"WeakMap"),ts=xi(ft,"create"),Sa=es&&new es,co={},Hw=Di(Pf),Ww=Di(Qo),qw=Di(Bf),Gw=Di(lo),Vw=Di(es),Ra=fi?fi.prototype:r,rs=Ra?Ra.valueOf:r,rh=Ra?Ra.toString:r;function T(n){if(Rt(n)&&!Fe(n)&&!(n instanceof Je)){if(n instanceof Nr)return n;if(it.call(n,"__wrapped__"))return ng(n)}return new Nr(n)}var ho=function(){function n(){}return function(i){if(!mt(i))return{};if(Xd)return Xd(i);n.prototype=i;var a=new n;return n.prototype=r,a}}();function Aa(){}function Nr(n,i){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=r}T.templateSettings={escape:Jr,evaluate:un,interpolate:N,variable:"",imports:{_:T}},T.prototype=Aa.prototype,T.prototype.constructor=T,Nr.prototype=ho(Aa.prototype),Nr.prototype.constructor=Nr;function Je(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function zw(){var n=new Je(this.__wrapped__);return n.__actions__=cr(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=cr(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=cr(this.__views__),n}function Kw(){if(this.__filtered__){var n=new Je(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Jw(){var n=this.__wrapped__.value(),i=this.__dir__,a=Fe(n),c=i<0,y=a?n.length:0,L=aE(0,y,this.__views__),k=L.start,z=L.end,ee=z-k,ge=c?z:k-1,pe=this.__iteratees__,we=pe.length,Ae=0,Pe=Kt(ee,this.__takeCount__);if(!a||!c&&y==ee&&Pe==ee)return Th(n,this.__actions__);var Me=[];e:for(;ee--&&Ae<Pe;){ge+=i;for(var qe=-1,xe=n[ge];++qe<we;){var ze=pe[qe],Xe=ze.iteratee,Sr=ze.type,sr=Xe(xe);if(Sr==G)xe=sr;else if(!sr){if(Sr==$)continue e;break e}}Me[Ae++]=xe}return Me}Je.prototype=ho(Aa.prototype),Je.prototype.constructor=Je;function Bi(n){var i=-1,a=n==null?0:n.length;for(this.clear();++i<a;){var c=n[i];this.set(c[0],c[1])}}function Yw(){this.__data__=ts?ts(null):{},this.size=0}function Xw(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}function Zw(n){var i=this.__data__;if(ts){var a=i[n];return a===l?r:a}return it.call(i,n)?i[n]:r}function Qw(n){var i=this.__data__;return ts?i[n]!==r:it.call(i,n)}function em(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=ts&&i===r?l:i,this}Bi.prototype.clear=Yw,Bi.prototype.delete=Xw,Bi.prototype.get=Zw,Bi.prototype.has=Qw,Bi.prototype.set=em;function xn(n){var i=-1,a=n==null?0:n.length;for(this.clear();++i<a;){var c=n[i];this.set(c[0],c[1])}}function tm(){this.__data__=[],this.size=0}function rm(n){var i=this.__data__,a=Ta(i,n);if(a<0)return!1;var c=i.length-1;return a==c?i.pop():wa.call(i,a,1),--this.size,!0}function nm(n){var i=this.__data__,a=Ta(i,n);return a<0?r:i[a][1]}function im(n){return Ta(this.__data__,n)>-1}function om(n,i){var a=this.__data__,c=Ta(a,n);return c<0?(++this.size,a.push([n,i])):a[c][1]=i,this}xn.prototype.clear=tm,xn.prototype.delete=rm,xn.prototype.get=nm,xn.prototype.has=im,xn.prototype.set=om;function Dn(n){var i=-1,a=n==null?0:n.length;for(this.clear();++i<a;){var c=n[i];this.set(c[0],c[1])}}function sm(){this.size=0,this.__data__={hash:new Bi,map:new(Qo||xn),string:new Bi}}function am(n){var i=ja(this,n).delete(n);return this.size-=i?1:0,i}function um(n){return ja(this,n).get(n)}function fm(n){return ja(this,n).has(n)}function lm(n,i){var a=ja(this,n),c=a.size;return a.set(n,i),this.size+=a.size==c?0:1,this}Dn.prototype.clear=sm,Dn.prototype.delete=am,Dn.prototype.get=um,Dn.prototype.has=fm,Dn.prototype.set=lm;function Ni(n){var i=-1,a=n==null?0:n.length;for(this.__data__=new Dn;++i<a;)this.add(n[i])}function cm(n){return this.__data__.set(n,l),this}function dm(n){return this.__data__.has(n)}Ni.prototype.add=Ni.prototype.push=cm,Ni.prototype.has=dm;function Zr(n){var i=this.__data__=new xn(n);this.size=i.size}function hm(){this.__data__=new xn,this.size=0}function gm(n){var i=this.__data__,a=i.delete(n);return this.size=i.size,a}function pm(n){return this.__data__.get(n)}function bm(n){return this.__data__.has(n)}function _m(n,i){var a=this.__data__;if(a instanceof xn){var c=a.__data__;if(!Qo||c.length<s-1)return c.push([n,i]),this.size=++a.size,this;a=this.__data__=new Dn(c)}return a.set(n,i),this.size=a.size,this}Zr.prototype.clear=hm,Zr.prototype.delete=gm,Zr.prototype.get=pm,Zr.prototype.has=bm,Zr.prototype.set=_m;function nh(n,i){var a=Fe(n),c=!a&&ji(n),y=!a&&!c&&gi(n),L=!a&&!c&&!y&&_o(n),k=a||c||y||L,z=k?Tf(n.length,Iw):[],ee=z.length;for(var ge in n)(i||it.call(n,ge))&&!(k&&(ge=="length"||y&&(ge=="offset"||ge=="parent")||L&&(ge=="buffer"||ge=="byteLength"||ge=="byteOffset")||Fn(ge,ee)))&&z.push(ge);return z}function ih(n){var i=n.length;return i?n[Wf(0,i-1)]:r}function ym(n,i){return Ua(cr(n),$i(i,0,n.length))}function wm(n){return Ua(cr(n))}function Nf(n,i,a){(a!==r&&!Qr(n[i],a)||a===r&&!(i in n))&&jn(n,i,a)}function ns(n,i,a){var c=n[i];(!(it.call(n,i)&&Qr(c,a))||a===r&&!(i in n))&&jn(n,i,a)}function Ta(n,i){for(var a=n.length;a--;)if(Qr(n[a][0],i))return a;return-1}function mm(n,i,a,c){return li(n,function(y,L,k){i(c,y,a(y),k)}),c}function oh(n,i){return n&&_n(i,jt(i),n)}function Em(n,i){return n&&_n(i,hr(i),n)}function jn(n,i,a){i=="__proto__"&&ma?ma(n,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[i]=a}function $f(n,i){for(var a=-1,c=i.length,y=fe(c),L=n==null;++a<c;)y[a]=L?r:gl(n,i[a]);return y}function $i(n,i,a){return n===n&&(a!==r&&(n=n<=a?n:a),i!==r&&(n=n>=i?n:i)),n}function $r(n,i,a,c,y,L){var k,z=i&w,ee=i&I,ge=i&A;if(a&&(k=y?a(n,c,y,L):a(n)),k!==r)return k;if(!mt(n))return n;var pe=Fe(n);if(pe){if(k=fE(n),!z)return cr(n,k)}else{var we=Jt(n),Ae=we==g||we==_;if(gi(n))return Ch(n,z);if(we==se||we==be||Ae&&!y){if(k=ee||Ae?{}:Kh(n),!z)return ee?Zm(n,Em(k,n)):Xm(n,oh(k,n))}else{if(!nt[we])return y?n:{};k=lE(n,we,z)}}L||(L=new Zr);var Pe=L.get(n);if(Pe)return Pe;L.set(n,k),Sg(n)?n.forEach(function(xe){k.add($r(xe,i,a,xe,n,L))}):Eg(n)&&n.forEach(function(xe,ze){k.set(ze,$r(xe,i,a,ze,n,L))});var Me=ge?ee?el:Qf:ee?hr:jt,qe=pe?r:Me(n);return Pr(qe||n,function(xe,ze){qe&&(ze=xe,xe=n[ze]),ns(k,ze,$r(xe,i,a,ze,n,L))}),k}function vm(n){var i=jt(n);return function(a){return sh(a,n,i)}}function sh(n,i,a){var c=a.length;if(n==null)return!c;for(n=ft(n);c--;){var y=a[c],L=i[y],k=n[y];if(k===r&&!(y in n)||!L(k))return!1}return!0}function ah(n,i,a){if(typeof n!="function")throw new Br(f);return ls(function(){n.apply(r,a)},i)}function is(n,i,a,c){var y=-1,L=fa,k=!0,z=n.length,ee=[],ge=i.length;if(!z)return ee;a&&(i=wt(i,mr(a))),c?(L=mf,k=!1):i.length>=s&&(L=Xo,k=!1,i=new Ni(i));e:for(;++y<z;){var pe=n[y],we=a==null?pe:a(pe);if(pe=c||pe!==0?pe:0,k&&we===we){for(var Ae=ge;Ae--;)if(i[Ae]===we)continue e;ee.push(pe)}else L(i,we,c)||ee.push(pe)}return ee}var li=$h(bn),uh=$h(xf,!0);function Sm(n,i){var a=!0;return li(n,function(c,y,L){return a=!!i(c,y,L),a}),a}function Ia(n,i,a){for(var c=-1,y=n.length;++c<y;){var L=n[c],k=i(L);if(k!=null&&(z===r?k===k&&!vr(k):a(k,z)))var z=k,ee=L}return ee}function Rm(n,i,a,c){var y=n.length;for(a=We(a),a<0&&(a=-a>y?0:y+a),c=c===r||c>y?y:We(c),c<0&&(c+=y),c=a>c?0:Ag(c);a<c;)n[a++]=i;return n}function fh(n,i){var a=[];return li(n,function(c,y,L){i(c,y,L)&&a.push(c)}),a}function Ht(n,i,a,c,y){var L=-1,k=n.length;for(a||(a=dE),y||(y=[]);++L<k;){var z=n[L];i>0&&a(z)?i>1?Ht(z,i-1,a,c,y):ai(y,z):c||(y[y.length]=z)}return y}var Mf=Mh(),lh=Mh(!0);function bn(n,i){return n&&Mf(n,i,jt)}function xf(n,i){return n&&lh(n,i,jt)}function Oa(n,i){return si(i,function(a){return Hn(n[a])})}function Mi(n,i){i=di(i,n);for(var a=0,c=i.length;n!=null&&a<c;)n=n[yn(i[a++])];return a&&a==c?n:r}function ch(n,i,a){var c=i(n);return Fe(n)?c:ai(c,a(n))}function ir(n){return n==null?n===r?bt:ie:Pi&&Pi in ft(n)?sE(n):wE(n)}function Df(n,i){return n>i}function Am(n,i){return n!=null&&it.call(n,i)}function Tm(n,i){return n!=null&&i in ft(n)}function Im(n,i,a){return n>=Kt(i,a)&&n<Mt(i,a)}function jf(n,i,a){for(var c=a?mf:fa,y=n[0].length,L=n.length,k=L,z=fe(L),ee=1/0,ge=[];k--;){var pe=n[k];k&&i&&(pe=wt(pe,mr(i))),ee=Kt(pe.length,ee),z[k]=!a&&(i||y>=120&&pe.length>=120)?new Ni(k&&pe):r}pe=n[0];var we=-1,Ae=z[0];e:for(;++we<y&&ge.length<ee;){var Pe=pe[we],Me=i?i(Pe):Pe;if(Pe=a||Pe!==0?Pe:0,!(Ae?Xo(Ae,Me):c(ge,Me,a))){for(k=L;--k;){var qe=z[k];if(!(qe?Xo(qe,Me):c(n[k],Me,a)))continue e}Ae&&Ae.push(Me),ge.push(Pe)}}return ge}function Om(n,i,a,c){return bn(n,function(y,L,k){i(c,a(y),L,k)}),c}function os(n,i,a){i=di(i,n),n=Zh(n,i);var c=n==null?n:n[yn(xr(i))];return c==null?r:wr(c,n,a)}function dh(n){return Rt(n)&&ir(n)==be}function Cm(n){return Rt(n)&&ir(n)==Ye}function Lm(n){return Rt(n)&&ir(n)==oe}function ss(n,i,a,c,y){return n===i?!0:n==null||i==null||!Rt(n)&&!Rt(i)?n!==n&&i!==i:Pm(n,i,a,c,ss,y)}function Pm(n,i,a,c,y,L){var k=Fe(n),z=Fe(i),ee=k?R:Jt(n),ge=z?R:Jt(i);ee=ee==be?se:ee,ge=ge==be?se:ge;var pe=ee==se,we=ge==se,Ae=ee==ge;if(Ae&&gi(n)){if(!gi(i))return!1;k=!0,pe=!1}if(Ae&&!pe)return L||(L=new Zr),k||_o(n)?Gh(n,i,a,c,y,L):iE(n,i,ee,a,c,y,L);if(!(a&x)){var Pe=pe&&it.call(n,"__wrapped__"),Me=we&&it.call(i,"__wrapped__");if(Pe||Me){var qe=Pe?n.value():n,xe=Me?i.value():i;return L||(L=new Zr),y(qe,xe,a,c,L)}}return Ae?(L||(L=new Zr),oE(n,i,a,c,y,L)):!1}function Bm(n){return Rt(n)&&Jt(n)==E}function Uf(n,i,a,c){var y=a.length,L=y,k=!c;if(n==null)return!L;for(n=ft(n);y--;){var z=a[y];if(k&&z[2]?z[1]!==n[z[0]]:!(z[0]in n))return!1}for(;++y<L;){z=a[y];var ee=z[0],ge=n[ee],pe=z[1];if(k&&z[2]){if(ge===r&&!(ee in n))return!1}else{var we=new Zr;if(c)var Ae=c(ge,pe,ee,n,i,we);if(!(Ae===r?ss(pe,ge,x|v,c,we):Ae))return!1}}return!0}function hh(n){if(!mt(n)||gE(n))return!1;var i=Hn(n)?Bw:Ft;return i.test(Di(n))}function Nm(n){return Rt(n)&&ir(n)==Ce}function $m(n){return Rt(n)&&Jt(n)==Ue}function Mm(n){return Rt(n)&&Ga(n.length)&&!!ut[ir(n)]}function gh(n){return typeof n=="function"?n:n==null?gr:typeof n=="object"?Fe(n)?_h(n[0],n[1]):bh(n):xg(n)}function kf(n){if(!fs(n))return jw(n);var i=[];for(var a in ft(n))it.call(n,a)&&a!="constructor"&&i.push(a);return i}function xm(n){if(!mt(n))return yE(n);var i=fs(n),a=[];for(var c in n)c=="constructor"&&(i||!it.call(n,c))||a.push(c);return a}function Ff(n,i){return n<i}function ph(n,i){var a=-1,c=dr(n)?fe(n.length):[];return li(n,function(y,L,k){c[++a]=i(y,L,k)}),c}function bh(n){var i=rl(n);return i.length==1&&i[0][2]?Yh(i[0][0],i[0][1]):function(a){return a===n||Uf(a,n,i)}}function _h(n,i){return il(n)&&Jh(i)?Yh(yn(n),i):function(a){var c=gl(a,n);return c===r&&c===i?pl(a,n):ss(i,c,x|v)}}function Ca(n,i,a,c,y){n!==i&&Mf(i,function(L,k){if(y||(y=new Zr),mt(L))Dm(n,i,k,a,Ca,c,y);else{var z=c?c(sl(n,k),L,k+"",n,i,y):r;z===r&&(z=L),Nf(n,k,z)}},hr)}function Dm(n,i,a,c,y,L,k){var z=sl(n,a),ee=sl(i,a),ge=k.get(ee);if(ge){Nf(n,a,ge);return}var pe=L?L(z,ee,a+"",n,i,k):r,we=pe===r;if(we){var Ae=Fe(ee),Pe=!Ae&&gi(ee),Me=!Ae&&!Pe&&_o(ee);pe=ee,Ae||Pe||Me?Fe(z)?pe=z:Tt(z)?pe=cr(z):Pe?(we=!1,pe=Ch(ee,!0)):Me?(we=!1,pe=Lh(ee,!0)):pe=[]:cs(ee)||ji(ee)?(pe=z,ji(z)?pe=Tg(z):(!mt(z)||Hn(z))&&(pe=Kh(ee))):we=!1}we&&(k.set(ee,pe),y(pe,ee,c,L,k),k.delete(ee)),Nf(n,a,pe)}function yh(n,i){var a=n.length;if(a)return i+=i<0?a:0,Fn(i,a)?n[i]:r}function wh(n,i,a){i.length?i=wt(i,function(L){return Fe(L)?function(k){return Mi(k,L.length===1?L[0]:L)}:L}):i=[gr];var c=-1;i=wt(i,mr($e()));var y=ph(n,function(L,k,z){var ee=wt(i,function(ge){return ge(L)});return{criteria:ee,index:++c,value:L}});return lw(y,function(L,k){return Ym(L,k,a)})}function jm(n,i){return mh(n,i,function(a,c){return pl(n,c)})}function mh(n,i,a){for(var c=-1,y=i.length,L={};++c<y;){var k=i[c],z=Mi(n,k);a(z,k)&&as(L,di(k,n),z)}return L}function Um(n){return function(i){return Mi(i,n)}}function Hf(n,i,a,c){var y=c?fw:oo,L=-1,k=i.length,z=n;for(n===i&&(i=cr(i)),a&&(z=wt(n,mr(a)));++L<k;)for(var ee=0,ge=i[L],pe=a?a(ge):ge;(ee=y(z,pe,ee,c))>-1;)z!==n&&wa.call(z,ee,1),wa.call(n,ee,1);return n}function Eh(n,i){for(var a=n?i.length:0,c=a-1;a--;){var y=i[a];if(a==c||y!==L){var L=y;Fn(y)?wa.call(n,y,1):Vf(n,y)}}return n}function Wf(n,i){return n+va(th()*(i-n+1))}function km(n,i,a,c){for(var y=-1,L=Mt(Ea((i-n)/(a||1)),0),k=fe(L);L--;)k[c?L:++y]=n,n+=a;return k}function qf(n,i){var a="";if(!n||i<1||i>ne)return a;do i%2&&(a+=n),i=va(i/2),i&&(n+=n);while(i);return a}function Ge(n,i){return al(Xh(n,i,gr),n+"")}function Fm(n){return ih(yo(n))}function Hm(n,i){var a=yo(n);return Ua(a,$i(i,0,a.length))}function as(n,i,a,c){if(!mt(n))return n;i=di(i,n);for(var y=-1,L=i.length,k=L-1,z=n;z!=null&&++y<L;){var ee=yn(i[y]),ge=a;if(ee==="__proto__"||ee==="constructor"||ee==="prototype")return n;if(y!=k){var pe=z[ee];ge=c?c(pe,ee,z):r,ge===r&&(ge=mt(pe)?pe:Fn(i[y+1])?[]:{})}ns(z,ee,ge),z=z[ee]}return n}var vh=Sa?function(n,i){return Sa.set(n,i),n}:gr,Wm=ma?function(n,i){return ma(n,"toString",{configurable:!0,enumerable:!1,value:_l(i),writable:!0})}:gr;function qm(n){return Ua(yo(n))}function Mr(n,i,a){var c=-1,y=n.length;i<0&&(i=-i>y?0:y+i),a=a>y?y:a,a<0&&(a+=y),y=i>a?0:a-i>>>0,i>>>=0;for(var L=fe(y);++c<y;)L[c]=n[c+i];return L}function Gm(n,i){var a;return li(n,function(c,y,L){return a=i(c,y,L),!a}),!!a}function La(n,i,a){var c=0,y=n==null?c:n.length;if(typeof i=="number"&&i===i&&y<=re){for(;c<y;){var L=c+y>>>1,k=n[L];k!==null&&!vr(k)&&(a?k<=i:k<i)?c=L+1:y=L}return y}return Gf(n,i,gr,a)}function Gf(n,i,a,c){var y=0,L=n==null?0:n.length;if(L===0)return 0;i=a(i);for(var k=i!==i,z=i===null,ee=vr(i),ge=i===r;y<L;){var pe=va((y+L)/2),we=a(n[pe]),Ae=we!==r,Pe=we===null,Me=we===we,qe=vr(we);if(k)var xe=c||Me;else ge?xe=Me&&(c||Ae):z?xe=Me&&Ae&&(c||!Pe):ee?xe=Me&&Ae&&!Pe&&(c||!qe):Pe||qe?xe=!1:xe=c?we<=i:we<i;xe?y=pe+1:L=pe}return Kt(L,de)}function Sh(n,i){for(var a=-1,c=n.length,y=0,L=[];++a<c;){var k=n[a],z=i?i(k):k;if(!a||!Qr(z,ee)){var ee=z;L[y++]=k===0?0:k}}return L}function Rh(n){return typeof n=="number"?n:vr(n)?K:+n}function Er(n){if(typeof n=="string")return n;if(Fe(n))return wt(n,Er)+"";if(vr(n))return rh?rh.call(n):"";var i=n+"";return i=="0"&&1/n==-1/0?"-0":i}function ci(n,i,a){var c=-1,y=fa,L=n.length,k=!0,z=[],ee=z;if(a)k=!1,y=mf;else if(L>=s){var ge=i?null:rE(n);if(ge)return ca(ge);k=!1,y=Xo,ee=new Ni}else ee=i?[]:z;e:for(;++c<L;){var pe=n[c],we=i?i(pe):pe;if(pe=a||pe!==0?pe:0,k&&we===we){for(var Ae=ee.length;Ae--;)if(ee[Ae]===we)continue e;i&&ee.push(we),z.push(pe)}else y(ee,we,a)||(ee!==z&&ee.push(we),z.push(pe))}return z}function Vf(n,i){return i=di(i,n),n=Zh(n,i),n==null||delete n[yn(xr(i))]}function Ah(n,i,a,c){return as(n,i,a(Mi(n,i)),c)}function Pa(n,i,a,c){for(var y=n.length,L=c?y:-1;(c?L--:++L<y)&&i(n[L],L,n););return a?Mr(n,c?0:L,c?L+1:y):Mr(n,c?L+1:0,c?y:L)}function Th(n,i){var a=n;return a instanceof Je&&(a=a.value()),Ef(i,function(c,y){return y.func.apply(y.thisArg,ai([c],y.args))},a)}function zf(n,i,a){var c=n.length;if(c<2)return c?ci(n[0]):[];for(var y=-1,L=fe(c);++y<c;)for(var k=n[y],z=-1;++z<c;)z!=y&&(L[y]=is(L[y]||k,n[z],i,a));return ci(Ht(L,1),i,a)}function Ih(n,i,a){for(var c=-1,y=n.length,L=i.length,k={};++c<y;){var z=c<L?i[c]:r;a(k,n[c],z)}return k}function Kf(n){return Tt(n)?n:[]}function Jf(n){return typeof n=="function"?n:gr}function di(n,i){return Fe(n)?n:il(n,i)?[n]:rg(rt(n))}var Vm=Ge;function hi(n,i,a){var c=n.length;return a=a===r?c:a,!i&&a>=c?n:Mr(n,i,a)}var Oh=Nw||function(n){return De.clearTimeout(n)};function Ch(n,i){if(i)return n.slice();var a=n.length,c=Yd?Yd(a):new n.constructor(a);return n.copy(c),c}function Yf(n){var i=new n.constructor(n.byteLength);return new _a(i).set(new _a(n)),i}function zm(n,i){var a=i?Yf(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.byteLength)}function Km(n){var i=new n.constructor(n.source,Cr.exec(n));return i.lastIndex=n.lastIndex,i}function Jm(n){return rs?ft(rs.call(n)):{}}function Lh(n,i){var a=i?Yf(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.length)}function Ph(n,i){if(n!==i){var a=n!==r,c=n===null,y=n===n,L=vr(n),k=i!==r,z=i===null,ee=i===i,ge=vr(i);if(!z&&!ge&&!L&&n>i||L&&k&&ee&&!z&&!ge||c&&k&&ee||!a&&ee||!y)return 1;if(!c&&!L&&!ge&&n<i||ge&&a&&y&&!c&&!L||z&&a&&y||!k&&y||!ee)return-1}return 0}function Ym(n,i,a){for(var c=-1,y=n.criteria,L=i.criteria,k=y.length,z=a.length;++c<k;){var ee=Ph(y[c],L[c]);if(ee){if(c>=z)return ee;var ge=a[c];return ee*(ge=="desc"?-1:1)}}return n.index-i.index}function Bh(n,i,a,c){for(var y=-1,L=n.length,k=a.length,z=-1,ee=i.length,ge=Mt(L-k,0),pe=fe(ee+ge),we=!c;++z<ee;)pe[z]=i[z];for(;++y<k;)(we||y<L)&&(pe[a[y]]=n[y]);for(;ge--;)pe[z++]=n[y++];return pe}function Nh(n,i,a,c){for(var y=-1,L=n.length,k=-1,z=a.length,ee=-1,ge=i.length,pe=Mt(L-z,0),we=fe(pe+ge),Ae=!c;++y<pe;)we[y]=n[y];for(var Pe=y;++ee<ge;)we[Pe+ee]=i[ee];for(;++k<z;)(Ae||y<L)&&(we[Pe+a[k]]=n[y++]);return we}function cr(n,i){var a=-1,c=n.length;for(i||(i=fe(c));++a<c;)i[a]=n[a];return i}function _n(n,i,a,c){var y=!a;a||(a={});for(var L=-1,k=i.length;++L<k;){var z=i[L],ee=c?c(a[z],n[z],z,a,n):r;ee===r&&(ee=n[z]),y?jn(a,z,ee):ns(a,z,ee)}return a}function Xm(n,i){return _n(n,nl(n),i)}function Zm(n,i){return _n(n,Vh(n),i)}function Ba(n,i){return function(a,c){var y=Fe(a)?nw:mm,L=i?i():{};return y(a,n,$e(c,2),L)}}function go(n){return Ge(function(i,a){var c=-1,y=a.length,L=y>1?a[y-1]:r,k=y>2?a[2]:r;for(L=n.length>3&&typeof L=="function"?(y--,L):r,k&&or(a[0],a[1],k)&&(L=y<3?r:L,y=1),i=ft(i);++c<y;){var z=a[c];z&&n(i,z,c,L)}return i})}function $h(n,i){return function(a,c){if(a==null)return a;if(!dr(a))return n(a,c);for(var y=a.length,L=i?y:-1,k=ft(a);(i?L--:++L<y)&&c(k[L],L,k)!==!1;);return a}}function Mh(n){return function(i,a,c){for(var y=-1,L=ft(i),k=c(i),z=k.length;z--;){var ee=k[n?z:++y];if(a(L[ee],ee,L)===!1)break}return i}}function Qm(n,i,a){var c=i&C,y=us(n);function L(){var k=this&&this!==De&&this instanceof L?y:n;return k.apply(c?a:this,arguments)}return L}function xh(n){return function(i){i=rt(i);var a=so(i)?Xr(i):r,c=a?a[0]:i.charAt(0),y=a?hi(a,1).join(""):i.slice(1);return c[n]()+y}}function po(n){return function(i){return Ef($g(Ng(i).replace(sa,"")),n,"")}}function us(n){return function(){var i=arguments;switch(i.length){case 0:return new n;case 1:return new n(i[0]);case 2:return new n(i[0],i[1]);case 3:return new n(i[0],i[1],i[2]);case 4:return new n(i[0],i[1],i[2],i[3]);case 5:return new n(i[0],i[1],i[2],i[3],i[4]);case 6:return new n(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new n(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var a=ho(n.prototype),c=n.apply(a,i);return mt(c)?c:a}}function eE(n,i,a){var c=us(n);function y(){for(var L=arguments.length,k=fe(L),z=L,ee=bo(y);z--;)k[z]=arguments[z];var ge=L<3&&k[0]!==ee&&k[L-1]!==ee?[]:ui(k,ee);if(L-=ge.length,L<a)return Fh(n,i,Na,y.placeholder,r,k,ge,r,r,a-L);var pe=this&&this!==De&&this instanceof y?c:n;return wr(pe,this,k)}return y}function Dh(n){return function(i,a,c){var y=ft(i);if(!dr(i)){var L=$e(a,3);i=jt(i),a=function(z){return L(y[z],z,y)}}var k=n(i,a,c);return k>-1?y[L?i[k]:k]:r}}function jh(n){return kn(function(i){var a=i.length,c=a,y=Nr.prototype.thru;for(n&&i.reverse();c--;){var L=i[c];if(typeof L!="function")throw new Br(f);if(y&&!k&&Da(L)=="wrapper")var k=new Nr([],!0)}for(c=k?c:a;++c<a;){L=i[c];var z=Da(L),ee=z=="wrapper"?tl(L):r;ee&&ol(ee[0])&&ee[1]==(ce|S|j|ue)&&!ee[4].length&&ee[9]==1?k=k[Da(ee[0])].apply(k,ee[3]):k=L.length==1&&ol(L)?k[z]():k.thru(L)}return function(){var ge=arguments,pe=ge[0];if(k&&ge.length==1&&Fe(pe))return k.plant(pe).value();for(var we=0,Ae=a?i[we].apply(this,ge):pe;++we<a;)Ae=i[we].call(this,Ae);return Ae}})}function Na(n,i,a,c,y,L,k,z,ee,ge){var pe=i&ce,we=i&C,Ae=i&B,Pe=i&(S|m),Me=i&te,qe=Ae?r:us(n);function xe(){for(var ze=arguments.length,Xe=fe(ze),Sr=ze;Sr--;)Xe[Sr]=arguments[Sr];if(Pe)var sr=bo(xe),Rr=dw(Xe,sr);if(c&&(Xe=Bh(Xe,c,y,Pe)),L&&(Xe=Nh(Xe,L,k,Pe)),ze-=Rr,Pe&&ze<ge){var It=ui(Xe,sr);return Fh(n,i,Na,xe.placeholder,a,Xe,It,z,ee,ge-ze)}var en=we?a:this,qn=Ae?en[n]:n;return ze=Xe.length,z?Xe=mE(Xe,z):Me&&ze>1&&Xe.reverse(),pe&&ee<ze&&(Xe.length=ee),this&&this!==De&&this instanceof xe&&(qn=qe||us(qn)),qn.apply(en,Xe)}return xe}function Uh(n,i){return function(a,c){return Om(a,n,i(c),{})}}function $a(n,i){return function(a,c){var y;if(a===r&&c===r)return i;if(a!==r&&(y=a),c!==r){if(y===r)return c;typeof a=="string"||typeof c=="string"?(a=Er(a),c=Er(c)):(a=Rh(a),c=Rh(c)),y=n(a,c)}return y}}function Xf(n){return kn(function(i){return i=wt(i,mr($e())),Ge(function(a){var c=this;return n(i,function(y){return wr(y,c,a)})})})}function Ma(n,i){i=i===r?" ":Er(i);var a=i.length;if(a<2)return a?qf(i,n):i;var c=qf(i,Ea(n/ao(i)));return so(i)?hi(Xr(c),0,n).join(""):c.slice(0,n)}function tE(n,i,a,c){var y=i&C,L=us(n);function k(){for(var z=-1,ee=arguments.length,ge=-1,pe=c.length,we=fe(pe+ee),Ae=this&&this!==De&&this instanceof k?L:n;++ge<pe;)we[ge]=c[ge];for(;ee--;)we[ge++]=arguments[++z];return wr(Ae,y?a:this,we)}return k}function kh(n){return function(i,a,c){return c&&typeof c!="number"&&or(i,a,c)&&(a=c=r),i=Wn(i),a===r?(a=i,i=0):a=Wn(a),c=c===r?i<a?1:-1:Wn(c),km(i,a,c,n)}}function xa(n){return function(i,a){return typeof i=="string"&&typeof a=="string"||(i=Dr(i),a=Dr(a)),n(i,a)}}function Fh(n,i,a,c,y,L,k,z,ee,ge){var pe=i&S,we=pe?k:r,Ae=pe?r:k,Pe=pe?L:r,Me=pe?r:L;i|=pe?j:Q,i&=~(pe?Q:j),i&P||(i&=-4);var qe=[n,i,y,Pe,we,Me,Ae,z,ee,ge],xe=a.apply(r,qe);return ol(n)&&Qh(xe,qe),xe.placeholder=c,eg(xe,n,i)}function Zf(n){var i=$t[n];return function(a,c){if(a=Dr(a),c=c==null?0:Kt(We(c),292),c&&eh(a)){var y=(rt(a)+"e").split("e"),L=i(y[0]+"e"+(+y[1]+c));return y=(rt(L)+"e").split("e"),+(y[0]+"e"+(+y[1]-c))}return i(a)}}var rE=lo&&1/ca(new lo([,-0]))[1]==V?function(n){return new lo(n)}:ml;function Hh(n){return function(i){var a=Jt(i);return a==E?Of(i):a==Ue?ww(i):cw(i,n(i))}}function Un(n,i,a,c,y,L,k,z){var ee=i&B;if(!ee&&typeof n!="function")throw new Br(f);var ge=c?c.length:0;if(ge||(i&=-97,c=y=r),k=k===r?k:Mt(We(k),0),z=z===r?z:We(z),ge-=y?y.length:0,i&Q){var pe=c,we=y;c=y=r}var Ae=ee?r:tl(n),Pe=[n,i,a,c,y,pe,we,L,k,z];if(Ae&&_E(Pe,Ae),n=Pe[0],i=Pe[1],a=Pe[2],c=Pe[3],y=Pe[4],z=Pe[9]=Pe[9]===r?ee?0:n.length:Mt(Pe[9]-ge,0),!z&&i&(S|m)&&(i&=-25),!i||i==C)var Me=Qm(n,i,a);else i==S||i==m?Me=eE(n,i,z):(i==j||i==(C|j))&&!y.length?Me=tE(n,i,a,c):Me=Na.apply(r,Pe);var qe=Ae?vh:Qh;return eg(qe(Me,Pe),n,i)}function Wh(n,i,a,c){return n===r||Qr(n,fo[a])&&!it.call(c,a)?i:n}function qh(n,i,a,c,y,L){return mt(n)&&mt(i)&&(L.set(i,n),Ca(n,i,r,qh,L),L.delete(i)),n}function nE(n){return cs(n)?r:n}function Gh(n,i,a,c,y,L){var k=a&x,z=n.length,ee=i.length;if(z!=ee&&!(k&&ee>z))return!1;var ge=L.get(n),pe=L.get(i);if(ge&&pe)return ge==i&&pe==n;var we=-1,Ae=!0,Pe=a&v?new Ni:r;for(L.set(n,i),L.set(i,n);++we<z;){var Me=n[we],qe=i[we];if(c)var xe=k?c(qe,Me,we,i,n,L):c(Me,qe,we,n,i,L);if(xe!==r){if(xe)continue;Ae=!1;break}if(Pe){if(!vf(i,function(ze,Xe){if(!Xo(Pe,Xe)&&(Me===ze||y(Me,ze,a,c,L)))return Pe.push(Xe)})){Ae=!1;break}}else if(!(Me===qe||y(Me,qe,a,c,L))){Ae=!1;break}}return L.delete(n),L.delete(i),Ae}function iE(n,i,a,c,y,L,k){switch(a){case Ve:if(n.byteLength!=i.byteLength||n.byteOffset!=i.byteOffset)return!1;n=n.buffer,i=i.buffer;case Ye:return!(n.byteLength!=i.byteLength||!L(new _a(n),new _a(i)));case q:case oe:case J:return Qr(+n,+i);case d:return n.name==i.name&&n.message==i.message;case Ce:case Re:return n==i+"";case E:var z=Of;case Ue:var ee=c&x;if(z||(z=ca),n.size!=i.size&&!ee)return!1;var ge=k.get(n);if(ge)return ge==i;c|=v,k.set(n,i);var pe=Gh(z(n),z(i),c,y,L,k);return k.delete(n),pe;case He:if(rs)return rs.call(n)==rs.call(i)}return!1}function oE(n,i,a,c,y,L){var k=a&x,z=Qf(n),ee=z.length,ge=Qf(i),pe=ge.length;if(ee!=pe&&!k)return!1;for(var we=ee;we--;){var Ae=z[we];if(!(k?Ae in i:it.call(i,Ae)))return!1}var Pe=L.get(n),Me=L.get(i);if(Pe&&Me)return Pe==i&&Me==n;var qe=!0;L.set(n,i),L.set(i,n);for(var xe=k;++we<ee;){Ae=z[we];var ze=n[Ae],Xe=i[Ae];if(c)var Sr=k?c(Xe,ze,Ae,i,n,L):c(ze,Xe,Ae,n,i,L);if(!(Sr===r?ze===Xe||y(ze,Xe,a,c,L):Sr)){qe=!1;break}xe||(xe=Ae=="constructor")}if(qe&&!xe){var sr=n.constructor,Rr=i.constructor;sr!=Rr&&"constructor"in n&&"constructor"in i&&!(typeof sr=="function"&&sr instanceof sr&&typeof Rr=="function"&&Rr instanceof Rr)&&(qe=!1)}return L.delete(n),L.delete(i),qe}function kn(n){return al(Xh(n,r,sg),n+"")}function Qf(n){return ch(n,jt,nl)}function el(n){return ch(n,hr,Vh)}var tl=Sa?function(n){return Sa.get(n)}:ml;function Da(n){for(var i=n.name+"",a=co[i],c=it.call(co,i)?a.length:0;c--;){var y=a[c],L=y.func;if(L==null||L==n)return y.name}return i}function bo(n){var i=it.call(T,"placeholder")?T:n;return i.placeholder}function $e(){var n=T.iteratee||yl;return n=n===yl?gh:n,arguments.length?n(arguments[0],arguments[1]):n}function ja(n,i){var a=n.__data__;return hE(i)?a[typeof i=="string"?"string":"hash"]:a.map}function rl(n){for(var i=jt(n),a=i.length;a--;){var c=i[a],y=n[c];i[a]=[c,y,Jh(y)]}return i}function xi(n,i){var a=bw(n,i);return hh(a)?a:r}function sE(n){var i=it.call(n,Pi),a=n[Pi];try{n[Pi]=r;var c=!0}catch{}var y=pa.call(n);return c&&(i?n[Pi]=a:delete n[Pi]),y}var nl=Lf?function(n){return n==null?[]:(n=ft(n),si(Lf(n),function(i){return Zd.call(n,i)}))}:El,Vh=Lf?function(n){for(var i=[];n;)ai(i,nl(n)),n=ya(n);return i}:El,Jt=ir;(Pf&&Jt(new Pf(new ArrayBuffer(1)))!=Ve||Qo&&Jt(new Qo)!=E||Bf&&Jt(Bf.resolve())!=Ie||lo&&Jt(new lo)!=Ue||es&&Jt(new es)!=et)&&(Jt=function(n){var i=ir(n),a=i==se?n.constructor:r,c=a?Di(a):"";if(c)switch(c){case Hw:return Ve;case Ww:return E;case qw:return Ie;case Gw:return Ue;case Vw:return et}return i});function aE(n,i,a){for(var c=-1,y=a.length;++c<y;){var L=a[c],k=L.size;switch(L.type){case"drop":n+=k;break;case"dropRight":i-=k;break;case"take":i=Kt(i,n+k);break;case"takeRight":n=Mt(n,i-k);break}}return{start:n,end:i}}function uE(n){var i=n.match(ln);return i?i[1].split(Pn):[]}function zh(n,i,a){i=di(i,n);for(var c=-1,y=i.length,L=!1;++c<y;){var k=yn(i[c]);if(!(L=n!=null&&a(n,k)))break;n=n[k]}return L||++c!=y?L:(y=n==null?0:n.length,!!y&&Ga(y)&&Fn(k,y)&&(Fe(n)||ji(n)))}function fE(n){var i=n.length,a=new n.constructor(i);return i&&typeof n[0]=="string"&&it.call(n,"index")&&(a.index=n.index,a.input=n.input),a}function Kh(n){return typeof n.constructor=="function"&&!fs(n)?ho(ya(n)):{}}function lE(n,i,a){var c=n.constructor;switch(i){case Ye:return Yf(n);case q:case oe:return new c(+n);case Ve:return zm(n,a);case Dt:case Lt:case at:case Bt:case fr:case er:case kt:case lr:case zr:return Lh(n,a);case E:return new c;case J:case Re:return new c(n);case Ce:return Km(n);case Ue:return new c;case He:return Jm(n)}}function cE(n,i){var a=i.length;if(!a)return n;var c=a-1;return i[c]=(a>1?"& ":"")+i[c],i=i.join(a>2?", ":" "),n.replace(Pt,`{
11
11
  /* [wrapped with `+i+`] */
12
- `)}function hE(n){return Fe(n)||ji(n)||!!(eh&&n&&n[eh])}function Fn(n,i){var a=typeof n;return i=i??ne,!!i&&(a=="number"||a!="symbol"&&Ii.test(n))&&n>-1&&n%1==0&&n<i}function or(n,i,a){if(!mt(a))return!1;var c=typeof i;return(c=="number"?dr(a)&&Fn(i,a.length):c=="string"&&i in a)?Qr(a[i],n):!1}function il(n,i){if(Fe(n))return!1;var a=typeof n;return a=="number"||a=="symbol"||a=="boolean"||n==null||vr(n)?!0:Ee.test(n)||!D.test(n)||i!=null&&n in ft(i)}function gE(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}function ol(n){var i=Da(n),a=T[i];if(typeof a!="function"||!(i in Je.prototype))return!1;if(n===a)return!0;var c=tl(a);return!!c&&n===c[0]}function pE(n){return!!Yd&&Yd in n}var bE=ha?Hn:vl;function fs(n){var i=n&&n.constructor,a=typeof i=="function"&&i.prototype||fo;return n===a}function Yh(n){return n===n&&!mt(n)}function Xh(n,i){return function(a){return a==null?!1:a[n]===i&&(i!==r||n in ft(a))}}function _E(n){var i=Wa(n,function(c){return a.size===p&&a.clear(),c}),a=i.cache;return i}function yE(n,i){var a=n[1],c=i[1],y=a|c,L=y<(C|B|ce),k=c==ce&&a==S||c==ce&&a==ue&&n[7].length<=i[8]||c==(ce|ue)&&i[7].length<=i[8]&&a==S;if(!(L||k))return n;c&C&&(n[2]=i[2],y|=a&C?0:P);var z=i[3];if(z){var ee=n[3];n[3]=ee?Nh(ee,z,i[4]):z,n[4]=ee?ui(n[3],b):i[4]}return z=i[5],z&&(ee=n[5],n[5]=ee?$h(ee,z,i[6]):z,n[6]=ee?ui(n[5],b):i[6]),z=i[7],z&&(n[7]=z),c&ce&&(n[8]=n[8]==null?i[8]:Kt(n[8],i[8])),n[9]==null&&(n[9]=i[9]),n[0]=i[0],n[1]=y,n}function wE(n){var i=[];if(n!=null)for(var a in ft(n))i.push(a);return i}function mE(n){return pa.call(n)}function Zh(n,i,a){return i=Mt(i===r?n.length-1:i,0),function(){for(var c=arguments,y=-1,L=Mt(c.length-i,0),k=fe(L);++y<L;)k[y]=c[i+y];y=-1;for(var z=fe(i+1);++y<i;)z[y]=c[y];return z[i]=a(k),wr(n,this,z)}}function Qh(n,i){return i.length<2?n:Mi(n,Mr(i,0,-1))}function EE(n,i){for(var a=n.length,c=Kt(i.length,a),y=cr(n);c--;){var L=i[c];n[c]=Fn(L,a)?y[L]:r}return n}function sl(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}var eg=rg(Sh),ls=xw||function(n,i){return De.setTimeout(n,i)},al=rg(qm);function tg(n,i,a){var c=i+"";return al(n,dE(c,vE(fE(c),a)))}function rg(n){var i=0,a=0;return function(){var c=kw(),y=U-(c-a);if(a=c,y>0){if(++i>=F)return arguments[0]}else i=0;return n.apply(r,arguments)}}function Ua(n,i){var a=-1,c=n.length,y=c-1;for(i=i===r?c:i;++a<i;){var L=Wf(a,y),k=n[L];n[L]=n[a],n[a]=k}return n.length=i,n}var ng=_E(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(ve,function(a,c,y,L){i.push(y?L.replace(Yr,"$1"):c||a)}),i});function yn(n){if(typeof n=="string"||vr(n))return n;var i=n+"";return i=="0"&&1/n==-1/0?"-0":i}function Di(n){if(n!=null){try{return ga.call(n)}catch{}try{return n+""}catch{}}return""}function vE(n,i){return Pr(_e,function(a){var c="_."+a[0];i&a[1]&&!fa(n,c)&&n.push(c)}),n.sort()}function ig(n){if(n instanceof Je)return n.clone();var i=new Nr(n.__wrapped__,n.__chain__);return i.__actions__=cr(n.__actions__),i.__index__=n.__index__,i.__values__=n.__values__,i}function SE(n,i,a){(a?or(n,i,a):i===r)?i=1:i=Mt(We(i),0);var c=n==null?0:n.length;if(!c||i<1)return[];for(var y=0,L=0,k=fe(Ea(c/i));y<c;)k[L++]=Mr(n,y,y+=i);return k}function RE(n){for(var i=-1,a=n==null?0:n.length,c=0,y=[];++i<a;){var L=n[i];L&&(y[c++]=L)}return y}function AE(){var n=arguments.length;if(!n)return[];for(var i=fe(n-1),a=arguments[0],c=n;c--;)i[c-1]=arguments[c];return ai(Fe(a)?cr(a):[a],Ht(i,1))}var TE=Ge(function(n,i){return Tt(n)?is(n,Ht(i,1,Tt,!0)):[]}),IE=Ge(function(n,i){var a=xr(i);return Tt(a)&&(a=r),Tt(n)?is(n,Ht(i,1,Tt,!0),$e(a,2)):[]}),OE=Ge(function(n,i){var a=xr(i);return Tt(a)&&(a=r),Tt(n)?is(n,Ht(i,1,Tt,!0),r,a):[]});function CE(n,i,a){var c=n==null?0:n.length;return c?(i=a||i===r?1:We(i),Mr(n,i<0?0:i,c)):[]}function LE(n,i,a){var c=n==null?0:n.length;return c?(i=a||i===r?1:We(i),i=c-i,Mr(n,0,i<0?0:i)):[]}function PE(n,i){return n&&n.length?Pa(n,$e(i,3),!0,!0):[]}function BE(n,i){return n&&n.length?Pa(n,$e(i,3),!0):[]}function NE(n,i,a,c){var y=n==null?0:n.length;return y?(a&&typeof a!="number"&&or(n,i,a)&&(a=0,c=y),Am(n,i,a,c)):[]}function og(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=a==null?0:We(a);return y<0&&(y=Mt(c+y,0)),la(n,$e(i,3),y)}function sg(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=c-1;return a!==r&&(y=We(a),y=a<0?Mt(c+y,0):Kt(y,c-1)),la(n,$e(i,3),y,!0)}function ag(n){var i=n==null?0:n.length;return i?Ht(n,1):[]}function $E(n){var i=n==null?0:n.length;return i?Ht(n,V):[]}function ME(n,i){var a=n==null?0:n.length;return a?(i=i===r?1:We(i),Ht(n,i)):[]}function xE(n){for(var i=-1,a=n==null?0:n.length,c={};++i<a;){var y=n[i];c[y[0]]=y[1]}return c}function ug(n){return n&&n.length?n[0]:r}function DE(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=a==null?0:We(a);return y<0&&(y=Mt(c+y,0)),oo(n,i,y)}function jE(n){var i=n==null?0:n.length;return i?Mr(n,0,-1):[]}var UE=Ge(function(n){var i=wt(n,Kf);return i.length&&i[0]===n[0]?jf(i):[]}),kE=Ge(function(n){var i=xr(n),a=wt(n,Kf);return i===xr(a)?i=r:a.pop(),a.length&&a[0]===n[0]?jf(a,$e(i,2)):[]}),FE=Ge(function(n){var i=xr(n),a=wt(n,Kf);return i=typeof i=="function"?i:r,i&&a.pop(),a.length&&a[0]===n[0]?jf(a,r,i):[]});function HE(n,i){return n==null?"":jw.call(n,i)}function xr(n){var i=n==null?0:n.length;return i?n[i-1]:r}function WE(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=c;return a!==r&&(y=We(a),y=y<0?Mt(c+y,0):Kt(y,c-1)),i===i?vw(n,i,y):la(n,Hd,y,!0)}function qE(n,i){return n&&n.length?wh(n,We(i)):r}var GE=Ge(fg);function fg(n,i){return n&&n.length&&i&&i.length?Hf(n,i):n}function VE(n,i,a){return n&&n.length&&i&&i.length?Hf(n,i,$e(a,2)):n}function zE(n,i,a){return n&&n.length&&i&&i.length?Hf(n,i,r,a):n}var KE=kn(function(n,i){var a=n==null?0:n.length,c=$f(n,i);return vh(n,wt(i,function(y){return Fn(y,a)?+y:y}).sort(Bh)),c});function JE(n,i){var a=[];if(!(n&&n.length))return a;var c=-1,y=[],L=n.length;for(i=$e(i,3);++c<L;){var k=n[c];i(k,c,n)&&(a.push(k),y.push(c))}return vh(n,y),a}function ul(n){return n==null?n:Hw.call(n)}function YE(n,i,a){var c=n==null?0:n.length;return c?(a&&typeof a!="number"&&or(n,i,a)?(i=0,a=c):(i=i==null?0:We(i),a=a===r?c:We(a)),Mr(n,i,a)):[]}function XE(n,i){return La(n,i)}function ZE(n,i,a){return Gf(n,i,$e(a,2))}function QE(n,i){var a=n==null?0:n.length;if(a){var c=La(n,i);if(c<a&&Qr(n[c],i))return c}return-1}function ev(n,i){return La(n,i,!0)}function tv(n,i,a){return Gf(n,i,$e(a,2),!0)}function rv(n,i){var a=n==null?0:n.length;if(a){var c=La(n,i,!0)-1;if(Qr(n[c],i))return c}return-1}function nv(n){return n&&n.length?Rh(n):[]}function iv(n,i){return n&&n.length?Rh(n,$e(i,2)):[]}function ov(n){var i=n==null?0:n.length;return i?Mr(n,1,i):[]}function sv(n,i,a){return n&&n.length?(i=a||i===r?1:We(i),Mr(n,0,i<0?0:i)):[]}function av(n,i,a){var c=n==null?0:n.length;return c?(i=a||i===r?1:We(i),i=c-i,Mr(n,i<0?0:i,c)):[]}function uv(n,i){return n&&n.length?Pa(n,$e(i,3),!1,!0):[]}function fv(n,i){return n&&n.length?Pa(n,$e(i,3)):[]}var lv=Ge(function(n){return ci(Ht(n,1,Tt,!0))}),cv=Ge(function(n){var i=xr(n);return Tt(i)&&(i=r),ci(Ht(n,1,Tt,!0),$e(i,2))}),dv=Ge(function(n){var i=xr(n);return i=typeof i=="function"?i:r,ci(Ht(n,1,Tt,!0),r,i)});function hv(n){return n&&n.length?ci(n):[]}function gv(n,i){return n&&n.length?ci(n,$e(i,2)):[]}function pv(n,i){return i=typeof i=="function"?i:r,n&&n.length?ci(n,r,i):[]}function fl(n){if(!(n&&n.length))return[];var i=0;return n=si(n,function(a){if(Tt(a))return i=Mt(a.length,i),!0}),Tf(i,function(a){return wt(n,Sf(a))})}function lg(n,i){if(!(n&&n.length))return[];var a=fl(n);return i==null?a:wt(a,function(c){return wr(i,r,c)})}var bv=Ge(function(n,i){return Tt(n)?is(n,i):[]}),_v=Ge(function(n){return zf(si(n,Tt))}),yv=Ge(function(n){var i=xr(n);return Tt(i)&&(i=r),zf(si(n,Tt),$e(i,2))}),wv=Ge(function(n){var i=xr(n);return i=typeof i=="function"?i:r,zf(si(n,Tt),r,i)}),mv=Ge(fl);function Ev(n,i){return Oh(n||[],i||[],ns)}function vv(n,i){return Oh(n||[],i||[],as)}var Sv=Ge(function(n){var i=n.length,a=i>1?n[i-1]:r;return a=typeof a=="function"?(n.pop(),a):r,lg(n,a)});function cg(n){var i=T(n);return i.__chain__=!0,i}function Rv(n,i){return i(n),n}function ka(n,i){return i(n)}var Av=kn(function(n){var i=n.length,a=i?n[0]:0,c=this.__wrapped__,y=function(L){return $f(L,n)};return i>1||this.__actions__.length||!(c instanceof Je)||!Fn(a)?this.thru(y):(c=c.slice(a,+a+(i?1:0)),c.__actions__.push({func:ka,args:[y],thisArg:r}),new Nr(c,this.__chain__).thru(function(L){return i&&!L.length&&L.push(r),L}))});function Tv(){return cg(this)}function Iv(){return new Nr(this.value(),this.__chain__)}function Ov(){this.__values__===r&&(this.__values__=Ag(this.value()));var n=this.__index__>=this.__values__.length,i=n?r:this.__values__[this.__index__++];return{done:n,value:i}}function Cv(){return this}function Lv(n){for(var i,a=this;a instanceof Aa;){var c=ig(a);c.__index__=0,c.__values__=r,i?y.__wrapped__=c:i=c;var y=c;a=a.__wrapped__}return y.__wrapped__=n,i}function Pv(){var n=this.__wrapped__;if(n instanceof Je){var i=n;return this.__actions__.length&&(i=new Je(this)),i=i.reverse(),i.__actions__.push({func:ka,args:[ul],thisArg:r}),new Nr(i,this.__chain__)}return this.thru(ul)}function Bv(){return Ih(this.__wrapped__,this.__actions__)}var Nv=Ba(function(n,i,a){it.call(n,a)?++n[a]:jn(n,a,1)});function $v(n,i,a){var c=Fe(n)?kd:Rm;return a&&or(n,i,a)&&(i=r),c(n,$e(i,3))}function Mv(n,i){var a=Fe(n)?si:lh;return a(n,$e(i,3))}var xv=jh(og),Dv=jh(sg);function jv(n,i){return Ht(Fa(n,i),1)}function Uv(n,i){return Ht(Fa(n,i),V)}function kv(n,i,a){return a=a===r?1:We(a),Ht(Fa(n,i),a)}function dg(n,i){var a=Fe(n)?Pr:li;return a(n,$e(i,3))}function hg(n,i){var a=Fe(n)?ow:fh;return a(n,$e(i,3))}var Fv=Ba(function(n,i,a){it.call(n,a)?n[a].push(i):jn(n,a,[i])});function Hv(n,i,a,c){n=dr(n)?n:yo(n),a=a&&!c?We(a):0;var y=n.length;return a<0&&(a=Mt(y+a,0)),Va(n)?a<=y&&n.indexOf(i,a)>-1:!!y&&oo(n,i,a)>-1}var Wv=Ge(function(n,i,a){var c=-1,y=typeof i=="function",L=dr(n)?fe(n.length):[];return li(n,function(k){L[++c]=y?wr(i,k,a):os(k,i,a)}),L}),qv=Ba(function(n,i,a){jn(n,a,i)});function Fa(n,i){var a=Fe(n)?wt:bh;return a(n,$e(i,3))}function Gv(n,i,a,c){return n==null?[]:(Fe(i)||(i=i==null?[]:[i]),a=c?r:a,Fe(a)||(a=a==null?[]:[a]),mh(n,i,a))}var Vv=Ba(function(n,i,a){n[a?0:1].push(i)},function(){return[[],[]]});function zv(n,i,a){var c=Fe(n)?Ef:qd,y=arguments.length<3;return c(n,$e(i,4),a,y,li)}function Kv(n,i,a){var c=Fe(n)?sw:qd,y=arguments.length<3;return c(n,$e(i,4),a,y,fh)}function Jv(n,i){var a=Fe(n)?si:lh;return a(n,qa($e(i,3)))}function Yv(n){var i=Fe(n)?oh:Hm;return i(n)}function Xv(n,i,a){(a?or(n,i,a):i===r)?i=1:i=We(i);var c=Fe(n)?wm:Wm;return c(n,i)}function Zv(n){var i=Fe(n)?mm:Gm;return i(n)}function Qv(n){if(n==null)return 0;if(dr(n))return Va(n)?ao(n):n.length;var i=Jt(n);return i==E||i==Ue?n.size:kf(n).length}function eS(n,i,a){var c=Fe(n)?vf:Vm;return a&&or(n,i,a)&&(i=r),c(n,$e(i,3))}var tS=Ge(function(n,i){if(n==null)return[];var a=i.length;return a>1&&or(n,i[0],i[1])?i=[]:a>2&&or(i[0],i[1],i[2])&&(i=[i[0]]),mh(n,Ht(i,1),[])}),Ha=Mw||function(){return De.Date.now()};function rS(n,i){if(typeof i!="function")throw new Br(f);return n=We(n),function(){if(--n<1)return i.apply(this,arguments)}}function gg(n,i,a){return i=a?r:i,i=n&&i==null?n.length:i,Un(n,ce,r,r,r,r,i)}function pg(n,i){var a;if(typeof i!="function")throw new Br(f);return n=We(n),function(){return--n>0&&(a=i.apply(this,arguments)),n<=1&&(i=r),a}}var ll=Ge(function(n,i,a){var c=C;if(a.length){var y=ui(a,bo(ll));c|=j}return Un(n,c,i,a,y)}),bg=Ge(function(n,i,a){var c=C|B;if(a.length){var y=ui(a,bo(bg));c|=j}return Un(i,c,n,a,y)});function _g(n,i,a){i=a?r:i;var c=Un(n,S,r,r,r,r,r,i);return c.placeholder=_g.placeholder,c}function yg(n,i,a){i=a?r:i;var c=Un(n,m,r,r,r,r,r,i);return c.placeholder=yg.placeholder,c}function wg(n,i,a){var c,y,L,k,z,ee,ge=0,pe=!1,we=!1,Ae=!0;if(typeof n!="function")throw new Br(f);i=Dr(i)||0,mt(a)&&(pe=!!a.leading,we="maxWait"in a,L=we?Mt(Dr(a.maxWait)||0,i):L,Ae="trailing"in a?!!a.trailing:Ae);function Pe(It){var en=c,qn=y;return c=y=r,ge=It,k=n.apply(qn,en),k}function Me(It){return ge=It,z=ls(ze,i),pe?Pe(It):k}function qe(It){var en=It-ee,qn=It-ge,jg=i-en;return we?Kt(jg,L-qn):jg}function xe(It){var en=It-ee,qn=It-ge;return ee===r||en>=i||en<0||we&&qn>=L}function ze(){var It=Ha();if(xe(It))return Xe(It);z=ls(ze,qe(It))}function Xe(It){return z=r,Ae&&c?Pe(It):(c=y=r,k)}function Sr(){z!==r&&Ch(z),ge=0,c=ee=y=z=r}function sr(){return z===r?k:Xe(Ha())}function Rr(){var It=Ha(),en=xe(It);if(c=arguments,y=this,ee=It,en){if(z===r)return Me(ee);if(we)return Ch(z),z=ls(ze,i),Pe(ee)}return z===r&&(z=ls(ze,i)),k}return Rr.cancel=Sr,Rr.flush=sr,Rr}var nS=Ge(function(n,i){return uh(n,1,i)}),iS=Ge(function(n,i,a){return uh(n,Dr(i)||0,a)});function oS(n){return Un(n,te)}function Wa(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new Br(f);var a=function(){var c=arguments,y=i?i.apply(this,c):c[0],L=a.cache;if(L.has(y))return L.get(y);var k=n.apply(this,c);return a.cache=L.set(y,k)||L,k};return a.cache=new(Wa.Cache||Dn),a}Wa.Cache=Dn;function qa(n){if(typeof n!="function")throw new Br(f);return function(){var i=arguments;switch(i.length){case 0:return!n.call(this);case 1:return!n.call(this,i[0]);case 2:return!n.call(this,i[0],i[1]);case 3:return!n.call(this,i[0],i[1],i[2])}return!n.apply(this,i)}}function sS(n){return pg(2,n)}var aS=zm(function(n,i){i=i.length==1&&Fe(i[0])?wt(i[0],mr($e())):wt(Ht(i,1),mr($e()));var a=i.length;return Ge(function(c){for(var y=-1,L=Kt(c.length,a);++y<L;)c[y]=i[y].call(this,c[y]);return wr(n,this,c)})}),cl=Ge(function(n,i){var a=ui(i,bo(cl));return Un(n,j,r,i,a)}),mg=Ge(function(n,i){var a=ui(i,bo(mg));return Un(n,Q,r,i,a)}),uS=kn(function(n,i){return Un(n,ue,r,r,r,i)});function fS(n,i){if(typeof n!="function")throw new Br(f);return i=i===r?i:We(i),Ge(n,i)}function lS(n,i){if(typeof n!="function")throw new Br(f);return i=i==null?0:Mt(We(i),0),Ge(function(a){var c=a[i],y=hi(a,0,i);return c&&ai(y,c),wr(n,this,y)})}function cS(n,i,a){var c=!0,y=!0;if(typeof n!="function")throw new Br(f);return mt(a)&&(c="leading"in a?!!a.leading:c,y="trailing"in a?!!a.trailing:y),wg(n,i,{leading:c,maxWait:i,trailing:y})}function dS(n){return gg(n,1)}function hS(n,i){return cl(Jf(i),n)}function gS(){if(!arguments.length)return[];var n=arguments[0];return Fe(n)?n:[n]}function pS(n){return $r(n,A)}function bS(n,i){return i=typeof i=="function"?i:r,$r(n,A,i)}function _S(n){return $r(n,w|A)}function yS(n,i){return i=typeof i=="function"?i:r,$r(n,w|A,i)}function wS(n,i){return i==null||ah(n,i,jt(i))}function Qr(n,i){return n===i||n!==n&&i!==i}var mS=xa(Df),ES=xa(function(n,i){return n>=i}),ji=hh(function(){return arguments}())?hh:function(n){return Rt(n)&&it.call(n,"callee")&&!Qd.call(n,"callee")},Fe=fe.isArray,vS=io?mr(io):Lm;function dr(n){return n!=null&&Ga(n.length)&&!Hn(n)}function Tt(n){return Rt(n)&&dr(n)}function SS(n){return n===!0||n===!1||Rt(n)&&ir(n)==q}var gi=Dw||vl,RS=Yo?mr(Yo):Pm;function AS(n){return Rt(n)&&n.nodeType===1&&!cs(n)}function TS(n){if(n==null)return!0;if(dr(n)&&(Fe(n)||typeof n=="string"||typeof n.splice=="function"||gi(n)||_o(n)||ji(n)))return!n.length;var i=Jt(n);if(i==E||i==Ue)return!n.size;if(fs(n))return!kf(n).length;for(var a in n)if(it.call(n,a))return!1;return!0}function IS(n,i){return ss(n,i)}function OS(n,i,a){a=typeof a=="function"?a:r;var c=a?a(n,i):r;return c===r?ss(n,i,r,a):!!c}function dl(n){if(!Rt(n))return!1;var i=ir(n);return i==d||i==ye||typeof n.message=="string"&&typeof n.name=="string"&&!cs(n)}function CS(n){return typeof n=="number"&&th(n)}function Hn(n){if(!mt(n))return!1;var i=ir(n);return i==g||i==_||i==O||i==Be}function Eg(n){return typeof n=="number"&&n==We(n)}function Ga(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ne}function mt(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}function Rt(n){return n!=null&&typeof n=="object"}var vg=xd?mr(xd):Nm;function LS(n,i){return n===i||Uf(n,i,rl(i))}function PS(n,i,a){return a=typeof a=="function"?a:r,Uf(n,i,rl(i),a)}function BS(n){return Sg(n)&&n!=+n}function NS(n){if(bE(n))throw new ke(u);return gh(n)}function $S(n){return n===null}function MS(n){return n==null}function Sg(n){return typeof n=="number"||Rt(n)&&ir(n)==J}function cs(n){if(!Rt(n)||ir(n)!=se)return!1;var i=ya(n);if(i===null)return!0;var a=it.call(i,"constructor")&&i.constructor;return typeof a=="function"&&a instanceof a&&ga.call(a)==Pw}var hl=Dd?mr(Dd):$m;function xS(n){return Eg(n)&&n>=-9007199254740991&&n<=ne}var Rg=jd?mr(jd):Mm;function Va(n){return typeof n=="string"||!Fe(n)&&Rt(n)&&ir(n)==Re}function vr(n){return typeof n=="symbol"||Rt(n)&&ir(n)==He}var _o=Ud?mr(Ud):xm;function DS(n){return n===r}function jS(n){return Rt(n)&&Jt(n)==et}function US(n){return Rt(n)&&ir(n)==_t}var kS=xa(Ff),FS=xa(function(n,i){return n<=i});function Ag(n){if(!n)return[];if(dr(n))return Va(n)?Xr(n):cr(n);if(Zo&&n[Zo])return ww(n[Zo]());var i=Jt(n),a=i==E?Of:i==Ue?ca:yo;return a(n)}function Wn(n){if(!n)return n===0?n:0;if(n=Dr(n),n===V||n===-1/0){var i=n<0?-1:1;return i*W}return n===n?n:0}function We(n){var i=Wn(n),a=i%1;return i===i?a?i-a:i:0}function Tg(n){return n?$i(We(n),0,ae):0}function Dr(n){if(typeof n=="number")return n;if(vr(n))return K;if(mt(n)){var i=typeof n.valueOf=="function"?n.valueOf():n;n=mt(i)?i+"":i}if(typeof n!="string")return n===0?n:+n;n=Gd(n);var a=nr.test(n);return a||Ti.test(n)?Ke(n.slice(2),a?2:8):yr.test(n)?K:+n}function Ig(n){return _n(n,hr(n))}function HS(n){return n?$i(We(n),-9007199254740991,ne):n===0?n:0}function rt(n){return n==null?"":Er(n)}var WS=go(function(n,i){if(fs(i)||dr(i)){_n(i,jt(i),n);return}for(var a in i)it.call(i,a)&&ns(n,a,i[a])}),Og=go(function(n,i){_n(i,hr(i),n)}),za=go(function(n,i,a,c){_n(i,hr(i),n,c)}),qS=go(function(n,i,a,c){_n(i,jt(i),n,c)}),GS=kn($f);function VS(n,i){var a=ho(n);return i==null?a:sh(a,i)}var zS=Ge(function(n,i){n=ft(n);var a=-1,c=i.length,y=c>2?i[2]:r;for(y&&or(i[0],i[1],y)&&(c=1);++a<c;)for(var L=i[a],k=hr(L),z=-1,ee=k.length;++z<ee;){var ge=k[z],pe=n[ge];(pe===r||Qr(pe,fo[ge])&&!it.call(n,ge))&&(n[ge]=L[ge])}return n}),KS=Ge(function(n){return n.push(r,Gh),wr(Cg,r,n)});function JS(n,i){return Fd(n,$e(i,3),bn)}function YS(n,i){return Fd(n,$e(i,3),xf)}function XS(n,i){return n==null?n:Mf(n,$e(i,3),hr)}function ZS(n,i){return n==null?n:ch(n,$e(i,3),hr)}function QS(n,i){return n&&bn(n,$e(i,3))}function eR(n,i){return n&&xf(n,$e(i,3))}function tR(n){return n==null?[]:Oa(n,jt(n))}function rR(n){return n==null?[]:Oa(n,hr(n))}function gl(n,i,a){var c=n==null?r:Mi(n,i);return c===r?a:c}function nR(n,i){return n!=null&&Kh(n,i,Tm)}function pl(n,i){return n!=null&&Kh(n,i,Im)}var iR=kh(function(n,i,a){i!=null&&typeof i.toString!="function"&&(i=pa.call(i)),n[i]=a},_l(gr)),oR=kh(function(n,i,a){i!=null&&typeof i.toString!="function"&&(i=pa.call(i)),it.call(n,i)?n[i].push(a):n[i]=[a]},$e),sR=Ge(os);function jt(n){return dr(n)?ih(n):kf(n)}function hr(n){return dr(n)?ih(n,!0):Dm(n)}function aR(n,i){var a={};return i=$e(i,3),bn(n,function(c,y,L){jn(a,i(c,y,L),c)}),a}function uR(n,i){var a={};return i=$e(i,3),bn(n,function(c,y,L){jn(a,y,i(c,y,L))}),a}var fR=go(function(n,i,a){Ca(n,i,a)}),Cg=go(function(n,i,a,c){Ca(n,i,a,c)}),lR=kn(function(n,i){var a={};if(n==null)return a;var c=!1;i=wt(i,function(L){return L=di(L,n),c||(c=L.length>1),L}),_n(n,el(n),a),c&&(a=$r(a,w|I|A,iE));for(var y=i.length;y--;)Vf(a,i[y]);return a});function cR(n,i){return Lg(n,qa($e(i)))}var dR=kn(function(n,i){return n==null?{}:Um(n,i)});function Lg(n,i){if(n==null)return{};var a=wt(el(n),function(c){return[c]});return i=$e(i),Eh(n,a,function(c,y){return i(c,y[0])})}function hR(n,i,a){i=di(i,n);var c=-1,y=i.length;for(y||(y=1,n=r);++c<y;){var L=n==null?r:n[yn(i[c])];L===r&&(c=y,L=a),n=Hn(L)?L.call(n):L}return n}function gR(n,i,a){return n==null?n:as(n,i,a)}function pR(n,i,a,c){return c=typeof c=="function"?c:r,n==null?n:as(n,i,a,c)}var Pg=Wh(jt),Bg=Wh(hr);function bR(n,i,a){var c=Fe(n),y=c||gi(n)||_o(n);if(i=$e(i,4),a==null){var L=n&&n.constructor;y?a=c?new L:[]:mt(n)?a=Hn(L)?ho(ya(n)):{}:a={}}return(y?Pr:bn)(n,function(k,z,ee){return i(a,k,z,ee)}),a}function _R(n,i){return n==null?!0:Vf(n,i)}function yR(n,i,a){return n==null?n:Th(n,i,Jf(a))}function wR(n,i,a,c){return c=typeof c=="function"?c:r,n==null?n:Th(n,i,Jf(a),c)}function yo(n){return n==null?[]:If(n,jt(n))}function mR(n){return n==null?[]:If(n,hr(n))}function ER(n,i,a){return a===r&&(a=i,i=r),a!==r&&(a=Dr(a),a=a===a?a:0),i!==r&&(i=Dr(i),i=i===i?i:0),$i(Dr(n),i,a)}function vR(n,i,a){return i=Wn(i),a===r?(a=i,i=0):a=Wn(a),n=Dr(n),Om(n,i,a)}function SR(n,i,a){if(a&&typeof a!="boolean"&&or(n,i,a)&&(i=a=r),a===r&&(typeof i=="boolean"?(a=i,i=r):typeof n=="boolean"&&(a=n,n=r)),n===r&&i===r?(n=0,i=1):(n=Wn(n),i===r?(i=n,n=0):i=Wn(i)),n>i){var c=n;n=i,i=c}if(a||n%1||i%1){var y=rh();return Kt(n+y*(i-n+Le("1e-"+((y+"").length-1))),i)}return Wf(n,i)}var RR=po(function(n,i,a){return i=i.toLowerCase(),n+(a?Ng(i):i)});function Ng(n){return bl(rt(n).toLowerCase())}function $g(n){return n=rt(n),n&&n.replace(Bn,gw).replace(Nn,"")}function AR(n,i,a){n=rt(n),i=Er(i);var c=n.length;a=a===r?c:$i(We(a),0,c);var y=a;return a-=i.length,a>=0&&n.slice(a,y)==i}function TR(n){return n=rt(n),n&&Ln.test(n)?n.replace(Or,pw):n}function IR(n){return n=rt(n),n&&yt.test(n)?n.replace(Te,"\\$&"):n}var OR=po(function(n,i,a){return n+(a?"-":"")+i.toLowerCase()}),CR=po(function(n,i,a){return n+(a?" ":"")+i.toLowerCase()}),LR=Dh("toLowerCase");function PR(n,i,a){n=rt(n),i=We(i);var c=i?ao(n):0;if(!i||c>=i)return n;var y=(i-c)/2;return Ma(va(y),a)+n+Ma(Ea(y),a)}function BR(n,i,a){n=rt(n),i=We(i);var c=i?ao(n):0;return i&&c<i?n+Ma(i-c,a):n}function NR(n,i,a){n=rt(n),i=We(i);var c=i?ao(n):0;return i&&c<i?Ma(i-c,a)+n:n}function $R(n,i,a){return a||i==null?i=0:i&&(i=+i),Fw(rt(n).replace(St,""),i||0)}function MR(n,i,a){return(a?or(n,i,a):i===r)?i=1:i=We(i),qf(rt(n),i)}function xR(){var n=arguments,i=rt(n[0]);return n.length<3?i:i.replace(n[1],n[2])}var DR=po(function(n,i,a){return n+(a?"_":"")+i.toLowerCase()});function jR(n,i,a){return a&&typeof a!="number"&&or(n,i,a)&&(i=a=r),a=a===r?ae:a>>>0,a?(n=rt(n),n&&(typeof i=="string"||i!=null&&!hl(i))&&(i=Er(i),!i&&so(n))?hi(Xr(n),0,a):n.split(i,a)):[]}var UR=po(function(n,i,a){return n+(a?" ":"")+bl(i)});function kR(n,i,a){return n=rt(n),a=a==null?0:$i(We(a),0,n.length),i=Er(i),n.slice(a,a+i.length)==i}function FR(n,i,a){var c=T.templateSettings;a&&or(n,i,a)&&(i=r),n=rt(n),i=za({},i,c,qh);var y=za({},i.imports,c.imports,qh),L=jt(y),k=If(y,L),z,ee,ge=0,pe=i.interpolate||hn,we="__p += '",Ae=Cf((i.escape||hn).source+"|"+pe.source+"|"+(pe===N?Gt:hn).source+"|"+(i.evaluate||hn).source+"|$","g"),Pe="//# sourceURL="+(it.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yf+"]")+`
13
- `;n.replace(Ae,function(xe,ze,Xe,Sr,sr,Rr){return Xe||(Xe=Sr),we+=n.slice(ge,Rr).replace(gn,bw),ze&&(z=!0,we+=`' +
12
+ `)}function dE(n){return Fe(n)||ji(n)||!!(Qd&&n&&n[Qd])}function Fn(n,i){var a=typeof n;return i=i??ne,!!i&&(a=="number"||a!="symbol"&&Ii.test(n))&&n>-1&&n%1==0&&n<i}function or(n,i,a){if(!mt(a))return!1;var c=typeof i;return(c=="number"?dr(a)&&Fn(i,a.length):c=="string"&&i in a)?Qr(a[i],n):!1}function il(n,i){if(Fe(n))return!1;var a=typeof n;return a=="number"||a=="symbol"||a=="boolean"||n==null||vr(n)?!0:Ee.test(n)||!D.test(n)||i!=null&&n in ft(i)}function hE(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}function ol(n){var i=Da(n),a=T[i];if(typeof a!="function"||!(i in Je.prototype))return!1;if(n===a)return!0;var c=tl(a);return!!c&&n===c[0]}function gE(n){return!!Jd&&Jd in n}var pE=ha?Hn:vl;function fs(n){var i=n&&n.constructor,a=typeof i=="function"&&i.prototype||fo;return n===a}function Jh(n){return n===n&&!mt(n)}function Yh(n,i){return function(a){return a==null?!1:a[n]===i&&(i!==r||n in ft(a))}}function bE(n){var i=Wa(n,function(c){return a.size===p&&a.clear(),c}),a=i.cache;return i}function _E(n,i){var a=n[1],c=i[1],y=a|c,L=y<(C|B|ce),k=c==ce&&a==S||c==ce&&a==ue&&n[7].length<=i[8]||c==(ce|ue)&&i[7].length<=i[8]&&a==S;if(!(L||k))return n;c&C&&(n[2]=i[2],y|=a&C?0:P);var z=i[3];if(z){var ee=n[3];n[3]=ee?Bh(ee,z,i[4]):z,n[4]=ee?ui(n[3],b):i[4]}return z=i[5],z&&(ee=n[5],n[5]=ee?Nh(ee,z,i[6]):z,n[6]=ee?ui(n[5],b):i[6]),z=i[7],z&&(n[7]=z),c&ce&&(n[8]=n[8]==null?i[8]:Kt(n[8],i[8])),n[9]==null&&(n[9]=i[9]),n[0]=i[0],n[1]=y,n}function yE(n){var i=[];if(n!=null)for(var a in ft(n))i.push(a);return i}function wE(n){return pa.call(n)}function Xh(n,i,a){return i=Mt(i===r?n.length-1:i,0),function(){for(var c=arguments,y=-1,L=Mt(c.length-i,0),k=fe(L);++y<L;)k[y]=c[i+y];y=-1;for(var z=fe(i+1);++y<i;)z[y]=c[y];return z[i]=a(k),wr(n,this,z)}}function Zh(n,i){return i.length<2?n:Mi(n,Mr(i,0,-1))}function mE(n,i){for(var a=n.length,c=Kt(i.length,a),y=cr(n);c--;){var L=i[c];n[c]=Fn(L,a)?y[L]:r}return n}function sl(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}var Qh=tg(vh),ls=Mw||function(n,i){return De.setTimeout(n,i)},al=tg(Wm);function eg(n,i,a){var c=i+"";return al(n,cE(c,EE(uE(c),a)))}function tg(n){var i=0,a=0;return function(){var c=Uw(),y=U-(c-a);if(a=c,y>0){if(++i>=F)return arguments[0]}else i=0;return n.apply(r,arguments)}}function Ua(n,i){var a=-1,c=n.length,y=c-1;for(i=i===r?c:i;++a<i;){var L=Wf(a,y),k=n[L];n[L]=n[a],n[a]=k}return n.length=i,n}var rg=bE(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(ve,function(a,c,y,L){i.push(y?L.replace(Yr,"$1"):c||a)}),i});function yn(n){if(typeof n=="string"||vr(n))return n;var i=n+"";return i=="0"&&1/n==-1/0?"-0":i}function Di(n){if(n!=null){try{return ga.call(n)}catch{}try{return n+""}catch{}}return""}function EE(n,i){return Pr(_e,function(a){var c="_."+a[0];i&a[1]&&!fa(n,c)&&n.push(c)}),n.sort()}function ng(n){if(n instanceof Je)return n.clone();var i=new Nr(n.__wrapped__,n.__chain__);return i.__actions__=cr(n.__actions__),i.__index__=n.__index__,i.__values__=n.__values__,i}function vE(n,i,a){(a?or(n,i,a):i===r)?i=1:i=Mt(We(i),0);var c=n==null?0:n.length;if(!c||i<1)return[];for(var y=0,L=0,k=fe(Ea(c/i));y<c;)k[L++]=Mr(n,y,y+=i);return k}function SE(n){for(var i=-1,a=n==null?0:n.length,c=0,y=[];++i<a;){var L=n[i];L&&(y[c++]=L)}return y}function RE(){var n=arguments.length;if(!n)return[];for(var i=fe(n-1),a=arguments[0],c=n;c--;)i[c-1]=arguments[c];return ai(Fe(a)?cr(a):[a],Ht(i,1))}var AE=Ge(function(n,i){return Tt(n)?is(n,Ht(i,1,Tt,!0)):[]}),TE=Ge(function(n,i){var a=xr(i);return Tt(a)&&(a=r),Tt(n)?is(n,Ht(i,1,Tt,!0),$e(a,2)):[]}),IE=Ge(function(n,i){var a=xr(i);return Tt(a)&&(a=r),Tt(n)?is(n,Ht(i,1,Tt,!0),r,a):[]});function OE(n,i,a){var c=n==null?0:n.length;return c?(i=a||i===r?1:We(i),Mr(n,i<0?0:i,c)):[]}function CE(n,i,a){var c=n==null?0:n.length;return c?(i=a||i===r?1:We(i),i=c-i,Mr(n,0,i<0?0:i)):[]}function LE(n,i){return n&&n.length?Pa(n,$e(i,3),!0,!0):[]}function PE(n,i){return n&&n.length?Pa(n,$e(i,3),!0):[]}function BE(n,i,a,c){var y=n==null?0:n.length;return y?(a&&typeof a!="number"&&or(n,i,a)&&(a=0,c=y),Rm(n,i,a,c)):[]}function ig(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=a==null?0:We(a);return y<0&&(y=Mt(c+y,0)),la(n,$e(i,3),y)}function og(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=c-1;return a!==r&&(y=We(a),y=a<0?Mt(c+y,0):Kt(y,c-1)),la(n,$e(i,3),y,!0)}function sg(n){var i=n==null?0:n.length;return i?Ht(n,1):[]}function NE(n){var i=n==null?0:n.length;return i?Ht(n,V):[]}function $E(n,i){var a=n==null?0:n.length;return a?(i=i===r?1:We(i),Ht(n,i)):[]}function ME(n){for(var i=-1,a=n==null?0:n.length,c={};++i<a;){var y=n[i];c[y[0]]=y[1]}return c}function ag(n){return n&&n.length?n[0]:r}function xE(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=a==null?0:We(a);return y<0&&(y=Mt(c+y,0)),oo(n,i,y)}function DE(n){var i=n==null?0:n.length;return i?Mr(n,0,-1):[]}var jE=Ge(function(n){var i=wt(n,Kf);return i.length&&i[0]===n[0]?jf(i):[]}),UE=Ge(function(n){var i=xr(n),a=wt(n,Kf);return i===xr(a)?i=r:a.pop(),a.length&&a[0]===n[0]?jf(a,$e(i,2)):[]}),kE=Ge(function(n){var i=xr(n),a=wt(n,Kf);return i=typeof i=="function"?i:r,i&&a.pop(),a.length&&a[0]===n[0]?jf(a,r,i):[]});function FE(n,i){return n==null?"":Dw.call(n,i)}function xr(n){var i=n==null?0:n.length;return i?n[i-1]:r}function HE(n,i,a){var c=n==null?0:n.length;if(!c)return-1;var y=c;return a!==r&&(y=We(a),y=y<0?Mt(c+y,0):Kt(y,c-1)),i===i?Ew(n,i,y):la(n,Fd,y,!0)}function WE(n,i){return n&&n.length?yh(n,We(i)):r}var qE=Ge(ug);function ug(n,i){return n&&n.length&&i&&i.length?Hf(n,i):n}function GE(n,i,a){return n&&n.length&&i&&i.length?Hf(n,i,$e(a,2)):n}function VE(n,i,a){return n&&n.length&&i&&i.length?Hf(n,i,r,a):n}var zE=kn(function(n,i){var a=n==null?0:n.length,c=$f(n,i);return Eh(n,wt(i,function(y){return Fn(y,a)?+y:y}).sort(Ph)),c});function KE(n,i){var a=[];if(!(n&&n.length))return a;var c=-1,y=[],L=n.length;for(i=$e(i,3);++c<L;){var k=n[c];i(k,c,n)&&(a.push(k),y.push(c))}return Eh(n,y),a}function ul(n){return n==null?n:Fw.call(n)}function JE(n,i,a){var c=n==null?0:n.length;return c?(a&&typeof a!="number"&&or(n,i,a)?(i=0,a=c):(i=i==null?0:We(i),a=a===r?c:We(a)),Mr(n,i,a)):[]}function YE(n,i){return La(n,i)}function XE(n,i,a){return Gf(n,i,$e(a,2))}function ZE(n,i){var a=n==null?0:n.length;if(a){var c=La(n,i);if(c<a&&Qr(n[c],i))return c}return-1}function QE(n,i){return La(n,i,!0)}function ev(n,i,a){return Gf(n,i,$e(a,2),!0)}function tv(n,i){var a=n==null?0:n.length;if(a){var c=La(n,i,!0)-1;if(Qr(n[c],i))return c}return-1}function rv(n){return n&&n.length?Sh(n):[]}function nv(n,i){return n&&n.length?Sh(n,$e(i,2)):[]}function iv(n){var i=n==null?0:n.length;return i?Mr(n,1,i):[]}function ov(n,i,a){return n&&n.length?(i=a||i===r?1:We(i),Mr(n,0,i<0?0:i)):[]}function sv(n,i,a){var c=n==null?0:n.length;return c?(i=a||i===r?1:We(i),i=c-i,Mr(n,i<0?0:i,c)):[]}function av(n,i){return n&&n.length?Pa(n,$e(i,3),!1,!0):[]}function uv(n,i){return n&&n.length?Pa(n,$e(i,3)):[]}var fv=Ge(function(n){return ci(Ht(n,1,Tt,!0))}),lv=Ge(function(n){var i=xr(n);return Tt(i)&&(i=r),ci(Ht(n,1,Tt,!0),$e(i,2))}),cv=Ge(function(n){var i=xr(n);return i=typeof i=="function"?i:r,ci(Ht(n,1,Tt,!0),r,i)});function dv(n){return n&&n.length?ci(n):[]}function hv(n,i){return n&&n.length?ci(n,$e(i,2)):[]}function gv(n,i){return i=typeof i=="function"?i:r,n&&n.length?ci(n,r,i):[]}function fl(n){if(!(n&&n.length))return[];var i=0;return n=si(n,function(a){if(Tt(a))return i=Mt(a.length,i),!0}),Tf(i,function(a){return wt(n,Sf(a))})}function fg(n,i){if(!(n&&n.length))return[];var a=fl(n);return i==null?a:wt(a,function(c){return wr(i,r,c)})}var pv=Ge(function(n,i){return Tt(n)?is(n,i):[]}),bv=Ge(function(n){return zf(si(n,Tt))}),_v=Ge(function(n){var i=xr(n);return Tt(i)&&(i=r),zf(si(n,Tt),$e(i,2))}),yv=Ge(function(n){var i=xr(n);return i=typeof i=="function"?i:r,zf(si(n,Tt),r,i)}),wv=Ge(fl);function mv(n,i){return Ih(n||[],i||[],ns)}function Ev(n,i){return Ih(n||[],i||[],as)}var vv=Ge(function(n){var i=n.length,a=i>1?n[i-1]:r;return a=typeof a=="function"?(n.pop(),a):r,fg(n,a)});function lg(n){var i=T(n);return i.__chain__=!0,i}function Sv(n,i){return i(n),n}function ka(n,i){return i(n)}var Rv=kn(function(n){var i=n.length,a=i?n[0]:0,c=this.__wrapped__,y=function(L){return $f(L,n)};return i>1||this.__actions__.length||!(c instanceof Je)||!Fn(a)?this.thru(y):(c=c.slice(a,+a+(i?1:0)),c.__actions__.push({func:ka,args:[y],thisArg:r}),new Nr(c,this.__chain__).thru(function(L){return i&&!L.length&&L.push(r),L}))});function Av(){return lg(this)}function Tv(){return new Nr(this.value(),this.__chain__)}function Iv(){this.__values__===r&&(this.__values__=Rg(this.value()));var n=this.__index__>=this.__values__.length,i=n?r:this.__values__[this.__index__++];return{done:n,value:i}}function Ov(){return this}function Cv(n){for(var i,a=this;a instanceof Aa;){var c=ng(a);c.__index__=0,c.__values__=r,i?y.__wrapped__=c:i=c;var y=c;a=a.__wrapped__}return y.__wrapped__=n,i}function Lv(){var n=this.__wrapped__;if(n instanceof Je){var i=n;return this.__actions__.length&&(i=new Je(this)),i=i.reverse(),i.__actions__.push({func:ka,args:[ul],thisArg:r}),new Nr(i,this.__chain__)}return this.thru(ul)}function Pv(){return Th(this.__wrapped__,this.__actions__)}var Bv=Ba(function(n,i,a){it.call(n,a)?++n[a]:jn(n,a,1)});function Nv(n,i,a){var c=Fe(n)?Ud:Sm;return a&&or(n,i,a)&&(i=r),c(n,$e(i,3))}function $v(n,i){var a=Fe(n)?si:fh;return a(n,$e(i,3))}var Mv=Dh(ig),xv=Dh(og);function Dv(n,i){return Ht(Fa(n,i),1)}function jv(n,i){return Ht(Fa(n,i),V)}function Uv(n,i,a){return a=a===r?1:We(a),Ht(Fa(n,i),a)}function cg(n,i){var a=Fe(n)?Pr:li;return a(n,$e(i,3))}function dg(n,i){var a=Fe(n)?iw:uh;return a(n,$e(i,3))}var kv=Ba(function(n,i,a){it.call(n,a)?n[a].push(i):jn(n,a,[i])});function Fv(n,i,a,c){n=dr(n)?n:yo(n),a=a&&!c?We(a):0;var y=n.length;return a<0&&(a=Mt(y+a,0)),Va(n)?a<=y&&n.indexOf(i,a)>-1:!!y&&oo(n,i,a)>-1}var Hv=Ge(function(n,i,a){var c=-1,y=typeof i=="function",L=dr(n)?fe(n.length):[];return li(n,function(k){L[++c]=y?wr(i,k,a):os(k,i,a)}),L}),Wv=Ba(function(n,i,a){jn(n,a,i)});function Fa(n,i){var a=Fe(n)?wt:ph;return a(n,$e(i,3))}function qv(n,i,a,c){return n==null?[]:(Fe(i)||(i=i==null?[]:[i]),a=c?r:a,Fe(a)||(a=a==null?[]:[a]),wh(n,i,a))}var Gv=Ba(function(n,i,a){n[a?0:1].push(i)},function(){return[[],[]]});function Vv(n,i,a){var c=Fe(n)?Ef:Wd,y=arguments.length<3;return c(n,$e(i,4),a,y,li)}function zv(n,i,a){var c=Fe(n)?ow:Wd,y=arguments.length<3;return c(n,$e(i,4),a,y,uh)}function Kv(n,i){var a=Fe(n)?si:fh;return a(n,qa($e(i,3)))}function Jv(n){var i=Fe(n)?ih:Fm;return i(n)}function Yv(n,i,a){(a?or(n,i,a):i===r)?i=1:i=We(i);var c=Fe(n)?ym:Hm;return c(n,i)}function Xv(n){var i=Fe(n)?wm:qm;return i(n)}function Zv(n){if(n==null)return 0;if(dr(n))return Va(n)?ao(n):n.length;var i=Jt(n);return i==E||i==Ue?n.size:kf(n).length}function Qv(n,i,a){var c=Fe(n)?vf:Gm;return a&&or(n,i,a)&&(i=r),c(n,$e(i,3))}var eS=Ge(function(n,i){if(n==null)return[];var a=i.length;return a>1&&or(n,i[0],i[1])?i=[]:a>2&&or(i[0],i[1],i[2])&&(i=[i[0]]),wh(n,Ht(i,1),[])}),Ha=$w||function(){return De.Date.now()};function tS(n,i){if(typeof i!="function")throw new Br(f);return n=We(n),function(){if(--n<1)return i.apply(this,arguments)}}function hg(n,i,a){return i=a?r:i,i=n&&i==null?n.length:i,Un(n,ce,r,r,r,r,i)}function gg(n,i){var a;if(typeof i!="function")throw new Br(f);return n=We(n),function(){return--n>0&&(a=i.apply(this,arguments)),n<=1&&(i=r),a}}var ll=Ge(function(n,i,a){var c=C;if(a.length){var y=ui(a,bo(ll));c|=j}return Un(n,c,i,a,y)}),pg=Ge(function(n,i,a){var c=C|B;if(a.length){var y=ui(a,bo(pg));c|=j}return Un(i,c,n,a,y)});function bg(n,i,a){i=a?r:i;var c=Un(n,S,r,r,r,r,r,i);return c.placeholder=bg.placeholder,c}function _g(n,i,a){i=a?r:i;var c=Un(n,m,r,r,r,r,r,i);return c.placeholder=_g.placeholder,c}function yg(n,i,a){var c,y,L,k,z,ee,ge=0,pe=!1,we=!1,Ae=!0;if(typeof n!="function")throw new Br(f);i=Dr(i)||0,mt(a)&&(pe=!!a.leading,we="maxWait"in a,L=we?Mt(Dr(a.maxWait)||0,i):L,Ae="trailing"in a?!!a.trailing:Ae);function Pe(It){var en=c,qn=y;return c=y=r,ge=It,k=n.apply(qn,en),k}function Me(It){return ge=It,z=ls(ze,i),pe?Pe(It):k}function qe(It){var en=It-ee,qn=It-ge,Dg=i-en;return we?Kt(Dg,L-qn):Dg}function xe(It){var en=It-ee,qn=It-ge;return ee===r||en>=i||en<0||we&&qn>=L}function ze(){var It=Ha();if(xe(It))return Xe(It);z=ls(ze,qe(It))}function Xe(It){return z=r,Ae&&c?Pe(It):(c=y=r,k)}function Sr(){z!==r&&Oh(z),ge=0,c=ee=y=z=r}function sr(){return z===r?k:Xe(Ha())}function Rr(){var It=Ha(),en=xe(It);if(c=arguments,y=this,ee=It,en){if(z===r)return Me(ee);if(we)return Oh(z),z=ls(ze,i),Pe(ee)}return z===r&&(z=ls(ze,i)),k}return Rr.cancel=Sr,Rr.flush=sr,Rr}var rS=Ge(function(n,i){return ah(n,1,i)}),nS=Ge(function(n,i,a){return ah(n,Dr(i)||0,a)});function iS(n){return Un(n,te)}function Wa(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new Br(f);var a=function(){var c=arguments,y=i?i.apply(this,c):c[0],L=a.cache;if(L.has(y))return L.get(y);var k=n.apply(this,c);return a.cache=L.set(y,k)||L,k};return a.cache=new(Wa.Cache||Dn),a}Wa.Cache=Dn;function qa(n){if(typeof n!="function")throw new Br(f);return function(){var i=arguments;switch(i.length){case 0:return!n.call(this);case 1:return!n.call(this,i[0]);case 2:return!n.call(this,i[0],i[1]);case 3:return!n.call(this,i[0],i[1],i[2])}return!n.apply(this,i)}}function oS(n){return gg(2,n)}var sS=Vm(function(n,i){i=i.length==1&&Fe(i[0])?wt(i[0],mr($e())):wt(Ht(i,1),mr($e()));var a=i.length;return Ge(function(c){for(var y=-1,L=Kt(c.length,a);++y<L;)c[y]=i[y].call(this,c[y]);return wr(n,this,c)})}),cl=Ge(function(n,i){var a=ui(i,bo(cl));return Un(n,j,r,i,a)}),wg=Ge(function(n,i){var a=ui(i,bo(wg));return Un(n,Q,r,i,a)}),aS=kn(function(n,i){return Un(n,ue,r,r,r,i)});function uS(n,i){if(typeof n!="function")throw new Br(f);return i=i===r?i:We(i),Ge(n,i)}function fS(n,i){if(typeof n!="function")throw new Br(f);return i=i==null?0:Mt(We(i),0),Ge(function(a){var c=a[i],y=hi(a,0,i);return c&&ai(y,c),wr(n,this,y)})}function lS(n,i,a){var c=!0,y=!0;if(typeof n!="function")throw new Br(f);return mt(a)&&(c="leading"in a?!!a.leading:c,y="trailing"in a?!!a.trailing:y),yg(n,i,{leading:c,maxWait:i,trailing:y})}function cS(n){return hg(n,1)}function dS(n,i){return cl(Jf(i),n)}function hS(){if(!arguments.length)return[];var n=arguments[0];return Fe(n)?n:[n]}function gS(n){return $r(n,A)}function pS(n,i){return i=typeof i=="function"?i:r,$r(n,A,i)}function bS(n){return $r(n,w|A)}function _S(n,i){return i=typeof i=="function"?i:r,$r(n,w|A,i)}function yS(n,i){return i==null||sh(n,i,jt(i))}function Qr(n,i){return n===i||n!==n&&i!==i}var wS=xa(Df),mS=xa(function(n,i){return n>=i}),ji=dh(function(){return arguments}())?dh:function(n){return Rt(n)&&it.call(n,"callee")&&!Zd.call(n,"callee")},Fe=fe.isArray,ES=io?mr(io):Cm;function dr(n){return n!=null&&Ga(n.length)&&!Hn(n)}function Tt(n){return Rt(n)&&dr(n)}function vS(n){return n===!0||n===!1||Rt(n)&&ir(n)==q}var gi=xw||vl,SS=Yo?mr(Yo):Lm;function RS(n){return Rt(n)&&n.nodeType===1&&!cs(n)}function AS(n){if(n==null)return!0;if(dr(n)&&(Fe(n)||typeof n=="string"||typeof n.splice=="function"||gi(n)||_o(n)||ji(n)))return!n.length;var i=Jt(n);if(i==E||i==Ue)return!n.size;if(fs(n))return!kf(n).length;for(var a in n)if(it.call(n,a))return!1;return!0}function TS(n,i){return ss(n,i)}function IS(n,i,a){a=typeof a=="function"?a:r;var c=a?a(n,i):r;return c===r?ss(n,i,r,a):!!c}function dl(n){if(!Rt(n))return!1;var i=ir(n);return i==d||i==ye||typeof n.message=="string"&&typeof n.name=="string"&&!cs(n)}function OS(n){return typeof n=="number"&&eh(n)}function Hn(n){if(!mt(n))return!1;var i=ir(n);return i==g||i==_||i==O||i==Be}function mg(n){return typeof n=="number"&&n==We(n)}function Ga(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ne}function mt(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}function Rt(n){return n!=null&&typeof n=="object"}var Eg=Md?mr(Md):Bm;function CS(n,i){return n===i||Uf(n,i,rl(i))}function LS(n,i,a){return a=typeof a=="function"?a:r,Uf(n,i,rl(i),a)}function PS(n){return vg(n)&&n!=+n}function BS(n){if(pE(n))throw new ke(u);return hh(n)}function NS(n){return n===null}function $S(n){return n==null}function vg(n){return typeof n=="number"||Rt(n)&&ir(n)==J}function cs(n){if(!Rt(n)||ir(n)!=se)return!1;var i=ya(n);if(i===null)return!0;var a=it.call(i,"constructor")&&i.constructor;return typeof a=="function"&&a instanceof a&&ga.call(a)==Lw}var hl=xd?mr(xd):Nm;function MS(n){return mg(n)&&n>=-9007199254740991&&n<=ne}var Sg=Dd?mr(Dd):$m;function Va(n){return typeof n=="string"||!Fe(n)&&Rt(n)&&ir(n)==Re}function vr(n){return typeof n=="symbol"||Rt(n)&&ir(n)==He}var _o=jd?mr(jd):Mm;function xS(n){return n===r}function DS(n){return Rt(n)&&Jt(n)==et}function jS(n){return Rt(n)&&ir(n)==_t}var US=xa(Ff),kS=xa(function(n,i){return n<=i});function Rg(n){if(!n)return[];if(dr(n))return Va(n)?Xr(n):cr(n);if(Zo&&n[Zo])return yw(n[Zo]());var i=Jt(n),a=i==E?Of:i==Ue?ca:yo;return a(n)}function Wn(n){if(!n)return n===0?n:0;if(n=Dr(n),n===V||n===-1/0){var i=n<0?-1:1;return i*W}return n===n?n:0}function We(n){var i=Wn(n),a=i%1;return i===i?a?i-a:i:0}function Ag(n){return n?$i(We(n),0,ae):0}function Dr(n){if(typeof n=="number")return n;if(vr(n))return K;if(mt(n)){var i=typeof n.valueOf=="function"?n.valueOf():n;n=mt(i)?i+"":i}if(typeof n!="string")return n===0?n:+n;n=qd(n);var a=nr.test(n);return a||Ti.test(n)?Ke(n.slice(2),a?2:8):yr.test(n)?K:+n}function Tg(n){return _n(n,hr(n))}function FS(n){return n?$i(We(n),-9007199254740991,ne):n===0?n:0}function rt(n){return n==null?"":Er(n)}var HS=go(function(n,i){if(fs(i)||dr(i)){_n(i,jt(i),n);return}for(var a in i)it.call(i,a)&&ns(n,a,i[a])}),Ig=go(function(n,i){_n(i,hr(i),n)}),za=go(function(n,i,a,c){_n(i,hr(i),n,c)}),WS=go(function(n,i,a,c){_n(i,jt(i),n,c)}),qS=kn($f);function GS(n,i){var a=ho(n);return i==null?a:oh(a,i)}var VS=Ge(function(n,i){n=ft(n);var a=-1,c=i.length,y=c>2?i[2]:r;for(y&&or(i[0],i[1],y)&&(c=1);++a<c;)for(var L=i[a],k=hr(L),z=-1,ee=k.length;++z<ee;){var ge=k[z],pe=n[ge];(pe===r||Qr(pe,fo[ge])&&!it.call(n,ge))&&(n[ge]=L[ge])}return n}),zS=Ge(function(n){return n.push(r,qh),wr(Og,r,n)});function KS(n,i){return kd(n,$e(i,3),bn)}function JS(n,i){return kd(n,$e(i,3),xf)}function YS(n,i){return n==null?n:Mf(n,$e(i,3),hr)}function XS(n,i){return n==null?n:lh(n,$e(i,3),hr)}function ZS(n,i){return n&&bn(n,$e(i,3))}function QS(n,i){return n&&xf(n,$e(i,3))}function eR(n){return n==null?[]:Oa(n,jt(n))}function tR(n){return n==null?[]:Oa(n,hr(n))}function gl(n,i,a){var c=n==null?r:Mi(n,i);return c===r?a:c}function rR(n,i){return n!=null&&zh(n,i,Am)}function pl(n,i){return n!=null&&zh(n,i,Tm)}var nR=Uh(function(n,i,a){i!=null&&typeof i.toString!="function"&&(i=pa.call(i)),n[i]=a},_l(gr)),iR=Uh(function(n,i,a){i!=null&&typeof i.toString!="function"&&(i=pa.call(i)),it.call(n,i)?n[i].push(a):n[i]=[a]},$e),oR=Ge(os);function jt(n){return dr(n)?nh(n):kf(n)}function hr(n){return dr(n)?nh(n,!0):xm(n)}function sR(n,i){var a={};return i=$e(i,3),bn(n,function(c,y,L){jn(a,i(c,y,L),c)}),a}function aR(n,i){var a={};return i=$e(i,3),bn(n,function(c,y,L){jn(a,y,i(c,y,L))}),a}var uR=go(function(n,i,a){Ca(n,i,a)}),Og=go(function(n,i,a,c){Ca(n,i,a,c)}),fR=kn(function(n,i){var a={};if(n==null)return a;var c=!1;i=wt(i,function(L){return L=di(L,n),c||(c=L.length>1),L}),_n(n,el(n),a),c&&(a=$r(a,w|I|A,nE));for(var y=i.length;y--;)Vf(a,i[y]);return a});function lR(n,i){return Cg(n,qa($e(i)))}var cR=kn(function(n,i){return n==null?{}:jm(n,i)});function Cg(n,i){if(n==null)return{};var a=wt(el(n),function(c){return[c]});return i=$e(i),mh(n,a,function(c,y){return i(c,y[0])})}function dR(n,i,a){i=di(i,n);var c=-1,y=i.length;for(y||(y=1,n=r);++c<y;){var L=n==null?r:n[yn(i[c])];L===r&&(c=y,L=a),n=Hn(L)?L.call(n):L}return n}function hR(n,i,a){return n==null?n:as(n,i,a)}function gR(n,i,a,c){return c=typeof c=="function"?c:r,n==null?n:as(n,i,a,c)}var Lg=Hh(jt),Pg=Hh(hr);function pR(n,i,a){var c=Fe(n),y=c||gi(n)||_o(n);if(i=$e(i,4),a==null){var L=n&&n.constructor;y?a=c?new L:[]:mt(n)?a=Hn(L)?ho(ya(n)):{}:a={}}return(y?Pr:bn)(n,function(k,z,ee){return i(a,k,z,ee)}),a}function bR(n,i){return n==null?!0:Vf(n,i)}function _R(n,i,a){return n==null?n:Ah(n,i,Jf(a))}function yR(n,i,a,c){return c=typeof c=="function"?c:r,n==null?n:Ah(n,i,Jf(a),c)}function yo(n){return n==null?[]:If(n,jt(n))}function wR(n){return n==null?[]:If(n,hr(n))}function mR(n,i,a){return a===r&&(a=i,i=r),a!==r&&(a=Dr(a),a=a===a?a:0),i!==r&&(i=Dr(i),i=i===i?i:0),$i(Dr(n),i,a)}function ER(n,i,a){return i=Wn(i),a===r?(a=i,i=0):a=Wn(a),n=Dr(n),Im(n,i,a)}function vR(n,i,a){if(a&&typeof a!="boolean"&&or(n,i,a)&&(i=a=r),a===r&&(typeof i=="boolean"?(a=i,i=r):typeof n=="boolean"&&(a=n,n=r)),n===r&&i===r?(n=0,i=1):(n=Wn(n),i===r?(i=n,n=0):i=Wn(i)),n>i){var c=n;n=i,i=c}if(a||n%1||i%1){var y=th();return Kt(n+y*(i-n+Le("1e-"+((y+"").length-1))),i)}return Wf(n,i)}var SR=po(function(n,i,a){return i=i.toLowerCase(),n+(a?Bg(i):i)});function Bg(n){return bl(rt(n).toLowerCase())}function Ng(n){return n=rt(n),n&&n.replace(Bn,hw).replace(Nn,"")}function RR(n,i,a){n=rt(n),i=Er(i);var c=n.length;a=a===r?c:$i(We(a),0,c);var y=a;return a-=i.length,a>=0&&n.slice(a,y)==i}function AR(n){return n=rt(n),n&&Ln.test(n)?n.replace(Or,gw):n}function TR(n){return n=rt(n),n&&yt.test(n)?n.replace(Te,"\\$&"):n}var IR=po(function(n,i,a){return n+(a?"-":"")+i.toLowerCase()}),OR=po(function(n,i,a){return n+(a?" ":"")+i.toLowerCase()}),CR=xh("toLowerCase");function LR(n,i,a){n=rt(n),i=We(i);var c=i?ao(n):0;if(!i||c>=i)return n;var y=(i-c)/2;return Ma(va(y),a)+n+Ma(Ea(y),a)}function PR(n,i,a){n=rt(n),i=We(i);var c=i?ao(n):0;return i&&c<i?n+Ma(i-c,a):n}function BR(n,i,a){n=rt(n),i=We(i);var c=i?ao(n):0;return i&&c<i?Ma(i-c,a)+n:n}function NR(n,i,a){return a||i==null?i=0:i&&(i=+i),kw(rt(n).replace(St,""),i||0)}function $R(n,i,a){return(a?or(n,i,a):i===r)?i=1:i=We(i),qf(rt(n),i)}function MR(){var n=arguments,i=rt(n[0]);return n.length<3?i:i.replace(n[1],n[2])}var xR=po(function(n,i,a){return n+(a?"_":"")+i.toLowerCase()});function DR(n,i,a){return a&&typeof a!="number"&&or(n,i,a)&&(i=a=r),a=a===r?ae:a>>>0,a?(n=rt(n),n&&(typeof i=="string"||i!=null&&!hl(i))&&(i=Er(i),!i&&so(n))?hi(Xr(n),0,a):n.split(i,a)):[]}var jR=po(function(n,i,a){return n+(a?" ":"")+bl(i)});function UR(n,i,a){return n=rt(n),a=a==null?0:$i(We(a),0,n.length),i=Er(i),n.slice(a,a+i.length)==i}function kR(n,i,a){var c=T.templateSettings;a&&or(n,i,a)&&(i=r),n=rt(n),i=za({},i,c,Wh);var y=za({},i.imports,c.imports,Wh),L=jt(y),k=If(y,L),z,ee,ge=0,pe=i.interpolate||hn,we="__p += '",Ae=Cf((i.escape||hn).source+"|"+pe.source+"|"+(pe===N?Gt:hn).source+"|"+(i.evaluate||hn).source+"|$","g"),Pe="//# sourceURL="+(it.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yf+"]")+`
13
+ `;n.replace(Ae,function(xe,ze,Xe,Sr,sr,Rr){return Xe||(Xe=Sr),we+=n.slice(ge,Rr).replace(gn,pw),ze&&(z=!0,we+=`' +
14
14
  __e(`+ze+`) +
15
15
  '`),sr&&(ee=!0,we+=`';
16
16
  `+sr+`;
@@ -26,12 +26,12 @@ __p += '`),Xe&&(we+=`' +
26
26
  function print() { __p += __j.call(arguments, '') }
27
27
  `:`;
28
28
  `)+we+`return __p
29
- }`;var qe=xg(function(){return Qe(L,Pe+"return "+we).apply(r,k)});if(qe.source=we,dl(qe))throw qe;return qe}function HR(n){return rt(n).toLowerCase()}function WR(n){return rt(n).toUpperCase()}function qR(n,i,a){if(n=rt(n),n&&(a||i===r))return Gd(n);if(!n||!(i=Er(i)))return n;var c=Xr(n),y=Xr(i),L=Vd(c,y),k=zd(c,y)+1;return hi(c,L,k).join("")}function GR(n,i,a){if(n=rt(n),n&&(a||i===r))return n.slice(0,Jd(n)+1);if(!n||!(i=Er(i)))return n;var c=Xr(n),y=zd(c,Xr(i))+1;return hi(c,0,y).join("")}function VR(n,i,a){if(n=rt(n),n&&(a||i===r))return n.replace(St,"");if(!n||!(i=Er(i)))return n;var c=Xr(n),y=Vd(c,Xr(i));return hi(c,y).join("")}function zR(n,i){var a=Se,c=me;if(mt(i)){var y="separator"in i?i.separator:y;a="length"in i?We(i.length):a,c="omission"in i?Er(i.omission):c}n=rt(n);var L=n.length;if(so(n)){var k=Xr(n);L=k.length}if(a>=L)return n;var z=a-ao(c);if(z<1)return c;var ee=k?hi(k,0,z).join(""):n.slice(0,z);if(y===r)return ee+c;if(k&&(z+=ee.length-z),hl(y)){if(n.slice(z).search(y)){var ge,pe=ee;for(y.global||(y=Cf(y.source,rt(Cr.exec(y))+"g")),y.lastIndex=0;ge=y.exec(pe);)var we=ge.index;ee=ee.slice(0,we===r?z:we)}}else if(n.indexOf(Er(y),z)!=z){var Ae=ee.lastIndexOf(y);Ae>-1&&(ee=ee.slice(0,Ae))}return ee+c}function KR(n){return n=rt(n),n&&rr.test(n)?n.replace(tr,Sw):n}var JR=po(function(n,i,a){return n+(a?" ":"")+i.toUpperCase()}),bl=Dh("toUpperCase");function Mg(n,i,a){return n=rt(n),i=a?r:i,i===r?yw(n)?Tw(n):fw(n):n.match(i)||[]}var xg=Ge(function(n,i){try{return wr(n,r,i)}catch(a){return dl(a)?a:new ke(a)}}),YR=kn(function(n,i){return Pr(i,function(a){a=yn(a),jn(n,a,ll(n[a],n))}),n});function XR(n){var i=n==null?0:n.length,a=$e();return n=i?wt(n,function(c){if(typeof c[1]!="function")throw new Br(f);return[a(c[0]),c[1]]}):[],Ge(function(c){for(var y=-1;++y<i;){var L=n[y];if(wr(L[0],this,c))return wr(L[1],this,c)}})}function ZR(n){return Sm($r(n,w))}function _l(n){return function(){return n}}function QR(n,i){return n==null||n!==n?i:n}var e1=Uh(),t1=Uh(!0);function gr(n){return n}function yl(n){return ph(typeof n=="function"?n:$r(n,w))}function r1(n){return _h($r(n,w))}function n1(n,i){return yh(n,$r(i,w))}var i1=Ge(function(n,i){return function(a){return os(a,n,i)}}),o1=Ge(function(n,i){return function(a){return os(n,a,i)}});function wl(n,i,a){var c=jt(i),y=Oa(i,c);a==null&&!(mt(i)&&(y.length||!c.length))&&(a=i,i=n,n=this,y=Oa(i,jt(i)));var L=!(mt(a)&&"chain"in a)||!!a.chain,k=Hn(n);return Pr(y,function(z){var ee=i[z];n[z]=ee,k&&(n.prototype[z]=function(){var ge=this.__chain__;if(L||ge){var pe=n(this.__wrapped__),we=pe.__actions__=cr(this.__actions__);return we.push({func:ee,args:arguments,thisArg:n}),pe.__chain__=ge,pe}return ee.apply(n,ai([this.value()],arguments))})}),n}function s1(){return De._===this&&(De._=Bw),this}function ml(){}function a1(n){return n=We(n),Ge(function(i){return wh(i,n)})}var u1=Xf(wt),f1=Xf(kd),l1=Xf(vf);function Dg(n){return il(n)?Sf(yn(n)):km(n)}function c1(n){return function(i){return n==null?r:Mi(n,i)}}var d1=Fh(),h1=Fh(!0);function El(){return[]}function vl(){return!1}function g1(){return{}}function p1(){return""}function b1(){return!0}function _1(n,i){if(n=We(n),n<1||n>ne)return[];var a=ae,c=Kt(n,ae);i=$e(i),n-=ae;for(var y=Tf(c,i);++a<n;)i(a);return y}function y1(n){return Fe(n)?wt(n,yn):vr(n)?[n]:cr(ng(rt(n)))}function w1(n){var i=++Lw;return rt(n)+i}var m1=$a(function(n,i){return n+i},0),E1=Zf("ceil"),v1=$a(function(n,i){return n/i},1),S1=Zf("floor");function R1(n){return n&&n.length?Ia(n,gr,Df):r}function A1(n,i){return n&&n.length?Ia(n,$e(i,2),Df):r}function T1(n){return Wd(n,gr)}function I1(n,i){return Wd(n,$e(i,2))}function O1(n){return n&&n.length?Ia(n,gr,Ff):r}function C1(n,i){return n&&n.length?Ia(n,$e(i,2),Ff):r}var L1=$a(function(n,i){return n*i},1),P1=Zf("round"),B1=$a(function(n,i){return n-i},0);function N1(n){return n&&n.length?Af(n,gr):0}function $1(n,i){return n&&n.length?Af(n,$e(i,2)):0}return T.after=rS,T.ary=gg,T.assign=WS,T.assignIn=Og,T.assignInWith=za,T.assignWith=qS,T.at=GS,T.before=pg,T.bind=ll,T.bindAll=YR,T.bindKey=bg,T.castArray=gS,T.chain=cg,T.chunk=SE,T.compact=RE,T.concat=AE,T.cond=XR,T.conforms=ZR,T.constant=_l,T.countBy=Nv,T.create=VS,T.curry=_g,T.curryRight=yg,T.debounce=wg,T.defaults=zS,T.defaultsDeep=KS,T.defer=nS,T.delay=iS,T.difference=TE,T.differenceBy=IE,T.differenceWith=OE,T.drop=CE,T.dropRight=LE,T.dropRightWhile=PE,T.dropWhile=BE,T.fill=NE,T.filter=Mv,T.flatMap=jv,T.flatMapDeep=Uv,T.flatMapDepth=kv,T.flatten=ag,T.flattenDeep=$E,T.flattenDepth=ME,T.flip=oS,T.flow=e1,T.flowRight=t1,T.fromPairs=xE,T.functions=tR,T.functionsIn=rR,T.groupBy=Fv,T.initial=jE,T.intersection=UE,T.intersectionBy=kE,T.intersectionWith=FE,T.invert=iR,T.invertBy=oR,T.invokeMap=Wv,T.iteratee=yl,T.keyBy=qv,T.keys=jt,T.keysIn=hr,T.map=Fa,T.mapKeys=aR,T.mapValues=uR,T.matches=r1,T.matchesProperty=n1,T.memoize=Wa,T.merge=fR,T.mergeWith=Cg,T.method=i1,T.methodOf=o1,T.mixin=wl,T.negate=qa,T.nthArg=a1,T.omit=lR,T.omitBy=cR,T.once=sS,T.orderBy=Gv,T.over=u1,T.overArgs=aS,T.overEvery=f1,T.overSome=l1,T.partial=cl,T.partialRight=mg,T.partition=Vv,T.pick=dR,T.pickBy=Lg,T.property=Dg,T.propertyOf=c1,T.pull=GE,T.pullAll=fg,T.pullAllBy=VE,T.pullAllWith=zE,T.pullAt=KE,T.range=d1,T.rangeRight=h1,T.rearg=uS,T.reject=Jv,T.remove=JE,T.rest=fS,T.reverse=ul,T.sampleSize=Xv,T.set=gR,T.setWith=pR,T.shuffle=Zv,T.slice=YE,T.sortBy=tS,T.sortedUniq=nv,T.sortedUniqBy=iv,T.split=jR,T.spread=lS,T.tail=ov,T.take=sv,T.takeRight=av,T.takeRightWhile=uv,T.takeWhile=fv,T.tap=Rv,T.throttle=cS,T.thru=ka,T.toArray=Ag,T.toPairs=Pg,T.toPairsIn=Bg,T.toPath=y1,T.toPlainObject=Ig,T.transform=bR,T.unary=dS,T.union=lv,T.unionBy=cv,T.unionWith=dv,T.uniq=hv,T.uniqBy=gv,T.uniqWith=pv,T.unset=_R,T.unzip=fl,T.unzipWith=lg,T.update=yR,T.updateWith=wR,T.values=yo,T.valuesIn=mR,T.without=bv,T.words=Mg,T.wrap=hS,T.xor=_v,T.xorBy=yv,T.xorWith=wv,T.zip=mv,T.zipObject=Ev,T.zipObjectDeep=vv,T.zipWith=Sv,T.entries=Pg,T.entriesIn=Bg,T.extend=Og,T.extendWith=za,wl(T,T),T.add=m1,T.attempt=xg,T.camelCase=RR,T.capitalize=Ng,T.ceil=E1,T.clamp=ER,T.clone=pS,T.cloneDeep=_S,T.cloneDeepWith=yS,T.cloneWith=bS,T.conformsTo=wS,T.deburr=$g,T.defaultTo=QR,T.divide=v1,T.endsWith=AR,T.eq=Qr,T.escape=TR,T.escapeRegExp=IR,T.every=$v,T.find=xv,T.findIndex=og,T.findKey=JS,T.findLast=Dv,T.findLastIndex=sg,T.findLastKey=YS,T.floor=S1,T.forEach=dg,T.forEachRight=hg,T.forIn=XS,T.forInRight=ZS,T.forOwn=QS,T.forOwnRight=eR,T.get=gl,T.gt=mS,T.gte=ES,T.has=nR,T.hasIn=pl,T.head=ug,T.identity=gr,T.includes=Hv,T.indexOf=DE,T.inRange=vR,T.invoke=sR,T.isArguments=ji,T.isArray=Fe,T.isArrayBuffer=vS,T.isArrayLike=dr,T.isArrayLikeObject=Tt,T.isBoolean=SS,T.isBuffer=gi,T.isDate=RS,T.isElement=AS,T.isEmpty=TS,T.isEqual=IS,T.isEqualWith=OS,T.isError=dl,T.isFinite=CS,T.isFunction=Hn,T.isInteger=Eg,T.isLength=Ga,T.isMap=vg,T.isMatch=LS,T.isMatchWith=PS,T.isNaN=BS,T.isNative=NS,T.isNil=MS,T.isNull=$S,T.isNumber=Sg,T.isObject=mt,T.isObjectLike=Rt,T.isPlainObject=cs,T.isRegExp=hl,T.isSafeInteger=xS,T.isSet=Rg,T.isString=Va,T.isSymbol=vr,T.isTypedArray=_o,T.isUndefined=DS,T.isWeakMap=jS,T.isWeakSet=US,T.join=HE,T.kebabCase=OR,T.last=xr,T.lastIndexOf=WE,T.lowerCase=CR,T.lowerFirst=LR,T.lt=kS,T.lte=FS,T.max=R1,T.maxBy=A1,T.mean=T1,T.meanBy=I1,T.min=O1,T.minBy=C1,T.stubArray=El,T.stubFalse=vl,T.stubObject=g1,T.stubString=p1,T.stubTrue=b1,T.multiply=L1,T.nth=qE,T.noConflict=s1,T.noop=ml,T.now=Ha,T.pad=PR,T.padEnd=BR,T.padStart=NR,T.parseInt=$R,T.random=SR,T.reduce=zv,T.reduceRight=Kv,T.repeat=MR,T.replace=xR,T.result=hR,T.round=P1,T.runInContext=Z,T.sample=Yv,T.size=Qv,T.snakeCase=DR,T.some=eS,T.sortedIndex=XE,T.sortedIndexBy=ZE,T.sortedIndexOf=QE,T.sortedLastIndex=ev,T.sortedLastIndexBy=tv,T.sortedLastIndexOf=rv,T.startCase=UR,T.startsWith=kR,T.subtract=B1,T.sum=N1,T.sumBy=$1,T.template=FR,T.times=_1,T.toFinite=Wn,T.toInteger=We,T.toLength=Tg,T.toLower=HR,T.toNumber=Dr,T.toSafeInteger=HS,T.toString=rt,T.toUpper=WR,T.trim=qR,T.trimEnd=GR,T.trimStart=VR,T.truncate=zR,T.unescape=KR,T.uniqueId=w1,T.upperCase=JR,T.upperFirst=bl,T.each=dg,T.eachRight=hg,T.first=ug,wl(T,function(){var n={};return bn(T,function(i,a){it.call(T.prototype,a)||(n[a]=i)}),n}(),{chain:!1}),T.VERSION=o,Pr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){T[n].placeholder=T}),Pr(["drop","take"],function(n,i){Je.prototype[n]=function(a){a=a===r?1:Mt(We(a),0);var c=this.__filtered__&&!i?new Je(this):this.clone();return c.__filtered__?c.__takeCount__=Kt(a,c.__takeCount__):c.__views__.push({size:Kt(a,ae),type:n+(c.__dir__<0?"Right":"")}),c},Je.prototype[n+"Right"]=function(a){return this.reverse()[n](a).reverse()}}),Pr(["filter","map","takeWhile"],function(n,i){var a=i+1,c=a==$||a==Y;Je.prototype[n]=function(y){var L=this.clone();return L.__iteratees__.push({iteratee:$e(y,3),type:a}),L.__filtered__=L.__filtered__||c,L}}),Pr(["head","last"],function(n,i){var a="take"+(i?"Right":"");Je.prototype[n]=function(){return this[a](1).value()[0]}}),Pr(["initial","tail"],function(n,i){var a="drop"+(i?"":"Right");Je.prototype[n]=function(){return this.__filtered__?new Je(this):this[a](1)}}),Je.prototype.compact=function(){return this.filter(gr)},Je.prototype.find=function(n){return this.filter(n).head()},Je.prototype.findLast=function(n){return this.reverse().find(n)},Je.prototype.invokeMap=Ge(function(n,i){return typeof n=="function"?new Je(this):this.map(function(a){return os(a,n,i)})}),Je.prototype.reject=function(n){return this.filter(qa($e(n)))},Je.prototype.slice=function(n,i){n=We(n);var a=this;return a.__filtered__&&(n>0||i<0)?new Je(a):(n<0?a=a.takeRight(-n):n&&(a=a.drop(n)),i!==r&&(i=We(i),a=i<0?a.dropRight(-i):a.take(i-n)),a)},Je.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Je.prototype.toArray=function(){return this.take(ae)},bn(Je.prototype,function(n,i){var a=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),y=T[c?"take"+(i=="last"?"Right":""):i],L=c||/^find/.test(i);y&&(T.prototype[i]=function(){var k=this.__wrapped__,z=c?[1]:arguments,ee=k instanceof Je,ge=z[0],pe=ee||Fe(k),we=function(ze){var Xe=y.apply(T,ai([ze],z));return c&&Ae?Xe[0]:Xe};pe&&a&&typeof ge=="function"&&ge.length!=1&&(ee=pe=!1);var Ae=this.__chain__,Pe=!!this.__actions__.length,Me=L&&!Ae,qe=ee&&!Pe;if(!L&&pe){k=qe?k:new Je(this);var xe=n.apply(k,z);return xe.__actions__.push({func:ka,args:[we],thisArg:r}),new Nr(xe,Ae)}return Me&&qe?n.apply(this,z):(xe=this.thru(we),Me?c?xe.value()[0]:xe.value():xe)})}),Pr(["pop","push","shift","sort","splice","unshift"],function(n){var i=da[n],a=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",c=/^(?:pop|shift)$/.test(n);T.prototype[n]=function(){var y=arguments;if(c&&!this.__chain__){var L=this.value();return i.apply(Fe(L)?L:[],y)}return this[a](function(k){return i.apply(Fe(k)?k:[],y)})}}),bn(Je.prototype,function(n,i){var a=T[i];if(a){var c=a.name+"";it.call(co,c)||(co[c]=[]),co[c].push({name:i,func:a})}}),co[Na(r,B).name]=[{name:"wrapper",func:r}],Je.prototype.clone=Kw,Je.prototype.reverse=Jw,Je.prototype.value=Yw,T.prototype.at=Av,T.prototype.chain=Tv,T.prototype.commit=Iv,T.prototype.next=Ov,T.prototype.plant=Lv,T.prototype.reverse=Pv,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=Bv,T.prototype.first=T.prototype.head,Zo&&(T.prototype[Zo]=Cv),T},uo=Iw();Nt?((Nt.exports=uo)._=uo,st._=uo):De._=uo}).call(H.commonjsGlobal)})(vu,vu.exports);vu.exports;yA();const ys={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},En={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state"},oB={GET_PROVIDER_STATE:"wallet_get_provider_state"},ic={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function sB(e){return function(r,o,s){s(u=>{o.error&&mu.warn(`Error in RPC response:
30
- `,o),!r.isTorusInternal&&(mu.info(`RPC (${e.origin}):`,r,"->",o),u())})}}var yb;(function(e){e.approved="approved",e.cancelled="cancelled",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired"})(yb||(yb={}));var Uc={exports:{}},F0=H.requireEvents().EventEmitter,oc,wb;function aB(){if(wb)return oc;wb=1;function e(x,v){var C=Object.keys(x);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(x);v&&(B=B.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),C.push.apply(C,B)}return C}function t(x){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?e(Object(C),!0).forEach(function(B){r(x,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(C)):e(Object(C)).forEach(function(B){Object.defineProperty(x,B,Object.getOwnPropertyDescriptor(C,B))})}return x}function r(x,v,C){return v=f(v),v in x?Object.defineProperty(x,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[v]=C,x}function o(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function s(x,v){for(var C=0;C<v.length;C++){var B=v[C];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(x,f(B.key),B)}}function u(x,v,C){return v&&s(x.prototype,v),Object.defineProperty(x,"prototype",{writable:!1}),x}function f(x){var v=h(x,"string");return typeof v=="symbol"?v:String(v)}function h(x,v){if(typeof x!="object"||x===null)return x;var C=x[Symbol.toPrimitive];if(C!==void 0){var B=C.call(x,v);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}var l=H.bufferPolyfill,p=l.Buffer,b=H.require$$3,w=b.inspect,I=w&&w.custom||"inspect";function A(x,v,C){p.prototype.copy.call(x,v,C)}return oc=function(){function x(){o(this,x),this.head=null,this.tail=null,this.length=0}return u(x,[{key:"push",value:function(C){var B={data:C,next:null};this.length>0?this.tail.next=B:this.head=B,this.tail=B,++this.length}},{key:"unshift",value:function(C){var B={data:C,next:this.head};this.length===0&&(this.tail=B),this.head=B,++this.length}},{key:"shift",value:function(){if(this.length!==0){var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(C){if(this.length===0)return"";for(var B=this.head,P=""+B.data;B=B.next;)P+=C+B.data;return P}},{key:"concat",value:function(C){if(this.length===0)return p.alloc(0);for(var B=p.allocUnsafe(C>>>0),P=this.head,S=0;P;)A(P.data,B,S),S+=P.data.length,P=P.next;return B}},{key:"consume",value:function(C,B){var P;return C<this.head.data.length?(P=this.head.data.slice(0,C),this.head.data=this.head.data.slice(C)):C===this.head.data.length?P=this.shift():P=B?this._getString(C):this._getBuffer(C),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(C){var B=this.head,P=1,S=B.data;for(C-=S.length;B=B.next;){var m=B.data,j=C>m.length?m.length:C;if(j===m.length?S+=m:S+=m.slice(0,C),C-=j,C===0){j===m.length?(++P,B.next?this.head=B.next:this.head=this.tail=null):(this.head=B,B.data=m.slice(j));break}++P}return this.length-=P,S}},{key:"_getBuffer",value:function(C){var B=p.allocUnsafe(C),P=this.head,S=1;for(P.data.copy(B),C-=P.data.length;P=P.next;){var m=P.data,j=C>m.length?m.length:C;if(m.copy(B,B.length-C,0,j),C-=j,C===0){j===m.length?(++S,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=m.slice(j));break}++S}return this.length-=S,B}},{key:I,value:function(C,B){return w(this,t(t({},B),{},{depth:0,customInspect:!1}))}}]),x}(),oc}function uB(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,H.dist.process.nextTick(kc,this,e)):H.dist.process.nextTick(kc,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(u){!t&&u?r._writableState?r._writableState.errorEmitted?H.dist.process.nextTick(lu,r):(r._writableState.errorEmitted=!0,H.dist.process.nextTick(mb,r,u)):H.dist.process.nextTick(mb,r,u):t?(H.dist.process.nextTick(lu,r),t(u)):H.dist.process.nextTick(lu,r)}),this)}function mb(e,t){kc(e,t),lu(e)}function lu(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function fB(){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 kc(e,t){e.emit("error",t)}function lB(e,t){var r=e._readableState,o=e._writableState;r&&r.autoDestroy||o&&o.autoDestroy?e.destroy(t):e.emit("error",t)}var H0={destroy:uB,undestroy:fB,errorOrDestroy:lB},eo={};function cB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var W0={};function Vr(e,t,r){r||(r=Error);function o(u,f,h){return typeof t=="string"?t:t(u,f,h)}var s=function(u){cB(f,u);function f(h,l,p){return u.call(this,o(h,l,p))||this}return f}(r);s.prototype.name=r.name,s.prototype.code=e,W0[e]=s}function Eb(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(o){return String(o)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function dB(e,t,r){return e.substr(0,t.length)===t}function hB(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function gB(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Vr("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Vr("ERR_INVALID_ARG_TYPE",function(e,t,r){var o;typeof t=="string"&&dB(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be";var s;if(hB(e," argument"))s="The ".concat(e," ").concat(o," ").concat(Eb(t,"type"));else{var u=gB(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(Eb(t,"type"))}return s+=". Received type ".concat(typeof r),s},TypeError);Vr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Vr("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Vr("ERR_STREAM_PREMATURE_CLOSE","Premature close");Vr("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Vr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Vr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Vr("ERR_STREAM_WRITE_AFTER_END","write after end");Vr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Vr("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Vr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");eo.codes=W0;var pB=eo.codes.ERR_INVALID_OPT_VALUE;function bB(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function _B(e,t,r,o){var s=bB(t,o,r);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var u=o?r:"highWaterMark";throw new pB(u,s)}return Math.floor(s)}return e.objectMode?16:16*1024}var q0={getHighWaterMark:_B},sc,vb;function G0(){if(vb)return sc;vb=1,sc=ue;function e(R){var O=this;this.next=null,this.entry=null,this.finish=function(){be(O,R)}}var t;ue.WritableState=Q;var r={deprecate:H.requireBrowser()},o=F0,s=H.bufferPolyfill.Buffer,u=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(R){return s.from(R)}function h(R){return s.isBuffer(R)||R instanceof u}var l=H0,p=q0,b=p.getHighWaterMark,w=eo.codes,I=w.ERR_INVALID_ARG_TYPE,A=w.ERR_METHOD_NOT_IMPLEMENTED,x=w.ERR_MULTIPLE_CALLBACK,v=w.ERR_STREAM_CANNOT_PIPE,C=w.ERR_STREAM_DESTROYED,B=w.ERR_STREAM_NULL_VALUES,P=w.ERR_STREAM_WRITE_AFTER_END,S=w.ERR_UNKNOWN_ENCODING,m=l.errorOrDestroy;H.requireInherits_browser()(ue,o);function j(){}function Q(R,O,q){t=t||xo(),R=R||{},typeof q!="boolean"&&(q=O instanceof t),this.objectMode=!!R.objectMode,q&&(this.objectMode=this.objectMode||!!R.writableObjectMode),this.highWaterMark=b(this,R,"writableHighWaterMark",q),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var oe=R.decodeStrings===!1;this.decodeStrings=!oe,this.defaultEncoding=R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){Y(O,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}Q.prototype.getBuffer=function(){for(var O=this.bufferedRequest,q=[];O;)q.push(O),O=O.next;return q},function(){try{Object.defineProperty(Q.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ce;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ce=Function.prototype[Symbol.hasInstance],Object.defineProperty(ue,Symbol.hasInstance,{value:function(O){return ce.call(this,O)?!0:this!==ue?!1:O&&O._writableState instanceof Q}})):ce=function(O){return O instanceof this};function ue(R){t=t||xo();var O=this instanceof t;if(!O&&!ce.call(ue,this))return new ue(R);this._writableState=new Q(R,this,O),this.writable=!0,R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final)),o.call(this)}ue.prototype.pipe=function(){m(this,new v)};function te(R,O){var q=new P;m(R,q),H.dist.process.nextTick(O,q)}function Se(R,O,q,oe){var ye;return q===null?ye=new B:typeof q!="string"&&!O.objectMode&&(ye=new I("chunk",["string","Buffer"],q)),ye?(m(R,ye),H.dist.process.nextTick(oe,ye),!1):!0}ue.prototype.write=function(R,O,q){var oe=this._writableState,ye=!1,d=!oe.objectMode&&h(R);return d&&!s.isBuffer(R)&&(R=f(R)),typeof O=="function"&&(q=O,O=null),d?O="buffer":O||(O=oe.defaultEncoding),typeof q!="function"&&(q=j),oe.ending?te(this,q):(d||Se(this,oe,R,q))&&(oe.pendingcb++,ye=F(this,oe,d,R,O,q)),ye},ue.prototype.cork=function(){this._writableState.corked++},ue.prototype.uncork=function(){var R=this._writableState;R.corked&&(R.corked--,!R.writing&&!R.corked&&!R.bufferProcessing&&R.bufferedRequest&&W(this,R))},ue.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new S(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(ue.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function me(R,O,q){return!R.objectMode&&R.decodeStrings!==!1&&typeof O=="string"&&(O=s.from(O,q)),O}Object.defineProperty(ue.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(R,O,q,oe,ye,d){if(!q){var g=me(O,oe,ye);oe!==g&&(q=!0,ye="buffer",oe=g)}var _=O.objectMode?1:oe.length;O.length+=_;var E=O.length<O.highWaterMark;if(E||(O.needDrain=!0),O.writing||O.corked){var J=O.lastBufferedRequest;O.lastBufferedRequest={chunk:oe,encoding:ye,isBuf:q,callback:d,next:null},J?J.next=O.lastBufferedRequest:O.bufferedRequest=O.lastBufferedRequest,O.bufferedRequestCount+=1}else U(R,O,!1,_,oe,ye,d);return E}function U(R,O,q,oe,ye,d,g){O.writelen=oe,O.writecb=g,O.writing=!0,O.sync=!0,O.destroyed?O.onwrite(new C("write")):q?R._writev(ye,O.onwrite):R._write(ye,d,O.onwrite),O.sync=!1}function $(R,O,q,oe,ye){--O.pendingcb,q?(H.dist.process.nextTick(ye,oe),H.dist.process.nextTick(re,R,O),R._writableState.errorEmitted=!0,m(R,oe)):(ye(oe),R._writableState.errorEmitted=!0,m(R,oe),re(R,O))}function G(R){R.writing=!1,R.writecb=null,R.length-=R.writelen,R.writelen=0}function Y(R,O){var q=R._writableState,oe=q.sync,ye=q.writecb;if(typeof ye!="function")throw new x;if(G(q),O)$(R,q,oe,O,ye);else{var d=K(q)||R.destroyed;!d&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest&&W(R,q),oe?H.dist.process.nextTick(V,R,q,d,ye):V(R,q,d,ye)}}function V(R,O,q,oe){q||ne(R,O),O.pendingcb--,oe(),re(R,O)}function ne(R,O){O.length===0&&O.needDrain&&(O.needDrain=!1,R.emit("drain"))}function W(R,O){O.bufferProcessing=!0;var q=O.bufferedRequest;if(R._writev&&q&&q.next){var oe=O.bufferedRequestCount,ye=new Array(oe),d=O.corkedRequestsFree;d.entry=q;for(var g=0,_=!0;q;)ye[g]=q,q.isBuf||(_=!1),q=q.next,g+=1;ye.allBuffers=_,U(R,O,!0,O.length,ye,"",d.finish),O.pendingcb++,O.lastBufferedRequest=null,d.next?(O.corkedRequestsFree=d.next,d.next=null):O.corkedRequestsFree=new e(O),O.bufferedRequestCount=0}else{for(;q;){var E=q.chunk,J=q.encoding,ie=q.callback,se=O.objectMode?1:E.length;if(U(R,O,!1,se,E,J,ie),q=q.next,O.bufferedRequestCount--,O.writing)break}q===null&&(O.lastBufferedRequest=null)}O.bufferedRequest=q,O.bufferProcessing=!1}ue.prototype._write=function(R,O,q){q(new A("_write()"))},ue.prototype._writev=null,ue.prototype.end=function(R,O,q){var oe=this._writableState;return typeof R=="function"?(q=R,R=null,O=null):typeof O=="function"&&(q=O,O=null),R!=null&&this.write(R,O),oe.corked&&(oe.corked=1,this.uncork()),oe.ending||_e(this,oe,q),this},Object.defineProperty(ue.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function K(R){return R.ending&&R.length===0&&R.bufferedRequest===null&&!R.finished&&!R.writing}function ae(R,O){R._final(function(q){O.pendingcb--,q&&m(R,q),O.prefinished=!0,R.emit("prefinish"),re(R,O)})}function de(R,O){!O.prefinished&&!O.finalCalled&&(typeof R._final=="function"&&!O.destroyed?(O.pendingcb++,O.finalCalled=!0,H.dist.process.nextTick(ae,R,O)):(O.prefinished=!0,R.emit("prefinish")))}function re(R,O){var q=K(O);if(q&&(de(R,O),O.pendingcb===0&&(O.finished=!0,R.emit("finish"),O.autoDestroy))){var oe=R._readableState;(!oe||oe.autoDestroy&&oe.endEmitted)&&R.destroy()}return q}function _e(R,O,q){O.ending=!0,re(R,O),q&&(O.finished?H.dist.process.nextTick(q):R.once("finish",q)),O.ended=!0,R.writable=!1}function be(R,O,q){var oe=R.entry;for(R.entry=null;oe;){var ye=oe.callback;O.pendingcb--,ye(q),oe=oe.next}O.corkedRequestsFree.next=R}return Object.defineProperty(ue.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),ue.prototype.destroy=l.destroy,ue.prototype._undestroy=l.undestroy,ue.prototype._destroy=function(R,O){O(R)},sc}var ac,Sb;function xo(){if(Sb)return ac;Sb=1;var e=Object.keys||function(p){var b=[];for(var w in p)b.push(w);return b};ac=f;var t=z0(),r=G0();H.requireInherits_browser()(f,t);for(var o=e(r.prototype),s=0;s<o.length;s++){var u=o[s];f.prototype[u]||(f.prototype[u]=r.prototype[u])}function f(p){if(!(this instanceof f))return new f(p);t.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",h)))}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function h(){this._writableState.ended||H.dist.process.nextTick(l,this)}function l(p){p.end()}return Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),ac}var Rb=eo.codes.ERR_STREAM_PREMATURE_CLOSE;function yB(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];e.apply(this,o)}}}function wB(){}function mB(e){return e.setHeader&&typeof e.abort=="function"}function V0(e,t,r){if(typeof t=="function")return V0(e,null,t);t||(t={}),r=yB(r||wB);var o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||h()},f=e._writableState&&e._writableState.finished,h=function(){s=!1,f=!0,o||r.call(e)},l=e._readableState&&e._readableState.endEmitted,p=function(){o=!1,l=!0,s||r.call(e)},b=function(x){r.call(e,x)},w=function(){var x;if(o&&!l)return(!e._readableState||!e._readableState.ended)&&(x=new Rb),r.call(e,x);if(s&&!f)return(!e._writableState||!e._writableState.ended)&&(x=new Rb),r.call(e,x)},I=function(){e.req.on("finish",h)};return mB(e)?(e.on("complete",h),e.on("abort",w),e.req?I():e.on("request",I)):s&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",p),e.on("finish",h),t.error!==!1&&e.on("error",b),e.on("close",w),function(){e.removeListener("complete",h),e.removeListener("abort",w),e.removeListener("request",I),e.req&&e.req.removeListener("finish",h),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",h),e.removeListener("end",p),e.removeListener("error",b),e.removeListener("close",w)}}var Pd=V0,uc,Ab;function EB(){if(Ab)return uc;Ab=1;var e;function t(S,m,j){return m=r(m),m in S?Object.defineProperty(S,m,{value:j,enumerable:!0,configurable:!0,writable:!0}):S[m]=j,S}function r(S){var m=o(S,"string");return typeof m=="symbol"?m:String(m)}function o(S,m){if(typeof S!="object"||S===null)return S;var j=S[Symbol.toPrimitive];if(j!==void 0){var Q=j.call(S,m);if(typeof Q!="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(S)}var s=Pd,u=Symbol("lastResolve"),f=Symbol("lastReject"),h=Symbol("error"),l=Symbol("ended"),p=Symbol("lastPromise"),b=Symbol("handlePromise"),w=Symbol("stream");function I(S,m){return{value:S,done:m}}function A(S){var m=S[u];if(m!==null){var j=S[w].read();j!==null&&(S[p]=null,S[u]=null,S[f]=null,m(I(j,!1)))}}function x(S){H.dist.process.nextTick(A,S)}function v(S,m){return function(j,Q){S.then(function(){if(m[l]){j(I(void 0,!0));return}m[b](j,Q)},Q)}}var C=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((e={get stream(){return this[w]},next:function(){var m=this,j=this[h];if(j!==null)return Promise.reject(j);if(this[l])return Promise.resolve(I(void 0,!0));if(this[w].destroyed)return new Promise(function(te,Se){H.dist.process.nextTick(function(){m[h]?Se(m[h]):te(I(void 0,!0))})});var Q=this[p],ce;if(Q)ce=new Promise(v(Q,this));else{var ue=this[w].read();if(ue!==null)return Promise.resolve(I(ue,!1));ce=new Promise(this[b])}return this[p]=ce,ce}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var m=this;return new Promise(function(j,Q){m[w].destroy(null,function(ce){if(ce){Q(ce);return}j(I(void 0,!0))})})}),e),C),P=function(m){var j,Q=Object.create(B,(j={},t(j,w,{value:m,writable:!0}),t(j,u,{value:null,writable:!0}),t(j,f,{value:null,writable:!0}),t(j,h,{value:null,writable:!0}),t(j,l,{value:m._readableState.endEmitted,writable:!0}),t(j,b,{value:function(ue,te){var Se=Q[w].read();Se?(Q[p]=null,Q[u]=null,Q[f]=null,ue(I(Se,!1))):(Q[u]=ue,Q[f]=te)},writable:!0}),j));return Q[p]=null,s(m,function(ce){if(ce&&ce.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ue=Q[f];ue!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,ue(ce)),Q[h]=ce;return}var te=Q[u];te!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,te(I(void 0,!0))),Q[l]=!0}),m.on("readable",x.bind(null,Q)),Q};return uc=P,uc}var fc,Tb;function vB(){return Tb||(Tb=1,fc=function(){throw new Error("Readable.from is not available in the browser")}),fc}var lc,Ib;function z0(){if(Ib)return lc;Ib=1,lc=te;var e;te.ReadableState=ue,H.requireEvents().EventEmitter;var t=function(g,_){return g.listeners(_).length},r=F0,o=H.bufferPolyfill.Buffer,s=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(d){return o.from(d)}function f(d){return o.isBuffer(d)||d instanceof s}var h=H.require$$3,l;h&&h.debuglog?l=h.debuglog("stream"):l=function(){};var p=aB(),b=H0,w=q0,I=w.getHighWaterMark,A=eo.codes,x=A.ERR_INVALID_ARG_TYPE,v=A.ERR_STREAM_PUSH_AFTER_EOF,C=A.ERR_METHOD_NOT_IMPLEMENTED,B=A.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,S,m;H.requireInherits_browser()(te,r);var j=b.errorOrDestroy,Q=["error","close","destroy","pause","resume"];function ce(d,g,_){if(typeof d.prependListener=="function")return d.prependListener(g,_);!d._events||!d._events[g]?d.on(g,_):Array.isArray(d._events[g])?d._events[g].unshift(_):d._events[g]=[_,d._events[g]]}function ue(d,g,_){e=e||xo(),d=d||{},typeof _!="boolean"&&(_=g instanceof e),this.objectMode=!!d.objectMode,_&&(this.objectMode=this.objectMode||!!d.readableObjectMode),this.highWaterMark=I(this,d,"readableHighWaterMark",_),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.destroyed=!1,this.defaultEncoding=d.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,d.encoding&&(P||(P=H.requireString_decoder().StringDecoder),this.decoder=new P(d.encoding),this.encoding=d.encoding)}function te(d){if(e=e||xo(),!(this instanceof te))return new te(d);var g=this instanceof e;this._readableState=new ue(d,this,g),this.readable=!0,d&&(typeof d.read=="function"&&(this._read=d.read),typeof d.destroy=="function"&&(this._destroy=d.destroy)),r.call(this)}Object.defineProperty(te.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(g){this._readableState&&(this._readableState.destroyed=g)}}),te.prototype.destroy=b.destroy,te.prototype._undestroy=b.undestroy,te.prototype._destroy=function(d,g){g(d)},te.prototype.push=function(d,g){var _=this._readableState,E;return _.objectMode?E=!0:typeof d=="string"&&(g=g||_.defaultEncoding,g!==_.encoding&&(d=o.from(d,g),g=""),E=!0),Se(this,d,g,!1,E)},te.prototype.unshift=function(d){return Se(this,d,null,!0,!1)};function Se(d,g,_,E,J){l("readableAddChunk",g);var ie=d._readableState;if(g===null)ie.reading=!1,Y(d,ie);else{var se;if(J||(se=F(ie,g)),se)j(d,se);else if(ie.objectMode||g&&g.length>0)if(typeof g!="string"&&!ie.objectMode&&Object.getPrototypeOf(g)!==o.prototype&&(g=u(g)),E)ie.endEmitted?j(d,new B):me(d,ie,g,!0);else if(ie.ended)j(d,new v);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!_?(g=ie.decoder.write(g),ie.objectMode||g.length!==0?me(d,ie,g,!1):W(d,ie)):me(d,ie,g,!1)}else E||(ie.reading=!1,W(d,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function me(d,g,_,E){g.flowing&&g.length===0&&!g.sync?(g.awaitDrain=0,d.emit("data",_)):(g.length+=g.objectMode?1:_.length,E?g.buffer.unshift(_):g.buffer.push(_),g.needReadable&&V(d)),W(d,g)}function F(d,g){var _;return!f(g)&&typeof g!="string"&&g!==void 0&&!d.objectMode&&(_=new x("chunk",["string","Buffer","Uint8Array"],g)),_}te.prototype.isPaused=function(){return this._readableState.flowing===!1},te.prototype.setEncoding=function(d){P||(P=H.requireString_decoder().StringDecoder);var g=new P(d);this._readableState.decoder=g,this._readableState.encoding=this._readableState.decoder.encoding;for(var _=this._readableState.buffer.head,E="";_!==null;)E+=g.write(_.data),_=_.next;return this._readableState.buffer.clear(),E!==""&&this._readableState.buffer.push(E),this._readableState.length=E.length,this};var U=1073741824;function $(d){return d>=U?d=U:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++),d}function G(d,g){return d<=0||g.length===0&&g.ended?0:g.objectMode?1:d!==d?g.flowing&&g.length?g.buffer.head.data.length:g.length:(d>g.highWaterMark&&(g.highWaterMark=$(d)),d<=g.length?d:g.ended?g.length:(g.needReadable=!0,0))}te.prototype.read=function(d){l("read",d),d=parseInt(d,10);var g=this._readableState,_=d;if(d!==0&&(g.emittedReadable=!1),d===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return l("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?q(this):V(this),null;if(d=G(d,g),d===0&&g.ended)return g.length===0&&q(this),null;var E=g.needReadable;l("need readable",E),(g.length===0||g.length-d<g.highWaterMark)&&(E=!0,l("length less than watermark",E)),g.ended||g.reading?(E=!1,l("reading or ended",E)):E&&(l("do read"),g.reading=!0,g.sync=!0,g.length===0&&(g.needReadable=!0),this._read(g.highWaterMark),g.sync=!1,g.reading||(d=G(_,g)));var J;return d>0?J=O(d,g):J=null,J===null?(g.needReadable=g.length<=g.highWaterMark,d=0):(g.length-=d,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),_!==d&&g.ended&&q(this)),J!==null&&this.emit("data",J),J};function Y(d,g){if(l("onEofChunk"),!g.ended){if(g.decoder){var _=g.decoder.end();_&&_.length&&(g.buffer.push(_),g.length+=g.objectMode?1:_.length)}g.ended=!0,g.sync?V(d):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,ne(d)))}}function V(d){var g=d._readableState;l("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(l("emitReadable",g.flowing),g.emittedReadable=!0,H.dist.process.nextTick(ne,d))}function ne(d){var g=d._readableState;l("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(d.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,R(d)}function W(d,g){g.readingMore||(g.readingMore=!0,H.dist.process.nextTick(K,d,g))}function K(d,g){for(;!g.reading&&!g.ended&&(g.length<g.highWaterMark||g.flowing&&g.length===0);){var _=g.length;if(l("maybeReadMore read 0"),d.read(0),_===g.length)break}g.readingMore=!1}te.prototype._read=function(d){j(this,new C("_read()"))},te.prototype.pipe=function(d,g){var _=this,E=this._readableState;switch(E.pipesCount){case 0:E.pipes=d;break;case 1:E.pipes=[E.pipes,d];break;default:E.pipes.push(d);break}E.pipesCount+=1,l("pipe count=%d opts=%j",E.pipesCount,g);var J=(!g||g.end!==!1)&&d!==H.dist.process.stdout&&d!==H.dist.process.stderr,ie=J?Ie:_t;E.endEmitted?H.dist.process.nextTick(ie):_.once("end",ie),d.on("unpipe",se);function se(Ye,Ve){l("onunpipe"),Ye===_&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,Ue())}function Ie(){l("onend"),d.end()}var Be=ae(_);d.on("drain",Be);var Ce=!1;function Ue(){l("cleanup"),d.removeListener("close",bt),d.removeListener("finish",et),d.removeListener("drain",Be),d.removeListener("error",He),d.removeListener("unpipe",se),_.removeListener("end",Ie),_.removeListener("end",_t),_.removeListener("data",Re),Ce=!0,E.awaitDrain&&(!d._writableState||d._writableState.needDrain)&&Be()}_.on("data",Re);function Re(Ye){l("ondata");var Ve=d.write(Ye);l("dest.write",Ve),Ve===!1&&((E.pipesCount===1&&E.pipes===d||E.pipesCount>1&&ye(E.pipes,d)!==-1)&&!Ce&&(l("false write response, pause",E.awaitDrain),E.awaitDrain++),_.pause())}function He(Ye){l("onerror",Ye),_t(),d.removeListener("error",He),t(d,"error")===0&&j(d,Ye)}ce(d,"error",He);function bt(){d.removeListener("finish",et),_t()}d.once("close",bt);function et(){l("onfinish"),d.removeListener("close",bt),_t()}d.once("finish",et);function _t(){l("unpipe"),_.unpipe(d)}return d.emit("pipe",_),E.flowing||(l("pipe resume"),_.resume()),d};function ae(d){return function(){var _=d._readableState;l("pipeOnDrain",_.awaitDrain),_.awaitDrain&&_.awaitDrain--,_.awaitDrain===0&&t(d,"data")&&(_.flowing=!0,R(d))}}te.prototype.unpipe=function(d){var g=this._readableState,_={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return d&&d!==g.pipes?this:(d||(d=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,d&&d.emit("unpipe",this,_),this);if(!d){var E=g.pipes,J=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var ie=0;ie<J;ie++)E[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var se=ye(g.pipes,d);return se===-1?this:(g.pipes.splice(se,1),g.pipesCount-=1,g.pipesCount===1&&(g.pipes=g.pipes[0]),d.emit("unpipe",this,_),this)},te.prototype.on=function(d,g){var _=r.prototype.on.call(this,d,g),E=this._readableState;return d==="data"?(E.readableListening=this.listenerCount("readable")>0,E.flowing!==!1&&this.resume()):d==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,l("on readable",E.length,E.reading),E.length?V(this):E.reading||H.dist.process.nextTick(re,this)),_},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(d,g){var _=r.prototype.removeListener.call(this,d,g);return d==="readable"&&H.dist.process.nextTick(de,this),_},te.prototype.removeAllListeners=function(d){var g=r.prototype.removeAllListeners.apply(this,arguments);return(d==="readable"||d===void 0)&&H.dist.process.nextTick(de,this),g};function de(d){var g=d._readableState;g.readableListening=d.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:d.listenerCount("data")>0&&d.resume()}function re(d){l("readable nexttick read 0"),d.read(0)}te.prototype.resume=function(){var d=this._readableState;return d.flowing||(l("resume"),d.flowing=!d.readableListening,_e(this,d)),d.paused=!1,this};function _e(d,g){g.resumeScheduled||(g.resumeScheduled=!0,H.dist.process.nextTick(be,d,g))}function be(d,g){l("resume",g.reading),g.reading||d.read(0),g.resumeScheduled=!1,d.emit("resume"),R(d),g.flowing&&!g.reading&&d.read(0)}te.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function R(d){var g=d._readableState;for(l("flow",g.flowing);g.flowing&&d.read()!==null;);}te.prototype.wrap=function(d){var g=this,_=this._readableState,E=!1;d.on("end",function(){if(l("wrapped end"),_.decoder&&!_.ended){var se=_.decoder.end();se&&se.length&&g.push(se)}g.push(null)}),d.on("data",function(se){if(l("wrapped data"),_.decoder&&(se=_.decoder.write(se)),!(_.objectMode&&se==null)&&!(!_.objectMode&&(!se||!se.length))){var Ie=g.push(se);Ie||(E=!0,d.pause())}});for(var J in d)this[J]===void 0&&typeof d[J]=="function"&&(this[J]=function(Ie){return function(){return d[Ie].apply(d,arguments)}}(J));for(var ie=0;ie<Q.length;ie++)d.on(Q[ie],this.emit.bind(this,Q[ie]));return this._read=function(se){l("wrapped _read",se),E&&(E=!1,d.resume())},this},typeof Symbol=="function"&&(te.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=EB()),S(this)}),Object.defineProperty(te.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(te.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(te.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(g){this._readableState&&(this._readableState.flowing=g)}}),te._fromList=O,Object.defineProperty(te.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(d,g){if(g.length===0)return null;var _;return g.objectMode?_=g.buffer.shift():!d||d>=g.length?(g.decoder?_=g.buffer.join(""):g.buffer.length===1?_=g.buffer.first():_=g.buffer.concat(g.length),g.buffer.clear()):_=g.buffer.consume(d,g.decoder),_}function q(d){var g=d._readableState;l("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,H.dist.process.nextTick(oe,g,d))}function oe(d,g){if(l("endReadableNT",d.endEmitted,d.length),!d.endEmitted&&d.length===0&&(d.endEmitted=!0,g.readable=!1,g.emit("end"),d.autoDestroy)){var _=g._writableState;(!_||_.autoDestroy&&_.finished)&&g.destroy()}}typeof Symbol=="function"&&(te.from=function(d,g){return m===void 0&&(m=vB()),m(te,d,g)});function ye(d,g){for(var _=0,E=d.length;_<E;_++)if(d[_]===g)return _;return-1}return lc}var K0=Qn,sf=eo.codes,SB=sf.ERR_METHOD_NOT_IMPLEMENTED,RB=sf.ERR_MULTIPLE_CALLBACK,AB=sf.ERR_TRANSFORM_ALREADY_TRANSFORMING,TB=sf.ERR_TRANSFORM_WITH_LENGTH_0,af=xo();H.requireInherits_browser()(Qn,af);function IB(e,t){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(o===null)return this.emit("error",new RB);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),o(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function Qn(e){if(!(this instanceof Qn))return new Qn(e);af.call(this,e),this._transformState={afterTransform:IB.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",OB)}function OB(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Ob(e,t,r)}):Ob(this,null,null)}Qn.prototype.push=function(e,t){return this._transformState.needTransform=!1,af.prototype.push.call(this,e,t)};Qn.prototype._transform=function(e,t,r){r(new SB("_transform()"))};Qn.prototype._write=function(e,t,r){var o=this._transformState;if(o.writecb=r,o.writechunk=e,o.writeencoding=t,!o.transforming){var s=this._readableState;(o.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}};Qn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Qn.prototype._destroy=function(e,t){af.prototype._destroy.call(this,e,function(r){t(r)})};function Ob(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new TB;if(e._transformState.transforming)throw new AB;return e.push(null)}var CB=Bs,J0=K0;H.requireInherits_browser()(Bs,J0);function Bs(e){if(!(this instanceof Bs))return new Bs(e);J0.call(this,e)}Bs.prototype._transform=function(e,t,r){r(null,e)};var cc;function LB(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Y0=eo.codes,PB=Y0.ERR_MISSING_ARGS,BB=Y0.ERR_STREAM_DESTROYED;function Cb(e){if(e)throw e}function NB(e){return e.setHeader&&typeof e.abort=="function"}function $B(e,t,r,o){o=LB(o);var s=!1;e.on("close",function(){s=!0}),cc===void 0&&(cc=Pd),cc(e,{readable:t,writable:r},function(f){if(f)return o(f);s=!0,o()});var u=!1;return function(f){if(!s&&!u){if(u=!0,NB(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();o(f||new BB("pipe"))}}}function Lb(e){e()}function MB(e,t){return e.pipe(t)}function xB(e){return!e.length||typeof e[e.length-1]!="function"?Cb:e.pop()}function DB(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=xB(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new PB("streams");var s,u=t.map(function(f,h){var l=h<t.length-1,p=h>0;return $B(f,l,p,function(b){s||(s=b),b&&u.forEach(Lb),!l&&(u.forEach(Lb),o(s))})});return t.reduce(MB)}var jB=DB;(function(e,t){t=e.exports=z0(),t.Stream=t,t.Readable=t,t.Writable=G0(),t.Duplex=xo(),t.Transform=K0,t.PassThrough=CB,t.finished=Pd,t.pipeline=jB})(Uc,Uc.exports);var uf=Uc.exports,UB=H.requireBrowser$1();const kB=H.getDefaultExportFromCjs(UB);var FB={exports:{}},Bd={},Nd={};Object.defineProperty(Nd,"__esModule",{value:!0});function HB(e){var t=4,r=e.length,o=r%t;if(!o)return e;var s=r,u=t-o,f=r+u,h=H.dist.Buffer.alloc(f);for(h.write(e);u--;)h.write("=",s++);return h.toString()}Nd.default=HB;Object.defineProperty(Bd,"__esModule",{value:!0});var WB=Nd;function X0(e,t){return t===void 0&&(t="utf8"),H.dist.Buffer.isBuffer(e)?Fc(e.toString("base64")):Fc(H.dist.Buffer.from(e,t).toString("base64"))}function qB(e,t){return t===void 0&&(t="utf8"),H.dist.Buffer.from($d(e),"base64").toString(t)}function $d(e){return e=e.toString(),WB.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function Fc(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function GB(e){return H.dist.Buffer.from($d(e),"base64")}var Fo=X0;Fo.encode=X0;Fo.decode=qB;Fo.toBase64=$d;Fo.fromBase64=Fc;Fo.toBuffer=GB;Bd.default=Fo;(function(e){e.exports=Bd.default,e.exports.default=e.exports})(FB);const VB=()=>kB(32).toString("hex");function nu(){}const Pb="SYN",dc="ACK",Bb="BRK";class Nb extends uf.Duplex{constructor(t){let{name:r,target:o,targetWindow:s=window,targetOrigin:u="*"}=t;if(super({objectMode:!0}),Ne(this,"_init",void 0),Ne(this,"_haveSyn",void 0),Ne(this,"_name",void 0),Ne(this,"_target",void 0),Ne(this,"_targetWindow",void 0),Ne(this,"_targetOrigin",void 0),Ne(this,"_onMessage",void 0),Ne(this,"_synIntervalId",void 0),!r||!o)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=r,this._target=o,this._targetWindow=s,this._targetOrigin=u,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(Bb,null,nu),this._haveSyn=!1,this._init=!1}_handShake(){this._write(Pb,null,nu),this.cork()}_onData(t){if(!this._init)t===Pb?(this._haveSyn=!0,this._write(dc,null,nu)):t===dc&&(this._init=!0,this._haveSyn||this._write(dc,null,nu),this.uncork());else if(t===Bb)this._break();else try{this.push(t)}catch(r){this.emit("error",r)}}_postMessage(t){const r=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:t},r)}onMessage(t){const r=t.data;this._targetOrigin!=="*"&&t.origin!==this._targetOrigin||t.source!==this._targetWindow||typeof r!="object"||r.target!==this._name||!r.data||this._onData(r.data)}_read(){}_write(t,r,o){this._postMessage(t),o()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function $b(e,t,r){try{Reflect.apply(e,t,r)}catch(o){setTimeout(()=>{throw o})}}function zB(e){const t=e.length,r=new Array(t);for(let o=0;o<t;o+=1)r[o]=e[o];return r}class ff extends M1.eventsExports.EventEmitter{emit(t){let r=t==="error";const o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;for(var s=arguments.length,u=new Array(s>1?s-1:0),f=1;f<s;f++)u[f-1]=arguments[f];if(r){let l;if(u.length>0&&([l]=u),l instanceof Error)throw l;const p=new Error(`Unhandled error.${l?` (${l.message})`:""}`);throw p.context=l,p}const h=o[t];if(h===void 0)return!1;if(typeof h=="function")$b(h,this,u);else{const l=h.length,p=zB(h);for(let b=0;b<l;b+=1)$b(p[b],this,u)}return!0}}class ws extends Error{constructor(t){let{code:r,message:o,data:s}=t;if(!Number.isInteger(r))throw new Error("code must be an integer");if(!o||typeof o!="string")throw new Error("message must be string");super(o),Ne(this,"code",void 0),Ne(this,"data",void 0),this.code=r,s!==void 0&&(this.data=s)}toString(){return RA({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const Hc=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(o,s)=>{o||s.error?t(o||s.error):!r||Array.isArray(s)?e(s):e(s.result)}};function KB(){const e={};function t(){return!1}const r=new ff;function o(l){const p=e[l.id];if(!p)throw new Error(`StreamMiddleware - Unknown response id "${l.id}"`);delete e[l.id],Object.assign(p.res,l),setTimeout(p.end)}function s(l){r.emit("notification",l)}function u(l,p,b){let w;try{!l.id?s(l):o(l)}catch(I){w=I}b(w)}const f=new uf.Duplex({objectMode:!0,read:t,write:u});return{events:r,middleware:(l,p,b,w)=>{f.push(l),e[l.id]={req:l,res:p,next:b,end:w}},stream:f}}function JB(){return(e,t,r,o)=>{const s=e.id,u=VB();e.id=u,t.id=u,r(f=>{e.id=s,t.id=s,f()})}}function Mb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function YB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mb(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mb(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class Kn extends ff{constructor(){super(),Ne(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(t,r,o){const s=[];let u=null,f=!1;for(const h of o)if([u,f]=await Kn._runMiddleware(t,r,h,s),f)break;return[u,f,s.reverse()]}static _runMiddleware(t,r,o,s){return new Promise(u=>{const f=l=>{const p=l||r.error;p&&(r.error=nn.serializeError(p)),u([p,!0])},h=l=>{r.error?f(r.error):(l&&(typeof l!="function"&&f(new ws({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),s.push(l)),u([null,!1]))};try{o(t,r,h,f)}catch(l){f(l)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((o,s)=>{r(u=>u?s(u):o())})}static _checkForCompletion(t,r,o){if(!("result"in r)&&!("error"in r))throw new ws({code:-32603,message:"Response has no error or result for request"});if(!o)throw new ws({code:-32603,message:"Nothing ended request"})}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,o,s)=>{try{const[u,f,h]=await Kn._runAllMiddleware(t,r,this._middleware);return f?(await Kn._runReturnHandlers(h),s(u)):o(async l=>{try{await Kn._runReturnHandlers(h)}catch(p){return l(p)}return l()})}catch(u){return s(u)}}}async _handleBatch(t,r){try{const o=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,o):o}catch(o){if(r)return r(o);throw o}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(o,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const f=new ws({code:-32603,message:"request must be plain object"});return r(f,{id:void 0,jsonrpc:"2.0",error:f})}if(typeof t.method!="string"){const f=new ws({code:-32603,message:"method must be string"});return r(f,{id:t.id,jsonrpc:"2.0",error:f})}const o=YB({},t),s={id:o.id,jsonrpc:o.jsonrpc};let u=null;try{await this._processRequest(o,s)}catch(f){u=f}return u&&(delete s.result,s.error||(s.error=nn.serializeError(u))),r(u,s)}async _processRequest(t,r){const[o,s,u]=await Kn._runAllMiddleware(t,r,this._middleware);if(Kn._checkForCompletion(t,r,s),await Kn._runReturnHandlers(u),o)throw o}}class XB extends uf.Duplex{constructor(t){let{parent:r,name:o}=t;super({objectMode:!0}),Ne(this,"_parent",void 0),Ne(this,"_name",void 0),this._parent=r,this._name=o}_read(){}_write(t,r,o){this._parent.push({name:this._name,data:t}),o()}}function xb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function Db(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xb(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xb(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}const jb=Symbol("IGNORE_SUBSTREAM");class ZB extends uf.Duplex{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(Db(Db({},t),{},{objectMode:!0})),Ne(this,"_substreams",void 0),Ne(this,"getStream",void 0),this._substreams={}}createStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);const r=new XB({parent:this,name:t});return this._substreams[t]=r,QB(this,o=>r.destroy(o||void 0)),r}ignoreStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);this._substreams[t]=jb}_read(){}_write(t,r,o){const{name:s,data:u}=t;if(!s)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${t}"`),o();const f=this._substreams[s];return f?(f!==jb&&f.push(u),o()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${s}"`),o())}}function QB(e,t){const r=oL(t);nb(e,{readable:!1},r),nb(e,{writable:!1},r)}const In=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";In.writable=e=>In(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";In.readable=e=>In(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";In.duplex=e=>In.writable(e)&&In.readable(e);In.transform=e=>In.duplex(e)&&typeof e._transform=="function";var eN=In,tN=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,s,u;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(s=o;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(u=Object.keys(t),o=u.length,o!==Object.keys(r).length)return!1;for(s=o;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,u[s]))return!1;for(s=o;s--!==0;){var f=u[s];if(!e(t[f],r[f]))return!1}return!0}return t!==t&&r!==r};const rN=H.getDefaultExportFromCjs(tN);var nN="0.3.4",An={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:e=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:e=>`Invalid options. Received: { maxEventListeners: ${e}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`Torus: Connected to chain with ID "${e}".`}};const Z0={PRODUCTION:"production"},So={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},iN={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var Md={translations:iN,localStorageKeyPrefix:"torus-"},lt=mu.getLogger("solana-embed");function oN(){return(e,t,r)=>{(typeof e.method!="string"||!e.method)&&(t.error=nn.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),r(o=>{const{error:s}=t;return s&&lt.error(`Torus - RPC Error: ${s.message}`,s),o()})}}function sN(e,t,r){let o=`Torus: Lost connection to "${e}".`;t!=null&&t.stack&&(o+=`
31
- ${t.stack}`),lt.warn(o),r&&r.listenerCount("error")>0&&r.emit("error",o)}const iu=()=>Math.random().toString(36).slice(2),Q0=async e=>{let t,r;switch(e){case"testing":t="https://solana-testing.tor.us",r="debug";break;case"development":t="http://localhost:8080",r="debug";break;default:t="https://solana.tor.us",r="error";break}return{torusUrl:t,logLevel:r}},aN=()=>{let e=window.navigator.language||"en-US";const t=e.split("-");return e=Object.prototype.hasOwnProperty.call(Md.translations,t[0])?t[0]:"en",e},uN={height:660,width:375},fN={height:740,width:1315},lN={height:700,width:1200},ew={height:600,width:400};function cN(e){let t;try{t=window[e];const r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return r&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0}}function Ss(e){let{width:t,height:r}=e;const o=window.screenLeft!==void 0?window.screenLeft:window.screenX,s=window.screenTop!==void 0?window.screenTop:window.screenY,u=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,f=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,h=1,l=Math.abs((u-t)/2/h+o),p=Math.abs((f-r)/2/h+s);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${r/h},width=${t/h},top=${p},left=${l}`}class tw extends ff{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:s="provider"}=r;if(super(),Ne(this,"isTorus",void 0),Ne(this,"_rpcEngine",void 0),Ne(this,"jsonRpcConnectionEvents",void 0),Ne(this,"_state",void 0),!eN.duplex(t))throw new Error(An.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(o),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this);const u=new ZB;ob(t,u,t,this._handleStreamDisconnect.bind(this,"Torus")),u.ignoreStream("phishing");const f=KB();ob(f.stream,u.createStream(s),f.stream,this._handleStreamDisconnect.bind(this,"Torus RpcProvider"));const h=new Kn;h.push(JB()),h.push(oN()),h.push(sB({origin:location.origin})),h.push(f.middleware),this._rpcEngine=h,this.jsonRpcConnectionEvents=f.events}async request(t){if(!t||typeof t!="object"||Array.isArray(t))throw nn.ethErrors.rpc.invalidRequest({message:An.errors.invalidRequestArgs(),data:t});const{method:r,params:o}=t;if(typeof r!="string"||r.length===0)throw nn.ethErrors.rpc.invalidRequest({message:An.errors.invalidRequestMethod(),data:t});if(o!==void 0&&!Array.isArray(o)&&(typeof o!="object"||o===null))throw nn.ethErrors.rpc.invalidRequest({message:An.errors.invalidRequestParams(),data:t});return new Promise((s,u)=>{this._rpcRequest({method:r,params:o},Hc(s,u))})}send(t,r){this._rpcRequest(t,r)}sendAsync(t){return new Promise((r,o)=>{this._rpcRequest(t,Hc(r,o))})}_handleStreamDisconnect(t,r){sN(t,r,this),this._handleDisconnect(!1,r?r.message:void 0)}}const dN=function(e,t,r){for(var o=arguments.length,s=new Array(o>3?o-3:0),u=3;u<o;u++)s[u-3]=arguments[u];const f=()=>{r(...s),e.removeEventListener(t,f)};e.addEventListener(t,f)};async function rw(){return new Promise(e=>{document.readyState!=="loading"?e():dN(document,"DOMContentLoaded",e)})}const Io=e=>{const t=window.document.createElement("template"),r=e.trim();return t.innerHTML=r,t.content.firstChild};function ou(e){return e.version===void 0}class nw extends ff{constructor(t){let{url:r,target:o,features:s}=t;super(),Ne(this,"url",void 0),Ne(this,"target",void 0),Ne(this,"features",void 0),Ne(this,"window",void 0),Ne(this,"windowTimer",void 0),Ne(this,"iClosedWindow",void 0),this.url=r,this.target=o||"_blank",this.features=s||Ss(lN),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){var t;return this.window=window.open(this.url.href,this.target,this.features),(t=this.window)!=null&&t.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(t){t?window.location.replace(this.url.href):window.location.href=this.url.href}}function Ub(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function hN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ub(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ub(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class lf extends tw{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:s="provider"}=r;super(t,{maxEventListeners:o,jsonRpcStreamName:s}),Ne(this,"embedTranslations",void 0),Ne(this,"torusUrl",void 0),Ne(this,"dappStorageKey",void 0),Ne(this,"windowRefs",void 0),Ne(this,"tryWindowHandle",void 0),Ne(this,"torusAlertContainer",void 0),Ne(this,"torusIframe",void 0),this._state=hN({},lf._defaultState),this.torusUrl="",this.dappStorageKey="";const u=Md.translations[aN()];this.embedTranslations=u.embed,this.windowRefs={},this.on("connect",()=>{this._state.isConnected=!0});const f=h=>{const{method:l,params:p}=h;if(l===ys.IFRAME_STATUS){const{isFullScreen:b,rid:w}=p;this._displayIframe({isFull:b,rid:w})}else if(l===ys.CREATE_WINDOW){const{windowId:b,url:w}=p;this._createPopupBlockAlert(b,w)}else if(l===ys.CLOSE_WINDOW)this._handleCloseWindow(p);else if(l===ys.USER_LOGGED_IN){const{currentLoginProvider:b}=p;this._state.isLoggedIn=!0,this._state.currentLoginProvider=b}else l===ys.USER_LOGGED_OUT&&(this._state.isLoggedIn=!1,this._state.currentLoginProvider=null,this._displayIframe())};this.jsonRpcConnectionEvents.on("notification",f)}get isLoggedIn(){return this._state.isLoggedIn}get isIFrameFullScreen(){return this._state.isIFrameFullScreen}isConnected(){return this._state.isConnected}async _initializeState(t){try{const{torusUrl:r,dappStorageKey:o,torusAlertContainer:s,torusIframe:u}=t;this.torusUrl=r,this.dappStorageKey=o,this.torusAlertContainer=s,this.torusIframe=u,this.torusIframe.addEventListener("load",()=>{this._state.isIFrameFullScreen||this._displayIframe()});const{currentLoginProvider:f,isLoggedIn:h}=await this.request({method:En.GET_PROVIDER_STATE,params:[]});this._handleConnect(f,h)}catch(r){lt.error("Torus: Failed to get initial state. Please report this bug.",r)}finally{lt.info("initialized communication state"),this._state.initialized=!0,this.emit("_initialized")}}_handleWindow(t){let{url:r,target:o,features:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const u=new URL(r||`${this.torusUrl}/redirect?windowId=${t}`);this.dappStorageKey&&(u.hash?u.hash+=`&dappStorageKey=${this.dappStorageKey}`:u.hash=`#dappStorageKey=${this.dappStorageKey}`);const f=new nw({url:u,target:o,features:s});if(f.open(),!f.window){this._createPopupBlockAlert(t,u.href);return}this.windowRefs[t]=f,this.request({method:En.OPENED_WINDOW,params:{windowId:t}}),f.once("close",()=>{delete this.windowRefs[t],this.request({method:En.CLOSED_WINDOW,params:{windowId:t}})})}_displayIframe(){let{isFull:t=!1,rid:r=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const o={};if(t)o.display="block",o.width="100%",o.height="100%",o.top="0px",o.right="0px",o.left="0px",o.bottom="0px";else switch(o.display=this._state.torusWidgetVisibility?"block":"none",o.height="70px",o.width="70px",this._state.buttonPosition){case So.TOP_LEFT:o.top="0px",o.left="0px",o.right="auto",o.bottom="auto";break;case So.TOP_RIGHT:o.top="0px",o.right="0px",o.left="auto",o.bottom="auto";break;case So.BOTTOM_RIGHT:o.bottom="0px",o.right="0px",o.top="auto",o.left="auto";break;case So.BOTTOM_LEFT:default:o.bottom="0px",o.left="0px",o.top="auto",o.right="auto";break}Object.assign(this.torusIframe.style,o),this._state.isIFrameFullScreen=t,this.request({method:En.IFRAME_STATUS,params:{isIFrameFullScreen:t,rid:r}})}hideTorusButton(){this._state.torusWidgetVisibility=!1,this._displayIframe()}showTorusButton(){this._state.torusWidgetVisibility=!0,this._displayIframe()}_rpcRequest(t,r){const o=r,s=t;Array.isArray(s)||s.jsonrpc||(s.jsonrpc="2.0"),this.tryWindowHandle(s,o)}_handleConnect(t,r){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{currentLoginProvider:t,isLoggedIn:r}),lt.debug(An.info.connected(t)))}_handleDisconnect(t,r){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){this._state.isConnected=!1;let o;t?(o=new nn.EthereumRpcError(1013,r||An.errors.disconnected()),lt.debug(o)):(o=new nn.EthereumRpcError(1011,r||An.errors.permanentlyDisconnected()),lt.error(o),this._state.currentLoginProvider=null,this._state.isLoggedIn=!1,this._state.torusWidgetVisibility=!1,this._state.isIFrameFullScreen=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",o)}}_handleCloseWindow(t){const{windowId:r}=t;this.windowRefs[r]&&(this.windowRefs[r].close(),delete this.windowRefs[r])}async _createPopupBlockAlert(t,r){const o=this.getLogoUrl(),s=Io(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${o}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),u=Io(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),f=Io('<div id="torusAlert__btn-container"></div>');f.appendChild(u),s.appendChild(f);const h=()=>{u.addEventListener("click",()=>{this._handleWindow(t,{url:r,target:"_blank",features:Ss(ew)}),s.remove(),this.torusAlertContainer.children.length===0&&(this.torusAlertContainer.style.display="none")})},l=()=>{this.torusAlertContainer.appendChild(s)};await rw(),l(),h(),this.torusAlertContainer.style.display="block"}getLogoUrl(){return`${this.torusUrl}/images/torus_icon-blue.svg`}}Ne(lf,"_defaultState",{buttonPosition:"bottom-left",currentLoginProvider:null,isIFrameFullScreen:!1,hasEmittedConnection:!1,torusWidgetVisibility:!1,initialized:!1,isLoggedIn:!1,isPermanentlyDisconnected:!1,isConnected:!1});function kb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function gN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kb(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kb(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class qs extends tw{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:s="provider"}=r;super(t,{maxEventListeners:o,jsonRpcStreamName:s}),Ne(this,"chainId",void 0),Ne(this,"selectedAddress",void 0),Ne(this,"tryWindowHandle",void 0),this._state=gN({},qs._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this.on("connect",()=>{this._state.isConnected=!0});const u=f=>{const{method:h,params:l}=f;h===ic.ACCOUNTS_CHANGED?this._handleAccountsChanged(l):h===ic.UNLOCK_STATE_CHANGED?this._handleUnlockStateChanged(l):h===ic.CHAIN_CHANGED&&this._handleChainChanged(l)};this.jsonRpcConnectionEvents.on("notification",u)}isConnected(){return this._state.isConnected}async _initializeState(){try{const{accounts:t,chainId:r,isUnlocked:o}=await this.request({method:oB.GET_PROVIDER_STATE,params:[]});this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r}),this._handleUnlockStateChanged({accounts:t,isUnlocked:o}),this._handleAccountsChanged(t)}catch(t){lt.error("Torus: Failed to get initial state. Please report this bug.",t)}finally{lt.info("initialized provider state"),this._state.initialized=!0,this.emit("_initialized")}}_rpcRequest(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=r;const u=t;if(!Array.isArray(u)){if(u.jsonrpc||(u.jsonrpc="2.0"),u.method==="solana_accounts"||u.method==="solana_requestAccounts")s=(f,h)=>{this._handleAccountsChanged(h.result||[],u.method==="solana_accounts",o),r(f,h)};else if(u.method==="wallet_getProviderState"){this._rpcEngine.handle(t,s);return}}this.tryWindowHandle(u,s)}_handleConnect(t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:t}),lt.debug(An.info.connected(t)))}_handleDisconnect(t,r){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){this._state.isConnected=!1;let o;t?(o=new nn.EthereumRpcError(1013,r||An.errors.disconnected()),lt.debug(o)):(o=new nn.EthereumRpcError(1011,r||An.errors.permanentlyDisconnected()),lt.error(o),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",o)}}_handleAccountsChanged(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=t;Array.isArray(s)||(lt.error("Torus: Received non-array accounts parameter. Please report this bug.",s),s=[]);for(const u of t)if(typeof u!="string"){lt.error("Torus: Received non-string account. Please report this bug.",t),s=[];break}rN(this._state.accounts,s)||(r&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!o&&lt.error('Torus: "solana_accounts" unexpectedly updated accounts. Please report this bug.',s),this._state.accounts=s,this.emit("accountsChanged",s)),this.selectedAddress!==s[0]&&(this.selectedAddress=s[0]||null)}_handleChainChanged(){let{chainId:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!t){lt.error("Torus: Received invalid network parameters. Please report this bug.",{chainId:t});return}t==="loading"?this._handleDisconnect(!0):(this._handleConnect(t),t!==this.chainId&&(this.chainId=t,this._state.initialized&&this.emit("chainChanged",this.chainId)))}_handleUnlockStateChanged(){let{accounts:t,isUnlocked:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof r!="boolean"){lt.error("Torus: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:r});return}r!==this._state.isUnlocked&&(this._state.isUnlocked=r,this._handleAccountsChanged(t||[]))}}Ne(qs,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});function Fb(e){return new Promise((t,r)=>{try{const o=document.createElement("img");o.onload=()=>t(!0),o.onerror=()=>t(!1),o.src=e}catch(o){r(o)}})}const pN=e=>{const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const o=t.querySelector('head > meta[name="title"]');return o?o.content:t.title&&t.title.length>0?t.title:e.location.hostname};async function bN(e){try{const{document:t}=e;let r=t.querySelector('head > link[rel="shortcut icon"]');return r&&await Fb(r.href)||(r=Array.from(t.querySelectorAll('head > link[rel="icon"]')).find(o=>!!o.href),r&&await Fb(r.href))?r.href:""}catch{return""}}const _N=async()=>({name:pN(window),icon:await bN(window)});function Hb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function hc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hb(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hb(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}const yN=["send_transaction","sign_transaction","sign_all_transactions","sign_message","connect"],wN=[En.SET_PROVIDER],mN=cN("localStorage");(async function(){try{if(typeof document>"u")return;const t=document.createElement("link"),{torusUrl:r}=await Q0("production");t.href=`${r}/frame`,t.crossOrigin="anonymous",t.type="text/html",t.rel="prefetch",t.relList&&t.relList.supports&&t.relList.supports("prefetch")&&document.head.appendChild(t)}catch(t){lt.warn(t)}})();class EN{constructor(){let{modalZIndex:t=99999}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ne(this,"isInitialized",void 0),Ne(this,"torusAlert",void 0),Ne(this,"modalZIndex",void 0),Ne(this,"alertZIndex",void 0),Ne(this,"requestedLoginProvider",void 0),Ne(this,"provider",void 0),Ne(this,"communicationProvider",void 0),Ne(this,"dappStorageKey",void 0),Ne(this,"isTopupHidden",!1),Ne(this,"torusAlertContainer",void 0),Ne(this,"torusUrl",void 0),Ne(this,"torusIframe",void 0),Ne(this,"styleLink",void 0),this.torusUrl="",this.isInitialized=!1,this.requestedLoginProvider=null,this.modalZIndex=t,this.alertZIndex=t+1e3,this.dappStorageKey=""}get isLoggedIn(){return this.communicationProvider?this.communicationProvider.isLoggedIn:!1}async init(){let{buildEnv:t=Z0.PRODUCTION,enableLogging:r=!1,network:o,showTorusButton:s=!1,useLocalStorage:u=!1,buttonPosition:f=So.BOTTOM_LEFT,apiKey:h="torus-default",extraParams:l={},whiteLabel:p}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.isInitialized)throw new Error("Already initialized");const{torusUrl:b,logLevel:w}=await Q0(t);lt.enableAll(),lt.info(b,"url loaded"),lt.info(`Solana Embed Version :${nN}`),this.torusUrl=b,lt.setDefaultLevel(w),r?lt.enableAll():lt.disableAll();const I=this.handleDappStorageKey(u),A=new URL(b);A.pathname.endsWith("/")?A.pathname+="frame":A.pathname+="/frame";const x=new URLSearchParams;I&&x.append("dappStorageKey",I),x.append("origin",window.location.origin),A.hash=x.toString(),this.torusIframe=Io(`<iframe
29
+ }`;var qe=Mg(function(){return Qe(L,Pe+"return "+we).apply(r,k)});if(qe.source=we,dl(qe))throw qe;return qe}function FR(n){return rt(n).toLowerCase()}function HR(n){return rt(n).toUpperCase()}function WR(n,i,a){if(n=rt(n),n&&(a||i===r))return qd(n);if(!n||!(i=Er(i)))return n;var c=Xr(n),y=Xr(i),L=Gd(c,y),k=Vd(c,y)+1;return hi(c,L,k).join("")}function qR(n,i,a){if(n=rt(n),n&&(a||i===r))return n.slice(0,Kd(n)+1);if(!n||!(i=Er(i)))return n;var c=Xr(n),y=Vd(c,Xr(i))+1;return hi(c,0,y).join("")}function GR(n,i,a){if(n=rt(n),n&&(a||i===r))return n.replace(St,"");if(!n||!(i=Er(i)))return n;var c=Xr(n),y=Gd(c,Xr(i));return hi(c,y).join("")}function VR(n,i){var a=Se,c=me;if(mt(i)){var y="separator"in i?i.separator:y;a="length"in i?We(i.length):a,c="omission"in i?Er(i.omission):c}n=rt(n);var L=n.length;if(so(n)){var k=Xr(n);L=k.length}if(a>=L)return n;var z=a-ao(c);if(z<1)return c;var ee=k?hi(k,0,z).join(""):n.slice(0,z);if(y===r)return ee+c;if(k&&(z+=ee.length-z),hl(y)){if(n.slice(z).search(y)){var ge,pe=ee;for(y.global||(y=Cf(y.source,rt(Cr.exec(y))+"g")),y.lastIndex=0;ge=y.exec(pe);)var we=ge.index;ee=ee.slice(0,we===r?z:we)}}else if(n.indexOf(Er(y),z)!=z){var Ae=ee.lastIndexOf(y);Ae>-1&&(ee=ee.slice(0,Ae))}return ee+c}function zR(n){return n=rt(n),n&&rr.test(n)?n.replace(tr,vw):n}var KR=po(function(n,i,a){return n+(a?" ":"")+i.toUpperCase()}),bl=xh("toUpperCase");function $g(n,i,a){return n=rt(n),i=a?r:i,i===r?_w(n)?Aw(n):uw(n):n.match(i)||[]}var Mg=Ge(function(n,i){try{return wr(n,r,i)}catch(a){return dl(a)?a:new ke(a)}}),JR=kn(function(n,i){return Pr(i,function(a){a=yn(a),jn(n,a,ll(n[a],n))}),n});function YR(n){var i=n==null?0:n.length,a=$e();return n=i?wt(n,function(c){if(typeof c[1]!="function")throw new Br(f);return[a(c[0]),c[1]]}):[],Ge(function(c){for(var y=-1;++y<i;){var L=n[y];if(wr(L[0],this,c))return wr(L[1],this,c)}})}function XR(n){return vm($r(n,w))}function _l(n){return function(){return n}}function ZR(n,i){return n==null||n!==n?i:n}var QR=jh(),e1=jh(!0);function gr(n){return n}function yl(n){return gh(typeof n=="function"?n:$r(n,w))}function t1(n){return bh($r(n,w))}function r1(n,i){return _h(n,$r(i,w))}var n1=Ge(function(n,i){return function(a){return os(a,n,i)}}),i1=Ge(function(n,i){return function(a){return os(n,a,i)}});function wl(n,i,a){var c=jt(i),y=Oa(i,c);a==null&&!(mt(i)&&(y.length||!c.length))&&(a=i,i=n,n=this,y=Oa(i,jt(i)));var L=!(mt(a)&&"chain"in a)||!!a.chain,k=Hn(n);return Pr(y,function(z){var ee=i[z];n[z]=ee,k&&(n.prototype[z]=function(){var ge=this.__chain__;if(L||ge){var pe=n(this.__wrapped__),we=pe.__actions__=cr(this.__actions__);return we.push({func:ee,args:arguments,thisArg:n}),pe.__chain__=ge,pe}return ee.apply(n,ai([this.value()],arguments))})}),n}function o1(){return De._===this&&(De._=Pw),this}function ml(){}function s1(n){return n=We(n),Ge(function(i){return yh(i,n)})}var a1=Xf(wt),u1=Xf(Ud),f1=Xf(vf);function xg(n){return il(n)?Sf(yn(n)):Um(n)}function l1(n){return function(i){return n==null?r:Mi(n,i)}}var c1=kh(),d1=kh(!0);function El(){return[]}function vl(){return!1}function h1(){return{}}function g1(){return""}function p1(){return!0}function b1(n,i){if(n=We(n),n<1||n>ne)return[];var a=ae,c=Kt(n,ae);i=$e(i),n-=ae;for(var y=Tf(c,i);++a<n;)i(a);return y}function _1(n){return Fe(n)?wt(n,yn):vr(n)?[n]:cr(rg(rt(n)))}function y1(n){var i=++Cw;return rt(n)+i}var w1=$a(function(n,i){return n+i},0),m1=Zf("ceil"),E1=$a(function(n,i){return n/i},1),v1=Zf("floor");function S1(n){return n&&n.length?Ia(n,gr,Df):r}function R1(n,i){return n&&n.length?Ia(n,$e(i,2),Df):r}function A1(n){return Hd(n,gr)}function T1(n,i){return Hd(n,$e(i,2))}function I1(n){return n&&n.length?Ia(n,gr,Ff):r}function O1(n,i){return n&&n.length?Ia(n,$e(i,2),Ff):r}var C1=$a(function(n,i){return n*i},1),L1=Zf("round"),P1=$a(function(n,i){return n-i},0);function B1(n){return n&&n.length?Af(n,gr):0}function N1(n,i){return n&&n.length?Af(n,$e(i,2)):0}return T.after=tS,T.ary=hg,T.assign=HS,T.assignIn=Ig,T.assignInWith=za,T.assignWith=WS,T.at=qS,T.before=gg,T.bind=ll,T.bindAll=JR,T.bindKey=pg,T.castArray=hS,T.chain=lg,T.chunk=vE,T.compact=SE,T.concat=RE,T.cond=YR,T.conforms=XR,T.constant=_l,T.countBy=Bv,T.create=GS,T.curry=bg,T.curryRight=_g,T.debounce=yg,T.defaults=VS,T.defaultsDeep=zS,T.defer=rS,T.delay=nS,T.difference=AE,T.differenceBy=TE,T.differenceWith=IE,T.drop=OE,T.dropRight=CE,T.dropRightWhile=LE,T.dropWhile=PE,T.fill=BE,T.filter=$v,T.flatMap=Dv,T.flatMapDeep=jv,T.flatMapDepth=Uv,T.flatten=sg,T.flattenDeep=NE,T.flattenDepth=$E,T.flip=iS,T.flow=QR,T.flowRight=e1,T.fromPairs=ME,T.functions=eR,T.functionsIn=tR,T.groupBy=kv,T.initial=DE,T.intersection=jE,T.intersectionBy=UE,T.intersectionWith=kE,T.invert=nR,T.invertBy=iR,T.invokeMap=Hv,T.iteratee=yl,T.keyBy=Wv,T.keys=jt,T.keysIn=hr,T.map=Fa,T.mapKeys=sR,T.mapValues=aR,T.matches=t1,T.matchesProperty=r1,T.memoize=Wa,T.merge=uR,T.mergeWith=Og,T.method=n1,T.methodOf=i1,T.mixin=wl,T.negate=qa,T.nthArg=s1,T.omit=fR,T.omitBy=lR,T.once=oS,T.orderBy=qv,T.over=a1,T.overArgs=sS,T.overEvery=u1,T.overSome=f1,T.partial=cl,T.partialRight=wg,T.partition=Gv,T.pick=cR,T.pickBy=Cg,T.property=xg,T.propertyOf=l1,T.pull=qE,T.pullAll=ug,T.pullAllBy=GE,T.pullAllWith=VE,T.pullAt=zE,T.range=c1,T.rangeRight=d1,T.rearg=aS,T.reject=Kv,T.remove=KE,T.rest=uS,T.reverse=ul,T.sampleSize=Yv,T.set=hR,T.setWith=gR,T.shuffle=Xv,T.slice=JE,T.sortBy=eS,T.sortedUniq=rv,T.sortedUniqBy=nv,T.split=DR,T.spread=fS,T.tail=iv,T.take=ov,T.takeRight=sv,T.takeRightWhile=av,T.takeWhile=uv,T.tap=Sv,T.throttle=lS,T.thru=ka,T.toArray=Rg,T.toPairs=Lg,T.toPairsIn=Pg,T.toPath=_1,T.toPlainObject=Tg,T.transform=pR,T.unary=cS,T.union=fv,T.unionBy=lv,T.unionWith=cv,T.uniq=dv,T.uniqBy=hv,T.uniqWith=gv,T.unset=bR,T.unzip=fl,T.unzipWith=fg,T.update=_R,T.updateWith=yR,T.values=yo,T.valuesIn=wR,T.without=pv,T.words=$g,T.wrap=dS,T.xor=bv,T.xorBy=_v,T.xorWith=yv,T.zip=wv,T.zipObject=mv,T.zipObjectDeep=Ev,T.zipWith=vv,T.entries=Lg,T.entriesIn=Pg,T.extend=Ig,T.extendWith=za,wl(T,T),T.add=w1,T.attempt=Mg,T.camelCase=SR,T.capitalize=Bg,T.ceil=m1,T.clamp=mR,T.clone=gS,T.cloneDeep=bS,T.cloneDeepWith=_S,T.cloneWith=pS,T.conformsTo=yS,T.deburr=Ng,T.defaultTo=ZR,T.divide=E1,T.endsWith=RR,T.eq=Qr,T.escape=AR,T.escapeRegExp=TR,T.every=Nv,T.find=Mv,T.findIndex=ig,T.findKey=KS,T.findLast=xv,T.findLastIndex=og,T.findLastKey=JS,T.floor=v1,T.forEach=cg,T.forEachRight=dg,T.forIn=YS,T.forInRight=XS,T.forOwn=ZS,T.forOwnRight=QS,T.get=gl,T.gt=wS,T.gte=mS,T.has=rR,T.hasIn=pl,T.head=ag,T.identity=gr,T.includes=Fv,T.indexOf=xE,T.inRange=ER,T.invoke=oR,T.isArguments=ji,T.isArray=Fe,T.isArrayBuffer=ES,T.isArrayLike=dr,T.isArrayLikeObject=Tt,T.isBoolean=vS,T.isBuffer=gi,T.isDate=SS,T.isElement=RS,T.isEmpty=AS,T.isEqual=TS,T.isEqualWith=IS,T.isError=dl,T.isFinite=OS,T.isFunction=Hn,T.isInteger=mg,T.isLength=Ga,T.isMap=Eg,T.isMatch=CS,T.isMatchWith=LS,T.isNaN=PS,T.isNative=BS,T.isNil=$S,T.isNull=NS,T.isNumber=vg,T.isObject=mt,T.isObjectLike=Rt,T.isPlainObject=cs,T.isRegExp=hl,T.isSafeInteger=MS,T.isSet=Sg,T.isString=Va,T.isSymbol=vr,T.isTypedArray=_o,T.isUndefined=xS,T.isWeakMap=DS,T.isWeakSet=jS,T.join=FE,T.kebabCase=IR,T.last=xr,T.lastIndexOf=HE,T.lowerCase=OR,T.lowerFirst=CR,T.lt=US,T.lte=kS,T.max=S1,T.maxBy=R1,T.mean=A1,T.meanBy=T1,T.min=I1,T.minBy=O1,T.stubArray=El,T.stubFalse=vl,T.stubObject=h1,T.stubString=g1,T.stubTrue=p1,T.multiply=C1,T.nth=WE,T.noConflict=o1,T.noop=ml,T.now=Ha,T.pad=LR,T.padEnd=PR,T.padStart=BR,T.parseInt=NR,T.random=vR,T.reduce=Vv,T.reduceRight=zv,T.repeat=$R,T.replace=MR,T.result=dR,T.round=L1,T.runInContext=Z,T.sample=Jv,T.size=Zv,T.snakeCase=xR,T.some=Qv,T.sortedIndex=YE,T.sortedIndexBy=XE,T.sortedIndexOf=ZE,T.sortedLastIndex=QE,T.sortedLastIndexBy=ev,T.sortedLastIndexOf=tv,T.startCase=jR,T.startsWith=UR,T.subtract=P1,T.sum=B1,T.sumBy=N1,T.template=kR,T.times=b1,T.toFinite=Wn,T.toInteger=We,T.toLength=Ag,T.toLower=FR,T.toNumber=Dr,T.toSafeInteger=FS,T.toString=rt,T.toUpper=HR,T.trim=WR,T.trimEnd=qR,T.trimStart=GR,T.truncate=VR,T.unescape=zR,T.uniqueId=y1,T.upperCase=KR,T.upperFirst=bl,T.each=cg,T.eachRight=dg,T.first=ag,wl(T,function(){var n={};return bn(T,function(i,a){it.call(T.prototype,a)||(n[a]=i)}),n}(),{chain:!1}),T.VERSION=o,Pr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){T[n].placeholder=T}),Pr(["drop","take"],function(n,i){Je.prototype[n]=function(a){a=a===r?1:Mt(We(a),0);var c=this.__filtered__&&!i?new Je(this):this.clone();return c.__filtered__?c.__takeCount__=Kt(a,c.__takeCount__):c.__views__.push({size:Kt(a,ae),type:n+(c.__dir__<0?"Right":"")}),c},Je.prototype[n+"Right"]=function(a){return this.reverse()[n](a).reverse()}}),Pr(["filter","map","takeWhile"],function(n,i){var a=i+1,c=a==$||a==Y;Je.prototype[n]=function(y){var L=this.clone();return L.__iteratees__.push({iteratee:$e(y,3),type:a}),L.__filtered__=L.__filtered__||c,L}}),Pr(["head","last"],function(n,i){var a="take"+(i?"Right":"");Je.prototype[n]=function(){return this[a](1).value()[0]}}),Pr(["initial","tail"],function(n,i){var a="drop"+(i?"":"Right");Je.prototype[n]=function(){return this.__filtered__?new Je(this):this[a](1)}}),Je.prototype.compact=function(){return this.filter(gr)},Je.prototype.find=function(n){return this.filter(n).head()},Je.prototype.findLast=function(n){return this.reverse().find(n)},Je.prototype.invokeMap=Ge(function(n,i){return typeof n=="function"?new Je(this):this.map(function(a){return os(a,n,i)})}),Je.prototype.reject=function(n){return this.filter(qa($e(n)))},Je.prototype.slice=function(n,i){n=We(n);var a=this;return a.__filtered__&&(n>0||i<0)?new Je(a):(n<0?a=a.takeRight(-n):n&&(a=a.drop(n)),i!==r&&(i=We(i),a=i<0?a.dropRight(-i):a.take(i-n)),a)},Je.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Je.prototype.toArray=function(){return this.take(ae)},bn(Je.prototype,function(n,i){var a=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),y=T[c?"take"+(i=="last"?"Right":""):i],L=c||/^find/.test(i);y&&(T.prototype[i]=function(){var k=this.__wrapped__,z=c?[1]:arguments,ee=k instanceof Je,ge=z[0],pe=ee||Fe(k),we=function(ze){var Xe=y.apply(T,ai([ze],z));return c&&Ae?Xe[0]:Xe};pe&&a&&typeof ge=="function"&&ge.length!=1&&(ee=pe=!1);var Ae=this.__chain__,Pe=!!this.__actions__.length,Me=L&&!Ae,qe=ee&&!Pe;if(!L&&pe){k=qe?k:new Je(this);var xe=n.apply(k,z);return xe.__actions__.push({func:ka,args:[we],thisArg:r}),new Nr(xe,Ae)}return Me&&qe?n.apply(this,z):(xe=this.thru(we),Me?c?xe.value()[0]:xe.value():xe)})}),Pr(["pop","push","shift","sort","splice","unshift"],function(n){var i=da[n],a=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",c=/^(?:pop|shift)$/.test(n);T.prototype[n]=function(){var y=arguments;if(c&&!this.__chain__){var L=this.value();return i.apply(Fe(L)?L:[],y)}return this[a](function(k){return i.apply(Fe(k)?k:[],y)})}}),bn(Je.prototype,function(n,i){var a=T[i];if(a){var c=a.name+"";it.call(co,c)||(co[c]=[]),co[c].push({name:i,func:a})}}),co[Na(r,B).name]=[{name:"wrapper",func:r}],Je.prototype.clone=zw,Je.prototype.reverse=Kw,Je.prototype.value=Jw,T.prototype.at=Rv,T.prototype.chain=Av,T.prototype.commit=Tv,T.prototype.next=Iv,T.prototype.plant=Cv,T.prototype.reverse=Lv,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=Pv,T.prototype.first=T.prototype.head,Zo&&(T.prototype[Zo]=Ov),T},uo=Tw();Nt?((Nt.exports=uo)._=uo,st._=uo):De._=uo}).call(H.commonjsGlobal)})(vu,vu.exports);vu.exports;_A();const ys={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},En={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key"},oB={GET_PROVIDER_STATE:"wallet_get_provider_state"},ic={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function sB(e){return function(r,o,s){s(u=>{o.error&&mu.warn(`Error in RPC response:
30
+ `,o),!r.isTorusInternal&&(mu.info(`RPC (${e.origin}):`,r,"->",o),u())})}}var _b;(function(e){e.approved="approved",e.cancelled="cancelled",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired"})(_b||(_b={}));var Uc={exports:{}},k0=H.requireEvents().EventEmitter,oc,yb;function aB(){if(yb)return oc;yb=1;function e(x,v){var C=Object.keys(x);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(x);v&&(B=B.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),C.push.apply(C,B)}return C}function t(x){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?e(Object(C),!0).forEach(function(B){r(x,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(C)):e(Object(C)).forEach(function(B){Object.defineProperty(x,B,Object.getOwnPropertyDescriptor(C,B))})}return x}function r(x,v,C){return v=f(v),v in x?Object.defineProperty(x,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[v]=C,x}function o(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function s(x,v){for(var C=0;C<v.length;C++){var B=v[C];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(x,f(B.key),B)}}function u(x,v,C){return v&&s(x.prototype,v),Object.defineProperty(x,"prototype",{writable:!1}),x}function f(x){var v=h(x,"string");return typeof v=="symbol"?v:String(v)}function h(x,v){if(typeof x!="object"||x===null)return x;var C=x[Symbol.toPrimitive];if(C!==void 0){var B=C.call(x,v);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}var l=H.bufferPolyfill,p=l.Buffer,b=H.require$$3,w=b.inspect,I=w&&w.custom||"inspect";function A(x,v,C){p.prototype.copy.call(x,v,C)}return oc=function(){function x(){o(this,x),this.head=null,this.tail=null,this.length=0}return u(x,[{key:"push",value:function(C){var B={data:C,next:null};this.length>0?this.tail.next=B:this.head=B,this.tail=B,++this.length}},{key:"unshift",value:function(C){var B={data:C,next:this.head};this.length===0&&(this.tail=B),this.head=B,++this.length}},{key:"shift",value:function(){if(this.length!==0){var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(C){if(this.length===0)return"";for(var B=this.head,P=""+B.data;B=B.next;)P+=C+B.data;return P}},{key:"concat",value:function(C){if(this.length===0)return p.alloc(0);for(var B=p.allocUnsafe(C>>>0),P=this.head,S=0;P;)A(P.data,B,S),S+=P.data.length,P=P.next;return B}},{key:"consume",value:function(C,B){var P;return C<this.head.data.length?(P=this.head.data.slice(0,C),this.head.data=this.head.data.slice(C)):C===this.head.data.length?P=this.shift():P=B?this._getString(C):this._getBuffer(C),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(C){var B=this.head,P=1,S=B.data;for(C-=S.length;B=B.next;){var m=B.data,j=C>m.length?m.length:C;if(j===m.length?S+=m:S+=m.slice(0,C),C-=j,C===0){j===m.length?(++P,B.next?this.head=B.next:this.head=this.tail=null):(this.head=B,B.data=m.slice(j));break}++P}return this.length-=P,S}},{key:"_getBuffer",value:function(C){var B=p.allocUnsafe(C),P=this.head,S=1;for(P.data.copy(B),C-=P.data.length;P=P.next;){var m=P.data,j=C>m.length?m.length:C;if(m.copy(B,B.length-C,0,j),C-=j,C===0){j===m.length?(++S,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=m.slice(j));break}++S}return this.length-=S,B}},{key:I,value:function(C,B){return w(this,t(t({},B),{},{depth:0,customInspect:!1}))}}]),x}(),oc}function uB(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,H.dist.process.nextTick(kc,this,e)):H.dist.process.nextTick(kc,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(u){!t&&u?r._writableState?r._writableState.errorEmitted?H.dist.process.nextTick(lu,r):(r._writableState.errorEmitted=!0,H.dist.process.nextTick(wb,r,u)):H.dist.process.nextTick(wb,r,u):t?(H.dist.process.nextTick(lu,r),t(u)):H.dist.process.nextTick(lu,r)}),this)}function wb(e,t){kc(e,t),lu(e)}function lu(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function fB(){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 kc(e,t){e.emit("error",t)}function lB(e,t){var r=e._readableState,o=e._writableState;r&&r.autoDestroy||o&&o.autoDestroy?e.destroy(t):e.emit("error",t)}var F0={destroy:uB,undestroy:fB,errorOrDestroy:lB},eo={};function cB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var H0={};function Vr(e,t,r){r||(r=Error);function o(u,f,h){return typeof t=="string"?t:t(u,f,h)}var s=function(u){cB(f,u);function f(h,l,p){return u.call(this,o(h,l,p))||this}return f}(r);s.prototype.name=r.name,s.prototype.code=e,H0[e]=s}function mb(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(o){return String(o)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function dB(e,t,r){return e.substr(0,t.length)===t}function hB(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function gB(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Vr("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Vr("ERR_INVALID_ARG_TYPE",function(e,t,r){var o;typeof t=="string"&&dB(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be";var s;if(hB(e," argument"))s="The ".concat(e," ").concat(o," ").concat(mb(t,"type"));else{var u=gB(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(mb(t,"type"))}return s+=". Received type ".concat(typeof r),s},TypeError);Vr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Vr("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Vr("ERR_STREAM_PREMATURE_CLOSE","Premature close");Vr("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Vr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Vr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Vr("ERR_STREAM_WRITE_AFTER_END","write after end");Vr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Vr("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Vr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");eo.codes=H0;var pB=eo.codes.ERR_INVALID_OPT_VALUE;function bB(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function _B(e,t,r,o){var s=bB(t,o,r);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var u=o?r:"highWaterMark";throw new pB(u,s)}return Math.floor(s)}return e.objectMode?16:16*1024}var W0={getHighWaterMark:_B},sc,Eb;function q0(){if(Eb)return sc;Eb=1,sc=ue;function e(R){var O=this;this.next=null,this.entry=null,this.finish=function(){be(O,R)}}var t;ue.WritableState=Q;var r={deprecate:H.requireBrowser()},o=k0,s=H.bufferPolyfill.Buffer,u=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(R){return s.from(R)}function h(R){return s.isBuffer(R)||R instanceof u}var l=F0,p=W0,b=p.getHighWaterMark,w=eo.codes,I=w.ERR_INVALID_ARG_TYPE,A=w.ERR_METHOD_NOT_IMPLEMENTED,x=w.ERR_MULTIPLE_CALLBACK,v=w.ERR_STREAM_CANNOT_PIPE,C=w.ERR_STREAM_DESTROYED,B=w.ERR_STREAM_NULL_VALUES,P=w.ERR_STREAM_WRITE_AFTER_END,S=w.ERR_UNKNOWN_ENCODING,m=l.errorOrDestroy;H.requireInherits_browser()(ue,o);function j(){}function Q(R,O,q){t=t||xo(),R=R||{},typeof q!="boolean"&&(q=O instanceof t),this.objectMode=!!R.objectMode,q&&(this.objectMode=this.objectMode||!!R.writableObjectMode),this.highWaterMark=b(this,R,"writableHighWaterMark",q),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var oe=R.decodeStrings===!1;this.decodeStrings=!oe,this.defaultEncoding=R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){Y(O,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}Q.prototype.getBuffer=function(){for(var O=this.bufferedRequest,q=[];O;)q.push(O),O=O.next;return q},function(){try{Object.defineProperty(Q.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ce;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ce=Function.prototype[Symbol.hasInstance],Object.defineProperty(ue,Symbol.hasInstance,{value:function(O){return ce.call(this,O)?!0:this!==ue?!1:O&&O._writableState instanceof Q}})):ce=function(O){return O instanceof this};function ue(R){t=t||xo();var O=this instanceof t;if(!O&&!ce.call(ue,this))return new ue(R);this._writableState=new Q(R,this,O),this.writable=!0,R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final)),o.call(this)}ue.prototype.pipe=function(){m(this,new v)};function te(R,O){var q=new P;m(R,q),H.dist.process.nextTick(O,q)}function Se(R,O,q,oe){var ye;return q===null?ye=new B:typeof q!="string"&&!O.objectMode&&(ye=new I("chunk",["string","Buffer"],q)),ye?(m(R,ye),H.dist.process.nextTick(oe,ye),!1):!0}ue.prototype.write=function(R,O,q){var oe=this._writableState,ye=!1,d=!oe.objectMode&&h(R);return d&&!s.isBuffer(R)&&(R=f(R)),typeof O=="function"&&(q=O,O=null),d?O="buffer":O||(O=oe.defaultEncoding),typeof q!="function"&&(q=j),oe.ending?te(this,q):(d||Se(this,oe,R,q))&&(oe.pendingcb++,ye=F(this,oe,d,R,O,q)),ye},ue.prototype.cork=function(){this._writableState.corked++},ue.prototype.uncork=function(){var R=this._writableState;R.corked&&(R.corked--,!R.writing&&!R.corked&&!R.bufferProcessing&&R.bufferedRequest&&W(this,R))},ue.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new S(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(ue.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function me(R,O,q){return!R.objectMode&&R.decodeStrings!==!1&&typeof O=="string"&&(O=s.from(O,q)),O}Object.defineProperty(ue.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(R,O,q,oe,ye,d){if(!q){var g=me(O,oe,ye);oe!==g&&(q=!0,ye="buffer",oe=g)}var _=O.objectMode?1:oe.length;O.length+=_;var E=O.length<O.highWaterMark;if(E||(O.needDrain=!0),O.writing||O.corked){var J=O.lastBufferedRequest;O.lastBufferedRequest={chunk:oe,encoding:ye,isBuf:q,callback:d,next:null},J?J.next=O.lastBufferedRequest:O.bufferedRequest=O.lastBufferedRequest,O.bufferedRequestCount+=1}else U(R,O,!1,_,oe,ye,d);return E}function U(R,O,q,oe,ye,d,g){O.writelen=oe,O.writecb=g,O.writing=!0,O.sync=!0,O.destroyed?O.onwrite(new C("write")):q?R._writev(ye,O.onwrite):R._write(ye,d,O.onwrite),O.sync=!1}function $(R,O,q,oe,ye){--O.pendingcb,q?(H.dist.process.nextTick(ye,oe),H.dist.process.nextTick(re,R,O),R._writableState.errorEmitted=!0,m(R,oe)):(ye(oe),R._writableState.errorEmitted=!0,m(R,oe),re(R,O))}function G(R){R.writing=!1,R.writecb=null,R.length-=R.writelen,R.writelen=0}function Y(R,O){var q=R._writableState,oe=q.sync,ye=q.writecb;if(typeof ye!="function")throw new x;if(G(q),O)$(R,q,oe,O,ye);else{var d=K(q)||R.destroyed;!d&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest&&W(R,q),oe?H.dist.process.nextTick(V,R,q,d,ye):V(R,q,d,ye)}}function V(R,O,q,oe){q||ne(R,O),O.pendingcb--,oe(),re(R,O)}function ne(R,O){O.length===0&&O.needDrain&&(O.needDrain=!1,R.emit("drain"))}function W(R,O){O.bufferProcessing=!0;var q=O.bufferedRequest;if(R._writev&&q&&q.next){var oe=O.bufferedRequestCount,ye=new Array(oe),d=O.corkedRequestsFree;d.entry=q;for(var g=0,_=!0;q;)ye[g]=q,q.isBuf||(_=!1),q=q.next,g+=1;ye.allBuffers=_,U(R,O,!0,O.length,ye,"",d.finish),O.pendingcb++,O.lastBufferedRequest=null,d.next?(O.corkedRequestsFree=d.next,d.next=null):O.corkedRequestsFree=new e(O),O.bufferedRequestCount=0}else{for(;q;){var E=q.chunk,J=q.encoding,ie=q.callback,se=O.objectMode?1:E.length;if(U(R,O,!1,se,E,J,ie),q=q.next,O.bufferedRequestCount--,O.writing)break}q===null&&(O.lastBufferedRequest=null)}O.bufferedRequest=q,O.bufferProcessing=!1}ue.prototype._write=function(R,O,q){q(new A("_write()"))},ue.prototype._writev=null,ue.prototype.end=function(R,O,q){var oe=this._writableState;return typeof R=="function"?(q=R,R=null,O=null):typeof O=="function"&&(q=O,O=null),R!=null&&this.write(R,O),oe.corked&&(oe.corked=1,this.uncork()),oe.ending||_e(this,oe,q),this},Object.defineProperty(ue.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function K(R){return R.ending&&R.length===0&&R.bufferedRequest===null&&!R.finished&&!R.writing}function ae(R,O){R._final(function(q){O.pendingcb--,q&&m(R,q),O.prefinished=!0,R.emit("prefinish"),re(R,O)})}function de(R,O){!O.prefinished&&!O.finalCalled&&(typeof R._final=="function"&&!O.destroyed?(O.pendingcb++,O.finalCalled=!0,H.dist.process.nextTick(ae,R,O)):(O.prefinished=!0,R.emit("prefinish")))}function re(R,O){var q=K(O);if(q&&(de(R,O),O.pendingcb===0&&(O.finished=!0,R.emit("finish"),O.autoDestroy))){var oe=R._readableState;(!oe||oe.autoDestroy&&oe.endEmitted)&&R.destroy()}return q}function _e(R,O,q){O.ending=!0,re(R,O),q&&(O.finished?H.dist.process.nextTick(q):R.once("finish",q)),O.ended=!0,R.writable=!1}function be(R,O,q){var oe=R.entry;for(R.entry=null;oe;){var ye=oe.callback;O.pendingcb--,ye(q),oe=oe.next}O.corkedRequestsFree.next=R}return Object.defineProperty(ue.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),ue.prototype.destroy=l.destroy,ue.prototype._undestroy=l.undestroy,ue.prototype._destroy=function(R,O){O(R)},sc}var ac,vb;function xo(){if(vb)return ac;vb=1;var e=Object.keys||function(p){var b=[];for(var w in p)b.push(w);return b};ac=f;var t=V0(),r=q0();H.requireInherits_browser()(f,t);for(var o=e(r.prototype),s=0;s<o.length;s++){var u=o[s];f.prototype[u]||(f.prototype[u]=r.prototype[u])}function f(p){if(!(this instanceof f))return new f(p);t.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",h)))}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function h(){this._writableState.ended||H.dist.process.nextTick(l,this)}function l(p){p.end()}return Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),ac}var Sb=eo.codes.ERR_STREAM_PREMATURE_CLOSE;function yB(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];e.apply(this,o)}}}function wB(){}function mB(e){return e.setHeader&&typeof e.abort=="function"}function G0(e,t,r){if(typeof t=="function")return G0(e,null,t);t||(t={}),r=yB(r||wB);var o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||h()},f=e._writableState&&e._writableState.finished,h=function(){s=!1,f=!0,o||r.call(e)},l=e._readableState&&e._readableState.endEmitted,p=function(){o=!1,l=!0,s||r.call(e)},b=function(x){r.call(e,x)},w=function(){var x;if(o&&!l)return(!e._readableState||!e._readableState.ended)&&(x=new Sb),r.call(e,x);if(s&&!f)return(!e._writableState||!e._writableState.ended)&&(x=new Sb),r.call(e,x)},I=function(){e.req.on("finish",h)};return mB(e)?(e.on("complete",h),e.on("abort",w),e.req?I():e.on("request",I)):s&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",p),e.on("finish",h),t.error!==!1&&e.on("error",b),e.on("close",w),function(){e.removeListener("complete",h),e.removeListener("abort",w),e.removeListener("request",I),e.req&&e.req.removeListener("finish",h),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",h),e.removeListener("end",p),e.removeListener("error",b),e.removeListener("close",w)}}var Ld=G0,uc,Rb;function EB(){if(Rb)return uc;Rb=1;var e;function t(S,m,j){return m=r(m),m in S?Object.defineProperty(S,m,{value:j,enumerable:!0,configurable:!0,writable:!0}):S[m]=j,S}function r(S){var m=o(S,"string");return typeof m=="symbol"?m:String(m)}function o(S,m){if(typeof S!="object"||S===null)return S;var j=S[Symbol.toPrimitive];if(j!==void 0){var Q=j.call(S,m);if(typeof Q!="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(S)}var s=Ld,u=Symbol("lastResolve"),f=Symbol("lastReject"),h=Symbol("error"),l=Symbol("ended"),p=Symbol("lastPromise"),b=Symbol("handlePromise"),w=Symbol("stream");function I(S,m){return{value:S,done:m}}function A(S){var m=S[u];if(m!==null){var j=S[w].read();j!==null&&(S[p]=null,S[u]=null,S[f]=null,m(I(j,!1)))}}function x(S){H.dist.process.nextTick(A,S)}function v(S,m){return function(j,Q){S.then(function(){if(m[l]){j(I(void 0,!0));return}m[b](j,Q)},Q)}}var C=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((e={get stream(){return this[w]},next:function(){var m=this,j=this[h];if(j!==null)return Promise.reject(j);if(this[l])return Promise.resolve(I(void 0,!0));if(this[w].destroyed)return new Promise(function(te,Se){H.dist.process.nextTick(function(){m[h]?Se(m[h]):te(I(void 0,!0))})});var Q=this[p],ce;if(Q)ce=new Promise(v(Q,this));else{var ue=this[w].read();if(ue!==null)return Promise.resolve(I(ue,!1));ce=new Promise(this[b])}return this[p]=ce,ce}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var m=this;return new Promise(function(j,Q){m[w].destroy(null,function(ce){if(ce){Q(ce);return}j(I(void 0,!0))})})}),e),C),P=function(m){var j,Q=Object.create(B,(j={},t(j,w,{value:m,writable:!0}),t(j,u,{value:null,writable:!0}),t(j,f,{value:null,writable:!0}),t(j,h,{value:null,writable:!0}),t(j,l,{value:m._readableState.endEmitted,writable:!0}),t(j,b,{value:function(ue,te){var Se=Q[w].read();Se?(Q[p]=null,Q[u]=null,Q[f]=null,ue(I(Se,!1))):(Q[u]=ue,Q[f]=te)},writable:!0}),j));return Q[p]=null,s(m,function(ce){if(ce&&ce.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ue=Q[f];ue!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,ue(ce)),Q[h]=ce;return}var te=Q[u];te!==null&&(Q[p]=null,Q[u]=null,Q[f]=null,te(I(void 0,!0))),Q[l]=!0}),m.on("readable",x.bind(null,Q)),Q};return uc=P,uc}var fc,Ab;function vB(){return Ab||(Ab=1,fc=function(){throw new Error("Readable.from is not available in the browser")}),fc}var lc,Tb;function V0(){if(Tb)return lc;Tb=1,lc=te;var e;te.ReadableState=ue,H.requireEvents().EventEmitter;var t=function(g,_){return g.listeners(_).length},r=k0,o=H.bufferPolyfill.Buffer,s=(typeof H.commonjsGlobal<"u"?H.commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(d){return o.from(d)}function f(d){return o.isBuffer(d)||d instanceof s}var h=H.require$$3,l;h&&h.debuglog?l=h.debuglog("stream"):l=function(){};var p=aB(),b=F0,w=W0,I=w.getHighWaterMark,A=eo.codes,x=A.ERR_INVALID_ARG_TYPE,v=A.ERR_STREAM_PUSH_AFTER_EOF,C=A.ERR_METHOD_NOT_IMPLEMENTED,B=A.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,S,m;H.requireInherits_browser()(te,r);var j=b.errorOrDestroy,Q=["error","close","destroy","pause","resume"];function ce(d,g,_){if(typeof d.prependListener=="function")return d.prependListener(g,_);!d._events||!d._events[g]?d.on(g,_):Array.isArray(d._events[g])?d._events[g].unshift(_):d._events[g]=[_,d._events[g]]}function ue(d,g,_){e=e||xo(),d=d||{},typeof _!="boolean"&&(_=g instanceof e),this.objectMode=!!d.objectMode,_&&(this.objectMode=this.objectMode||!!d.readableObjectMode),this.highWaterMark=I(this,d,"readableHighWaterMark",_),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.destroyed=!1,this.defaultEncoding=d.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,d.encoding&&(P||(P=H.requireString_decoder().StringDecoder),this.decoder=new P(d.encoding),this.encoding=d.encoding)}function te(d){if(e=e||xo(),!(this instanceof te))return new te(d);var g=this instanceof e;this._readableState=new ue(d,this,g),this.readable=!0,d&&(typeof d.read=="function"&&(this._read=d.read),typeof d.destroy=="function"&&(this._destroy=d.destroy)),r.call(this)}Object.defineProperty(te.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(g){this._readableState&&(this._readableState.destroyed=g)}}),te.prototype.destroy=b.destroy,te.prototype._undestroy=b.undestroy,te.prototype._destroy=function(d,g){g(d)},te.prototype.push=function(d,g){var _=this._readableState,E;return _.objectMode?E=!0:typeof d=="string"&&(g=g||_.defaultEncoding,g!==_.encoding&&(d=o.from(d,g),g=""),E=!0),Se(this,d,g,!1,E)},te.prototype.unshift=function(d){return Se(this,d,null,!0,!1)};function Se(d,g,_,E,J){l("readableAddChunk",g);var ie=d._readableState;if(g===null)ie.reading=!1,Y(d,ie);else{var se;if(J||(se=F(ie,g)),se)j(d,se);else if(ie.objectMode||g&&g.length>0)if(typeof g!="string"&&!ie.objectMode&&Object.getPrototypeOf(g)!==o.prototype&&(g=u(g)),E)ie.endEmitted?j(d,new B):me(d,ie,g,!0);else if(ie.ended)j(d,new v);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!_?(g=ie.decoder.write(g),ie.objectMode||g.length!==0?me(d,ie,g,!1):W(d,ie)):me(d,ie,g,!1)}else E||(ie.reading=!1,W(d,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function me(d,g,_,E){g.flowing&&g.length===0&&!g.sync?(g.awaitDrain=0,d.emit("data",_)):(g.length+=g.objectMode?1:_.length,E?g.buffer.unshift(_):g.buffer.push(_),g.needReadable&&V(d)),W(d,g)}function F(d,g){var _;return!f(g)&&typeof g!="string"&&g!==void 0&&!d.objectMode&&(_=new x("chunk",["string","Buffer","Uint8Array"],g)),_}te.prototype.isPaused=function(){return this._readableState.flowing===!1},te.prototype.setEncoding=function(d){P||(P=H.requireString_decoder().StringDecoder);var g=new P(d);this._readableState.decoder=g,this._readableState.encoding=this._readableState.decoder.encoding;for(var _=this._readableState.buffer.head,E="";_!==null;)E+=g.write(_.data),_=_.next;return this._readableState.buffer.clear(),E!==""&&this._readableState.buffer.push(E),this._readableState.length=E.length,this};var U=1073741824;function $(d){return d>=U?d=U:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++),d}function G(d,g){return d<=0||g.length===0&&g.ended?0:g.objectMode?1:d!==d?g.flowing&&g.length?g.buffer.head.data.length:g.length:(d>g.highWaterMark&&(g.highWaterMark=$(d)),d<=g.length?d:g.ended?g.length:(g.needReadable=!0,0))}te.prototype.read=function(d){l("read",d),d=parseInt(d,10);var g=this._readableState,_=d;if(d!==0&&(g.emittedReadable=!1),d===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return l("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?q(this):V(this),null;if(d=G(d,g),d===0&&g.ended)return g.length===0&&q(this),null;var E=g.needReadable;l("need readable",E),(g.length===0||g.length-d<g.highWaterMark)&&(E=!0,l("length less than watermark",E)),g.ended||g.reading?(E=!1,l("reading or ended",E)):E&&(l("do read"),g.reading=!0,g.sync=!0,g.length===0&&(g.needReadable=!0),this._read(g.highWaterMark),g.sync=!1,g.reading||(d=G(_,g)));var J;return d>0?J=O(d,g):J=null,J===null?(g.needReadable=g.length<=g.highWaterMark,d=0):(g.length-=d,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),_!==d&&g.ended&&q(this)),J!==null&&this.emit("data",J),J};function Y(d,g){if(l("onEofChunk"),!g.ended){if(g.decoder){var _=g.decoder.end();_&&_.length&&(g.buffer.push(_),g.length+=g.objectMode?1:_.length)}g.ended=!0,g.sync?V(d):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,ne(d)))}}function V(d){var g=d._readableState;l("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(l("emitReadable",g.flowing),g.emittedReadable=!0,H.dist.process.nextTick(ne,d))}function ne(d){var g=d._readableState;l("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(d.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,R(d)}function W(d,g){g.readingMore||(g.readingMore=!0,H.dist.process.nextTick(K,d,g))}function K(d,g){for(;!g.reading&&!g.ended&&(g.length<g.highWaterMark||g.flowing&&g.length===0);){var _=g.length;if(l("maybeReadMore read 0"),d.read(0),_===g.length)break}g.readingMore=!1}te.prototype._read=function(d){j(this,new C("_read()"))},te.prototype.pipe=function(d,g){var _=this,E=this._readableState;switch(E.pipesCount){case 0:E.pipes=d;break;case 1:E.pipes=[E.pipes,d];break;default:E.pipes.push(d);break}E.pipesCount+=1,l("pipe count=%d opts=%j",E.pipesCount,g);var J=(!g||g.end!==!1)&&d!==H.dist.process.stdout&&d!==H.dist.process.stderr,ie=J?Ie:_t;E.endEmitted?H.dist.process.nextTick(ie):_.once("end",ie),d.on("unpipe",se);function se(Ye,Ve){l("onunpipe"),Ye===_&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,Ue())}function Ie(){l("onend"),d.end()}var Be=ae(_);d.on("drain",Be);var Ce=!1;function Ue(){l("cleanup"),d.removeListener("close",bt),d.removeListener("finish",et),d.removeListener("drain",Be),d.removeListener("error",He),d.removeListener("unpipe",se),_.removeListener("end",Ie),_.removeListener("end",_t),_.removeListener("data",Re),Ce=!0,E.awaitDrain&&(!d._writableState||d._writableState.needDrain)&&Be()}_.on("data",Re);function Re(Ye){l("ondata");var Ve=d.write(Ye);l("dest.write",Ve),Ve===!1&&((E.pipesCount===1&&E.pipes===d||E.pipesCount>1&&ye(E.pipes,d)!==-1)&&!Ce&&(l("false write response, pause",E.awaitDrain),E.awaitDrain++),_.pause())}function He(Ye){l("onerror",Ye),_t(),d.removeListener("error",He),t(d,"error")===0&&j(d,Ye)}ce(d,"error",He);function bt(){d.removeListener("finish",et),_t()}d.once("close",bt);function et(){l("onfinish"),d.removeListener("close",bt),_t()}d.once("finish",et);function _t(){l("unpipe"),_.unpipe(d)}return d.emit("pipe",_),E.flowing||(l("pipe resume"),_.resume()),d};function ae(d){return function(){var _=d._readableState;l("pipeOnDrain",_.awaitDrain),_.awaitDrain&&_.awaitDrain--,_.awaitDrain===0&&t(d,"data")&&(_.flowing=!0,R(d))}}te.prototype.unpipe=function(d){var g=this._readableState,_={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return d&&d!==g.pipes?this:(d||(d=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,d&&d.emit("unpipe",this,_),this);if(!d){var E=g.pipes,J=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var ie=0;ie<J;ie++)E[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var se=ye(g.pipes,d);return se===-1?this:(g.pipes.splice(se,1),g.pipesCount-=1,g.pipesCount===1&&(g.pipes=g.pipes[0]),d.emit("unpipe",this,_),this)},te.prototype.on=function(d,g){var _=r.prototype.on.call(this,d,g),E=this._readableState;return d==="data"?(E.readableListening=this.listenerCount("readable")>0,E.flowing!==!1&&this.resume()):d==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,l("on readable",E.length,E.reading),E.length?V(this):E.reading||H.dist.process.nextTick(re,this)),_},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(d,g){var _=r.prototype.removeListener.call(this,d,g);return d==="readable"&&H.dist.process.nextTick(de,this),_},te.prototype.removeAllListeners=function(d){var g=r.prototype.removeAllListeners.apply(this,arguments);return(d==="readable"||d===void 0)&&H.dist.process.nextTick(de,this),g};function de(d){var g=d._readableState;g.readableListening=d.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:d.listenerCount("data")>0&&d.resume()}function re(d){l("readable nexttick read 0"),d.read(0)}te.prototype.resume=function(){var d=this._readableState;return d.flowing||(l("resume"),d.flowing=!d.readableListening,_e(this,d)),d.paused=!1,this};function _e(d,g){g.resumeScheduled||(g.resumeScheduled=!0,H.dist.process.nextTick(be,d,g))}function be(d,g){l("resume",g.reading),g.reading||d.read(0),g.resumeScheduled=!1,d.emit("resume"),R(d),g.flowing&&!g.reading&&d.read(0)}te.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function R(d){var g=d._readableState;for(l("flow",g.flowing);g.flowing&&d.read()!==null;);}te.prototype.wrap=function(d){var g=this,_=this._readableState,E=!1;d.on("end",function(){if(l("wrapped end"),_.decoder&&!_.ended){var se=_.decoder.end();se&&se.length&&g.push(se)}g.push(null)}),d.on("data",function(se){if(l("wrapped data"),_.decoder&&(se=_.decoder.write(se)),!(_.objectMode&&se==null)&&!(!_.objectMode&&(!se||!se.length))){var Ie=g.push(se);Ie||(E=!0,d.pause())}});for(var J in d)this[J]===void 0&&typeof d[J]=="function"&&(this[J]=function(Ie){return function(){return d[Ie].apply(d,arguments)}}(J));for(var ie=0;ie<Q.length;ie++)d.on(Q[ie],this.emit.bind(this,Q[ie]));return this._read=function(se){l("wrapped _read",se),E&&(E=!1,d.resume())},this},typeof Symbol=="function"&&(te.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=EB()),S(this)}),Object.defineProperty(te.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(te.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(te.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(g){this._readableState&&(this._readableState.flowing=g)}}),te._fromList=O,Object.defineProperty(te.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(d,g){if(g.length===0)return null;var _;return g.objectMode?_=g.buffer.shift():!d||d>=g.length?(g.decoder?_=g.buffer.join(""):g.buffer.length===1?_=g.buffer.first():_=g.buffer.concat(g.length),g.buffer.clear()):_=g.buffer.consume(d,g.decoder),_}function q(d){var g=d._readableState;l("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,H.dist.process.nextTick(oe,g,d))}function oe(d,g){if(l("endReadableNT",d.endEmitted,d.length),!d.endEmitted&&d.length===0&&(d.endEmitted=!0,g.readable=!1,g.emit("end"),d.autoDestroy)){var _=g._writableState;(!_||_.autoDestroy&&_.finished)&&g.destroy()}}typeof Symbol=="function"&&(te.from=function(d,g){return m===void 0&&(m=vB()),m(te,d,g)});function ye(d,g){for(var _=0,E=d.length;_<E;_++)if(d[_]===g)return _;return-1}return lc}var z0=Qn,sf=eo.codes,SB=sf.ERR_METHOD_NOT_IMPLEMENTED,RB=sf.ERR_MULTIPLE_CALLBACK,AB=sf.ERR_TRANSFORM_ALREADY_TRANSFORMING,TB=sf.ERR_TRANSFORM_WITH_LENGTH_0,af=xo();H.requireInherits_browser()(Qn,af);function IB(e,t){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(o===null)return this.emit("error",new RB);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),o(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function Qn(e){if(!(this instanceof Qn))return new Qn(e);af.call(this,e),this._transformState={afterTransform:IB.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",OB)}function OB(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Ib(e,t,r)}):Ib(this,null,null)}Qn.prototype.push=function(e,t){return this._transformState.needTransform=!1,af.prototype.push.call(this,e,t)};Qn.prototype._transform=function(e,t,r){r(new SB("_transform()"))};Qn.prototype._write=function(e,t,r){var o=this._transformState;if(o.writecb=r,o.writechunk=e,o.writeencoding=t,!o.transforming){var s=this._readableState;(o.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}};Qn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Qn.prototype._destroy=function(e,t){af.prototype._destroy.call(this,e,function(r){t(r)})};function Ib(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new TB;if(e._transformState.transforming)throw new AB;return e.push(null)}var CB=Bs,K0=z0;H.requireInherits_browser()(Bs,K0);function Bs(e){if(!(this instanceof Bs))return new Bs(e);K0.call(this,e)}Bs.prototype._transform=function(e,t,r){r(null,e)};var cc;function LB(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var J0=eo.codes,PB=J0.ERR_MISSING_ARGS,BB=J0.ERR_STREAM_DESTROYED;function Ob(e){if(e)throw e}function NB(e){return e.setHeader&&typeof e.abort=="function"}function $B(e,t,r,o){o=LB(o);var s=!1;e.on("close",function(){s=!0}),cc===void 0&&(cc=Ld),cc(e,{readable:t,writable:r},function(f){if(f)return o(f);s=!0,o()});var u=!1;return function(f){if(!s&&!u){if(u=!0,NB(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();o(f||new BB("pipe"))}}}function Cb(e){e()}function MB(e,t){return e.pipe(t)}function xB(e){return!e.length||typeof e[e.length-1]!="function"?Ob:e.pop()}function DB(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=xB(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new PB("streams");var s,u=t.map(function(f,h){var l=h<t.length-1,p=h>0;return $B(f,l,p,function(b){s||(s=b),b&&u.forEach(Cb),!l&&(u.forEach(Cb),o(s))})});return t.reduce(MB)}var jB=DB;(function(e,t){t=e.exports=V0(),t.Stream=t,t.Readable=t,t.Writable=q0(),t.Duplex=xo(),t.Transform=z0,t.PassThrough=CB,t.finished=Ld,t.pipeline=jB})(Uc,Uc.exports);var uf=Uc.exports,UB=H.requireBrowser$1();const kB=H.getDefaultExportFromCjs(UB);var FB={exports:{}},Pd={},Bd={};Object.defineProperty(Bd,"__esModule",{value:!0});function HB(e){var t=4,r=e.length,o=r%t;if(!o)return e;var s=r,u=t-o,f=r+u,h=H.dist.Buffer.alloc(f);for(h.write(e);u--;)h.write("=",s++);return h.toString()}Bd.default=HB;Object.defineProperty(Pd,"__esModule",{value:!0});var WB=Bd;function Y0(e,t){return t===void 0&&(t="utf8"),H.dist.Buffer.isBuffer(e)?Fc(e.toString("base64")):Fc(H.dist.Buffer.from(e,t).toString("base64"))}function qB(e,t){return t===void 0&&(t="utf8"),H.dist.Buffer.from(Nd(e),"base64").toString(t)}function Nd(e){return e=e.toString(),WB.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function Fc(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function GB(e){return H.dist.Buffer.from(Nd(e),"base64")}var Fo=Y0;Fo.encode=Y0;Fo.decode=qB;Fo.toBase64=Nd;Fo.fromBase64=Fc;Fo.toBuffer=GB;Pd.default=Fo;(function(e){e.exports=Pd.default,e.exports.default=e.exports})(FB);const VB=()=>kB(32).toString("hex");function nu(){}const Lb="SYN",dc="ACK",Pb="BRK";class Bb extends uf.Duplex{constructor(t){let{name:r,target:o,targetWindow:s=window,targetOrigin:u="*"}=t;if(super({objectMode:!0}),Ne(this,"_init",void 0),Ne(this,"_haveSyn",void 0),Ne(this,"_name",void 0),Ne(this,"_target",void 0),Ne(this,"_targetWindow",void 0),Ne(this,"_targetOrigin",void 0),Ne(this,"_onMessage",void 0),Ne(this,"_synIntervalId",void 0),!r||!o)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=r,this._target=o,this._targetWindow=s,this._targetOrigin=u,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(Pb,null,nu),this._haveSyn=!1,this._init=!1}_handShake(){this._write(Lb,null,nu),this.cork()}_onData(t){if(!this._init)t===Lb?(this._haveSyn=!0,this._write(dc,null,nu)):t===dc&&(this._init=!0,this._haveSyn||this._write(dc,null,nu),this.uncork());else if(t===Pb)this._break();else try{this.push(t)}catch(r){this.emit("error",r)}}_postMessage(t){const r=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:t},r)}onMessage(t){const r=t.data;this._targetOrigin!=="*"&&t.origin!==this._targetOrigin||t.source!==this._targetWindow||typeof r!="object"||r.target!==this._name||!r.data||this._onData(r.data)}_read(){}_write(t,r,o){this._postMessage(t),o()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function Nb(e,t,r){try{Reflect.apply(e,t,r)}catch(o){setTimeout(()=>{throw o})}}function zB(e){const t=e.length,r=new Array(t);for(let o=0;o<t;o+=1)r[o]=e[o];return r}class ff extends $1.eventsExports.EventEmitter{emit(t){let r=t==="error";const o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;for(var s=arguments.length,u=new Array(s>1?s-1:0),f=1;f<s;f++)u[f-1]=arguments[f];if(r){let l;if(u.length>0&&([l]=u),l instanceof Error)throw l;const p=new Error(`Unhandled error.${l?` (${l.message})`:""}`);throw p.context=l,p}const h=o[t];if(h===void 0)return!1;if(typeof h=="function")Nb(h,this,u);else{const l=h.length,p=zB(h);for(let b=0;b<l;b+=1)Nb(p[b],this,u)}return!0}}class ws extends Error{constructor(t){let{code:r,message:o,data:s}=t;if(!Number.isInteger(r))throw new Error("code must be an integer");if(!o||typeof o!="string")throw new Error("message must be string");super(o),Ne(this,"code",void 0),Ne(this,"data",void 0),this.code=r,s!==void 0&&(this.data=s)}toString(){return SA({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const Hc=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(o,s)=>{o||s.error?t(o||s.error):!r||Array.isArray(s)?e(s):e(s.result)}};function KB(){const e={};function t(){return!1}const r=new ff;function o(l){const p=e[l.id];if(!p)throw new Error(`StreamMiddleware - Unknown response id "${l.id}"`);delete e[l.id],Object.assign(p.res,l),setTimeout(p.end)}function s(l){r.emit("notification",l)}function u(l,p,b){let w;try{!l.id?s(l):o(l)}catch(I){w=I}b(w)}const f=new uf.Duplex({objectMode:!0,read:t,write:u});return{events:r,middleware:(l,p,b,w)=>{f.push(l),e[l.id]={req:l,res:p,next:b,end:w}},stream:f}}function JB(){return(e,t,r,o)=>{const s=e.id,u=VB();e.id=u,t.id=u,r(f=>{e.id=s,t.id=s,f()})}}function $b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function YB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$b(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$b(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class Kn extends ff{constructor(){super(),Ne(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(t,r,o){const s=[];let u=null,f=!1;for(const h of o)if([u,f]=await Kn._runMiddleware(t,r,h,s),f)break;return[u,f,s.reverse()]}static _runMiddleware(t,r,o,s){return new Promise(u=>{const f=l=>{const p=l||r.error;p&&(r.error=nn.serializeError(p)),u([p,!0])},h=l=>{r.error?f(r.error):(l&&(typeof l!="function"&&f(new ws({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),s.push(l)),u([null,!1]))};try{o(t,r,h,f)}catch(l){f(l)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((o,s)=>{r(u=>u?s(u):o())})}static _checkForCompletion(t,r,o){if(!("result"in r)&&!("error"in r))throw new ws({code:-32603,message:"Response has no error or result for request"});if(!o)throw new ws({code:-32603,message:"Nothing ended request"})}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,o,s)=>{try{const[u,f,h]=await Kn._runAllMiddleware(t,r,this._middleware);return f?(await Kn._runReturnHandlers(h),s(u)):o(async l=>{try{await Kn._runReturnHandlers(h)}catch(p){return l(p)}return l()})}catch(u){return s(u)}}}async _handleBatch(t,r){try{const o=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,o):o}catch(o){if(r)return r(o);throw o}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(o,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const f=new ws({code:-32603,message:"request must be plain object"});return r(f,{id:void 0,jsonrpc:"2.0",error:f})}if(typeof t.method!="string"){const f=new ws({code:-32603,message:"method must be string"});return r(f,{id:t.id,jsonrpc:"2.0",error:f})}const o=YB({},t),s={id:o.id,jsonrpc:o.jsonrpc};let u=null;try{await this._processRequest(o,s)}catch(f){u=f}return u&&(delete s.result,s.error||(s.error=nn.serializeError(u))),r(u,s)}async _processRequest(t,r){const[o,s,u]=await Kn._runAllMiddleware(t,r,this._middleware);if(Kn._checkForCompletion(t,r,s),await Kn._runReturnHandlers(u),o)throw o}}class XB extends uf.Duplex{constructor(t){let{parent:r,name:o}=t;super({objectMode:!0}),Ne(this,"_parent",void 0),Ne(this,"_name",void 0),this._parent=r,this._name=o}_read(){}_write(t,r,o){this._parent.push({name:this._name,data:t}),o()}}function Mb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function xb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mb(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mb(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}const Db=Symbol("IGNORE_SUBSTREAM");class ZB extends uf.Duplex{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(xb(xb({},t),{},{objectMode:!0})),Ne(this,"_substreams",void 0),Ne(this,"getStream",void 0),this._substreams={}}createStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);const r=new XB({parent:this,name:t});return this._substreams[t]=r,QB(this,o=>r.destroy(o||void 0)),r}ignoreStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);this._substreams[t]=Db}_read(){}_write(t,r,o){const{name:s,data:u}=t;if(!s)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${t}"`),o();const f=this._substreams[s];return f?(f!==Db&&f.push(u),o()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${s}"`),o())}}function QB(e,t){const r=oL(t);rb(e,{readable:!1},r),rb(e,{writable:!1},r)}const In=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";In.writable=e=>In(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";In.readable=e=>In(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";In.duplex=e=>In.writable(e)&&In.readable(e);In.transform=e=>In.duplex(e)&&typeof e._transform=="function";var eN=In,tN=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,s,u;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(s=o;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(u=Object.keys(t),o=u.length,o!==Object.keys(r).length)return!1;for(s=o;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,u[s]))return!1;for(s=o;s--!==0;){var f=u[s];if(!e(t[f],r[f]))return!1}return!0}return t!==t&&r!==r};const rN=H.getDefaultExportFromCjs(tN);var nN="0.3.4",An={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:e=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:e=>`Invalid options. Received: { maxEventListeners: ${e}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`Torus: Connected to chain with ID "${e}".`}};const X0={PRODUCTION:"production"},So={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},iN={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var $d={translations:iN,localStorageKeyPrefix:"torus-"},lt=mu.getLogger("solana-embed");function oN(){return(e,t,r)=>{(typeof e.method!="string"||!e.method)&&(t.error=nn.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),r(o=>{const{error:s}=t;return s&&lt.error(`Torus - RPC Error: ${s.message}`,s),o()})}}function sN(e,t,r){let o=`Torus: Lost connection to "${e}".`;t!=null&&t.stack&&(o+=`
31
+ ${t.stack}`),lt.warn(o),r&&r.listenerCount("error")>0&&r.emit("error",o)}const iu=()=>Math.random().toString(36).slice(2),Z0=async e=>{let t,r;switch(e){case"testing":t="https://solana-testing.tor.us",r="debug";break;case"development":t="http://localhost:8080",r="debug";break;default:t="https://solana.tor.us",r="error";break}return{torusUrl:t,logLevel:r}},aN=()=>{let e=window.navigator.language||"en-US";const t=e.split("-");return e=Object.prototype.hasOwnProperty.call($d.translations,t[0])?t[0]:"en",e},uN={height:660,width:375},fN={height:740,width:1315},lN={height:700,width:1200},Q0={height:600,width:400};function cN(e){let t;try{t=window[e];const r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return r&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0}}function Ss(e){let{width:t,height:r}=e;const o=window.screenLeft!==void 0?window.screenLeft:window.screenX,s=window.screenTop!==void 0?window.screenTop:window.screenY,u=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,f=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,h=1,l=Math.abs((u-t)/2/h+o),p=Math.abs((f-r)/2/h+s);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${r/h},width=${t/h},top=${p},left=${l}`}class ew extends ff{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:s="provider"}=r;if(super(),Ne(this,"isTorus",void 0),Ne(this,"_rpcEngine",void 0),Ne(this,"jsonRpcConnectionEvents",void 0),Ne(this,"_state",void 0),!eN.duplex(t))throw new Error(An.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(o),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this);const u=new ZB;ib(t,u,t,this._handleStreamDisconnect.bind(this,"Torus")),u.ignoreStream("phishing");const f=KB();ib(f.stream,u.createStream(s),f.stream,this._handleStreamDisconnect.bind(this,"Torus RpcProvider"));const h=new Kn;h.push(JB()),h.push(oN()),h.push(sB({origin:location.origin})),h.push(f.middleware),this._rpcEngine=h,this.jsonRpcConnectionEvents=f.events}async request(t){if(!t||typeof t!="object"||Array.isArray(t))throw nn.ethErrors.rpc.invalidRequest({message:An.errors.invalidRequestArgs(),data:t});const{method:r,params:o}=t;if(typeof r!="string"||r.length===0)throw nn.ethErrors.rpc.invalidRequest({message:An.errors.invalidRequestMethod(),data:t});if(o!==void 0&&!Array.isArray(o)&&(typeof o!="object"||o===null))throw nn.ethErrors.rpc.invalidRequest({message:An.errors.invalidRequestParams(),data:t});return new Promise((s,u)=>{this._rpcRequest({method:r,params:o},Hc(s,u))})}send(t,r){this._rpcRequest(t,r)}sendAsync(t){return new Promise((r,o)=>{this._rpcRequest(t,Hc(r,o))})}_handleStreamDisconnect(t,r){sN(t,r,this),this._handleDisconnect(!1,r?r.message:void 0)}}const dN=function(e,t,r){for(var o=arguments.length,s=new Array(o>3?o-3:0),u=3;u<o;u++)s[u-3]=arguments[u];const f=()=>{r(...s),e.removeEventListener(t,f)};e.addEventListener(t,f)};async function tw(){return new Promise(e=>{document.readyState!=="loading"?e():dN(document,"DOMContentLoaded",e)})}const Io=e=>{const t=window.document.createElement("template"),r=e.trim();return t.innerHTML=r,t.content.firstChild};function ou(e){return e.version===void 0}class rw extends ff{constructor(t){let{url:r,target:o,features:s}=t;super(),Ne(this,"url",void 0),Ne(this,"target",void 0),Ne(this,"features",void 0),Ne(this,"window",void 0),Ne(this,"windowTimer",void 0),Ne(this,"iClosedWindow",void 0),this.url=r,this.target=o||"_blank",this.features=s||Ss(lN),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){var t;return this.window=window.open(this.url.href,this.target,this.features),(t=this.window)!=null&&t.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(t){t?window.location.replace(this.url.href):window.location.href=this.url.href}}function jb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function hN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jb(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jb(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class lf extends ew{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:s="provider"}=r;super(t,{maxEventListeners:o,jsonRpcStreamName:s}),Ne(this,"embedTranslations",void 0),Ne(this,"torusUrl",void 0),Ne(this,"dappStorageKey",void 0),Ne(this,"windowRefs",void 0),Ne(this,"tryWindowHandle",void 0),Ne(this,"torusAlertContainer",void 0),Ne(this,"torusIframe",void 0),this._state=hN({},lf._defaultState),this.torusUrl="",this.dappStorageKey="";const u=$d.translations[aN()];this.embedTranslations=u.embed,this.windowRefs={},this.on("connect",()=>{this._state.isConnected=!0});const f=h=>{const{method:l,params:p}=h;if(l===ys.IFRAME_STATUS){const{isFullScreen:b,rid:w}=p;this._displayIframe({isFull:b,rid:w})}else if(l===ys.CREATE_WINDOW){const{windowId:b,url:w}=p;this._createPopupBlockAlert(b,w)}else if(l===ys.CLOSE_WINDOW)this._handleCloseWindow(p);else if(l===ys.USER_LOGGED_IN){const{currentLoginProvider:b}=p;this._state.isLoggedIn=!0,this._state.currentLoginProvider=b}else l===ys.USER_LOGGED_OUT&&(this._state.isLoggedIn=!1,this._state.currentLoginProvider=null,this._displayIframe())};this.jsonRpcConnectionEvents.on("notification",f)}get isLoggedIn(){return this._state.isLoggedIn}get isIFrameFullScreen(){return this._state.isIFrameFullScreen}isConnected(){return this._state.isConnected}async _initializeState(t){try{const{torusUrl:r,dappStorageKey:o,torusAlertContainer:s,torusIframe:u}=t;this.torusUrl=r,this.dappStorageKey=o,this.torusAlertContainer=s,this.torusIframe=u,this.torusIframe.addEventListener("load",()=>{this._state.isIFrameFullScreen||this._displayIframe()});const{currentLoginProvider:f,isLoggedIn:h}=await this.request({method:En.GET_PROVIDER_STATE,params:[]});this._handleConnect(f,h)}catch(r){lt.error("Torus: Failed to get initial state. Please report this bug.",r)}finally{lt.info("initialized communication state"),this._state.initialized=!0,this.emit("_initialized")}}_handleWindow(t){let{url:r,target:o,features:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const u=new URL(r||`${this.torusUrl}/redirect?windowId=${t}`);this.dappStorageKey&&(u.hash?u.hash+=`&dappStorageKey=${this.dappStorageKey}`:u.hash=`#dappStorageKey=${this.dappStorageKey}`);const f=new rw({url:u,target:o,features:s});if(f.open(),!f.window){this._createPopupBlockAlert(t,u.href);return}this.windowRefs[t]=f,this.request({method:En.OPENED_WINDOW,params:{windowId:t}}),f.once("close",()=>{delete this.windowRefs[t],this.request({method:En.CLOSED_WINDOW,params:{windowId:t}})})}_displayIframe(){let{isFull:t=!1,rid:r=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const o={};if(t)o.display="block",o.width="100%",o.height="100%",o.top="0px",o.right="0px",o.left="0px",o.bottom="0px";else switch(o.display=this._state.torusWidgetVisibility?"block":"none",o.height="70px",o.width="70px",this._state.buttonPosition){case So.TOP_LEFT:o.top="0px",o.left="0px",o.right="auto",o.bottom="auto";break;case So.TOP_RIGHT:o.top="0px",o.right="0px",o.left="auto",o.bottom="auto";break;case So.BOTTOM_RIGHT:o.bottom="0px",o.right="0px",o.top="auto",o.left="auto";break;case So.BOTTOM_LEFT:default:o.bottom="0px",o.left="0px",o.top="auto",o.right="auto";break}Object.assign(this.torusIframe.style,o),this._state.isIFrameFullScreen=t,this.request({method:En.IFRAME_STATUS,params:{isIFrameFullScreen:t,rid:r}})}hideTorusButton(){this._state.torusWidgetVisibility=!1,this._displayIframe()}showTorusButton(){this._state.torusWidgetVisibility=!0,this._displayIframe()}_rpcRequest(t,r){const o=r,s=t;Array.isArray(s)||s.jsonrpc||(s.jsonrpc="2.0"),this.tryWindowHandle(s,o)}_handleConnect(t,r){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{currentLoginProvider:t,isLoggedIn:r}),lt.debug(An.info.connected(t)))}_handleDisconnect(t,r){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){this._state.isConnected=!1;let o;t?(o=new nn.EthereumRpcError(1013,r||An.errors.disconnected()),lt.debug(o)):(o=new nn.EthereumRpcError(1011,r||An.errors.permanentlyDisconnected()),lt.error(o),this._state.currentLoginProvider=null,this._state.isLoggedIn=!1,this._state.torusWidgetVisibility=!1,this._state.isIFrameFullScreen=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",o)}}_handleCloseWindow(t){const{windowId:r}=t;this.windowRefs[r]&&(this.windowRefs[r].close(),delete this.windowRefs[r])}async _createPopupBlockAlert(t,r){const o=this.getLogoUrl(),s=Io(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${o}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),u=Io(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),f=Io('<div id="torusAlert__btn-container"></div>');f.appendChild(u),s.appendChild(f);const h=()=>{u.addEventListener("click",()=>{this._handleWindow(t,{url:r,target:"_blank",features:Ss(Q0)}),s.remove(),this.torusAlertContainer.children.length===0&&(this.torusAlertContainer.style.display="none")})},l=()=>{this.torusAlertContainer.appendChild(s)};await tw(),l(),h(),this.torusAlertContainer.style.display="block"}getLogoUrl(){return`${this.torusUrl}/images/torus_icon-blue.svg`}}Ne(lf,"_defaultState",{buttonPosition:"bottom-left",currentLoginProvider:null,isIFrameFullScreen:!1,hasEmittedConnection:!1,torusWidgetVisibility:!1,initialized:!1,isLoggedIn:!1,isPermanentlyDisconnected:!1,isConnected:!1});function Ub(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function gN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ub(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ub(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class qs extends ew{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:s="provider"}=r;super(t,{maxEventListeners:o,jsonRpcStreamName:s}),Ne(this,"chainId",void 0),Ne(this,"selectedAddress",void 0),Ne(this,"tryWindowHandle",void 0),this._state=gN({},qs._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this.on("connect",()=>{this._state.isConnected=!0});const u=f=>{const{method:h,params:l}=f;h===ic.ACCOUNTS_CHANGED?this._handleAccountsChanged(l):h===ic.UNLOCK_STATE_CHANGED?this._handleUnlockStateChanged(l):h===ic.CHAIN_CHANGED&&this._handleChainChanged(l)};this.jsonRpcConnectionEvents.on("notification",u)}isConnected(){return this._state.isConnected}async _initializeState(){try{const{accounts:t,chainId:r,isUnlocked:o}=await this.request({method:oB.GET_PROVIDER_STATE,params:[]});this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r}),this._handleUnlockStateChanged({accounts:t,isUnlocked:o}),this._handleAccountsChanged(t)}catch(t){lt.error("Torus: Failed to get initial state. Please report this bug.",t)}finally{lt.info("initialized provider state"),this._state.initialized=!0,this.emit("_initialized")}}_rpcRequest(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=r;const u=t;if(!Array.isArray(u)){if(u.jsonrpc||(u.jsonrpc="2.0"),u.method==="solana_accounts"||u.method==="solana_requestAccounts")s=(f,h)=>{this._handleAccountsChanged(h.result||[],u.method==="solana_accounts",o),r(f,h)};else if(u.method==="wallet_getProviderState"){this._rpcEngine.handle(t,s);return}}this.tryWindowHandle(u,s)}_handleConnect(t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:t}),lt.debug(An.info.connected(t)))}_handleDisconnect(t,r){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){this._state.isConnected=!1;let o;t?(o=new nn.EthereumRpcError(1013,r||An.errors.disconnected()),lt.debug(o)):(o=new nn.EthereumRpcError(1011,r||An.errors.permanentlyDisconnected()),lt.error(o),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",o)}}_handleAccountsChanged(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=t;Array.isArray(s)||(lt.error("Torus: Received non-array accounts parameter. Please report this bug.",s),s=[]);for(const u of t)if(typeof u!="string"){lt.error("Torus: Received non-string account. Please report this bug.",t),s=[];break}rN(this._state.accounts,s)||(r&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!o&&lt.error('Torus: "solana_accounts" unexpectedly updated accounts. Please report this bug.',s),this._state.accounts=s,this.emit("accountsChanged",s)),this.selectedAddress!==s[0]&&(this.selectedAddress=s[0]||null)}_handleChainChanged(){let{chainId:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!t){lt.error("Torus: Received invalid network parameters. Please report this bug.",{chainId:t});return}t==="loading"?this._handleDisconnect(!0):(this._handleConnect(t),t!==this.chainId&&(this.chainId=t,this._state.initialized&&this.emit("chainChanged",this.chainId)))}_handleUnlockStateChanged(){let{accounts:t,isUnlocked:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof r!="boolean"){lt.error("Torus: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:r});return}r!==this._state.isUnlocked&&(this._state.isUnlocked=r,this._handleAccountsChanged(t||[]))}}Ne(qs,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});function kb(e){return new Promise((t,r)=>{try{const o=document.createElement("img");o.onload=()=>t(!0),o.onerror=()=>t(!1),o.src=e}catch(o){r(o)}})}const pN=e=>{const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const o=t.querySelector('head > meta[name="title"]');return o?o.content:t.title&&t.title.length>0?t.title:e.location.hostname};async function bN(e){try{const{document:t}=e;let r=t.querySelector('head > link[rel="shortcut icon"]');return r&&await kb(r.href)||(r=Array.from(t.querySelectorAll('head > link[rel="icon"]')).find(o=>!!o.href),r&&await kb(r.href))?r.href:""}catch{return""}}const _N=async()=>({name:pN(window),icon:await bN(window)});function Fb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function hc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fb(Object(r),!0).forEach(function(o){Ne(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fb(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}const yN=["send_transaction","sign_transaction","sign_all_transactions","sign_message","connect"],wN=[En.SET_PROVIDER],mN=cN("localStorage");(async function(){try{if(typeof document>"u")return;const t=document.createElement("link"),{torusUrl:r}=await Z0("production");t.href=`${r}/frame`,t.crossOrigin="anonymous",t.type="text/html",t.rel="prefetch",t.relList&&t.relList.supports&&t.relList.supports("prefetch")&&document.head.appendChild(t)}catch(t){lt.warn(t)}})();class EN{constructor(){let{modalZIndex:t=99999}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ne(this,"isInitialized",void 0),Ne(this,"torusAlert",void 0),Ne(this,"modalZIndex",void 0),Ne(this,"alertZIndex",void 0),Ne(this,"requestedLoginProvider",void 0),Ne(this,"provider",void 0),Ne(this,"communicationProvider",void 0),Ne(this,"dappStorageKey",void 0),Ne(this,"isTopupHidden",!1),Ne(this,"torusAlertContainer",void 0),Ne(this,"torusUrl",void 0),Ne(this,"torusIframe",void 0),Ne(this,"styleLink",void 0),this.torusUrl="",this.isInitialized=!1,this.requestedLoginProvider=null,this.modalZIndex=t,this.alertZIndex=t+1e3,this.dappStorageKey=""}get isLoggedIn(){return this.communicationProvider?this.communicationProvider.isLoggedIn:!1}async init(){let{buildEnv:t=X0.PRODUCTION,enableLogging:r=!1,network:o,showTorusButton:s=!1,useLocalStorage:u=!1,buttonPosition:f=So.BOTTOM_LEFT,apiKey:h="torus-default",extraParams:l={},whiteLabel:p}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.isInitialized)throw new Error("Already initialized");const{torusUrl:b,logLevel:w}=await Z0(t);lt.enableAll(),lt.info(b,"url loaded"),lt.info(`Solana Embed Version :${nN}`),this.torusUrl=b,lt.setDefaultLevel(w),r?lt.enableAll():lt.disableAll();const I=this.handleDappStorageKey(u),A=new URL(b);A.pathname.endsWith("/")?A.pathname+="frame":A.pathname+="/frame";const x=new URLSearchParams;I&&x.append("dappStorageKey",I),x.append("origin",window.location.origin),A.hash=x.toString(),this.torusIframe=Io(`<iframe
32
32
  id="torusIframe"
33
33
  class="torusIframe"
34
34
  src="${A.href}"
35
35
  style="display: none; position: fixed; top: 0; right: 0; width: 100%;
36
36
  height: 100%; border: none; border-radius: 0; z-index: ${this.modalZIndex.toString()}"
37
- ></iframe>`),this.torusAlertContainer=Io(`<div id="torusAlertContainer" style="display:none; z-index: ${this.alertZIndex.toString()}"></div>`),this.styleLink=Io(`<link href="${b}/css/widget.css" rel="stylesheet" type="text/css">`);const v=async()=>new Promise((C,B)=>{try{window.document.head.appendChild(this.styleLink),window.document.body.appendChild(this.torusIframe),window.document.body.appendChild(this.torusAlertContainer),this.torusIframe.addEventListener("load",async()=>{const P=await _N();this.torusIframe.contentWindow.postMessage({buttonPosition:f,apiKey:h,network:o,dappMetadata:P,extraParams:l,whiteLabel:p},A.origin),await this._setupWeb3({torusUrl:b}),s&&this.showTorusButton(),p!=null&&p.topupHide?this.isTopupHidden=p.topupHide:this.hideTorusButton(),this.isInitialized=!0,window.torus=this,C()})}catch(P){B(P)}});await rw(),await v()}async login(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.isInitialized)throw new Error("Call init() first");try{this.requestedLoginProvider=t.loginProvider||null,this.requestedLoginProvider||this.communicationProvider._displayIframe({isFull:!0});const r=await new Promise((o,s)=>{this.provider._rpcRequest({method:"solana_requestAccounts",params:[this.requestedLoginProvider,t.login_hint]},Hc(o,s))});if(Array.isArray(r)&&r.length>0)return r;throw new Error("Login failed")}catch(r){throw lt.error("login failed",r),r}finally{this.communicationProvider.isIFrameFullScreen&&this.communicationProvider._displayIframe()}}async loginWithPrivateKey(t){if(!this.isInitialized)throw new Error("Call init() first");const{privateKey:r,userInfo:o}=t,{success:s}=await this.communicationProvider.request({method:"login_with_private_key",params:{privateKey:r,userInfo:o}});if(!s)throw new Error("Login Failed")}async logout(){if(!this.communicationProvider.isLoggedIn)throw new Error("Not logged in");await this.communicationProvider.request({method:En.LOGOUT,params:[]}),this.requestedLoginProvider=null}async cleanUp(){this.communicationProvider.isLoggedIn&&await this.logout(),this.clearInit()}clearInit(){function t(r){return r instanceof Element||r instanceof Document}t(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink=void 0),t(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe=void 0),t(this.torusAlertContainer)&&window.document.body.contains(this.torusAlertContainer)&&(this.torusAlert=void 0,this.torusAlertContainer.remove(),this.torusAlertContainer=void 0),this.isInitialized=!1}hideTorusButton(){this.communicationProvider.hideTorusButton()}showTorusButton(){this.communicationProvider.showTorusButton()}async setProvider(t){await this.communicationProvider.request({method:En.SET_PROVIDER,params:hc({},t)})}async showWallet(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=await this.communicationProvider.request({method:En.WALLET_INSTANCE_ID,params:[]}),s=t?`/${t}`:"",u=new URL(`${this.torusUrl}/wallet${s}`);u.searchParams.append("instanceId",o),Object.keys(r).forEach(h=>{u.searchParams.append(h,r[h])}),this.dappStorageKey&&(u.hash=`#dappStorageKey=${this.dappStorageKey}`),new nw({url:u,features:Ss(fN)}).open()}async getUserInfo(){return await this.communicationProvider.request({method:En.USER_INFO,params:[]})}async initiateTopup(t,r){if(!this.isInitialized)throw new Error("Torus is not initialized");const o=iu();return this.communicationProvider._handleWindow(o),await this.communicationProvider.request({method:En.TOPUP,params:{provider:t,params:r,windowId:o}})}async getAccounts(){return await this.provider.request({method:"getAccounts",params:[]})}async sendTransaction(t){const r=ou(t),o=r?t.serialize({requireAllSignatures:!1}).toString("hex"):H.dist.Buffer.from(t.serialize()).toString("hex");return await this.provider.request({method:"send_transaction",params:{message:o,isLegacyTransaction:r}})}async signAndSendTransaction(t,r){const o=ou(t),s=o?t.serialize({requireAllSignatures:!1}).toString("hex"):H.dist.Buffer.from(t.serialize()).toString("hex");return{signature:await this.provider.request({method:"send_transaction",params:{message:s,options:r,isLegacyTransaction:o}})}}async signTransaction(t){const r=ou(t),o=r?t.serializeMessage().toString("hex"):H.dist.Buffer.from(t.message.serialize()).toString("hex"),s=await this.provider.request({method:"sign_transaction",params:{message:o,messageOnly:!0,isLegacyTransaction:r}}),u=JSON.parse(s),f={publicKey:new H.PublicKey(u.publicKey),signature:H.dist.Buffer.from(u.signature,"hex")};return t.addSignature(f.publicKey,f.signature),t}async signAllTransactions(t){let r;const o=t.map(f=>(r=ou(f),r?f.serializeMessage().toString("hex"):H.dist.Buffer.from(f.message.serialize()).toString("hex"))),u=(await this.provider.request({method:"sign_all_transactions",params:{message:o,messageOnly:!0,isLegacyTransaction:r}})).map(f=>{const h=JSON.parse(f);return{publicKey:new H.PublicKey(h.publicKey),signature:H.dist.Buffer.from(h.signature,"hex")}});return t.forEach((f,h)=>(f.addSignature(u[h].publicKey,u[h].signature),f)),t}async signMessage(t){return await this.provider.request({method:"sign_message",params:{data:t}})}async getGaslessPublicKey(){return await this.provider.request({method:"get_gasless_public_key",params:[]})}handleDappStorageKey(t){const r=`${Md.localStorageKeyPrefix}${window.location.hostname}`;let o="";if(mN&&t){const s=window.localStorage.getItem(r);if(s)o=s;else{const u=`torus-app-${iu()}`;window.localStorage.setItem(r,u),o=u}}return this.dappStorageKey=o,o}async _setupWeb3(t){lt.info("setupWeb3 running");const r=new Nb({name:"embed_torus",target:"iframe_torus",targetWindow:this.torusIframe.contentWindow}),o=new Nb({name:"embed_communication",target:"iframe_communication",targetWindow:this.torusIframe.contentWindow}),s=new qs(r,{}),u=new lf(o,{});s.tryWindowHandle=(p,b)=>{const w=p;if(!Array.isArray(w)&&yN.includes(w.method)){if(!this.communicationProvider.isLoggedIn)throw new Error("User Not Logged In");const I=iu();u._handleWindow(I,{target:"_blank",features:Ss(ew)}),w.windowId=I}s._rpcEngine.handle(w,b)},u.tryWindowHandle=(p,b)=>{const w=p;if(!Array.isArray(w)&&wN.includes(w.method)){const I=iu();u._handleWindow(I,{target:"_blank",features:Ss(uN)}),w.params.windowId=I}u._rpcEngine.handle(w,b)};const f=p=>{const b=s[p],w=this;s[p]=function(A,x){const{method:v,params:C=[]}=A;if(v==="solana_requestAccounts"){if(!x)return w.login({loginProvider:C[0]});w.login({loginProvider:C[0]}).then(B=>x(null,B)).catch(B=>x(B))}return b.apply(this,[A,x])}};f("request"),f("sendAsync"),f("send");const h=new Proxy(s,{deleteProperty:()=>!0}),l=new Proxy(u,{deleteProperty:()=>!0});this.provider=h,this.communicationProvider=l,await Promise.all([s._initializeState(),u._initializeState(hc(hc({},t),{},{dappStorageKey:this.dappStorageKey,torusAlertContainer:this.torusAlertContainer,torusIframe:this.torusIframe}))]),lt.debug("Torus - injected provider")}}exports.BUTTON_POSITION=So;exports.TORUS_BUILD_ENV=Z0;exports.TorusInPageProvider=qs;exports.default=EN;
37
+ ></iframe>`),this.torusAlertContainer=Io(`<div id="torusAlertContainer" style="display:none; z-index: ${this.alertZIndex.toString()}"></div>`),this.styleLink=Io(`<link href="${b}/css/widget.css" rel="stylesheet" type="text/css">`);const v=async()=>new Promise((C,B)=>{try{window.document.head.appendChild(this.styleLink),window.document.body.appendChild(this.torusIframe),window.document.body.appendChild(this.torusAlertContainer),this.torusIframe.addEventListener("load",async()=>{const P=await _N();this.torusIframe.contentWindow.postMessage({buttonPosition:f,apiKey:h,network:o,dappMetadata:P,extraParams:l,whiteLabel:p},A.origin),await this._setupWeb3({torusUrl:b}),s&&this.showTorusButton(),p!=null&&p.topupHide?this.isTopupHidden=p.topupHide:this.hideTorusButton(),this.isInitialized=!0,window.torus=this,C()})}catch(P){B(P)}});await tw(),await v()}async login(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.isInitialized)throw new Error("Call init() first");try{this.requestedLoginProvider=t.loginProvider||null,this.requestedLoginProvider||this.communicationProvider._displayIframe({isFull:!0});const r=await new Promise((o,s)=>{this.provider._rpcRequest({method:"solana_requestAccounts",params:[this.requestedLoginProvider,t.login_hint]},Hc(o,s))});if(Array.isArray(r)&&r.length>0)return r;throw new Error("Login failed")}catch(r){throw lt.error("login failed",r),r}finally{this.communicationProvider.isIFrameFullScreen&&this.communicationProvider._displayIframe()}}async loginWithPrivateKey(t){if(!this.isInitialized)throw new Error("Call init() first");const{privateKey:r,userInfo:o}=t,{success:s}=await this.communicationProvider.request({method:"login_with_private_key",params:{privateKey:r,userInfo:o}});if(!s)throw new Error("Login Failed")}async logout(){if(!this.communicationProvider.isLoggedIn)throw new Error("Not logged in");await this.communicationProvider.request({method:En.LOGOUT,params:[]}),this.requestedLoginProvider=null}async cleanUp(){this.communicationProvider.isLoggedIn&&await this.logout(),this.clearInit()}clearInit(){function t(r){return r instanceof Element||r instanceof Document}t(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink=void 0),t(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe=void 0),t(this.torusAlertContainer)&&window.document.body.contains(this.torusAlertContainer)&&(this.torusAlert=void 0,this.torusAlertContainer.remove(),this.torusAlertContainer=void 0),this.isInitialized=!1}hideTorusButton(){this.communicationProvider.hideTorusButton()}showTorusButton(){this.communicationProvider.showTorusButton()}async setProvider(t){await this.communicationProvider.request({method:En.SET_PROVIDER,params:hc({},t)})}async showWallet(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=await this.communicationProvider.request({method:En.WALLET_INSTANCE_ID,params:[]}),s=t?`/${t}`:"",u=new URL(`${this.torusUrl}/wallet${s}`);u.searchParams.append("instanceId",o),Object.keys(r).forEach(h=>{u.searchParams.append(h,r[h])}),this.dappStorageKey&&(u.hash=`#dappStorageKey=${this.dappStorageKey}`),new rw({url:u,features:Ss(fN)}).open()}async getUserInfo(){return await this.communicationProvider.request({method:En.USER_INFO,params:[]})}async initiateTopup(t,r){if(!this.isInitialized)throw new Error("Torus is not initialized");const o=iu();return this.communicationProvider._handleWindow(o),await this.communicationProvider.request({method:En.TOPUP,params:{provider:t,params:r,windowId:o}})}async getAccounts(){return await this.provider.request({method:"getAccounts",params:[]})}async sendTransaction(t){const r=ou(t),o=r?t.serialize({requireAllSignatures:!1}).toString("hex"):H.dist.Buffer.from(t.serialize()).toString("hex");return await this.provider.request({method:"send_transaction",params:{message:o,isLegacyTransaction:r}})}async signAndSendTransaction(t,r){const o=ou(t),s=o?t.serialize({requireAllSignatures:!1}).toString("hex"):H.dist.Buffer.from(t.serialize()).toString("hex");return{signature:await this.provider.request({method:"send_transaction",params:{message:s,options:r,isLegacyTransaction:o}})}}async signTransaction(t){const r=ou(t),o=r?t.serializeMessage().toString("hex"):H.dist.Buffer.from(t.message.serialize()).toString("hex"),s=await this.provider.request({method:"sign_transaction",params:{message:o,messageOnly:!0,isLegacyTransaction:r}}),u=JSON.parse(s),f={publicKey:new H.PublicKey(u.publicKey),signature:H.dist.Buffer.from(u.signature,"hex")};return t.addSignature(f.publicKey,f.signature),t}async signAllTransactions(t){let r;const o=t.map(f=>(r=ou(f),r?f.serializeMessage().toString("hex"):H.dist.Buffer.from(f.message.serialize()).toString("hex"))),u=(await this.provider.request({method:"sign_all_transactions",params:{message:o,messageOnly:!0,isLegacyTransaction:r}})).map(f=>{const h=JSON.parse(f);return{publicKey:new H.PublicKey(h.publicKey),signature:H.dist.Buffer.from(h.signature,"hex")}});return t.forEach((f,h)=>(f.addSignature(u[h].publicKey,u[h].signature),f)),t}async signMessage(t){return await this.provider.request({method:"sign_message",params:{data:t}})}async getGaslessPublicKey(){return await this.provider.request({method:"get_gasless_public_key",params:[]})}handleDappStorageKey(t){const r=`${$d.localStorageKeyPrefix}${window.location.hostname}`;let o="";if(mN&&t){const s=window.localStorage.getItem(r);if(s)o=s;else{const u=`torus-app-${iu()}`;window.localStorage.setItem(r,u),o=u}}return this.dappStorageKey=o,o}async _setupWeb3(t){lt.info("setupWeb3 running");const r=new Bb({name:"embed_torus",target:"iframe_torus",targetWindow:this.torusIframe.contentWindow}),o=new Bb({name:"embed_communication",target:"iframe_communication",targetWindow:this.torusIframe.contentWindow}),s=new qs(r,{}),u=new lf(o,{});s.tryWindowHandle=(p,b)=>{const w=p;if(!Array.isArray(w)&&yN.includes(w.method)){if(!this.communicationProvider.isLoggedIn)throw new Error("User Not Logged In");const I=iu();u._handleWindow(I,{target:"_blank",features:Ss(Q0)}),w.windowId=I}s._rpcEngine.handle(w,b)},u.tryWindowHandle=(p,b)=>{const w=p;if(!Array.isArray(w)&&wN.includes(w.method)){const I=iu();u._handleWindow(I,{target:"_blank",features:Ss(uN)}),w.params.windowId=I}u._rpcEngine.handle(w,b)};const f=p=>{const b=s[p],w=this;s[p]=function(A,x){const{method:v,params:C=[]}=A;if(v==="solana_requestAccounts"){if(!x)return w.login({loginProvider:C[0]});w.login({loginProvider:C[0]}).then(B=>x(null,B)).catch(B=>x(B))}return b.apply(this,[A,x])}};f("request"),f("sendAsync"),f("send");const h=new Proxy(s,{deleteProperty:()=>!0}),l=new Proxy(u,{deleteProperty:()=>!0});this.provider=h,this.communicationProvider=l,await Promise.all([s._initializeState(),u._initializeState(hc(hc({},t),{},{dappStorageKey:this.dappStorageKey,torusAlertContainer:this.torusAlertContainer,torusIframe:this.torusIframe}))]),lt.debug("Torus - injected provider")}}exports.BUTTON_POSITION=So;exports.TORUS_BUILD_ENV=X0;exports.TorusInPageProvider=qs;exports.default=EN;