@multiplechain/bitcoin 0.4.21 → 0.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";var A5=Object.create;var mp=Object.defineProperty;var O5=Object.getOwnPropertyDescriptor;var k5=Object.getOwnPropertyNames;var P5=Object.getPrototypeOf,N5=Object.prototype.hasOwnProperty;var X=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Oa=(e,t)=>{for(var r in t)mp(e,r,{get:t[r],enumerable:!0})},i1=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of k5(t))!N5.call(e,n)&&n!==r&&mp(e,n,{get:()=>t[n],enumerable:!(i=O5(t,n))||i.enumerable});return e};var Mr=(e,t,r)=>(r=e!=null?A5(P5(e)):{},i1(t||!e||!e.__esModule?mp(r,"default",{value:e,enumerable:!0}):r,e)),B5=e=>i1(mp({},"__esModule",{value:!0}),e);var g1=X((RU,v1)=>{var m1=require("stream").Stream,dk=require("util");v1.exports=An;function An(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}dk.inherits(An,m1);An.create=function(e,t){var r=new this;t=t||{};for(var i in t)r[i]=t[i];r.source=e;var n=e.emit;return e.emit=function(){return r._handleEmit(arguments),n.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(An.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});An.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};An.prototype.resume=function(){this._released||this.release(),this.source.resume()};An.prototype.pause=function(){this.source.pause()};An.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};An.prototype.pipe=function(){var e=m1.prototype.pipe.apply(this,arguments);return this.resume(),e};An.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};An.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var y1=X((AU,_1)=>{var mk=require("util"),b1=require("stream").Stream,x1=g1();_1.exports=_r;function _r(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}mk.inherits(_r,b1);_r.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};_r.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};_r.prototype.append=function(e){var t=_r.isStreamLike(e);if(t){if(!(e instanceof x1)){var r=x1.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};_r.prototype.pipe=function(e,t){return b1.prototype.pipe.call(this,e,t),this.resume(),e};_r.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};_r.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var i=_r.isStreamLike(r);i&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};_r.prototype._pipeNext=function(e){this._currentStream=e;var t=_r.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};_r.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};_r.prototype.write=function(e){this.emit("data",e)};_r.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};_r.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};_r.prototype.end=function(){this._reset(),this.emit("end")};_r.prototype.destroy=function(){this._reset(),this.emit("close")};_r.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};_r.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};_r.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};_r.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var w1=X((OU,vk)=>{vk.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var E1=X((kU,S1)=>{S1.exports=w1()});var R1=X(Ri=>{"use strict";var _p=E1(),gk=require("path").extname,I1=/^\s*([^;\s]*)(?:;|\s|$)/,xk=/^text\//i;Ri.charset=T1;Ri.charsets={lookup:T1};Ri.contentType=bk;Ri.extension=_k;Ri.extensions=Object.create(null);Ri.lookup=yk;Ri.types=Object.create(null);wk(Ri.extensions,Ri.types);function T1(e){if(!e||typeof e!="string")return!1;var t=I1.exec(e),r=t&&_p[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&xk.test(t[1])?"UTF-8":!1}function bk(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Ri.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Ri.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}function _k(e){if(!e||typeof e!="string")return!1;var t=I1.exec(e),r=t&&Ri.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}function yk(e){if(!e||typeof e!="string")return!1;var t=gk("x."+e).toLowerCase().substr(1);return t&&Ri.types[t]||!1}function wk(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(_p).forEach(function(n){var o=_p[n],u=o.extensions;if(!(!u||!u.length)){e[n]=u;for(var m=0;m<u.length;m++){var _=u[m];if(t[_]){var w=r.indexOf(_p[t[_]].source),I=r.indexOf(o.source);if(t[_]!=="application/octet-stream"&&(w>I||w===I&&t[_].substr(0,12)==="application/"))continue}t[_]=n}}})}});var O1=X((NU,A1)=>{A1.exports=Sk;function Sk(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}});var j0=X((BU,P1)=>{var k1=O1();P1.exports=Ek;function Ek(e){var t=!1;return k1(function(){t=!0}),function(i,n){t?e(i,n):k1(function(){e(i,n)})}}});var W0=X((MU,N1)=>{N1.exports=Ik;function Ik(e){Object.keys(e.jobs).forEach(Tk.bind(e)),e.jobs={}}function Tk(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}});var K0=X((CU,M1)=>{var B1=j0(),Rk=W0();M1.exports=Ak;function Ak(e,t,r,i){var n=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[n]=Ok(t,n,e[n],function(o,u){n in r.jobs&&(delete r.jobs[n],o?Rk(r):r.results[n]=u,i(o,r.results))})}function Ok(e,t,r,i){var n;return e.length==2?n=e(r,B1(i)):n=e(r,t,B1(i)),n}});var G0=X((LU,C1)=>{C1.exports=kk;function kk(e,t){var r=!Array.isArray(e),i={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&i.keyedList.sort(r?t:function(n,o){return t(e[n],e[o])}),i}});var $0=X((UU,L1)=>{var Pk=W0(),Nk=j0();L1.exports=Bk;function Bk(e){Object.keys(this.jobs).length&&(this.index=this.size,Pk(this),Nk(e)(null,this.results))}});var D1=X((DU,U1)=>{var Mk=K0(),Ck=G0(),Lk=$0();U1.exports=Uk;function Uk(e,t,r){for(var i=Ck(e);i.index<(i.keyedList||e).length;)Mk(e,t,i,function(n,o){if(n){r(n,o);return}if(Object.keys(i.jobs).length===0){r(null,i.results);return}}),i.index++;return Lk.bind(i,r)}});var Y0=X((qU,yp)=>{var q1=K0(),Dk=G0(),qk=$0();yp.exports=Fk;yp.exports.ascending=F1;yp.exports.descending=Hk;function Fk(e,t,r,i){var n=Dk(e,r);return q1(e,t,n,function o(u,m){if(u){i(u,m);return}if(n.index++,n.index<(n.keyedList||e).length){q1(e,t,n,o);return}i(null,n.results)}),qk.bind(n,i)}function F1(e,t){return e<t?-1:e>t?1:0}function Hk(e,t){return-1*F1(e,t)}});var z1=X((FU,H1)=>{var zk=Y0();H1.exports=Vk;function Vk(e,t,r){return zk(e,t,null,r)}});var j1=X((HU,V1)=>{V1.exports={parallel:D1(),serial:z1(),serialOrdered:Y0()}});var K1=X((zU,W1)=>{W1.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Y1=X((VU,$1)=>{var Q0=y1(),G1=require("util"),Z0=require("path"),jk=require("http"),Wk=require("https"),Kk=require("url").parse,Gk=require("fs"),$k=require("stream").Stream,X0=R1(),Yk=j1(),J0=K1();$1.exports=yt;G1.inherits(yt,Q0);function yt(e){if(!(this instanceof yt))return new yt(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Q0.call(this),e=e||{};for(var t in e)this[t]=e[t]}yt.LINE_BREAK=`\r
2
- `;yt.DEFAULT_CONTENT_TYPE="application/octet-stream";yt.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var i=Q0.prototype.append.bind(this);if(typeof t=="number"&&(t=""+t),G1.isArray(t)){this._error(new Error("Arrays are not supported."));return}var n=this._multiPartHeader(e,t,r),o=this._multiPartFooter();i(n),i(t),i(o),this._trackLength(n,t,r)};yt.prototype._trackLength=function(e,t,r){var i=0;r.knownLength!=null?i+=+r.knownLength:Buffer.isBuffer(t)?i=t.length:typeof t=="string"&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+yt.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&t.hasOwnProperty("httpVersion"))&&!(t instanceof $k))&&(r.knownLength||this._valuesToMeasure.push(t))};yt.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Gk.stat(e.path,function(r,i){var n;if(r){t(r);return}n=i.size-(e.start?e.start:0),t(null,n)}):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",function(r){e.pause(),t(null,+r.headers["content-length"])}),e.resume()):t("Unknown stream")};yt.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var i=this._getContentDisposition(t,r),n=this._getContentType(t,r),o="",u={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(n||[])};typeof r.header=="object"&&J0(u,r.header);var m;for(var _ in u)u.hasOwnProperty(_)&&(m=u[_],m!=null&&(Array.isArray(m)||(m=[m]),m.length&&(o+=_+": "+m.join("; ")+yt.LINE_BREAK)));return"--"+this.getBoundary()+yt.LINE_BREAK+o+yt.LINE_BREAK};yt.prototype._getContentDisposition=function(e,t){var r,i;return typeof t.filepath=="string"?r=Z0.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?r=Z0.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(r=Z0.basename(e.client._httpMessage.path||"")),r&&(i='filename="'+r+'"'),i};yt.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e.name&&(r=X0.lookup(e.name)),!r&&e.path&&(r=X0.lookup(e.path)),!r&&e.readable&&e.hasOwnProperty("httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=X0.lookup(t.filepath||t.filename)),!r&&typeof e=="object"&&(r=yt.DEFAULT_CONTENT_TYPE),r};yt.prototype._multiPartFooter=function(){return function(e){var t=yt.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};yt.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+yt.LINE_BREAK};yt.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(r[t.toLowerCase()]=e[t]);return r};yt.prototype.setBoundary=function(e){this._boundary=e};yt.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};yt.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,i=this._streams.length;r<i;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(yt.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};yt.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(Math.random()*10).toString(16);this._boundary=e};yt.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};yt.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};yt.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Yk.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,i){if(r){e(r);return}i.forEach(function(n){t+=n}),e(null,t)})};yt.prototype.submit=function(e,t){var r,i,n={method:"post"};return typeof e=="string"?(e=Kk(e),i=J0({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},n)):(i=J0(e,n),i.port||(i.port=i.protocol=="https:"?443:80)),i.headers=this.getHeaders(e.headers),i.protocol=="https:"?r=Wk.request(i):r=jk.request(i),this.getLength(function(o,u){if(o&&o!=="Unknown stream"){this._error(o);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var m,_=function(w,I){return r.removeListener("error",_),r.removeListener("response",m),t.call(this,w,I)};m=_.bind(this,null),r.on("error",_),r.on("response",m)}}.bind(this)),r};yt.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};yt.prototype.toString=function(){return"[object FormData]"}});var ly=X(fy=>{"use strict";var lP=require("url").parse,pP={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},hP=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function dP(e){var t=typeof e=="string"?lP(e):e||{},r=t.protocol,i=t.host,n=t.port;if(typeof i!="string"||!i||typeof r!="string"||(r=r.split(":",1)[0],i=i.replace(/:\d*$/,""),n=parseInt(n)||pP[r]||0,!mP(i,n)))return"";var o=Dc("npm_config_"+r+"_proxy")||Dc(r+"_proxy")||Dc("npm_config_proxy")||Dc("all_proxy");return o&&o.indexOf("://")===-1&&(o=r+"://"+o),o}function mP(e,t){var r=(Dc("npm_config_no_proxy")||Dc("no_proxy")).toLowerCase();return r?r==="*"?!1:r.split(/[,\s]/).every(function(i){if(!i)return!0;var n=i.match(/^(.+):(\d+)$/),o=n?n[1]:i,u=n?parseInt(n[2]):0;return u&&u!==t?!0:/^[.*]/.test(o)?(o.charAt(0)==="*"&&(o=o.slice(1)),!hP.call(e,o)):e!==o}):!0}function Dc(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}fy.getProxyForUrl=dP});var hy=X((jD,py)=>{var tf;py.exports=function(){if(!tf){try{tf=require("debug")("follow-redirects")}catch{}typeof tf!="function"&&(tf=function(){})}tf.apply(null,arguments)}});var xy=X((WD,_m)=>{var sf=require("url"),rf=sf.URL,vP=require("http"),gP=require("https"),hm=require("stream").Writable,dm=require("assert"),dy=hy(),mm=!1;try{dm(new rf)}catch(e){mm=e.code==="ERR_INVALID_URL"}var xP=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],vm=["abort","aborted","connect","error","socket","timeout"],gm=Object.create(null);vm.forEach(function(e){gm[e]=function(t,r,i){this._redirectable.emit(e,t,r,i)}});var fm=af("ERR_INVALID_URL","Invalid URL",TypeError),lm=af("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),bP=af("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",lm),_P=af("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),yP=af("ERR_STREAM_WRITE_AFTER_END","write after end"),wP=hm.prototype.destroy||vy;function Ai(e,t){hm.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(i){try{r._processResponse(i)}catch(n){r.emit("error",n instanceof lm?n:new lm({cause:n}))}},this._performRequest()}Ai.prototype=Object.create(hm.prototype);Ai.prototype.abort=function(){bm(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Ai.prototype.destroy=function(e){return bm(this._currentRequest,e),wP.call(this,e),this};Ai.prototype.write=function(e,t,r){if(this._ending)throw new yP;if(!Ro(e)&&!IP(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(nf(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new _P),this.abort())};Ai.prototype.end=function(e,t,r){if(nf(e)?(r=e,e=t=null):nf(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var i=this,n=this._currentRequest;this.write(e,t,function(){i._ended=!0,n.end(null,null,r)}),this._ending=!0}};Ai.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Ai.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Ai.prototype.setTimeout=function(e,t){var r=this;function i(u){u.setTimeout(e),u.removeListener("timeout",u.destroy),u.addListener("timeout",u.destroy)}function n(u){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},e),i(u)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",o),r.removeListener("error",o),r.removeListener("response",o),r.removeListener("close",o),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",n)}return t&&this.on("timeout",t),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this.on("close",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Ai.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Ai.prototype,e,{get:function(){return this._currentRequest[e]}})});Ai.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Ai.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);i._redirectable=this;for(var n of vm)i.on(n,gm[n]);if(this._currentUrl=/^\//.test(this._options.path)?sf.format(this._options):this._options.path,this._isRedirect){var o=0,u=this,m=this._requestBodyBuffers;(function _(w){if(i===u._currentRequest)if(w)u.emit("error",w);else if(o<m.length){var I=m[o++];i.finished||i.write(I.data,I.encoding,_)}else u._ended&&i.end()})()}};Ai.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(bm(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new bP;var i,n=this._options.beforeRedirect;n&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],um(/^content-/i,this._options.headers));var u=um(/^host$/i,this._options.headers),m=xm(this._currentUrl),_=u||m.host,w=/^\w+:/.test(r)?this._currentUrl:sf.format(Object.assign(m,{host:_})),I=SP(r,w);if(dy("redirecting to",I.href),this._isRedirect=!0,pm(I,this._options),(I.protocol!==m.protocol&&I.protocol!=="https:"||I.host!==_&&!EP(I.host,_))&&um(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),nf(n)){var T={headers:e.headers,statusCode:t},N={url:w,method:o,headers:i};n(this._options,T,N),this._sanitizeOptions(this._options)}this._performRequest()};function my(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(i){var n=i+":",o=r[n]=e[i],u=t[i]=Object.create(o);function m(w,I,T){return TP(w)?w=pm(w):Ro(w)?w=pm(xm(w)):(T=I,I=gy(w),w={protocol:n}),nf(I)&&(T=I,I=null),I=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},w,I),I.nativeProtocols=r,!Ro(I.host)&&!Ro(I.hostname)&&(I.hostname="::1"),dm.equal(I.protocol,n,"protocol mismatch"),dy("options",I),new Ai(I,T)}function _(w,I,T){var N=u.request(w,I,T);return N.end(),N}Object.defineProperties(u,{request:{value:m,configurable:!0,enumerable:!0,writable:!0},get:{value:_,configurable:!0,enumerable:!0,writable:!0}})}),t}function vy(){}function xm(e){var t;if(mm)t=new rf(e);else if(t=gy(sf.parse(e)),!Ro(t.protocol))throw new fm({input:e});return t}function SP(e,t){return mm?new rf(e,t):xm(sf.resolve(t,e))}function gy(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new fm({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new fm({input:e.href||e});return e}function pm(e,t){var r=t||{};for(var i of xP)r[i]=e[i];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function um(e,t){var r;for(var i in t)e.test(i)&&(r=t[i],delete t[i]);return r===null||typeof r>"u"?void 0:String(r).trim()}function af(e,t,r){function i(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(r||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),i}function bm(e,t){for(var r of vm)e.removeListener(r,gm[r]);e.on("error",vy),e.destroy(t)}function EP(e,t){dm(Ro(e)&&Ro(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function Ro(e){return typeof e=="string"||e instanceof String}function nf(e){return typeof e=="function"}function IP(e){return typeof e=="object"&&"length"in e}function TP(e){return rf&&e instanceof rf}_m.exports=my({http:vP,https:gP});_m.exports.wrap=my});var D2=X((GK,lv)=>{"use strict";var S7=Object.prototype.hasOwnProperty,_i="~";function Df(){}Object.create&&(Df.prototype=Object.create(null),new Df().__proto__||(_i=!1));function E7(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function U2(e,t,r,i,n){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new E7(r,i||e,n),u=_i?_i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],o]:e._events[u].push(o):(e._events[u]=o,e._eventsCount++),e}function ah(e,t){--e._eventsCount===0?e._events=new Df:delete e._events[t]}function fi(){this._events=new Df,this._eventsCount=0}fi.prototype.eventNames=function(){var t=[],r,i;if(this._eventsCount===0)return t;for(i in r=this._events)S7.call(r,i)&&t.push(_i?i.slice(1):i);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};fi.prototype.listeners=function(t){var r=_i?_i+t:t,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,u=new Array(o);n<o;n++)u[n]=i[n].fn;return u};fi.prototype.listenerCount=function(t){var r=_i?_i+t:t,i=this._events[r];return i?i.fn?1:i.length:0};fi.prototype.emit=function(t,r,i,n,o,u){var m=_i?_i+t:t;if(!this._events[m])return!1;var _=this._events[m],w=arguments.length,I,T;if(_.fn){switch(_.once&&this.removeListener(t,_.fn,void 0,!0),w){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,r),!0;case 3:return _.fn.call(_.context,r,i),!0;case 4:return _.fn.call(_.context,r,i,n),!0;case 5:return _.fn.call(_.context,r,i,n,o),!0;case 6:return _.fn.call(_.context,r,i,n,o,u),!0}for(T=1,I=new Array(w-1);T<w;T++)I[T-1]=arguments[T];_.fn.apply(_.context,I)}else{var N=_.length,C;for(T=0;T<N;T++)switch(_[T].once&&this.removeListener(t,_[T].fn,void 0,!0),w){case 1:_[T].fn.call(_[T].context);break;case 2:_[T].fn.call(_[T].context,r);break;case 3:_[T].fn.call(_[T].context,r,i);break;case 4:_[T].fn.call(_[T].context,r,i,n);break;default:if(!I)for(C=1,I=new Array(w-1);C<w;C++)I[C-1]=arguments[C];_[T].fn.apply(_[T].context,I)}}return!0};fi.prototype.on=function(t,r,i){return U2(this,t,r,i,!1)};fi.prototype.once=function(t,r,i){return U2(this,t,r,i,!0)};fi.prototype.removeListener=function(t,r,i,n){var o=_i?_i+t:t;if(!this._events[o])return this;if(!r)return ah(this,o),this;var u=this._events[o];if(u.fn)u.fn===r&&(!n||u.once)&&(!i||u.context===i)&&ah(this,o);else{for(var m=0,_=[],w=u.length;m<w;m++)(u[m].fn!==r||n&&!u[m].once||i&&u[m].context!==i)&&_.push(u[m]);_.length?this._events[o]=_.length===1?_[0]:_:ah(this,o)}return this};fi.prototype.removeAllListeners=function(t){var r;return t?(r=_i?_i+t:t,this._events[r]&&ah(this,r)):(this._events=new Df,this._eventsCount=0),this};fi.prototype.off=fi.prototype.removeListener;fi.prototype.addListener=fi.prototype.on;fi.prefixed=_i;fi.EventEmitter=fi;typeof lv<"u"&&(lv.exports=fi)});var mv=X((iY,W2)=>{"use strict";var{Duplex:k7}=require("stream");function V2(e){e.emit("close")}function P7(){!this.destroyed&&this._writableState.finished&&this.destroy()}function j2(e){this.removeListener("error",j2),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function N7(e,t){let r=!0,i=new k7({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,u){let m=!u&&i._readableState.objectMode?o.toString():o;i.push(m)||e.pause()}),e.once("error",function(o){i.destroyed||(r=!1,i.destroy(o))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(n,o){if(e.readyState===e.CLOSED){o(n),process.nextTick(V2,i);return}let u=!1;e.once("error",function(_){u=!0,o(_)}),e.once("close",function(){u||o(n),process.nextTick(V2,i)}),r&&e.terminate()},i._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(n,o,u){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(n,o,u)});return}e.send(n,u)},i.on("end",P7),i.on("error",j2),i}W2.exports=N7});var za=X((nY,K2)=>{"use strict";K2.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var qf=X((sY,uh)=>{"use strict";var{EMPTY_BUFFER:B7}=za(),vv=Buffer[Symbol.species];function M7(e,t){if(e.length===0)return B7;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let n=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return i<t?new vv(r.buffer,r.byteOffset,i):r}function G2(e,t,r,i,n){for(let o=0;o<n;o++)r[i+o]=e[o]^t[o&3]}function $2(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function C7(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function gv(e){if(gv.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new vv(e):ArrayBuffer.isView(e)?t=new vv(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),gv.readOnly=!1),t}uh.exports={concat:M7,mask:G2,toArrayBuffer:C7,toBuffer:gv,unmask:$2};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=require("bufferutil");uh.exports.mask=function(t,r,i,n,o){o<48?G2(t,r,i,n,o):e.mask(t,r,i,n,o)},uh.exports.unmask=function(t,r){t.length<32?$2(t,r):e.unmask(t,r)}}catch{}});var X2=X((aY,Z2)=>{"use strict";var Y2=Symbol("kDone"),xv=Symbol("kRun"),bv=class{constructor(t){this[Y2]=()=>{this.pending--,this[xv]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[xv]()}[xv](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Y2])}}};Z2.exports=bv});var zf=X((oY,tw)=>{"use strict";var Ff=require("zlib"),J2=qf(),L7=X2(),{kStatusCode:Q2}=za(),U7=Buffer[Symbol.species],D7=Buffer.from([0,0,255,255]),ph=Symbol("permessage-deflate"),Js=Symbol("total-length"),Hf=Symbol("callback"),Va=Symbol("buffers"),lh=Symbol("error"),fh,_v=class{constructor(t,r,i){if(this._maxPayload=i|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!fh){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;fh=new L7(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Hf];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,i=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(i=>{let n=r[i];if(n.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(n=n[0],i==="client_max_window_bits"){if(n!==!0){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else if(i==="server_max_window_bits"){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=n})}),t}decompress(t,r,i){fh.add(n=>{this._decompress(t,r,(o,u)=>{n(),i(o,u)})})}compress(t,r,i){fh.add(n=>{this._compress(t,r,(o,u)=>{n(),i(o,u)})})}_decompress(t,r,i){let n=this._isServer?"client":"server";if(!this._inflate){let o=`${n}_max_window_bits`,u=typeof this.params[o]!="number"?Ff.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Ff.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[ph]=this,this._inflate[Js]=0,this._inflate[Va]=[],this._inflate.on("error",F7),this._inflate.on("data",ew)}this._inflate[Hf]=i,this._inflate.write(t),r&&this._inflate.write(D7),this._inflate.flush(()=>{let o=this._inflate[lh];if(o){this._inflate.close(),this._inflate=null,i(o);return}let u=J2.concat(this._inflate[Va],this._inflate[Js]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Js]=0,this._inflate[Va]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),i(null,u)})}_compress(t,r,i){let n=this._isServer?"server":"client";if(!this._deflate){let o=`${n}_max_window_bits`,u=typeof this.params[o]!="number"?Ff.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Ff.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Js]=0,this._deflate[Va]=[],this._deflate.on("data",q7)}this._deflate[Hf]=i,this._deflate.write(t),this._deflate.flush(Ff.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=J2.concat(this._deflate[Va],this._deflate[Js]);r&&(o=new U7(o.buffer,o.byteOffset,o.length-4)),this._deflate[Hf]=null,this._deflate[Js]=0,this._deflate[Va]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};tw.exports=_v;function q7(e){this[Va].push(e),this[Js]+=e.length}function ew(e){if(this[Js]+=e.length,this[ph]._maxPayload<1||this[Js]<=this[ph]._maxPayload){this[Va].push(e);return}this[lh]=new RangeError("Max payload size exceeded"),this[lh].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[lh][Q2]=1009,this.removeListener("data",ew),this.reset()}function F7(e){this[ph]._inflate=null,e[Q2]=1007,this[Hf](e)}});var Vf=X((cY,hh)=>{"use strict";var{isUtf8:rw}=require("buffer"),H7=[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,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function z7(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function yv(e){let t=e.length,r=0;for(;r<t;)if(!(e[r]&128))r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}hh.exports={isValidStatusCode:z7,isValidUTF8:yv,tokenChars:H7};if(rw)hh.exports.isValidUTF8=function(e){return e.length<24?yv(e):rw(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=require("utf-8-validate");hh.exports.isValidUTF8=function(t){return t.length<32?yv(t):e(t)}}catch{}});var vh=X((uY,uw)=>{"use strict";var{Writable:V7}=require("stream"),iw=zf(),{BINARY_TYPES:j7,EMPTY_BUFFER:nw,kStatusCode:W7,kWebSocket:K7}=za(),{concat:wv,toArrayBuffer:G7,unmask:$7}=qf(),{isValidStatusCode:Y7,isValidUTF8:sw}=Vf(),dh=Buffer[Symbol.species],vn=0,aw=1,ow=2,cw=3,Sv=4,Ev=5,mh=6,Iv=class extends V7{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||j7[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[K7]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=vn}_write(t,r,i){if(this._opcode===8&&this._state==vn)return i();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new dh(i.buffer,i.byteOffset+t,i.length-t),new dh(i.buffer,i.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let i=this._buffers[0],n=r.length-t;t>=i.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),n),this._buffers[0]=new dh(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case vn:this.getInfo(t);break;case aw:this.getPayloadLength16(t);break;case ow:this.getPayloadLength64(t);break;case cw:this.getMask();break;case Sv:this.getData(t);break;case Ev:case mh:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if(r[0]&48){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let i=(r[0]&64)===64;if(i&&!this._extensions[iw.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=aw:this._payloadLength===127?this._state=ow:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),i=r.readUInt32BE(0);if(i>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=i*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=cw:this._state=Sv}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Sv}getData(t){let r=nw;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&$7(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Ev,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[iw.extensionName].decompress(t,this._fin,(n,o)=>{if(n)return r(n);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(u);return}this._fragments.push(o)}this.dataMessage(r),this._state===vn&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=vn;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=wv(i,r):this._binaryType==="arraybuffer"?n=G7(wv(i,r)):n=i,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=vn):(this._state=mh,setImmediate(()=>{this.emit("message",n,!0),this._state=vn,this.startLoop(t)}))}else{let n=wv(i,r);if(!this._skipUTF8Validation&&!sw(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===Ev||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=vn):(this._state=mh,setImmediate(()=>{this.emit("message",n,!1),this._state=vn,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,nw),this.end();else{let i=t.readUInt16BE(0);if(!Y7(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let n=new dh(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!sw(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",i,n),this.end()}this._state=vn;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=vn):(this._state=mh,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=vn,this.startLoop(r)}))}createError(t,r,i,n,o){this._loop=!1,this._errored=!0;let u=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(u,this.createError),u.code=o,u[W7]=n,u}};uw.exports=Iv});var gh=X((lY,pw)=>{"use strict";var{Duplex:fY}=require("stream"),{randomFillSync:Z7}=require("crypto"),fw=zf(),{EMPTY_BUFFER:X7}=za(),{isValidStatusCode:J7}=Vf(),{mask:lw,toBuffer:Jc}=qf(),Cn=Symbol("kByteLength"),Q7=Buffer.alloc(4),Tv=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let i,n=!1,o=2,u=!1;r.mask&&(i=r.maskBuffer||Q7,r.generateMask?r.generateMask(i):Z7(i,0,4),u=(i[0]|i[1]|i[2]|i[3])===0,o=6);let m;typeof t=="string"?(!r.mask||u)&&r[Cn]!==void 0?m=r[Cn]:(t=Buffer.from(t),m=t.length):(m=t.length,n=r.mask&&r.readOnly&&!u);let _=m;m>=65536?(o+=8,_=127):m>125&&(o+=2,_=126);let w=Buffer.allocUnsafe(n?m+o:o);return w[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(w[0]|=64),w[1]=_,_===126?w.writeUInt16BE(m,2):_===127&&(w[2]=w[3]=0,w.writeUIntBE(m,4,6)),r.mask?(w[1]|=128,w[o-4]=i[0],w[o-3]=i[1],w[o-2]=i[2],w[o-1]=i[3],u?[w,t]:n?(lw(t,i,w,o,m),[w]):(lw(t,i,t,0,m),[w,t])):[w,t]}close(t,r,i,n){let o;if(t===void 0)o=X7;else{if(typeof t!="number"||!J7(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let m=Buffer.byteLength(r);if(m>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+m),o.writeUInt16BE(t,0),typeof r=="string"?o.write(r,2):o.set(r,2)}}let u={[Cn]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,u,n]):this.sendFrame(e.frame(o,u),n)}ping(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):(t=Jc(t),n=t.length,o=Jc.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Cn]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}pong(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):(t=Jc(t),n=t.length,o=Jc.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Cn]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}send(t,r,i){let n=this._extensions[fw.extensionName],o=r.binary?2:1,u=r.compress,m,_;if(typeof t=="string"?(m=Buffer.byteLength(t),_=!1):(t=Jc(t),m=t.length,_=Jc.readOnly),this._firstFragment?(this._firstFragment=!1,u&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=m>=n._threshold),this._compress=u):(u=!1,o=0),r.fin&&(this._firstFragment=!0),n){let w={[Cn]:m,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:_,rsv1:u};this._deflating?this.enqueue([this.dispatch,t,this._compress,w,i]):this.dispatch(t,this._compress,w,i)}else this.sendFrame(e.frame(t,{[Cn]:m,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:_,rsv1:!1}),i)}dispatch(t,r,i,n){if(!r){this.sendFrame(e.frame(t,i),n);return}let o=this._extensions[fw.extensionName];this._bufferedBytes+=i[Cn],this._deflating=!0,o.compress(t,i.fin,(u,m)=>{if(this._socket.destroyed){let _=new Error("The socket was closed while data was being compressed");typeof n=="function"&&n(_);for(let w=0;w<this._queue.length;w++){let I=this._queue[w],T=I[I.length-1];typeof T=="function"&&T(_)}return}this._bufferedBytes-=i[Cn],this._deflating=!1,i.readOnly=!1,this.sendFrame(e.frame(m,i),n),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Cn],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Cn],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};pw.exports=Tv});var yw=X((pY,_w)=>{"use strict";var{kForOnEventAttribute:jf,kListener:Rv}=za(),hw=Symbol("kCode"),dw=Symbol("kData"),mw=Symbol("kError"),vw=Symbol("kMessage"),gw=Symbol("kReason"),Qc=Symbol("kTarget"),xw=Symbol("kType"),bw=Symbol("kWasClean"),Qs=class{constructor(t){this[Qc]=null,this[xw]=t}get target(){return this[Qc]}get type(){return this[xw]}};Object.defineProperty(Qs.prototype,"target",{enumerable:!0});Object.defineProperty(Qs.prototype,"type",{enumerable:!0});var Wo=class extends Qs{constructor(t,r={}){super(t),this[hw]=r.code===void 0?0:r.code,this[gw]=r.reason===void 0?"":r.reason,this[bw]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[hw]}get reason(){return this[gw]}get wasClean(){return this[bw]}};Object.defineProperty(Wo.prototype,"code",{enumerable:!0});Object.defineProperty(Wo.prototype,"reason",{enumerable:!0});Object.defineProperty(Wo.prototype,"wasClean",{enumerable:!0});var eu=class extends Qs{constructor(t,r={}){super(t),this[mw]=r.error===void 0?null:r.error,this[vw]=r.message===void 0?"":r.message}get error(){return this[mw]}get message(){return this[vw]}};Object.defineProperty(eu.prototype,"error",{enumerable:!0});Object.defineProperty(eu.prototype,"message",{enumerable:!0});var Wf=class extends Qs{constructor(t,r={}){super(t),this[dw]=r.data===void 0?null:r.data}get data(){return this[dw]}};Object.defineProperty(Wf.prototype,"data",{enumerable:!0});var e9={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[jf]&&n[Rv]===t&&!n[jf])return;let i;if(e==="message")i=function(o,u){let m=new Wf("message",{data:u?o:o.toString()});m[Qc]=this,xh(t,this,m)};else if(e==="close")i=function(o,u){let m=new Wo("close",{code:o,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});m[Qc]=this,xh(t,this,m)};else if(e==="error")i=function(o){let u=new eu("error",{error:o,message:o.message});u[Qc]=this,xh(t,this,u)};else if(e==="open")i=function(){let o=new Qs("open");o[Qc]=this,xh(t,this,o)};else return;i[jf]=!!r[jf],i[Rv]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Rv]===t&&!r[jf]){this.removeListener(e,r);break}}};_w.exports={CloseEvent:Wo,ErrorEvent:eu,Event:Qs,EventTarget:e9,MessageEvent:Wf};function xh(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Av=X((hY,ww)=>{"use strict";var{tokenChars:Kf}=Vf();function as(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function t9(e){let t=Object.create(null),r=Object.create(null),i=!1,n=!1,o=!1,u,m,_=-1,w=-1,I=-1,T=0;for(;T<e.length;T++)if(w=e.charCodeAt(T),u===void 0)if(I===-1&&Kf[w]===1)_===-1&&(_=T);else if(T!==0&&(w===32||w===9))I===-1&&_!==-1&&(I=T);else if(w===59||w===44){if(_===-1)throw new SyntaxError(`Unexpected character at index ${T}`);I===-1&&(I=T);let C=e.slice(_,I);w===44?(as(t,C,r),r=Object.create(null)):u=C,_=I=-1}else throw new SyntaxError(`Unexpected character at index ${T}`);else if(m===void 0)if(I===-1&&Kf[w]===1)_===-1&&(_=T);else if(w===32||w===9)I===-1&&_!==-1&&(I=T);else if(w===59||w===44){if(_===-1)throw new SyntaxError(`Unexpected character at index ${T}`);I===-1&&(I=T),as(r,e.slice(_,I),!0),w===44&&(as(t,u,r),r=Object.create(null),u=void 0),_=I=-1}else if(w===61&&_!==-1&&I===-1)m=e.slice(_,T),_=I=-1;else throw new SyntaxError(`Unexpected character at index ${T}`);else if(n){if(Kf[w]!==1)throw new SyntaxError(`Unexpected character at index ${T}`);_===-1?_=T:i||(i=!0),n=!1}else if(o)if(Kf[w]===1)_===-1&&(_=T);else if(w===34&&_!==-1)o=!1,I=T;else if(w===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${T}`);else if(w===34&&e.charCodeAt(T-1)===61)o=!0;else if(I===-1&&Kf[w]===1)_===-1&&(_=T);else if(_!==-1&&(w===32||w===9))I===-1&&(I=T);else if(w===59||w===44){if(_===-1)throw new SyntaxError(`Unexpected character at index ${T}`);I===-1&&(I=T);let C=e.slice(_,I);i&&(C=C.replace(/\\/g,""),i=!1),as(r,m,C),w===44&&(as(t,u,r),r=Object.create(null),u=void 0),m=void 0,_=I=-1}else throw new SyntaxError(`Unexpected character at index ${T}`);if(_===-1||o||w===32||w===9)throw new SyntaxError("Unexpected end of input");I===-1&&(I=T);let N=e.slice(_,I);return u===void 0?as(t,N,r):(m===void 0?as(r,N,!0):i?as(r,m,N.replace(/\\/g,"")):as(r,m,N),as(t,u,r)),t}function r9(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(n=>{let o=i[n];return Array.isArray(o)||(o=[o]),o.map(u=>u===!0?n:`${n}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ww.exports={format:r9,parse:t9}});var wh=X((vY,Bw)=>{"use strict";var i9=require("events"),n9=require("https"),s9=require("http"),Iw=require("net"),a9=require("tls"),{randomBytes:o9,createHash:c9}=require("crypto"),{Duplex:dY,Readable:mY}=require("stream"),{URL:Ov}=require("url"),ja=zf(),u9=vh(),f9=gh(),{BINARY_TYPES:Sw,EMPTY_BUFFER:bh,GUID:l9,kForOnEventAttribute:kv,kListener:p9,kStatusCode:h9,kWebSocket:li,NOOP:Tw}=za(),{EventTarget:{addEventListener:d9,removeEventListener:m9}}=yw(),{format:v9,parse:g9}=Av(),{toBuffer:x9}=qf(),b9=30*1e3,Rw=Symbol("kAborted"),Pv=[8,13],ea=["CONNECTING","OPEN","CLOSING","CLOSED"],_9=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Tr=class e extends i9{constructor(t,r,i){super(),this._binaryType=Sw[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=bh,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(i=r,r=[]):r=[r]),Aw(this,t,r,i)):(this._autoPong=i.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Sw.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,i){let n=new u9({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation});this._sender=new f9(t,this._extensions,i.generateMask),this._receiver=n,this._socket=t,n[li]=this,t[li]=this,n.on("conclude",S9),n.on("drain",E9),n.on("error",I9),n.on("message",T9),n.on("ping",R9),n.on("pong",A9),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",kw),t.on("data",yh),t.on("end",Pw),t.on("error",Nw),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[ja.extensionName]&&this._extensions[ja.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){$i(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),b9)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Nv(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||bh,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Nv(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||bh,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Nv(this,t,i);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[ja.extensionName]||(n.compress=!1),this._sender.send(t||bh,n,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){$i(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Tr,"CONNECTING",{enumerable:!0,value:ea.indexOf("CONNECTING")});Object.defineProperty(Tr.prototype,"CONNECTING",{enumerable:!0,value:ea.indexOf("CONNECTING")});Object.defineProperty(Tr,"OPEN",{enumerable:!0,value:ea.indexOf("OPEN")});Object.defineProperty(Tr.prototype,"OPEN",{enumerable:!0,value:ea.indexOf("OPEN")});Object.defineProperty(Tr,"CLOSING",{enumerable:!0,value:ea.indexOf("CLOSING")});Object.defineProperty(Tr.prototype,"CLOSING",{enumerable:!0,value:ea.indexOf("CLOSING")});Object.defineProperty(Tr,"CLOSED",{enumerable:!0,value:ea.indexOf("CLOSED")});Object.defineProperty(Tr.prototype,"CLOSED",{enumerable:!0,value:ea.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Tr.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Tr.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[kv])return t[p9];return null},set(t){for(let r of this.listeners(e))if(r[kv]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[kv]:!0})}})});Tr.prototype.addEventListener=d9;Tr.prototype.removeEventListener=m9;Bw.exports=Tr;function Aw(e,t,r,i){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Pv[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,!Pv.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${Pv.join(", ")})`);let o;if(t instanceof Ov)o=t;else try{o=new Ov(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let u=o.protocol==="wss:",m=o.protocol==="ws+unix:",_;if(o.protocol!=="ws:"&&!u&&!m?_=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:m&&!o.pathname?_="The URL's pathname is empty":o.hash&&(_="The URL contains a fragment identifier"),_){let U=new SyntaxError(_);if(e._redirects===0)throw U;_h(e,U);return}let w=u?443:80,I=o9(16).toString("base64"),T=u?n9.request:s9.request,N=new Set,C;if(n.createConnection=n.createConnection||(u?w9:y9),n.defaultPort=n.defaultPort||w,n.port=o.port||w,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":I,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(C=new ja(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=v9({[ja.extensionName]:C.offer()})),r.length){for(let U of r){if(typeof U!="string"||!_9.test(U)||N.has(U))throw new SyntaxError("An invalid or duplicated subprotocol was specified");N.add(U)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(o.username||o.password)&&(n.auth=`${o.username}:${o.password}`),m){let U=n.path.split(":");n.socketPath=U[0],n.path=U[1]}let B;if(n.followRedirects){if(e._redirects===0){e._originalIpc=m,e._originalSecure=u,e._originalHostOrSocketPath=m?n.socketPath:o.host;let U=i&&i.headers;if(i={...i,headers:{}},U)for(let[Z,$]of Object.entries(U))i.headers[Z.toLowerCase()]=$}else if(e.listenerCount("redirect")===0){let U=m?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!U||e._originalSecure&&!u)&&(delete n.headers.authorization,delete n.headers.cookie,U||delete n.headers.host,n.auth=void 0)}n.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),B=e._req=T(n),e._redirects&&e.emit("redirect",e.url,B)}else B=e._req=T(n);n.timeout&&B.on("timeout",()=>{$i(e,B,"Opening handshake has timed out")}),B.on("error",U=>{B===null||B[Rw]||(B=e._req=null,_h(e,U))}),B.on("response",U=>{let Z=U.headers.location,$=U.statusCode;if(Z&&n.followRedirects&&$>=300&&$<400){if(++e._redirects>n.maxRedirects){$i(e,B,"Maximum redirects exceeded");return}B.abort();let H;try{H=new Ov(Z,t)}catch{let ce=new SyntaxError(`Invalid URL: ${Z}`);_h(e,ce);return}Aw(e,H,r,i)}else e.emit("unexpected-response",B,U)||$i(e,B,`Unexpected server response: ${U.statusCode}`)}),B.on("upgrade",(U,Z,$)=>{if(e.emit("upgrade",U),e.readyState!==Tr.CONNECTING)return;if(B=e._req=null,U.headers.upgrade.toLowerCase()!=="websocket"){$i(e,Z,"Invalid Upgrade header");return}let H=c9("sha1").update(I+l9).digest("base64");if(U.headers["sec-websocket-accept"]!==H){$i(e,Z,"Invalid Sec-WebSocket-Accept header");return}let ee=U.headers["sec-websocket-protocol"],ce;if(ee!==void 0?N.size?N.has(ee)||(ce="Server sent an invalid subprotocol"):ce="Server sent a subprotocol but none was requested":N.size&&(ce="Server sent no subprotocol"),ce){$i(e,Z,ce);return}ee&&(e._protocol=ee);let ge=U.headers["sec-websocket-extensions"];if(ge!==void 0){if(!C){$i(e,Z,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Se;try{Se=g9(ge)}catch{$i(e,Z,"Invalid Sec-WebSocket-Extensions header");return}let me=Object.keys(Se);if(me.length!==1||me[0]!==ja.extensionName){$i(e,Z,"Server indicated an extension that was not requested");return}try{C.accept(Se[ja.extensionName])}catch{$i(e,Z,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[ja.extensionName]=C}e.setSocket(Z,$,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(B,e):B.end()}function _h(e,t){e._readyState=Tr.CLOSING,e.emit("error",t),e.emitClose()}function y9(e){return e.path=e.socketPath,Iw.connect(e)}function w9(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=Iw.isIP(e.host)?"":e.host),a9.connect(e)}function $i(e,t,r){e._readyState=Tr.CLOSING;let i=new Error(r);Error.captureStackTrace(i,$i),t.setHeader?(t[Rw]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(_h,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Nv(e,t,r){if(t){let i=x9(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${ea[e.readyState]})`);process.nextTick(r,i)}}function S9(e,t){let r=this[li];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[li]!==void 0&&(r._socket.removeListener("data",yh),process.nextTick(Ow,r._socket),e===1005?r.close():r.close(e,t))}function E9(){let e=this[li];e.isPaused||e._socket.resume()}function I9(e){let t=this[li];t._socket[li]!==void 0&&(t._socket.removeListener("data",yh),process.nextTick(Ow,t._socket),t.close(e[h9])),t.emit("error",e)}function Ew(){this[li].emitClose()}function T9(e,t){this[li].emit("message",e,t)}function R9(e){let t=this[li];t._autoPong&&t.pong(e,!this._isServer,Tw),t.emit("ping",e)}function A9(e){this[li].emit("pong",e)}function Ow(e){e.resume()}function kw(){let e=this[li];this.removeListener("close",kw),this.removeListener("data",yh),this.removeListener("end",Pw),e._readyState=Tr.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[li]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Ew),e._receiver.on("finish",Ew))}function yh(e){this[li]._receiver.write(e)||this.pause()}function Pw(){let e=this[li];e._readyState=Tr.CLOSING,e._receiver.end(),this.end()}function Nw(){let e=this[li];this.removeListener("error",Nw),this.on("error",Tw),e&&(e._readyState=Tr.CLOSING,this.destroy())}});var Cw=X((gY,Mw)=>{"use strict";var{tokenChars:O9}=Vf();function k9(e){let t=new Set,r=-1,i=-1,n=0;for(n;n<e.length;n++){let u=e.charCodeAt(n);if(i===-1&&O9[u]===1)r===-1&&(r=n);else if(n!==0&&(u===32||u===9))i===-1&&r!==-1&&(i=n);else if(u===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);i===-1&&(i=n);let m=e.slice(r,i);if(t.has(m))throw new SyntaxError(`The "${m}" subprotocol is duplicated`);t.add(m),r=i=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,n);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}Mw.exports={parse:k9}});var Mv=X((bY,Hw)=>{"use strict";var P9=require("events"),Sh=require("http"),{Duplex:xY}=require("stream"),{createHash:N9}=require("crypto"),Lw=Av(),Ko=zf(),B9=Cw(),M9=wh(),{GUID:C9,kWebSocket:L9}=za(),U9=/^[+/0-9A-Za-z]{22}==$/,Uw=0,Dw=1,Fw=2,Bv=class extends P9{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:M9,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Sh.createServer((i,n)=>{let o=Sh.STATUS_CODES[426];n.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),n.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=D9(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,o,u)=>{this.handleUpgrade(n,o,u,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Uw}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===Fw){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Gf,this);return}if(t&&this.once("close",t),this._state!==Dw)if(this._state=Dw,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Gf,this):process.nextTick(Gf,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Gf(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,i,n){r.on("error",qw);let o=t.headers["sec-websocket-key"],u=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Go(this,t,r,405,"Invalid HTTP method");return}if(t.headers.upgrade.toLowerCase()!=="websocket"){Go(this,t,r,400,"Invalid Upgrade header");return}if(!o||!U9.test(o)){Go(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(u!==8&&u!==13){Go(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){$f(r,400);return}let m=t.headers["sec-websocket-protocol"],_=new Set;if(m!==void 0)try{_=B9.parse(m)}catch{Go(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let w=t.headers["sec-websocket-extensions"],I={};if(this.options.perMessageDeflate&&w!==void 0){let T=new Ko(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let N=Lw.parse(w);N[Ko.extensionName]&&(T.accept(N[Ko.extensionName]),I[Ko.extensionName]=T)}catch{Go(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let T={origin:t.headers[`${u===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(T,(N,C,B,U)=>{if(!N)return $f(r,C||401,B,U);this.completeUpgrade(I,o,_,t,r,i,n)});return}if(!this.options.verifyClient(T))return $f(r,401)}this.completeUpgrade(I,o,_,t,r,i,n)}completeUpgrade(t,r,i,n,o,u,m){if(!o.readable||!o.writable)return o.destroy();if(o[L9])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Uw)return $f(o,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${N9("sha1").update(r+C9).digest("base64")}`],I=new this.options.WebSocket(null,void 0,this.options);if(i.size){let T=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;T&&(w.push(`Sec-WebSocket-Protocol: ${T}`),I._protocol=T)}if(t[Ko.extensionName]){let T=t[Ko.extensionName].params,N=Lw.format({[Ko.extensionName]:[T]});w.push(`Sec-WebSocket-Extensions: ${N}`),I._extensions=t}this.emit("headers",w,n),o.write(w.concat(`\r
2
+ `;yt.DEFAULT_CONTENT_TYPE="application/octet-stream";yt.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var i=Q0.prototype.append.bind(this);if(typeof t=="number"&&(t=""+t),G1.isArray(t)){this._error(new Error("Arrays are not supported."));return}var n=this._multiPartHeader(e,t,r),o=this._multiPartFooter();i(n),i(t),i(o),this._trackLength(n,t,r)};yt.prototype._trackLength=function(e,t,r){var i=0;r.knownLength!=null?i+=+r.knownLength:Buffer.isBuffer(t)?i=t.length:typeof t=="string"&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+yt.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&t.hasOwnProperty("httpVersion"))&&!(t instanceof $k))&&(r.knownLength||this._valuesToMeasure.push(t))};yt.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Gk.stat(e.path,function(r,i){var n;if(r){t(r);return}n=i.size-(e.start?e.start:0),t(null,n)}):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",function(r){e.pause(),t(null,+r.headers["content-length"])}),e.resume()):t("Unknown stream")};yt.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var i=this._getContentDisposition(t,r),n=this._getContentType(t,r),o="",u={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(n||[])};typeof r.header=="object"&&J0(u,r.header);var m;for(var _ in u)u.hasOwnProperty(_)&&(m=u[_],m!=null&&(Array.isArray(m)||(m=[m]),m.length&&(o+=_+": "+m.join("; ")+yt.LINE_BREAK)));return"--"+this.getBoundary()+yt.LINE_BREAK+o+yt.LINE_BREAK};yt.prototype._getContentDisposition=function(e,t){var r,i;return typeof t.filepath=="string"?r=Z0.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?r=Z0.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(r=Z0.basename(e.client._httpMessage.path||"")),r&&(i='filename="'+r+'"'),i};yt.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e.name&&(r=X0.lookup(e.name)),!r&&e.path&&(r=X0.lookup(e.path)),!r&&e.readable&&e.hasOwnProperty("httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=X0.lookup(t.filepath||t.filename)),!r&&typeof e=="object"&&(r=yt.DEFAULT_CONTENT_TYPE),r};yt.prototype._multiPartFooter=function(){return function(e){var t=yt.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};yt.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+yt.LINE_BREAK};yt.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(r[t.toLowerCase()]=e[t]);return r};yt.prototype.setBoundary=function(e){this._boundary=e};yt.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};yt.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,i=this._streams.length;r<i;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(yt.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};yt.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(Math.random()*10).toString(16);this._boundary=e};yt.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};yt.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};yt.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Yk.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,i){if(r){e(r);return}i.forEach(function(n){t+=n}),e(null,t)})};yt.prototype.submit=function(e,t){var r,i,n={method:"post"};return typeof e=="string"?(e=Kk(e),i=J0({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},n)):(i=J0(e,n),i.port||(i.port=i.protocol=="https:"?443:80)),i.headers=this.getHeaders(e.headers),i.protocol=="https:"?r=Wk.request(i):r=jk.request(i),this.getLength(function(o,u){if(o&&o!=="Unknown stream"){this._error(o);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var m,_=function(w,I){return r.removeListener("error",_),r.removeListener("response",m),t.call(this,w,I)};m=_.bind(this,null),r.on("error",_),r.on("response",m)}}.bind(this)),r};yt.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};yt.prototype.toString=function(){return"[object FormData]"}});var ly=X(fy=>{"use strict";var lP=require("url").parse,pP={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},hP=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function dP(e){var t=typeof e=="string"?lP(e):e||{},r=t.protocol,i=t.host,n=t.port;if(typeof i!="string"||!i||typeof r!="string"||(r=r.split(":",1)[0],i=i.replace(/:\d*$/,""),n=parseInt(n)||pP[r]||0,!mP(i,n)))return"";var o=Dc("npm_config_"+r+"_proxy")||Dc(r+"_proxy")||Dc("npm_config_proxy")||Dc("all_proxy");return o&&o.indexOf("://")===-1&&(o=r+"://"+o),o}function mP(e,t){var r=(Dc("npm_config_no_proxy")||Dc("no_proxy")).toLowerCase();return r?r==="*"?!1:r.split(/[,\s]/).every(function(i){if(!i)return!0;var n=i.match(/^(.+):(\d+)$/),o=n?n[1]:i,u=n?parseInt(n[2]):0;return u&&u!==t?!0:/^[.*]/.test(o)?(o.charAt(0)==="*"&&(o=o.slice(1)),!hP.call(e,o)):e!==o}):!0}function Dc(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}fy.getProxyForUrl=dP});var hy=X((jD,py)=>{var tf;py.exports=function(){if(!tf){try{tf=require("debug")("follow-redirects")}catch{}typeof tf!="function"&&(tf=function(){})}tf.apply(null,arguments)}});var xy=X((WD,_m)=>{var sf=require("url"),rf=sf.URL,vP=require("http"),gP=require("https"),hm=require("stream").Writable,dm=require("assert"),dy=hy(),mm=!1;try{dm(new rf)}catch(e){mm=e.code==="ERR_INVALID_URL"}var xP=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],vm=["abort","aborted","connect","error","socket","timeout"],gm=Object.create(null);vm.forEach(function(e){gm[e]=function(t,r,i){this._redirectable.emit(e,t,r,i)}});var fm=af("ERR_INVALID_URL","Invalid URL",TypeError),lm=af("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),bP=af("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",lm),_P=af("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),yP=af("ERR_STREAM_WRITE_AFTER_END","write after end"),wP=hm.prototype.destroy||vy;function Ai(e,t){hm.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(i){try{r._processResponse(i)}catch(n){r.emit("error",n instanceof lm?n:new lm({cause:n}))}},this._performRequest()}Ai.prototype=Object.create(hm.prototype);Ai.prototype.abort=function(){bm(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Ai.prototype.destroy=function(e){return bm(this._currentRequest,e),wP.call(this,e),this};Ai.prototype.write=function(e,t,r){if(this._ending)throw new yP;if(!Ro(e)&&!IP(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(nf(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new _P),this.abort())};Ai.prototype.end=function(e,t,r){if(nf(e)?(r=e,e=t=null):nf(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var i=this,n=this._currentRequest;this.write(e,t,function(){i._ended=!0,n.end(null,null,r)}),this._ending=!0}};Ai.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Ai.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Ai.prototype.setTimeout=function(e,t){var r=this;function i(u){u.setTimeout(e),u.removeListener("timeout",u.destroy),u.addListener("timeout",u.destroy)}function n(u){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},e),i(u)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",o),r.removeListener("error",o),r.removeListener("response",o),r.removeListener("close",o),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",n)}return t&&this.on("timeout",t),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this.on("close",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Ai.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Ai.prototype,e,{get:function(){return this._currentRequest[e]}})});Ai.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Ai.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);i._redirectable=this;for(var n of vm)i.on(n,gm[n]);if(this._currentUrl=/^\//.test(this._options.path)?sf.format(this._options):this._options.path,this._isRedirect){var o=0,u=this,m=this._requestBodyBuffers;(function _(w){if(i===u._currentRequest)if(w)u.emit("error",w);else if(o<m.length){var I=m[o++];i.finished||i.write(I.data,I.encoding,_)}else u._ended&&i.end()})()}};Ai.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(bm(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new bP;var i,n=this._options.beforeRedirect;n&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],um(/^content-/i,this._options.headers));var u=um(/^host$/i,this._options.headers),m=xm(this._currentUrl),_=u||m.host,w=/^\w+:/.test(r)?this._currentUrl:sf.format(Object.assign(m,{host:_})),I=SP(r,w);if(dy("redirecting to",I.href),this._isRedirect=!0,pm(I,this._options),(I.protocol!==m.protocol&&I.protocol!=="https:"||I.host!==_&&!EP(I.host,_))&&um(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),nf(n)){var T={headers:e.headers,statusCode:t},N={url:w,method:o,headers:i};n(this._options,T,N),this._sanitizeOptions(this._options)}this._performRequest()};function my(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(i){var n=i+":",o=r[n]=e[i],u=t[i]=Object.create(o);function m(w,I,T){return TP(w)?w=pm(w):Ro(w)?w=pm(xm(w)):(T=I,I=gy(w),w={protocol:n}),nf(I)&&(T=I,I=null),I=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},w,I),I.nativeProtocols=r,!Ro(I.host)&&!Ro(I.hostname)&&(I.hostname="::1"),dm.equal(I.protocol,n,"protocol mismatch"),dy("options",I),new Ai(I,T)}function _(w,I,T){var N=u.request(w,I,T);return N.end(),N}Object.defineProperties(u,{request:{value:m,configurable:!0,enumerable:!0,writable:!0},get:{value:_,configurable:!0,enumerable:!0,writable:!0}})}),t}function vy(){}function xm(e){var t;if(mm)t=new rf(e);else if(t=gy(sf.parse(e)),!Ro(t.protocol))throw new fm({input:e});return t}function SP(e,t){return mm?new rf(e,t):xm(sf.resolve(t,e))}function gy(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new fm({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new fm({input:e.href||e});return e}function pm(e,t){var r=t||{};for(var i of xP)r[i]=e[i];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function um(e,t){var r;for(var i in t)e.test(i)&&(r=t[i],delete t[i]);return r===null||typeof r>"u"?void 0:String(r).trim()}function af(e,t,r){function i(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(r||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),i}function bm(e,t){for(var r of vm)e.removeListener(r,gm[r]);e.on("error",vy),e.destroy(t)}function EP(e,t){dm(Ro(e)&&Ro(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function Ro(e){return typeof e=="string"||e instanceof String}function nf(e){return typeof e=="function"}function IP(e){return typeof e=="object"&&"length"in e}function TP(e){return rf&&e instanceof rf}_m.exports=my({http:vP,https:gP});_m.exports.wrap=my});var D2=X((GK,lv)=>{"use strict";var S7=Object.prototype.hasOwnProperty,_i="~";function Df(){}Object.create&&(Df.prototype=Object.create(null),new Df().__proto__||(_i=!1));function E7(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function U2(e,t,r,i,n){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new E7(r,i||e,n),u=_i?_i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],o]:e._events[u].push(o):(e._events[u]=o,e._eventsCount++),e}function ah(e,t){--e._eventsCount===0?e._events=new Df:delete e._events[t]}function fi(){this._events=new Df,this._eventsCount=0}fi.prototype.eventNames=function(){var t=[],r,i;if(this._eventsCount===0)return t;for(i in r=this._events)S7.call(r,i)&&t.push(_i?i.slice(1):i);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};fi.prototype.listeners=function(t){var r=_i?_i+t:t,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,u=new Array(o);n<o;n++)u[n]=i[n].fn;return u};fi.prototype.listenerCount=function(t){var r=_i?_i+t:t,i=this._events[r];return i?i.fn?1:i.length:0};fi.prototype.emit=function(t,r,i,n,o,u){var m=_i?_i+t:t;if(!this._events[m])return!1;var _=this._events[m],w=arguments.length,I,T;if(_.fn){switch(_.once&&this.removeListener(t,_.fn,void 0,!0),w){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,r),!0;case 3:return _.fn.call(_.context,r,i),!0;case 4:return _.fn.call(_.context,r,i,n),!0;case 5:return _.fn.call(_.context,r,i,n,o),!0;case 6:return _.fn.call(_.context,r,i,n,o,u),!0}for(T=1,I=new Array(w-1);T<w;T++)I[T-1]=arguments[T];_.fn.apply(_.context,I)}else{var N=_.length,C;for(T=0;T<N;T++)switch(_[T].once&&this.removeListener(t,_[T].fn,void 0,!0),w){case 1:_[T].fn.call(_[T].context);break;case 2:_[T].fn.call(_[T].context,r);break;case 3:_[T].fn.call(_[T].context,r,i);break;case 4:_[T].fn.call(_[T].context,r,i,n);break;default:if(!I)for(C=1,I=new Array(w-1);C<w;C++)I[C-1]=arguments[C];_[T].fn.apply(_[T].context,I)}}return!0};fi.prototype.on=function(t,r,i){return U2(this,t,r,i,!1)};fi.prototype.once=function(t,r,i){return U2(this,t,r,i,!0)};fi.prototype.removeListener=function(t,r,i,n){var o=_i?_i+t:t;if(!this._events[o])return this;if(!r)return ah(this,o),this;var u=this._events[o];if(u.fn)u.fn===r&&(!n||u.once)&&(!i||u.context===i)&&ah(this,o);else{for(var m=0,_=[],w=u.length;m<w;m++)(u[m].fn!==r||n&&!u[m].once||i&&u[m].context!==i)&&_.push(u[m]);_.length?this._events[o]=_.length===1?_[0]:_:ah(this,o)}return this};fi.prototype.removeAllListeners=function(t){var r;return t?(r=_i?_i+t:t,this._events[r]&&ah(this,r)):(this._events=new Df,this._eventsCount=0),this};fi.prototype.off=fi.prototype.removeListener;fi.prototype.addListener=fi.prototype.on;fi.prefixed=_i;fi.EventEmitter=fi;typeof lv<"u"&&(lv.exports=fi)});var mv=X((iY,W2)=>{"use strict";var{Duplex:k7}=require("stream");function V2(e){e.emit("close")}function P7(){!this.destroyed&&this._writableState.finished&&this.destroy()}function j2(e){this.removeListener("error",j2),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function N7(e,t){let r=!0,i=new k7({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,u){let m=!u&&i._readableState.objectMode?o.toString():o;i.push(m)||e.pause()}),e.once("error",function(o){i.destroyed||(r=!1,i.destroy(o))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(n,o){if(e.readyState===e.CLOSED){o(n),process.nextTick(V2,i);return}let u=!1;e.once("error",function(_){u=!0,o(_)}),e.once("close",function(){u||o(n),process.nextTick(V2,i)}),r&&e.terminate()},i._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(n,o,u){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(n,o,u)});return}e.send(n,u)},i.on("end",P7),i.on("error",j2),i}W2.exports=N7});var za=X((nY,K2)=>{"use strict";K2.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var qf=X((sY,uh)=>{"use strict";var{EMPTY_BUFFER:B7}=za(),vv=Buffer[Symbol.species];function M7(e,t){if(e.length===0)return B7;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let n=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return i<t?new vv(r.buffer,r.byteOffset,i):r}function G2(e,t,r,i,n){for(let o=0;o<n;o++)r[i+o]=e[o]^t[o&3]}function $2(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function C7(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function gv(e){if(gv.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new vv(e):ArrayBuffer.isView(e)?t=new vv(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),gv.readOnly=!1),t}uh.exports={concat:M7,mask:G2,toArrayBuffer:C7,toBuffer:gv,unmask:$2};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=require("bufferutil");uh.exports.mask=function(t,r,i,n,o){o<48?G2(t,r,i,n,o):e.mask(t,r,i,n,o)},uh.exports.unmask=function(t,r){t.length<32?$2(t,r):e.unmask(t,r)}}catch{}});var X2=X((aY,Z2)=>{"use strict";var Y2=Symbol("kDone"),xv=Symbol("kRun"),bv=class{constructor(t){this[Y2]=()=>{this.pending--,this[xv]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[xv]()}[xv](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Y2])}}};Z2.exports=bv});var zf=X((oY,tw)=>{"use strict";var Ff=require("zlib"),J2=qf(),L7=X2(),{kStatusCode:Q2}=za(),U7=Buffer[Symbol.species],D7=Buffer.from([0,0,255,255]),ph=Symbol("permessage-deflate"),Js=Symbol("total-length"),Hf=Symbol("callback"),Va=Symbol("buffers"),lh=Symbol("error"),fh,_v=class{constructor(t,r,i){if(this._maxPayload=i|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!fh){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;fh=new L7(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Hf];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,i=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(i=>{let n=r[i];if(n.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(n=n[0],i==="client_max_window_bits"){if(n!==!0){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else if(i==="server_max_window_bits"){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=n})}),t}decompress(t,r,i){fh.add(n=>{this._decompress(t,r,(o,u)=>{n(),i(o,u)})})}compress(t,r,i){fh.add(n=>{this._compress(t,r,(o,u)=>{n(),i(o,u)})})}_decompress(t,r,i){let n=this._isServer?"client":"server";if(!this._inflate){let o=`${n}_max_window_bits`,u=typeof this.params[o]!="number"?Ff.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Ff.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[ph]=this,this._inflate[Js]=0,this._inflate[Va]=[],this._inflate.on("error",F7),this._inflate.on("data",ew)}this._inflate[Hf]=i,this._inflate.write(t),r&&this._inflate.write(D7),this._inflate.flush(()=>{let o=this._inflate[lh];if(o){this._inflate.close(),this._inflate=null,i(o);return}let u=J2.concat(this._inflate[Va],this._inflate[Js]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Js]=0,this._inflate[Va]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),i(null,u)})}_compress(t,r,i){let n=this._isServer?"server":"client";if(!this._deflate){let o=`${n}_max_window_bits`,u=typeof this.params[o]!="number"?Ff.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Ff.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Js]=0,this._deflate[Va]=[],this._deflate.on("data",q7)}this._deflate[Hf]=i,this._deflate.write(t),this._deflate.flush(Ff.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=J2.concat(this._deflate[Va],this._deflate[Js]);r&&(o=new U7(o.buffer,o.byteOffset,o.length-4)),this._deflate[Hf]=null,this._deflate[Js]=0,this._deflate[Va]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};tw.exports=_v;function q7(e){this[Va].push(e),this[Js]+=e.length}function ew(e){if(this[Js]+=e.length,this[ph]._maxPayload<1||this[Js]<=this[ph]._maxPayload){this[Va].push(e);return}this[lh]=new RangeError("Max payload size exceeded"),this[lh].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[lh][Q2]=1009,this.removeListener("data",ew),this.reset()}function F7(e){this[ph]._inflate=null,e[Q2]=1007,this[Hf](e)}});var Vf=X((cY,hh)=>{"use strict";var{isUtf8:rw}=require("buffer"),H7=[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,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function z7(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function yv(e){let t=e.length,r=0;for(;r<t;)if(!(e[r]&128))r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}hh.exports={isValidStatusCode:z7,isValidUTF8:yv,tokenChars:H7};if(rw)hh.exports.isValidUTF8=function(e){return e.length<24?yv(e):rw(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=require("utf-8-validate");hh.exports.isValidUTF8=function(t){return t.length<32?yv(t):e(t)}}catch{}});var vh=X((uY,uw)=>{"use strict";var{Writable:V7}=require("stream"),iw=zf(),{BINARY_TYPES:j7,EMPTY_BUFFER:nw,kStatusCode:W7,kWebSocket:K7}=za(),{concat:wv,toArrayBuffer:G7,unmask:$7}=qf(),{isValidStatusCode:Y7,isValidUTF8:sw}=Vf(),dh=Buffer[Symbol.species],vn=0,aw=1,ow=2,cw=3,Sv=4,Ev=5,mh=6,Iv=class extends V7{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||j7[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[K7]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=vn}_write(t,r,i){if(this._opcode===8&&this._state==vn)return i();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new dh(i.buffer,i.byteOffset+t,i.length-t),new dh(i.buffer,i.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let i=this._buffers[0],n=r.length-t;t>=i.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),n),this._buffers[0]=new dh(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case vn:this.getInfo(t);break;case aw:this.getPayloadLength16(t);break;case ow:this.getPayloadLength64(t);break;case cw:this.getMask();break;case Sv:this.getData(t);break;case Ev:case mh:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if(r[0]&48){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let i=(r[0]&64)===64;if(i&&!this._extensions[iw.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=aw:this._payloadLength===127?this._state=ow:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),i=r.readUInt32BE(0);if(i>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=i*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=cw:this._state=Sv}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Sv}getData(t){let r=nw;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&$7(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Ev,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[iw.extensionName].decompress(t,this._fin,(n,o)=>{if(n)return r(n);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(u);return}this._fragments.push(o)}this.dataMessage(r),this._state===vn&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=vn;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=wv(i,r):this._binaryType==="arraybuffer"?n=G7(wv(i,r)):n=i,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=vn):(this._state=mh,setImmediate(()=>{this.emit("message",n,!0),this._state=vn,this.startLoop(t)}))}else{let n=wv(i,r);if(!this._skipUTF8Validation&&!sw(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===Ev||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=vn):(this._state=mh,setImmediate(()=>{this.emit("message",n,!1),this._state=vn,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,nw),this.end();else{let i=t.readUInt16BE(0);if(!Y7(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let n=new dh(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!sw(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",i,n),this.end()}this._state=vn;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=vn):(this._state=mh,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=vn,this.startLoop(r)}))}createError(t,r,i,n,o){this._loop=!1,this._errored=!0;let u=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(u,this.createError),u.code=o,u[W7]=n,u}};uw.exports=Iv});var gh=X((lY,pw)=>{"use strict";var{Duplex:fY}=require("stream"),{randomFillSync:Z7}=require("crypto"),fw=zf(),{EMPTY_BUFFER:X7}=za(),{isValidStatusCode:J7}=Vf(),{mask:lw,toBuffer:Jc}=qf(),Cn=Symbol("kByteLength"),Q7=Buffer.alloc(4),Tv=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let i,n=!1,o=2,u=!1;r.mask&&(i=r.maskBuffer||Q7,r.generateMask?r.generateMask(i):Z7(i,0,4),u=(i[0]|i[1]|i[2]|i[3])===0,o=6);let m;typeof t=="string"?(!r.mask||u)&&r[Cn]!==void 0?m=r[Cn]:(t=Buffer.from(t),m=t.length):(m=t.length,n=r.mask&&r.readOnly&&!u);let _=m;m>=65536?(o+=8,_=127):m>125&&(o+=2,_=126);let w=Buffer.allocUnsafe(n?m+o:o);return w[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(w[0]|=64),w[1]=_,_===126?w.writeUInt16BE(m,2):_===127&&(w[2]=w[3]=0,w.writeUIntBE(m,4,6)),r.mask?(w[1]|=128,w[o-4]=i[0],w[o-3]=i[1],w[o-2]=i[2],w[o-1]=i[3],u?[w,t]:n?(lw(t,i,w,o,m),[w]):(lw(t,i,t,0,m),[w,t])):[w,t]}close(t,r,i,n){let o;if(t===void 0)o=X7;else{if(typeof t!="number"||!J7(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let m=Buffer.byteLength(r);if(m>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+m),o.writeUInt16BE(t,0),typeof r=="string"?o.write(r,2):o.set(r,2)}}let u={[Cn]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,u,n]):this.sendFrame(e.frame(o,u),n)}ping(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):(t=Jc(t),n=t.length,o=Jc.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Cn]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}pong(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):(t=Jc(t),n=t.length,o=Jc.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Cn]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}send(t,r,i){let n=this._extensions[fw.extensionName],o=r.binary?2:1,u=r.compress,m,_;if(typeof t=="string"?(m=Buffer.byteLength(t),_=!1):(t=Jc(t),m=t.length,_=Jc.readOnly),this._firstFragment?(this._firstFragment=!1,u&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=m>=n._threshold),this._compress=u):(u=!1,o=0),r.fin&&(this._firstFragment=!0),n){let w={[Cn]:m,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:_,rsv1:u};this._deflating?this.enqueue([this.dispatch,t,this._compress,w,i]):this.dispatch(t,this._compress,w,i)}else this.sendFrame(e.frame(t,{[Cn]:m,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:_,rsv1:!1}),i)}dispatch(t,r,i,n){if(!r){this.sendFrame(e.frame(t,i),n);return}let o=this._extensions[fw.extensionName];this._bufferedBytes+=i[Cn],this._deflating=!0,o.compress(t,i.fin,(u,m)=>{if(this._socket.destroyed){let _=new Error("The socket was closed while data was being compressed");typeof n=="function"&&n(_);for(let w=0;w<this._queue.length;w++){let I=this._queue[w],T=I[I.length-1];typeof T=="function"&&T(_)}return}this._bufferedBytes-=i[Cn],this._deflating=!1,i.readOnly=!1,this.sendFrame(e.frame(m,i),n),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Cn],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Cn],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};pw.exports=Tv});var yw=X((pY,_w)=>{"use strict";var{kForOnEventAttribute:jf,kListener:Rv}=za(),hw=Symbol("kCode"),dw=Symbol("kData"),mw=Symbol("kError"),vw=Symbol("kMessage"),gw=Symbol("kReason"),Qc=Symbol("kTarget"),xw=Symbol("kType"),bw=Symbol("kWasClean"),Qs=class{constructor(t){this[Qc]=null,this[xw]=t}get target(){return this[Qc]}get type(){return this[xw]}};Object.defineProperty(Qs.prototype,"target",{enumerable:!0});Object.defineProperty(Qs.prototype,"type",{enumerable:!0});var Wo=class extends Qs{constructor(t,r={}){super(t),this[hw]=r.code===void 0?0:r.code,this[gw]=r.reason===void 0?"":r.reason,this[bw]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[hw]}get reason(){return this[gw]}get wasClean(){return this[bw]}};Object.defineProperty(Wo.prototype,"code",{enumerable:!0});Object.defineProperty(Wo.prototype,"reason",{enumerable:!0});Object.defineProperty(Wo.prototype,"wasClean",{enumerable:!0});var eu=class extends Qs{constructor(t,r={}){super(t),this[mw]=r.error===void 0?null:r.error,this[vw]=r.message===void 0?"":r.message}get error(){return this[mw]}get message(){return this[vw]}};Object.defineProperty(eu.prototype,"error",{enumerable:!0});Object.defineProperty(eu.prototype,"message",{enumerable:!0});var Wf=class extends Qs{constructor(t,r={}){super(t),this[dw]=r.data===void 0?null:r.data}get data(){return this[dw]}};Object.defineProperty(Wf.prototype,"data",{enumerable:!0});var e9={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[jf]&&n[Rv]===t&&!n[jf])return;let i;if(e==="message")i=function(o,u){let m=new Wf("message",{data:u?o:o.toString()});m[Qc]=this,xh(t,this,m)};else if(e==="close")i=function(o,u){let m=new Wo("close",{code:o,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});m[Qc]=this,xh(t,this,m)};else if(e==="error")i=function(o){let u=new eu("error",{error:o,message:o.message});u[Qc]=this,xh(t,this,u)};else if(e==="open")i=function(){let o=new Qs("open");o[Qc]=this,xh(t,this,o)};else return;i[jf]=!!r[jf],i[Rv]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Rv]===t&&!r[jf]){this.removeListener(e,r);break}}};_w.exports={CloseEvent:Wo,ErrorEvent:eu,Event:Qs,EventTarget:e9,MessageEvent:Wf};function xh(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Av=X((hY,ww)=>{"use strict";var{tokenChars:Kf}=Vf();function os(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function t9(e){let t=Object.create(null),r=Object.create(null),i=!1,n=!1,o=!1,u,m,_=-1,w=-1,I=-1,T=0;for(;T<e.length;T++)if(w=e.charCodeAt(T),u===void 0)if(I===-1&&Kf[w]===1)_===-1&&(_=T);else if(T!==0&&(w===32||w===9))I===-1&&_!==-1&&(I=T);else if(w===59||w===44){if(_===-1)throw new SyntaxError(`Unexpected character at index ${T}`);I===-1&&(I=T);let C=e.slice(_,I);w===44?(os(t,C,r),r=Object.create(null)):u=C,_=I=-1}else throw new SyntaxError(`Unexpected character at index ${T}`);else if(m===void 0)if(I===-1&&Kf[w]===1)_===-1&&(_=T);else if(w===32||w===9)I===-1&&_!==-1&&(I=T);else if(w===59||w===44){if(_===-1)throw new SyntaxError(`Unexpected character at index ${T}`);I===-1&&(I=T),os(r,e.slice(_,I),!0),w===44&&(os(t,u,r),r=Object.create(null),u=void 0),_=I=-1}else if(w===61&&_!==-1&&I===-1)m=e.slice(_,T),_=I=-1;else throw new SyntaxError(`Unexpected character at index ${T}`);else if(n){if(Kf[w]!==1)throw new SyntaxError(`Unexpected character at index ${T}`);_===-1?_=T:i||(i=!0),n=!1}else if(o)if(Kf[w]===1)_===-1&&(_=T);else if(w===34&&_!==-1)o=!1,I=T;else if(w===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${T}`);else if(w===34&&e.charCodeAt(T-1)===61)o=!0;else if(I===-1&&Kf[w]===1)_===-1&&(_=T);else if(_!==-1&&(w===32||w===9))I===-1&&(I=T);else if(w===59||w===44){if(_===-1)throw new SyntaxError(`Unexpected character at index ${T}`);I===-1&&(I=T);let C=e.slice(_,I);i&&(C=C.replace(/\\/g,""),i=!1),os(r,m,C),w===44&&(os(t,u,r),r=Object.create(null),u=void 0),m=void 0,_=I=-1}else throw new SyntaxError(`Unexpected character at index ${T}`);if(_===-1||o||w===32||w===9)throw new SyntaxError("Unexpected end of input");I===-1&&(I=T);let N=e.slice(_,I);return u===void 0?os(t,N,r):(m===void 0?os(r,N,!0):i?os(r,m,N.replace(/\\/g,"")):os(r,m,N),os(t,u,r)),t}function r9(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(n=>{let o=i[n];return Array.isArray(o)||(o=[o]),o.map(u=>u===!0?n:`${n}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ww.exports={format:r9,parse:t9}});var wh=X((vY,Bw)=>{"use strict";var i9=require("events"),n9=require("https"),s9=require("http"),Iw=require("net"),a9=require("tls"),{randomBytes:o9,createHash:c9}=require("crypto"),{Duplex:dY,Readable:mY}=require("stream"),{URL:Ov}=require("url"),ja=zf(),u9=vh(),f9=gh(),{BINARY_TYPES:Sw,EMPTY_BUFFER:bh,GUID:l9,kForOnEventAttribute:kv,kListener:p9,kStatusCode:h9,kWebSocket:li,NOOP:Tw}=za(),{EventTarget:{addEventListener:d9,removeEventListener:m9}}=yw(),{format:v9,parse:g9}=Av(),{toBuffer:x9}=qf(),b9=30*1e3,Rw=Symbol("kAborted"),Pv=[8,13],ea=["CONNECTING","OPEN","CLOSING","CLOSED"],_9=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Tr=class e extends i9{constructor(t,r,i){super(),this._binaryType=Sw[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=bh,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(i=r,r=[]):r=[r]),Aw(this,t,r,i)):(this._autoPong=i.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Sw.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,i){let n=new u9({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation});this._sender=new f9(t,this._extensions,i.generateMask),this._receiver=n,this._socket=t,n[li]=this,t[li]=this,n.on("conclude",S9),n.on("drain",E9),n.on("error",I9),n.on("message",T9),n.on("ping",R9),n.on("pong",A9),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",kw),t.on("data",yh),t.on("end",Pw),t.on("error",Nw),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[ja.extensionName]&&this._extensions[ja.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){$i(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),b9)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Nv(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||bh,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Nv(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||bh,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Nv(this,t,i);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[ja.extensionName]||(n.compress=!1),this._sender.send(t||bh,n,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){$i(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Tr,"CONNECTING",{enumerable:!0,value:ea.indexOf("CONNECTING")});Object.defineProperty(Tr.prototype,"CONNECTING",{enumerable:!0,value:ea.indexOf("CONNECTING")});Object.defineProperty(Tr,"OPEN",{enumerable:!0,value:ea.indexOf("OPEN")});Object.defineProperty(Tr.prototype,"OPEN",{enumerable:!0,value:ea.indexOf("OPEN")});Object.defineProperty(Tr,"CLOSING",{enumerable:!0,value:ea.indexOf("CLOSING")});Object.defineProperty(Tr.prototype,"CLOSING",{enumerable:!0,value:ea.indexOf("CLOSING")});Object.defineProperty(Tr,"CLOSED",{enumerable:!0,value:ea.indexOf("CLOSED")});Object.defineProperty(Tr.prototype,"CLOSED",{enumerable:!0,value:ea.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Tr.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Tr.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[kv])return t[p9];return null},set(t){for(let r of this.listeners(e))if(r[kv]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[kv]:!0})}})});Tr.prototype.addEventListener=d9;Tr.prototype.removeEventListener=m9;Bw.exports=Tr;function Aw(e,t,r,i){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Pv[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,!Pv.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${Pv.join(", ")})`);let o;if(t instanceof Ov)o=t;else try{o=new Ov(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let u=o.protocol==="wss:",m=o.protocol==="ws+unix:",_;if(o.protocol!=="ws:"&&!u&&!m?_=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:m&&!o.pathname?_="The URL's pathname is empty":o.hash&&(_="The URL contains a fragment identifier"),_){let U=new SyntaxError(_);if(e._redirects===0)throw U;_h(e,U);return}let w=u?443:80,I=o9(16).toString("base64"),T=u?n9.request:s9.request,N=new Set,C;if(n.createConnection=n.createConnection||(u?w9:y9),n.defaultPort=n.defaultPort||w,n.port=o.port||w,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":I,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(C=new ja(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=v9({[ja.extensionName]:C.offer()})),r.length){for(let U of r){if(typeof U!="string"||!_9.test(U)||N.has(U))throw new SyntaxError("An invalid or duplicated subprotocol was specified");N.add(U)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(o.username||o.password)&&(n.auth=`${o.username}:${o.password}`),m){let U=n.path.split(":");n.socketPath=U[0],n.path=U[1]}let B;if(n.followRedirects){if(e._redirects===0){e._originalIpc=m,e._originalSecure=u,e._originalHostOrSocketPath=m?n.socketPath:o.host;let U=i&&i.headers;if(i={...i,headers:{}},U)for(let[Z,$]of Object.entries(U))i.headers[Z.toLowerCase()]=$}else if(e.listenerCount("redirect")===0){let U=m?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!U||e._originalSecure&&!u)&&(delete n.headers.authorization,delete n.headers.cookie,U||delete n.headers.host,n.auth=void 0)}n.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),B=e._req=T(n),e._redirects&&e.emit("redirect",e.url,B)}else B=e._req=T(n);n.timeout&&B.on("timeout",()=>{$i(e,B,"Opening handshake has timed out")}),B.on("error",U=>{B===null||B[Rw]||(B=e._req=null,_h(e,U))}),B.on("response",U=>{let Z=U.headers.location,$=U.statusCode;if(Z&&n.followRedirects&&$>=300&&$<400){if(++e._redirects>n.maxRedirects){$i(e,B,"Maximum redirects exceeded");return}B.abort();let H;try{H=new Ov(Z,t)}catch{let ce=new SyntaxError(`Invalid URL: ${Z}`);_h(e,ce);return}Aw(e,H,r,i)}else e.emit("unexpected-response",B,U)||$i(e,B,`Unexpected server response: ${U.statusCode}`)}),B.on("upgrade",(U,Z,$)=>{if(e.emit("upgrade",U),e.readyState!==Tr.CONNECTING)return;if(B=e._req=null,U.headers.upgrade.toLowerCase()!=="websocket"){$i(e,Z,"Invalid Upgrade header");return}let H=c9("sha1").update(I+l9).digest("base64");if(U.headers["sec-websocket-accept"]!==H){$i(e,Z,"Invalid Sec-WebSocket-Accept header");return}let ee=U.headers["sec-websocket-protocol"],ce;if(ee!==void 0?N.size?N.has(ee)||(ce="Server sent an invalid subprotocol"):ce="Server sent a subprotocol but none was requested":N.size&&(ce="Server sent no subprotocol"),ce){$i(e,Z,ce);return}ee&&(e._protocol=ee);let ge=U.headers["sec-websocket-extensions"];if(ge!==void 0){if(!C){$i(e,Z,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Se;try{Se=g9(ge)}catch{$i(e,Z,"Invalid Sec-WebSocket-Extensions header");return}let me=Object.keys(Se);if(me.length!==1||me[0]!==ja.extensionName){$i(e,Z,"Server indicated an extension that was not requested");return}try{C.accept(Se[ja.extensionName])}catch{$i(e,Z,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[ja.extensionName]=C}e.setSocket(Z,$,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(B,e):B.end()}function _h(e,t){e._readyState=Tr.CLOSING,e.emit("error",t),e.emitClose()}function y9(e){return e.path=e.socketPath,Iw.connect(e)}function w9(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=Iw.isIP(e.host)?"":e.host),a9.connect(e)}function $i(e,t,r){e._readyState=Tr.CLOSING;let i=new Error(r);Error.captureStackTrace(i,$i),t.setHeader?(t[Rw]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(_h,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Nv(e,t,r){if(t){let i=x9(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${ea[e.readyState]})`);process.nextTick(r,i)}}function S9(e,t){let r=this[li];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[li]!==void 0&&(r._socket.removeListener("data",yh),process.nextTick(Ow,r._socket),e===1005?r.close():r.close(e,t))}function E9(){let e=this[li];e.isPaused||e._socket.resume()}function I9(e){let t=this[li];t._socket[li]!==void 0&&(t._socket.removeListener("data",yh),process.nextTick(Ow,t._socket),t.close(e[h9])),t.emit("error",e)}function Ew(){this[li].emitClose()}function T9(e,t){this[li].emit("message",e,t)}function R9(e){let t=this[li];t._autoPong&&t.pong(e,!this._isServer,Tw),t.emit("ping",e)}function A9(e){this[li].emit("pong",e)}function Ow(e){e.resume()}function kw(){let e=this[li];this.removeListener("close",kw),this.removeListener("data",yh),this.removeListener("end",Pw),e._readyState=Tr.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[li]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Ew),e._receiver.on("finish",Ew))}function yh(e){this[li]._receiver.write(e)||this.pause()}function Pw(){let e=this[li];e._readyState=Tr.CLOSING,e._receiver.end(),this.end()}function Nw(){let e=this[li];this.removeListener("error",Nw),this.on("error",Tw),e&&(e._readyState=Tr.CLOSING,this.destroy())}});var Cw=X((gY,Mw)=>{"use strict";var{tokenChars:O9}=Vf();function k9(e){let t=new Set,r=-1,i=-1,n=0;for(n;n<e.length;n++){let u=e.charCodeAt(n);if(i===-1&&O9[u]===1)r===-1&&(r=n);else if(n!==0&&(u===32||u===9))i===-1&&r!==-1&&(i=n);else if(u===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);i===-1&&(i=n);let m=e.slice(r,i);if(t.has(m))throw new SyntaxError(`The "${m}" subprotocol is duplicated`);t.add(m),r=i=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,n);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}Mw.exports={parse:k9}});var Mv=X((bY,Hw)=>{"use strict";var P9=require("events"),Sh=require("http"),{Duplex:xY}=require("stream"),{createHash:N9}=require("crypto"),Lw=Av(),Ko=zf(),B9=Cw(),M9=wh(),{GUID:C9,kWebSocket:L9}=za(),U9=/^[+/0-9A-Za-z]{22}==$/,Uw=0,Dw=1,Fw=2,Bv=class extends P9{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:M9,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Sh.createServer((i,n)=>{let o=Sh.STATUS_CODES[426];n.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),n.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=D9(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,o,u)=>{this.handleUpgrade(n,o,u,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Uw}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===Fw){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Gf,this);return}if(t&&this.once("close",t),this._state!==Dw)if(this._state=Dw,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Gf,this):process.nextTick(Gf,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Gf(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,i,n){r.on("error",qw);let o=t.headers["sec-websocket-key"],u=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Go(this,t,r,405,"Invalid HTTP method");return}if(t.headers.upgrade.toLowerCase()!=="websocket"){Go(this,t,r,400,"Invalid Upgrade header");return}if(!o||!U9.test(o)){Go(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(u!==8&&u!==13){Go(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){$f(r,400);return}let m=t.headers["sec-websocket-protocol"],_=new Set;if(m!==void 0)try{_=B9.parse(m)}catch{Go(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let w=t.headers["sec-websocket-extensions"],I={};if(this.options.perMessageDeflate&&w!==void 0){let T=new Ko(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let N=Lw.parse(w);N[Ko.extensionName]&&(T.accept(N[Ko.extensionName]),I[Ko.extensionName]=T)}catch{Go(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let T={origin:t.headers[`${u===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(T,(N,C,B,U)=>{if(!N)return $f(r,C||401,B,U);this.completeUpgrade(I,o,_,t,r,i,n)});return}if(!this.options.verifyClient(T))return $f(r,401)}this.completeUpgrade(I,o,_,t,r,i,n)}completeUpgrade(t,r,i,n,o,u,m){if(!o.readable||!o.writable)return o.destroy();if(o[L9])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Uw)return $f(o,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${N9("sha1").update(r+C9).digest("base64")}`],I=new this.options.WebSocket(null,void 0,this.options);if(i.size){let T=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;T&&(w.push(`Sec-WebSocket-Protocol: ${T}`),I._protocol=T)}if(t[Ko.extensionName]){let T=t[Ko.extensionName].params,N=Lw.format({[Ko.extensionName]:[T]});w.push(`Sec-WebSocket-Extensions: ${N}`),I._extensions=t}this.emit("headers",w,n),o.write(w.concat(`\r
3
3
  `).join(`\r
4
4
  `)),o.removeListener("error",qw),I.setSocket(o,u,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(I),I.on("close",()=>{this.clients.delete(I),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Gf,this)})),m(I,n)}};Hw.exports=Bv;function D9(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let i of Object.keys(t))e.removeListener(i,t[i])}}function Gf(e){e._state=Fw,e.emit("close")}function qw(){this.destroy()}function $f(e,t,r,i){r=r||Sh.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Sh.STATUS_CODES[t]}\r
5
5
  `+Object.keys(i).map(n=>`${n}: ${i[n]}`).join(`\r
6
6
  `)+`\r
7
7
  \r
8
- `+r)}function Go(e,t,r,i,n){if(e.listenerCount("wsClientError")){let o=new Error(n);Error.captureStackTrace(o,Go),e.emit("wsClientError",o,r,t)}else $f(r,i,n)}});var Vw=X((MY,Q9)=>{Q9.exports={name:"bitcore-lib",version:"10.7.0",description:"A pure and powerful JavaScript Bitcoin library.",author:"BitPay <dev@bitpay.com>",main:"index.js",scripts:{test:"gulp test","test:ci":"npm run test",coverage:"gulp coverage",build:"gulp",pub:"npm run build && npm publish"},keywords:["bitcoin","transaction","address","p2p","ecies","cryptocurrency","blockchain","payment","bip21","bip32","bip37","bip69","bip70","multisig"],repository:{type:"git",url:"https://github.com/bitpay/bitcore/tree/master/packages/bitcore-lib"},browser:{request:"browser-request"},dependencies:{bech32:"=2.0.0","bn.js":"=4.11.8",bs58:"^4.0.1","buffer-compare":"=1.1.1",elliptic:"^6.5.3",inherits:"=2.0.1",lodash:"^4.17.20"},devDependencies:{"bitcore-build":"^10.5.3",brfs:"^2.0.1",chai:"^4.2.0",gulp:"^4.0.0",sinon:"^7.1.1"},license:"MIT",gitHead:"f1efdbe2e7b17e22c586145c450d75ea94497591"}});var zv=X((jw,Hv)=>{(function(e,t){"use strict";function r(E,f){if(!E)throw new Error(f||"Assertion failed")}function i(E,f){E.super_=f;var c=function(){};c.prototype=f.prototype,E.prototype=new c,E.prototype.constructor=E}function n(E,f,c){if(n.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((f==="le"||f==="be")&&(c=f,f=10),this._init(E||0,f||10,c||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{o=require("buffer").Buffer}catch{}n.isBN=function(f){return f instanceof n?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===n.wordSize&&Array.isArray(f.words)},n.max=function(f,c){return f.cmp(c)>0?f:c},n.min=function(f,c){return f.cmp(c)<0?f:c},n.prototype._init=function(f,c,p){if(typeof f=="number")return this._initNumber(f,c,p);if(typeof f=="object")return this._initArray(f,c,p);c==="hex"&&(c=16),r(c===(c|0)&&c>=2&&c<=36),f=f.toString().replace(/\s+/g,"");var v=0;f[0]==="-"&&v++,c===16?this._parseHex(f,v):this._parseBase(f,c,v),f[0]==="-"&&(this.negative=1),this.strip(),p==="le"&&this._initArray(this.toArray(),c,p)},n.prototype._initNumber=function(f,c,p){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),c,p)},n.prototype._initArray=function(f,c,p){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var g,x,S=0;if(p==="be")for(v=f.length-1,g=0;v>=0;v-=3)x=f[v]|f[v-1]<<8|f[v-2]<<16,this.words[g]|=x<<S&67108863,this.words[g+1]=x>>>26-S&67108863,S+=24,S>=26&&(S-=26,g++);else if(p==="le")for(v=0,g=0;v<f.length;v+=3)x=f[v]|f[v+1]<<8|f[v+2]<<16,this.words[g]|=x<<S&67108863,this.words[g+1]=x>>>26-S&67108863,S+=24,S>=26&&(S-=26,g++);return this.strip()};function u(E,f,c){for(var p=0,v=Math.min(E.length,c),g=f;g<v;g++){var x=E.charCodeAt(g)-48;p<<=4,x>=49&&x<=54?p|=x-49+10:x>=17&&x<=22?p|=x-17+10:p|=x&15}return p}n.prototype._parseHex=function(f,c){this.length=Math.ceil((f.length-c)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var v,g,x=0;for(p=f.length-6,v=0;p>=c;p-=6)g=u(f,p,p+6),this.words[v]|=g<<x&67108863,this.words[v+1]|=g>>>26-x&4194303,x+=24,x>=26&&(x-=26,v++);p+6!==c&&(g=u(f,c,p+6),this.words[v]|=g<<x&67108863,this.words[v+1]|=g>>>26-x&4194303),this.strip()};function m(E,f,c,p){for(var v=0,g=Math.min(E.length,c),x=f;x<g;x++){var S=E.charCodeAt(x)-48;v*=p,S>=49?v+=S-49+10:S>=17?v+=S-17+10:v+=S}return v}n.prototype._parseBase=function(f,c,p){this.words=[0],this.length=1;for(var v=0,g=1;g<=67108863;g*=c)v++;v--,g=g/c|0;for(var x=f.length-p,S=x%v,b=Math.min(x,x-S)+p,l=0,d=p;d<b;d+=v)l=m(f,d,d+v,c),this.imuln(g),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(S!==0){var A=1;for(l=m(f,d,f.length,c),d=0;d<S;d++)A*=c;this.imuln(A),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}},n.prototype.copy=function(f){f.words=new Array(this.length);for(var c=0;c<this.length;c++)f.words[c]=this.words[c];f.length=this.length,f.negative=this.negative,f.red=this.red},n.prototype.clone=function(){var f=new n(null);return this.copy(f),f},n.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(f,c){f=f||10,c=c|0||1;var p;if(f===16||f==="hex"){p="";for(var v=0,g=0,x=0;x<this.length;x++){var S=this.words[x],b=((S<<v|g)&16777215).toString(16);g=S>>>24-v&16777215,g!==0||x!==this.length-1?p=_[6-b.length]+b+p:p=b+p,v+=2,v>=26&&(v-=26,x--)}for(g!==0&&(p=g.toString(16)+p);p.length%c!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(f===(f|0)&&f>=2&&f<=36){var l=w[f],d=I[f];p="";var A=this.clone();for(A.negative=0;!A.isZero();){var D=A.modn(d).toString(f);A=A.idivn(d),A.isZero()?p=D+p:p=_[l-D.length]+D+p}for(this.isZero()&&(p="0"+p);p.length%c!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(f,c){return r(typeof o<"u"),this.toArrayLike(o,f,c)},n.prototype.toArray=function(f,c){return this.toArrayLike(Array,f,c)},n.prototype.toArrayLike=function(f,c,p){var v=this.byteLength(),g=p||Math.max(1,v);r(v<=g,"byte array longer than desired length"),r(g>0,"Requested array length <= 0"),this.strip();var x=c==="le",S=new f(g),b,l,d=this.clone();if(x){for(l=0;!d.isZero();l++)b=d.andln(255),d.iushrn(8),S[l]=b;for(;l<g;l++)S[l]=0}else{for(l=0;l<g-v;l++)S[l]=0;for(l=0;!d.isZero();l++)b=d.andln(255),d.iushrn(8),S[g-l-1]=b}return S},Math.clz32?n.prototype._countBits=function(f){return 32-Math.clz32(f)}:n.prototype._countBits=function(f){var c=f,p=0;return c>=4096&&(p+=13,c>>>=13),c>=64&&(p+=7,c>>>=7),c>=8&&(p+=4,c>>>=4),c>=2&&(p+=2,c>>>=2),p+c},n.prototype._zeroBits=function(f){if(f===0)return 26;var c=f,p=0;return c&8191||(p+=13,c>>>=13),c&127||(p+=7,c>>>=7),c&15||(p+=4,c>>>=4),c&3||(p+=2,c>>>=2),c&1||p++,p},n.prototype.bitLength=function(){var f=this.words[this.length-1],c=this._countBits(f);return(this.length-1)*26+c};function T(E){for(var f=new Array(E.bitLength()),c=0;c<f.length;c++){var p=c/26|0,v=c%26;f[c]=(E.words[p]&1<<v)>>>v}return f}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,c=0;c<this.length;c++){var p=this._zeroBits(this.words[c]);if(f+=p,p!==26)break}return f},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},n.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var c=0;c<f.length;c++)this.words[c]=this.words[c]|f.words[c];return this.strip()},n.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},n.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},n.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},n.prototype.iuand=function(f){var c;this.length>f.length?c=f:c=this;for(var p=0;p<c.length;p++)this.words[p]=this.words[p]&f.words[p];return this.length=c.length,this.strip()},n.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},n.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},n.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},n.prototype.iuxor=function(f){var c,p;this.length>f.length?(c=this,p=f):(c=f,p=this);for(var v=0;v<p.length;v++)this.words[v]=c.words[v]^p.words[v];if(this!==c)for(;v<c.length;v++)this.words[v]=c.words[v];return this.length=c.length,this.strip()},n.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},n.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},n.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},n.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var c=Math.ceil(f/26)|0,p=f%26;this._expand(c),p>0&&c--;for(var v=0;v<c;v++)this.words[v]=~this.words[v]&67108863;return p>0&&(this.words[v]=~this.words[v]&67108863>>26-p),this.strip()},n.prototype.notn=function(f){return this.clone().inotn(f)},n.prototype.setn=function(f,c){r(typeof f=="number"&&f>=0);var p=f/26|0,v=f%26;return this._expand(p+1),c?this.words[p]=this.words[p]|1<<v:this.words[p]=this.words[p]&~(1<<v),this.strip()},n.prototype.iadd=function(f){var c;if(this.negative!==0&&f.negative===0)return this.negative=0,c=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,c=this.isub(f),f.negative=1,c._normSign();var p,v;this.length>f.length?(p=this,v=f):(p=f,v=this);for(var g=0,x=0;x<v.length;x++)c=(p.words[x]|0)+(v.words[x]|0)+g,this.words[x]=c&67108863,g=c>>>26;for(;g!==0&&x<p.length;x++)c=(p.words[x]|0)+g,this.words[x]=c&67108863,g=c>>>26;if(this.length=p.length,g!==0)this.words[this.length]=g,this.length++;else if(p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this},n.prototype.add=function(f){var c;return f.negative!==0&&this.negative===0?(f.negative=0,c=this.sub(f),f.negative^=1,c):f.negative===0&&this.negative!==0?(this.negative=0,c=f.sub(this),this.negative=1,c):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},n.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var c=this.iadd(f);return f.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var p=this.cmp(f);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,g;p>0?(v=this,g=f):(v=f,g=this);for(var x=0,S=0;S<g.length;S++)c=(v.words[S]|0)-(g.words[S]|0)+x,x=c>>26,this.words[S]=c&67108863;for(;x!==0&&S<v.length;S++)c=(v.words[S]|0)+x,x=c>>26,this.words[S]=c&67108863;if(x===0&&S<v.length&&v!==this)for(;S<v.length;S++)this.words[S]=v.words[S];return this.length=Math.max(this.length,S),v!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(f){return this.clone().isub(f)};function N(E,f,c){c.negative=f.negative^E.negative;var p=E.length+f.length|0;c.length=p,p=p-1|0;var v=E.words[0]|0,g=f.words[0]|0,x=v*g,S=x&67108863,b=x/67108864|0;c.words[0]=S;for(var l=1;l<p;l++){for(var d=b>>>26,A=b&67108863,D=Math.min(l,f.length-1),V=Math.max(0,l-E.length+1);V<=D;V++){var Y=l-V|0;v=E.words[Y]|0,g=f.words[V]|0,x=v*g+A,d+=x/67108864|0,A=x&67108863}c.words[l]=A|0,b=d|0}return b!==0?c.words[l]=b|0:c.length--,c.strip()}var C=function(f,c,p){var v=f.words,g=c.words,x=p.words,S=0,b,l,d,A=v[0]|0,D=A&8191,V=A>>>13,Y=v[1]|0,se=Y&8191,ae=Y>>>13,pe=v[2]|0,ye=pe&8191,de=pe>>>13,ht=v[3]|0,wt=ht&8191,Re=ht>>>13,st=v[4]|0,et=st&8191,Ie=st>>>13,Te=v[5]|0,jt=Te&8191,Ve=Te>>>13,Rt=v[6]|0,vt=Rt&8191,Me=Rt>>>13,Pt=v[7]|0,Qt=Pt&8191,Ce=Pt>>>13,er=v[8]|0,At=er&8191,Be=er>>>13,Bt=v[9]|0,Mt=Bt&8191,Ue=Bt>>>13,Ct=g[0]|0,Lt=Ct&8191,De=Ct>>>13,Ut=g[1]|0,Dt=Ut&8191,qe=Ut>>>13,tr=g[2]|0,rr=tr&8191,je=tr>>>13,Wt=g[3]|0,Kt=Wt&8191,We=Wt>>>13,ir=g[4]|0,nr=ir&8191,Ke=ir>>>13,Gt=g[5]|0,sr=Gt&8191,Ge=Gt>>>13,ar=g[6]|0,qt=ar&8191,$e=ar>>>13,Ft=g[7]|0,or=Ft&8191,Ye=Ft>>>13,cr=g[8]|0,ur=cr&8191,Ze=cr>>>13,fr=g[9]|0,lr=fr&8191,Xe=fr>>>13;p.negative=f.negative^c.negative,p.length=19,b=Math.imul(D,Lt),l=Math.imul(D,De),l=l+Math.imul(V,Lt)|0,d=Math.imul(V,De);var Ht=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,b=Math.imul(se,Lt),l=Math.imul(se,De),l=l+Math.imul(ae,Lt)|0,d=Math.imul(ae,De),b=b+Math.imul(D,Dt)|0,l=l+Math.imul(D,qe)|0,l=l+Math.imul(V,Dt)|0,d=d+Math.imul(V,qe)|0;var ys=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(ys>>>26)|0,ys&=67108863,b=Math.imul(ye,Lt),l=Math.imul(ye,De),l=l+Math.imul(de,Lt)|0,d=Math.imul(de,De),b=b+Math.imul(se,Dt)|0,l=l+Math.imul(se,qe)|0,l=l+Math.imul(ae,Dt)|0,d=d+Math.imul(ae,qe)|0,b=b+Math.imul(D,rr)|0,l=l+Math.imul(D,je)|0,l=l+Math.imul(V,rr)|0,d=d+Math.imul(V,je)|0;var ws=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(ws>>>26)|0,ws&=67108863,b=Math.imul(wt,Lt),l=Math.imul(wt,De),l=l+Math.imul(Re,Lt)|0,d=Math.imul(Re,De),b=b+Math.imul(ye,Dt)|0,l=l+Math.imul(ye,qe)|0,l=l+Math.imul(de,Dt)|0,d=d+Math.imul(de,qe)|0,b=b+Math.imul(se,rr)|0,l=l+Math.imul(se,je)|0,l=l+Math.imul(ae,rr)|0,d=d+Math.imul(ae,je)|0,b=b+Math.imul(D,Kt)|0,l=l+Math.imul(D,We)|0,l=l+Math.imul(V,Kt)|0,d=d+Math.imul(V,We)|0;var Ss=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,b=Math.imul(et,Lt),l=Math.imul(et,De),l=l+Math.imul(Ie,Lt)|0,d=Math.imul(Ie,De),b=b+Math.imul(wt,Dt)|0,l=l+Math.imul(wt,qe)|0,l=l+Math.imul(Re,Dt)|0,d=d+Math.imul(Re,qe)|0,b=b+Math.imul(ye,rr)|0,l=l+Math.imul(ye,je)|0,l=l+Math.imul(de,rr)|0,d=d+Math.imul(de,je)|0,b=b+Math.imul(se,Kt)|0,l=l+Math.imul(se,We)|0,l=l+Math.imul(ae,Kt)|0,d=d+Math.imul(ae,We)|0,b=b+Math.imul(D,nr)|0,l=l+Math.imul(D,Ke)|0,l=l+Math.imul(V,nr)|0,d=d+Math.imul(V,Ke)|0;var Es=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Es>>>26)|0,Es&=67108863,b=Math.imul(jt,Lt),l=Math.imul(jt,De),l=l+Math.imul(Ve,Lt)|0,d=Math.imul(Ve,De),b=b+Math.imul(et,Dt)|0,l=l+Math.imul(et,qe)|0,l=l+Math.imul(Ie,Dt)|0,d=d+Math.imul(Ie,qe)|0,b=b+Math.imul(wt,rr)|0,l=l+Math.imul(wt,je)|0,l=l+Math.imul(Re,rr)|0,d=d+Math.imul(Re,je)|0,b=b+Math.imul(ye,Kt)|0,l=l+Math.imul(ye,We)|0,l=l+Math.imul(de,Kt)|0,d=d+Math.imul(de,We)|0,b=b+Math.imul(se,nr)|0,l=l+Math.imul(se,Ke)|0,l=l+Math.imul(ae,nr)|0,d=d+Math.imul(ae,Ke)|0,b=b+Math.imul(D,sr)|0,l=l+Math.imul(D,Ge)|0,l=l+Math.imul(V,sr)|0,d=d+Math.imul(V,Ge)|0;var Is=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Is>>>26)|0,Is&=67108863,b=Math.imul(vt,Lt),l=Math.imul(vt,De),l=l+Math.imul(Me,Lt)|0,d=Math.imul(Me,De),b=b+Math.imul(jt,Dt)|0,l=l+Math.imul(jt,qe)|0,l=l+Math.imul(Ve,Dt)|0,d=d+Math.imul(Ve,qe)|0,b=b+Math.imul(et,rr)|0,l=l+Math.imul(et,je)|0,l=l+Math.imul(Ie,rr)|0,d=d+Math.imul(Ie,je)|0,b=b+Math.imul(wt,Kt)|0,l=l+Math.imul(wt,We)|0,l=l+Math.imul(Re,Kt)|0,d=d+Math.imul(Re,We)|0,b=b+Math.imul(ye,nr)|0,l=l+Math.imul(ye,Ke)|0,l=l+Math.imul(de,nr)|0,d=d+Math.imul(de,Ke)|0,b=b+Math.imul(se,sr)|0,l=l+Math.imul(se,Ge)|0,l=l+Math.imul(ae,sr)|0,d=d+Math.imul(ae,Ge)|0,b=b+Math.imul(D,qt)|0,l=l+Math.imul(D,$e)|0,l=l+Math.imul(V,qt)|0,d=d+Math.imul(V,$e)|0;var Ts=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,b=Math.imul(Qt,Lt),l=Math.imul(Qt,De),l=l+Math.imul(Ce,Lt)|0,d=Math.imul(Ce,De),b=b+Math.imul(vt,Dt)|0,l=l+Math.imul(vt,qe)|0,l=l+Math.imul(Me,Dt)|0,d=d+Math.imul(Me,qe)|0,b=b+Math.imul(jt,rr)|0,l=l+Math.imul(jt,je)|0,l=l+Math.imul(Ve,rr)|0,d=d+Math.imul(Ve,je)|0,b=b+Math.imul(et,Kt)|0,l=l+Math.imul(et,We)|0,l=l+Math.imul(Ie,Kt)|0,d=d+Math.imul(Ie,We)|0,b=b+Math.imul(wt,nr)|0,l=l+Math.imul(wt,Ke)|0,l=l+Math.imul(Re,nr)|0,d=d+Math.imul(Re,Ke)|0,b=b+Math.imul(ye,sr)|0,l=l+Math.imul(ye,Ge)|0,l=l+Math.imul(de,sr)|0,d=d+Math.imul(de,Ge)|0,b=b+Math.imul(se,qt)|0,l=l+Math.imul(se,$e)|0,l=l+Math.imul(ae,qt)|0,d=d+Math.imul(ae,$e)|0,b=b+Math.imul(D,or)|0,l=l+Math.imul(D,Ye)|0,l=l+Math.imul(V,or)|0,d=d+Math.imul(V,Ye)|0;var Qi=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,b=Math.imul(At,Lt),l=Math.imul(At,De),l=l+Math.imul(Be,Lt)|0,d=Math.imul(Be,De),b=b+Math.imul(Qt,Dt)|0,l=l+Math.imul(Qt,qe)|0,l=l+Math.imul(Ce,Dt)|0,d=d+Math.imul(Ce,qe)|0,b=b+Math.imul(vt,rr)|0,l=l+Math.imul(vt,je)|0,l=l+Math.imul(Me,rr)|0,d=d+Math.imul(Me,je)|0,b=b+Math.imul(jt,Kt)|0,l=l+Math.imul(jt,We)|0,l=l+Math.imul(Ve,Kt)|0,d=d+Math.imul(Ve,We)|0,b=b+Math.imul(et,nr)|0,l=l+Math.imul(et,Ke)|0,l=l+Math.imul(Ie,nr)|0,d=d+Math.imul(Ie,Ke)|0,b=b+Math.imul(wt,sr)|0,l=l+Math.imul(wt,Ge)|0,l=l+Math.imul(Re,sr)|0,d=d+Math.imul(Re,Ge)|0,b=b+Math.imul(ye,qt)|0,l=l+Math.imul(ye,$e)|0,l=l+Math.imul(de,qt)|0,d=d+Math.imul(de,$e)|0,b=b+Math.imul(se,or)|0,l=l+Math.imul(se,Ye)|0,l=l+Math.imul(ae,or)|0,d=d+Math.imul(ae,Ye)|0,b=b+Math.imul(D,ur)|0,l=l+Math.imul(D,Ze)|0,l=l+Math.imul(V,ur)|0,d=d+Math.imul(V,Ze)|0;var Rs=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,b=Math.imul(Mt,Lt),l=Math.imul(Mt,De),l=l+Math.imul(Ue,Lt)|0,d=Math.imul(Ue,De),b=b+Math.imul(At,Dt)|0,l=l+Math.imul(At,qe)|0,l=l+Math.imul(Be,Dt)|0,d=d+Math.imul(Be,qe)|0,b=b+Math.imul(Qt,rr)|0,l=l+Math.imul(Qt,je)|0,l=l+Math.imul(Ce,rr)|0,d=d+Math.imul(Ce,je)|0,b=b+Math.imul(vt,Kt)|0,l=l+Math.imul(vt,We)|0,l=l+Math.imul(Me,Kt)|0,d=d+Math.imul(Me,We)|0,b=b+Math.imul(jt,nr)|0,l=l+Math.imul(jt,Ke)|0,l=l+Math.imul(Ve,nr)|0,d=d+Math.imul(Ve,Ke)|0,b=b+Math.imul(et,sr)|0,l=l+Math.imul(et,Ge)|0,l=l+Math.imul(Ie,sr)|0,d=d+Math.imul(Ie,Ge)|0,b=b+Math.imul(wt,qt)|0,l=l+Math.imul(wt,$e)|0,l=l+Math.imul(Re,qt)|0,d=d+Math.imul(Re,$e)|0,b=b+Math.imul(ye,or)|0,l=l+Math.imul(ye,Ye)|0,l=l+Math.imul(de,or)|0,d=d+Math.imul(de,Ye)|0,b=b+Math.imul(se,ur)|0,l=l+Math.imul(se,Ze)|0,l=l+Math.imul(ae,ur)|0,d=d+Math.imul(ae,Ze)|0,b=b+Math.imul(D,lr)|0,l=l+Math.imul(D,Xe)|0,l=l+Math.imul(V,lr)|0,d=d+Math.imul(V,Xe)|0;var en=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(en>>>26)|0,en&=67108863,b=Math.imul(Mt,Dt),l=Math.imul(Mt,qe),l=l+Math.imul(Ue,Dt)|0,d=Math.imul(Ue,qe),b=b+Math.imul(At,rr)|0,l=l+Math.imul(At,je)|0,l=l+Math.imul(Be,rr)|0,d=d+Math.imul(Be,je)|0,b=b+Math.imul(Qt,Kt)|0,l=l+Math.imul(Qt,We)|0,l=l+Math.imul(Ce,Kt)|0,d=d+Math.imul(Ce,We)|0,b=b+Math.imul(vt,nr)|0,l=l+Math.imul(vt,Ke)|0,l=l+Math.imul(Me,nr)|0,d=d+Math.imul(Me,Ke)|0,b=b+Math.imul(jt,sr)|0,l=l+Math.imul(jt,Ge)|0,l=l+Math.imul(Ve,sr)|0,d=d+Math.imul(Ve,Ge)|0,b=b+Math.imul(et,qt)|0,l=l+Math.imul(et,$e)|0,l=l+Math.imul(Ie,qt)|0,d=d+Math.imul(Ie,$e)|0,b=b+Math.imul(wt,or)|0,l=l+Math.imul(wt,Ye)|0,l=l+Math.imul(Re,or)|0,d=d+Math.imul(Re,Ye)|0,b=b+Math.imul(ye,ur)|0,l=l+Math.imul(ye,Ze)|0,l=l+Math.imul(de,ur)|0,d=d+Math.imul(de,Ze)|0,b=b+Math.imul(se,lr)|0,l=l+Math.imul(se,Xe)|0,l=l+Math.imul(ae,lr)|0,d=d+Math.imul(ae,Xe)|0;var As=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(As>>>26)|0,As&=67108863,b=Math.imul(Mt,rr),l=Math.imul(Mt,je),l=l+Math.imul(Ue,rr)|0,d=Math.imul(Ue,je),b=b+Math.imul(At,Kt)|0,l=l+Math.imul(At,We)|0,l=l+Math.imul(Be,Kt)|0,d=d+Math.imul(Be,We)|0,b=b+Math.imul(Qt,nr)|0,l=l+Math.imul(Qt,Ke)|0,l=l+Math.imul(Ce,nr)|0,d=d+Math.imul(Ce,Ke)|0,b=b+Math.imul(vt,sr)|0,l=l+Math.imul(vt,Ge)|0,l=l+Math.imul(Me,sr)|0,d=d+Math.imul(Me,Ge)|0,b=b+Math.imul(jt,qt)|0,l=l+Math.imul(jt,$e)|0,l=l+Math.imul(Ve,qt)|0,d=d+Math.imul(Ve,$e)|0,b=b+Math.imul(et,or)|0,l=l+Math.imul(et,Ye)|0,l=l+Math.imul(Ie,or)|0,d=d+Math.imul(Ie,Ye)|0,b=b+Math.imul(wt,ur)|0,l=l+Math.imul(wt,Ze)|0,l=l+Math.imul(Re,ur)|0,d=d+Math.imul(Re,Ze)|0,b=b+Math.imul(ye,lr)|0,l=l+Math.imul(ye,Xe)|0,l=l+Math.imul(de,lr)|0,d=d+Math.imul(de,Xe)|0;var Os=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Os>>>26)|0,Os&=67108863,b=Math.imul(Mt,Kt),l=Math.imul(Mt,We),l=l+Math.imul(Ue,Kt)|0,d=Math.imul(Ue,We),b=b+Math.imul(At,nr)|0,l=l+Math.imul(At,Ke)|0,l=l+Math.imul(Be,nr)|0,d=d+Math.imul(Be,Ke)|0,b=b+Math.imul(Qt,sr)|0,l=l+Math.imul(Qt,Ge)|0,l=l+Math.imul(Ce,sr)|0,d=d+Math.imul(Ce,Ge)|0,b=b+Math.imul(vt,qt)|0,l=l+Math.imul(vt,$e)|0,l=l+Math.imul(Me,qt)|0,d=d+Math.imul(Me,$e)|0,b=b+Math.imul(jt,or)|0,l=l+Math.imul(jt,Ye)|0,l=l+Math.imul(Ve,or)|0,d=d+Math.imul(Ve,Ye)|0,b=b+Math.imul(et,ur)|0,l=l+Math.imul(et,Ze)|0,l=l+Math.imul(Ie,ur)|0,d=d+Math.imul(Ie,Ze)|0,b=b+Math.imul(wt,lr)|0,l=l+Math.imul(wt,Xe)|0,l=l+Math.imul(Re,lr)|0,d=d+Math.imul(Re,Xe)|0;var ks=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(ks>>>26)|0,ks&=67108863,b=Math.imul(Mt,nr),l=Math.imul(Mt,Ke),l=l+Math.imul(Ue,nr)|0,d=Math.imul(Ue,Ke),b=b+Math.imul(At,sr)|0,l=l+Math.imul(At,Ge)|0,l=l+Math.imul(Be,sr)|0,d=d+Math.imul(Be,Ge)|0,b=b+Math.imul(Qt,qt)|0,l=l+Math.imul(Qt,$e)|0,l=l+Math.imul(Ce,qt)|0,d=d+Math.imul(Ce,$e)|0,b=b+Math.imul(vt,or)|0,l=l+Math.imul(vt,Ye)|0,l=l+Math.imul(Me,or)|0,d=d+Math.imul(Me,Ye)|0,b=b+Math.imul(jt,ur)|0,l=l+Math.imul(jt,Ze)|0,l=l+Math.imul(Ve,ur)|0,d=d+Math.imul(Ve,Ze)|0,b=b+Math.imul(et,lr)|0,l=l+Math.imul(et,Xe)|0,l=l+Math.imul(Ie,lr)|0,d=d+Math.imul(Ie,Xe)|0;var Zn=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Zn>>>26)|0,Zn&=67108863,b=Math.imul(Mt,sr),l=Math.imul(Mt,Ge),l=l+Math.imul(Ue,sr)|0,d=Math.imul(Ue,Ge),b=b+Math.imul(At,qt)|0,l=l+Math.imul(At,$e)|0,l=l+Math.imul(Be,qt)|0,d=d+Math.imul(Be,$e)|0,b=b+Math.imul(Qt,or)|0,l=l+Math.imul(Qt,Ye)|0,l=l+Math.imul(Ce,or)|0,d=d+Math.imul(Ce,Ye)|0,b=b+Math.imul(vt,ur)|0,l=l+Math.imul(vt,Ze)|0,l=l+Math.imul(Me,ur)|0,d=d+Math.imul(Me,Ze)|0,b=b+Math.imul(jt,lr)|0,l=l+Math.imul(jt,Xe)|0,l=l+Math.imul(Ve,lr)|0,d=d+Math.imul(Ve,Xe)|0;var Xn=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,b=Math.imul(Mt,qt),l=Math.imul(Mt,$e),l=l+Math.imul(Ue,qt)|0,d=Math.imul(Ue,$e),b=b+Math.imul(At,or)|0,l=l+Math.imul(At,Ye)|0,l=l+Math.imul(Be,or)|0,d=d+Math.imul(Be,Ye)|0,b=b+Math.imul(Qt,ur)|0,l=l+Math.imul(Qt,Ze)|0,l=l+Math.imul(Ce,ur)|0,d=d+Math.imul(Ce,Ze)|0,b=b+Math.imul(vt,lr)|0,l=l+Math.imul(vt,Xe)|0,l=l+Math.imul(Me,lr)|0,d=d+Math.imul(Me,Xe)|0;var Jn=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,b=Math.imul(Mt,or),l=Math.imul(Mt,Ye),l=l+Math.imul(Ue,or)|0,d=Math.imul(Ue,Ye),b=b+Math.imul(At,ur)|0,l=l+Math.imul(At,Ze)|0,l=l+Math.imul(Be,ur)|0,d=d+Math.imul(Be,Ze)|0,b=b+Math.imul(Qt,lr)|0,l=l+Math.imul(Qt,Xe)|0,l=l+Math.imul(Ce,lr)|0,d=d+Math.imul(Ce,Xe)|0;var Ps=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,b=Math.imul(Mt,ur),l=Math.imul(Mt,Ze),l=l+Math.imul(Ue,ur)|0,d=Math.imul(Ue,Ze),b=b+Math.imul(At,lr)|0,l=l+Math.imul(At,Xe)|0,l=l+Math.imul(Be,lr)|0,d=d+Math.imul(Be,Xe)|0;var Ns=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,b=Math.imul(Mt,lr),l=Math.imul(Mt,Xe),l=l+Math.imul(Ue,lr)|0,d=Math.imul(Ue,Xe);var Bs=(S+b|0)+((l&8191)<<13)|0;return S=(d+(l>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,x[0]=Ht,x[1]=ys,x[2]=ws,x[3]=Ss,x[4]=Es,x[5]=Is,x[6]=Ts,x[7]=Qi,x[8]=Rs,x[9]=en,x[10]=As,x[11]=Os,x[12]=ks,x[13]=Zn,x[14]=Xn,x[15]=Jn,x[16]=Ps,x[17]=Ns,x[18]=Bs,S!==0&&(x[19]=S,p.length++),p};Math.imul||(C=N);function B(E,f,c){c.negative=f.negative^E.negative,c.length=E.length+f.length;for(var p=0,v=0,g=0;g<c.length-1;g++){var x=v;v=0;for(var S=p&67108863,b=Math.min(g,f.length-1),l=Math.max(0,g-E.length+1);l<=b;l++){var d=g-l,A=E.words[d]|0,D=f.words[l]|0,V=A*D,Y=V&67108863;x=x+(V/67108864|0)|0,Y=Y+S|0,S=Y&67108863,x=x+(Y>>>26)|0,v+=x>>>26,x&=67108863}c.words[g]=S,p=x,x=v}return p!==0?c.words[g]=p:c.length--,c.strip()}function U(E,f,c){var p=new Z;return p.mulp(E,f,c)}n.prototype.mulTo=function(f,c){var p,v=this.length+f.length;return this.length===10&&f.length===10?p=C(this,f,c):v<63?p=N(this,f,c):v<1024?p=B(this,f,c):p=U(this,f,c),p};function Z(E,f){this.x=E,this.y=f}Z.prototype.makeRBT=function(f){for(var c=new Array(f),p=n.prototype._countBits(f)-1,v=0;v<f;v++)c[v]=this.revBin(v,p,f);return c},Z.prototype.revBin=function(f,c,p){if(f===0||f===p-1)return f;for(var v=0,g=0;g<c;g++)v|=(f&1)<<c-g-1,f>>=1;return v},Z.prototype.permute=function(f,c,p,v,g,x){for(var S=0;S<x;S++)v[S]=c[f[S]],g[S]=p[f[S]]},Z.prototype.transform=function(f,c,p,v,g,x){this.permute(x,f,c,p,v,g);for(var S=1;S<g;S<<=1)for(var b=S<<1,l=Math.cos(2*Math.PI/b),d=Math.sin(2*Math.PI/b),A=0;A<g;A+=b)for(var D=l,V=d,Y=0;Y<S;Y++){var se=p[A+Y],ae=v[A+Y],pe=p[A+Y+S],ye=v[A+Y+S],de=D*pe-V*ye;ye=D*ye+V*pe,pe=de,p[A+Y]=se+pe,v[A+Y]=ae+ye,p[A+Y+S]=se-pe,v[A+Y+S]=ae-ye,Y!==b&&(de=l*D-d*V,V=l*V+d*D,D=de)}},Z.prototype.guessLen13b=function(f,c){var p=Math.max(c,f)|1,v=p&1,g=0;for(p=p/2|0;p;p=p>>>1)g++;return 1<<g+1+v},Z.prototype.conjugate=function(f,c,p){if(!(p<=1))for(var v=0;v<p/2;v++){var g=f[v];f[v]=f[p-v-1],f[p-v-1]=g,g=c[v],c[v]=-c[p-v-1],c[p-v-1]=-g}},Z.prototype.normalize13b=function(f,c){for(var p=0,v=0;v<c/2;v++){var g=Math.round(f[2*v+1]/c)*8192+Math.round(f[2*v]/c)+p;f[v]=g&67108863,g<67108864?p=0:p=g/67108864|0}return f},Z.prototype.convert13b=function(f,c,p,v){for(var g=0,x=0;x<c;x++)g=g+(f[x]|0),p[2*x]=g&8191,g=g>>>13,p[2*x+1]=g&8191,g=g>>>13;for(x=2*c;x<v;++x)p[x]=0;r(g===0),r((g&-8192)===0)},Z.prototype.stub=function(f){for(var c=new Array(f),p=0;p<f;p++)c[p]=0;return c},Z.prototype.mulp=function(f,c,p){var v=2*this.guessLen13b(f.length,c.length),g=this.makeRBT(v),x=this.stub(v),S=new Array(v),b=new Array(v),l=new Array(v),d=new Array(v),A=new Array(v),D=new Array(v),V=p.words;V.length=v,this.convert13b(f.words,f.length,S,v),this.convert13b(c.words,c.length,d,v),this.transform(S,x,b,l,v,g),this.transform(d,x,A,D,v,g);for(var Y=0;Y<v;Y++){var se=b[Y]*A[Y]-l[Y]*D[Y];l[Y]=b[Y]*D[Y]+l[Y]*A[Y],b[Y]=se}return this.conjugate(b,l,v),this.transform(b,l,V,x,v,g),this.conjugate(V,x,v),this.normalize13b(V,v),p.negative=f.negative^c.negative,p.length=f.length+c.length,p.strip()},n.prototype.mul=function(f){var c=new n(null);return c.words=new Array(this.length+f.length),this.mulTo(f,c)},n.prototype.mulf=function(f){var c=new n(null);return c.words=new Array(this.length+f.length),U(this,f,c)},n.prototype.imul=function(f){return this.clone().mulTo(f,this)},n.prototype.imuln=function(f){r(typeof f=="number"),r(f<67108864);for(var c=0,p=0;p<this.length;p++){var v=(this.words[p]|0)*f,g=(v&67108863)+(c&67108863);c>>=26,c+=v/67108864|0,c+=g>>>26,this.words[p]=g&67108863}return c!==0&&(this.words[p]=c,this.length++),this},n.prototype.muln=function(f){return this.clone().imuln(f)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(f){var c=T(f);if(c.length===0)return new n(1);for(var p=this,v=0;v<c.length&&c[v]===0;v++,p=p.sqr());if(++v<c.length)for(var g=p.sqr();v<c.length;v++,g=g.sqr())c[v]!==0&&(p=p.mul(g));return p},n.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var c=f%26,p=(f-c)/26,v=67108863>>>26-c<<26-c,g;if(c!==0){var x=0;for(g=0;g<this.length;g++){var S=this.words[g]&v,b=(this.words[g]|0)-S<<c;this.words[g]=b|x,x=S>>>26-c}x&&(this.words[g]=x,this.length++)}if(p!==0){for(g=this.length-1;g>=0;g--)this.words[g+p]=this.words[g];for(g=0;g<p;g++)this.words[g]=0;this.length+=p}return this.strip()},n.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},n.prototype.iushrn=function(f,c,p){r(typeof f=="number"&&f>=0);var v;c?v=(c-c%26)/26:v=0;var g=f%26,x=Math.min((f-g)/26,this.length),S=67108863^67108863>>>g<<g,b=p;if(v-=x,v=Math.max(0,v),b){for(var l=0;l<x;l++)b.words[l]=this.words[l];b.length=x}if(x!==0)if(this.length>x)for(this.length-=x,l=0;l<this.length;l++)this.words[l]=this.words[l+x];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(d!==0||l>=v);l--){var A=this.words[l]|0;this.words[l]=d<<26-g|A>>>g,d=A&S}return b&&d!==0&&(b.words[b.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(f,c,p){return r(this.negative===0),this.iushrn(f,c,p)},n.prototype.shln=function(f){return this.clone().ishln(f)},n.prototype.ushln=function(f){return this.clone().iushln(f)},n.prototype.shrn=function(f){return this.clone().ishrn(f)},n.prototype.ushrn=function(f){return this.clone().iushrn(f)},n.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var c=f%26,p=(f-c)/26,v=1<<c;if(this.length<=p)return!1;var g=this.words[p];return!!(g&v)},n.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var c=f%26,p=(f-c)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(c!==0&&p++,this.length=Math.min(p,this.length),c!==0){var v=67108863^67108863>>>c<<c;this.words[this.length-1]&=v}return this.strip()},n.prototype.maskn=function(f){return this.clone().imaskn(f)},n.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},n.prototype._iaddn=function(f){this.words[0]+=f;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)this.words[c]-=67108864,c===this.length-1?this.words[c+1]=1:this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},n.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},n.prototype.addn=function(f){return this.clone().iaddn(f)},n.prototype.subn=function(f){return this.clone().isubn(f)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(f,c,p){var v=f.length+p,g;this._expand(v);var x,S=0;for(g=0;g<f.length;g++){x=(this.words[g+p]|0)+S;var b=(f.words[g]|0)*c;x-=b&67108863,S=(x>>26)-(b/67108864|0),this.words[g+p]=x&67108863}for(;g<this.length-p;g++)x=(this.words[g+p]|0)+S,S=x>>26,this.words[g+p]=x&67108863;if(S===0)return this.strip();for(r(S===-1),S=0,g=0;g<this.length;g++)x=-(this.words[g]|0)+S,S=x>>26,this.words[g]=x&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(f,c){var p=this.length-f.length,v=this.clone(),g=f,x=g.words[g.length-1]|0,S=this._countBits(x);p=26-S,p!==0&&(g=g.ushln(p),v.iushln(p),x=g.words[g.length-1]|0);var b=v.length-g.length,l;if(c!=="mod"){l=new n(null),l.length=b+1,l.words=new Array(l.length);for(var d=0;d<l.length;d++)l.words[d]=0}var A=v.clone()._ishlnsubmul(g,1,b);A.negative===0&&(v=A,l&&(l.words[b]=1));for(var D=b-1;D>=0;D--){var V=(v.words[g.length+D]|0)*67108864+(v.words[g.length+D-1]|0);for(V=Math.min(V/x|0,67108863),v._ishlnsubmul(g,V,D);v.negative!==0;)V--,v.negative=0,v._ishlnsubmul(g,1,D),v.isZero()||(v.negative^=1);l&&(l.words[D]=V)}return l&&l.strip(),v.strip(),c!=="div"&&p!==0&&v.iushrn(p),{div:l||null,mod:v}},n.prototype.divmod=function(f,c,p){if(r(!f.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var v,g,x;return this.negative!==0&&f.negative===0?(x=this.neg().divmod(f,c),c!=="mod"&&(v=x.div.neg()),c!=="div"&&(g=x.mod.neg(),p&&g.negative!==0&&g.iadd(f)),{div:v,mod:g}):this.negative===0&&f.negative!==0?(x=this.divmod(f.neg(),c),c!=="mod"&&(v=x.div.neg()),{div:v,mod:x.mod}):this.negative&f.negative?(x=this.neg().divmod(f.neg(),c),c!=="div"&&(g=x.mod.neg(),p&&g.negative!==0&&g.isub(f)),{div:x.div,mod:g}):f.length>this.length||this.cmp(f)<0?{div:new n(0),mod:this}:f.length===1?c==="div"?{div:this.divn(f.words[0]),mod:null}:c==="mod"?{div:null,mod:new n(this.modn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new n(this.modn(f.words[0]))}:this._wordDiv(f,c)},n.prototype.div=function(f){return this.divmod(f,"div",!1).div},n.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},n.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},n.prototype.divRound=function(f){var c=this.divmod(f);if(c.mod.isZero())return c.div;var p=c.div.negative!==0?c.mod.isub(f):c.mod,v=f.ushrn(1),g=f.andln(1),x=p.cmp(v);return x<0||g===1&&x===0?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},n.prototype.modn=function(f){r(f<=67108863);for(var c=(1<<26)%f,p=0,v=this.length-1;v>=0;v--)p=(c*p+(this.words[v]|0))%f;return p},n.prototype.idivn=function(f){r(f<=67108863);for(var c=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+c*67108864;this.words[p]=v/f|0,c=v%f}return this.strip()},n.prototype.divn=function(f){return this.clone().idivn(f)},n.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var c=this,p=f.clone();c.negative!==0?c=c.umod(f):c=c.clone();for(var v=new n(1),g=new n(0),x=new n(0),S=new n(1),b=0;c.isEven()&&p.isEven();)c.iushrn(1),p.iushrn(1),++b;for(var l=p.clone(),d=c.clone();!c.isZero();){for(var A=0,D=1;!(c.words[0]&D)&&A<26;++A,D<<=1);if(A>0)for(c.iushrn(A);A-- >0;)(v.isOdd()||g.isOdd())&&(v.iadd(l),g.isub(d)),v.iushrn(1),g.iushrn(1);for(var V=0,Y=1;!(p.words[0]&Y)&&V<26;++V,Y<<=1);if(V>0)for(p.iushrn(V);V-- >0;)(x.isOdd()||S.isOdd())&&(x.iadd(l),S.isub(d)),x.iushrn(1),S.iushrn(1);c.cmp(p)>=0?(c.isub(p),v.isub(x),g.isub(S)):(p.isub(c),x.isub(v),S.isub(g))}return{a:x,b:S,gcd:p.iushln(b)}},n.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var c=this,p=f.clone();c.negative!==0?c=c.umod(f):c=c.clone();for(var v=new n(1),g=new n(0),x=p.clone();c.cmpn(1)>0&&p.cmpn(1)>0;){for(var S=0,b=1;!(c.words[0]&b)&&S<26;++S,b<<=1);if(S>0)for(c.iushrn(S);S-- >0;)v.isOdd()&&v.iadd(x),v.iushrn(1);for(var l=0,d=1;!(p.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(p.iushrn(l);l-- >0;)g.isOdd()&&g.iadd(x),g.iushrn(1);c.cmp(p)>=0?(c.isub(p),v.isub(g)):(p.isub(c),g.isub(v))}var A;return c.cmpn(1)===0?A=v:A=g,A.cmpn(0)<0&&A.iadd(f),A},n.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var c=this.clone(),p=f.clone();c.negative=0,p.negative=0;for(var v=0;c.isEven()&&p.isEven();v++)c.iushrn(1),p.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;p.isEven();)p.iushrn(1);var g=c.cmp(p);if(g<0){var x=c;c=p,p=x}else if(g===0||p.cmpn(1)===0)break;c.isub(p)}while(!0);return p.iushln(v)},n.prototype.invm=function(f){return this.egcd(f).a.umod(f)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(f){return this.words[0]&f},n.prototype.bincn=function(f){r(typeof f=="number");var c=f%26,p=(f-c)/26,v=1<<c;if(this.length<=p)return this._expand(p+1),this.words[p]|=v,this;for(var g=v,x=p;g!==0&&x<this.length;x++){var S=this.words[x]|0;S+=g,g=S>>>26,S&=67108863,this.words[x]=S}return g!==0&&(this.words[x]=g,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(f){var c=f<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var p;if(this.length>1)p=1;else{c&&(f=-f),r(f<=67108863,"Number is too big");var v=this.words[0]|0;p=v===f?0:v<f?-1:1}return this.negative!==0?-p|0:p},n.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var c=this.ucmp(f);return this.negative!==0?-c|0:c},n.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var c=0,p=this.length-1;p>=0;p--){var v=this.words[p]|0,g=f.words[p]|0;if(v!==g){v<g?c=-1:v>g&&(c=1);break}}return c},n.prototype.gtn=function(f){return this.cmpn(f)===1},n.prototype.gt=function(f){return this.cmp(f)===1},n.prototype.gten=function(f){return this.cmpn(f)>=0},n.prototype.gte=function(f){return this.cmp(f)>=0},n.prototype.ltn=function(f){return this.cmpn(f)===-1},n.prototype.lt=function(f){return this.cmp(f)===-1},n.prototype.lten=function(f){return this.cmpn(f)<=0},n.prototype.lte=function(f){return this.cmp(f)<=0},n.prototype.eqn=function(f){return this.cmpn(f)===0},n.prototype.eq=function(f){return this.cmp(f)===0},n.red=function(f){return new me(f)},n.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(f){return this.red=f,this},n.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},n.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},n.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},n.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},n.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},n.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},n.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},n.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var $={k256:null,p224:null,p192:null,p25519:null};function H(E,f){this.name=E,this.p=new n(f,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var f=new n(null);return f.words=new Array(Math.ceil(this.n/13)),f},H.prototype.ireduce=function(f){var c=f,p;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),p=c.bitLength();while(p>this.n);var v=p<this.n?-1:c.ucmp(this.p);return v===0?(c.words[0]=0,c.length=1):v>0?c.isub(this.p):c.strip(),c},H.prototype.split=function(f,c){f.iushrn(this.n,0,c)},H.prototype.imulK=function(f){return f.imul(this.k)};function ee(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(ee,H),ee.prototype.split=function(f,c){for(var p=4194303,v=Math.min(f.length,9),g=0;g<v;g++)c.words[g]=f.words[g];if(c.length=v,f.length<=9){f.words[0]=0,f.length=1;return}var x=f.words[9];for(c.words[c.length++]=x&p,g=10;g<f.length;g++){var S=f.words[g]|0;f.words[g-10]=(S&p)<<4|x>>>22,x=S}x>>>=22,f.words[g-10]=x,x===0&&f.length>10?f.length-=10:f.length-=9},ee.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var c=0,p=0;p<f.length;p++){var v=f.words[p]|0;c+=v*977,f.words[p]=c&67108863,c=v*64+(c/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function ce(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(ce,H);function ge(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(ge,H);function Se(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Se,H),Se.prototype.imulK=function(f){for(var c=0,p=0;p<f.length;p++){var v=(f.words[p]|0)*19+c,g=v&67108863;v>>>=26,f.words[p]=g,c=v}return c!==0&&(f.words[f.length++]=c),f},n._prime=function(f){if($[f])return $[f];var c;if(f==="k256")c=new ee;else if(f==="p224")c=new ce;else if(f==="p192")c=new ge;else if(f==="p25519")c=new Se;else throw new Error("Unknown prime "+f);return $[f]=c,c};function me(E){if(typeof E=="string"){var f=n._prime(E);this.m=f.p,this.prime=f}else r(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}me.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},me.prototype._verify2=function(f,c){r((f.negative|c.negative)===0,"red works only with positives"),r(f.red&&f.red===c.red,"red works only with red numbers")},me.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):f.umod(this.m)._forceRed(this)},me.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},me.prototype.add=function(f,c){this._verify2(f,c);var p=f.add(c);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},me.prototype.iadd=function(f,c){this._verify2(f,c);var p=f.iadd(c);return p.cmp(this.m)>=0&&p.isub(this.m),p},me.prototype.sub=function(f,c){this._verify2(f,c);var p=f.sub(c);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},me.prototype.isub=function(f,c){this._verify2(f,c);var p=f.isub(c);return p.cmpn(0)<0&&p.iadd(this.m),p},me.prototype.shl=function(f,c){return this._verify1(f),this.imod(f.ushln(c))},me.prototype.imul=function(f,c){return this._verify2(f,c),this.imod(f.imul(c))},me.prototype.mul=function(f,c){return this._verify2(f,c),this.imod(f.mul(c))},me.prototype.isqr=function(f){return this.imul(f,f.clone())},me.prototype.sqr=function(f){return this.mul(f,f)},me.prototype.sqrt=function(f){if(f.isZero())return f.clone();var c=this.m.andln(3);if(r(c%2===1),c===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(f,p)}for(var v=this.m.subn(1),g=0;!v.isZero()&&v.andln(1)===0;)g++,v.iushrn(1);r(!v.isZero());var x=new n(1).toRed(this),S=x.redNeg(),b=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);this.pow(l,b).cmp(S)!==0;)l.redIAdd(S);for(var d=this.pow(l,v),A=this.pow(f,v.addn(1).iushrn(1)),D=this.pow(f,v),V=g;D.cmp(x)!==0;){for(var Y=D,se=0;Y.cmp(x)!==0;se++)Y=Y.redSqr();r(se<V);var ae=this.pow(d,new n(1).iushln(V-se-1));A=A.redMul(ae),d=ae.redSqr(),D=D.redMul(d),V=se}return A},me.prototype.invm=function(f){var c=f._invmp(this.m);return c.negative!==0?(c.negative=0,this.imod(c).redNeg()):this.imod(c)},me.prototype.pow=function(f,c){if(c.isZero())return new n(1).toRed(this);if(c.cmpn(1)===0)return f.clone();var p=4,v=new Array(1<<p);v[0]=new n(1).toRed(this),v[1]=f;for(var g=2;g<v.length;g++)v[g]=this.mul(v[g-1],f);var x=v[0],S=0,b=0,l=c.bitLength()%26;for(l===0&&(l=26),g=c.length-1;g>=0;g--){for(var d=c.words[g],A=l-1;A>=0;A--){var D=d>>A&1;if(x!==v[0]&&(x=this.sqr(x)),D===0&&S===0){b=0;continue}S<<=1,S|=D,b++,!(b!==p&&(g!==0||A!==0))&&(x=this.mul(x,v[S]),b=0,S=0)}l=26}return x},me.prototype.convertTo=function(f){var c=f.umod(this.m);return c===f?c.clone():c},me.prototype.convertFrom=function(f){var c=f.clone();return c.red=null,c},n.mont=function(f){return new O(f)};function O(E){me.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(O,me),O.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},O.prototype.convertFrom=function(f){var c=this.imod(f.mul(this.rinv));return c.red=null,c},O.prototype.imul=function(f,c){if(f.isZero()||c.isZero())return f.words[0]=0,f.length=1,f;var p=f.imul(c),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=p.isub(v).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},O.prototype.mul=function(f,c){if(f.isZero()||c.isZero())return new n(0)._forceRed(this);var p=f.mul(c),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=p.isub(v).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},O.prototype.invm=function(f){var c=this.imod(f._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof Hv>"u"||Hv,jw)});var Et=X((tu,Xf)=>{(function(){var e,t="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",n="Expected a function",o="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",m=500,_="__lodash_placeholder__",w=1,I=2,T=4,N=1,C=2,B=1,U=2,Z=4,$=8,H=16,ee=32,ce=64,ge=128,Se=256,me=512,O=30,E="...",f=800,c=16,p=1,v=2,g=3,x=1/0,S=9007199254740991,b=17976931348623157e292,l=NaN,d=4294967295,A=d-1,D=d>>>1,V=[["ary",ge],["bind",B],["bindKey",U],["curry",$],["curryRight",H],["flip",me],["partial",ee],["partialRight",ce],["rearg",Se]],Y="[object Arguments]",se="[object Array]",ae="[object AsyncFunction]",pe="[object Boolean]",ye="[object Date]",de="[object DOMException]",ht="[object Error]",wt="[object Function]",Re="[object GeneratorFunction]",st="[object Map]",et="[object Number]",Ie="[object Null]",Te="[object Object]",jt="[object Promise]",Ve="[object Proxy]",Rt="[object RegExp]",vt="[object Set]",Me="[object String]",Pt="[object Symbol]",Qt="[object Undefined]",Ce="[object WeakMap]",er="[object WeakSet]",At="[object ArrayBuffer]",Be="[object DataView]",Bt="[object Float32Array]",Mt="[object Float64Array]",Ue="[object Int8Array]",Ct="[object Int16Array]",Lt="[object Int32Array]",De="[object Uint8Array]",Ut="[object Uint8ClampedArray]",Dt="[object Uint16Array]",qe="[object Uint32Array]",tr=/\b__p \+= '';/g,rr=/\b(__p \+=) '' \+/g,je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wt=/&(?:amp|lt|gt|quot|#39);/g,Kt=/[&<>"']/g,We=RegExp(Wt.source),ir=RegExp(Kt.source),nr=/<%-([\s\S]+?)%>/g,Ke=/<%([\s\S]+?)%>/g,Gt=/<%=([\s\S]+?)%>/g,sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ge=/^\w*$/,ar=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qt=/[\\^$.*+?()[\]{}|]/g,$e=RegExp(qt.source),Ft=/^\s+/,or=/\s/,Ye=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cr=/\{\n\/\* \[wrapped with (.+)\] \*/,ur=/,? & /,Ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fr=/[()=,{}\[\]\/\s]/,lr=/\\(\\)?/g,Xe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,ys=/^[-+]0x[0-9a-f]+$/i,ws=/^0b[01]+$/i,Ss=/^\[object .+?Constructor\]$/,Es=/^0o[0-7]+$/i,Is=/^(?:0|[1-9]\d*)$/,Ts=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qi=/($^)/,Rs=/['\n\r\u2028\u2029\\]/g,en="\\ud800-\\udfff",As="\\u0300-\\u036f",Os="\\ufe20-\\ufe2f",ks="\\u20d0-\\u20ff",Zn=As+Os+ks,Xn="\\u2700-\\u27bf",Jn="a-z\\xdf-\\xf6\\xf8-\\xff",Ps="\\xac\\xb1\\xd7\\xf7",Ns="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bs="\\u2000-\\u206f",Bu=" \\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",Cx="A-Z\\xc0-\\xd6\\xd8-\\xde",Lx="\\ufe0e\\ufe0f",Ux=Ps+Ns+Bs+Bu,Pd="['\u2019]",AT="["+en+"]",Dx="["+Ux+"]",Ol="["+Zn+"]",qx="\\d+",OT="["+Xn+"]",Fx="["+Jn+"]",Hx="[^"+en+Ux+qx+Xn+Jn+Cx+"]",Nd="\\ud83c[\\udffb-\\udfff]",kT="(?:"+Ol+"|"+Nd+")",zx="[^"+en+"]",Bd="(?:\\ud83c[\\udde6-\\uddff]){2}",Md="[\\ud800-\\udbff][\\udc00-\\udfff]",_c="["+Cx+"]",Vx="\\u200d",jx="(?:"+Fx+"|"+Hx+")",PT="(?:"+_c+"|"+Hx+")",Wx="(?:"+Pd+"(?:d|ll|m|re|s|t|ve))?",Kx="(?:"+Pd+"(?:D|LL|M|RE|S|T|VE))?",Gx=kT+"?",$x="["+Lx+"]?",NT="(?:"+Vx+"(?:"+[zx,Bd,Md].join("|")+")"+$x+Gx+")*",BT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yx=$x+Gx+NT,CT="(?:"+[OT,Bd,Md].join("|")+")"+Yx,LT="(?:"+[zx+Ol+"?",Ol,Bd,Md,AT].join("|")+")",UT=RegExp(Pd,"g"),DT=RegExp(Ol,"g"),Cd=RegExp(Nd+"(?="+Nd+")|"+LT+Yx,"g"),qT=RegExp([_c+"?"+Fx+"+"+Wx+"(?="+[Dx,_c,"$"].join("|")+")",PT+"+"+Kx+"(?="+[Dx,_c+jx,"$"].join("|")+")",_c+"?"+jx+"+"+Wx,_c+"+"+Kx,MT,BT,qx,CT].join("|"),"g"),FT=RegExp("["+Vx+en+Zn+Lx+"]"),HT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zT=["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"],VT=-1,pr={};pr[Bt]=pr[Mt]=pr[Ue]=pr[Ct]=pr[Lt]=pr[De]=pr[Ut]=pr[Dt]=pr[qe]=!0,pr[Y]=pr[se]=pr[At]=pr[pe]=pr[Be]=pr[ye]=pr[ht]=pr[wt]=pr[st]=pr[et]=pr[Te]=pr[Rt]=pr[vt]=pr[Me]=pr[Ce]=!1;var $t={};$t[Y]=$t[se]=$t[At]=$t[Be]=$t[pe]=$t[ye]=$t[Bt]=$t[Mt]=$t[Ue]=$t[Ct]=$t[Lt]=$t[st]=$t[et]=$t[Te]=$t[Rt]=$t[vt]=$t[Me]=$t[Pt]=$t[De]=$t[Ut]=$t[Dt]=$t[qe]=!0,$t[ht]=$t[wt]=$t[Ce]=!1;var jT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},WT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},KT={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},GT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$T=parseFloat,YT=parseInt,Zx=typeof global=="object"&&global&&global.Object===Object&&global,ZT=typeof self=="object"&&self&&self.Object===Object&&self,$r=Zx||ZT||Function("return this")(),Ld=typeof tu=="object"&&tu&&!tu.nodeType&&tu,vo=Ld&&typeof Xf=="object"&&Xf&&!Xf.nodeType&&Xf,Xx=vo&&vo.exports===Ld,Ud=Xx&&Zx.process,tn=function(){try{var q=vo&&vo.require&&vo.require("util").types;return q||Ud&&Ud.binding&&Ud.binding("util")}catch{}}(),Jx=tn&&tn.isArrayBuffer,Qx=tn&&tn.isDate,eb=tn&&tn.isMap,tb=tn&&tn.isRegExp,rb=tn&&tn.isSet,ib=tn&&tn.isTypedArray;function Di(q,Q,G){switch(G.length){case 0:return q.call(Q);case 1:return q.call(Q,G[0]);case 2:return q.call(Q,G[0],G[1]);case 3:return q.call(Q,G[0],G[1],G[2])}return q.apply(Q,G)}function XT(q,Q,G,xe){for(var He=-1,It=q==null?0:q.length;++He<It;){var Hr=q[He];Q(xe,Hr,G(Hr),q)}return xe}function rn(q,Q){for(var G=-1,xe=q==null?0:q.length;++G<xe&&Q(q[G],G,q)!==!1;);return q}function JT(q,Q){for(var G=q==null?0:q.length;G--&&Q(q[G],G,q)!==!1;);return q}function nb(q,Q){for(var G=-1,xe=q==null?0:q.length;++G<xe;)if(!Q(q[G],G,q))return!1;return!0}function ba(q,Q){for(var G=-1,xe=q==null?0:q.length,He=0,It=[];++G<xe;){var Hr=q[G];Q(Hr,G,q)&&(It[He++]=Hr)}return It}function kl(q,Q){var G=q==null?0:q.length;return!!G&&yc(q,Q,0)>-1}function Dd(q,Q,G){for(var xe=-1,He=q==null?0:q.length;++xe<He;)if(G(Q,q[xe]))return!0;return!1}function mr(q,Q){for(var G=-1,xe=q==null?0:q.length,He=Array(xe);++G<xe;)He[G]=Q(q[G],G,q);return He}function _a(q,Q){for(var G=-1,xe=Q.length,He=q.length;++G<xe;)q[He+G]=Q[G];return q}function qd(q,Q,G,xe){var He=-1,It=q==null?0:q.length;for(xe&&It&&(G=q[++He]);++He<It;)G=Q(G,q[He],He,q);return G}function QT(q,Q,G,xe){var He=q==null?0:q.length;for(xe&&He&&(G=q[--He]);He--;)G=Q(G,q[He],He,q);return G}function Fd(q,Q){for(var G=-1,xe=q==null?0:q.length;++G<xe;)if(Q(q[G],G,q))return!0;return!1}var eR=Hd("length");function tR(q){return q.split("")}function rR(q){return q.match(Ze)||[]}function sb(q,Q,G){var xe;return G(q,function(He,It,Hr){if(Q(He,It,Hr))return xe=It,!1}),xe}function Pl(q,Q,G,xe){for(var He=q.length,It=G+(xe?1:-1);xe?It--:++It<He;)if(Q(q[It],It,q))return It;return-1}function yc(q,Q,G){return Q===Q?dR(q,Q,G):Pl(q,ab,G)}function iR(q,Q,G,xe){for(var He=G-1,It=q.length;++He<It;)if(xe(q[He],Q))return He;return-1}function ab(q){return q!==q}function ob(q,Q){var G=q==null?0:q.length;return G?Vd(q,Q)/G:l}function Hd(q){return function(Q){return Q==null?e:Q[q]}}function zd(q){return function(Q){return q==null?e:q[Q]}}function cb(q,Q,G,xe,He){return He(q,function(It,Hr,zt){G=xe?(xe=!1,It):Q(G,It,Hr,zt)}),G}function nR(q,Q){var G=q.length;for(q.sort(Q);G--;)q[G]=q[G].value;return q}function Vd(q,Q){for(var G,xe=-1,He=q.length;++xe<He;){var It=Q(q[xe]);It!==e&&(G=G===e?It:G+It)}return G}function jd(q,Q){for(var G=-1,xe=Array(q);++G<q;)xe[G]=Q(G);return xe}function sR(q,Q){return mr(Q,function(G){return[G,q[G]]})}function ub(q){return q&&q.slice(0,hb(q)+1).replace(Ft,"")}function qi(q){return function(Q){return q(Q)}}function Wd(q,Q){return mr(Q,function(G){return q[G]})}function Mu(q,Q){return q.has(Q)}function fb(q,Q){for(var G=-1,xe=q.length;++G<xe&&yc(Q,q[G],0)>-1;);return G}function lb(q,Q){for(var G=q.length;G--&&yc(Q,q[G],0)>-1;);return G}function aR(q,Q){for(var G=q.length,xe=0;G--;)q[G]===Q&&++xe;return xe}var oR=zd(jT),cR=zd(WT);function uR(q){return"\\"+GT[q]}function fR(q,Q){return q==null?e:q[Q]}function wc(q){return FT.test(q)}function lR(q){return HT.test(q)}function pR(q){for(var Q,G=[];!(Q=q.next()).done;)G.push(Q.value);return G}function Kd(q){var Q=-1,G=Array(q.size);return q.forEach(function(xe,He){G[++Q]=[He,xe]}),G}function pb(q,Q){return function(G){return q(Q(G))}}function ya(q,Q){for(var G=-1,xe=q.length,He=0,It=[];++G<xe;){var Hr=q[G];(Hr===Q||Hr===_)&&(q[G]=_,It[He++]=G)}return It}function Nl(q){var Q=-1,G=Array(q.size);return q.forEach(function(xe){G[++Q]=xe}),G}function hR(q){var Q=-1,G=Array(q.size);return q.forEach(function(xe){G[++Q]=[xe,xe]}),G}function dR(q,Q,G){for(var xe=G-1,He=q.length;++xe<He;)if(q[xe]===Q)return xe;return-1}function mR(q,Q,G){for(var xe=G+1;xe--;)if(q[xe]===Q)return xe;return xe}function Sc(q){return wc(q)?gR(q):eR(q)}function En(q){return wc(q)?xR(q):tR(q)}function hb(q){for(var Q=q.length;Q--&&or.test(q.charAt(Q)););return Q}var vR=zd(KT);function gR(q){for(var Q=Cd.lastIndex=0;Cd.test(q);)++Q;return Q}function xR(q){return q.match(Cd)||[]}function bR(q){return q.match(qT)||[]}var _R=function q(Q){Q=Q==null?$r:wa.defaults($r.Object(),Q,wa.pick($r,zT));var G=Q.Array,xe=Q.Date,He=Q.Error,It=Q.Function,Hr=Q.Math,zt=Q.Object,Gd=Q.RegExp,yR=Q.String,nn=Q.TypeError,Bl=G.prototype,wR=It.prototype,Ec=zt.prototype,Ml=Q["__core-js_shared__"],Cl=wR.toString,Ot=Ec.hasOwnProperty,SR=0,db=function(){var s=/[^.]+$/.exec(Ml&&Ml.keys&&Ml.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Ll=Ec.toString,ER=Cl.call(zt),IR=$r._,TR=Gd("^"+Cl.call(Ot).replace(qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ul=Xx?Q.Buffer:e,Sa=Q.Symbol,Dl=Q.Uint8Array,mb=Ul?Ul.allocUnsafe:e,ql=pb(zt.getPrototypeOf,zt),vb=zt.create,gb=Ec.propertyIsEnumerable,Fl=Bl.splice,xb=Sa?Sa.isConcatSpreadable:e,Cu=Sa?Sa.iterator:e,go=Sa?Sa.toStringTag:e,Hl=function(){try{var s=wo(zt,"defineProperty");return s({},"",{}),s}catch{}}(),RR=Q.clearTimeout!==$r.clearTimeout&&Q.clearTimeout,AR=xe&&xe.now!==$r.Date.now&&xe.now,OR=Q.setTimeout!==$r.setTimeout&&Q.setTimeout,zl=Hr.ceil,Vl=Hr.floor,$d=zt.getOwnPropertySymbols,kR=Ul?Ul.isBuffer:e,bb=Q.isFinite,PR=Bl.join,NR=pb(zt.keys,zt),zr=Hr.max,oi=Hr.min,BR=xe.now,MR=Q.parseInt,_b=Hr.random,CR=Bl.reverse,Yd=wo(Q,"DataView"),Lu=wo(Q,"Map"),Zd=wo(Q,"Promise"),Ic=wo(Q,"Set"),Uu=wo(Q,"WeakMap"),Du=wo(zt,"create"),jl=Uu&&new Uu,Tc={},LR=So(Yd),UR=So(Lu),DR=So(Zd),qR=So(Ic),FR=So(Uu),Wl=Sa?Sa.prototype:e,qu=Wl?Wl.valueOf:e,yb=Wl?Wl.toString:e;function k(s){if(br(s)&&!Je(s)&&!(s instanceof dt)){if(s instanceof sn)return s;if(Ot.call(s,"__wrapped__"))return w_(s)}return new sn(s)}var Rc=function(){function s(){}return function(a){if(!gr(a))return{};if(vb)return vb(a);s.prototype=a;var h=new s;return s.prototype=e,h}}();function Kl(){}function sn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=e}k.templateSettings={escape:nr,evaluate:Ke,interpolate:Gt,variable:"",imports:{_:k}},k.prototype=Kl.prototype,k.prototype.constructor=k,sn.prototype=Rc(Kl.prototype),sn.prototype.constructor=sn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function HR(){var s=new dt(this.__wrapped__);return s.__actions__=Si(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Si(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Si(this.__views__),s}function zR(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function VR(){var s=this.__wrapped__.value(),a=this.__dir__,h=Je(s),y=a<0,R=h?s.length:0,P=t6(0,R,this.__views__),M=P.start,L=P.end,F=L-M,te=y?L:M-1,re=this.__iteratees__,oe=re.length,he=0,Ee=oi(F,this.__takeCount__);if(!h||!y&&R==F&&Ee==F)return Wb(s,this.__actions__);var ke=[];e:for(;F--&&he<Ee;){te+=a;for(var ct=-1,Pe=s[te];++ct<oe;){var pt=re[ct],gt=pt.iteratee,zi=pt.type,xi=gt(Pe);if(zi==v)Pe=xi;else if(!xi){if(zi==p)continue e;break e}}ke[he++]=Pe}return ke}dt.prototype=Rc(Kl.prototype),dt.prototype.constructor=dt;function xo(s){var a=-1,h=s==null?0:s.length;for(this.clear();++a<h;){var y=s[a];this.set(y[0],y[1])}}function jR(){this.__data__=Du?Du(null):{},this.size=0}function WR(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function KR(s){var a=this.__data__;if(Du){var h=a[s];return h===u?e:h}return Ot.call(a,s)?a[s]:e}function GR(s){var a=this.__data__;return Du?a[s]!==e:Ot.call(a,s)}function $R(s,a){var h=this.__data__;return this.size+=this.has(s)?0:1,h[s]=Du&&a===e?u:a,this}xo.prototype.clear=jR,xo.prototype.delete=WR,xo.prototype.get=KR,xo.prototype.has=GR,xo.prototype.set=$R;function Ms(s){var a=-1,h=s==null?0:s.length;for(this.clear();++a<h;){var y=s[a];this.set(y[0],y[1])}}function YR(){this.__data__=[],this.size=0}function ZR(s){var a=this.__data__,h=Gl(a,s);if(h<0)return!1;var y=a.length-1;return h==y?a.pop():Fl.call(a,h,1),--this.size,!0}function XR(s){var a=this.__data__,h=Gl(a,s);return h<0?e:a[h][1]}function JR(s){return Gl(this.__data__,s)>-1}function QR(s,a){var h=this.__data__,y=Gl(h,s);return y<0?(++this.size,h.push([s,a])):h[y][1]=a,this}Ms.prototype.clear=YR,Ms.prototype.delete=ZR,Ms.prototype.get=XR,Ms.prototype.has=JR,Ms.prototype.set=QR;function Cs(s){var a=-1,h=s==null?0:s.length;for(this.clear();++a<h;){var y=s[a];this.set(y[0],y[1])}}function eA(){this.size=0,this.__data__={hash:new xo,map:new(Lu||Ms),string:new xo}}function tA(s){var a=sp(this,s).delete(s);return this.size-=a?1:0,a}function rA(s){return sp(this,s).get(s)}function iA(s){return sp(this,s).has(s)}function nA(s,a){var h=sp(this,s),y=h.size;return h.set(s,a),this.size+=h.size==y?0:1,this}Cs.prototype.clear=eA,Cs.prototype.delete=tA,Cs.prototype.get=rA,Cs.prototype.has=iA,Cs.prototype.set=nA;function bo(s){var a=-1,h=s==null?0:s.length;for(this.__data__=new Cs;++a<h;)this.add(s[a])}function sA(s){return this.__data__.set(s,u),this}function aA(s){return this.__data__.has(s)}bo.prototype.add=bo.prototype.push=sA,bo.prototype.has=aA;function In(s){var a=this.__data__=new Ms(s);this.size=a.size}function oA(){this.__data__=new Ms,this.size=0}function cA(s){var a=this.__data__,h=a.delete(s);return this.size=a.size,h}function uA(s){return this.__data__.get(s)}function fA(s){return this.__data__.has(s)}function lA(s,a){var h=this.__data__;if(h instanceof Ms){var y=h.__data__;if(!Lu||y.length<r-1)return y.push([s,a]),this.size=++h.size,this;h=this.__data__=new Cs(y)}return h.set(s,a),this.size=h.size,this}In.prototype.clear=oA,In.prototype.delete=cA,In.prototype.get=uA,In.prototype.has=fA,In.prototype.set=lA;function wb(s,a){var h=Je(s),y=!h&&Eo(s),R=!h&&!y&&Aa(s),P=!h&&!y&&!R&&Pc(s),M=h||y||R||P,L=M?jd(s.length,yR):[],F=L.length;for(var te in s)(a||Ot.call(s,te))&&!(M&&(te=="length"||R&&(te=="offset"||te=="parent")||P&&(te=="buffer"||te=="byteLength"||te=="byteOffset")||qs(te,F)))&&L.push(te);return L}function Sb(s){var a=s.length;return a?s[o0(0,a-1)]:e}function pA(s,a){return ap(Si(s),_o(a,0,s.length))}function hA(s){return ap(Si(s))}function Xd(s,a,h){(h!==e&&!Tn(s[a],h)||h===e&&!(a in s))&&Ls(s,a,h)}function Fu(s,a,h){var y=s[a];(!(Ot.call(s,a)&&Tn(y,h))||h===e&&!(a in s))&&Ls(s,a,h)}function Gl(s,a){for(var h=s.length;h--;)if(Tn(s[h][0],a))return h;return-1}function dA(s,a,h,y){return Ea(s,function(R,P,M){a(y,R,h(R),M)}),y}function Eb(s,a){return s&&es(a,Yr(a),s)}function mA(s,a){return s&&es(a,Ii(a),s)}function Ls(s,a,h){a=="__proto__"&&Hl?Hl(s,a,{configurable:!0,enumerable:!0,value:h,writable:!0}):s[a]=h}function Jd(s,a){for(var h=-1,y=a.length,R=G(y),P=s==null;++h<y;)R[h]=P?e:N0(s,a[h]);return R}function _o(s,a,h){return s===s&&(h!==e&&(s=s<=h?s:h),a!==e&&(s=s>=a?s:a)),s}function an(s,a,h,y,R,P){var M,L=a&w,F=a&I,te=a&T;if(h&&(M=R?h(s,y,R,P):h(s)),M!==e)return M;if(!gr(s))return s;var re=Je(s);if(re){if(M=i6(s),!L)return Si(s,M)}else{var oe=ci(s),he=oe==wt||oe==Re;if(Aa(s))return $b(s,L);if(oe==Te||oe==Y||he&&!R){if(M=F||he?{}:h_(s),!L)return F?KA(s,mA(M,s)):WA(s,Eb(M,s))}else{if(!$t[oe])return R?s:{};M=n6(s,oe,L)}}P||(P=new In);var Ee=P.get(s);if(Ee)return Ee;P.set(s,M),z_(s)?s.forEach(function(Pe){M.add(an(Pe,a,h,Pe,s,P))}):F_(s)&&s.forEach(function(Pe,pt){M.set(pt,an(Pe,a,h,pt,s,P))});var ke=te?F?x0:g0:F?Ii:Yr,ct=re?e:ke(s);return rn(ct||s,function(Pe,pt){ct&&(pt=Pe,Pe=s[pt]),Fu(M,pt,an(Pe,a,h,pt,s,P))}),M}function vA(s){var a=Yr(s);return function(h){return Ib(h,s,a)}}function Ib(s,a,h){var y=h.length;if(s==null)return!y;for(s=zt(s);y--;){var R=h[y],P=a[R],M=s[R];if(M===e&&!(R in s)||!P(M))return!1}return!0}function Tb(s,a,h){if(typeof s!="function")throw new nn(n);return Gu(function(){s.apply(e,h)},a)}function Hu(s,a,h,y){var R=-1,P=kl,M=!0,L=s.length,F=[],te=a.length;if(!L)return F;h&&(a=mr(a,qi(h))),y?(P=Dd,M=!1):a.length>=r&&(P=Mu,M=!1,a=new bo(a));e:for(;++R<L;){var re=s[R],oe=h==null?re:h(re);if(re=y||re!==0?re:0,M&&oe===oe){for(var he=te;he--;)if(a[he]===oe)continue e;F.push(re)}else P(a,oe,y)||F.push(re)}return F}var Ea=Qb(Qn),Rb=Qb(e0,!0);function gA(s,a){var h=!0;return Ea(s,function(y,R,P){return h=!!a(y,R,P),h}),h}function $l(s,a,h){for(var y=-1,R=s.length;++y<R;){var P=s[y],M=a(P);if(M!=null&&(L===e?M===M&&!Hi(M):h(M,L)))var L=M,F=P}return F}function xA(s,a,h,y){var R=s.length;for(h=at(h),h<0&&(h=-h>R?0:R+h),y=y===e||y>R?R:at(y),y<0&&(y+=R),y=h>y?0:j_(y);h<y;)s[h++]=a;return s}function Ab(s,a){var h=[];return Ea(s,function(y,R,P){a(y,R,P)&&h.push(y)}),h}function ii(s,a,h,y,R){var P=-1,M=s.length;for(h||(h=a6),R||(R=[]);++P<M;){var L=s[P];a>0&&h(L)?a>1?ii(L,a-1,h,y,R):_a(R,L):y||(R[R.length]=L)}return R}var Qd=e_(),Ob=e_(!0);function Qn(s,a){return s&&Qd(s,a,Yr)}function e0(s,a){return s&&Ob(s,a,Yr)}function Yl(s,a){return ba(a,function(h){return Fs(s[h])})}function yo(s,a){a=Ta(a,s);for(var h=0,y=a.length;s!=null&&h<y;)s=s[ts(a[h++])];return h&&h==y?s:e}function kb(s,a,h){var y=a(s);return Je(s)?y:_a(y,h(s))}function vi(s){return s==null?s===e?Qt:Ie:go&&go in zt(s)?e6(s):h6(s)}function t0(s,a){return s>a}function bA(s,a){return s!=null&&Ot.call(s,a)}function _A(s,a){return s!=null&&a in zt(s)}function yA(s,a,h){return s>=oi(a,h)&&s<zr(a,h)}function r0(s,a,h){for(var y=h?Dd:kl,R=s[0].length,P=s.length,M=P,L=G(P),F=1/0,te=[];M--;){var re=s[M];M&&a&&(re=mr(re,qi(a))),F=oi(re.length,F),L[M]=!h&&(a||R>=120&&re.length>=120)?new bo(M&&re):e}re=s[0];var oe=-1,he=L[0];e:for(;++oe<R&&te.length<F;){var Ee=re[oe],ke=a?a(Ee):Ee;if(Ee=h||Ee!==0?Ee:0,!(he?Mu(he,ke):y(te,ke,h))){for(M=P;--M;){var ct=L[M];if(!(ct?Mu(ct,ke):y(s[M],ke,h)))continue e}he&&he.push(ke),te.push(Ee)}}return te}function wA(s,a,h,y){return Qn(s,function(R,P,M){a(y,h(R),P,M)}),y}function zu(s,a,h){a=Ta(a,s),s=g_(s,a);var y=s==null?s:s[ts(cn(a))];return y==null?e:Di(y,s,h)}function Pb(s){return br(s)&&vi(s)==Y}function SA(s){return br(s)&&vi(s)==At}function EA(s){return br(s)&&vi(s)==ye}function Vu(s,a,h,y,R){return s===a?!0:s==null||a==null||!br(s)&&!br(a)?s!==s&&a!==a:IA(s,a,h,y,Vu,R)}function IA(s,a,h,y,R,P){var M=Je(s),L=Je(a),F=M?se:ci(s),te=L?se:ci(a);F=F==Y?Te:F,te=te==Y?Te:te;var re=F==Te,oe=te==Te,he=F==te;if(he&&Aa(s)){if(!Aa(a))return!1;M=!0,re=!1}if(he&&!re)return P||(P=new In),M||Pc(s)?f_(s,a,h,y,R,P):JA(s,a,F,h,y,R,P);if(!(h&N)){var Ee=re&&Ot.call(s,"__wrapped__"),ke=oe&&Ot.call(a,"__wrapped__");if(Ee||ke){var ct=Ee?s.value():s,Pe=ke?a.value():a;return P||(P=new In),R(ct,Pe,h,y,P)}}return he?(P||(P=new In),QA(s,a,h,y,R,P)):!1}function TA(s){return br(s)&&ci(s)==st}function i0(s,a,h,y){var R=h.length,P=R,M=!y;if(s==null)return!P;for(s=zt(s);R--;){var L=h[R];if(M&&L[2]?L[1]!==s[L[0]]:!(L[0]in s))return!1}for(;++R<P;){L=h[R];var F=L[0],te=s[F],re=L[1];if(M&&L[2]){if(te===e&&!(F in s))return!1}else{var oe=new In;if(y)var he=y(te,re,F,s,a,oe);if(!(he===e?Vu(re,te,N|C,y,oe):he))return!1}}return!0}function Nb(s){if(!gr(s)||c6(s))return!1;var a=Fs(s)?TR:Ss;return a.test(So(s))}function RA(s){return br(s)&&vi(s)==Rt}function AA(s){return br(s)&&ci(s)==vt}function OA(s){return br(s)&&pp(s.length)&&!!pr[vi(s)]}function Bb(s){return typeof s=="function"?s:s==null?Ti:typeof s=="object"?Je(s)?Lb(s[0],s[1]):Cb(s):t1(s)}function n0(s){if(!Ku(s))return NR(s);var a=[];for(var h in zt(s))Ot.call(s,h)&&h!="constructor"&&a.push(h);return a}function kA(s){if(!gr(s))return p6(s);var a=Ku(s),h=[];for(var y in s)y=="constructor"&&(a||!Ot.call(s,y))||h.push(y);return h}function s0(s,a){return s<a}function Mb(s,a){var h=-1,y=Ei(s)?G(s.length):[];return Ea(s,function(R,P,M){y[++h]=a(R,P,M)}),y}function Cb(s){var a=_0(s);return a.length==1&&a[0][2]?m_(a[0][0],a[0][1]):function(h){return h===s||i0(h,s,a)}}function Lb(s,a){return w0(s)&&d_(a)?m_(ts(s),a):function(h){var y=N0(h,s);return y===e&&y===a?B0(h,s):Vu(a,y,N|C)}}function Zl(s,a,h,y,R){s!==a&&Qd(a,function(P,M){if(R||(R=new In),gr(P))PA(s,a,M,h,Zl,y,R);else{var L=y?y(E0(s,M),P,M+"",s,a,R):e;L===e&&(L=P),Xd(s,M,L)}},Ii)}function PA(s,a,h,y,R,P,M){var L=E0(s,h),F=E0(a,h),te=M.get(F);if(te){Xd(s,h,te);return}var re=P?P(L,F,h+"",s,a,M):e,oe=re===e;if(oe){var he=Je(F),Ee=!he&&Aa(F),ke=!he&&!Ee&&Pc(F);re=F,he||Ee||ke?Je(L)?re=L:Er(L)?re=Si(L):Ee?(oe=!1,re=$b(F,!0)):ke?(oe=!1,re=Yb(F,!0)):re=[]:$u(F)||Eo(F)?(re=L,Eo(L)?re=W_(L):(!gr(L)||Fs(L))&&(re=h_(F))):oe=!1}oe&&(M.set(F,re),R(re,F,y,P,M),M.delete(F)),Xd(s,h,re)}function Ub(s,a){var h=s.length;if(h)return a+=a<0?h:0,qs(a,h)?s[a]:e}function Db(s,a,h){a.length?a=mr(a,function(P){return Je(P)?function(M){return yo(M,P.length===1?P[0]:P)}:P}):a=[Ti];var y=-1;a=mr(a,qi(Oe()));var R=Mb(s,function(P,M,L){var F=mr(a,function(te){return te(P)});return{criteria:F,index:++y,value:P}});return nR(R,function(P,M){return jA(P,M,h)})}function NA(s,a){return qb(s,a,function(h,y){return B0(s,y)})}function qb(s,a,h){for(var y=-1,R=a.length,P={};++y<R;){var M=a[y],L=yo(s,M);h(L,M)&&ju(P,Ta(M,s),L)}return P}function BA(s){return function(a){return yo(a,s)}}function a0(s,a,h,y){var R=y?iR:yc,P=-1,M=a.length,L=s;for(s===a&&(a=Si(a)),h&&(L=mr(s,qi(h)));++P<M;)for(var F=0,te=a[P],re=h?h(te):te;(F=R(L,re,F,y))>-1;)L!==s&&Fl.call(L,F,1),Fl.call(s,F,1);return s}function Fb(s,a){for(var h=s?a.length:0,y=h-1;h--;){var R=a[h];if(h==y||R!==P){var P=R;qs(R)?Fl.call(s,R,1):f0(s,R)}}return s}function o0(s,a){return s+Vl(_b()*(a-s+1))}function MA(s,a,h,y){for(var R=-1,P=zr(zl((a-s)/(h||1)),0),M=G(P);P--;)M[y?P:++R]=s,s+=h;return M}function c0(s,a){var h="";if(!s||a<1||a>S)return h;do a%2&&(h+=s),a=Vl(a/2),a&&(s+=s);while(a);return h}function ft(s,a){return I0(v_(s,a,Ti),s+"")}function CA(s){return Sb(Nc(s))}function LA(s,a){var h=Nc(s);return ap(h,_o(a,0,h.length))}function ju(s,a,h,y){if(!gr(s))return s;a=Ta(a,s);for(var R=-1,P=a.length,M=P-1,L=s;L!=null&&++R<P;){var F=ts(a[R]),te=h;if(F==="__proto__"||F==="constructor"||F==="prototype")return s;if(R!=M){var re=L[F];te=y?y(re,F,L):e,te===e&&(te=gr(re)?re:qs(a[R+1])?[]:{})}Fu(L,F,te),L=L[F]}return s}var Hb=jl?function(s,a){return jl.set(s,a),s}:Ti,UA=Hl?function(s,a){return Hl(s,"toString",{configurable:!0,enumerable:!1,value:C0(a),writable:!0})}:Ti;function DA(s){return ap(Nc(s))}function on(s,a,h){var y=-1,R=s.length;a<0&&(a=-a>R?0:R+a),h=h>R?R:h,h<0&&(h+=R),R=a>h?0:h-a>>>0,a>>>=0;for(var P=G(R);++y<R;)P[y]=s[y+a];return P}function qA(s,a){var h;return Ea(s,function(y,R,P){return h=a(y,R,P),!h}),!!h}function Xl(s,a,h){var y=0,R=s==null?y:s.length;if(typeof a=="number"&&a===a&&R<=D){for(;y<R;){var P=y+R>>>1,M=s[P];M!==null&&!Hi(M)&&(h?M<=a:M<a)?y=P+1:R=P}return R}return u0(s,a,Ti,h)}function u0(s,a,h,y){var R=0,P=s==null?0:s.length;if(P===0)return 0;a=h(a);for(var M=a!==a,L=a===null,F=Hi(a),te=a===e;R<P;){var re=Vl((R+P)/2),oe=h(s[re]),he=oe!==e,Ee=oe===null,ke=oe===oe,ct=Hi(oe);if(M)var Pe=y||ke;else te?Pe=ke&&(y||he):L?Pe=ke&&he&&(y||!Ee):F?Pe=ke&&he&&!Ee&&(y||!ct):Ee||ct?Pe=!1:Pe=y?oe<=a:oe<a;Pe?R=re+1:P=re}return oi(P,A)}function zb(s,a){for(var h=-1,y=s.length,R=0,P=[];++h<y;){var M=s[h],L=a?a(M):M;if(!h||!Tn(L,F)){var F=L;P[R++]=M===0?0:M}}return P}function Vb(s){return typeof s=="number"?s:Hi(s)?l:+s}function Fi(s){if(typeof s=="string")return s;if(Je(s))return mr(s,Fi)+"";if(Hi(s))return yb?yb.call(s):"";var a=s+"";return a=="0"&&1/s==-x?"-0":a}function Ia(s,a,h){var y=-1,R=kl,P=s.length,M=!0,L=[],F=L;if(h)M=!1,R=Dd;else if(P>=r){var te=a?null:ZA(s);if(te)return Nl(te);M=!1,R=Mu,F=new bo}else F=a?[]:L;e:for(;++y<P;){var re=s[y],oe=a?a(re):re;if(re=h||re!==0?re:0,M&&oe===oe){for(var he=F.length;he--;)if(F[he]===oe)continue e;a&&F.push(oe),L.push(re)}else R(F,oe,h)||(F!==L&&F.push(oe),L.push(re))}return L}function f0(s,a){return a=Ta(a,s),s=g_(s,a),s==null||delete s[ts(cn(a))]}function jb(s,a,h,y){return ju(s,a,h(yo(s,a)),y)}function Jl(s,a,h,y){for(var R=s.length,P=y?R:-1;(y?P--:++P<R)&&a(s[P],P,s););return h?on(s,y?0:P,y?P+1:R):on(s,y?P+1:0,y?R:P)}function Wb(s,a){var h=s;return h instanceof dt&&(h=h.value()),qd(a,function(y,R){return R.func.apply(R.thisArg,_a([y],R.args))},h)}function l0(s,a,h){var y=s.length;if(y<2)return y?Ia(s[0]):[];for(var R=-1,P=G(y);++R<y;)for(var M=s[R],L=-1;++L<y;)L!=R&&(P[R]=Hu(P[R]||M,s[L],a,h));return Ia(ii(P,1),a,h)}function Kb(s,a,h){for(var y=-1,R=s.length,P=a.length,M={};++y<R;){var L=y<P?a[y]:e;h(M,s[y],L)}return M}function p0(s){return Er(s)?s:[]}function h0(s){return typeof s=="function"?s:Ti}function Ta(s,a){return Je(s)?s:w0(s,a)?[s]:y_(Tt(s))}var FA=ft;function Ra(s,a,h){var y=s.length;return h=h===e?y:h,!a&&h>=y?s:on(s,a,h)}var Gb=RR||function(s){return $r.clearTimeout(s)};function $b(s,a){if(a)return s.slice();var h=s.length,y=mb?mb(h):new s.constructor(h);return s.copy(y),y}function d0(s){var a=new s.constructor(s.byteLength);return new Dl(a).set(new Dl(s)),a}function HA(s,a){var h=a?d0(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.byteLength)}function zA(s){var a=new s.constructor(s.source,Ht.exec(s));return a.lastIndex=s.lastIndex,a}function VA(s){return qu?zt(qu.call(s)):{}}function Yb(s,a){var h=a?d0(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.length)}function Zb(s,a){if(s!==a){var h=s!==e,y=s===null,R=s===s,P=Hi(s),M=a!==e,L=a===null,F=a===a,te=Hi(a);if(!L&&!te&&!P&&s>a||P&&M&&F&&!L&&!te||y&&M&&F||!h&&F||!R)return 1;if(!y&&!P&&!te&&s<a||te&&h&&R&&!y&&!P||L&&h&&R||!M&&R||!F)return-1}return 0}function jA(s,a,h){for(var y=-1,R=s.criteria,P=a.criteria,M=R.length,L=h.length;++y<M;){var F=Zb(R[y],P[y]);if(F){if(y>=L)return F;var te=h[y];return F*(te=="desc"?-1:1)}}return s.index-a.index}function Xb(s,a,h,y){for(var R=-1,P=s.length,M=h.length,L=-1,F=a.length,te=zr(P-M,0),re=G(F+te),oe=!y;++L<F;)re[L]=a[L];for(;++R<M;)(oe||R<P)&&(re[h[R]]=s[R]);for(;te--;)re[L++]=s[R++];return re}function Jb(s,a,h,y){for(var R=-1,P=s.length,M=-1,L=h.length,F=-1,te=a.length,re=zr(P-L,0),oe=G(re+te),he=!y;++R<re;)oe[R]=s[R];for(var Ee=R;++F<te;)oe[Ee+F]=a[F];for(;++M<L;)(he||R<P)&&(oe[Ee+h[M]]=s[R++]);return oe}function Si(s,a){var h=-1,y=s.length;for(a||(a=G(y));++h<y;)a[h]=s[h];return a}function es(s,a,h,y){var R=!h;h||(h={});for(var P=-1,M=a.length;++P<M;){var L=a[P],F=y?y(h[L],s[L],L,h,s):e;F===e&&(F=s[L]),R?Ls(h,L,F):Fu(h,L,F)}return h}function WA(s,a){return es(s,y0(s),a)}function KA(s,a){return es(s,l_(s),a)}function Ql(s,a){return function(h,y){var R=Je(h)?XT:dA,P=a?a():{};return R(h,s,Oe(y,2),P)}}function Ac(s){return ft(function(a,h){var y=-1,R=h.length,P=R>1?h[R-1]:e,M=R>2?h[2]:e;for(P=s.length>3&&typeof P=="function"?(R--,P):e,M&&gi(h[0],h[1],M)&&(P=R<3?e:P,R=1),a=zt(a);++y<R;){var L=h[y];L&&s(a,L,y,P)}return a})}function Qb(s,a){return function(h,y){if(h==null)return h;if(!Ei(h))return s(h,y);for(var R=h.length,P=a?R:-1,M=zt(h);(a?P--:++P<R)&&y(M[P],P,M)!==!1;);return h}}function e_(s){return function(a,h,y){for(var R=-1,P=zt(a),M=y(a),L=M.length;L--;){var F=M[s?L:++R];if(h(P[F],F,P)===!1)break}return a}}function GA(s,a,h){var y=a&B,R=Wu(s);function P(){var M=this&&this!==$r&&this instanceof P?R:s;return M.apply(y?h:this,arguments)}return P}function t_(s){return function(a){a=Tt(a);var h=wc(a)?En(a):e,y=h?h[0]:a.charAt(0),R=h?Ra(h,1).join(""):a.slice(1);return y[s]()+R}}function Oc(s){return function(a){return qd(Q_(J_(a).replace(UT,"")),s,"")}}function Wu(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var h=Rc(s.prototype),y=s.apply(h,a);return gr(y)?y:h}}function $A(s,a,h){var y=Wu(s);function R(){for(var P=arguments.length,M=G(P),L=P,F=kc(R);L--;)M[L]=arguments[L];var te=P<3&&M[0]!==F&&M[P-1]!==F?[]:ya(M,F);if(P-=te.length,P<h)return a_(s,a,ep,R.placeholder,e,M,te,e,e,h-P);var re=this&&this!==$r&&this instanceof R?y:s;return Di(re,this,M)}return R}function r_(s){return function(a,h,y){var R=zt(a);if(!Ei(a)){var P=Oe(h,3);a=Yr(a),h=function(L){return P(R[L],L,R)}}var M=s(a,h,y);return M>-1?R[P?a[M]:M]:e}}function i_(s){return Ds(function(a){var h=a.length,y=h,R=sn.prototype.thru;for(s&&a.reverse();y--;){var P=a[y];if(typeof P!="function")throw new nn(n);if(R&&!M&&np(P)=="wrapper")var M=new sn([],!0)}for(y=M?y:h;++y<h;){P=a[y];var L=np(P),F=L=="wrapper"?b0(P):e;F&&S0(F[0])&&F[1]==(ge|$|ee|Se)&&!F[4].length&&F[9]==1?M=M[np(F[0])].apply(M,F[3]):M=P.length==1&&S0(P)?M[L]():M.thru(P)}return function(){var te=arguments,re=te[0];if(M&&te.length==1&&Je(re))return M.plant(re).value();for(var oe=0,he=h?a[oe].apply(this,te):re;++oe<h;)he=a[oe].call(this,he);return he}})}function ep(s,a,h,y,R,P,M,L,F,te){var re=a&ge,oe=a&B,he=a&U,Ee=a&($|H),ke=a&me,ct=he?e:Wu(s);function Pe(){for(var pt=arguments.length,gt=G(pt),zi=pt;zi--;)gt[zi]=arguments[zi];if(Ee)var xi=kc(Pe),Vi=aR(gt,xi);if(y&&(gt=Xb(gt,y,R,Ee)),P&&(gt=Jb(gt,P,M,Ee)),pt-=Vi,Ee&&pt<te){var Ir=ya(gt,xi);return a_(s,a,ep,Pe.placeholder,h,gt,Ir,L,F,te-pt)}var Rn=oe?h:this,zs=he?Rn[s]:s;return pt=gt.length,L?gt=d6(gt,L):ke&&pt>1&&gt.reverse(),re&&F<pt&&(gt.length=F),this&&this!==$r&&this instanceof Pe&&(zs=ct||Wu(zs)),zs.apply(Rn,gt)}return Pe}function n_(s,a){return function(h,y){return wA(h,s,a(y),{})}}function tp(s,a){return function(h,y){var R;if(h===e&&y===e)return a;if(h!==e&&(R=h),y!==e){if(R===e)return y;typeof h=="string"||typeof y=="string"?(h=Fi(h),y=Fi(y)):(h=Vb(h),y=Vb(y)),R=s(h,y)}return R}}function m0(s){return Ds(function(a){return a=mr(a,qi(Oe())),ft(function(h){var y=this;return s(a,function(R){return Di(R,y,h)})})})}function rp(s,a){a=a===e?" ":Fi(a);var h=a.length;if(h<2)return h?c0(a,s):a;var y=c0(a,zl(s/Sc(a)));return wc(a)?Ra(En(y),0,s).join(""):y.slice(0,s)}function YA(s,a,h,y){var R=a&B,P=Wu(s);function M(){for(var L=-1,F=arguments.length,te=-1,re=y.length,oe=G(re+F),he=this&&this!==$r&&this instanceof M?P:s;++te<re;)oe[te]=y[te];for(;F--;)oe[te++]=arguments[++L];return Di(he,R?h:this,oe)}return M}function s_(s){return function(a,h,y){return y&&typeof y!="number"&&gi(a,h,y)&&(h=y=e),a=Hs(a),h===e?(h=a,a=0):h=Hs(h),y=y===e?a<h?1:-1:Hs(y),MA(a,h,y,s)}}function ip(s){return function(a,h){return typeof a=="string"&&typeof h=="string"||(a=un(a),h=un(h)),s(a,h)}}function a_(s,a,h,y,R,P,M,L,F,te){var re=a&$,oe=re?M:e,he=re?e:M,Ee=re?P:e,ke=re?e:P;a|=re?ee:ce,a&=~(re?ce:ee),a&Z||(a&=~(B|U));var ct=[s,a,R,Ee,oe,ke,he,L,F,te],Pe=h.apply(e,ct);return S0(s)&&x_(Pe,ct),Pe.placeholder=y,b_(Pe,s,a)}function v0(s){var a=Hr[s];return function(h,y){if(h=un(h),y=y==null?0:oi(at(y),292),y&&bb(h)){var R=(Tt(h)+"e").split("e"),P=a(R[0]+"e"+(+R[1]+y));return R=(Tt(P)+"e").split("e"),+(R[0]+"e"+(+R[1]-y))}return a(h)}}var ZA=Ic&&1/Nl(new Ic([,-0]))[1]==x?function(s){return new Ic(s)}:D0;function o_(s){return function(a){var h=ci(a);return h==st?Kd(a):h==vt?hR(a):sR(a,s(a))}}function Us(s,a,h,y,R,P,M,L){var F=a&U;if(!F&&typeof s!="function")throw new nn(n);var te=y?y.length:0;if(te||(a&=~(ee|ce),y=R=e),M=M===e?M:zr(at(M),0),L=L===e?L:at(L),te-=R?R.length:0,a&ce){var re=y,oe=R;y=R=e}var he=F?e:b0(s),Ee=[s,a,h,y,R,re,oe,P,M,L];if(he&&l6(Ee,he),s=Ee[0],a=Ee[1],h=Ee[2],y=Ee[3],R=Ee[4],L=Ee[9]=Ee[9]===e?F?0:s.length:zr(Ee[9]-te,0),!L&&a&($|H)&&(a&=~($|H)),!a||a==B)var ke=GA(s,a,h);else a==$||a==H?ke=$A(s,a,L):(a==ee||a==(B|ee))&&!R.length?ke=YA(s,a,h,y):ke=ep.apply(e,Ee);var ct=he?Hb:x_;return b_(ct(ke,Ee),s,a)}function c_(s,a,h,y){return s===e||Tn(s,Ec[h])&&!Ot.call(y,h)?a:s}function u_(s,a,h,y,R,P){return gr(s)&&gr(a)&&(P.set(a,s),Zl(s,a,e,u_,P),P.delete(a)),s}function XA(s){return $u(s)?e:s}function f_(s,a,h,y,R,P){var M=h&N,L=s.length,F=a.length;if(L!=F&&!(M&&F>L))return!1;var te=P.get(s),re=P.get(a);if(te&&re)return te==a&&re==s;var oe=-1,he=!0,Ee=h&C?new bo:e;for(P.set(s,a),P.set(a,s);++oe<L;){var ke=s[oe],ct=a[oe];if(y)var Pe=M?y(ct,ke,oe,a,s,P):y(ke,ct,oe,s,a,P);if(Pe!==e){if(Pe)continue;he=!1;break}if(Ee){if(!Fd(a,function(pt,gt){if(!Mu(Ee,gt)&&(ke===pt||R(ke,pt,h,y,P)))return Ee.push(gt)})){he=!1;break}}else if(!(ke===ct||R(ke,ct,h,y,P))){he=!1;break}}return P.delete(s),P.delete(a),he}function JA(s,a,h,y,R,P,M){switch(h){case Be:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case At:return!(s.byteLength!=a.byteLength||!P(new Dl(s),new Dl(a)));case pe:case ye:case et:return Tn(+s,+a);case ht:return s.name==a.name&&s.message==a.message;case Rt:case Me:return s==a+"";case st:var L=Kd;case vt:var F=y&N;if(L||(L=Nl),s.size!=a.size&&!F)return!1;var te=M.get(s);if(te)return te==a;y|=C,M.set(s,a);var re=f_(L(s),L(a),y,R,P,M);return M.delete(s),re;case Pt:if(qu)return qu.call(s)==qu.call(a)}return!1}function QA(s,a,h,y,R,P){var M=h&N,L=g0(s),F=L.length,te=g0(a),re=te.length;if(F!=re&&!M)return!1;for(var oe=F;oe--;){var he=L[oe];if(!(M?he in a:Ot.call(a,he)))return!1}var Ee=P.get(s),ke=P.get(a);if(Ee&&ke)return Ee==a&&ke==s;var ct=!0;P.set(s,a),P.set(a,s);for(var Pe=M;++oe<F;){he=L[oe];var pt=s[he],gt=a[he];if(y)var zi=M?y(gt,pt,he,a,s,P):y(pt,gt,he,s,a,P);if(!(zi===e?pt===gt||R(pt,gt,h,y,P):zi)){ct=!1;break}Pe||(Pe=he=="constructor")}if(ct&&!Pe){var xi=s.constructor,Vi=a.constructor;xi!=Vi&&"constructor"in s&&"constructor"in a&&!(typeof xi=="function"&&xi instanceof xi&&typeof Vi=="function"&&Vi instanceof Vi)&&(ct=!1)}return P.delete(s),P.delete(a),ct}function Ds(s){return I0(v_(s,e,I_),s+"")}function g0(s){return kb(s,Yr,y0)}function x0(s){return kb(s,Ii,l_)}var b0=jl?function(s){return jl.get(s)}:D0;function np(s){for(var a=s.name+"",h=Tc[a],y=Ot.call(Tc,a)?h.length:0;y--;){var R=h[y],P=R.func;if(P==null||P==s)return R.name}return a}function kc(s){var a=Ot.call(k,"placeholder")?k:s;return a.placeholder}function Oe(){var s=k.iteratee||L0;return s=s===L0?Bb:s,arguments.length?s(arguments[0],arguments[1]):s}function sp(s,a){var h=s.__data__;return o6(a)?h[typeof a=="string"?"string":"hash"]:h.map}function _0(s){for(var a=Yr(s),h=a.length;h--;){var y=a[h],R=s[y];a[h]=[y,R,d_(R)]}return a}function wo(s,a){var h=fR(s,a);return Nb(h)?h:e}function e6(s){var a=Ot.call(s,go),h=s[go];try{s[go]=e;var y=!0}catch{}var R=Ll.call(s);return y&&(a?s[go]=h:delete s[go]),R}var y0=$d?function(s){return s==null?[]:(s=zt(s),ba($d(s),function(a){return gb.call(s,a)}))}:q0,l_=$d?function(s){for(var a=[];s;)_a(a,y0(s)),s=ql(s);return a}:q0,ci=vi;(Yd&&ci(new Yd(new ArrayBuffer(1)))!=Be||Lu&&ci(new Lu)!=st||Zd&&ci(Zd.resolve())!=jt||Ic&&ci(new Ic)!=vt||Uu&&ci(new Uu)!=Ce)&&(ci=function(s){var a=vi(s),h=a==Te?s.constructor:e,y=h?So(h):"";if(y)switch(y){case LR:return Be;case UR:return st;case DR:return jt;case qR:return vt;case FR:return Ce}return a});function t6(s,a,h){for(var y=-1,R=h.length;++y<R;){var P=h[y],M=P.size;switch(P.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=oi(a,s+M);break;case"takeRight":s=zr(s,a-M);break}}return{start:s,end:a}}function r6(s){var a=s.match(cr);return a?a[1].split(ur):[]}function p_(s,a,h){a=Ta(a,s);for(var y=-1,R=a.length,P=!1;++y<R;){var M=ts(a[y]);if(!(P=s!=null&&h(s,M)))break;s=s[M]}return P||++y!=R?P:(R=s==null?0:s.length,!!R&&pp(R)&&qs(M,R)&&(Je(s)||Eo(s)))}function i6(s){var a=s.length,h=new s.constructor(a);return a&&typeof s[0]=="string"&&Ot.call(s,"index")&&(h.index=s.index,h.input=s.input),h}function h_(s){return typeof s.constructor=="function"&&!Ku(s)?Rc(ql(s)):{}}function n6(s,a,h){var y=s.constructor;switch(a){case At:return d0(s);case pe:case ye:return new y(+s);case Be:return HA(s,h);case Bt:case Mt:case Ue:case Ct:case Lt:case De:case Ut:case Dt:case qe:return Yb(s,h);case st:return new y;case et:case Me:return new y(s);case Rt:return zA(s);case vt:return new y;case Pt:return VA(s)}}function s6(s,a){var h=a.length;if(!h)return s;var y=h-1;return a[y]=(h>1?"& ":"")+a[y],a=a.join(h>2?", ":" "),s.replace(Ye,`{
8
+ `+r)}function Go(e,t,r,i,n){if(e.listenerCount("wsClientError")){let o=new Error(n);Error.captureStackTrace(o,Go),e.emit("wsClientError",o,r,t)}else $f(r,i,n)}});var Vw=X((MY,Q9)=>{Q9.exports={name:"bitcore-lib",version:"10.7.0",description:"A pure and powerful JavaScript Bitcoin library.",author:"BitPay <dev@bitpay.com>",main:"index.js",scripts:{test:"gulp test","test:ci":"npm run test",coverage:"gulp coverage",build:"gulp",pub:"npm run build && npm publish"},keywords:["bitcoin","transaction","address","p2p","ecies","cryptocurrency","blockchain","payment","bip21","bip32","bip37","bip69","bip70","multisig"],repository:{type:"git",url:"https://github.com/bitpay/bitcore/tree/master/packages/bitcore-lib"},browser:{request:"browser-request"},dependencies:{bech32:"=2.0.0","bn.js":"=4.11.8",bs58:"^4.0.1","buffer-compare":"=1.1.1",elliptic:"^6.5.3",inherits:"=2.0.1",lodash:"^4.17.20"},devDependencies:{"bitcore-build":"^10.5.3",brfs:"^2.0.1",chai:"^4.2.0",gulp:"^4.0.0",sinon:"^7.1.1"},license:"MIT",gitHead:"f1efdbe2e7b17e22c586145c450d75ea94497591"}});var zv=X((jw,Hv)=>{(function(e,t){"use strict";function r(E,f){if(!E)throw new Error(f||"Assertion failed")}function i(E,f){E.super_=f;var c=function(){};c.prototype=f.prototype,E.prototype=new c,E.prototype.constructor=E}function n(E,f,c){if(n.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((f==="le"||f==="be")&&(c=f,f=10),this._init(E||0,f||10,c||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{o=require("buffer").Buffer}catch{}n.isBN=function(f){return f instanceof n?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===n.wordSize&&Array.isArray(f.words)},n.max=function(f,c){return f.cmp(c)>0?f:c},n.min=function(f,c){return f.cmp(c)<0?f:c},n.prototype._init=function(f,c,p){if(typeof f=="number")return this._initNumber(f,c,p);if(typeof f=="object")return this._initArray(f,c,p);c==="hex"&&(c=16),r(c===(c|0)&&c>=2&&c<=36),f=f.toString().replace(/\s+/g,"");var v=0;f[0]==="-"&&v++,c===16?this._parseHex(f,v):this._parseBase(f,c,v),f[0]==="-"&&(this.negative=1),this.strip(),p==="le"&&this._initArray(this.toArray(),c,p)},n.prototype._initNumber=function(f,c,p){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),c,p)},n.prototype._initArray=function(f,c,p){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var g,x,S=0;if(p==="be")for(v=f.length-1,g=0;v>=0;v-=3)x=f[v]|f[v-1]<<8|f[v-2]<<16,this.words[g]|=x<<S&67108863,this.words[g+1]=x>>>26-S&67108863,S+=24,S>=26&&(S-=26,g++);else if(p==="le")for(v=0,g=0;v<f.length;v+=3)x=f[v]|f[v+1]<<8|f[v+2]<<16,this.words[g]|=x<<S&67108863,this.words[g+1]=x>>>26-S&67108863,S+=24,S>=26&&(S-=26,g++);return this.strip()};function u(E,f,c){for(var p=0,v=Math.min(E.length,c),g=f;g<v;g++){var x=E.charCodeAt(g)-48;p<<=4,x>=49&&x<=54?p|=x-49+10:x>=17&&x<=22?p|=x-17+10:p|=x&15}return p}n.prototype._parseHex=function(f,c){this.length=Math.ceil((f.length-c)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var v,g,x=0;for(p=f.length-6,v=0;p>=c;p-=6)g=u(f,p,p+6),this.words[v]|=g<<x&67108863,this.words[v+1]|=g>>>26-x&4194303,x+=24,x>=26&&(x-=26,v++);p+6!==c&&(g=u(f,c,p+6),this.words[v]|=g<<x&67108863,this.words[v+1]|=g>>>26-x&4194303),this.strip()};function m(E,f,c,p){for(var v=0,g=Math.min(E.length,c),x=f;x<g;x++){var S=E.charCodeAt(x)-48;v*=p,S>=49?v+=S-49+10:S>=17?v+=S-17+10:v+=S}return v}n.prototype._parseBase=function(f,c,p){this.words=[0],this.length=1;for(var v=0,g=1;g<=67108863;g*=c)v++;v--,g=g/c|0;for(var x=f.length-p,S=x%v,b=Math.min(x,x-S)+p,l=0,d=p;d<b;d+=v)l=m(f,d,d+v,c),this.imuln(g),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(S!==0){var A=1;for(l=m(f,d,f.length,c),d=0;d<S;d++)A*=c;this.imuln(A),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}},n.prototype.copy=function(f){f.words=new Array(this.length);for(var c=0;c<this.length;c++)f.words[c]=this.words[c];f.length=this.length,f.negative=this.negative,f.red=this.red},n.prototype.clone=function(){var f=new n(null);return this.copy(f),f},n.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(f,c){f=f||10,c=c|0||1;var p;if(f===16||f==="hex"){p="";for(var v=0,g=0,x=0;x<this.length;x++){var S=this.words[x],b=((S<<v|g)&16777215).toString(16);g=S>>>24-v&16777215,g!==0||x!==this.length-1?p=_[6-b.length]+b+p:p=b+p,v+=2,v>=26&&(v-=26,x--)}for(g!==0&&(p=g.toString(16)+p);p.length%c!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(f===(f|0)&&f>=2&&f<=36){var l=w[f],d=I[f];p="";var A=this.clone();for(A.negative=0;!A.isZero();){var D=A.modn(d).toString(f);A=A.idivn(d),A.isZero()?p=D+p:p=_[l-D.length]+D+p}for(this.isZero()&&(p="0"+p);p.length%c!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(f,c){return r(typeof o<"u"),this.toArrayLike(o,f,c)},n.prototype.toArray=function(f,c){return this.toArrayLike(Array,f,c)},n.prototype.toArrayLike=function(f,c,p){var v=this.byteLength(),g=p||Math.max(1,v);r(v<=g,"byte array longer than desired length"),r(g>0,"Requested array length <= 0"),this.strip();var x=c==="le",S=new f(g),b,l,d=this.clone();if(x){for(l=0;!d.isZero();l++)b=d.andln(255),d.iushrn(8),S[l]=b;for(;l<g;l++)S[l]=0}else{for(l=0;l<g-v;l++)S[l]=0;for(l=0;!d.isZero();l++)b=d.andln(255),d.iushrn(8),S[g-l-1]=b}return S},Math.clz32?n.prototype._countBits=function(f){return 32-Math.clz32(f)}:n.prototype._countBits=function(f){var c=f,p=0;return c>=4096&&(p+=13,c>>>=13),c>=64&&(p+=7,c>>>=7),c>=8&&(p+=4,c>>>=4),c>=2&&(p+=2,c>>>=2),p+c},n.prototype._zeroBits=function(f){if(f===0)return 26;var c=f,p=0;return c&8191||(p+=13,c>>>=13),c&127||(p+=7,c>>>=7),c&15||(p+=4,c>>>=4),c&3||(p+=2,c>>>=2),c&1||p++,p},n.prototype.bitLength=function(){var f=this.words[this.length-1],c=this._countBits(f);return(this.length-1)*26+c};function T(E){for(var f=new Array(E.bitLength()),c=0;c<f.length;c++){var p=c/26|0,v=c%26;f[c]=(E.words[p]&1<<v)>>>v}return f}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,c=0;c<this.length;c++){var p=this._zeroBits(this.words[c]);if(f+=p,p!==26)break}return f},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},n.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var c=0;c<f.length;c++)this.words[c]=this.words[c]|f.words[c];return this.strip()},n.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},n.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},n.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},n.prototype.iuand=function(f){var c;this.length>f.length?c=f:c=this;for(var p=0;p<c.length;p++)this.words[p]=this.words[p]&f.words[p];return this.length=c.length,this.strip()},n.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},n.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},n.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},n.prototype.iuxor=function(f){var c,p;this.length>f.length?(c=this,p=f):(c=f,p=this);for(var v=0;v<p.length;v++)this.words[v]=c.words[v]^p.words[v];if(this!==c)for(;v<c.length;v++)this.words[v]=c.words[v];return this.length=c.length,this.strip()},n.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},n.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},n.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},n.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var c=Math.ceil(f/26)|0,p=f%26;this._expand(c),p>0&&c--;for(var v=0;v<c;v++)this.words[v]=~this.words[v]&67108863;return p>0&&(this.words[v]=~this.words[v]&67108863>>26-p),this.strip()},n.prototype.notn=function(f){return this.clone().inotn(f)},n.prototype.setn=function(f,c){r(typeof f=="number"&&f>=0);var p=f/26|0,v=f%26;return this._expand(p+1),c?this.words[p]=this.words[p]|1<<v:this.words[p]=this.words[p]&~(1<<v),this.strip()},n.prototype.iadd=function(f){var c;if(this.negative!==0&&f.negative===0)return this.negative=0,c=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,c=this.isub(f),f.negative=1,c._normSign();var p,v;this.length>f.length?(p=this,v=f):(p=f,v=this);for(var g=0,x=0;x<v.length;x++)c=(p.words[x]|0)+(v.words[x]|0)+g,this.words[x]=c&67108863,g=c>>>26;for(;g!==0&&x<p.length;x++)c=(p.words[x]|0)+g,this.words[x]=c&67108863,g=c>>>26;if(this.length=p.length,g!==0)this.words[this.length]=g,this.length++;else if(p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this},n.prototype.add=function(f){var c;return f.negative!==0&&this.negative===0?(f.negative=0,c=this.sub(f),f.negative^=1,c):f.negative===0&&this.negative!==0?(this.negative=0,c=f.sub(this),this.negative=1,c):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},n.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var c=this.iadd(f);return f.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var p=this.cmp(f);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,g;p>0?(v=this,g=f):(v=f,g=this);for(var x=0,S=0;S<g.length;S++)c=(v.words[S]|0)-(g.words[S]|0)+x,x=c>>26,this.words[S]=c&67108863;for(;x!==0&&S<v.length;S++)c=(v.words[S]|0)+x,x=c>>26,this.words[S]=c&67108863;if(x===0&&S<v.length&&v!==this)for(;S<v.length;S++)this.words[S]=v.words[S];return this.length=Math.max(this.length,S),v!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(f){return this.clone().isub(f)};function N(E,f,c){c.negative=f.negative^E.negative;var p=E.length+f.length|0;c.length=p,p=p-1|0;var v=E.words[0]|0,g=f.words[0]|0,x=v*g,S=x&67108863,b=x/67108864|0;c.words[0]=S;for(var l=1;l<p;l++){for(var d=b>>>26,A=b&67108863,D=Math.min(l,f.length-1),V=Math.max(0,l-E.length+1);V<=D;V++){var Y=l-V|0;v=E.words[Y]|0,g=f.words[V]|0,x=v*g+A,d+=x/67108864|0,A=x&67108863}c.words[l]=A|0,b=d|0}return b!==0?c.words[l]=b|0:c.length--,c.strip()}var C=function(f,c,p){var v=f.words,g=c.words,x=p.words,S=0,b,l,d,A=v[0]|0,D=A&8191,V=A>>>13,Y=v[1]|0,se=Y&8191,ae=Y>>>13,pe=v[2]|0,ye=pe&8191,de=pe>>>13,ht=v[3]|0,wt=ht&8191,Re=ht>>>13,st=v[4]|0,et=st&8191,Ie=st>>>13,Te=v[5]|0,jt=Te&8191,Ve=Te>>>13,Rt=v[6]|0,vt=Rt&8191,Me=Rt>>>13,Pt=v[7]|0,Qt=Pt&8191,Ce=Pt>>>13,er=v[8]|0,At=er&8191,Be=er>>>13,Bt=v[9]|0,Mt=Bt&8191,Ue=Bt>>>13,Ct=g[0]|0,Lt=Ct&8191,De=Ct>>>13,Ut=g[1]|0,Dt=Ut&8191,qe=Ut>>>13,tr=g[2]|0,rr=tr&8191,je=tr>>>13,Wt=g[3]|0,Kt=Wt&8191,We=Wt>>>13,ir=g[4]|0,nr=ir&8191,Ke=ir>>>13,Gt=g[5]|0,sr=Gt&8191,Ge=Gt>>>13,ar=g[6]|0,qt=ar&8191,$e=ar>>>13,Ft=g[7]|0,or=Ft&8191,Ye=Ft>>>13,cr=g[8]|0,ur=cr&8191,Ze=cr>>>13,fr=g[9]|0,lr=fr&8191,Xe=fr>>>13;p.negative=f.negative^c.negative,p.length=19,b=Math.imul(D,Lt),l=Math.imul(D,De),l=l+Math.imul(V,Lt)|0,d=Math.imul(V,De);var Ht=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,b=Math.imul(se,Lt),l=Math.imul(se,De),l=l+Math.imul(ae,Lt)|0,d=Math.imul(ae,De),b=b+Math.imul(D,Dt)|0,l=l+Math.imul(D,qe)|0,l=l+Math.imul(V,Dt)|0,d=d+Math.imul(V,qe)|0;var ys=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(ys>>>26)|0,ys&=67108863,b=Math.imul(ye,Lt),l=Math.imul(ye,De),l=l+Math.imul(de,Lt)|0,d=Math.imul(de,De),b=b+Math.imul(se,Dt)|0,l=l+Math.imul(se,qe)|0,l=l+Math.imul(ae,Dt)|0,d=d+Math.imul(ae,qe)|0,b=b+Math.imul(D,rr)|0,l=l+Math.imul(D,je)|0,l=l+Math.imul(V,rr)|0,d=d+Math.imul(V,je)|0;var ws=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(ws>>>26)|0,ws&=67108863,b=Math.imul(wt,Lt),l=Math.imul(wt,De),l=l+Math.imul(Re,Lt)|0,d=Math.imul(Re,De),b=b+Math.imul(ye,Dt)|0,l=l+Math.imul(ye,qe)|0,l=l+Math.imul(de,Dt)|0,d=d+Math.imul(de,qe)|0,b=b+Math.imul(se,rr)|0,l=l+Math.imul(se,je)|0,l=l+Math.imul(ae,rr)|0,d=d+Math.imul(ae,je)|0,b=b+Math.imul(D,Kt)|0,l=l+Math.imul(D,We)|0,l=l+Math.imul(V,Kt)|0,d=d+Math.imul(V,We)|0;var Ss=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,b=Math.imul(et,Lt),l=Math.imul(et,De),l=l+Math.imul(Ie,Lt)|0,d=Math.imul(Ie,De),b=b+Math.imul(wt,Dt)|0,l=l+Math.imul(wt,qe)|0,l=l+Math.imul(Re,Dt)|0,d=d+Math.imul(Re,qe)|0,b=b+Math.imul(ye,rr)|0,l=l+Math.imul(ye,je)|0,l=l+Math.imul(de,rr)|0,d=d+Math.imul(de,je)|0,b=b+Math.imul(se,Kt)|0,l=l+Math.imul(se,We)|0,l=l+Math.imul(ae,Kt)|0,d=d+Math.imul(ae,We)|0,b=b+Math.imul(D,nr)|0,l=l+Math.imul(D,Ke)|0,l=l+Math.imul(V,nr)|0,d=d+Math.imul(V,Ke)|0;var Es=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Es>>>26)|0,Es&=67108863,b=Math.imul(jt,Lt),l=Math.imul(jt,De),l=l+Math.imul(Ve,Lt)|0,d=Math.imul(Ve,De),b=b+Math.imul(et,Dt)|0,l=l+Math.imul(et,qe)|0,l=l+Math.imul(Ie,Dt)|0,d=d+Math.imul(Ie,qe)|0,b=b+Math.imul(wt,rr)|0,l=l+Math.imul(wt,je)|0,l=l+Math.imul(Re,rr)|0,d=d+Math.imul(Re,je)|0,b=b+Math.imul(ye,Kt)|0,l=l+Math.imul(ye,We)|0,l=l+Math.imul(de,Kt)|0,d=d+Math.imul(de,We)|0,b=b+Math.imul(se,nr)|0,l=l+Math.imul(se,Ke)|0,l=l+Math.imul(ae,nr)|0,d=d+Math.imul(ae,Ke)|0,b=b+Math.imul(D,sr)|0,l=l+Math.imul(D,Ge)|0,l=l+Math.imul(V,sr)|0,d=d+Math.imul(V,Ge)|0;var Is=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Is>>>26)|0,Is&=67108863,b=Math.imul(vt,Lt),l=Math.imul(vt,De),l=l+Math.imul(Me,Lt)|0,d=Math.imul(Me,De),b=b+Math.imul(jt,Dt)|0,l=l+Math.imul(jt,qe)|0,l=l+Math.imul(Ve,Dt)|0,d=d+Math.imul(Ve,qe)|0,b=b+Math.imul(et,rr)|0,l=l+Math.imul(et,je)|0,l=l+Math.imul(Ie,rr)|0,d=d+Math.imul(Ie,je)|0,b=b+Math.imul(wt,Kt)|0,l=l+Math.imul(wt,We)|0,l=l+Math.imul(Re,Kt)|0,d=d+Math.imul(Re,We)|0,b=b+Math.imul(ye,nr)|0,l=l+Math.imul(ye,Ke)|0,l=l+Math.imul(de,nr)|0,d=d+Math.imul(de,Ke)|0,b=b+Math.imul(se,sr)|0,l=l+Math.imul(se,Ge)|0,l=l+Math.imul(ae,sr)|0,d=d+Math.imul(ae,Ge)|0,b=b+Math.imul(D,qt)|0,l=l+Math.imul(D,$e)|0,l=l+Math.imul(V,qt)|0,d=d+Math.imul(V,$e)|0;var Ts=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,b=Math.imul(Qt,Lt),l=Math.imul(Qt,De),l=l+Math.imul(Ce,Lt)|0,d=Math.imul(Ce,De),b=b+Math.imul(vt,Dt)|0,l=l+Math.imul(vt,qe)|0,l=l+Math.imul(Me,Dt)|0,d=d+Math.imul(Me,qe)|0,b=b+Math.imul(jt,rr)|0,l=l+Math.imul(jt,je)|0,l=l+Math.imul(Ve,rr)|0,d=d+Math.imul(Ve,je)|0,b=b+Math.imul(et,Kt)|0,l=l+Math.imul(et,We)|0,l=l+Math.imul(Ie,Kt)|0,d=d+Math.imul(Ie,We)|0,b=b+Math.imul(wt,nr)|0,l=l+Math.imul(wt,Ke)|0,l=l+Math.imul(Re,nr)|0,d=d+Math.imul(Re,Ke)|0,b=b+Math.imul(ye,sr)|0,l=l+Math.imul(ye,Ge)|0,l=l+Math.imul(de,sr)|0,d=d+Math.imul(de,Ge)|0,b=b+Math.imul(se,qt)|0,l=l+Math.imul(se,$e)|0,l=l+Math.imul(ae,qt)|0,d=d+Math.imul(ae,$e)|0,b=b+Math.imul(D,or)|0,l=l+Math.imul(D,Ye)|0,l=l+Math.imul(V,or)|0,d=d+Math.imul(V,Ye)|0;var Qi=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,b=Math.imul(At,Lt),l=Math.imul(At,De),l=l+Math.imul(Be,Lt)|0,d=Math.imul(Be,De),b=b+Math.imul(Qt,Dt)|0,l=l+Math.imul(Qt,qe)|0,l=l+Math.imul(Ce,Dt)|0,d=d+Math.imul(Ce,qe)|0,b=b+Math.imul(vt,rr)|0,l=l+Math.imul(vt,je)|0,l=l+Math.imul(Me,rr)|0,d=d+Math.imul(Me,je)|0,b=b+Math.imul(jt,Kt)|0,l=l+Math.imul(jt,We)|0,l=l+Math.imul(Ve,Kt)|0,d=d+Math.imul(Ve,We)|0,b=b+Math.imul(et,nr)|0,l=l+Math.imul(et,Ke)|0,l=l+Math.imul(Ie,nr)|0,d=d+Math.imul(Ie,Ke)|0,b=b+Math.imul(wt,sr)|0,l=l+Math.imul(wt,Ge)|0,l=l+Math.imul(Re,sr)|0,d=d+Math.imul(Re,Ge)|0,b=b+Math.imul(ye,qt)|0,l=l+Math.imul(ye,$e)|0,l=l+Math.imul(de,qt)|0,d=d+Math.imul(de,$e)|0,b=b+Math.imul(se,or)|0,l=l+Math.imul(se,Ye)|0,l=l+Math.imul(ae,or)|0,d=d+Math.imul(ae,Ye)|0,b=b+Math.imul(D,ur)|0,l=l+Math.imul(D,Ze)|0,l=l+Math.imul(V,ur)|0,d=d+Math.imul(V,Ze)|0;var Rs=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,b=Math.imul(Mt,Lt),l=Math.imul(Mt,De),l=l+Math.imul(Ue,Lt)|0,d=Math.imul(Ue,De),b=b+Math.imul(At,Dt)|0,l=l+Math.imul(At,qe)|0,l=l+Math.imul(Be,Dt)|0,d=d+Math.imul(Be,qe)|0,b=b+Math.imul(Qt,rr)|0,l=l+Math.imul(Qt,je)|0,l=l+Math.imul(Ce,rr)|0,d=d+Math.imul(Ce,je)|0,b=b+Math.imul(vt,Kt)|0,l=l+Math.imul(vt,We)|0,l=l+Math.imul(Me,Kt)|0,d=d+Math.imul(Me,We)|0,b=b+Math.imul(jt,nr)|0,l=l+Math.imul(jt,Ke)|0,l=l+Math.imul(Ve,nr)|0,d=d+Math.imul(Ve,Ke)|0,b=b+Math.imul(et,sr)|0,l=l+Math.imul(et,Ge)|0,l=l+Math.imul(Ie,sr)|0,d=d+Math.imul(Ie,Ge)|0,b=b+Math.imul(wt,qt)|0,l=l+Math.imul(wt,$e)|0,l=l+Math.imul(Re,qt)|0,d=d+Math.imul(Re,$e)|0,b=b+Math.imul(ye,or)|0,l=l+Math.imul(ye,Ye)|0,l=l+Math.imul(de,or)|0,d=d+Math.imul(de,Ye)|0,b=b+Math.imul(se,ur)|0,l=l+Math.imul(se,Ze)|0,l=l+Math.imul(ae,ur)|0,d=d+Math.imul(ae,Ze)|0,b=b+Math.imul(D,lr)|0,l=l+Math.imul(D,Xe)|0,l=l+Math.imul(V,lr)|0,d=d+Math.imul(V,Xe)|0;var en=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(en>>>26)|0,en&=67108863,b=Math.imul(Mt,Dt),l=Math.imul(Mt,qe),l=l+Math.imul(Ue,Dt)|0,d=Math.imul(Ue,qe),b=b+Math.imul(At,rr)|0,l=l+Math.imul(At,je)|0,l=l+Math.imul(Be,rr)|0,d=d+Math.imul(Be,je)|0,b=b+Math.imul(Qt,Kt)|0,l=l+Math.imul(Qt,We)|0,l=l+Math.imul(Ce,Kt)|0,d=d+Math.imul(Ce,We)|0,b=b+Math.imul(vt,nr)|0,l=l+Math.imul(vt,Ke)|0,l=l+Math.imul(Me,nr)|0,d=d+Math.imul(Me,Ke)|0,b=b+Math.imul(jt,sr)|0,l=l+Math.imul(jt,Ge)|0,l=l+Math.imul(Ve,sr)|0,d=d+Math.imul(Ve,Ge)|0,b=b+Math.imul(et,qt)|0,l=l+Math.imul(et,$e)|0,l=l+Math.imul(Ie,qt)|0,d=d+Math.imul(Ie,$e)|0,b=b+Math.imul(wt,or)|0,l=l+Math.imul(wt,Ye)|0,l=l+Math.imul(Re,or)|0,d=d+Math.imul(Re,Ye)|0,b=b+Math.imul(ye,ur)|0,l=l+Math.imul(ye,Ze)|0,l=l+Math.imul(de,ur)|0,d=d+Math.imul(de,Ze)|0,b=b+Math.imul(se,lr)|0,l=l+Math.imul(se,Xe)|0,l=l+Math.imul(ae,lr)|0,d=d+Math.imul(ae,Xe)|0;var As=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(As>>>26)|0,As&=67108863,b=Math.imul(Mt,rr),l=Math.imul(Mt,je),l=l+Math.imul(Ue,rr)|0,d=Math.imul(Ue,je),b=b+Math.imul(At,Kt)|0,l=l+Math.imul(At,We)|0,l=l+Math.imul(Be,Kt)|0,d=d+Math.imul(Be,We)|0,b=b+Math.imul(Qt,nr)|0,l=l+Math.imul(Qt,Ke)|0,l=l+Math.imul(Ce,nr)|0,d=d+Math.imul(Ce,Ke)|0,b=b+Math.imul(vt,sr)|0,l=l+Math.imul(vt,Ge)|0,l=l+Math.imul(Me,sr)|0,d=d+Math.imul(Me,Ge)|0,b=b+Math.imul(jt,qt)|0,l=l+Math.imul(jt,$e)|0,l=l+Math.imul(Ve,qt)|0,d=d+Math.imul(Ve,$e)|0,b=b+Math.imul(et,or)|0,l=l+Math.imul(et,Ye)|0,l=l+Math.imul(Ie,or)|0,d=d+Math.imul(Ie,Ye)|0,b=b+Math.imul(wt,ur)|0,l=l+Math.imul(wt,Ze)|0,l=l+Math.imul(Re,ur)|0,d=d+Math.imul(Re,Ze)|0,b=b+Math.imul(ye,lr)|0,l=l+Math.imul(ye,Xe)|0,l=l+Math.imul(de,lr)|0,d=d+Math.imul(de,Xe)|0;var Os=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Os>>>26)|0,Os&=67108863,b=Math.imul(Mt,Kt),l=Math.imul(Mt,We),l=l+Math.imul(Ue,Kt)|0,d=Math.imul(Ue,We),b=b+Math.imul(At,nr)|0,l=l+Math.imul(At,Ke)|0,l=l+Math.imul(Be,nr)|0,d=d+Math.imul(Be,Ke)|0,b=b+Math.imul(Qt,sr)|0,l=l+Math.imul(Qt,Ge)|0,l=l+Math.imul(Ce,sr)|0,d=d+Math.imul(Ce,Ge)|0,b=b+Math.imul(vt,qt)|0,l=l+Math.imul(vt,$e)|0,l=l+Math.imul(Me,qt)|0,d=d+Math.imul(Me,$e)|0,b=b+Math.imul(jt,or)|0,l=l+Math.imul(jt,Ye)|0,l=l+Math.imul(Ve,or)|0,d=d+Math.imul(Ve,Ye)|0,b=b+Math.imul(et,ur)|0,l=l+Math.imul(et,Ze)|0,l=l+Math.imul(Ie,ur)|0,d=d+Math.imul(Ie,Ze)|0,b=b+Math.imul(wt,lr)|0,l=l+Math.imul(wt,Xe)|0,l=l+Math.imul(Re,lr)|0,d=d+Math.imul(Re,Xe)|0;var ks=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(ks>>>26)|0,ks&=67108863,b=Math.imul(Mt,nr),l=Math.imul(Mt,Ke),l=l+Math.imul(Ue,nr)|0,d=Math.imul(Ue,Ke),b=b+Math.imul(At,sr)|0,l=l+Math.imul(At,Ge)|0,l=l+Math.imul(Be,sr)|0,d=d+Math.imul(Be,Ge)|0,b=b+Math.imul(Qt,qt)|0,l=l+Math.imul(Qt,$e)|0,l=l+Math.imul(Ce,qt)|0,d=d+Math.imul(Ce,$e)|0,b=b+Math.imul(vt,or)|0,l=l+Math.imul(vt,Ye)|0,l=l+Math.imul(Me,or)|0,d=d+Math.imul(Me,Ye)|0,b=b+Math.imul(jt,ur)|0,l=l+Math.imul(jt,Ze)|0,l=l+Math.imul(Ve,ur)|0,d=d+Math.imul(Ve,Ze)|0,b=b+Math.imul(et,lr)|0,l=l+Math.imul(et,Xe)|0,l=l+Math.imul(Ie,lr)|0,d=d+Math.imul(Ie,Xe)|0;var Xn=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,b=Math.imul(Mt,sr),l=Math.imul(Mt,Ge),l=l+Math.imul(Ue,sr)|0,d=Math.imul(Ue,Ge),b=b+Math.imul(At,qt)|0,l=l+Math.imul(At,$e)|0,l=l+Math.imul(Be,qt)|0,d=d+Math.imul(Be,$e)|0,b=b+Math.imul(Qt,or)|0,l=l+Math.imul(Qt,Ye)|0,l=l+Math.imul(Ce,or)|0,d=d+Math.imul(Ce,Ye)|0,b=b+Math.imul(vt,ur)|0,l=l+Math.imul(vt,Ze)|0,l=l+Math.imul(Me,ur)|0,d=d+Math.imul(Me,Ze)|0,b=b+Math.imul(jt,lr)|0,l=l+Math.imul(jt,Xe)|0,l=l+Math.imul(Ve,lr)|0,d=d+Math.imul(Ve,Xe)|0;var Jn=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,b=Math.imul(Mt,qt),l=Math.imul(Mt,$e),l=l+Math.imul(Ue,qt)|0,d=Math.imul(Ue,$e),b=b+Math.imul(At,or)|0,l=l+Math.imul(At,Ye)|0,l=l+Math.imul(Be,or)|0,d=d+Math.imul(Be,Ye)|0,b=b+Math.imul(Qt,ur)|0,l=l+Math.imul(Qt,Ze)|0,l=l+Math.imul(Ce,ur)|0,d=d+Math.imul(Ce,Ze)|0,b=b+Math.imul(vt,lr)|0,l=l+Math.imul(vt,Xe)|0,l=l+Math.imul(Me,lr)|0,d=d+Math.imul(Me,Xe)|0;var Qn=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,b=Math.imul(Mt,or),l=Math.imul(Mt,Ye),l=l+Math.imul(Ue,or)|0,d=Math.imul(Ue,Ye),b=b+Math.imul(At,ur)|0,l=l+Math.imul(At,Ze)|0,l=l+Math.imul(Be,ur)|0,d=d+Math.imul(Be,Ze)|0,b=b+Math.imul(Qt,lr)|0,l=l+Math.imul(Qt,Xe)|0,l=l+Math.imul(Ce,lr)|0,d=d+Math.imul(Ce,Xe)|0;var Ps=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,b=Math.imul(Mt,ur),l=Math.imul(Mt,Ze),l=l+Math.imul(Ue,ur)|0,d=Math.imul(Ue,Ze),b=b+Math.imul(At,lr)|0,l=l+Math.imul(At,Xe)|0,l=l+Math.imul(Be,lr)|0,d=d+Math.imul(Be,Xe)|0;var Ns=(S+b|0)+((l&8191)<<13)|0;S=(d+(l>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,b=Math.imul(Mt,lr),l=Math.imul(Mt,Xe),l=l+Math.imul(Ue,lr)|0,d=Math.imul(Ue,Xe);var Bs=(S+b|0)+((l&8191)<<13)|0;return S=(d+(l>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,x[0]=Ht,x[1]=ys,x[2]=ws,x[3]=Ss,x[4]=Es,x[5]=Is,x[6]=Ts,x[7]=Qi,x[8]=Rs,x[9]=en,x[10]=As,x[11]=Os,x[12]=ks,x[13]=Xn,x[14]=Jn,x[15]=Qn,x[16]=Ps,x[17]=Ns,x[18]=Bs,S!==0&&(x[19]=S,p.length++),p};Math.imul||(C=N);function B(E,f,c){c.negative=f.negative^E.negative,c.length=E.length+f.length;for(var p=0,v=0,g=0;g<c.length-1;g++){var x=v;v=0;for(var S=p&67108863,b=Math.min(g,f.length-1),l=Math.max(0,g-E.length+1);l<=b;l++){var d=g-l,A=E.words[d]|0,D=f.words[l]|0,V=A*D,Y=V&67108863;x=x+(V/67108864|0)|0,Y=Y+S|0,S=Y&67108863,x=x+(Y>>>26)|0,v+=x>>>26,x&=67108863}c.words[g]=S,p=x,x=v}return p!==0?c.words[g]=p:c.length--,c.strip()}function U(E,f,c){var p=new Z;return p.mulp(E,f,c)}n.prototype.mulTo=function(f,c){var p,v=this.length+f.length;return this.length===10&&f.length===10?p=C(this,f,c):v<63?p=N(this,f,c):v<1024?p=B(this,f,c):p=U(this,f,c),p};function Z(E,f){this.x=E,this.y=f}Z.prototype.makeRBT=function(f){for(var c=new Array(f),p=n.prototype._countBits(f)-1,v=0;v<f;v++)c[v]=this.revBin(v,p,f);return c},Z.prototype.revBin=function(f,c,p){if(f===0||f===p-1)return f;for(var v=0,g=0;g<c;g++)v|=(f&1)<<c-g-1,f>>=1;return v},Z.prototype.permute=function(f,c,p,v,g,x){for(var S=0;S<x;S++)v[S]=c[f[S]],g[S]=p[f[S]]},Z.prototype.transform=function(f,c,p,v,g,x){this.permute(x,f,c,p,v,g);for(var S=1;S<g;S<<=1)for(var b=S<<1,l=Math.cos(2*Math.PI/b),d=Math.sin(2*Math.PI/b),A=0;A<g;A+=b)for(var D=l,V=d,Y=0;Y<S;Y++){var se=p[A+Y],ae=v[A+Y],pe=p[A+Y+S],ye=v[A+Y+S],de=D*pe-V*ye;ye=D*ye+V*pe,pe=de,p[A+Y]=se+pe,v[A+Y]=ae+ye,p[A+Y+S]=se-pe,v[A+Y+S]=ae-ye,Y!==b&&(de=l*D-d*V,V=l*V+d*D,D=de)}},Z.prototype.guessLen13b=function(f,c){var p=Math.max(c,f)|1,v=p&1,g=0;for(p=p/2|0;p;p=p>>>1)g++;return 1<<g+1+v},Z.prototype.conjugate=function(f,c,p){if(!(p<=1))for(var v=0;v<p/2;v++){var g=f[v];f[v]=f[p-v-1],f[p-v-1]=g,g=c[v],c[v]=-c[p-v-1],c[p-v-1]=-g}},Z.prototype.normalize13b=function(f,c){for(var p=0,v=0;v<c/2;v++){var g=Math.round(f[2*v+1]/c)*8192+Math.round(f[2*v]/c)+p;f[v]=g&67108863,g<67108864?p=0:p=g/67108864|0}return f},Z.prototype.convert13b=function(f,c,p,v){for(var g=0,x=0;x<c;x++)g=g+(f[x]|0),p[2*x]=g&8191,g=g>>>13,p[2*x+1]=g&8191,g=g>>>13;for(x=2*c;x<v;++x)p[x]=0;r(g===0),r((g&-8192)===0)},Z.prototype.stub=function(f){for(var c=new Array(f),p=0;p<f;p++)c[p]=0;return c},Z.prototype.mulp=function(f,c,p){var v=2*this.guessLen13b(f.length,c.length),g=this.makeRBT(v),x=this.stub(v),S=new Array(v),b=new Array(v),l=new Array(v),d=new Array(v),A=new Array(v),D=new Array(v),V=p.words;V.length=v,this.convert13b(f.words,f.length,S,v),this.convert13b(c.words,c.length,d,v),this.transform(S,x,b,l,v,g),this.transform(d,x,A,D,v,g);for(var Y=0;Y<v;Y++){var se=b[Y]*A[Y]-l[Y]*D[Y];l[Y]=b[Y]*D[Y]+l[Y]*A[Y],b[Y]=se}return this.conjugate(b,l,v),this.transform(b,l,V,x,v,g),this.conjugate(V,x,v),this.normalize13b(V,v),p.negative=f.negative^c.negative,p.length=f.length+c.length,p.strip()},n.prototype.mul=function(f){var c=new n(null);return c.words=new Array(this.length+f.length),this.mulTo(f,c)},n.prototype.mulf=function(f){var c=new n(null);return c.words=new Array(this.length+f.length),U(this,f,c)},n.prototype.imul=function(f){return this.clone().mulTo(f,this)},n.prototype.imuln=function(f){r(typeof f=="number"),r(f<67108864);for(var c=0,p=0;p<this.length;p++){var v=(this.words[p]|0)*f,g=(v&67108863)+(c&67108863);c>>=26,c+=v/67108864|0,c+=g>>>26,this.words[p]=g&67108863}return c!==0&&(this.words[p]=c,this.length++),this},n.prototype.muln=function(f){return this.clone().imuln(f)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(f){var c=T(f);if(c.length===0)return new n(1);for(var p=this,v=0;v<c.length&&c[v]===0;v++,p=p.sqr());if(++v<c.length)for(var g=p.sqr();v<c.length;v++,g=g.sqr())c[v]!==0&&(p=p.mul(g));return p},n.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var c=f%26,p=(f-c)/26,v=67108863>>>26-c<<26-c,g;if(c!==0){var x=0;for(g=0;g<this.length;g++){var S=this.words[g]&v,b=(this.words[g]|0)-S<<c;this.words[g]=b|x,x=S>>>26-c}x&&(this.words[g]=x,this.length++)}if(p!==0){for(g=this.length-1;g>=0;g--)this.words[g+p]=this.words[g];for(g=0;g<p;g++)this.words[g]=0;this.length+=p}return this.strip()},n.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},n.prototype.iushrn=function(f,c,p){r(typeof f=="number"&&f>=0);var v;c?v=(c-c%26)/26:v=0;var g=f%26,x=Math.min((f-g)/26,this.length),S=67108863^67108863>>>g<<g,b=p;if(v-=x,v=Math.max(0,v),b){for(var l=0;l<x;l++)b.words[l]=this.words[l];b.length=x}if(x!==0)if(this.length>x)for(this.length-=x,l=0;l<this.length;l++)this.words[l]=this.words[l+x];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(d!==0||l>=v);l--){var A=this.words[l]|0;this.words[l]=d<<26-g|A>>>g,d=A&S}return b&&d!==0&&(b.words[b.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(f,c,p){return r(this.negative===0),this.iushrn(f,c,p)},n.prototype.shln=function(f){return this.clone().ishln(f)},n.prototype.ushln=function(f){return this.clone().iushln(f)},n.prototype.shrn=function(f){return this.clone().ishrn(f)},n.prototype.ushrn=function(f){return this.clone().iushrn(f)},n.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var c=f%26,p=(f-c)/26,v=1<<c;if(this.length<=p)return!1;var g=this.words[p];return!!(g&v)},n.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var c=f%26,p=(f-c)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(c!==0&&p++,this.length=Math.min(p,this.length),c!==0){var v=67108863^67108863>>>c<<c;this.words[this.length-1]&=v}return this.strip()},n.prototype.maskn=function(f){return this.clone().imaskn(f)},n.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},n.prototype._iaddn=function(f){this.words[0]+=f;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)this.words[c]-=67108864,c===this.length-1?this.words[c+1]=1:this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},n.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},n.prototype.addn=function(f){return this.clone().iaddn(f)},n.prototype.subn=function(f){return this.clone().isubn(f)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(f,c,p){var v=f.length+p,g;this._expand(v);var x,S=0;for(g=0;g<f.length;g++){x=(this.words[g+p]|0)+S;var b=(f.words[g]|0)*c;x-=b&67108863,S=(x>>26)-(b/67108864|0),this.words[g+p]=x&67108863}for(;g<this.length-p;g++)x=(this.words[g+p]|0)+S,S=x>>26,this.words[g+p]=x&67108863;if(S===0)return this.strip();for(r(S===-1),S=0,g=0;g<this.length;g++)x=-(this.words[g]|0)+S,S=x>>26,this.words[g]=x&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(f,c){var p=this.length-f.length,v=this.clone(),g=f,x=g.words[g.length-1]|0,S=this._countBits(x);p=26-S,p!==0&&(g=g.ushln(p),v.iushln(p),x=g.words[g.length-1]|0);var b=v.length-g.length,l;if(c!=="mod"){l=new n(null),l.length=b+1,l.words=new Array(l.length);for(var d=0;d<l.length;d++)l.words[d]=0}var A=v.clone()._ishlnsubmul(g,1,b);A.negative===0&&(v=A,l&&(l.words[b]=1));for(var D=b-1;D>=0;D--){var V=(v.words[g.length+D]|0)*67108864+(v.words[g.length+D-1]|0);for(V=Math.min(V/x|0,67108863),v._ishlnsubmul(g,V,D);v.negative!==0;)V--,v.negative=0,v._ishlnsubmul(g,1,D),v.isZero()||(v.negative^=1);l&&(l.words[D]=V)}return l&&l.strip(),v.strip(),c!=="div"&&p!==0&&v.iushrn(p),{div:l||null,mod:v}},n.prototype.divmod=function(f,c,p){if(r(!f.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var v,g,x;return this.negative!==0&&f.negative===0?(x=this.neg().divmod(f,c),c!=="mod"&&(v=x.div.neg()),c!=="div"&&(g=x.mod.neg(),p&&g.negative!==0&&g.iadd(f)),{div:v,mod:g}):this.negative===0&&f.negative!==0?(x=this.divmod(f.neg(),c),c!=="mod"&&(v=x.div.neg()),{div:v,mod:x.mod}):this.negative&f.negative?(x=this.neg().divmod(f.neg(),c),c!=="div"&&(g=x.mod.neg(),p&&g.negative!==0&&g.isub(f)),{div:x.div,mod:g}):f.length>this.length||this.cmp(f)<0?{div:new n(0),mod:this}:f.length===1?c==="div"?{div:this.divn(f.words[0]),mod:null}:c==="mod"?{div:null,mod:new n(this.modn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new n(this.modn(f.words[0]))}:this._wordDiv(f,c)},n.prototype.div=function(f){return this.divmod(f,"div",!1).div},n.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},n.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},n.prototype.divRound=function(f){var c=this.divmod(f);if(c.mod.isZero())return c.div;var p=c.div.negative!==0?c.mod.isub(f):c.mod,v=f.ushrn(1),g=f.andln(1),x=p.cmp(v);return x<0||g===1&&x===0?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},n.prototype.modn=function(f){r(f<=67108863);for(var c=(1<<26)%f,p=0,v=this.length-1;v>=0;v--)p=(c*p+(this.words[v]|0))%f;return p},n.prototype.idivn=function(f){r(f<=67108863);for(var c=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+c*67108864;this.words[p]=v/f|0,c=v%f}return this.strip()},n.prototype.divn=function(f){return this.clone().idivn(f)},n.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var c=this,p=f.clone();c.negative!==0?c=c.umod(f):c=c.clone();for(var v=new n(1),g=new n(0),x=new n(0),S=new n(1),b=0;c.isEven()&&p.isEven();)c.iushrn(1),p.iushrn(1),++b;for(var l=p.clone(),d=c.clone();!c.isZero();){for(var A=0,D=1;!(c.words[0]&D)&&A<26;++A,D<<=1);if(A>0)for(c.iushrn(A);A-- >0;)(v.isOdd()||g.isOdd())&&(v.iadd(l),g.isub(d)),v.iushrn(1),g.iushrn(1);for(var V=0,Y=1;!(p.words[0]&Y)&&V<26;++V,Y<<=1);if(V>0)for(p.iushrn(V);V-- >0;)(x.isOdd()||S.isOdd())&&(x.iadd(l),S.isub(d)),x.iushrn(1),S.iushrn(1);c.cmp(p)>=0?(c.isub(p),v.isub(x),g.isub(S)):(p.isub(c),x.isub(v),S.isub(g))}return{a:x,b:S,gcd:p.iushln(b)}},n.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var c=this,p=f.clone();c.negative!==0?c=c.umod(f):c=c.clone();for(var v=new n(1),g=new n(0),x=p.clone();c.cmpn(1)>0&&p.cmpn(1)>0;){for(var S=0,b=1;!(c.words[0]&b)&&S<26;++S,b<<=1);if(S>0)for(c.iushrn(S);S-- >0;)v.isOdd()&&v.iadd(x),v.iushrn(1);for(var l=0,d=1;!(p.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(p.iushrn(l);l-- >0;)g.isOdd()&&g.iadd(x),g.iushrn(1);c.cmp(p)>=0?(c.isub(p),v.isub(g)):(p.isub(c),g.isub(v))}var A;return c.cmpn(1)===0?A=v:A=g,A.cmpn(0)<0&&A.iadd(f),A},n.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var c=this.clone(),p=f.clone();c.negative=0,p.negative=0;for(var v=0;c.isEven()&&p.isEven();v++)c.iushrn(1),p.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;p.isEven();)p.iushrn(1);var g=c.cmp(p);if(g<0){var x=c;c=p,p=x}else if(g===0||p.cmpn(1)===0)break;c.isub(p)}while(!0);return p.iushln(v)},n.prototype.invm=function(f){return this.egcd(f).a.umod(f)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(f){return this.words[0]&f},n.prototype.bincn=function(f){r(typeof f=="number");var c=f%26,p=(f-c)/26,v=1<<c;if(this.length<=p)return this._expand(p+1),this.words[p]|=v,this;for(var g=v,x=p;g!==0&&x<this.length;x++){var S=this.words[x]|0;S+=g,g=S>>>26,S&=67108863,this.words[x]=S}return g!==0&&(this.words[x]=g,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(f){var c=f<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var p;if(this.length>1)p=1;else{c&&(f=-f),r(f<=67108863,"Number is too big");var v=this.words[0]|0;p=v===f?0:v<f?-1:1}return this.negative!==0?-p|0:p},n.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var c=this.ucmp(f);return this.negative!==0?-c|0:c},n.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var c=0,p=this.length-1;p>=0;p--){var v=this.words[p]|0,g=f.words[p]|0;if(v!==g){v<g?c=-1:v>g&&(c=1);break}}return c},n.prototype.gtn=function(f){return this.cmpn(f)===1},n.prototype.gt=function(f){return this.cmp(f)===1},n.prototype.gten=function(f){return this.cmpn(f)>=0},n.prototype.gte=function(f){return this.cmp(f)>=0},n.prototype.ltn=function(f){return this.cmpn(f)===-1},n.prototype.lt=function(f){return this.cmp(f)===-1},n.prototype.lten=function(f){return this.cmpn(f)<=0},n.prototype.lte=function(f){return this.cmp(f)<=0},n.prototype.eqn=function(f){return this.cmpn(f)===0},n.prototype.eq=function(f){return this.cmp(f)===0},n.red=function(f){return new me(f)},n.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(f){return this.red=f,this},n.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},n.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},n.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},n.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},n.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},n.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},n.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},n.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var $={k256:null,p224:null,p192:null,p25519:null};function H(E,f){this.name=E,this.p=new n(f,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var f=new n(null);return f.words=new Array(Math.ceil(this.n/13)),f},H.prototype.ireduce=function(f){var c=f,p;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),p=c.bitLength();while(p>this.n);var v=p<this.n?-1:c.ucmp(this.p);return v===0?(c.words[0]=0,c.length=1):v>0?c.isub(this.p):c.strip(),c},H.prototype.split=function(f,c){f.iushrn(this.n,0,c)},H.prototype.imulK=function(f){return f.imul(this.k)};function ee(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(ee,H),ee.prototype.split=function(f,c){for(var p=4194303,v=Math.min(f.length,9),g=0;g<v;g++)c.words[g]=f.words[g];if(c.length=v,f.length<=9){f.words[0]=0,f.length=1;return}var x=f.words[9];for(c.words[c.length++]=x&p,g=10;g<f.length;g++){var S=f.words[g]|0;f.words[g-10]=(S&p)<<4|x>>>22,x=S}x>>>=22,f.words[g-10]=x,x===0&&f.length>10?f.length-=10:f.length-=9},ee.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var c=0,p=0;p<f.length;p++){var v=f.words[p]|0;c+=v*977,f.words[p]=c&67108863,c=v*64+(c/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function ce(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(ce,H);function ge(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(ge,H);function Se(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Se,H),Se.prototype.imulK=function(f){for(var c=0,p=0;p<f.length;p++){var v=(f.words[p]|0)*19+c,g=v&67108863;v>>>=26,f.words[p]=g,c=v}return c!==0&&(f.words[f.length++]=c),f},n._prime=function(f){if($[f])return $[f];var c;if(f==="k256")c=new ee;else if(f==="p224")c=new ce;else if(f==="p192")c=new ge;else if(f==="p25519")c=new Se;else throw new Error("Unknown prime "+f);return $[f]=c,c};function me(E){if(typeof E=="string"){var f=n._prime(E);this.m=f.p,this.prime=f}else r(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}me.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},me.prototype._verify2=function(f,c){r((f.negative|c.negative)===0,"red works only with positives"),r(f.red&&f.red===c.red,"red works only with red numbers")},me.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):f.umod(this.m)._forceRed(this)},me.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},me.prototype.add=function(f,c){this._verify2(f,c);var p=f.add(c);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},me.prototype.iadd=function(f,c){this._verify2(f,c);var p=f.iadd(c);return p.cmp(this.m)>=0&&p.isub(this.m),p},me.prototype.sub=function(f,c){this._verify2(f,c);var p=f.sub(c);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},me.prototype.isub=function(f,c){this._verify2(f,c);var p=f.isub(c);return p.cmpn(0)<0&&p.iadd(this.m),p},me.prototype.shl=function(f,c){return this._verify1(f),this.imod(f.ushln(c))},me.prototype.imul=function(f,c){return this._verify2(f,c),this.imod(f.imul(c))},me.prototype.mul=function(f,c){return this._verify2(f,c),this.imod(f.mul(c))},me.prototype.isqr=function(f){return this.imul(f,f.clone())},me.prototype.sqr=function(f){return this.mul(f,f)},me.prototype.sqrt=function(f){if(f.isZero())return f.clone();var c=this.m.andln(3);if(r(c%2===1),c===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(f,p)}for(var v=this.m.subn(1),g=0;!v.isZero()&&v.andln(1)===0;)g++,v.iushrn(1);r(!v.isZero());var x=new n(1).toRed(this),S=x.redNeg(),b=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);this.pow(l,b).cmp(S)!==0;)l.redIAdd(S);for(var d=this.pow(l,v),A=this.pow(f,v.addn(1).iushrn(1)),D=this.pow(f,v),V=g;D.cmp(x)!==0;){for(var Y=D,se=0;Y.cmp(x)!==0;se++)Y=Y.redSqr();r(se<V);var ae=this.pow(d,new n(1).iushln(V-se-1));A=A.redMul(ae),d=ae.redSqr(),D=D.redMul(d),V=se}return A},me.prototype.invm=function(f){var c=f._invmp(this.m);return c.negative!==0?(c.negative=0,this.imod(c).redNeg()):this.imod(c)},me.prototype.pow=function(f,c){if(c.isZero())return new n(1).toRed(this);if(c.cmpn(1)===0)return f.clone();var p=4,v=new Array(1<<p);v[0]=new n(1).toRed(this),v[1]=f;for(var g=2;g<v.length;g++)v[g]=this.mul(v[g-1],f);var x=v[0],S=0,b=0,l=c.bitLength()%26;for(l===0&&(l=26),g=c.length-1;g>=0;g--){for(var d=c.words[g],A=l-1;A>=0;A--){var D=d>>A&1;if(x!==v[0]&&(x=this.sqr(x)),D===0&&S===0){b=0;continue}S<<=1,S|=D,b++,!(b!==p&&(g!==0||A!==0))&&(x=this.mul(x,v[S]),b=0,S=0)}l=26}return x},me.prototype.convertTo=function(f){var c=f.umod(this.m);return c===f?c.clone():c},me.prototype.convertFrom=function(f){var c=f.clone();return c.red=null,c},n.mont=function(f){return new O(f)};function O(E){me.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(O,me),O.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},O.prototype.convertFrom=function(f){var c=this.imod(f.mul(this.rinv));return c.red=null,c},O.prototype.imul=function(f,c){if(f.isZero()||c.isZero())return f.words[0]=0,f.length=1,f;var p=f.imul(c),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=p.isub(v).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},O.prototype.mul=function(f,c){if(f.isZero()||c.isZero())return new n(0)._forceRed(this);var p=f.mul(c),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=p.isub(v).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},O.prototype.invm=function(f){var c=this.imod(f._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof Hv>"u"||Hv,jw)});var Et=X((tu,Xf)=>{(function(){var e,t="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",n="Expected a function",o="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",m=500,_="__lodash_placeholder__",w=1,I=2,T=4,N=1,C=2,B=1,U=2,Z=4,$=8,H=16,ee=32,ce=64,ge=128,Se=256,me=512,O=30,E="...",f=800,c=16,p=1,v=2,g=3,x=1/0,S=9007199254740991,b=17976931348623157e292,l=NaN,d=4294967295,A=d-1,D=d>>>1,V=[["ary",ge],["bind",B],["bindKey",U],["curry",$],["curryRight",H],["flip",me],["partial",ee],["partialRight",ce],["rearg",Se]],Y="[object Arguments]",se="[object Array]",ae="[object AsyncFunction]",pe="[object Boolean]",ye="[object Date]",de="[object DOMException]",ht="[object Error]",wt="[object Function]",Re="[object GeneratorFunction]",st="[object Map]",et="[object Number]",Ie="[object Null]",Te="[object Object]",jt="[object Promise]",Ve="[object Proxy]",Rt="[object RegExp]",vt="[object Set]",Me="[object String]",Pt="[object Symbol]",Qt="[object Undefined]",Ce="[object WeakMap]",er="[object WeakSet]",At="[object ArrayBuffer]",Be="[object DataView]",Bt="[object Float32Array]",Mt="[object Float64Array]",Ue="[object Int8Array]",Ct="[object Int16Array]",Lt="[object Int32Array]",De="[object Uint8Array]",Ut="[object Uint8ClampedArray]",Dt="[object Uint16Array]",qe="[object Uint32Array]",tr=/\b__p \+= '';/g,rr=/\b(__p \+=) '' \+/g,je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wt=/&(?:amp|lt|gt|quot|#39);/g,Kt=/[&<>"']/g,We=RegExp(Wt.source),ir=RegExp(Kt.source),nr=/<%-([\s\S]+?)%>/g,Ke=/<%([\s\S]+?)%>/g,Gt=/<%=([\s\S]+?)%>/g,sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ge=/^\w*$/,ar=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qt=/[\\^$.*+?()[\]{}|]/g,$e=RegExp(qt.source),Ft=/^\s+/,or=/\s/,Ye=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cr=/\{\n\/\* \[wrapped with (.+)\] \*/,ur=/,? & /,Ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fr=/[()=,{}\[\]\/\s]/,lr=/\\(\\)?/g,Xe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,ys=/^[-+]0x[0-9a-f]+$/i,ws=/^0b[01]+$/i,Ss=/^\[object .+?Constructor\]$/,Es=/^0o[0-7]+$/i,Is=/^(?:0|[1-9]\d*)$/,Ts=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qi=/($^)/,Rs=/['\n\r\u2028\u2029\\]/g,en="\\ud800-\\udfff",As="\\u0300-\\u036f",Os="\\ufe20-\\ufe2f",ks="\\u20d0-\\u20ff",Xn=As+Os+ks,Jn="\\u2700-\\u27bf",Qn="a-z\\xdf-\\xf6\\xf8-\\xff",Ps="\\xac\\xb1\\xd7\\xf7",Ns="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bs="\\u2000-\\u206f",Bu=" \\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",Cx="A-Z\\xc0-\\xd6\\xd8-\\xde",Lx="\\ufe0e\\ufe0f",Ux=Ps+Ns+Bs+Bu,Pd="['\u2019]",AT="["+en+"]",Dx="["+Ux+"]",Ol="["+Xn+"]",qx="\\d+",OT="["+Jn+"]",Fx="["+Qn+"]",Hx="[^"+en+Ux+qx+Jn+Qn+Cx+"]",Nd="\\ud83c[\\udffb-\\udfff]",kT="(?:"+Ol+"|"+Nd+")",zx="[^"+en+"]",Bd="(?:\\ud83c[\\udde6-\\uddff]){2}",Md="[\\ud800-\\udbff][\\udc00-\\udfff]",_c="["+Cx+"]",Vx="\\u200d",jx="(?:"+Fx+"|"+Hx+")",PT="(?:"+_c+"|"+Hx+")",Wx="(?:"+Pd+"(?:d|ll|m|re|s|t|ve))?",Kx="(?:"+Pd+"(?:D|LL|M|RE|S|T|VE))?",Gx=kT+"?",$x="["+Lx+"]?",NT="(?:"+Vx+"(?:"+[zx,Bd,Md].join("|")+")"+$x+Gx+")*",BT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yx=$x+Gx+NT,CT="(?:"+[OT,Bd,Md].join("|")+")"+Yx,LT="(?:"+[zx+Ol+"?",Ol,Bd,Md,AT].join("|")+")",UT=RegExp(Pd,"g"),DT=RegExp(Ol,"g"),Cd=RegExp(Nd+"(?="+Nd+")|"+LT+Yx,"g"),qT=RegExp([_c+"?"+Fx+"+"+Wx+"(?="+[Dx,_c,"$"].join("|")+")",PT+"+"+Kx+"(?="+[Dx,_c+jx,"$"].join("|")+")",_c+"?"+jx+"+"+Wx,_c+"+"+Kx,MT,BT,qx,CT].join("|"),"g"),FT=RegExp("["+Vx+en+Xn+Lx+"]"),HT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zT=["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"],VT=-1,pr={};pr[Bt]=pr[Mt]=pr[Ue]=pr[Ct]=pr[Lt]=pr[De]=pr[Ut]=pr[Dt]=pr[qe]=!0,pr[Y]=pr[se]=pr[At]=pr[pe]=pr[Be]=pr[ye]=pr[ht]=pr[wt]=pr[st]=pr[et]=pr[Te]=pr[Rt]=pr[vt]=pr[Me]=pr[Ce]=!1;var $t={};$t[Y]=$t[se]=$t[At]=$t[Be]=$t[pe]=$t[ye]=$t[Bt]=$t[Mt]=$t[Ue]=$t[Ct]=$t[Lt]=$t[st]=$t[et]=$t[Te]=$t[Rt]=$t[vt]=$t[Me]=$t[Pt]=$t[De]=$t[Ut]=$t[Dt]=$t[qe]=!0,$t[ht]=$t[wt]=$t[Ce]=!1;var jT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},WT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},KT={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},GT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$T=parseFloat,YT=parseInt,Zx=typeof global=="object"&&global&&global.Object===Object&&global,ZT=typeof self=="object"&&self&&self.Object===Object&&self,$r=Zx||ZT||Function("return this")(),Ld=typeof tu=="object"&&tu&&!tu.nodeType&&tu,vo=Ld&&typeof Xf=="object"&&Xf&&!Xf.nodeType&&Xf,Xx=vo&&vo.exports===Ld,Ud=Xx&&Zx.process,tn=function(){try{var q=vo&&vo.require&&vo.require("util").types;return q||Ud&&Ud.binding&&Ud.binding("util")}catch{}}(),Jx=tn&&tn.isArrayBuffer,Qx=tn&&tn.isDate,eb=tn&&tn.isMap,tb=tn&&tn.isRegExp,rb=tn&&tn.isSet,ib=tn&&tn.isTypedArray;function Di(q,Q,G){switch(G.length){case 0:return q.call(Q);case 1:return q.call(Q,G[0]);case 2:return q.call(Q,G[0],G[1]);case 3:return q.call(Q,G[0],G[1],G[2])}return q.apply(Q,G)}function XT(q,Q,G,xe){for(var He=-1,It=q==null?0:q.length;++He<It;){var Hr=q[He];Q(xe,Hr,G(Hr),q)}return xe}function rn(q,Q){for(var G=-1,xe=q==null?0:q.length;++G<xe&&Q(q[G],G,q)!==!1;);return q}function JT(q,Q){for(var G=q==null?0:q.length;G--&&Q(q[G],G,q)!==!1;);return q}function nb(q,Q){for(var G=-1,xe=q==null?0:q.length;++G<xe;)if(!Q(q[G],G,q))return!1;return!0}function ba(q,Q){for(var G=-1,xe=q==null?0:q.length,He=0,It=[];++G<xe;){var Hr=q[G];Q(Hr,G,q)&&(It[He++]=Hr)}return It}function kl(q,Q){var G=q==null?0:q.length;return!!G&&yc(q,Q,0)>-1}function Dd(q,Q,G){for(var xe=-1,He=q==null?0:q.length;++xe<He;)if(G(Q,q[xe]))return!0;return!1}function mr(q,Q){for(var G=-1,xe=q==null?0:q.length,He=Array(xe);++G<xe;)He[G]=Q(q[G],G,q);return He}function _a(q,Q){for(var G=-1,xe=Q.length,He=q.length;++G<xe;)q[He+G]=Q[G];return q}function qd(q,Q,G,xe){var He=-1,It=q==null?0:q.length;for(xe&&It&&(G=q[++He]);++He<It;)G=Q(G,q[He],He,q);return G}function QT(q,Q,G,xe){var He=q==null?0:q.length;for(xe&&He&&(G=q[--He]);He--;)G=Q(G,q[He],He,q);return G}function Fd(q,Q){for(var G=-1,xe=q==null?0:q.length;++G<xe;)if(Q(q[G],G,q))return!0;return!1}var eR=Hd("length");function tR(q){return q.split("")}function rR(q){return q.match(Ze)||[]}function sb(q,Q,G){var xe;return G(q,function(He,It,Hr){if(Q(He,It,Hr))return xe=It,!1}),xe}function Pl(q,Q,G,xe){for(var He=q.length,It=G+(xe?1:-1);xe?It--:++It<He;)if(Q(q[It],It,q))return It;return-1}function yc(q,Q,G){return Q===Q?dR(q,Q,G):Pl(q,ab,G)}function iR(q,Q,G,xe){for(var He=G-1,It=q.length;++He<It;)if(xe(q[He],Q))return He;return-1}function ab(q){return q!==q}function ob(q,Q){var G=q==null?0:q.length;return G?Vd(q,Q)/G:l}function Hd(q){return function(Q){return Q==null?e:Q[q]}}function zd(q){return function(Q){return q==null?e:q[Q]}}function cb(q,Q,G,xe,He){return He(q,function(It,Hr,zt){G=xe?(xe=!1,It):Q(G,It,Hr,zt)}),G}function nR(q,Q){var G=q.length;for(q.sort(Q);G--;)q[G]=q[G].value;return q}function Vd(q,Q){for(var G,xe=-1,He=q.length;++xe<He;){var It=Q(q[xe]);It!==e&&(G=G===e?It:G+It)}return G}function jd(q,Q){for(var G=-1,xe=Array(q);++G<q;)xe[G]=Q(G);return xe}function sR(q,Q){return mr(Q,function(G){return[G,q[G]]})}function ub(q){return q&&q.slice(0,hb(q)+1).replace(Ft,"")}function qi(q){return function(Q){return q(Q)}}function Wd(q,Q){return mr(Q,function(G){return q[G]})}function Mu(q,Q){return q.has(Q)}function fb(q,Q){for(var G=-1,xe=q.length;++G<xe&&yc(Q,q[G],0)>-1;);return G}function lb(q,Q){for(var G=q.length;G--&&yc(Q,q[G],0)>-1;);return G}function aR(q,Q){for(var G=q.length,xe=0;G--;)q[G]===Q&&++xe;return xe}var oR=zd(jT),cR=zd(WT);function uR(q){return"\\"+GT[q]}function fR(q,Q){return q==null?e:q[Q]}function wc(q){return FT.test(q)}function lR(q){return HT.test(q)}function pR(q){for(var Q,G=[];!(Q=q.next()).done;)G.push(Q.value);return G}function Kd(q){var Q=-1,G=Array(q.size);return q.forEach(function(xe,He){G[++Q]=[He,xe]}),G}function pb(q,Q){return function(G){return q(Q(G))}}function ya(q,Q){for(var G=-1,xe=q.length,He=0,It=[];++G<xe;){var Hr=q[G];(Hr===Q||Hr===_)&&(q[G]=_,It[He++]=G)}return It}function Nl(q){var Q=-1,G=Array(q.size);return q.forEach(function(xe){G[++Q]=xe}),G}function hR(q){var Q=-1,G=Array(q.size);return q.forEach(function(xe){G[++Q]=[xe,xe]}),G}function dR(q,Q,G){for(var xe=G-1,He=q.length;++xe<He;)if(q[xe]===Q)return xe;return-1}function mR(q,Q,G){for(var xe=G+1;xe--;)if(q[xe]===Q)return xe;return xe}function Sc(q){return wc(q)?gR(q):eR(q)}function En(q){return wc(q)?xR(q):tR(q)}function hb(q){for(var Q=q.length;Q--&&or.test(q.charAt(Q)););return Q}var vR=zd(KT);function gR(q){for(var Q=Cd.lastIndex=0;Cd.test(q);)++Q;return Q}function xR(q){return q.match(Cd)||[]}function bR(q){return q.match(qT)||[]}var _R=function q(Q){Q=Q==null?$r:wa.defaults($r.Object(),Q,wa.pick($r,zT));var G=Q.Array,xe=Q.Date,He=Q.Error,It=Q.Function,Hr=Q.Math,zt=Q.Object,Gd=Q.RegExp,yR=Q.String,nn=Q.TypeError,Bl=G.prototype,wR=It.prototype,Ec=zt.prototype,Ml=Q["__core-js_shared__"],Cl=wR.toString,Ot=Ec.hasOwnProperty,SR=0,db=function(){var s=/[^.]+$/.exec(Ml&&Ml.keys&&Ml.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Ll=Ec.toString,ER=Cl.call(zt),IR=$r._,TR=Gd("^"+Cl.call(Ot).replace(qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ul=Xx?Q.Buffer:e,Sa=Q.Symbol,Dl=Q.Uint8Array,mb=Ul?Ul.allocUnsafe:e,ql=pb(zt.getPrototypeOf,zt),vb=zt.create,gb=Ec.propertyIsEnumerable,Fl=Bl.splice,xb=Sa?Sa.isConcatSpreadable:e,Cu=Sa?Sa.iterator:e,go=Sa?Sa.toStringTag:e,Hl=function(){try{var s=wo(zt,"defineProperty");return s({},"",{}),s}catch{}}(),RR=Q.clearTimeout!==$r.clearTimeout&&Q.clearTimeout,AR=xe&&xe.now!==$r.Date.now&&xe.now,OR=Q.setTimeout!==$r.setTimeout&&Q.setTimeout,zl=Hr.ceil,Vl=Hr.floor,$d=zt.getOwnPropertySymbols,kR=Ul?Ul.isBuffer:e,bb=Q.isFinite,PR=Bl.join,NR=pb(zt.keys,zt),zr=Hr.max,oi=Hr.min,BR=xe.now,MR=Q.parseInt,_b=Hr.random,CR=Bl.reverse,Yd=wo(Q,"DataView"),Lu=wo(Q,"Map"),Zd=wo(Q,"Promise"),Ic=wo(Q,"Set"),Uu=wo(Q,"WeakMap"),Du=wo(zt,"create"),jl=Uu&&new Uu,Tc={},LR=So(Yd),UR=So(Lu),DR=So(Zd),qR=So(Ic),FR=So(Uu),Wl=Sa?Sa.prototype:e,qu=Wl?Wl.valueOf:e,yb=Wl?Wl.toString:e;function k(s){if(br(s)&&!Je(s)&&!(s instanceof dt)){if(s instanceof sn)return s;if(Ot.call(s,"__wrapped__"))return w_(s)}return new sn(s)}var Rc=function(){function s(){}return function(a){if(!gr(a))return{};if(vb)return vb(a);s.prototype=a;var h=new s;return s.prototype=e,h}}();function Kl(){}function sn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=e}k.templateSettings={escape:nr,evaluate:Ke,interpolate:Gt,variable:"",imports:{_:k}},k.prototype=Kl.prototype,k.prototype.constructor=k,sn.prototype=Rc(Kl.prototype),sn.prototype.constructor=sn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function HR(){var s=new dt(this.__wrapped__);return s.__actions__=Si(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Si(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Si(this.__views__),s}function zR(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function VR(){var s=this.__wrapped__.value(),a=this.__dir__,h=Je(s),y=a<0,R=h?s.length:0,P=t6(0,R,this.__views__),M=P.start,L=P.end,F=L-M,te=y?L:M-1,re=this.__iteratees__,oe=re.length,he=0,Ee=oi(F,this.__takeCount__);if(!h||!y&&R==F&&Ee==F)return Wb(s,this.__actions__);var ke=[];e:for(;F--&&he<Ee;){te+=a;for(var ct=-1,Pe=s[te];++ct<oe;){var pt=re[ct],gt=pt.iteratee,zi=pt.type,xi=gt(Pe);if(zi==v)Pe=xi;else if(!xi){if(zi==p)continue e;break e}}ke[he++]=Pe}return ke}dt.prototype=Rc(Kl.prototype),dt.prototype.constructor=dt;function xo(s){var a=-1,h=s==null?0:s.length;for(this.clear();++a<h;){var y=s[a];this.set(y[0],y[1])}}function jR(){this.__data__=Du?Du(null):{},this.size=0}function WR(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function KR(s){var a=this.__data__;if(Du){var h=a[s];return h===u?e:h}return Ot.call(a,s)?a[s]:e}function GR(s){var a=this.__data__;return Du?a[s]!==e:Ot.call(a,s)}function $R(s,a){var h=this.__data__;return this.size+=this.has(s)?0:1,h[s]=Du&&a===e?u:a,this}xo.prototype.clear=jR,xo.prototype.delete=WR,xo.prototype.get=KR,xo.prototype.has=GR,xo.prototype.set=$R;function Ms(s){var a=-1,h=s==null?0:s.length;for(this.clear();++a<h;){var y=s[a];this.set(y[0],y[1])}}function YR(){this.__data__=[],this.size=0}function ZR(s){var a=this.__data__,h=Gl(a,s);if(h<0)return!1;var y=a.length-1;return h==y?a.pop():Fl.call(a,h,1),--this.size,!0}function XR(s){var a=this.__data__,h=Gl(a,s);return h<0?e:a[h][1]}function JR(s){return Gl(this.__data__,s)>-1}function QR(s,a){var h=this.__data__,y=Gl(h,s);return y<0?(++this.size,h.push([s,a])):h[y][1]=a,this}Ms.prototype.clear=YR,Ms.prototype.delete=ZR,Ms.prototype.get=XR,Ms.prototype.has=JR,Ms.prototype.set=QR;function Cs(s){var a=-1,h=s==null?0:s.length;for(this.clear();++a<h;){var y=s[a];this.set(y[0],y[1])}}function eA(){this.size=0,this.__data__={hash:new xo,map:new(Lu||Ms),string:new xo}}function tA(s){var a=sp(this,s).delete(s);return this.size-=a?1:0,a}function rA(s){return sp(this,s).get(s)}function iA(s){return sp(this,s).has(s)}function nA(s,a){var h=sp(this,s),y=h.size;return h.set(s,a),this.size+=h.size==y?0:1,this}Cs.prototype.clear=eA,Cs.prototype.delete=tA,Cs.prototype.get=rA,Cs.prototype.has=iA,Cs.prototype.set=nA;function bo(s){var a=-1,h=s==null?0:s.length;for(this.__data__=new Cs;++a<h;)this.add(s[a])}function sA(s){return this.__data__.set(s,u),this}function aA(s){return this.__data__.has(s)}bo.prototype.add=bo.prototype.push=sA,bo.prototype.has=aA;function In(s){var a=this.__data__=new Ms(s);this.size=a.size}function oA(){this.__data__=new Ms,this.size=0}function cA(s){var a=this.__data__,h=a.delete(s);return this.size=a.size,h}function uA(s){return this.__data__.get(s)}function fA(s){return this.__data__.has(s)}function lA(s,a){var h=this.__data__;if(h instanceof Ms){var y=h.__data__;if(!Lu||y.length<r-1)return y.push([s,a]),this.size=++h.size,this;h=this.__data__=new Cs(y)}return h.set(s,a),this.size=h.size,this}In.prototype.clear=oA,In.prototype.delete=cA,In.prototype.get=uA,In.prototype.has=fA,In.prototype.set=lA;function wb(s,a){var h=Je(s),y=!h&&Eo(s),R=!h&&!y&&Aa(s),P=!h&&!y&&!R&&Pc(s),M=h||y||R||P,L=M?jd(s.length,yR):[],F=L.length;for(var te in s)(a||Ot.call(s,te))&&!(M&&(te=="length"||R&&(te=="offset"||te=="parent")||P&&(te=="buffer"||te=="byteLength"||te=="byteOffset")||qs(te,F)))&&L.push(te);return L}function Sb(s){var a=s.length;return a?s[o0(0,a-1)]:e}function pA(s,a){return ap(Si(s),_o(a,0,s.length))}function hA(s){return ap(Si(s))}function Xd(s,a,h){(h!==e&&!Tn(s[a],h)||h===e&&!(a in s))&&Ls(s,a,h)}function Fu(s,a,h){var y=s[a];(!(Ot.call(s,a)&&Tn(y,h))||h===e&&!(a in s))&&Ls(s,a,h)}function Gl(s,a){for(var h=s.length;h--;)if(Tn(s[h][0],a))return h;return-1}function dA(s,a,h,y){return Ea(s,function(R,P,M){a(y,R,h(R),M)}),y}function Eb(s,a){return s&&ts(a,Yr(a),s)}function mA(s,a){return s&&ts(a,Ii(a),s)}function Ls(s,a,h){a=="__proto__"&&Hl?Hl(s,a,{configurable:!0,enumerable:!0,value:h,writable:!0}):s[a]=h}function Jd(s,a){for(var h=-1,y=a.length,R=G(y),P=s==null;++h<y;)R[h]=P?e:N0(s,a[h]);return R}function _o(s,a,h){return s===s&&(h!==e&&(s=s<=h?s:h),a!==e&&(s=s>=a?s:a)),s}function an(s,a,h,y,R,P){var M,L=a&w,F=a&I,te=a&T;if(h&&(M=R?h(s,y,R,P):h(s)),M!==e)return M;if(!gr(s))return s;var re=Je(s);if(re){if(M=i6(s),!L)return Si(s,M)}else{var oe=ci(s),he=oe==wt||oe==Re;if(Aa(s))return $b(s,L);if(oe==Te||oe==Y||he&&!R){if(M=F||he?{}:h_(s),!L)return F?KA(s,mA(M,s)):WA(s,Eb(M,s))}else{if(!$t[oe])return R?s:{};M=n6(s,oe,L)}}P||(P=new In);var Ee=P.get(s);if(Ee)return Ee;P.set(s,M),z_(s)?s.forEach(function(Pe){M.add(an(Pe,a,h,Pe,s,P))}):F_(s)&&s.forEach(function(Pe,pt){M.set(pt,an(Pe,a,h,pt,s,P))});var ke=te?F?x0:g0:F?Ii:Yr,ct=re?e:ke(s);return rn(ct||s,function(Pe,pt){ct&&(pt=Pe,Pe=s[pt]),Fu(M,pt,an(Pe,a,h,pt,s,P))}),M}function vA(s){var a=Yr(s);return function(h){return Ib(h,s,a)}}function Ib(s,a,h){var y=h.length;if(s==null)return!y;for(s=zt(s);y--;){var R=h[y],P=a[R],M=s[R];if(M===e&&!(R in s)||!P(M))return!1}return!0}function Tb(s,a,h){if(typeof s!="function")throw new nn(n);return Gu(function(){s.apply(e,h)},a)}function Hu(s,a,h,y){var R=-1,P=kl,M=!0,L=s.length,F=[],te=a.length;if(!L)return F;h&&(a=mr(a,qi(h))),y?(P=Dd,M=!1):a.length>=r&&(P=Mu,M=!1,a=new bo(a));e:for(;++R<L;){var re=s[R],oe=h==null?re:h(re);if(re=y||re!==0?re:0,M&&oe===oe){for(var he=te;he--;)if(a[he]===oe)continue e;F.push(re)}else P(a,oe,y)||F.push(re)}return F}var Ea=Qb(es),Rb=Qb(e0,!0);function gA(s,a){var h=!0;return Ea(s,function(y,R,P){return h=!!a(y,R,P),h}),h}function $l(s,a,h){for(var y=-1,R=s.length;++y<R;){var P=s[y],M=a(P);if(M!=null&&(L===e?M===M&&!Hi(M):h(M,L)))var L=M,F=P}return F}function xA(s,a,h,y){var R=s.length;for(h=at(h),h<0&&(h=-h>R?0:R+h),y=y===e||y>R?R:at(y),y<0&&(y+=R),y=h>y?0:j_(y);h<y;)s[h++]=a;return s}function Ab(s,a){var h=[];return Ea(s,function(y,R,P){a(y,R,P)&&h.push(y)}),h}function ii(s,a,h,y,R){var P=-1,M=s.length;for(h||(h=a6),R||(R=[]);++P<M;){var L=s[P];a>0&&h(L)?a>1?ii(L,a-1,h,y,R):_a(R,L):y||(R[R.length]=L)}return R}var Qd=e_(),Ob=e_(!0);function es(s,a){return s&&Qd(s,a,Yr)}function e0(s,a){return s&&Ob(s,a,Yr)}function Yl(s,a){return ba(a,function(h){return Fs(s[h])})}function yo(s,a){a=Ta(a,s);for(var h=0,y=a.length;s!=null&&h<y;)s=s[rs(a[h++])];return h&&h==y?s:e}function kb(s,a,h){var y=a(s);return Je(s)?y:_a(y,h(s))}function vi(s){return s==null?s===e?Qt:Ie:go&&go in zt(s)?e6(s):h6(s)}function t0(s,a){return s>a}function bA(s,a){return s!=null&&Ot.call(s,a)}function _A(s,a){return s!=null&&a in zt(s)}function yA(s,a,h){return s>=oi(a,h)&&s<zr(a,h)}function r0(s,a,h){for(var y=h?Dd:kl,R=s[0].length,P=s.length,M=P,L=G(P),F=1/0,te=[];M--;){var re=s[M];M&&a&&(re=mr(re,qi(a))),F=oi(re.length,F),L[M]=!h&&(a||R>=120&&re.length>=120)?new bo(M&&re):e}re=s[0];var oe=-1,he=L[0];e:for(;++oe<R&&te.length<F;){var Ee=re[oe],ke=a?a(Ee):Ee;if(Ee=h||Ee!==0?Ee:0,!(he?Mu(he,ke):y(te,ke,h))){for(M=P;--M;){var ct=L[M];if(!(ct?Mu(ct,ke):y(s[M],ke,h)))continue e}he&&he.push(ke),te.push(Ee)}}return te}function wA(s,a,h,y){return es(s,function(R,P,M){a(y,h(R),P,M)}),y}function zu(s,a,h){a=Ta(a,s),s=g_(s,a);var y=s==null?s:s[rs(cn(a))];return y==null?e:Di(y,s,h)}function Pb(s){return br(s)&&vi(s)==Y}function SA(s){return br(s)&&vi(s)==At}function EA(s){return br(s)&&vi(s)==ye}function Vu(s,a,h,y,R){return s===a?!0:s==null||a==null||!br(s)&&!br(a)?s!==s&&a!==a:IA(s,a,h,y,Vu,R)}function IA(s,a,h,y,R,P){var M=Je(s),L=Je(a),F=M?se:ci(s),te=L?se:ci(a);F=F==Y?Te:F,te=te==Y?Te:te;var re=F==Te,oe=te==Te,he=F==te;if(he&&Aa(s)){if(!Aa(a))return!1;M=!0,re=!1}if(he&&!re)return P||(P=new In),M||Pc(s)?f_(s,a,h,y,R,P):JA(s,a,F,h,y,R,P);if(!(h&N)){var Ee=re&&Ot.call(s,"__wrapped__"),ke=oe&&Ot.call(a,"__wrapped__");if(Ee||ke){var ct=Ee?s.value():s,Pe=ke?a.value():a;return P||(P=new In),R(ct,Pe,h,y,P)}}return he?(P||(P=new In),QA(s,a,h,y,R,P)):!1}function TA(s){return br(s)&&ci(s)==st}function i0(s,a,h,y){var R=h.length,P=R,M=!y;if(s==null)return!P;for(s=zt(s);R--;){var L=h[R];if(M&&L[2]?L[1]!==s[L[0]]:!(L[0]in s))return!1}for(;++R<P;){L=h[R];var F=L[0],te=s[F],re=L[1];if(M&&L[2]){if(te===e&&!(F in s))return!1}else{var oe=new In;if(y)var he=y(te,re,F,s,a,oe);if(!(he===e?Vu(re,te,N|C,y,oe):he))return!1}}return!0}function Nb(s){if(!gr(s)||c6(s))return!1;var a=Fs(s)?TR:Ss;return a.test(So(s))}function RA(s){return br(s)&&vi(s)==Rt}function AA(s){return br(s)&&ci(s)==vt}function OA(s){return br(s)&&pp(s.length)&&!!pr[vi(s)]}function Bb(s){return typeof s=="function"?s:s==null?Ti:typeof s=="object"?Je(s)?Lb(s[0],s[1]):Cb(s):t1(s)}function n0(s){if(!Ku(s))return NR(s);var a=[];for(var h in zt(s))Ot.call(s,h)&&h!="constructor"&&a.push(h);return a}function kA(s){if(!gr(s))return p6(s);var a=Ku(s),h=[];for(var y in s)y=="constructor"&&(a||!Ot.call(s,y))||h.push(y);return h}function s0(s,a){return s<a}function Mb(s,a){var h=-1,y=Ei(s)?G(s.length):[];return Ea(s,function(R,P,M){y[++h]=a(R,P,M)}),y}function Cb(s){var a=_0(s);return a.length==1&&a[0][2]?m_(a[0][0],a[0][1]):function(h){return h===s||i0(h,s,a)}}function Lb(s,a){return w0(s)&&d_(a)?m_(rs(s),a):function(h){var y=N0(h,s);return y===e&&y===a?B0(h,s):Vu(a,y,N|C)}}function Zl(s,a,h,y,R){s!==a&&Qd(a,function(P,M){if(R||(R=new In),gr(P))PA(s,a,M,h,Zl,y,R);else{var L=y?y(E0(s,M),P,M+"",s,a,R):e;L===e&&(L=P),Xd(s,M,L)}},Ii)}function PA(s,a,h,y,R,P,M){var L=E0(s,h),F=E0(a,h),te=M.get(F);if(te){Xd(s,h,te);return}var re=P?P(L,F,h+"",s,a,M):e,oe=re===e;if(oe){var he=Je(F),Ee=!he&&Aa(F),ke=!he&&!Ee&&Pc(F);re=F,he||Ee||ke?Je(L)?re=L:Er(L)?re=Si(L):Ee?(oe=!1,re=$b(F,!0)):ke?(oe=!1,re=Yb(F,!0)):re=[]:$u(F)||Eo(F)?(re=L,Eo(L)?re=W_(L):(!gr(L)||Fs(L))&&(re=h_(F))):oe=!1}oe&&(M.set(F,re),R(re,F,y,P,M),M.delete(F)),Xd(s,h,re)}function Ub(s,a){var h=s.length;if(h)return a+=a<0?h:0,qs(a,h)?s[a]:e}function Db(s,a,h){a.length?a=mr(a,function(P){return Je(P)?function(M){return yo(M,P.length===1?P[0]:P)}:P}):a=[Ti];var y=-1;a=mr(a,qi(Oe()));var R=Mb(s,function(P,M,L){var F=mr(a,function(te){return te(P)});return{criteria:F,index:++y,value:P}});return nR(R,function(P,M){return jA(P,M,h)})}function NA(s,a){return qb(s,a,function(h,y){return B0(s,y)})}function qb(s,a,h){for(var y=-1,R=a.length,P={};++y<R;){var M=a[y],L=yo(s,M);h(L,M)&&ju(P,Ta(M,s),L)}return P}function BA(s){return function(a){return yo(a,s)}}function a0(s,a,h,y){var R=y?iR:yc,P=-1,M=a.length,L=s;for(s===a&&(a=Si(a)),h&&(L=mr(s,qi(h)));++P<M;)for(var F=0,te=a[P],re=h?h(te):te;(F=R(L,re,F,y))>-1;)L!==s&&Fl.call(L,F,1),Fl.call(s,F,1);return s}function Fb(s,a){for(var h=s?a.length:0,y=h-1;h--;){var R=a[h];if(h==y||R!==P){var P=R;qs(R)?Fl.call(s,R,1):f0(s,R)}}return s}function o0(s,a){return s+Vl(_b()*(a-s+1))}function MA(s,a,h,y){for(var R=-1,P=zr(zl((a-s)/(h||1)),0),M=G(P);P--;)M[y?P:++R]=s,s+=h;return M}function c0(s,a){var h="";if(!s||a<1||a>S)return h;do a%2&&(h+=s),a=Vl(a/2),a&&(s+=s);while(a);return h}function ft(s,a){return I0(v_(s,a,Ti),s+"")}function CA(s){return Sb(Nc(s))}function LA(s,a){var h=Nc(s);return ap(h,_o(a,0,h.length))}function ju(s,a,h,y){if(!gr(s))return s;a=Ta(a,s);for(var R=-1,P=a.length,M=P-1,L=s;L!=null&&++R<P;){var F=rs(a[R]),te=h;if(F==="__proto__"||F==="constructor"||F==="prototype")return s;if(R!=M){var re=L[F];te=y?y(re,F,L):e,te===e&&(te=gr(re)?re:qs(a[R+1])?[]:{})}Fu(L,F,te),L=L[F]}return s}var Hb=jl?function(s,a){return jl.set(s,a),s}:Ti,UA=Hl?function(s,a){return Hl(s,"toString",{configurable:!0,enumerable:!1,value:C0(a),writable:!0})}:Ti;function DA(s){return ap(Nc(s))}function on(s,a,h){var y=-1,R=s.length;a<0&&(a=-a>R?0:R+a),h=h>R?R:h,h<0&&(h+=R),R=a>h?0:h-a>>>0,a>>>=0;for(var P=G(R);++y<R;)P[y]=s[y+a];return P}function qA(s,a){var h;return Ea(s,function(y,R,P){return h=a(y,R,P),!h}),!!h}function Xl(s,a,h){var y=0,R=s==null?y:s.length;if(typeof a=="number"&&a===a&&R<=D){for(;y<R;){var P=y+R>>>1,M=s[P];M!==null&&!Hi(M)&&(h?M<=a:M<a)?y=P+1:R=P}return R}return u0(s,a,Ti,h)}function u0(s,a,h,y){var R=0,P=s==null?0:s.length;if(P===0)return 0;a=h(a);for(var M=a!==a,L=a===null,F=Hi(a),te=a===e;R<P;){var re=Vl((R+P)/2),oe=h(s[re]),he=oe!==e,Ee=oe===null,ke=oe===oe,ct=Hi(oe);if(M)var Pe=y||ke;else te?Pe=ke&&(y||he):L?Pe=ke&&he&&(y||!Ee):F?Pe=ke&&he&&!Ee&&(y||!ct):Ee||ct?Pe=!1:Pe=y?oe<=a:oe<a;Pe?R=re+1:P=re}return oi(P,A)}function zb(s,a){for(var h=-1,y=s.length,R=0,P=[];++h<y;){var M=s[h],L=a?a(M):M;if(!h||!Tn(L,F)){var F=L;P[R++]=M===0?0:M}}return P}function Vb(s){return typeof s=="number"?s:Hi(s)?l:+s}function Fi(s){if(typeof s=="string")return s;if(Je(s))return mr(s,Fi)+"";if(Hi(s))return yb?yb.call(s):"";var a=s+"";return a=="0"&&1/s==-x?"-0":a}function Ia(s,a,h){var y=-1,R=kl,P=s.length,M=!0,L=[],F=L;if(h)M=!1,R=Dd;else if(P>=r){var te=a?null:ZA(s);if(te)return Nl(te);M=!1,R=Mu,F=new bo}else F=a?[]:L;e:for(;++y<P;){var re=s[y],oe=a?a(re):re;if(re=h||re!==0?re:0,M&&oe===oe){for(var he=F.length;he--;)if(F[he]===oe)continue e;a&&F.push(oe),L.push(re)}else R(F,oe,h)||(F!==L&&F.push(oe),L.push(re))}return L}function f0(s,a){return a=Ta(a,s),s=g_(s,a),s==null||delete s[rs(cn(a))]}function jb(s,a,h,y){return ju(s,a,h(yo(s,a)),y)}function Jl(s,a,h,y){for(var R=s.length,P=y?R:-1;(y?P--:++P<R)&&a(s[P],P,s););return h?on(s,y?0:P,y?P+1:R):on(s,y?P+1:0,y?R:P)}function Wb(s,a){var h=s;return h instanceof dt&&(h=h.value()),qd(a,function(y,R){return R.func.apply(R.thisArg,_a([y],R.args))},h)}function l0(s,a,h){var y=s.length;if(y<2)return y?Ia(s[0]):[];for(var R=-1,P=G(y);++R<y;)for(var M=s[R],L=-1;++L<y;)L!=R&&(P[R]=Hu(P[R]||M,s[L],a,h));return Ia(ii(P,1),a,h)}function Kb(s,a,h){for(var y=-1,R=s.length,P=a.length,M={};++y<R;){var L=y<P?a[y]:e;h(M,s[y],L)}return M}function p0(s){return Er(s)?s:[]}function h0(s){return typeof s=="function"?s:Ti}function Ta(s,a){return Je(s)?s:w0(s,a)?[s]:y_(Tt(s))}var FA=ft;function Ra(s,a,h){var y=s.length;return h=h===e?y:h,!a&&h>=y?s:on(s,a,h)}var Gb=RR||function(s){return $r.clearTimeout(s)};function $b(s,a){if(a)return s.slice();var h=s.length,y=mb?mb(h):new s.constructor(h);return s.copy(y),y}function d0(s){var a=new s.constructor(s.byteLength);return new Dl(a).set(new Dl(s)),a}function HA(s,a){var h=a?d0(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.byteLength)}function zA(s){var a=new s.constructor(s.source,Ht.exec(s));return a.lastIndex=s.lastIndex,a}function VA(s){return qu?zt(qu.call(s)):{}}function Yb(s,a){var h=a?d0(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.length)}function Zb(s,a){if(s!==a){var h=s!==e,y=s===null,R=s===s,P=Hi(s),M=a!==e,L=a===null,F=a===a,te=Hi(a);if(!L&&!te&&!P&&s>a||P&&M&&F&&!L&&!te||y&&M&&F||!h&&F||!R)return 1;if(!y&&!P&&!te&&s<a||te&&h&&R&&!y&&!P||L&&h&&R||!M&&R||!F)return-1}return 0}function jA(s,a,h){for(var y=-1,R=s.criteria,P=a.criteria,M=R.length,L=h.length;++y<M;){var F=Zb(R[y],P[y]);if(F){if(y>=L)return F;var te=h[y];return F*(te=="desc"?-1:1)}}return s.index-a.index}function Xb(s,a,h,y){for(var R=-1,P=s.length,M=h.length,L=-1,F=a.length,te=zr(P-M,0),re=G(F+te),oe=!y;++L<F;)re[L]=a[L];for(;++R<M;)(oe||R<P)&&(re[h[R]]=s[R]);for(;te--;)re[L++]=s[R++];return re}function Jb(s,a,h,y){for(var R=-1,P=s.length,M=-1,L=h.length,F=-1,te=a.length,re=zr(P-L,0),oe=G(re+te),he=!y;++R<re;)oe[R]=s[R];for(var Ee=R;++F<te;)oe[Ee+F]=a[F];for(;++M<L;)(he||R<P)&&(oe[Ee+h[M]]=s[R++]);return oe}function Si(s,a){var h=-1,y=s.length;for(a||(a=G(y));++h<y;)a[h]=s[h];return a}function ts(s,a,h,y){var R=!h;h||(h={});for(var P=-1,M=a.length;++P<M;){var L=a[P],F=y?y(h[L],s[L],L,h,s):e;F===e&&(F=s[L]),R?Ls(h,L,F):Fu(h,L,F)}return h}function WA(s,a){return ts(s,y0(s),a)}function KA(s,a){return ts(s,l_(s),a)}function Ql(s,a){return function(h,y){var R=Je(h)?XT:dA,P=a?a():{};return R(h,s,Oe(y,2),P)}}function Ac(s){return ft(function(a,h){var y=-1,R=h.length,P=R>1?h[R-1]:e,M=R>2?h[2]:e;for(P=s.length>3&&typeof P=="function"?(R--,P):e,M&&gi(h[0],h[1],M)&&(P=R<3?e:P,R=1),a=zt(a);++y<R;){var L=h[y];L&&s(a,L,y,P)}return a})}function Qb(s,a){return function(h,y){if(h==null)return h;if(!Ei(h))return s(h,y);for(var R=h.length,P=a?R:-1,M=zt(h);(a?P--:++P<R)&&y(M[P],P,M)!==!1;);return h}}function e_(s){return function(a,h,y){for(var R=-1,P=zt(a),M=y(a),L=M.length;L--;){var F=M[s?L:++R];if(h(P[F],F,P)===!1)break}return a}}function GA(s,a,h){var y=a&B,R=Wu(s);function P(){var M=this&&this!==$r&&this instanceof P?R:s;return M.apply(y?h:this,arguments)}return P}function t_(s){return function(a){a=Tt(a);var h=wc(a)?En(a):e,y=h?h[0]:a.charAt(0),R=h?Ra(h,1).join(""):a.slice(1);return y[s]()+R}}function Oc(s){return function(a){return qd(Q_(J_(a).replace(UT,"")),s,"")}}function Wu(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var h=Rc(s.prototype),y=s.apply(h,a);return gr(y)?y:h}}function $A(s,a,h){var y=Wu(s);function R(){for(var P=arguments.length,M=G(P),L=P,F=kc(R);L--;)M[L]=arguments[L];var te=P<3&&M[0]!==F&&M[P-1]!==F?[]:ya(M,F);if(P-=te.length,P<h)return a_(s,a,ep,R.placeholder,e,M,te,e,e,h-P);var re=this&&this!==$r&&this instanceof R?y:s;return Di(re,this,M)}return R}function r_(s){return function(a,h,y){var R=zt(a);if(!Ei(a)){var P=Oe(h,3);a=Yr(a),h=function(L){return P(R[L],L,R)}}var M=s(a,h,y);return M>-1?R[P?a[M]:M]:e}}function i_(s){return Ds(function(a){var h=a.length,y=h,R=sn.prototype.thru;for(s&&a.reverse();y--;){var P=a[y];if(typeof P!="function")throw new nn(n);if(R&&!M&&np(P)=="wrapper")var M=new sn([],!0)}for(y=M?y:h;++y<h;){P=a[y];var L=np(P),F=L=="wrapper"?b0(P):e;F&&S0(F[0])&&F[1]==(ge|$|ee|Se)&&!F[4].length&&F[9]==1?M=M[np(F[0])].apply(M,F[3]):M=P.length==1&&S0(P)?M[L]():M.thru(P)}return function(){var te=arguments,re=te[0];if(M&&te.length==1&&Je(re))return M.plant(re).value();for(var oe=0,he=h?a[oe].apply(this,te):re;++oe<h;)he=a[oe].call(this,he);return he}})}function ep(s,a,h,y,R,P,M,L,F,te){var re=a&ge,oe=a&B,he=a&U,Ee=a&($|H),ke=a&me,ct=he?e:Wu(s);function Pe(){for(var pt=arguments.length,gt=G(pt),zi=pt;zi--;)gt[zi]=arguments[zi];if(Ee)var xi=kc(Pe),Vi=aR(gt,xi);if(y&&(gt=Xb(gt,y,R,Ee)),P&&(gt=Jb(gt,P,M,Ee)),pt-=Vi,Ee&&pt<te){var Ir=ya(gt,xi);return a_(s,a,ep,Pe.placeholder,h,gt,Ir,L,F,te-pt)}var Rn=oe?h:this,zs=he?Rn[s]:s;return pt=gt.length,L?gt=d6(gt,L):ke&&pt>1&&gt.reverse(),re&&F<pt&&(gt.length=F),this&&this!==$r&&this instanceof Pe&&(zs=ct||Wu(zs)),zs.apply(Rn,gt)}return Pe}function n_(s,a){return function(h,y){return wA(h,s,a(y),{})}}function tp(s,a){return function(h,y){var R;if(h===e&&y===e)return a;if(h!==e&&(R=h),y!==e){if(R===e)return y;typeof h=="string"||typeof y=="string"?(h=Fi(h),y=Fi(y)):(h=Vb(h),y=Vb(y)),R=s(h,y)}return R}}function m0(s){return Ds(function(a){return a=mr(a,qi(Oe())),ft(function(h){var y=this;return s(a,function(R){return Di(R,y,h)})})})}function rp(s,a){a=a===e?" ":Fi(a);var h=a.length;if(h<2)return h?c0(a,s):a;var y=c0(a,zl(s/Sc(a)));return wc(a)?Ra(En(y),0,s).join(""):y.slice(0,s)}function YA(s,a,h,y){var R=a&B,P=Wu(s);function M(){for(var L=-1,F=arguments.length,te=-1,re=y.length,oe=G(re+F),he=this&&this!==$r&&this instanceof M?P:s;++te<re;)oe[te]=y[te];for(;F--;)oe[te++]=arguments[++L];return Di(he,R?h:this,oe)}return M}function s_(s){return function(a,h,y){return y&&typeof y!="number"&&gi(a,h,y)&&(h=y=e),a=Hs(a),h===e?(h=a,a=0):h=Hs(h),y=y===e?a<h?1:-1:Hs(y),MA(a,h,y,s)}}function ip(s){return function(a,h){return typeof a=="string"&&typeof h=="string"||(a=un(a),h=un(h)),s(a,h)}}function a_(s,a,h,y,R,P,M,L,F,te){var re=a&$,oe=re?M:e,he=re?e:M,Ee=re?P:e,ke=re?e:P;a|=re?ee:ce,a&=~(re?ce:ee),a&Z||(a&=~(B|U));var ct=[s,a,R,Ee,oe,ke,he,L,F,te],Pe=h.apply(e,ct);return S0(s)&&x_(Pe,ct),Pe.placeholder=y,b_(Pe,s,a)}function v0(s){var a=Hr[s];return function(h,y){if(h=un(h),y=y==null?0:oi(at(y),292),y&&bb(h)){var R=(Tt(h)+"e").split("e"),P=a(R[0]+"e"+(+R[1]+y));return R=(Tt(P)+"e").split("e"),+(R[0]+"e"+(+R[1]-y))}return a(h)}}var ZA=Ic&&1/Nl(new Ic([,-0]))[1]==x?function(s){return new Ic(s)}:D0;function o_(s){return function(a){var h=ci(a);return h==st?Kd(a):h==vt?hR(a):sR(a,s(a))}}function Us(s,a,h,y,R,P,M,L){var F=a&U;if(!F&&typeof s!="function")throw new nn(n);var te=y?y.length:0;if(te||(a&=~(ee|ce),y=R=e),M=M===e?M:zr(at(M),0),L=L===e?L:at(L),te-=R?R.length:0,a&ce){var re=y,oe=R;y=R=e}var he=F?e:b0(s),Ee=[s,a,h,y,R,re,oe,P,M,L];if(he&&l6(Ee,he),s=Ee[0],a=Ee[1],h=Ee[2],y=Ee[3],R=Ee[4],L=Ee[9]=Ee[9]===e?F?0:s.length:zr(Ee[9]-te,0),!L&&a&($|H)&&(a&=~($|H)),!a||a==B)var ke=GA(s,a,h);else a==$||a==H?ke=$A(s,a,L):(a==ee||a==(B|ee))&&!R.length?ke=YA(s,a,h,y):ke=ep.apply(e,Ee);var ct=he?Hb:x_;return b_(ct(ke,Ee),s,a)}function c_(s,a,h,y){return s===e||Tn(s,Ec[h])&&!Ot.call(y,h)?a:s}function u_(s,a,h,y,R,P){return gr(s)&&gr(a)&&(P.set(a,s),Zl(s,a,e,u_,P),P.delete(a)),s}function XA(s){return $u(s)?e:s}function f_(s,a,h,y,R,P){var M=h&N,L=s.length,F=a.length;if(L!=F&&!(M&&F>L))return!1;var te=P.get(s),re=P.get(a);if(te&&re)return te==a&&re==s;var oe=-1,he=!0,Ee=h&C?new bo:e;for(P.set(s,a),P.set(a,s);++oe<L;){var ke=s[oe],ct=a[oe];if(y)var Pe=M?y(ct,ke,oe,a,s,P):y(ke,ct,oe,s,a,P);if(Pe!==e){if(Pe)continue;he=!1;break}if(Ee){if(!Fd(a,function(pt,gt){if(!Mu(Ee,gt)&&(ke===pt||R(ke,pt,h,y,P)))return Ee.push(gt)})){he=!1;break}}else if(!(ke===ct||R(ke,ct,h,y,P))){he=!1;break}}return P.delete(s),P.delete(a),he}function JA(s,a,h,y,R,P,M){switch(h){case Be:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case At:return!(s.byteLength!=a.byteLength||!P(new Dl(s),new Dl(a)));case pe:case ye:case et:return Tn(+s,+a);case ht:return s.name==a.name&&s.message==a.message;case Rt:case Me:return s==a+"";case st:var L=Kd;case vt:var F=y&N;if(L||(L=Nl),s.size!=a.size&&!F)return!1;var te=M.get(s);if(te)return te==a;y|=C,M.set(s,a);var re=f_(L(s),L(a),y,R,P,M);return M.delete(s),re;case Pt:if(qu)return qu.call(s)==qu.call(a)}return!1}function QA(s,a,h,y,R,P){var M=h&N,L=g0(s),F=L.length,te=g0(a),re=te.length;if(F!=re&&!M)return!1;for(var oe=F;oe--;){var he=L[oe];if(!(M?he in a:Ot.call(a,he)))return!1}var Ee=P.get(s),ke=P.get(a);if(Ee&&ke)return Ee==a&&ke==s;var ct=!0;P.set(s,a),P.set(a,s);for(var Pe=M;++oe<F;){he=L[oe];var pt=s[he],gt=a[he];if(y)var zi=M?y(gt,pt,he,a,s,P):y(pt,gt,he,s,a,P);if(!(zi===e?pt===gt||R(pt,gt,h,y,P):zi)){ct=!1;break}Pe||(Pe=he=="constructor")}if(ct&&!Pe){var xi=s.constructor,Vi=a.constructor;xi!=Vi&&"constructor"in s&&"constructor"in a&&!(typeof xi=="function"&&xi instanceof xi&&typeof Vi=="function"&&Vi instanceof Vi)&&(ct=!1)}return P.delete(s),P.delete(a),ct}function Ds(s){return I0(v_(s,e,I_),s+"")}function g0(s){return kb(s,Yr,y0)}function x0(s){return kb(s,Ii,l_)}var b0=jl?function(s){return jl.get(s)}:D0;function np(s){for(var a=s.name+"",h=Tc[a],y=Ot.call(Tc,a)?h.length:0;y--;){var R=h[y],P=R.func;if(P==null||P==s)return R.name}return a}function kc(s){var a=Ot.call(k,"placeholder")?k:s;return a.placeholder}function Oe(){var s=k.iteratee||L0;return s=s===L0?Bb:s,arguments.length?s(arguments[0],arguments[1]):s}function sp(s,a){var h=s.__data__;return o6(a)?h[typeof a=="string"?"string":"hash"]:h.map}function _0(s){for(var a=Yr(s),h=a.length;h--;){var y=a[h],R=s[y];a[h]=[y,R,d_(R)]}return a}function wo(s,a){var h=fR(s,a);return Nb(h)?h:e}function e6(s){var a=Ot.call(s,go),h=s[go];try{s[go]=e;var y=!0}catch{}var R=Ll.call(s);return y&&(a?s[go]=h:delete s[go]),R}var y0=$d?function(s){return s==null?[]:(s=zt(s),ba($d(s),function(a){return gb.call(s,a)}))}:q0,l_=$d?function(s){for(var a=[];s;)_a(a,y0(s)),s=ql(s);return a}:q0,ci=vi;(Yd&&ci(new Yd(new ArrayBuffer(1)))!=Be||Lu&&ci(new Lu)!=st||Zd&&ci(Zd.resolve())!=jt||Ic&&ci(new Ic)!=vt||Uu&&ci(new Uu)!=Ce)&&(ci=function(s){var a=vi(s),h=a==Te?s.constructor:e,y=h?So(h):"";if(y)switch(y){case LR:return Be;case UR:return st;case DR:return jt;case qR:return vt;case FR:return Ce}return a});function t6(s,a,h){for(var y=-1,R=h.length;++y<R;){var P=h[y],M=P.size;switch(P.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=oi(a,s+M);break;case"takeRight":s=zr(s,a-M);break}}return{start:s,end:a}}function r6(s){var a=s.match(cr);return a?a[1].split(ur):[]}function p_(s,a,h){a=Ta(a,s);for(var y=-1,R=a.length,P=!1;++y<R;){var M=rs(a[y]);if(!(P=s!=null&&h(s,M)))break;s=s[M]}return P||++y!=R?P:(R=s==null?0:s.length,!!R&&pp(R)&&qs(M,R)&&(Je(s)||Eo(s)))}function i6(s){var a=s.length,h=new s.constructor(a);return a&&typeof s[0]=="string"&&Ot.call(s,"index")&&(h.index=s.index,h.input=s.input),h}function h_(s){return typeof s.constructor=="function"&&!Ku(s)?Rc(ql(s)):{}}function n6(s,a,h){var y=s.constructor;switch(a){case At:return d0(s);case pe:case ye:return new y(+s);case Be:return HA(s,h);case Bt:case Mt:case Ue:case Ct:case Lt:case De:case Ut:case Dt:case qe:return Yb(s,h);case st:return new y;case et:case Me:return new y(s);case Rt:return zA(s);case vt:return new y;case Pt:return VA(s)}}function s6(s,a){var h=a.length;if(!h)return s;var y=h-1;return a[y]=(h>1?"& ":"")+a[y],a=a.join(h>2?", ":" "),s.replace(Ye,`{
9
9
  /* [wrapped with `+a+`] */
10
- `)}function a6(s){return Je(s)||Eo(s)||!!(xb&&s&&s[xb])}function qs(s,a){var h=typeof s;return a=a??S,!!a&&(h=="number"||h!="symbol"&&Is.test(s))&&s>-1&&s%1==0&&s<a}function gi(s,a,h){if(!gr(h))return!1;var y=typeof a;return(y=="number"?Ei(h)&&qs(a,h.length):y=="string"&&a in h)?Tn(h[a],s):!1}function w0(s,a){if(Je(s))return!1;var h=typeof s;return h=="number"||h=="symbol"||h=="boolean"||s==null||Hi(s)?!0:Ge.test(s)||!sr.test(s)||a!=null&&s in zt(a)}function o6(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function S0(s){var a=np(s),h=k[a];if(typeof h!="function"||!(a in dt.prototype))return!1;if(s===h)return!0;var y=b0(h);return!!y&&s===y[0]}function c6(s){return!!db&&db in s}var u6=Ml?Fs:F0;function Ku(s){var a=s&&s.constructor,h=typeof a=="function"&&a.prototype||Ec;return s===h}function d_(s){return s===s&&!gr(s)}function m_(s,a){return function(h){return h==null?!1:h[s]===a&&(a!==e||s in zt(h))}}function f6(s){var a=fp(s,function(y){return h.size===m&&h.clear(),y}),h=a.cache;return a}function l6(s,a){var h=s[1],y=a[1],R=h|y,P=R<(B|U|ge),M=y==ge&&h==$||y==ge&&h==Se&&s[7].length<=a[8]||y==(ge|Se)&&a[7].length<=a[8]&&h==$;if(!(P||M))return s;y&B&&(s[2]=a[2],R|=h&B?0:Z);var L=a[3];if(L){var F=s[3];s[3]=F?Xb(F,L,a[4]):L,s[4]=F?ya(s[3],_):a[4]}return L=a[5],L&&(F=s[5],s[5]=F?Jb(F,L,a[6]):L,s[6]=F?ya(s[5],_):a[6]),L=a[7],L&&(s[7]=L),y&ge&&(s[8]=s[8]==null?a[8]:oi(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=R,s}function p6(s){var a=[];if(s!=null)for(var h in zt(s))a.push(h);return a}function h6(s){return Ll.call(s)}function v_(s,a,h){return a=zr(a===e?s.length-1:a,0),function(){for(var y=arguments,R=-1,P=zr(y.length-a,0),M=G(P);++R<P;)M[R]=y[a+R];R=-1;for(var L=G(a+1);++R<a;)L[R]=y[R];return L[a]=h(M),Di(s,this,L)}}function g_(s,a){return a.length<2?s:yo(s,on(a,0,-1))}function d6(s,a){for(var h=s.length,y=oi(a.length,h),R=Si(s);y--;){var P=a[y];s[y]=qs(P,h)?R[P]:e}return s}function E0(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var x_=__(Hb),Gu=OR||function(s,a){return $r.setTimeout(s,a)},I0=__(UA);function b_(s,a,h){var y=a+"";return I0(s,s6(y,m6(r6(y),h)))}function __(s){var a=0,h=0;return function(){var y=BR(),R=c-(y-h);if(h=y,R>0){if(++a>=f)return arguments[0]}else a=0;return s.apply(e,arguments)}}function ap(s,a){var h=-1,y=s.length,R=y-1;for(a=a===e?y:a;++h<a;){var P=o0(h,R),M=s[P];s[P]=s[h],s[h]=M}return s.length=a,s}var y_=f6(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ar,function(h,y,R,P){a.push(R?P.replace(lr,"$1"):y||h)}),a});function ts(s){if(typeof s=="string"||Hi(s))return s;var a=s+"";return a=="0"&&1/s==-x?"-0":a}function So(s){if(s!=null){try{return Cl.call(s)}catch{}try{return s+""}catch{}}return""}function m6(s,a){return rn(V,function(h){var y="_."+h[0];a&h[1]&&!kl(s,y)&&s.push(y)}),s.sort()}function w_(s){if(s instanceof dt)return s.clone();var a=new sn(s.__wrapped__,s.__chain__);return a.__actions__=Si(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function v6(s,a,h){(h?gi(s,a,h):a===e)?a=1:a=zr(at(a),0);var y=s==null?0:s.length;if(!y||a<1)return[];for(var R=0,P=0,M=G(zl(y/a));R<y;)M[P++]=on(s,R,R+=a);return M}function g6(s){for(var a=-1,h=s==null?0:s.length,y=0,R=[];++a<h;){var P=s[a];P&&(R[y++]=P)}return R}function x6(){var s=arguments.length;if(!s)return[];for(var a=G(s-1),h=arguments[0],y=s;y--;)a[y-1]=arguments[y];return _a(Je(h)?Si(h):[h],ii(a,1))}var b6=ft(function(s,a){return Er(s)?Hu(s,ii(a,1,Er,!0)):[]}),_6=ft(function(s,a){var h=cn(a);return Er(h)&&(h=e),Er(s)?Hu(s,ii(a,1,Er,!0),Oe(h,2)):[]}),y6=ft(function(s,a){var h=cn(a);return Er(h)&&(h=e),Er(s)?Hu(s,ii(a,1,Er,!0),e,h):[]});function w6(s,a,h){var y=s==null?0:s.length;return y?(a=h||a===e?1:at(a),on(s,a<0?0:a,y)):[]}function S6(s,a,h){var y=s==null?0:s.length;return y?(a=h||a===e?1:at(a),a=y-a,on(s,0,a<0?0:a)):[]}function E6(s,a){return s&&s.length?Jl(s,Oe(a,3),!0,!0):[]}function I6(s,a){return s&&s.length?Jl(s,Oe(a,3),!0):[]}function T6(s,a,h,y){var R=s==null?0:s.length;return R?(h&&typeof h!="number"&&gi(s,a,h)&&(h=0,y=R),xA(s,a,h,y)):[]}function S_(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=h==null?0:at(h);return R<0&&(R=zr(y+R,0)),Pl(s,Oe(a,3),R)}function E_(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=y-1;return h!==e&&(R=at(h),R=h<0?zr(y+R,0):oi(R,y-1)),Pl(s,Oe(a,3),R,!0)}function I_(s){var a=s==null?0:s.length;return a?ii(s,1):[]}function R6(s){var a=s==null?0:s.length;return a?ii(s,x):[]}function A6(s,a){var h=s==null?0:s.length;return h?(a=a===e?1:at(a),ii(s,a)):[]}function O6(s){for(var a=-1,h=s==null?0:s.length,y={};++a<h;){var R=s[a];y[R[0]]=R[1]}return y}function T_(s){return s&&s.length?s[0]:e}function k6(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=h==null?0:at(h);return R<0&&(R=zr(y+R,0)),yc(s,a,R)}function P6(s){var a=s==null?0:s.length;return a?on(s,0,-1):[]}var N6=ft(function(s){var a=mr(s,p0);return a.length&&a[0]===s[0]?r0(a):[]}),B6=ft(function(s){var a=cn(s),h=mr(s,p0);return a===cn(h)?a=e:h.pop(),h.length&&h[0]===s[0]?r0(h,Oe(a,2)):[]}),M6=ft(function(s){var a=cn(s),h=mr(s,p0);return a=typeof a=="function"?a:e,a&&h.pop(),h.length&&h[0]===s[0]?r0(h,e,a):[]});function C6(s,a){return s==null?"":PR.call(s,a)}function cn(s){var a=s==null?0:s.length;return a?s[a-1]:e}function L6(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=y;return h!==e&&(R=at(h),R=R<0?zr(y+R,0):oi(R,y-1)),a===a?mR(s,a,R):Pl(s,ab,R,!0)}function U6(s,a){return s&&s.length?Ub(s,at(a)):e}var D6=ft(R_);function R_(s,a){return s&&s.length&&a&&a.length?a0(s,a):s}function q6(s,a,h){return s&&s.length&&a&&a.length?a0(s,a,Oe(h,2)):s}function F6(s,a,h){return s&&s.length&&a&&a.length?a0(s,a,e,h):s}var H6=Ds(function(s,a){var h=s==null?0:s.length,y=Jd(s,a);return Fb(s,mr(a,function(R){return qs(R,h)?+R:R}).sort(Zb)),y});function z6(s,a){var h=[];if(!(s&&s.length))return h;var y=-1,R=[],P=s.length;for(a=Oe(a,3);++y<P;){var M=s[y];a(M,y,s)&&(h.push(M),R.push(y))}return Fb(s,R),h}function T0(s){return s==null?s:CR.call(s)}function V6(s,a,h){var y=s==null?0:s.length;return y?(h&&typeof h!="number"&&gi(s,a,h)?(a=0,h=y):(a=a==null?0:at(a),h=h===e?y:at(h)),on(s,a,h)):[]}function j6(s,a){return Xl(s,a)}function W6(s,a,h){return u0(s,a,Oe(h,2))}function K6(s,a){var h=s==null?0:s.length;if(h){var y=Xl(s,a);if(y<h&&Tn(s[y],a))return y}return-1}function G6(s,a){return Xl(s,a,!0)}function $6(s,a,h){return u0(s,a,Oe(h,2),!0)}function Y6(s,a){var h=s==null?0:s.length;if(h){var y=Xl(s,a,!0)-1;if(Tn(s[y],a))return y}return-1}function Z6(s){return s&&s.length?zb(s):[]}function X6(s,a){return s&&s.length?zb(s,Oe(a,2)):[]}function J6(s){var a=s==null?0:s.length;return a?on(s,1,a):[]}function Q6(s,a,h){return s&&s.length?(a=h||a===e?1:at(a),on(s,0,a<0?0:a)):[]}function e4(s,a,h){var y=s==null?0:s.length;return y?(a=h||a===e?1:at(a),a=y-a,on(s,a<0?0:a,y)):[]}function t4(s,a){return s&&s.length?Jl(s,Oe(a,3),!1,!0):[]}function r4(s,a){return s&&s.length?Jl(s,Oe(a,3)):[]}var i4=ft(function(s){return Ia(ii(s,1,Er,!0))}),n4=ft(function(s){var a=cn(s);return Er(a)&&(a=e),Ia(ii(s,1,Er,!0),Oe(a,2))}),s4=ft(function(s){var a=cn(s);return a=typeof a=="function"?a:e,Ia(ii(s,1,Er,!0),e,a)});function a4(s){return s&&s.length?Ia(s):[]}function o4(s,a){return s&&s.length?Ia(s,Oe(a,2)):[]}function c4(s,a){return a=typeof a=="function"?a:e,s&&s.length?Ia(s,e,a):[]}function R0(s){if(!(s&&s.length))return[];var a=0;return s=ba(s,function(h){if(Er(h))return a=zr(h.length,a),!0}),jd(a,function(h){return mr(s,Hd(h))})}function A_(s,a){if(!(s&&s.length))return[];var h=R0(s);return a==null?h:mr(h,function(y){return Di(a,e,y)})}var u4=ft(function(s,a){return Er(s)?Hu(s,a):[]}),f4=ft(function(s){return l0(ba(s,Er))}),l4=ft(function(s){var a=cn(s);return Er(a)&&(a=e),l0(ba(s,Er),Oe(a,2))}),p4=ft(function(s){var a=cn(s);return a=typeof a=="function"?a:e,l0(ba(s,Er),e,a)}),h4=ft(R0);function d4(s,a){return Kb(s||[],a||[],Fu)}function m4(s,a){return Kb(s||[],a||[],ju)}var v4=ft(function(s){var a=s.length,h=a>1?s[a-1]:e;return h=typeof h=="function"?(s.pop(),h):e,A_(s,h)});function O_(s){var a=k(s);return a.__chain__=!0,a}function g4(s,a){return a(s),s}function op(s,a){return a(s)}var x4=Ds(function(s){var a=s.length,h=a?s[0]:0,y=this.__wrapped__,R=function(P){return Jd(P,s)};return a>1||this.__actions__.length||!(y instanceof dt)||!qs(h)?this.thru(R):(y=y.slice(h,+h+(a?1:0)),y.__actions__.push({func:op,args:[R],thisArg:e}),new sn(y,this.__chain__).thru(function(P){return a&&!P.length&&P.push(e),P}))});function b4(){return O_(this)}function _4(){return new sn(this.value(),this.__chain__)}function y4(){this.__values__===e&&(this.__values__=V_(this.value()));var s=this.__index__>=this.__values__.length,a=s?e:this.__values__[this.__index__++];return{done:s,value:a}}function w4(){return this}function S4(s){for(var a,h=this;h instanceof Kl;){var y=w_(h);y.__index__=0,y.__values__=e,a?R.__wrapped__=y:a=y;var R=y;h=h.__wrapped__}return R.__wrapped__=s,a}function E4(){var s=this.__wrapped__;if(s instanceof dt){var a=s;return this.__actions__.length&&(a=new dt(this)),a=a.reverse(),a.__actions__.push({func:op,args:[T0],thisArg:e}),new sn(a,this.__chain__)}return this.thru(T0)}function I4(){return Wb(this.__wrapped__,this.__actions__)}var T4=Ql(function(s,a,h){Ot.call(s,h)?++s[h]:Ls(s,h,1)});function R4(s,a,h){var y=Je(s)?nb:gA;return h&&gi(s,a,h)&&(a=e),y(s,Oe(a,3))}function A4(s,a){var h=Je(s)?ba:Ab;return h(s,Oe(a,3))}var O4=r_(S_),k4=r_(E_);function P4(s,a){return ii(cp(s,a),1)}function N4(s,a){return ii(cp(s,a),x)}function B4(s,a,h){return h=h===e?1:at(h),ii(cp(s,a),h)}function k_(s,a){var h=Je(s)?rn:Ea;return h(s,Oe(a,3))}function P_(s,a){var h=Je(s)?JT:Rb;return h(s,Oe(a,3))}var M4=Ql(function(s,a,h){Ot.call(s,h)?s[h].push(a):Ls(s,h,[a])});function C4(s,a,h,y){s=Ei(s)?s:Nc(s),h=h&&!y?at(h):0;var R=s.length;return h<0&&(h=zr(R+h,0)),hp(s)?h<=R&&s.indexOf(a,h)>-1:!!R&&yc(s,a,h)>-1}var L4=ft(function(s,a,h){var y=-1,R=typeof a=="function",P=Ei(s)?G(s.length):[];return Ea(s,function(M){P[++y]=R?Di(a,M,h):zu(M,a,h)}),P}),U4=Ql(function(s,a,h){Ls(s,h,a)});function cp(s,a){var h=Je(s)?mr:Mb;return h(s,Oe(a,3))}function D4(s,a,h,y){return s==null?[]:(Je(a)||(a=a==null?[]:[a]),h=y?e:h,Je(h)||(h=h==null?[]:[h]),Db(s,a,h))}var q4=Ql(function(s,a,h){s[h?0:1].push(a)},function(){return[[],[]]});function F4(s,a,h){var y=Je(s)?qd:cb,R=arguments.length<3;return y(s,Oe(a,4),h,R,Ea)}function H4(s,a,h){var y=Je(s)?QT:cb,R=arguments.length<3;return y(s,Oe(a,4),h,R,Rb)}function z4(s,a){var h=Je(s)?ba:Ab;return h(s,lp(Oe(a,3)))}function V4(s){var a=Je(s)?Sb:CA;return a(s)}function j4(s,a,h){(h?gi(s,a,h):a===e)?a=1:a=at(a);var y=Je(s)?pA:LA;return y(s,a)}function W4(s){var a=Je(s)?hA:DA;return a(s)}function K4(s){if(s==null)return 0;if(Ei(s))return hp(s)?Sc(s):s.length;var a=ci(s);return a==st||a==vt?s.size:n0(s).length}function G4(s,a,h){var y=Je(s)?Fd:qA;return h&&gi(s,a,h)&&(a=e),y(s,Oe(a,3))}var $4=ft(function(s,a){if(s==null)return[];var h=a.length;return h>1&&gi(s,a[0],a[1])?a=[]:h>2&&gi(a[0],a[1],a[2])&&(a=[a[0]]),Db(s,ii(a,1),[])}),up=AR||function(){return $r.Date.now()};function Y4(s,a){if(typeof a!="function")throw new nn(n);return s=at(s),function(){if(--s<1)return a.apply(this,arguments)}}function N_(s,a,h){return a=h?e:a,a=s&&a==null?s.length:a,Us(s,ge,e,e,e,e,a)}function B_(s,a){var h;if(typeof a!="function")throw new nn(n);return s=at(s),function(){return--s>0&&(h=a.apply(this,arguments)),s<=1&&(a=e),h}}var A0=ft(function(s,a,h){var y=B;if(h.length){var R=ya(h,kc(A0));y|=ee}return Us(s,y,a,h,R)}),M_=ft(function(s,a,h){var y=B|U;if(h.length){var R=ya(h,kc(M_));y|=ee}return Us(a,y,s,h,R)});function C_(s,a,h){a=h?e:a;var y=Us(s,$,e,e,e,e,e,a);return y.placeholder=C_.placeholder,y}function L_(s,a,h){a=h?e:a;var y=Us(s,H,e,e,e,e,e,a);return y.placeholder=L_.placeholder,y}function U_(s,a,h){var y,R,P,M,L,F,te=0,re=!1,oe=!1,he=!0;if(typeof s!="function")throw new nn(n);a=un(a)||0,gr(h)&&(re=!!h.leading,oe="maxWait"in h,P=oe?zr(un(h.maxWait)||0,a):P,he="trailing"in h?!!h.trailing:he);function Ee(Ir){var Rn=y,zs=R;return y=R=e,te=Ir,M=s.apply(zs,Rn),M}function ke(Ir){return te=Ir,L=Gu(pt,a),re?Ee(Ir):M}function ct(Ir){var Rn=Ir-F,zs=Ir-te,r1=a-Rn;return oe?oi(r1,P-zs):r1}function Pe(Ir){var Rn=Ir-F,zs=Ir-te;return F===e||Rn>=a||Rn<0||oe&&zs>=P}function pt(){var Ir=up();if(Pe(Ir))return gt(Ir);L=Gu(pt,ct(Ir))}function gt(Ir){return L=e,he&&y?Ee(Ir):(y=R=e,M)}function zi(){L!==e&&Gb(L),te=0,y=F=R=L=e}function xi(){return L===e?M:gt(up())}function Vi(){var Ir=up(),Rn=Pe(Ir);if(y=arguments,R=this,F=Ir,Rn){if(L===e)return ke(F);if(oe)return Gb(L),L=Gu(pt,a),Ee(F)}return L===e&&(L=Gu(pt,a)),M}return Vi.cancel=zi,Vi.flush=xi,Vi}var Z4=ft(function(s,a){return Tb(s,1,a)}),X4=ft(function(s,a,h){return Tb(s,un(a)||0,h)});function J4(s){return Us(s,me)}function fp(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new nn(n);var h=function(){var y=arguments,R=a?a.apply(this,y):y[0],P=h.cache;if(P.has(R))return P.get(R);var M=s.apply(this,y);return h.cache=P.set(R,M)||P,M};return h.cache=new(fp.Cache||Cs),h}fp.Cache=Cs;function lp(s){if(typeof s!="function")throw new nn(n);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function Q4(s){return B_(2,s)}var eO=FA(function(s,a){a=a.length==1&&Je(a[0])?mr(a[0],qi(Oe())):mr(ii(a,1),qi(Oe()));var h=a.length;return ft(function(y){for(var R=-1,P=oi(y.length,h);++R<P;)y[R]=a[R].call(this,y[R]);return Di(s,this,y)})}),O0=ft(function(s,a){var h=ya(a,kc(O0));return Us(s,ee,e,a,h)}),D_=ft(function(s,a){var h=ya(a,kc(D_));return Us(s,ce,e,a,h)}),tO=Ds(function(s,a){return Us(s,Se,e,e,e,a)});function rO(s,a){if(typeof s!="function")throw new nn(n);return a=a===e?a:at(a),ft(s,a)}function iO(s,a){if(typeof s!="function")throw new nn(n);return a=a==null?0:zr(at(a),0),ft(function(h){var y=h[a],R=Ra(h,0,a);return y&&_a(R,y),Di(s,this,R)})}function nO(s,a,h){var y=!0,R=!0;if(typeof s!="function")throw new nn(n);return gr(h)&&(y="leading"in h?!!h.leading:y,R="trailing"in h?!!h.trailing:R),U_(s,a,{leading:y,maxWait:a,trailing:R})}function sO(s){return N_(s,1)}function aO(s,a){return O0(h0(a),s)}function oO(){if(!arguments.length)return[];var s=arguments[0];return Je(s)?s:[s]}function cO(s){return an(s,T)}function uO(s,a){return a=typeof a=="function"?a:e,an(s,T,a)}function fO(s){return an(s,w|T)}function lO(s,a){return a=typeof a=="function"?a:e,an(s,w|T,a)}function pO(s,a){return a==null||Ib(s,a,Yr(a))}function Tn(s,a){return s===a||s!==s&&a!==a}var hO=ip(t0),dO=ip(function(s,a){return s>=a}),Eo=Pb(function(){return arguments}())?Pb:function(s){return br(s)&&Ot.call(s,"callee")&&!gb.call(s,"callee")},Je=G.isArray,mO=Jx?qi(Jx):SA;function Ei(s){return s!=null&&pp(s.length)&&!Fs(s)}function Er(s){return br(s)&&Ei(s)}function vO(s){return s===!0||s===!1||br(s)&&vi(s)==pe}var Aa=kR||F0,gO=Qx?qi(Qx):EA;function xO(s){return br(s)&&s.nodeType===1&&!$u(s)}function bO(s){if(s==null)return!0;if(Ei(s)&&(Je(s)||typeof s=="string"||typeof s.splice=="function"||Aa(s)||Pc(s)||Eo(s)))return!s.length;var a=ci(s);if(a==st||a==vt)return!s.size;if(Ku(s))return!n0(s).length;for(var h in s)if(Ot.call(s,h))return!1;return!0}function _O(s,a){return Vu(s,a)}function yO(s,a,h){h=typeof h=="function"?h:e;var y=h?h(s,a):e;return y===e?Vu(s,a,e,h):!!y}function k0(s){if(!br(s))return!1;var a=vi(s);return a==ht||a==de||typeof s.message=="string"&&typeof s.name=="string"&&!$u(s)}function wO(s){return typeof s=="number"&&bb(s)}function Fs(s){if(!gr(s))return!1;var a=vi(s);return a==wt||a==Re||a==ae||a==Ve}function q_(s){return typeof s=="number"&&s==at(s)}function pp(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=S}function gr(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function br(s){return s!=null&&typeof s=="object"}var F_=eb?qi(eb):TA;function SO(s,a){return s===a||i0(s,a,_0(a))}function EO(s,a,h){return h=typeof h=="function"?h:e,i0(s,a,_0(a),h)}function IO(s){return H_(s)&&s!=+s}function TO(s){if(u6(s))throw new He(i);return Nb(s)}function RO(s){return s===null}function AO(s){return s==null}function H_(s){return typeof s=="number"||br(s)&&vi(s)==et}function $u(s){if(!br(s)||vi(s)!=Te)return!1;var a=ql(s);if(a===null)return!0;var h=Ot.call(a,"constructor")&&a.constructor;return typeof h=="function"&&h instanceof h&&Cl.call(h)==ER}var P0=tb?qi(tb):RA;function OO(s){return q_(s)&&s>=-S&&s<=S}var z_=rb?qi(rb):AA;function hp(s){return typeof s=="string"||!Je(s)&&br(s)&&vi(s)==Me}function Hi(s){return typeof s=="symbol"||br(s)&&vi(s)==Pt}var Pc=ib?qi(ib):OA;function kO(s){return s===e}function PO(s){return br(s)&&ci(s)==Ce}function NO(s){return br(s)&&vi(s)==er}var BO=ip(s0),MO=ip(function(s,a){return s<=a});function V_(s){if(!s)return[];if(Ei(s))return hp(s)?En(s):Si(s);if(Cu&&s[Cu])return pR(s[Cu]());var a=ci(s),h=a==st?Kd:a==vt?Nl:Nc;return h(s)}function Hs(s){if(!s)return s===0?s:0;if(s=un(s),s===x||s===-x){var a=s<0?-1:1;return a*b}return s===s?s:0}function at(s){var a=Hs(s),h=a%1;return a===a?h?a-h:a:0}function j_(s){return s?_o(at(s),0,d):0}function un(s){if(typeof s=="number")return s;if(Hi(s))return l;if(gr(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=gr(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=ub(s);var h=ws.test(s);return h||Es.test(s)?YT(s.slice(2),h?2:8):ys.test(s)?l:+s}function W_(s){return es(s,Ii(s))}function CO(s){return s?_o(at(s),-S,S):s===0?s:0}function Tt(s){return s==null?"":Fi(s)}var LO=Ac(function(s,a){if(Ku(a)||Ei(a)){es(a,Yr(a),s);return}for(var h in a)Ot.call(a,h)&&Fu(s,h,a[h])}),K_=Ac(function(s,a){es(a,Ii(a),s)}),dp=Ac(function(s,a,h,y){es(a,Ii(a),s,y)}),UO=Ac(function(s,a,h,y){es(a,Yr(a),s,y)}),DO=Ds(Jd);function qO(s,a){var h=Rc(s);return a==null?h:Eb(h,a)}var FO=ft(function(s,a){s=zt(s);var h=-1,y=a.length,R=y>2?a[2]:e;for(R&&gi(a[0],a[1],R)&&(y=1);++h<y;)for(var P=a[h],M=Ii(P),L=-1,F=M.length;++L<F;){var te=M[L],re=s[te];(re===e||Tn(re,Ec[te])&&!Ot.call(s,te))&&(s[te]=P[te])}return s}),HO=ft(function(s){return s.push(e,u_),Di(G_,e,s)});function zO(s,a){return sb(s,Oe(a,3),Qn)}function VO(s,a){return sb(s,Oe(a,3),e0)}function jO(s,a){return s==null?s:Qd(s,Oe(a,3),Ii)}function WO(s,a){return s==null?s:Ob(s,Oe(a,3),Ii)}function KO(s,a){return s&&Qn(s,Oe(a,3))}function GO(s,a){return s&&e0(s,Oe(a,3))}function $O(s){return s==null?[]:Yl(s,Yr(s))}function YO(s){return s==null?[]:Yl(s,Ii(s))}function N0(s,a,h){var y=s==null?e:yo(s,a);return y===e?h:y}function ZO(s,a){return s!=null&&p_(s,a,bA)}function B0(s,a){return s!=null&&p_(s,a,_A)}var XO=n_(function(s,a,h){a!=null&&typeof a.toString!="function"&&(a=Ll.call(a)),s[a]=h},C0(Ti)),JO=n_(function(s,a,h){a!=null&&typeof a.toString!="function"&&(a=Ll.call(a)),Ot.call(s,a)?s[a].push(h):s[a]=[h]},Oe),QO=ft(zu);function Yr(s){return Ei(s)?wb(s):n0(s)}function Ii(s){return Ei(s)?wb(s,!0):kA(s)}function e8(s,a){var h={};return a=Oe(a,3),Qn(s,function(y,R,P){Ls(h,a(y,R,P),y)}),h}function t8(s,a){var h={};return a=Oe(a,3),Qn(s,function(y,R,P){Ls(h,R,a(y,R,P))}),h}var r8=Ac(function(s,a,h){Zl(s,a,h)}),G_=Ac(function(s,a,h,y){Zl(s,a,h,y)}),i8=Ds(function(s,a){var h={};if(s==null)return h;var y=!1;a=mr(a,function(P){return P=Ta(P,s),y||(y=P.length>1),P}),es(s,x0(s),h),y&&(h=an(h,w|I|T,XA));for(var R=a.length;R--;)f0(h,a[R]);return h});function n8(s,a){return $_(s,lp(Oe(a)))}var s8=Ds(function(s,a){return s==null?{}:NA(s,a)});function $_(s,a){if(s==null)return{};var h=mr(x0(s),function(y){return[y]});return a=Oe(a),qb(s,h,function(y,R){return a(y,R[0])})}function a8(s,a,h){a=Ta(a,s);var y=-1,R=a.length;for(R||(R=1,s=e);++y<R;){var P=s==null?e:s[ts(a[y])];P===e&&(y=R,P=h),s=Fs(P)?P.call(s):P}return s}function o8(s,a,h){return s==null?s:ju(s,a,h)}function c8(s,a,h,y){return y=typeof y=="function"?y:e,s==null?s:ju(s,a,h,y)}var Y_=o_(Yr),Z_=o_(Ii);function u8(s,a,h){var y=Je(s),R=y||Aa(s)||Pc(s);if(a=Oe(a,4),h==null){var P=s&&s.constructor;R?h=y?new P:[]:gr(s)?h=Fs(P)?Rc(ql(s)):{}:h={}}return(R?rn:Qn)(s,function(M,L,F){return a(h,M,L,F)}),h}function f8(s,a){return s==null?!0:f0(s,a)}function l8(s,a,h){return s==null?s:jb(s,a,h0(h))}function p8(s,a,h,y){return y=typeof y=="function"?y:e,s==null?s:jb(s,a,h0(h),y)}function Nc(s){return s==null?[]:Wd(s,Yr(s))}function h8(s){return s==null?[]:Wd(s,Ii(s))}function d8(s,a,h){return h===e&&(h=a,a=e),h!==e&&(h=un(h),h=h===h?h:0),a!==e&&(a=un(a),a=a===a?a:0),_o(un(s),a,h)}function m8(s,a,h){return a=Hs(a),h===e?(h=a,a=0):h=Hs(h),s=un(s),yA(s,a,h)}function v8(s,a,h){if(h&&typeof h!="boolean"&&gi(s,a,h)&&(a=h=e),h===e&&(typeof a=="boolean"?(h=a,a=e):typeof s=="boolean"&&(h=s,s=e)),s===e&&a===e?(s=0,a=1):(s=Hs(s),a===e?(a=s,s=0):a=Hs(a)),s>a){var y=s;s=a,a=y}if(h||s%1||a%1){var R=_b();return oi(s+R*(a-s+$T("1e-"+((R+"").length-1))),a)}return o0(s,a)}var g8=Oc(function(s,a,h){return a=a.toLowerCase(),s+(h?X_(a):a)});function X_(s){return M0(Tt(s).toLowerCase())}function J_(s){return s=Tt(s),s&&s.replace(Ts,oR).replace(DT,"")}function x8(s,a,h){s=Tt(s),a=Fi(a);var y=s.length;h=h===e?y:_o(at(h),0,y);var R=h;return h-=a.length,h>=0&&s.slice(h,R)==a}function b8(s){return s=Tt(s),s&&ir.test(s)?s.replace(Kt,cR):s}function _8(s){return s=Tt(s),s&&$e.test(s)?s.replace(qt,"\\$&"):s}var y8=Oc(function(s,a,h){return s+(h?"-":"")+a.toLowerCase()}),w8=Oc(function(s,a,h){return s+(h?" ":"")+a.toLowerCase()}),S8=t_("toLowerCase");function E8(s,a,h){s=Tt(s),a=at(a);var y=a?Sc(s):0;if(!a||y>=a)return s;var R=(a-y)/2;return rp(Vl(R),h)+s+rp(zl(R),h)}function I8(s,a,h){s=Tt(s),a=at(a);var y=a?Sc(s):0;return a&&y<a?s+rp(a-y,h):s}function T8(s,a,h){s=Tt(s),a=at(a);var y=a?Sc(s):0;return a&&y<a?rp(a-y,h)+s:s}function R8(s,a,h){return h||a==null?a=0:a&&(a=+a),MR(Tt(s).replace(Ft,""),a||0)}function A8(s,a,h){return(h?gi(s,a,h):a===e)?a=1:a=at(a),c0(Tt(s),a)}function O8(){var s=arguments,a=Tt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var k8=Oc(function(s,a,h){return s+(h?"_":"")+a.toLowerCase()});function P8(s,a,h){return h&&typeof h!="number"&&gi(s,a,h)&&(a=h=e),h=h===e?d:h>>>0,h?(s=Tt(s),s&&(typeof a=="string"||a!=null&&!P0(a))&&(a=Fi(a),!a&&wc(s))?Ra(En(s),0,h):s.split(a,h)):[]}var N8=Oc(function(s,a,h){return s+(h?" ":"")+M0(a)});function B8(s,a,h){return s=Tt(s),h=h==null?0:_o(at(h),0,s.length),a=Fi(a),s.slice(h,h+a.length)==a}function M8(s,a,h){var y=k.templateSettings;h&&gi(s,a,h)&&(a=e),s=Tt(s),a=dp({},a,y,c_);var R=dp({},a.imports,y.imports,c_),P=Yr(R),M=Wd(R,P),L,F,te=0,re=a.interpolate||Qi,oe="__p += '",he=Gd((a.escape||Qi).source+"|"+re.source+"|"+(re===Gt?Xe:Qi).source+"|"+(a.evaluate||Qi).source+"|$","g"),Ee="//# sourceURL="+(Ot.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++VT+"]")+`
10
+ `)}function a6(s){return Je(s)||Eo(s)||!!(xb&&s&&s[xb])}function qs(s,a){var h=typeof s;return a=a??S,!!a&&(h=="number"||h!="symbol"&&Is.test(s))&&s>-1&&s%1==0&&s<a}function gi(s,a,h){if(!gr(h))return!1;var y=typeof a;return(y=="number"?Ei(h)&&qs(a,h.length):y=="string"&&a in h)?Tn(h[a],s):!1}function w0(s,a){if(Je(s))return!1;var h=typeof s;return h=="number"||h=="symbol"||h=="boolean"||s==null||Hi(s)?!0:Ge.test(s)||!sr.test(s)||a!=null&&s in zt(a)}function o6(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function S0(s){var a=np(s),h=k[a];if(typeof h!="function"||!(a in dt.prototype))return!1;if(s===h)return!0;var y=b0(h);return!!y&&s===y[0]}function c6(s){return!!db&&db in s}var u6=Ml?Fs:F0;function Ku(s){var a=s&&s.constructor,h=typeof a=="function"&&a.prototype||Ec;return s===h}function d_(s){return s===s&&!gr(s)}function m_(s,a){return function(h){return h==null?!1:h[s]===a&&(a!==e||s in zt(h))}}function f6(s){var a=fp(s,function(y){return h.size===m&&h.clear(),y}),h=a.cache;return a}function l6(s,a){var h=s[1],y=a[1],R=h|y,P=R<(B|U|ge),M=y==ge&&h==$||y==ge&&h==Se&&s[7].length<=a[8]||y==(ge|Se)&&a[7].length<=a[8]&&h==$;if(!(P||M))return s;y&B&&(s[2]=a[2],R|=h&B?0:Z);var L=a[3];if(L){var F=s[3];s[3]=F?Xb(F,L,a[4]):L,s[4]=F?ya(s[3],_):a[4]}return L=a[5],L&&(F=s[5],s[5]=F?Jb(F,L,a[6]):L,s[6]=F?ya(s[5],_):a[6]),L=a[7],L&&(s[7]=L),y&ge&&(s[8]=s[8]==null?a[8]:oi(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=R,s}function p6(s){var a=[];if(s!=null)for(var h in zt(s))a.push(h);return a}function h6(s){return Ll.call(s)}function v_(s,a,h){return a=zr(a===e?s.length-1:a,0),function(){for(var y=arguments,R=-1,P=zr(y.length-a,0),M=G(P);++R<P;)M[R]=y[a+R];R=-1;for(var L=G(a+1);++R<a;)L[R]=y[R];return L[a]=h(M),Di(s,this,L)}}function g_(s,a){return a.length<2?s:yo(s,on(a,0,-1))}function d6(s,a){for(var h=s.length,y=oi(a.length,h),R=Si(s);y--;){var P=a[y];s[y]=qs(P,h)?R[P]:e}return s}function E0(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var x_=__(Hb),Gu=OR||function(s,a){return $r.setTimeout(s,a)},I0=__(UA);function b_(s,a,h){var y=a+"";return I0(s,s6(y,m6(r6(y),h)))}function __(s){var a=0,h=0;return function(){var y=BR(),R=c-(y-h);if(h=y,R>0){if(++a>=f)return arguments[0]}else a=0;return s.apply(e,arguments)}}function ap(s,a){var h=-1,y=s.length,R=y-1;for(a=a===e?y:a;++h<a;){var P=o0(h,R),M=s[P];s[P]=s[h],s[h]=M}return s.length=a,s}var y_=f6(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ar,function(h,y,R,P){a.push(R?P.replace(lr,"$1"):y||h)}),a});function rs(s){if(typeof s=="string"||Hi(s))return s;var a=s+"";return a=="0"&&1/s==-x?"-0":a}function So(s){if(s!=null){try{return Cl.call(s)}catch{}try{return s+""}catch{}}return""}function m6(s,a){return rn(V,function(h){var y="_."+h[0];a&h[1]&&!kl(s,y)&&s.push(y)}),s.sort()}function w_(s){if(s instanceof dt)return s.clone();var a=new sn(s.__wrapped__,s.__chain__);return a.__actions__=Si(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function v6(s,a,h){(h?gi(s,a,h):a===e)?a=1:a=zr(at(a),0);var y=s==null?0:s.length;if(!y||a<1)return[];for(var R=0,P=0,M=G(zl(y/a));R<y;)M[P++]=on(s,R,R+=a);return M}function g6(s){for(var a=-1,h=s==null?0:s.length,y=0,R=[];++a<h;){var P=s[a];P&&(R[y++]=P)}return R}function x6(){var s=arguments.length;if(!s)return[];for(var a=G(s-1),h=arguments[0],y=s;y--;)a[y-1]=arguments[y];return _a(Je(h)?Si(h):[h],ii(a,1))}var b6=ft(function(s,a){return Er(s)?Hu(s,ii(a,1,Er,!0)):[]}),_6=ft(function(s,a){var h=cn(a);return Er(h)&&(h=e),Er(s)?Hu(s,ii(a,1,Er,!0),Oe(h,2)):[]}),y6=ft(function(s,a){var h=cn(a);return Er(h)&&(h=e),Er(s)?Hu(s,ii(a,1,Er,!0),e,h):[]});function w6(s,a,h){var y=s==null?0:s.length;return y?(a=h||a===e?1:at(a),on(s,a<0?0:a,y)):[]}function S6(s,a,h){var y=s==null?0:s.length;return y?(a=h||a===e?1:at(a),a=y-a,on(s,0,a<0?0:a)):[]}function E6(s,a){return s&&s.length?Jl(s,Oe(a,3),!0,!0):[]}function I6(s,a){return s&&s.length?Jl(s,Oe(a,3),!0):[]}function T6(s,a,h,y){var R=s==null?0:s.length;return R?(h&&typeof h!="number"&&gi(s,a,h)&&(h=0,y=R),xA(s,a,h,y)):[]}function S_(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=h==null?0:at(h);return R<0&&(R=zr(y+R,0)),Pl(s,Oe(a,3),R)}function E_(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=y-1;return h!==e&&(R=at(h),R=h<0?zr(y+R,0):oi(R,y-1)),Pl(s,Oe(a,3),R,!0)}function I_(s){var a=s==null?0:s.length;return a?ii(s,1):[]}function R6(s){var a=s==null?0:s.length;return a?ii(s,x):[]}function A6(s,a){var h=s==null?0:s.length;return h?(a=a===e?1:at(a),ii(s,a)):[]}function O6(s){for(var a=-1,h=s==null?0:s.length,y={};++a<h;){var R=s[a];y[R[0]]=R[1]}return y}function T_(s){return s&&s.length?s[0]:e}function k6(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=h==null?0:at(h);return R<0&&(R=zr(y+R,0)),yc(s,a,R)}function P6(s){var a=s==null?0:s.length;return a?on(s,0,-1):[]}var N6=ft(function(s){var a=mr(s,p0);return a.length&&a[0]===s[0]?r0(a):[]}),B6=ft(function(s){var a=cn(s),h=mr(s,p0);return a===cn(h)?a=e:h.pop(),h.length&&h[0]===s[0]?r0(h,Oe(a,2)):[]}),M6=ft(function(s){var a=cn(s),h=mr(s,p0);return a=typeof a=="function"?a:e,a&&h.pop(),h.length&&h[0]===s[0]?r0(h,e,a):[]});function C6(s,a){return s==null?"":PR.call(s,a)}function cn(s){var a=s==null?0:s.length;return a?s[a-1]:e}function L6(s,a,h){var y=s==null?0:s.length;if(!y)return-1;var R=y;return h!==e&&(R=at(h),R=R<0?zr(y+R,0):oi(R,y-1)),a===a?mR(s,a,R):Pl(s,ab,R,!0)}function U6(s,a){return s&&s.length?Ub(s,at(a)):e}var D6=ft(R_);function R_(s,a){return s&&s.length&&a&&a.length?a0(s,a):s}function q6(s,a,h){return s&&s.length&&a&&a.length?a0(s,a,Oe(h,2)):s}function F6(s,a,h){return s&&s.length&&a&&a.length?a0(s,a,e,h):s}var H6=Ds(function(s,a){var h=s==null?0:s.length,y=Jd(s,a);return Fb(s,mr(a,function(R){return qs(R,h)?+R:R}).sort(Zb)),y});function z6(s,a){var h=[];if(!(s&&s.length))return h;var y=-1,R=[],P=s.length;for(a=Oe(a,3);++y<P;){var M=s[y];a(M,y,s)&&(h.push(M),R.push(y))}return Fb(s,R),h}function T0(s){return s==null?s:CR.call(s)}function V6(s,a,h){var y=s==null?0:s.length;return y?(h&&typeof h!="number"&&gi(s,a,h)?(a=0,h=y):(a=a==null?0:at(a),h=h===e?y:at(h)),on(s,a,h)):[]}function j6(s,a){return Xl(s,a)}function W6(s,a,h){return u0(s,a,Oe(h,2))}function K6(s,a){var h=s==null?0:s.length;if(h){var y=Xl(s,a);if(y<h&&Tn(s[y],a))return y}return-1}function G6(s,a){return Xl(s,a,!0)}function $6(s,a,h){return u0(s,a,Oe(h,2),!0)}function Y6(s,a){var h=s==null?0:s.length;if(h){var y=Xl(s,a,!0)-1;if(Tn(s[y],a))return y}return-1}function Z6(s){return s&&s.length?zb(s):[]}function X6(s,a){return s&&s.length?zb(s,Oe(a,2)):[]}function J6(s){var a=s==null?0:s.length;return a?on(s,1,a):[]}function Q6(s,a,h){return s&&s.length?(a=h||a===e?1:at(a),on(s,0,a<0?0:a)):[]}function e4(s,a,h){var y=s==null?0:s.length;return y?(a=h||a===e?1:at(a),a=y-a,on(s,a<0?0:a,y)):[]}function t4(s,a){return s&&s.length?Jl(s,Oe(a,3),!1,!0):[]}function r4(s,a){return s&&s.length?Jl(s,Oe(a,3)):[]}var i4=ft(function(s){return Ia(ii(s,1,Er,!0))}),n4=ft(function(s){var a=cn(s);return Er(a)&&(a=e),Ia(ii(s,1,Er,!0),Oe(a,2))}),s4=ft(function(s){var a=cn(s);return a=typeof a=="function"?a:e,Ia(ii(s,1,Er,!0),e,a)});function a4(s){return s&&s.length?Ia(s):[]}function o4(s,a){return s&&s.length?Ia(s,Oe(a,2)):[]}function c4(s,a){return a=typeof a=="function"?a:e,s&&s.length?Ia(s,e,a):[]}function R0(s){if(!(s&&s.length))return[];var a=0;return s=ba(s,function(h){if(Er(h))return a=zr(h.length,a),!0}),jd(a,function(h){return mr(s,Hd(h))})}function A_(s,a){if(!(s&&s.length))return[];var h=R0(s);return a==null?h:mr(h,function(y){return Di(a,e,y)})}var u4=ft(function(s,a){return Er(s)?Hu(s,a):[]}),f4=ft(function(s){return l0(ba(s,Er))}),l4=ft(function(s){var a=cn(s);return Er(a)&&(a=e),l0(ba(s,Er),Oe(a,2))}),p4=ft(function(s){var a=cn(s);return a=typeof a=="function"?a:e,l0(ba(s,Er),e,a)}),h4=ft(R0);function d4(s,a){return Kb(s||[],a||[],Fu)}function m4(s,a){return Kb(s||[],a||[],ju)}var v4=ft(function(s){var a=s.length,h=a>1?s[a-1]:e;return h=typeof h=="function"?(s.pop(),h):e,A_(s,h)});function O_(s){var a=k(s);return a.__chain__=!0,a}function g4(s,a){return a(s),s}function op(s,a){return a(s)}var x4=Ds(function(s){var a=s.length,h=a?s[0]:0,y=this.__wrapped__,R=function(P){return Jd(P,s)};return a>1||this.__actions__.length||!(y instanceof dt)||!qs(h)?this.thru(R):(y=y.slice(h,+h+(a?1:0)),y.__actions__.push({func:op,args:[R],thisArg:e}),new sn(y,this.__chain__).thru(function(P){return a&&!P.length&&P.push(e),P}))});function b4(){return O_(this)}function _4(){return new sn(this.value(),this.__chain__)}function y4(){this.__values__===e&&(this.__values__=V_(this.value()));var s=this.__index__>=this.__values__.length,a=s?e:this.__values__[this.__index__++];return{done:s,value:a}}function w4(){return this}function S4(s){for(var a,h=this;h instanceof Kl;){var y=w_(h);y.__index__=0,y.__values__=e,a?R.__wrapped__=y:a=y;var R=y;h=h.__wrapped__}return R.__wrapped__=s,a}function E4(){var s=this.__wrapped__;if(s instanceof dt){var a=s;return this.__actions__.length&&(a=new dt(this)),a=a.reverse(),a.__actions__.push({func:op,args:[T0],thisArg:e}),new sn(a,this.__chain__)}return this.thru(T0)}function I4(){return Wb(this.__wrapped__,this.__actions__)}var T4=Ql(function(s,a,h){Ot.call(s,h)?++s[h]:Ls(s,h,1)});function R4(s,a,h){var y=Je(s)?nb:gA;return h&&gi(s,a,h)&&(a=e),y(s,Oe(a,3))}function A4(s,a){var h=Je(s)?ba:Ab;return h(s,Oe(a,3))}var O4=r_(S_),k4=r_(E_);function P4(s,a){return ii(cp(s,a),1)}function N4(s,a){return ii(cp(s,a),x)}function B4(s,a,h){return h=h===e?1:at(h),ii(cp(s,a),h)}function k_(s,a){var h=Je(s)?rn:Ea;return h(s,Oe(a,3))}function P_(s,a){var h=Je(s)?JT:Rb;return h(s,Oe(a,3))}var M4=Ql(function(s,a,h){Ot.call(s,h)?s[h].push(a):Ls(s,h,[a])});function C4(s,a,h,y){s=Ei(s)?s:Nc(s),h=h&&!y?at(h):0;var R=s.length;return h<0&&(h=zr(R+h,0)),hp(s)?h<=R&&s.indexOf(a,h)>-1:!!R&&yc(s,a,h)>-1}var L4=ft(function(s,a,h){var y=-1,R=typeof a=="function",P=Ei(s)?G(s.length):[];return Ea(s,function(M){P[++y]=R?Di(a,M,h):zu(M,a,h)}),P}),U4=Ql(function(s,a,h){Ls(s,h,a)});function cp(s,a){var h=Je(s)?mr:Mb;return h(s,Oe(a,3))}function D4(s,a,h,y){return s==null?[]:(Je(a)||(a=a==null?[]:[a]),h=y?e:h,Je(h)||(h=h==null?[]:[h]),Db(s,a,h))}var q4=Ql(function(s,a,h){s[h?0:1].push(a)},function(){return[[],[]]});function F4(s,a,h){var y=Je(s)?qd:cb,R=arguments.length<3;return y(s,Oe(a,4),h,R,Ea)}function H4(s,a,h){var y=Je(s)?QT:cb,R=arguments.length<3;return y(s,Oe(a,4),h,R,Rb)}function z4(s,a){var h=Je(s)?ba:Ab;return h(s,lp(Oe(a,3)))}function V4(s){var a=Je(s)?Sb:CA;return a(s)}function j4(s,a,h){(h?gi(s,a,h):a===e)?a=1:a=at(a);var y=Je(s)?pA:LA;return y(s,a)}function W4(s){var a=Je(s)?hA:DA;return a(s)}function K4(s){if(s==null)return 0;if(Ei(s))return hp(s)?Sc(s):s.length;var a=ci(s);return a==st||a==vt?s.size:n0(s).length}function G4(s,a,h){var y=Je(s)?Fd:qA;return h&&gi(s,a,h)&&(a=e),y(s,Oe(a,3))}var $4=ft(function(s,a){if(s==null)return[];var h=a.length;return h>1&&gi(s,a[0],a[1])?a=[]:h>2&&gi(a[0],a[1],a[2])&&(a=[a[0]]),Db(s,ii(a,1),[])}),up=AR||function(){return $r.Date.now()};function Y4(s,a){if(typeof a!="function")throw new nn(n);return s=at(s),function(){if(--s<1)return a.apply(this,arguments)}}function N_(s,a,h){return a=h?e:a,a=s&&a==null?s.length:a,Us(s,ge,e,e,e,e,a)}function B_(s,a){var h;if(typeof a!="function")throw new nn(n);return s=at(s),function(){return--s>0&&(h=a.apply(this,arguments)),s<=1&&(a=e),h}}var A0=ft(function(s,a,h){var y=B;if(h.length){var R=ya(h,kc(A0));y|=ee}return Us(s,y,a,h,R)}),M_=ft(function(s,a,h){var y=B|U;if(h.length){var R=ya(h,kc(M_));y|=ee}return Us(a,y,s,h,R)});function C_(s,a,h){a=h?e:a;var y=Us(s,$,e,e,e,e,e,a);return y.placeholder=C_.placeholder,y}function L_(s,a,h){a=h?e:a;var y=Us(s,H,e,e,e,e,e,a);return y.placeholder=L_.placeholder,y}function U_(s,a,h){var y,R,P,M,L,F,te=0,re=!1,oe=!1,he=!0;if(typeof s!="function")throw new nn(n);a=un(a)||0,gr(h)&&(re=!!h.leading,oe="maxWait"in h,P=oe?zr(un(h.maxWait)||0,a):P,he="trailing"in h?!!h.trailing:he);function Ee(Ir){var Rn=y,zs=R;return y=R=e,te=Ir,M=s.apply(zs,Rn),M}function ke(Ir){return te=Ir,L=Gu(pt,a),re?Ee(Ir):M}function ct(Ir){var Rn=Ir-F,zs=Ir-te,r1=a-Rn;return oe?oi(r1,P-zs):r1}function Pe(Ir){var Rn=Ir-F,zs=Ir-te;return F===e||Rn>=a||Rn<0||oe&&zs>=P}function pt(){var Ir=up();if(Pe(Ir))return gt(Ir);L=Gu(pt,ct(Ir))}function gt(Ir){return L=e,he&&y?Ee(Ir):(y=R=e,M)}function zi(){L!==e&&Gb(L),te=0,y=F=R=L=e}function xi(){return L===e?M:gt(up())}function Vi(){var Ir=up(),Rn=Pe(Ir);if(y=arguments,R=this,F=Ir,Rn){if(L===e)return ke(F);if(oe)return Gb(L),L=Gu(pt,a),Ee(F)}return L===e&&(L=Gu(pt,a)),M}return Vi.cancel=zi,Vi.flush=xi,Vi}var Z4=ft(function(s,a){return Tb(s,1,a)}),X4=ft(function(s,a,h){return Tb(s,un(a)||0,h)});function J4(s){return Us(s,me)}function fp(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new nn(n);var h=function(){var y=arguments,R=a?a.apply(this,y):y[0],P=h.cache;if(P.has(R))return P.get(R);var M=s.apply(this,y);return h.cache=P.set(R,M)||P,M};return h.cache=new(fp.Cache||Cs),h}fp.Cache=Cs;function lp(s){if(typeof s!="function")throw new nn(n);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function Q4(s){return B_(2,s)}var eO=FA(function(s,a){a=a.length==1&&Je(a[0])?mr(a[0],qi(Oe())):mr(ii(a,1),qi(Oe()));var h=a.length;return ft(function(y){for(var R=-1,P=oi(y.length,h);++R<P;)y[R]=a[R].call(this,y[R]);return Di(s,this,y)})}),O0=ft(function(s,a){var h=ya(a,kc(O0));return Us(s,ee,e,a,h)}),D_=ft(function(s,a){var h=ya(a,kc(D_));return Us(s,ce,e,a,h)}),tO=Ds(function(s,a){return Us(s,Se,e,e,e,a)});function rO(s,a){if(typeof s!="function")throw new nn(n);return a=a===e?a:at(a),ft(s,a)}function iO(s,a){if(typeof s!="function")throw new nn(n);return a=a==null?0:zr(at(a),0),ft(function(h){var y=h[a],R=Ra(h,0,a);return y&&_a(R,y),Di(s,this,R)})}function nO(s,a,h){var y=!0,R=!0;if(typeof s!="function")throw new nn(n);return gr(h)&&(y="leading"in h?!!h.leading:y,R="trailing"in h?!!h.trailing:R),U_(s,a,{leading:y,maxWait:a,trailing:R})}function sO(s){return N_(s,1)}function aO(s,a){return O0(h0(a),s)}function oO(){if(!arguments.length)return[];var s=arguments[0];return Je(s)?s:[s]}function cO(s){return an(s,T)}function uO(s,a){return a=typeof a=="function"?a:e,an(s,T,a)}function fO(s){return an(s,w|T)}function lO(s,a){return a=typeof a=="function"?a:e,an(s,w|T,a)}function pO(s,a){return a==null||Ib(s,a,Yr(a))}function Tn(s,a){return s===a||s!==s&&a!==a}var hO=ip(t0),dO=ip(function(s,a){return s>=a}),Eo=Pb(function(){return arguments}())?Pb:function(s){return br(s)&&Ot.call(s,"callee")&&!gb.call(s,"callee")},Je=G.isArray,mO=Jx?qi(Jx):SA;function Ei(s){return s!=null&&pp(s.length)&&!Fs(s)}function Er(s){return br(s)&&Ei(s)}function vO(s){return s===!0||s===!1||br(s)&&vi(s)==pe}var Aa=kR||F0,gO=Qx?qi(Qx):EA;function xO(s){return br(s)&&s.nodeType===1&&!$u(s)}function bO(s){if(s==null)return!0;if(Ei(s)&&(Je(s)||typeof s=="string"||typeof s.splice=="function"||Aa(s)||Pc(s)||Eo(s)))return!s.length;var a=ci(s);if(a==st||a==vt)return!s.size;if(Ku(s))return!n0(s).length;for(var h in s)if(Ot.call(s,h))return!1;return!0}function _O(s,a){return Vu(s,a)}function yO(s,a,h){h=typeof h=="function"?h:e;var y=h?h(s,a):e;return y===e?Vu(s,a,e,h):!!y}function k0(s){if(!br(s))return!1;var a=vi(s);return a==ht||a==de||typeof s.message=="string"&&typeof s.name=="string"&&!$u(s)}function wO(s){return typeof s=="number"&&bb(s)}function Fs(s){if(!gr(s))return!1;var a=vi(s);return a==wt||a==Re||a==ae||a==Ve}function q_(s){return typeof s=="number"&&s==at(s)}function pp(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=S}function gr(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function br(s){return s!=null&&typeof s=="object"}var F_=eb?qi(eb):TA;function SO(s,a){return s===a||i0(s,a,_0(a))}function EO(s,a,h){return h=typeof h=="function"?h:e,i0(s,a,_0(a),h)}function IO(s){return H_(s)&&s!=+s}function TO(s){if(u6(s))throw new He(i);return Nb(s)}function RO(s){return s===null}function AO(s){return s==null}function H_(s){return typeof s=="number"||br(s)&&vi(s)==et}function $u(s){if(!br(s)||vi(s)!=Te)return!1;var a=ql(s);if(a===null)return!0;var h=Ot.call(a,"constructor")&&a.constructor;return typeof h=="function"&&h instanceof h&&Cl.call(h)==ER}var P0=tb?qi(tb):RA;function OO(s){return q_(s)&&s>=-S&&s<=S}var z_=rb?qi(rb):AA;function hp(s){return typeof s=="string"||!Je(s)&&br(s)&&vi(s)==Me}function Hi(s){return typeof s=="symbol"||br(s)&&vi(s)==Pt}var Pc=ib?qi(ib):OA;function kO(s){return s===e}function PO(s){return br(s)&&ci(s)==Ce}function NO(s){return br(s)&&vi(s)==er}var BO=ip(s0),MO=ip(function(s,a){return s<=a});function V_(s){if(!s)return[];if(Ei(s))return hp(s)?En(s):Si(s);if(Cu&&s[Cu])return pR(s[Cu]());var a=ci(s),h=a==st?Kd:a==vt?Nl:Nc;return h(s)}function Hs(s){if(!s)return s===0?s:0;if(s=un(s),s===x||s===-x){var a=s<0?-1:1;return a*b}return s===s?s:0}function at(s){var a=Hs(s),h=a%1;return a===a?h?a-h:a:0}function j_(s){return s?_o(at(s),0,d):0}function un(s){if(typeof s=="number")return s;if(Hi(s))return l;if(gr(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=gr(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=ub(s);var h=ws.test(s);return h||Es.test(s)?YT(s.slice(2),h?2:8):ys.test(s)?l:+s}function W_(s){return ts(s,Ii(s))}function CO(s){return s?_o(at(s),-S,S):s===0?s:0}function Tt(s){return s==null?"":Fi(s)}var LO=Ac(function(s,a){if(Ku(a)||Ei(a)){ts(a,Yr(a),s);return}for(var h in a)Ot.call(a,h)&&Fu(s,h,a[h])}),K_=Ac(function(s,a){ts(a,Ii(a),s)}),dp=Ac(function(s,a,h,y){ts(a,Ii(a),s,y)}),UO=Ac(function(s,a,h,y){ts(a,Yr(a),s,y)}),DO=Ds(Jd);function qO(s,a){var h=Rc(s);return a==null?h:Eb(h,a)}var FO=ft(function(s,a){s=zt(s);var h=-1,y=a.length,R=y>2?a[2]:e;for(R&&gi(a[0],a[1],R)&&(y=1);++h<y;)for(var P=a[h],M=Ii(P),L=-1,F=M.length;++L<F;){var te=M[L],re=s[te];(re===e||Tn(re,Ec[te])&&!Ot.call(s,te))&&(s[te]=P[te])}return s}),HO=ft(function(s){return s.push(e,u_),Di(G_,e,s)});function zO(s,a){return sb(s,Oe(a,3),es)}function VO(s,a){return sb(s,Oe(a,3),e0)}function jO(s,a){return s==null?s:Qd(s,Oe(a,3),Ii)}function WO(s,a){return s==null?s:Ob(s,Oe(a,3),Ii)}function KO(s,a){return s&&es(s,Oe(a,3))}function GO(s,a){return s&&e0(s,Oe(a,3))}function $O(s){return s==null?[]:Yl(s,Yr(s))}function YO(s){return s==null?[]:Yl(s,Ii(s))}function N0(s,a,h){var y=s==null?e:yo(s,a);return y===e?h:y}function ZO(s,a){return s!=null&&p_(s,a,bA)}function B0(s,a){return s!=null&&p_(s,a,_A)}var XO=n_(function(s,a,h){a!=null&&typeof a.toString!="function"&&(a=Ll.call(a)),s[a]=h},C0(Ti)),JO=n_(function(s,a,h){a!=null&&typeof a.toString!="function"&&(a=Ll.call(a)),Ot.call(s,a)?s[a].push(h):s[a]=[h]},Oe),QO=ft(zu);function Yr(s){return Ei(s)?wb(s):n0(s)}function Ii(s){return Ei(s)?wb(s,!0):kA(s)}function e8(s,a){var h={};return a=Oe(a,3),es(s,function(y,R,P){Ls(h,a(y,R,P),y)}),h}function t8(s,a){var h={};return a=Oe(a,3),es(s,function(y,R,P){Ls(h,R,a(y,R,P))}),h}var r8=Ac(function(s,a,h){Zl(s,a,h)}),G_=Ac(function(s,a,h,y){Zl(s,a,h,y)}),i8=Ds(function(s,a){var h={};if(s==null)return h;var y=!1;a=mr(a,function(P){return P=Ta(P,s),y||(y=P.length>1),P}),ts(s,x0(s),h),y&&(h=an(h,w|I|T,XA));for(var R=a.length;R--;)f0(h,a[R]);return h});function n8(s,a){return $_(s,lp(Oe(a)))}var s8=Ds(function(s,a){return s==null?{}:NA(s,a)});function $_(s,a){if(s==null)return{};var h=mr(x0(s),function(y){return[y]});return a=Oe(a),qb(s,h,function(y,R){return a(y,R[0])})}function a8(s,a,h){a=Ta(a,s);var y=-1,R=a.length;for(R||(R=1,s=e);++y<R;){var P=s==null?e:s[rs(a[y])];P===e&&(y=R,P=h),s=Fs(P)?P.call(s):P}return s}function o8(s,a,h){return s==null?s:ju(s,a,h)}function c8(s,a,h,y){return y=typeof y=="function"?y:e,s==null?s:ju(s,a,h,y)}var Y_=o_(Yr),Z_=o_(Ii);function u8(s,a,h){var y=Je(s),R=y||Aa(s)||Pc(s);if(a=Oe(a,4),h==null){var P=s&&s.constructor;R?h=y?new P:[]:gr(s)?h=Fs(P)?Rc(ql(s)):{}:h={}}return(R?rn:es)(s,function(M,L,F){return a(h,M,L,F)}),h}function f8(s,a){return s==null?!0:f0(s,a)}function l8(s,a,h){return s==null?s:jb(s,a,h0(h))}function p8(s,a,h,y){return y=typeof y=="function"?y:e,s==null?s:jb(s,a,h0(h),y)}function Nc(s){return s==null?[]:Wd(s,Yr(s))}function h8(s){return s==null?[]:Wd(s,Ii(s))}function d8(s,a,h){return h===e&&(h=a,a=e),h!==e&&(h=un(h),h=h===h?h:0),a!==e&&(a=un(a),a=a===a?a:0),_o(un(s),a,h)}function m8(s,a,h){return a=Hs(a),h===e?(h=a,a=0):h=Hs(h),s=un(s),yA(s,a,h)}function v8(s,a,h){if(h&&typeof h!="boolean"&&gi(s,a,h)&&(a=h=e),h===e&&(typeof a=="boolean"?(h=a,a=e):typeof s=="boolean"&&(h=s,s=e)),s===e&&a===e?(s=0,a=1):(s=Hs(s),a===e?(a=s,s=0):a=Hs(a)),s>a){var y=s;s=a,a=y}if(h||s%1||a%1){var R=_b();return oi(s+R*(a-s+$T("1e-"+((R+"").length-1))),a)}return o0(s,a)}var g8=Oc(function(s,a,h){return a=a.toLowerCase(),s+(h?X_(a):a)});function X_(s){return M0(Tt(s).toLowerCase())}function J_(s){return s=Tt(s),s&&s.replace(Ts,oR).replace(DT,"")}function x8(s,a,h){s=Tt(s),a=Fi(a);var y=s.length;h=h===e?y:_o(at(h),0,y);var R=h;return h-=a.length,h>=0&&s.slice(h,R)==a}function b8(s){return s=Tt(s),s&&ir.test(s)?s.replace(Kt,cR):s}function _8(s){return s=Tt(s),s&&$e.test(s)?s.replace(qt,"\\$&"):s}var y8=Oc(function(s,a,h){return s+(h?"-":"")+a.toLowerCase()}),w8=Oc(function(s,a,h){return s+(h?" ":"")+a.toLowerCase()}),S8=t_("toLowerCase");function E8(s,a,h){s=Tt(s),a=at(a);var y=a?Sc(s):0;if(!a||y>=a)return s;var R=(a-y)/2;return rp(Vl(R),h)+s+rp(zl(R),h)}function I8(s,a,h){s=Tt(s),a=at(a);var y=a?Sc(s):0;return a&&y<a?s+rp(a-y,h):s}function T8(s,a,h){s=Tt(s),a=at(a);var y=a?Sc(s):0;return a&&y<a?rp(a-y,h)+s:s}function R8(s,a,h){return h||a==null?a=0:a&&(a=+a),MR(Tt(s).replace(Ft,""),a||0)}function A8(s,a,h){return(h?gi(s,a,h):a===e)?a=1:a=at(a),c0(Tt(s),a)}function O8(){var s=arguments,a=Tt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var k8=Oc(function(s,a,h){return s+(h?"_":"")+a.toLowerCase()});function P8(s,a,h){return h&&typeof h!="number"&&gi(s,a,h)&&(a=h=e),h=h===e?d:h>>>0,h?(s=Tt(s),s&&(typeof a=="string"||a!=null&&!P0(a))&&(a=Fi(a),!a&&wc(s))?Ra(En(s),0,h):s.split(a,h)):[]}var N8=Oc(function(s,a,h){return s+(h?" ":"")+M0(a)});function B8(s,a,h){return s=Tt(s),h=h==null?0:_o(at(h),0,s.length),a=Fi(a),s.slice(h,h+a.length)==a}function M8(s,a,h){var y=k.templateSettings;h&&gi(s,a,h)&&(a=e),s=Tt(s),a=dp({},a,y,c_);var R=dp({},a.imports,y.imports,c_),P=Yr(R),M=Wd(R,P),L,F,te=0,re=a.interpolate||Qi,oe="__p += '",he=Gd((a.escape||Qi).source+"|"+re.source+"|"+(re===Gt?Xe:Qi).source+"|"+(a.evaluate||Qi).source+"|$","g"),Ee="//# sourceURL="+(Ot.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++VT+"]")+`
11
11
  `;s.replace(he,function(Pe,pt,gt,zi,xi,Vi){return gt||(gt=zi),oe+=s.slice(te,Vi).replace(Rs,uR),pt&&(L=!0,oe+=`' +
12
12
  __e(`+pt+`) +
13
13
  '`),xi&&(F=!0,oe+=`';
@@ -24,18 +24,18 @@ __p += '`),gt&&(oe+=`' +
24
24
  function print() { __p += __j.call(arguments, '') }
25
25
  `:`;
26
26
  `)+oe+`return __p
27
- }`;var ct=e1(function(){return It(P,Ee+"return "+oe).apply(e,M)});if(ct.source=oe,k0(ct))throw ct;return ct}function C8(s){return Tt(s).toLowerCase()}function L8(s){return Tt(s).toUpperCase()}function U8(s,a,h){if(s=Tt(s),s&&(h||a===e))return ub(s);if(!s||!(a=Fi(a)))return s;var y=En(s),R=En(a),P=fb(y,R),M=lb(y,R)+1;return Ra(y,P,M).join("")}function D8(s,a,h){if(s=Tt(s),s&&(h||a===e))return s.slice(0,hb(s)+1);if(!s||!(a=Fi(a)))return s;var y=En(s),R=lb(y,En(a))+1;return Ra(y,0,R).join("")}function q8(s,a,h){if(s=Tt(s),s&&(h||a===e))return s.replace(Ft,"");if(!s||!(a=Fi(a)))return s;var y=En(s),R=fb(y,En(a));return Ra(y,R).join("")}function F8(s,a){var h=O,y=E;if(gr(a)){var R="separator"in a?a.separator:R;h="length"in a?at(a.length):h,y="omission"in a?Fi(a.omission):y}s=Tt(s);var P=s.length;if(wc(s)){var M=En(s);P=M.length}if(h>=P)return s;var L=h-Sc(y);if(L<1)return y;var F=M?Ra(M,0,L).join(""):s.slice(0,L);if(R===e)return F+y;if(M&&(L+=F.length-L),P0(R)){if(s.slice(L).search(R)){var te,re=F;for(R.global||(R=Gd(R.source,Tt(Ht.exec(R))+"g")),R.lastIndex=0;te=R.exec(re);)var oe=te.index;F=F.slice(0,oe===e?L:oe)}}else if(s.indexOf(Fi(R),L)!=L){var he=F.lastIndexOf(R);he>-1&&(F=F.slice(0,he))}return F+y}function H8(s){return s=Tt(s),s&&We.test(s)?s.replace(Wt,vR):s}var z8=Oc(function(s,a,h){return s+(h?" ":"")+a.toUpperCase()}),M0=t_("toUpperCase");function Q_(s,a,h){return s=Tt(s),a=h?e:a,a===e?lR(s)?bR(s):rR(s):s.match(a)||[]}var e1=ft(function(s,a){try{return Di(s,e,a)}catch(h){return k0(h)?h:new He(h)}}),V8=Ds(function(s,a){return rn(a,function(h){h=ts(h),Ls(s,h,A0(s[h],s))}),s});function j8(s){var a=s==null?0:s.length,h=Oe();return s=a?mr(s,function(y){if(typeof y[1]!="function")throw new nn(n);return[h(y[0]),y[1]]}):[],ft(function(y){for(var R=-1;++R<a;){var P=s[R];if(Di(P[0],this,y))return Di(P[1],this,y)}})}function W8(s){return vA(an(s,w))}function C0(s){return function(){return s}}function K8(s,a){return s==null||s!==s?a:s}var G8=i_(),$8=i_(!0);function Ti(s){return s}function L0(s){return Bb(typeof s=="function"?s:an(s,w))}function Y8(s){return Cb(an(s,w))}function Z8(s,a){return Lb(s,an(a,w))}var X8=ft(function(s,a){return function(h){return zu(h,s,a)}}),J8=ft(function(s,a){return function(h){return zu(s,h,a)}});function U0(s,a,h){var y=Yr(a),R=Yl(a,y);h==null&&!(gr(a)&&(R.length||!y.length))&&(h=a,a=s,s=this,R=Yl(a,Yr(a)));var P=!(gr(h)&&"chain"in h)||!!h.chain,M=Fs(s);return rn(R,function(L){var F=a[L];s[L]=F,M&&(s.prototype[L]=function(){var te=this.__chain__;if(P||te){var re=s(this.__wrapped__),oe=re.__actions__=Si(this.__actions__);return oe.push({func:F,args:arguments,thisArg:s}),re.__chain__=te,re}return F.apply(s,_a([this.value()],arguments))})}),s}function Q8(){return $r._===this&&($r._=IR),this}function D0(){}function e5(s){return s=at(s),ft(function(a){return Ub(a,s)})}var t5=m0(mr),r5=m0(nb),i5=m0(Fd);function t1(s){return w0(s)?Hd(ts(s)):BA(s)}function n5(s){return function(a){return s==null?e:yo(s,a)}}var s5=s_(),a5=s_(!0);function q0(){return[]}function F0(){return!1}function o5(){return{}}function c5(){return""}function u5(){return!0}function f5(s,a){if(s=at(s),s<1||s>S)return[];var h=d,y=oi(s,d);a=Oe(a),s-=d;for(var R=jd(y,a);++h<s;)a(h);return R}function l5(s){return Je(s)?mr(s,ts):Hi(s)?[s]:Si(y_(Tt(s)))}function p5(s){var a=++SR;return Tt(s)+a}var h5=tp(function(s,a){return s+a},0),d5=v0("ceil"),m5=tp(function(s,a){return s/a},1),v5=v0("floor");function g5(s){return s&&s.length?$l(s,Ti,t0):e}function x5(s,a){return s&&s.length?$l(s,Oe(a,2),t0):e}function b5(s){return ob(s,Ti)}function _5(s,a){return ob(s,Oe(a,2))}function y5(s){return s&&s.length?$l(s,Ti,s0):e}function w5(s,a){return s&&s.length?$l(s,Oe(a,2),s0):e}var S5=tp(function(s,a){return s*a},1),E5=v0("round"),I5=tp(function(s,a){return s-a},0);function T5(s){return s&&s.length?Vd(s,Ti):0}function R5(s,a){return s&&s.length?Vd(s,Oe(a,2)):0}return k.after=Y4,k.ary=N_,k.assign=LO,k.assignIn=K_,k.assignInWith=dp,k.assignWith=UO,k.at=DO,k.before=B_,k.bind=A0,k.bindAll=V8,k.bindKey=M_,k.castArray=oO,k.chain=O_,k.chunk=v6,k.compact=g6,k.concat=x6,k.cond=j8,k.conforms=W8,k.constant=C0,k.countBy=T4,k.create=qO,k.curry=C_,k.curryRight=L_,k.debounce=U_,k.defaults=FO,k.defaultsDeep=HO,k.defer=Z4,k.delay=X4,k.difference=b6,k.differenceBy=_6,k.differenceWith=y6,k.drop=w6,k.dropRight=S6,k.dropRightWhile=E6,k.dropWhile=I6,k.fill=T6,k.filter=A4,k.flatMap=P4,k.flatMapDeep=N4,k.flatMapDepth=B4,k.flatten=I_,k.flattenDeep=R6,k.flattenDepth=A6,k.flip=J4,k.flow=G8,k.flowRight=$8,k.fromPairs=O6,k.functions=$O,k.functionsIn=YO,k.groupBy=M4,k.initial=P6,k.intersection=N6,k.intersectionBy=B6,k.intersectionWith=M6,k.invert=XO,k.invertBy=JO,k.invokeMap=L4,k.iteratee=L0,k.keyBy=U4,k.keys=Yr,k.keysIn=Ii,k.map=cp,k.mapKeys=e8,k.mapValues=t8,k.matches=Y8,k.matchesProperty=Z8,k.memoize=fp,k.merge=r8,k.mergeWith=G_,k.method=X8,k.methodOf=J8,k.mixin=U0,k.negate=lp,k.nthArg=e5,k.omit=i8,k.omitBy=n8,k.once=Q4,k.orderBy=D4,k.over=t5,k.overArgs=eO,k.overEvery=r5,k.overSome=i5,k.partial=O0,k.partialRight=D_,k.partition=q4,k.pick=s8,k.pickBy=$_,k.property=t1,k.propertyOf=n5,k.pull=D6,k.pullAll=R_,k.pullAllBy=q6,k.pullAllWith=F6,k.pullAt=H6,k.range=s5,k.rangeRight=a5,k.rearg=tO,k.reject=z4,k.remove=z6,k.rest=rO,k.reverse=T0,k.sampleSize=j4,k.set=o8,k.setWith=c8,k.shuffle=W4,k.slice=V6,k.sortBy=$4,k.sortedUniq=Z6,k.sortedUniqBy=X6,k.split=P8,k.spread=iO,k.tail=J6,k.take=Q6,k.takeRight=e4,k.takeRightWhile=t4,k.takeWhile=r4,k.tap=g4,k.throttle=nO,k.thru=op,k.toArray=V_,k.toPairs=Y_,k.toPairsIn=Z_,k.toPath=l5,k.toPlainObject=W_,k.transform=u8,k.unary=sO,k.union=i4,k.unionBy=n4,k.unionWith=s4,k.uniq=a4,k.uniqBy=o4,k.uniqWith=c4,k.unset=f8,k.unzip=R0,k.unzipWith=A_,k.update=l8,k.updateWith=p8,k.values=Nc,k.valuesIn=h8,k.without=u4,k.words=Q_,k.wrap=aO,k.xor=f4,k.xorBy=l4,k.xorWith=p4,k.zip=h4,k.zipObject=d4,k.zipObjectDeep=m4,k.zipWith=v4,k.entries=Y_,k.entriesIn=Z_,k.extend=K_,k.extendWith=dp,U0(k,k),k.add=h5,k.attempt=e1,k.camelCase=g8,k.capitalize=X_,k.ceil=d5,k.clamp=d8,k.clone=cO,k.cloneDeep=fO,k.cloneDeepWith=lO,k.cloneWith=uO,k.conformsTo=pO,k.deburr=J_,k.defaultTo=K8,k.divide=m5,k.endsWith=x8,k.eq=Tn,k.escape=b8,k.escapeRegExp=_8,k.every=R4,k.find=O4,k.findIndex=S_,k.findKey=zO,k.findLast=k4,k.findLastIndex=E_,k.findLastKey=VO,k.floor=v5,k.forEach=k_,k.forEachRight=P_,k.forIn=jO,k.forInRight=WO,k.forOwn=KO,k.forOwnRight=GO,k.get=N0,k.gt=hO,k.gte=dO,k.has=ZO,k.hasIn=B0,k.head=T_,k.identity=Ti,k.includes=C4,k.indexOf=k6,k.inRange=m8,k.invoke=QO,k.isArguments=Eo,k.isArray=Je,k.isArrayBuffer=mO,k.isArrayLike=Ei,k.isArrayLikeObject=Er,k.isBoolean=vO,k.isBuffer=Aa,k.isDate=gO,k.isElement=xO,k.isEmpty=bO,k.isEqual=_O,k.isEqualWith=yO,k.isError=k0,k.isFinite=wO,k.isFunction=Fs,k.isInteger=q_,k.isLength=pp,k.isMap=F_,k.isMatch=SO,k.isMatchWith=EO,k.isNaN=IO,k.isNative=TO,k.isNil=AO,k.isNull=RO,k.isNumber=H_,k.isObject=gr,k.isObjectLike=br,k.isPlainObject=$u,k.isRegExp=P0,k.isSafeInteger=OO,k.isSet=z_,k.isString=hp,k.isSymbol=Hi,k.isTypedArray=Pc,k.isUndefined=kO,k.isWeakMap=PO,k.isWeakSet=NO,k.join=C6,k.kebabCase=y8,k.last=cn,k.lastIndexOf=L6,k.lowerCase=w8,k.lowerFirst=S8,k.lt=BO,k.lte=MO,k.max=g5,k.maxBy=x5,k.mean=b5,k.meanBy=_5,k.min=y5,k.minBy=w5,k.stubArray=q0,k.stubFalse=F0,k.stubObject=o5,k.stubString=c5,k.stubTrue=u5,k.multiply=S5,k.nth=U6,k.noConflict=Q8,k.noop=D0,k.now=up,k.pad=E8,k.padEnd=I8,k.padStart=T8,k.parseInt=R8,k.random=v8,k.reduce=F4,k.reduceRight=H4,k.repeat=A8,k.replace=O8,k.result=a8,k.round=E5,k.runInContext=q,k.sample=V4,k.size=K4,k.snakeCase=k8,k.some=G4,k.sortedIndex=j6,k.sortedIndexBy=W6,k.sortedIndexOf=K6,k.sortedLastIndex=G6,k.sortedLastIndexBy=$6,k.sortedLastIndexOf=Y6,k.startCase=N8,k.startsWith=B8,k.subtract=I5,k.sum=T5,k.sumBy=R5,k.template=M8,k.times=f5,k.toFinite=Hs,k.toInteger=at,k.toLength=j_,k.toLower=C8,k.toNumber=un,k.toSafeInteger=CO,k.toString=Tt,k.toUpper=L8,k.trim=U8,k.trimEnd=D8,k.trimStart=q8,k.truncate=F8,k.unescape=H8,k.uniqueId=p5,k.upperCase=z8,k.upperFirst=M0,k.each=k_,k.eachRight=P_,k.first=T_,U0(k,function(){var s={};return Qn(k,function(a,h){Ot.call(k.prototype,h)||(s[h]=a)}),s}(),{chain:!1}),k.VERSION=t,rn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){k[s].placeholder=k}),rn(["drop","take"],function(s,a){dt.prototype[s]=function(h){h=h===e?1:zr(at(h),0);var y=this.__filtered__&&!a?new dt(this):this.clone();return y.__filtered__?y.__takeCount__=oi(h,y.__takeCount__):y.__views__.push({size:oi(h,d),type:s+(y.__dir__<0?"Right":"")}),y},dt.prototype[s+"Right"]=function(h){return this.reverse()[s](h).reverse()}}),rn(["filter","map","takeWhile"],function(s,a){var h=a+1,y=h==p||h==g;dt.prototype[s]=function(R){var P=this.clone();return P.__iteratees__.push({iteratee:Oe(R,3),type:h}),P.__filtered__=P.__filtered__||y,P}}),rn(["head","last"],function(s,a){var h="take"+(a?"Right":"");dt.prototype[s]=function(){return this[h](1).value()[0]}}),rn(["initial","tail"],function(s,a){var h="drop"+(a?"":"Right");dt.prototype[s]=function(){return this.__filtered__?new dt(this):this[h](1)}}),dt.prototype.compact=function(){return this.filter(Ti)},dt.prototype.find=function(s){return this.filter(s).head()},dt.prototype.findLast=function(s){return this.reverse().find(s)},dt.prototype.invokeMap=ft(function(s,a){return typeof s=="function"?new dt(this):this.map(function(h){return zu(h,s,a)})}),dt.prototype.reject=function(s){return this.filter(lp(Oe(s)))},dt.prototype.slice=function(s,a){s=at(s);var h=this;return h.__filtered__&&(s>0||a<0)?new dt(h):(s<0?h=h.takeRight(-s):s&&(h=h.drop(s)),a!==e&&(a=at(a),h=a<0?h.dropRight(-a):h.take(a-s)),h)},dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},dt.prototype.toArray=function(){return this.take(d)},Qn(dt.prototype,function(s,a){var h=/^(?:filter|find|map|reject)|While$/.test(a),y=/^(?:head|last)$/.test(a),R=k[y?"take"+(a=="last"?"Right":""):a],P=y||/^find/.test(a);R&&(k.prototype[a]=function(){var M=this.__wrapped__,L=y?[1]:arguments,F=M instanceof dt,te=L[0],re=F||Je(M),oe=function(pt){var gt=R.apply(k,_a([pt],L));return y&&he?gt[0]:gt};re&&h&&typeof te=="function"&&te.length!=1&&(F=re=!1);var he=this.__chain__,Ee=!!this.__actions__.length,ke=P&&!he,ct=F&&!Ee;if(!P&&re){M=ct?M:new dt(this);var Pe=s.apply(M,L);return Pe.__actions__.push({func:op,args:[oe],thisArg:e}),new sn(Pe,he)}return ke&&ct?s.apply(this,L):(Pe=this.thru(oe),ke?y?Pe.value()[0]:Pe.value():Pe)})}),rn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Bl[s],h=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);k.prototype[s]=function(){var R=arguments;if(y&&!this.__chain__){var P=this.value();return a.apply(Je(P)?P:[],R)}return this[h](function(M){return a.apply(Je(M)?M:[],R)})}}),Qn(dt.prototype,function(s,a){var h=k[a];if(h){var y=h.name+"";Ot.call(Tc,y)||(Tc[y]=[]),Tc[y].push({name:a,func:h})}}),Tc[ep(e,U).name]=[{name:"wrapper",func:e}],dt.prototype.clone=HR,dt.prototype.reverse=zR,dt.prototype.value=VR,k.prototype.at=x4,k.prototype.chain=b4,k.prototype.commit=_4,k.prototype.next=y4,k.prototype.plant=S4,k.prototype.reverse=E4,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=I4,k.prototype.first=k.prototype.head,Cu&&(k.prototype[Cu]=w4),k},wa=_R();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($r._=wa,define(function(){return wa})):vo?((vo.exports=wa)._=wa,Ld._=wa):$r._=wa}).call(tu)});var Kw=X((CY,Ww)=>{"use strict";var eB="http://bitcore.io/";Ww.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+eB+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."},{name:"BlockHeightOutOfRange",message:"Block Height can only be between 0 and 65535"},{name:"LockTimeRange",message:"Seconds needs to be more that 0 and less that 33553920"}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]});var Yi=X((LY,jv)=>{"use strict";var Vv=Et();function tB(e,t){return e.replace("{0}",t[0]).replace("{1}",t[1]).replace("{2}",t[2])}var Gw=function(e,t){var r=function(){if(Vv.isString(t.message))this.message=tB(t.message,arguments);else if(Vv.isFunction(t.message))this.message=t.message.apply(null,arguments);else throw new Error("Invalid error definition for "+t.name);this.stack=this.message+`
27
+ }`;var ct=e1(function(){return It(P,Ee+"return "+oe).apply(e,M)});if(ct.source=oe,k0(ct))throw ct;return ct}function C8(s){return Tt(s).toLowerCase()}function L8(s){return Tt(s).toUpperCase()}function U8(s,a,h){if(s=Tt(s),s&&(h||a===e))return ub(s);if(!s||!(a=Fi(a)))return s;var y=En(s),R=En(a),P=fb(y,R),M=lb(y,R)+1;return Ra(y,P,M).join("")}function D8(s,a,h){if(s=Tt(s),s&&(h||a===e))return s.slice(0,hb(s)+1);if(!s||!(a=Fi(a)))return s;var y=En(s),R=lb(y,En(a))+1;return Ra(y,0,R).join("")}function q8(s,a,h){if(s=Tt(s),s&&(h||a===e))return s.replace(Ft,"");if(!s||!(a=Fi(a)))return s;var y=En(s),R=fb(y,En(a));return Ra(y,R).join("")}function F8(s,a){var h=O,y=E;if(gr(a)){var R="separator"in a?a.separator:R;h="length"in a?at(a.length):h,y="omission"in a?Fi(a.omission):y}s=Tt(s);var P=s.length;if(wc(s)){var M=En(s);P=M.length}if(h>=P)return s;var L=h-Sc(y);if(L<1)return y;var F=M?Ra(M,0,L).join(""):s.slice(0,L);if(R===e)return F+y;if(M&&(L+=F.length-L),P0(R)){if(s.slice(L).search(R)){var te,re=F;for(R.global||(R=Gd(R.source,Tt(Ht.exec(R))+"g")),R.lastIndex=0;te=R.exec(re);)var oe=te.index;F=F.slice(0,oe===e?L:oe)}}else if(s.indexOf(Fi(R),L)!=L){var he=F.lastIndexOf(R);he>-1&&(F=F.slice(0,he))}return F+y}function H8(s){return s=Tt(s),s&&We.test(s)?s.replace(Wt,vR):s}var z8=Oc(function(s,a,h){return s+(h?" ":"")+a.toUpperCase()}),M0=t_("toUpperCase");function Q_(s,a,h){return s=Tt(s),a=h?e:a,a===e?lR(s)?bR(s):rR(s):s.match(a)||[]}var e1=ft(function(s,a){try{return Di(s,e,a)}catch(h){return k0(h)?h:new He(h)}}),V8=Ds(function(s,a){return rn(a,function(h){h=rs(h),Ls(s,h,A0(s[h],s))}),s});function j8(s){var a=s==null?0:s.length,h=Oe();return s=a?mr(s,function(y){if(typeof y[1]!="function")throw new nn(n);return[h(y[0]),y[1]]}):[],ft(function(y){for(var R=-1;++R<a;){var P=s[R];if(Di(P[0],this,y))return Di(P[1],this,y)}})}function W8(s){return vA(an(s,w))}function C0(s){return function(){return s}}function K8(s,a){return s==null||s!==s?a:s}var G8=i_(),$8=i_(!0);function Ti(s){return s}function L0(s){return Bb(typeof s=="function"?s:an(s,w))}function Y8(s){return Cb(an(s,w))}function Z8(s,a){return Lb(s,an(a,w))}var X8=ft(function(s,a){return function(h){return zu(h,s,a)}}),J8=ft(function(s,a){return function(h){return zu(s,h,a)}});function U0(s,a,h){var y=Yr(a),R=Yl(a,y);h==null&&!(gr(a)&&(R.length||!y.length))&&(h=a,a=s,s=this,R=Yl(a,Yr(a)));var P=!(gr(h)&&"chain"in h)||!!h.chain,M=Fs(s);return rn(R,function(L){var F=a[L];s[L]=F,M&&(s.prototype[L]=function(){var te=this.__chain__;if(P||te){var re=s(this.__wrapped__),oe=re.__actions__=Si(this.__actions__);return oe.push({func:F,args:arguments,thisArg:s}),re.__chain__=te,re}return F.apply(s,_a([this.value()],arguments))})}),s}function Q8(){return $r._===this&&($r._=IR),this}function D0(){}function e5(s){return s=at(s),ft(function(a){return Ub(a,s)})}var t5=m0(mr),r5=m0(nb),i5=m0(Fd);function t1(s){return w0(s)?Hd(rs(s)):BA(s)}function n5(s){return function(a){return s==null?e:yo(s,a)}}var s5=s_(),a5=s_(!0);function q0(){return[]}function F0(){return!1}function o5(){return{}}function c5(){return""}function u5(){return!0}function f5(s,a){if(s=at(s),s<1||s>S)return[];var h=d,y=oi(s,d);a=Oe(a),s-=d;for(var R=jd(y,a);++h<s;)a(h);return R}function l5(s){return Je(s)?mr(s,rs):Hi(s)?[s]:Si(y_(Tt(s)))}function p5(s){var a=++SR;return Tt(s)+a}var h5=tp(function(s,a){return s+a},0),d5=v0("ceil"),m5=tp(function(s,a){return s/a},1),v5=v0("floor");function g5(s){return s&&s.length?$l(s,Ti,t0):e}function x5(s,a){return s&&s.length?$l(s,Oe(a,2),t0):e}function b5(s){return ob(s,Ti)}function _5(s,a){return ob(s,Oe(a,2))}function y5(s){return s&&s.length?$l(s,Ti,s0):e}function w5(s,a){return s&&s.length?$l(s,Oe(a,2),s0):e}var S5=tp(function(s,a){return s*a},1),E5=v0("round"),I5=tp(function(s,a){return s-a},0);function T5(s){return s&&s.length?Vd(s,Ti):0}function R5(s,a){return s&&s.length?Vd(s,Oe(a,2)):0}return k.after=Y4,k.ary=N_,k.assign=LO,k.assignIn=K_,k.assignInWith=dp,k.assignWith=UO,k.at=DO,k.before=B_,k.bind=A0,k.bindAll=V8,k.bindKey=M_,k.castArray=oO,k.chain=O_,k.chunk=v6,k.compact=g6,k.concat=x6,k.cond=j8,k.conforms=W8,k.constant=C0,k.countBy=T4,k.create=qO,k.curry=C_,k.curryRight=L_,k.debounce=U_,k.defaults=FO,k.defaultsDeep=HO,k.defer=Z4,k.delay=X4,k.difference=b6,k.differenceBy=_6,k.differenceWith=y6,k.drop=w6,k.dropRight=S6,k.dropRightWhile=E6,k.dropWhile=I6,k.fill=T6,k.filter=A4,k.flatMap=P4,k.flatMapDeep=N4,k.flatMapDepth=B4,k.flatten=I_,k.flattenDeep=R6,k.flattenDepth=A6,k.flip=J4,k.flow=G8,k.flowRight=$8,k.fromPairs=O6,k.functions=$O,k.functionsIn=YO,k.groupBy=M4,k.initial=P6,k.intersection=N6,k.intersectionBy=B6,k.intersectionWith=M6,k.invert=XO,k.invertBy=JO,k.invokeMap=L4,k.iteratee=L0,k.keyBy=U4,k.keys=Yr,k.keysIn=Ii,k.map=cp,k.mapKeys=e8,k.mapValues=t8,k.matches=Y8,k.matchesProperty=Z8,k.memoize=fp,k.merge=r8,k.mergeWith=G_,k.method=X8,k.methodOf=J8,k.mixin=U0,k.negate=lp,k.nthArg=e5,k.omit=i8,k.omitBy=n8,k.once=Q4,k.orderBy=D4,k.over=t5,k.overArgs=eO,k.overEvery=r5,k.overSome=i5,k.partial=O0,k.partialRight=D_,k.partition=q4,k.pick=s8,k.pickBy=$_,k.property=t1,k.propertyOf=n5,k.pull=D6,k.pullAll=R_,k.pullAllBy=q6,k.pullAllWith=F6,k.pullAt=H6,k.range=s5,k.rangeRight=a5,k.rearg=tO,k.reject=z4,k.remove=z6,k.rest=rO,k.reverse=T0,k.sampleSize=j4,k.set=o8,k.setWith=c8,k.shuffle=W4,k.slice=V6,k.sortBy=$4,k.sortedUniq=Z6,k.sortedUniqBy=X6,k.split=P8,k.spread=iO,k.tail=J6,k.take=Q6,k.takeRight=e4,k.takeRightWhile=t4,k.takeWhile=r4,k.tap=g4,k.throttle=nO,k.thru=op,k.toArray=V_,k.toPairs=Y_,k.toPairsIn=Z_,k.toPath=l5,k.toPlainObject=W_,k.transform=u8,k.unary=sO,k.union=i4,k.unionBy=n4,k.unionWith=s4,k.uniq=a4,k.uniqBy=o4,k.uniqWith=c4,k.unset=f8,k.unzip=R0,k.unzipWith=A_,k.update=l8,k.updateWith=p8,k.values=Nc,k.valuesIn=h8,k.without=u4,k.words=Q_,k.wrap=aO,k.xor=f4,k.xorBy=l4,k.xorWith=p4,k.zip=h4,k.zipObject=d4,k.zipObjectDeep=m4,k.zipWith=v4,k.entries=Y_,k.entriesIn=Z_,k.extend=K_,k.extendWith=dp,U0(k,k),k.add=h5,k.attempt=e1,k.camelCase=g8,k.capitalize=X_,k.ceil=d5,k.clamp=d8,k.clone=cO,k.cloneDeep=fO,k.cloneDeepWith=lO,k.cloneWith=uO,k.conformsTo=pO,k.deburr=J_,k.defaultTo=K8,k.divide=m5,k.endsWith=x8,k.eq=Tn,k.escape=b8,k.escapeRegExp=_8,k.every=R4,k.find=O4,k.findIndex=S_,k.findKey=zO,k.findLast=k4,k.findLastIndex=E_,k.findLastKey=VO,k.floor=v5,k.forEach=k_,k.forEachRight=P_,k.forIn=jO,k.forInRight=WO,k.forOwn=KO,k.forOwnRight=GO,k.get=N0,k.gt=hO,k.gte=dO,k.has=ZO,k.hasIn=B0,k.head=T_,k.identity=Ti,k.includes=C4,k.indexOf=k6,k.inRange=m8,k.invoke=QO,k.isArguments=Eo,k.isArray=Je,k.isArrayBuffer=mO,k.isArrayLike=Ei,k.isArrayLikeObject=Er,k.isBoolean=vO,k.isBuffer=Aa,k.isDate=gO,k.isElement=xO,k.isEmpty=bO,k.isEqual=_O,k.isEqualWith=yO,k.isError=k0,k.isFinite=wO,k.isFunction=Fs,k.isInteger=q_,k.isLength=pp,k.isMap=F_,k.isMatch=SO,k.isMatchWith=EO,k.isNaN=IO,k.isNative=TO,k.isNil=AO,k.isNull=RO,k.isNumber=H_,k.isObject=gr,k.isObjectLike=br,k.isPlainObject=$u,k.isRegExp=P0,k.isSafeInteger=OO,k.isSet=z_,k.isString=hp,k.isSymbol=Hi,k.isTypedArray=Pc,k.isUndefined=kO,k.isWeakMap=PO,k.isWeakSet=NO,k.join=C6,k.kebabCase=y8,k.last=cn,k.lastIndexOf=L6,k.lowerCase=w8,k.lowerFirst=S8,k.lt=BO,k.lte=MO,k.max=g5,k.maxBy=x5,k.mean=b5,k.meanBy=_5,k.min=y5,k.minBy=w5,k.stubArray=q0,k.stubFalse=F0,k.stubObject=o5,k.stubString=c5,k.stubTrue=u5,k.multiply=S5,k.nth=U6,k.noConflict=Q8,k.noop=D0,k.now=up,k.pad=E8,k.padEnd=I8,k.padStart=T8,k.parseInt=R8,k.random=v8,k.reduce=F4,k.reduceRight=H4,k.repeat=A8,k.replace=O8,k.result=a8,k.round=E5,k.runInContext=q,k.sample=V4,k.size=K4,k.snakeCase=k8,k.some=G4,k.sortedIndex=j6,k.sortedIndexBy=W6,k.sortedIndexOf=K6,k.sortedLastIndex=G6,k.sortedLastIndexBy=$6,k.sortedLastIndexOf=Y6,k.startCase=N8,k.startsWith=B8,k.subtract=I5,k.sum=T5,k.sumBy=R5,k.template=M8,k.times=f5,k.toFinite=Hs,k.toInteger=at,k.toLength=j_,k.toLower=C8,k.toNumber=un,k.toSafeInteger=CO,k.toString=Tt,k.toUpper=L8,k.trim=U8,k.trimEnd=D8,k.trimStart=q8,k.truncate=F8,k.unescape=H8,k.uniqueId=p5,k.upperCase=z8,k.upperFirst=M0,k.each=k_,k.eachRight=P_,k.first=T_,U0(k,function(){var s={};return es(k,function(a,h){Ot.call(k.prototype,h)||(s[h]=a)}),s}(),{chain:!1}),k.VERSION=t,rn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){k[s].placeholder=k}),rn(["drop","take"],function(s,a){dt.prototype[s]=function(h){h=h===e?1:zr(at(h),0);var y=this.__filtered__&&!a?new dt(this):this.clone();return y.__filtered__?y.__takeCount__=oi(h,y.__takeCount__):y.__views__.push({size:oi(h,d),type:s+(y.__dir__<0?"Right":"")}),y},dt.prototype[s+"Right"]=function(h){return this.reverse()[s](h).reverse()}}),rn(["filter","map","takeWhile"],function(s,a){var h=a+1,y=h==p||h==g;dt.prototype[s]=function(R){var P=this.clone();return P.__iteratees__.push({iteratee:Oe(R,3),type:h}),P.__filtered__=P.__filtered__||y,P}}),rn(["head","last"],function(s,a){var h="take"+(a?"Right":"");dt.prototype[s]=function(){return this[h](1).value()[0]}}),rn(["initial","tail"],function(s,a){var h="drop"+(a?"":"Right");dt.prototype[s]=function(){return this.__filtered__?new dt(this):this[h](1)}}),dt.prototype.compact=function(){return this.filter(Ti)},dt.prototype.find=function(s){return this.filter(s).head()},dt.prototype.findLast=function(s){return this.reverse().find(s)},dt.prototype.invokeMap=ft(function(s,a){return typeof s=="function"?new dt(this):this.map(function(h){return zu(h,s,a)})}),dt.prototype.reject=function(s){return this.filter(lp(Oe(s)))},dt.prototype.slice=function(s,a){s=at(s);var h=this;return h.__filtered__&&(s>0||a<0)?new dt(h):(s<0?h=h.takeRight(-s):s&&(h=h.drop(s)),a!==e&&(a=at(a),h=a<0?h.dropRight(-a):h.take(a-s)),h)},dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},dt.prototype.toArray=function(){return this.take(d)},es(dt.prototype,function(s,a){var h=/^(?:filter|find|map|reject)|While$/.test(a),y=/^(?:head|last)$/.test(a),R=k[y?"take"+(a=="last"?"Right":""):a],P=y||/^find/.test(a);R&&(k.prototype[a]=function(){var M=this.__wrapped__,L=y?[1]:arguments,F=M instanceof dt,te=L[0],re=F||Je(M),oe=function(pt){var gt=R.apply(k,_a([pt],L));return y&&he?gt[0]:gt};re&&h&&typeof te=="function"&&te.length!=1&&(F=re=!1);var he=this.__chain__,Ee=!!this.__actions__.length,ke=P&&!he,ct=F&&!Ee;if(!P&&re){M=ct?M:new dt(this);var Pe=s.apply(M,L);return Pe.__actions__.push({func:op,args:[oe],thisArg:e}),new sn(Pe,he)}return ke&&ct?s.apply(this,L):(Pe=this.thru(oe),ke?y?Pe.value()[0]:Pe.value():Pe)})}),rn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Bl[s],h=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);k.prototype[s]=function(){var R=arguments;if(y&&!this.__chain__){var P=this.value();return a.apply(Je(P)?P:[],R)}return this[h](function(M){return a.apply(Je(M)?M:[],R)})}}),es(dt.prototype,function(s,a){var h=k[a];if(h){var y=h.name+"";Ot.call(Tc,y)||(Tc[y]=[]),Tc[y].push({name:a,func:h})}}),Tc[ep(e,U).name]=[{name:"wrapper",func:e}],dt.prototype.clone=HR,dt.prototype.reverse=zR,dt.prototype.value=VR,k.prototype.at=x4,k.prototype.chain=b4,k.prototype.commit=_4,k.prototype.next=y4,k.prototype.plant=S4,k.prototype.reverse=E4,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=I4,k.prototype.first=k.prototype.head,Cu&&(k.prototype[Cu]=w4),k},wa=_R();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($r._=wa,define(function(){return wa})):vo?((vo.exports=wa)._=wa,Ld._=wa):$r._=wa}).call(tu)});var Kw=X((CY,Ww)=>{"use strict";var eB="http://bitcore.io/";Ww.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+eB+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."},{name:"BlockHeightOutOfRange",message:"Block Height can only be between 0 and 65535"},{name:"LockTimeRange",message:"Seconds needs to be more that 0 and less that 33553920"}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]});var Yi=X((LY,jv)=>{"use strict";var Vv=Et();function tB(e,t){return e.replace("{0}",t[0]).replace("{1}",t[1]).replace("{2}",t[2])}var Gw=function(e,t){var r=function(){if(Vv.isString(t.message))this.message=tB(t.message,arguments);else if(Vv.isFunction(t.message))this.message=t.message.apply(null,arguments);else throw new Error("Invalid error definition for "+t.name);this.stack=this.message+`
28
28
  `+new Error().stack};return r.prototype=Object.create(e.prototype),r.prototype.name=e.prototype.name+t.name,e[t.name]=r,t.errors&&$w(r,t.errors),r},$w=function(e,t){Vv.each(t,function(r){Gw(e,r)})},rB=function(e,t){return $w(e,t),e},ru={};ru.Error=function(){this.message="Internal error",this.stack=this.message+`
29
- `+new Error().stack};ru.Error.prototype=Object.create(Error.prototype);ru.Error.prototype.name="bitcore.Error";var iB=Kw();rB(ru.Error,iB);jv.exports=ru.Error;jv.exports.extend=function(e){return Gw(ru.Error,e)}});var xt=X((UY,Yw)=>{"use strict";var Jf=Yi(),nB=Et();Yw.exports={checkState:function(e,t){if(!e)throw new Jf.InvalidState(t)},checkArgument:function(e,t,r,i){if(!e)throw new Jf.InvalidArgument(t,r,i)},checkArgumentType:function(e,t,r){if(r=r||"(unknown name)",nB.isString(t)){if(t==="Buffer"){var i=require("buffer");if(!i.Buffer.isBuffer(e))throw new Jf.InvalidArgumentType(e,t,r)}else if(typeof e!==t&&e&&e.constructor&&e.constructor.name!==t)throw new Jf.InvalidArgumentType(e,t,r)}else if(!(e instanceof t))throw new Jf.InvalidArgumentType(e,t.name,r)},isType:function(e,t,r){try{return this.checkArgumentType(e,t,r),!0}catch{return!1}}}});var Rr=X((DY,Jw)=>{"use strict";var Xw=Et(),Zw=function(t){return Xw.isString(t)?/^[0-9a-fA-F]+$/.test(t):!1};Jw.exports={isValidJSON:function(t){var r;if(!Xw.isString(t))return!1;try{r=JSON.parse(t)}catch{return!1}return typeof r=="object"},isHexa:Zw,isHexaString:Zw,cloneArray:function(e){return[].concat(e)},defineImmutable:function(t,r){return Object.keys(r).forEach(function(i){Object.defineProperty(t,i,{configurable:!1,enumerable:!0,value:r[i]})}),t},isNaturalNumber:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&t>=0}}});var Yt=X((HY,Qf)=>{"use strict";var Qw=require("buffer"),qY=require("assert"),FY=Rr(),Wa=xt();function eS(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i<r;i++)if(e[i]!==t[i])return!1;return!0}Qf.exports={fill:function(t,r){Wa.checkArgumentType(t,"Buffer","buffer"),Wa.checkArgumentType(r,"number","value");for(var i=t.length,n=0;n<i;n++)t[n]=r;return t},copy:function(e){var t=Buffer.alloc(e.length);return e.copy(t),t},isBuffer:function(t){return Qw.Buffer.isBuffer(t)||t instanceof Uint8Array},emptyBuffer:function(t){Wa.checkArgumentType(t,"number","bytes");for(var r=Buffer.alloc(t),i=0;i<t;i++)r.write("\0",i);return r},concat:Qw.Buffer.concat,equals:eS,equal:eS,integerAsSingleByteBuffer:function(t){return Wa.checkArgumentType(t,"number","integer"),Buffer.from([t&255])},integerAsBuffer:function(t){Wa.checkArgumentType(t,"number","integer");var r=[];return r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(t&255),Buffer.from(r)},integerFromBuffer:function(t){return Wa.checkArgumentType(t,"Buffer","buffer"),t[0]<<24|t[1]<<16|t[2]<<8|t[3]},integerFromSingleByteBuffer:function(t){return Wa.checkArgumentType(t,"Buffer","buffer"),t[0]},bufferToHex:function(t){return Wa.checkArgumentType(t,"Buffer","buffer"),t.toString("hex")},reverse:function(t){return Buffer.from(t).reverse()}};Qf.exports.NULL_HASH=Qf.exports.fill(Buffer.alloc(32),0);Qf.exports.EMPTY_BUFFER=Buffer.alloc(0)});var Xr=X((zY,rS)=>{"use strict";var kt=zv(),Ah=xt(),tS=Et(),sB=Yt(),Oh=function(e){for(var t=Buffer.alloc(e.length),r=0;r<e.length;r++)t[r]=e[e.length-1-r];return t};kt.Zero=new kt(0);kt.One=new kt(1);kt.Minus1=new kt(-1);kt.fromNumber=function(e){return Ah.checkArgument(tS.isNumber(e)),new kt(e)};kt.fromString=function(e,t){return Ah.checkArgument(tS.isString(e)),new kt(e,t)};kt.fromBuffer=function(e,t){Ah.checkArgument(sB.isBuffer(e),"first argument should be a buffer"),e=Buffer.from(e),typeof t<"u"&&t.endian==="little"&&(e=Oh(e));var r=e.toString("hex"),i=new kt(r,16);return i};kt.fromSM=function(e,t){var r;if(e.length===0)return kt.fromBuffer(Buffer.from([0]));var i="big";return t&&(i=t.endian),i==="little"&&(e=Oh(e)),e[0]&128?(e[0]=e[0]&127,r=kt.fromBuffer(e),r.neg().copy(r)):r=kt.fromBuffer(e),r};kt.prototype.toNumber=function(){return parseInt(this.toString(10),10)};kt.prototype.toBuffer=function(e){var t,r;if(e&&e.size){r=this.toString(16,2);var i=r.length/2;t=Buffer.from(r,"hex"),i===e.size?t=t:i>e.size?t=kt.trim(t,i):i<e.size&&(t=kt.pad(t,i,e.size))}else r=this.toString(16,2),t=Buffer.from(r,"hex");return typeof e<"u"&&e.endian==="little"&&(t=Oh(t)),t};kt.prototype.toSMBigEndian=function(){var e;return this.cmp(kt.Zero)===-1?(e=this.neg().toBuffer(),e[0]&128?e=Buffer.concat([Buffer.from([128]),e]):e[0]=e[0]|128):(e=this.toBuffer(),e[0]&128&&(e=Buffer.concat([Buffer.from([0]),e]))),e.length===1&e[0]===0&&(e=Buffer.from([])),e};kt.prototype.toSM=function(e){var t=e?e.endian:"big",r=this.toSMBigEndian();return t==="little"&&(r=Oh(r)),r};kt.fromScriptNumBuffer=function(e,t,r){var i=r||4;if(Ah.checkArgument(e.length<=i,new Error("script number overflow")),t&&e.length>0&&!(e[e.length-1]&127)&&(e.length<=1||!(e[e.length-2]&128)))throw new Error("non-minimally encoded script number");return kt.fromSM(e,{endian:"little"})};kt.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})};kt.trim=function(e,t){return e.slice(t-e.length,e.length)};kt.pad=function(e,t,r){for(var i=Buffer.alloc(r),n=0;n<e.length;n++)i[i.length-1-n]=e[e.length-1-n];for(n=0;n<r-t;n++)i[n]=0;return i};rS.exports=kt});var iS=X((VY,aB)=>{aB.exports={name:"elliptic",version:"6.5.5",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var os=X((nS,Wv)=>{(function(e,t){"use strict";function r(f,c){if(!f)throw new Error(c||"Assertion failed")}function i(f,c){f.super_=c;var p=function(){};p.prototype=c.prototype,f.prototype=new p,f.prototype.constructor=f}function n(f,c,p){if(n.isBN(f))return f;this.negative=0,this.words=null,this.length=0,this.red=null,f!==null&&((c==="le"||c==="be")&&(p=c,c=10),this._init(f||0,c||10,p||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=require("buffer").Buffer}catch{}n.isBN=function(c){return c instanceof n?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===n.wordSize&&Array.isArray(c.words)},n.max=function(c,p){return c.cmp(p)>0?c:p},n.min=function(c,p){return c.cmp(p)<0?c:p},n.prototype._init=function(c,p,v){if(typeof c=="number")return this._initNumber(c,p,v);if(typeof c=="object")return this._initArray(c,p,v);p==="hex"&&(p=16),r(p===(p|0)&&p>=2&&p<=36),c=c.toString().replace(/\s+/g,"");var g=0;c[0]==="-"&&(g++,this.negative=1),g<c.length&&(p===16?this._parseHex(c,g,v):(this._parseBase(c,p,g),v==="le"&&this._initArray(this.toArray(),p,v)))},n.prototype._initNumber=function(c,p,v){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(r(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),v==="le"&&this._initArray(this.toArray(),p,v)},n.prototype._initArray=function(c,p,v){if(r(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var x,S,b=0;if(v==="be")for(g=c.length-1,x=0;g>=0;g-=3)S=c[g]|c[g-1]<<8|c[g-2]<<16,this.words[x]|=S<<b&67108863,this.words[x+1]=S>>>26-b&67108863,b+=24,b>=26&&(b-=26,x++);else if(v==="le")for(g=0,x=0;g<c.length;g+=3)S=c[g]|c[g+1]<<8|c[g+2]<<16,this.words[x]|=S<<b&67108863,this.words[x+1]=S>>>26-b&67108863,b+=24,b>=26&&(b-=26,x++);return this.strip()};function u(f,c){var p=f.charCodeAt(c);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function m(f,c,p){var v=u(f,p);return p-1>=c&&(v|=u(f,p-1)<<4),v}n.prototype._parseHex=function(c,p,v){this.length=Math.ceil((c.length-p)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var x=0,S=0,b;if(v==="be")for(g=c.length-1;g>=p;g-=2)b=m(c,p,g)<<x,this.words[S]|=b&67108863,x>=18?(x-=18,S+=1,this.words[S]|=b>>>26):x+=8;else{var l=c.length-p;for(g=l%2===0?p+1:p;g<c.length;g+=2)b=m(c,p,g)<<x,this.words[S]|=b&67108863,x>=18?(x-=18,S+=1,this.words[S]|=b>>>26):x+=8}this.strip()};function _(f,c,p,v){for(var g=0,x=Math.min(f.length,p),S=c;S<x;S++){var b=f.charCodeAt(S)-48;g*=v,b>=49?g+=b-49+10:b>=17?g+=b-17+10:g+=b}return g}n.prototype._parseBase=function(c,p,v){this.words=[0],this.length=1;for(var g=0,x=1;x<=67108863;x*=p)g++;g--,x=x/p|0;for(var S=c.length-v,b=S%g,l=Math.min(S,S-b)+v,d=0,A=v;A<l;A+=g)d=_(c,A,A+g,p),this.imuln(x),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(b!==0){var D=1;for(d=_(c,A,c.length,p),A=0;A<b;A++)D*=p;this.imuln(D),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},n.prototype.copy=function(c){c.words=new Array(this.length);for(var p=0;p<this.length;p++)c.words[p]=this.words[p];c.length=this.length,c.negative=this.negative,c.red=this.red},n.prototype.clone=function(){var c=new n(null);return this.copy(c),c},n.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],T=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(c,p){c=c||10,p=p|0||1;var v;if(c===16||c==="hex"){v="";for(var g=0,x=0,S=0;S<this.length;S++){var b=this.words[S],l=((b<<g|x)&16777215).toString(16);x=b>>>24-g&16777215,x!==0||S!==this.length-1?v=w[6-l.length]+l+v:v=l+v,g+=2,g>=26&&(g-=26,S--)}for(x!==0&&(v=x.toString(16)+v);v.length%p!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(c===(c|0)&&c>=2&&c<=36){var d=I[c],A=T[c];v="";var D=this.clone();for(D.negative=0;!D.isZero();){var V=D.modn(A).toString(c);D=D.idivn(A),D.isZero()?v=V+v:v=w[d-V.length]+V+v}for(this.isZero()&&(v="0"+v);v.length%p!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(c,p){return r(typeof o<"u"),this.toArrayLike(o,c,p)},n.prototype.toArray=function(c,p){return this.toArrayLike(Array,c,p)},n.prototype.toArrayLike=function(c,p,v){var g=this.byteLength(),x=v||Math.max(1,g);r(g<=x,"byte array longer than desired length"),r(x>0,"Requested array length <= 0"),this.strip();var S=p==="le",b=new c(x),l,d,A=this.clone();if(S){for(d=0;!A.isZero();d++)l=A.andln(255),A.iushrn(8),b[d]=l;for(;d<x;d++)b[d]=0}else{for(d=0;d<x-g;d++)b[d]=0;for(d=0;!A.isZero();d++)l=A.andln(255),A.iushrn(8),b[x-d-1]=l}return b},Math.clz32?n.prototype._countBits=function(c){return 32-Math.clz32(c)}:n.prototype._countBits=function(c){var p=c,v=0;return p>=4096&&(v+=13,p>>>=13),p>=64&&(v+=7,p>>>=7),p>=8&&(v+=4,p>>>=4),p>=2&&(v+=2,p>>>=2),v+p},n.prototype._zeroBits=function(c){if(c===0)return 26;var p=c,v=0;return p&8191||(v+=13,p>>>=13),p&127||(v+=7,p>>>=7),p&15||(v+=4,p>>>=4),p&3||(v+=2,p>>>=2),p&1||v++,v},n.prototype.bitLength=function(){var c=this.words[this.length-1],p=this._countBits(c);return(this.length-1)*26+p};function N(f){for(var c=new Array(f.bitLength()),p=0;p<c.length;p++){var v=p/26|0,g=p%26;c[p]=(f.words[v]&1<<g)>>>g}return c}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,p=0;p<this.length;p++){var v=this._zeroBits(this.words[p]);if(c+=v,v!==26)break}return c},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},n.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var p=0;p<c.length;p++)this.words[p]=this.words[p]|c.words[p];return this.strip()},n.prototype.ior=function(c){return r((this.negative|c.negative)===0),this.iuor(c)},n.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},n.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},n.prototype.iuand=function(c){var p;this.length>c.length?p=c:p=this;for(var v=0;v<p.length;v++)this.words[v]=this.words[v]&c.words[v];return this.length=p.length,this.strip()},n.prototype.iand=function(c){return r((this.negative|c.negative)===0),this.iuand(c)},n.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},n.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},n.prototype.iuxor=function(c){var p,v;this.length>c.length?(p=this,v=c):(p=c,v=this);for(var g=0;g<v.length;g++)this.words[g]=p.words[g]^v.words[g];if(this!==p)for(;g<p.length;g++)this.words[g]=p.words[g];return this.length=p.length,this.strip()},n.prototype.ixor=function(c){return r((this.negative|c.negative)===0),this.iuxor(c)},n.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},n.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},n.prototype.inotn=function(c){r(typeof c=="number"&&c>=0);var p=Math.ceil(c/26)|0,v=c%26;this._expand(p),v>0&&p--;for(var g=0;g<p;g++)this.words[g]=~this.words[g]&67108863;return v>0&&(this.words[g]=~this.words[g]&67108863>>26-v),this.strip()},n.prototype.notn=function(c){return this.clone().inotn(c)},n.prototype.setn=function(c,p){r(typeof c=="number"&&c>=0);var v=c/26|0,g=c%26;return this._expand(v+1),p?this.words[v]=this.words[v]|1<<g:this.words[v]=this.words[v]&~(1<<g),this.strip()},n.prototype.iadd=function(c){var p;if(this.negative!==0&&c.negative===0)return this.negative=0,p=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,p=this.isub(c),c.negative=1,p._normSign();var v,g;this.length>c.length?(v=this,g=c):(v=c,g=this);for(var x=0,S=0;S<g.length;S++)p=(v.words[S]|0)+(g.words[S]|0)+x,this.words[S]=p&67108863,x=p>>>26;for(;x!==0&&S<v.length;S++)p=(v.words[S]|0)+x,this.words[S]=p&67108863,x=p>>>26;if(this.length=v.length,x!==0)this.words[this.length]=x,this.length++;else if(v!==this)for(;S<v.length;S++)this.words[S]=v.words[S];return this},n.prototype.add=function(c){var p;return c.negative!==0&&this.negative===0?(c.negative=0,p=this.sub(c),c.negative^=1,p):c.negative===0&&this.negative!==0?(this.negative=0,p=c.sub(this),this.negative=1,p):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},n.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var p=this.iadd(c);return c.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var v=this.cmp(c);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,x;v>0?(g=this,x=c):(g=c,x=this);for(var S=0,b=0;b<x.length;b++)p=(g.words[b]|0)-(x.words[b]|0)+S,S=p>>26,this.words[b]=p&67108863;for(;S!==0&&b<g.length;b++)p=(g.words[b]|0)+S,S=p>>26,this.words[b]=p&67108863;if(S===0&&b<g.length&&g!==this)for(;b<g.length;b++)this.words[b]=g.words[b];return this.length=Math.max(this.length,b),g!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(c){return this.clone().isub(c)};function C(f,c,p){p.negative=c.negative^f.negative;var v=f.length+c.length|0;p.length=v,v=v-1|0;var g=f.words[0]|0,x=c.words[0]|0,S=g*x,b=S&67108863,l=S/67108864|0;p.words[0]=b;for(var d=1;d<v;d++){for(var A=l>>>26,D=l&67108863,V=Math.min(d,c.length-1),Y=Math.max(0,d-f.length+1);Y<=V;Y++){var se=d-Y|0;g=f.words[se]|0,x=c.words[Y]|0,S=g*x+D,A+=S/67108864|0,D=S&67108863}p.words[d]=D|0,l=A|0}return l!==0?p.words[d]=l|0:p.length--,p.strip()}var B=function(c,p,v){var g=c.words,x=p.words,S=v.words,b=0,l,d,A,D=g[0]|0,V=D&8191,Y=D>>>13,se=g[1]|0,ae=se&8191,pe=se>>>13,ye=g[2]|0,de=ye&8191,ht=ye>>>13,wt=g[3]|0,Re=wt&8191,st=wt>>>13,et=g[4]|0,Ie=et&8191,Te=et>>>13,jt=g[5]|0,Ve=jt&8191,Rt=jt>>>13,vt=g[6]|0,Me=vt&8191,Pt=vt>>>13,Qt=g[7]|0,Ce=Qt&8191,er=Qt>>>13,At=g[8]|0,Be=At&8191,Bt=At>>>13,Mt=g[9]|0,Ue=Mt&8191,Ct=Mt>>>13,Lt=x[0]|0,De=Lt&8191,Ut=Lt>>>13,Dt=x[1]|0,qe=Dt&8191,tr=Dt>>>13,rr=x[2]|0,je=rr&8191,Wt=rr>>>13,Kt=x[3]|0,We=Kt&8191,ir=Kt>>>13,nr=x[4]|0,Ke=nr&8191,Gt=nr>>>13,sr=x[5]|0,Ge=sr&8191,ar=sr>>>13,qt=x[6]|0,$e=qt&8191,Ft=qt>>>13,or=x[7]|0,Ye=or&8191,cr=or>>>13,ur=x[8]|0,Ze=ur&8191,fr=ur>>>13,lr=x[9]|0,Xe=lr&8191,Ht=lr>>>13;v.negative=c.negative^p.negative,v.length=19,l=Math.imul(V,De),d=Math.imul(V,Ut),d=d+Math.imul(Y,De)|0,A=Math.imul(Y,Ut);var ys=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(ys>>>26)|0,ys&=67108863,l=Math.imul(ae,De),d=Math.imul(ae,Ut),d=d+Math.imul(pe,De)|0,A=Math.imul(pe,Ut),l=l+Math.imul(V,qe)|0,d=d+Math.imul(V,tr)|0,d=d+Math.imul(Y,qe)|0,A=A+Math.imul(Y,tr)|0;var ws=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(ws>>>26)|0,ws&=67108863,l=Math.imul(de,De),d=Math.imul(de,Ut),d=d+Math.imul(ht,De)|0,A=Math.imul(ht,Ut),l=l+Math.imul(ae,qe)|0,d=d+Math.imul(ae,tr)|0,d=d+Math.imul(pe,qe)|0,A=A+Math.imul(pe,tr)|0,l=l+Math.imul(V,je)|0,d=d+Math.imul(V,Wt)|0,d=d+Math.imul(Y,je)|0,A=A+Math.imul(Y,Wt)|0;var Ss=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,l=Math.imul(Re,De),d=Math.imul(Re,Ut),d=d+Math.imul(st,De)|0,A=Math.imul(st,Ut),l=l+Math.imul(de,qe)|0,d=d+Math.imul(de,tr)|0,d=d+Math.imul(ht,qe)|0,A=A+Math.imul(ht,tr)|0,l=l+Math.imul(ae,je)|0,d=d+Math.imul(ae,Wt)|0,d=d+Math.imul(pe,je)|0,A=A+Math.imul(pe,Wt)|0,l=l+Math.imul(V,We)|0,d=d+Math.imul(V,ir)|0,d=d+Math.imul(Y,We)|0,A=A+Math.imul(Y,ir)|0;var Es=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Es>>>26)|0,Es&=67108863,l=Math.imul(Ie,De),d=Math.imul(Ie,Ut),d=d+Math.imul(Te,De)|0,A=Math.imul(Te,Ut),l=l+Math.imul(Re,qe)|0,d=d+Math.imul(Re,tr)|0,d=d+Math.imul(st,qe)|0,A=A+Math.imul(st,tr)|0,l=l+Math.imul(de,je)|0,d=d+Math.imul(de,Wt)|0,d=d+Math.imul(ht,je)|0,A=A+Math.imul(ht,Wt)|0,l=l+Math.imul(ae,We)|0,d=d+Math.imul(ae,ir)|0,d=d+Math.imul(pe,We)|0,A=A+Math.imul(pe,ir)|0,l=l+Math.imul(V,Ke)|0,d=d+Math.imul(V,Gt)|0,d=d+Math.imul(Y,Ke)|0,A=A+Math.imul(Y,Gt)|0;var Is=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Is>>>26)|0,Is&=67108863,l=Math.imul(Ve,De),d=Math.imul(Ve,Ut),d=d+Math.imul(Rt,De)|0,A=Math.imul(Rt,Ut),l=l+Math.imul(Ie,qe)|0,d=d+Math.imul(Ie,tr)|0,d=d+Math.imul(Te,qe)|0,A=A+Math.imul(Te,tr)|0,l=l+Math.imul(Re,je)|0,d=d+Math.imul(Re,Wt)|0,d=d+Math.imul(st,je)|0,A=A+Math.imul(st,Wt)|0,l=l+Math.imul(de,We)|0,d=d+Math.imul(de,ir)|0,d=d+Math.imul(ht,We)|0,A=A+Math.imul(ht,ir)|0,l=l+Math.imul(ae,Ke)|0,d=d+Math.imul(ae,Gt)|0,d=d+Math.imul(pe,Ke)|0,A=A+Math.imul(pe,Gt)|0,l=l+Math.imul(V,Ge)|0,d=d+Math.imul(V,ar)|0,d=d+Math.imul(Y,Ge)|0,A=A+Math.imul(Y,ar)|0;var Ts=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,l=Math.imul(Me,De),d=Math.imul(Me,Ut),d=d+Math.imul(Pt,De)|0,A=Math.imul(Pt,Ut),l=l+Math.imul(Ve,qe)|0,d=d+Math.imul(Ve,tr)|0,d=d+Math.imul(Rt,qe)|0,A=A+Math.imul(Rt,tr)|0,l=l+Math.imul(Ie,je)|0,d=d+Math.imul(Ie,Wt)|0,d=d+Math.imul(Te,je)|0,A=A+Math.imul(Te,Wt)|0,l=l+Math.imul(Re,We)|0,d=d+Math.imul(Re,ir)|0,d=d+Math.imul(st,We)|0,A=A+Math.imul(st,ir)|0,l=l+Math.imul(de,Ke)|0,d=d+Math.imul(de,Gt)|0,d=d+Math.imul(ht,Ke)|0,A=A+Math.imul(ht,Gt)|0,l=l+Math.imul(ae,Ge)|0,d=d+Math.imul(ae,ar)|0,d=d+Math.imul(pe,Ge)|0,A=A+Math.imul(pe,ar)|0,l=l+Math.imul(V,$e)|0,d=d+Math.imul(V,Ft)|0,d=d+Math.imul(Y,$e)|0,A=A+Math.imul(Y,Ft)|0;var Qi=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,l=Math.imul(Ce,De),d=Math.imul(Ce,Ut),d=d+Math.imul(er,De)|0,A=Math.imul(er,Ut),l=l+Math.imul(Me,qe)|0,d=d+Math.imul(Me,tr)|0,d=d+Math.imul(Pt,qe)|0,A=A+Math.imul(Pt,tr)|0,l=l+Math.imul(Ve,je)|0,d=d+Math.imul(Ve,Wt)|0,d=d+Math.imul(Rt,je)|0,A=A+Math.imul(Rt,Wt)|0,l=l+Math.imul(Ie,We)|0,d=d+Math.imul(Ie,ir)|0,d=d+Math.imul(Te,We)|0,A=A+Math.imul(Te,ir)|0,l=l+Math.imul(Re,Ke)|0,d=d+Math.imul(Re,Gt)|0,d=d+Math.imul(st,Ke)|0,A=A+Math.imul(st,Gt)|0,l=l+Math.imul(de,Ge)|0,d=d+Math.imul(de,ar)|0,d=d+Math.imul(ht,Ge)|0,A=A+Math.imul(ht,ar)|0,l=l+Math.imul(ae,$e)|0,d=d+Math.imul(ae,Ft)|0,d=d+Math.imul(pe,$e)|0,A=A+Math.imul(pe,Ft)|0,l=l+Math.imul(V,Ye)|0,d=d+Math.imul(V,cr)|0,d=d+Math.imul(Y,Ye)|0,A=A+Math.imul(Y,cr)|0;var Rs=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,l=Math.imul(Be,De),d=Math.imul(Be,Ut),d=d+Math.imul(Bt,De)|0,A=Math.imul(Bt,Ut),l=l+Math.imul(Ce,qe)|0,d=d+Math.imul(Ce,tr)|0,d=d+Math.imul(er,qe)|0,A=A+Math.imul(er,tr)|0,l=l+Math.imul(Me,je)|0,d=d+Math.imul(Me,Wt)|0,d=d+Math.imul(Pt,je)|0,A=A+Math.imul(Pt,Wt)|0,l=l+Math.imul(Ve,We)|0,d=d+Math.imul(Ve,ir)|0,d=d+Math.imul(Rt,We)|0,A=A+Math.imul(Rt,ir)|0,l=l+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ie,Gt)|0,d=d+Math.imul(Te,Ke)|0,A=A+Math.imul(Te,Gt)|0,l=l+Math.imul(Re,Ge)|0,d=d+Math.imul(Re,ar)|0,d=d+Math.imul(st,Ge)|0,A=A+Math.imul(st,ar)|0,l=l+Math.imul(de,$e)|0,d=d+Math.imul(de,Ft)|0,d=d+Math.imul(ht,$e)|0,A=A+Math.imul(ht,Ft)|0,l=l+Math.imul(ae,Ye)|0,d=d+Math.imul(ae,cr)|0,d=d+Math.imul(pe,Ye)|0,A=A+Math.imul(pe,cr)|0,l=l+Math.imul(V,Ze)|0,d=d+Math.imul(V,fr)|0,d=d+Math.imul(Y,Ze)|0,A=A+Math.imul(Y,fr)|0;var en=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(en>>>26)|0,en&=67108863,l=Math.imul(Ue,De),d=Math.imul(Ue,Ut),d=d+Math.imul(Ct,De)|0,A=Math.imul(Ct,Ut),l=l+Math.imul(Be,qe)|0,d=d+Math.imul(Be,tr)|0,d=d+Math.imul(Bt,qe)|0,A=A+Math.imul(Bt,tr)|0,l=l+Math.imul(Ce,je)|0,d=d+Math.imul(Ce,Wt)|0,d=d+Math.imul(er,je)|0,A=A+Math.imul(er,Wt)|0,l=l+Math.imul(Me,We)|0,d=d+Math.imul(Me,ir)|0,d=d+Math.imul(Pt,We)|0,A=A+Math.imul(Pt,ir)|0,l=l+Math.imul(Ve,Ke)|0,d=d+Math.imul(Ve,Gt)|0,d=d+Math.imul(Rt,Ke)|0,A=A+Math.imul(Rt,Gt)|0,l=l+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ie,ar)|0,d=d+Math.imul(Te,Ge)|0,A=A+Math.imul(Te,ar)|0,l=l+Math.imul(Re,$e)|0,d=d+Math.imul(Re,Ft)|0,d=d+Math.imul(st,$e)|0,A=A+Math.imul(st,Ft)|0,l=l+Math.imul(de,Ye)|0,d=d+Math.imul(de,cr)|0,d=d+Math.imul(ht,Ye)|0,A=A+Math.imul(ht,cr)|0,l=l+Math.imul(ae,Ze)|0,d=d+Math.imul(ae,fr)|0,d=d+Math.imul(pe,Ze)|0,A=A+Math.imul(pe,fr)|0,l=l+Math.imul(V,Xe)|0,d=d+Math.imul(V,Ht)|0,d=d+Math.imul(Y,Xe)|0,A=A+Math.imul(Y,Ht)|0;var As=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(As>>>26)|0,As&=67108863,l=Math.imul(Ue,qe),d=Math.imul(Ue,tr),d=d+Math.imul(Ct,qe)|0,A=Math.imul(Ct,tr),l=l+Math.imul(Be,je)|0,d=d+Math.imul(Be,Wt)|0,d=d+Math.imul(Bt,je)|0,A=A+Math.imul(Bt,Wt)|0,l=l+Math.imul(Ce,We)|0,d=d+Math.imul(Ce,ir)|0,d=d+Math.imul(er,We)|0,A=A+Math.imul(er,ir)|0,l=l+Math.imul(Me,Ke)|0,d=d+Math.imul(Me,Gt)|0,d=d+Math.imul(Pt,Ke)|0,A=A+Math.imul(Pt,Gt)|0,l=l+Math.imul(Ve,Ge)|0,d=d+Math.imul(Ve,ar)|0,d=d+Math.imul(Rt,Ge)|0,A=A+Math.imul(Rt,ar)|0,l=l+Math.imul(Ie,$e)|0,d=d+Math.imul(Ie,Ft)|0,d=d+Math.imul(Te,$e)|0,A=A+Math.imul(Te,Ft)|0,l=l+Math.imul(Re,Ye)|0,d=d+Math.imul(Re,cr)|0,d=d+Math.imul(st,Ye)|0,A=A+Math.imul(st,cr)|0,l=l+Math.imul(de,Ze)|0,d=d+Math.imul(de,fr)|0,d=d+Math.imul(ht,Ze)|0,A=A+Math.imul(ht,fr)|0,l=l+Math.imul(ae,Xe)|0,d=d+Math.imul(ae,Ht)|0,d=d+Math.imul(pe,Xe)|0,A=A+Math.imul(pe,Ht)|0;var Os=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Os>>>26)|0,Os&=67108863,l=Math.imul(Ue,je),d=Math.imul(Ue,Wt),d=d+Math.imul(Ct,je)|0,A=Math.imul(Ct,Wt),l=l+Math.imul(Be,We)|0,d=d+Math.imul(Be,ir)|0,d=d+Math.imul(Bt,We)|0,A=A+Math.imul(Bt,ir)|0,l=l+Math.imul(Ce,Ke)|0,d=d+Math.imul(Ce,Gt)|0,d=d+Math.imul(er,Ke)|0,A=A+Math.imul(er,Gt)|0,l=l+Math.imul(Me,Ge)|0,d=d+Math.imul(Me,ar)|0,d=d+Math.imul(Pt,Ge)|0,A=A+Math.imul(Pt,ar)|0,l=l+Math.imul(Ve,$e)|0,d=d+Math.imul(Ve,Ft)|0,d=d+Math.imul(Rt,$e)|0,A=A+Math.imul(Rt,Ft)|0,l=l+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,cr)|0,d=d+Math.imul(Te,Ye)|0,A=A+Math.imul(Te,cr)|0,l=l+Math.imul(Re,Ze)|0,d=d+Math.imul(Re,fr)|0,d=d+Math.imul(st,Ze)|0,A=A+Math.imul(st,fr)|0,l=l+Math.imul(de,Xe)|0,d=d+Math.imul(de,Ht)|0,d=d+Math.imul(ht,Xe)|0,A=A+Math.imul(ht,Ht)|0;var ks=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(ks>>>26)|0,ks&=67108863,l=Math.imul(Ue,We),d=Math.imul(Ue,ir),d=d+Math.imul(Ct,We)|0,A=Math.imul(Ct,ir),l=l+Math.imul(Be,Ke)|0,d=d+Math.imul(Be,Gt)|0,d=d+Math.imul(Bt,Ke)|0,A=A+Math.imul(Bt,Gt)|0,l=l+Math.imul(Ce,Ge)|0,d=d+Math.imul(Ce,ar)|0,d=d+Math.imul(er,Ge)|0,A=A+Math.imul(er,ar)|0,l=l+Math.imul(Me,$e)|0,d=d+Math.imul(Me,Ft)|0,d=d+Math.imul(Pt,$e)|0,A=A+Math.imul(Pt,Ft)|0,l=l+Math.imul(Ve,Ye)|0,d=d+Math.imul(Ve,cr)|0,d=d+Math.imul(Rt,Ye)|0,A=A+Math.imul(Rt,cr)|0,l=l+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ie,fr)|0,d=d+Math.imul(Te,Ze)|0,A=A+Math.imul(Te,fr)|0,l=l+Math.imul(Re,Xe)|0,d=d+Math.imul(Re,Ht)|0,d=d+Math.imul(st,Xe)|0,A=A+Math.imul(st,Ht)|0;var Zn=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Zn>>>26)|0,Zn&=67108863,l=Math.imul(Ue,Ke),d=Math.imul(Ue,Gt),d=d+Math.imul(Ct,Ke)|0,A=Math.imul(Ct,Gt),l=l+Math.imul(Be,Ge)|0,d=d+Math.imul(Be,ar)|0,d=d+Math.imul(Bt,Ge)|0,A=A+Math.imul(Bt,ar)|0,l=l+Math.imul(Ce,$e)|0,d=d+Math.imul(Ce,Ft)|0,d=d+Math.imul(er,$e)|0,A=A+Math.imul(er,Ft)|0,l=l+Math.imul(Me,Ye)|0,d=d+Math.imul(Me,cr)|0,d=d+Math.imul(Pt,Ye)|0,A=A+Math.imul(Pt,cr)|0,l=l+Math.imul(Ve,Ze)|0,d=d+Math.imul(Ve,fr)|0,d=d+Math.imul(Rt,Ze)|0,A=A+Math.imul(Rt,fr)|0,l=l+Math.imul(Ie,Xe)|0,d=d+Math.imul(Ie,Ht)|0,d=d+Math.imul(Te,Xe)|0,A=A+Math.imul(Te,Ht)|0;var Xn=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,l=Math.imul(Ue,Ge),d=Math.imul(Ue,ar),d=d+Math.imul(Ct,Ge)|0,A=Math.imul(Ct,ar),l=l+Math.imul(Be,$e)|0,d=d+Math.imul(Be,Ft)|0,d=d+Math.imul(Bt,$e)|0,A=A+Math.imul(Bt,Ft)|0,l=l+Math.imul(Ce,Ye)|0,d=d+Math.imul(Ce,cr)|0,d=d+Math.imul(er,Ye)|0,A=A+Math.imul(er,cr)|0,l=l+Math.imul(Me,Ze)|0,d=d+Math.imul(Me,fr)|0,d=d+Math.imul(Pt,Ze)|0,A=A+Math.imul(Pt,fr)|0,l=l+Math.imul(Ve,Xe)|0,d=d+Math.imul(Ve,Ht)|0,d=d+Math.imul(Rt,Xe)|0,A=A+Math.imul(Rt,Ht)|0;var Jn=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,l=Math.imul(Ue,$e),d=Math.imul(Ue,Ft),d=d+Math.imul(Ct,$e)|0,A=Math.imul(Ct,Ft),l=l+Math.imul(Be,Ye)|0,d=d+Math.imul(Be,cr)|0,d=d+Math.imul(Bt,Ye)|0,A=A+Math.imul(Bt,cr)|0,l=l+Math.imul(Ce,Ze)|0,d=d+Math.imul(Ce,fr)|0,d=d+Math.imul(er,Ze)|0,A=A+Math.imul(er,fr)|0,l=l+Math.imul(Me,Xe)|0,d=d+Math.imul(Me,Ht)|0,d=d+Math.imul(Pt,Xe)|0,A=A+Math.imul(Pt,Ht)|0;var Ps=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,l=Math.imul(Ue,Ye),d=Math.imul(Ue,cr),d=d+Math.imul(Ct,Ye)|0,A=Math.imul(Ct,cr),l=l+Math.imul(Be,Ze)|0,d=d+Math.imul(Be,fr)|0,d=d+Math.imul(Bt,Ze)|0,A=A+Math.imul(Bt,fr)|0,l=l+Math.imul(Ce,Xe)|0,d=d+Math.imul(Ce,Ht)|0,d=d+Math.imul(er,Xe)|0,A=A+Math.imul(er,Ht)|0;var Ns=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,l=Math.imul(Ue,Ze),d=Math.imul(Ue,fr),d=d+Math.imul(Ct,Ze)|0,A=Math.imul(Ct,fr),l=l+Math.imul(Be,Xe)|0,d=d+Math.imul(Be,Ht)|0,d=d+Math.imul(Bt,Xe)|0,A=A+Math.imul(Bt,Ht)|0;var Bs=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,l=Math.imul(Ue,Xe),d=Math.imul(Ue,Ht),d=d+Math.imul(Ct,Xe)|0,A=Math.imul(Ct,Ht);var Bu=(b+l|0)+((d&8191)<<13)|0;return b=(A+(d>>>13)|0)+(Bu>>>26)|0,Bu&=67108863,S[0]=ys,S[1]=ws,S[2]=Ss,S[3]=Es,S[4]=Is,S[5]=Ts,S[6]=Qi,S[7]=Rs,S[8]=en,S[9]=As,S[10]=Os,S[11]=ks,S[12]=Zn,S[13]=Xn,S[14]=Jn,S[15]=Ps,S[16]=Ns,S[17]=Bs,S[18]=Bu,b!==0&&(S[19]=b,v.length++),v};Math.imul||(B=C);function U(f,c,p){p.negative=c.negative^f.negative,p.length=f.length+c.length;for(var v=0,g=0,x=0;x<p.length-1;x++){var S=g;g=0;for(var b=v&67108863,l=Math.min(x,c.length-1),d=Math.max(0,x-f.length+1);d<=l;d++){var A=x-d,D=f.words[A]|0,V=c.words[d]|0,Y=D*V,se=Y&67108863;S=S+(Y/67108864|0)|0,se=se+b|0,b=se&67108863,S=S+(se>>>26)|0,g+=S>>>26,S&=67108863}p.words[x]=b,v=S,S=g}return v!==0?p.words[x]=v:p.length--,p.strip()}function Z(f,c,p){var v=new $;return v.mulp(f,c,p)}n.prototype.mulTo=function(c,p){var v,g=this.length+c.length;return this.length===10&&c.length===10?v=B(this,c,p):g<63?v=C(this,c,p):g<1024?v=U(this,c,p):v=Z(this,c,p),v};function $(f,c){this.x=f,this.y=c}$.prototype.makeRBT=function(c){for(var p=new Array(c),v=n.prototype._countBits(c)-1,g=0;g<c;g++)p[g]=this.revBin(g,v,c);return p},$.prototype.revBin=function(c,p,v){if(c===0||c===v-1)return c;for(var g=0,x=0;x<p;x++)g|=(c&1)<<p-x-1,c>>=1;return g},$.prototype.permute=function(c,p,v,g,x,S){for(var b=0;b<S;b++)g[b]=p[c[b]],x[b]=v[c[b]]},$.prototype.transform=function(c,p,v,g,x,S){this.permute(S,c,p,v,g,x);for(var b=1;b<x;b<<=1)for(var l=b<<1,d=Math.cos(2*Math.PI/l),A=Math.sin(2*Math.PI/l),D=0;D<x;D+=l)for(var V=d,Y=A,se=0;se<b;se++){var ae=v[D+se],pe=g[D+se],ye=v[D+se+b],de=g[D+se+b],ht=V*ye-Y*de;de=V*de+Y*ye,ye=ht,v[D+se]=ae+ye,g[D+se]=pe+de,v[D+se+b]=ae-ye,g[D+se+b]=pe-de,se!==l&&(ht=d*V-A*Y,Y=d*Y+A*V,V=ht)}},$.prototype.guessLen13b=function(c,p){var v=Math.max(p,c)|1,g=v&1,x=0;for(v=v/2|0;v;v=v>>>1)x++;return 1<<x+1+g},$.prototype.conjugate=function(c,p,v){if(!(v<=1))for(var g=0;g<v/2;g++){var x=c[g];c[g]=c[v-g-1],c[v-g-1]=x,x=p[g],p[g]=-p[v-g-1],p[v-g-1]=-x}},$.prototype.normalize13b=function(c,p){for(var v=0,g=0;g<p/2;g++){var x=Math.round(c[2*g+1]/p)*8192+Math.round(c[2*g]/p)+v;c[g]=x&67108863,x<67108864?v=0:v=x/67108864|0}return c},$.prototype.convert13b=function(c,p,v,g){for(var x=0,S=0;S<p;S++)x=x+(c[S]|0),v[2*S]=x&8191,x=x>>>13,v[2*S+1]=x&8191,x=x>>>13;for(S=2*p;S<g;++S)v[S]=0;r(x===0),r((x&-8192)===0)},$.prototype.stub=function(c){for(var p=new Array(c),v=0;v<c;v++)p[v]=0;return p},$.prototype.mulp=function(c,p,v){var g=2*this.guessLen13b(c.length,p.length),x=this.makeRBT(g),S=this.stub(g),b=new Array(g),l=new Array(g),d=new Array(g),A=new Array(g),D=new Array(g),V=new Array(g),Y=v.words;Y.length=g,this.convert13b(c.words,c.length,b,g),this.convert13b(p.words,p.length,A,g),this.transform(b,S,l,d,g,x),this.transform(A,S,D,V,g,x);for(var se=0;se<g;se++){var ae=l[se]*D[se]-d[se]*V[se];d[se]=l[se]*V[se]+d[se]*D[se],l[se]=ae}return this.conjugate(l,d,g),this.transform(l,d,Y,S,g,x),this.conjugate(Y,S,g),this.normalize13b(Y,g),v.negative=c.negative^p.negative,v.length=c.length+p.length,v.strip()},n.prototype.mul=function(c){var p=new n(null);return p.words=new Array(this.length+c.length),this.mulTo(c,p)},n.prototype.mulf=function(c){var p=new n(null);return p.words=new Array(this.length+c.length),Z(this,c,p)},n.prototype.imul=function(c){return this.clone().mulTo(c,this)},n.prototype.imuln=function(c){r(typeof c=="number"),r(c<67108864);for(var p=0,v=0;v<this.length;v++){var g=(this.words[v]|0)*c,x=(g&67108863)+(p&67108863);p>>=26,p+=g/67108864|0,p+=x>>>26,this.words[v]=x&67108863}return p!==0&&(this.words[v]=p,this.length++),this},n.prototype.muln=function(c){return this.clone().imuln(c)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(c){var p=N(c);if(p.length===0)return new n(1);for(var v=this,g=0;g<p.length&&p[g]===0;g++,v=v.sqr());if(++g<p.length)for(var x=v.sqr();g<p.length;g++,x=x.sqr())p[g]!==0&&(v=v.mul(x));return v},n.prototype.iushln=function(c){r(typeof c=="number"&&c>=0);var p=c%26,v=(c-p)/26,g=67108863>>>26-p<<26-p,x;if(p!==0){var S=0;for(x=0;x<this.length;x++){var b=this.words[x]&g,l=(this.words[x]|0)-b<<p;this.words[x]=l|S,S=b>>>26-p}S&&(this.words[x]=S,this.length++)}if(v!==0){for(x=this.length-1;x>=0;x--)this.words[x+v]=this.words[x];for(x=0;x<v;x++)this.words[x]=0;this.length+=v}return this.strip()},n.prototype.ishln=function(c){return r(this.negative===0),this.iushln(c)},n.prototype.iushrn=function(c,p,v){r(typeof c=="number"&&c>=0);var g;p?g=(p-p%26)/26:g=0;var x=c%26,S=Math.min((c-x)/26,this.length),b=67108863^67108863>>>x<<x,l=v;if(g-=S,g=Math.max(0,g),l){for(var d=0;d<S;d++)l.words[d]=this.words[d];l.length=S}if(S!==0)if(this.length>S)for(this.length-=S,d=0;d<this.length;d++)this.words[d]=this.words[d+S];else this.words[0]=0,this.length=1;var A=0;for(d=this.length-1;d>=0&&(A!==0||d>=g);d--){var D=this.words[d]|0;this.words[d]=A<<26-x|D>>>x,A=D&b}return l&&A!==0&&(l.words[l.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(c,p,v){return r(this.negative===0),this.iushrn(c,p,v)},n.prototype.shln=function(c){return this.clone().ishln(c)},n.prototype.ushln=function(c){return this.clone().iushln(c)},n.prototype.shrn=function(c){return this.clone().ishrn(c)},n.prototype.ushrn=function(c){return this.clone().iushrn(c)},n.prototype.testn=function(c){r(typeof c=="number"&&c>=0);var p=c%26,v=(c-p)/26,g=1<<p;if(this.length<=v)return!1;var x=this.words[v];return!!(x&g)},n.prototype.imaskn=function(c){r(typeof c=="number"&&c>=0);var p=c%26,v=(c-p)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(p!==0&&v++,this.length=Math.min(v,this.length),p!==0){var g=67108863^67108863>>>p<<p;this.words[this.length-1]&=g}return this.strip()},n.prototype.maskn=function(c){return this.clone().imaskn(c)},n.prototype.iaddn=function(c){return r(typeof c=="number"),r(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},n.prototype._iaddn=function(c){this.words[0]+=c;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},n.prototype.isubn=function(c){if(r(typeof c=="number"),r(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this.strip()},n.prototype.addn=function(c){return this.clone().iaddn(c)},n.prototype.subn=function(c){return this.clone().isubn(c)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(c,p,v){var g=c.length+v,x;this._expand(g);var S,b=0;for(x=0;x<c.length;x++){S=(this.words[x+v]|0)+b;var l=(c.words[x]|0)*p;S-=l&67108863,b=(S>>26)-(l/67108864|0),this.words[x+v]=S&67108863}for(;x<this.length-v;x++)S=(this.words[x+v]|0)+b,b=S>>26,this.words[x+v]=S&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,x=0;x<this.length;x++)S=-(this.words[x]|0)+b,b=S>>26,this.words[x]=S&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(c,p){var v=this.length-c.length,g=this.clone(),x=c,S=x.words[x.length-1]|0,b=this._countBits(S);v=26-b,v!==0&&(x=x.ushln(v),g.iushln(v),S=x.words[x.length-1]|0);var l=g.length-x.length,d;if(p!=="mod"){d=new n(null),d.length=l+1,d.words=new Array(d.length);for(var A=0;A<d.length;A++)d.words[A]=0}var D=g.clone()._ishlnsubmul(x,1,l);D.negative===0&&(g=D,d&&(d.words[l]=1));for(var V=l-1;V>=0;V--){var Y=(g.words[x.length+V]|0)*67108864+(g.words[x.length+V-1]|0);for(Y=Math.min(Y/S|0,67108863),g._ishlnsubmul(x,Y,V);g.negative!==0;)Y--,g.negative=0,g._ishlnsubmul(x,1,V),g.isZero()||(g.negative^=1);d&&(d.words[V]=Y)}return d&&d.strip(),g.strip(),p!=="div"&&v!==0&&g.iushrn(v),{div:d||null,mod:g}},n.prototype.divmod=function(c,p,v){if(r(!c.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var g,x,S;return this.negative!==0&&c.negative===0?(S=this.neg().divmod(c,p),p!=="mod"&&(g=S.div.neg()),p!=="div"&&(x=S.mod.neg(),v&&x.negative!==0&&x.iadd(c)),{div:g,mod:x}):this.negative===0&&c.negative!==0?(S=this.divmod(c.neg(),p),p!=="mod"&&(g=S.div.neg()),{div:g,mod:S.mod}):this.negative&c.negative?(S=this.neg().divmod(c.neg(),p),p!=="div"&&(x=S.mod.neg(),v&&x.negative!==0&&x.isub(c)),{div:S.div,mod:x}):c.length>this.length||this.cmp(c)<0?{div:new n(0),mod:this}:c.length===1?p==="div"?{div:this.divn(c.words[0]),mod:null}:p==="mod"?{div:null,mod:new n(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new n(this.modn(c.words[0]))}:this._wordDiv(c,p)},n.prototype.div=function(c){return this.divmod(c,"div",!1).div},n.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},n.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},n.prototype.divRound=function(c){var p=this.divmod(c);if(p.mod.isZero())return p.div;var v=p.div.negative!==0?p.mod.isub(c):p.mod,g=c.ushrn(1),x=c.andln(1),S=v.cmp(g);return S<0||x===1&&S===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},n.prototype.modn=function(c){r(c<=67108863);for(var p=(1<<26)%c,v=0,g=this.length-1;g>=0;g--)v=(p*v+(this.words[g]|0))%c;return v},n.prototype.idivn=function(c){r(c<=67108863);for(var p=0,v=this.length-1;v>=0;v--){var g=(this.words[v]|0)+p*67108864;this.words[v]=g/c|0,p=g%c}return this.strip()},n.prototype.divn=function(c){return this.clone().idivn(c)},n.prototype.egcd=function(c){r(c.negative===0),r(!c.isZero());var p=this,v=c.clone();p.negative!==0?p=p.umod(c):p=p.clone();for(var g=new n(1),x=new n(0),S=new n(0),b=new n(1),l=0;p.isEven()&&v.isEven();)p.iushrn(1),v.iushrn(1),++l;for(var d=v.clone(),A=p.clone();!p.isZero();){for(var D=0,V=1;!(p.words[0]&V)&&D<26;++D,V<<=1);if(D>0)for(p.iushrn(D);D-- >0;)(g.isOdd()||x.isOdd())&&(g.iadd(d),x.isub(A)),g.iushrn(1),x.iushrn(1);for(var Y=0,se=1;!(v.words[0]&se)&&Y<26;++Y,se<<=1);if(Y>0)for(v.iushrn(Y);Y-- >0;)(S.isOdd()||b.isOdd())&&(S.iadd(d),b.isub(A)),S.iushrn(1),b.iushrn(1);p.cmp(v)>=0?(p.isub(v),g.isub(S),x.isub(b)):(v.isub(p),S.isub(g),b.isub(x))}return{a:S,b,gcd:v.iushln(l)}},n.prototype._invmp=function(c){r(c.negative===0),r(!c.isZero());var p=this,v=c.clone();p.negative!==0?p=p.umod(c):p=p.clone();for(var g=new n(1),x=new n(0),S=v.clone();p.cmpn(1)>0&&v.cmpn(1)>0;){for(var b=0,l=1;!(p.words[0]&l)&&b<26;++b,l<<=1);if(b>0)for(p.iushrn(b);b-- >0;)g.isOdd()&&g.iadd(S),g.iushrn(1);for(var d=0,A=1;!(v.words[0]&A)&&d<26;++d,A<<=1);if(d>0)for(v.iushrn(d);d-- >0;)x.isOdd()&&x.iadd(S),x.iushrn(1);p.cmp(v)>=0?(p.isub(v),g.isub(x)):(v.isub(p),x.isub(g))}var D;return p.cmpn(1)===0?D=g:D=x,D.cmpn(0)<0&&D.iadd(c),D},n.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var p=this.clone(),v=c.clone();p.negative=0,v.negative=0;for(var g=0;p.isEven()&&v.isEven();g++)p.iushrn(1),v.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;v.isEven();)v.iushrn(1);var x=p.cmp(v);if(x<0){var S=p;p=v,v=S}else if(x===0||v.cmpn(1)===0)break;p.isub(v)}while(!0);return v.iushln(g)},n.prototype.invm=function(c){return this.egcd(c).a.umod(c)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(c){return this.words[0]&c},n.prototype.bincn=function(c){r(typeof c=="number");var p=c%26,v=(c-p)/26,g=1<<p;if(this.length<=v)return this._expand(v+1),this.words[v]|=g,this;for(var x=g,S=v;x!==0&&S<this.length;S++){var b=this.words[S]|0;b+=x,x=b>>>26,b&=67108863,this.words[S]=b}return x!==0&&(this.words[S]=x,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(c){var p=c<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var v;if(this.length>1)v=1;else{p&&(c=-c),r(c<=67108863,"Number is too big");var g=this.words[0]|0;v=g===c?0:g<c?-1:1}return this.negative!==0?-v|0:v},n.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var p=this.ucmp(c);return this.negative!==0?-p|0:p},n.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var p=0,v=this.length-1;v>=0;v--){var g=this.words[v]|0,x=c.words[v]|0;if(g!==x){g<x?p=-1:g>x&&(p=1);break}}return p},n.prototype.gtn=function(c){return this.cmpn(c)===1},n.prototype.gt=function(c){return this.cmp(c)===1},n.prototype.gten=function(c){return this.cmpn(c)>=0},n.prototype.gte=function(c){return this.cmp(c)>=0},n.prototype.ltn=function(c){return this.cmpn(c)===-1},n.prototype.lt=function(c){return this.cmp(c)===-1},n.prototype.lten=function(c){return this.cmpn(c)<=0},n.prototype.lte=function(c){return this.cmp(c)<=0},n.prototype.eqn=function(c){return this.cmpn(c)===0},n.prototype.eq=function(c){return this.cmp(c)===0},n.red=function(c){return new O(c)},n.prototype.toRed=function(c){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(c){return this.red=c,this},n.prototype.forceRed=function(c){return r(!this.red,"Already a number in reduction context"),this._forceRed(c)},n.prototype.redAdd=function(c){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},n.prototype.redIAdd=function(c){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},n.prototype.redSub=function(c){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},n.prototype.redISub=function(c){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},n.prototype.redShl=function(c){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},n.prototype.redMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},n.prototype.redIMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(c){return r(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var H={k256:null,p224:null,p192:null,p25519:null};function ee(f,c){this.name=f,this.p=new n(c,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}ee.prototype._tmp=function(){var c=new n(null);return c.words=new Array(Math.ceil(this.n/13)),c},ee.prototype.ireduce=function(c){var p=c,v;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),v=p.bitLength();while(v>this.n);var g=v<this.n?-1:p.ucmp(this.p);return g===0?(p.words[0]=0,p.length=1):g>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},ee.prototype.split=function(c,p){c.iushrn(this.n,0,p)},ee.prototype.imulK=function(c){return c.imul(this.k)};function ce(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(ce,ee),ce.prototype.split=function(c,p){for(var v=4194303,g=Math.min(c.length,9),x=0;x<g;x++)p.words[x]=c.words[x];if(p.length=g,c.length<=9){c.words[0]=0,c.length=1;return}var S=c.words[9];for(p.words[p.length++]=S&v,x=10;x<c.length;x++){var b=c.words[x]|0;c.words[x-10]=(b&v)<<4|S>>>22,S=b}S>>>=22,c.words[x-10]=S,S===0&&c.length>10?c.length-=10:c.length-=9},ce.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var p=0,v=0;v<c.length;v++){var g=c.words[v]|0;p+=g*977,c.words[v]=p&67108863,p=g*64+(p/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function ge(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(ge,ee);function Se(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(Se,ee);function me(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(me,ee),me.prototype.imulK=function(c){for(var p=0,v=0;v<c.length;v++){var g=(c.words[v]|0)*19+p,x=g&67108863;g>>>=26,c.words[v]=x,p=g}return p!==0&&(c.words[c.length++]=p),c},n._prime=function(c){if(H[c])return H[c];var p;if(c==="k256")p=new ce;else if(c==="p224")p=new ge;else if(c==="p192")p=new Se;else if(c==="p25519")p=new me;else throw new Error("Unknown prime "+c);return H[c]=p,p};function O(f){if(typeof f=="string"){var c=n._prime(f);this.m=c.p,this.prime=c}else r(f.gtn(1),"modulus must be greater than 1"),this.m=f,this.prime=null}O.prototype._verify1=function(c){r(c.negative===0,"red works only with positives"),r(c.red,"red works only with red numbers")},O.prototype._verify2=function(c,p){r((c.negative|p.negative)===0,"red works only with positives"),r(c.red&&c.red===p.red,"red works only with red numbers")},O.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):c.umod(this.m)._forceRed(this)},O.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},O.prototype.add=function(c,p){this._verify2(c,p);var v=c.add(p);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},O.prototype.iadd=function(c,p){this._verify2(c,p);var v=c.iadd(p);return v.cmp(this.m)>=0&&v.isub(this.m),v},O.prototype.sub=function(c,p){this._verify2(c,p);var v=c.sub(p);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},O.prototype.isub=function(c,p){this._verify2(c,p);var v=c.isub(p);return v.cmpn(0)<0&&v.iadd(this.m),v},O.prototype.shl=function(c,p){return this._verify1(c),this.imod(c.ushln(p))},O.prototype.imul=function(c,p){return this._verify2(c,p),this.imod(c.imul(p))},O.prototype.mul=function(c,p){return this._verify2(c,p),this.imod(c.mul(p))},O.prototype.isqr=function(c){return this.imul(c,c.clone())},O.prototype.sqr=function(c){return this.mul(c,c)},O.prototype.sqrt=function(c){if(c.isZero())return c.clone();var p=this.m.andln(3);if(r(p%2===1),p===3){var v=this.m.add(new n(1)).iushrn(2);return this.pow(c,v)}for(var g=this.m.subn(1),x=0;!g.isZero()&&g.andln(1)===0;)x++,g.iushrn(1);r(!g.isZero());var S=new n(1).toRed(this),b=S.redNeg(),l=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new n(2*d*d).toRed(this);this.pow(d,l).cmp(b)!==0;)d.redIAdd(b);for(var A=this.pow(d,g),D=this.pow(c,g.addn(1).iushrn(1)),V=this.pow(c,g),Y=x;V.cmp(S)!==0;){for(var se=V,ae=0;se.cmp(S)!==0;ae++)se=se.redSqr();r(ae<Y);var pe=this.pow(A,new n(1).iushln(Y-ae-1));D=D.redMul(pe),A=pe.redSqr(),V=V.redMul(A),Y=ae}return D},O.prototype.invm=function(c){var p=c._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},O.prototype.pow=function(c,p){if(p.isZero())return new n(1).toRed(this);if(p.cmpn(1)===0)return c.clone();var v=4,g=new Array(1<<v);g[0]=new n(1).toRed(this),g[1]=c;for(var x=2;x<g.length;x++)g[x]=this.mul(g[x-1],c);var S=g[0],b=0,l=0,d=p.bitLength()%26;for(d===0&&(d=26),x=p.length-1;x>=0;x--){for(var A=p.words[x],D=d-1;D>=0;D--){var V=A>>D&1;if(S!==g[0]&&(S=this.sqr(S)),V===0&&b===0){l=0;continue}b<<=1,b|=V,l++,!(l!==v&&(x!==0||D!==0))&&(S=this.mul(S,g[b]),l=0,b=0)}d=26}return S},O.prototype.convertTo=function(c){var p=c.umod(this.m);return p===c?p.clone():p},O.prototype.convertFrom=function(c){var p=c.clone();return p.red=null,p},n.mont=function(c){return new E(c)};function E(f){O.call(this,f),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(E,O),E.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},E.prototype.convertFrom=function(c){var p=this.imod(c.mul(this.rinv));return p.red=null,p},E.prototype.imul=function(c,p){if(c.isZero()||p.isZero())return c.words[0]=0,c.length=1,c;var v=c.imul(p),g=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=v.isub(g).iushrn(this.shift),S=x;return x.cmp(this.m)>=0?S=x.isub(this.m):x.cmpn(0)<0&&(S=x.iadd(this.m)),S._forceRed(this)},E.prototype.mul=function(c,p){if(c.isZero()||p.isZero())return new n(0)._forceRed(this);var v=c.mul(p),g=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=v.isub(g).iushrn(this.shift),S=x;return x.cmp(this.m)>=0?S=x.isub(this.m):x.cmpn(0)<0&&(S=x.iadd(this.m)),S._forceRed(this)},E.prototype.invm=function(c){var p=this.imod(c._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof Wv>"u"||Wv,nS)});var Ka=X((jY,aS)=>{aS.exports=sS;function sS(e,t){if(!e)throw new Error(t||"Assertion failed")}sS.equal=function(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)}});var Kv=X(uS=>{"use strict";var kh=uS;function oB(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e!="string"){for(var i=0;i<e.length;i++)r[i]=e[i]|0;return r}if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,u=n&255;o?r.push(o,u):r.push(u)}return r}kh.toArray=oB;function oS(e){return e.length===1?"0"+e:e}kh.zero2=oS;function cS(e){for(var t="",r=0;r<e.length;r++)t+=oS(e[r].toString(16));return t}kh.toHex=cS;kh.encode=function(t,r){return r==="hex"?cS(t):t}});var Zi=X(fS=>{"use strict";var Un=fS,cB=os(),uB=Ka(),Ph=Kv();Un.assert=uB;Un.toArray=Ph.toArray;Un.zero2=Ph.zero2;Un.toHex=Ph.toHex;Un.encode=Ph.encode;function fB(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1),n;for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,u=e.clone();for(n=0;n<i.length;n++){var m,_=u.andln(o-1);u.isOdd()?(_>(o>>1)-1?m=(o>>1)-_:m=_,u.isubn(m)):m=0,i[n]=m,u.iushrn(1)}return i}Un.getNAF=fB;function lB(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0,o;e.cmpn(-i)>0||t.cmpn(-n)>0;){var u=e.andln(3)+i&3,m=t.andln(3)+n&3;u===3&&(u=-1),m===3&&(m=-1);var _;u&1?(o=e.andln(7)+i&7,(o===3||o===5)&&m===2?_=-u:_=u):_=0,r[0].push(_);var w;m&1?(o=t.andln(7)+n&7,(o===3||o===5)&&u===2?w=-m:w=m):w=0,r[1].push(w),2*i===_+1&&(i=1-i),2*n===w+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r}Un.getJSF=lB;function pB(e,t,r){var i="_"+t;e.prototype[t]=function(){return this[i]!==void 0?this[i]:this[i]=r.call(this)}}Un.cachedProperty=pB;function hB(e){return typeof e=="string"?Un.toArray(e,"hex"):e}Un.parseBytes=hB;function dB(e){return new cB(e,"hex","le")}Un.intFromLE=dB});var Zv=X((GY,Yv)=>{var Gv;Yv.exports=function(t){return Gv||(Gv=new Ga(null)),Gv.generate(t)};function Ga(e){this.rand=e}Yv.exports.Rand=Ga;Ga.prototype.generate=function(t){return this._rand(t)};Ga.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ga.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Ga.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Ga.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if($v=require("crypto"),typeof $v.randomBytes!="function")throw new Error("Not supported");Ga.prototype._rand=function(t){return $v.randomBytes(t)}}catch{}var $v});var tl=X(($Y,lS)=>{"use strict";var $o=os(),el=Zi(),Nh=el.getNAF,mB=el.getJSF,Bh=el.assert;function $a(e,t){this.type=e,this.p=new $o(t.p,16),this.red=t.prime?$o.red(t.prime):$o.mont(this.p),this.zero=new $o(0).toRed(this.red),this.one=new $o(1).toRed(this.red),this.two=new $o(2).toRed(this.red),this.n=t.n&&new $o(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}lS.exports=$a;$a.prototype.point=function(){throw new Error("Not implemented")};$a.prototype.validate=function(){throw new Error("Not implemented")};$a.prototype._fixedNafMul=function(t,r){Bh(t.precomputed);var i=t._getDoubles(),n=Nh(r,1,this._bitLength),o=(1<<i.step+1)-(i.step%2===0?2:1);o/=3;var u=[],m,_;for(m=0;m<n.length;m+=i.step){_=0;for(var w=m+i.step-1;w>=m;w--)_=(_<<1)+n[w];u.push(_)}for(var I=this.jpoint(null,null,null),T=this.jpoint(null,null,null),N=o;N>0;N--){for(m=0;m<u.length;m++)_=u[m],_===N?T=T.mixedAdd(i.points[m]):_===-N&&(T=T.mixedAdd(i.points[m].neg()));I=I.add(T)}return I.toP()};$a.prototype._wnafMul=function(t,r){var i=4,n=t._getNAFPoints(i);i=n.wnd;for(var o=n.points,u=Nh(r,i,this._bitLength),m=this.jpoint(null,null,null),_=u.length-1;_>=0;_--){for(var w=0;_>=0&&u[_]===0;_--)w++;if(_>=0&&w++,m=m.dblp(w),_<0)break;var I=u[_];Bh(I!==0),t.type==="affine"?I>0?m=m.mixedAdd(o[I-1>>1]):m=m.mixedAdd(o[-I-1>>1].neg()):I>0?m=m.add(o[I-1>>1]):m=m.add(o[-I-1>>1].neg())}return t.type==="affine"?m.toP():m};$a.prototype._wnafMulAdd=function(t,r,i,n,o){var u=this._wnafT1,m=this._wnafT2,_=this._wnafT3,w=0,I,T,N;for(I=0;I<n;I++){N=r[I];var C=N._getNAFPoints(t);u[I]=C.wnd,m[I]=C.points}for(I=n-1;I>=1;I-=2){var B=I-1,U=I;if(u[B]!==1||u[U]!==1){_[B]=Nh(i[B],u[B],this._bitLength),_[U]=Nh(i[U],u[U],this._bitLength),w=Math.max(_[B].length,w),w=Math.max(_[U].length,w);continue}var Z=[r[B],null,null,r[U]];r[B].y.cmp(r[U].y)===0?(Z[1]=r[B].add(r[U]),Z[2]=r[B].toJ().mixedAdd(r[U].neg())):r[B].y.cmp(r[U].y.redNeg())===0?(Z[1]=r[B].toJ().mixedAdd(r[U]),Z[2]=r[B].add(r[U].neg())):(Z[1]=r[B].toJ().mixedAdd(r[U]),Z[2]=r[B].toJ().mixedAdd(r[U].neg()));var $=[-3,-1,-5,-7,0,7,5,1,3],H=mB(i[B],i[U]);for(w=Math.max(H[0].length,w),_[B]=new Array(w),_[U]=new Array(w),T=0;T<w;T++){var ee=H[0][T]|0,ce=H[1][T]|0;_[B][T]=$[(ee+1)*3+(ce+1)],_[U][T]=0,m[B]=Z}}var ge=this.jpoint(null,null,null),Se=this._wnafT4;for(I=w;I>=0;I--){for(var me=0;I>=0;){var O=!0;for(T=0;T<n;T++)Se[T]=_[T][I]|0,Se[T]!==0&&(O=!1);if(!O)break;me++,I--}if(I>=0&&me++,ge=ge.dblp(me),I<0)break;for(T=0;T<n;T++){var E=Se[T];E!==0&&(E>0?N=m[T][E-1>>1]:E<0&&(N=m[T][-E-1>>1].neg()),N.type==="affine"?ge=ge.mixedAdd(N):ge=ge.add(N))}}for(I=0;I<n;I++)m[I]=null;return o?ge:ge.toP()};function gn(e,t){this.curve=e,this.type=t,this.precomputed=null}$a.BasePoint=gn;gn.prototype.eq=function(){throw new Error("Not implemented")};gn.prototype.validate=function(){return this.curve.validate(this)};$a.prototype.decodePoint=function(t,r){t=el.toArray(t,r);var i=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*i){t[0]===6?Bh(t[t.length-1]%2===0):t[0]===7&&Bh(t[t.length-1]%2===1);var n=this.point(t.slice(1,1+i),t.slice(1+i,1+2*i));return n}else if((t[0]===2||t[0]===3)&&t.length-1===i)return this.pointFromX(t.slice(1,1+i),t[0]===3);throw new Error("Unknown point format")};gn.prototype.encodeCompressed=function(t){return this.encode(t,!0)};gn.prototype._encode=function(t){var r=this.curve.p.byteLength(),i=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",r))};gn.prototype.encode=function(t,r){return el.encode(this._encode(r),t)};gn.prototype.precompute=function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this};gn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1};gn.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,o=0;o<r;o+=t){for(var u=0;u<t;u++)n=n.dbl();i.push(n)}return{step:t,points:i}};gn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],i=(1<<t)-1,n=i===1?null:this.dbl(),o=1;o<i;o++)r[o]=r[o-1].add(n);return{wnd:t,points:r}};gn.prototype._getBeta=function(){return null};gn.prototype.dblp=function(t){for(var r=this,i=0;i<t;i++)r=r.dbl();return r}});var pS=X((YY,Xv)=>{typeof Object.create=="function"?Xv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Xv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var rl=X((ZY,Qv)=>{try{if(Jv=require("util"),typeof Jv.inherits!="function")throw"";Qv.exports=Jv.inherits}catch{Qv.exports=pS()}var Jv});var dS=X((XY,hS)=>{"use strict";var vB=Zi(),yr=os(),eg=rl(),iu=tl(),gB=vB.assert;function xn(e){iu.call(this,"short",e),this.a=new yr(e.a,16).toRed(this.red),this.b=new yr(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}eg(xn,iu);hS.exports=xn;xn.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(t.beta)r=new yr(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(t.lambda)i=new yr(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?i=o[0]:(i=o[1],gB(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var u;return t.basis?u=t.basis.map(function(m){return{a:new yr(m.a,16),b:new yr(m.b,16)}}):u=this._getEndoBasis(i),{beta:r,lambda:i,basis:u}}};xn.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:yr.mont(t),i=new yr(2).toRed(r).redInvm(),n=i.redNeg(),o=new yr(3).toRed(r).redNeg().redSqrt().redMul(i),u=n.redAdd(o).fromRed(),m=n.redSub(o).fromRed();return[u,m]};xn.prototype._getEndoBasis=function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=t,n=this.n.clone(),o=new yr(1),u=new yr(0),m=new yr(0),_=new yr(1),w,I,T,N,C,B,U,Z=0,$,H;i.cmpn(0)!==0;){var ee=n.div(i);$=n.sub(ee.mul(i)),H=m.sub(ee.mul(o));var ce=_.sub(ee.mul(u));if(!T&&$.cmp(r)<0)w=U.neg(),I=o,T=$.neg(),N=H;else if(T&&++Z===2)break;U=$,n=i,i=$,m=o,o=H,_=u,u=ce}C=$.neg(),B=H;var ge=T.sqr().add(N.sqr()),Se=C.sqr().add(B.sqr());return Se.cmp(ge)>=0&&(C=w,B=I),T.negative&&(T=T.neg(),N=N.neg()),C.negative&&(C=C.neg(),B=B.neg()),[{a:T,b:N},{a:C,b:B}]};xn.prototype._endoSplit=function(t){var r=this.endo.basis,i=r[0],n=r[1],o=n.b.mul(t).divRound(this.n),u=i.b.neg().mul(t).divRound(this.n),m=o.mul(i.a),_=u.mul(n.a),w=o.mul(i.b),I=u.mul(n.b),T=t.sub(m).sub(_),N=w.add(I).neg();return{k1:T,k2:N}};xn.prototype.pointFromX=function(t,r){t=new yr(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var o=n.fromRed().isOdd();return(r&&!o||!r&&o)&&(n=n.redNeg()),this.point(t,n)};xn.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,i=t.y,n=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0};xn.prototype._endoWnafMulAdd=function(t,r,i){for(var n=this._endoWnafT1,o=this._endoWnafT2,u=0;u<t.length;u++){var m=this._endoSplit(r[u]),_=t[u],w=_._getBeta();m.k1.negative&&(m.k1.ineg(),_=_.neg(!0)),m.k2.negative&&(m.k2.ineg(),w=w.neg(!0)),n[u*2]=_,n[u*2+1]=w,o[u*2]=m.k1,o[u*2+1]=m.k2}for(var I=this._wnafMulAdd(1,n,o,u*2,i),T=0;T<u*2;T++)n[T]=null,o[T]=null;return I};function Jr(e,t,r,i){iu.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new yr(t,16),this.y=new yr(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}eg(Jr,iu.BasePoint);xn.prototype.point=function(t,r,i){return new Jr(this,t,r,i)};xn.prototype.pointFromJSON=function(t,r){return Jr.fromJSON(this,t,r)};Jr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var i=this.curve,n=function(o){return i.point(o.x.redMul(i.endo.beta),o.y)};t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return r}};Jr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Jr.fromJSON=function(t,r,i){typeof r=="string"&&(r=JSON.parse(r));var n=t.point(r[0],r[1],i);if(!r[2])return n;function o(m){return t.point(m[0],m[1],i)}var u=r[2];return n.precomputed={beta:null,doubles:u.doubles&&{step:u.doubles.step,points:[n].concat(u.doubles.points.map(o))},naf:u.naf&&{wnd:u.naf.wnd,points:[n].concat(u.naf.points.map(o))}},n};Jr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Jr.prototype.isInfinity=function(){return this.inf};Jr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(t.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};Jr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=t.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),u=o.redSqr().redISub(this.x.redAdd(this.x)),m=o.redMul(this.x.redSub(u)).redISub(this.y);return this.curve.point(u,m)};Jr.prototype.getX=function(){return this.x.fromRed()};Jr.prototype.getY=function(){return this.y.fromRed()};Jr.prototype.mul=function(t){return t=new yr(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Jr.prototype.mulAdd=function(t,r,i){var n=[this,r],o=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)};Jr.prototype.jmulAdd=function(t,r,i){var n=[this,r],o=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)};Jr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Jr.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,n=function(o){return o.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r};Jr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function ni(e,t,r,i){iu.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yr(0)):(this.x=new yr(t,16),this.y=new yr(r,16),this.z=new yr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}eg(ni,iu.BasePoint);xn.prototype.jpoint=function(t,r,i){return new ni(this,t,r,i)};ni.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(t);return this.curve.point(i,n)};ni.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ni.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),o=t.x.redMul(i),u=this.y.redMul(r.redMul(t.z)),m=t.y.redMul(i.redMul(this.z)),_=n.redSub(o),w=u.redSub(m);if(_.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var I=_.redSqr(),T=I.redMul(_),N=n.redMul(I),C=w.redSqr().redIAdd(T).redISub(N).redISub(N),B=w.redMul(N.redISub(C)).redISub(u.redMul(T)),U=this.z.redMul(t.z).redMul(_);return this.curve.jpoint(C,B,U)};ni.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=t.x.redMul(r),o=this.y,u=t.y.redMul(r).redMul(this.z),m=i.redSub(n),_=o.redSub(u);if(m.cmpn(0)===0)return _.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=m.redSqr(),I=w.redMul(m),T=i.redMul(w),N=_.redSqr().redIAdd(I).redISub(T).redISub(T),C=_.redMul(T.redISub(N)).redISub(o.redMul(I)),B=this.z.redMul(m);return this.curve.jpoint(N,C,B)};ni.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r<t;r++)i=i.dbl();return i}var n=this.curve.a,o=this.curve.tinv,u=this.x,m=this.y,_=this.z,w=_.redSqr().redSqr(),I=m.redAdd(m);for(r=0;r<t;r++){var T=u.redSqr(),N=I.redSqr(),C=N.redSqr(),B=T.redAdd(T).redIAdd(T).redIAdd(n.redMul(w)),U=u.redMul(N),Z=B.redSqr().redISub(U.redAdd(U)),$=U.redISub(Z),H=B.redMul($);H=H.redIAdd(H).redISub(C);var ee=I.redMul(_);r+1<t&&(w=w.redMul(C)),u=Z,_=ee,I=H}return this.curve.jpoint(u,I.redMul(o),_)};ni.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ni.prototype._zeroDbl=function(){var t,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),u=o.redSqr(),m=this.x.redAdd(o).redSqr().redISub(n).redISub(u);m=m.redIAdd(m);var _=n.redAdd(n).redIAdd(n),w=_.redSqr().redISub(m).redISub(m),I=u.redIAdd(u);I=I.redIAdd(I),I=I.redIAdd(I),t=w,r=_.redMul(m.redISub(w)).redISub(I),i=this.y.redAdd(this.y)}else{var T=this.x.redSqr(),N=this.y.redSqr(),C=N.redSqr(),B=this.x.redAdd(N).redSqr().redISub(T).redISub(C);B=B.redIAdd(B);var U=T.redAdd(T).redIAdd(T),Z=U.redSqr(),$=C.redIAdd(C);$=$.redIAdd($),$=$.redIAdd($),t=Z.redISub(B).redISub(B),r=U.redMul(B.redISub(t)).redISub($),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(t,r,i)};ni.prototype._threeDbl=function(){var t,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),u=o.redSqr(),m=this.x.redAdd(o).redSqr().redISub(n).redISub(u);m=m.redIAdd(m);var _=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),w=_.redSqr().redISub(m).redISub(m);t=w;var I=u.redIAdd(u);I=I.redIAdd(I),I=I.redIAdd(I),r=_.redMul(m.redISub(w)).redISub(I),i=this.y.redAdd(this.y)}else{var T=this.z.redSqr(),N=this.y.redSqr(),C=this.x.redMul(N),B=this.x.redSub(T).redMul(this.x.redAdd(T));B=B.redAdd(B).redIAdd(B);var U=C.redIAdd(C);U=U.redIAdd(U);var Z=U.redAdd(U);t=B.redSqr().redISub(Z),i=this.y.redAdd(this.z).redSqr().redISub(N).redISub(T);var $=N.redSqr();$=$.redIAdd($),$=$.redIAdd($),$=$.redIAdd($),r=B.redMul(U.redISub(t)).redISub($)}return this.curve.jpoint(t,r,i)};ni.prototype._dbl=function(){var t=this.curve.a,r=this.x,i=this.y,n=this.z,o=n.redSqr().redSqr(),u=r.redSqr(),m=i.redSqr(),_=u.redAdd(u).redIAdd(u).redIAdd(t.redMul(o)),w=r.redAdd(r);w=w.redIAdd(w);var I=w.redMul(m),T=_.redSqr().redISub(I.redAdd(I)),N=I.redISub(T),C=m.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var B=_.redMul(N).redISub(C),U=i.redAdd(i).redMul(n);return this.curve.jpoint(T,B,U)};ni.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr(),n=r.redSqr(),o=t.redAdd(t).redIAdd(t),u=o.redSqr(),m=this.x.redAdd(r).redSqr().redISub(t).redISub(n);m=m.redIAdd(m),m=m.redAdd(m).redIAdd(m),m=m.redISub(u);var _=m.redSqr(),w=n.redIAdd(n);w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var I=o.redIAdd(m).redSqr().redISub(u).redISub(_).redISub(w),T=r.redMul(I);T=T.redIAdd(T),T=T.redIAdd(T);var N=this.x.redMul(_).redISub(T);N=N.redIAdd(N),N=N.redIAdd(N);var C=this.y.redMul(I.redMul(w.redISub(I)).redISub(m.redMul(_)));C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var B=this.z.redAdd(m).redSqr().redISub(i).redISub(_);return this.curve.jpoint(N,C,B)};ni.prototype.mul=function(t,r){return t=new yr(t,r),this.curve._wnafMul(this,t)};ni.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),i=t.z.redSqr();if(this.x.redMul(i).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var n=r.redMul(this.z),o=i.redMul(t.z);return this.y.redMul(o).redISub(t.y.redMul(n)).cmpn(0)===0};ni.prototype.eqXToP=function(t){var r=this.z.redSqr(),i=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(i)===0)return!0;for(var n=t.clone(),o=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}};ni.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};ni.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var gS=X((JY,vS)=>{"use strict";var nu=os(),mS=rl(),Mh=tl(),xB=Zi();function su(e){Mh.call(this,"mont",e),this.a=new nu(e.a,16).toRed(this.red),this.b=new nu(e.b,16).toRed(this.red),this.i4=new nu(4).toRed(this.red).redInvm(),this.two=new nu(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}mS(su,Mh);vS.exports=su;su.prototype.validate=function(t){var r=t.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),o=n.redSqrt();return o.redSqr().cmp(n)===0};function Qr(e,t,r){Mh.BasePoint.call(this,e,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new nu(t,16),this.z=new nu(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}mS(Qr,Mh.BasePoint);su.prototype.decodePoint=function(t,r){return this.point(xB.toArray(t,r),1)};su.prototype.point=function(t,r){return new Qr(this,t,r)};su.prototype.pointFromJSON=function(t){return Qr.fromJSON(this,t)};Qr.prototype.precompute=function(){};Qr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Qr.fromJSON=function(t,r){return new Qr(t,r[0],r[1]||t.one)};Qr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Qr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Qr.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),o=r.redSub(n),u=r.redMul(n),m=o.redMul(n.redAdd(this.curve.a24.redMul(o)));return this.curve.point(u,m)};Qr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Qr.prototype.diffAdd=function(t,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=t.x.redAdd(t.z),u=t.x.redSub(t.z),m=u.redMul(i),_=o.redMul(n),w=r.z.redMul(m.redAdd(_).redSqr()),I=r.x.redMul(m.redISub(_).redSqr());return this.curve.point(w,I)};Qr.prototype.mul=function(t){for(var r=t.clone(),i=this,n=this.curve.point(null,null),o=this,u=[];r.cmpn(0)!==0;r.iushrn(1))u.push(r.andln(1));for(var m=u.length-1;m>=0;m--)u[m]===0?(i=i.diffAdd(n,o),n=n.dbl()):(n=i.diffAdd(n,o),i=i.dbl());return n};Qr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Qr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Qr.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};Qr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Qr.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var _S=X((QY,bS)=>{"use strict";var bB=Zi(),ta=os(),xS=rl(),Ch=tl(),_B=bB.assert;function cs(e){this.twisted=(e.a|0)!==1,this.mOneA=this.twisted&&(e.a|0)===-1,this.extended=this.mOneA,Ch.call(this,"edwards",e),this.a=new ta(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new ta(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new ta(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),_B(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(e.c|0)===1}xS(cs,Ch);bS.exports=cs;cs.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};cs.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};cs.prototype.jpoint=function(t,r,i,n){return this.point(t,r,i,n)};cs.prototype.pointFromX=function(t,r){t=new ta(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr(),n=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),u=n.redMul(o.redInvm()),m=u.redSqrt();if(m.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");var _=m.fromRed().isOdd();return(r&&!_||!r&&_)&&(m=m.redNeg()),this.point(t,m)};cs.prototype.pointFromY=function(t,r){t=new ta(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr(),n=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),u=n.redMul(o.redInvm());if(u.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var m=u.redSqrt();if(m.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");return m.fromRed().isOdd()!==r&&(m=m.redNeg()),this.point(m,t)};cs.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),i=t.y.redSqr(),n=r.redMul(this.a).redAdd(i),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return n.cmp(o)===0};function Zt(e,t,r,i,n){Ch.BasePoint.call(this,e,"projective"),t===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new ta(t,16),this.y=new ta(r,16),this.z=i?new ta(i,16):this.curve.one,this.t=n&&new ta(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}xS(Zt,Ch.BasePoint);cs.prototype.pointFromJSON=function(t){return Zt.fromJSON(this,t)};cs.prototype.point=function(t,r,i,n){return new Zt(this,t,r,i,n)};Zt.fromJSON=function(t,r){return new Zt(t,r[0],r[1],r[2])};Zt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Zt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Zt.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),u=n.redAdd(r),m=u.redSub(i),_=n.redSub(r),w=o.redMul(m),I=u.redMul(_),T=o.redMul(_),N=m.redMul(u);return this.curve.point(w,I,N,T)};Zt.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),n,o,u,m,_,w;if(this.curve.twisted){m=this.curve._mulA(r);var I=m.redAdd(i);this.zOne?(n=t.redSub(r).redSub(i).redMul(I.redSub(this.curve.two)),o=I.redMul(m.redSub(i)),u=I.redSqr().redSub(I).redSub(I)):(_=this.z.redSqr(),w=I.redSub(_).redISub(_),n=t.redSub(r).redISub(i).redMul(w),o=I.redMul(m.redSub(i)),u=I.redMul(w))}else m=r.redAdd(i),_=this.curve._mulC(this.z).redSqr(),w=m.redSub(_).redSub(_),n=this.curve._mulC(t.redISub(m)).redMul(w),o=this.curve._mulC(m).redMul(r.redISub(i)),u=m.redMul(w);return this.curve.point(n,o,u)};Zt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Zt.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),i=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),u=i.redSub(r),m=o.redSub(n),_=o.redAdd(n),w=i.redAdd(r),I=u.redMul(m),T=_.redMul(w),N=u.redMul(w),C=m.redMul(_);return this.curve.point(I,T,C,N)};Zt.prototype._projAdd=function(t){var r=this.z.redMul(t.z),i=r.redSqr(),n=this.x.redMul(t.x),o=this.y.redMul(t.y),u=this.curve.d.redMul(n).redMul(o),m=i.redSub(u),_=i.redAdd(u),w=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(n).redISub(o),I=r.redMul(m).redMul(w),T,N;return this.curve.twisted?(T=r.redMul(_).redMul(o.redSub(this.curve._mulA(n))),N=m.redMul(_)):(T=r.redMul(_).redMul(o.redSub(n)),N=this.curve._mulC(m).redMul(_)),this.curve.point(I,T,N)};Zt.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};Zt.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};Zt.prototype.mulAdd=function(t,r,i){return this.curve._wnafMulAdd(1,[this,r],[t,i],2,!1)};Zt.prototype.jmulAdd=function(t,r,i){return this.curve._wnafMulAdd(1,[this,r],[t,i],2,!0)};Zt.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};Zt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Zt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Zt.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Zt.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};Zt.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=t.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}};Zt.prototype.toP=Zt.prototype.normalize;Zt.prototype.mixedAdd=Zt.prototype.add});var tg=X(yS=>{"use strict";var Lh=yS;Lh.base=tl();Lh.short=dS();Lh.mont=gS();Lh.edwards=_S()});var Dn=X(Vt=>{"use strict";var yB=Ka(),wB=rl();Vt.inherits=wB;function SB(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function EB(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=o&63|128):SB(e,n)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(n=0;n<e.length;n++)r[n]=e[n]|0;return r}Vt.toArray=EB;function IB(e){for(var t="",r=0;r<e.length;r++)t+=SS(e[r].toString(16));return t}Vt.toHex=IB;function wS(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Vt.htonl=wS;function TB(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];t==="little"&&(n=wS(n)),r+=ES(n.toString(16))}return r}Vt.toHex32=TB;function SS(e){return e.length===1?"0"+e:e}Vt.zero2=SS;function ES(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}Vt.zero8=ES;function RB(e,t,r,i){var n=r-t;yB(n%4===0);for(var o=new Array(n/4),u=0,m=t;u<o.length;u++,m+=4){var _;i==="big"?_=e[m]<<24|e[m+1]<<16|e[m+2]<<8|e[m+3]:_=e[m+3]<<24|e[m+2]<<16|e[m+1]<<8|e[m],o[u]=_>>>0}return o}Vt.join32=RB;function AB(e,t){for(var r=new Array(e.length*4),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];t==="big"?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o&255):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=o&255)}return r}Vt.split32=AB;function OB(e,t){return e>>>t|e<<32-t}Vt.rotr32=OB;function kB(e,t){return e<<t|e>>>32-t}Vt.rotl32=kB;function PB(e,t){return e+t>>>0}Vt.sum32=PB;function NB(e,t,r){return e+t+r>>>0}Vt.sum32_3=NB;function BB(e,t,r,i){return e+t+r+i>>>0}Vt.sum32_4=BB;function MB(e,t,r,i,n){return e+t+r+i+n>>>0}Vt.sum32_5=MB;function CB(e,t,r,i){var n=e[t],o=e[t+1],u=i+o>>>0,m=(u<i?1:0)+r+n;e[t]=m>>>0,e[t+1]=u}Vt.sum64=CB;function LB(e,t,r,i){var n=t+i>>>0,o=(n<t?1:0)+e+r;return o>>>0}Vt.sum64_hi=LB;function UB(e,t,r,i){var n=t+i;return n>>>0}Vt.sum64_lo=UB;function DB(e,t,r,i,n,o,u,m){var _=0,w=t;w=w+i>>>0,_+=w<t?1:0,w=w+o>>>0,_+=w<o?1:0,w=w+m>>>0,_+=w<m?1:0;var I=e+r+n+u+_;return I>>>0}Vt.sum64_4_hi=DB;function qB(e,t,r,i,n,o,u,m){var _=t+i+o+m;return _>>>0}Vt.sum64_4_lo=qB;function FB(e,t,r,i,n,o,u,m,_,w){var I=0,T=t;T=T+i>>>0,I+=T<t?1:0,T=T+o>>>0,I+=T<o?1:0,T=T+m>>>0,I+=T<m?1:0,T=T+w>>>0,I+=T<w?1:0;var N=e+r+n+u+_+I;return N>>>0}Vt.sum64_5_hi=FB;function HB(e,t,r,i,n,o,u,m,_,w){var I=t+i+o+m+w;return I>>>0}Vt.sum64_5_lo=HB;function zB(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}Vt.rotr64_hi=zB;function VB(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Vt.rotr64_lo=VB;function jB(e,t,r){return e>>>r}Vt.shr64_hi=jB;function WB(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Vt.shr64_lo=WB});var au=X(TS=>{"use strict";var IS=Dn(),KB=Ka();function Uh(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}TS.BlockHash=Uh;Uh.prototype.update=function(t,r){if(t=IS.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var i=t.length%this._delta8;this.pending=t.slice(t.length-i,t.length),this.pending.length===0&&(this.pending=null),t=IS.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this};Uh.prototype.digest=function(t){return this.update(this._pad()),KB(this.pending===null),this._digest(t)};Uh.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,i=r-(t+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var o=1;o<i;o++)n[o]=0;if(t<<=3,this.endian==="big"){for(var u=8;u<this.padLength;u++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=t&255}else for(n[o++]=t&255,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,u=8;u<this.padLength;u++)n[o++]=0;return n}});var rg=X(ra=>{"use strict";var GB=Dn(),us=GB.rotr32;function $B(e,t,r,i){if(e===0)return RS(t,r,i);if(e===1||e===3)return OS(t,r,i);if(e===2)return AS(t,r,i)}ra.ft_1=$B;function RS(e,t,r){return e&t^~e&r}ra.ch32=RS;function AS(e,t,r){return e&t^e&r^t&r}ra.maj32=AS;function OS(e,t,r){return e^t^r}ra.p32=OS;function YB(e){return us(e,2)^us(e,13)^us(e,22)}ra.s0_256=YB;function ZB(e){return us(e,6)^us(e,11)^us(e,25)}ra.s1_256=ZB;function XB(e){return us(e,7)^us(e,18)^e>>>3}ra.g0_256=XB;function JB(e){return us(e,17)^us(e,19)^e>>>10}ra.g1_256=JB});var NS=X((nZ,PS)=>{"use strict";var ou=Dn(),QB=au(),eM=rg(),ig=ou.rotl32,il=ou.sum32,tM=ou.sum32_5,rM=eM.ft_1,kS=QB.BlockHash,iM=[1518500249,1859775393,2400959708,3395469782];function fs(){if(!(this instanceof fs))return new fs;kS.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}ou.inherits(fs,kS);PS.exports=fs;fs.blockSize=512;fs.outSize=160;fs.hmacStrength=80;fs.padLength=64;fs.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=ig(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var o=this.h[0],u=this.h[1],m=this.h[2],_=this.h[3],w=this.h[4];for(n=0;n<i.length;n++){var I=~~(n/20),T=tM(ig(o,5),rM(I,u,m,_),w,i[n],iM[I]);w=_,_=m,m=ig(u,30),u=o,o=T}this.h[0]=il(this.h[0],o),this.h[1]=il(this.h[1],u),this.h[2]=il(this.h[2],m),this.h[3]=il(this.h[3],_),this.h[4]=il(this.h[4],w)};fs.prototype._digest=function(t){return t==="hex"?ou.toHex32(this.h,"big"):ou.split32(this.h,"big")}});var ng=X((sZ,MS)=>{"use strict";var cu=Dn(),nM=au(),uu=rg(),sM=Ka(),qn=cu.sum32,aM=cu.sum32_4,oM=cu.sum32_5,cM=uu.ch32,uM=uu.maj32,fM=uu.s0_256,lM=uu.s1_256,pM=uu.g0_256,hM=uu.g1_256,BS=nM.BlockHash,dM=[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];function ls(){if(!(this instanceof ls))return new ls;BS.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=dM,this.W=new Array(64)}cu.inherits(ls,BS);MS.exports=ls;ls.blockSize=512;ls.outSize=256;ls.hmacStrength=192;ls.padLength=64;ls.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=aM(hM(i[n-2]),i[n-7],pM(i[n-15]),i[n-16]);var o=this.h[0],u=this.h[1],m=this.h[2],_=this.h[3],w=this.h[4],I=this.h[5],T=this.h[6],N=this.h[7];for(sM(this.k.length===i.length),n=0;n<i.length;n++){var C=oM(N,lM(w),cM(w,I,T),this.k[n],i[n]),B=qn(fM(o),uM(o,u,m));N=T,T=I,I=w,w=qn(_,C),_=m,m=u,u=o,o=qn(C,B)}this.h[0]=qn(this.h[0],o),this.h[1]=qn(this.h[1],u),this.h[2]=qn(this.h[2],m),this.h[3]=qn(this.h[3],_),this.h[4]=qn(this.h[4],w),this.h[5]=qn(this.h[5],I),this.h[6]=qn(this.h[6],T),this.h[7]=qn(this.h[7],N)};ls.prototype._digest=function(t){return t==="hex"?cu.toHex32(this.h,"big"):cu.split32(this.h,"big")}});var US=X((aZ,LS)=>{"use strict";var sg=Dn(),CS=ng();function ia(){if(!(this instanceof ia))return new ia;CS.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sg.inherits(ia,CS);LS.exports=ia;ia.blockSize=512;ia.outSize=224;ia.hmacStrength=192;ia.padLength=64;ia.prototype._digest=function(t){return t==="hex"?sg.toHex32(this.h.slice(0,7),"big"):sg.split32(this.h.slice(0,7),"big")}});var cg=X((oZ,HS)=>{"use strict";var Bi=Dn(),mM=au(),vM=Ka(),ps=Bi.rotr64_hi,hs=Bi.rotr64_lo,DS=Bi.shr64_hi,qS=Bi.shr64_lo,Ya=Bi.sum64,ag=Bi.sum64_hi,og=Bi.sum64_lo,gM=Bi.sum64_4_hi,xM=Bi.sum64_4_lo,bM=Bi.sum64_5_hi,_M=Bi.sum64_5_lo,FS=mM.BlockHash,yM=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Fn(){if(!(this instanceof Fn))return new Fn;FS.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=yM,this.W=new Array(160)}Bi.inherits(Fn,FS);HS.exports=Fn;Fn.blockSize=1024;Fn.outSize=512;Fn.hmacStrength=192;Fn.padLength=128;Fn.prototype._prepareBlock=function(t,r){for(var i=this.W,n=0;n<32;n++)i[n]=t[r+n];for(;n<i.length;n+=2){var o=NM(i[n-4],i[n-3]),u=BM(i[n-4],i[n-3]),m=i[n-14],_=i[n-13],w=kM(i[n-30],i[n-29]),I=PM(i[n-30],i[n-29]),T=i[n-32],N=i[n-31];i[n]=gM(o,u,m,_,w,I,T,N),i[n+1]=xM(o,u,m,_,w,I,T,N)}};Fn.prototype._update=function(t,r){this._prepareBlock(t,r);var i=this.W,n=this.h[0],o=this.h[1],u=this.h[2],m=this.h[3],_=this.h[4],w=this.h[5],I=this.h[6],T=this.h[7],N=this.h[8],C=this.h[9],B=this.h[10],U=this.h[11],Z=this.h[12],$=this.h[13],H=this.h[14],ee=this.h[15];vM(this.k.length===i.length);for(var ce=0;ce<i.length;ce+=2){var ge=H,Se=ee,me=AM(N,C),O=OM(N,C),E=wM(N,C,B,U,Z,$),f=SM(N,C,B,U,Z,$),c=this.k[ce],p=this.k[ce+1],v=i[ce],g=i[ce+1],x=bM(ge,Se,me,O,E,f,c,p,v,g),S=_M(ge,Se,me,O,E,f,c,p,v,g);ge=TM(n,o),Se=RM(n,o),me=EM(n,o,u,m,_,w),O=IM(n,o,u,m,_,w);var b=ag(ge,Se,me,O),l=og(ge,Se,me,O);H=Z,ee=$,Z=B,$=U,B=N,U=C,N=ag(I,T,x,S),C=og(T,T,x,S),I=_,T=w,_=u,w=m,u=n,m=o,n=ag(x,S,b,l),o=og(x,S,b,l)}Ya(this.h,0,n,o),Ya(this.h,2,u,m),Ya(this.h,4,_,w),Ya(this.h,6,I,T),Ya(this.h,8,N,C),Ya(this.h,10,B,U),Ya(this.h,12,Z,$),Ya(this.h,14,H,ee)};Fn.prototype._digest=function(t){return t==="hex"?Bi.toHex32(this.h,"big"):Bi.split32(this.h,"big")};function wM(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function SM(e,t,r,i,n,o){var u=t&i^~t&o;return u<0&&(u+=4294967296),u}function EM(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function IM(e,t,r,i,n,o){var u=t&i^t&o^i&o;return u<0&&(u+=4294967296),u}function TM(e,t){var r=ps(e,t,28),i=ps(t,e,2),n=ps(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function RM(e,t){var r=hs(e,t,28),i=hs(t,e,2),n=hs(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function AM(e,t){var r=ps(e,t,14),i=ps(e,t,18),n=ps(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function OM(e,t){var r=hs(e,t,14),i=hs(e,t,18),n=hs(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function kM(e,t){var r=ps(e,t,1),i=ps(e,t,8),n=DS(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function PM(e,t){var r=hs(e,t,1),i=hs(e,t,8),n=qS(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function NM(e,t){var r=ps(e,t,19),i=ps(t,e,29),n=DS(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}function BM(e,t){var r=hs(e,t,19),i=hs(t,e,29),n=qS(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}});var jS=X((cZ,VS)=>{"use strict";var ug=Dn(),zS=cg();function na(){if(!(this instanceof na))return new na;zS.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ug.inherits(na,zS);VS.exports=na;na.blockSize=1024;na.outSize=384;na.hmacStrength=192;na.padLength=128;na.prototype._digest=function(t){return t==="hex"?ug.toHex32(this.h.slice(0,12),"big"):ug.split32(this.h.slice(0,12),"big")}});var WS=X(fu=>{"use strict";fu.sha1=NS();fu.sha224=US();fu.sha256=ng();fu.sha384=jS();fu.sha512=cg()});var XS=X(ZS=>{"use strict";var Yo=Dn(),MM=au(),Dh=Yo.rotl32,KS=Yo.sum32,nl=Yo.sum32_3,GS=Yo.sum32_4,YS=MM.BlockHash;function ds(){if(!(this instanceof ds))return new ds;YS.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Yo.inherits(ds,YS);ZS.ripemd160=ds;ds.blockSize=512;ds.outSize=160;ds.hmacStrength=192;ds.padLength=64;ds.prototype._update=function(t,r){for(var i=this.h[0],n=this.h[1],o=this.h[2],u=this.h[3],m=this.h[4],_=i,w=n,I=o,T=u,N=m,C=0;C<80;C++){var B=KS(Dh(GS(i,$S(C,n,o,u),t[UM[C]+r],CM(C)),qM[C]),m);i=m,m=u,u=Dh(o,10),o=n,n=B,B=KS(Dh(GS(_,$S(79-C,w,I,T),t[DM[C]+r],LM(C)),FM[C]),N),_=N,N=T,T=Dh(I,10),I=w,w=B}B=nl(this.h[1],o,T),this.h[1]=nl(this.h[2],u,N),this.h[2]=nl(this.h[3],m,_),this.h[3]=nl(this.h[4],i,w),this.h[4]=nl(this.h[0],n,I),this.h[0]=B};ds.prototype._digest=function(t){return t==="hex"?Yo.toHex32(this.h,"little"):Yo.split32(this.h,"little")};function $S(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function CM(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function LM(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var UM=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],DM=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],qM=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],FM=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var QS=X((lZ,JS)=>{"use strict";var HM=Dn(),zM=Ka();function lu(e,t,r){if(!(this instanceof lu))return new lu(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(HM.toArray(t,r))}JS.exports=lu;lu.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),zM(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};lu.prototype.update=function(t,r){return this.inner.update(t,r),this};lu.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var qh=X(eE=>{var si=eE;si.utils=Dn();si.common=au();si.sha=WS();si.ripemd=XS();si.hmac=QS();si.sha1=si.sha.sha1;si.sha256=si.sha.sha256;si.sha224=si.sha.sha224;si.sha384=si.sha.sha384;si.sha512=si.sha.sha512;si.ripemd160=si.ripemd.ripemd160});var rE=X((hZ,tE)=>{tE.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var Fh=X(sE=>{"use strict";var lg=sE,Za=qh(),fg=tg(),VM=Zi(),iE=VM.assert;function nE(e){e.type==="short"?this.curve=new fg.short(e):e.type==="edwards"?this.curve=new fg.edwards(e):this.curve=new fg.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,iE(this.g.validate(),"Invalid curve"),iE(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}lg.PresetCurve=nE;function Xa(e,t){Object.defineProperty(lg,e,{configurable:!0,enumerable:!0,get:function(){var r=new nE(t);return Object.defineProperty(lg,e,{configurable:!0,enumerable:!0,value:r}),r}})}Xa("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Za.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Xa("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Za.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Xa("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Za.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Xa("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Za.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Xa("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Za.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Xa("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Za.sha256,gRed:!1,g:["9"]});Xa("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Za.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pg;try{pg=rE()}catch{pg=void 0}Xa("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Za.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pg]})});var cE=X((mZ,oE)=>{"use strict";var jM=qh(),Zo=Kv(),aE=Ka();function Ja(e){if(!(this instanceof Ja))return new Ja(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Zo.toArray(e.entropy,e.entropyEnc||"hex"),r=Zo.toArray(e.nonce,e.nonceEnc||"hex"),i=Zo.toArray(e.pers,e.persEnc||"hex");aE(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}oE.exports=Ja;Ja.prototype._init=function(t,r,i){var n=t.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656};Ja.prototype._hmac=function(){return new jM.hmac(this.hash,this.K)};Ja.prototype._update=function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};Ja.prototype.reseed=function(t,r,i,n){typeof r!="string"&&(n=i,i=r,r=null),t=Zo.toArray(t,r),i=Zo.toArray(i,n),aE(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this._reseed=1};Ja.prototype.generate=function(t,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=Zo.toArray(i,n||"hex"),this._update(i));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var u=o.slice(0,t);return this._update(i),this._reseed++,Zo.encode(u,r)}});var fE=X((vZ,uE)=>{"use strict";var WM=os(),KM=Zi(),hg=KM.assert;function pi(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}uE.exports=pi;pi.fromPublic=function(t,r,i){return r instanceof pi?r:new pi(t,{pub:r,pubEnc:i})};pi.fromPrivate=function(t,r,i){return r instanceof pi?r:new pi(t,{priv:r,privEnc:i})};pi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};pi.prototype.getPublic=function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub};pi.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};pi.prototype._importPrivate=function(t,r){this.priv=new WM(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)};pi.prototype._importPublic=function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?hg(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&hg(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)};pi.prototype.derive=function(t){return t.validate()||hg(t.validate(),"public point not validated"),t.mul(this.priv).getX()};pi.prototype.sign=function(t,r,i){return this.ec.sign(t,this,r,i)};pi.prototype.verify=function(t,r){return this.ec.verify(t,r,this)};pi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var hE=X((gZ,pE)=>{"use strict";var Hh=os(),vg=Zi(),GM=vg.assert;function zh(e,t){if(e instanceof zh)return e;this._importDER(e,t)||(GM(e.r&&e.s,"Signature without r or s"),this.r=new Hh(e.r,16),this.s=new Hh(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}pE.exports=zh;function $M(){this.place=0}function dg(e,t){var r=e[t.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,o=0,u=t.place;o<i;o++,u++)n<<=8,n|=e[u],n>>>=0;return n<=127?!1:(t.place=u,n)}function lE(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}zh.prototype._importDER=function(t,r){t=vg.toArray(t,r);var i=new $M;if(t[i.place++]!==48)return!1;var n=dg(t,i);if(n===!1||n+i.place!==t.length||t[i.place++]!==2)return!1;var o=dg(t,i);if(o===!1)return!1;var u=t.slice(i.place,o+i.place);if(i.place+=o,t[i.place++]!==2)return!1;var m=dg(t,i);if(m===!1||t.length!==m+i.place)return!1;var _=t.slice(i.place,m+i.place);if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;return this.r=new Hh(u),this.s=new Hh(_),this.recoveryParam=null,!0};function mg(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}zh.prototype.toDER=function(t){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=lE(r),i=lE(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];mg(n,r.length),n=n.concat(r),n.push(2),mg(n,i.length);var o=n.concat(i),u=[48];return mg(u,o.length),u=u.concat(o),vg.encode(u,t)}});var gE=X((xZ,vE)=>{"use strict";var Xo=os(),dE=cE(),YM=Zi(),gg=Fh(),ZM=Zv(),mE=YM.assert,xg=fE(),Vh=hE();function bn(e){if(!(this instanceof bn))return new bn(e);typeof e=="string"&&(mE(Object.prototype.hasOwnProperty.call(gg,e),"Unknown curve "+e),e=gg[e]),e instanceof gg.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}vE.exports=bn;bn.prototype.keyPair=function(t){return new xg(this,t)};bn.prototype.keyFromPrivate=function(t,r){return xg.fromPrivate(this,t,r)};bn.prototype.keyFromPublic=function(t,r){return xg.fromPublic(this,t,r)};bn.prototype.genKeyPair=function(t){t||(t={});for(var r=new dE({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||ZM(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new Xo(2));;){var o=new Xo(r.generate(i));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}};bn.prototype._truncateToN=function(t,r){var i=t.byteLength()*8-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};bn.prototype.sign=function(t,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),t=this._truncateToN(new Xo(t,16));for(var o=this.n.byteLength(),u=r.getPrivate().toArray("be",o),m=t.toArray("be",o),_=new dE({hash:this.hash,entropy:u,nonce:m,pers:n.pers,persEnc:n.persEnc||"utf8"}),w=this.n.sub(new Xo(1)),I=0;;I++){var T=n.k?n.k(I):new Xo(_.generate(this.n.byteLength()));if(T=this._truncateToN(T,!0),!(T.cmpn(1)<=0||T.cmp(w)>=0)){var N=this.g.mul(T);if(!N.isInfinity()){var C=N.getX(),B=C.umod(this.n);if(B.cmpn(0)!==0){var U=T.invm(this.n).mul(B.mul(r.getPrivate()).iadd(t));if(U=U.umod(this.n),U.cmpn(0)!==0){var Z=(N.getY().isOdd()?1:0)|(C.cmp(B)!==0?2:0);return n.canonical&&U.cmp(this.nh)>0&&(U=this.n.sub(U),Z^=1),new Vh({r:B,s:U,recoveryParam:Z})}}}}}};bn.prototype.verify=function(t,r,i,n){t=this._truncateToN(new Xo(t,16)),i=this.keyFromPublic(i,n),r=new Vh(r,"hex");var o=r.r,u=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var m=u.invm(this.n),_=m.mul(t).umod(this.n),w=m.mul(o).umod(this.n),I;return this.curve._maxwellTrick?(I=this.g.jmulAdd(_,i.getPublic(),w),I.isInfinity()?!1:I.eqXToP(o)):(I=this.g.mulAdd(_,i.getPublic(),w),I.isInfinity()?!1:I.getX().umod(this.n).cmp(o)===0)};bn.prototype.recoverPubKey=function(e,t,r,i){mE((3&r)===r,"The recovery param is more than two bits"),t=new Vh(t,i);var n=this.n,o=new Xo(e),u=t.r,m=t.s,_=r&1,w=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");w?u=this.curve.pointFromX(u.add(this.curve.n),_):u=this.curve.pointFromX(u,_);var I=t.r.invm(n),T=n.sub(o).mul(I).umod(n),N=m.mul(I).umod(n);return this.g.mulAdd(T,u,N)};bn.prototype.getKeyRecoveryParam=function(e,t,r,i){if(t=new Vh(t,i),t.recoveryParam!==null)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch{continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}});var yE=X((bZ,_E)=>{"use strict";var sl=Zi(),bE=sl.assert,xE=sl.parseBytes,pu=sl.cachedProperty;function ei(e,t){this.eddsa=e,this._secret=xE(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=xE(t.pub)}ei.fromPublic=function(t,r){return r instanceof ei?r:new ei(t,{pub:r})};ei.fromSecret=function(t,r){return r instanceof ei?r:new ei(t,{secret:r})};ei.prototype.secret=function(){return this._secret};pu(ei,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});pu(ei,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});pu(ei,"privBytes",function(){var t=this.eddsa,r=this.hash(),i=t.encodingLength-1,n=r.slice(0,t.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});pu(ei,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});pu(ei,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});pu(ei,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});ei.prototype.sign=function(t){return bE(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};ei.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};ei.prototype.getSecret=function(t){return bE(this._secret,"KeyPair is public only"),sl.encode(this.secret(),t)};ei.prototype.getPublic=function(t){return sl.encode(this.pubBytes(),t)};_E.exports=ei});var SE=X((_Z,wE)=>{"use strict";var XM=os(),jh=Zi(),JM=jh.assert,Wh=jh.cachedProperty,QM=jh.parseBytes;function Jo(e,t){this.eddsa=e,typeof t!="object"&&(t=QM(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),JM(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof XM&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Wh(Jo,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Wh(Jo,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Wh(Jo,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Wh(Jo,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Jo.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Jo.prototype.toHex=function(){return jh.encode(this.toBytes(),"hex").toUpperCase()};wE.exports=Jo});var AE=X((yZ,RE)=>{"use strict";var eC=qh(),tC=Fh(),hu=Zi(),rC=hu.assert,IE=hu.parseBytes,TE=yE(),EE=SE();function Mi(e){if(rC(e==="ed25519","only tested with ed25519 so far"),!(this instanceof Mi))return new Mi(e);e=tC[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=eC.sha512}RE.exports=Mi;Mi.prototype.sign=function(t,r){t=IE(t);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),t),o=this.g.mul(n),u=this.encodePoint(o),m=this.hashInt(u,i.pubBytes(),t).mul(i.priv()),_=n.add(m).umod(this.curve.n);return this.makeSignature({R:o,S:_,Rencoded:u})};Mi.prototype.verify=function(t,r,i){t=IE(t),r=this.makeSignature(r);var n=this.keyFromPublic(i),o=this.hashInt(r.Rencoded(),n.pubBytes(),t),u=this.g.mul(r.S()),m=r.R().add(n.pub().mul(o));return m.eq(u)};Mi.prototype.hashInt=function(){for(var t=this.hash(),r=0;r<arguments.length;r++)t.update(arguments[r]);return hu.intFromLE(t.digest()).umod(this.curve.n)};Mi.prototype.keyFromPublic=function(t){return TE.fromPublic(this,t)};Mi.prototype.keyFromSecret=function(t){return TE.fromSecret(this,t)};Mi.prototype.makeSignature=function(t){return t instanceof EE?t:new EE(this,t)};Mi.prototype.encodePoint=function(t){var r=t.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=t.getX().isOdd()?128:0,r};Mi.prototype.decodePoint=function(t){t=hu.parseBytes(t);var r=t.length-1,i=t.slice(0,r).concat(t[r]&-129),n=(t[r]&128)!==0,o=hu.intFromLE(i);return this.curve.pointFromY(o,n)};Mi.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)};Mi.prototype.decodeInt=function(t){return hu.intFromLE(t)};Mi.prototype.isPoint=function(t){return t instanceof this.pointClass}});var bg=X(OE=>{"use strict";var Qo=OE;Qo.version=iS().version;Qo.utils=Zi();Qo.rand=Zv();Qo.curve=tg();Qo.curves=Fh();Qo.ec=gE();Qo.eddsa=AE()});var eo=X((SZ,PE)=>{"use strict";var ms=Xr(),iC=Yt(),nC=bg().ec,Qa=new nC("secp256k1"),sC=Qa.curve.point.bind(Qa.curve),kE=Qa.curve.pointFromX.bind(Qa.curve),ti=function(t,r,i){try{var n=sC(t,r,i)}catch{throw new Error("Invalid Point")}return n.validate(),n};ti.prototype=Object.getPrototypeOf(Qa.curve.point());ti.fromX=function(t,r){try{var i=kE(r,t)}catch{throw new Error("Invalid X")}return i.validate(),i};ti.getG=function(){return Qa.curve.g};ti.getN=function(){return new ms(Qa.curve.n.toArray())};ti.getP=function(){return Qa.curve.p.clone()};ti.prototype._getX=ti.prototype.getX;ti.prototype.getX=function(){return new ms(this._getX().toArray())};ti.prototype._getY=ti.prototype.getY;ti.prototype.getY=function(){return new ms(this._getY().toArray())};ti.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var t;try{t=kE(this.getX(),this.getY().isOdd())}catch{throw new Error("Point does not lie on the curve")}if(t.y.cmp(this.y)!==0)throw new Error("Invalid y value for curve.");if(!this.mul(ti.getN()).isInfinity())throw new Error("Point times N must be infinity");return this};ti.pointToCompressed=function(t){var r=t.getX().toBuffer({size:32}),i=t.getY().toBuffer({size:32}),n,o=i[i.length-1]%2;return o?n=Buffer.from([3]):n=Buffer.from([2]),iC.concat([n,r])};ti.prototype.liftX=function(){let e=ti.getP(),t=new ms(0),r=new ms(1),i=new ms(2),n=new ms(3),o=new ms(4),u=new ms(7),m=ms.red("k256"),_=this.x.pow(n).add(u).mod(e),w=_.toRed(m).redPow(e.add(r).div(o)).mod(e);if(!_.eq(w.pow(i).mod(e)))throw new Error("liftX failed");let I=this.x.red?this.x.fromRed():this.x,T=w.mod(i).eq(t)?w.fromRed():e.sub(w);return new ti(I,T,!0)};PE.exports=ti});var di=X((EZ,BE)=>{"use strict";var sa=Xr(),aC=Et(),hi=xt(),NE=Yt(),oC=Rr(),it=function e(t,r,i){if(!(this instanceof e))return new e(t,r,i);if(t instanceof sa)this.set({r:t,s:r,isSchnorr:i});else if(t){var n=t;this.set(n)}};it.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=typeof e.i>"u"?this.i:e.i,this.compressed=typeof e.compressed>"u"?this.compressed:e.compressed,this.isSchnorr=typeof e.isSchnorr>"u"?this.isSchnorr:e.isSchnorr,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this};it.fromCompact=function(e){hi.checkArgument(NE.isBuffer(e),"Argument is expected to be a Buffer");var t=new it,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i=i+4);var n=e.slice(1,33),o=e.slice(33,65);return hi.checkArgument(i===0||i===1||i===2||i===3,new Error("i must be 0, 1, 2, or 3")),hi.checkArgument(n.length===32,new Error("r must be 32 bytes")),hi.checkArgument(o.length===32,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=sa.fromBuffer(n),t.s=sa.fromBuffer(o),t};it.fromDER=it.fromBuffer=function(e,t){var r=new it;if((e.length===64||e.length===65)&&e[0]!=48)return it.fromSchnorr(e);hi.checkArgument(!(e.length===64&&e[0]===48),new Error("64 DER (ecdsa) signatures not allowed"));var i=it.parseDER(e,t);return r.r=i.r,r.s=i.s,r};it.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new it.fromDER(r,!1);return i.nhashtype=t,i};it.fromString=function(e){var t=Buffer.from(e,"hex");return it.fromDER(t)};it.parseDER=function(e,t){hi.checkArgument(NE.isBuffer(e),new Error("DER formatted signature should be a buffer")),aC.isUndefined(t)&&(t=!0);var r=e[0];hi.checkArgument(r===48,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;hi.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i<n?i:n;var o=e[2];hi.checkArgument(o===2,new Error("Integer byte for r should be 0x02"));var u=e[3],m=e.slice(4,4+u),_=sa.fromBuffer(m),w=e[4]===0;hi.checkArgument(u===m.length,new Error("Length of r incorrect"));var I=e[4+u+0];hi.checkArgument(I===2,new Error("Integer byte for s should be 0x02"));var T=e[4+u+1],N=e.slice(4+u+2,4+u+2+T),C=sa.fromBuffer(N),B=e[4+u+2+2]===0;hi.checkArgument(T===N.length,new Error("Length of s incorrect"));var U=4+u+2+T;hi.checkArgument(i===U-2,new Error("Length of signature incorrect"));var Z={header:r,length:i,rheader:o,rlength:u,rneg:w,rbuf:m,r:_,sheader:I,slength:T,sneg:B,sbuf:N,s:C};return Z};it.prototype.toCompact=function(e,t){if(e=typeof e=="number"?e:this.i,t=typeof t=="boolean"?t:this.compressed,!(e===0||e===1||e===2||e===3))throw new Error("i must be equal to 0, 1, 2, or 3");var r=e+27+4;t===!1&&(r=r-4);var i=Buffer.from([r]),n=this.r.toBuffer({size:32}),o=this.s.toBuffer({size:32});return Buffer.concat([i,n,o])};it.prototype.toBuffer=it.prototype.toDER=function(){if(this.isSchnorr){let C=!this.nhashtype||this.nhashtype===it.SIGHASH_DEFAULT?Buffer.alloc(0):Buffer.from([this.nhashtype]);return Buffer.concat([this.r.toBuffer({size:32}),this.s.toBuffer({size:32}),C])}var e=this.r.toBuffer(),t=this.s.toBuffer(),r=!!(e[0]&128),i=!!(t[0]&128),n=r?Buffer.concat([Buffer.from([0]),e]):e,o=i?Buffer.concat([Buffer.from([0]),t]):t,u=n.length,m=o.length,_=2+u+2+m,w=2,I=2,T=48,N=Buffer.concat([Buffer.from([T,_,w,u]),n,Buffer.from([I,m]),o]);return N};it.prototype.toString=function(){var e=this.toDER();return e.toString("hex")};it.isTxDER=function(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(e[2]!==2||t===0||i[0]&128||t>1&&i[0]===0&&!(i[1]&128))return!1;var n=e.slice(6+t);return!(e[6+t-2]!==2||r===0||n[0]&128||r>1&&n[0]===0&&!(n[1]&128))};it.prototype.hasLowS=function(){return!(this.s.lt(new sa(1))||this.s.gt(new sa("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))};it.prototype.hasDefinedHashtype=function(){if(!oC.isNaturalNumber(this.nhashtype))return!1;var e=this.nhashtype&~it.SIGHASH_ANYONECANPAY;return!(e<it.SIGHASH_ALL||e>it.SIGHASH_SINGLE)};it.prototype.toTxFormat=function(){var e=this.toDER(),t=Buffer.alloc(1);return t.writeUInt8(this.nhashtype,0),Buffer.concat([e,t])};it.fromSchnorr=function(e){hi.checkArgument(Buffer.isBuffer(e),"Schnorr signature argument must be a buffer"),hi.checkArgument(e.length===64||e.length===65,"Schnorr signatures must be 64 or 65 bytes");let t=new it,r=e.slice(0,32),i=e.slice(32,64);return e.length===65?(t.nhashtype=e[e.length-1],hi.checkState(t.nhashtype!==it.SIGHASH_DEFAULT,new Error("invalid hashtype"))):t.nhashtype=it.SIGHASH_DEFAULT,t.r=sa.fromBuffer(r),t.s=sa.fromBuffer(i),t.isSchnorr=!0,t};it.SIGHASH_DEFAULT=0;it.SIGHASH_ALL=1;it.SIGHASH_NONE=2;it.SIGHASH_SINGLE=3;it.SIGHASH_ANYONECANPAY=128;it.SIGHASH_OUTPUT_MASK=3;it.SIGHASH_INPUT_MASK=128;it.Version={};it.Version.BASE=0;it.Version.WITNESS_V0=1;it.Version.TAPROOT=2;it.Version.TAPSCRIPT=3;BE.exports=it});var Dr=X((IZ,ME)=>{"use strict";var Kh=require("crypto"),to=Yt(),aa=xt(),Ur=ME.exports;Ur.sha1=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("sha1").update(e).digest()};Ur.sha1.blocksize=512;Ur.sha256=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("sha256").update(e).digest()};Ur.sha256.blocksize=512;Ur.sha256sha256=function(e){return aa.checkArgument(to.isBuffer(e)),Ur.sha256(Ur.sha256(e))};Ur.ripemd160=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("ripemd160").update(e).digest()};Ur.sha256ripemd160=function(e){return aa.checkArgument(to.isBuffer(e)),Ur.ripemd160(Ur.sha256(e))};Ur.sha512=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("sha512").update(e).digest()};Ur.sha512.blocksize=1024;Ur.hmac=function(e,t,r){aa.checkArgument(to.isBuffer(t)),aa.checkArgument(to.isBuffer(r)),aa.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=Buffer.alloc(i);o.fill(92);var u=Buffer.alloc(i);u.fill(54);for(var m=Buffer.alloc(i),_=Buffer.alloc(i),w=0;w<i;w++)m[w]=o[w]^r[w],_[w]=u[w]^r[w];return e(Buffer.concat([m,e(Buffer.concat([_,t]))]))};Ur.sha256hmac=function(e,t){return Ur.hmac(Ur.sha256,e,t)};Ur.sha512hmac=function(e,t){return Ur.hmac(Ur.sha512,e,t)}});var io=X((TZ,LE)=>{"use strict";var cC=Yt(),Gh=Rr(),ro=[],yi={};function CE(){}CE.prototype.toString=function(){return this.name};function ec(e,t){if(~ro.indexOf(e))return e;if(t){Array.isArray(t)||(t=[t]);for(let r in ro)if(t.some(i=>ro[r][i]===e))return ro[r];return}return yi[e]&&yi[e].length>=1?yi[e][0]:yi[e]}function yg(e){return this.name==e||this.alias==e}function al(e){var t=new CE;Gh.defineImmutable(t,{name:e.name,alias:e.alias,is:e.is,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,bech32prefix:e.bech32prefix,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&Gh.defineImmutable(t,{networkMagic:cC.integerAsBuffer(e.networkMagic)}),e.port&&Gh.defineImmutable(t,{port:e.port}),e.dnsSeeds&&Gh.defineImmutable(t,{dnsSeeds:e.dnsSeeds});for(let r of Object.values(t))r!=null&&typeof r!="object"&&(yi[r]||(yi[r]=[]),yi[r].push(t));ro.push(t);for(let r of e.variants||[])al({...e,variants:void 0,...r});return t}function uC(e){typeof e!="object"&&(e=ec(e));for(var t=0;t<ro.length;t++)ro[t]===e&&ro.splice(t,1);for(var r in yi)if(yi[r].length){let i=yi[r].indexOf(e);i>=0&&yi[r].splice(i,1),yi[r].length===0&&delete yi[r]}else yi[r]===e&&delete yi[r]}al({name:"livenet",alias:"mainnet",is:yg,pubkeyhash:0,privatekey:128,scripthash:5,bech32prefix:"bc",xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var _g=ec("livenet");al({name:"testnet",alias:"testnet",is:yg,pubkeyhash:111,privatekey:239,scripthash:196,bech32prefix:"tb",xpubkey:70617039,xprivkey:70615956,variants:[{name:"testnet3",networkMagic:185665799,port:18333,dnsSeeds:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]},{name:"signet",networkMagic:168021824,port:38333,dnsSeeds:["178.128.221.177","103.16.128.63","153.126.143.201","192.241.163.142"]},{name:"testnet4",networkMagic:471220008,port:48333,dnsSeeds:["18.189.156.102","18.201.207.55","51.158.248.8","57.128.176.163","82.67.102.15","88.99.248.50","95.217.73.162","103.99.171.212","103.165.192.210"]}]});var wg=ec("testnet"),fC=ec("testnet3"),lC=ec("signet");al({name:"regtest",alias:"dev",is:yg,pubkeyhash:111,privatekey:239,scripthash:196,bech32prefix:"bcrt",xpubkey:70617039,xprivkey:70615956,networkMagic:4206867930,port:18444,dnsSeeds:[]});var pC=ec("regtest");function hC(){wg.regtestEnabled=!0}function dC(){wg.regtestEnabled=!1}LE.exports={add:al,remove:uC,defaultNetwork:_g,livenet:_g,mainnet:_g,testnet:wg,testnet3:fC,signet:lC,regtest:pC,get:ec,enableRegtest:hC,disableRegtest:dC}});var ri=X((RZ,DE)=>{"use strict";var Sg=Yt(),UE=require("assert"),Ar=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};Ar.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};Ar.prototype.toBuffer=function(){return this.concat()};Ar.prototype.concat=function(){return Buffer.concat(this.bufs,this.bufLen)};Ar.prototype.write=function(e){return UE(Sg.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};Ar.prototype.writeReverse=function(e){return UE(Sg.isBuffer(e)),this.bufs.push(Sg.reverse(e)),this.bufLen+=e.length,this};Ar.prototype.writeUInt8=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};Ar.prototype.writeUInt16BE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};Ar.prototype.writeUInt16LE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};Ar.prototype.writeUInt32BE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};Ar.prototype.writeInt32LE=function(e){var t=Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};Ar.prototype.writeUInt32LE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};Ar.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};Ar.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};Ar.prototype.writeVarintNum=function(e){var t=Ar.varintBufNum(e);return this.write(t),this};Ar.prototype.writeVarintBN=function(e){var t=Ar.varintBufBN(e);return this.write(t),this};Ar.varintBufNum=function(e){var t=void 0;return e<253?(t=Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};Ar.varintBufBN=function(e){var t=void 0,r=e.toNumber();if(r<253)t=Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new Ar;i.writeUInt8(255),i.writeUInt64LEBN(e);var t=i.concat()}return t};DE.exports=Ar});var no=X((AZ,qE)=>{qE.exports=require("util").inherits});var ca=X((OZ,zE)=>{var FE=Dr(),HE=ri(),mC=no();function oa(e,t,r="hex"){if(!(this instanceof oa))return new oa(e,t,r);HE.apply(this),e=Buffer.from(e);let i=FE.sha256(e);return this.write(i),this.write(i),t&&(t=Buffer.isBuffer(t)?t:Buffer.from(t,r),this.write(t)),this}mC(oa,HE);oa.prototype.finalize=function(){return Buffer.from(FE.sha256(this.toBuffer()))};Object.defineProperties(oa,{TAPSIGHASH:{get:()=>new oa("TapSighash")},TAPLEAF:{get:()=>new oa("TapLeaf")},TAPBRANCH:{get:()=>new oa("TapBranch")}});zE.exports=oa});var WE=X((Eg,jE)=>{var $h=require("buffer"),vs=$h.Buffer;function VE(e,t){for(var r in e)t[r]=e[r]}vs.from&&vs.alloc&&vs.allocUnsafe&&vs.allocUnsafeSlow?jE.exports=$h:(VE($h,Eg),Eg.Buffer=tc);function tc(e,t,r){return vs(e,t,r)}tc.prototype=Object.create(vs.prototype);VE(vs,tc);tc.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return vs(e,t,r)};tc.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=vs(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};tc.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return vs(e)};tc.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $h.SlowBuffer(e)}});var GE=X((kZ,KE)=>{"use strict";var Yh=WE().Buffer;function vC(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var n=e.charAt(i),o=n.charCodeAt(0);if(t[o]!==255)throw new TypeError(n+" is ambiguous");t[o]=i}var u=e.length,m=e.charAt(0),_=Math.log(u)/Math.log(256),w=Math.log(256)/Math.log(u);function I(C){if((Array.isArray(C)||C instanceof Uint8Array)&&(C=Yh.from(C)),!Yh.isBuffer(C))throw new TypeError("Expected Buffer");if(C.length===0)return"";for(var B=0,U=0,Z=0,$=C.length;Z!==$&&C[Z]===0;)Z++,B++;for(var H=($-Z)*w+1>>>0,ee=new Uint8Array(H);Z!==$;){for(var ce=C[Z],ge=0,Se=H-1;(ce!==0||ge<U)&&Se!==-1;Se--,ge++)ce+=256*ee[Se]>>>0,ee[Se]=ce%u>>>0,ce=ce/u>>>0;if(ce!==0)throw new Error("Non-zero carry");U=ge,Z++}for(var me=H-U;me!==H&&ee[me]===0;)me++;for(var O=m.repeat(B);me<H;++me)O+=e.charAt(ee[me]);return O}function T(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return Yh.alloc(0);for(var B=0,U=0,Z=0;C[B]===m;)U++,B++;for(var $=(C.length-B)*_+1>>>0,H=new Uint8Array($);C[B];){var ee=t[C.charCodeAt(B)];if(ee===255)return;for(var ce=0,ge=$-1;(ee!==0||ce<Z)&&ge!==-1;ge--,ce++)ee+=u*H[ge]>>>0,H[ge]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");Z=ce,B++}for(var Se=$-Z;Se!==$&&H[Se]===0;)Se++;var me=Yh.allocUnsafe(U+($-Se));me.fill(0,0,U);for(var O=U;Se!==$;)me[O++]=H[Se++];return me}function N(C){var B=T(C);if(B)return B;throw new Error("Non-base"+u+" character")}return{encode:I,decodeUnsafe:T,decode:N}}KE.exports=vC});var Ig=X((PZ,$E)=>{var gC=GE(),xC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";$E.exports=gC(xC)});var ol=X((NZ,XE)=>{"use strict";var Tg=Et(),YE=Ig(),ZE=require("buffer"),bC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),Hn=function e(t){if(!(this instanceof e))return new e(t);if(Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}else t&&this.set(t)};Hn.validCharacters=function(t){return ZE.Buffer.isBuffer(t)&&(t=t.toString()),Tg.every(Tg.map(t,function(r){return Tg.includes(bC,r)}))};Hn.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Hn.encode=function(e){if(!ZE.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return YE.encode(e)};Hn.decode=function(e){if(typeof e!="string")throw new Error("Input should be a string");return Buffer.from(YE.decode(e))};Hn.prototype.fromBuffer=function(e){return this.buf=e,this};Hn.prototype.fromString=function(e){var t=Hn.decode(e);return this.buf=t,this};Hn.prototype.toBuffer=function(){return this.buf};Hn.prototype.toString=function(){return Hn.encode(this.buf)};XE.exports=Hn});var du=X((MZ,e3)=>{"use strict";var JE=Et(),Zh=ol(),BZ=require("buffer"),QE=Dr().sha256sha256,Ci=function e(t){if(!(this instanceof e))return new e(t);if(Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}else t&&this.set(t)};Ci.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Ci.validChecksum=function(t,r){return JE.isString(t)&&(t=Buffer.from(Zh.decode(t))),JE.isString(r)&&(r=Buffer.from(Zh.decode(r))),r||(r=t.slice(-4),t=t.slice(0,-4)),Ci.checksum(t).toString("hex")===r.toString("hex")};Ci.decode=function(e){if(typeof e!="string")throw new Error("Input must be a string");var t=Buffer.from(Zh.decode(e));if(t.length<4)throw new Error("Input string too short");var r=t.slice(0,-4),i=t.slice(-4),n=QE(r),o=n.slice(0,4);if(i.toString("hex")!==o.toString("hex"))throw new Error("Checksum mismatch");return r};Ci.checksum=function(e){return QE(e).slice(0,4)};Ci.encode=function(e){if(!Buffer.isBuffer(e))throw new Error("Input must be a buffer");var t=Buffer.alloc(e.length+4),r=Ci.checksum(e);return e.copy(t),r.copy(t,e.length),Zh.encode(t)};Ci.prototype.fromBuffer=function(e){return this.buf=e,this};Ci.prototype.fromString=function(e){var t=Ci.decode(e);return this.buf=t,this};Ci.prototype.toBuffer=function(){return this.buf};Ci.prototype.toString=function(){return Ci.encode(this.buf)};e3.exports=Ci});var n3=X(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.bech32m=vu.bech32=void 0;var Xh="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r3={};for(let e=0;e<Xh.length;e++){let t=Xh.charAt(e);r3[t]=e}function mu(e){let t=e>>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function t3(e){let t=1;for(let r=0;r<e.length;++r){let i=e.charCodeAt(r);if(i<33||i>126)return"Invalid prefix ("+e+")";t=mu(t)^i>>5}t=mu(t);for(let r=0;r<e.length;++r){let i=e.charCodeAt(r);t=mu(t)^i&31}return t}function Rg(e,t,r,i){let n=0,o=0,u=(1<<r)-1,m=[];for(let _=0;_<e.length;++_)for(n=n<<t|e[_],o+=t;o>=r;)o-=r,m.push(n>>o&u);if(i)o>0&&m.push(n<<r-o&u);else{if(o>=t)return"Excess padding";if(n<<r-o&u)return"Non-zero padding"}return m}function _C(e){return Rg(e,8,5,!0)}function yC(e){let t=Rg(e,5,8,!1);if(Array.isArray(t))return t}function wC(e){let t=Rg(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function i3(e){let t;e==="bech32"?t=1:t=734539939;function r(u,m,_){if(_=_||90,u.length+7+m.length>_)throw new TypeError("Exceeds length limit");u=u.toLowerCase();let w=t3(u);if(typeof w=="string")throw new Error(w);let I=u+"1";for(let T=0;T<m.length;++T){let N=m[T];if(N>>5)throw new Error("Non 5-bit word");w=mu(w)^N,I+=Xh.charAt(N)}for(let T=0;T<6;++T)w=mu(w);w^=t;for(let T=0;T<6;++T){let N=w>>(5-T)*5&31;I+=Xh.charAt(N)}return I}function i(u,m){if(m=m||90,u.length<8)return u+" too short";if(u.length>m)return"Exceeds length limit";let _=u.toLowerCase(),w=u.toUpperCase();if(u!==_&&u!==w)return"Mixed-case string "+u;u=_;let I=u.lastIndexOf("1");if(I===-1)return"No separator character for "+u;if(I===0)return"Missing prefix for "+u;let T=u.slice(0,I),N=u.slice(I+1);if(N.length<6)return"Data too short";let C=t3(T);if(typeof C=="string")return C;let B=[];for(let U=0;U<N.length;++U){let Z=N.charAt(U),$=r3[Z];if($===void 0)return"Unknown character "+Z;C=mu(C)^$,!(U+6>=N.length)&&B.push($)}return C!==t?"Invalid checksum for "+u:{prefix:T,words:B}}function n(u,m){let _=i(u,m);if(typeof _=="object")return _}function o(u,m){let _=i(u,m);if(typeof _=="object")return _;throw new Error(_)}return{decodeUnsafe:n,decode:o,encode:r,toWords:_C,fromWordsUnsafe:yC,fromWords:wC}}vu.bech32=i3("bech32");vu.bech32m=i3("bech32m")});var a3=X((LZ,s3)=>{"use strict";var gu=n3(),SC=function(e){if(typeof e!="string")throw new Error("Input should be a string");var t;let r=gu.bech32.fromWords,i=so.BECH32;try{t=gu.bech32.decode(e)}catch(o){if(o.message.indexOf("Invalid checksum")>-1)t=gu.bech32m.decode(e),i=so.BECH32M,r=gu.bech32m.fromWords;else throw o}let n=t.words[0];if(n>=1&&i!==so.BECH32M)throw new Error("Version 1+ witness address must use Bech32m checksum");return{prefix:t.prefix,data:Buffer.from(r(t.words.slice(1))),version:n}},EC=function(e,t,r,i){if(typeof e!="string")throw new Error("Prefix should be a string");if(typeof t!="number")throw new Error("version should be a number");if(i&&typeof i=="string"&&(i=so[i.toUpperCase()]||-1),i&&!(i==so.BECH32||i==so.BECH32M))throw new Error("Invalid encoding specified");let n=i==so.BECH32M?gu.bech32m:gu.bech32,o=n.toWords(r);return o.unshift(t),n.encode(e,o)},so={BECH32:1,BECH32M:2};s3.exports={decode:SC,encode:EC,encodings:so}});var gs=X((UZ,c3)=>{"use strict";var cl=Et(),o3=xt(),IC=Yt(),xu=Xr(),Or=function e(t){if(!(this instanceof e))return new e(t);if(!cl.isUndefined(t))if(Buffer.isBuffer(t))this.set({buf:t});else if(cl.isString(t))this.set({buf:Buffer.from(t,"hex")});else if(cl.isObject(t)){var r=t;this.set(r)}else throw new TypeError("Unrecognized argument for BufferReader")};Or.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this};Or.prototype.eof=function(){return this.buf?this.pos>=this.buf.length:!0};Or.prototype.finished=Or.prototype.eof;Or.prototype.read=function(e){o3.checkArgument(!cl.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t};Or.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e};Or.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e};Or.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e};Or.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e};Or.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e};Or.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e};Or.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e};Or.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=xu.fromBuffer(e);return this.pos=this.pos+8,t};Or.prototype.readUInt64LEBN=function(){var e=this.buf.readUInt32LE(this.pos),t=this.buf.readUInt32LE(this.pos+4),r=t*4294967296+e,i;if(r<=9007199254740991)i=new xu(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);i=new xu(n,10,"le")}return this.pos=this.pos+8,i};Or.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN(),r=t.toNumber();if(r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarintBN");default:return e}};Or.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return o3.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t};Or.prototype.readVarintBuf=function(){var e=this.buf.readUInt8(this.pos);switch(e){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}};Or.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new xu(this.readUInt16LE());case 254:return new xu(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new xu(e)}};Or.prototype.reverse=function(){for(var e=Buffer.alloc(this.buf.length),t=0;t<e.length;t++)e[t]=this.buf[this.buf.length-1-t];return this.buf=e,this};Or.prototype.readReverse=function(e){cl.isUndefined(e)&&(e=this.buf.length);var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,IC.reverse(t)};c3.exports=Or});var Jh=X((DZ,u3)=>{"use strict";var bu=Et(),_u=xt(),TC=Yt(),RC=Rr();function ut(e){if(!(this instanceof ut))return new ut(e);var t;if(bu.isNumber(e))t=e;else if(bu.isString(e))t=ut.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return RC.defineImmutable(this,{num:t}),this}ut.fromBuffer=function(e){return _u.checkArgument(TC.isBuffer(e)),new ut(+("0x"+e.toString("hex")))};ut.fromNumber=function(e){return _u.checkArgument(bu.isNumber(e)),new ut(e)};ut.fromString=function(e){_u.checkArgument(bu.isString(e));var t=ut.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new ut(t)};ut.prototype.toHex=function(){return this.num.toString(16)};ut.prototype.toBuffer=function(){return Buffer.from(this.toHex(),"hex")};ut.prototype.toNumber=function(){return this.num};ut.prototype.toString=function(){var e=ut.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};ut.smallInt=function(e){return _u.checkArgument(bu.isNumber(e),"Invalid Argument: n should be number"),_u.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?ut("OP_0"):new ut(ut.map.OP_1+e-1)};ut.decodeOpN=function(e){return e===ut.OP_0?0:(_u.checkArgument(e>=ut.OP_1&&e<=ut.OP_16,new Error("Invalid opcode: "+JSON.stringify(e))),e-(ut.OP_1-1))};ut.isOpSuccess=function(e){return typeof e=="string"&&!parseInt(e)&&(e=ut[e]),e==80||e==98||e>=126&&e<=129||e>=131&&e<=134||e>=137&&e<=138||e>=141&&e<=142||e>=149&&e<=153||e>=187&&e<=254};ut.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKSIGADD:186,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};ut.reverseMap=[];for(Ag in ut.map)ut.reverseMap[ut.map[Ag]]=Ag;var Ag;bu.extend(ut,ut.map);ut.isSmallIntOp=function(e){return e instanceof ut&&(e=e.toNumber()),e===ut.map.OP_0||e>=ut.map.OP_1&&e<=ut.map.OP_16};ut.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};u3.exports=ut});var Pg=X((qZ,p3)=>{"use strict";var Kr=Vn(),AC=gs(),OC=ri(),Qh=Dr(),le=Jh(),zn=jn(),rc=di(),f3=io(),Xt=xt(),Og=Et(),kg=Yi(),ai=Yt(),kC=Rr(),l3=ca(),K=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],ai.isBuffer(t))return e.fromBuffer(t);if(t instanceof Kr)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(typeof t=="string")return e.fromString(t);Og.isObject(t)&&Array.isArray(t.chunks)&&this.set(t)};K.prototype.set=function(e){return Xt.checkArgument(Og.isObject(e)),Xt.checkArgument(Array.isArray(e.chunks)),this.chunks=e.chunks,this};K.fromBuffer=function(e){var t=new K;t.chunks=[];for(var r=new AC(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<le.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===le.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===le.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===le.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):le.isOpSuccess(i)?(o=r.readAll(),n=o.length,t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(u){throw u instanceof RangeError?new kg.Script.InvalidBuffer(e.toString("hex")):u}return t};K.prototype.toBuffer=function(){for(var e=new OC,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<le.OP_PUSHDATA1?e.write(r.buf):i===le.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===le.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):(i===le.OP_PUSHDATA4&&e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};K.fromASM=function(e){var t=new K;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=le(n),u=o.toNumber();if(u==null){var m=Buffer.from(r[i],"hex");t.chunks.push({buf:m,len:m.length,opcodenum:m.length}),i=i+1}else u===le.OP_PUSHDATA1||u===le.OP_PUSHDATA2||u===le.OP_PUSHDATA4?(t.chunks.push({buf:Buffer.from(r[i+2],"hex"),len:parseInt(r[i+1]),opcodenum:u}),i=i+3):(t.chunks.push({opcodenum:u}),i=i+1)}return t};K.fromHex=function(e){return new K(Buffer.from(e,"hex"))};K.fromString=function(e){if(kC.isHexa(e)||e.length===0)return new K(Buffer.from(e,"hex"));var t=new K;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=le(n),u=o.toNumber();if(u==null)if(u=parseInt(n),u>0&&u<le.OP_PUSHDATA1)t.chunks.push({buf:Buffer.from(r[i+1].slice(2),"hex"),len:u,opcodenum:u}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(u===le.OP_PUSHDATA1||u===le.OP_PUSHDATA2||u===le.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:u}),i=i+3}else t.chunks.push({opcodenum:u}),i=i+1}return t};K.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)(!i&&r===le.OP_PUSHDATA1||r===le.OP_PUSHDATA2||r===le.OP_PUSHDATA4)&&(n=n+" "+le(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof le.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+le(r).toString():n=n+" "+le(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};K.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};K.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};K.prototype.toHex=function(){return this.toBuffer().toString("hex")};K.prototype.inspect=function(){return"<Script: "+this.toString()+">"};K.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===le.OP_DUP&&this.chunks[1].opcodenum===le.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===le.OP_EQUALVERIFY&&this.chunks[4].opcodenum===le.OP_CHECKSIG)};K.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};K.prototype.getPublicKey=function(){return Xt.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};K.prototype.getPublicKeyHash=function(){if(this.isPublicKeyHashOut())return this.chunks[2].buf;if(this.isWitnessPublicKeyHashOut())return this.chunks[1].buf;if(this.isTaproot())return this.chunks[1].buf;throw new Error("Can't retrieve PublicKeyHash from a non-PKH output")};K.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===le.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return zn.isValid(e)}return!1};K.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};K.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===le.OP_HASH160&&e[1]===20&&e[e.length-1]===le.OP_EQUAL};K.prototype.isWitnessScriptHashOut=function(){var e=this.toBuffer();return e.length===34&&e[0]===le.OP_0&&e[1]===32};K.prototype.isWitnessPublicKeyHashOut=function(){var e=this.toBuffer();return e.length===22&&e[0]===le.OP_0&&e[1]===20};K.prototype.isTaproot=function(){var e=this.toBuffer();return e.length===34&&e[0]===le.OP_1&&e[1]===32};K.prototype.isWitnessProgram=function(e){e||(e={});var t=this.toBuffer();return t.length<4||t.length>42||t[0]!==le.OP_0&&!(t[0]>=le.OP_1&&t[0]<=le.OP_16)?!1:t.length===t[1]+2?(e.version=le.decodeOpN(t[0]),e.program=t.slice(2,t.length),!0):!1};K.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=K.fromBuffer(t)}catch(n){if(n instanceof kg.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==K.types.UNKNOWN};K.prototype.isMultisigOut=function(){return this.chunks.length>3&&le.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&ai.isBuffer(e.buf)})&&le.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===le.OP_CHECKMULTISIG};K.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&ai.isBuffer(e.buf)&&rc.isTxDER(e.buf)})};K.prototype.isDataOut=function(){return this.chunks.length>=1&&this.chunks[0].opcodenum===le.OP_RETURN&&(this.chunks.length===1||this.chunks.length===2&&this.chunks[1].buf&&this.chunks[1].buf.length<=K.OP_RETURN_STANDARD_SIZE&&this.chunks[1].length===this.chunks.len)};K.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut()||this.isWitnessScriptHashOut()||this.isWitnessPublicKeyHashOut()||this.isTaproot())return this.chunks[1]==null?Buffer.alloc(0):Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};K.prototype.isPushOnly=function(){return this.chunks.every(function(e){return e.opcodenum<=le.OP_16})};K.types={};K.types.UNKNOWN="Unknown";K.types.PUBKEY_OUT="Pay to public key";K.types.PUBKEY_IN="Spend from public key";K.types.PUBKEYHASH_OUT="Pay to public key hash";K.types.PUBKEYHASH_IN="Spend from public key hash";K.types.SCRIPTHASH_OUT="Pay to script hash";K.types.SCRIPTHASH_IN="Spend from script hash";K.types.MULTISIG_OUT="Pay to multisig";K.types.MULTISIG_IN="Spend from multisig";K.types.DATA_OUT="Data push";K.OP_RETURN_STANDARD_SIZE=80;K.ANNEX_TAG=80;K.VALIDATION_WEIGHT_PER_SIGOP_PASSED=50;K.VALIDATION_WEIGHT_OFFSET=50;K.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!=K.types.UNKNOWN?e:this.classifyInput()};K.outputIdentifiers={};K.outputIdentifiers.PUBKEY_OUT=K.prototype.isPublicKeyOut;K.outputIdentifiers.PUBKEYHASH_OUT=K.prototype.isPublicKeyHashOut;K.outputIdentifiers.MULTISIG_OUT=K.prototype.isMultisigOut;K.outputIdentifiers.SCRIPTHASH_OUT=K.prototype.isScriptHashOut;K.outputIdentifiers.DATA_OUT=K.prototype.isDataOut;K.prototype.classifyOutput=function(){for(var e in K.outputIdentifiers)if(K.outputIdentifiers[e].bind(this)())return K.types[e];return K.types.UNKNOWN};K.inputIdentifiers={};K.inputIdentifiers.PUBKEY_IN=K.prototype.isPublicKeyIn;K.inputIdentifiers.PUBKEYHASH_IN=K.prototype.isPublicKeyHashIn;K.inputIdentifiers.MULTISIG_IN=K.prototype.isMultisigIn;K.inputIdentifiers.SCRIPTHASH_IN=K.prototype.isScriptHashIn;K.prototype.classifyInput=function(){for(var e in K.inputIdentifiers)if(K.inputIdentifiers[e].bind(this)())return K.types[e];return K.types.UNKNOWN};K.prototype.isStandard=function(){return this.classify()!==K.types.UNKNOWN};K.prototype.prepend=function(e){return this._addByType(e,!0),this};K.prototype.equals=function(e){if(Xt.checkState(e instanceof K,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(ai.isBuffer(this.chunks[t].buf)&&!ai.isBuffer(e.chunks[t].buf)||ai.isBuffer(this.chunks[t].buf)&&!ai.equals(this.chunks[t].buf,e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};K.prototype.add=function(e){return this._addByType(e,!1),this};K.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof le)this._addOpcode(e,t);else if(ai.isBuffer(e))this._addBuffer(e,t);else if(e instanceof K)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};K.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};K.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof le?r=e.toNumber():r=le(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};K.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<le.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=le.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=le.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=le.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};K.prototype.hasCodeseparators=function(){for(var e=0;e<this.chunks.length;e++)if(this.chunks[e].opcodenum===le.OP_CODESEPARATOR)return!0;return!1};K.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==le.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};K.buildMultisigOut=function(e,t,r){Xt.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new K;i.add(le.smallInt(t)),e=e.map(zn);var n=e;r.noSorting||(n=Og.sortBy(e,function(m){return m.toString("hex")}));for(var o=0;o<n.length;o++){var u=n[o];i.add(u.toBuffer())}return i.add(le.smallInt(e.length)),i.add(le.OP_CHECKMULTISIG),i};K.buildWitnessMultisigOutFromScript=function(e){if(e instanceof K){var t=new K;return t.add(le.OP_0),t.add(Qh.sha256(e.toBuffer())),t}else throw new TypeError("First argument is expected to be a p2sh script")};K.buildMultisigIn=function(e,t,r,i){Xt.checkArgument(Array.isArray(e)),Xt.checkArgument(!isNaN(t)),Xt.checkArgument(Array.isArray(r)),i=i||{};var n=new K;n.add(le.OP_0);for(let o of r)Xt.checkArgument(ai.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o);return n};K.buildP2SHMultisigIn=function(e,t,r,i){Xt.checkArgument(Array.isArray(e)),Xt.checkArgument(!isNaN(t)),Xt.checkArgument(Array.isArray(r)),i=i||{};var n=new K;n.add(le.OP_0);for(let o of r)Xt.checkArgument(ai.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o);return n.add((i.cachedMultisig||K.buildMultisigOut(e,t,i)).toBuffer()),n};K.buildPublicKeyHashOut=function(e){Xt.checkArgument(e!=null),Xt.checkArgument(e instanceof zn||e instanceof Kr||typeof e=="string"),e instanceof zn?e=e.toAddress():typeof e=="string"&&(e=new Kr(e));var t=new K;return t.add(le.OP_DUP).add(le.OP_HASH160).add(e.hashBuffer).add(le.OP_EQUALVERIFY).add(le.OP_CHECKSIG),t._network=e.network,t};K.buildWitnessV0Out=function(e){Xt.checkArgument(e!=null),Xt.checkArgument(e instanceof zn||e instanceof Kr||typeof e=="string"),e instanceof zn?e=e.toAddress(null,Kr.PayToWitnessPublicKeyHash):typeof e=="string"&&(e=new Kr(e));var t=new K;return t.add(le.OP_0).add(e.hashBuffer),t._network=e.network,t};K.buildWitnessV1Out=function(e,t){if(Xt.checkArgument(e instanceof zn||e instanceof Kr||typeof e=="string"),Xt.checkArgument(!t||Array.isArray(t)||!!t.script),typeof e=="string")try{e=zn.fromTaproot(e)}catch{e=Kr.fromString(e)}function r(u){if(Array.isArray(u)){let[m,_]=r(u[0]),[w,I]=r(u[1]),T=[[[m[0],m[1]],I],[[w[0],w[1]],_]],N=l3.TAPBRANCH;return _.compare(I)===1?(N.write(I),N.write(_)):(N.write(_),N.write(I)),[T,N.finalize()]}else{let{leafVersion:m,script:_}=u,w=new K(_).toBuffer(),I=l3.TAPLEAF;I.writeUInt8(m),I.writeUInt8(w.length),I.write(w);let T=I.finalize();return[[Buffer.from([m]),w],T]}}let i=null;if(t){let[u,m]=r(t);i=m}let n;e instanceof zn?n=e.createTapTweak(i).tweakedPubKey:n=e.hashBuffer;let o=new K;return o.add(le.OP_1),o.add(n),o};K.buildPublicKeyOut=function(e){Xt.checkArgument(e instanceof zn);var t=new K;return t.add(e.toBuffer()).add(le.OP_CHECKSIG),t};K.buildDataOut=function(e,t){Xt.checkArgument(e==null||typeof e=="string"||ai.isBuffer(e)),typeof e=="string"&&(e=Buffer.from(e,t));var r=new K;return r.add(le.OP_RETURN),e!=null&&r.add(e),r};K.buildScriptHashOut=function(e){Xt.checkArgument(e instanceof K||e instanceof Kr&&e.isPayToScriptHash());var t=new K;return t.add(le.OP_HASH160).add(e instanceof Kr?e.hashBuffer:Qh.sha256ripemd160(e.toBuffer())).add(le.OP_EQUAL),t._network=e._network||e.network,t};K.buildPublicKeyIn=function(e,t){Xt.checkArgument(e instanceof rc||ai.isBuffer(e)),Xt.checkArgument(t==null||!isNaN(t)),e instanceof rc&&(e=e.toBuffer());var r=new K;return r.add(ai.concat([e,ai.integerAsSingleByteBuffer(t||rc.SIGHASH_ALL)])),r};K.buildPublicKeyHashIn=function(e,t,r){Xt.checkArgument(t instanceof rc||ai.isBuffer(t)),Xt.checkArgument(r==null||!isNaN(r)),t instanceof rc&&(t=t.toBuffer());var i=new K().add(ai.concat([t,ai.integerAsSingleByteBuffer(r||rc.SIGHASH_ALL)])).add(new zn(e).toBuffer());return i};K.empty=function(){return new K};K.prototype.toScriptHashOut=function(){return K.buildScriptHashOut(this)};K.fromAddress=function(e){if(e=Kr(e),e.isPayToScriptHash())return K.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return K.buildPublicKeyHashOut(e);if(e.isPayToWitnessPublicKeyHash())return K.buildWitnessV0Out(e);if(e.isPayToWitnessScriptHash())return K.buildWitnessV0Out(e);if(e.isPayToTaproot())return K.buildWitnessV1Out(e);throw new kg.Script.UnrecognizedAddress(e)};K.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};K.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToPublicKeyHash;else if(this.isWitnessScriptHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToWitnessScriptHash;else if(this.isWitnessPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToWitnessPublicKeyHash;else if(this.isTaproot())e.hashBuffer=this.getData(),e.type=Kr.PayToTaproot;else return!1;return e};K.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=Qh.sha256ripemd160(this.chunks[1].buf),e.type=Kr.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=Qh.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Kr.PayToScriptHash;else return!1;return e};K.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=f3.get(e)||this._network||f3.defaultNetwork,new Kr(t)):!1};K.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=K({chunks:[this.chunks[i]]}),o=n.toBuffer(),u=o.toString("hex");r===u&&this.chunks.splice(i,1)}return this};K.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===le.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===le.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===le.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===le.OP_PUSHDATA1:r.length<=65535?i===le.OP_PUSHDATA2:!0:!0};K.prototype.getSignatureOperationsCount=function(e){e=e??!0;var t=0,r=le.OP_INVALIDOPCODE;for(let n of this.chunks){var i=n.opcodenum;i==le.OP_CHECKSIG||i==le.OP_CHECKSIGVERIFY?t++:(i==le.OP_CHECKMULTISIG||i==le.OP_CHECKMULTISIGVERIFY)&&(e&&r>=le.OP_1&&r<=le.OP_16?t+=le.decodeOpN(r):t+=20),r=i}return t};p3.exports=K});var yu=X((HZ,g3)=>{"use strict";var ic=di(),FZ=Li(),h3=gs(),d3=ri(),ul=Dr(),v3=fl(),m3=xt(),Ng=Et(),Bg=function(t,r,i,n,o){var u=Buffer.alloc(32),m=Buffer.alloc(32),_=Buffer.alloc(32);if(!(r&ic.SIGHASH_ANYONECANPAY)){for(var w=[],I=0;I<t.inputs.length;I++){var T=t.inputs[I],N=new h3(T.prevTxId).readReverse();w.push(N);var C=Buffer.alloc(4);C.writeUInt32LE(T.outputIndex,0),w.push(C)}u=ul.sha256sha256(Buffer.concat(w))}if(!(r&ic.SIGHASH_ANYONECANPAY)&&(r&31)!==ic.SIGHASH_SINGLE&&(r&31)!==ic.SIGHASH_NONE){for(var B=[],U=0;U<t.inputs.length;U++){var Z=Buffer.alloc(4);Z.writeUInt32LE(t.inputs[U].sequenceNumber,0),B.push(Z)}m=ul.sha256sha256(Buffer.concat(B))}var $=new d3;if((r&31)!==ic.SIGHASH_SINGLE&&(r&31)!==ic.SIGHASH_NONE){for(var H=0;H<t.outputs.length;H++)t.outputs[H].toBufferWriter($);_=ul.sha256sha256($.toBuffer())}else(r&31)===ic.SIGHASH_SINGLE&&i<t.outputs.length&&(t.outputs[i].toBufferWriter($),_=ul.sha256sha256($.toBuffer()));var ee=new d3;ee.writeUInt32LE(t.version),ee.write(u),ee.write(m);var ce=new h3(t.inputs[i].prevTxId).readReverse();return ee.write(ce),ee.writeUInt32LE(t.inputs[i].outputIndex),ee.write(n),ee.write(o),ee.writeUInt32LE(t.inputs[i].sequenceNumber),ee.write(_),ee.writeUInt32LE(t.nLockTime),ee.writeInt32LE(r),ul.sha256sha256(ee.toBuffer())};function PC(e,t,r,i,n,o){let u=Bg(e,r,i,n,o);return v3.sign(u,t).set({nhashtype:r})}function NC(e,t,r,i,n,o){m3.checkArgument(!Ng.isUndefined(e),"Transaction Undefined"),m3.checkArgument(!Ng.isUndefined(t)&&!Ng.isUndefined(t.nhashtype),"Signature Undefined");let u=Bg(e,t.nhashtype,i,n,o);return v3.verify(u,t,r)}g3.exports={sighash:Bg,sign:PC,verify:NC}});var Mg=X((zZ,x3)=>{var BC=require("crypto"),ua=xt(),td=Rr(),nc=Xr(),sc=eo(),ed=ca(),ll=function e(){return this instanceof e?this:new e};ll.prototype.set=function(){};ll.sign=function(e,t,r){if(e=Buffer.isBuffer(e)?e:e.toBuffer(),e.length!==32)throw new Error("Private key should be 32 bytes for schnorr signatures");typeof t=="string"&&(ua.checkArgument(td.isHexaString(t),"Schnorr message string is not hex"),t=Buffer.from(t,"hex")),ua.checkArgument(ua.isType(t,"Buffer"),"Schnorr message must be a hex string or buffer"),r||(r=BC.randomBytes(32)),typeof r=="string"&&(ua.checkArgument(td.isHexaString(r),"Schnorr aux string is not hex"),r=Buffer.from(r,"hex")),ua.checkArgument(ua.isType(r,"Buffer"),"Schnorr aux must be a hex string or buffer");let i=sc.getG(),n=sc.getN(),o=new nc(e);if(o.eqn(0)||o.gte(n))throw new Error("Invalid private key for schnorr signing");let u=i.mul(o),m=Buffer.from(u.encodeCompressed().slice(1)),_=u.y.isEven()?o:n.sub(o),w=_.xor(new nc(new ed("BIP0340/aux",r).finalize())),I=new ed("BIP0340/nonce",Buffer.concat([w.toBuffer(),m,t])).finalize(),T=new nc(I).mod(n);if(T.eqn(0))throw new Error("Error creating schnorr signature");let N=i.mul(T),C=Buffer.from(N.encodeCompressed().slice(1)),B=N.y.isEven()?T:n.sub(T),U=new nc(new ed("BIP0340/challenge",Buffer.concat([C,m,t])).finalize()).mod(n),Z=Buffer.concat([C,B.add(U.mul(_)).mod(n).toBuffer({size:32})]);if(!ll.verify(m,t,Z))throw new Error("Error creating schnorr signature. Verification failed");return Z};ll.verify=function(e,t,r){if(ua.isType(e,"PublicKey")&&(e=e.point.x.toBuffer()),e.length!==32)throw new Error("Public key should be 32 bytes for schnorr signatures");if(typeof t=="string"&&(ua.checkArgument(td.isHexaString(t),"Schnorr message string is not hex"),t=Buffer.from(t,"hex")),t.length!==32)throw new Error("Message should be a 32 byte buffer");if(typeof r=="string"&&(ua.checkArgument(td.isHexaString(r),"Schnorr signature string is not hex"),r=Buffer.from(r,"hex")),typeof r.toBuffer=="function"&&(r=r.toBuffer(),r.length===65&&(r=r.slice(0,64))),r.length!==64)throw new Error("Signature should be a 64 byte buffer. Got "+r.length+" bytes");try{let i=sc.getP(),n=sc.getN(),o=sc.fromX(!1,e).liftX(),u=new nc(r.slice(0,32)),m=new nc(r.slice(32,64));if(u.gte(i)||m.gte(n))return!1;let _=MC(u,o,t),I=sc.getG().mul(m).add(o.mul(_).neg());return!(I.inf||!I.y.isEven()||!I.x.eq(u))}catch{return!1}};var MC=function(e,t,r){let i=sc.getN(),n=new ed("BIP0340/challenge",Buffer.concat([e.toBuffer({size:32}),t.x.toBuffer({size:32}),r])).finalize();return new nc(n).mod(i)};x3.exports=ll});var rd=X((jZ,w3)=>{"use strict";var wi=di(),ac=ri(),wu=Dr(),b3=Mg(),oc=xt(),CC=ca(),VZ=ao();function _3(e,t,r,i,n){let o,u;switch(i){case wi.Version.TAPROOT:o=0;break;case wi.Version.TAPSCRIPT:o=1,u=0;break;default:return!1}oc.checkArgument(r<e.inputs.length,"inputNumber is greater than number of inputs");let m=CC.TAPSIGHASH;m.writeUInt8(0);let _=t==wi.SIGHASH_DEFAULT?wi.SIGHASH_ALL:t&wi.SIGHASH_OUTPUT_MASK,w=t&wi.SIGHASH_INPUT_MASK;if(!(t<=3||t>=129&&t<=131))return!1;if(m.writeUInt8(t),m.writeInt32LE(e.version),m.writeUInt32LE(e.nLockTime),w!==wi.SIGHASH_ANYONECANPAY){let T=new ac,N=new ac,C=new ac,B=new ac;for(let ee of e.inputs){T.writeReverse(ee.prevTxId),T.writeInt32LE(ee.outputIndex),N.writeUInt64LEBN(ee.output._satoshisBN);let ce=ee.output.script.toBuffer();C.writeUInt8(ce.length),C.write(ce),B.writeUInt32LE(ee.sequenceNumber)}let U=wu.sha256(T.toBuffer());m.write(U);let Z=wu.sha256(N.toBuffer());m.write(Z);let $=wu.sha256(C.toBuffer());m.write($);let H=wu.sha256(B.toBuffer());m.write(H)}if(_===wi.SIGHASH_ALL){let T=new ac;for(let C of e.outputs)T.write(C.toBufferWriter().toBuffer());let N=wu.sha256(T.toBuffer());m.write(N)}oc.checkArgument(n.annexInit,"missing or invalid annexInit");let I=(o<<1)+(n.annexPresent?1:0);if(m.writeUInt8(I),w===wi.SIGHASH_ANYONECANPAY){let T=new ac;T.writeReverse(e.inputs[r].prevTxId),T.writeInt32LE(e.inputs[r].outputIndex),m.write(T.toBuffer()),m.write(e.inputs[r].output.toBufferWriter().toBuffer()),m.writeUInt32LE(e.inputs[r].sequenceNumber)}else m.writeUInt32LE(r);if(n.annexPresent&&m.write(n.annexHash),_===wi.SIGHASH_SINGLE){if(r>=e.outputs.length)return!1;let T=new ac;T.writeUInt64LEBN(e.outputs[r]._satoshisBN);let N=e.outputs[r].script.toBuffer();T.writeVarintNum(N.length),T.write(N),m.write(wu.sha256(T.toBuffer()))}return i==wi.Version.TAPSCRIPT&&(oc.checkArgument(n.tapleafHashInit,"missing or invalid tapleafHashInit"),m.write(n.tapleafHash),m.writeUInt8(u),oc.checkArgument(n.codeseparatorPosInit,"missing or invalid codeseparatorPosInit"),m.writeUInt32LE(n.codeseparatorPos)),m.finalize()}function y3(e,t){let r={annexInit:!0,annexPresent:!1};if(e===wi.Version.TAPSCRIPT){if(r.codeseparatorPosInit=!0,r.codeseparatorPos=4294967295,!t)return!1;r.tapleafHashInit=!0,r.tapleafHash=t}return r}function LC(e,t,r,i,n,o){oc.checkArgument(n===wi.Version.TAPROOT||n===wi.Version.TAPSCRIPT,"Invalid sigversion");let u=y3(n,o),m=_3(e,r,i,n,u);if(!m)return!1;let _=b3.sign(t,m);return r!==wi.SIGHASH_DEFAULT?Buffer.concat([_,Buffer.from([r])]):_}function UC(e,t,r,i,n,o){oc.checkArgument(e!=null,"Transaction Undefined"),(!o||Buffer.isBuffer(o))&&(o=y3(i,o)),oc.checkArgument(o.annexInit,"invalid execdata");let u=_3(e,t.nhashtype,n,i,o);return u?b3.verify(r,u,t):!1}w3.exports={sign:LC,verify:UC}});var E3=X((WZ,S3)=>{S3.exports=function(e,t){if(typeof e.compare=="function")return e.compare(t);if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o&&e[n]===t[n];)++n;return n!==o&&(r=e[n],i=t[n]),r<i?-1:i<r?1:0}});var xs=X((KZ,A3)=>{"use strict";var id=Et(),Cg=Xr(),I3=Yt(),Lg=Rr(),T3=ri(),Ug=Li(),Su=xt(),DC=Yi(),R3=qg(),Dg=ca(),qC=9007199254740991;function kr(e){if(!(this instanceof kr))return new kr(e);if(id.isObject(e)){if(this.satoshis=e.satoshis,I3.isBuffer(e.script))this.setScriptFromBuffer(e.script);else{var t;id.isString(e.script)&&Lg.isHexa(e.script)?t=Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}e.type==="taproot"&&(this.branch=[],Object.defineProperty(this,"isValid",{configurable:!1,enumerable:!1,get:function(){this._isValid||this._branch.length},set:function(r){this._isValid=r}}),Object.defineProperty(this,"isComplete",{configurable:!1,enumerable:!1,get:function(){return this.isValid&&(this._branch.length===0||this._branch.length===1&&!!this._branch[0])}}))}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(kr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(kr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof Cg?(this._satoshisBN=e,this._satoshis=e.toNumber()):id.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=Cg.fromNumber(this._satoshis)):(Su.checkArgument(Lg.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=Cg.fromNumber(e),this._satoshis=e),Su.checkState(Lg.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});kr.prototype.invalidSatoshis=function(){return this._satoshis>qC?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};kr.prototype.toObject=kr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};kr.fromObject=function(e){return new kr(e)};kr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=Ug.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof DC.Script.InvalidBuffer)this._script=null;else throw t}};kr.prototype.setScript=function(e){if(e instanceof Ug)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(id.isString(e))this._script=Ug.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(I3.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};kr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};kr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=Buffer.from([]),new kr(t)};kr.prototype.toBufferWriter=function(e){e||(e=new T3),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};kr.prototype.calculateSize=function(){let e=8;return e+=T3.varintBufNum(this._scriptBuffer.length).length,e+=this._scriptBuffer.length,e};kr.prototype.add=function(e,t,r,i=!0){if(Su.checkArgument((r&~R3.TAPROOT_LEAF_MASK)===0,"invalid leafVersion"),!this.isValid)return;let n={hash:Dg.TAPLEAF.writeUInt8(r).write(t.toBuffer()).finalize(),leaves:[]};if(i){let o={script:t,leafVersion:r,merkleBranch:[]};n.leaves.push(o)}return this._insertNode(n,e),this};kr.prototype._insertNode=function(e,t){if(Su.checkArgument(t>=0&&t<=R3.TAPROOT_CONTROL_MAX_NODE_COUNT,"invalid depth"),t+1<this._branch.length){this.isValid=!1;return}for(;this.isValid&&this._branch.length>t&&this._branch[t];)e=this._combineNodes(e,this._branch[t]),this._branch=this._branch.slice(0,this._branch.length-2),t==0&&(this.isValid=!1),t--;this.isValid&&(this._branch.length<=t&&(this._branch=this._branch.slice(0,t+1)),Su.checkState(!this._nodes[t]),m_branch[t]=e)};kr.prototype._combineNodes=function(e,t){let r={hash:null,leaves:[]};for(let i of e.leaves)i.merkleBranch.push(t.hash),r.leaves.push(i);for(let i of t.leaves)i.merkleBranch.push(e.hash),r.leaves.push(i);return e.hash.compare(t.hash)===-1?r.hash=Dg.TAPBRANCH.write(e.hash).write(t.hash).finalize():r.hash=Dg.TAPBRANCH.write(t.hash).write(e.hash).finalize(),r};kr.prototype.finalize=function(e){Su.checkState(this.isComplete===!0,"finalize can only be called when isComplete is true");let t=e.createTapTweak(this._branch.length===0?null:this._branch[0].hash)};A3.exports=kr});var Eu=X(($Z,N3)=>{"use strict";var nd=Et(),pl=xt(),cc=Yi(),O3=ri(),GZ=require("buffer"),FC=Yt(),k3=Rr(),Fg=Li(),HC=fa(),Hg=xs(),sd=4294967295,P3=sd,zC=sd-1,VC=sd-2,jC=Math.pow(2,31),jg=Math.pow(2,22),zg=65535,Vg=512,WC=Math.pow(2,16)-1;function bt(e){if(!(this instanceof bt))return new bt(e);if(e)return this._fromObject(e)}bt.MAXINT=sd;bt.DEFAULT_SEQNUMBER=P3;bt.DEFAULT_LOCKTIME_SEQNUMBER=zC;bt.DEFAULT_RBF_SEQNUMBER=VC;bt.SEQUENCE_LOCKTIME_TYPE_FLAG=jg;Object.defineProperty(bt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new Fg(this._scriptBuffer),this._script._isInput=!0),this._script)}});bt.fromObject=function(e){pl.checkArgument(nd.isObject(e));var t=new bt;return t._fromObject(e)};bt.prototype._fromObject=function(e){var t;if(typeof e.prevTxId=="string"&&k3.isHexa(e.prevTxId)?t=Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.witnesses=[],this.output=e.output?e.output instanceof Hg?e.output:new Hg(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=e.outputIndex==null?e.txoutnum:e.outputIndex,this.sequenceNumber=e.sequenceNumber==null?e.seqnum==null?P3:e.seqnum:e.sequenceNumber,e.script===void 0&&e.scriptBuffer===void 0)throw new cc.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};bt.prototype.toObject=bt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};bt.fromBufferReader=function(e){var t=new bt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};bt.prototype.toBufferWriter=function(e){e||(e=new O3),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};bt.prototype.setScript=function(e){if(this._script=null,e instanceof Fg)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(k3.isHexa(e))this._scriptBuffer=Buffer.from(e,"hex");else if(nd.isString(e))this._script=new Fg(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(FC.isBuffer(e))this._scriptBuffer=Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};bt.prototype.getSignatures=function(){throw new cc.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};bt.prototype.getSatoshisBuffer=function(){return pl.checkState(this.output instanceof Hg),pl.checkState(this.output._satoshisBN),new O3().writeUInt64LEBN(this.output._satoshisBN).toBuffer()};bt.prototype.isFullySigned=function(){throw new cc.AbstractMethodInvoked("Input#isFullySigned")};bt.prototype.isFinal=function(){return this.sequenceNumber!==bt.MAXINT};bt.prototype.addSignature=function(){throw new cc.AbstractMethodInvoked("Input#addSignature")};bt.prototype.clearSignatures=function(){throw new cc.AbstractMethodInvoked("Input#clearSignatures")};bt.prototype.hasWitnesses=function(){return!!(this.witnesses&&this.witnesses.length>0)};bt.prototype.getWitnesses=function(){return this.witnesses};bt.prototype.setWitnesses=function(e){this.witnesses=e};bt.prototype.isValidSignature=function(e,t,r){return r=r||"ecdsa",t.signature.nhashtype=t.sigtype,HC.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)};bt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};bt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};bt.prototype._getBaseSize=function(){return 40};bt.prototype.lockForSeconds=function(e){if(pl.checkArgument(nd.isNumber(e)),e<0||e>=Vg*zg)throw new cc.Transaction.Input.LockTimeRange;return e=parseInt(Math.floor(e/Vg)),this.sequenceNumber=e|jg,this};bt.prototype.lockUntilBlockHeight=function(e){if(pl.checkArgument(nd.isNumber(e)),e<0||e>=WC)throw new cc.Transaction.Input.BlockHeightOutOfRange;return this.sequenceNumber=e,this};bt.prototype.getLockTime=function(){if(this.sequenceNumber&jC)return null;if(this.sequenceNumber&jg){var e=Vg*(this.sequenceNumber&zg);return e}else{var t=this.sequenceNumber&zg;return t}};N3.exports=bt});var uc=X((YZ,C3)=>{"use strict";var _n=xt(),KC=no(),ad=Yt(),B3=Rr(),M3=jn(),GC=Yi(),hl=di();function Wn(e){if(!(this instanceof Wn))return new Wn(e);if(e instanceof Wn)return e;if(e&&typeof e=="object")return this._fromObject(e);throw new GC.InvalidArgument("TransactionSignatures must be instantiated from an object")}KC(Wn,hl);Wn.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new M3(e.publicKey),this.prevTxId=ad.isBuffer(e.prevTxId)?e.prevTxId:Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof hl?e.signature:ad.isBuffer(e.signature)?hl.fromBuffer(e.signature):hl.fromString(e.signature),this.sigtype=e.sigtype,this};Wn.prototype._checkObjectArgs=function(e){_n.checkArgument(M3(e.publicKey),"invalid publicKey"),_n.checkArgument(e.inputIndex!=null,"missing inputIndex"),_n.checkArgument(e.outputIndex!=null,"missing outputIndex"),_n.checkState(!isNaN(e.inputIndex),"inputIndex must be a number"),_n.checkState(!isNaN(e.outputIndex),"outputIndex must be a number"),_n.checkArgument(e.signature,"missing signature"),_n.checkArgument(e.prevTxId,"missing prevTxId"),_n.checkState(e.signature instanceof hl||ad.isBuffer(e.signature)||B3.isHexa(e.signature),"signature must be a buffer or hexa value"),_n.checkState(ad.isBuffer(e.prevTxId)||B3.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),_n.checkArgument(e.sigtype!=null,"missing sigtype"),_n.checkState(!isNaN(e.sigtype),"sigtype must be a number")};Wn.prototype.toObject=Wn.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};Wn.fromObject=function(e){return _n.checkArgument(e),new Wn(e)};C3.exports=Wn});var F3=X((XZ,q3)=>{"use strict";var $C=no(),L3=xt(),ZZ=Yt(),U3=Eu(),YC=xs(),ZC=fa(),D3=Li(),XC=di(),JC=uc();function la(){U3.apply(this,arguments)}$C(la,U3);la.prototype.getSignatures=function(e,t,r,i,n,o){L3.checkState(this.output instanceof YC),i=i||XC.SIGHASH_ALL,o=o||"ecdsa";var u=t.toPublicKey();return u.toString()===this.output.script.getPublicKey().toString("hex")?[new JC({publicKey:u,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:ZC.sign(e,t,i,r,this.output.script),sigtype:i})]:[]};la.prototype.addSignature=function(e,t,r){return L3.checkState(this.isValidSignature(e,t,r),"Signature is invalid"),this.setScript(D3.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};la.prototype.clearSignatures=function(){return this.setScript(D3.empty()),this};la.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};la.SCRIPT_MAX_SIZE=73;la.prototype._estimateSize=function(){return this._getBaseSize()+la.SCRIPT_MAX_SIZE};q3.exports=la});var Kg=X((QZ,j3)=>{"use strict";var QC=no(),H3=xt(),od=Yt(),JZ=Vn(),eL=Dr(),z3=Eu(),tL=xs(),V3=fa(),Wg=yu(),rL=ri(),od=Yt(),Iu=Li(),iL=di(),nL=uc();function mi(){z3.apply(this,arguments)}QC(mi,z3);mi.prototype.getRedeemScript=function(e){if(!this.redeemScript){var t=Iu.buildWitnessV0Out(e);if(Iu.buildScriptHashOut(t).equals(this.output.script)){var r=new Iu;r.add(t.toBuffer()),this.setScript(r),this.redeemScript=t}}return this.redeemScript};mi.prototype.getScriptCode=function(e){var t=new rL,r;this.output.script.isScriptHashOut()?r=this.getRedeemScript(e):r=this.output.script;var i=Iu.buildPublicKeyHashOut(r.toAddress()).toBuffer();return t.writeVarintNum(i.length),t.write(i),t.toBuffer()};mi.prototype.getSighash=function(e,t,r,i){var n=this.getScriptCode(t),o=this.getSatoshisBuffer();return Wg.sighash(e,i,r,n,o)};mi.prototype.getSignatures=function(e,t,r,i,n,o,u){H3.checkState(this.output instanceof tL),n=n||eL.sha256ripemd160(t.publicKey.toBuffer()),i=i||iL.SIGHASH_ALL,o=o||"ecdsa";var m;if(this.output.script.isScriptHashOut()?m=this.getRedeemScript(t.publicKey):m=this.output.script,m&&od.equals(n,m.getPublicKeyHash())){var _;if(m.isWitnessPublicKeyHashOut()){var w=this.getSatoshisBuffer(),I=this.getScriptCode(t.publicKey);_=Wg.sign(e,t,i,r,I,w)}else _=V3.sign(e,t,i,r,this.output.script);return[new nL({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:_,sigtype:i})]}return[]};mi.prototype.addSignature=function(e,t,r){return H3.checkState(this.isValidSignature(e,t,r),"Signature is invalid"),this.output.script.isWitnessPublicKeyHashOut()||this.output.script.isScriptHashOut()?this.setWitnesses([od.concat([t.signature.toDER(),od.integerAsSingleByteBuffer(t.sigtype)]),t.publicKey.toBuffer()]):this.setScript(Iu.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};mi.prototype.clearSignatures=function(){return this.setScript(Iu.empty()),this.setWitnesses([]),this};mi.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()||this.hasWitnesses()};mi.prototype.isValidSignature=function(e,t,r){if(r=r||"ecdsa",t.signature.nhashtype=t.sigtype,this.output.script.isWitnessPublicKeyHashOut()||this.output.script.isScriptHashOut()){var i=this.getScriptCode(),n=this.getSatoshisBuffer();return Wg.verify(e,t.signature,t.publicKey,t.inputIndex,i,n)}else return V3.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)};mi.SCRIPT_MAX_SIZE=107;mi.REDEEM_SCRIPT_SIZE=23;mi.prototype._estimateSize=function(){let e=this._getBaseSize();e+=1;let r=mi.SCRIPT_MAX_SIZE/4;return this.output.script.isWitnessPublicKeyHashOut()?e+=r:this.output.script.isScriptHashOut()?e+=r+mi.REDEEM_SCRIPT_SIZE:e+=mi.SCRIPT_MAX_SIZE,e};j3.exports=mi});var $3=X((rX,G3)=>{"use strict";var Kn=Et(),sL=no(),eX=cd(),$g=Eu(),aL=xs(),dl=xt(),K3=Li(),Gg=di(),Yg=fa(),tX=jn(),W3=Yt(),Zg=uc();function Pr(e,t,r,i,n){n=n||{},$g.apply(this,arguments);var o=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,n.noSorting?this.publicKeys=t:this.publicKeys=Kn.sortBy(t,function(u){return u.toString("hex")}),dl.checkState(K3.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},Kn.each(this.publicKeys,function(u,m){o.publicKeyIndex[u.toString()]=m}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}sL(Pr,$g);Pr.prototype.toObject=function(){var e=$g.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=Kn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Pr.prototype._deserializeSignatures=function(e){return Kn.map(e,function(t){if(t)return new Zg(t)})};Pr.prototype._serializeSignatures=function(){return Kn.map(this.signatures,function(e){if(e)return e.toObject()})};Pr.prototype.getSignatures=function(e,t,r,i,n,o,u){dl.checkState(this.output instanceof aL),i=i||Gg.SIGHASH_ALL,o=o||"ecdsa";let m=[];for(let _ of this.publicKeys||[])_.toString()===t.publicKey.toString()&&m.push(new Zg({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:Yg.sign(e,t,i,r,this.output.script),sigtype:i}));return m};Pr.prototype.addSignature=function(e,t,r){return dl.checkState(!this.isFullySigned(),"All needed signatures have already been added"),dl.checkArgument(!Kn.isUndefined(this.publicKeyIndex[t.publicKey.toString()],"Signature Undefined"),"Signature has no matching public key"),dl.checkState(this.isValidSignature(e,t,r),"Invalid Signature"),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Pr.prototype._updateScript=function(){return this.setScript(K3.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Pr.prototype._createSignatures=function(){return Kn.map(Kn.filter(this.signatures,function(e){return!Kn.isUndefined(e)}),function(e){return W3.concat([e.signature.toDER(),W3.integerAsSingleByteBuffer(e.sigtype)])})};Pr.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Pr.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Pr.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Pr.prototype.countSignatures=function(){return Kn.reduce(this.signatures,function(e,t){return e+!!t},0)};Pr.prototype.publicKeysWithoutSignature=function(){var e=this;return Kn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Pr.prototype.isValidSignature=function(e,t,r){return r=r||"ecdsa",t.signature.nhashtype=t.sigtype,Yg.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)};Pr.normalizeSignatures=function(e,t,r,i,n,o){return o=o||"ecdsa",n.map(function(u){var m=null;return i=i.filter(function(_){if(m)return!0;var w=new Zg({signature:Gg.fromTxFormat(_),publicKey:u,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:Gg.SIGHASH_ALL});w.signature.nhashtype=w.sigtype;var I=Yg.verify(e,w.signature,w.publicKey,w.inputIndex,t.output.script);return I?(m=w,!1):!0}),m||null})};Pr.OPCODES_SIZE=1;Pr.SIGNATURE_SIZE=73;Pr.prototype._estimateSize=function(){return this._getBaseSize()+Pr.OPCODES_SIZE+this.threshold*Pr.SIGNATURE_SIZE};G3.exports=Pr});var J3=X((iX,X3)=>{"use strict";var oL=Et(),cL=no(),Xg=Eu(),uL=xs(),ud=xt(),oo=Vn(),Tu=Li(),fL=di(),Jg=fa(),Qg=yu(),lL=ri(),Y3=Yt(),Z3=uc();function Jt(e,t,r,i,n){n=n||{},Xg.apply(this,arguments),t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,n.noSorting?this.publicKeys=t:this.publicKeys=oL.sortBy(t,function(m){return m.toString("hex")}),this.redeemScript=Tu.buildMultisigOut(this.publicKeys,r,n);var o=Tu.buildWitnessMultisigOutFromScript(this.redeemScript);if(o.equals(this.output.script))this.nestedWitness=!1,this.type=oo.PayToWitnessScriptHash;else if(Tu.buildScriptHashOut(o).equals(this.output.script))this.nestedWitness=!0,this.type=oo.PayToScriptHash;else if(Tu.buildScriptHashOut(this.redeemScript).equals(this.output.script))this.nestedWitness=!1,this.type=oo.PayToScriptHash;else throw new Error("Provided public keys don't hash to the provided output");if(this.nestedWitness){var u=new Tu;u.add(o.toBuffer()),this.setScript(u)}this.publicKeyIndex={};for(let m=0;m<this.publicKeys.length;m++){let _=this.publicKeys[m];this.publicKeyIndex[_.toString()]=m}this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}cL(Jt,Xg);Jt.prototype.toObject=function(){var e=Xg.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=this.publicKeys.map(function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Jt.prototype._deserializeSignatures=function(e){return e.map(function(t){if(t)return new Z3(t)})};Jt.prototype._serializeSignatures=function(){return this.signatures.map(function(e){if(e)return e.toObject()})};Jt.prototype.getScriptCode=function(){var e=new lL;if(this.redeemScript.hasCodeseparators())throw new Error("@TODO");var t=this.redeemScript.toBuffer();return e.writeVarintNum(t.length),e.write(t),e.toBuffer()};Jt.prototype.getSighash=function(e,t,r,i){var n;if(this.nestedWitness||this.type===oo.PayToWitnessScriptHash){var o=this.getScriptCode(),u=this.getSatoshisBuffer();n=Qg.sighash(e,i,r,o,u)}else n=Jg.sighash(e,i,r,this.redeemScript);return n};Jt.prototype.getSignatures=function(e,t,r,i,n,o,u){ud.checkState(this.output instanceof uL),i=i||fL.SIGHASH_ALL,o=o||"ecdsa";let m=[];for(let T of this.publicKeys)if(T.toString()===t.publicKey.toString()){var _;if(this.nestedWitness||this.type===oo.PayToWitnessScriptHash){var w=this.getScriptCode(),I=this.getSatoshisBuffer();_=Qg.sign(e,t,i,r,w,I)}else _=Jg.sign(e,t,i,r,this.redeemScript);m.push(new Z3({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:_,sigtype:i}))}return m};Jt.prototype.addSignature=function(e,t,r){return ud.checkState(!this.isFullySigned(),"All needed signatures have already been added"),ud.checkArgument(this.publicKeyIndex[t.publicKey.toString()]!=null,"Signature has no matching public key"),ud.checkState(this.isValidSignature(e,t,r),"Invalid Signature!"),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Jt.prototype._updateScript=function(){if(this.nestedWitness||this.type===oo.PayToWitnessScriptHash){for(var e=[Buffer.alloc(0)],t=this._createSignatures(),r=0;r<t.length;r++)e.push(t[r]);e.push(this.redeemScript.toBuffer()),this.setWitnesses(e)}else{var i=Tu.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript});this.setScript(i)}return this};Jt.prototype._createSignatures=function(){return this.signatures.filter(function(e){return e!=null}).map(function(e){return Y3.concat([e.signature.toDER(),Y3.integerAsSingleByteBuffer(e.sigtype)])})};Jt.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Jt.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Jt.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Jt.prototype.countSignatures=function(){return this.signatures.reduce(function(e,t){return e+!!t},0)};Jt.prototype.publicKeysWithoutSignature=function(){return this.publicKeys.filter(e=>!this.signatures[this.publicKeyIndex[e.toString()]])};Jt.prototype.isValidSignature=function(e,t,r){if(r=r||"ecdsa",this.nestedWitness||this.type===oo.PayToWitnessScriptHash){t.signature.nhashtype=t.sigtype;var i=this.getScriptCode(),n=this.getSatoshisBuffer();return Qg.verify(e,t.signature,t.publicKey,t.inputIndex,i,n)}else return t.signature.nhashtype=t.sigtype,Jg.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)};Jt.MAX_OPCODES_SIZE=8;Jt.MAX_SIGNATURE_SIZE=74;Jt.MAX_PUBKEY_SIZE=34;Jt.REDEEM_SCRIPT_SIZE=34;Jt.prototype._estimateSize=function(){let e=this._getBaseSize(),t=4,r=Jt.MAX_OPCODES_SIZE+this.threshold*Jt.MAX_SIGNATURE_SIZE+this.publicKeys.length*Jt.MAX_PUBKEY_SIZE;return this.type===oo.PayToWitnessScriptHash?e+=r/t:this.nestedWitness?e+=r/t+Jt.REDEEM_SCRIPT_SIZE:e+=r,e};X3.exports=Jt});var iI=X((sX,rI)=>{var pL=no(),ex=xt(),Q3=Kg(),eI=rd(),fd=di(),hL=uc(),tI=xs(),nX=ao();function pa(){Q3.apply(this,arguments)}pL(pa,Q3);pa.prototype.getSignatures=function(e,t,r,i,n,o,u){ex.checkState(this.output instanceof tI),i=i||fd.SIGHASH_DEFAULT;let m=e.inputs.indexOf(this),_=t.createTapTweak(u).tweakedPrivKey,w=eI.sign(e,_,i,m,fd.Version.TAPROOT,null);if(!w)return[];let I=new hL({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:m,signature:fd.fromSchnorr(w),sigtype:i});return this.isValidSignature(e,I)?[I]:[]};pa.prototype.isValidSignature=function(e,t){return ex.checkState(e.inputs.indexOf(this)>=0,"Signature has no matching input"),ex.checkState(this.output instanceof tI,"output is not instance of Output"),this.output.script.isTaproot()?eI.verify(e,t.signature,this.output.script.chunks[1].buf,fd.Version.TAPROOT,e.inputs.indexOf(this),null):!1};pa.prototype.isFullySigned=function(){return this.output.script.isTaproot()&&this.hasWitnesses()};pa.prototype.addSignature=function(e,t){return this.isValidSignature(e,t)&&this.setWitnesses([t.signature.toBuffer()]),this};pa.SCRIPT_MAX_SIZE=66;pa.prototype._estimateSize=function(){let e=this._getBaseSize();e+=1;let r=pa.SCRIPT_MAX_SIZE/4;return e+=r,e};rI.exports=pa});var ld=X((aX,fc)=>{fc.exports=Eu();fc.exports.PublicKey=F3();fc.exports.PublicKeyHash=Kg();fc.exports.MultiSig=$3();fc.exports.MultiSigScriptHash=J3();fc.exports.Taproot=iI()});var fa=X((oX,aI)=>{"use strict";var ml=di(),tx=Li(),dL=xs(),mL=gs(),vL=ri(),gL=Xr(),xL=Dr(),sI=fl(),nI=xt(),rx=Et(),bL="0000000000000000000000000000000000000000000000000000000000000001",_L="ffffffffffffffff",ix=function(t,r,i,n){var o=cd(),u=ld();i=parseInt(i);var m,_=o.shallowCopy(t);for(n=new tx(n),n.removeCodeseparators(),m=0;m<_.inputs.length;m++)_.inputs[m]=new u(_.inputs[m]).setScript(tx.empty());if(_.inputs[i]=new u(_.inputs[i]).setScript(n),(r&31)===ml.SIGHASH_NONE||(r&31)===ml.SIGHASH_SINGLE)for(m=0;m<_.inputs.length;m++)m!==i&&(_.inputs[m].sequenceNumber=0);if((r&31)===ml.SIGHASH_NONE)_.outputs=[];else if((r&31)===ml.SIGHASH_SINGLE){if(i>=_.outputs.length)return Buffer.from(bL,"hex");for(_.outputs.length=i+1,m=0;m<i;m++)_.outputs[m]=new dL({satoshis:gL.fromBuffer(Buffer.from(_L,"hex")),script:tx.empty()})}r&ml.SIGHASH_ANYONECANPAY&&(_.inputs=[_.inputs[i]]);var w=new vL().write(_.toBuffer()).writeInt32LE(r).toBuffer(),I=xL.sha256sha256(w);return I=new mL(I).readReverse(),I};function yL(e,t,r,i,n){let o=ix(e,r,i,n),u=sI.sign(o,t,{endian:"little"});return u.nhashtype=r,u}function wL(e,t,r,i,n){nI.checkArgument(!rx.isUndefined(e),"Transaction Undefined"),nI.checkArgument(!rx.isUndefined(t)&&!rx.isUndefined(t.nhashtype),"Signature Undefined");let o=ix(e,t.nhashtype,i,n);return sI.verify(o,t,r,{endian:"little"})}aI.exports={sighash:ix,sign:yL,verify:wL}});var hd=X((cX,oI)=>{"use strict";var nx=Et(),pd=Yi(),SL=xt(),lc={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function ot(e,t){if(!(this instanceof ot))return new ot(e,t);if(nx.isNumber(t)){if(t<=0)throw new pd.Unit.InvalidRate(t);e=e/t,t=ot.BTC}this._value=this._from(e,t);var r=this,i=function(n){Object.defineProperty(r,n,{get:function(){return r.to(n)},enumerable:!0})};Object.keys(lc).forEach(i)}Object.keys(lc).forEach(function(e){ot[e]=e});ot.fromObject=function(t){return SL.checkArgument(nx.isObject(t),"Argument is expected to be an object"),new ot(t.amount,t.code)};ot.fromBTC=function(e){return new ot(e,ot.BTC)};ot.fromMillis=ot.fromMilis=function(e){return new ot(e,ot.mBTC)};ot.fromMicros=ot.fromBits=function(e){return new ot(e,ot.bits)};ot.fromSatoshis=function(e){return new ot(e,ot.satoshis)};ot.fromFiat=function(e,t){return new ot(e,t)};ot.prototype._from=function(e,t){if(!lc[t])throw new pd.Unit.UnknownCode(t);return parseInt((e*lc[t][0]).toFixed())};ot.prototype.to=function(e){if(nx.isNumber(e)){if(e<=0)throw new pd.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!lc[e])throw new pd.Unit.UnknownCode(e);var t=this._value/lc[e][0];return parseFloat(t.toFixed(lc[e][1]))};ot.prototype.toBTC=function(){return this.to(ot.BTC)};ot.prototype.toMillis=ot.prototype.toMilis=function(){return this.to(ot.mBTC)};ot.prototype.toMicros=ot.prototype.toBits=function(){return this.to(ot.bits)};ot.prototype.toSatoshis=function(){return this.to(ot.satoshis)};ot.prototype.atRate=function(e){return this.to(e)};ot.prototype.toString=function(){return this.satoshis+" satoshis"};ot.prototype.toObject=ot.prototype.toJSON=function(){return{amount:this.BTC,code:ot.BTC}};ot.prototype.inspect=function(){return"<Unit: "+this.toString()+">"};oI.exports=ot});var sx=X((uX,fI)=>{"use strict";var ha=Et(),dd=xt(),cI=Rr(),EL=Li(),IL=Vn(),uI=hd();function da(e){if(!(this instanceof da))return new da(e);dd.checkArgument(ha.isObject(e),"Must provide an object from where to extract data");var t=e.address?new IL(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!cI.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=ha.isUndefined(e.vout)?e.outputIndex:e.vout;if(!ha.isNumber(i))throw new Error("Invalid outputIndex, received "+i);dd.checkArgument(!ha.isUndefined(e.scriptPubKey)||!ha.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new EL(e.scriptPubKey||e.script);dd.checkArgument(!ha.isUndefined(e.amount)||!ha.isUndefined(e.satoshis),"Must provide an amount for the output");var o=ha.isUndefined(e.amount)?e.satoshis:new uI.fromBTC(e.amount).toSatoshis();dd.checkArgument(ha.isNumber(o),"Amount must be a number"),cI.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}da.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};da.prototype.toString=function(){return this.txId+":"+this.outputIndex};da.fromObject=function(e){return new da(e)};da.prototype.toObject=da.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:uI.fromSatoshis(this.satoshis).toBTC()}};fI.exports=da});var cd=X((fX,mI)=>{"use strict";var uo=Et(),vr=xt(),TL=require("buffer"),lI=Buffer.compare||E3(),Gr=Yi(),RL=Yt(),vd=Rr(),ax=gs(),Au=ri(),ox=Dr(),Ru=di(),AL=fa(),OL=yu(),kL=rd(),PL=Vn(),pI=sx(),wr=ld(),NL=wr.PublicKeyHash,BL=wr.PublicKey,ML=wr.MultiSigScriptHash,CL=wr.MultiSig,LL=wr.Taproot,fo=xs(),co=Li(),UL=ao(),md=Xr();function ie(e,t){if(!(this instanceof ie))return new ie(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof ie)return ie.shallowCopy(e);if(vd.isHexa(e))this.fromString(e);else if(RL.isBuffer(e))this.fromBuffer(e);else if(uo.isObject(e))this.fromObject(e,t);else throw new Gr.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var hI=2,DL=0,qL=1e6;ie.DUST_AMOUNT=546;ie.FEE_SECURITY_MARGIN=150;ie.MAX_MONEY=21e6*1e8;ie.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;ie.NLOCKTIME_MAX_VALUE=4294967295;ie.FEE_PER_KB=1e5;ie.CHANGE_OUTPUT_MAX_SIZE=62;ie.MAXIMUM_EXTRA_SIZE=26;ie.shallowCopy=function(e){var t=new ie(e.toBuffer());return t};var dI={configurable:!1,enumerable:!0,get:function(){return this._hash=new ax(this._getHash()).readReverse().toString("hex"),this._hash}},FL={configurable:!1,enumerable:!0,get:function(){return new ax(this._getWitnessHash()).readReverse().toString("hex")}};Object.defineProperty(ie.prototype,"witnessHash",FL);Object.defineProperty(ie.prototype,"hash",dI);Object.defineProperty(ie.prototype,"id",dI);var cx={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(ie.prototype,"inputAmount",cx);cx.get=function(){return this._getOutputAmount()};Object.defineProperty(ie.prototype,"outputAmount",cx);Object.defineProperty(ie.prototype,"size",{configurable:!1,enumerable:!1,get:function(){return this._calculateSize()}});Object.defineProperty(ie.prototype,"vsize",{configurable:!1,enumerable:!1,get:function(){return this._calculateVSize()}});Object.defineProperty(ie.prototype,"weight",{configurable:!1,enumerable:!1,get:function(){return this._calculateWeight()}});ie.prototype._getHash=function(){return ox.sha256sha256(this.toBuffer(!0))};ie.prototype._getWitnessHash=function(){return ox.sha256sha256(this.toBuffer(!1))};ie.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};ie.prototype.uncheckedSerialize=ie.prototype.toString=function(){return this.toBuffer().toString("hex")};ie.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://github.com/bitpay/bitcore/blob/master/packages/bitcore-lib/docs/transaction.md#serialization-checks",t;return this.uncheckedSerialize()};ie.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};ie.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Gr.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Gr.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};ie.prototype._hasFeeError=function(e,t){if(this._fee!=null&&this._fee!==t)return new Gr.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(ie.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Gr.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Gr.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}if(!e.disableSmallFees){var i=Math.ceil(this._estimateFee()/ie.FEE_SECURITY_MARGIN);if(t<i)return new Gr.Transaction.FeeError.TooSmall("expected more than "+i+" but got "+t)}};ie.prototype._missingChange=function(){return!this._changeScript};ie.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<ie.DUST_AMOUNT&&!r.script.isDataOut())return new Gr.Transaction.DustOutputs}};ie.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Gr.Transaction.MissingSignatures};ie.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};ie.prototype.toBuffer=function(e){var t=new Au;return this.toBufferWriter(t,e).toBuffer()};ie.prototype.hasWitnesses=function(){for(var e=0;e<this.inputs.length;e++)if(this.inputs[e].hasWitnesses())return!0;return!1};ie.prototype.toBufferWriter=function(e,t){e.writeInt32LE(this.version);let r=this.hasWitnesses();r&&!t&&e.write(Buffer.from("0001","hex")),e.writeVarintNum(this.inputs?this.inputs.length:0);for(let i of this.inputs||[])i.toBufferWriter(e);e.writeVarintNum(this.outputs?this.outputs.length:0);for(let i of this.outputs||[])i.toBufferWriter(e);if(r&&!t)for(let i of this.inputs){let n=i.getWitnesses();e.writeVarintNum(n.length);for(let o=0;o<n.length;o++)e.writeVarintNum(n[o].length),e.write(n[o])}return e.writeUInt32LE(this.nLockTime),e};ie.prototype.fromBuffer=function(e){var t=new ax(e);return this.fromBufferReader(t)};ie.prototype.fromBufferReader=function(e){vr.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readInt32LE();var t=e.readVarintNum(),r=!1;t===0&&e.buf[e.pos]!==0&&(e.pos+=1,r=!0,t=e.readVarintNum());for(var i=0;i<t;i++){var n=wr.fromBufferReader(e);this.inputs.push(n)}for(var o=e.readVarintNum(),u=0;u<o;u++)this.outputs.push(fo.fromBufferReader(e));if(r)for(var m=0;m<t;m++){for(var _=e.readVarintNum(),w=[],I=0;I<_;I++){var T=e.readVarintNum(),N=e.read(T);w.push(N)}this.inputs[m].setWitnesses(w)}return this.nLockTime=e.readUInt32LE(),this};ie.prototype.toObject=ie.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),this._changeIndex!=null&&(i.changeIndex=this._changeIndex),this._fee!=null&&(i.fee=this._fee),i};ie.prototype.fromObject=function(t,r){vr.checkArgument(uo.isObject(t)||t instanceof ie);var i;t instanceof ie?i=t.toObject():i=t;for(let u of i.inputs||[]){if(!u.output||!u.output.script){this.uncheckedAddInput(new wr(u));continue}var n=new co(u.output.script),o;if((n.isScriptHashOut()||n.isWitnessScriptHashOut())&&u.publicKeys&&u.threshold)o=new wr.MultiSigScriptHash(u,u.publicKeys,u.threshold,u.signatures,r);else if(n.isPublicKeyHashOut()||n.isWitnessPublicKeyHashOut()||n.isScriptHashOut())o=new wr.PublicKeyHash(u);else if(n.isPublicKeyOut())o=new wr.PublicKey(u);else throw new Gr.Transaction.Input.UnsupportedScript(u.output.script);this.addInput(o)}for(let u of i.outputs||[])this.addOutput(new fo(u));return i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new co(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};ie.prototype._checkConsistency=function(e){this._changeIndex!=null&&(vr.checkState(this._changeScript,"Change script is expected."),vr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),vr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&vr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};ie.prototype.lockUntilDate=function(e){if(vr.checkArgument(e),!isNaN(e)&&e<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Gr.Transaction.LockTimeTooEarly;uo.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===wr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=wr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.lockUntilBlockHeight=function(e){if(vr.checkArgument(!isNaN(e)),e>=ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Gr.Transaction.BlockHeightTooHigh;if(e<0)throw new Gr.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===wr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=wr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};ie.prototype.fromString=function(e){this.fromBuffer(TL.Buffer.from(e,"hex"))};ie.prototype._newTransaction=function(){this.version=hI,this.nLockTime=DL};ie.prototype.from=function(e,t,r,i){if(Array.isArray(e)){for(let o of e)this.from(o,t,r,i);return this}return this.inputs.some(function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex})?this:(t&&r?this._fromMultisigUtxo(e,t,r,i):this._fromNonP2SH(e,i),this)};ie.prototype.associateInputs=function(e,t,r,i={}){let n=[];for(let o of e){let u=this.inputs.findIndex(m=>m.prevTxId.toString("hex")===o.txId&&m.outputIndex===o.outputIndex);if(n.push(u),u>=0){let m=this.inputs[u].sequenceNumber;this.inputs[u]=this._getInputFrom(o,t,r,i),this.inputs[u].sequenceNumber=m}}return n};ie.prototype._selectInputType=function(e,t,r){var i;return e=new pI(e),t&&r?e.script.isMultisigOut()?i=CL:(e.script.isScriptHashOut()||e.script.isWitnessScriptHashOut())&&(i=ML):e.script.isPublicKeyHashOut()||e.script.isWitnessPublicKeyHashOut()||e.script.isScriptHashOut()?i=NL:e.script.isTaproot()?i=LL:e.script.isPublicKeyOut()?i=BL:i=wr,i};ie.prototype._getInputFrom=function(e,t,r,i={}){e=new pI(e);let n=this._selectInputType(e,t,r),o={output:new fo({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,sequenceNumber:i.sequenceNumber,script:co.empty()},u=t&&r?[t,r,!1,i]:[];return new n(o,...u)};ie.prototype._fromNonP2SH=function(e,t){let r=this._getInputFrom(e,null,null,t);this.addInput(r)};ie.prototype._fromMultisigUtxo=function(e,t,r,i){vr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");let n=this._getInputFrom(e,t,r,i);this.addInput(n)};ie.prototype.addInput=function(e,t,r){if(vr.checkArgumentType(e,wr,"input"),!e.output&&(t==null||r==null))throw new Gr.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&r!=null&&(t=t instanceof co?t:new co(t),vr.checkArgumentType(r,"number","satoshis"),e.output=new fo({script:t,satoshis:r})),this.uncheckedAddInput(e)};ie.prototype.uncheckedAddInput=function(e){return vr.checkArgumentType(e,wr,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};ie.prototype.hasAllUtxoInfo=function(){return this.inputs.every(function(e){return!!e.output})};ie.prototype.fee=function(e){return vr.checkArgument(!isNaN(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};ie.prototype.feePerKb=function(e){return vr.checkArgument(!isNaN(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};ie.prototype.feePerByte=function(e){return vr.checkArgument(!isNaN(e),"amount must be a number"),this._feePerByte=e,this._updateChangeOutput(),this};ie.prototype.change=function(e){return vr.checkArgument(e,"address is required"),this._changeScript=co.fromAddress(e),this._updateChangeOutput(),this};ie.prototype.getChangeOutput=function(){return this._changeIndex!=null?this.outputs[this._changeIndex]:null};ie.prototype.to=function(e,t){if(Array.isArray(e)){for(let r of e)this.to(r.address,r.satoshis);return this}return vr.checkArgument(vd.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new fo({script:co(new PL(e)),satoshis:t})),this};ie.prototype.addData=function(e){return this.addOutput(new fo({script:co.buildDataOut(e),satoshis:0})),this};ie.prototype.addOutput=function(e){return vr.checkArgumentType(e,fo,"output"),this._addOutput(e),this._updateChangeOutput(),this};ie.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};ie.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};ie.prototype._getOutputAmount=function(){if(this._outputAmount==null){var e=this;this._outputAmount=0;for(let t of this.outputs||[])e._outputAmount+=t.satoshis}return this._outputAmount};ie.prototype._getInputAmount=function(){return this._inputAmount==null&&(this._inputAmount=uo.sumBy(this.inputs,function(e){if(e.output==null)throw new Gr.Transaction.Input.MissingPreviousOutput;return e.output.satoshis})),this._inputAmount};ie.prototype._updateChangeOutput=function(e){if(this._changeScript){e||this._clearSignatures(),this._changeIndex!=null&&this._removeOutput(this._changeIndex);var t=this._getUnspentValue(),r=this.getFee(),i=t-r;i>ie.DUST_AMOUNT?(this._changeIndex=this.outputs.length,this._addOutput(new fo({script:this._changeScript,satoshis:i}))):this._changeIndex=void 0}};ie.prototype.getFee=function(){return this.isCoinbase()?0:this._fee!=null?this._fee:this._changeScript?this._estimateFee():this._getUnspentValue()};ie.prototype._estimateFee=function(){let e=this._estimateSize(),t=this._getUnspentValue(),r=this._feePerByte||(this._feePerKb||ie.FEE_PER_KB)/1e3;function i(u){return u*r}let n=Math.ceil(i(e)),o=Math.ceil(i(e)+i(this._estimateSizeOfChangeOutput()));return!this._changeScript||t<=o?n:o};ie.prototype._estimateSizeOfChangeOutput=function(){if(!this._changeScript)return 0;let e=this._changeScript.toBuffer().length;return 8+Au.varintBufNum(e).length+e};ie.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};ie.prototype._clearSignatures=function(){for(let e of this.inputs||[])e.clearSignatures()};ie.prototype._estimateSize=function(){let e=4;this.hasWitnesses()&&(e+=.5),e+=Au.varintBufNum(this.inputs.length).length;for(let t of this.inputs||[])e+=t._estimateSize();e+=Au.varintBufNum(this.outputs.length).length;for(let t of this.outputs||[])e+=t.calculateSize();return e+=4,Math.ceil(e)};ie.prototype._calculateSize=function(){return this.toBuffer().length};ie.prototype._calculateVSize=function(e){let t=this._calculateWeight()/4;return e?t:Math.ceil(t)};ie.prototype._calculateWeight=function(){return this.toBuffer(!0).length*3+this.toBuffer(!1).length};ie.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=uo.without(this.outputs,t),this._outputAmount=void 0};ie.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};ie.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);let r=0;return t.forEach(i=>{i.i=r++}),t.sort(function(i,n){return lI(i.prevTxId,n.prevTxId)||i.outputIndex-n.outputIndex||i.i-n.i}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);let r=0;return t.forEach(i=>{i.i=r++}),t.sort(function(i,n){return i.satoshis-n.satoshis||lI(i.script.toBuffer(),n.script.toBuffer())||i.i-n.i}),t}),this};ie.prototype.shuffleOutputs=function(){return this.sortOutputs(uo.shuffle)};ie.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};ie.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};ie.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||uo.difference(this.outputs,e).length!==0;if(t)throw new Gr.Transaction.InvalidSorting;if(this._changeIndex!=null){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};ie.prototype.removeInput=function(e,t){var r;if(!t&&!isNaN(e)?r=e:r=this.inputs.findIndex(function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Gr.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=uo.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};ie.prototype.sign=function(e,t,r,i){if(vr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction."),Array.isArray(e)){for(let n of e)this.sign(n,t,r,i);return this}for(let n of this.getSignatures(e,t,r,i))this.applySignature(n,r);return this};ie.prototype.getSignatures=function(e,t,r,i){typeof i=="string"&&(i=Buffer.from(i,"hex")),e=new UL(e);let n=[],o=ox.sha256ripemd160(e.publicKey.toBuffer());for(let u=0;u<this.inputs.length;u++){let m=this.inputs[u];for(let _ of m.getSignatures(this,e,u,t,o,r,i))n.push(_)}return n};ie.prototype.applySignature=function(e,t){return this.inputs[e.inputIndex].addSignature(this,e,t),this};ie.prototype.isFullySigned=function(){for(let e of this.inputs||[])if(e.isFullySigned===wr.prototype.isFullySigned)throw new Gr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs.every(function(e){return e.isFullySigned()})};ie.prototype.isValidSignature=function(e,t){if(this.inputs[e.inputIndex].isValidSignature===wr.prototype.isValidSignature)throw new Gr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e,t)};ie.prototype.checkEcdsaSignature=function(e,t,r,i,n){var o=i.toBuffer(),u=new Au;u.writeVarintNum(o.length),u.write(o);var m;n?(vr.checkState(vd.isNaturalNumber(n),"satoshis needs to be a natural number"),m=new Au().writeUInt64LEBN(new md(n)).toBuffer()):m=this.inputs[r].getSatoshisBuffer();var _=OL.verify(this,e,t,r,u.toBuffer(),m);return _};ie.prototype.checkSchnorrSignature=function(e,t,r,i,n){if(vr.isType(t,"PublicKey")&&(t=t.point.x.toBuffer()),vr.checkArgument(t&&t.length===32,"Schnorr signatures have 32-byte public keys. The caller is responsible for enforcing this."),Buffer.isBuffer(e)){if(e.length!==64&&e.length!==65)return!1;e=Ru.fromSchnorr(e)}return vr.checkArgument(e.isSchnorr,"Signature must be schnorr"),!!kL.verify(this,e,t,i,r,n)};ie.prototype.verifySignature=function(e,t,r,i,n,o,u){switch(n==null&&(n=Ru.Version.BASE),n){case Ru.Version.WITNESS_V0:return this.checkEcdsaSignature(e,t,r,i,o);case Ru.Version.TAPROOT:case Ru.Version.TAPSCRIPT:return this.checkSchnorrSignature(e,t,r,n,u);case Ru.Version.BASE:default:return AL.verify(this,e,t,r,i)}};ie.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new md(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new md(ie.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new md(ie.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>qL)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(i[o]!=null)return"transaction input "+t+" duplicate input";i[o]=!0}var u=this.isCoinbase();if(u){var m=this.inputs[0]._scriptBuffer;if(m.length<2||m.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};ie.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};ie.prototype.isRBF=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e];if(t.sequenceNumber<wr.MAXINT-1)return!0}return!1};ie.prototype.enableRBF=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e];t.sequenceNumber>=wr.MAXINT-1&&(t.sequenceNumber=wr.DEFAULT_RBF_SEQNUMBER)}return this};ie.prototype.setVersion=function(e){return vr.checkArgument(vd.isNaturalNumber(e)&&e<=hI,"Wrong version number"),this.version=e,this};mI.exports=ie});var vl=X((lX,lo)=>{lo.exports=cd();lo.exports.Input=ld();lo.exports.Output=xs();lo.exports.UnspentOutput=sx();lo.exports.Signature=uc();lo.exports.Sighash=fa();lo.exports.SighashWitness=yu()});var qg=X((pX,gI)=>{"use strict";var Ou=Et(),yn=Pg(),W=Jh(),Fe=Xr(),pc=Dr(),_t=di(),ku=jn(),wn=xt(),HL=yu(),zL=rd(),gd=ri(),vI=ca(),j=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};j.prototype.verifyWitnessProgram=function(e,t,r,i,n,o){var u=new yn,m=[];if(e===0)if(t.length===j.WITNESS_V0_SCRIPTHASH_SIZE){if(r.length===0)return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY",!1;var _=r[r.length-1];u=new yn(_);var w=pc.sha256(_);return w.toString("hex")!==t.toString("hex")?(this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1):(m=r.slice(0,-1),this.executeWitnessScript(u,m,_t.Version.WITNESS_V0,i,n))}else return t.length===j.WITNESS_V0_KEYHASH_SIZE?r.length!==2?(this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1):(u.add(W.OP_DUP),u.add(W.OP_HASH160),u.add(t),u.add(W.OP_EQUALVERIFY),u.add(W.OP_CHECKSIG),m=r,this.executeWitnessScript(u,m,_t.Version.WITNESS_V0,i,n)):(this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH",!1);else if(e===1&&t.length==j.WITNESS_V1_TAPROOT_SIZE&&!o){let I={annexPresent:!1};if(!(n&j.SCRIPT_VERIFY_TAPROOT))return!0;if(m=Array.from(r),m.length==0)return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY",!1;if(m.length>=2&&m[m.length-1].length&&m[m.length-1][0]===yn.ANNEX_TAG){let T=m.pop(),N=new gd;N.writeVarintNum(T.length),N.write(T),I.annexHash=pc.sha256(N.toBuffer()),I.annexPresent=!0}if(I.annexInit=!0,m.length===1)return this.checkSchnorrSignature(m[0],t,_t.Version.TAPROOT,I);{let T=m.pop(),N=m.pop();if(T.length<j.TAPROOT_CONTROL_BASE_SIZE||T.length>j.TAPROOT_CONTROL_MAX_SIZE||(T.length-j.TAPROOT_CONTROL_BASE_SIZE)%j.TAPROOT_CONTROL_NODE_SIZE!=0)return this.errstr="SCRIPT_ERR_TAPROOT_WRONG_CONTROL_SIZE",!1;if(I.tapleafHash=j.computeTapleafHash(T[0]&j.TAPROOT_LEAF_MASK,N),!j.verifyTaprootCommitment(T,t,I.tapleafHash))return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1;if(I.tapleafHashInit=!0,(T[0]&j.TAPROOT_LEAF_MASK)===j.TAPROOT_LEAF_TAPSCRIPT){let C;{let B=new gd;B.writeVarintNum(r.length);for(let U of r)B.writeVarintNum(U.length),B.write(U);C=B.toBuffer().length}try{u=new yn(N)}catch{return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return I.validationWeightLeft=C+yn.VALIDATION_WEIGHT_OFFSET,I.validationWeightLeftInit=!0,this.executeWitnessScript(u,m,_t.Version.TAPSCRIPT,i,n,I)}return n&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION?(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION",!1):!0}}else if(n&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM",!1;return!0};j.prototype.executeWitnessScript=function(e,t,r,i,n,o){if(r===_t.Version.TAPSCRIPT){for(let m of e.chunks)if(W.isOpSuccess(m.opcodenum))return n&j.SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS?(this.errstr="SCRIPT_ERR_DISCOURAGE_OP_SUCCESS",!1):!0;if(t.length>j.MAX_STACK_SIZE)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}if(t.length&&t.some(m=>m.length>j.MAX_SCRIPT_ELEMENT_SIZE))return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(this.initialize(),this.set({script:e,stack:t,sigversion:r,satoshis:i,flags:n,execdata:o}),!this.evaluate())return!1;if(this.stack.length!==1)return this.errstr="SCRIPT_ERR_EVAL_FALSE",!1;var u=this.stack[this.stack.length-1];return j.castToBool(u)?!0:(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1)};j.prototype.verify=function(e,t,r,i,n,o,u){var m=vl();Ou.isUndefined(r)&&(r=new m),Ou.isUndefined(i)&&(i=0),Ou.isUndefined(n)&&(n=0),Ou.isUndefined(o)&&(o=null),Ou.isUndefined(u)&&(u=0),this.set({script:e,tx:r,nin:i,sigversion:_t.Version.BASE,satoshis:0,flags:n});var _;if(n&j.SCRIPT_VERIFY_SIGPUSHONLY&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;n&j.SCRIPT_VERIFY_P2SH&&(_=this.stack.slice());var w=this.stack;if(this.initialize(),this.set({script:t,stack:w,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var I=this.stack[this.stack.length-1];if(!j.castToBool(I))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;var T=!1;if(n&j.SCRIPT_VERIFY_WITNESS){var N={};if(t.isWitnessProgram(N)){if(T=!0,e.toBuffer().length!==0)return this.errstr="SCRIPT_ERR_WITNESS_MALLEATED",!1;if(!this.verifyWitnessProgram(N.version,N.program,o,u,this.flags,!1))return!1}}if(n&j.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(_.length===0)throw new Error("internal error - stack copy empty");var C=_[_.length-1],B=yn.fromBuffer(C);if(_.pop(),this.initialize(),this.set({script:B,stack:_,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(_.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!j.castToBool(_[_.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1;if(n&j.SCRIPT_VERIFY_WITNESS){var U={};if(B.isWitnessProgram(U)){T=!0;var Z=new yn;if(Z.add(B.toBuffer()),e.toHex()!==Z.toHex())return this.errstr="SCRIPT_ERR_WITNESS_MALLEATED_P2SH",!1;if(!this.verifyWitnessProgram(U.version,U.program,o,u,this.flags,!0))return!1;w=[w[0]]}}}if(this.flags&j.SCRIPT_VERIFY_CLEANSTACK){if(!(this.flags&j.SCRIPT_VERIFY_P2SH)||!(this.flags&j.SCRIPT_VERIFY_WITNESS))throw"flags & SCRIPT_VERIFY_P2SH";if(_.length!=1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return this.flags&j.SCRIPT_VERIFY_WITNESS&&!T&&o.length>0?(this.errstr="SCRIPT_ERR_WITNESS_UNEXPECTED",!1):!0};gI.exports=j;j.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.satoshis=0,this.sigversion=_t.Version.BASE,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0,this.execdata={}};j.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin>"u"?this.nin:parseInt(e.nin),this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc>"u"?this.pc:e.pc,this.pbegincodehash=typeof e.pbegincodehash>"u"?this.pbegincodehash:e.pbegincodehash,this.sigversion=typeof e.sigversion>"u"?this.sigversion:e.sigversion,this.satoshis=typeof e.satoshis>"u"?this.satoshis:e.satoshis,this.nOpCount=typeof e.nOpCount>"u"?this.nOpCount:e.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags>"u"?this.flags:e.flags,this.execdata=typeof e.execdata>"u"?this.execdata:e.execdata||{}};j.true=Buffer.from([1]);j.false=Buffer.from([]);j.MAX_SCRIPT_SIZE=1e4;j.MAX_STACK_SIZE=1e3;j.MAX_SCRIPT_ELEMENT_SIZE=520;j.LOCKTIME_THRESHOLD=5e8;j.LOCKTIME_THRESHOLD_BN=new Fe(j.LOCKTIME_THRESHOLD);j.SCRIPT_VERIFY_NONE=0;j.SCRIPT_VERIFY_P2SH=1;j.SCRIPT_VERIFY_STRICTENC=2;j.SCRIPT_VERIFY_DERSIG=4;j.SCRIPT_VERIFY_LOW_S=8;j.SCRIPT_VERIFY_NULLDUMMY=16;j.SCRIPT_VERIFY_SIGPUSHONLY=32;j.SCRIPT_VERIFY_MINIMALDATA=64;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;j.SCRIPT_VERIFY_CLEANSTACK=256,j.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;j.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;j.SCRIPT_VERIFY_WITNESS=2048;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM=4096;j.SCRIPT_VERIFY_MINIMALIF=8192;j.SCRIPT_VERIFY_NULLFAIL=16384;j.SCRIPT_VERIFY_WITNESS_PUBKEYTYPE=32768;j.SCRIPT_ENABLE_SIGHASH_FORKID=65536;j.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;j.SCRIPT_VERIFY_CONST_SCRIPTCODE=65536;j.SCRIPT_VERIFY_TAPROOT=1<<17;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION=1<<18;j.SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS=1<<19;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE=1<<20;j.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;j.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;j.SEQUENCE_LOCKTIME_MASK=65535;j.WITNESS_V0_SCRIPTHASH_SIZE=32;j.WITNESS_V0_KEYHASH_SIZE=20;j.WITNESS_V1_TAPROOT_SIZE=32;j.TAPROOT_LEAF_MASK=254;j.TAPROOT_LEAF_TAPSCRIPT=192;j.TAPROOT_CONTROL_BASE_SIZE=33;j.TAPROOT_CONTROL_NODE_SIZE=32;j.TAPROOT_CONTROL_MAX_NODE_COUNT=128;j.TAPROOT_CONTROL_MAX_SIZE=j.TAPROOT_CONTROL_BASE_SIZE+j.TAPROOT_CONTROL_NODE_SIZE*j.TAPROOT_CONTROL_MAX_NODE_COUNT;j.PROTOCOL_VERSION=70016;j.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};j.prototype.checkSignatureEncoding=function(e){var t;if(e.length==0)return!0;if(this.flags&(j.SCRIPT_VERIFY_DERSIG|j.SCRIPT_VERIFY_LOW_S|j.SCRIPT_VERIFY_STRICTENC)&&!_t.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if(this.flags&j.SCRIPT_VERIFY_LOW_S){if(t=_t.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if(this.flags&j.SCRIPT_VERIFY_STRICTENC&&(t=_t.fromTxFormat(e),!t.hasDefinedHashtype()))return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;return!0};j.prototype.checkPubkeyEncoding=function(e){return this.flags&j.SCRIPT_VERIFY_STRICTENC&&!ku.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):this.flags&j.SCRIPT_VERIFY_WITNESS_PUBKEYTYPE&&this.sigversion==_t.Version.WITNESS_V0&&!ku.fromBuffer(e).compressed?(this.errstr="SCRIPT_ERR_WITNESS_PUBKEYTYPE",!1):!0};j.prototype.checkEcdsaSignature=function(e,t,r,i,n){var o=i.toBuffer(),u=new gd;u.writeVarintNum(o.length),u.write(o),wn.checkState(JSUtil.isNaturalNumber(n));var m=new gd().writeUInt64LEBN(new Fe(n)).toBuffer(),_=HL.verify(this,e,t,r,u.toBuffer(),m);return _};j.prototype.checkSchnorrSignature=function(e,t,r,i){return wn.checkArgument(e&&Buffer.isBuffer(e),"Missing sig"),wn.checkArgument(t&&Buffer.isBuffer(t),"Missing pubkey"),wn.checkArgument(r,"Missing sigversion"),wn.checkArgument(i,"Missing execdata"),wn.checkArgument(t.length===32,"Schnorr signatures have 32-byte public keys. The caller is responsible for enforcing this."),e.length===64||e.length===65?e.length===65&&e[e.length-1]===_t.SIGHASH_DEFAULT?(this.errstr="SCRIPT_ERR_SCHNORR_SIG_HASHTYPE",!1):(e=_t.fromSchnorr(e),zL.verify(this.tx,e,t,r,this.nin,i)):(this.errstr="SCRIPT_ERR_SCHNORR_SIG_SIZE",!1)};j.prototype._evalChecksigPreTapscript=function(e,t){wn.checkArgument(this.sigversion===_t.Version.BASE||this.sigversion===_t.Version.WITNESS_V0,"sigversion must be base or witness_v0");let r={success:!1,result:!1},i=new yn().set({chunks:this.script.chunks.slice(this.pbegincodehash)});if(this.sigversion===_t.Version.BASE){let n=new yn().add(e),o=i.chunks.length;if(i.findAndDelete(n),o=o==i.chunks.length+1,o&&this.flags&j.SCRIPT_VERIFY_CONST_SCRIPTCODE)return this.errstr="SCRIPT_ERR_SIG_FINDANDDELETE",r}if(!this.checkSignatureEncoding(e)||!this.checkPubkeyEncoding(t))return r;try{let n=_t.fromTxFormat(e),o=ku.fromBuffer(t,!1);r.success=this.tx.verifySignature(n,o,this.nin,i,this.sigversion,this.satoshis)}catch{r.success=!1}return!r.success&&this.flags&j.SCRIPT_VERIFY_NULLFAIL&&e.length?(this.errstr="SCRIPT_ERR_SIG_NULLFAIL",r):(r.result=!0,r)};j.prototype._evalChecksigTapscript=function(e,t){wn.checkArgument(this.sigversion==_t.Version.TAPSCRIPT,"this.sigversion must by TAPSCRIPT");let r={success:e.length>0,result:!1};if(r.success&&(wn.checkState(this.execdata.validationWeightLeftInit,"validationWeightLeftInit is false"),this.execdata.validationWeightLeft-=yn.VALIDATION_WEIGHT_PER_SIGOP_PASSED,this.execdata.validationWeightLeft<0))return this.errstr="SCRIPT_ERR_TAPSCRIPT_VALIDATION_WEIGHT",r;if(t.length===0)return this.errstr="SCRIPT_ERR_PUBKEYTYPE",r;if(t.length==32){if(r.success&&!this.tx.checkSchnorrSignature(e,t,this.nin,this.sigversion,this.execdata))return this.errstr="SCRIPT_ERR_SCHNORR_SIG",r}else if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_PUBKEYTYPE",r;return r.result=!0,r};j.prototype._evalCheckSig=function(e,t){switch(this.sigversion){case _t.Version.BASE:case _t.Version.WITNESS_V0:return this._evalChecksigPreTapscript(e,t);case _t.Version.TAPSCRIPT:return this._evalChecksigTapscript(e,t);case _t.Version.TAPROOT:throw new Error("Called evalCheckSig with a TAPROOT sigversion. Check your implementation")}};j.prototype.evaluate=function(){if(wn.checkArgument(this.sigversion==_t.Version.BASE||this.sigversion==_t.Version.WITNESS_V0||this.sigversion==_t.Version.TAPSCRIPT,"invalid sigversion"),(this.sigversion==_t.Version.BASE||this.sigversion==_t.Version.WITNESS_V0)&&this.script.toBuffer().length>j.MAX_SCRIPT_SIZE)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){var e=this.step();if(!e)return!1}}catch(t){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};j.prototype.checkLockTime=function(e){return!(!(this.tx.nLockTime<j.LOCKTIME_THRESHOLD&&e.lt(j.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=j.LOCKTIME_THRESHOLD&&e.gte(j.LOCKTIME_THRESHOLD_BN))||e.gt(new Fe(this.tx.nLockTime))||!this.tx.inputs[this.nin].isFinal())};j.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2||t&j.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=j.SEQUENCE_LOCKTIME_TYPE_FLAG|j.SEQUENCE_LOCKTIME_MASK,i=new Fe(t&r),n=e.and(new Fe(r)),o=new Fe(j.SEQUENCE_LOCKTIME_TYPE_FLAG);return i.lt(o)&&n.lt(o)||i.gte(o)&&n.gte(o)?n.lte(i):!1};j.computeTapleafHash=function(e,t){let r=vI.TAPLEAF;return r.writeUInt8(e),r.writeVarintNum(t.length),r.write(t),r.finalize()};j.computeTaprootMerkleRoot=function(e,t){let r=(e.length-j.TAPROOT_CONTROL_BASE_SIZE)/j.TAPROOT_CONTROL_NODE_SIZE,i=t;for(let n=0;n<r;++n){let o=vI.TAPBRANCH,u=j.TAPROOT_CONTROL_BASE_SIZE+j.TAPROOT_CONTROL_NODE_SIZE*n,m=e.slice(u,u+j.TAPROOT_CONTROL_NODE_SIZE);Buffer.compare(i,m)===-1?(o.write(i),o.write(m)):(o.write(m),o.write(i)),i=o.finalize()}return i};j.verifyTaprootCommitment=function(e,t,r){wn.checkArgument(e.length>=j.TAPROOT_CONTROL_BASE_SIZE,"control too short"),wn.checkArgument(t.length>=32,"program is too short");try{let i=ku.fromX(!1,e.slice(1,j.TAPROOT_CONTROL_BASE_SIZE));let n=ku.fromX(!1,t),o=j.computeTaprootMerkleRoot(e,r);return n.checkTapTweak(i,o,e)}catch{return!1}};j.prototype.step=function(){var e=(this.flags&j.SCRIPT_VERIFY_MINIMALDATA)!==0,t=this.vfExec.indexOf(!1)===-1,r,i,n,o,u,m,_,w,I,T,N,C,B,U,Z,$,H;this.execdata=this.execdata||{},this.execdata.codeseparatorPosInit||(this.execdata.codeseparatorPos=new Fe(4294967295),this.execdata.codeseparatorPosInit=!0);var ee=this.script.chunks[this.pc];this.pc++;var ce=ee.opcodenum;if(Ou.isUndefined(ce))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(ee.buf&&ee.buf.length>j.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if((this.sigversion===_t.Version.BASE||this.sigversion===_t.Version.WITNESS_V0)&&ce>W.OP_16&&++this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(ce===W.OP_CAT||ce===W.OP_SUBSTR||ce===W.OP_LEFT||ce===W.OP_RIGHT||ce===W.OP_INVERT||ce===W.OP_AND||ce===W.OP_OR||ce===W.OP_XOR||ce===W.OP_2MUL||ce===W.OP_2DIV||ce===W.OP_MUL||ce===W.OP_DIV||ce===W.OP_MOD||ce===W.OP_LSHIFT||ce===W.OP_RSHIFT)return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(ce==W.OP_CODESEPARATOR&&this.sigversion===_t.Version.BASE&&this.flags&j.SCRIPT_VERIFY_CONST_SCRIPTCODE)return this.errstr="SCRIPT_ERR_OP_CODESEPARATOR",!1;if(t&&0<=ce&&ce<=W.OP_PUSHDATA4){if(e&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!ee.buf)this.stack.push(j.false);else{if(ee.len!==ee.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(ee.buf)}}else if(t||W.OP_IF<=ce&&ce<=W.OP_ENDIF)switch(ce){case W.OP_1NEGATE:case W.OP_1:case W.OP_2:case W.OP_3:case W.OP_4:case W.OP_5:case W.OP_6:case W.OP_7:case W.OP_8:case W.OP_9:case W.OP_10:case W.OP_11:case W.OP_12:case W.OP_13:case W.OP_14:case W.OP_15:case W.OP_16:u=ce-(W.OP_1-1),r=new Fe(u).toScriptNumBuffer(),this.stack.push(r);break;case W.OP_NOP:break;case W.OP_NOP2:case W.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&j.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var ge=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e,5);if(ge.lt(new Fe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(ge))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case W.OP_NOP3:case W.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&j.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var Se=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e,5);if(Se.lt(new Fe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(Se&j.SEQUENCE_LOCKTIME_DISABLE_FLAG)break;if(!this.checkSequence(Se))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case W.OP_NOP1:case W.OP_NOP4:case W.OP_NOP5:case W.OP_NOP6:case W.OP_NOP7:case W.OP_NOP8:case W.OP_NOP9:case W.OP_NOP10:if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case W.OP_IF:case W.OP_NOTIF:{if($=!1,t){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(r=this.stack[this.stack.length-1],this.sigversion===_t.Version.TAPSCRIPT&&(r.length>1||r.length===1&&r[0]!==1))return this.errstr="SCRIPT_ERR_TAPSCRIPT_MINIMALIF",!1;if(this.sigversion===_t.Version.WITNESS_V0&&this.flags&j.SCRIPT_VERIFY_MINIMALIF){if(r=this.stack[this.stack.length-1],r.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(r.length==1&&r[0]!=1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}$=j.castToBool(r),ce===W.OP_NOTIF&&($=!$),this.stack.pop()}this.vfExec.push($)}break;case W.OP_ELSE:{if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1]}break;case W.OP_ENDIF:{if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop()}break;case W.OP_VERIFY:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(r=this.stack[this.stack.length-1],$=j.castToBool(r),$)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1}break;case W.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case W.OP_TOALTSTACK:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop())}break;case W.OP_FROMALTSTACK:{if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop())}break;case W.OP_2DROP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop()}break;case W.OP_2DUP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-2],n=this.stack[this.stack.length-1],this.stack.push(i),this.stack.push(n)}break;case W.OP_3DUP:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-3],n=this.stack[this.stack.length-2];var me=this.stack[this.stack.length-1];this.stack.push(i),this.stack.push(n),this.stack.push(me)}break;case W.OP_2OVER:{if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-4],n=this.stack[this.stack.length-3],this.stack.push(i),this.stack.push(n)}break;case W.OP_2ROT:{if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=this.stack.splice(this.stack.length-6,2),this.stack.push(o[0]),this.stack.push(o[1])}break;case W.OP_2SWAP:{if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=this.stack.splice(this.stack.length-4,2),this.stack.push(o[0]),this.stack.push(o[1])}break;case W.OP_IFDUP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=this.stack[this.stack.length-1],$=j.castToBool(r),$&&this.stack.push(r)}break;case W.OP_DEPTH:r=new Fe(this.stack.length).toScriptNumBuffer(),this.stack.push(r);break;case W.OP_DROP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop()}break;case W.OP_DUP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1])}break;case W.OP_NIP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1)}break;case W.OP_OVER:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2])}break;case W.OP_PICK:case W.OP_ROLL:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(r=this.stack[this.stack.length-1],w=Fe.fromScriptNumBuffer(r,e),u=w.toNumber(),this.stack.pop(),u<0||u>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=this.stack[this.stack.length-u-1],ce===W.OP_ROLL&&this.stack.splice(this.stack.length-u-1,1),this.stack.push(r)}break;case W.OP_ROT:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=this.stack[this.stack.length-3],_=this.stack[this.stack.length-2];var O=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=_,this.stack[this.stack.length-2]=O,this.stack[this.stack.length-1]=m}break;case W.OP_SWAP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=this.stack[this.stack.length-2],_=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=_,this.stack[this.stack.length-1]=m}break;case W.OP_TUCK:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1])}break;case W.OP_SIZE:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;w=new Fe(this.stack[this.stack.length-1].length),this.stack.push(w.toScriptNumBuffer())}break;case W.OP_EQUAL:case W.OP_EQUALVERIFY:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-2],n=this.stack[this.stack.length-1];var E=i.toString("hex")===n.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(E?j.true:j.false),ce===W.OP_EQUALVERIFY)if(E)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1}break;case W.OP_1ADD:case W.OP_1SUB:case W.OP_NEGATE:case W.OP_ABS:case W.OP_NOT:case W.OP_0NOTEQUAL:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(r=this.stack[this.stack.length-1],w=Fe.fromScriptNumBuffer(r,e),ce){case W.OP_1ADD:w=w.add(Fe.One);break;case W.OP_1SUB:w=w.sub(Fe.One);break;case W.OP_NEGATE:w=w.neg();break;case W.OP_ABS:w.cmp(Fe.Zero)<0&&(w=w.neg());break;case W.OP_NOT:w=new Fe((w.cmp(Fe.Zero)===0)+0);break;case W.OP_0NOTEQUAL:w=new Fe((w.cmp(Fe.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(w.toScriptNumBuffer())}break;case W.OP_ADD:case W.OP_SUB:case W.OP_BOOLAND:case W.OP_BOOLOR:case W.OP_NUMEQUAL:case W.OP_NUMEQUALVERIFY:case W.OP_NUMNOTEQUAL:case W.OP_LESSTHAN:case W.OP_GREATERTHAN:case W.OP_LESSTHANOREQUAL:case W.OP_GREATERTHANOREQUAL:case W.OP_MIN:case W.OP_MAX:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(I=Fe.fromScriptNumBuffer(this.stack[this.stack.length-2],e),T=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e),w=new Fe(0),ce){case W.OP_ADD:w=I.add(T);break;case W.OP_SUB:w=I.sub(T);break;case W.OP_BOOLAND:w=new Fe((I.cmp(Fe.Zero)!==0&&T.cmp(Fe.Zero)!==0)+0);break;case W.OP_BOOLOR:w=new Fe((I.cmp(Fe.Zero)!==0||T.cmp(Fe.Zero)!==0)+0);break;case W.OP_NUMEQUAL:w=new Fe((I.cmp(T)===0)+0);break;case W.OP_NUMEQUALVERIFY:w=new Fe((I.cmp(T)===0)+0);break;case W.OP_NUMNOTEQUAL:w=new Fe((I.cmp(T)!==0)+0);break;case W.OP_LESSTHAN:w=new Fe((I.cmp(T)<0)+0);break;case W.OP_GREATERTHAN:w=new Fe((I.cmp(T)>0)+0);break;case W.OP_LESSTHANOREQUAL:w=new Fe((I.cmp(T)<=0)+0);break;case W.OP_GREATERTHANOREQUAL:w=new Fe((I.cmp(T)>=0)+0);break;case W.OP_MIN:w=I.cmp(T)<0?I:T;break;case W.OP_MAX:w=I.cmp(T)>0?I:T;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(w.toScriptNumBuffer()),ce===W.OP_NUMEQUALVERIFY)if(j.castToBool(this.stack[this.stack.length-1]))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1}break;case W.OP_WITHIN:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;I=Fe.fromScriptNumBuffer(this.stack[this.stack.length-3],e),T=Fe.fromScriptNumBuffer(this.stack[this.stack.length-2],e);var f=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e);$=T.cmp(I)<=0&&I.cmp(f)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push($?j.true:j.false)}break;case W.OP_RIPEMD160:case W.OP_SHA1:case W.OP_SHA256:case W.OP_HASH160:case W.OP_HASH256:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=this.stack[this.stack.length-1];var c;ce===W.OP_RIPEMD160?c=pc.ripemd160(r):ce===W.OP_SHA1?c=pc.sha1(r):ce===W.OP_SHA256?c=pc.sha256(r):ce===W.OP_HASH160?c=pc.sha256ripemd160(r):ce===W.OP_HASH256&&(c=pc.sha256sha256(r)),this.stack.pop(),this.stack.push(c)}break;case W.OP_CODESEPARATOR:this.pbegincodehash=this.pc,this.execdata.codeseparatorPos=this.pc-1;break;case W.OP_CHECKSIG:case W.OP_CHECKSIGVERIFY:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;N=this.stack[this.stack.length-2],C=this.stack[this.stack.length-1];let{success:A,result:D}=this._evalCheckSig(N,C);if(!D)return!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(A?j.true:j.false),ce===W.OP_CHECKSIGVERIFY)if(A)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1}break;case W.OP_CHECKSIGADD:{if(this.sigversion==_t.Version.BASE||this.sigversion==_t.Version.WITNESS_V0)return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1;if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let A=this.stack[this.stack.length-3],D=this.stack[this.stack.length-2],V=this.stack[this.stack.length-1];D=Fe.fromScriptNumBuffer(D,e);let{success:Y,result:se}=this._evalCheckSig(A,V);if(!se)return!1;this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(D.addn(Y?1:0).toScriptNumBuffer())}break;case W.OP_CHECKMULTISIG:case W.OP_CHECKMULTISIGVERIFY:{var p=1;if(this.stack.length<p)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var v=Fe.fromScriptNumBuffer(this.stack[this.stack.length-p],e).toNumber();if(v<0||v>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=v,this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var g=++p;p+=v;var x=v+2;if(this.stack.length<p)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var S=Fe.fromScriptNumBuffer(this.stack[this.stack.length-p],e).toNumber();if(S<0||S>v)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var b=++p;if(p+=S,this.stack.length<p)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;B=new yn().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var l=0;l<S;l++)N=this.stack[this.stack.length-b-l],B.findAndDelete(new yn().add(N));for(H=!0;H&&S>0;){if(N=this.stack[this.stack.length-b],C=this.stack[this.stack.length-g],!this.checkSignatureEncoding(N)||!this.checkPubkeyEncoding(C))return!1;var d;try{U=_t.fromTxFormat(N),Z=ku.fromBuffer(C,!1),d=this.tx.verifySignature(U,Z,this.nin,B,this.sigversion,this.satoshis,this.execdata)}catch{d=!1}d&&(b++,S--),g++,v--,S>v&&(H=!1)}for(;p-- >1;){if(!H&&this.flags&j.SCRIPT_VERIFY_NULLFAIL&&!x&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;x>0&&x--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&j.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(H?j.true:j.false),ce===W.OP_CHECKMULTISIGVERIFY)if(H)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1}break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return this.stack.length+this.altstack.length>j.MAX_STACK_SIZE?(this.errstr="SCRIPT_ERR_STACK_SIZE",!1):!0}});var Li=X((hX,ux)=>{ux.exports=Pg();ux.exports.Interpreter=qg()});var Vn=X((dX,_I)=>{"use strict";var xd=Et(),ma=xt(),VL=Yi(),xI=du(),gl=a3(),Ui=io(),bd=Dr(),bI=Rr(),fx=jn();function ue(e,t,r,i){if(!(this instanceof ue))return new ue(e,t,r);if(xd.isArray(e)&&xd.isNumber(t))return ue.createMultisig(e,t,r,!1,i);if(e instanceof ue)return e;if(ma.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!Ui.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==ue.PayToPublicKeyHash&&r!==ue.PayToScriptHash&&r!==ue.PayToWitnessPublicKeyHash&&r!==ue.PayToWitnessScriptHash&&r!==ue.PayToTaproot)throw new TypeError('Third argument must be "pubkeyhash", "scripthash", "witnesspubkeyhash", "witnessscripthash", or "taproot".');var n=this._classifyArguments(e,t,r);return n.network=n.network||Ui.get(t)||Ui.defaultNetwork,n.type=n.type||r||ue.PayToPublicKeyHash,bI.defineImmutable(this,{hashBuffer:n.hashBuffer,network:n.network,type:n.type}),this}ue.prototype._classifyArguments=function(e,t,r){if((e instanceof Buffer||e instanceof Uint8Array)&&(e.length===20||e.length===32))return ue._transformHash(e,t,r);if((e instanceof Buffer||e instanceof Uint8Array)&&e.length>=21)return ue._transformBuffer(e,t,r);if(e instanceof fx)return ue._transformPublicKey(e,t,r);if(e instanceof hc)return ue._transformScript(e,t);if(typeof e=="string")return ue._transformString(e,t,r);if(xd.isObject(e))return ue._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};ue.PayToPublicKeyHash="pubkeyhash";ue.PayToScriptHash="scripthash";ue.PayToWitnessPublicKeyHash="witnesspubkeyhash";ue.PayToWitnessScriptHash="witnessscripthash";ue.PayToTaproot="taproot";ue._transformHash=function(e,t,r){var i={};if(!(e instanceof Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20&&e.length!==32)throw new TypeError("Address hashbuffers must be either 20 or 32 bytes.");return i.hashBuffer=e,i.network=Ui.get(t)||Ui.defaultNetwork,i.type=r,i};ue._transformObject=function(e){return ma.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),ma.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?Buffer.from(e.hash,"hex"):e.hashBuffer,network:Ui.get(e.network)||Ui.defaultNetwork,type:e.type}};ue._classifyFromVersion=function(e){var t={};if(e.length>21){var r=gl.decode(e.toString("utf8"));if(r.version!==0&&r.version!==1)throw new TypeError("Only witness v0 and v1 addresses are supported.");if(r.version===0)if(r.data.length===20)t.type=ue.PayToWitnessPublicKeyHash;else if(r.data.length===32)t.type=ue.PayToWitnessScriptHash;else throw new TypeError("Witness data must be either 20 or 32 bytes.");else if(r.version===1)if(r.data.length===32)t.type=ue.PayToTaproot;else throw new TypeError("Witness data must be 32 bytes for v1");t.network=Ui.get(r.prefix,"bech32prefix")}else{var i=Ui.get(e[0],"pubkeyhash"),n=Ui.get(e[0],"scripthash");i?(t.network=i,t.type=ue.PayToPublicKeyHash):n&&(t.network=n,t.type=ue.PayToScriptHash)}return t};ue._transformBuffer=function(e,t,r){var i={};if(!(e instanceof Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length<21)throw new TypeError("Address buffer is incorrect length.");var n=Ui.get(t),o=ue._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n.xpubkey!==o.network.xpubkey)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return e.length>21?i.hashBuffer=gl.decode(e.toString("utf8")).data:i.hashBuffer=e.slice(1),i.network=n||o.network,i.type=o.type,i};ue._transformPublicKey=function(e,t,r){var i={};if(!(e instanceof fx))throw new TypeError("Address must be an instance of PublicKey.");if(r&&r!==ue.PayToScriptHash&&r!==ue.PayToWitnessPublicKeyHash&&r!==ue.PayToPublicKeyHash&&r!==ue.PayToTaproot)throw new TypeError("Type must be either pubkeyhash, witnesspubkeyhash, scripthash, or taproot to transform public key.");if(!e.compressed&&(r===ue.PayToScriptHash||r===ue.PayToWitnessPublicKeyHash))throw new TypeError("Witness addresses must use compressed public keys.");return r===ue.PayToScriptHash?i.hashBuffer=bd.sha256ripemd160(hc.buildWitnessV0Out(e).toBuffer()):r===ue.PayToTaproot?i.hashBuffer=e.createTapTweak().tweakedPubKey:i.hashBuffer=bd.sha256ripemd160(e.toBuffer()),i.type=r||ue.PayToPublicKeyHash,i};ue._transformScript=function(e,t){ma.checkArgument(e instanceof hc,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new VL.Script.CantDeriveAddress(e);return r};ue.createMultisig=function(e,t,r,i,n){if(r=r||e[0].network||Ui.defaultNetwork,n&&n!==ue.PayToScriptHash&&n!==ue.PayToWitnessScriptHash)throw new TypeError("Type must be either scripthash or witnessscripthash to create multisig.");if(i||n===ue.PayToWitnessScriptHash){e=xd.map(e,fx);for(var o=0;o<e.length;o++)if(!e[o].compressed)throw new TypeError("Witness addresses must use compressed public keys.")}var u=hc.buildMultisigOut(e,t);return i?ue.payingTo(hc.buildWitnessMultisigOutFromScript(u),r):ue.payingTo(u,r,n)};ue._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length>100)throw new TypeError("address string is too long");if(t&&!Ui.get(t))throw new TypeError("Unknown network");e=e.trim();try{var n=ue._transformBuffer(Buffer.from(e,"utf8"),t,r);return n}catch(o){if(r===ue.PayToWitnessPublicKeyHash||r===ue.PayToWitnessScriptHash||r===ue.PayToTaproot)throw o}var i=xI.decode(e),n=ue._transformBuffer(i,t,r);return n};ue.fromPublicKey=function(e,t,r){var i=ue._transformPublicKey(e,t,r);return t=t||Ui.defaultNetwork,new ue(i.hashBuffer,t,i.type)};ue.fromPublicKeyHash=function(e,t){var r=ue._transformHash(e);return new ue(r.hashBuffer,t,ue.PayToPublicKeyHash)};ue.fromScriptHash=function(e,t,n){ma.checkArgument(e,"hash parameter is required");var i=ue._transformHash(e);if(n===ue.PayToWitnessScriptHash&&e.length!==32)throw new TypeError("Address hashbuffer must be exactly 32 bytes for v0 witness script hash.");var n=n||ue.PayToScriptHash;return new ue(i.hashBuffer,t,n)};ue.payingTo=function(e,t,n){ma.checkArgument(e,"script is required"),ma.checkArgument(e instanceof hc,"script must be instance of Script");var i;n===ue.PayToWitnessScriptHash?i=bd.sha256(e.toBuffer()):i=bd.sha256ripemd160(e.toBuffer());var n=n||ue.PayToScriptHash;return ue.fromScriptHash(i,t,n)};ue.fromScript=function(e,t){ma.checkArgument(e instanceof hc,"script must be a Script instance");var r=ue._transformScript(e,t);return new ue(r.hashBuffer,t,r.type)};ue.fromBuffer=function(e,t,r){var i=ue._transformBuffer(e,t,r);return new ue(i.hashBuffer,i.network,i.type)};ue.fromString=function(e,t,r){var i=ue._transformString(e,t,r);return new ue(i.hashBuffer,i.network,i.type)};ue.fromObject=function(t){ma.checkState(bI.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=Buffer.from(t.hash,"hex");return new ue(r,t.network,t.type)};ue.getValidationError=function(e,t,r){var i;try{new ue(e,t,r)}catch(n){i=n}return i};ue.isValid=function(e,t,r){return!ue.getValidationError(e,t,r)};ue.prototype.isPayToPublicKeyHash=function(){return this.type===ue.PayToPublicKeyHash};ue.prototype.isPayToScriptHash=function(){return this.type===ue.PayToScriptHash};ue.prototype.isPayToWitnessPublicKeyHash=function(){return this.type===ue.PayToWitnessPublicKeyHash};ue.prototype.isPayToWitnessScriptHash=function(){return this.type===ue.PayToWitnessScriptHash};ue.prototype.isPayToTaproot=function(){return this.type===ue.PayToTaproot};ue.prototype.toBuffer=function(){if(this.isPayToWitnessPublicKeyHash()||this.isPayToWitnessScriptHash())return Buffer.from(this.toString(),"utf8");var e=Buffer.from([this.network[this.type]]);return Buffer.concat([e,this.hashBuffer])};ue.prototype.toObject=ue.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};ue.prototype.toString=function(){if(this.isPayToWitnessPublicKeyHash()||this.isPayToWitnessScriptHash()||this.isPayToTaproot()){let e=this.network.bech32prefix,t=0,r=gl.encodings.BECH32;return this.isPayToTaproot()&&(t=1,r=gl.encodings.BECH32M),gl.encode(e,t,this.hashBuffer,r)}return xI.encode(this.toBuffer())};ue.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};_I.exports=ue;var hc=Li()});var xl=X((mX,yI)=>{"use strict";function dc(){}dc.getRandomBuffer=function(e){return process.browser?dc.getRandomBufferBrowser(e):dc.getRandomBufferNode(e)};dc.getRandomBufferNode=function(e){var t=require("crypto");return t.randomBytes(e)};dc.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var t=window.crypto;else if(window.msCrypto&&window.msCrypto.getRandomValues)var t=window.msCrypto;else throw new Error("window.crypto.getRandomValues not available");var r=new Uint8Array(e);t.getRandomValues(r);var i=Buffer.from(r);return i};dc.getPseudoRandomBuffer=function(e){for(var t=4294967296,r=Buffer.alloc(e),i,n=0;n<=e;n++){var o=Math.floor(n/4),u=n-o*4;u===0?(i=Math.random()*t,r[n]=i&255):r[n]=(i=i>>>8)&255}return r};yI.exports=dc});var ao=X((vX,EI)=>{"use strict";var _d=Et(),jL=Vn(),wI=du(),ga=Xr(),SI=Rr(),va=io(),yd=eo(),WL=jn(),KL=xl(),wd=xt(),GL=ca();function nt(e,t){if(!(this instanceof nt))return new nt(e,t);if(e instanceof nt)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new ga(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(yd.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return SI.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}nt.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?va.get(t):va.defaultNetwork};if(_d.isUndefined(e)||_d.isNull(e))r.bn=nt._getRandomBN();else if(e instanceof ga)r.bn=e;else if(e instanceof Buffer||e instanceof Uint8Array)r=nt._transformBuffer(e,t);else if(e.bn&&e.network)r=nt._transformObject(e);else if(!t&&va.get(e))r.bn=nt._getRandomBN(),r.network=va.get(e);else if(typeof e=="string")SI.isHexa(e)?r.bn=new ga(Buffer.from(e,"hex")):r=nt._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};nt._getRandomBN=function(){var e,t;do{var r=KL.getRandomBuffer(32);t=ga.fromBuffer(r),e=t.lt(yd.getN())}while(!e);return t};nt._transformBuffer=function(e,t){var r={};if(e.length===32)return nt._transformBNBuffer(e,t);if(r.network=va.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==va.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=ga.fromBuffer(e.slice(1,33)),r};nt._transformBNBuffer=function(e,t){var r={};return r.network=va.get(t)||va.defaultNetwork,r.bn=ga.fromBuffer(e),r.compressed=!1,r};nt._transformWIF=function(e,t){return nt._transformBuffer(wI.decode(e),t)};nt.fromBuffer=function(e,t){return new nt(e,t)};nt._transformObject=function(e){var t=new ga(e.bn,"hex"),r=va.get(e.network);return{bn:t,network:r,compressed:e.compressed}};nt.fromString=nt.fromWIF=function(e){return wd.checkArgument(_d.isString(e),"First argument is expected to be a string."),new nt(e)};nt.fromObject=function(e){return wd.checkArgument(_d.isObject(e),"First argument is expected to be an object."),new nt(e)};nt.fromRandom=function(e){var t=nt._getRandomBN();return new nt(t,e)};nt.getValidationError=function(e,t){var r;try{new nt(e,t)}catch(i){r=i}return r};nt.isValid=function(e,t){return e?!nt.getValidationError(e,t):!1};nt.prototype.toString=function(){return this.toBuffer().toString("hex")};nt.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=Buffer.concat([Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),Buffer.from([1])]):r=Buffer.concat([Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),wI.encode(r)};nt.prototype.toBigNumber=function(){return this.bn};nt.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};nt.prototype.toBufferNoPadding=function(){return this.bn.toBuffer()};nt.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=WL.fromPrivateKey(this)),this._pubkey};nt.prototype.toAddress=function(e,t){var r=this.toPublicKey();return jL.fromPublicKey(r,e||this.network,t)};nt.prototype.toObject=nt.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};nt.prototype.createTapTweak=function(e){let t=yd.getN(),r=yd.getG().mul(this.bn),i=r.y.isEven()?this.bn:t.sub(this.bn),n=new GL("TapTweak");n.write(r.x.toBuffer({size:32})),e&&(wd.checkArgument(Buffer.isBuffer(e)&&e.length===32,"merkleRoot must be 32 byte buffer"),n.write(e));let o=n.finalize();return wd.checkState(ga.fromBuffer(o).lt(t),"TapTweak hash failed secp256k1 order check"),{tweakedPrivKey:i.add(new ga(o)).mod(t).toBuffer({size:32})}};nt.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toString()+", network: "+this.network+e+">"};EI.exports=nt});var jn=X((gX,RI)=>{"use strict";var Gn=Xr(),po=eo(),$L=Dr(),II=Rr(),TI=io(),lx=Et(),Xi=xt(),YL=ca();function we(e,t){if(!(this instanceof we))return new we(e,t);if(Xi.checkArgument(e,"First argument is required, please include public key data."),e instanceof we)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),II.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||TI.defaultNetwork}),this}we.prototype._classifyArgs=function(e,t){var r={compressed:lx.isUndefined(t.compressed)||t.compressed};if(e instanceof po)r.point=e;else if(e.x&&e.y)r=we._transformObject(e);else if(typeof e=="string")r=we._transformDER(Buffer.from(e,"hex"));else if(we._isBuffer(e))r=we._transformDER(e);else if(we._isPrivateKey(e))r=we._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=lx.isUndefined(t.network)?void 0:TI.get(t.network)),r};we._isPrivateKey=function(e){var t=ao();return e instanceof t};we._isBuffer=function(e){return e instanceof Buffer||e instanceof Uint8Array};we._transformPrivateKey=function(e){Xi.checkArgument(we._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=po.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};we._transformDER=function(e,t){Xi.checkArgument(we._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r={};t=lx.isUndefined(t)?!0:t;var i,n,o,u;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),u=e.slice(33,65),o.length!==32||u.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new Gn(o),n=new Gn(u),r.point=new po(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new Gn(o),r=we._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new Gn(o),r=we._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};we._transformX=function(e,t){Xi.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=po.fromX(e,t),r};we._transformObject=function(e){var t=new Gn(e.x,"hex"),r=new Gn(e.y,"hex"),i=new po(t,r);return new we(i,{compressed:e.compressed})};we.fromPrivateKey=function(e){Xi.checkArgument(we._isPrivateKey(e),"Must be an instance of PrivateKey");var t=we._transformPrivateKey(e);return new we(t.point,{compressed:t.compressed,network:t.network})};we.fromBuffer=function(e,t){return Xi.checkArgument(we._isBuffer(e),"Must be a hex buffer of DER encoded public key or 32 byte X coordinate (taproot)"),e.length===32?we.fromX(!1,e):we.fromDER(e,t)};we.fromDER=function(e,t){Xi.checkArgument(we._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=we._transformDER(e,t);return new we(r.point,{compressed:r.compressed})};we.fromPoint=function(e,t){return Xi.checkArgument(e instanceof po,"First argument must be an instance of Point."),new we(e,{compressed:t})};we.fromString=function(e,t){var r=Buffer.from(e,t||"hex"),i=we._transformDER(r);return new we(i.point,{compressed:i.compressed})};we.fromX=function(e,t){var r=we._transformX(e,t);return new we(r.point,{compressed:r.compressed})};we.fromTaproot=function(e){return typeof e=="string"&&II.isHexaString(e)&&(e=Buffer.from(e,"hex")),Xi.checkArgument(Buffer.isBuffer(e),"hexBuf must be a hex string or buffer"),Xi.checkArgument(e.length===32,"Taproot public keys must be 32 bytes"),new we.fromX(!1,e)};we.isValidTaproot=function(e){try{return!!we.fromTaproot(e)}catch{return!1}};we.prototype.computeTapTweakHash=function(e){let t=new YL("TapTweak");t.write(this.point.x.toBuffer({size:32})),e&&(Xi.checkArgument(Buffer.isBuffer(e)&&e.length===32,"merkleRoot must be 32 byte buffer"),t.write(e));let r=t.finalize(),i=po.getN();return Xi.checkState(Gn.fromBuffer(r).lt(i),"TapTweak hash failed secp256k1 order check"),r};we.prototype.checkTapTweak=function(e,t,r){Buffer.isBuffer(e)&&(e=we.fromTaproot(e));let i=e.computeTapTweakHash(t),o=e.point.liftX().add(this.point.curve.g.mul(Gn.fromBuffer(i)));return this.point.x.eq(o.x)&&o.y.mod(new Gn(2)).eq(new Gn(r[0]&1))};we.prototype.createTapTweak=function(e){Xi.checkArgument(e==null||Buffer.isBuffer(e)&&e.length===32,"merkleRoot must be a 32 byte buffer");let t=this.computeTapTweakHash(e);t=new Gn(t);let r=this.point.liftX().add(po.getG().mul(t));return{parity:r.y.isEven()?0:1,tweakedPubKey:r.x.toBuffer()}};we.getValidationError=function(e){var t;try{new we(e)}catch(r){t=r}return t};we.isValid=function(e){return!we.getValidationError(e)};we.prototype.toObject=we.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};we.prototype.toBuffer=we.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=Buffer.from([3]):n=Buffer.from([2]),Buffer.concat([n,r])}else return n=Buffer.from([4]),Buffer.concat([n,r,i])};we.prototype._getID=function(){return $L.sha256ripemd160(this.toBuffer())};we.prototype.toAddress=function(e,t){var r=Vn();return r.fromPublicKey(this,e||this.network,t)};we.prototype.toString=function(){return this.toDER().toString("hex")};we.prototype.inspect=function(){return"<PublicKey: "+this.toString()+(this.compressed?"":", uncompressed")+">"};RI.exports=we});var fl=X((xX,dx)=>{"use strict";var Ji=Xr(),Sn=eo(),AI=di(),OI=jn(),ZL=xl(),ho=Dr(),kI=Yt(),px=xt(),XL=function(e,t,r){for(var i=0;i<4;i++){var n;try{n=hx(e,t,i)}catch(o){console.error(o);continue}if(n.point.eq(r.point))return t.i=i,t.compressed=r.compressed,t}throw new Error("Unable to find valid recovery factor")},hx=function(e,t,r){px.checkArgument(r===0||r===1||r===2||r===3,new Error("i must be equal to 0, 1, 2, or 3"));var i=Ji.fromBuffer(e),n=t.r,o=t.s,u=r&1,m=r>>1,_=Sn.getN(),w=Sn.getG(),I=m?n.add(_):n,T=Sn.fromX(u,I),N=T.mul(_);if(!N.isInfinity())throw new Error("nR is not a valid curve point");var C=i.neg().umod(_),B=n.invm(_),U=T.mul(o).add(w.mul(C)).mul(B),Z=OI.fromPoint(U,t.compressed);return Z},JL=function(e,t){return hx(e,t,t.i)},PI=function(){var e=Sn.getN(),t;do t=Ji.fromBuffer(ZL.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(Ji.Zero)));return t},NI=function(e,t,r){r||(r=0);var i=Buffer.alloc(32);i.fill(1);var n=Buffer.alloc(32);n.fill(0);var o=t.bn.toBuffer({size:32});n=ho.sha256hmac(Buffer.concat([i,Buffer.from([0]),o,e]),n),i=ho.sha256hmac(i,n),n=ho.sha256hmac(Buffer.concat([i,Buffer.from([1]),o,e]),n),i=ho.sha256hmac(i,n),i=ho.sha256hmac(i,n);for(var u=Ji.fromBuffer(i),m=Sn.getN(),_=0;_<r||!(u.lt(m)&&u.gt(Ji.Zero));_++)n=ho.sha256hmac(Buffer.concat([i,Buffer.from([0])]),n),i=ho.sha256hmac(i,n),i=ho.sha256hmac(i,n),u=Ji.fromBuffer(i);return u},BI=function(e){return e.gt(new Ji("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))&&(e=Sn.getN().sub(e)),e},QL=function(e,t,r){let{endian:i="big",randomK:n=!1}=r||{};px.checkState(kI.isBuffer(e)&&e.length===32,"hashbuf must be a 32 byte buffer"),px.checkState(t&&t.bn,"privkey must be a PrivateKey");var o=t.bn;e=Buffer.from(e),i==="little"&&e.reverse();var u=Ji.fromBuffer(e),m=Sn.getN(),_=Sn.getG(),w=0,I,T,N,C;do I=n?PI():NI(e,t,w),w++,T=_.mul(I),N=T.x.umod(m),C=I.invm(m).mul(u.add(o.mul(N))).umod(m);while(N.cmp(Ji.Zero)<=0||C.cmp(Ji.Zero)<=0);return C=BI(C),new AI({s:C,r:N,compressed:t.publicKey.compressed})},MI=function(e,t,r,i){let{endian:n="big"}=i||{};if(!kI.isBuffer(e)||e.length!==32)return"hashbuf must be a 32 byte buffer";var o=t.r,u=t.s;if(!(o.gt(Ji.Zero)&&o.lt(Sn.getN()))||!(u.gt(Ji.Zero)&&u.lt(Sn.getN())))return"r and s not in range";var m=Ji.fromBuffer(e,{endian:n}),_=Sn.getN(),w=u.invm(_),I=w.mul(m).umod(_),T=w.mul(o).umod(_),N=Sn.getG().mulAdd(I,r.point,T);if(N.isInfinity())return"p is infinity";if(N.getX().umod(_).cmp(o)!==0)return"Invalid signature"},eU=function(e,t,r,i){if(!r)throw new Error("pubkey required for signature verification");if(r=new OI(r),!t)throw new Error("signature required for verification");return t=new AI(t),!MI(e,t,r,i)};dx.exports={sign:QL,verify:eU,verificationError:MI,calci:XL,recoverPublicKey:JL};dx.exports.__testing__={getDeterministicK:NI,getPublicKey:hx,getRandomK:PI,toLowS:BI}});var DI=X((bX,UI)=>{"use strict";var CI=ri(),LI=gs(),tU=Xr(),$n=function e(t){if(!(this instanceof e))return new e(t);if(Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof tU){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};$n.prototype.set=function(e){return this.buf=e.buf||this.buf,this};$n.prototype.fromString=function(e){return this.set({buf:Buffer.from(e,"hex")}),this};$n.prototype.toString=function(){return this.buf.toString("hex")};$n.prototype.fromBuffer=function(e){return this.buf=e,this};$n.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};$n.prototype.fromBN=function(e){return this.buf=CI().writeVarintBN(e).concat(),this};$n.prototype.fromNumber=function(e){return this.buf=CI().writeVarintNum(e).concat(),this};$n.prototype.toBuffer=function(){return this.buf};$n.prototype.toBN=function(){return LI(this.buf).readVarintBN()};$n.prototype.toNumber=function(){return LI(this.buf).readVarintNum()};UI.exports=$n});var _l=X((yX,HI)=>{"use strict";var Sd=Et(),bl=Xr(),Pu=Yt(),Ed=gs(),rU=ri(),iU=Dr(),_X=Rr(),qI=xt(),nU=486604799,mt=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&qI.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};mt._from=function(t){var r={};if(Pu.isBuffer(t))r=mt._fromBufferReader(Ed(t));else if(Sd.isObject(t))r=mt._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};mt._fromObject=function(t){qI.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;Sd.isString(t.prevHash)&&(r=Pu.reverse(Buffer.from(t.prevHash,"hex"))),Sd.isString(t.merkleRoot)&&(i=Pu.reverse(Buffer.from(t.merkleRoot,"hex")));var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};mt.fromObject=function(t){var r=mt._fromObject(t);return new mt(r)};mt.fromRawBlock=function(t){Pu.isBuffer(t)||(t=Buffer.from(t,"binary"));var r=Ed(t);r.pos=mt.Constants.START_OF_HEADER;var i=mt._fromBufferReader(r);return new mt(i)};mt.fromBuffer=function(t){var r=mt._fromBufferReader(Ed(t));return new mt(r)};mt.fromString=function(t){var r=Buffer.from(t,"hex");return mt.fromBuffer(r)};mt._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};mt.fromBufferReader=function(t){var r=mt._fromBufferReader(t);return new mt(r)};mt.prototype.toObject=mt.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:Pu.reverse(this.prevHash).toString("hex"),merkleRoot:Pu.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};mt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};mt.prototype.toString=function(){return this.toBuffer().toString("hex")};mt.prototype.toBufferWriter=function(t){return t||(t=new rU),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};mt.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new bl(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new bl(2));return r};mt.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(nU).mul(new bl(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};mt.prototype._getHash=function(){var t=this.toBuffer();return iU.sha256sha256(t)};var FI={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=Ed(this._getHash()).readReverse().toString("hex")),this._id},set:Sd.noop};Object.defineProperty(mt.prototype,"id",FI);Object.defineProperty(mt.prototype,"hash",FI);mt.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+mt.Constants.MAX_TIME_OFFSET)};mt.prototype.validProofOfWork=function(){var t=new bl(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};mt.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};mt.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:2*60*60,LARGEST_HASH:new bl("10000000000000000000000000000000000000000000000000000000000000000","hex")};HI.exports=mt});var $I=X((wX,GI)=>{"use strict";var vx=Et(),VI=_l(),zI=Xr(),jI=Yt(),gx=gs(),sU=ri(),aU=Dr(),mx=vl(),WI=xt();function lt(e){return this instanceof lt?(vx.extend(this,lt._from(e)),this):new lt(e)}lt.MAX_BLOCK_SIZE=1e6;lt._from=function(t){var r={};if(jI.isBuffer(t))r=lt._fromBufferReader(gx(t));else if(vx.isObject(t))r=lt._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};lt._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof mx?r.push(n):r.push(mx().fromObject(n))});var i={header:VI.fromObject(t.header),transactions:r};return i};lt.fromObject=function(t){var r=lt._fromObject(t);return new lt(r)};lt._fromBufferReader=function(t){var r={};WI.checkState(!t.finished(),"No block data received"),r.header=VI.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(mx().fromBufferReader(t));return r};lt.fromBufferReader=function(t){WI.checkArgument(t,"br is required");var r=lt._fromBufferReader(t);return new lt(r)};lt.fromBuffer=function(t){return lt.fromBufferReader(new gx(t))};lt.fromString=function(t){var r=Buffer.from(t,"hex");return lt.fromBuffer(r)};lt.fromRawBlock=function(t){jI.isBuffer(t)||(t=Buffer.from(t,"binary"));var r=gx(t);r.pos=lt.Values.START_OF_BLOCK;var i=lt._fromBufferReader(r);return new lt(i)};lt.prototype.toObject=lt.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};lt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};lt.prototype.toString=function(){return this.toBuffer().toString("hex")};lt.prototype.toBufferWriter=function(t){t||(t=new sU),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};lt.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[lt.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};lt.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),u=Buffer.concat([t[r+n],t[r+o]]);t.push(aU.sha256sha256(u))}r+=i}return t};lt.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};lt.prototype.validMerkleRoot=function(){var t=new zI(this.header.merkleRoot.toString("hex"),"hex"),r=new zI(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};lt.prototype._getHash=function(){return this.header._getHash()};var KI={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:vx.noop};Object.defineProperty(lt.prototype,"id",KI);Object.defineProperty(lt.prototype,"hash",KI);lt.prototype.inspect=function(){return"<Block "+this.id+">"};lt.Values={START_OF_BLOCK:8,NULL_HASH:Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};GI.exports=lt});var yx=X((EX,XI)=>{"use strict";var mc=Et(),bx=_l(),_x=Yt(),ZI=gs(),oU=ri(),cU=Dr(),SX=Rr(),YI=vl(),xx=Yi(),vc=xt();function Sr(e){if(!(this instanceof Sr))return new Sr(e);var t={};if(_x.isBuffer(e))t=Sr._fromBufferReader(ZI(e));else if(mc.isObject(e)){var r;e.header instanceof bx?r=e.header:r=bx.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return mc.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}Sr.fromBuffer=function(t){return Sr.fromBufferReader(ZI(t))};Sr.fromBufferReader=function(t){return new Sr(Sr._fromBufferReader(t))};Sr.prototype.toBuffer=function(){return this.toBufferWriter().concat()};Sr.prototype.toBufferWriter=function(t){t||(t=new oU),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};Sr.prototype.toObject=Sr.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};Sr.prototype.validMerkleTree=function(){if(vc.checkState(mc.isArray(this.flags),"MerkleBlock flags is not an array"),vc.checkState(mc.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:_x.equals(i,this.header.merkleRoot)};Sr.prototype.filterdTxsHash=function(){if(vc.checkState(mc.isArray(this.flags),"MerkleBlock flags is not an array"),vc.checkState(mc.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new xx.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new xx.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new xx.MerkleBlock.InvalidMerkleTree;return i};Sr.prototype._traverseMerkleTree=function(t,r,i,o){i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0;var o=o||!1;if(i.flagBitsUsed>this.flags.length*8)return null;var u=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!u){if(i.hashesUsed>=this.hashes.length)return null;var m=this.hashes[i.hashesUsed++];return t===0&&u&&i.txs.push(m),Buffer.from(m,"hex")}else{var _=this._traverseMerkleTree(t-1,r*2,i),w=_;return r*2+1<this._calcTreeWidth(t-1)&&(w=this._traverseMerkleTree(t-1,r*2+1,i)),o?i.txs:cU.sha256sha256(new Buffer.concat([_,w]))}};Sr.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};Sr.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};Sr.prototype.hasTransaction=function(t){vc.checkArgument(!mc.isUndefined(t),"tx cannot be undefined"),vc.checkArgument(t instanceof YI||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof YI&&(r=_x.reverse(Buffer.from(t.id,"hex")).toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};Sr._fromBufferReader=function(t){vc.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=bx.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};Sr.fromObject=function(t){return new Sr(t)};XI.exports=Sr});var JI=X((IX,Id)=>{Id.exports=$I();Id.exports.BlockHeader=_l();Id.exports.MerkleBlock=yx()});var Sx=X((TX,sT)=>{"use strict";var qr=Et(),eT=xt(),tT=Xr(),uU=ol(),Td=du(),rT=Dr(),Rd=Ex(),gc=io(),wx=eo(),iT=jn(),nT=Yi(),yl=nT,Yn=nT.HDPublicKey,Ad=require("assert"),QI=Rr(),Nt=Yt();function ne(e){if(e instanceof ne)return e;if(!(this instanceof ne))return new ne(e);if(e)if(qr.isString(e)||Nt.isBuffer(e)){var t=ne.getSerializedError(e);if(t){if(Nt.isBuffer(e)&&!ne.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof Yn.ArgumentIsPrivateExtended)return new Rd(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(qr.isObject(e))return e instanceof Rd?this._buildFromPrivate(e):this._buildFromObject(e);throw new Yn.UnrecognizedArgument(e)}else throw new Yn.MustSupplyArgument}ne.isValidPath=function(e){if(qr.isString(e)){var t=Rd._getDerivationIndexes(e);return t!==null&&qr.every(t,ne.isValidPath)}return qr.isNumber(e)?e>=0&&e<ne.Hardened:!1};ne.prototype.derive=function(e,t){return this.deriveChild(e,t)};ne.prototype.deriveChild=function(e,t){if(qr.isNumber(e))return this._deriveWithNumber(e,t);if(qr.isString(e))return this._deriveFromString(e);throw new Yn.InvalidDerivationArgument(e)};ne.prototype._deriveWithNumber=function(e,t){if(e>=ne.Hardened||t)throw new Yn.InvalidIndexCantDeriveHardened;if(e<0)throw new Yn.InvalidPath(e);var r=Nt.integerAsBuffer(e),i=Nt.concat([this.publicKey.toBuffer(),r]),n=rT.sha512hmac(i,this._buffers.chainCode),o=tT.fromBuffer(n.slice(0,32),{size:32}),u=n.slice(32,64),m;try{m=iT.fromPoint(wx.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var _=new ne({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:u,publicKey:m});return _};ne.prototype._deriveFromString=function(e){if(qr.includes(e,"'"))throw new Yn.InvalidIndexCantDeriveHardened;if(!ne.isValidPath(e))throw new Yn.InvalidPath(e);var t=Rd._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};ne.isValidSerialized=function(e,t){return qr.isNull(ne.getSerializedError(e,t))};ne.getSerializedError=function(e,t){if(!(qr.isString(e)||Nt.isBuffer(e)))return new Yn.UnrecognizedArgument("expected buffer or string");if(!uU.validCharacters(e))return new yl.InvalidB58Char("(unknown)",e);try{e=Td.decode(e)}catch{return new yl.InvalidB58Checksum(e)}if(e.length!==ne.DataSize)return new Yn.InvalidLength(e);if(!qr.isUndefined(t)){var r=ne._validateNetwork(e,t);if(r)return r}var i=Nt.integerFromBuffer(e.slice(0,4));return i===gc.livenet.xprivkey||i===gc.testnet.xprivkey?new Yn.ArgumentIsPrivateExtended:null};ne._validateNetwork=function(e,t){var r=gc.get(t);if(!r)return new yl.InvalidNetworkArgument(t);var i=e.slice(ne.VersionStart,ne.VersionEnd);return Nt.integerFromBuffer(i)!==r.xpubkey?new yl.InvalidNetwork(i):null};ne.prototype._buildFromPrivate=function(e){var t=qr.clone(e._buffers),r=wx.getG().mul(tT.fromBuffer(t.privateKey));return t.publicKey=wx.pointToCompressed(r),t.version=Nt.integerAsBuffer(gc.get(Nt.integerFromBuffer(t.version)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};ne.prototype._buildFromObject=function(e){var t={version:e.network?Nt.integerAsBuffer(gc.get(e.network).xpubkey):e.version,depth:qr.isNumber(e.depth)?Nt.integerAsSingleByteBuffer(e.depth):e.depth,parentFingerPrint:qr.isNumber(e.parentFingerPrint)?Nt.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:qr.isNumber(e.childIndex)?Nt.integerAsBuffer(e.childIndex):e.childIndex,chainCode:qr.isString(e.chainCode)?Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:qr.isString(e.publicKey)?Buffer.from(e.publicKey,"hex"):Nt.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:qr.isNumber(e.checksum)?Nt.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};ne.prototype._buildFromSerialized=function(e){var t=Td.decode(e),r={version:t.slice(ne.VersionStart,ne.VersionEnd),depth:t.slice(ne.DepthStart,ne.DepthEnd),parentFingerPrint:t.slice(ne.ParentFingerPrintStart,ne.ParentFingerPrintEnd),childIndex:t.slice(ne.ChildIndexStart,ne.ChildIndexEnd),chainCode:t.slice(ne.ChainCodeStart,ne.ChainCodeEnd),publicKey:t.slice(ne.PublicKeyStart,ne.PublicKeyEnd),checksum:t.slice(ne.ChecksumStart,ne.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};ne.prototype._buildFromBuffers=function(e){ne._validateBufferArguments(e),QI.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=Nt.concat(t),i=Td.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new yl.InvalidB58Checksum(r,i);var n=gc.get(Nt.integerFromBuffer(e.version)),o;o=Td.encode(Nt.concat(t)),e.xpubkey=Buffer.from(o);var u=new iT(e.publicKey,{network:n}),m=ne.ParentFingerPrintSize,_=rT.sha256ripemd160(u.toBuffer()).slice(0,m);return QI.defineImmutable(this,{xpubkey:o,network:n,depth:Nt.integerFromSingleByteBuffer(e.depth),publicKey:u,fingerPrint:_}),this};ne._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Ad(Nt.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),Ad(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",ne.VersionSize),t("depth",ne.DepthSize),t("parentFingerPrint",ne.ParentFingerPrintSize),t("childIndex",ne.ChildIndexSize),t("chainCode",ne.ChainCodeSize),t("publicKey",ne.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",ne.CheckSumSize)};ne.fromString=function(e){return eT.checkArgument(qr.isString(e),"No valid string was provided"),new ne(e)};ne.fromObject=function(e){return eT.checkArgument(qr.isObject(e),"No valid argument was provided"),new ne(e)};ne.prototype.toString=function(){return this.xpubkey};ne.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};ne.prototype.toObject=ne.prototype.toJSON=function(){return{network:gc.get(Nt.integerFromBuffer(this._buffers.version)).name,depth:Nt.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:Nt.integerFromBuffer(this.fingerPrint),parentFingerPrint:Nt.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:Nt.integerFromBuffer(this._buffers.childIndex),chainCode:Nt.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:Nt.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}};ne.fromBuffer=function(e){return new ne(e)};ne.prototype.toBuffer=function(){return Nt.copy(this._buffers.xpubkey)};ne.Hardened=2147483648;ne.RootElementAlias=["m","M"];ne.VersionSize=4;ne.DepthSize=1;ne.ParentFingerPrintSize=4;ne.ChildIndexSize=4;ne.ChainCodeSize=32;ne.PublicKeySize=33;ne.CheckSumSize=4;ne.DataSize=78;ne.SerializedByteSize=82;ne.VersionStart=0;ne.VersionEnd=ne.VersionStart+ne.VersionSize;ne.DepthStart=ne.VersionEnd;ne.DepthEnd=ne.DepthStart+ne.DepthSize;ne.ParentFingerPrintStart=ne.DepthEnd;ne.ParentFingerPrintEnd=ne.ParentFingerPrintStart+ne.ParentFingerPrintSize;ne.ChildIndexStart=ne.ParentFingerPrintEnd;ne.ChildIndexEnd=ne.ChildIndexStart+ne.ChildIndexSize;ne.ChainCodeStart=ne.ChildIndexEnd;ne.ChainCodeEnd=ne.ChainCodeStart+ne.ChainCodeSize;ne.PublicKeyStart=ne.ChainCodeEnd;ne.PublicKeyEnd=ne.PublicKeyStart+ne.PublicKeySize;ne.ChecksumStart=ne.PublicKeyEnd;ne.ChecksumEnd=ne.ChecksumStart+ne.CheckSumSize;Ad(ne.PublicKeyEnd===ne.DataSize);Ad(ne.ChecksumEnd===ne.SerializedByteSize);sT.exports=ne});var Ex=X((RX,lT)=>{"use strict";var Od=require("assert"),aT=require("buffer"),Nr=Et(),cT=xt(),uT=Xr(),fU=ol(),wl=du(),Ix=Dr(),xc=io(),lU=eo(),fT=ao(),pU=xl(),Nu=Yi(),bs=Nu.HDPrivateKey,dr=Yt(),Sl=Rr(),hU=128,oT=1/8,dU=512;function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(!e)return this._generateRandomly();if(xc.get(e))return this._generateRandomly(e);if(Nr.isString(e)||dr.isBuffer(e))if(J.isValidSerialized(e))this._buildFromSerialized(e);else if(Sl.isValidJSON(e))this._buildFromJSON(e);else if(dr.isBuffer(e)&&J.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw J.getSerializedError(e);else if(Nr.isObject(e))this._buildFromObject(e);else throw new bs.UnrecognizedArgument(e)}J.isValidPath=function(e,t){if(Nr.isString(e)){var r=J._getDerivationIndexes(e);return r!==null&&Nr.every(r,J.isValidPath)}return Nr.isNumber(e)?(e<J.Hardened&&t===!0&&(e+=J.Hardened),e>=0&&e<J.MaxIndex):!1};J._getDerivationIndexes=function(e){var t=e.split("/");if(Nr.includes(J.RootElementAlias,e))return[];if(!Nr.includes(J.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=J.Hardened),o});return Nr.some(r,isNaN)?null:r};J.prototype.derive=function(e,t){return this.deriveNonCompliantChild(e,t)};J.prototype.deriveChild=function(e,t){if(Nr.isNumber(e))return this._deriveWithNumber(e,t);if(Nr.isString(e))return this._deriveFromString(e);throw new bs.InvalidDerivationArgument(e)};J.prototype.deriveNonCompliantChild=function(e,t){if(Nr.isNumber(e))return this._deriveWithNumber(e,t,!0);if(Nr.isString(e))return this._deriveFromString(e,!0);throw new bs.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t,r){if(!J.isValidPath(e,t))throw new bs.InvalidPath(e);t=e>=J.Hardened?!0:t,e<J.Hardened&&t===!0&&(e+=J.Hardened);var i=dr.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=dr.concat([Buffer.from([0]),o,i])}else if(t){var u=this.privateKey.bn.toBuffer({size:32});Od(u.length===32,"length of private key buffer is expected to be 32 bytes"),n=dr.concat([Buffer.from([0]),u,i])}else n=dr.concat([this.publicKey.toBuffer(),i]);var m=Ix.sha512hmac(n,this._buffers.chainCode),_=uT.fromBuffer(m.slice(0,32),{size:32}),w=m.slice(32,64),I=_.add(this.privateKey.toBigNumber()).umod(lU.getN()).toBuffer({size:32});if(!fT.isValid(I))return this._deriveWithNumber(e+1,null,r);var T=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:w,privateKey:I});return T};J.prototype._deriveFromString=function(e,t){if(!J.isValidPath(e))throw new bs.InvalidPath(e);var r=J._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};J.isValidSerialized=function(e,t){return!J.getSerializedError(e,t)};J.getSerializedError=function(e,t){if(!(Nr.isString(e)||dr.isBuffer(e)))return new bs.UnrecognizedArgument("Expected string or buffer");if(!fU.validCharacters(e))return new Nu.InvalidB58Char("(unknown)",e);try{e=wl.decode(e)}catch{return new Nu.InvalidB58Checksum(e)}if(e.length!==J.DataLength)return new bs.InvalidLength(e);if(!Nr.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}return null};J._validateNetwork=function(e,t){var r=xc.get(t);if(!r)return new Nu.InvalidNetworkArgument(t);var i=e.slice(0,4);return dr.integerFromBuffer(i)!==r.xprivkey?new Nu.InvalidNetwork(i):null};J.fromString=function(e){return cT.checkArgument(Nr.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return cT.checkArgument(Nr.isObject(e),"No valid argument was provided"),new J(e)};J.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};J.prototype._buildFromObject=function(e){var t={version:e.network?dr.integerAsBuffer(xc.get(e.network).xprivkey):e.version,depth:Nr.isNumber(e.depth)?dr.integerAsSingleByteBuffer(e.depth):e.depth,parentFingerPrint:Nr.isNumber(e.parentFingerPrint)?dr.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Nr.isNumber(e.childIndex)?dr.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Nr.isString(e.chainCode)?Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:Nr.isString(e.privateKey)&&Sl.isHexa(e.privateKey)?Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:dr.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=wl.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),privateKey:t.slice(J.PrivateKeyStart,J.PrivateKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};J.prototype._generateRandomly=function(e){return J.fromSeed(pU.getRandomBuffer(64),e)};J.fromSeed=function(e,t){if(Sl.isHexaString(e)&&(e=Buffer.from(e,"hex")),!Buffer.isBuffer(e))throw new bs.InvalidEntropyArgument(e);if(e.length<hU*oT)throw new bs.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>dU*oT)throw new bs.InvalidEntropyArgument.TooMuchEntropy(e);var r=Ix.sha512hmac(e,Buffer.from("Bitcoin seed"));return new J({network:xc.get(t)||xc.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};J.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=Sx();this._hdPublicKey=new e(this)}};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),Sl.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,dr.emptyBuffer(1),e.privateKey],r=aT.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=wl.checksum(r);else if(e.checksum.toString()!==wl.checksum(r).toString())throw new Nu.InvalidB58Checksum(r);var i=xc.get(dr.integerFromBuffer(e.version)),n;n=wl.encode(aT.Buffer.concat(t)),e.xprivkey=Buffer.from(n);var o=new fT(uT.fromBuffer(e.privateKey),i),u=o.toPublicKey(),m=J.ParentFingerPrintSize,_=Ix.sha256ripemd160(u.toBuffer()).slice(0,m);return Sl.defineImmutable(this,{xprivkey:n,network:i,depth:dr.integerFromSingleByteBuffer(e.depth),privateKey:o,publicKey:u,fingerPrint:_}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Od(dr.isBuffer(n),r+" argument is not a buffer"),Od(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("privateKey",J.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.prototype.toString=function(){return this.xprivkey};J.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:xc.get(dr.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:dr.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:dr.integerFromBuffer(this.fingerPrint),parentFingerPrint:dr.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:dr.integerFromBuffer(this._buffers.childIndex),chainCode:dr.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:dr.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}};J.fromBuffer=function(e){return new J(e.toString())};J.prototype.toBuffer=function(){return dr.copy(this._buffers.xprivkey)};J.DefaultDepth=0;J.DefaultFingerprint=0;J.DefaultChildIndex=0;J.Hardened=2147483648;J.MaxIndex=2*J.Hardened;J.RootElementAlias=["m","M","m'","M'"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PrivateKeySize=32;J.CheckSumSize=4;J.DataLength=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PrivateKeyStart=J.ChainCodeEnd+1;J.PrivateKeyEnd=J.PrivateKeyStart+J.PrivateKeySize;J.ChecksumStart=J.PrivateKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;Od(J.ChecksumEnd===J.SerializedByteSize);lT.exports=J});var dT=X((OX,hT)=>{"use strict";var El=Et(),mU=ao(),vU=jn(),kd=Vn(),pT=ri(),Il=fl(),Tx=di(),gU=Dr().sha256sha256,xU=Rr(),mo=xt();function Fr(e){return this instanceof Fr?(mo.checkArgument(El.isString(e),"First argument should be a string"),this.message=e,this):new Fr(e)}Fr.MAGIC_BYTES=Buffer.from(`Bitcoin Signed Message:
30
- `);Fr.prototype.magicHash=function(){var t=pT.varintBufNum(Fr.MAGIC_BYTES.length),r=Buffer.from(this.message),i=pT.varintBufNum(r.length),n=Buffer.concat([t,Fr.MAGIC_BYTES,i,r]),o=gU(n);return o};Fr.prototype._sign=function(t){mo.checkArgument(t instanceof mU,"First argument should be an instance of PrivateKey");let r=this.magicHash(),i=Il.sign(r,t,{randomK:!0});return Il.calci(r,i,t.toPublicKey()),i};Fr.prototype.sign=function(t){var r=this._sign(t);return r.toCompact().toString("base64")};Fr.prototype._verify=function(t,r){mo.checkArgument(t instanceof vU,"First argument should be an instance of PublicKey"),mo.checkArgument(r instanceof Tx,"Second argument should be an instance of Signature");var i=this.magicHash(),n=Il.verify(i,r,t);return n||(this.error="The signature was invalid"),n};Fr.prototype.verify=function(t,r){mo.checkArgument(t),mo.checkArgument(r&&El.isString(r)),El.isString(t)&&(t=kd.fromString(t));var i=Tx.fromCompact(Buffer.from(r,"base64"));let n=this.magicHash();var o=Il.recoverPublicKey(n,i),u=kd.fromPublicKey(o,t.network);return t.toString()!==u.toString()?(this.error="The signature did not match the message digest",!1):this._verify(o,i)};Fr.prototype.recoverPublicKey=function(t,r){mo.checkArgument(t),mo.checkArgument(r&&El.isString(r)),El.isString(t)&&(t=kd.fromString(t));var i=Tx.fromCompact(Buffer.from(r,"base64"));let n=this.magicHash();var o=Il.recoverPublicKey(n,i),u=kd.fromPublicKey(o,t.network);return t.toString()!==u.toString()&&(this.error="The signature did not match the message digest"),o.toString()};Fr.fromString=function(e){return new Fr(e)};Fr.fromJSON=function(t){return xU.isValidJSON(t)&&(t=JSON.parse(t)),new Fr(t.message)};Fr.prototype.toObject=function(){return{message:this.message}};Fr.prototype.toJSON=function(){return JSON.stringify(this.toObject())};Fr.prototype.toString=function(){return this.message};Fr.prototype.inspect=function(){return"<Message: "+this.toString()+">"};hT.exports=Fr;var AX=Li()});var _T=X((kX,bT)=>{"use strict";var vT=Et(),gT=require("url"),mT=Vn(),xT=hd(),Br=function(e,t){if(!(this instanceof Br))return new Br(e,t);if(this.extras={},this.knownParams=t||[],this.address=this.network=this.amount=this.message=null,typeof e=="string"){var r=Br.parse(e);r.amount&&(r.amount=this._parseAmount(r.amount)),this._fromObject(r)}else if(typeof e=="object")this._fromObject(e);else throw new TypeError("Unrecognized data format.")};Br.fromString=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return new Br(t)};Br.fromObject=function(t){return new Br(t)};Br.isValid=function(e,t){try{new Br(e,t)}catch{return!1}return!0};Br.parse=function(e){var t=gT.parse(e,!0);if(t.protocol!=="bitcoin:")throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query};Br.Members=["address","amount","message","label","r"];Br.prototype._fromObject=function(e){if(!mT.isValid(e.address))throw new TypeError("Invalid bitcoin address");this.address=new mT(e.address),this.network=this.address.network,this.amount=e.amount;for(var t in e)if(!(t==="address"||t==="amount")){if(/^req-/.exec(t)&&this.knownParams.indexOf(t)===-1)throw Error("Unknown required argument "+t);var r=Br.Members.indexOf(t)>-1?this:this.extras;r[t]=e[t]}};Br.prototype._parseAmount=function(e){if(e=Number(e),isNaN(e))throw new TypeError("Invalid amount");return xT.fromBTC(e).toSatoshis()};Br.prototype.toObject=Br.prototype.toJSON=function(){for(var t={},r=0;r<Br.Members.length;r++){var i=Br.Members[r];this.hasOwnProperty(i)&&typeof this[i]<"u"&&(t[i]=this[i].toString())}return vT.extend(t,this.extras),t};Br.prototype.toString=function(){var e={};return this.amount&&(e.amount=xT.fromSatoshis(this.amount).toBTC()),this.message&&(e.message=this.message),this.label&&(e.label=this.label),this.r&&(e.r=this.r),vT.extend(e,this.extras),gT.format({protocol:"bitcoin:",host:this.address,query:e})};Br.prototype.inspect=function(){return"<URI: "+this.toString()+">"};bT.exports=Br});var Rx=X((PX,yT)=>{"use strict";var Le=yT.exports;Le.version="v"+Vw().version;Le.versionGuard=function(e){if(e!==void 0){var t="More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.";throw new Error(t)}};Le.versionGuard(global._bitcore);global._bitcore=Le.version;Le.crypto={};Le.crypto.BN=Xr();Le.crypto.ECDSA=fl();Le.crypto.Schnorr=Mg();Le.crypto.Hash=Dr();Le.crypto.Random=xl();Le.crypto.Point=eo();Le.crypto.Signature=di();Le.crypto.TaggedHash=ca();Le.encoding={};Le.encoding.Base58=ol();Le.encoding.Base58Check=du();Le.encoding.BufferReader=gs();Le.encoding.BufferWriter=ri();Le.encoding.Varint=DI();Le.util={};Le.util.buffer=Yt();Le.util.js=Rr();Le.util.preconditions=xt();Le.errors=Yi();Le.Address=Vn();Le.Block=JI();Le.MerkleBlock=yx();Le.BlockHeader=_l();Le.HDPrivateKey=Ex();Le.HDPublicKey=Sx();Le.Message=dT();Le.Networks=io();Le.Opcode=Jh();Le.PrivateKey=ao();Le.PublicKey=jn();Le.Script=Li();Le.Transaction=vl();Le.URI=_T();Le.Unit=hd();Le.deps={};Le.deps.bnjs=zv();Le.deps.bs58=Ig();Le.deps.Buffer=Buffer;Le.deps.elliptic=bg();Le.deps._=Et();Le.Transaction.sighash=fa()});var ET=X((rJ,ST)=>{"use strict";var xa=wh();xa.createWebSocketStream=mv();xa.Server=Mv();xa.Receiver=vh();xa.Sender=gh();xa.WebSocket=xa;xa.WebSocketServer=xa.Server;ST.exports=xa});var TT=X((iJ,IT)=>{"use strict";IT.exports=ET()});var bU={};Oa(bU,{Provider:()=>Ln,assets:()=>Px,bitcore:()=>_U,models:()=>Nx,services:()=>Mx,types:()=>Fv,utils:()=>Ox});module.exports=B5(bU);function Yu(e,t){return function(){return e.apply(t,arguments)}}var{toString:M5}=Object.prototype,{getPrototypeOf:V0}=Object,gp=(e=>t=>{let r=M5.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),rs=e=>(e=e.toLowerCase(),t=>gp(t)===e),xp=e=>t=>typeof t===e,{isArray:Bc}=Array,Zu=xp("undefined");function C5(e){return e!==null&&!Zu(e)&&e.constructor!==null&&!Zu(e.constructor)&&fn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var a1=rs("ArrayBuffer");function L5(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&a1(e.buffer),t}var U5=xp("string"),fn=xp("function"),o1=xp("number"),bp=e=>e!==null&&typeof e=="object",D5=e=>e===!0||e===!1,vp=e=>{if(gp(e)!=="object")return!1;let t=V0(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},q5=rs("Date"),F5=rs("File"),H5=rs("Blob"),z5=rs("FileList"),V5=e=>bp(e)&&fn(e.pipe),j5=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||fn(e.append)&&((t=gp(e))==="formdata"||t==="object"&&fn(e.toString)&&e.toString()==="[object FormData]"))},W5=rs("URLSearchParams"),K5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Xu(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),Bc(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let o=r?Object.getOwnPropertyNames(e):Object.keys(e),u=o.length,m;for(i=0;i<u;i++)m=o[i],t.call(null,e[m],m,e)}}function c1(e,t){t=t.toLowerCase();let r=Object.keys(e),i=r.length,n;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}var u1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,f1=e=>!Zu(e)&&e!==u1;function z0(){let{caseless:e}=f1(this)&&this||{},t={},r=(i,n)=>{let o=e&&c1(t,n)||n;vp(t[o])&&vp(i)?t[o]=z0(t[o],i):vp(i)?t[o]=z0({},i):Bc(i)?t[o]=i.slice():t[o]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&Xu(arguments[i],r);return t}var G5=(e,t,r,{allOwnKeys:i}={})=>(Xu(t,(n,o)=>{r&&fn(n)?e[o]=Yu(n,r):e[o]=n},{allOwnKeys:i}),e),$5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Y5=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Z5=(e,t,r,i)=>{let n,o,u,m={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),o=n.length;o-- >0;)u=n[o],(!i||i(u,e,t))&&!m[u]&&(t[u]=e[u],m[u]=!0);e=r!==!1&&V0(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},X5=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},J5=e=>{if(!e)return null;if(Bc(e))return e;let t=e.length;if(!o1(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Q5=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&V0(Uint8Array)),ek=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),n;for(;(n=i.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},tk=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},rk=rs("HTMLFormElement"),ik=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),n1=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),nk=rs("RegExp"),l1=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};Xu(r,(n,o)=>{let u;(u=t(n,o,e))!==!1&&(i[o]=u||n)}),Object.defineProperties(e,i)},sk=e=>{l1(e,(t,r)=>{if(fn(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(fn(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ak=(e,t)=>{let r={},i=n=>{n.forEach(o=>{r[o]=!0})};return Bc(e)?i(e):i(String(e).split(t)),r},ok=()=>{},ck=(e,t)=>(e=+e,Number.isFinite(e)?e:t),H0="abcdefghijklmnopqrstuvwxyz",s1="0123456789",p1={DIGIT:s1,ALPHA:H0,ALPHA_DIGIT:H0+H0.toUpperCase()+s1},uk=(e=16,t=p1.ALPHA_DIGIT)=>{let r="",{length:i}=t;for(;e--;)r+=t[Math.random()*i|0];return r};function fk(e){return!!(e&&fn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var lk=e=>{let t=new Array(10),r=(i,n)=>{if(bp(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;let o=Bc(i)?[]:{};return Xu(i,(u,m)=>{let _=r(u,n+1);!Zu(_)&&(o[m]=_)}),t[n]=void 0,o}}return i};return r(e,0)},pk=rs("AsyncFunction"),hk=e=>e&&(bp(e)||fn(e))&&fn(e.then)&&fn(e.catch),z={isArray:Bc,isArrayBuffer:a1,isBuffer:C5,isFormData:j5,isArrayBufferView:L5,isString:U5,isNumber:o1,isBoolean:D5,isObject:bp,isPlainObject:vp,isUndefined:Zu,isDate:q5,isFile:F5,isBlob:H5,isRegExp:nk,isFunction:fn,isStream:V5,isURLSearchParams:W5,isTypedArray:Q5,isFileList:z5,forEach:Xu,merge:z0,extend:G5,trim:K5,stripBOM:$5,inherits:Y5,toFlatObject:Z5,kindOf:gp,kindOfTest:rs,endsWith:X5,toArray:J5,forEachEntry:ek,matchAll:tk,isHTMLForm:rk,hasOwnProperty:n1,hasOwnProp:n1,reduceDescriptors:l1,freezeMethods:sk,toObjectSet:ak,toCamelCase:ik,noop:ok,toFiniteNumber:ck,findKey:c1,global:u1,isContextDefined:f1,ALPHABET:p1,generateString:uk,isSpecCompliantForm:fk,toJSONObject:lk,isAsyncFn:pk,isThenable:hk};function Mc(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n)}z.inherits(Mc,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var h1=Mc.prototype,d1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{d1[e]={value:e}});Object.defineProperties(Mc,d1);Object.defineProperty(h1,"isAxiosError",{value:!0});Mc.from=(e,t,r,i,n,o)=>{let u=Object.create(h1);return z.toFlatObject(e,u,function(_){return _!==Error.prototype},m=>m!=="isAxiosError"),Mc.call(u,e.message,t,r,i,n),u.cause=e,u.name=e.name,o&&Object.assign(u,o),u};var _e=Mc;var Z1=Mr(Y1(),1),wp=Z1.default;function em(e){return z.isPlainObject(e)||z.isArray(e)}function J1(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function X1(e,t,r){return e?e.concat(t).map(function(n,o){return n=J1(n),!r&&o?"["+n+"]":n}).join(r?".":""):t}function Zk(e){return z.isArray(e)&&!e.some(em)}var Xk=z.toFlatObject(z,{},null,function(t){return/^is[A-Z]/.test(t)});function Jk(e,t,r){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new(wp||FormData),r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(U,Z){return!z.isUndefined(Z[U])});let i=r.metaTokens,n=r.visitor||I,o=r.dots,u=r.indexes,_=(r.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(n))throw new TypeError("visitor must be a function");function w(B){if(B===null)return"";if(z.isDate(B))return B.toISOString();if(!_&&z.isBlob(B))throw new _e("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(B)||z.isTypedArray(B)?_&&typeof Blob=="function"?new Blob([B]):Buffer.from(B):B}function I(B,U,Z){let $=B;if(B&&!Z&&typeof B=="object"){if(z.endsWith(U,"{}"))U=i?U:U.slice(0,-2),B=JSON.stringify(B);else if(z.isArray(B)&&Zk(B)||(z.isFileList(B)||z.endsWith(U,"[]"))&&($=z.toArray(B)))return U=J1(U),$.forEach(function(ee,ce){!(z.isUndefined(ee)||ee===null)&&t.append(u===!0?X1([U],ce,o):u===null?U:U+"[]",w(ee))}),!1}return em(B)?!0:(t.append(X1(Z,U,o),w(B)),!1)}let T=[],N=Object.assign(Xk,{defaultVisitor:I,convertValue:w,isVisitable:em});function C(B,U){if(!z.isUndefined(B)){if(T.indexOf(B)!==-1)throw Error("Circular reference detected in "+U.join("."));T.push(B),z.forEach(B,function($,H){(!(z.isUndefined($)||$===null)&&n.call(t,$,z.isString(H)?H.trim():H,U,N))===!0&&C($,U?U.concat(H):[H])}),T.pop()}}if(!z.isObject(e))throw new TypeError("data must be an object");return C(e),t}var ka=Jk;function Q1(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function ey(e,t){this._pairs=[],e&&ka(e,this,t)}var ty=ey.prototype;ty.append=function(t,r){this._pairs.push([t,r])};ty.toString=function(t){let r=t?function(i){return t.call(this,i,Q1)}:Q1;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var ry=ey;function Qk(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Io(e,t,r){if(!t)return e;let i=r&&r.encode||Qk,n=r&&r.serialize,o;if(n?o=n(t,r):o=z.isURLSearchParams(t)?t.toString():new ry(t,r).toString(i),o){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var tm=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,function(i){i!==null&&t(i)})}},rm=tm;var Cc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var iy=Mr(require("url"),1),ny=iy.default.URLSearchParams;var sy={isNode:!0,classes:{URLSearchParams:ny,FormData:wp,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var im={};Oa(im,{hasBrowserEnv:()=>ay,hasStandardBrowserEnv:()=>eP,hasStandardBrowserWebWorkerEnv:()=>tP});var ay=typeof window<"u"&&typeof document<"u",eP=(e=>ay&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),tP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Vr={...im,...sy};function nm(e,t){return ka(e,new Vr.classes.URLSearchParams,Object.assign({visitor:function(r,i,n,o){return Vr.isNode&&z.isBuffer(r)?(this.append(i,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function rP(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function iP(e){let t={},r=Object.keys(e),i,n=r.length,o;for(i=0;i<n;i++)o=r[i],t[o]=e[o];return t}function nP(e){function t(r,i,n,o){let u=r[o++];if(u==="__proto__")return!0;let m=Number.isFinite(+u),_=o>=r.length;return u=!u&&z.isArray(n)?n.length:u,_?(z.hasOwnProp(n,u)?n[u]=[n[u],i]:n[u]=i,!m):((!n[u]||!z.isObject(n[u]))&&(n[u]=[]),t(r,i,n[u],o)&&z.isArray(n[u])&&(n[u]=iP(n[u])),!m)}if(z.isFormData(e)&&z.isFunction(e.entries)){let r={};return z.forEachEntry(e,(i,n)=>{t(rP(i),n,r,0)}),r}return null}var Sp=nP;function sP(e,t,r){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var sm={transitional:Cc,adapter:["xhr","http"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,o=z.isObject(t);if(o&&z.isHTMLForm(t)&&(t=new FormData(t)),z.isFormData(t))return n?JSON.stringify(Sp(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let m;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return nm(t,this.formSerializer).toString();if((m=z.isFileList(t))||i.indexOf("multipart/form-data")>-1){let _=this.env&&this.env.FormData;return ka(m?{"files[]":t}:t,_&&new _,this.formSerializer)}}return o||n?(r.setContentType("application/json",!1),sP(t)):t}],transformResponse:[function(t){let r=this.transitional||sm.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(t&&z.isString(t)&&(i&&!this.responseType||n)){let u=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(m){if(u)throw m.name==="SyntaxError"?_e.from(m,_e.ERR_BAD_RESPONSE,this,null,this.response):m}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{sm.headers[e]={}});var Lc=sm;var aP=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oy=e=>{let t={},r,i,n;return e&&e.split(`
29
+ `+new Error().stack};ru.Error.prototype=Object.create(Error.prototype);ru.Error.prototype.name="bitcore.Error";var iB=Kw();rB(ru.Error,iB);jv.exports=ru.Error;jv.exports.extend=function(e){return Gw(ru.Error,e)}});var xt=X((UY,Yw)=>{"use strict";var Jf=Yi(),nB=Et();Yw.exports={checkState:function(e,t){if(!e)throw new Jf.InvalidState(t)},checkArgument:function(e,t,r,i){if(!e)throw new Jf.InvalidArgument(t,r,i)},checkArgumentType:function(e,t,r){if(r=r||"(unknown name)",nB.isString(t)){if(t==="Buffer"){var i=require("buffer");if(!i.Buffer.isBuffer(e))throw new Jf.InvalidArgumentType(e,t,r)}else if(typeof e!==t&&e&&e.constructor&&e.constructor.name!==t)throw new Jf.InvalidArgumentType(e,t,r)}else if(!(e instanceof t))throw new Jf.InvalidArgumentType(e,t.name,r)},isType:function(e,t,r){try{return this.checkArgumentType(e,t,r),!0}catch{return!1}}}});var Rr=X((DY,Jw)=>{"use strict";var Xw=Et(),Zw=function(t){return Xw.isString(t)?/^[0-9a-fA-F]+$/.test(t):!1};Jw.exports={isValidJSON:function(t){var r;if(!Xw.isString(t))return!1;try{r=JSON.parse(t)}catch{return!1}return typeof r=="object"},isHexa:Zw,isHexaString:Zw,cloneArray:function(e){return[].concat(e)},defineImmutable:function(t,r){return Object.keys(r).forEach(function(i){Object.defineProperty(t,i,{configurable:!1,enumerable:!0,value:r[i]})}),t},isNaturalNumber:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&t>=0}}});var Yt=X((HY,Qf)=>{"use strict";var Qw=require("buffer"),qY=require("assert"),FY=Rr(),Wa=xt();function eS(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i<r;i++)if(e[i]!==t[i])return!1;return!0}Qf.exports={fill:function(t,r){Wa.checkArgumentType(t,"Buffer","buffer"),Wa.checkArgumentType(r,"number","value");for(var i=t.length,n=0;n<i;n++)t[n]=r;return t},copy:function(e){var t=Buffer.alloc(e.length);return e.copy(t),t},isBuffer:function(t){return Qw.Buffer.isBuffer(t)||t instanceof Uint8Array},emptyBuffer:function(t){Wa.checkArgumentType(t,"number","bytes");for(var r=Buffer.alloc(t),i=0;i<t;i++)r.write("\0",i);return r},concat:Qw.Buffer.concat,equals:eS,equal:eS,integerAsSingleByteBuffer:function(t){return Wa.checkArgumentType(t,"number","integer"),Buffer.from([t&255])},integerAsBuffer:function(t){Wa.checkArgumentType(t,"number","integer");var r=[];return r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(t&255),Buffer.from(r)},integerFromBuffer:function(t){return Wa.checkArgumentType(t,"Buffer","buffer"),t[0]<<24|t[1]<<16|t[2]<<8|t[3]},integerFromSingleByteBuffer:function(t){return Wa.checkArgumentType(t,"Buffer","buffer"),t[0]},bufferToHex:function(t){return Wa.checkArgumentType(t,"Buffer","buffer"),t.toString("hex")},reverse:function(t){return Buffer.from(t).reverse()}};Qf.exports.NULL_HASH=Qf.exports.fill(Buffer.alloc(32),0);Qf.exports.EMPTY_BUFFER=Buffer.alloc(0)});var Xr=X((zY,rS)=>{"use strict";var kt=zv(),Ah=xt(),tS=Et(),sB=Yt(),Oh=function(e){for(var t=Buffer.alloc(e.length),r=0;r<e.length;r++)t[r]=e[e.length-1-r];return t};kt.Zero=new kt(0);kt.One=new kt(1);kt.Minus1=new kt(-1);kt.fromNumber=function(e){return Ah.checkArgument(tS.isNumber(e)),new kt(e)};kt.fromString=function(e,t){return Ah.checkArgument(tS.isString(e)),new kt(e,t)};kt.fromBuffer=function(e,t){Ah.checkArgument(sB.isBuffer(e),"first argument should be a buffer"),e=Buffer.from(e),typeof t<"u"&&t.endian==="little"&&(e=Oh(e));var r=e.toString("hex"),i=new kt(r,16);return i};kt.fromSM=function(e,t){var r;if(e.length===0)return kt.fromBuffer(Buffer.from([0]));var i="big";return t&&(i=t.endian),i==="little"&&(e=Oh(e)),e[0]&128?(e[0]=e[0]&127,r=kt.fromBuffer(e),r.neg().copy(r)):r=kt.fromBuffer(e),r};kt.prototype.toNumber=function(){return parseInt(this.toString(10),10)};kt.prototype.toBuffer=function(e){var t,r;if(e&&e.size){r=this.toString(16,2);var i=r.length/2;t=Buffer.from(r,"hex"),i===e.size?t=t:i>e.size?t=kt.trim(t,i):i<e.size&&(t=kt.pad(t,i,e.size))}else r=this.toString(16,2),t=Buffer.from(r,"hex");return typeof e<"u"&&e.endian==="little"&&(t=Oh(t)),t};kt.prototype.toSMBigEndian=function(){var e;return this.cmp(kt.Zero)===-1?(e=this.neg().toBuffer(),e[0]&128?e=Buffer.concat([Buffer.from([128]),e]):e[0]=e[0]|128):(e=this.toBuffer(),e[0]&128&&(e=Buffer.concat([Buffer.from([0]),e]))),e.length===1&e[0]===0&&(e=Buffer.from([])),e};kt.prototype.toSM=function(e){var t=e?e.endian:"big",r=this.toSMBigEndian();return t==="little"&&(r=Oh(r)),r};kt.fromScriptNumBuffer=function(e,t,r){var i=r||4;if(Ah.checkArgument(e.length<=i,new Error("script number overflow")),t&&e.length>0&&!(e[e.length-1]&127)&&(e.length<=1||!(e[e.length-2]&128)))throw new Error("non-minimally encoded script number");return kt.fromSM(e,{endian:"little"})};kt.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})};kt.trim=function(e,t){return e.slice(t-e.length,e.length)};kt.pad=function(e,t,r){for(var i=Buffer.alloc(r),n=0;n<e.length;n++)i[i.length-1-n]=e[e.length-1-n];for(n=0;n<r-t;n++)i[n]=0;return i};rS.exports=kt});var iS=X((VY,aB)=>{aB.exports={name:"elliptic",version:"6.5.5",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var cs=X((nS,Wv)=>{(function(e,t){"use strict";function r(f,c){if(!f)throw new Error(c||"Assertion failed")}function i(f,c){f.super_=c;var p=function(){};p.prototype=c.prototype,f.prototype=new p,f.prototype.constructor=f}function n(f,c,p){if(n.isBN(f))return f;this.negative=0,this.words=null,this.length=0,this.red=null,f!==null&&((c==="le"||c==="be")&&(p=c,c=10),this._init(f||0,c||10,p||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=require("buffer").Buffer}catch{}n.isBN=function(c){return c instanceof n?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===n.wordSize&&Array.isArray(c.words)},n.max=function(c,p){return c.cmp(p)>0?c:p},n.min=function(c,p){return c.cmp(p)<0?c:p},n.prototype._init=function(c,p,v){if(typeof c=="number")return this._initNumber(c,p,v);if(typeof c=="object")return this._initArray(c,p,v);p==="hex"&&(p=16),r(p===(p|0)&&p>=2&&p<=36),c=c.toString().replace(/\s+/g,"");var g=0;c[0]==="-"&&(g++,this.negative=1),g<c.length&&(p===16?this._parseHex(c,g,v):(this._parseBase(c,p,g),v==="le"&&this._initArray(this.toArray(),p,v)))},n.prototype._initNumber=function(c,p,v){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(r(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),v==="le"&&this._initArray(this.toArray(),p,v)},n.prototype._initArray=function(c,p,v){if(r(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var x,S,b=0;if(v==="be")for(g=c.length-1,x=0;g>=0;g-=3)S=c[g]|c[g-1]<<8|c[g-2]<<16,this.words[x]|=S<<b&67108863,this.words[x+1]=S>>>26-b&67108863,b+=24,b>=26&&(b-=26,x++);else if(v==="le")for(g=0,x=0;g<c.length;g+=3)S=c[g]|c[g+1]<<8|c[g+2]<<16,this.words[x]|=S<<b&67108863,this.words[x+1]=S>>>26-b&67108863,b+=24,b>=26&&(b-=26,x++);return this.strip()};function u(f,c){var p=f.charCodeAt(c);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function m(f,c,p){var v=u(f,p);return p-1>=c&&(v|=u(f,p-1)<<4),v}n.prototype._parseHex=function(c,p,v){this.length=Math.ceil((c.length-p)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var x=0,S=0,b;if(v==="be")for(g=c.length-1;g>=p;g-=2)b=m(c,p,g)<<x,this.words[S]|=b&67108863,x>=18?(x-=18,S+=1,this.words[S]|=b>>>26):x+=8;else{var l=c.length-p;for(g=l%2===0?p+1:p;g<c.length;g+=2)b=m(c,p,g)<<x,this.words[S]|=b&67108863,x>=18?(x-=18,S+=1,this.words[S]|=b>>>26):x+=8}this.strip()};function _(f,c,p,v){for(var g=0,x=Math.min(f.length,p),S=c;S<x;S++){var b=f.charCodeAt(S)-48;g*=v,b>=49?g+=b-49+10:b>=17?g+=b-17+10:g+=b}return g}n.prototype._parseBase=function(c,p,v){this.words=[0],this.length=1;for(var g=0,x=1;x<=67108863;x*=p)g++;g--,x=x/p|0;for(var S=c.length-v,b=S%g,l=Math.min(S,S-b)+v,d=0,A=v;A<l;A+=g)d=_(c,A,A+g,p),this.imuln(x),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(b!==0){var D=1;for(d=_(c,A,c.length,p),A=0;A<b;A++)D*=p;this.imuln(D),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},n.prototype.copy=function(c){c.words=new Array(this.length);for(var p=0;p<this.length;p++)c.words[p]=this.words[p];c.length=this.length,c.negative=this.negative,c.red=this.red},n.prototype.clone=function(){var c=new n(null);return this.copy(c),c},n.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],T=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(c,p){c=c||10,p=p|0||1;var v;if(c===16||c==="hex"){v="";for(var g=0,x=0,S=0;S<this.length;S++){var b=this.words[S],l=((b<<g|x)&16777215).toString(16);x=b>>>24-g&16777215,x!==0||S!==this.length-1?v=w[6-l.length]+l+v:v=l+v,g+=2,g>=26&&(g-=26,S--)}for(x!==0&&(v=x.toString(16)+v);v.length%p!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(c===(c|0)&&c>=2&&c<=36){var d=I[c],A=T[c];v="";var D=this.clone();for(D.negative=0;!D.isZero();){var V=D.modn(A).toString(c);D=D.idivn(A),D.isZero()?v=V+v:v=w[d-V.length]+V+v}for(this.isZero()&&(v="0"+v);v.length%p!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(c,p){return r(typeof o<"u"),this.toArrayLike(o,c,p)},n.prototype.toArray=function(c,p){return this.toArrayLike(Array,c,p)},n.prototype.toArrayLike=function(c,p,v){var g=this.byteLength(),x=v||Math.max(1,g);r(g<=x,"byte array longer than desired length"),r(x>0,"Requested array length <= 0"),this.strip();var S=p==="le",b=new c(x),l,d,A=this.clone();if(S){for(d=0;!A.isZero();d++)l=A.andln(255),A.iushrn(8),b[d]=l;for(;d<x;d++)b[d]=0}else{for(d=0;d<x-g;d++)b[d]=0;for(d=0;!A.isZero();d++)l=A.andln(255),A.iushrn(8),b[x-d-1]=l}return b},Math.clz32?n.prototype._countBits=function(c){return 32-Math.clz32(c)}:n.prototype._countBits=function(c){var p=c,v=0;return p>=4096&&(v+=13,p>>>=13),p>=64&&(v+=7,p>>>=7),p>=8&&(v+=4,p>>>=4),p>=2&&(v+=2,p>>>=2),v+p},n.prototype._zeroBits=function(c){if(c===0)return 26;var p=c,v=0;return p&8191||(v+=13,p>>>=13),p&127||(v+=7,p>>>=7),p&15||(v+=4,p>>>=4),p&3||(v+=2,p>>>=2),p&1||v++,v},n.prototype.bitLength=function(){var c=this.words[this.length-1],p=this._countBits(c);return(this.length-1)*26+p};function N(f){for(var c=new Array(f.bitLength()),p=0;p<c.length;p++){var v=p/26|0,g=p%26;c[p]=(f.words[v]&1<<g)>>>g}return c}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,p=0;p<this.length;p++){var v=this._zeroBits(this.words[p]);if(c+=v,v!==26)break}return c},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},n.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var p=0;p<c.length;p++)this.words[p]=this.words[p]|c.words[p];return this.strip()},n.prototype.ior=function(c){return r((this.negative|c.negative)===0),this.iuor(c)},n.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},n.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},n.prototype.iuand=function(c){var p;this.length>c.length?p=c:p=this;for(var v=0;v<p.length;v++)this.words[v]=this.words[v]&c.words[v];return this.length=p.length,this.strip()},n.prototype.iand=function(c){return r((this.negative|c.negative)===0),this.iuand(c)},n.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},n.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},n.prototype.iuxor=function(c){var p,v;this.length>c.length?(p=this,v=c):(p=c,v=this);for(var g=0;g<v.length;g++)this.words[g]=p.words[g]^v.words[g];if(this!==p)for(;g<p.length;g++)this.words[g]=p.words[g];return this.length=p.length,this.strip()},n.prototype.ixor=function(c){return r((this.negative|c.negative)===0),this.iuxor(c)},n.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},n.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},n.prototype.inotn=function(c){r(typeof c=="number"&&c>=0);var p=Math.ceil(c/26)|0,v=c%26;this._expand(p),v>0&&p--;for(var g=0;g<p;g++)this.words[g]=~this.words[g]&67108863;return v>0&&(this.words[g]=~this.words[g]&67108863>>26-v),this.strip()},n.prototype.notn=function(c){return this.clone().inotn(c)},n.prototype.setn=function(c,p){r(typeof c=="number"&&c>=0);var v=c/26|0,g=c%26;return this._expand(v+1),p?this.words[v]=this.words[v]|1<<g:this.words[v]=this.words[v]&~(1<<g),this.strip()},n.prototype.iadd=function(c){var p;if(this.negative!==0&&c.negative===0)return this.negative=0,p=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,p=this.isub(c),c.negative=1,p._normSign();var v,g;this.length>c.length?(v=this,g=c):(v=c,g=this);for(var x=0,S=0;S<g.length;S++)p=(v.words[S]|0)+(g.words[S]|0)+x,this.words[S]=p&67108863,x=p>>>26;for(;x!==0&&S<v.length;S++)p=(v.words[S]|0)+x,this.words[S]=p&67108863,x=p>>>26;if(this.length=v.length,x!==0)this.words[this.length]=x,this.length++;else if(v!==this)for(;S<v.length;S++)this.words[S]=v.words[S];return this},n.prototype.add=function(c){var p;return c.negative!==0&&this.negative===0?(c.negative=0,p=this.sub(c),c.negative^=1,p):c.negative===0&&this.negative!==0?(this.negative=0,p=c.sub(this),this.negative=1,p):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},n.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var p=this.iadd(c);return c.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var v=this.cmp(c);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,x;v>0?(g=this,x=c):(g=c,x=this);for(var S=0,b=0;b<x.length;b++)p=(g.words[b]|0)-(x.words[b]|0)+S,S=p>>26,this.words[b]=p&67108863;for(;S!==0&&b<g.length;b++)p=(g.words[b]|0)+S,S=p>>26,this.words[b]=p&67108863;if(S===0&&b<g.length&&g!==this)for(;b<g.length;b++)this.words[b]=g.words[b];return this.length=Math.max(this.length,b),g!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(c){return this.clone().isub(c)};function C(f,c,p){p.negative=c.negative^f.negative;var v=f.length+c.length|0;p.length=v,v=v-1|0;var g=f.words[0]|0,x=c.words[0]|0,S=g*x,b=S&67108863,l=S/67108864|0;p.words[0]=b;for(var d=1;d<v;d++){for(var A=l>>>26,D=l&67108863,V=Math.min(d,c.length-1),Y=Math.max(0,d-f.length+1);Y<=V;Y++){var se=d-Y|0;g=f.words[se]|0,x=c.words[Y]|0,S=g*x+D,A+=S/67108864|0,D=S&67108863}p.words[d]=D|0,l=A|0}return l!==0?p.words[d]=l|0:p.length--,p.strip()}var B=function(c,p,v){var g=c.words,x=p.words,S=v.words,b=0,l,d,A,D=g[0]|0,V=D&8191,Y=D>>>13,se=g[1]|0,ae=se&8191,pe=se>>>13,ye=g[2]|0,de=ye&8191,ht=ye>>>13,wt=g[3]|0,Re=wt&8191,st=wt>>>13,et=g[4]|0,Ie=et&8191,Te=et>>>13,jt=g[5]|0,Ve=jt&8191,Rt=jt>>>13,vt=g[6]|0,Me=vt&8191,Pt=vt>>>13,Qt=g[7]|0,Ce=Qt&8191,er=Qt>>>13,At=g[8]|0,Be=At&8191,Bt=At>>>13,Mt=g[9]|0,Ue=Mt&8191,Ct=Mt>>>13,Lt=x[0]|0,De=Lt&8191,Ut=Lt>>>13,Dt=x[1]|0,qe=Dt&8191,tr=Dt>>>13,rr=x[2]|0,je=rr&8191,Wt=rr>>>13,Kt=x[3]|0,We=Kt&8191,ir=Kt>>>13,nr=x[4]|0,Ke=nr&8191,Gt=nr>>>13,sr=x[5]|0,Ge=sr&8191,ar=sr>>>13,qt=x[6]|0,$e=qt&8191,Ft=qt>>>13,or=x[7]|0,Ye=or&8191,cr=or>>>13,ur=x[8]|0,Ze=ur&8191,fr=ur>>>13,lr=x[9]|0,Xe=lr&8191,Ht=lr>>>13;v.negative=c.negative^p.negative,v.length=19,l=Math.imul(V,De),d=Math.imul(V,Ut),d=d+Math.imul(Y,De)|0,A=Math.imul(Y,Ut);var ys=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(ys>>>26)|0,ys&=67108863,l=Math.imul(ae,De),d=Math.imul(ae,Ut),d=d+Math.imul(pe,De)|0,A=Math.imul(pe,Ut),l=l+Math.imul(V,qe)|0,d=d+Math.imul(V,tr)|0,d=d+Math.imul(Y,qe)|0,A=A+Math.imul(Y,tr)|0;var ws=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(ws>>>26)|0,ws&=67108863,l=Math.imul(de,De),d=Math.imul(de,Ut),d=d+Math.imul(ht,De)|0,A=Math.imul(ht,Ut),l=l+Math.imul(ae,qe)|0,d=d+Math.imul(ae,tr)|0,d=d+Math.imul(pe,qe)|0,A=A+Math.imul(pe,tr)|0,l=l+Math.imul(V,je)|0,d=d+Math.imul(V,Wt)|0,d=d+Math.imul(Y,je)|0,A=A+Math.imul(Y,Wt)|0;var Ss=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,l=Math.imul(Re,De),d=Math.imul(Re,Ut),d=d+Math.imul(st,De)|0,A=Math.imul(st,Ut),l=l+Math.imul(de,qe)|0,d=d+Math.imul(de,tr)|0,d=d+Math.imul(ht,qe)|0,A=A+Math.imul(ht,tr)|0,l=l+Math.imul(ae,je)|0,d=d+Math.imul(ae,Wt)|0,d=d+Math.imul(pe,je)|0,A=A+Math.imul(pe,Wt)|0,l=l+Math.imul(V,We)|0,d=d+Math.imul(V,ir)|0,d=d+Math.imul(Y,We)|0,A=A+Math.imul(Y,ir)|0;var Es=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Es>>>26)|0,Es&=67108863,l=Math.imul(Ie,De),d=Math.imul(Ie,Ut),d=d+Math.imul(Te,De)|0,A=Math.imul(Te,Ut),l=l+Math.imul(Re,qe)|0,d=d+Math.imul(Re,tr)|0,d=d+Math.imul(st,qe)|0,A=A+Math.imul(st,tr)|0,l=l+Math.imul(de,je)|0,d=d+Math.imul(de,Wt)|0,d=d+Math.imul(ht,je)|0,A=A+Math.imul(ht,Wt)|0,l=l+Math.imul(ae,We)|0,d=d+Math.imul(ae,ir)|0,d=d+Math.imul(pe,We)|0,A=A+Math.imul(pe,ir)|0,l=l+Math.imul(V,Ke)|0,d=d+Math.imul(V,Gt)|0,d=d+Math.imul(Y,Ke)|0,A=A+Math.imul(Y,Gt)|0;var Is=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Is>>>26)|0,Is&=67108863,l=Math.imul(Ve,De),d=Math.imul(Ve,Ut),d=d+Math.imul(Rt,De)|0,A=Math.imul(Rt,Ut),l=l+Math.imul(Ie,qe)|0,d=d+Math.imul(Ie,tr)|0,d=d+Math.imul(Te,qe)|0,A=A+Math.imul(Te,tr)|0,l=l+Math.imul(Re,je)|0,d=d+Math.imul(Re,Wt)|0,d=d+Math.imul(st,je)|0,A=A+Math.imul(st,Wt)|0,l=l+Math.imul(de,We)|0,d=d+Math.imul(de,ir)|0,d=d+Math.imul(ht,We)|0,A=A+Math.imul(ht,ir)|0,l=l+Math.imul(ae,Ke)|0,d=d+Math.imul(ae,Gt)|0,d=d+Math.imul(pe,Ke)|0,A=A+Math.imul(pe,Gt)|0,l=l+Math.imul(V,Ge)|0,d=d+Math.imul(V,ar)|0,d=d+Math.imul(Y,Ge)|0,A=A+Math.imul(Y,ar)|0;var Ts=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,l=Math.imul(Me,De),d=Math.imul(Me,Ut),d=d+Math.imul(Pt,De)|0,A=Math.imul(Pt,Ut),l=l+Math.imul(Ve,qe)|0,d=d+Math.imul(Ve,tr)|0,d=d+Math.imul(Rt,qe)|0,A=A+Math.imul(Rt,tr)|0,l=l+Math.imul(Ie,je)|0,d=d+Math.imul(Ie,Wt)|0,d=d+Math.imul(Te,je)|0,A=A+Math.imul(Te,Wt)|0,l=l+Math.imul(Re,We)|0,d=d+Math.imul(Re,ir)|0,d=d+Math.imul(st,We)|0,A=A+Math.imul(st,ir)|0,l=l+Math.imul(de,Ke)|0,d=d+Math.imul(de,Gt)|0,d=d+Math.imul(ht,Ke)|0,A=A+Math.imul(ht,Gt)|0,l=l+Math.imul(ae,Ge)|0,d=d+Math.imul(ae,ar)|0,d=d+Math.imul(pe,Ge)|0,A=A+Math.imul(pe,ar)|0,l=l+Math.imul(V,$e)|0,d=d+Math.imul(V,Ft)|0,d=d+Math.imul(Y,$e)|0,A=A+Math.imul(Y,Ft)|0;var Qi=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,l=Math.imul(Ce,De),d=Math.imul(Ce,Ut),d=d+Math.imul(er,De)|0,A=Math.imul(er,Ut),l=l+Math.imul(Me,qe)|0,d=d+Math.imul(Me,tr)|0,d=d+Math.imul(Pt,qe)|0,A=A+Math.imul(Pt,tr)|0,l=l+Math.imul(Ve,je)|0,d=d+Math.imul(Ve,Wt)|0,d=d+Math.imul(Rt,je)|0,A=A+Math.imul(Rt,Wt)|0,l=l+Math.imul(Ie,We)|0,d=d+Math.imul(Ie,ir)|0,d=d+Math.imul(Te,We)|0,A=A+Math.imul(Te,ir)|0,l=l+Math.imul(Re,Ke)|0,d=d+Math.imul(Re,Gt)|0,d=d+Math.imul(st,Ke)|0,A=A+Math.imul(st,Gt)|0,l=l+Math.imul(de,Ge)|0,d=d+Math.imul(de,ar)|0,d=d+Math.imul(ht,Ge)|0,A=A+Math.imul(ht,ar)|0,l=l+Math.imul(ae,$e)|0,d=d+Math.imul(ae,Ft)|0,d=d+Math.imul(pe,$e)|0,A=A+Math.imul(pe,Ft)|0,l=l+Math.imul(V,Ye)|0,d=d+Math.imul(V,cr)|0,d=d+Math.imul(Y,Ye)|0,A=A+Math.imul(Y,cr)|0;var Rs=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,l=Math.imul(Be,De),d=Math.imul(Be,Ut),d=d+Math.imul(Bt,De)|0,A=Math.imul(Bt,Ut),l=l+Math.imul(Ce,qe)|0,d=d+Math.imul(Ce,tr)|0,d=d+Math.imul(er,qe)|0,A=A+Math.imul(er,tr)|0,l=l+Math.imul(Me,je)|0,d=d+Math.imul(Me,Wt)|0,d=d+Math.imul(Pt,je)|0,A=A+Math.imul(Pt,Wt)|0,l=l+Math.imul(Ve,We)|0,d=d+Math.imul(Ve,ir)|0,d=d+Math.imul(Rt,We)|0,A=A+Math.imul(Rt,ir)|0,l=l+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ie,Gt)|0,d=d+Math.imul(Te,Ke)|0,A=A+Math.imul(Te,Gt)|0,l=l+Math.imul(Re,Ge)|0,d=d+Math.imul(Re,ar)|0,d=d+Math.imul(st,Ge)|0,A=A+Math.imul(st,ar)|0,l=l+Math.imul(de,$e)|0,d=d+Math.imul(de,Ft)|0,d=d+Math.imul(ht,$e)|0,A=A+Math.imul(ht,Ft)|0,l=l+Math.imul(ae,Ye)|0,d=d+Math.imul(ae,cr)|0,d=d+Math.imul(pe,Ye)|0,A=A+Math.imul(pe,cr)|0,l=l+Math.imul(V,Ze)|0,d=d+Math.imul(V,fr)|0,d=d+Math.imul(Y,Ze)|0,A=A+Math.imul(Y,fr)|0;var en=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(en>>>26)|0,en&=67108863,l=Math.imul(Ue,De),d=Math.imul(Ue,Ut),d=d+Math.imul(Ct,De)|0,A=Math.imul(Ct,Ut),l=l+Math.imul(Be,qe)|0,d=d+Math.imul(Be,tr)|0,d=d+Math.imul(Bt,qe)|0,A=A+Math.imul(Bt,tr)|0,l=l+Math.imul(Ce,je)|0,d=d+Math.imul(Ce,Wt)|0,d=d+Math.imul(er,je)|0,A=A+Math.imul(er,Wt)|0,l=l+Math.imul(Me,We)|0,d=d+Math.imul(Me,ir)|0,d=d+Math.imul(Pt,We)|0,A=A+Math.imul(Pt,ir)|0,l=l+Math.imul(Ve,Ke)|0,d=d+Math.imul(Ve,Gt)|0,d=d+Math.imul(Rt,Ke)|0,A=A+Math.imul(Rt,Gt)|0,l=l+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ie,ar)|0,d=d+Math.imul(Te,Ge)|0,A=A+Math.imul(Te,ar)|0,l=l+Math.imul(Re,$e)|0,d=d+Math.imul(Re,Ft)|0,d=d+Math.imul(st,$e)|0,A=A+Math.imul(st,Ft)|0,l=l+Math.imul(de,Ye)|0,d=d+Math.imul(de,cr)|0,d=d+Math.imul(ht,Ye)|0,A=A+Math.imul(ht,cr)|0,l=l+Math.imul(ae,Ze)|0,d=d+Math.imul(ae,fr)|0,d=d+Math.imul(pe,Ze)|0,A=A+Math.imul(pe,fr)|0,l=l+Math.imul(V,Xe)|0,d=d+Math.imul(V,Ht)|0,d=d+Math.imul(Y,Xe)|0,A=A+Math.imul(Y,Ht)|0;var As=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(As>>>26)|0,As&=67108863,l=Math.imul(Ue,qe),d=Math.imul(Ue,tr),d=d+Math.imul(Ct,qe)|0,A=Math.imul(Ct,tr),l=l+Math.imul(Be,je)|0,d=d+Math.imul(Be,Wt)|0,d=d+Math.imul(Bt,je)|0,A=A+Math.imul(Bt,Wt)|0,l=l+Math.imul(Ce,We)|0,d=d+Math.imul(Ce,ir)|0,d=d+Math.imul(er,We)|0,A=A+Math.imul(er,ir)|0,l=l+Math.imul(Me,Ke)|0,d=d+Math.imul(Me,Gt)|0,d=d+Math.imul(Pt,Ke)|0,A=A+Math.imul(Pt,Gt)|0,l=l+Math.imul(Ve,Ge)|0,d=d+Math.imul(Ve,ar)|0,d=d+Math.imul(Rt,Ge)|0,A=A+Math.imul(Rt,ar)|0,l=l+Math.imul(Ie,$e)|0,d=d+Math.imul(Ie,Ft)|0,d=d+Math.imul(Te,$e)|0,A=A+Math.imul(Te,Ft)|0,l=l+Math.imul(Re,Ye)|0,d=d+Math.imul(Re,cr)|0,d=d+Math.imul(st,Ye)|0,A=A+Math.imul(st,cr)|0,l=l+Math.imul(de,Ze)|0,d=d+Math.imul(de,fr)|0,d=d+Math.imul(ht,Ze)|0,A=A+Math.imul(ht,fr)|0,l=l+Math.imul(ae,Xe)|0,d=d+Math.imul(ae,Ht)|0,d=d+Math.imul(pe,Xe)|0,A=A+Math.imul(pe,Ht)|0;var Os=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Os>>>26)|0,Os&=67108863,l=Math.imul(Ue,je),d=Math.imul(Ue,Wt),d=d+Math.imul(Ct,je)|0,A=Math.imul(Ct,Wt),l=l+Math.imul(Be,We)|0,d=d+Math.imul(Be,ir)|0,d=d+Math.imul(Bt,We)|0,A=A+Math.imul(Bt,ir)|0,l=l+Math.imul(Ce,Ke)|0,d=d+Math.imul(Ce,Gt)|0,d=d+Math.imul(er,Ke)|0,A=A+Math.imul(er,Gt)|0,l=l+Math.imul(Me,Ge)|0,d=d+Math.imul(Me,ar)|0,d=d+Math.imul(Pt,Ge)|0,A=A+Math.imul(Pt,ar)|0,l=l+Math.imul(Ve,$e)|0,d=d+Math.imul(Ve,Ft)|0,d=d+Math.imul(Rt,$e)|0,A=A+Math.imul(Rt,Ft)|0,l=l+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,cr)|0,d=d+Math.imul(Te,Ye)|0,A=A+Math.imul(Te,cr)|0,l=l+Math.imul(Re,Ze)|0,d=d+Math.imul(Re,fr)|0,d=d+Math.imul(st,Ze)|0,A=A+Math.imul(st,fr)|0,l=l+Math.imul(de,Xe)|0,d=d+Math.imul(de,Ht)|0,d=d+Math.imul(ht,Xe)|0,A=A+Math.imul(ht,Ht)|0;var ks=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(ks>>>26)|0,ks&=67108863,l=Math.imul(Ue,We),d=Math.imul(Ue,ir),d=d+Math.imul(Ct,We)|0,A=Math.imul(Ct,ir),l=l+Math.imul(Be,Ke)|0,d=d+Math.imul(Be,Gt)|0,d=d+Math.imul(Bt,Ke)|0,A=A+Math.imul(Bt,Gt)|0,l=l+Math.imul(Ce,Ge)|0,d=d+Math.imul(Ce,ar)|0,d=d+Math.imul(er,Ge)|0,A=A+Math.imul(er,ar)|0,l=l+Math.imul(Me,$e)|0,d=d+Math.imul(Me,Ft)|0,d=d+Math.imul(Pt,$e)|0,A=A+Math.imul(Pt,Ft)|0,l=l+Math.imul(Ve,Ye)|0,d=d+Math.imul(Ve,cr)|0,d=d+Math.imul(Rt,Ye)|0,A=A+Math.imul(Rt,cr)|0,l=l+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ie,fr)|0,d=d+Math.imul(Te,Ze)|0,A=A+Math.imul(Te,fr)|0,l=l+Math.imul(Re,Xe)|0,d=d+Math.imul(Re,Ht)|0,d=d+Math.imul(st,Xe)|0,A=A+Math.imul(st,Ht)|0;var Xn=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,l=Math.imul(Ue,Ke),d=Math.imul(Ue,Gt),d=d+Math.imul(Ct,Ke)|0,A=Math.imul(Ct,Gt),l=l+Math.imul(Be,Ge)|0,d=d+Math.imul(Be,ar)|0,d=d+Math.imul(Bt,Ge)|0,A=A+Math.imul(Bt,ar)|0,l=l+Math.imul(Ce,$e)|0,d=d+Math.imul(Ce,Ft)|0,d=d+Math.imul(er,$e)|0,A=A+Math.imul(er,Ft)|0,l=l+Math.imul(Me,Ye)|0,d=d+Math.imul(Me,cr)|0,d=d+Math.imul(Pt,Ye)|0,A=A+Math.imul(Pt,cr)|0,l=l+Math.imul(Ve,Ze)|0,d=d+Math.imul(Ve,fr)|0,d=d+Math.imul(Rt,Ze)|0,A=A+Math.imul(Rt,fr)|0,l=l+Math.imul(Ie,Xe)|0,d=d+Math.imul(Ie,Ht)|0,d=d+Math.imul(Te,Xe)|0,A=A+Math.imul(Te,Ht)|0;var Jn=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,l=Math.imul(Ue,Ge),d=Math.imul(Ue,ar),d=d+Math.imul(Ct,Ge)|0,A=Math.imul(Ct,ar),l=l+Math.imul(Be,$e)|0,d=d+Math.imul(Be,Ft)|0,d=d+Math.imul(Bt,$e)|0,A=A+Math.imul(Bt,Ft)|0,l=l+Math.imul(Ce,Ye)|0,d=d+Math.imul(Ce,cr)|0,d=d+Math.imul(er,Ye)|0,A=A+Math.imul(er,cr)|0,l=l+Math.imul(Me,Ze)|0,d=d+Math.imul(Me,fr)|0,d=d+Math.imul(Pt,Ze)|0,A=A+Math.imul(Pt,fr)|0,l=l+Math.imul(Ve,Xe)|0,d=d+Math.imul(Ve,Ht)|0,d=d+Math.imul(Rt,Xe)|0,A=A+Math.imul(Rt,Ht)|0;var Qn=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,l=Math.imul(Ue,$e),d=Math.imul(Ue,Ft),d=d+Math.imul(Ct,$e)|0,A=Math.imul(Ct,Ft),l=l+Math.imul(Be,Ye)|0,d=d+Math.imul(Be,cr)|0,d=d+Math.imul(Bt,Ye)|0,A=A+Math.imul(Bt,cr)|0,l=l+Math.imul(Ce,Ze)|0,d=d+Math.imul(Ce,fr)|0,d=d+Math.imul(er,Ze)|0,A=A+Math.imul(er,fr)|0,l=l+Math.imul(Me,Xe)|0,d=d+Math.imul(Me,Ht)|0,d=d+Math.imul(Pt,Xe)|0,A=A+Math.imul(Pt,Ht)|0;var Ps=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,l=Math.imul(Ue,Ye),d=Math.imul(Ue,cr),d=d+Math.imul(Ct,Ye)|0,A=Math.imul(Ct,cr),l=l+Math.imul(Be,Ze)|0,d=d+Math.imul(Be,fr)|0,d=d+Math.imul(Bt,Ze)|0,A=A+Math.imul(Bt,fr)|0,l=l+Math.imul(Ce,Xe)|0,d=d+Math.imul(Ce,Ht)|0,d=d+Math.imul(er,Xe)|0,A=A+Math.imul(er,Ht)|0;var Ns=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,l=Math.imul(Ue,Ze),d=Math.imul(Ue,fr),d=d+Math.imul(Ct,Ze)|0,A=Math.imul(Ct,fr),l=l+Math.imul(Be,Xe)|0,d=d+Math.imul(Be,Ht)|0,d=d+Math.imul(Bt,Xe)|0,A=A+Math.imul(Bt,Ht)|0;var Bs=(b+l|0)+((d&8191)<<13)|0;b=(A+(d>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,l=Math.imul(Ue,Xe),d=Math.imul(Ue,Ht),d=d+Math.imul(Ct,Xe)|0,A=Math.imul(Ct,Ht);var Bu=(b+l|0)+((d&8191)<<13)|0;return b=(A+(d>>>13)|0)+(Bu>>>26)|0,Bu&=67108863,S[0]=ys,S[1]=ws,S[2]=Ss,S[3]=Es,S[4]=Is,S[5]=Ts,S[6]=Qi,S[7]=Rs,S[8]=en,S[9]=As,S[10]=Os,S[11]=ks,S[12]=Xn,S[13]=Jn,S[14]=Qn,S[15]=Ps,S[16]=Ns,S[17]=Bs,S[18]=Bu,b!==0&&(S[19]=b,v.length++),v};Math.imul||(B=C);function U(f,c,p){p.negative=c.negative^f.negative,p.length=f.length+c.length;for(var v=0,g=0,x=0;x<p.length-1;x++){var S=g;g=0;for(var b=v&67108863,l=Math.min(x,c.length-1),d=Math.max(0,x-f.length+1);d<=l;d++){var A=x-d,D=f.words[A]|0,V=c.words[d]|0,Y=D*V,se=Y&67108863;S=S+(Y/67108864|0)|0,se=se+b|0,b=se&67108863,S=S+(se>>>26)|0,g+=S>>>26,S&=67108863}p.words[x]=b,v=S,S=g}return v!==0?p.words[x]=v:p.length--,p.strip()}function Z(f,c,p){var v=new $;return v.mulp(f,c,p)}n.prototype.mulTo=function(c,p){var v,g=this.length+c.length;return this.length===10&&c.length===10?v=B(this,c,p):g<63?v=C(this,c,p):g<1024?v=U(this,c,p):v=Z(this,c,p),v};function $(f,c){this.x=f,this.y=c}$.prototype.makeRBT=function(c){for(var p=new Array(c),v=n.prototype._countBits(c)-1,g=0;g<c;g++)p[g]=this.revBin(g,v,c);return p},$.prototype.revBin=function(c,p,v){if(c===0||c===v-1)return c;for(var g=0,x=0;x<p;x++)g|=(c&1)<<p-x-1,c>>=1;return g},$.prototype.permute=function(c,p,v,g,x,S){for(var b=0;b<S;b++)g[b]=p[c[b]],x[b]=v[c[b]]},$.prototype.transform=function(c,p,v,g,x,S){this.permute(S,c,p,v,g,x);for(var b=1;b<x;b<<=1)for(var l=b<<1,d=Math.cos(2*Math.PI/l),A=Math.sin(2*Math.PI/l),D=0;D<x;D+=l)for(var V=d,Y=A,se=0;se<b;se++){var ae=v[D+se],pe=g[D+se],ye=v[D+se+b],de=g[D+se+b],ht=V*ye-Y*de;de=V*de+Y*ye,ye=ht,v[D+se]=ae+ye,g[D+se]=pe+de,v[D+se+b]=ae-ye,g[D+se+b]=pe-de,se!==l&&(ht=d*V-A*Y,Y=d*Y+A*V,V=ht)}},$.prototype.guessLen13b=function(c,p){var v=Math.max(p,c)|1,g=v&1,x=0;for(v=v/2|0;v;v=v>>>1)x++;return 1<<x+1+g},$.prototype.conjugate=function(c,p,v){if(!(v<=1))for(var g=0;g<v/2;g++){var x=c[g];c[g]=c[v-g-1],c[v-g-1]=x,x=p[g],p[g]=-p[v-g-1],p[v-g-1]=-x}},$.prototype.normalize13b=function(c,p){for(var v=0,g=0;g<p/2;g++){var x=Math.round(c[2*g+1]/p)*8192+Math.round(c[2*g]/p)+v;c[g]=x&67108863,x<67108864?v=0:v=x/67108864|0}return c},$.prototype.convert13b=function(c,p,v,g){for(var x=0,S=0;S<p;S++)x=x+(c[S]|0),v[2*S]=x&8191,x=x>>>13,v[2*S+1]=x&8191,x=x>>>13;for(S=2*p;S<g;++S)v[S]=0;r(x===0),r((x&-8192)===0)},$.prototype.stub=function(c){for(var p=new Array(c),v=0;v<c;v++)p[v]=0;return p},$.prototype.mulp=function(c,p,v){var g=2*this.guessLen13b(c.length,p.length),x=this.makeRBT(g),S=this.stub(g),b=new Array(g),l=new Array(g),d=new Array(g),A=new Array(g),D=new Array(g),V=new Array(g),Y=v.words;Y.length=g,this.convert13b(c.words,c.length,b,g),this.convert13b(p.words,p.length,A,g),this.transform(b,S,l,d,g,x),this.transform(A,S,D,V,g,x);for(var se=0;se<g;se++){var ae=l[se]*D[se]-d[se]*V[se];d[se]=l[se]*V[se]+d[se]*D[se],l[se]=ae}return this.conjugate(l,d,g),this.transform(l,d,Y,S,g,x),this.conjugate(Y,S,g),this.normalize13b(Y,g),v.negative=c.negative^p.negative,v.length=c.length+p.length,v.strip()},n.prototype.mul=function(c){var p=new n(null);return p.words=new Array(this.length+c.length),this.mulTo(c,p)},n.prototype.mulf=function(c){var p=new n(null);return p.words=new Array(this.length+c.length),Z(this,c,p)},n.prototype.imul=function(c){return this.clone().mulTo(c,this)},n.prototype.imuln=function(c){r(typeof c=="number"),r(c<67108864);for(var p=0,v=0;v<this.length;v++){var g=(this.words[v]|0)*c,x=(g&67108863)+(p&67108863);p>>=26,p+=g/67108864|0,p+=x>>>26,this.words[v]=x&67108863}return p!==0&&(this.words[v]=p,this.length++),this},n.prototype.muln=function(c){return this.clone().imuln(c)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(c){var p=N(c);if(p.length===0)return new n(1);for(var v=this,g=0;g<p.length&&p[g]===0;g++,v=v.sqr());if(++g<p.length)for(var x=v.sqr();g<p.length;g++,x=x.sqr())p[g]!==0&&(v=v.mul(x));return v},n.prototype.iushln=function(c){r(typeof c=="number"&&c>=0);var p=c%26,v=(c-p)/26,g=67108863>>>26-p<<26-p,x;if(p!==0){var S=0;for(x=0;x<this.length;x++){var b=this.words[x]&g,l=(this.words[x]|0)-b<<p;this.words[x]=l|S,S=b>>>26-p}S&&(this.words[x]=S,this.length++)}if(v!==0){for(x=this.length-1;x>=0;x--)this.words[x+v]=this.words[x];for(x=0;x<v;x++)this.words[x]=0;this.length+=v}return this.strip()},n.prototype.ishln=function(c){return r(this.negative===0),this.iushln(c)},n.prototype.iushrn=function(c,p,v){r(typeof c=="number"&&c>=0);var g;p?g=(p-p%26)/26:g=0;var x=c%26,S=Math.min((c-x)/26,this.length),b=67108863^67108863>>>x<<x,l=v;if(g-=S,g=Math.max(0,g),l){for(var d=0;d<S;d++)l.words[d]=this.words[d];l.length=S}if(S!==0)if(this.length>S)for(this.length-=S,d=0;d<this.length;d++)this.words[d]=this.words[d+S];else this.words[0]=0,this.length=1;var A=0;for(d=this.length-1;d>=0&&(A!==0||d>=g);d--){var D=this.words[d]|0;this.words[d]=A<<26-x|D>>>x,A=D&b}return l&&A!==0&&(l.words[l.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(c,p,v){return r(this.negative===0),this.iushrn(c,p,v)},n.prototype.shln=function(c){return this.clone().ishln(c)},n.prototype.ushln=function(c){return this.clone().iushln(c)},n.prototype.shrn=function(c){return this.clone().ishrn(c)},n.prototype.ushrn=function(c){return this.clone().iushrn(c)},n.prototype.testn=function(c){r(typeof c=="number"&&c>=0);var p=c%26,v=(c-p)/26,g=1<<p;if(this.length<=v)return!1;var x=this.words[v];return!!(x&g)},n.prototype.imaskn=function(c){r(typeof c=="number"&&c>=0);var p=c%26,v=(c-p)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(p!==0&&v++,this.length=Math.min(v,this.length),p!==0){var g=67108863^67108863>>>p<<p;this.words[this.length-1]&=g}return this.strip()},n.prototype.maskn=function(c){return this.clone().imaskn(c)},n.prototype.iaddn=function(c){return r(typeof c=="number"),r(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},n.prototype._iaddn=function(c){this.words[0]+=c;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},n.prototype.isubn=function(c){if(r(typeof c=="number"),r(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this.strip()},n.prototype.addn=function(c){return this.clone().iaddn(c)},n.prototype.subn=function(c){return this.clone().isubn(c)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(c,p,v){var g=c.length+v,x;this._expand(g);var S,b=0;for(x=0;x<c.length;x++){S=(this.words[x+v]|0)+b;var l=(c.words[x]|0)*p;S-=l&67108863,b=(S>>26)-(l/67108864|0),this.words[x+v]=S&67108863}for(;x<this.length-v;x++)S=(this.words[x+v]|0)+b,b=S>>26,this.words[x+v]=S&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,x=0;x<this.length;x++)S=-(this.words[x]|0)+b,b=S>>26,this.words[x]=S&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(c,p){var v=this.length-c.length,g=this.clone(),x=c,S=x.words[x.length-1]|0,b=this._countBits(S);v=26-b,v!==0&&(x=x.ushln(v),g.iushln(v),S=x.words[x.length-1]|0);var l=g.length-x.length,d;if(p!=="mod"){d=new n(null),d.length=l+1,d.words=new Array(d.length);for(var A=0;A<d.length;A++)d.words[A]=0}var D=g.clone()._ishlnsubmul(x,1,l);D.negative===0&&(g=D,d&&(d.words[l]=1));for(var V=l-1;V>=0;V--){var Y=(g.words[x.length+V]|0)*67108864+(g.words[x.length+V-1]|0);for(Y=Math.min(Y/S|0,67108863),g._ishlnsubmul(x,Y,V);g.negative!==0;)Y--,g.negative=0,g._ishlnsubmul(x,1,V),g.isZero()||(g.negative^=1);d&&(d.words[V]=Y)}return d&&d.strip(),g.strip(),p!=="div"&&v!==0&&g.iushrn(v),{div:d||null,mod:g}},n.prototype.divmod=function(c,p,v){if(r(!c.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var g,x,S;return this.negative!==0&&c.negative===0?(S=this.neg().divmod(c,p),p!=="mod"&&(g=S.div.neg()),p!=="div"&&(x=S.mod.neg(),v&&x.negative!==0&&x.iadd(c)),{div:g,mod:x}):this.negative===0&&c.negative!==0?(S=this.divmod(c.neg(),p),p!=="mod"&&(g=S.div.neg()),{div:g,mod:S.mod}):this.negative&c.negative?(S=this.neg().divmod(c.neg(),p),p!=="div"&&(x=S.mod.neg(),v&&x.negative!==0&&x.isub(c)),{div:S.div,mod:x}):c.length>this.length||this.cmp(c)<0?{div:new n(0),mod:this}:c.length===1?p==="div"?{div:this.divn(c.words[0]),mod:null}:p==="mod"?{div:null,mod:new n(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new n(this.modn(c.words[0]))}:this._wordDiv(c,p)},n.prototype.div=function(c){return this.divmod(c,"div",!1).div},n.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},n.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},n.prototype.divRound=function(c){var p=this.divmod(c);if(p.mod.isZero())return p.div;var v=p.div.negative!==0?p.mod.isub(c):p.mod,g=c.ushrn(1),x=c.andln(1),S=v.cmp(g);return S<0||x===1&&S===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},n.prototype.modn=function(c){r(c<=67108863);for(var p=(1<<26)%c,v=0,g=this.length-1;g>=0;g--)v=(p*v+(this.words[g]|0))%c;return v},n.prototype.idivn=function(c){r(c<=67108863);for(var p=0,v=this.length-1;v>=0;v--){var g=(this.words[v]|0)+p*67108864;this.words[v]=g/c|0,p=g%c}return this.strip()},n.prototype.divn=function(c){return this.clone().idivn(c)},n.prototype.egcd=function(c){r(c.negative===0),r(!c.isZero());var p=this,v=c.clone();p.negative!==0?p=p.umod(c):p=p.clone();for(var g=new n(1),x=new n(0),S=new n(0),b=new n(1),l=0;p.isEven()&&v.isEven();)p.iushrn(1),v.iushrn(1),++l;for(var d=v.clone(),A=p.clone();!p.isZero();){for(var D=0,V=1;!(p.words[0]&V)&&D<26;++D,V<<=1);if(D>0)for(p.iushrn(D);D-- >0;)(g.isOdd()||x.isOdd())&&(g.iadd(d),x.isub(A)),g.iushrn(1),x.iushrn(1);for(var Y=0,se=1;!(v.words[0]&se)&&Y<26;++Y,se<<=1);if(Y>0)for(v.iushrn(Y);Y-- >0;)(S.isOdd()||b.isOdd())&&(S.iadd(d),b.isub(A)),S.iushrn(1),b.iushrn(1);p.cmp(v)>=0?(p.isub(v),g.isub(S),x.isub(b)):(v.isub(p),S.isub(g),b.isub(x))}return{a:S,b,gcd:v.iushln(l)}},n.prototype._invmp=function(c){r(c.negative===0),r(!c.isZero());var p=this,v=c.clone();p.negative!==0?p=p.umod(c):p=p.clone();for(var g=new n(1),x=new n(0),S=v.clone();p.cmpn(1)>0&&v.cmpn(1)>0;){for(var b=0,l=1;!(p.words[0]&l)&&b<26;++b,l<<=1);if(b>0)for(p.iushrn(b);b-- >0;)g.isOdd()&&g.iadd(S),g.iushrn(1);for(var d=0,A=1;!(v.words[0]&A)&&d<26;++d,A<<=1);if(d>0)for(v.iushrn(d);d-- >0;)x.isOdd()&&x.iadd(S),x.iushrn(1);p.cmp(v)>=0?(p.isub(v),g.isub(x)):(v.isub(p),x.isub(g))}var D;return p.cmpn(1)===0?D=g:D=x,D.cmpn(0)<0&&D.iadd(c),D},n.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var p=this.clone(),v=c.clone();p.negative=0,v.negative=0;for(var g=0;p.isEven()&&v.isEven();g++)p.iushrn(1),v.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;v.isEven();)v.iushrn(1);var x=p.cmp(v);if(x<0){var S=p;p=v,v=S}else if(x===0||v.cmpn(1)===0)break;p.isub(v)}while(!0);return v.iushln(g)},n.prototype.invm=function(c){return this.egcd(c).a.umod(c)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(c){return this.words[0]&c},n.prototype.bincn=function(c){r(typeof c=="number");var p=c%26,v=(c-p)/26,g=1<<p;if(this.length<=v)return this._expand(v+1),this.words[v]|=g,this;for(var x=g,S=v;x!==0&&S<this.length;S++){var b=this.words[S]|0;b+=x,x=b>>>26,b&=67108863,this.words[S]=b}return x!==0&&(this.words[S]=x,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(c){var p=c<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var v;if(this.length>1)v=1;else{p&&(c=-c),r(c<=67108863,"Number is too big");var g=this.words[0]|0;v=g===c?0:g<c?-1:1}return this.negative!==0?-v|0:v},n.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var p=this.ucmp(c);return this.negative!==0?-p|0:p},n.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var p=0,v=this.length-1;v>=0;v--){var g=this.words[v]|0,x=c.words[v]|0;if(g!==x){g<x?p=-1:g>x&&(p=1);break}}return p},n.prototype.gtn=function(c){return this.cmpn(c)===1},n.prototype.gt=function(c){return this.cmp(c)===1},n.prototype.gten=function(c){return this.cmpn(c)>=0},n.prototype.gte=function(c){return this.cmp(c)>=0},n.prototype.ltn=function(c){return this.cmpn(c)===-1},n.prototype.lt=function(c){return this.cmp(c)===-1},n.prototype.lten=function(c){return this.cmpn(c)<=0},n.prototype.lte=function(c){return this.cmp(c)<=0},n.prototype.eqn=function(c){return this.cmpn(c)===0},n.prototype.eq=function(c){return this.cmp(c)===0},n.red=function(c){return new O(c)},n.prototype.toRed=function(c){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(c){return this.red=c,this},n.prototype.forceRed=function(c){return r(!this.red,"Already a number in reduction context"),this._forceRed(c)},n.prototype.redAdd=function(c){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},n.prototype.redIAdd=function(c){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},n.prototype.redSub=function(c){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},n.prototype.redISub=function(c){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},n.prototype.redShl=function(c){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},n.prototype.redMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},n.prototype.redIMul=function(c){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(c){return r(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var H={k256:null,p224:null,p192:null,p25519:null};function ee(f,c){this.name=f,this.p=new n(c,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}ee.prototype._tmp=function(){var c=new n(null);return c.words=new Array(Math.ceil(this.n/13)),c},ee.prototype.ireduce=function(c){var p=c,v;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),v=p.bitLength();while(v>this.n);var g=v<this.n?-1:p.ucmp(this.p);return g===0?(p.words[0]=0,p.length=1):g>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},ee.prototype.split=function(c,p){c.iushrn(this.n,0,p)},ee.prototype.imulK=function(c){return c.imul(this.k)};function ce(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(ce,ee),ce.prototype.split=function(c,p){for(var v=4194303,g=Math.min(c.length,9),x=0;x<g;x++)p.words[x]=c.words[x];if(p.length=g,c.length<=9){c.words[0]=0,c.length=1;return}var S=c.words[9];for(p.words[p.length++]=S&v,x=10;x<c.length;x++){var b=c.words[x]|0;c.words[x-10]=(b&v)<<4|S>>>22,S=b}S>>>=22,c.words[x-10]=S,S===0&&c.length>10?c.length-=10:c.length-=9},ce.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var p=0,v=0;v<c.length;v++){var g=c.words[v]|0;p+=g*977,c.words[v]=p&67108863,p=g*64+(p/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function ge(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(ge,ee);function Se(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(Se,ee);function me(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(me,ee),me.prototype.imulK=function(c){for(var p=0,v=0;v<c.length;v++){var g=(c.words[v]|0)*19+p,x=g&67108863;g>>>=26,c.words[v]=x,p=g}return p!==0&&(c.words[c.length++]=p),c},n._prime=function(c){if(H[c])return H[c];var p;if(c==="k256")p=new ce;else if(c==="p224")p=new ge;else if(c==="p192")p=new Se;else if(c==="p25519")p=new me;else throw new Error("Unknown prime "+c);return H[c]=p,p};function O(f){if(typeof f=="string"){var c=n._prime(f);this.m=c.p,this.prime=c}else r(f.gtn(1),"modulus must be greater than 1"),this.m=f,this.prime=null}O.prototype._verify1=function(c){r(c.negative===0,"red works only with positives"),r(c.red,"red works only with red numbers")},O.prototype._verify2=function(c,p){r((c.negative|p.negative)===0,"red works only with positives"),r(c.red&&c.red===p.red,"red works only with red numbers")},O.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):c.umod(this.m)._forceRed(this)},O.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},O.prototype.add=function(c,p){this._verify2(c,p);var v=c.add(p);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},O.prototype.iadd=function(c,p){this._verify2(c,p);var v=c.iadd(p);return v.cmp(this.m)>=0&&v.isub(this.m),v},O.prototype.sub=function(c,p){this._verify2(c,p);var v=c.sub(p);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},O.prototype.isub=function(c,p){this._verify2(c,p);var v=c.isub(p);return v.cmpn(0)<0&&v.iadd(this.m),v},O.prototype.shl=function(c,p){return this._verify1(c),this.imod(c.ushln(p))},O.prototype.imul=function(c,p){return this._verify2(c,p),this.imod(c.imul(p))},O.prototype.mul=function(c,p){return this._verify2(c,p),this.imod(c.mul(p))},O.prototype.isqr=function(c){return this.imul(c,c.clone())},O.prototype.sqr=function(c){return this.mul(c,c)},O.prototype.sqrt=function(c){if(c.isZero())return c.clone();var p=this.m.andln(3);if(r(p%2===1),p===3){var v=this.m.add(new n(1)).iushrn(2);return this.pow(c,v)}for(var g=this.m.subn(1),x=0;!g.isZero()&&g.andln(1)===0;)x++,g.iushrn(1);r(!g.isZero());var S=new n(1).toRed(this),b=S.redNeg(),l=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new n(2*d*d).toRed(this);this.pow(d,l).cmp(b)!==0;)d.redIAdd(b);for(var A=this.pow(d,g),D=this.pow(c,g.addn(1).iushrn(1)),V=this.pow(c,g),Y=x;V.cmp(S)!==0;){for(var se=V,ae=0;se.cmp(S)!==0;ae++)se=se.redSqr();r(ae<Y);var pe=this.pow(A,new n(1).iushln(Y-ae-1));D=D.redMul(pe),A=pe.redSqr(),V=V.redMul(A),Y=ae}return D},O.prototype.invm=function(c){var p=c._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},O.prototype.pow=function(c,p){if(p.isZero())return new n(1).toRed(this);if(p.cmpn(1)===0)return c.clone();var v=4,g=new Array(1<<v);g[0]=new n(1).toRed(this),g[1]=c;for(var x=2;x<g.length;x++)g[x]=this.mul(g[x-1],c);var S=g[0],b=0,l=0,d=p.bitLength()%26;for(d===0&&(d=26),x=p.length-1;x>=0;x--){for(var A=p.words[x],D=d-1;D>=0;D--){var V=A>>D&1;if(S!==g[0]&&(S=this.sqr(S)),V===0&&b===0){l=0;continue}b<<=1,b|=V,l++,!(l!==v&&(x!==0||D!==0))&&(S=this.mul(S,g[b]),l=0,b=0)}d=26}return S},O.prototype.convertTo=function(c){var p=c.umod(this.m);return p===c?p.clone():p},O.prototype.convertFrom=function(c){var p=c.clone();return p.red=null,p},n.mont=function(c){return new E(c)};function E(f){O.call(this,f),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(E,O),E.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},E.prototype.convertFrom=function(c){var p=this.imod(c.mul(this.rinv));return p.red=null,p},E.prototype.imul=function(c,p){if(c.isZero()||p.isZero())return c.words[0]=0,c.length=1,c;var v=c.imul(p),g=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=v.isub(g).iushrn(this.shift),S=x;return x.cmp(this.m)>=0?S=x.isub(this.m):x.cmpn(0)<0&&(S=x.iadd(this.m)),S._forceRed(this)},E.prototype.mul=function(c,p){if(c.isZero()||p.isZero())return new n(0)._forceRed(this);var v=c.mul(p),g=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=v.isub(g).iushrn(this.shift),S=x;return x.cmp(this.m)>=0?S=x.isub(this.m):x.cmpn(0)<0&&(S=x.iadd(this.m)),S._forceRed(this)},E.prototype.invm=function(c){var p=this.imod(c._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof Wv>"u"||Wv,nS)});var Ka=X((jY,aS)=>{aS.exports=sS;function sS(e,t){if(!e)throw new Error(t||"Assertion failed")}sS.equal=function(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)}});var Kv=X(uS=>{"use strict";var kh=uS;function oB(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e!="string"){for(var i=0;i<e.length;i++)r[i]=e[i]|0;return r}if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,u=n&255;o?r.push(o,u):r.push(u)}return r}kh.toArray=oB;function oS(e){return e.length===1?"0"+e:e}kh.zero2=oS;function cS(e){for(var t="",r=0;r<e.length;r++)t+=oS(e[r].toString(16));return t}kh.toHex=cS;kh.encode=function(t,r){return r==="hex"?cS(t):t}});var Zi=X(fS=>{"use strict";var Un=fS,cB=cs(),uB=Ka(),Ph=Kv();Un.assert=uB;Un.toArray=Ph.toArray;Un.zero2=Ph.zero2;Un.toHex=Ph.toHex;Un.encode=Ph.encode;function fB(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1),n;for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,u=e.clone();for(n=0;n<i.length;n++){var m,_=u.andln(o-1);u.isOdd()?(_>(o>>1)-1?m=(o>>1)-_:m=_,u.isubn(m)):m=0,i[n]=m,u.iushrn(1)}return i}Un.getNAF=fB;function lB(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0,o;e.cmpn(-i)>0||t.cmpn(-n)>0;){var u=e.andln(3)+i&3,m=t.andln(3)+n&3;u===3&&(u=-1),m===3&&(m=-1);var _;u&1?(o=e.andln(7)+i&7,(o===3||o===5)&&m===2?_=-u:_=u):_=0,r[0].push(_);var w;m&1?(o=t.andln(7)+n&7,(o===3||o===5)&&u===2?w=-m:w=m):w=0,r[1].push(w),2*i===_+1&&(i=1-i),2*n===w+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r}Un.getJSF=lB;function pB(e,t,r){var i="_"+t;e.prototype[t]=function(){return this[i]!==void 0?this[i]:this[i]=r.call(this)}}Un.cachedProperty=pB;function hB(e){return typeof e=="string"?Un.toArray(e,"hex"):e}Un.parseBytes=hB;function dB(e){return new cB(e,"hex","le")}Un.intFromLE=dB});var Zv=X((GY,Yv)=>{var Gv;Yv.exports=function(t){return Gv||(Gv=new Ga(null)),Gv.generate(t)};function Ga(e){this.rand=e}Yv.exports.Rand=Ga;Ga.prototype.generate=function(t){return this._rand(t)};Ga.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ga.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Ga.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Ga.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if($v=require("crypto"),typeof $v.randomBytes!="function")throw new Error("Not supported");Ga.prototype._rand=function(t){return $v.randomBytes(t)}}catch{}var $v});var tl=X(($Y,lS)=>{"use strict";var $o=cs(),el=Zi(),Nh=el.getNAF,mB=el.getJSF,Bh=el.assert;function $a(e,t){this.type=e,this.p=new $o(t.p,16),this.red=t.prime?$o.red(t.prime):$o.mont(this.p),this.zero=new $o(0).toRed(this.red),this.one=new $o(1).toRed(this.red),this.two=new $o(2).toRed(this.red),this.n=t.n&&new $o(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}lS.exports=$a;$a.prototype.point=function(){throw new Error("Not implemented")};$a.prototype.validate=function(){throw new Error("Not implemented")};$a.prototype._fixedNafMul=function(t,r){Bh(t.precomputed);var i=t._getDoubles(),n=Nh(r,1,this._bitLength),o=(1<<i.step+1)-(i.step%2===0?2:1);o/=3;var u=[],m,_;for(m=0;m<n.length;m+=i.step){_=0;for(var w=m+i.step-1;w>=m;w--)_=(_<<1)+n[w];u.push(_)}for(var I=this.jpoint(null,null,null),T=this.jpoint(null,null,null),N=o;N>0;N--){for(m=0;m<u.length;m++)_=u[m],_===N?T=T.mixedAdd(i.points[m]):_===-N&&(T=T.mixedAdd(i.points[m].neg()));I=I.add(T)}return I.toP()};$a.prototype._wnafMul=function(t,r){var i=4,n=t._getNAFPoints(i);i=n.wnd;for(var o=n.points,u=Nh(r,i,this._bitLength),m=this.jpoint(null,null,null),_=u.length-1;_>=0;_--){for(var w=0;_>=0&&u[_]===0;_--)w++;if(_>=0&&w++,m=m.dblp(w),_<0)break;var I=u[_];Bh(I!==0),t.type==="affine"?I>0?m=m.mixedAdd(o[I-1>>1]):m=m.mixedAdd(o[-I-1>>1].neg()):I>0?m=m.add(o[I-1>>1]):m=m.add(o[-I-1>>1].neg())}return t.type==="affine"?m.toP():m};$a.prototype._wnafMulAdd=function(t,r,i,n,o){var u=this._wnafT1,m=this._wnafT2,_=this._wnafT3,w=0,I,T,N;for(I=0;I<n;I++){N=r[I];var C=N._getNAFPoints(t);u[I]=C.wnd,m[I]=C.points}for(I=n-1;I>=1;I-=2){var B=I-1,U=I;if(u[B]!==1||u[U]!==1){_[B]=Nh(i[B],u[B],this._bitLength),_[U]=Nh(i[U],u[U],this._bitLength),w=Math.max(_[B].length,w),w=Math.max(_[U].length,w);continue}var Z=[r[B],null,null,r[U]];r[B].y.cmp(r[U].y)===0?(Z[1]=r[B].add(r[U]),Z[2]=r[B].toJ().mixedAdd(r[U].neg())):r[B].y.cmp(r[U].y.redNeg())===0?(Z[1]=r[B].toJ().mixedAdd(r[U]),Z[2]=r[B].add(r[U].neg())):(Z[1]=r[B].toJ().mixedAdd(r[U]),Z[2]=r[B].toJ().mixedAdd(r[U].neg()));var $=[-3,-1,-5,-7,0,7,5,1,3],H=mB(i[B],i[U]);for(w=Math.max(H[0].length,w),_[B]=new Array(w),_[U]=new Array(w),T=0;T<w;T++){var ee=H[0][T]|0,ce=H[1][T]|0;_[B][T]=$[(ee+1)*3+(ce+1)],_[U][T]=0,m[B]=Z}}var ge=this.jpoint(null,null,null),Se=this._wnafT4;for(I=w;I>=0;I--){for(var me=0;I>=0;){var O=!0;for(T=0;T<n;T++)Se[T]=_[T][I]|0,Se[T]!==0&&(O=!1);if(!O)break;me++,I--}if(I>=0&&me++,ge=ge.dblp(me),I<0)break;for(T=0;T<n;T++){var E=Se[T];E!==0&&(E>0?N=m[T][E-1>>1]:E<0&&(N=m[T][-E-1>>1].neg()),N.type==="affine"?ge=ge.mixedAdd(N):ge=ge.add(N))}}for(I=0;I<n;I++)m[I]=null;return o?ge:ge.toP()};function gn(e,t){this.curve=e,this.type=t,this.precomputed=null}$a.BasePoint=gn;gn.prototype.eq=function(){throw new Error("Not implemented")};gn.prototype.validate=function(){return this.curve.validate(this)};$a.prototype.decodePoint=function(t,r){t=el.toArray(t,r);var i=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*i){t[0]===6?Bh(t[t.length-1]%2===0):t[0]===7&&Bh(t[t.length-1]%2===1);var n=this.point(t.slice(1,1+i),t.slice(1+i,1+2*i));return n}else if((t[0]===2||t[0]===3)&&t.length-1===i)return this.pointFromX(t.slice(1,1+i),t[0]===3);throw new Error("Unknown point format")};gn.prototype.encodeCompressed=function(t){return this.encode(t,!0)};gn.prototype._encode=function(t){var r=this.curve.p.byteLength(),i=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",r))};gn.prototype.encode=function(t,r){return el.encode(this._encode(r),t)};gn.prototype.precompute=function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this};gn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1};gn.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,o=0;o<r;o+=t){for(var u=0;u<t;u++)n=n.dbl();i.push(n)}return{step:t,points:i}};gn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],i=(1<<t)-1,n=i===1?null:this.dbl(),o=1;o<i;o++)r[o]=r[o-1].add(n);return{wnd:t,points:r}};gn.prototype._getBeta=function(){return null};gn.prototype.dblp=function(t){for(var r=this,i=0;i<t;i++)r=r.dbl();return r}});var pS=X((YY,Xv)=>{typeof Object.create=="function"?Xv.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Xv.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var rl=X((ZY,Qv)=>{try{if(Jv=require("util"),typeof Jv.inherits!="function")throw"";Qv.exports=Jv.inherits}catch{Qv.exports=pS()}var Jv});var dS=X((XY,hS)=>{"use strict";var vB=Zi(),yr=cs(),eg=rl(),iu=tl(),gB=vB.assert;function xn(e){iu.call(this,"short",e),this.a=new yr(e.a,16).toRed(this.red),this.b=new yr(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}eg(xn,iu);hS.exports=xn;xn.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(t.beta)r=new yr(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(t.lambda)i=new yr(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?i=o[0]:(i=o[1],gB(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var u;return t.basis?u=t.basis.map(function(m){return{a:new yr(m.a,16),b:new yr(m.b,16)}}):u=this._getEndoBasis(i),{beta:r,lambda:i,basis:u}}};xn.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:yr.mont(t),i=new yr(2).toRed(r).redInvm(),n=i.redNeg(),o=new yr(3).toRed(r).redNeg().redSqrt().redMul(i),u=n.redAdd(o).fromRed(),m=n.redSub(o).fromRed();return[u,m]};xn.prototype._getEndoBasis=function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=t,n=this.n.clone(),o=new yr(1),u=new yr(0),m=new yr(0),_=new yr(1),w,I,T,N,C,B,U,Z=0,$,H;i.cmpn(0)!==0;){var ee=n.div(i);$=n.sub(ee.mul(i)),H=m.sub(ee.mul(o));var ce=_.sub(ee.mul(u));if(!T&&$.cmp(r)<0)w=U.neg(),I=o,T=$.neg(),N=H;else if(T&&++Z===2)break;U=$,n=i,i=$,m=o,o=H,_=u,u=ce}C=$.neg(),B=H;var ge=T.sqr().add(N.sqr()),Se=C.sqr().add(B.sqr());return Se.cmp(ge)>=0&&(C=w,B=I),T.negative&&(T=T.neg(),N=N.neg()),C.negative&&(C=C.neg(),B=B.neg()),[{a:T,b:N},{a:C,b:B}]};xn.prototype._endoSplit=function(t){var r=this.endo.basis,i=r[0],n=r[1],o=n.b.mul(t).divRound(this.n),u=i.b.neg().mul(t).divRound(this.n),m=o.mul(i.a),_=u.mul(n.a),w=o.mul(i.b),I=u.mul(n.b),T=t.sub(m).sub(_),N=w.add(I).neg();return{k1:T,k2:N}};xn.prototype.pointFromX=function(t,r){t=new yr(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var o=n.fromRed().isOdd();return(r&&!o||!r&&o)&&(n=n.redNeg()),this.point(t,n)};xn.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,i=t.y,n=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0};xn.prototype._endoWnafMulAdd=function(t,r,i){for(var n=this._endoWnafT1,o=this._endoWnafT2,u=0;u<t.length;u++){var m=this._endoSplit(r[u]),_=t[u],w=_._getBeta();m.k1.negative&&(m.k1.ineg(),_=_.neg(!0)),m.k2.negative&&(m.k2.ineg(),w=w.neg(!0)),n[u*2]=_,n[u*2+1]=w,o[u*2]=m.k1,o[u*2+1]=m.k2}for(var I=this._wnafMulAdd(1,n,o,u*2,i),T=0;T<u*2;T++)n[T]=null,o[T]=null;return I};function Jr(e,t,r,i){iu.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new yr(t,16),this.y=new yr(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}eg(Jr,iu.BasePoint);xn.prototype.point=function(t,r,i){return new Jr(this,t,r,i)};xn.prototype.pointFromJSON=function(t,r){return Jr.fromJSON(this,t,r)};Jr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var i=this.curve,n=function(o){return i.point(o.x.redMul(i.endo.beta),o.y)};t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return r}};Jr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Jr.fromJSON=function(t,r,i){typeof r=="string"&&(r=JSON.parse(r));var n=t.point(r[0],r[1],i);if(!r[2])return n;function o(m){return t.point(m[0],m[1],i)}var u=r[2];return n.precomputed={beta:null,doubles:u.doubles&&{step:u.doubles.step,points:[n].concat(u.doubles.points.map(o))},naf:u.naf&&{wnd:u.naf.wnd,points:[n].concat(u.naf.points.map(o))}},n};Jr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Jr.prototype.isInfinity=function(){return this.inf};Jr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(t.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};Jr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=t.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),u=o.redSqr().redISub(this.x.redAdd(this.x)),m=o.redMul(this.x.redSub(u)).redISub(this.y);return this.curve.point(u,m)};Jr.prototype.getX=function(){return this.x.fromRed()};Jr.prototype.getY=function(){return this.y.fromRed()};Jr.prototype.mul=function(t){return t=new yr(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Jr.prototype.mulAdd=function(t,r,i){var n=[this,r],o=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)};Jr.prototype.jmulAdd=function(t,r,i){var n=[this,r],o=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)};Jr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Jr.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,n=function(o){return o.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r};Jr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function ni(e,t,r,i){iu.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yr(0)):(this.x=new yr(t,16),this.y=new yr(r,16),this.z=new yr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}eg(ni,iu.BasePoint);xn.prototype.jpoint=function(t,r,i){return new ni(this,t,r,i)};ni.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(t);return this.curve.point(i,n)};ni.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ni.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),o=t.x.redMul(i),u=this.y.redMul(r.redMul(t.z)),m=t.y.redMul(i.redMul(this.z)),_=n.redSub(o),w=u.redSub(m);if(_.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var I=_.redSqr(),T=I.redMul(_),N=n.redMul(I),C=w.redSqr().redIAdd(T).redISub(N).redISub(N),B=w.redMul(N.redISub(C)).redISub(u.redMul(T)),U=this.z.redMul(t.z).redMul(_);return this.curve.jpoint(C,B,U)};ni.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=t.x.redMul(r),o=this.y,u=t.y.redMul(r).redMul(this.z),m=i.redSub(n),_=o.redSub(u);if(m.cmpn(0)===0)return _.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=m.redSqr(),I=w.redMul(m),T=i.redMul(w),N=_.redSqr().redIAdd(I).redISub(T).redISub(T),C=_.redMul(T.redISub(N)).redISub(o.redMul(I)),B=this.z.redMul(m);return this.curve.jpoint(N,C,B)};ni.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r<t;r++)i=i.dbl();return i}var n=this.curve.a,o=this.curve.tinv,u=this.x,m=this.y,_=this.z,w=_.redSqr().redSqr(),I=m.redAdd(m);for(r=0;r<t;r++){var T=u.redSqr(),N=I.redSqr(),C=N.redSqr(),B=T.redAdd(T).redIAdd(T).redIAdd(n.redMul(w)),U=u.redMul(N),Z=B.redSqr().redISub(U.redAdd(U)),$=U.redISub(Z),H=B.redMul($);H=H.redIAdd(H).redISub(C);var ee=I.redMul(_);r+1<t&&(w=w.redMul(C)),u=Z,_=ee,I=H}return this.curve.jpoint(u,I.redMul(o),_)};ni.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ni.prototype._zeroDbl=function(){var t,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),u=o.redSqr(),m=this.x.redAdd(o).redSqr().redISub(n).redISub(u);m=m.redIAdd(m);var _=n.redAdd(n).redIAdd(n),w=_.redSqr().redISub(m).redISub(m),I=u.redIAdd(u);I=I.redIAdd(I),I=I.redIAdd(I),t=w,r=_.redMul(m.redISub(w)).redISub(I),i=this.y.redAdd(this.y)}else{var T=this.x.redSqr(),N=this.y.redSqr(),C=N.redSqr(),B=this.x.redAdd(N).redSqr().redISub(T).redISub(C);B=B.redIAdd(B);var U=T.redAdd(T).redIAdd(T),Z=U.redSqr(),$=C.redIAdd(C);$=$.redIAdd($),$=$.redIAdd($),t=Z.redISub(B).redISub(B),r=U.redMul(B.redISub(t)).redISub($),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(t,r,i)};ni.prototype._threeDbl=function(){var t,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),u=o.redSqr(),m=this.x.redAdd(o).redSqr().redISub(n).redISub(u);m=m.redIAdd(m);var _=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),w=_.redSqr().redISub(m).redISub(m);t=w;var I=u.redIAdd(u);I=I.redIAdd(I),I=I.redIAdd(I),r=_.redMul(m.redISub(w)).redISub(I),i=this.y.redAdd(this.y)}else{var T=this.z.redSqr(),N=this.y.redSqr(),C=this.x.redMul(N),B=this.x.redSub(T).redMul(this.x.redAdd(T));B=B.redAdd(B).redIAdd(B);var U=C.redIAdd(C);U=U.redIAdd(U);var Z=U.redAdd(U);t=B.redSqr().redISub(Z),i=this.y.redAdd(this.z).redSqr().redISub(N).redISub(T);var $=N.redSqr();$=$.redIAdd($),$=$.redIAdd($),$=$.redIAdd($),r=B.redMul(U.redISub(t)).redISub($)}return this.curve.jpoint(t,r,i)};ni.prototype._dbl=function(){var t=this.curve.a,r=this.x,i=this.y,n=this.z,o=n.redSqr().redSqr(),u=r.redSqr(),m=i.redSqr(),_=u.redAdd(u).redIAdd(u).redIAdd(t.redMul(o)),w=r.redAdd(r);w=w.redIAdd(w);var I=w.redMul(m),T=_.redSqr().redISub(I.redAdd(I)),N=I.redISub(T),C=m.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var B=_.redMul(N).redISub(C),U=i.redAdd(i).redMul(n);return this.curve.jpoint(T,B,U)};ni.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr(),n=r.redSqr(),o=t.redAdd(t).redIAdd(t),u=o.redSqr(),m=this.x.redAdd(r).redSqr().redISub(t).redISub(n);m=m.redIAdd(m),m=m.redAdd(m).redIAdd(m),m=m.redISub(u);var _=m.redSqr(),w=n.redIAdd(n);w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var I=o.redIAdd(m).redSqr().redISub(u).redISub(_).redISub(w),T=r.redMul(I);T=T.redIAdd(T),T=T.redIAdd(T);var N=this.x.redMul(_).redISub(T);N=N.redIAdd(N),N=N.redIAdd(N);var C=this.y.redMul(I.redMul(w.redISub(I)).redISub(m.redMul(_)));C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var B=this.z.redAdd(m).redSqr().redISub(i).redISub(_);return this.curve.jpoint(N,C,B)};ni.prototype.mul=function(t,r){return t=new yr(t,r),this.curve._wnafMul(this,t)};ni.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),i=t.z.redSqr();if(this.x.redMul(i).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var n=r.redMul(this.z),o=i.redMul(t.z);return this.y.redMul(o).redISub(t.y.redMul(n)).cmpn(0)===0};ni.prototype.eqXToP=function(t){var r=this.z.redSqr(),i=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(i)===0)return!0;for(var n=t.clone(),o=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}};ni.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};ni.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var gS=X((JY,vS)=>{"use strict";var nu=cs(),mS=rl(),Mh=tl(),xB=Zi();function su(e){Mh.call(this,"mont",e),this.a=new nu(e.a,16).toRed(this.red),this.b=new nu(e.b,16).toRed(this.red),this.i4=new nu(4).toRed(this.red).redInvm(),this.two=new nu(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}mS(su,Mh);vS.exports=su;su.prototype.validate=function(t){var r=t.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),o=n.redSqrt();return o.redSqr().cmp(n)===0};function Qr(e,t,r){Mh.BasePoint.call(this,e,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new nu(t,16),this.z=new nu(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}mS(Qr,Mh.BasePoint);su.prototype.decodePoint=function(t,r){return this.point(xB.toArray(t,r),1)};su.prototype.point=function(t,r){return new Qr(this,t,r)};su.prototype.pointFromJSON=function(t){return Qr.fromJSON(this,t)};Qr.prototype.precompute=function(){};Qr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Qr.fromJSON=function(t,r){return new Qr(t,r[0],r[1]||t.one)};Qr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Qr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Qr.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),o=r.redSub(n),u=r.redMul(n),m=o.redMul(n.redAdd(this.curve.a24.redMul(o)));return this.curve.point(u,m)};Qr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Qr.prototype.diffAdd=function(t,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=t.x.redAdd(t.z),u=t.x.redSub(t.z),m=u.redMul(i),_=o.redMul(n),w=r.z.redMul(m.redAdd(_).redSqr()),I=r.x.redMul(m.redISub(_).redSqr());return this.curve.point(w,I)};Qr.prototype.mul=function(t){for(var r=t.clone(),i=this,n=this.curve.point(null,null),o=this,u=[];r.cmpn(0)!==0;r.iushrn(1))u.push(r.andln(1));for(var m=u.length-1;m>=0;m--)u[m]===0?(i=i.diffAdd(n,o),n=n.dbl()):(n=i.diffAdd(n,o),i=i.dbl());return n};Qr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Qr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Qr.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};Qr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Qr.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var _S=X((QY,bS)=>{"use strict";var bB=Zi(),ta=cs(),xS=rl(),Ch=tl(),_B=bB.assert;function us(e){this.twisted=(e.a|0)!==1,this.mOneA=this.twisted&&(e.a|0)===-1,this.extended=this.mOneA,Ch.call(this,"edwards",e),this.a=new ta(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new ta(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new ta(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),_B(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(e.c|0)===1}xS(us,Ch);bS.exports=us;us.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};us.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};us.prototype.jpoint=function(t,r,i,n){return this.point(t,r,i,n)};us.prototype.pointFromX=function(t,r){t=new ta(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr(),n=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),u=n.redMul(o.redInvm()),m=u.redSqrt();if(m.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");var _=m.fromRed().isOdd();return(r&&!_||!r&&_)&&(m=m.redNeg()),this.point(t,m)};us.prototype.pointFromY=function(t,r){t=new ta(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr(),n=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),u=n.redMul(o.redInvm());if(u.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var m=u.redSqrt();if(m.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");return m.fromRed().isOdd()!==r&&(m=m.redNeg()),this.point(m,t)};us.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),i=t.y.redSqr(),n=r.redMul(this.a).redAdd(i),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return n.cmp(o)===0};function Zt(e,t,r,i,n){Ch.BasePoint.call(this,e,"projective"),t===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new ta(t,16),this.y=new ta(r,16),this.z=i?new ta(i,16):this.curve.one,this.t=n&&new ta(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}xS(Zt,Ch.BasePoint);us.prototype.pointFromJSON=function(t){return Zt.fromJSON(this,t)};us.prototype.point=function(t,r,i,n){return new Zt(this,t,r,i,n)};Zt.fromJSON=function(t,r){return new Zt(t,r[0],r[1],r[2])};Zt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Zt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Zt.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),u=n.redAdd(r),m=u.redSub(i),_=n.redSub(r),w=o.redMul(m),I=u.redMul(_),T=o.redMul(_),N=m.redMul(u);return this.curve.point(w,I,N,T)};Zt.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),n,o,u,m,_,w;if(this.curve.twisted){m=this.curve._mulA(r);var I=m.redAdd(i);this.zOne?(n=t.redSub(r).redSub(i).redMul(I.redSub(this.curve.two)),o=I.redMul(m.redSub(i)),u=I.redSqr().redSub(I).redSub(I)):(_=this.z.redSqr(),w=I.redSub(_).redISub(_),n=t.redSub(r).redISub(i).redMul(w),o=I.redMul(m.redSub(i)),u=I.redMul(w))}else m=r.redAdd(i),_=this.curve._mulC(this.z).redSqr(),w=m.redSub(_).redSub(_),n=this.curve._mulC(t.redISub(m)).redMul(w),o=this.curve._mulC(m).redMul(r.redISub(i)),u=m.redMul(w);return this.curve.point(n,o,u)};Zt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Zt.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),i=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),u=i.redSub(r),m=o.redSub(n),_=o.redAdd(n),w=i.redAdd(r),I=u.redMul(m),T=_.redMul(w),N=u.redMul(w),C=m.redMul(_);return this.curve.point(I,T,C,N)};Zt.prototype._projAdd=function(t){var r=this.z.redMul(t.z),i=r.redSqr(),n=this.x.redMul(t.x),o=this.y.redMul(t.y),u=this.curve.d.redMul(n).redMul(o),m=i.redSub(u),_=i.redAdd(u),w=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(n).redISub(o),I=r.redMul(m).redMul(w),T,N;return this.curve.twisted?(T=r.redMul(_).redMul(o.redSub(this.curve._mulA(n))),N=m.redMul(_)):(T=r.redMul(_).redMul(o.redSub(n)),N=this.curve._mulC(m).redMul(_)),this.curve.point(I,T,N)};Zt.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};Zt.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};Zt.prototype.mulAdd=function(t,r,i){return this.curve._wnafMulAdd(1,[this,r],[t,i],2,!1)};Zt.prototype.jmulAdd=function(t,r,i){return this.curve._wnafMulAdd(1,[this,r],[t,i],2,!0)};Zt.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};Zt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Zt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Zt.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Zt.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};Zt.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=t.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}};Zt.prototype.toP=Zt.prototype.normalize;Zt.prototype.mixedAdd=Zt.prototype.add});var tg=X(yS=>{"use strict";var Lh=yS;Lh.base=tl();Lh.short=dS();Lh.mont=gS();Lh.edwards=_S()});var Dn=X(Vt=>{"use strict";var yB=Ka(),wB=rl();Vt.inherits=wB;function SB(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function EB(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=o&63|128):SB(e,n)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(n=0;n<e.length;n++)r[n]=e[n]|0;return r}Vt.toArray=EB;function IB(e){for(var t="",r=0;r<e.length;r++)t+=SS(e[r].toString(16));return t}Vt.toHex=IB;function wS(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Vt.htonl=wS;function TB(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];t==="little"&&(n=wS(n)),r+=ES(n.toString(16))}return r}Vt.toHex32=TB;function SS(e){return e.length===1?"0"+e:e}Vt.zero2=SS;function ES(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}Vt.zero8=ES;function RB(e,t,r,i){var n=r-t;yB(n%4===0);for(var o=new Array(n/4),u=0,m=t;u<o.length;u++,m+=4){var _;i==="big"?_=e[m]<<24|e[m+1]<<16|e[m+2]<<8|e[m+3]:_=e[m+3]<<24|e[m+2]<<16|e[m+1]<<8|e[m],o[u]=_>>>0}return o}Vt.join32=RB;function AB(e,t){for(var r=new Array(e.length*4),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];t==="big"?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o&255):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=o&255)}return r}Vt.split32=AB;function OB(e,t){return e>>>t|e<<32-t}Vt.rotr32=OB;function kB(e,t){return e<<t|e>>>32-t}Vt.rotl32=kB;function PB(e,t){return e+t>>>0}Vt.sum32=PB;function NB(e,t,r){return e+t+r>>>0}Vt.sum32_3=NB;function BB(e,t,r,i){return e+t+r+i>>>0}Vt.sum32_4=BB;function MB(e,t,r,i,n){return e+t+r+i+n>>>0}Vt.sum32_5=MB;function CB(e,t,r,i){var n=e[t],o=e[t+1],u=i+o>>>0,m=(u<i?1:0)+r+n;e[t]=m>>>0,e[t+1]=u}Vt.sum64=CB;function LB(e,t,r,i){var n=t+i>>>0,o=(n<t?1:0)+e+r;return o>>>0}Vt.sum64_hi=LB;function UB(e,t,r,i){var n=t+i;return n>>>0}Vt.sum64_lo=UB;function DB(e,t,r,i,n,o,u,m){var _=0,w=t;w=w+i>>>0,_+=w<t?1:0,w=w+o>>>0,_+=w<o?1:0,w=w+m>>>0,_+=w<m?1:0;var I=e+r+n+u+_;return I>>>0}Vt.sum64_4_hi=DB;function qB(e,t,r,i,n,o,u,m){var _=t+i+o+m;return _>>>0}Vt.sum64_4_lo=qB;function FB(e,t,r,i,n,o,u,m,_,w){var I=0,T=t;T=T+i>>>0,I+=T<t?1:0,T=T+o>>>0,I+=T<o?1:0,T=T+m>>>0,I+=T<m?1:0,T=T+w>>>0,I+=T<w?1:0;var N=e+r+n+u+_+I;return N>>>0}Vt.sum64_5_hi=FB;function HB(e,t,r,i,n,o,u,m,_,w){var I=t+i+o+m+w;return I>>>0}Vt.sum64_5_lo=HB;function zB(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}Vt.rotr64_hi=zB;function VB(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Vt.rotr64_lo=VB;function jB(e,t,r){return e>>>r}Vt.shr64_hi=jB;function WB(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Vt.shr64_lo=WB});var au=X(TS=>{"use strict";var IS=Dn(),KB=Ka();function Uh(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}TS.BlockHash=Uh;Uh.prototype.update=function(t,r){if(t=IS.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var i=t.length%this._delta8;this.pending=t.slice(t.length-i,t.length),this.pending.length===0&&(this.pending=null),t=IS.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this};Uh.prototype.digest=function(t){return this.update(this._pad()),KB(this.pending===null),this._digest(t)};Uh.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,i=r-(t+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var o=1;o<i;o++)n[o]=0;if(t<<=3,this.endian==="big"){for(var u=8;u<this.padLength;u++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=t&255}else for(n[o++]=t&255,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,u=8;u<this.padLength;u++)n[o++]=0;return n}});var rg=X(ra=>{"use strict";var GB=Dn(),fs=GB.rotr32;function $B(e,t,r,i){if(e===0)return RS(t,r,i);if(e===1||e===3)return OS(t,r,i);if(e===2)return AS(t,r,i)}ra.ft_1=$B;function RS(e,t,r){return e&t^~e&r}ra.ch32=RS;function AS(e,t,r){return e&t^e&r^t&r}ra.maj32=AS;function OS(e,t,r){return e^t^r}ra.p32=OS;function YB(e){return fs(e,2)^fs(e,13)^fs(e,22)}ra.s0_256=YB;function ZB(e){return fs(e,6)^fs(e,11)^fs(e,25)}ra.s1_256=ZB;function XB(e){return fs(e,7)^fs(e,18)^e>>>3}ra.g0_256=XB;function JB(e){return fs(e,17)^fs(e,19)^e>>>10}ra.g1_256=JB});var NS=X((nZ,PS)=>{"use strict";var ou=Dn(),QB=au(),eM=rg(),ig=ou.rotl32,il=ou.sum32,tM=ou.sum32_5,rM=eM.ft_1,kS=QB.BlockHash,iM=[1518500249,1859775393,2400959708,3395469782];function ls(){if(!(this instanceof ls))return new ls;kS.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}ou.inherits(ls,kS);PS.exports=ls;ls.blockSize=512;ls.outSize=160;ls.hmacStrength=80;ls.padLength=64;ls.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=ig(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var o=this.h[0],u=this.h[1],m=this.h[2],_=this.h[3],w=this.h[4];for(n=0;n<i.length;n++){var I=~~(n/20),T=tM(ig(o,5),rM(I,u,m,_),w,i[n],iM[I]);w=_,_=m,m=ig(u,30),u=o,o=T}this.h[0]=il(this.h[0],o),this.h[1]=il(this.h[1],u),this.h[2]=il(this.h[2],m),this.h[3]=il(this.h[3],_),this.h[4]=il(this.h[4],w)};ls.prototype._digest=function(t){return t==="hex"?ou.toHex32(this.h,"big"):ou.split32(this.h,"big")}});var ng=X((sZ,MS)=>{"use strict";var cu=Dn(),nM=au(),uu=rg(),sM=Ka(),qn=cu.sum32,aM=cu.sum32_4,oM=cu.sum32_5,cM=uu.ch32,uM=uu.maj32,fM=uu.s0_256,lM=uu.s1_256,pM=uu.g0_256,hM=uu.g1_256,BS=nM.BlockHash,dM=[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];function ps(){if(!(this instanceof ps))return new ps;BS.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=dM,this.W=new Array(64)}cu.inherits(ps,BS);MS.exports=ps;ps.blockSize=512;ps.outSize=256;ps.hmacStrength=192;ps.padLength=64;ps.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=aM(hM(i[n-2]),i[n-7],pM(i[n-15]),i[n-16]);var o=this.h[0],u=this.h[1],m=this.h[2],_=this.h[3],w=this.h[4],I=this.h[5],T=this.h[6],N=this.h[7];for(sM(this.k.length===i.length),n=0;n<i.length;n++){var C=oM(N,lM(w),cM(w,I,T),this.k[n],i[n]),B=qn(fM(o),uM(o,u,m));N=T,T=I,I=w,w=qn(_,C),_=m,m=u,u=o,o=qn(C,B)}this.h[0]=qn(this.h[0],o),this.h[1]=qn(this.h[1],u),this.h[2]=qn(this.h[2],m),this.h[3]=qn(this.h[3],_),this.h[4]=qn(this.h[4],w),this.h[5]=qn(this.h[5],I),this.h[6]=qn(this.h[6],T),this.h[7]=qn(this.h[7],N)};ps.prototype._digest=function(t){return t==="hex"?cu.toHex32(this.h,"big"):cu.split32(this.h,"big")}});var US=X((aZ,LS)=>{"use strict";var sg=Dn(),CS=ng();function ia(){if(!(this instanceof ia))return new ia;CS.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sg.inherits(ia,CS);LS.exports=ia;ia.blockSize=512;ia.outSize=224;ia.hmacStrength=192;ia.padLength=64;ia.prototype._digest=function(t){return t==="hex"?sg.toHex32(this.h.slice(0,7),"big"):sg.split32(this.h.slice(0,7),"big")}});var cg=X((oZ,HS)=>{"use strict";var Bi=Dn(),mM=au(),vM=Ka(),hs=Bi.rotr64_hi,ds=Bi.rotr64_lo,DS=Bi.shr64_hi,qS=Bi.shr64_lo,Ya=Bi.sum64,ag=Bi.sum64_hi,og=Bi.sum64_lo,gM=Bi.sum64_4_hi,xM=Bi.sum64_4_lo,bM=Bi.sum64_5_hi,_M=Bi.sum64_5_lo,FS=mM.BlockHash,yM=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Fn(){if(!(this instanceof Fn))return new Fn;FS.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=yM,this.W=new Array(160)}Bi.inherits(Fn,FS);HS.exports=Fn;Fn.blockSize=1024;Fn.outSize=512;Fn.hmacStrength=192;Fn.padLength=128;Fn.prototype._prepareBlock=function(t,r){for(var i=this.W,n=0;n<32;n++)i[n]=t[r+n];for(;n<i.length;n+=2){var o=NM(i[n-4],i[n-3]),u=BM(i[n-4],i[n-3]),m=i[n-14],_=i[n-13],w=kM(i[n-30],i[n-29]),I=PM(i[n-30],i[n-29]),T=i[n-32],N=i[n-31];i[n]=gM(o,u,m,_,w,I,T,N),i[n+1]=xM(o,u,m,_,w,I,T,N)}};Fn.prototype._update=function(t,r){this._prepareBlock(t,r);var i=this.W,n=this.h[0],o=this.h[1],u=this.h[2],m=this.h[3],_=this.h[4],w=this.h[5],I=this.h[6],T=this.h[7],N=this.h[8],C=this.h[9],B=this.h[10],U=this.h[11],Z=this.h[12],$=this.h[13],H=this.h[14],ee=this.h[15];vM(this.k.length===i.length);for(var ce=0;ce<i.length;ce+=2){var ge=H,Se=ee,me=AM(N,C),O=OM(N,C),E=wM(N,C,B,U,Z,$),f=SM(N,C,B,U,Z,$),c=this.k[ce],p=this.k[ce+1],v=i[ce],g=i[ce+1],x=bM(ge,Se,me,O,E,f,c,p,v,g),S=_M(ge,Se,me,O,E,f,c,p,v,g);ge=TM(n,o),Se=RM(n,o),me=EM(n,o,u,m,_,w),O=IM(n,o,u,m,_,w);var b=ag(ge,Se,me,O),l=og(ge,Se,me,O);H=Z,ee=$,Z=B,$=U,B=N,U=C,N=ag(I,T,x,S),C=og(T,T,x,S),I=_,T=w,_=u,w=m,u=n,m=o,n=ag(x,S,b,l),o=og(x,S,b,l)}Ya(this.h,0,n,o),Ya(this.h,2,u,m),Ya(this.h,4,_,w),Ya(this.h,6,I,T),Ya(this.h,8,N,C),Ya(this.h,10,B,U),Ya(this.h,12,Z,$),Ya(this.h,14,H,ee)};Fn.prototype._digest=function(t){return t==="hex"?Bi.toHex32(this.h,"big"):Bi.split32(this.h,"big")};function wM(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function SM(e,t,r,i,n,o){var u=t&i^~t&o;return u<0&&(u+=4294967296),u}function EM(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function IM(e,t,r,i,n,o){var u=t&i^t&o^i&o;return u<0&&(u+=4294967296),u}function TM(e,t){var r=hs(e,t,28),i=hs(t,e,2),n=hs(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function RM(e,t){var r=ds(e,t,28),i=ds(t,e,2),n=ds(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function AM(e,t){var r=hs(e,t,14),i=hs(e,t,18),n=hs(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function OM(e,t){var r=ds(e,t,14),i=ds(e,t,18),n=ds(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function kM(e,t){var r=hs(e,t,1),i=hs(e,t,8),n=DS(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function PM(e,t){var r=ds(e,t,1),i=ds(e,t,8),n=qS(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function NM(e,t){var r=hs(e,t,19),i=hs(t,e,29),n=DS(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}function BM(e,t){var r=ds(e,t,19),i=ds(t,e,29),n=qS(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}});var jS=X((cZ,VS)=>{"use strict";var ug=Dn(),zS=cg();function na(){if(!(this instanceof na))return new na;zS.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ug.inherits(na,zS);VS.exports=na;na.blockSize=1024;na.outSize=384;na.hmacStrength=192;na.padLength=128;na.prototype._digest=function(t){return t==="hex"?ug.toHex32(this.h.slice(0,12),"big"):ug.split32(this.h.slice(0,12),"big")}});var WS=X(fu=>{"use strict";fu.sha1=NS();fu.sha224=US();fu.sha256=ng();fu.sha384=jS();fu.sha512=cg()});var XS=X(ZS=>{"use strict";var Yo=Dn(),MM=au(),Dh=Yo.rotl32,KS=Yo.sum32,nl=Yo.sum32_3,GS=Yo.sum32_4,YS=MM.BlockHash;function ms(){if(!(this instanceof ms))return new ms;YS.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Yo.inherits(ms,YS);ZS.ripemd160=ms;ms.blockSize=512;ms.outSize=160;ms.hmacStrength=192;ms.padLength=64;ms.prototype._update=function(t,r){for(var i=this.h[0],n=this.h[1],o=this.h[2],u=this.h[3],m=this.h[4],_=i,w=n,I=o,T=u,N=m,C=0;C<80;C++){var B=KS(Dh(GS(i,$S(C,n,o,u),t[UM[C]+r],CM(C)),qM[C]),m);i=m,m=u,u=Dh(o,10),o=n,n=B,B=KS(Dh(GS(_,$S(79-C,w,I,T),t[DM[C]+r],LM(C)),FM[C]),N),_=N,N=T,T=Dh(I,10),I=w,w=B}B=nl(this.h[1],o,T),this.h[1]=nl(this.h[2],u,N),this.h[2]=nl(this.h[3],m,_),this.h[3]=nl(this.h[4],i,w),this.h[4]=nl(this.h[0],n,I),this.h[0]=B};ms.prototype._digest=function(t){return t==="hex"?Yo.toHex32(this.h,"little"):Yo.split32(this.h,"little")};function $S(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function CM(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function LM(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var UM=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],DM=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],qM=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],FM=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var QS=X((lZ,JS)=>{"use strict";var HM=Dn(),zM=Ka();function lu(e,t,r){if(!(this instanceof lu))return new lu(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(HM.toArray(t,r))}JS.exports=lu;lu.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),zM(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};lu.prototype.update=function(t,r){return this.inner.update(t,r),this};lu.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var qh=X(eE=>{var si=eE;si.utils=Dn();si.common=au();si.sha=WS();si.ripemd=XS();si.hmac=QS();si.sha1=si.sha.sha1;si.sha256=si.sha.sha256;si.sha224=si.sha.sha224;si.sha384=si.sha.sha384;si.sha512=si.sha.sha512;si.ripemd160=si.ripemd.ripemd160});var rE=X((hZ,tE)=>{tE.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var Fh=X(sE=>{"use strict";var lg=sE,Za=qh(),fg=tg(),VM=Zi(),iE=VM.assert;function nE(e){e.type==="short"?this.curve=new fg.short(e):e.type==="edwards"?this.curve=new fg.edwards(e):this.curve=new fg.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,iE(this.g.validate(),"Invalid curve"),iE(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}lg.PresetCurve=nE;function Xa(e,t){Object.defineProperty(lg,e,{configurable:!0,enumerable:!0,get:function(){var r=new nE(t);return Object.defineProperty(lg,e,{configurable:!0,enumerable:!0,value:r}),r}})}Xa("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Za.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Xa("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Za.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Xa("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Za.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Xa("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Za.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Xa("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Za.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Xa("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Za.sha256,gRed:!1,g:["9"]});Xa("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Za.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pg;try{pg=rE()}catch{pg=void 0}Xa("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Za.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pg]})});var cE=X((mZ,oE)=>{"use strict";var jM=qh(),Zo=Kv(),aE=Ka();function Ja(e){if(!(this instanceof Ja))return new Ja(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Zo.toArray(e.entropy,e.entropyEnc||"hex"),r=Zo.toArray(e.nonce,e.nonceEnc||"hex"),i=Zo.toArray(e.pers,e.persEnc||"hex");aE(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}oE.exports=Ja;Ja.prototype._init=function(t,r,i){var n=t.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656};Ja.prototype._hmac=function(){return new jM.hmac(this.hash,this.K)};Ja.prototype._update=function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};Ja.prototype.reseed=function(t,r,i,n){typeof r!="string"&&(n=i,i=r,r=null),t=Zo.toArray(t,r),i=Zo.toArray(i,n),aE(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this._reseed=1};Ja.prototype.generate=function(t,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=Zo.toArray(i,n||"hex"),this._update(i));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var u=o.slice(0,t);return this._update(i),this._reseed++,Zo.encode(u,r)}});var fE=X((vZ,uE)=>{"use strict";var WM=cs(),KM=Zi(),hg=KM.assert;function pi(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}uE.exports=pi;pi.fromPublic=function(t,r,i){return r instanceof pi?r:new pi(t,{pub:r,pubEnc:i})};pi.fromPrivate=function(t,r,i){return r instanceof pi?r:new pi(t,{priv:r,privEnc:i})};pi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};pi.prototype.getPublic=function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub};pi.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};pi.prototype._importPrivate=function(t,r){this.priv=new WM(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)};pi.prototype._importPublic=function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?hg(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&hg(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)};pi.prototype.derive=function(t){return t.validate()||hg(t.validate(),"public point not validated"),t.mul(this.priv).getX()};pi.prototype.sign=function(t,r,i){return this.ec.sign(t,this,r,i)};pi.prototype.verify=function(t,r){return this.ec.verify(t,r,this)};pi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var hE=X((gZ,pE)=>{"use strict";var Hh=cs(),vg=Zi(),GM=vg.assert;function zh(e,t){if(e instanceof zh)return e;this._importDER(e,t)||(GM(e.r&&e.s,"Signature without r or s"),this.r=new Hh(e.r,16),this.s=new Hh(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}pE.exports=zh;function $M(){this.place=0}function dg(e,t){var r=e[t.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,o=0,u=t.place;o<i;o++,u++)n<<=8,n|=e[u],n>>>=0;return n<=127?!1:(t.place=u,n)}function lE(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}zh.prototype._importDER=function(t,r){t=vg.toArray(t,r);var i=new $M;if(t[i.place++]!==48)return!1;var n=dg(t,i);if(n===!1||n+i.place!==t.length||t[i.place++]!==2)return!1;var o=dg(t,i);if(o===!1)return!1;var u=t.slice(i.place,o+i.place);if(i.place+=o,t[i.place++]!==2)return!1;var m=dg(t,i);if(m===!1||t.length!==m+i.place)return!1;var _=t.slice(i.place,m+i.place);if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;return this.r=new Hh(u),this.s=new Hh(_),this.recoveryParam=null,!0};function mg(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}zh.prototype.toDER=function(t){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=lE(r),i=lE(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];mg(n,r.length),n=n.concat(r),n.push(2),mg(n,i.length);var o=n.concat(i),u=[48];return mg(u,o.length),u=u.concat(o),vg.encode(u,t)}});var gE=X((xZ,vE)=>{"use strict";var Xo=cs(),dE=cE(),YM=Zi(),gg=Fh(),ZM=Zv(),mE=YM.assert,xg=fE(),Vh=hE();function bn(e){if(!(this instanceof bn))return new bn(e);typeof e=="string"&&(mE(Object.prototype.hasOwnProperty.call(gg,e),"Unknown curve "+e),e=gg[e]),e instanceof gg.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}vE.exports=bn;bn.prototype.keyPair=function(t){return new xg(this,t)};bn.prototype.keyFromPrivate=function(t,r){return xg.fromPrivate(this,t,r)};bn.prototype.keyFromPublic=function(t,r){return xg.fromPublic(this,t,r)};bn.prototype.genKeyPair=function(t){t||(t={});for(var r=new dE({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||ZM(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new Xo(2));;){var o=new Xo(r.generate(i));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}};bn.prototype._truncateToN=function(t,r){var i=t.byteLength()*8-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};bn.prototype.sign=function(t,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),t=this._truncateToN(new Xo(t,16));for(var o=this.n.byteLength(),u=r.getPrivate().toArray("be",o),m=t.toArray("be",o),_=new dE({hash:this.hash,entropy:u,nonce:m,pers:n.pers,persEnc:n.persEnc||"utf8"}),w=this.n.sub(new Xo(1)),I=0;;I++){var T=n.k?n.k(I):new Xo(_.generate(this.n.byteLength()));if(T=this._truncateToN(T,!0),!(T.cmpn(1)<=0||T.cmp(w)>=0)){var N=this.g.mul(T);if(!N.isInfinity()){var C=N.getX(),B=C.umod(this.n);if(B.cmpn(0)!==0){var U=T.invm(this.n).mul(B.mul(r.getPrivate()).iadd(t));if(U=U.umod(this.n),U.cmpn(0)!==0){var Z=(N.getY().isOdd()?1:0)|(C.cmp(B)!==0?2:0);return n.canonical&&U.cmp(this.nh)>0&&(U=this.n.sub(U),Z^=1),new Vh({r:B,s:U,recoveryParam:Z})}}}}}};bn.prototype.verify=function(t,r,i,n){t=this._truncateToN(new Xo(t,16)),i=this.keyFromPublic(i,n),r=new Vh(r,"hex");var o=r.r,u=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var m=u.invm(this.n),_=m.mul(t).umod(this.n),w=m.mul(o).umod(this.n),I;return this.curve._maxwellTrick?(I=this.g.jmulAdd(_,i.getPublic(),w),I.isInfinity()?!1:I.eqXToP(o)):(I=this.g.mulAdd(_,i.getPublic(),w),I.isInfinity()?!1:I.getX().umod(this.n).cmp(o)===0)};bn.prototype.recoverPubKey=function(e,t,r,i){mE((3&r)===r,"The recovery param is more than two bits"),t=new Vh(t,i);var n=this.n,o=new Xo(e),u=t.r,m=t.s,_=r&1,w=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");w?u=this.curve.pointFromX(u.add(this.curve.n),_):u=this.curve.pointFromX(u,_);var I=t.r.invm(n),T=n.sub(o).mul(I).umod(n),N=m.mul(I).umod(n);return this.g.mulAdd(T,u,N)};bn.prototype.getKeyRecoveryParam=function(e,t,r,i){if(t=new Vh(t,i),t.recoveryParam!==null)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch{continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}});var yE=X((bZ,_E)=>{"use strict";var sl=Zi(),bE=sl.assert,xE=sl.parseBytes,pu=sl.cachedProperty;function ei(e,t){this.eddsa=e,this._secret=xE(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=xE(t.pub)}ei.fromPublic=function(t,r){return r instanceof ei?r:new ei(t,{pub:r})};ei.fromSecret=function(t,r){return r instanceof ei?r:new ei(t,{secret:r})};ei.prototype.secret=function(){return this._secret};pu(ei,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});pu(ei,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});pu(ei,"privBytes",function(){var t=this.eddsa,r=this.hash(),i=t.encodingLength-1,n=r.slice(0,t.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});pu(ei,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});pu(ei,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});pu(ei,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});ei.prototype.sign=function(t){return bE(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};ei.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};ei.prototype.getSecret=function(t){return bE(this._secret,"KeyPair is public only"),sl.encode(this.secret(),t)};ei.prototype.getPublic=function(t){return sl.encode(this.pubBytes(),t)};_E.exports=ei});var SE=X((_Z,wE)=>{"use strict";var XM=cs(),jh=Zi(),JM=jh.assert,Wh=jh.cachedProperty,QM=jh.parseBytes;function Jo(e,t){this.eddsa=e,typeof t!="object"&&(t=QM(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),JM(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof XM&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Wh(Jo,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Wh(Jo,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Wh(Jo,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Wh(Jo,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Jo.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Jo.prototype.toHex=function(){return jh.encode(this.toBytes(),"hex").toUpperCase()};wE.exports=Jo});var AE=X((yZ,RE)=>{"use strict";var eC=qh(),tC=Fh(),hu=Zi(),rC=hu.assert,IE=hu.parseBytes,TE=yE(),EE=SE();function Mi(e){if(rC(e==="ed25519","only tested with ed25519 so far"),!(this instanceof Mi))return new Mi(e);e=tC[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=eC.sha512}RE.exports=Mi;Mi.prototype.sign=function(t,r){t=IE(t);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),t),o=this.g.mul(n),u=this.encodePoint(o),m=this.hashInt(u,i.pubBytes(),t).mul(i.priv()),_=n.add(m).umod(this.curve.n);return this.makeSignature({R:o,S:_,Rencoded:u})};Mi.prototype.verify=function(t,r,i){t=IE(t),r=this.makeSignature(r);var n=this.keyFromPublic(i),o=this.hashInt(r.Rencoded(),n.pubBytes(),t),u=this.g.mul(r.S()),m=r.R().add(n.pub().mul(o));return m.eq(u)};Mi.prototype.hashInt=function(){for(var t=this.hash(),r=0;r<arguments.length;r++)t.update(arguments[r]);return hu.intFromLE(t.digest()).umod(this.curve.n)};Mi.prototype.keyFromPublic=function(t){return TE.fromPublic(this,t)};Mi.prototype.keyFromSecret=function(t){return TE.fromSecret(this,t)};Mi.prototype.makeSignature=function(t){return t instanceof EE?t:new EE(this,t)};Mi.prototype.encodePoint=function(t){var r=t.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=t.getX().isOdd()?128:0,r};Mi.prototype.decodePoint=function(t){t=hu.parseBytes(t);var r=t.length-1,i=t.slice(0,r).concat(t[r]&-129),n=(t[r]&128)!==0,o=hu.intFromLE(i);return this.curve.pointFromY(o,n)};Mi.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)};Mi.prototype.decodeInt=function(t){return hu.intFromLE(t)};Mi.prototype.isPoint=function(t){return t instanceof this.pointClass}});var bg=X(OE=>{"use strict";var Qo=OE;Qo.version=iS().version;Qo.utils=Zi();Qo.rand=Zv();Qo.curve=tg();Qo.curves=Fh();Qo.ec=gE();Qo.eddsa=AE()});var eo=X((SZ,PE)=>{"use strict";var vs=Xr(),iC=Yt(),nC=bg().ec,Qa=new nC("secp256k1"),sC=Qa.curve.point.bind(Qa.curve),kE=Qa.curve.pointFromX.bind(Qa.curve),ti=function(t,r,i){try{var n=sC(t,r,i)}catch{throw new Error("Invalid Point")}return n.validate(),n};ti.prototype=Object.getPrototypeOf(Qa.curve.point());ti.fromX=function(t,r){try{var i=kE(r,t)}catch{throw new Error("Invalid X")}return i.validate(),i};ti.getG=function(){return Qa.curve.g};ti.getN=function(){return new vs(Qa.curve.n.toArray())};ti.getP=function(){return Qa.curve.p.clone()};ti.prototype._getX=ti.prototype.getX;ti.prototype.getX=function(){return new vs(this._getX().toArray())};ti.prototype._getY=ti.prototype.getY;ti.prototype.getY=function(){return new vs(this._getY().toArray())};ti.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var t;try{t=kE(this.getX(),this.getY().isOdd())}catch{throw new Error("Point does not lie on the curve")}if(t.y.cmp(this.y)!==0)throw new Error("Invalid y value for curve.");if(!this.mul(ti.getN()).isInfinity())throw new Error("Point times N must be infinity");return this};ti.pointToCompressed=function(t){var r=t.getX().toBuffer({size:32}),i=t.getY().toBuffer({size:32}),n,o=i[i.length-1]%2;return o?n=Buffer.from([3]):n=Buffer.from([2]),iC.concat([n,r])};ti.prototype.liftX=function(){let e=ti.getP(),t=new vs(0),r=new vs(1),i=new vs(2),n=new vs(3),o=new vs(4),u=new vs(7),m=vs.red("k256"),_=this.x.pow(n).add(u).mod(e),w=_.toRed(m).redPow(e.add(r).div(o)).mod(e);if(!_.eq(w.pow(i).mod(e)))throw new Error("liftX failed");let I=this.x.red?this.x.fromRed():this.x,T=w.mod(i).eq(t)?w.fromRed():e.sub(w);return new ti(I,T,!0)};PE.exports=ti});var di=X((EZ,BE)=>{"use strict";var sa=Xr(),aC=Et(),hi=xt(),NE=Yt(),oC=Rr(),it=function e(t,r,i){if(!(this instanceof e))return new e(t,r,i);if(t instanceof sa)this.set({r:t,s:r,isSchnorr:i});else if(t){var n=t;this.set(n)}};it.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=typeof e.i>"u"?this.i:e.i,this.compressed=typeof e.compressed>"u"?this.compressed:e.compressed,this.isSchnorr=typeof e.isSchnorr>"u"?this.isSchnorr:e.isSchnorr,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this};it.fromCompact=function(e){hi.checkArgument(NE.isBuffer(e),"Argument is expected to be a Buffer");var t=new it,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i=i+4);var n=e.slice(1,33),o=e.slice(33,65);return hi.checkArgument(i===0||i===1||i===2||i===3,new Error("i must be 0, 1, 2, or 3")),hi.checkArgument(n.length===32,new Error("r must be 32 bytes")),hi.checkArgument(o.length===32,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=sa.fromBuffer(n),t.s=sa.fromBuffer(o),t};it.fromDER=it.fromBuffer=function(e,t){var r=new it;if((e.length===64||e.length===65)&&e[0]!=48)return it.fromSchnorr(e);hi.checkArgument(!(e.length===64&&e[0]===48),new Error("64 DER (ecdsa) signatures not allowed"));var i=it.parseDER(e,t);return r.r=i.r,r.s=i.s,r};it.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new it.fromDER(r,!1);return i.nhashtype=t,i};it.fromString=function(e){var t=Buffer.from(e,"hex");return it.fromDER(t)};it.parseDER=function(e,t){hi.checkArgument(NE.isBuffer(e),new Error("DER formatted signature should be a buffer")),aC.isUndefined(t)&&(t=!0);var r=e[0];hi.checkArgument(r===48,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;hi.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i<n?i:n;var o=e[2];hi.checkArgument(o===2,new Error("Integer byte for r should be 0x02"));var u=e[3],m=e.slice(4,4+u),_=sa.fromBuffer(m),w=e[4]===0;hi.checkArgument(u===m.length,new Error("Length of r incorrect"));var I=e[4+u+0];hi.checkArgument(I===2,new Error("Integer byte for s should be 0x02"));var T=e[4+u+1],N=e.slice(4+u+2,4+u+2+T),C=sa.fromBuffer(N),B=e[4+u+2+2]===0;hi.checkArgument(T===N.length,new Error("Length of s incorrect"));var U=4+u+2+T;hi.checkArgument(i===U-2,new Error("Length of signature incorrect"));var Z={header:r,length:i,rheader:o,rlength:u,rneg:w,rbuf:m,r:_,sheader:I,slength:T,sneg:B,sbuf:N,s:C};return Z};it.prototype.toCompact=function(e,t){if(e=typeof e=="number"?e:this.i,t=typeof t=="boolean"?t:this.compressed,!(e===0||e===1||e===2||e===3))throw new Error("i must be equal to 0, 1, 2, or 3");var r=e+27+4;t===!1&&(r=r-4);var i=Buffer.from([r]),n=this.r.toBuffer({size:32}),o=this.s.toBuffer({size:32});return Buffer.concat([i,n,o])};it.prototype.toBuffer=it.prototype.toDER=function(){if(this.isSchnorr){let C=!this.nhashtype||this.nhashtype===it.SIGHASH_DEFAULT?Buffer.alloc(0):Buffer.from([this.nhashtype]);return Buffer.concat([this.r.toBuffer({size:32}),this.s.toBuffer({size:32}),C])}var e=this.r.toBuffer(),t=this.s.toBuffer(),r=!!(e[0]&128),i=!!(t[0]&128),n=r?Buffer.concat([Buffer.from([0]),e]):e,o=i?Buffer.concat([Buffer.from([0]),t]):t,u=n.length,m=o.length,_=2+u+2+m,w=2,I=2,T=48,N=Buffer.concat([Buffer.from([T,_,w,u]),n,Buffer.from([I,m]),o]);return N};it.prototype.toString=function(){var e=this.toDER();return e.toString("hex")};it.isTxDER=function(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(e[2]!==2||t===0||i[0]&128||t>1&&i[0]===0&&!(i[1]&128))return!1;var n=e.slice(6+t);return!(e[6+t-2]!==2||r===0||n[0]&128||r>1&&n[0]===0&&!(n[1]&128))};it.prototype.hasLowS=function(){return!(this.s.lt(new sa(1))||this.s.gt(new sa("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))};it.prototype.hasDefinedHashtype=function(){if(!oC.isNaturalNumber(this.nhashtype))return!1;var e=this.nhashtype&~it.SIGHASH_ANYONECANPAY;return!(e<it.SIGHASH_ALL||e>it.SIGHASH_SINGLE)};it.prototype.toTxFormat=function(){var e=this.toDER(),t=Buffer.alloc(1);return t.writeUInt8(this.nhashtype,0),Buffer.concat([e,t])};it.fromSchnorr=function(e){hi.checkArgument(Buffer.isBuffer(e),"Schnorr signature argument must be a buffer"),hi.checkArgument(e.length===64||e.length===65,"Schnorr signatures must be 64 or 65 bytes");let t=new it,r=e.slice(0,32),i=e.slice(32,64);return e.length===65?(t.nhashtype=e[e.length-1],hi.checkState(t.nhashtype!==it.SIGHASH_DEFAULT,new Error("invalid hashtype"))):t.nhashtype=it.SIGHASH_DEFAULT,t.r=sa.fromBuffer(r),t.s=sa.fromBuffer(i),t.isSchnorr=!0,t};it.SIGHASH_DEFAULT=0;it.SIGHASH_ALL=1;it.SIGHASH_NONE=2;it.SIGHASH_SINGLE=3;it.SIGHASH_ANYONECANPAY=128;it.SIGHASH_OUTPUT_MASK=3;it.SIGHASH_INPUT_MASK=128;it.Version={};it.Version.BASE=0;it.Version.WITNESS_V0=1;it.Version.TAPROOT=2;it.Version.TAPSCRIPT=3;BE.exports=it});var Dr=X((IZ,ME)=>{"use strict";var Kh=require("crypto"),to=Yt(),aa=xt(),Ur=ME.exports;Ur.sha1=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("sha1").update(e).digest()};Ur.sha1.blocksize=512;Ur.sha256=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("sha256").update(e).digest()};Ur.sha256.blocksize=512;Ur.sha256sha256=function(e){return aa.checkArgument(to.isBuffer(e)),Ur.sha256(Ur.sha256(e))};Ur.ripemd160=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("ripemd160").update(e).digest()};Ur.sha256ripemd160=function(e){return aa.checkArgument(to.isBuffer(e)),Ur.ripemd160(Ur.sha256(e))};Ur.sha512=function(e){return aa.checkArgument(to.isBuffer(e)),Kh.createHash("sha512").update(e).digest()};Ur.sha512.blocksize=1024;Ur.hmac=function(e,t,r){aa.checkArgument(to.isBuffer(t)),aa.checkArgument(to.isBuffer(r)),aa.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=Buffer.alloc(i);o.fill(92);var u=Buffer.alloc(i);u.fill(54);for(var m=Buffer.alloc(i),_=Buffer.alloc(i),w=0;w<i;w++)m[w]=o[w]^r[w],_[w]=u[w]^r[w];return e(Buffer.concat([m,e(Buffer.concat([_,t]))]))};Ur.sha256hmac=function(e,t){return Ur.hmac(Ur.sha256,e,t)};Ur.sha512hmac=function(e,t){return Ur.hmac(Ur.sha512,e,t)}});var io=X((TZ,LE)=>{"use strict";var cC=Yt(),Gh=Rr(),ro=[],yi={};function CE(){}CE.prototype.toString=function(){return this.name};function ec(e,t){if(~ro.indexOf(e))return e;if(t){Array.isArray(t)||(t=[t]);for(let r in ro)if(t.some(i=>ro[r][i]===e))return ro[r];return}return yi[e]&&yi[e].length>=1?yi[e][0]:yi[e]}function yg(e){return this.name==e||this.alias==e}function al(e){var t=new CE;Gh.defineImmutable(t,{name:e.name,alias:e.alias,is:e.is,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,bech32prefix:e.bech32prefix,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&Gh.defineImmutable(t,{networkMagic:cC.integerAsBuffer(e.networkMagic)}),e.port&&Gh.defineImmutable(t,{port:e.port}),e.dnsSeeds&&Gh.defineImmutable(t,{dnsSeeds:e.dnsSeeds});for(let r of Object.values(t))r!=null&&typeof r!="object"&&(yi[r]||(yi[r]=[]),yi[r].push(t));ro.push(t);for(let r of e.variants||[])al({...e,variants:void 0,...r});return t}function uC(e){typeof e!="object"&&(e=ec(e));for(var t=0;t<ro.length;t++)ro[t]===e&&ro.splice(t,1);for(var r in yi)if(yi[r].length){let i=yi[r].indexOf(e);i>=0&&yi[r].splice(i,1),yi[r].length===0&&delete yi[r]}else yi[r]===e&&delete yi[r]}al({name:"livenet",alias:"mainnet",is:yg,pubkeyhash:0,privatekey:128,scripthash:5,bech32prefix:"bc",xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var _g=ec("livenet");al({name:"testnet",alias:"testnet",is:yg,pubkeyhash:111,privatekey:239,scripthash:196,bech32prefix:"tb",xpubkey:70617039,xprivkey:70615956,variants:[{name:"testnet3",networkMagic:185665799,port:18333,dnsSeeds:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]},{name:"signet",networkMagic:168021824,port:38333,dnsSeeds:["178.128.221.177","103.16.128.63","153.126.143.201","192.241.163.142"]},{name:"testnet4",networkMagic:471220008,port:48333,dnsSeeds:["18.189.156.102","18.201.207.55","51.158.248.8","57.128.176.163","82.67.102.15","88.99.248.50","95.217.73.162","103.99.171.212","103.165.192.210"]}]});var wg=ec("testnet"),fC=ec("testnet3"),lC=ec("signet");al({name:"regtest",alias:"dev",is:yg,pubkeyhash:111,privatekey:239,scripthash:196,bech32prefix:"bcrt",xpubkey:70617039,xprivkey:70615956,networkMagic:4206867930,port:18444,dnsSeeds:[]});var pC=ec("regtest");function hC(){wg.regtestEnabled=!0}function dC(){wg.regtestEnabled=!1}LE.exports={add:al,remove:uC,defaultNetwork:_g,livenet:_g,mainnet:_g,testnet:wg,testnet3:fC,signet:lC,regtest:pC,get:ec,enableRegtest:hC,disableRegtest:dC}});var ri=X((RZ,DE)=>{"use strict";var Sg=Yt(),UE=require("assert"),Ar=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};Ar.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};Ar.prototype.toBuffer=function(){return this.concat()};Ar.prototype.concat=function(){return Buffer.concat(this.bufs,this.bufLen)};Ar.prototype.write=function(e){return UE(Sg.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};Ar.prototype.writeReverse=function(e){return UE(Sg.isBuffer(e)),this.bufs.push(Sg.reverse(e)),this.bufLen+=e.length,this};Ar.prototype.writeUInt8=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};Ar.prototype.writeUInt16BE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};Ar.prototype.writeUInt16LE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};Ar.prototype.writeUInt32BE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};Ar.prototype.writeInt32LE=function(e){var t=Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};Ar.prototype.writeUInt32LE=function(e){e<0&&(e=e>>>0);var t=Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};Ar.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};Ar.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};Ar.prototype.writeVarintNum=function(e){var t=Ar.varintBufNum(e);return this.write(t),this};Ar.prototype.writeVarintBN=function(e){var t=Ar.varintBufBN(e);return this.write(t),this};Ar.varintBufNum=function(e){var t=void 0;return e<253?(t=Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};Ar.varintBufBN=function(e){var t=void 0,r=e.toNumber();if(r<253)t=Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new Ar;i.writeUInt8(255),i.writeUInt64LEBN(e);var t=i.concat()}return t};DE.exports=Ar});var no=X((AZ,qE)=>{qE.exports=require("util").inherits});var ca=X((OZ,zE)=>{var FE=Dr(),HE=ri(),mC=no();function oa(e,t,r="hex"){if(!(this instanceof oa))return new oa(e,t,r);HE.apply(this),e=Buffer.from(e);let i=FE.sha256(e);return this.write(i),this.write(i),t&&(t=Buffer.isBuffer(t)?t:Buffer.from(t,r),this.write(t)),this}mC(oa,HE);oa.prototype.finalize=function(){return Buffer.from(FE.sha256(this.toBuffer()))};Object.defineProperties(oa,{TAPSIGHASH:{get:()=>new oa("TapSighash")},TAPLEAF:{get:()=>new oa("TapLeaf")},TAPBRANCH:{get:()=>new oa("TapBranch")}});zE.exports=oa});var WE=X((Eg,jE)=>{var $h=require("buffer"),gs=$h.Buffer;function VE(e,t){for(var r in e)t[r]=e[r]}gs.from&&gs.alloc&&gs.allocUnsafe&&gs.allocUnsafeSlow?jE.exports=$h:(VE($h,Eg),Eg.Buffer=tc);function tc(e,t,r){return gs(e,t,r)}tc.prototype=Object.create(gs.prototype);VE(gs,tc);tc.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return gs(e,t,r)};tc.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=gs(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};tc.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return gs(e)};tc.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $h.SlowBuffer(e)}});var GE=X((kZ,KE)=>{"use strict";var Yh=WE().Buffer;function vC(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var n=e.charAt(i),o=n.charCodeAt(0);if(t[o]!==255)throw new TypeError(n+" is ambiguous");t[o]=i}var u=e.length,m=e.charAt(0),_=Math.log(u)/Math.log(256),w=Math.log(256)/Math.log(u);function I(C){if((Array.isArray(C)||C instanceof Uint8Array)&&(C=Yh.from(C)),!Yh.isBuffer(C))throw new TypeError("Expected Buffer");if(C.length===0)return"";for(var B=0,U=0,Z=0,$=C.length;Z!==$&&C[Z]===0;)Z++,B++;for(var H=($-Z)*w+1>>>0,ee=new Uint8Array(H);Z!==$;){for(var ce=C[Z],ge=0,Se=H-1;(ce!==0||ge<U)&&Se!==-1;Se--,ge++)ce+=256*ee[Se]>>>0,ee[Se]=ce%u>>>0,ce=ce/u>>>0;if(ce!==0)throw new Error("Non-zero carry");U=ge,Z++}for(var me=H-U;me!==H&&ee[me]===0;)me++;for(var O=m.repeat(B);me<H;++me)O+=e.charAt(ee[me]);return O}function T(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return Yh.alloc(0);for(var B=0,U=0,Z=0;C[B]===m;)U++,B++;for(var $=(C.length-B)*_+1>>>0,H=new Uint8Array($);C[B];){var ee=t[C.charCodeAt(B)];if(ee===255)return;for(var ce=0,ge=$-1;(ee!==0||ce<Z)&&ge!==-1;ge--,ce++)ee+=u*H[ge]>>>0,H[ge]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");Z=ce,B++}for(var Se=$-Z;Se!==$&&H[Se]===0;)Se++;var me=Yh.allocUnsafe(U+($-Se));me.fill(0,0,U);for(var O=U;Se!==$;)me[O++]=H[Se++];return me}function N(C){var B=T(C);if(B)return B;throw new Error("Non-base"+u+" character")}return{encode:I,decodeUnsafe:T,decode:N}}KE.exports=vC});var Ig=X((PZ,$E)=>{var gC=GE(),xC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";$E.exports=gC(xC)});var ol=X((NZ,XE)=>{"use strict";var Tg=Et(),YE=Ig(),ZE=require("buffer"),bC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),Hn=function e(t){if(!(this instanceof e))return new e(t);if(Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}else t&&this.set(t)};Hn.validCharacters=function(t){return ZE.Buffer.isBuffer(t)&&(t=t.toString()),Tg.every(Tg.map(t,function(r){return Tg.includes(bC,r)}))};Hn.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Hn.encode=function(e){if(!ZE.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return YE.encode(e)};Hn.decode=function(e){if(typeof e!="string")throw new Error("Input should be a string");return Buffer.from(YE.decode(e))};Hn.prototype.fromBuffer=function(e){return this.buf=e,this};Hn.prototype.fromString=function(e){var t=Hn.decode(e);return this.buf=t,this};Hn.prototype.toBuffer=function(){return this.buf};Hn.prototype.toString=function(){return Hn.encode(this.buf)};XE.exports=Hn});var du=X((MZ,e3)=>{"use strict";var JE=Et(),Zh=ol(),BZ=require("buffer"),QE=Dr().sha256sha256,Ci=function e(t){if(!(this instanceof e))return new e(t);if(Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}else t&&this.set(t)};Ci.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Ci.validChecksum=function(t,r){return JE.isString(t)&&(t=Buffer.from(Zh.decode(t))),JE.isString(r)&&(r=Buffer.from(Zh.decode(r))),r||(r=t.slice(-4),t=t.slice(0,-4)),Ci.checksum(t).toString("hex")===r.toString("hex")};Ci.decode=function(e){if(typeof e!="string")throw new Error("Input must be a string");var t=Buffer.from(Zh.decode(e));if(t.length<4)throw new Error("Input string too short");var r=t.slice(0,-4),i=t.slice(-4),n=QE(r),o=n.slice(0,4);if(i.toString("hex")!==o.toString("hex"))throw new Error("Checksum mismatch");return r};Ci.checksum=function(e){return QE(e).slice(0,4)};Ci.encode=function(e){if(!Buffer.isBuffer(e))throw new Error("Input must be a buffer");var t=Buffer.alloc(e.length+4),r=Ci.checksum(e);return e.copy(t),r.copy(t,e.length),Zh.encode(t)};Ci.prototype.fromBuffer=function(e){return this.buf=e,this};Ci.prototype.fromString=function(e){var t=Ci.decode(e);return this.buf=t,this};Ci.prototype.toBuffer=function(){return this.buf};Ci.prototype.toString=function(){return Ci.encode(this.buf)};e3.exports=Ci});var n3=X(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.bech32m=vu.bech32=void 0;var Xh="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r3={};for(let e=0;e<Xh.length;e++){let t=Xh.charAt(e);r3[t]=e}function mu(e){let t=e>>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function t3(e){let t=1;for(let r=0;r<e.length;++r){let i=e.charCodeAt(r);if(i<33||i>126)return"Invalid prefix ("+e+")";t=mu(t)^i>>5}t=mu(t);for(let r=0;r<e.length;++r){let i=e.charCodeAt(r);t=mu(t)^i&31}return t}function Rg(e,t,r,i){let n=0,o=0,u=(1<<r)-1,m=[];for(let _=0;_<e.length;++_)for(n=n<<t|e[_],o+=t;o>=r;)o-=r,m.push(n>>o&u);if(i)o>0&&m.push(n<<r-o&u);else{if(o>=t)return"Excess padding";if(n<<r-o&u)return"Non-zero padding"}return m}function _C(e){return Rg(e,8,5,!0)}function yC(e){let t=Rg(e,5,8,!1);if(Array.isArray(t))return t}function wC(e){let t=Rg(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function i3(e){let t;e==="bech32"?t=1:t=734539939;function r(u,m,_){if(_=_||90,u.length+7+m.length>_)throw new TypeError("Exceeds length limit");u=u.toLowerCase();let w=t3(u);if(typeof w=="string")throw new Error(w);let I=u+"1";for(let T=0;T<m.length;++T){let N=m[T];if(N>>5)throw new Error("Non 5-bit word");w=mu(w)^N,I+=Xh.charAt(N)}for(let T=0;T<6;++T)w=mu(w);w^=t;for(let T=0;T<6;++T){let N=w>>(5-T)*5&31;I+=Xh.charAt(N)}return I}function i(u,m){if(m=m||90,u.length<8)return u+" too short";if(u.length>m)return"Exceeds length limit";let _=u.toLowerCase(),w=u.toUpperCase();if(u!==_&&u!==w)return"Mixed-case string "+u;u=_;let I=u.lastIndexOf("1");if(I===-1)return"No separator character for "+u;if(I===0)return"Missing prefix for "+u;let T=u.slice(0,I),N=u.slice(I+1);if(N.length<6)return"Data too short";let C=t3(T);if(typeof C=="string")return C;let B=[];for(let U=0;U<N.length;++U){let Z=N.charAt(U),$=r3[Z];if($===void 0)return"Unknown character "+Z;C=mu(C)^$,!(U+6>=N.length)&&B.push($)}return C!==t?"Invalid checksum for "+u:{prefix:T,words:B}}function n(u,m){let _=i(u,m);if(typeof _=="object")return _}function o(u,m){let _=i(u,m);if(typeof _=="object")return _;throw new Error(_)}return{decodeUnsafe:n,decode:o,encode:r,toWords:_C,fromWordsUnsafe:yC,fromWords:wC}}vu.bech32=i3("bech32");vu.bech32m=i3("bech32m")});var a3=X((LZ,s3)=>{"use strict";var gu=n3(),SC=function(e){if(typeof e!="string")throw new Error("Input should be a string");var t;let r=gu.bech32.fromWords,i=so.BECH32;try{t=gu.bech32.decode(e)}catch(o){if(o.message.indexOf("Invalid checksum")>-1)t=gu.bech32m.decode(e),i=so.BECH32M,r=gu.bech32m.fromWords;else throw o}let n=t.words[0];if(n>=1&&i!==so.BECH32M)throw new Error("Version 1+ witness address must use Bech32m checksum");return{prefix:t.prefix,data:Buffer.from(r(t.words.slice(1))),version:n}},EC=function(e,t,r,i){if(typeof e!="string")throw new Error("Prefix should be a string");if(typeof t!="number")throw new Error("version should be a number");if(i&&typeof i=="string"&&(i=so[i.toUpperCase()]||-1),i&&!(i==so.BECH32||i==so.BECH32M))throw new Error("Invalid encoding specified");let n=i==so.BECH32M?gu.bech32m:gu.bech32,o=n.toWords(r);return o.unshift(t),n.encode(e,o)},so={BECH32:1,BECH32M:2};s3.exports={decode:SC,encode:EC,encodings:so}});var xs=X((UZ,c3)=>{"use strict";var cl=Et(),o3=xt(),IC=Yt(),xu=Xr(),Or=function e(t){if(!(this instanceof e))return new e(t);if(!cl.isUndefined(t))if(Buffer.isBuffer(t))this.set({buf:t});else if(cl.isString(t))this.set({buf:Buffer.from(t,"hex")});else if(cl.isObject(t)){var r=t;this.set(r)}else throw new TypeError("Unrecognized argument for BufferReader")};Or.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this};Or.prototype.eof=function(){return this.buf?this.pos>=this.buf.length:!0};Or.prototype.finished=Or.prototype.eof;Or.prototype.read=function(e){o3.checkArgument(!cl.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t};Or.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e};Or.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e};Or.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e};Or.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e};Or.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e};Or.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e};Or.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e};Or.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=xu.fromBuffer(e);return this.pos=this.pos+8,t};Or.prototype.readUInt64LEBN=function(){var e=this.buf.readUInt32LE(this.pos),t=this.buf.readUInt32LE(this.pos+4),r=t*4294967296+e,i;if(r<=9007199254740991)i=new xu(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);i=new xu(n,10,"le")}return this.pos=this.pos+8,i};Or.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN(),r=t.toNumber();if(r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarintBN");default:return e}};Or.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return o3.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t};Or.prototype.readVarintBuf=function(){var e=this.buf.readUInt8(this.pos);switch(e){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}};Or.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new xu(this.readUInt16LE());case 254:return new xu(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new xu(e)}};Or.prototype.reverse=function(){for(var e=Buffer.alloc(this.buf.length),t=0;t<e.length;t++)e[t]=this.buf[this.buf.length-1-t];return this.buf=e,this};Or.prototype.readReverse=function(e){cl.isUndefined(e)&&(e=this.buf.length);var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,IC.reverse(t)};c3.exports=Or});var Jh=X((DZ,u3)=>{"use strict";var bu=Et(),_u=xt(),TC=Yt(),RC=Rr();function ut(e){if(!(this instanceof ut))return new ut(e);var t;if(bu.isNumber(e))t=e;else if(bu.isString(e))t=ut.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return RC.defineImmutable(this,{num:t}),this}ut.fromBuffer=function(e){return _u.checkArgument(TC.isBuffer(e)),new ut(+("0x"+e.toString("hex")))};ut.fromNumber=function(e){return _u.checkArgument(bu.isNumber(e)),new ut(e)};ut.fromString=function(e){_u.checkArgument(bu.isString(e));var t=ut.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new ut(t)};ut.prototype.toHex=function(){return this.num.toString(16)};ut.prototype.toBuffer=function(){return Buffer.from(this.toHex(),"hex")};ut.prototype.toNumber=function(){return this.num};ut.prototype.toString=function(){var e=ut.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};ut.smallInt=function(e){return _u.checkArgument(bu.isNumber(e),"Invalid Argument: n should be number"),_u.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?ut("OP_0"):new ut(ut.map.OP_1+e-1)};ut.decodeOpN=function(e){return e===ut.OP_0?0:(_u.checkArgument(e>=ut.OP_1&&e<=ut.OP_16,new Error("Invalid opcode: "+JSON.stringify(e))),e-(ut.OP_1-1))};ut.isOpSuccess=function(e){return typeof e=="string"&&!parseInt(e)&&(e=ut[e]),e==80||e==98||e>=126&&e<=129||e>=131&&e<=134||e>=137&&e<=138||e>=141&&e<=142||e>=149&&e<=153||e>=187&&e<=254};ut.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKSIGADD:186,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};ut.reverseMap=[];for(Ag in ut.map)ut.reverseMap[ut.map[Ag]]=Ag;var Ag;bu.extend(ut,ut.map);ut.isSmallIntOp=function(e){return e instanceof ut&&(e=e.toNumber()),e===ut.map.OP_0||e>=ut.map.OP_1&&e<=ut.map.OP_16};ut.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};u3.exports=ut});var Pg=X((qZ,p3)=>{"use strict";var Kr=Vn(),AC=xs(),OC=ri(),Qh=Dr(),le=Jh(),zn=jn(),rc=di(),f3=io(),Xt=xt(),Og=Et(),kg=Yi(),ai=Yt(),kC=Rr(),l3=ca(),K=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],ai.isBuffer(t))return e.fromBuffer(t);if(t instanceof Kr)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(typeof t=="string")return e.fromString(t);Og.isObject(t)&&Array.isArray(t.chunks)&&this.set(t)};K.prototype.set=function(e){return Xt.checkArgument(Og.isObject(e)),Xt.checkArgument(Array.isArray(e.chunks)),this.chunks=e.chunks,this};K.fromBuffer=function(e){var t=new K;t.chunks=[];for(var r=new AC(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<le.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===le.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===le.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===le.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):le.isOpSuccess(i)?(o=r.readAll(),n=o.length,t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(u){throw u instanceof RangeError?new kg.Script.InvalidBuffer(e.toString("hex")):u}return t};K.prototype.toBuffer=function(){for(var e=new OC,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<le.OP_PUSHDATA1?e.write(r.buf):i===le.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===le.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):(i===le.OP_PUSHDATA4&&e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};K.fromASM=function(e){var t=new K;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=le(n),u=o.toNumber();if(u==null){var m=Buffer.from(r[i],"hex");t.chunks.push({buf:m,len:m.length,opcodenum:m.length}),i=i+1}else u===le.OP_PUSHDATA1||u===le.OP_PUSHDATA2||u===le.OP_PUSHDATA4?(t.chunks.push({buf:Buffer.from(r[i+2],"hex"),len:parseInt(r[i+1]),opcodenum:u}),i=i+3):(t.chunks.push({opcodenum:u}),i=i+1)}return t};K.fromHex=function(e){return new K(Buffer.from(e,"hex"))};K.fromString=function(e){if(kC.isHexa(e)||e.length===0)return new K(Buffer.from(e,"hex"));var t=new K;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=le(n),u=o.toNumber();if(u==null)if(u=parseInt(n),u>0&&u<le.OP_PUSHDATA1)t.chunks.push({buf:Buffer.from(r[i+1].slice(2),"hex"),len:u,opcodenum:u}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(u===le.OP_PUSHDATA1||u===le.OP_PUSHDATA2||u===le.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:u}),i=i+3}else t.chunks.push({opcodenum:u}),i=i+1}return t};K.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)(!i&&r===le.OP_PUSHDATA1||r===le.OP_PUSHDATA2||r===le.OP_PUSHDATA4)&&(n=n+" "+le(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof le.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+le(r).toString():n=n+" "+le(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};K.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};K.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};K.prototype.toHex=function(){return this.toBuffer().toString("hex")};K.prototype.inspect=function(){return"<Script: "+this.toString()+">"};K.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===le.OP_DUP&&this.chunks[1].opcodenum===le.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===le.OP_EQUALVERIFY&&this.chunks[4].opcodenum===le.OP_CHECKSIG)};K.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};K.prototype.getPublicKey=function(){return Xt.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};K.prototype.getPublicKeyHash=function(){if(this.isPublicKeyHashOut())return this.chunks[2].buf;if(this.isWitnessPublicKeyHashOut())return this.chunks[1].buf;if(this.isTaproot())return this.chunks[1].buf;throw new Error("Can't retrieve PublicKeyHash from a non-PKH output")};K.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===le.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return zn.isValid(e)}return!1};K.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};K.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===le.OP_HASH160&&e[1]===20&&e[e.length-1]===le.OP_EQUAL};K.prototype.isWitnessScriptHashOut=function(){var e=this.toBuffer();return e.length===34&&e[0]===le.OP_0&&e[1]===32};K.prototype.isWitnessPublicKeyHashOut=function(){var e=this.toBuffer();return e.length===22&&e[0]===le.OP_0&&e[1]===20};K.prototype.isTaproot=function(){var e=this.toBuffer();return e.length===34&&e[0]===le.OP_1&&e[1]===32};K.prototype.isWitnessProgram=function(e){e||(e={});var t=this.toBuffer();return t.length<4||t.length>42||t[0]!==le.OP_0&&!(t[0]>=le.OP_1&&t[0]<=le.OP_16)?!1:t.length===t[1]+2?(e.version=le.decodeOpN(t[0]),e.program=t.slice(2,t.length),!0):!1};K.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=K.fromBuffer(t)}catch(n){if(n instanceof kg.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==K.types.UNKNOWN};K.prototype.isMultisigOut=function(){return this.chunks.length>3&&le.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&ai.isBuffer(e.buf)})&&le.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===le.OP_CHECKMULTISIG};K.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&ai.isBuffer(e.buf)&&rc.isTxDER(e.buf)})};K.prototype.isDataOut=function(){return this.chunks.length>=1&&this.chunks[0].opcodenum===le.OP_RETURN&&(this.chunks.length===1||this.chunks.length===2&&this.chunks[1].buf&&this.chunks[1].buf.length<=K.OP_RETURN_STANDARD_SIZE&&this.chunks[1].length===this.chunks.len)};K.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut()||this.isWitnessScriptHashOut()||this.isWitnessPublicKeyHashOut()||this.isTaproot())return this.chunks[1]==null?Buffer.alloc(0):Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};K.prototype.isPushOnly=function(){return this.chunks.every(function(e){return e.opcodenum<=le.OP_16})};K.types={};K.types.UNKNOWN="Unknown";K.types.PUBKEY_OUT="Pay to public key";K.types.PUBKEY_IN="Spend from public key";K.types.PUBKEYHASH_OUT="Pay to public key hash";K.types.PUBKEYHASH_IN="Spend from public key hash";K.types.SCRIPTHASH_OUT="Pay to script hash";K.types.SCRIPTHASH_IN="Spend from script hash";K.types.MULTISIG_OUT="Pay to multisig";K.types.MULTISIG_IN="Spend from multisig";K.types.DATA_OUT="Data push";K.OP_RETURN_STANDARD_SIZE=80;K.ANNEX_TAG=80;K.VALIDATION_WEIGHT_PER_SIGOP_PASSED=50;K.VALIDATION_WEIGHT_OFFSET=50;K.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!=K.types.UNKNOWN?e:this.classifyInput()};K.outputIdentifiers={};K.outputIdentifiers.PUBKEY_OUT=K.prototype.isPublicKeyOut;K.outputIdentifiers.PUBKEYHASH_OUT=K.prototype.isPublicKeyHashOut;K.outputIdentifiers.MULTISIG_OUT=K.prototype.isMultisigOut;K.outputIdentifiers.SCRIPTHASH_OUT=K.prototype.isScriptHashOut;K.outputIdentifiers.DATA_OUT=K.prototype.isDataOut;K.prototype.classifyOutput=function(){for(var e in K.outputIdentifiers)if(K.outputIdentifiers[e].bind(this)())return K.types[e];return K.types.UNKNOWN};K.inputIdentifiers={};K.inputIdentifiers.PUBKEY_IN=K.prototype.isPublicKeyIn;K.inputIdentifiers.PUBKEYHASH_IN=K.prototype.isPublicKeyHashIn;K.inputIdentifiers.MULTISIG_IN=K.prototype.isMultisigIn;K.inputIdentifiers.SCRIPTHASH_IN=K.prototype.isScriptHashIn;K.prototype.classifyInput=function(){for(var e in K.inputIdentifiers)if(K.inputIdentifiers[e].bind(this)())return K.types[e];return K.types.UNKNOWN};K.prototype.isStandard=function(){return this.classify()!==K.types.UNKNOWN};K.prototype.prepend=function(e){return this._addByType(e,!0),this};K.prototype.equals=function(e){if(Xt.checkState(e instanceof K,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(ai.isBuffer(this.chunks[t].buf)&&!ai.isBuffer(e.chunks[t].buf)||ai.isBuffer(this.chunks[t].buf)&&!ai.equals(this.chunks[t].buf,e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};K.prototype.add=function(e){return this._addByType(e,!1),this};K.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof le)this._addOpcode(e,t);else if(ai.isBuffer(e))this._addBuffer(e,t);else if(e instanceof K)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};K.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};K.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof le?r=e.toNumber():r=le(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};K.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<le.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=le.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=le.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=le.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};K.prototype.hasCodeseparators=function(){for(var e=0;e<this.chunks.length;e++)if(this.chunks[e].opcodenum===le.OP_CODESEPARATOR)return!0;return!1};K.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==le.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};K.buildMultisigOut=function(e,t,r){Xt.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new K;i.add(le.smallInt(t)),e=e.map(zn);var n=e;r.noSorting||(n=Og.sortBy(e,function(m){return m.toString("hex")}));for(var o=0;o<n.length;o++){var u=n[o];i.add(u.toBuffer())}return i.add(le.smallInt(e.length)),i.add(le.OP_CHECKMULTISIG),i};K.buildWitnessMultisigOutFromScript=function(e){if(e instanceof K){var t=new K;return t.add(le.OP_0),t.add(Qh.sha256(e.toBuffer())),t}else throw new TypeError("First argument is expected to be a p2sh script")};K.buildMultisigIn=function(e,t,r,i){Xt.checkArgument(Array.isArray(e)),Xt.checkArgument(!isNaN(t)),Xt.checkArgument(Array.isArray(r)),i=i||{};var n=new K;n.add(le.OP_0);for(let o of r)Xt.checkArgument(ai.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o);return n};K.buildP2SHMultisigIn=function(e,t,r,i){Xt.checkArgument(Array.isArray(e)),Xt.checkArgument(!isNaN(t)),Xt.checkArgument(Array.isArray(r)),i=i||{};var n=new K;n.add(le.OP_0);for(let o of r)Xt.checkArgument(ai.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o);return n.add((i.cachedMultisig||K.buildMultisigOut(e,t,i)).toBuffer()),n};K.buildPublicKeyHashOut=function(e){Xt.checkArgument(e!=null),Xt.checkArgument(e instanceof zn||e instanceof Kr||typeof e=="string"),e instanceof zn?e=e.toAddress():typeof e=="string"&&(e=new Kr(e));var t=new K;return t.add(le.OP_DUP).add(le.OP_HASH160).add(e.hashBuffer).add(le.OP_EQUALVERIFY).add(le.OP_CHECKSIG),t._network=e.network,t};K.buildWitnessV0Out=function(e){Xt.checkArgument(e!=null),Xt.checkArgument(e instanceof zn||e instanceof Kr||typeof e=="string"),e instanceof zn?e=e.toAddress(null,Kr.PayToWitnessPublicKeyHash):typeof e=="string"&&(e=new Kr(e));var t=new K;return t.add(le.OP_0).add(e.hashBuffer),t._network=e.network,t};K.buildWitnessV1Out=function(e,t){if(Xt.checkArgument(e instanceof zn||e instanceof Kr||typeof e=="string"),Xt.checkArgument(!t||Array.isArray(t)||!!t.script),typeof e=="string")try{e=zn.fromTaproot(e)}catch{e=Kr.fromString(e)}function r(u){if(Array.isArray(u)){let[m,_]=r(u[0]),[w,I]=r(u[1]),T=[[[m[0],m[1]],I],[[w[0],w[1]],_]],N=l3.TAPBRANCH;return _.compare(I)===1?(N.write(I),N.write(_)):(N.write(_),N.write(I)),[T,N.finalize()]}else{let{leafVersion:m,script:_}=u,w=new K(_).toBuffer(),I=l3.TAPLEAF;I.writeUInt8(m),I.writeUInt8(w.length),I.write(w);let T=I.finalize();return[[Buffer.from([m]),w],T]}}let i=null;if(t){let[u,m]=r(t);i=m}let n;e instanceof zn?n=e.createTapTweak(i).tweakedPubKey:n=e.hashBuffer;let o=new K;return o.add(le.OP_1),o.add(n),o};K.buildPublicKeyOut=function(e){Xt.checkArgument(e instanceof zn);var t=new K;return t.add(e.toBuffer()).add(le.OP_CHECKSIG),t};K.buildDataOut=function(e,t){Xt.checkArgument(e==null||typeof e=="string"||ai.isBuffer(e)),typeof e=="string"&&(e=Buffer.from(e,t));var r=new K;return r.add(le.OP_RETURN),e!=null&&r.add(e),r};K.buildScriptHashOut=function(e){Xt.checkArgument(e instanceof K||e instanceof Kr&&e.isPayToScriptHash());var t=new K;return t.add(le.OP_HASH160).add(e instanceof Kr?e.hashBuffer:Qh.sha256ripemd160(e.toBuffer())).add(le.OP_EQUAL),t._network=e._network||e.network,t};K.buildPublicKeyIn=function(e,t){Xt.checkArgument(e instanceof rc||ai.isBuffer(e)),Xt.checkArgument(t==null||!isNaN(t)),e instanceof rc&&(e=e.toBuffer());var r=new K;return r.add(ai.concat([e,ai.integerAsSingleByteBuffer(t||rc.SIGHASH_ALL)])),r};K.buildPublicKeyHashIn=function(e,t,r){Xt.checkArgument(t instanceof rc||ai.isBuffer(t)),Xt.checkArgument(r==null||!isNaN(r)),t instanceof rc&&(t=t.toBuffer());var i=new K().add(ai.concat([t,ai.integerAsSingleByteBuffer(r||rc.SIGHASH_ALL)])).add(new zn(e).toBuffer());return i};K.empty=function(){return new K};K.prototype.toScriptHashOut=function(){return K.buildScriptHashOut(this)};K.fromAddress=function(e){if(e=Kr(e),e.isPayToScriptHash())return K.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return K.buildPublicKeyHashOut(e);if(e.isPayToWitnessPublicKeyHash())return K.buildWitnessV0Out(e);if(e.isPayToWitnessScriptHash())return K.buildWitnessV0Out(e);if(e.isPayToTaproot())return K.buildWitnessV1Out(e);throw new kg.Script.UnrecognizedAddress(e)};K.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};K.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToPublicKeyHash;else if(this.isWitnessScriptHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToWitnessScriptHash;else if(this.isWitnessPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Kr.PayToWitnessPublicKeyHash;else if(this.isTaproot())e.hashBuffer=this.getData(),e.type=Kr.PayToTaproot;else return!1;return e};K.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=Qh.sha256ripemd160(this.chunks[1].buf),e.type=Kr.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=Qh.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Kr.PayToScriptHash;else return!1;return e};K.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=f3.get(e)||this._network||f3.defaultNetwork,new Kr(t)):!1};K.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=K({chunks:[this.chunks[i]]}),o=n.toBuffer(),u=o.toString("hex");r===u&&this.chunks.splice(i,1)}return this};K.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===le.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===le.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===le.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===le.OP_PUSHDATA1:r.length<=65535?i===le.OP_PUSHDATA2:!0:!0};K.prototype.getSignatureOperationsCount=function(e){e=e??!0;var t=0,r=le.OP_INVALIDOPCODE;for(let n of this.chunks){var i=n.opcodenum;i==le.OP_CHECKSIG||i==le.OP_CHECKSIGVERIFY?t++:(i==le.OP_CHECKMULTISIG||i==le.OP_CHECKMULTISIGVERIFY)&&(e&&r>=le.OP_1&&r<=le.OP_16?t+=le.decodeOpN(r):t+=20),r=i}return t};p3.exports=K});var yu=X((HZ,g3)=>{"use strict";var ic=di(),FZ=Li(),h3=xs(),d3=ri(),ul=Dr(),v3=fl(),m3=xt(),Ng=Et(),Bg=function(t,r,i,n,o){var u=Buffer.alloc(32),m=Buffer.alloc(32),_=Buffer.alloc(32);if(!(r&ic.SIGHASH_ANYONECANPAY)){for(var w=[],I=0;I<t.inputs.length;I++){var T=t.inputs[I],N=new h3(T.prevTxId).readReverse();w.push(N);var C=Buffer.alloc(4);C.writeUInt32LE(T.outputIndex,0),w.push(C)}u=ul.sha256sha256(Buffer.concat(w))}if(!(r&ic.SIGHASH_ANYONECANPAY)&&(r&31)!==ic.SIGHASH_SINGLE&&(r&31)!==ic.SIGHASH_NONE){for(var B=[],U=0;U<t.inputs.length;U++){var Z=Buffer.alloc(4);Z.writeUInt32LE(t.inputs[U].sequenceNumber,0),B.push(Z)}m=ul.sha256sha256(Buffer.concat(B))}var $=new d3;if((r&31)!==ic.SIGHASH_SINGLE&&(r&31)!==ic.SIGHASH_NONE){for(var H=0;H<t.outputs.length;H++)t.outputs[H].toBufferWriter($);_=ul.sha256sha256($.toBuffer())}else(r&31)===ic.SIGHASH_SINGLE&&i<t.outputs.length&&(t.outputs[i].toBufferWriter($),_=ul.sha256sha256($.toBuffer()));var ee=new d3;ee.writeUInt32LE(t.version),ee.write(u),ee.write(m);var ce=new h3(t.inputs[i].prevTxId).readReverse();return ee.write(ce),ee.writeUInt32LE(t.inputs[i].outputIndex),ee.write(n),ee.write(o),ee.writeUInt32LE(t.inputs[i].sequenceNumber),ee.write(_),ee.writeUInt32LE(t.nLockTime),ee.writeInt32LE(r),ul.sha256sha256(ee.toBuffer())};function PC(e,t,r,i,n,o){let u=Bg(e,r,i,n,o);return v3.sign(u,t).set({nhashtype:r})}function NC(e,t,r,i,n,o){m3.checkArgument(!Ng.isUndefined(e),"Transaction Undefined"),m3.checkArgument(!Ng.isUndefined(t)&&!Ng.isUndefined(t.nhashtype),"Signature Undefined");let u=Bg(e,t.nhashtype,i,n,o);return v3.verify(u,t,r)}g3.exports={sighash:Bg,sign:PC,verify:NC}});var Mg=X((zZ,x3)=>{var BC=require("crypto"),ua=xt(),td=Rr(),nc=Xr(),sc=eo(),ed=ca(),ll=function e(){return this instanceof e?this:new e};ll.prototype.set=function(){};ll.sign=function(e,t,r){if(e=Buffer.isBuffer(e)?e:e.toBuffer(),e.length!==32)throw new Error("Private key should be 32 bytes for schnorr signatures");typeof t=="string"&&(ua.checkArgument(td.isHexaString(t),"Schnorr message string is not hex"),t=Buffer.from(t,"hex")),ua.checkArgument(ua.isType(t,"Buffer"),"Schnorr message must be a hex string or buffer"),r||(r=BC.randomBytes(32)),typeof r=="string"&&(ua.checkArgument(td.isHexaString(r),"Schnorr aux string is not hex"),r=Buffer.from(r,"hex")),ua.checkArgument(ua.isType(r,"Buffer"),"Schnorr aux must be a hex string or buffer");let i=sc.getG(),n=sc.getN(),o=new nc(e);if(o.eqn(0)||o.gte(n))throw new Error("Invalid private key for schnorr signing");let u=i.mul(o),m=Buffer.from(u.encodeCompressed().slice(1)),_=u.y.isEven()?o:n.sub(o),w=_.xor(new nc(new ed("BIP0340/aux",r).finalize())),I=new ed("BIP0340/nonce",Buffer.concat([w.toBuffer(),m,t])).finalize(),T=new nc(I).mod(n);if(T.eqn(0))throw new Error("Error creating schnorr signature");let N=i.mul(T),C=Buffer.from(N.encodeCompressed().slice(1)),B=N.y.isEven()?T:n.sub(T),U=new nc(new ed("BIP0340/challenge",Buffer.concat([C,m,t])).finalize()).mod(n),Z=Buffer.concat([C,B.add(U.mul(_)).mod(n).toBuffer({size:32})]);if(!ll.verify(m,t,Z))throw new Error("Error creating schnorr signature. Verification failed");return Z};ll.verify=function(e,t,r){if(ua.isType(e,"PublicKey")&&(e=e.point.x.toBuffer()),e.length!==32)throw new Error("Public key should be 32 bytes for schnorr signatures");if(typeof t=="string"&&(ua.checkArgument(td.isHexaString(t),"Schnorr message string is not hex"),t=Buffer.from(t,"hex")),t.length!==32)throw new Error("Message should be a 32 byte buffer");if(typeof r=="string"&&(ua.checkArgument(td.isHexaString(r),"Schnorr signature string is not hex"),r=Buffer.from(r,"hex")),typeof r.toBuffer=="function"&&(r=r.toBuffer(),r.length===65&&(r=r.slice(0,64))),r.length!==64)throw new Error("Signature should be a 64 byte buffer. Got "+r.length+" bytes");try{let i=sc.getP(),n=sc.getN(),o=sc.fromX(!1,e).liftX(),u=new nc(r.slice(0,32)),m=new nc(r.slice(32,64));if(u.gte(i)||m.gte(n))return!1;let _=MC(u,o,t),I=sc.getG().mul(m).add(o.mul(_).neg());return!(I.inf||!I.y.isEven()||!I.x.eq(u))}catch{return!1}};var MC=function(e,t,r){let i=sc.getN(),n=new ed("BIP0340/challenge",Buffer.concat([e.toBuffer({size:32}),t.x.toBuffer({size:32}),r])).finalize();return new nc(n).mod(i)};x3.exports=ll});var rd=X((jZ,w3)=>{"use strict";var wi=di(),ac=ri(),wu=Dr(),b3=Mg(),oc=xt(),CC=ca(),VZ=ao();function _3(e,t,r,i,n){let o,u;switch(i){case wi.Version.TAPROOT:o=0;break;case wi.Version.TAPSCRIPT:o=1,u=0;break;default:return!1}oc.checkArgument(r<e.inputs.length,"inputNumber is greater than number of inputs");let m=CC.TAPSIGHASH;m.writeUInt8(0);let _=t==wi.SIGHASH_DEFAULT?wi.SIGHASH_ALL:t&wi.SIGHASH_OUTPUT_MASK,w=t&wi.SIGHASH_INPUT_MASK;if(!(t<=3||t>=129&&t<=131))return!1;if(m.writeUInt8(t),m.writeInt32LE(e.version),m.writeUInt32LE(e.nLockTime),w!==wi.SIGHASH_ANYONECANPAY){let T=new ac,N=new ac,C=new ac,B=new ac;for(let ee of e.inputs){T.writeReverse(ee.prevTxId),T.writeInt32LE(ee.outputIndex),N.writeUInt64LEBN(ee.output._satoshisBN);let ce=ee.output.script.toBuffer();C.writeUInt8(ce.length),C.write(ce),B.writeUInt32LE(ee.sequenceNumber)}let U=wu.sha256(T.toBuffer());m.write(U);let Z=wu.sha256(N.toBuffer());m.write(Z);let $=wu.sha256(C.toBuffer());m.write($);let H=wu.sha256(B.toBuffer());m.write(H)}if(_===wi.SIGHASH_ALL){let T=new ac;for(let C of e.outputs)T.write(C.toBufferWriter().toBuffer());let N=wu.sha256(T.toBuffer());m.write(N)}oc.checkArgument(n.annexInit,"missing or invalid annexInit");let I=(o<<1)+(n.annexPresent?1:0);if(m.writeUInt8(I),w===wi.SIGHASH_ANYONECANPAY){let T=new ac;T.writeReverse(e.inputs[r].prevTxId),T.writeInt32LE(e.inputs[r].outputIndex),m.write(T.toBuffer()),m.write(e.inputs[r].output.toBufferWriter().toBuffer()),m.writeUInt32LE(e.inputs[r].sequenceNumber)}else m.writeUInt32LE(r);if(n.annexPresent&&m.write(n.annexHash),_===wi.SIGHASH_SINGLE){if(r>=e.outputs.length)return!1;let T=new ac;T.writeUInt64LEBN(e.outputs[r]._satoshisBN);let N=e.outputs[r].script.toBuffer();T.writeVarintNum(N.length),T.write(N),m.write(wu.sha256(T.toBuffer()))}return i==wi.Version.TAPSCRIPT&&(oc.checkArgument(n.tapleafHashInit,"missing or invalid tapleafHashInit"),m.write(n.tapleafHash),m.writeUInt8(u),oc.checkArgument(n.codeseparatorPosInit,"missing or invalid codeseparatorPosInit"),m.writeUInt32LE(n.codeseparatorPos)),m.finalize()}function y3(e,t){let r={annexInit:!0,annexPresent:!1};if(e===wi.Version.TAPSCRIPT){if(r.codeseparatorPosInit=!0,r.codeseparatorPos=4294967295,!t)return!1;r.tapleafHashInit=!0,r.tapleafHash=t}return r}function LC(e,t,r,i,n,o){oc.checkArgument(n===wi.Version.TAPROOT||n===wi.Version.TAPSCRIPT,"Invalid sigversion");let u=y3(n,o),m=_3(e,r,i,n,u);if(!m)return!1;let _=b3.sign(t,m);return r!==wi.SIGHASH_DEFAULT?Buffer.concat([_,Buffer.from([r])]):_}function UC(e,t,r,i,n,o){oc.checkArgument(e!=null,"Transaction Undefined"),(!o||Buffer.isBuffer(o))&&(o=y3(i,o)),oc.checkArgument(o.annexInit,"invalid execdata");let u=_3(e,t.nhashtype,n,i,o);return u?b3.verify(r,u,t):!1}w3.exports={sign:LC,verify:UC}});var E3=X((WZ,S3)=>{S3.exports=function(e,t){if(typeof e.compare=="function")return e.compare(t);if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o&&e[n]===t[n];)++n;return n!==o&&(r=e[n],i=t[n]),r<i?-1:i<r?1:0}});var bs=X((KZ,A3)=>{"use strict";var id=Et(),Cg=Xr(),I3=Yt(),Lg=Rr(),T3=ri(),Ug=Li(),Su=xt(),DC=Yi(),R3=qg(),Dg=ca(),qC=9007199254740991;function kr(e){if(!(this instanceof kr))return new kr(e);if(id.isObject(e)){if(this.satoshis=e.satoshis,I3.isBuffer(e.script))this.setScriptFromBuffer(e.script);else{var t;id.isString(e.script)&&Lg.isHexa(e.script)?t=Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}e.type==="taproot"&&(this.branch=[],Object.defineProperty(this,"isValid",{configurable:!1,enumerable:!1,get:function(){this._isValid||this._branch.length},set:function(r){this._isValid=r}}),Object.defineProperty(this,"isComplete",{configurable:!1,enumerable:!1,get:function(){return this.isValid&&(this._branch.length===0||this._branch.length===1&&!!this._branch[0])}}))}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(kr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(kr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof Cg?(this._satoshisBN=e,this._satoshis=e.toNumber()):id.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=Cg.fromNumber(this._satoshis)):(Su.checkArgument(Lg.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=Cg.fromNumber(e),this._satoshis=e),Su.checkState(Lg.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});kr.prototype.invalidSatoshis=function(){return this._satoshis>qC?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};kr.prototype.toObject=kr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};kr.fromObject=function(e){return new kr(e)};kr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=Ug.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof DC.Script.InvalidBuffer)this._script=null;else throw t}};kr.prototype.setScript=function(e){if(e instanceof Ug)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(id.isString(e))this._script=Ug.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(I3.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};kr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};kr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=Buffer.from([]),new kr(t)};kr.prototype.toBufferWriter=function(e){e||(e=new T3),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};kr.prototype.calculateSize=function(){let e=8;return e+=T3.varintBufNum(this._scriptBuffer.length).length,e+=this._scriptBuffer.length,e};kr.prototype.add=function(e,t,r,i=!0){if(Su.checkArgument((r&~R3.TAPROOT_LEAF_MASK)===0,"invalid leafVersion"),!this.isValid)return;let n={hash:Dg.TAPLEAF.writeUInt8(r).write(t.toBuffer()).finalize(),leaves:[]};if(i){let o={script:t,leafVersion:r,merkleBranch:[]};n.leaves.push(o)}return this._insertNode(n,e),this};kr.prototype._insertNode=function(e,t){if(Su.checkArgument(t>=0&&t<=R3.TAPROOT_CONTROL_MAX_NODE_COUNT,"invalid depth"),t+1<this._branch.length){this.isValid=!1;return}for(;this.isValid&&this._branch.length>t&&this._branch[t];)e=this._combineNodes(e,this._branch[t]),this._branch=this._branch.slice(0,this._branch.length-2),t==0&&(this.isValid=!1),t--;this.isValid&&(this._branch.length<=t&&(this._branch=this._branch.slice(0,t+1)),Su.checkState(!this._nodes[t]),m_branch[t]=e)};kr.prototype._combineNodes=function(e,t){let r={hash:null,leaves:[]};for(let i of e.leaves)i.merkleBranch.push(t.hash),r.leaves.push(i);for(let i of t.leaves)i.merkleBranch.push(e.hash),r.leaves.push(i);return e.hash.compare(t.hash)===-1?r.hash=Dg.TAPBRANCH.write(e.hash).write(t.hash).finalize():r.hash=Dg.TAPBRANCH.write(t.hash).write(e.hash).finalize(),r};kr.prototype.finalize=function(e){Su.checkState(this.isComplete===!0,"finalize can only be called when isComplete is true");let t=e.createTapTweak(this._branch.length===0?null:this._branch[0].hash)};A3.exports=kr});var Eu=X(($Z,N3)=>{"use strict";var nd=Et(),pl=xt(),cc=Yi(),O3=ri(),GZ=require("buffer"),FC=Yt(),k3=Rr(),Fg=Li(),HC=fa(),Hg=bs(),sd=4294967295,P3=sd,zC=sd-1,VC=sd-2,jC=Math.pow(2,31),jg=Math.pow(2,22),zg=65535,Vg=512,WC=Math.pow(2,16)-1;function bt(e){if(!(this instanceof bt))return new bt(e);if(e)return this._fromObject(e)}bt.MAXINT=sd;bt.DEFAULT_SEQNUMBER=P3;bt.DEFAULT_LOCKTIME_SEQNUMBER=zC;bt.DEFAULT_RBF_SEQNUMBER=VC;bt.SEQUENCE_LOCKTIME_TYPE_FLAG=jg;Object.defineProperty(bt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new Fg(this._scriptBuffer),this._script._isInput=!0),this._script)}});bt.fromObject=function(e){pl.checkArgument(nd.isObject(e));var t=new bt;return t._fromObject(e)};bt.prototype._fromObject=function(e){var t;if(typeof e.prevTxId=="string"&&k3.isHexa(e.prevTxId)?t=Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.witnesses=[],this.output=e.output?e.output instanceof Hg?e.output:new Hg(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=e.outputIndex==null?e.txoutnum:e.outputIndex,this.sequenceNumber=e.sequenceNumber==null?e.seqnum==null?P3:e.seqnum:e.sequenceNumber,e.script===void 0&&e.scriptBuffer===void 0)throw new cc.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};bt.prototype.toObject=bt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};bt.fromBufferReader=function(e){var t=new bt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};bt.prototype.toBufferWriter=function(e){e||(e=new O3),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};bt.prototype.setScript=function(e){if(this._script=null,e instanceof Fg)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(k3.isHexa(e))this._scriptBuffer=Buffer.from(e,"hex");else if(nd.isString(e))this._script=new Fg(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(FC.isBuffer(e))this._scriptBuffer=Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};bt.prototype.getSignatures=function(){throw new cc.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};bt.prototype.getSatoshisBuffer=function(){return pl.checkState(this.output instanceof Hg),pl.checkState(this.output._satoshisBN),new O3().writeUInt64LEBN(this.output._satoshisBN).toBuffer()};bt.prototype.isFullySigned=function(){throw new cc.AbstractMethodInvoked("Input#isFullySigned")};bt.prototype.isFinal=function(){return this.sequenceNumber!==bt.MAXINT};bt.prototype.addSignature=function(){throw new cc.AbstractMethodInvoked("Input#addSignature")};bt.prototype.clearSignatures=function(){throw new cc.AbstractMethodInvoked("Input#clearSignatures")};bt.prototype.hasWitnesses=function(){return!!(this.witnesses&&this.witnesses.length>0)};bt.prototype.getWitnesses=function(){return this.witnesses};bt.prototype.setWitnesses=function(e){this.witnesses=e};bt.prototype.isValidSignature=function(e,t,r){return r=r||"ecdsa",t.signature.nhashtype=t.sigtype,HC.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)};bt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};bt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};bt.prototype._getBaseSize=function(){return 40};bt.prototype.lockForSeconds=function(e){if(pl.checkArgument(nd.isNumber(e)),e<0||e>=Vg*zg)throw new cc.Transaction.Input.LockTimeRange;return e=parseInt(Math.floor(e/Vg)),this.sequenceNumber=e|jg,this};bt.prototype.lockUntilBlockHeight=function(e){if(pl.checkArgument(nd.isNumber(e)),e<0||e>=WC)throw new cc.Transaction.Input.BlockHeightOutOfRange;return this.sequenceNumber=e,this};bt.prototype.getLockTime=function(){if(this.sequenceNumber&jC)return null;if(this.sequenceNumber&jg){var e=Vg*(this.sequenceNumber&zg);return e}else{var t=this.sequenceNumber&zg;return t}};N3.exports=bt});var uc=X((YZ,C3)=>{"use strict";var _n=xt(),KC=no(),ad=Yt(),B3=Rr(),M3=jn(),GC=Yi(),hl=di();function Wn(e){if(!(this instanceof Wn))return new Wn(e);if(e instanceof Wn)return e;if(e&&typeof e=="object")return this._fromObject(e);throw new GC.InvalidArgument("TransactionSignatures must be instantiated from an object")}KC(Wn,hl);Wn.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new M3(e.publicKey),this.prevTxId=ad.isBuffer(e.prevTxId)?e.prevTxId:Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof hl?e.signature:ad.isBuffer(e.signature)?hl.fromBuffer(e.signature):hl.fromString(e.signature),this.sigtype=e.sigtype,this};Wn.prototype._checkObjectArgs=function(e){_n.checkArgument(M3(e.publicKey),"invalid publicKey"),_n.checkArgument(e.inputIndex!=null,"missing inputIndex"),_n.checkArgument(e.outputIndex!=null,"missing outputIndex"),_n.checkState(!isNaN(e.inputIndex),"inputIndex must be a number"),_n.checkState(!isNaN(e.outputIndex),"outputIndex must be a number"),_n.checkArgument(e.signature,"missing signature"),_n.checkArgument(e.prevTxId,"missing prevTxId"),_n.checkState(e.signature instanceof hl||ad.isBuffer(e.signature)||B3.isHexa(e.signature),"signature must be a buffer or hexa value"),_n.checkState(ad.isBuffer(e.prevTxId)||B3.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),_n.checkArgument(e.sigtype!=null,"missing sigtype"),_n.checkState(!isNaN(e.sigtype),"sigtype must be a number")};Wn.prototype.toObject=Wn.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};Wn.fromObject=function(e){return _n.checkArgument(e),new Wn(e)};C3.exports=Wn});var F3=X((XZ,q3)=>{"use strict";var $C=no(),L3=xt(),ZZ=Yt(),U3=Eu(),YC=bs(),ZC=fa(),D3=Li(),XC=di(),JC=uc();function la(){U3.apply(this,arguments)}$C(la,U3);la.prototype.getSignatures=function(e,t,r,i,n,o){L3.checkState(this.output instanceof YC),i=i||XC.SIGHASH_ALL,o=o||"ecdsa";var u=t.toPublicKey();return u.toString()===this.output.script.getPublicKey().toString("hex")?[new JC({publicKey:u,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:ZC.sign(e,t,i,r,this.output.script),sigtype:i})]:[]};la.prototype.addSignature=function(e,t,r){return L3.checkState(this.isValidSignature(e,t,r),"Signature is invalid"),this.setScript(D3.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};la.prototype.clearSignatures=function(){return this.setScript(D3.empty()),this};la.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};la.SCRIPT_MAX_SIZE=73;la.prototype._estimateSize=function(){return this._getBaseSize()+la.SCRIPT_MAX_SIZE};q3.exports=la});var Kg=X((QZ,j3)=>{"use strict";var QC=no(),H3=xt(),od=Yt(),JZ=Vn(),eL=Dr(),z3=Eu(),tL=bs(),V3=fa(),Wg=yu(),rL=ri(),od=Yt(),Iu=Li(),iL=di(),nL=uc();function mi(){z3.apply(this,arguments)}QC(mi,z3);mi.prototype.getRedeemScript=function(e){if(!this.redeemScript){var t=Iu.buildWitnessV0Out(e);if(Iu.buildScriptHashOut(t).equals(this.output.script)){var r=new Iu;r.add(t.toBuffer()),this.setScript(r),this.redeemScript=t}}return this.redeemScript};mi.prototype.getScriptCode=function(e){var t=new rL,r;this.output.script.isScriptHashOut()?r=this.getRedeemScript(e):r=this.output.script;var i=Iu.buildPublicKeyHashOut(r.toAddress()).toBuffer();return t.writeVarintNum(i.length),t.write(i),t.toBuffer()};mi.prototype.getSighash=function(e,t,r,i){var n=this.getScriptCode(t),o=this.getSatoshisBuffer();return Wg.sighash(e,i,r,n,o)};mi.prototype.getSignatures=function(e,t,r,i,n,o,u){H3.checkState(this.output instanceof tL),n=n||eL.sha256ripemd160(t.publicKey.toBuffer()),i=i||iL.SIGHASH_ALL,o=o||"ecdsa";var m;if(this.output.script.isScriptHashOut()?m=this.getRedeemScript(t.publicKey):m=this.output.script,m&&od.equals(n,m.getPublicKeyHash())){var _;if(m.isWitnessPublicKeyHashOut()){var w=this.getSatoshisBuffer(),I=this.getScriptCode(t.publicKey);_=Wg.sign(e,t,i,r,I,w)}else _=V3.sign(e,t,i,r,this.output.script);return[new nL({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:_,sigtype:i})]}return[]};mi.prototype.addSignature=function(e,t,r){return H3.checkState(this.isValidSignature(e,t,r),"Signature is invalid"),this.output.script.isWitnessPublicKeyHashOut()||this.output.script.isScriptHashOut()?this.setWitnesses([od.concat([t.signature.toDER(),od.integerAsSingleByteBuffer(t.sigtype)]),t.publicKey.toBuffer()]):this.setScript(Iu.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};mi.prototype.clearSignatures=function(){return this.setScript(Iu.empty()),this.setWitnesses([]),this};mi.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()||this.hasWitnesses()};mi.prototype.isValidSignature=function(e,t,r){if(r=r||"ecdsa",t.signature.nhashtype=t.sigtype,this.output.script.isWitnessPublicKeyHashOut()||this.output.script.isScriptHashOut()){var i=this.getScriptCode(),n=this.getSatoshisBuffer();return Wg.verify(e,t.signature,t.publicKey,t.inputIndex,i,n)}else return V3.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)};mi.SCRIPT_MAX_SIZE=107;mi.REDEEM_SCRIPT_SIZE=23;mi.prototype._estimateSize=function(){let e=this._getBaseSize();e+=1;let r=mi.SCRIPT_MAX_SIZE/4;return this.output.script.isWitnessPublicKeyHashOut()?e+=r:this.output.script.isScriptHashOut()?e+=r+mi.REDEEM_SCRIPT_SIZE:e+=mi.SCRIPT_MAX_SIZE,e};j3.exports=mi});var $3=X((rX,G3)=>{"use strict";var Kn=Et(),sL=no(),eX=cd(),$g=Eu(),aL=bs(),dl=xt(),K3=Li(),Gg=di(),Yg=fa(),tX=jn(),W3=Yt(),Zg=uc();function Pr(e,t,r,i,n){n=n||{},$g.apply(this,arguments);var o=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,n.noSorting?this.publicKeys=t:this.publicKeys=Kn.sortBy(t,function(u){return u.toString("hex")}),dl.checkState(K3.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},Kn.each(this.publicKeys,function(u,m){o.publicKeyIndex[u.toString()]=m}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}sL(Pr,$g);Pr.prototype.toObject=function(){var e=$g.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=Kn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Pr.prototype._deserializeSignatures=function(e){return Kn.map(e,function(t){if(t)return new Zg(t)})};Pr.prototype._serializeSignatures=function(){return Kn.map(this.signatures,function(e){if(e)return e.toObject()})};Pr.prototype.getSignatures=function(e,t,r,i,n,o,u){dl.checkState(this.output instanceof aL),i=i||Gg.SIGHASH_ALL,o=o||"ecdsa";let m=[];for(let _ of this.publicKeys||[])_.toString()===t.publicKey.toString()&&m.push(new Zg({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:Yg.sign(e,t,i,r,this.output.script),sigtype:i}));return m};Pr.prototype.addSignature=function(e,t,r){return dl.checkState(!this.isFullySigned(),"All needed signatures have already been added"),dl.checkArgument(!Kn.isUndefined(this.publicKeyIndex[t.publicKey.toString()],"Signature Undefined"),"Signature has no matching public key"),dl.checkState(this.isValidSignature(e,t,r),"Invalid Signature"),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Pr.prototype._updateScript=function(){return this.setScript(K3.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Pr.prototype._createSignatures=function(){return Kn.map(Kn.filter(this.signatures,function(e){return!Kn.isUndefined(e)}),function(e){return W3.concat([e.signature.toDER(),W3.integerAsSingleByteBuffer(e.sigtype)])})};Pr.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Pr.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Pr.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Pr.prototype.countSignatures=function(){return Kn.reduce(this.signatures,function(e,t){return e+!!t},0)};Pr.prototype.publicKeysWithoutSignature=function(){var e=this;return Kn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Pr.prototype.isValidSignature=function(e,t,r){return r=r||"ecdsa",t.signature.nhashtype=t.sigtype,Yg.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)};Pr.normalizeSignatures=function(e,t,r,i,n,o){return o=o||"ecdsa",n.map(function(u){var m=null;return i=i.filter(function(_){if(m)return!0;var w=new Zg({signature:Gg.fromTxFormat(_),publicKey:u,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:Gg.SIGHASH_ALL});w.signature.nhashtype=w.sigtype;var I=Yg.verify(e,w.signature,w.publicKey,w.inputIndex,t.output.script);return I?(m=w,!1):!0}),m||null})};Pr.OPCODES_SIZE=1;Pr.SIGNATURE_SIZE=73;Pr.prototype._estimateSize=function(){return this._getBaseSize()+Pr.OPCODES_SIZE+this.threshold*Pr.SIGNATURE_SIZE};G3.exports=Pr});var J3=X((iX,X3)=>{"use strict";var oL=Et(),cL=no(),Xg=Eu(),uL=bs(),ud=xt(),oo=Vn(),Tu=Li(),fL=di(),Jg=fa(),Qg=yu(),lL=ri(),Y3=Yt(),Z3=uc();function Jt(e,t,r,i,n){n=n||{},Xg.apply(this,arguments),t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,n.noSorting?this.publicKeys=t:this.publicKeys=oL.sortBy(t,function(m){return m.toString("hex")}),this.redeemScript=Tu.buildMultisigOut(this.publicKeys,r,n);var o=Tu.buildWitnessMultisigOutFromScript(this.redeemScript);if(o.equals(this.output.script))this.nestedWitness=!1,this.type=oo.PayToWitnessScriptHash;else if(Tu.buildScriptHashOut(o).equals(this.output.script))this.nestedWitness=!0,this.type=oo.PayToScriptHash;else if(Tu.buildScriptHashOut(this.redeemScript).equals(this.output.script))this.nestedWitness=!1,this.type=oo.PayToScriptHash;else throw new Error("Provided public keys don't hash to the provided output");if(this.nestedWitness){var u=new Tu;u.add(o.toBuffer()),this.setScript(u)}this.publicKeyIndex={};for(let m=0;m<this.publicKeys.length;m++){let _=this.publicKeys[m];this.publicKeyIndex[_.toString()]=m}this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}cL(Jt,Xg);Jt.prototype.toObject=function(){var e=Xg.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=this.publicKeys.map(function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Jt.prototype._deserializeSignatures=function(e){return e.map(function(t){if(t)return new Z3(t)})};Jt.prototype._serializeSignatures=function(){return this.signatures.map(function(e){if(e)return e.toObject()})};Jt.prototype.getScriptCode=function(){var e=new lL;if(this.redeemScript.hasCodeseparators())throw new Error("@TODO");var t=this.redeemScript.toBuffer();return e.writeVarintNum(t.length),e.write(t),e.toBuffer()};Jt.prototype.getSighash=function(e,t,r,i){var n;if(this.nestedWitness||this.type===oo.PayToWitnessScriptHash){var o=this.getScriptCode(),u=this.getSatoshisBuffer();n=Qg.sighash(e,i,r,o,u)}else n=Jg.sighash(e,i,r,this.redeemScript);return n};Jt.prototype.getSignatures=function(e,t,r,i,n,o,u){ud.checkState(this.output instanceof uL),i=i||fL.SIGHASH_ALL,o=o||"ecdsa";let m=[];for(let T of this.publicKeys)if(T.toString()===t.publicKey.toString()){var _;if(this.nestedWitness||this.type===oo.PayToWitnessScriptHash){var w=this.getScriptCode(),I=this.getSatoshisBuffer();_=Qg.sign(e,t,i,r,w,I)}else _=Jg.sign(e,t,i,r,this.redeemScript);m.push(new Z3({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:_,sigtype:i}))}return m};Jt.prototype.addSignature=function(e,t,r){return ud.checkState(!this.isFullySigned(),"All needed signatures have already been added"),ud.checkArgument(this.publicKeyIndex[t.publicKey.toString()]!=null,"Signature has no matching public key"),ud.checkState(this.isValidSignature(e,t,r),"Invalid Signature!"),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Jt.prototype._updateScript=function(){if(this.nestedWitness||this.type===oo.PayToWitnessScriptHash){for(var e=[Buffer.alloc(0)],t=this._createSignatures(),r=0;r<t.length;r++)e.push(t[r]);e.push(this.redeemScript.toBuffer()),this.setWitnesses(e)}else{var i=Tu.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript});this.setScript(i)}return this};Jt.prototype._createSignatures=function(){return this.signatures.filter(function(e){return e!=null}).map(function(e){return Y3.concat([e.signature.toDER(),Y3.integerAsSingleByteBuffer(e.sigtype)])})};Jt.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Jt.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Jt.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Jt.prototype.countSignatures=function(){return this.signatures.reduce(function(e,t){return e+!!t},0)};Jt.prototype.publicKeysWithoutSignature=function(){return this.publicKeys.filter(e=>!this.signatures[this.publicKeyIndex[e.toString()]])};Jt.prototype.isValidSignature=function(e,t,r){if(r=r||"ecdsa",this.nestedWitness||this.type===oo.PayToWitnessScriptHash){t.signature.nhashtype=t.sigtype;var i=this.getScriptCode(),n=this.getSatoshisBuffer();return Qg.verify(e,t.signature,t.publicKey,t.inputIndex,i,n)}else return t.signature.nhashtype=t.sigtype,Jg.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)};Jt.MAX_OPCODES_SIZE=8;Jt.MAX_SIGNATURE_SIZE=74;Jt.MAX_PUBKEY_SIZE=34;Jt.REDEEM_SCRIPT_SIZE=34;Jt.prototype._estimateSize=function(){let e=this._getBaseSize(),t=4,r=Jt.MAX_OPCODES_SIZE+this.threshold*Jt.MAX_SIGNATURE_SIZE+this.publicKeys.length*Jt.MAX_PUBKEY_SIZE;return this.type===oo.PayToWitnessScriptHash?e+=r/t:this.nestedWitness?e+=r/t+Jt.REDEEM_SCRIPT_SIZE:e+=r,e};X3.exports=Jt});var iI=X((sX,rI)=>{var pL=no(),ex=xt(),Q3=Kg(),eI=rd(),fd=di(),hL=uc(),tI=bs(),nX=ao();function pa(){Q3.apply(this,arguments)}pL(pa,Q3);pa.prototype.getSignatures=function(e,t,r,i,n,o,u){ex.checkState(this.output instanceof tI),i=i||fd.SIGHASH_DEFAULT;let m=e.inputs.indexOf(this),_=t.createTapTweak(u).tweakedPrivKey,w=eI.sign(e,_,i,m,fd.Version.TAPROOT,null);if(!w)return[];let I=new hL({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:m,signature:fd.fromSchnorr(w),sigtype:i});return this.isValidSignature(e,I)?[I]:[]};pa.prototype.isValidSignature=function(e,t){return ex.checkState(e.inputs.indexOf(this)>=0,"Signature has no matching input"),ex.checkState(this.output instanceof tI,"output is not instance of Output"),this.output.script.isTaproot()?eI.verify(e,t.signature,this.output.script.chunks[1].buf,fd.Version.TAPROOT,e.inputs.indexOf(this),null):!1};pa.prototype.isFullySigned=function(){return this.output.script.isTaproot()&&this.hasWitnesses()};pa.prototype.addSignature=function(e,t){return this.isValidSignature(e,t)&&this.setWitnesses([t.signature.toBuffer()]),this};pa.SCRIPT_MAX_SIZE=66;pa.prototype._estimateSize=function(){let e=this._getBaseSize();e+=1;let r=pa.SCRIPT_MAX_SIZE/4;return e+=r,e};rI.exports=pa});var ld=X((aX,fc)=>{fc.exports=Eu();fc.exports.PublicKey=F3();fc.exports.PublicKeyHash=Kg();fc.exports.MultiSig=$3();fc.exports.MultiSigScriptHash=J3();fc.exports.Taproot=iI()});var fa=X((oX,aI)=>{"use strict";var ml=di(),tx=Li(),dL=bs(),mL=xs(),vL=ri(),gL=Xr(),xL=Dr(),sI=fl(),nI=xt(),rx=Et(),bL="0000000000000000000000000000000000000000000000000000000000000001",_L="ffffffffffffffff",ix=function(t,r,i,n){var o=cd(),u=ld();i=parseInt(i);var m,_=o.shallowCopy(t);for(n=new tx(n),n.removeCodeseparators(),m=0;m<_.inputs.length;m++)_.inputs[m]=new u(_.inputs[m]).setScript(tx.empty());if(_.inputs[i]=new u(_.inputs[i]).setScript(n),(r&31)===ml.SIGHASH_NONE||(r&31)===ml.SIGHASH_SINGLE)for(m=0;m<_.inputs.length;m++)m!==i&&(_.inputs[m].sequenceNumber=0);if((r&31)===ml.SIGHASH_NONE)_.outputs=[];else if((r&31)===ml.SIGHASH_SINGLE){if(i>=_.outputs.length)return Buffer.from(bL,"hex");for(_.outputs.length=i+1,m=0;m<i;m++)_.outputs[m]=new dL({satoshis:gL.fromBuffer(Buffer.from(_L,"hex")),script:tx.empty()})}r&ml.SIGHASH_ANYONECANPAY&&(_.inputs=[_.inputs[i]]);var w=new vL().write(_.toBuffer()).writeInt32LE(r).toBuffer(),I=xL.sha256sha256(w);return I=new mL(I).readReverse(),I};function yL(e,t,r,i,n){let o=ix(e,r,i,n),u=sI.sign(o,t,{endian:"little"});return u.nhashtype=r,u}function wL(e,t,r,i,n){nI.checkArgument(!rx.isUndefined(e),"Transaction Undefined"),nI.checkArgument(!rx.isUndefined(t)&&!rx.isUndefined(t.nhashtype),"Signature Undefined");let o=ix(e,t.nhashtype,i,n);return sI.verify(o,t,r,{endian:"little"})}aI.exports={sighash:ix,sign:yL,verify:wL}});var hd=X((cX,oI)=>{"use strict";var nx=Et(),pd=Yi(),SL=xt(),lc={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function ot(e,t){if(!(this instanceof ot))return new ot(e,t);if(nx.isNumber(t)){if(t<=0)throw new pd.Unit.InvalidRate(t);e=e/t,t=ot.BTC}this._value=this._from(e,t);var r=this,i=function(n){Object.defineProperty(r,n,{get:function(){return r.to(n)},enumerable:!0})};Object.keys(lc).forEach(i)}Object.keys(lc).forEach(function(e){ot[e]=e});ot.fromObject=function(t){return SL.checkArgument(nx.isObject(t),"Argument is expected to be an object"),new ot(t.amount,t.code)};ot.fromBTC=function(e){return new ot(e,ot.BTC)};ot.fromMillis=ot.fromMilis=function(e){return new ot(e,ot.mBTC)};ot.fromMicros=ot.fromBits=function(e){return new ot(e,ot.bits)};ot.fromSatoshis=function(e){return new ot(e,ot.satoshis)};ot.fromFiat=function(e,t){return new ot(e,t)};ot.prototype._from=function(e,t){if(!lc[t])throw new pd.Unit.UnknownCode(t);return parseInt((e*lc[t][0]).toFixed())};ot.prototype.to=function(e){if(nx.isNumber(e)){if(e<=0)throw new pd.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!lc[e])throw new pd.Unit.UnknownCode(e);var t=this._value/lc[e][0];return parseFloat(t.toFixed(lc[e][1]))};ot.prototype.toBTC=function(){return this.to(ot.BTC)};ot.prototype.toMillis=ot.prototype.toMilis=function(){return this.to(ot.mBTC)};ot.prototype.toMicros=ot.prototype.toBits=function(){return this.to(ot.bits)};ot.prototype.toSatoshis=function(){return this.to(ot.satoshis)};ot.prototype.atRate=function(e){return this.to(e)};ot.prototype.toString=function(){return this.satoshis+" satoshis"};ot.prototype.toObject=ot.prototype.toJSON=function(){return{amount:this.BTC,code:ot.BTC}};ot.prototype.inspect=function(){return"<Unit: "+this.toString()+">"};oI.exports=ot});var sx=X((uX,fI)=>{"use strict";var ha=Et(),dd=xt(),cI=Rr(),EL=Li(),IL=Vn(),uI=hd();function da(e){if(!(this instanceof da))return new da(e);dd.checkArgument(ha.isObject(e),"Must provide an object from where to extract data");var t=e.address?new IL(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!cI.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=ha.isUndefined(e.vout)?e.outputIndex:e.vout;if(!ha.isNumber(i))throw new Error("Invalid outputIndex, received "+i);dd.checkArgument(!ha.isUndefined(e.scriptPubKey)||!ha.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new EL(e.scriptPubKey||e.script);dd.checkArgument(!ha.isUndefined(e.amount)||!ha.isUndefined(e.satoshis),"Must provide an amount for the output");var o=ha.isUndefined(e.amount)?e.satoshis:new uI.fromBTC(e.amount).toSatoshis();dd.checkArgument(ha.isNumber(o),"Amount must be a number"),cI.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}da.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};da.prototype.toString=function(){return this.txId+":"+this.outputIndex};da.fromObject=function(e){return new da(e)};da.prototype.toObject=da.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:uI.fromSatoshis(this.satoshis).toBTC()}};fI.exports=da});var cd=X((fX,mI)=>{"use strict";var uo=Et(),vr=xt(),TL=require("buffer"),lI=Buffer.compare||E3(),Gr=Yi(),RL=Yt(),vd=Rr(),ax=xs(),Au=ri(),ox=Dr(),Ru=di(),AL=fa(),OL=yu(),kL=rd(),PL=Vn(),pI=sx(),wr=ld(),NL=wr.PublicKeyHash,BL=wr.PublicKey,ML=wr.MultiSigScriptHash,CL=wr.MultiSig,LL=wr.Taproot,fo=bs(),co=Li(),UL=ao(),md=Xr();function ie(e,t){if(!(this instanceof ie))return new ie(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof ie)return ie.shallowCopy(e);if(vd.isHexa(e))this.fromString(e);else if(RL.isBuffer(e))this.fromBuffer(e);else if(uo.isObject(e))this.fromObject(e,t);else throw new Gr.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var hI=2,DL=0,qL=1e6;ie.DUST_AMOUNT=546;ie.FEE_SECURITY_MARGIN=150;ie.MAX_MONEY=21e6*1e8;ie.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;ie.NLOCKTIME_MAX_VALUE=4294967295;ie.FEE_PER_KB=1e5;ie.CHANGE_OUTPUT_MAX_SIZE=62;ie.MAXIMUM_EXTRA_SIZE=26;ie.shallowCopy=function(e){var t=new ie(e.toBuffer());return t};var dI={configurable:!1,enumerable:!0,get:function(){return this._hash=new ax(this._getHash()).readReverse().toString("hex"),this._hash}},FL={configurable:!1,enumerable:!0,get:function(){return new ax(this._getWitnessHash()).readReverse().toString("hex")}};Object.defineProperty(ie.prototype,"witnessHash",FL);Object.defineProperty(ie.prototype,"hash",dI);Object.defineProperty(ie.prototype,"id",dI);var cx={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(ie.prototype,"inputAmount",cx);cx.get=function(){return this._getOutputAmount()};Object.defineProperty(ie.prototype,"outputAmount",cx);Object.defineProperty(ie.prototype,"size",{configurable:!1,enumerable:!1,get:function(){return this._calculateSize()}});Object.defineProperty(ie.prototype,"vsize",{configurable:!1,enumerable:!1,get:function(){return this._calculateVSize()}});Object.defineProperty(ie.prototype,"weight",{configurable:!1,enumerable:!1,get:function(){return this._calculateWeight()}});ie.prototype._getHash=function(){return ox.sha256sha256(this.toBuffer(!0))};ie.prototype._getWitnessHash=function(){return ox.sha256sha256(this.toBuffer(!1))};ie.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};ie.prototype.uncheckedSerialize=ie.prototype.toString=function(){return this.toBuffer().toString("hex")};ie.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://github.com/bitpay/bitcore/blob/master/packages/bitcore-lib/docs/transaction.md#serialization-checks",t;return this.uncheckedSerialize()};ie.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};ie.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Gr.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Gr.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};ie.prototype._hasFeeError=function(e,t){if(this._fee!=null&&this._fee!==t)return new Gr.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(ie.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Gr.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Gr.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}if(!e.disableSmallFees){var i=Math.ceil(this._estimateFee()/ie.FEE_SECURITY_MARGIN);if(t<i)return new Gr.Transaction.FeeError.TooSmall("expected more than "+i+" but got "+t)}};ie.prototype._missingChange=function(){return!this._changeScript};ie.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<ie.DUST_AMOUNT&&!r.script.isDataOut())return new Gr.Transaction.DustOutputs}};ie.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Gr.Transaction.MissingSignatures};ie.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};ie.prototype.toBuffer=function(e){var t=new Au;return this.toBufferWriter(t,e).toBuffer()};ie.prototype.hasWitnesses=function(){for(var e=0;e<this.inputs.length;e++)if(this.inputs[e].hasWitnesses())return!0;return!1};ie.prototype.toBufferWriter=function(e,t){e.writeInt32LE(this.version);let r=this.hasWitnesses();r&&!t&&e.write(Buffer.from("0001","hex")),e.writeVarintNum(this.inputs?this.inputs.length:0);for(let i of this.inputs||[])i.toBufferWriter(e);e.writeVarintNum(this.outputs?this.outputs.length:0);for(let i of this.outputs||[])i.toBufferWriter(e);if(r&&!t)for(let i of this.inputs){let n=i.getWitnesses();e.writeVarintNum(n.length);for(let o=0;o<n.length;o++)e.writeVarintNum(n[o].length),e.write(n[o])}return e.writeUInt32LE(this.nLockTime),e};ie.prototype.fromBuffer=function(e){var t=new ax(e);return this.fromBufferReader(t)};ie.prototype.fromBufferReader=function(e){vr.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readInt32LE();var t=e.readVarintNum(),r=!1;t===0&&e.buf[e.pos]!==0&&(e.pos+=1,r=!0,t=e.readVarintNum());for(var i=0;i<t;i++){var n=wr.fromBufferReader(e);this.inputs.push(n)}for(var o=e.readVarintNum(),u=0;u<o;u++)this.outputs.push(fo.fromBufferReader(e));if(r)for(var m=0;m<t;m++){for(var _=e.readVarintNum(),w=[],I=0;I<_;I++){var T=e.readVarintNum(),N=e.read(T);w.push(N)}this.inputs[m].setWitnesses(w)}return this.nLockTime=e.readUInt32LE(),this};ie.prototype.toObject=ie.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),this._changeIndex!=null&&(i.changeIndex=this._changeIndex),this._fee!=null&&(i.fee=this._fee),i};ie.prototype.fromObject=function(t,r){vr.checkArgument(uo.isObject(t)||t instanceof ie);var i;t instanceof ie?i=t.toObject():i=t;for(let u of i.inputs||[]){if(!u.output||!u.output.script){this.uncheckedAddInput(new wr(u));continue}var n=new co(u.output.script),o;if((n.isScriptHashOut()||n.isWitnessScriptHashOut())&&u.publicKeys&&u.threshold)o=new wr.MultiSigScriptHash(u,u.publicKeys,u.threshold,u.signatures,r);else if(n.isPublicKeyHashOut()||n.isWitnessPublicKeyHashOut()||n.isScriptHashOut())o=new wr.PublicKeyHash(u);else if(n.isPublicKeyOut())o=new wr.PublicKey(u);else throw new Gr.Transaction.Input.UnsupportedScript(u.output.script);this.addInput(o)}for(let u of i.outputs||[])this.addOutput(new fo(u));return i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new co(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};ie.prototype._checkConsistency=function(e){this._changeIndex!=null&&(vr.checkState(this._changeScript,"Change script is expected."),vr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),vr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&vr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};ie.prototype.lockUntilDate=function(e){if(vr.checkArgument(e),!isNaN(e)&&e<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Gr.Transaction.LockTimeTooEarly;uo.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===wr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=wr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.lockUntilBlockHeight=function(e){if(vr.checkArgument(!isNaN(e)),e>=ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Gr.Transaction.BlockHeightTooHigh;if(e<0)throw new Gr.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===wr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=wr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};ie.prototype.fromString=function(e){this.fromBuffer(TL.Buffer.from(e,"hex"))};ie.prototype._newTransaction=function(){this.version=hI,this.nLockTime=DL};ie.prototype.from=function(e,t,r,i){if(Array.isArray(e)){for(let o of e)this.from(o,t,r,i);return this}return this.inputs.some(function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex})?this:(t&&r?this._fromMultisigUtxo(e,t,r,i):this._fromNonP2SH(e,i),this)};ie.prototype.associateInputs=function(e,t,r,i={}){let n=[];for(let o of e){let u=this.inputs.findIndex(m=>m.prevTxId.toString("hex")===o.txId&&m.outputIndex===o.outputIndex);if(n.push(u),u>=0){let m=this.inputs[u].sequenceNumber;this.inputs[u]=this._getInputFrom(o,t,r,i),this.inputs[u].sequenceNumber=m}}return n};ie.prototype._selectInputType=function(e,t,r){var i;return e=new pI(e),t&&r?e.script.isMultisigOut()?i=CL:(e.script.isScriptHashOut()||e.script.isWitnessScriptHashOut())&&(i=ML):e.script.isPublicKeyHashOut()||e.script.isWitnessPublicKeyHashOut()||e.script.isScriptHashOut()?i=NL:e.script.isTaproot()?i=LL:e.script.isPublicKeyOut()?i=BL:i=wr,i};ie.prototype._getInputFrom=function(e,t,r,i={}){e=new pI(e);let n=this._selectInputType(e,t,r),o={output:new fo({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,sequenceNumber:i.sequenceNumber,script:co.empty()},u=t&&r?[t,r,!1,i]:[];return new n(o,...u)};ie.prototype._fromNonP2SH=function(e,t){let r=this._getInputFrom(e,null,null,t);this.addInput(r)};ie.prototype._fromMultisigUtxo=function(e,t,r,i){vr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");let n=this._getInputFrom(e,t,r,i);this.addInput(n)};ie.prototype.addInput=function(e,t,r){if(vr.checkArgumentType(e,wr,"input"),!e.output&&(t==null||r==null))throw new Gr.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&r!=null&&(t=t instanceof co?t:new co(t),vr.checkArgumentType(r,"number","satoshis"),e.output=new fo({script:t,satoshis:r})),this.uncheckedAddInput(e)};ie.prototype.uncheckedAddInput=function(e){return vr.checkArgumentType(e,wr,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};ie.prototype.hasAllUtxoInfo=function(){return this.inputs.every(function(e){return!!e.output})};ie.prototype.fee=function(e){return vr.checkArgument(!isNaN(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};ie.prototype.feePerKb=function(e){return vr.checkArgument(!isNaN(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};ie.prototype.feePerByte=function(e){return vr.checkArgument(!isNaN(e),"amount must be a number"),this._feePerByte=e,this._updateChangeOutput(),this};ie.prototype.change=function(e){return vr.checkArgument(e,"address is required"),this._changeScript=co.fromAddress(e),this._updateChangeOutput(),this};ie.prototype.getChangeOutput=function(){return this._changeIndex!=null?this.outputs[this._changeIndex]:null};ie.prototype.to=function(e,t){if(Array.isArray(e)){for(let r of e)this.to(r.address,r.satoshis);return this}return vr.checkArgument(vd.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new fo({script:co(new PL(e)),satoshis:t})),this};ie.prototype.addData=function(e){return this.addOutput(new fo({script:co.buildDataOut(e),satoshis:0})),this};ie.prototype.addOutput=function(e){return vr.checkArgumentType(e,fo,"output"),this._addOutput(e),this._updateChangeOutput(),this};ie.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};ie.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};ie.prototype._getOutputAmount=function(){if(this._outputAmount==null){var e=this;this._outputAmount=0;for(let t of this.outputs||[])e._outputAmount+=t.satoshis}return this._outputAmount};ie.prototype._getInputAmount=function(){return this._inputAmount==null&&(this._inputAmount=uo.sumBy(this.inputs,function(e){if(e.output==null)throw new Gr.Transaction.Input.MissingPreviousOutput;return e.output.satoshis})),this._inputAmount};ie.prototype._updateChangeOutput=function(e){if(this._changeScript){e||this._clearSignatures(),this._changeIndex!=null&&this._removeOutput(this._changeIndex);var t=this._getUnspentValue(),r=this.getFee(),i=t-r;i>ie.DUST_AMOUNT?(this._changeIndex=this.outputs.length,this._addOutput(new fo({script:this._changeScript,satoshis:i}))):this._changeIndex=void 0}};ie.prototype.getFee=function(){return this.isCoinbase()?0:this._fee!=null?this._fee:this._changeScript?this._estimateFee():this._getUnspentValue()};ie.prototype._estimateFee=function(){let e=this._estimateSize(),t=this._getUnspentValue(),r=this._feePerByte||(this._feePerKb||ie.FEE_PER_KB)/1e3;function i(u){return u*r}let n=Math.ceil(i(e)),o=Math.ceil(i(e)+i(this._estimateSizeOfChangeOutput()));return!this._changeScript||t<=o?n:o};ie.prototype._estimateSizeOfChangeOutput=function(){if(!this._changeScript)return 0;let e=this._changeScript.toBuffer().length;return 8+Au.varintBufNum(e).length+e};ie.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};ie.prototype._clearSignatures=function(){for(let e of this.inputs||[])e.clearSignatures()};ie.prototype._estimateSize=function(){let e=4;this.hasWitnesses()&&(e+=.5),e+=Au.varintBufNum(this.inputs.length).length;for(let t of this.inputs||[])e+=t._estimateSize();e+=Au.varintBufNum(this.outputs.length).length;for(let t of this.outputs||[])e+=t.calculateSize();return e+=4,Math.ceil(e)};ie.prototype._calculateSize=function(){return this.toBuffer().length};ie.prototype._calculateVSize=function(e){let t=this._calculateWeight()/4;return e?t:Math.ceil(t)};ie.prototype._calculateWeight=function(){return this.toBuffer(!0).length*3+this.toBuffer(!1).length};ie.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=uo.without(this.outputs,t),this._outputAmount=void 0};ie.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};ie.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);let r=0;return t.forEach(i=>{i.i=r++}),t.sort(function(i,n){return lI(i.prevTxId,n.prevTxId)||i.outputIndex-n.outputIndex||i.i-n.i}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);let r=0;return t.forEach(i=>{i.i=r++}),t.sort(function(i,n){return i.satoshis-n.satoshis||lI(i.script.toBuffer(),n.script.toBuffer())||i.i-n.i}),t}),this};ie.prototype.shuffleOutputs=function(){return this.sortOutputs(uo.shuffle)};ie.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};ie.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};ie.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||uo.difference(this.outputs,e).length!==0;if(t)throw new Gr.Transaction.InvalidSorting;if(this._changeIndex!=null){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};ie.prototype.removeInput=function(e,t){var r;if(!t&&!isNaN(e)?r=e:r=this.inputs.findIndex(function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Gr.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=uo.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};ie.prototype.sign=function(e,t,r,i){if(vr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction."),Array.isArray(e)){for(let n of e)this.sign(n,t,r,i);return this}for(let n of this.getSignatures(e,t,r,i))this.applySignature(n,r);return this};ie.prototype.getSignatures=function(e,t,r,i){typeof i=="string"&&(i=Buffer.from(i,"hex")),e=new UL(e);let n=[],o=ox.sha256ripemd160(e.publicKey.toBuffer());for(let u=0;u<this.inputs.length;u++){let m=this.inputs[u];for(let _ of m.getSignatures(this,e,u,t,o,r,i))n.push(_)}return n};ie.prototype.applySignature=function(e,t){return this.inputs[e.inputIndex].addSignature(this,e,t),this};ie.prototype.isFullySigned=function(){for(let e of this.inputs||[])if(e.isFullySigned===wr.prototype.isFullySigned)throw new Gr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs.every(function(e){return e.isFullySigned()})};ie.prototype.isValidSignature=function(e,t){if(this.inputs[e.inputIndex].isValidSignature===wr.prototype.isValidSignature)throw new Gr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e,t)};ie.prototype.checkEcdsaSignature=function(e,t,r,i,n){var o=i.toBuffer(),u=new Au;u.writeVarintNum(o.length),u.write(o);var m;n?(vr.checkState(vd.isNaturalNumber(n),"satoshis needs to be a natural number"),m=new Au().writeUInt64LEBN(new md(n)).toBuffer()):m=this.inputs[r].getSatoshisBuffer();var _=OL.verify(this,e,t,r,u.toBuffer(),m);return _};ie.prototype.checkSchnorrSignature=function(e,t,r,i,n){if(vr.isType(t,"PublicKey")&&(t=t.point.x.toBuffer()),vr.checkArgument(t&&t.length===32,"Schnorr signatures have 32-byte public keys. The caller is responsible for enforcing this."),Buffer.isBuffer(e)){if(e.length!==64&&e.length!==65)return!1;e=Ru.fromSchnorr(e)}return vr.checkArgument(e.isSchnorr,"Signature must be schnorr"),!!kL.verify(this,e,t,i,r,n)};ie.prototype.verifySignature=function(e,t,r,i,n,o,u){switch(n==null&&(n=Ru.Version.BASE),n){case Ru.Version.WITNESS_V0:return this.checkEcdsaSignature(e,t,r,i,o);case Ru.Version.TAPROOT:case Ru.Version.TAPSCRIPT:return this.checkSchnorrSignature(e,t,r,n,u);case Ru.Version.BASE:default:return AL.verify(this,e,t,r,i)}};ie.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new md(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new md(ie.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new md(ie.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>qL)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(i[o]!=null)return"transaction input "+t+" duplicate input";i[o]=!0}var u=this.isCoinbase();if(u){var m=this.inputs[0]._scriptBuffer;if(m.length<2||m.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};ie.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};ie.prototype.isRBF=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e];if(t.sequenceNumber<wr.MAXINT-1)return!0}return!1};ie.prototype.enableRBF=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e];t.sequenceNumber>=wr.MAXINT-1&&(t.sequenceNumber=wr.DEFAULT_RBF_SEQNUMBER)}return this};ie.prototype.setVersion=function(e){return vr.checkArgument(vd.isNaturalNumber(e)&&e<=hI,"Wrong version number"),this.version=e,this};mI.exports=ie});var vl=X((lX,lo)=>{lo.exports=cd();lo.exports.Input=ld();lo.exports.Output=bs();lo.exports.UnspentOutput=sx();lo.exports.Signature=uc();lo.exports.Sighash=fa();lo.exports.SighashWitness=yu()});var qg=X((pX,gI)=>{"use strict";var Ou=Et(),yn=Pg(),W=Jh(),Fe=Xr(),pc=Dr(),_t=di(),ku=jn(),wn=xt(),HL=yu(),zL=rd(),gd=ri(),vI=ca(),j=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};j.prototype.verifyWitnessProgram=function(e,t,r,i,n,o){var u=new yn,m=[];if(e===0)if(t.length===j.WITNESS_V0_SCRIPTHASH_SIZE){if(r.length===0)return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY",!1;var _=r[r.length-1];u=new yn(_);var w=pc.sha256(_);return w.toString("hex")!==t.toString("hex")?(this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1):(m=r.slice(0,-1),this.executeWitnessScript(u,m,_t.Version.WITNESS_V0,i,n))}else return t.length===j.WITNESS_V0_KEYHASH_SIZE?r.length!==2?(this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1):(u.add(W.OP_DUP),u.add(W.OP_HASH160),u.add(t),u.add(W.OP_EQUALVERIFY),u.add(W.OP_CHECKSIG),m=r,this.executeWitnessScript(u,m,_t.Version.WITNESS_V0,i,n)):(this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH",!1);else if(e===1&&t.length==j.WITNESS_V1_TAPROOT_SIZE&&!o){let I={annexPresent:!1};if(!(n&j.SCRIPT_VERIFY_TAPROOT))return!0;if(m=Array.from(r),m.length==0)return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY",!1;if(m.length>=2&&m[m.length-1].length&&m[m.length-1][0]===yn.ANNEX_TAG){let T=m.pop(),N=new gd;N.writeVarintNum(T.length),N.write(T),I.annexHash=pc.sha256(N.toBuffer()),I.annexPresent=!0}if(I.annexInit=!0,m.length===1)return this.checkSchnorrSignature(m[0],t,_t.Version.TAPROOT,I);{let T=m.pop(),N=m.pop();if(T.length<j.TAPROOT_CONTROL_BASE_SIZE||T.length>j.TAPROOT_CONTROL_MAX_SIZE||(T.length-j.TAPROOT_CONTROL_BASE_SIZE)%j.TAPROOT_CONTROL_NODE_SIZE!=0)return this.errstr="SCRIPT_ERR_TAPROOT_WRONG_CONTROL_SIZE",!1;if(I.tapleafHash=j.computeTapleafHash(T[0]&j.TAPROOT_LEAF_MASK,N),!j.verifyTaprootCommitment(T,t,I.tapleafHash))return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1;if(I.tapleafHashInit=!0,(T[0]&j.TAPROOT_LEAF_MASK)===j.TAPROOT_LEAF_TAPSCRIPT){let C;{let B=new gd;B.writeVarintNum(r.length);for(let U of r)B.writeVarintNum(U.length),B.write(U);C=B.toBuffer().length}try{u=new yn(N)}catch{return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return I.validationWeightLeft=C+yn.VALIDATION_WEIGHT_OFFSET,I.validationWeightLeftInit=!0,this.executeWitnessScript(u,m,_t.Version.TAPSCRIPT,i,n,I)}return n&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION?(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION",!1):!0}}else if(n&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM",!1;return!0};j.prototype.executeWitnessScript=function(e,t,r,i,n,o){if(r===_t.Version.TAPSCRIPT){for(let m of e.chunks)if(W.isOpSuccess(m.opcodenum))return n&j.SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS?(this.errstr="SCRIPT_ERR_DISCOURAGE_OP_SUCCESS",!1):!0;if(t.length>j.MAX_STACK_SIZE)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}if(t.length&&t.some(m=>m.length>j.MAX_SCRIPT_ELEMENT_SIZE))return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(this.initialize(),this.set({script:e,stack:t,sigversion:r,satoshis:i,flags:n,execdata:o}),!this.evaluate())return!1;if(this.stack.length!==1)return this.errstr="SCRIPT_ERR_EVAL_FALSE",!1;var u=this.stack[this.stack.length-1];return j.castToBool(u)?!0:(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1)};j.prototype.verify=function(e,t,r,i,n,o,u){var m=vl();Ou.isUndefined(r)&&(r=new m),Ou.isUndefined(i)&&(i=0),Ou.isUndefined(n)&&(n=0),Ou.isUndefined(o)&&(o=null),Ou.isUndefined(u)&&(u=0),this.set({script:e,tx:r,nin:i,sigversion:_t.Version.BASE,satoshis:0,flags:n});var _;if(n&j.SCRIPT_VERIFY_SIGPUSHONLY&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;n&j.SCRIPT_VERIFY_P2SH&&(_=this.stack.slice());var w=this.stack;if(this.initialize(),this.set({script:t,stack:w,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var I=this.stack[this.stack.length-1];if(!j.castToBool(I))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;var T=!1;if(n&j.SCRIPT_VERIFY_WITNESS){var N={};if(t.isWitnessProgram(N)){if(T=!0,e.toBuffer().length!==0)return this.errstr="SCRIPT_ERR_WITNESS_MALLEATED",!1;if(!this.verifyWitnessProgram(N.version,N.program,o,u,this.flags,!1))return!1}}if(n&j.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(_.length===0)throw new Error("internal error - stack copy empty");var C=_[_.length-1],B=yn.fromBuffer(C);if(_.pop(),this.initialize(),this.set({script:B,stack:_,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(_.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!j.castToBool(_[_.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1;if(n&j.SCRIPT_VERIFY_WITNESS){var U={};if(B.isWitnessProgram(U)){T=!0;var Z=new yn;if(Z.add(B.toBuffer()),e.toHex()!==Z.toHex())return this.errstr="SCRIPT_ERR_WITNESS_MALLEATED_P2SH",!1;if(!this.verifyWitnessProgram(U.version,U.program,o,u,this.flags,!0))return!1;w=[w[0]]}}}if(this.flags&j.SCRIPT_VERIFY_CLEANSTACK){if(!(this.flags&j.SCRIPT_VERIFY_P2SH)||!(this.flags&j.SCRIPT_VERIFY_WITNESS))throw"flags & SCRIPT_VERIFY_P2SH";if(_.length!=1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return this.flags&j.SCRIPT_VERIFY_WITNESS&&!T&&o.length>0?(this.errstr="SCRIPT_ERR_WITNESS_UNEXPECTED",!1):!0};gI.exports=j;j.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.satoshis=0,this.sigversion=_t.Version.BASE,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0,this.execdata={}};j.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin>"u"?this.nin:parseInt(e.nin),this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc>"u"?this.pc:e.pc,this.pbegincodehash=typeof e.pbegincodehash>"u"?this.pbegincodehash:e.pbegincodehash,this.sigversion=typeof e.sigversion>"u"?this.sigversion:e.sigversion,this.satoshis=typeof e.satoshis>"u"?this.satoshis:e.satoshis,this.nOpCount=typeof e.nOpCount>"u"?this.nOpCount:e.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags>"u"?this.flags:e.flags,this.execdata=typeof e.execdata>"u"?this.execdata:e.execdata||{}};j.true=Buffer.from([1]);j.false=Buffer.from([]);j.MAX_SCRIPT_SIZE=1e4;j.MAX_STACK_SIZE=1e3;j.MAX_SCRIPT_ELEMENT_SIZE=520;j.LOCKTIME_THRESHOLD=5e8;j.LOCKTIME_THRESHOLD_BN=new Fe(j.LOCKTIME_THRESHOLD);j.SCRIPT_VERIFY_NONE=0;j.SCRIPT_VERIFY_P2SH=1;j.SCRIPT_VERIFY_STRICTENC=2;j.SCRIPT_VERIFY_DERSIG=4;j.SCRIPT_VERIFY_LOW_S=8;j.SCRIPT_VERIFY_NULLDUMMY=16;j.SCRIPT_VERIFY_SIGPUSHONLY=32;j.SCRIPT_VERIFY_MINIMALDATA=64;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;j.SCRIPT_VERIFY_CLEANSTACK=256,j.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;j.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;j.SCRIPT_VERIFY_WITNESS=2048;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM=4096;j.SCRIPT_VERIFY_MINIMALIF=8192;j.SCRIPT_VERIFY_NULLFAIL=16384;j.SCRIPT_VERIFY_WITNESS_PUBKEYTYPE=32768;j.SCRIPT_ENABLE_SIGHASH_FORKID=65536;j.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;j.SCRIPT_VERIFY_CONST_SCRIPTCODE=65536;j.SCRIPT_VERIFY_TAPROOT=1<<17;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION=1<<18;j.SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS=1<<19;j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE=1<<20;j.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;j.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;j.SEQUENCE_LOCKTIME_MASK=65535;j.WITNESS_V0_SCRIPTHASH_SIZE=32;j.WITNESS_V0_KEYHASH_SIZE=20;j.WITNESS_V1_TAPROOT_SIZE=32;j.TAPROOT_LEAF_MASK=254;j.TAPROOT_LEAF_TAPSCRIPT=192;j.TAPROOT_CONTROL_BASE_SIZE=33;j.TAPROOT_CONTROL_NODE_SIZE=32;j.TAPROOT_CONTROL_MAX_NODE_COUNT=128;j.TAPROOT_CONTROL_MAX_SIZE=j.TAPROOT_CONTROL_BASE_SIZE+j.TAPROOT_CONTROL_NODE_SIZE*j.TAPROOT_CONTROL_MAX_NODE_COUNT;j.PROTOCOL_VERSION=70016;j.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};j.prototype.checkSignatureEncoding=function(e){var t;if(e.length==0)return!0;if(this.flags&(j.SCRIPT_VERIFY_DERSIG|j.SCRIPT_VERIFY_LOW_S|j.SCRIPT_VERIFY_STRICTENC)&&!_t.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if(this.flags&j.SCRIPT_VERIFY_LOW_S){if(t=_t.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if(this.flags&j.SCRIPT_VERIFY_STRICTENC&&(t=_t.fromTxFormat(e),!t.hasDefinedHashtype()))return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;return!0};j.prototype.checkPubkeyEncoding=function(e){return this.flags&j.SCRIPT_VERIFY_STRICTENC&&!ku.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):this.flags&j.SCRIPT_VERIFY_WITNESS_PUBKEYTYPE&&this.sigversion==_t.Version.WITNESS_V0&&!ku.fromBuffer(e).compressed?(this.errstr="SCRIPT_ERR_WITNESS_PUBKEYTYPE",!1):!0};j.prototype.checkEcdsaSignature=function(e,t,r,i,n){var o=i.toBuffer(),u=new gd;u.writeVarintNum(o.length),u.write(o),wn.checkState(JSUtil.isNaturalNumber(n));var m=new gd().writeUInt64LEBN(new Fe(n)).toBuffer(),_=HL.verify(this,e,t,r,u.toBuffer(),m);return _};j.prototype.checkSchnorrSignature=function(e,t,r,i){return wn.checkArgument(e&&Buffer.isBuffer(e),"Missing sig"),wn.checkArgument(t&&Buffer.isBuffer(t),"Missing pubkey"),wn.checkArgument(r,"Missing sigversion"),wn.checkArgument(i,"Missing execdata"),wn.checkArgument(t.length===32,"Schnorr signatures have 32-byte public keys. The caller is responsible for enforcing this."),e.length===64||e.length===65?e.length===65&&e[e.length-1]===_t.SIGHASH_DEFAULT?(this.errstr="SCRIPT_ERR_SCHNORR_SIG_HASHTYPE",!1):(e=_t.fromSchnorr(e),zL.verify(this.tx,e,t,r,this.nin,i)):(this.errstr="SCRIPT_ERR_SCHNORR_SIG_SIZE",!1)};j.prototype._evalChecksigPreTapscript=function(e,t){wn.checkArgument(this.sigversion===_t.Version.BASE||this.sigversion===_t.Version.WITNESS_V0,"sigversion must be base or witness_v0");let r={success:!1,result:!1},i=new yn().set({chunks:this.script.chunks.slice(this.pbegincodehash)});if(this.sigversion===_t.Version.BASE){let n=new yn().add(e),o=i.chunks.length;if(i.findAndDelete(n),o=o==i.chunks.length+1,o&&this.flags&j.SCRIPT_VERIFY_CONST_SCRIPTCODE)return this.errstr="SCRIPT_ERR_SIG_FINDANDDELETE",r}if(!this.checkSignatureEncoding(e)||!this.checkPubkeyEncoding(t))return r;try{let n=_t.fromTxFormat(e),o=ku.fromBuffer(t,!1);r.success=this.tx.verifySignature(n,o,this.nin,i,this.sigversion,this.satoshis)}catch{r.success=!1}return!r.success&&this.flags&j.SCRIPT_VERIFY_NULLFAIL&&e.length?(this.errstr="SCRIPT_ERR_SIG_NULLFAIL",r):(r.result=!0,r)};j.prototype._evalChecksigTapscript=function(e,t){wn.checkArgument(this.sigversion==_t.Version.TAPSCRIPT,"this.sigversion must by TAPSCRIPT");let r={success:e.length>0,result:!1};if(r.success&&(wn.checkState(this.execdata.validationWeightLeftInit,"validationWeightLeftInit is false"),this.execdata.validationWeightLeft-=yn.VALIDATION_WEIGHT_PER_SIGOP_PASSED,this.execdata.validationWeightLeft<0))return this.errstr="SCRIPT_ERR_TAPSCRIPT_VALIDATION_WEIGHT",r;if(t.length===0)return this.errstr="SCRIPT_ERR_PUBKEYTYPE",r;if(t.length==32){if(r.success&&!this.tx.checkSchnorrSignature(e,t,this.nin,this.sigversion,this.execdata))return this.errstr="SCRIPT_ERR_SCHNORR_SIG",r}else if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_PUBKEYTYPE",r;return r.result=!0,r};j.prototype._evalCheckSig=function(e,t){switch(this.sigversion){case _t.Version.BASE:case _t.Version.WITNESS_V0:return this._evalChecksigPreTapscript(e,t);case _t.Version.TAPSCRIPT:return this._evalChecksigTapscript(e,t);case _t.Version.TAPROOT:throw new Error("Called evalCheckSig with a TAPROOT sigversion. Check your implementation")}};j.prototype.evaluate=function(){if(wn.checkArgument(this.sigversion==_t.Version.BASE||this.sigversion==_t.Version.WITNESS_V0||this.sigversion==_t.Version.TAPSCRIPT,"invalid sigversion"),(this.sigversion==_t.Version.BASE||this.sigversion==_t.Version.WITNESS_V0)&&this.script.toBuffer().length>j.MAX_SCRIPT_SIZE)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){var e=this.step();if(!e)return!1}}catch(t){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};j.prototype.checkLockTime=function(e){return!(!(this.tx.nLockTime<j.LOCKTIME_THRESHOLD&&e.lt(j.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=j.LOCKTIME_THRESHOLD&&e.gte(j.LOCKTIME_THRESHOLD_BN))||e.gt(new Fe(this.tx.nLockTime))||!this.tx.inputs[this.nin].isFinal())};j.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2||t&j.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=j.SEQUENCE_LOCKTIME_TYPE_FLAG|j.SEQUENCE_LOCKTIME_MASK,i=new Fe(t&r),n=e.and(new Fe(r)),o=new Fe(j.SEQUENCE_LOCKTIME_TYPE_FLAG);return i.lt(o)&&n.lt(o)||i.gte(o)&&n.gte(o)?n.lte(i):!1};j.computeTapleafHash=function(e,t){let r=vI.TAPLEAF;return r.writeUInt8(e),r.writeVarintNum(t.length),r.write(t),r.finalize()};j.computeTaprootMerkleRoot=function(e,t){let r=(e.length-j.TAPROOT_CONTROL_BASE_SIZE)/j.TAPROOT_CONTROL_NODE_SIZE,i=t;for(let n=0;n<r;++n){let o=vI.TAPBRANCH,u=j.TAPROOT_CONTROL_BASE_SIZE+j.TAPROOT_CONTROL_NODE_SIZE*n,m=e.slice(u,u+j.TAPROOT_CONTROL_NODE_SIZE);Buffer.compare(i,m)===-1?(o.write(i),o.write(m)):(o.write(m),o.write(i)),i=o.finalize()}return i};j.verifyTaprootCommitment=function(e,t,r){wn.checkArgument(e.length>=j.TAPROOT_CONTROL_BASE_SIZE,"control too short"),wn.checkArgument(t.length>=32,"program is too short");try{let i=ku.fromX(!1,e.slice(1,j.TAPROOT_CONTROL_BASE_SIZE));let n=ku.fromX(!1,t),o=j.computeTaprootMerkleRoot(e,r);return n.checkTapTweak(i,o,e)}catch{return!1}};j.prototype.step=function(){var e=(this.flags&j.SCRIPT_VERIFY_MINIMALDATA)!==0,t=this.vfExec.indexOf(!1)===-1,r,i,n,o,u,m,_,w,I,T,N,C,B,U,Z,$,H;this.execdata=this.execdata||{},this.execdata.codeseparatorPosInit||(this.execdata.codeseparatorPos=new Fe(4294967295),this.execdata.codeseparatorPosInit=!0);var ee=this.script.chunks[this.pc];this.pc++;var ce=ee.opcodenum;if(Ou.isUndefined(ce))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(ee.buf&&ee.buf.length>j.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if((this.sigversion===_t.Version.BASE||this.sigversion===_t.Version.WITNESS_V0)&&ce>W.OP_16&&++this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(ce===W.OP_CAT||ce===W.OP_SUBSTR||ce===W.OP_LEFT||ce===W.OP_RIGHT||ce===W.OP_INVERT||ce===W.OP_AND||ce===W.OP_OR||ce===W.OP_XOR||ce===W.OP_2MUL||ce===W.OP_2DIV||ce===W.OP_MUL||ce===W.OP_DIV||ce===W.OP_MOD||ce===W.OP_LSHIFT||ce===W.OP_RSHIFT)return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(ce==W.OP_CODESEPARATOR&&this.sigversion===_t.Version.BASE&&this.flags&j.SCRIPT_VERIFY_CONST_SCRIPTCODE)return this.errstr="SCRIPT_ERR_OP_CODESEPARATOR",!1;if(t&&0<=ce&&ce<=W.OP_PUSHDATA4){if(e&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!ee.buf)this.stack.push(j.false);else{if(ee.len!==ee.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(ee.buf)}}else if(t||W.OP_IF<=ce&&ce<=W.OP_ENDIF)switch(ce){case W.OP_1NEGATE:case W.OP_1:case W.OP_2:case W.OP_3:case W.OP_4:case W.OP_5:case W.OP_6:case W.OP_7:case W.OP_8:case W.OP_9:case W.OP_10:case W.OP_11:case W.OP_12:case W.OP_13:case W.OP_14:case W.OP_15:case W.OP_16:u=ce-(W.OP_1-1),r=new Fe(u).toScriptNumBuffer(),this.stack.push(r);break;case W.OP_NOP:break;case W.OP_NOP2:case W.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&j.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var ge=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e,5);if(ge.lt(new Fe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(ge))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case W.OP_NOP3:case W.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&j.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var Se=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e,5);if(Se.lt(new Fe(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(Se&j.SEQUENCE_LOCKTIME_DISABLE_FLAG)break;if(!this.checkSequence(Se))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case W.OP_NOP1:case W.OP_NOP4:case W.OP_NOP5:case W.OP_NOP6:case W.OP_NOP7:case W.OP_NOP8:case W.OP_NOP9:case W.OP_NOP10:if(this.flags&j.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case W.OP_IF:case W.OP_NOTIF:{if($=!1,t){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(r=this.stack[this.stack.length-1],this.sigversion===_t.Version.TAPSCRIPT&&(r.length>1||r.length===1&&r[0]!==1))return this.errstr="SCRIPT_ERR_TAPSCRIPT_MINIMALIF",!1;if(this.sigversion===_t.Version.WITNESS_V0&&this.flags&j.SCRIPT_VERIFY_MINIMALIF){if(r=this.stack[this.stack.length-1],r.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(r.length==1&&r[0]!=1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}$=j.castToBool(r),ce===W.OP_NOTIF&&($=!$),this.stack.pop()}this.vfExec.push($)}break;case W.OP_ELSE:{if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1]}break;case W.OP_ENDIF:{if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop()}break;case W.OP_VERIFY:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(r=this.stack[this.stack.length-1],$=j.castToBool(r),$)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1}break;case W.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case W.OP_TOALTSTACK:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop())}break;case W.OP_FROMALTSTACK:{if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop())}break;case W.OP_2DROP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop()}break;case W.OP_2DUP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-2],n=this.stack[this.stack.length-1],this.stack.push(i),this.stack.push(n)}break;case W.OP_3DUP:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-3],n=this.stack[this.stack.length-2];var me=this.stack[this.stack.length-1];this.stack.push(i),this.stack.push(n),this.stack.push(me)}break;case W.OP_2OVER:{if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-4],n=this.stack[this.stack.length-3],this.stack.push(i),this.stack.push(n)}break;case W.OP_2ROT:{if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=this.stack.splice(this.stack.length-6,2),this.stack.push(o[0]),this.stack.push(o[1])}break;case W.OP_2SWAP:{if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=this.stack.splice(this.stack.length-4,2),this.stack.push(o[0]),this.stack.push(o[1])}break;case W.OP_IFDUP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=this.stack[this.stack.length-1],$=j.castToBool(r),$&&this.stack.push(r)}break;case W.OP_DEPTH:r=new Fe(this.stack.length).toScriptNumBuffer(),this.stack.push(r);break;case W.OP_DROP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop()}break;case W.OP_DUP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1])}break;case W.OP_NIP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1)}break;case W.OP_OVER:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2])}break;case W.OP_PICK:case W.OP_ROLL:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(r=this.stack[this.stack.length-1],w=Fe.fromScriptNumBuffer(r,e),u=w.toNumber(),this.stack.pop(),u<0||u>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=this.stack[this.stack.length-u-1],ce===W.OP_ROLL&&this.stack.splice(this.stack.length-u-1,1),this.stack.push(r)}break;case W.OP_ROT:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=this.stack[this.stack.length-3],_=this.stack[this.stack.length-2];var O=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=_,this.stack[this.stack.length-2]=O,this.stack[this.stack.length-1]=m}break;case W.OP_SWAP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=this.stack[this.stack.length-2],_=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=_,this.stack[this.stack.length-1]=m}break;case W.OP_TUCK:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1])}break;case W.OP_SIZE:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;w=new Fe(this.stack[this.stack.length-1].length),this.stack.push(w.toScriptNumBuffer())}break;case W.OP_EQUAL:case W.OP_EQUALVERIFY:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;i=this.stack[this.stack.length-2],n=this.stack[this.stack.length-1];var E=i.toString("hex")===n.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(E?j.true:j.false),ce===W.OP_EQUALVERIFY)if(E)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1}break;case W.OP_1ADD:case W.OP_1SUB:case W.OP_NEGATE:case W.OP_ABS:case W.OP_NOT:case W.OP_0NOTEQUAL:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(r=this.stack[this.stack.length-1],w=Fe.fromScriptNumBuffer(r,e),ce){case W.OP_1ADD:w=w.add(Fe.One);break;case W.OP_1SUB:w=w.sub(Fe.One);break;case W.OP_NEGATE:w=w.neg();break;case W.OP_ABS:w.cmp(Fe.Zero)<0&&(w=w.neg());break;case W.OP_NOT:w=new Fe((w.cmp(Fe.Zero)===0)+0);break;case W.OP_0NOTEQUAL:w=new Fe((w.cmp(Fe.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(w.toScriptNumBuffer())}break;case W.OP_ADD:case W.OP_SUB:case W.OP_BOOLAND:case W.OP_BOOLOR:case W.OP_NUMEQUAL:case W.OP_NUMEQUALVERIFY:case W.OP_NUMNOTEQUAL:case W.OP_LESSTHAN:case W.OP_GREATERTHAN:case W.OP_LESSTHANOREQUAL:case W.OP_GREATERTHANOREQUAL:case W.OP_MIN:case W.OP_MAX:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(I=Fe.fromScriptNumBuffer(this.stack[this.stack.length-2],e),T=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e),w=new Fe(0),ce){case W.OP_ADD:w=I.add(T);break;case W.OP_SUB:w=I.sub(T);break;case W.OP_BOOLAND:w=new Fe((I.cmp(Fe.Zero)!==0&&T.cmp(Fe.Zero)!==0)+0);break;case W.OP_BOOLOR:w=new Fe((I.cmp(Fe.Zero)!==0||T.cmp(Fe.Zero)!==0)+0);break;case W.OP_NUMEQUAL:w=new Fe((I.cmp(T)===0)+0);break;case W.OP_NUMEQUALVERIFY:w=new Fe((I.cmp(T)===0)+0);break;case W.OP_NUMNOTEQUAL:w=new Fe((I.cmp(T)!==0)+0);break;case W.OP_LESSTHAN:w=new Fe((I.cmp(T)<0)+0);break;case W.OP_GREATERTHAN:w=new Fe((I.cmp(T)>0)+0);break;case W.OP_LESSTHANOREQUAL:w=new Fe((I.cmp(T)<=0)+0);break;case W.OP_GREATERTHANOREQUAL:w=new Fe((I.cmp(T)>=0)+0);break;case W.OP_MIN:w=I.cmp(T)<0?I:T;break;case W.OP_MAX:w=I.cmp(T)>0?I:T;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(w.toScriptNumBuffer()),ce===W.OP_NUMEQUALVERIFY)if(j.castToBool(this.stack[this.stack.length-1]))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1}break;case W.OP_WITHIN:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;I=Fe.fromScriptNumBuffer(this.stack[this.stack.length-3],e),T=Fe.fromScriptNumBuffer(this.stack[this.stack.length-2],e);var f=Fe.fromScriptNumBuffer(this.stack[this.stack.length-1],e);$=T.cmp(I)<=0&&I.cmp(f)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push($?j.true:j.false)}break;case W.OP_RIPEMD160:case W.OP_SHA1:case W.OP_SHA256:case W.OP_HASH160:case W.OP_HASH256:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=this.stack[this.stack.length-1];var c;ce===W.OP_RIPEMD160?c=pc.ripemd160(r):ce===W.OP_SHA1?c=pc.sha1(r):ce===W.OP_SHA256?c=pc.sha256(r):ce===W.OP_HASH160?c=pc.sha256ripemd160(r):ce===W.OP_HASH256&&(c=pc.sha256sha256(r)),this.stack.pop(),this.stack.push(c)}break;case W.OP_CODESEPARATOR:this.pbegincodehash=this.pc,this.execdata.codeseparatorPos=this.pc-1;break;case W.OP_CHECKSIG:case W.OP_CHECKSIGVERIFY:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;N=this.stack[this.stack.length-2],C=this.stack[this.stack.length-1];let{success:A,result:D}=this._evalCheckSig(N,C);if(!D)return!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(A?j.true:j.false),ce===W.OP_CHECKSIGVERIFY)if(A)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1}break;case W.OP_CHECKSIGADD:{if(this.sigversion==_t.Version.BASE||this.sigversion==_t.Version.WITNESS_V0)return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1;if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let A=this.stack[this.stack.length-3],D=this.stack[this.stack.length-2],V=this.stack[this.stack.length-1];D=Fe.fromScriptNumBuffer(D,e);let{success:Y,result:se}=this._evalCheckSig(A,V);if(!se)return!1;this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(D.addn(Y?1:0).toScriptNumBuffer())}break;case W.OP_CHECKMULTISIG:case W.OP_CHECKMULTISIGVERIFY:{var p=1;if(this.stack.length<p)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var v=Fe.fromScriptNumBuffer(this.stack[this.stack.length-p],e).toNumber();if(v<0||v>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=v,this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var g=++p;p+=v;var x=v+2;if(this.stack.length<p)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var S=Fe.fromScriptNumBuffer(this.stack[this.stack.length-p],e).toNumber();if(S<0||S>v)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var b=++p;if(p+=S,this.stack.length<p)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;B=new yn().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var l=0;l<S;l++)N=this.stack[this.stack.length-b-l],B.findAndDelete(new yn().add(N));for(H=!0;H&&S>0;){if(N=this.stack[this.stack.length-b],C=this.stack[this.stack.length-g],!this.checkSignatureEncoding(N)||!this.checkPubkeyEncoding(C))return!1;var d;try{U=_t.fromTxFormat(N),Z=ku.fromBuffer(C,!1),d=this.tx.verifySignature(U,Z,this.nin,B,this.sigversion,this.satoshis,this.execdata)}catch{d=!1}d&&(b++,S--),g++,v--,S>v&&(H=!1)}for(;p-- >1;){if(!H&&this.flags&j.SCRIPT_VERIFY_NULLFAIL&&!x&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;x>0&&x--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&j.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(H?j.true:j.false),ce===W.OP_CHECKMULTISIGVERIFY)if(H)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1}break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return this.stack.length+this.altstack.length>j.MAX_STACK_SIZE?(this.errstr="SCRIPT_ERR_STACK_SIZE",!1):!0}});var Li=X((hX,ux)=>{ux.exports=Pg();ux.exports.Interpreter=qg()});var Vn=X((dX,_I)=>{"use strict";var xd=Et(),ma=xt(),VL=Yi(),xI=du(),gl=a3(),Ui=io(),bd=Dr(),bI=Rr(),fx=jn();function ue(e,t,r,i){if(!(this instanceof ue))return new ue(e,t,r);if(xd.isArray(e)&&xd.isNumber(t))return ue.createMultisig(e,t,r,!1,i);if(e instanceof ue)return e;if(ma.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!Ui.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==ue.PayToPublicKeyHash&&r!==ue.PayToScriptHash&&r!==ue.PayToWitnessPublicKeyHash&&r!==ue.PayToWitnessScriptHash&&r!==ue.PayToTaproot)throw new TypeError('Third argument must be "pubkeyhash", "scripthash", "witnesspubkeyhash", "witnessscripthash", or "taproot".');var n=this._classifyArguments(e,t,r);return n.network=n.network||Ui.get(t)||Ui.defaultNetwork,n.type=n.type||r||ue.PayToPublicKeyHash,bI.defineImmutable(this,{hashBuffer:n.hashBuffer,network:n.network,type:n.type}),this}ue.prototype._classifyArguments=function(e,t,r){if((e instanceof Buffer||e instanceof Uint8Array)&&(e.length===20||e.length===32))return ue._transformHash(e,t,r);if((e instanceof Buffer||e instanceof Uint8Array)&&e.length>=21)return ue._transformBuffer(e,t,r);if(e instanceof fx)return ue._transformPublicKey(e,t,r);if(e instanceof hc)return ue._transformScript(e,t);if(typeof e=="string")return ue._transformString(e,t,r);if(xd.isObject(e))return ue._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};ue.PayToPublicKeyHash="pubkeyhash";ue.PayToScriptHash="scripthash";ue.PayToWitnessPublicKeyHash="witnesspubkeyhash";ue.PayToWitnessScriptHash="witnessscripthash";ue.PayToTaproot="taproot";ue._transformHash=function(e,t,r){var i={};if(!(e instanceof Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20&&e.length!==32)throw new TypeError("Address hashbuffers must be either 20 or 32 bytes.");return i.hashBuffer=e,i.network=Ui.get(t)||Ui.defaultNetwork,i.type=r,i};ue._transformObject=function(e){return ma.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),ma.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?Buffer.from(e.hash,"hex"):e.hashBuffer,network:Ui.get(e.network)||Ui.defaultNetwork,type:e.type}};ue._classifyFromVersion=function(e){var t={};if(e.length>21){var r=gl.decode(e.toString("utf8"));if(r.version!==0&&r.version!==1)throw new TypeError("Only witness v0 and v1 addresses are supported.");if(r.version===0)if(r.data.length===20)t.type=ue.PayToWitnessPublicKeyHash;else if(r.data.length===32)t.type=ue.PayToWitnessScriptHash;else throw new TypeError("Witness data must be either 20 or 32 bytes.");else if(r.version===1)if(r.data.length===32)t.type=ue.PayToTaproot;else throw new TypeError("Witness data must be 32 bytes for v1");t.network=Ui.get(r.prefix,"bech32prefix")}else{var i=Ui.get(e[0],"pubkeyhash"),n=Ui.get(e[0],"scripthash");i?(t.network=i,t.type=ue.PayToPublicKeyHash):n&&(t.network=n,t.type=ue.PayToScriptHash)}return t};ue._transformBuffer=function(e,t,r){var i={};if(!(e instanceof Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length<21)throw new TypeError("Address buffer is incorrect length.");var n=Ui.get(t),o=ue._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n.xpubkey!==o.network.xpubkey)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return e.length>21?i.hashBuffer=gl.decode(e.toString("utf8")).data:i.hashBuffer=e.slice(1),i.network=n||o.network,i.type=o.type,i};ue._transformPublicKey=function(e,t,r){var i={};if(!(e instanceof fx))throw new TypeError("Address must be an instance of PublicKey.");if(r&&r!==ue.PayToScriptHash&&r!==ue.PayToWitnessPublicKeyHash&&r!==ue.PayToPublicKeyHash&&r!==ue.PayToTaproot)throw new TypeError("Type must be either pubkeyhash, witnesspubkeyhash, scripthash, or taproot to transform public key.");if(!e.compressed&&(r===ue.PayToScriptHash||r===ue.PayToWitnessPublicKeyHash))throw new TypeError("Witness addresses must use compressed public keys.");return r===ue.PayToScriptHash?i.hashBuffer=bd.sha256ripemd160(hc.buildWitnessV0Out(e).toBuffer()):r===ue.PayToTaproot?i.hashBuffer=e.createTapTweak().tweakedPubKey:i.hashBuffer=bd.sha256ripemd160(e.toBuffer()),i.type=r||ue.PayToPublicKeyHash,i};ue._transformScript=function(e,t){ma.checkArgument(e instanceof hc,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new VL.Script.CantDeriveAddress(e);return r};ue.createMultisig=function(e,t,r,i,n){if(r=r||e[0].network||Ui.defaultNetwork,n&&n!==ue.PayToScriptHash&&n!==ue.PayToWitnessScriptHash)throw new TypeError("Type must be either scripthash or witnessscripthash to create multisig.");if(i||n===ue.PayToWitnessScriptHash){e=xd.map(e,fx);for(var o=0;o<e.length;o++)if(!e[o].compressed)throw new TypeError("Witness addresses must use compressed public keys.")}var u=hc.buildMultisigOut(e,t);return i?ue.payingTo(hc.buildWitnessMultisigOutFromScript(u),r):ue.payingTo(u,r,n)};ue._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length>100)throw new TypeError("address string is too long");if(t&&!Ui.get(t))throw new TypeError("Unknown network");e=e.trim();try{var n=ue._transformBuffer(Buffer.from(e,"utf8"),t,r);return n}catch(o){if(r===ue.PayToWitnessPublicKeyHash||r===ue.PayToWitnessScriptHash||r===ue.PayToTaproot)throw o}var i=xI.decode(e),n=ue._transformBuffer(i,t,r);return n};ue.fromPublicKey=function(e,t,r){var i=ue._transformPublicKey(e,t,r);return t=t||Ui.defaultNetwork,new ue(i.hashBuffer,t,i.type)};ue.fromPublicKeyHash=function(e,t){var r=ue._transformHash(e);return new ue(r.hashBuffer,t,ue.PayToPublicKeyHash)};ue.fromScriptHash=function(e,t,n){ma.checkArgument(e,"hash parameter is required");var i=ue._transformHash(e);if(n===ue.PayToWitnessScriptHash&&e.length!==32)throw new TypeError("Address hashbuffer must be exactly 32 bytes for v0 witness script hash.");var n=n||ue.PayToScriptHash;return new ue(i.hashBuffer,t,n)};ue.payingTo=function(e,t,n){ma.checkArgument(e,"script is required"),ma.checkArgument(e instanceof hc,"script must be instance of Script");var i;n===ue.PayToWitnessScriptHash?i=bd.sha256(e.toBuffer()):i=bd.sha256ripemd160(e.toBuffer());var n=n||ue.PayToScriptHash;return ue.fromScriptHash(i,t,n)};ue.fromScript=function(e,t){ma.checkArgument(e instanceof hc,"script must be a Script instance");var r=ue._transformScript(e,t);return new ue(r.hashBuffer,t,r.type)};ue.fromBuffer=function(e,t,r){var i=ue._transformBuffer(e,t,r);return new ue(i.hashBuffer,i.network,i.type)};ue.fromString=function(e,t,r){var i=ue._transformString(e,t,r);return new ue(i.hashBuffer,i.network,i.type)};ue.fromObject=function(t){ma.checkState(bI.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=Buffer.from(t.hash,"hex");return new ue(r,t.network,t.type)};ue.getValidationError=function(e,t,r){var i;try{new ue(e,t,r)}catch(n){i=n}return i};ue.isValid=function(e,t,r){return!ue.getValidationError(e,t,r)};ue.prototype.isPayToPublicKeyHash=function(){return this.type===ue.PayToPublicKeyHash};ue.prototype.isPayToScriptHash=function(){return this.type===ue.PayToScriptHash};ue.prototype.isPayToWitnessPublicKeyHash=function(){return this.type===ue.PayToWitnessPublicKeyHash};ue.prototype.isPayToWitnessScriptHash=function(){return this.type===ue.PayToWitnessScriptHash};ue.prototype.isPayToTaproot=function(){return this.type===ue.PayToTaproot};ue.prototype.toBuffer=function(){if(this.isPayToWitnessPublicKeyHash()||this.isPayToWitnessScriptHash())return Buffer.from(this.toString(),"utf8");var e=Buffer.from([this.network[this.type]]);return Buffer.concat([e,this.hashBuffer])};ue.prototype.toObject=ue.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};ue.prototype.toString=function(){if(this.isPayToWitnessPublicKeyHash()||this.isPayToWitnessScriptHash()||this.isPayToTaproot()){let e=this.network.bech32prefix,t=0,r=gl.encodings.BECH32;return this.isPayToTaproot()&&(t=1,r=gl.encodings.BECH32M),gl.encode(e,t,this.hashBuffer,r)}return xI.encode(this.toBuffer())};ue.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};_I.exports=ue;var hc=Li()});var xl=X((mX,yI)=>{"use strict";function dc(){}dc.getRandomBuffer=function(e){return process.browser?dc.getRandomBufferBrowser(e):dc.getRandomBufferNode(e)};dc.getRandomBufferNode=function(e){var t=require("crypto");return t.randomBytes(e)};dc.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var t=window.crypto;else if(window.msCrypto&&window.msCrypto.getRandomValues)var t=window.msCrypto;else throw new Error("window.crypto.getRandomValues not available");var r=new Uint8Array(e);t.getRandomValues(r);var i=Buffer.from(r);return i};dc.getPseudoRandomBuffer=function(e){for(var t=4294967296,r=Buffer.alloc(e),i,n=0;n<=e;n++){var o=Math.floor(n/4),u=n-o*4;u===0?(i=Math.random()*t,r[n]=i&255):r[n]=(i=i>>>8)&255}return r};yI.exports=dc});var ao=X((vX,EI)=>{"use strict";var _d=Et(),jL=Vn(),wI=du(),ga=Xr(),SI=Rr(),va=io(),yd=eo(),WL=jn(),KL=xl(),wd=xt(),GL=ca();function nt(e,t){if(!(this instanceof nt))return new nt(e,t);if(e instanceof nt)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new ga(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(yd.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return SI.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}nt.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?va.get(t):va.defaultNetwork};if(_d.isUndefined(e)||_d.isNull(e))r.bn=nt._getRandomBN();else if(e instanceof ga)r.bn=e;else if(e instanceof Buffer||e instanceof Uint8Array)r=nt._transformBuffer(e,t);else if(e.bn&&e.network)r=nt._transformObject(e);else if(!t&&va.get(e))r.bn=nt._getRandomBN(),r.network=va.get(e);else if(typeof e=="string")SI.isHexa(e)?r.bn=new ga(Buffer.from(e,"hex")):r=nt._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};nt._getRandomBN=function(){var e,t;do{var r=KL.getRandomBuffer(32);t=ga.fromBuffer(r),e=t.lt(yd.getN())}while(!e);return t};nt._transformBuffer=function(e,t){var r={};if(e.length===32)return nt._transformBNBuffer(e,t);if(r.network=va.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==va.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=ga.fromBuffer(e.slice(1,33)),r};nt._transformBNBuffer=function(e,t){var r={};return r.network=va.get(t)||va.defaultNetwork,r.bn=ga.fromBuffer(e),r.compressed=!1,r};nt._transformWIF=function(e,t){return nt._transformBuffer(wI.decode(e),t)};nt.fromBuffer=function(e,t){return new nt(e,t)};nt._transformObject=function(e){var t=new ga(e.bn,"hex"),r=va.get(e.network);return{bn:t,network:r,compressed:e.compressed}};nt.fromString=nt.fromWIF=function(e){return wd.checkArgument(_d.isString(e),"First argument is expected to be a string."),new nt(e)};nt.fromObject=function(e){return wd.checkArgument(_d.isObject(e),"First argument is expected to be an object."),new nt(e)};nt.fromRandom=function(e){var t=nt._getRandomBN();return new nt(t,e)};nt.getValidationError=function(e,t){var r;try{new nt(e,t)}catch(i){r=i}return r};nt.isValid=function(e,t){return e?!nt.getValidationError(e,t):!1};nt.prototype.toString=function(){return this.toBuffer().toString("hex")};nt.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=Buffer.concat([Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),Buffer.from([1])]):r=Buffer.concat([Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),wI.encode(r)};nt.prototype.toBigNumber=function(){return this.bn};nt.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};nt.prototype.toBufferNoPadding=function(){return this.bn.toBuffer()};nt.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=WL.fromPrivateKey(this)),this._pubkey};nt.prototype.toAddress=function(e,t){var r=this.toPublicKey();return jL.fromPublicKey(r,e||this.network,t)};nt.prototype.toObject=nt.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};nt.prototype.createTapTweak=function(e){let t=yd.getN(),r=yd.getG().mul(this.bn),i=r.y.isEven()?this.bn:t.sub(this.bn),n=new GL("TapTweak");n.write(r.x.toBuffer({size:32})),e&&(wd.checkArgument(Buffer.isBuffer(e)&&e.length===32,"merkleRoot must be 32 byte buffer"),n.write(e));let o=n.finalize();return wd.checkState(ga.fromBuffer(o).lt(t),"TapTweak hash failed secp256k1 order check"),{tweakedPrivKey:i.add(new ga(o)).mod(t).toBuffer({size:32})}};nt.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toString()+", network: "+this.network+e+">"};EI.exports=nt});var jn=X((gX,RI)=>{"use strict";var Gn=Xr(),po=eo(),$L=Dr(),II=Rr(),TI=io(),lx=Et(),Xi=xt(),YL=ca();function we(e,t){if(!(this instanceof we))return new we(e,t);if(Xi.checkArgument(e,"First argument is required, please include public key data."),e instanceof we)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),II.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||TI.defaultNetwork}),this}we.prototype._classifyArgs=function(e,t){var r={compressed:lx.isUndefined(t.compressed)||t.compressed};if(e instanceof po)r.point=e;else if(e.x&&e.y)r=we._transformObject(e);else if(typeof e=="string")r=we._transformDER(Buffer.from(e,"hex"));else if(we._isBuffer(e))r=we._transformDER(e);else if(we._isPrivateKey(e))r=we._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=lx.isUndefined(t.network)?void 0:TI.get(t.network)),r};we._isPrivateKey=function(e){var t=ao();return e instanceof t};we._isBuffer=function(e){return e instanceof Buffer||e instanceof Uint8Array};we._transformPrivateKey=function(e){Xi.checkArgument(we._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=po.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};we._transformDER=function(e,t){Xi.checkArgument(we._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r={};t=lx.isUndefined(t)?!0:t;var i,n,o,u;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),u=e.slice(33,65),o.length!==32||u.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new Gn(o),n=new Gn(u),r.point=new po(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new Gn(o),r=we._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new Gn(o),r=we._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};we._transformX=function(e,t){Xi.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=po.fromX(e,t),r};we._transformObject=function(e){var t=new Gn(e.x,"hex"),r=new Gn(e.y,"hex"),i=new po(t,r);return new we(i,{compressed:e.compressed})};we.fromPrivateKey=function(e){Xi.checkArgument(we._isPrivateKey(e),"Must be an instance of PrivateKey");var t=we._transformPrivateKey(e);return new we(t.point,{compressed:t.compressed,network:t.network})};we.fromBuffer=function(e,t){return Xi.checkArgument(we._isBuffer(e),"Must be a hex buffer of DER encoded public key or 32 byte X coordinate (taproot)"),e.length===32?we.fromX(!1,e):we.fromDER(e,t)};we.fromDER=function(e,t){Xi.checkArgument(we._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=we._transformDER(e,t);return new we(r.point,{compressed:r.compressed})};we.fromPoint=function(e,t){return Xi.checkArgument(e instanceof po,"First argument must be an instance of Point."),new we(e,{compressed:t})};we.fromString=function(e,t){var r=Buffer.from(e,t||"hex"),i=we._transformDER(r);return new we(i.point,{compressed:i.compressed})};we.fromX=function(e,t){var r=we._transformX(e,t);return new we(r.point,{compressed:r.compressed})};we.fromTaproot=function(e){return typeof e=="string"&&II.isHexaString(e)&&(e=Buffer.from(e,"hex")),Xi.checkArgument(Buffer.isBuffer(e),"hexBuf must be a hex string or buffer"),Xi.checkArgument(e.length===32,"Taproot public keys must be 32 bytes"),new we.fromX(!1,e)};we.isValidTaproot=function(e){try{return!!we.fromTaproot(e)}catch{return!1}};we.prototype.computeTapTweakHash=function(e){let t=new YL("TapTweak");t.write(this.point.x.toBuffer({size:32})),e&&(Xi.checkArgument(Buffer.isBuffer(e)&&e.length===32,"merkleRoot must be 32 byte buffer"),t.write(e));let r=t.finalize(),i=po.getN();return Xi.checkState(Gn.fromBuffer(r).lt(i),"TapTweak hash failed secp256k1 order check"),r};we.prototype.checkTapTweak=function(e,t,r){Buffer.isBuffer(e)&&(e=we.fromTaproot(e));let i=e.computeTapTweakHash(t),o=e.point.liftX().add(this.point.curve.g.mul(Gn.fromBuffer(i)));return this.point.x.eq(o.x)&&o.y.mod(new Gn(2)).eq(new Gn(r[0]&1))};we.prototype.createTapTweak=function(e){Xi.checkArgument(e==null||Buffer.isBuffer(e)&&e.length===32,"merkleRoot must be a 32 byte buffer");let t=this.computeTapTweakHash(e);t=new Gn(t);let r=this.point.liftX().add(po.getG().mul(t));return{parity:r.y.isEven()?0:1,tweakedPubKey:r.x.toBuffer()}};we.getValidationError=function(e){var t;try{new we(e)}catch(r){t=r}return t};we.isValid=function(e){return!we.getValidationError(e)};we.prototype.toObject=we.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};we.prototype.toBuffer=we.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=Buffer.from([3]):n=Buffer.from([2]),Buffer.concat([n,r])}else return n=Buffer.from([4]),Buffer.concat([n,r,i])};we.prototype._getID=function(){return $L.sha256ripemd160(this.toBuffer())};we.prototype.toAddress=function(e,t){var r=Vn();return r.fromPublicKey(this,e||this.network,t)};we.prototype.toString=function(){return this.toDER().toString("hex")};we.prototype.inspect=function(){return"<PublicKey: "+this.toString()+(this.compressed?"":", uncompressed")+">"};RI.exports=we});var fl=X((xX,dx)=>{"use strict";var Ji=Xr(),Sn=eo(),AI=di(),OI=jn(),ZL=xl(),ho=Dr(),kI=Yt(),px=xt(),XL=function(e,t,r){for(var i=0;i<4;i++){var n;try{n=hx(e,t,i)}catch(o){console.error(o);continue}if(n.point.eq(r.point))return t.i=i,t.compressed=r.compressed,t}throw new Error("Unable to find valid recovery factor")},hx=function(e,t,r){px.checkArgument(r===0||r===1||r===2||r===3,new Error("i must be equal to 0, 1, 2, or 3"));var i=Ji.fromBuffer(e),n=t.r,o=t.s,u=r&1,m=r>>1,_=Sn.getN(),w=Sn.getG(),I=m?n.add(_):n,T=Sn.fromX(u,I),N=T.mul(_);if(!N.isInfinity())throw new Error("nR is not a valid curve point");var C=i.neg().umod(_),B=n.invm(_),U=T.mul(o).add(w.mul(C)).mul(B),Z=OI.fromPoint(U,t.compressed);return Z},JL=function(e,t){return hx(e,t,t.i)},PI=function(){var e=Sn.getN(),t;do t=Ji.fromBuffer(ZL.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(Ji.Zero)));return t},NI=function(e,t,r){r||(r=0);var i=Buffer.alloc(32);i.fill(1);var n=Buffer.alloc(32);n.fill(0);var o=t.bn.toBuffer({size:32});n=ho.sha256hmac(Buffer.concat([i,Buffer.from([0]),o,e]),n),i=ho.sha256hmac(i,n),n=ho.sha256hmac(Buffer.concat([i,Buffer.from([1]),o,e]),n),i=ho.sha256hmac(i,n),i=ho.sha256hmac(i,n);for(var u=Ji.fromBuffer(i),m=Sn.getN(),_=0;_<r||!(u.lt(m)&&u.gt(Ji.Zero));_++)n=ho.sha256hmac(Buffer.concat([i,Buffer.from([0])]),n),i=ho.sha256hmac(i,n),i=ho.sha256hmac(i,n),u=Ji.fromBuffer(i);return u},BI=function(e){return e.gt(new Ji("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))&&(e=Sn.getN().sub(e)),e},QL=function(e,t,r){let{endian:i="big",randomK:n=!1}=r||{};px.checkState(kI.isBuffer(e)&&e.length===32,"hashbuf must be a 32 byte buffer"),px.checkState(t&&t.bn,"privkey must be a PrivateKey");var o=t.bn;e=Buffer.from(e),i==="little"&&e.reverse();var u=Ji.fromBuffer(e),m=Sn.getN(),_=Sn.getG(),w=0,I,T,N,C;do I=n?PI():NI(e,t,w),w++,T=_.mul(I),N=T.x.umod(m),C=I.invm(m).mul(u.add(o.mul(N))).umod(m);while(N.cmp(Ji.Zero)<=0||C.cmp(Ji.Zero)<=0);return C=BI(C),new AI({s:C,r:N,compressed:t.publicKey.compressed})},MI=function(e,t,r,i){let{endian:n="big"}=i||{};if(!kI.isBuffer(e)||e.length!==32)return"hashbuf must be a 32 byte buffer";var o=t.r,u=t.s;if(!(o.gt(Ji.Zero)&&o.lt(Sn.getN()))||!(u.gt(Ji.Zero)&&u.lt(Sn.getN())))return"r and s not in range";var m=Ji.fromBuffer(e,{endian:n}),_=Sn.getN(),w=u.invm(_),I=w.mul(m).umod(_),T=w.mul(o).umod(_),N=Sn.getG().mulAdd(I,r.point,T);if(N.isInfinity())return"p is infinity";if(N.getX().umod(_).cmp(o)!==0)return"Invalid signature"},eU=function(e,t,r,i){if(!r)throw new Error("pubkey required for signature verification");if(r=new OI(r),!t)throw new Error("signature required for verification");return t=new AI(t),!MI(e,t,r,i)};dx.exports={sign:QL,verify:eU,verificationError:MI,calci:XL,recoverPublicKey:JL};dx.exports.__testing__={getDeterministicK:NI,getPublicKey:hx,getRandomK:PI,toLowS:BI}});var DI=X((bX,UI)=>{"use strict";var CI=ri(),LI=xs(),tU=Xr(),$n=function e(t){if(!(this instanceof e))return new e(t);if(Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof tU){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};$n.prototype.set=function(e){return this.buf=e.buf||this.buf,this};$n.prototype.fromString=function(e){return this.set({buf:Buffer.from(e,"hex")}),this};$n.prototype.toString=function(){return this.buf.toString("hex")};$n.prototype.fromBuffer=function(e){return this.buf=e,this};$n.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};$n.prototype.fromBN=function(e){return this.buf=CI().writeVarintBN(e).concat(),this};$n.prototype.fromNumber=function(e){return this.buf=CI().writeVarintNum(e).concat(),this};$n.prototype.toBuffer=function(){return this.buf};$n.prototype.toBN=function(){return LI(this.buf).readVarintBN()};$n.prototype.toNumber=function(){return LI(this.buf).readVarintNum()};UI.exports=$n});var _l=X((yX,HI)=>{"use strict";var Sd=Et(),bl=Xr(),Pu=Yt(),Ed=xs(),rU=ri(),iU=Dr(),_X=Rr(),qI=xt(),nU=486604799,mt=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&qI.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};mt._from=function(t){var r={};if(Pu.isBuffer(t))r=mt._fromBufferReader(Ed(t));else if(Sd.isObject(t))r=mt._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};mt._fromObject=function(t){qI.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;Sd.isString(t.prevHash)&&(r=Pu.reverse(Buffer.from(t.prevHash,"hex"))),Sd.isString(t.merkleRoot)&&(i=Pu.reverse(Buffer.from(t.merkleRoot,"hex")));var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};mt.fromObject=function(t){var r=mt._fromObject(t);return new mt(r)};mt.fromRawBlock=function(t){Pu.isBuffer(t)||(t=Buffer.from(t,"binary"));var r=Ed(t);r.pos=mt.Constants.START_OF_HEADER;var i=mt._fromBufferReader(r);return new mt(i)};mt.fromBuffer=function(t){var r=mt._fromBufferReader(Ed(t));return new mt(r)};mt.fromString=function(t){var r=Buffer.from(t,"hex");return mt.fromBuffer(r)};mt._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};mt.fromBufferReader=function(t){var r=mt._fromBufferReader(t);return new mt(r)};mt.prototype.toObject=mt.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:Pu.reverse(this.prevHash).toString("hex"),merkleRoot:Pu.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};mt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};mt.prototype.toString=function(){return this.toBuffer().toString("hex")};mt.prototype.toBufferWriter=function(t){return t||(t=new rU),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};mt.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new bl(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new bl(2));return r};mt.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(nU).mul(new bl(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};mt.prototype._getHash=function(){var t=this.toBuffer();return iU.sha256sha256(t)};var FI={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=Ed(this._getHash()).readReverse().toString("hex")),this._id},set:Sd.noop};Object.defineProperty(mt.prototype,"id",FI);Object.defineProperty(mt.prototype,"hash",FI);mt.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+mt.Constants.MAX_TIME_OFFSET)};mt.prototype.validProofOfWork=function(){var t=new bl(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};mt.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};mt.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:2*60*60,LARGEST_HASH:new bl("10000000000000000000000000000000000000000000000000000000000000000","hex")};HI.exports=mt});var $I=X((wX,GI)=>{"use strict";var vx=Et(),VI=_l(),zI=Xr(),jI=Yt(),gx=xs(),sU=ri(),aU=Dr(),mx=vl(),WI=xt();function lt(e){return this instanceof lt?(vx.extend(this,lt._from(e)),this):new lt(e)}lt.MAX_BLOCK_SIZE=1e6;lt._from=function(t){var r={};if(jI.isBuffer(t))r=lt._fromBufferReader(gx(t));else if(vx.isObject(t))r=lt._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};lt._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof mx?r.push(n):r.push(mx().fromObject(n))});var i={header:VI.fromObject(t.header),transactions:r};return i};lt.fromObject=function(t){var r=lt._fromObject(t);return new lt(r)};lt._fromBufferReader=function(t){var r={};WI.checkState(!t.finished(),"No block data received"),r.header=VI.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(mx().fromBufferReader(t));return r};lt.fromBufferReader=function(t){WI.checkArgument(t,"br is required");var r=lt._fromBufferReader(t);return new lt(r)};lt.fromBuffer=function(t){return lt.fromBufferReader(new gx(t))};lt.fromString=function(t){var r=Buffer.from(t,"hex");return lt.fromBuffer(r)};lt.fromRawBlock=function(t){jI.isBuffer(t)||(t=Buffer.from(t,"binary"));var r=gx(t);r.pos=lt.Values.START_OF_BLOCK;var i=lt._fromBufferReader(r);return new lt(i)};lt.prototype.toObject=lt.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};lt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};lt.prototype.toString=function(){return this.toBuffer().toString("hex")};lt.prototype.toBufferWriter=function(t){t||(t=new sU),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};lt.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[lt.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};lt.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),u=Buffer.concat([t[r+n],t[r+o]]);t.push(aU.sha256sha256(u))}r+=i}return t};lt.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};lt.prototype.validMerkleRoot=function(){var t=new zI(this.header.merkleRoot.toString("hex"),"hex"),r=new zI(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};lt.prototype._getHash=function(){return this.header._getHash()};var KI={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:vx.noop};Object.defineProperty(lt.prototype,"id",KI);Object.defineProperty(lt.prototype,"hash",KI);lt.prototype.inspect=function(){return"<Block "+this.id+">"};lt.Values={START_OF_BLOCK:8,NULL_HASH:Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};GI.exports=lt});var yx=X((EX,XI)=>{"use strict";var mc=Et(),bx=_l(),_x=Yt(),ZI=xs(),oU=ri(),cU=Dr(),SX=Rr(),YI=vl(),xx=Yi(),vc=xt();function Sr(e){if(!(this instanceof Sr))return new Sr(e);var t={};if(_x.isBuffer(e))t=Sr._fromBufferReader(ZI(e));else if(mc.isObject(e)){var r;e.header instanceof bx?r=e.header:r=bx.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return mc.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}Sr.fromBuffer=function(t){return Sr.fromBufferReader(ZI(t))};Sr.fromBufferReader=function(t){return new Sr(Sr._fromBufferReader(t))};Sr.prototype.toBuffer=function(){return this.toBufferWriter().concat()};Sr.prototype.toBufferWriter=function(t){t||(t=new oU),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};Sr.prototype.toObject=Sr.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};Sr.prototype.validMerkleTree=function(){if(vc.checkState(mc.isArray(this.flags),"MerkleBlock flags is not an array"),vc.checkState(mc.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:_x.equals(i,this.header.merkleRoot)};Sr.prototype.filterdTxsHash=function(){if(vc.checkState(mc.isArray(this.flags),"MerkleBlock flags is not an array"),vc.checkState(mc.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new xx.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new xx.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new xx.MerkleBlock.InvalidMerkleTree;return i};Sr.prototype._traverseMerkleTree=function(t,r,i,o){i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0;var o=o||!1;if(i.flagBitsUsed>this.flags.length*8)return null;var u=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!u){if(i.hashesUsed>=this.hashes.length)return null;var m=this.hashes[i.hashesUsed++];return t===0&&u&&i.txs.push(m),Buffer.from(m,"hex")}else{var _=this._traverseMerkleTree(t-1,r*2,i),w=_;return r*2+1<this._calcTreeWidth(t-1)&&(w=this._traverseMerkleTree(t-1,r*2+1,i)),o?i.txs:cU.sha256sha256(new Buffer.concat([_,w]))}};Sr.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};Sr.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};Sr.prototype.hasTransaction=function(t){vc.checkArgument(!mc.isUndefined(t),"tx cannot be undefined"),vc.checkArgument(t instanceof YI||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof YI&&(r=_x.reverse(Buffer.from(t.id,"hex")).toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};Sr._fromBufferReader=function(t){vc.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=bx.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};Sr.fromObject=function(t){return new Sr(t)};XI.exports=Sr});var JI=X((IX,Id)=>{Id.exports=$I();Id.exports.BlockHeader=_l();Id.exports.MerkleBlock=yx()});var Sx=X((TX,sT)=>{"use strict";var qr=Et(),eT=xt(),tT=Xr(),uU=ol(),Td=du(),rT=Dr(),Rd=Ex(),gc=io(),wx=eo(),iT=jn(),nT=Yi(),yl=nT,Yn=nT.HDPublicKey,Ad=require("assert"),QI=Rr(),Nt=Yt();function ne(e){if(e instanceof ne)return e;if(!(this instanceof ne))return new ne(e);if(e)if(qr.isString(e)||Nt.isBuffer(e)){var t=ne.getSerializedError(e);if(t){if(Nt.isBuffer(e)&&!ne.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof Yn.ArgumentIsPrivateExtended)return new Rd(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(qr.isObject(e))return e instanceof Rd?this._buildFromPrivate(e):this._buildFromObject(e);throw new Yn.UnrecognizedArgument(e)}else throw new Yn.MustSupplyArgument}ne.isValidPath=function(e){if(qr.isString(e)){var t=Rd._getDerivationIndexes(e);return t!==null&&qr.every(t,ne.isValidPath)}return qr.isNumber(e)?e>=0&&e<ne.Hardened:!1};ne.prototype.derive=function(e,t){return this.deriveChild(e,t)};ne.prototype.deriveChild=function(e,t){if(qr.isNumber(e))return this._deriveWithNumber(e,t);if(qr.isString(e))return this._deriveFromString(e);throw new Yn.InvalidDerivationArgument(e)};ne.prototype._deriveWithNumber=function(e,t){if(e>=ne.Hardened||t)throw new Yn.InvalidIndexCantDeriveHardened;if(e<0)throw new Yn.InvalidPath(e);var r=Nt.integerAsBuffer(e),i=Nt.concat([this.publicKey.toBuffer(),r]),n=rT.sha512hmac(i,this._buffers.chainCode),o=tT.fromBuffer(n.slice(0,32),{size:32}),u=n.slice(32,64),m;try{m=iT.fromPoint(wx.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var _=new ne({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:u,publicKey:m});return _};ne.prototype._deriveFromString=function(e){if(qr.includes(e,"'"))throw new Yn.InvalidIndexCantDeriveHardened;if(!ne.isValidPath(e))throw new Yn.InvalidPath(e);var t=Rd._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};ne.isValidSerialized=function(e,t){return qr.isNull(ne.getSerializedError(e,t))};ne.getSerializedError=function(e,t){if(!(qr.isString(e)||Nt.isBuffer(e)))return new Yn.UnrecognizedArgument("expected buffer or string");if(!uU.validCharacters(e))return new yl.InvalidB58Char("(unknown)",e);try{e=Td.decode(e)}catch{return new yl.InvalidB58Checksum(e)}if(e.length!==ne.DataSize)return new Yn.InvalidLength(e);if(!qr.isUndefined(t)){var r=ne._validateNetwork(e,t);if(r)return r}var i=Nt.integerFromBuffer(e.slice(0,4));return i===gc.livenet.xprivkey||i===gc.testnet.xprivkey?new Yn.ArgumentIsPrivateExtended:null};ne._validateNetwork=function(e,t){var r=gc.get(t);if(!r)return new yl.InvalidNetworkArgument(t);var i=e.slice(ne.VersionStart,ne.VersionEnd);return Nt.integerFromBuffer(i)!==r.xpubkey?new yl.InvalidNetwork(i):null};ne.prototype._buildFromPrivate=function(e){var t=qr.clone(e._buffers),r=wx.getG().mul(tT.fromBuffer(t.privateKey));return t.publicKey=wx.pointToCompressed(r),t.version=Nt.integerAsBuffer(gc.get(Nt.integerFromBuffer(t.version)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};ne.prototype._buildFromObject=function(e){var t={version:e.network?Nt.integerAsBuffer(gc.get(e.network).xpubkey):e.version,depth:qr.isNumber(e.depth)?Nt.integerAsSingleByteBuffer(e.depth):e.depth,parentFingerPrint:qr.isNumber(e.parentFingerPrint)?Nt.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:qr.isNumber(e.childIndex)?Nt.integerAsBuffer(e.childIndex):e.childIndex,chainCode:qr.isString(e.chainCode)?Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:qr.isString(e.publicKey)?Buffer.from(e.publicKey,"hex"):Nt.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:qr.isNumber(e.checksum)?Nt.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};ne.prototype._buildFromSerialized=function(e){var t=Td.decode(e),r={version:t.slice(ne.VersionStart,ne.VersionEnd),depth:t.slice(ne.DepthStart,ne.DepthEnd),parentFingerPrint:t.slice(ne.ParentFingerPrintStart,ne.ParentFingerPrintEnd),childIndex:t.slice(ne.ChildIndexStart,ne.ChildIndexEnd),chainCode:t.slice(ne.ChainCodeStart,ne.ChainCodeEnd),publicKey:t.slice(ne.PublicKeyStart,ne.PublicKeyEnd),checksum:t.slice(ne.ChecksumStart,ne.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};ne.prototype._buildFromBuffers=function(e){ne._validateBufferArguments(e),QI.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=Nt.concat(t),i=Td.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new yl.InvalidB58Checksum(r,i);var n=gc.get(Nt.integerFromBuffer(e.version)),o;o=Td.encode(Nt.concat(t)),e.xpubkey=Buffer.from(o);var u=new iT(e.publicKey,{network:n}),m=ne.ParentFingerPrintSize,_=rT.sha256ripemd160(u.toBuffer()).slice(0,m);return QI.defineImmutable(this,{xpubkey:o,network:n,depth:Nt.integerFromSingleByteBuffer(e.depth),publicKey:u,fingerPrint:_}),this};ne._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Ad(Nt.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),Ad(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",ne.VersionSize),t("depth",ne.DepthSize),t("parentFingerPrint",ne.ParentFingerPrintSize),t("childIndex",ne.ChildIndexSize),t("chainCode",ne.ChainCodeSize),t("publicKey",ne.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",ne.CheckSumSize)};ne.fromString=function(e){return eT.checkArgument(qr.isString(e),"No valid string was provided"),new ne(e)};ne.fromObject=function(e){return eT.checkArgument(qr.isObject(e),"No valid argument was provided"),new ne(e)};ne.prototype.toString=function(){return this.xpubkey};ne.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};ne.prototype.toObject=ne.prototype.toJSON=function(){return{network:gc.get(Nt.integerFromBuffer(this._buffers.version)).name,depth:Nt.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:Nt.integerFromBuffer(this.fingerPrint),parentFingerPrint:Nt.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:Nt.integerFromBuffer(this._buffers.childIndex),chainCode:Nt.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:Nt.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}};ne.fromBuffer=function(e){return new ne(e)};ne.prototype.toBuffer=function(){return Nt.copy(this._buffers.xpubkey)};ne.Hardened=2147483648;ne.RootElementAlias=["m","M"];ne.VersionSize=4;ne.DepthSize=1;ne.ParentFingerPrintSize=4;ne.ChildIndexSize=4;ne.ChainCodeSize=32;ne.PublicKeySize=33;ne.CheckSumSize=4;ne.DataSize=78;ne.SerializedByteSize=82;ne.VersionStart=0;ne.VersionEnd=ne.VersionStart+ne.VersionSize;ne.DepthStart=ne.VersionEnd;ne.DepthEnd=ne.DepthStart+ne.DepthSize;ne.ParentFingerPrintStart=ne.DepthEnd;ne.ParentFingerPrintEnd=ne.ParentFingerPrintStart+ne.ParentFingerPrintSize;ne.ChildIndexStart=ne.ParentFingerPrintEnd;ne.ChildIndexEnd=ne.ChildIndexStart+ne.ChildIndexSize;ne.ChainCodeStart=ne.ChildIndexEnd;ne.ChainCodeEnd=ne.ChainCodeStart+ne.ChainCodeSize;ne.PublicKeyStart=ne.ChainCodeEnd;ne.PublicKeyEnd=ne.PublicKeyStart+ne.PublicKeySize;ne.ChecksumStart=ne.PublicKeyEnd;ne.ChecksumEnd=ne.ChecksumStart+ne.CheckSumSize;Ad(ne.PublicKeyEnd===ne.DataSize);Ad(ne.ChecksumEnd===ne.SerializedByteSize);sT.exports=ne});var Ex=X((RX,lT)=>{"use strict";var Od=require("assert"),aT=require("buffer"),Nr=Et(),cT=xt(),uT=Xr(),fU=ol(),wl=du(),Ix=Dr(),xc=io(),lU=eo(),fT=ao(),pU=xl(),Nu=Yi(),_s=Nu.HDPrivateKey,dr=Yt(),Sl=Rr(),hU=128,oT=1/8,dU=512;function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(!e)return this._generateRandomly();if(xc.get(e))return this._generateRandomly(e);if(Nr.isString(e)||dr.isBuffer(e))if(J.isValidSerialized(e))this._buildFromSerialized(e);else if(Sl.isValidJSON(e))this._buildFromJSON(e);else if(dr.isBuffer(e)&&J.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw J.getSerializedError(e);else if(Nr.isObject(e))this._buildFromObject(e);else throw new _s.UnrecognizedArgument(e)}J.isValidPath=function(e,t){if(Nr.isString(e)){var r=J._getDerivationIndexes(e);return r!==null&&Nr.every(r,J.isValidPath)}return Nr.isNumber(e)?(e<J.Hardened&&t===!0&&(e+=J.Hardened),e>=0&&e<J.MaxIndex):!1};J._getDerivationIndexes=function(e){var t=e.split("/");if(Nr.includes(J.RootElementAlias,e))return[];if(!Nr.includes(J.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=J.Hardened),o});return Nr.some(r,isNaN)?null:r};J.prototype.derive=function(e,t){return this.deriveNonCompliantChild(e,t)};J.prototype.deriveChild=function(e,t){if(Nr.isNumber(e))return this._deriveWithNumber(e,t);if(Nr.isString(e))return this._deriveFromString(e);throw new _s.InvalidDerivationArgument(e)};J.prototype.deriveNonCompliantChild=function(e,t){if(Nr.isNumber(e))return this._deriveWithNumber(e,t,!0);if(Nr.isString(e))return this._deriveFromString(e,!0);throw new _s.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t,r){if(!J.isValidPath(e,t))throw new _s.InvalidPath(e);t=e>=J.Hardened?!0:t,e<J.Hardened&&t===!0&&(e+=J.Hardened);var i=dr.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=dr.concat([Buffer.from([0]),o,i])}else if(t){var u=this.privateKey.bn.toBuffer({size:32});Od(u.length===32,"length of private key buffer is expected to be 32 bytes"),n=dr.concat([Buffer.from([0]),u,i])}else n=dr.concat([this.publicKey.toBuffer(),i]);var m=Ix.sha512hmac(n,this._buffers.chainCode),_=uT.fromBuffer(m.slice(0,32),{size:32}),w=m.slice(32,64),I=_.add(this.privateKey.toBigNumber()).umod(lU.getN()).toBuffer({size:32});if(!fT.isValid(I))return this._deriveWithNumber(e+1,null,r);var T=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:w,privateKey:I});return T};J.prototype._deriveFromString=function(e,t){if(!J.isValidPath(e))throw new _s.InvalidPath(e);var r=J._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};J.isValidSerialized=function(e,t){return!J.getSerializedError(e,t)};J.getSerializedError=function(e,t){if(!(Nr.isString(e)||dr.isBuffer(e)))return new _s.UnrecognizedArgument("Expected string or buffer");if(!fU.validCharacters(e))return new Nu.InvalidB58Char("(unknown)",e);try{e=wl.decode(e)}catch{return new Nu.InvalidB58Checksum(e)}if(e.length!==J.DataLength)return new _s.InvalidLength(e);if(!Nr.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}return null};J._validateNetwork=function(e,t){var r=xc.get(t);if(!r)return new Nu.InvalidNetworkArgument(t);var i=e.slice(0,4);return dr.integerFromBuffer(i)!==r.xprivkey?new Nu.InvalidNetwork(i):null};J.fromString=function(e){return cT.checkArgument(Nr.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return cT.checkArgument(Nr.isObject(e),"No valid argument was provided"),new J(e)};J.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};J.prototype._buildFromObject=function(e){var t={version:e.network?dr.integerAsBuffer(xc.get(e.network).xprivkey):e.version,depth:Nr.isNumber(e.depth)?dr.integerAsSingleByteBuffer(e.depth):e.depth,parentFingerPrint:Nr.isNumber(e.parentFingerPrint)?dr.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Nr.isNumber(e.childIndex)?dr.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Nr.isString(e.chainCode)?Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:Nr.isString(e.privateKey)&&Sl.isHexa(e.privateKey)?Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:dr.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=wl.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),privateKey:t.slice(J.PrivateKeyStart,J.PrivateKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};J.prototype._generateRandomly=function(e){return J.fromSeed(pU.getRandomBuffer(64),e)};J.fromSeed=function(e,t){if(Sl.isHexaString(e)&&(e=Buffer.from(e,"hex")),!Buffer.isBuffer(e))throw new _s.InvalidEntropyArgument(e);if(e.length<hU*oT)throw new _s.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>dU*oT)throw new _s.InvalidEntropyArgument.TooMuchEntropy(e);var r=Ix.sha512hmac(e,Buffer.from("Bitcoin seed"));return new J({network:xc.get(t)||xc.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};J.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=Sx();this._hdPublicKey=new e(this)}};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),Sl.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,dr.emptyBuffer(1),e.privateKey],r=aT.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=wl.checksum(r);else if(e.checksum.toString()!==wl.checksum(r).toString())throw new Nu.InvalidB58Checksum(r);var i=xc.get(dr.integerFromBuffer(e.version)),n;n=wl.encode(aT.Buffer.concat(t)),e.xprivkey=Buffer.from(n);var o=new fT(uT.fromBuffer(e.privateKey),i),u=o.toPublicKey(),m=J.ParentFingerPrintSize,_=Ix.sha256ripemd160(u.toBuffer()).slice(0,m);return Sl.defineImmutable(this,{xprivkey:n,network:i,depth:dr.integerFromSingleByteBuffer(e.depth),privateKey:o,publicKey:u,fingerPrint:_}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Od(dr.isBuffer(n),r+" argument is not a buffer"),Od(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("privateKey",J.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.prototype.toString=function(){return this.xprivkey};J.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:xc.get(dr.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:dr.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:dr.integerFromBuffer(this.fingerPrint),parentFingerPrint:dr.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:dr.integerFromBuffer(this._buffers.childIndex),chainCode:dr.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:dr.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}};J.fromBuffer=function(e){return new J(e.toString())};J.prototype.toBuffer=function(){return dr.copy(this._buffers.xprivkey)};J.DefaultDepth=0;J.DefaultFingerprint=0;J.DefaultChildIndex=0;J.Hardened=2147483648;J.MaxIndex=2*J.Hardened;J.RootElementAlias=["m","M","m'","M'"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PrivateKeySize=32;J.CheckSumSize=4;J.DataLength=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PrivateKeyStart=J.ChainCodeEnd+1;J.PrivateKeyEnd=J.PrivateKeyStart+J.PrivateKeySize;J.ChecksumStart=J.PrivateKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;Od(J.ChecksumEnd===J.SerializedByteSize);lT.exports=J});var dT=X((OX,hT)=>{"use strict";var El=Et(),mU=ao(),vU=jn(),kd=Vn(),pT=ri(),Il=fl(),Tx=di(),gU=Dr().sha256sha256,xU=Rr(),mo=xt();function Fr(e){return this instanceof Fr?(mo.checkArgument(El.isString(e),"First argument should be a string"),this.message=e,this):new Fr(e)}Fr.MAGIC_BYTES=Buffer.from(`Bitcoin Signed Message:
30
+ `);Fr.prototype.magicHash=function(){var t=pT.varintBufNum(Fr.MAGIC_BYTES.length),r=Buffer.from(this.message),i=pT.varintBufNum(r.length),n=Buffer.concat([t,Fr.MAGIC_BYTES,i,r]),o=gU(n);return o};Fr.prototype._sign=function(t){mo.checkArgument(t instanceof mU,"First argument should be an instance of PrivateKey");let r=this.magicHash(),i=Il.sign(r,t,{randomK:!0});return Il.calci(r,i,t.toPublicKey()),i};Fr.prototype.sign=function(t){var r=this._sign(t);return r.toCompact().toString("base64")};Fr.prototype._verify=function(t,r){mo.checkArgument(t instanceof vU,"First argument should be an instance of PublicKey"),mo.checkArgument(r instanceof Tx,"Second argument should be an instance of Signature");var i=this.magicHash(),n=Il.verify(i,r,t);return n||(this.error="The signature was invalid"),n};Fr.prototype.verify=function(t,r){mo.checkArgument(t),mo.checkArgument(r&&El.isString(r)),El.isString(t)&&(t=kd.fromString(t));var i=Tx.fromCompact(Buffer.from(r,"base64"));let n=this.magicHash();var o=Il.recoverPublicKey(n,i),u=kd.fromPublicKey(o,t.network);return t.toString()!==u.toString()?(this.error="The signature did not match the message digest",!1):this._verify(o,i)};Fr.prototype.recoverPublicKey=function(t,r){mo.checkArgument(t),mo.checkArgument(r&&El.isString(r)),El.isString(t)&&(t=kd.fromString(t));var i=Tx.fromCompact(Buffer.from(r,"base64"));let n=this.magicHash();var o=Il.recoverPublicKey(n,i),u=kd.fromPublicKey(o,t.network);return t.toString()!==u.toString()&&(this.error="The signature did not match the message digest"),o.toString()};Fr.fromString=function(e){return new Fr(e)};Fr.fromJSON=function(t){return xU.isValidJSON(t)&&(t=JSON.parse(t)),new Fr(t.message)};Fr.prototype.toObject=function(){return{message:this.message}};Fr.prototype.toJSON=function(){return JSON.stringify(this.toObject())};Fr.prototype.toString=function(){return this.message};Fr.prototype.inspect=function(){return"<Message: "+this.toString()+">"};hT.exports=Fr;var AX=Li()});var _T=X((kX,bT)=>{"use strict";var vT=Et(),gT=require("url"),mT=Vn(),xT=hd(),Br=function(e,t){if(!(this instanceof Br))return new Br(e,t);if(this.extras={},this.knownParams=t||[],this.address=this.network=this.amount=this.message=null,typeof e=="string"){var r=Br.parse(e);r.amount&&(r.amount=this._parseAmount(r.amount)),this._fromObject(r)}else if(typeof e=="object")this._fromObject(e);else throw new TypeError("Unrecognized data format.")};Br.fromString=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return new Br(t)};Br.fromObject=function(t){return new Br(t)};Br.isValid=function(e,t){try{new Br(e,t)}catch{return!1}return!0};Br.parse=function(e){var t=gT.parse(e,!0);if(t.protocol!=="bitcoin:")throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query};Br.Members=["address","amount","message","label","r"];Br.prototype._fromObject=function(e){if(!mT.isValid(e.address))throw new TypeError("Invalid bitcoin address");this.address=new mT(e.address),this.network=this.address.network,this.amount=e.amount;for(var t in e)if(!(t==="address"||t==="amount")){if(/^req-/.exec(t)&&this.knownParams.indexOf(t)===-1)throw Error("Unknown required argument "+t);var r=Br.Members.indexOf(t)>-1?this:this.extras;r[t]=e[t]}};Br.prototype._parseAmount=function(e){if(e=Number(e),isNaN(e))throw new TypeError("Invalid amount");return xT.fromBTC(e).toSatoshis()};Br.prototype.toObject=Br.prototype.toJSON=function(){for(var t={},r=0;r<Br.Members.length;r++){var i=Br.Members[r];this.hasOwnProperty(i)&&typeof this[i]<"u"&&(t[i]=this[i].toString())}return vT.extend(t,this.extras),t};Br.prototype.toString=function(){var e={};return this.amount&&(e.amount=xT.fromSatoshis(this.amount).toBTC()),this.message&&(e.message=this.message),this.label&&(e.label=this.label),this.r&&(e.r=this.r),vT.extend(e,this.extras),gT.format({protocol:"bitcoin:",host:this.address,query:e})};Br.prototype.inspect=function(){return"<URI: "+this.toString()+">"};bT.exports=Br});var Rx=X((PX,yT)=>{"use strict";var Le=yT.exports;Le.version="v"+Vw().version;Le.versionGuard=function(e){if(e!==void 0){var t="More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.";throw new Error(t)}};Le.versionGuard(global._bitcore);global._bitcore=Le.version;Le.crypto={};Le.crypto.BN=Xr();Le.crypto.ECDSA=fl();Le.crypto.Schnorr=Mg();Le.crypto.Hash=Dr();Le.crypto.Random=xl();Le.crypto.Point=eo();Le.crypto.Signature=di();Le.crypto.TaggedHash=ca();Le.encoding={};Le.encoding.Base58=ol();Le.encoding.Base58Check=du();Le.encoding.BufferReader=xs();Le.encoding.BufferWriter=ri();Le.encoding.Varint=DI();Le.util={};Le.util.buffer=Yt();Le.util.js=Rr();Le.util.preconditions=xt();Le.errors=Yi();Le.Address=Vn();Le.Block=JI();Le.MerkleBlock=yx();Le.BlockHeader=_l();Le.HDPrivateKey=Ex();Le.HDPublicKey=Sx();Le.Message=dT();Le.Networks=io();Le.Opcode=Jh();Le.PrivateKey=ao();Le.PublicKey=jn();Le.Script=Li();Le.Transaction=vl();Le.URI=_T();Le.Unit=hd();Le.deps={};Le.deps.bnjs=zv();Le.deps.bs58=Ig();Le.deps.Buffer=Buffer;Le.deps.elliptic=bg();Le.deps._=Et();Le.Transaction.sighash=fa()});var ET=X((rJ,ST)=>{"use strict";var xa=wh();xa.createWebSocketStream=mv();xa.Server=Mv();xa.Receiver=vh();xa.Sender=gh();xa.WebSocket=xa;xa.WebSocketServer=xa.Server;ST.exports=xa});var TT=X((iJ,IT)=>{"use strict";IT.exports=ET()});var bU={};Oa(bU,{Provider:()=>Ln,assets:()=>Px,bitcore:()=>_U,models:()=>Nx,services:()=>Mx,types:()=>Fv,utils:()=>Ox});module.exports=B5(bU);function Yu(e,t){return function(){return e.apply(t,arguments)}}var{toString:M5}=Object.prototype,{getPrototypeOf:V0}=Object,gp=(e=>t=>{let r=M5.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),is=e=>(e=e.toLowerCase(),t=>gp(t)===e),xp=e=>t=>typeof t===e,{isArray:Bc}=Array,Zu=xp("undefined");function C5(e){return e!==null&&!Zu(e)&&e.constructor!==null&&!Zu(e.constructor)&&fn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var a1=is("ArrayBuffer");function L5(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&a1(e.buffer),t}var U5=xp("string"),fn=xp("function"),o1=xp("number"),bp=e=>e!==null&&typeof e=="object",D5=e=>e===!0||e===!1,vp=e=>{if(gp(e)!=="object")return!1;let t=V0(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},q5=is("Date"),F5=is("File"),H5=is("Blob"),z5=is("FileList"),V5=e=>bp(e)&&fn(e.pipe),j5=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||fn(e.append)&&((t=gp(e))==="formdata"||t==="object"&&fn(e.toString)&&e.toString()==="[object FormData]"))},W5=is("URLSearchParams"),K5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Xu(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),Bc(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let o=r?Object.getOwnPropertyNames(e):Object.keys(e),u=o.length,m;for(i=0;i<u;i++)m=o[i],t.call(null,e[m],m,e)}}function c1(e,t){t=t.toLowerCase();let r=Object.keys(e),i=r.length,n;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}var u1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,f1=e=>!Zu(e)&&e!==u1;function z0(){let{caseless:e}=f1(this)&&this||{},t={},r=(i,n)=>{let o=e&&c1(t,n)||n;vp(t[o])&&vp(i)?t[o]=z0(t[o],i):vp(i)?t[o]=z0({},i):Bc(i)?t[o]=i.slice():t[o]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&Xu(arguments[i],r);return t}var G5=(e,t,r,{allOwnKeys:i}={})=>(Xu(t,(n,o)=>{r&&fn(n)?e[o]=Yu(n,r):e[o]=n},{allOwnKeys:i}),e),$5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Y5=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Z5=(e,t,r,i)=>{let n,o,u,m={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),o=n.length;o-- >0;)u=n[o],(!i||i(u,e,t))&&!m[u]&&(t[u]=e[u],m[u]=!0);e=r!==!1&&V0(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},X5=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},J5=e=>{if(!e)return null;if(Bc(e))return e;let t=e.length;if(!o1(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Q5=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&V0(Uint8Array)),ek=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),n;for(;(n=i.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},tk=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},rk=is("HTMLFormElement"),ik=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),n1=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),nk=is("RegExp"),l1=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};Xu(r,(n,o)=>{let u;(u=t(n,o,e))!==!1&&(i[o]=u||n)}),Object.defineProperties(e,i)},sk=e=>{l1(e,(t,r)=>{if(fn(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(fn(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ak=(e,t)=>{let r={},i=n=>{n.forEach(o=>{r[o]=!0})};return Bc(e)?i(e):i(String(e).split(t)),r},ok=()=>{},ck=(e,t)=>(e=+e,Number.isFinite(e)?e:t),H0="abcdefghijklmnopqrstuvwxyz",s1="0123456789",p1={DIGIT:s1,ALPHA:H0,ALPHA_DIGIT:H0+H0.toUpperCase()+s1},uk=(e=16,t=p1.ALPHA_DIGIT)=>{let r="",{length:i}=t;for(;e--;)r+=t[Math.random()*i|0];return r};function fk(e){return!!(e&&fn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var lk=e=>{let t=new Array(10),r=(i,n)=>{if(bp(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;let o=Bc(i)?[]:{};return Xu(i,(u,m)=>{let _=r(u,n+1);!Zu(_)&&(o[m]=_)}),t[n]=void 0,o}}return i};return r(e,0)},pk=is("AsyncFunction"),hk=e=>e&&(bp(e)||fn(e))&&fn(e.then)&&fn(e.catch),z={isArray:Bc,isArrayBuffer:a1,isBuffer:C5,isFormData:j5,isArrayBufferView:L5,isString:U5,isNumber:o1,isBoolean:D5,isObject:bp,isPlainObject:vp,isUndefined:Zu,isDate:q5,isFile:F5,isBlob:H5,isRegExp:nk,isFunction:fn,isStream:V5,isURLSearchParams:W5,isTypedArray:Q5,isFileList:z5,forEach:Xu,merge:z0,extend:G5,trim:K5,stripBOM:$5,inherits:Y5,toFlatObject:Z5,kindOf:gp,kindOfTest:is,endsWith:X5,toArray:J5,forEachEntry:ek,matchAll:tk,isHTMLForm:rk,hasOwnProperty:n1,hasOwnProp:n1,reduceDescriptors:l1,freezeMethods:sk,toObjectSet:ak,toCamelCase:ik,noop:ok,toFiniteNumber:ck,findKey:c1,global:u1,isContextDefined:f1,ALPHABET:p1,generateString:uk,isSpecCompliantForm:fk,toJSONObject:lk,isAsyncFn:pk,isThenable:hk};function Mc(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n)}z.inherits(Mc,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var h1=Mc.prototype,d1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{d1[e]={value:e}});Object.defineProperties(Mc,d1);Object.defineProperty(h1,"isAxiosError",{value:!0});Mc.from=(e,t,r,i,n,o)=>{let u=Object.create(h1);return z.toFlatObject(e,u,function(_){return _!==Error.prototype},m=>m!=="isAxiosError"),Mc.call(u,e.message,t,r,i,n),u.cause=e,u.name=e.name,o&&Object.assign(u,o),u};var _e=Mc;var Z1=Mr(Y1(),1),wp=Z1.default;function em(e){return z.isPlainObject(e)||z.isArray(e)}function J1(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function X1(e,t,r){return e?e.concat(t).map(function(n,o){return n=J1(n),!r&&o?"["+n+"]":n}).join(r?".":""):t}function Zk(e){return z.isArray(e)&&!e.some(em)}var Xk=z.toFlatObject(z,{},null,function(t){return/^is[A-Z]/.test(t)});function Jk(e,t,r){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new(wp||FormData),r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(U,Z){return!z.isUndefined(Z[U])});let i=r.metaTokens,n=r.visitor||I,o=r.dots,u=r.indexes,_=(r.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(n))throw new TypeError("visitor must be a function");function w(B){if(B===null)return"";if(z.isDate(B))return B.toISOString();if(!_&&z.isBlob(B))throw new _e("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(B)||z.isTypedArray(B)?_&&typeof Blob=="function"?new Blob([B]):Buffer.from(B):B}function I(B,U,Z){let $=B;if(B&&!Z&&typeof B=="object"){if(z.endsWith(U,"{}"))U=i?U:U.slice(0,-2),B=JSON.stringify(B);else if(z.isArray(B)&&Zk(B)||(z.isFileList(B)||z.endsWith(U,"[]"))&&($=z.toArray(B)))return U=J1(U),$.forEach(function(ee,ce){!(z.isUndefined(ee)||ee===null)&&t.append(u===!0?X1([U],ce,o):u===null?U:U+"[]",w(ee))}),!1}return em(B)?!0:(t.append(X1(Z,U,o),w(B)),!1)}let T=[],N=Object.assign(Xk,{defaultVisitor:I,convertValue:w,isVisitable:em});function C(B,U){if(!z.isUndefined(B)){if(T.indexOf(B)!==-1)throw Error("Circular reference detected in "+U.join("."));T.push(B),z.forEach(B,function($,H){(!(z.isUndefined($)||$===null)&&n.call(t,$,z.isString(H)?H.trim():H,U,N))===!0&&C($,U?U.concat(H):[H])}),T.pop()}}if(!z.isObject(e))throw new TypeError("data must be an object");return C(e),t}var ka=Jk;function Q1(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function ey(e,t){this._pairs=[],e&&ka(e,this,t)}var ty=ey.prototype;ty.append=function(t,r){this._pairs.push([t,r])};ty.toString=function(t){let r=t?function(i){return t.call(this,i,Q1)}:Q1;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var ry=ey;function Qk(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Io(e,t,r){if(!t)return e;let i=r&&r.encode||Qk,n=r&&r.serialize,o;if(n?o=n(t,r):o=z.isURLSearchParams(t)?t.toString():new ry(t,r).toString(i),o){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var tm=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,function(i){i!==null&&t(i)})}},rm=tm;var Cc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var iy=Mr(require("url"),1),ny=iy.default.URLSearchParams;var sy={isNode:!0,classes:{URLSearchParams:ny,FormData:wp,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var im={};Oa(im,{hasBrowserEnv:()=>ay,hasStandardBrowserEnv:()=>eP,hasStandardBrowserWebWorkerEnv:()=>tP});var ay=typeof window<"u"&&typeof document<"u",eP=(e=>ay&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),tP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Vr={...im,...sy};function nm(e,t){return ka(e,new Vr.classes.URLSearchParams,Object.assign({visitor:function(r,i,n,o){return Vr.isNode&&z.isBuffer(r)?(this.append(i,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function rP(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function iP(e){let t={},r=Object.keys(e),i,n=r.length,o;for(i=0;i<n;i++)o=r[i],t[o]=e[o];return t}function nP(e){function t(r,i,n,o){let u=r[o++];if(u==="__proto__")return!0;let m=Number.isFinite(+u),_=o>=r.length;return u=!u&&z.isArray(n)?n.length:u,_?(z.hasOwnProp(n,u)?n[u]=[n[u],i]:n[u]=i,!m):((!n[u]||!z.isObject(n[u]))&&(n[u]=[]),t(r,i,n[u],o)&&z.isArray(n[u])&&(n[u]=iP(n[u])),!m)}if(z.isFormData(e)&&z.isFunction(e.entries)){let r={};return z.forEachEntry(e,(i,n)=>{t(rP(i),n,r,0)}),r}return null}var Sp=nP;function sP(e,t,r){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var sm={transitional:Cc,adapter:["xhr","http"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,o=z.isObject(t);if(o&&z.isHTMLForm(t)&&(t=new FormData(t)),z.isFormData(t))return n?JSON.stringify(Sp(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let m;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return nm(t,this.formSerializer).toString();if((m=z.isFileList(t))||i.indexOf("multipart/form-data")>-1){let _=this.env&&this.env.FormData;return ka(m?{"files[]":t}:t,_&&new _,this.formSerializer)}}return o||n?(r.setContentType("application/json",!1),sP(t)):t}],transformResponse:[function(t){let r=this.transitional||sm.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(t&&z.isString(t)&&(i&&!this.responseType||n)){let u=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(m){if(u)throw m.name==="SyntaxError"?_e.from(m,_e.ERR_BAD_RESPONSE,this,null,this.response):m}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{sm.headers[e]={}});var Lc=sm;var aP=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oy=e=>{let t={},r,i,n;return e&&e.split(`
31
31
  `).forEach(function(u){n=u.indexOf(":"),r=u.substring(0,n).trim().toLowerCase(),i=u.substring(n+1).trim(),!(!r||t[r]&&aP[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t};var cy=Symbol("internals");function Ju(e){return e&&String(e).trim().toLowerCase()}function Ep(e){return e===!1||e==null?e:z.isArray(e)?e.map(Ep):String(e)}function oP(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}var cP=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function am(e,t,r,i,n){if(z.isFunction(i))return i.call(this,t,r);if(n&&(t=r),!!z.isString(t)){if(z.isString(i))return t.indexOf(i)!==-1;if(z.isRegExp(i))return i.test(t)}}function uP(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function fP(e,t){let r=z.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(n,o,u){return this[i].call(this,t,n,o,u)},configurable:!0})})}var Uc=class{constructor(t){t&&this.set(t)}set(t,r,i){let n=this;function o(m,_,w){let I=Ju(_);if(!I)throw new Error("header name must be a non-empty string");let T=z.findKey(n,I);(!T||n[T]===void 0||w===!0||w===void 0&&n[T]!==!1)&&(n[T||_]=Ep(m))}let u=(m,_)=>z.forEach(m,(w,I)=>o(w,I,_));return z.isPlainObject(t)||t instanceof this.constructor?u(t,r):z.isString(t)&&(t=t.trim())&&!cP(t)?u(oy(t),r):t!=null&&o(r,t,i),this}get(t,r){if(t=Ju(t),t){let i=z.findKey(this,t);if(i){let n=this[i];if(!r)return n;if(r===!0)return oP(n);if(z.isFunction(r))return r.call(this,n,i);if(z.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ju(t),t){let i=z.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||am(this,this[i],i,r)))}return!1}delete(t,r){let i=this,n=!1;function o(u){if(u=Ju(u),u){let m=z.findKey(i,u);m&&(!r||am(i,i[m],m,r))&&(delete i[m],n=!0)}}return z.isArray(t)?t.forEach(o):o(t),n}clear(t){let r=Object.keys(this),i=r.length,n=!1;for(;i--;){let o=r[i];(!t||am(this,this[o],o,t,!0))&&(delete this[o],n=!0)}return n}normalize(t){let r=this,i={};return z.forEach(this,(n,o)=>{let u=z.findKey(i,o);if(u){r[u]=Ep(n),delete r[o];return}let m=t?uP(o):String(o).trim();m!==o&&delete r[o],r[m]=Ep(n),i[m]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return z.forEach(this,(i,n)=>{i!=null&&i!==!1&&(r[n]=t&&z.isArray(i)?i.join(", "):i)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
32
32
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let i=new this(t);return r.forEach(n=>i.set(n)),i}static accessor(t){let i=(this[cy]=this[cy]={accessors:{}}).accessors,n=this.prototype;function o(u){let m=Ju(u);i[m]||(fP(n,u),i[m]=!0)}return z.isArray(t)?t.forEach(o):o(t),this}};Uc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);z.reduceDescriptors(Uc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});z.freezeMethods(Uc);var jr=Uc;function Qu(e,t){let r=this||Lc,i=t||r,n=jr.from(i.headers),o=i.data;return z.forEach(e,function(m){o=m.call(r,o,n.normalize(),t?t.status:void 0)}),n.normalize(),o}function ef(e){return!!(e&&e.__CANCEL__)}function uy(e,t,r){_e.call(this,e??"canceled",_e.ERR_CANCELED,t,r),this.name="CanceledError"}z.inherits(uy,_e,{__CANCEL__:!0});var On=uy;function Pa(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new _e("Request failed with status code "+r.status,[_e.ERR_BAD_REQUEST,_e.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function om(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cm(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function To(e,t){return e&&!om(t)?cm(e,t):t}var Ny=Mr(ly(),1),By=Mr(require("http"),1),My=Mr(require("https"),1),Cy=Mr(require("util"),1),Ly=Mr(xy(),1),Vs=Mr(require("zlib"),1);var Ao="1.6.8";function of(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var RP=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function ym(e,t,r){let i=r&&r.Blob||Vr.classes.Blob,n=of(e);if(t===void 0&&i&&(t=!0),n==="data"){e=n.length?e.slice(n.length+1):e;let o=RP.exec(e);if(!o)throw new _e("Invalid URL",_e.ERR_INVALID_URL);let u=o[1],m=o[2],_=o[3],w=Buffer.from(decodeURIComponent(_),m?"base64":"utf8");if(t){if(!i)throw new _e("Blob is not supported",_e.ERR_NOT_SUPPORT);return new i([w],{type:u})}return w}throw new _e("Unsupported protocol "+n,_e.ERR_NOT_SUPPORT)}var Oo=Mr(require("stream"),1);var _y=Mr(require("stream"),1);function AP(e,t){let r=0,i=1e3/t,n=null;return function(u,m){let _=Date.now();if(u||_-r>i)return n&&(clearTimeout(n),n=null),r=_,e.apply(null,m);n||(n=setTimeout(()=>(n=null,r=Date.now(),e.apply(null,m)),i-(_-r)))}}var by=AP;function OP(e,t){e=e||10;let r=new Array(e),i=new Array(e),n=0,o=0,u;return t=t!==void 0?t:1e3,function(_){let w=Date.now(),I=i[o];u||(u=w),r[n]=_,i[n]=w;let T=o,N=0;for(;T!==n;)N+=r[T++],T=T%e;if(n=(n+1)%e,n===o&&(o=(o+1)%e),w-u<t)return;let C=I&&w-I;return C?Math.round(N*1e3/C):void 0}}var Ip=OP;var Tp=Symbol("internals"),wm=class extends _y.default.Transform{constructor(t){t=z.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(m,_)=>!z.isUndefined(_[m])),super({readableHighWaterMark:t.chunkSize});let r=this,i=this[Tp]={length:t.length,timeWindow:t.timeWindow,ticksRate:t.ticksRate,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},n=Ip(i.ticksRate*t.samplesCount,i.timeWindow);this.on("newListener",m=>{m==="progress"&&(i.isCaptured||(i.isCaptured=!0))});let o=0;i.updateProgress=by(function(){let _=i.length,w=i.bytesSeen,I=w-o;if(!I||r.destroyed)return;let T=n(I);o=w,process.nextTick(()=>{r.emit("progress",{loaded:w,total:_,progress:_?w/_:void 0,bytes:I,rate:T||void 0,estimated:T&&_&&w<=_?(_-w)/T:void 0})})},i.ticksRate);let u=()=>{i.updateProgress(!0)};this.once("end",u),this.once("error",u)}_read(t){let r=this[Tp];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,i){let n=this,o=this[Tp],u=o.maxRate,m=this.readableHighWaterMark,_=o.timeWindow,w=1e3/_,I=u/w,T=o.minChunkSize!==!1?Math.max(o.minChunkSize,I*.01):0;function N(B,U){let Z=Buffer.byteLength(B);o.bytesSeen+=Z,o.bytes+=Z,o.isCaptured&&o.updateProgress(),n.push(B)?process.nextTick(U):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(U)}}let C=(B,U)=>{let Z=Buffer.byteLength(B),$=null,H=m,ee,ce=0;if(u){let ge=Date.now();(!o.ts||(ce=ge-o.ts)>=_)&&(o.ts=ge,ee=I-o.bytes,o.bytes=ee<0?-ee:0,ce=0),ee=I-o.bytes}if(u){if(ee<=0)return setTimeout(()=>{U(null,B)},_-ce);ee<H&&(H=ee)}H&&Z>H&&Z-H>T&&($=B.subarray(H),B=B.subarray(0,H)),N(B,$?()=>{process.nextTick(U,null,$)}:U)};C(t,function B(U,Z){if(U)return i(U);Z?C(Z,B):i(null)})}setLength(t){return this[Tp].length=+t,this}},Sm=wm;var Uy=require("events");var wy=require("util"),Sy=require("stream");var{asyncIterator:yy}=Symbol,kP=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[yy]?yield*e[yy]():yield e},Rp=kP;var PP=z.ALPHABET.ALPHA_DIGIT+"-_",cf=new wy.TextEncoder,Na=`\r
33
33
  `,NP=cf.encode(Na),BP=2,Em=class{constructor(t,r){let{escapeName:i}=this.constructor,n=z.isString(r),o=`Content-Disposition: form-data; name="${i(t)}"${!n&&r.name?`; filename="${i(r.name)}"`:""}${Na}`;n?r=cf.encode(String(r).replace(/\r?\n|\r\n?/g,Na)):o+=`Content-Type: ${r.type||"application/octet-stream"}${Na}`,this.headers=cf.encode(o+Na),this.contentLength=n?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+BP,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;z.isTypedArray(t)?yield t:yield*Rp(t),yield NP}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},MP=(e,t,r)=>{let{tag:i="form-data-boundary",size:n=25,boundary:o=i+"-"+z.generateString(n,PP)}=r||{};if(!z.isFormData(e))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");let u=cf.encode("--"+o+Na),m=cf.encode("--"+o+"--"+Na+Na),_=m.byteLength,w=Array.from(e.entries()).map(([T,N])=>{let C=new Em(T,N);return _+=C.size,C});_+=u.byteLength*w.length,_=z.toFiniteNumber(_);let I={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(_)&&(I["Content-Length"]=_),t&&t(I),Sy.Readable.from(async function*(){for(let T of w)yield u,yield*T.encode();yield m}())},Ey=MP;var Iy=Mr(require("stream"),1),Im=class extends Iy.default.Transform{__transform(t,r,i){this.push(t),i()}_transform(t,r,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,r)}this.__transform(t,r,i)}},Ty=Im;var CP=(e,t)=>z.isAsyncFn(e)?function(...r){let i=r.pop();e.apply(this,r).then(n=>{try{t?i(null,...t(n)):i(null,n)}catch(o){i(o)}},i)}:e,Ry=CP;var Ay={flush:Vs.default.constants.Z_SYNC_FLUSH,finishFlush:Vs.default.constants.Z_SYNC_FLUSH},LP={flush:Vs.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Vs.default.constants.BROTLI_OPERATION_FLUSH},Oy=z.isFunction(Vs.default.createBrotliDecompress),{http:UP,https:DP}=Ly.default,qP=/https:?/,ky=Vr.protocols.map(e=>e+":");function FP(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function Dy(e,t,r){let i=t;if(!i&&i!==!1){let n=(0,Ny.getProxyForUrl)(r);n&&(i=new URL(n))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let o=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+o}e.headers.host=e.hostname+(e.port?":"+e.port:"");let n=i.hostname||i.host;e.hostname=n,e.host=n,e.port=i.port,e.path=r,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(o){Dy(o,t,o.href)}}var HP=typeof process<"u"&&z.kindOf(process)==="process",zP=e=>new Promise((t,r)=>{let i,n,o=(_,w)=>{n||(n=!0,i&&i(_,w))},u=_=>{o(_),t(_)},m=_=>{o(_,!0),r(_)};e(u,m,_=>i=_).catch(m)}),VP=({address:e,family:t})=>{if(!z.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},Py=(e,t)=>VP(z.isObject(e)?e:{address:e,family:t}),qy=HP&&function(t){return zP(async function(i,n,o){let{data:u,lookup:m,family:_}=t,{responseType:w,responseEncoding:I}=t,T=t.method.toUpperCase(),N,C=!1,B;if(m){let b=Ry(m,l=>z.isArray(l)?l:[l]);m=(l,d,A)=>{b(l,d,(D,V,Y)=>{if(D)return A(D);let se=z.isArray(V)?V.map(ae=>Py(ae)):[Py(V,Y)];d.all?A(D,se):A(D,se[0].address,se[0].family)})}}let U=new Uy.EventEmitter,Z=()=>{t.cancelToken&&t.cancelToken.unsubscribe($),t.signal&&t.signal.removeEventListener("abort",$),U.removeAllListeners()};o((b,l)=>{N=!0,l&&(C=!0,Z())});function $(b){U.emit("abort",!b||b.type?new On(null,t,B):b)}U.once("abort",n),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe($),t.signal&&(t.signal.aborted?$():t.signal.addEventListener("abort",$)));let H=To(t.baseURL,t.url),ee=new URL(H,"http://localhost"),ce=ee.protocol||ky[0];if(ce==="data:"){let b;if(T!=="GET")return Pa(i,n,{status:405,statusText:"method not allowed",headers:{},config:t});try{b=ym(t.url,w==="blob",{Blob:t.env&&t.env.Blob})}catch(l){throw _e.from(l,_e.ERR_BAD_REQUEST,t)}return w==="text"?(b=b.toString(I),(!I||I==="utf8")&&(b=z.stripBOM(b))):w==="stream"&&(b=Oo.default.Readable.from(b)),Pa(i,n,{data:b,status:200,statusText:"OK",headers:new jr,config:t})}if(ky.indexOf(ce)===-1)return n(new _e("Unsupported protocol "+ce,_e.ERR_BAD_REQUEST,t));let ge=jr.from(t.headers).normalize();ge.set("User-Agent","axios/"+Ao,!1);let Se=t.onDownloadProgress,me=t.onUploadProgress,O=t.maxRate,E,f;if(z.isSpecCompliantForm(u)){let b=ge.getContentType(/boundary=([-_\w\d]{10,70})/i);u=Ey(u,l=>{ge.set(l)},{tag:`axios-${Ao}-boundary`,boundary:b&&b[1]||void 0})}else if(z.isFormData(u)&&z.isFunction(u.getHeaders)){if(ge.set(u.getHeaders()),!ge.hasContentLength())try{let b=await Cy.default.promisify(u.getLength).call(u);Number.isFinite(b)&&b>=0&&ge.setContentLength(b)}catch{}}else if(z.isBlob(u))u.size&&ge.setContentType(u.type||"application/octet-stream"),ge.setContentLength(u.size||0),u=Oo.default.Readable.from(Rp(u));else if(u&&!z.isStream(u)){if(!Buffer.isBuffer(u))if(z.isArrayBuffer(u))u=Buffer.from(new Uint8Array(u));else if(z.isString(u))u=Buffer.from(u,"utf-8");else return n(new _e("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",_e.ERR_BAD_REQUEST,t));if(ge.setContentLength(u.length,!1),t.maxBodyLength>-1&&u.length>t.maxBodyLength)return n(new _e("Request body larger than maxBodyLength limit",_e.ERR_BAD_REQUEST,t))}let c=z.toFiniteNumber(ge.getContentLength());z.isArray(O)?(E=O[0],f=O[1]):E=f=O,u&&(me||E)&&(z.isStream(u)||(u=Oo.default.Readable.from(u,{objectMode:!1})),u=Oo.default.pipeline([u,new Sm({length:c,maxRate:z.toFiniteNumber(E)})],z.noop),me&&u.on("progress",b=>{me(Object.assign(b,{upload:!0}))}));let p;if(t.auth){let b=t.auth.username||"",l=t.auth.password||"";p=b+":"+l}if(!p&&ee.username){let b=ee.username,l=ee.password;p=b+":"+l}p&&ge.delete("authorization");let v;try{v=Io(ee.pathname+ee.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(b){let l=new Error(b.message);return l.config=t,l.url=t.url,l.exists=!0,n(l)}ge.set("Accept-Encoding","gzip, compress, deflate"+(Oy?", br":""),!1);let g={path:v,method:T,headers:ge.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:p,protocol:ce,family:_,beforeRedirect:FP,beforeRedirects:{}};!z.isUndefined(m)&&(g.lookup=m),t.socketPath?g.socketPath=t.socketPath:(g.hostname=ee.hostname,g.port=ee.port,Dy(g,t.proxy,ce+"//"+ee.hostname+(ee.port?":"+ee.port:"")+g.path));let x,S=qP.test(g.protocol);if(g.agent=S?t.httpsAgent:t.httpAgent,t.transport?x=t.transport:t.maxRedirects===0?x=S?My.default:By.default:(t.maxRedirects&&(g.maxRedirects=t.maxRedirects),t.beforeRedirect&&(g.beforeRedirects.config=t.beforeRedirect),x=S?DP:UP),t.maxBodyLength>-1?g.maxBodyLength=t.maxBodyLength:g.maxBodyLength=1/0,t.insecureHTTPParser&&(g.insecureHTTPParser=t.insecureHTTPParser),B=x.request(g,function(l){if(B.destroyed)return;let d=[l],A=+l.headers["content-length"];if(Se){let ae=new Sm({length:z.toFiniteNumber(A),maxRate:z.toFiniteNumber(f)});Se&&ae.on("progress",pe=>{Se(Object.assign(pe,{download:!0}))}),d.push(ae)}let D=l,V=l.req||B;if(t.decompress!==!1&&l.headers["content-encoding"])switch((T==="HEAD"||l.statusCode===204)&&delete l.headers["content-encoding"],(l.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":d.push(Vs.default.createUnzip(Ay)),delete l.headers["content-encoding"];break;case"deflate":d.push(new Ty),d.push(Vs.default.createUnzip(Ay)),delete l.headers["content-encoding"];break;case"br":Oy&&(d.push(Vs.default.createBrotliDecompress(LP)),delete l.headers["content-encoding"])}D=d.length>1?Oo.default.pipeline(d,z.noop):d[0];let Y=Oo.default.finished(D,()=>{Y(),Z()}),se={status:l.statusCode,statusText:l.statusMessage,headers:new jr(l.headers),config:t,request:V};if(w==="stream")se.data=D,Pa(i,n,se);else{let ae=[],pe=0;D.on("data",function(de){ae.push(de),pe+=de.length,t.maxContentLength>-1&&pe>t.maxContentLength&&(C=!0,D.destroy(),n(new _e("maxContentLength size of "+t.maxContentLength+" exceeded",_e.ERR_BAD_RESPONSE,t,V)))}),D.on("aborted",function(){if(C)return;let de=new _e("maxContentLength size of "+t.maxContentLength+" exceeded",_e.ERR_BAD_RESPONSE,t,V);D.destroy(de),n(de)}),D.on("error",function(de){B.destroyed||n(_e.from(de,null,t,V))}),D.on("end",function(){try{let de=ae.length===1?ae[0]:Buffer.concat(ae);w!=="arraybuffer"&&(de=de.toString(I),(!I||I==="utf8")&&(de=z.stripBOM(de))),se.data=de}catch(de){return n(_e.from(de,null,t,se.request,se))}Pa(i,n,se)})}U.once("abort",ae=>{D.destroyed||(D.emit("error",ae),D.destroy())})}),U.once("abort",b=>{n(b),B.destroy(b)}),B.on("error",function(l){n(_e.from(l,null,t,B))}),B.on("socket",function(l){l.setKeepAlive(!0,1e3*60)}),t.timeout){let b=parseInt(t.timeout,10);if(Number.isNaN(b)){n(new _e("error trying to parse `config.timeout` to int",_e.ERR_BAD_OPTION_VALUE,t,B));return}B.setTimeout(b,function(){if(N)return;let d=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",A=t.transitional||Cc;t.timeoutErrorMessage&&(d=t.timeoutErrorMessage),n(new _e(d,A.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,t,B)),$()})}if(z.isStream(u)){let b=!1,l=!1;u.on("end",()=>{b=!0}),u.once("error",d=>{l=!0,B.destroy(d)}),u.on("close",()=>{!b&&!l&&$(new On("Request stream has been aborted",t,B))}),u.pipe(B)}else B.end(u)})};var Fy=Vr.hasStandardBrowserEnv?{write(e,t,r,i,n,o){let u=[e+"="+encodeURIComponent(t)];z.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),z.isString(i)&&u.push("path="+i),z.isString(n)&&u.push("domain="+n),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var Hy=Vr.hasStandardBrowserEnv?function(){let t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function n(o){let u=o;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=n(window.location.href),function(u){let m=z.isString(u)?n(u):u;return m.protocol===i.protocol&&m.host===i.host}}():function(){return function(){return!0}}();function zy(e,t){let r=0,i=Ip(50,250);return n=>{let o=n.loaded,u=n.lengthComputable?n.total:void 0,m=o-r,_=i(m),w=o<=u;r=o;let I={loaded:o,total:u,progress:u?o/u:void 0,bytes:m,rate:_||void 0,estimated:_&&u&&w?(u-o)/_:void 0,event:n};I[t?"download":"upload"]=!0,e(I)}}var jP=typeof XMLHttpRequest<"u",Vy=jP&&function(e){return new Promise(function(r,i){let n=e.data,o=jr.from(e.headers).normalize(),{responseType:u,withXSRFToken:m}=e,_;function w(){e.cancelToken&&e.cancelToken.unsubscribe(_),e.signal&&e.signal.removeEventListener("abort",_)}let I;if(z.isFormData(n)){if(Vr.hasStandardBrowserEnv||Vr.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((I=o.getContentType())!==!1){let[U,...Z]=I?I.split(";").map($=>$.trim()).filter(Boolean):[];o.setContentType([U||"multipart/form-data",...Z].join("; "))}}let T=new XMLHttpRequest;if(e.auth){let U=e.auth.username||"",Z=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(U+":"+Z))}let N=To(e.baseURL,e.url);T.open(e.method.toUpperCase(),Io(N,e.params,e.paramsSerializer),!0),T.timeout=e.timeout;function C(){if(!T)return;let U=jr.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),$={data:!u||u==="text"||u==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:U,config:e,request:T};Pa(function(ee){r(ee),w()},function(ee){i(ee),w()},$),T=null}if("onloadend"in T?T.onloadend=C:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(C)},T.onabort=function(){T&&(i(new _e("Request aborted",_e.ECONNABORTED,e,T)),T=null)},T.onerror=function(){i(new _e("Network Error",_e.ERR_NETWORK,e,T)),T=null},T.ontimeout=function(){let Z=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",$=e.transitional||Cc;e.timeoutErrorMessage&&(Z=e.timeoutErrorMessage),i(new _e(Z,$.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,e,T)),T=null},Vr.hasStandardBrowserEnv&&(m&&z.isFunction(m)&&(m=m(e)),m||m!==!1&&Hy(N))){let U=e.xsrfHeaderName&&e.xsrfCookieName&&Fy.read(e.xsrfCookieName);U&&o.set(e.xsrfHeaderName,U)}n===void 0&&o.setContentType(null),"setRequestHeader"in T&&z.forEach(o.toJSON(),function(Z,$){T.setRequestHeader($,Z)}),z.isUndefined(e.withCredentials)||(T.withCredentials=!!e.withCredentials),u&&u!=="json"&&(T.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&T.addEventListener("progress",zy(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&T.upload&&T.upload.addEventListener("progress",zy(e.onUploadProgress)),(e.cancelToken||e.signal)&&(_=U=>{T&&(i(!U||U.type?new On(null,e,T):U),T.abort(),T=null)},e.cancelToken&&e.cancelToken.subscribe(_),e.signal&&(e.signal.aborted?_():e.signal.addEventListener("abort",_)));let B=of(N);if(B&&Vr.protocols.indexOf(B)===-1){i(new _e("Unsupported protocol "+B+":",_e.ERR_BAD_REQUEST,e));return}T.send(n||null)})};var Tm={http:qy,xhr:Vy};z.forEach(Tm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var jy=e=>`- ${e}`,WP=e=>z.isFunction(e)||e===null||e===!1,Ap={getAdapter:e=>{e=z.isArray(e)?e:[e];let{length:t}=e,r,i,n={};for(let o=0;o<t;o++){r=e[o];let u;if(i=r,!WP(r)&&(i=Tm[(u=String(r)).toLowerCase()],i===void 0))throw new _e(`Unknown adapter '${u}'`);if(i)break;n[u||"#"+o]=i}if(!i){let o=Object.entries(n).map(([m,_])=>`adapter ${m} `+(_===!1?"is not supported by the environment":"is not available in the build")),u=t?o.length>1?`since :
34
34
  `+o.map(jy).join(`
35
35
  `):" "+jy(o[0]):"as no adapter specified";throw new _e("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return i},adapters:Tm};function Rm(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new On(null,e)}function Op(e){return Rm(e),e.headers=jr.from(e.headers),e.data=Qu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ap.getAdapter(e.adapter||Lc.adapter)(e).then(function(i){return Rm(e),i.data=Qu.call(e,e.transformResponse,i),i.headers=jr.from(i.headers),i},function(i){return ef(i)||(Rm(e),i&&i.response&&(i.response.data=Qu.call(e,e.transformResponse,i.response),i.response.headers=jr.from(i.response.headers))),Promise.reject(i)})}var Wy=e=>e instanceof jr?{...e}:e;function js(e,t){t=t||{};let r={};function i(w,I,T){return z.isPlainObject(w)&&z.isPlainObject(I)?z.merge.call({caseless:T},w,I):z.isPlainObject(I)?z.merge({},I):z.isArray(I)?I.slice():I}function n(w,I,T){if(z.isUndefined(I)){if(!z.isUndefined(w))return i(void 0,w,T)}else return i(w,I,T)}function o(w,I){if(!z.isUndefined(I))return i(void 0,I)}function u(w,I){if(z.isUndefined(I)){if(!z.isUndefined(w))return i(void 0,w)}else return i(void 0,I)}function m(w,I,T){if(T in t)return i(w,I);if(T in e)return i(void 0,w)}let _={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:m,headers:(w,I)=>n(Wy(w),Wy(I),!0)};return z.forEach(Object.keys(Object.assign({},e,t)),function(I){let T=_[I]||n,N=T(e[I],t[I],I);z.isUndefined(N)&&T!==m||(r[I]=N)}),r}var Am={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Am[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});var Ky={};Am.transitional=function(t,r,i){function n(o,u){return"[Axios v"+Ao+"] Transitional option '"+o+"'"+u+(i?". "+i:"")}return(o,u,m)=>{if(t===!1)throw new _e(n(u," has been removed"+(r?" in "+r:"")),_e.ERR_DEPRECATED);return r&&!Ky[u]&&(Ky[u]=!0,console.warn(n(u," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,u,m):!0}};function KP(e,t,r){if(typeof e!="object")throw new _e("options must be an object",_e.ERR_BAD_OPTION_VALUE);let i=Object.keys(e),n=i.length;for(;n-- >0;){let o=i[n],u=t[o];if(u){let m=e[o],_=m===void 0||u(m,o,e);if(_!==!0)throw new _e("option "+o+" must be "+_,_e.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new _e("Unknown option "+o,_e.ERR_BAD_OPTION)}}var kp={assertOptions:KP,validators:Am};var Ba=kp.validators,qc=class{constructor(t){this.defaults=t,this.interceptors={request:new rm,response:new rm}}async request(t,r){try{return await this._request(t,r)}catch(i){if(i instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;let o=n.stack?n.stack.replace(/^.+\n/,""):"";i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
36
- `+o):i.stack=o}throw i}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=js(this.defaults,r);let{transitional:i,paramsSerializer:n,headers:o}=r;i!==void 0&&kp.assertOptions(i,{silentJSONParsing:Ba.transitional(Ba.boolean),forcedJSONParsing:Ba.transitional(Ba.boolean),clarifyTimeoutError:Ba.transitional(Ba.boolean)},!1),n!=null&&(z.isFunction(n)?r.paramsSerializer={serialize:n}:kp.assertOptions(n,{encode:Ba.function,serialize:Ba.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let u=o&&z.merge(o.common,o[r.method]);o&&z.forEach(["delete","get","head","post","put","patch","common"],B=>{delete o[B]}),r.headers=jr.concat(u,o);let m=[],_=!0;this.interceptors.request.forEach(function(U){typeof U.runWhen=="function"&&U.runWhen(r)===!1||(_=_&&U.synchronous,m.unshift(U.fulfilled,U.rejected))});let w=[];this.interceptors.response.forEach(function(U){w.push(U.fulfilled,U.rejected)});let I,T=0,N;if(!_){let B=[Op.bind(this),void 0];for(B.unshift.apply(B,m),B.push.apply(B,w),N=B.length,I=Promise.resolve(r);T<N;)I=I.then(B[T++],B[T++]);return I}N=m.length;let C=r;for(T=0;T<N;){let B=m[T++],U=m[T++];try{C=B(C)}catch(Z){U.call(this,Z);break}}try{I=Op.call(this,C)}catch(B){return Promise.reject(B)}for(T=0,N=w.length;T<N;)I=I.then(w[T++],w[T++]);return I}getUri(t){t=js(this.defaults,t);let r=To(t.baseURL,t.url);return Io(r,t.params,t.paramsSerializer)}};z.forEach(["delete","get","head","options"],function(t){qc.prototype[t]=function(r,i){return this.request(js(i||{},{method:t,url:r,data:(i||{}).data}))}});z.forEach(["post","put","patch"],function(t){function r(i){return function(o,u,m){return this.request(js(m||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:u}))}}qc.prototype[t]=r(),qc.prototype[t+"Form"]=r(!0)});var uf=qc;var Om=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});let i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o,u=new Promise(m=>{i.subscribe(m),o=m}).then(n);return u.cancel=function(){i.unsubscribe(o)},u},t(function(o,u,m){i.reason||(i.reason=new On(o,u,m),r(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new e(function(n){t=n}),cancel:t}}},Gy=Om;function km(e){return function(r){return e.apply(null,r)}}function Pm(e){return z.isObject(e)&&e.isAxiosError===!0}var Nm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Nm).forEach(([e,t])=>{Nm[t]=e});var $y=Nm;function Yy(e){let t=new uf(e),r=Yu(uf.prototype.request,t);return z.extend(r,uf.prototype,t,{allOwnKeys:!0}),z.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Yy(js(e,n))},r}var Cr=Yy(Lc);Cr.Axios=uf;Cr.CanceledError=On;Cr.CancelToken=Gy;Cr.isCancel=ef;Cr.VERSION=Ao;Cr.toFormData=ka;Cr.AxiosError=_e;Cr.Cancel=Cr.CanceledError;Cr.all=function(t){return Promise.all(t)};Cr.spread=km;Cr.isAxiosError=Pm;Cr.mergeConfig=js;Cr.AxiosHeaders=jr;Cr.formToJSON=e=>Sp(z.isHTMLForm(e)?new FormData(e):e);Cr.getAdapter=Ap.getAdapter;Cr.HttpStatusCode=$y;Cr.default=Cr;var ln=Cr;var{Axios:KF,AxiosError:GF,CanceledError:$F,isCancel:YF,CancelToken:ZF,VERSION:XF,all:JF,Cancel:QF,isAxiosError:eH,spread:tH,toFormData:rH,AxiosHeaders:iH,HttpStatusCode:nH,formToJSON:sH,getAdapter:aH,mergeConfig:oH}=ln;function Fc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function GP(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function $P(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Pp(e,...t){if(!$P(e))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function YP(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Fc(e.outputLen),Fc(e.blockLen)}function Np(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")}function Bm(e,t){Pp(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var ZP={number:Fc,bool:GP,bytes:Pp,hash:YP,exists:Np,output:Bm},Bp=ZP;var Mp=BigInt(4294967295),Zy=BigInt(32);function XP(e,t=!1){return t?{h:Number(e&Mp),l:Number(e>>Zy&Mp)}:{h:Number(e>>Zy&Mp)|0,l:Number(e&Mp)|0}}function Xy(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:o,l:u}=XP(e[n],t);[r[n],i[n]]=[o,u]}return[r,i]}var Jy=(e,t,r)=>e<<r|t>>>32-r,Qy=(e,t,r)=>t<<r|e>>>32-r,e2=(e,t,r)=>t<<r-32|e>>>64-r,t2=(e,t,r)=>e<<r-32|t>>>64-r;var r2=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));function JP(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}var QP=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!QP)throw new Error("Non little-endian hardware is not supported");function Hc(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Lp(e){if(typeof e=="string"&&(e=Hc(e)),!JP(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Cp=class{clone(){return this._cloneInto()}},lH={}.toString;function i2(e){let t=i=>e().update(Lp(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function n2(e){let t=(i,n)=>e(n).update(Lp(i)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}var[o2,c2,u2]=[[],[],[]],eN=BigInt(0),ff=BigInt(1),tN=BigInt(2),rN=BigInt(7),iN=BigInt(256),nN=BigInt(113);for(let e=0,t=ff,r=1,i=0;e<24;e++){[r,i]=[i,(2*r+3*i)%5],o2.push(2*(5*i+r)),c2.push((e+1)*(e+2)/2%64);let n=eN;for(let o=0;o<7;o++)t=(t<<ff^(t>>rN)*nN)%iN,t&tN&&(n^=ff<<(ff<<BigInt(o))-ff);u2.push(n)}var[sN,aN]=Xy(u2,!0),s2=(e,t,r)=>r>32?e2(e,t,r):Jy(e,t,r),a2=(e,t,r)=>r>32?t2(e,t,r):Qy(e,t,r);function oN(e,t=24){let r=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let u=0;u<10;u++)r[u]=e[u]^e[u+10]^e[u+20]^e[u+30]^e[u+40];for(let u=0;u<10;u+=2){let m=(u+8)%10,_=(u+2)%10,w=r[_],I=r[_+1],T=s2(w,I,1)^r[m],N=a2(w,I,1)^r[m+1];for(let C=0;C<50;C+=10)e[u+C]^=T,e[u+C+1]^=N}let n=e[2],o=e[3];for(let u=0;u<24;u++){let m=c2[u],_=s2(n,o,m),w=a2(n,o,m),I=o2[u];n=e[I],o=e[I+1],e[I]=_,e[I+1]=w}for(let u=0;u<50;u+=10){for(let m=0;m<10;m++)r[m]=e[u+m];for(let m=0;m<10;m++)e[u+m]^=~r[(m+2)%10]&r[(m+4)%10]}e[0]^=sN[i],e[1]^=aN[i]}r.fill(0)}var Up=class e extends Cp{constructor(t,r,i,n=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=i,this.enableXOF=n,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fc(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=r2(this.state)}keccak(){oN(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){Np(this);let{blockLen:r,state:i}=this;t=Lp(t);let n=t.length;for(let o=0;o<n;){let u=Math.min(r-this.pos,n-o);for(let m=0;m<u;m++)i[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:i,blockLen:n}=this;t[i]^=r,r&128&&i===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){Np(this,!1),Pp(t),this.finish();let r=this.state,{blockLen:i}=this;for(let n=0,o=t.length;n<o;){this.posOut>=i&&this.keccak();let u=Math.min(i-this.posOut,o-n);t.set(r.subarray(this.posOut,this.posOut+u),n),this.posOut+=u,n+=u}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Fc(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Bm(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){let{blockLen:r,suffix:i,outputLen:n,rounds:o,enableXOF:u}=this;return t||(t=new e(r,i,n,u,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=i,t.outputLen=n,t.enableXOF=u,t.destroyed=this.destroyed,t}},Ma=(e,t,r)=>i2(()=>new Up(t,e,r)),vH=Ma(6,144,224/8),gH=Ma(6,136,256/8),xH=Ma(6,104,384/8),bH=Ma(6,72,512/8),f2=Ma(1,144,224/8),Mm=Ma(1,136,256/8),l2=Ma(1,104,384/8),p2=Ma(1,72,512/8),h2=(e,t,r)=>n2((i={})=>new Up(t,e,i.dkLen===void 0?r:i.dkLen,!0)),_H=h2(31,168,128/8),yH=h2(31,136,256/8);var TH=Bp.bool,RH=Bp.bytes;function lf(e){return t=>(Bp.bytes(t),e(t))}var AH=(()=>{let e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();var BH=lf(f2),pf=(()=>{let e=lf(Mm);return e.create=Mm.create,e})(),MH=lf(l2),CH=lf(p2);var Wr=class extends Error{constructor(t,r){super(t),this.innerError=r,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(t,r=!1){if(t==null)return"undefined";let i=JSON.stringify(t,(n,o)=>typeof o=="bigint"?o.toString():o);return r&&["bigint","string"].includes(typeof t)?i.replace(/['\\"]+/g,""):i}toJSON(){return{name:this.name,code:this.code,message:this.message,innerError:this.innerError}}},Ws=class extends Wr{constructor(t,r){super(`Invalid value given "${Wr.convertToString(t,!0)}". Error: ${r}.`),this.name=this.constructor.name}};var Ca=class extends Ws{constructor(t){super(t,"can not parse as byte data"),this.code=1002}},hf=class extends Ws{constructor(t){super(t,"can not parse as number data"),this.code=1003}};var Dp=class extends Ws{constructor(t){super(t,"can not be converted to hex"),this.code=1006}};var d2="An Rpc error has occured with a code of *code*",ji={[-32700]:{message:"Parse error",description:"Invalid JSON"},[-32600]:{message:"Invalid request",description:"JSON is not a valid request object "},[-32601]:{message:"Method not found",description:"Method does not exist "},[-32602]:{message:"Invalid params",description:"Invalid method parameters"},[-32603]:{message:"Internal error",description:"Internal JSON-RPC error"},[-32e3]:{message:"Invalid input",description:"Missing or invalid parameters"},[-32001]:{message:"Resource not found",description:"Requested resource not found"},[-32002]:{message:"Resource unavailable",description:"Requested resource not available"},[-32003]:{message:"Transaction rejected",description:"Transaction creation failed"},[-32004]:{message:"Method not supported",description:"Method is not implemented"},[-32005]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[-32006]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[4001]:{name:"User Rejected Request",message:"The user rejected the request."},[4100]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[4200]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[4900]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[4901]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};var Oi=class extends Wr{constructor(t,r){super(r??d2.replace("*code*",t.error.code.toString())),this.code=t.error.code,this.id=t.id,this.jsonrpc=t.jsonrpc,this.jsonRpcError=t.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}};var Cm=class extends Oi{constructor(t){super(t,ji[-32700].message),this.code=-32700}},Lm=class extends Oi{constructor(t){super(t,ji[-32600].message),this.code=-32600}},Um=class extends Oi{constructor(t){super(t,ji[-32601].message),this.code=-32601}},Dm=class extends Oi{constructor(t){super(t,ji[-32602].message),this.code=-32602}},qm=class extends Oi{constructor(t){super(t,ji[-32603].message),this.code=-32603}},Fm=class extends Oi{constructor(t){super(t,ji[-32e3].message),this.code=-32e3}},Hm=class extends Oi{constructor(t){super(t,ji[-32004].message),this.code=-32004}},zm=class extends Oi{constructor(t){super(t,ji[-32002].message),this.code=-32002}},Vm=class extends Oi{constructor(t){super(t,ji[-32001].message),this.code=-32001}},jm=class extends Oi{constructor(t){super(t,ji[-32006].message),this.code=-32006}},Wm=class extends Oi{constructor(t){super(t,ji[-32003].message),this.code=-32003}},Km=class extends Oi{constructor(t){super(t,ji[-32005].message),this.code=-32005}},Wi=new Map;Wi.set(-32700,{error:Cm});Wi.set(-32600,{error:Lm});Wi.set(-32601,{error:Um});Wi.set(-32602,{error:Dm});Wi.set(-32603,{error:qm});Wi.set(-32e3,{error:Fm});Wi.set(-32004,{error:Hm});Wi.set(-32002,{error:zm});Wi.set(-32003,{error:Wm});Wi.set(-32001,{error:Vm});Wi.set(-32006,{error:jm});Wi.set(-32005,{error:Km});var qp=class extends Wr{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=1200}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}};var St;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let o={};for(let u of n)o[u]=u;return o},e.getValidEnumValues=n=>{let o=e.objectKeys(n).filter(m=>typeof n[n[m]]!="number"),u={};for(let m of o)u[m]=n[m];return e.objectValues(u)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&o.push(u);return o},e.find=(n,o)=>{for(let u of n)if(o(u))return u},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(u=>typeof u=="string"?`'${u}'`:u).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(St||(St={}));var $m;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})($m||($m={}));var ve=St.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),La=e=>{switch(typeof e){case"undefined":return ve.undefined;case"string":return ve.string;case"number":return isNaN(e)?ve.nan:ve.number;case"boolean":return ve.boolean;case"function":return ve.function;case"bigint":return ve.bigint;case"symbol":return ve.symbol;case"object":return Array.isArray(e)?ve.array:e===null?ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ve.promise:typeof Map<"u"&&e instanceof Map?ve.map:typeof Set<"u"&&e instanceof Set?ve.set:typeof Date<"u"&&e instanceof Date?ve.date:ve.object;default:return ve.unknown}},fe=St.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Ki=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(o){return o.message},i={_errors:[]},n=o=>{for(let u of o.issues)if(u.code==="invalid_union")u.unionErrors.map(n);else if(u.code==="invalid_return_type")n(u.returnTypeError);else if(u.code==="invalid_arguments")n(u.argumentsError);else if(u.path.length===0)i._errors.push(r(u));else{let m=i,_=0;for(;_<u.path.length;){let w=u.path[_];_===u.path.length-1?(m[w]=m[w]||{_errors:[]},m[w]._errors.push(r(u))):m[w]=m[w]||{_errors:[]},m=m[w],_++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,St.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Ki.create=e=>new Ki(e);var Tf=(e,t)=>{let r;switch(e.code){case fe.invalid_type:e.received===ve.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case fe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,St.jsonStringifyReplacer)}`;break;case fe.unrecognized_keys:r=`Unrecognized key(s) in object: ${St.joinValues(e.keys,", ")}`;break;case fe.invalid_union:r="Invalid input";break;case fe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${St.joinValues(e.options)}`;break;case fe.invalid_enum_value:r=`Invalid enum value. Expected ${St.joinValues(e.options)}, received '${e.received}'`;break;case fe.invalid_arguments:r="Invalid function arguments";break;case fe.invalid_return_type:r="Invalid function return type";break;case fe.invalid_date:r="Invalid date";break;case fe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:St.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case fe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case fe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case fe.custom:r="Invalid input";break;case fe.invalid_intersection_types:r="Intersection results could not be merged";break;case fe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case fe.not_finite:r="Number must be finite";break;default:r=t.defaultError,St.assertNever(e)}return{message:r}},g2=Tf;function bN(e){g2=e}function Hp(){return g2}var zp=e=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,o=[...r,...n.path||[]],u={...n,path:o},m="",_=i.filter(w=>!!w).slice().reverse();for(let w of _)m=w(u,{data:t,defaultError:m}).message;return{...n,path:o,message:n.message||m}},_N=[];function be(e,t){let r=zp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Hp(),Tf].filter(i=>!!i)});e.common.issues.push(r)}var ui=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let i=[];for(let n of r){if(n.status==="aborted")return ze;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return e.mergeObjectSync(t,i)}static mergeObjectSync(t,r){let i={};for(let n of r){let{key:o,value:u}=n;if(o.status==="aborted"||u.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof u.value<"u"||n.alwaysSet)&&(i[o.value]=u.value)}return{status:t.value,value:i}}},ze=Object.freeze({status:"aborted"}),x2=e=>({status:"dirty",value:e}),bi=e=>({status:"valid",value:e}),Ym=e=>e.status==="aborted",Zm=e=>e.status==="dirty",Rf=e=>e.status==="valid",Vp=e=>typeof Promise<"u"&&e instanceof Promise,Ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ae||(Ae={}));var pn=class{constructor(t,r,i,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},m2=(e,t)=>{if(Rf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ki(e.common.issues);return this._error=r,this._error}}};function tt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(u,m)=>u.code!=="invalid_type"?{message:m.defaultError}:typeof m.data>"u"?{message:i??m.defaultError}:{message:r??m.defaultError},description:n}}var rt=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return La(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:La(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ui,ctx:{common:t.parent.common,data:t.data,parsedType:La(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Vp(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:La(t)},o=this._parseSync({data:t,path:n.path,parent:n});return m2(n,o)}async parseAsync(t,r){let i=await this.safeParseAsync(t,r);if(i.success)return i.data;throw i.error}async safeParseAsync(t,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:La(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(Vp(n)?n:Promise.resolve(n));return m2(i,o)}refine(t,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let u=t(n),m=()=>o.addIssue({code:fe.custom,...i(n)});return typeof Promise<"u"&&u instanceof Promise?u.then(_=>_?!0:(m(),!1)):u?!0:(m(),!1)})}refinement(t,r){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(t){return new Gi({schema:this,typeName:Ne.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return kn.create(this,this._def)}nullable(){return $s.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gs.create(this,this._def)}promise(){return qa.create(this,this._def)}or(t){return Lo.create([this,t],this._def)}and(t){return Uo.create(this,t,this._def)}transform(t){return new Gi({...tt(this._def),schema:this,typeName:Ne.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new zo({...tt(this._def),innerType:this,defaultValue:r,typeName:Ne.ZodDefault})}brand(){return new Gp({typeName:Ne.ZodBranded,type:this,...tt(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Gc({...tt(this._def),innerType:this,catchValue:r,typeName:Ne.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Af.create(this,t)}readonly(){return Yc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yN=/^c[^\s-]{8,}$/i,wN=/^[a-z][a-z0-9]*$/,SN=/^[0-9A-HJKMNP-TV-Z]{26}$/,EN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,IN=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,TN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Gm,RN=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,AN=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ON=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function kN(e,t){return!!((t==="v4"||!t)&&RN.test(e)||(t==="v6"||!t)&&AN.test(e))}var Ua=class e extends rt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ve.string){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.string,received:o.parsedType}),ze}let i=new ui,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let u=t.data.length>o.value,m=t.data.length<o.value;(u||m)&&(n=this._getOrReturnCtx(t,n),u?be(n,{code:fe.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):m&&be(n,{code:fe.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")IN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"email",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Gm||(Gm=new RegExp(TN,"u")),Gm.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"emoji",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")EN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"uuid",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")yN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"cuid",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")wN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"cuid2",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")SN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"ulid",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),be(n,{validation:"url",code:fe.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"regex",code:fe.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?ON(o).test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="ip"?kN(t.data,o.version)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"ip",code:fe.invalid_string,message:o.message}),i.dirty()):St.assertNever(o);return{status:i.value,value:t.data}}_regex(t,r,i){return this.refinement(n=>t.test(n),{validation:r,code:fe.invalid_string,...Ae.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ae.errToObj(t)})}datetime(t){var r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,...Ae.errToObj(t?.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ae.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Ae.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ae.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ae.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ae.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ae.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ae.errToObj(r)})}nonempty(t){return this.min(1,Ae.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ua.create=e=>{var t;return new Ua({checks:[],typeName:Ne.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...tt(e)})};function PN(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=parseInt(e.toFixed(n).replace(".","")),u=parseInt(t.toFixed(n).replace(".",""));return o%u/Math.pow(10,n)}var ko=class e extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ve.number){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.number,received:o.parsedType}),ze}let i,n=new ui;for(let o of this._def.checks)o.kind==="int"?St.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),be(i,{code:fe.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?PN(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),be(i,{code:fe.not_finite,message:o.message}),n.dirty()):St.assertNever(o);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ae.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Ae.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ae.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&St.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ko.create=e=>new ko({checks:[],typeName:Ne.ZodNumber,coerce:e?.coerce||!1,...tt(e)});var Po=class e extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ve.bigint){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.bigint,received:o.parsedType}),ze}let i,n=new ui;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):St.assertNever(o);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ae.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Ae.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Po.create=e=>{var t;return new Po({checks:[],typeName:Ne.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...tt(e)})};var No=class extends rt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ve.boolean){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.boolean,received:i.parsedType}),ze}return bi(t.data)}};No.create=e=>new No({typeName:Ne.ZodBoolean,coerce:e?.coerce||!1,...tt(e)});var Bo=class e extends rt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ve.date){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.date,received:o.parsedType}),ze}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_date}),ze}let i=new ui,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):St.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ae.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ae.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Bo.create=e=>new Bo({checks:[],coerce:e?.coerce||!1,typeName:Ne.ZodDate,...tt(e)});var Vc=class extends rt{_parse(t){if(this._getType(t)!==ve.symbol){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.symbol,received:i.parsedType}),ze}return bi(t.data)}};Vc.create=e=>new Vc({typeName:Ne.ZodSymbol,...tt(e)});var Mo=class extends rt{_parse(t){if(this._getType(t)!==ve.undefined){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.undefined,received:i.parsedType}),ze}return bi(t.data)}};Mo.create=e=>new Mo({typeName:Ne.ZodUndefined,...tt(e)});var Co=class extends rt{_parse(t){if(this._getType(t)!==ve.null){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.null,received:i.parsedType}),ze}return bi(t.data)}};Co.create=e=>new Co({typeName:Ne.ZodNull,...tt(e)});var Da=class extends rt{constructor(){super(...arguments),this._any=!0}_parse(t){return bi(t.data)}};Da.create=e=>new Da({typeName:Ne.ZodAny,...tt(e)});var Ks=class extends rt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bi(t.data)}};Ks.create=e=>new Ks({typeName:Ne.ZodUnknown,...tt(e)});var Pn=class extends rt{_parse(t){let r=this._getOrReturnCtx(t);return be(r,{code:fe.invalid_type,expected:ve.never,received:r.parsedType}),ze}};Pn.create=e=>new Pn({typeName:Ne.ZodNever,...tt(e)});var jc=class extends rt{_parse(t){if(this._getType(t)!==ve.undefined){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.void,received:i.parsedType}),ze}return bi(t.data)}};jc.create=e=>new jc({typeName:Ne.ZodVoid,...tt(e)});var Gs=class e extends rt{_parse(t){let{ctx:r,status:i}=this._processInputParams(t),n=this._def;if(r.parsedType!==ve.array)return be(r,{code:fe.invalid_type,expected:ve.array,received:r.parsedType}),ze;if(n.exactLength!==null){let u=r.data.length>n.exactLength.value,m=r.data.length<n.exactLength.value;(u||m)&&(be(r,{code:u?fe.too_big:fe.too_small,minimum:m?n.exactLength.value:void 0,maximum:u?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(be(r,{code:fe.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(be(r,{code:fe.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((u,m)=>n.type._parseAsync(new pn(r,u,r.path,m)))).then(u=>ui.mergeArray(i,u));let o=[...r.data].map((u,m)=>n.type._parseSync(new pn(r,u,r.path,m)));return ui.mergeArray(i,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Ae.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Ae.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Ae.toString(r)}})}nonempty(t){return this.min(1,t)}};Gs.create=(e,t)=>new Gs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ne.ZodArray,...tt(t)});function zc(e){if(e instanceof ki){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=kn.create(zc(i))}return new ki({...e._def,shape:()=>t})}else return e instanceof Gs?new Gs({...e._def,type:zc(e.element)}):e instanceof kn?kn.create(zc(e.unwrap())):e instanceof $s?$s.create(zc(e.unwrap())):e instanceof is?is.create(e.items.map(t=>zc(t))):e}var ki=class e extends rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=St.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ve.object){let w=this._getOrReturnCtx(t);return be(w,{code:fe.invalid_type,expected:ve.object,received:w.parsedType}),ze}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:u}=this._getCached(),m=[];if(!(this._def.catchall instanceof Pn&&this._def.unknownKeys==="strip"))for(let w in n.data)u.includes(w)||m.push(w);let _=[];for(let w of u){let I=o[w],T=n.data[w];_.push({key:{status:"valid",value:w},value:I._parse(new pn(n,T,n.path,w)),alwaysSet:w in n.data})}if(this._def.catchall instanceof Pn){let w=this._def.unknownKeys;if(w==="passthrough")for(let I of m)_.push({key:{status:"valid",value:I},value:{status:"valid",value:n.data[I]}});else if(w==="strict")m.length>0&&(be(n,{code:fe.unrecognized_keys,keys:m}),i.dirty());else if(w!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let w=this._def.catchall;for(let I of m){let T=n.data[I];_.push({key:{status:"valid",value:I},value:w._parse(new pn(n,T,n.path,I)),alwaysSet:I in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let w=[];for(let I of _){let T=await I.key;w.push({key:T,value:await I.value,alwaysSet:I.alwaysSet})}return w}).then(w=>ui.mergeObjectSync(i,w)):ui.mergeObjectSync(i,_)}get shape(){return this._def.shape()}strict(t){return Ae.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,i)=>{var n,o,u,m;let _=(u=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,r,i).message)!==null&&u!==void 0?u:i.defaultError;return r.code==="unrecognized_keys"?{message:(m=Ae.errToObj(t).message)!==null&&m!==void 0?m:_}:{message:_}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ne.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return St.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return St.objectKeys(this.shape).forEach(i=>{t[i]||(r[i]=this.shape[i])}),new e({...this._def,shape:()=>r})}deepPartial(){return zc(this)}partial(t){let r={};return St.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];t&&!t[i]?r[i]=n:r[i]=n.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return St.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])r[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof kn;)o=o._def.innerType;r[i]=o}}),new e({...this._def,shape:()=>r})}keyof(){return b2(St.objectKeys(this.shape))}};ki.create=(e,t)=>new ki({shape:()=>e,unknownKeys:"strip",catchall:Pn.create(),typeName:Ne.ZodObject,...tt(t)});ki.strictCreate=(e,t)=>new ki({shape:()=>e,unknownKeys:"strict",catchall:Pn.create(),typeName:Ne.ZodObject,...tt(t)});ki.lazycreate=(e,t)=>new ki({shape:e,unknownKeys:"strip",catchall:Pn.create(),typeName:Ne.ZodObject,...tt(t)});var Lo=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i=this._def.options;function n(o){for(let m of o)if(m.result.status==="valid")return m.result;for(let m of o)if(m.result.status==="dirty")return r.common.issues.push(...m.ctx.common.issues),m.result;let u=o.map(m=>new Ki(m.ctx.common.issues));return be(r,{code:fe.invalid_union,unionErrors:u}),ze}if(r.common.async)return Promise.all(i.map(async o=>{let u={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:u}),ctx:u}})).then(n);{let o,u=[];for(let _ of i){let w={...r,common:{...r.common,issues:[]},parent:null},I=_._parseSync({data:r.data,path:r.path,parent:w});if(I.status==="valid")return I;I.status==="dirty"&&!o&&(o={result:I,ctx:w}),w.common.issues.length&&u.push(w.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let m=u.map(_=>new Ki(_));return be(r,{code:fe.invalid_union,unionErrors:m}),ze}}get options(){return this._def.options}};Lo.create=(e,t)=>new Lo({options:e,typeName:Ne.ZodUnion,...tt(t)});var Fp=e=>e instanceof Do?Fp(e.schema):e instanceof Gi?Fp(e.innerType()):e instanceof qo?[e.value]:e instanceof Fo?e.options:e instanceof Ho?Object.keys(e.enum):e instanceof zo?Fp(e._def.innerType):e instanceof Mo?[void 0]:e instanceof Co?[null]:null,jp=class e extends rt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ve.object)return be(r,{code:fe.invalid_type,expected:ve.object,received:r.parsedType}),ze;let i=this.discriminator,n=r.data[i],o=this.optionsMap.get(n);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(be(r,{code:fe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){let n=new Map;for(let o of r){let u=Fp(o.shape[t]);if(!u)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let m of u){if(n.has(m))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(m)}`);n.set(m,o)}}return new e({typeName:Ne.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...tt(i)})}};function Xm(e,t){let r=La(e),i=La(t);if(e===t)return{valid:!0,data:e};if(r===ve.object&&i===ve.object){let n=St.objectKeys(t),o=St.objectKeys(e).filter(m=>n.indexOf(m)!==-1),u={...e,...t};for(let m of o){let _=Xm(e[m],t[m]);if(!_.valid)return{valid:!1};u[m]=_.data}return{valid:!0,data:u}}else if(r===ve.array&&i===ve.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<e.length;o++){let u=e[o],m=t[o],_=Xm(u,m);if(!_.valid)return{valid:!1};n.push(_.data)}return{valid:!0,data:n}}else return r===ve.date&&i===ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Uo=class extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=(o,u)=>{if(Ym(o)||Ym(u))return ze;let m=Xm(o.value,u.value);return m.valid?((Zm(o)||Zm(u))&&r.dirty(),{status:r.value,value:m.data}):(be(i,{code:fe.invalid_intersection_types}),ze)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,u])=>n(o,u)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Uo.create=(e,t,r)=>new Uo({left:e,right:t,typeName:Ne.ZodIntersection,...tt(r)});var is=class e extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.array)return be(i,{code:fe.invalid_type,expected:ve.array,received:i.parsedType}),ze;if(i.data.length<this._def.items.length)return be(i,{code:fe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&i.data.length>this._def.items.length&&(be(i,{code:fe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...i.data].map((u,m)=>{let _=this._def.items[m]||this._def.rest;return _?_._parse(new pn(i,u,i.path,m)):null}).filter(u=>!!u);return i.common.async?Promise.all(o).then(u=>ui.mergeArray(r,u)):ui.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};is.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new is({items:e,typeName:Ne.ZodTuple,rest:null,...tt(t)})};var Wp=class e extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.object)return be(i,{code:fe.invalid_type,expected:ve.object,received:i.parsedType}),ze;let n=[],o=this._def.keyType,u=this._def.valueType;for(let m in i.data)n.push({key:o._parse(new pn(i,m,i.path,m)),value:u._parse(new pn(i,i.data[m],i.path,m))});return i.common.async?ui.mergeObjectAsync(r,n):ui.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,i){return r instanceof rt?new e({keyType:t,valueType:r,typeName:Ne.ZodRecord,...tt(i)}):new e({keyType:Ua.create(),valueType:t,typeName:Ne.ZodRecord,...tt(r)})}},Wc=class extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.map)return be(i,{code:fe.invalid_type,expected:ve.map,received:i.parsedType}),ze;let n=this._def.keyType,o=this._def.valueType,u=[...i.data.entries()].map(([m,_],w)=>({key:n._parse(new pn(i,m,i.path,[w,"key"])),value:o._parse(new pn(i,_,i.path,[w,"value"]))}));if(i.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let _ of u){let w=await _.key,I=await _.value;if(w.status==="aborted"||I.status==="aborted")return ze;(w.status==="dirty"||I.status==="dirty")&&r.dirty(),m.set(w.value,I.value)}return{status:r.value,value:m}})}else{let m=new Map;for(let _ of u){let w=_.key,I=_.value;if(w.status==="aborted"||I.status==="aborted")return ze;(w.status==="dirty"||I.status==="dirty")&&r.dirty(),m.set(w.value,I.value)}return{status:r.value,value:m}}}};Wc.create=(e,t,r)=>new Wc({valueType:t,keyType:e,typeName:Ne.ZodMap,...tt(r)});var Kc=class e extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.set)return be(i,{code:fe.invalid_type,expected:ve.set,received:i.parsedType}),ze;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(be(i,{code:fe.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(be(i,{code:fe.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function u(_){let w=new Set;for(let I of _){if(I.status==="aborted")return ze;I.status==="dirty"&&r.dirty(),w.add(I.value)}return{status:r.value,value:w}}let m=[...i.data.values()].map((_,w)=>o._parse(new pn(i,_,i.path,w)));return i.common.async?Promise.all(m).then(_=>u(_)):u(m)}min(t,r){return new e({...this._def,minSize:{value:t,message:Ae.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Ae.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Kc.create=(e,t)=>new Kc({valueType:e,minSize:null,maxSize:null,typeName:Ne.ZodSet,...tt(t)});var Kp=class e extends rt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ve.function)return be(r,{code:fe.invalid_type,expected:ve.function,received:r.parsedType}),ze;function i(m,_){return zp({data:m,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hp(),Tf].filter(w=>!!w),issueData:{code:fe.invalid_arguments,argumentsError:_}})}function n(m,_){return zp({data:m,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hp(),Tf].filter(w=>!!w),issueData:{code:fe.invalid_return_type,returnTypeError:_}})}let o={errorMap:r.common.contextualErrorMap},u=r.data;if(this._def.returns instanceof qa){let m=this;return bi(async function(..._){let w=new Ki([]),I=await m._def.args.parseAsync(_,o).catch(C=>{throw w.addIssue(i(_,C)),w}),T=await Reflect.apply(u,this,I);return await m._def.returns._def.type.parseAsync(T,o).catch(C=>{throw w.addIssue(n(T,C)),w})})}else{let m=this;return bi(function(..._){let w=m._def.args.safeParse(_,o);if(!w.success)throw new Ki([i(_,w.error)]);let I=Reflect.apply(u,this,w.data),T=m._def.returns.safeParse(I,o);if(!T.success)throw new Ki([n(I,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:is.create(t).rest(Ks.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new e({args:t||is.create([]).rest(Ks.create()),returns:r||Ks.create(),typeName:Ne.ZodFunction,...tt(i)})}},Do=class extends rt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Do.create=(e,t)=>new Do({getter:e,typeName:Ne.ZodLazy,...tt(t)});var qo=class extends rt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return be(r,{received:r.data,code:fe.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}};qo.create=(e,t)=>new qo({value:e,typeName:Ne.ZodLiteral,...tt(t)});function b2(e,t){return new Fo({values:e,typeName:Ne.ZodEnum,...tt(t)})}var Fo=class e extends rt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),i=this._def.values;return be(r,{expected:St.joinValues(i),received:r.parsedType,code:fe.invalid_type}),ze}if(this._def.values.indexOf(t.data)===-1){let r=this._getOrReturnCtx(t),i=this._def.values;return be(r,{received:r.data,code:fe.invalid_enum_value,options:i}),ze}return bi(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t){return e.create(t)}exclude(t){return e.create(this.options.filter(r=>!t.includes(r)))}};Fo.create=b2;var Ho=class extends rt{_parse(t){let r=St.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==ve.string&&i.parsedType!==ve.number){let n=St.objectValues(r);return be(i,{expected:St.joinValues(n),received:i.parsedType,code:fe.invalid_type}),ze}if(r.indexOf(t.data)===-1){let n=St.objectValues(r);return be(i,{received:i.data,code:fe.invalid_enum_value,options:n}),ze}return bi(t.data)}get enum(){return this._def.values}};Ho.create=(e,t)=>new Ho({values:e,typeName:Ne.ZodNativeEnum,...tt(t)});var qa=class extends rt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ve.promise&&r.common.async===!1)return be(r,{code:fe.invalid_type,expected:ve.promise,received:r.parsedType}),ze;let i=r.parsedType===ve.promise?r.data:Promise.resolve(r.data);return bi(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};qa.create=(e,t)=>new qa({type:e,typeName:Ne.ZodPromise,...tt(t)});var Gi=class extends rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:u=>{be(i,u),u.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let u=n.transform(i.data,o);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(u).then(m=>this._def.schema._parseAsync({data:m,path:i.path,parent:i})):this._def.schema._parseSync({data:u,path:i.path,parent:i})}if(n.type==="refinement"){let u=m=>{let _=n.refinement(m,o);if(i.common.async)return Promise.resolve(_);if(_ instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(i.common.async===!1){let m=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return m.status==="aborted"?ze:(m.status==="dirty"&&r.dirty(),u(m.value),{status:r.value,value:m.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(m=>m.status==="aborted"?ze:(m.status==="dirty"&&r.dirty(),u(m.value).then(()=>({status:r.value,value:m.value}))))}if(n.type==="transform")if(i.common.async===!1){let u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Rf(u))return u;let m=n.transform(u.value,o);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:m}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>Rf(u)?Promise.resolve(n.transform(u.value,o)).then(m=>({status:r.value,value:m})):u);St.assertNever(n)}};Gi.create=(e,t,r)=>new Gi({schema:e,typeName:Ne.ZodEffects,effect:t,...tt(r)});Gi.createWithPreprocess=(e,t,r)=>new Gi({schema:t,effect:{type:"preprocess",transform:e},typeName:Ne.ZodEffects,...tt(r)});var kn=class extends rt{_parse(t){return this._getType(t)===ve.undefined?bi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};kn.create=(e,t)=>new kn({innerType:e,typeName:Ne.ZodOptional,...tt(t)});var $s=class extends rt{_parse(t){return this._getType(t)===ve.null?bi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};$s.create=(e,t)=>new $s({innerType:e,typeName:Ne.ZodNullable,...tt(t)});var zo=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return r.parsedType===ve.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};zo.create=(e,t)=>new zo({innerType:e,typeName:Ne.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...tt(t)});var Gc=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Vp(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ki(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ki(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Gc.create=(e,t)=>new Gc({innerType:e,typeName:Ne.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...tt(t)});var $c=class extends rt{_parse(t){if(this._getType(t)!==ve.nan){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.nan,received:i.parsedType}),ze}return{status:"valid",value:t.data}}};$c.create=e=>new $c({typeName:Ne.ZodNaN,...tt(e)});var NN=Symbol("zod_brand"),Gp=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},Af=class e extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?ze:o.status==="dirty"?(r.dirty(),x2(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?ze:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,r){return new e({in:t,out:r,typeName:Ne.ZodPipeline})}},Yc=class extends rt{_parse(t){let r=this._def.innerType._parse(t);return Rf(r)&&(r.value=Object.freeze(r.value)),r}};Yc.create=(e,t)=>new Yc({innerType:e,typeName:Ne.ZodReadonly,...tt(t)});var _2=(e,t={},r)=>e?Da.create().superRefine((i,n)=>{var o,u;if(!e(i)){let m=typeof t=="function"?t(i):typeof t=="string"?{message:t}:t,_=(u=(o=m.fatal)!==null&&o!==void 0?o:r)!==null&&u!==void 0?u:!0,w=typeof m=="string"?{message:m}:m;n.addIssue({code:"custom",...w,fatal:_})}}):Da.create(),BN={object:ki.lazycreate},Ne;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ne||(Ne={}));var MN=(e,t={message:`Input not instance of ${e.name}`})=>_2(r=>r instanceof e,t),y2=Ua.create,w2=ko.create,CN=$c.create,LN=Po.create,S2=No.create,UN=Bo.create,DN=Vc.create,qN=Mo.create,FN=Co.create,HN=Da.create,zN=Ks.create,VN=Pn.create,jN=jc.create,WN=Gs.create,KN=ki.create,GN=ki.strictCreate,$N=Lo.create,YN=jp.create,ZN=Uo.create,XN=is.create,JN=Wp.create,QN=Wc.create,e7=Kc.create,t7=Kp.create,r7=Do.create,i7=qo.create,n7=Fo.create,s7=Ho.create,a7=qa.create,v2=Gi.create,o7=kn.create,c7=$s.create,u7=Gi.createWithPreprocess,f7=Af.create,l7=()=>y2().optional(),p7=()=>w2().optional(),h7=()=>S2().optional(),d7={string:e=>Ua.create({...e,coerce:!0}),number:e=>ko.create({...e,coerce:!0}),boolean:e=>No.create({...e,coerce:!0}),bigint:e=>Po.create({...e,coerce:!0}),date:e=>Bo.create({...e,coerce:!0})},m7=ze,Nn=Object.freeze({__proto__:null,defaultErrorMap:Tf,setErrorMap:bN,getErrorMap:Hp,makeIssue:zp,EMPTY_PATH:_N,addIssueToContext:be,ParseStatus:ui,INVALID:ze,DIRTY:x2,OK:bi,isAborted:Ym,isDirty:Zm,isValid:Rf,isAsync:Vp,get util(){return St},get objectUtil(){return $m},ZodParsedType:ve,getParsedType:La,ZodType:rt,ZodString:Ua,ZodNumber:ko,ZodBigInt:Po,ZodBoolean:No,ZodDate:Bo,ZodSymbol:Vc,ZodUndefined:Mo,ZodNull:Co,ZodAny:Da,ZodUnknown:Ks,ZodNever:Pn,ZodVoid:jc,ZodArray:Gs,ZodObject:ki,ZodUnion:Lo,ZodDiscriminatedUnion:jp,ZodIntersection:Uo,ZodTuple:is,ZodRecord:Wp,ZodMap:Wc,ZodSet:Kc,ZodFunction:Kp,ZodLazy:Do,ZodLiteral:qo,ZodEnum:Fo,ZodNativeEnum:Ho,ZodPromise:qa,ZodEffects:Gi,ZodTransformer:Gi,ZodOptional:kn,ZodNullable:$s,ZodDefault:zo,ZodCatch:Gc,ZodNaN:$c,BRAND:NN,ZodBranded:Gp,ZodPipeline:Af,ZodReadonly:Yc,custom:_2,Schema:rt,ZodSchema:rt,late:BN,get ZodFirstPartyTypeKind(){return Ne},coerce:d7,any:HN,array:WN,bigint:LN,boolean:S2,date:UN,discriminatedUnion:YN,effect:v2,enum:n7,function:t7,instanceof:MN,intersection:ZN,lazy:r7,literal:i7,map:QN,nan:CN,nativeEnum:s7,never:VN,null:FN,nullable:c7,number:w2,object:KN,oboolean:h7,onumber:p7,optional:o7,ostring:l7,pipeline:f7,preprocess:u7,promise:a7,record:JN,set:e7,strictObject:GN,string:y2,symbol:DN,transformer:v2,tuple:XN,undefined:qN,union:$N,unknown:zN,void:jN,NEVER:m7,ZodIssueCode:fe,quotelessJson:xN,ZodError:Ki});var g7=e=>e.message?e.message:"unspecified error",Ys=class extends Wr{constructor(t){super(),this.code=1100,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
36
+ `+o):i.stack=o}throw i}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=js(this.defaults,r);let{transitional:i,paramsSerializer:n,headers:o}=r;i!==void 0&&kp.assertOptions(i,{silentJSONParsing:Ba.transitional(Ba.boolean),forcedJSONParsing:Ba.transitional(Ba.boolean),clarifyTimeoutError:Ba.transitional(Ba.boolean)},!1),n!=null&&(z.isFunction(n)?r.paramsSerializer={serialize:n}:kp.assertOptions(n,{encode:Ba.function,serialize:Ba.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let u=o&&z.merge(o.common,o[r.method]);o&&z.forEach(["delete","get","head","post","put","patch","common"],B=>{delete o[B]}),r.headers=jr.concat(u,o);let m=[],_=!0;this.interceptors.request.forEach(function(U){typeof U.runWhen=="function"&&U.runWhen(r)===!1||(_=_&&U.synchronous,m.unshift(U.fulfilled,U.rejected))});let w=[];this.interceptors.response.forEach(function(U){w.push(U.fulfilled,U.rejected)});let I,T=0,N;if(!_){let B=[Op.bind(this),void 0];for(B.unshift.apply(B,m),B.push.apply(B,w),N=B.length,I=Promise.resolve(r);T<N;)I=I.then(B[T++],B[T++]);return I}N=m.length;let C=r;for(T=0;T<N;){let B=m[T++],U=m[T++];try{C=B(C)}catch(Z){U.call(this,Z);break}}try{I=Op.call(this,C)}catch(B){return Promise.reject(B)}for(T=0,N=w.length;T<N;)I=I.then(w[T++],w[T++]);return I}getUri(t){t=js(this.defaults,t);let r=To(t.baseURL,t.url);return Io(r,t.params,t.paramsSerializer)}};z.forEach(["delete","get","head","options"],function(t){qc.prototype[t]=function(r,i){return this.request(js(i||{},{method:t,url:r,data:(i||{}).data}))}});z.forEach(["post","put","patch"],function(t){function r(i){return function(o,u,m){return this.request(js(m||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:u}))}}qc.prototype[t]=r(),qc.prototype[t+"Form"]=r(!0)});var uf=qc;var Om=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});let i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o,u=new Promise(m=>{i.subscribe(m),o=m}).then(n);return u.cancel=function(){i.unsubscribe(o)},u},t(function(o,u,m){i.reason||(i.reason=new On(o,u,m),r(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new e(function(n){t=n}),cancel:t}}},Gy=Om;function km(e){return function(r){return e.apply(null,r)}}function Pm(e){return z.isObject(e)&&e.isAxiosError===!0}var Nm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Nm).forEach(([e,t])=>{Nm[t]=e});var $y=Nm;function Yy(e){let t=new uf(e),r=Yu(uf.prototype.request,t);return z.extend(r,uf.prototype,t,{allOwnKeys:!0}),z.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Yy(js(e,n))},r}var Cr=Yy(Lc);Cr.Axios=uf;Cr.CanceledError=On;Cr.CancelToken=Gy;Cr.isCancel=ef;Cr.VERSION=Ao;Cr.toFormData=ka;Cr.AxiosError=_e;Cr.Cancel=Cr.CanceledError;Cr.all=function(t){return Promise.all(t)};Cr.spread=km;Cr.isAxiosError=Pm;Cr.mergeConfig=js;Cr.AxiosHeaders=jr;Cr.formToJSON=e=>Sp(z.isHTMLForm(e)?new FormData(e):e);Cr.getAdapter=Ap.getAdapter;Cr.HttpStatusCode=$y;Cr.default=Cr;var ln=Cr;var{Axios:KF,AxiosError:GF,CanceledError:$F,isCancel:YF,CancelToken:ZF,VERSION:XF,all:JF,Cancel:QF,isAxiosError:eH,spread:tH,toFormData:rH,AxiosHeaders:iH,HttpStatusCode:nH,formToJSON:sH,getAdapter:aH,mergeConfig:oH}=ln;function Fc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function GP(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function $P(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Pp(e,...t){if(!$P(e))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function YP(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Fc(e.outputLen),Fc(e.blockLen)}function Np(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")}function Bm(e,t){Pp(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var ZP={number:Fc,bool:GP,bytes:Pp,hash:YP,exists:Np,output:Bm},Bp=ZP;var Mp=BigInt(4294967295),Zy=BigInt(32);function XP(e,t=!1){return t?{h:Number(e&Mp),l:Number(e>>Zy&Mp)}:{h:Number(e>>Zy&Mp)|0,l:Number(e&Mp)|0}}function Xy(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:o,l:u}=XP(e[n],t);[r[n],i[n]]=[o,u]}return[r,i]}var Jy=(e,t,r)=>e<<r|t>>>32-r,Qy=(e,t,r)=>t<<r|e>>>32-r,e2=(e,t,r)=>t<<r-32|e>>>64-r,t2=(e,t,r)=>e<<r-32|t>>>64-r;var r2=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));function JP(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}var QP=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!QP)throw new Error("Non little-endian hardware is not supported");function Hc(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Lp(e){if(typeof e=="string"&&(e=Hc(e)),!JP(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Cp=class{clone(){return this._cloneInto()}},lH={}.toString;function i2(e){let t=i=>e().update(Lp(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function n2(e){let t=(i,n)=>e(n).update(Lp(i)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}var[o2,c2,u2]=[[],[],[]],eN=BigInt(0),ff=BigInt(1),tN=BigInt(2),rN=BigInt(7),iN=BigInt(256),nN=BigInt(113);for(let e=0,t=ff,r=1,i=0;e<24;e++){[r,i]=[i,(2*r+3*i)%5],o2.push(2*(5*i+r)),c2.push((e+1)*(e+2)/2%64);let n=eN;for(let o=0;o<7;o++)t=(t<<ff^(t>>rN)*nN)%iN,t&tN&&(n^=ff<<(ff<<BigInt(o))-ff);u2.push(n)}var[sN,aN]=Xy(u2,!0),s2=(e,t,r)=>r>32?e2(e,t,r):Jy(e,t,r),a2=(e,t,r)=>r>32?t2(e,t,r):Qy(e,t,r);function oN(e,t=24){let r=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let u=0;u<10;u++)r[u]=e[u]^e[u+10]^e[u+20]^e[u+30]^e[u+40];for(let u=0;u<10;u+=2){let m=(u+8)%10,_=(u+2)%10,w=r[_],I=r[_+1],T=s2(w,I,1)^r[m],N=a2(w,I,1)^r[m+1];for(let C=0;C<50;C+=10)e[u+C]^=T,e[u+C+1]^=N}let n=e[2],o=e[3];for(let u=0;u<24;u++){let m=c2[u],_=s2(n,o,m),w=a2(n,o,m),I=o2[u];n=e[I],o=e[I+1],e[I]=_,e[I+1]=w}for(let u=0;u<50;u+=10){for(let m=0;m<10;m++)r[m]=e[u+m];for(let m=0;m<10;m++)e[u+m]^=~r[(m+2)%10]&r[(m+4)%10]}e[0]^=sN[i],e[1]^=aN[i]}r.fill(0)}var Up=class e extends Cp{constructor(t,r,i,n=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=i,this.enableXOF=n,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fc(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=r2(this.state)}keccak(){oN(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){Np(this);let{blockLen:r,state:i}=this;t=Lp(t);let n=t.length;for(let o=0;o<n;){let u=Math.min(r-this.pos,n-o);for(let m=0;m<u;m++)i[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:i,blockLen:n}=this;t[i]^=r,r&128&&i===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){Np(this,!1),Pp(t),this.finish();let r=this.state,{blockLen:i}=this;for(let n=0,o=t.length;n<o;){this.posOut>=i&&this.keccak();let u=Math.min(i-this.posOut,o-n);t.set(r.subarray(this.posOut,this.posOut+u),n),this.posOut+=u,n+=u}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Fc(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Bm(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){let{blockLen:r,suffix:i,outputLen:n,rounds:o,enableXOF:u}=this;return t||(t=new e(r,i,n,u,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=i,t.outputLen=n,t.enableXOF=u,t.destroyed=this.destroyed,t}},Ma=(e,t,r)=>i2(()=>new Up(t,e,r)),vH=Ma(6,144,224/8),gH=Ma(6,136,256/8),xH=Ma(6,104,384/8),bH=Ma(6,72,512/8),f2=Ma(1,144,224/8),Mm=Ma(1,136,256/8),l2=Ma(1,104,384/8),p2=Ma(1,72,512/8),h2=(e,t,r)=>n2((i={})=>new Up(t,e,i.dkLen===void 0?r:i.dkLen,!0)),_H=h2(31,168,128/8),yH=h2(31,136,256/8);var TH=Bp.bool,RH=Bp.bytes;function lf(e){return t=>(Bp.bytes(t),e(t))}var AH=(()=>{let e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();var BH=lf(f2),pf=(()=>{let e=lf(Mm);return e.create=Mm.create,e})(),MH=lf(l2),CH=lf(p2);var Wr=class extends Error{constructor(t,r){super(t),this.innerError=r,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(t,r=!1){if(t==null)return"undefined";let i=JSON.stringify(t,(n,o)=>typeof o=="bigint"?o.toString():o);return r&&["bigint","string"].includes(typeof t)?i.replace(/['\\"]+/g,""):i}toJSON(){return{name:this.name,code:this.code,message:this.message,innerError:this.innerError}}},Ws=class extends Wr{constructor(t,r){super(`Invalid value given "${Wr.convertToString(t,!0)}". Error: ${r}.`),this.name=this.constructor.name}};var Ca=class extends Ws{constructor(t){super(t,"can not parse as byte data"),this.code=1002}},hf=class extends Ws{constructor(t){super(t,"can not parse as number data"),this.code=1003}};var Dp=class extends Ws{constructor(t){super(t,"can not be converted to hex"),this.code=1006}};var d2="An Rpc error has occured with a code of *code*",ji={[-32700]:{message:"Parse error",description:"Invalid JSON"},[-32600]:{message:"Invalid request",description:"JSON is not a valid request object "},[-32601]:{message:"Method not found",description:"Method does not exist "},[-32602]:{message:"Invalid params",description:"Invalid method parameters"},[-32603]:{message:"Internal error",description:"Internal JSON-RPC error"},[-32e3]:{message:"Invalid input",description:"Missing or invalid parameters"},[-32001]:{message:"Resource not found",description:"Requested resource not found"},[-32002]:{message:"Resource unavailable",description:"Requested resource not available"},[-32003]:{message:"Transaction rejected",description:"Transaction creation failed"},[-32004]:{message:"Method not supported",description:"Method is not implemented"},[-32005]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[-32006]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[4001]:{name:"User Rejected Request",message:"The user rejected the request."},[4100]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[4200]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[4900]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[4901]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};var Oi=class extends Wr{constructor(t,r){super(r??d2.replace("*code*",t.error.code.toString())),this.code=t.error.code,this.id=t.id,this.jsonrpc=t.jsonrpc,this.jsonRpcError=t.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}};var Cm=class extends Oi{constructor(t){super(t,ji[-32700].message),this.code=-32700}},Lm=class extends Oi{constructor(t){super(t,ji[-32600].message),this.code=-32600}},Um=class extends Oi{constructor(t){super(t,ji[-32601].message),this.code=-32601}},Dm=class extends Oi{constructor(t){super(t,ji[-32602].message),this.code=-32602}},qm=class extends Oi{constructor(t){super(t,ji[-32603].message),this.code=-32603}},Fm=class extends Oi{constructor(t){super(t,ji[-32e3].message),this.code=-32e3}},Hm=class extends Oi{constructor(t){super(t,ji[-32004].message),this.code=-32004}},zm=class extends Oi{constructor(t){super(t,ji[-32002].message),this.code=-32002}},Vm=class extends Oi{constructor(t){super(t,ji[-32001].message),this.code=-32001}},jm=class extends Oi{constructor(t){super(t,ji[-32006].message),this.code=-32006}},Wm=class extends Oi{constructor(t){super(t,ji[-32003].message),this.code=-32003}},Km=class extends Oi{constructor(t){super(t,ji[-32005].message),this.code=-32005}},Wi=new Map;Wi.set(-32700,{error:Cm});Wi.set(-32600,{error:Lm});Wi.set(-32601,{error:Um});Wi.set(-32602,{error:Dm});Wi.set(-32603,{error:qm});Wi.set(-32e3,{error:Fm});Wi.set(-32004,{error:Hm});Wi.set(-32002,{error:zm});Wi.set(-32003,{error:Wm});Wi.set(-32001,{error:Vm});Wi.set(-32006,{error:jm});Wi.set(-32005,{error:Km});var qp=class extends Wr{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=1200}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}};var St;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let o={};for(let u of n)o[u]=u;return o},e.getValidEnumValues=n=>{let o=e.objectKeys(n).filter(m=>typeof n[n[m]]!="number"),u={};for(let m of o)u[m]=n[m];return e.objectValues(u)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&o.push(u);return o},e.find=(n,o)=>{for(let u of n)if(o(u))return u},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(u=>typeof u=="string"?`'${u}'`:u).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(St||(St={}));var $m;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})($m||($m={}));var ve=St.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),La=e=>{switch(typeof e){case"undefined":return ve.undefined;case"string":return ve.string;case"number":return isNaN(e)?ve.nan:ve.number;case"boolean":return ve.boolean;case"function":return ve.function;case"bigint":return ve.bigint;case"symbol":return ve.symbol;case"object":return Array.isArray(e)?ve.array:e===null?ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ve.promise:typeof Map<"u"&&e instanceof Map?ve.map:typeof Set<"u"&&e instanceof Set?ve.set:typeof Date<"u"&&e instanceof Date?ve.date:ve.object;default:return ve.unknown}},fe=St.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Ki=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(o){return o.message},i={_errors:[]},n=o=>{for(let u of o.issues)if(u.code==="invalid_union")u.unionErrors.map(n);else if(u.code==="invalid_return_type")n(u.returnTypeError);else if(u.code==="invalid_arguments")n(u.argumentsError);else if(u.path.length===0)i._errors.push(r(u));else{let m=i,_=0;for(;_<u.path.length;){let w=u.path[_];_===u.path.length-1?(m[w]=m[w]||{_errors:[]},m[w]._errors.push(r(u))):m[w]=m[w]||{_errors:[]},m=m[w],_++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,St.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Ki.create=e=>new Ki(e);var Tf=(e,t)=>{let r;switch(e.code){case fe.invalid_type:e.received===ve.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case fe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,St.jsonStringifyReplacer)}`;break;case fe.unrecognized_keys:r=`Unrecognized key(s) in object: ${St.joinValues(e.keys,", ")}`;break;case fe.invalid_union:r="Invalid input";break;case fe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${St.joinValues(e.options)}`;break;case fe.invalid_enum_value:r=`Invalid enum value. Expected ${St.joinValues(e.options)}, received '${e.received}'`;break;case fe.invalid_arguments:r="Invalid function arguments";break;case fe.invalid_return_type:r="Invalid function return type";break;case fe.invalid_date:r="Invalid date";break;case fe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:St.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case fe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case fe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case fe.custom:r="Invalid input";break;case fe.invalid_intersection_types:r="Intersection results could not be merged";break;case fe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case fe.not_finite:r="Number must be finite";break;default:r=t.defaultError,St.assertNever(e)}return{message:r}},g2=Tf;function bN(e){g2=e}function Hp(){return g2}var zp=e=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,o=[...r,...n.path||[]],u={...n,path:o},m="",_=i.filter(w=>!!w).slice().reverse();for(let w of _)m=w(u,{data:t,defaultError:m}).message;return{...n,path:o,message:n.message||m}},_N=[];function be(e,t){let r=zp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Hp(),Tf].filter(i=>!!i)});e.common.issues.push(r)}var ui=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let i=[];for(let n of r){if(n.status==="aborted")return ze;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return e.mergeObjectSync(t,i)}static mergeObjectSync(t,r){let i={};for(let n of r){let{key:o,value:u}=n;if(o.status==="aborted"||u.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof u.value<"u"||n.alwaysSet)&&(i[o.value]=u.value)}return{status:t.value,value:i}}},ze=Object.freeze({status:"aborted"}),x2=e=>({status:"dirty",value:e}),bi=e=>({status:"valid",value:e}),Ym=e=>e.status==="aborted",Zm=e=>e.status==="dirty",Rf=e=>e.status==="valid",Vp=e=>typeof Promise<"u"&&e instanceof Promise,Ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ae||(Ae={}));var pn=class{constructor(t,r,i,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},m2=(e,t)=>{if(Rf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ki(e.common.issues);return this._error=r,this._error}}};function tt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(u,m)=>u.code!=="invalid_type"?{message:m.defaultError}:typeof m.data>"u"?{message:i??m.defaultError}:{message:r??m.defaultError},description:n}}var rt=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return La(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:La(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ui,ctx:{common:t.parent.common,data:t.data,parsedType:La(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Vp(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:La(t)},o=this._parseSync({data:t,path:n.path,parent:n});return m2(n,o)}async parseAsync(t,r){let i=await this.safeParseAsync(t,r);if(i.success)return i.data;throw i.error}async safeParseAsync(t,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:La(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(Vp(n)?n:Promise.resolve(n));return m2(i,o)}refine(t,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let u=t(n),m=()=>o.addIssue({code:fe.custom,...i(n)});return typeof Promise<"u"&&u instanceof Promise?u.then(_=>_?!0:(m(),!1)):u?!0:(m(),!1)})}refinement(t,r){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(t){return new Gi({schema:this,typeName:Ne.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return kn.create(this,this._def)}nullable(){return $s.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gs.create(this,this._def)}promise(){return qa.create(this,this._def)}or(t){return Lo.create([this,t],this._def)}and(t){return Uo.create(this,t,this._def)}transform(t){return new Gi({...tt(this._def),schema:this,typeName:Ne.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new zo({...tt(this._def),innerType:this,defaultValue:r,typeName:Ne.ZodDefault})}brand(){return new Gp({typeName:Ne.ZodBranded,type:this,...tt(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Gc({...tt(this._def),innerType:this,catchValue:r,typeName:Ne.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Af.create(this,t)}readonly(){return Yc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yN=/^c[^\s-]{8,}$/i,wN=/^[a-z][a-z0-9]*$/,SN=/^[0-9A-HJKMNP-TV-Z]{26}$/,EN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,IN=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,TN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Gm,RN=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,AN=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ON=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function kN(e,t){return!!((t==="v4"||!t)&&RN.test(e)||(t==="v6"||!t)&&AN.test(e))}var Ua=class e extends rt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ve.string){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.string,received:o.parsedType}),ze}let i=new ui,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let u=t.data.length>o.value,m=t.data.length<o.value;(u||m)&&(n=this._getOrReturnCtx(t,n),u?be(n,{code:fe.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):m&&be(n,{code:fe.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")IN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"email",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Gm||(Gm=new RegExp(TN,"u")),Gm.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"emoji",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")EN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"uuid",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")yN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"cuid",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")wN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"cuid2",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")SN.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"ulid",code:fe.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),be(n,{validation:"url",code:fe.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"regex",code:fe.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?ON(o).test(t.data)||(n=this._getOrReturnCtx(t,n),be(n,{code:fe.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="ip"?kN(t.data,o.version)||(n=this._getOrReturnCtx(t,n),be(n,{validation:"ip",code:fe.invalid_string,message:o.message}),i.dirty()):St.assertNever(o);return{status:i.value,value:t.data}}_regex(t,r,i){return this.refinement(n=>t.test(n),{validation:r,code:fe.invalid_string,...Ae.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ae.errToObj(t)})}datetime(t){var r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,...Ae.errToObj(t?.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ae.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Ae.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ae.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ae.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ae.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ae.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ae.errToObj(r)})}nonempty(t){return this.min(1,Ae.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ua.create=e=>{var t;return new Ua({checks:[],typeName:Ne.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...tt(e)})};function PN(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=parseInt(e.toFixed(n).replace(".","")),u=parseInt(t.toFixed(n).replace(".",""));return o%u/Math.pow(10,n)}var ko=class e extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ve.number){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.number,received:o.parsedType}),ze}let i,n=new ui;for(let o of this._def.checks)o.kind==="int"?St.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),be(i,{code:fe.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?PN(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),be(i,{code:fe.not_finite,message:o.message}),n.dirty()):St.assertNever(o);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ae.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Ae.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ae.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&St.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ko.create=e=>new ko({checks:[],typeName:Ne.ZodNumber,coerce:e?.coerce||!1,...tt(e)});var Po=class e extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ve.bigint){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.bigint,received:o.parsedType}),ze}let i,n=new ui;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),be(i,{code:fe.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):St.assertNever(o);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ae.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Ae.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Po.create=e=>{var t;return new Po({checks:[],typeName:Ne.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...tt(e)})};var No=class extends rt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ve.boolean){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.boolean,received:i.parsedType}),ze}return bi(t.data)}};No.create=e=>new No({typeName:Ne.ZodBoolean,coerce:e?.coerce||!1,...tt(e)});var Bo=class e extends rt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ve.date){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_type,expected:ve.date,received:o.parsedType}),ze}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return be(o,{code:fe.invalid_date}),ze}let i=new ui,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),be(n,{code:fe.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):St.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ae.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ae.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Bo.create=e=>new Bo({checks:[],coerce:e?.coerce||!1,typeName:Ne.ZodDate,...tt(e)});var Vc=class extends rt{_parse(t){if(this._getType(t)!==ve.symbol){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.symbol,received:i.parsedType}),ze}return bi(t.data)}};Vc.create=e=>new Vc({typeName:Ne.ZodSymbol,...tt(e)});var Mo=class extends rt{_parse(t){if(this._getType(t)!==ve.undefined){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.undefined,received:i.parsedType}),ze}return bi(t.data)}};Mo.create=e=>new Mo({typeName:Ne.ZodUndefined,...tt(e)});var Co=class extends rt{_parse(t){if(this._getType(t)!==ve.null){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.null,received:i.parsedType}),ze}return bi(t.data)}};Co.create=e=>new Co({typeName:Ne.ZodNull,...tt(e)});var Da=class extends rt{constructor(){super(...arguments),this._any=!0}_parse(t){return bi(t.data)}};Da.create=e=>new Da({typeName:Ne.ZodAny,...tt(e)});var Ks=class extends rt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bi(t.data)}};Ks.create=e=>new Ks({typeName:Ne.ZodUnknown,...tt(e)});var Pn=class extends rt{_parse(t){let r=this._getOrReturnCtx(t);return be(r,{code:fe.invalid_type,expected:ve.never,received:r.parsedType}),ze}};Pn.create=e=>new Pn({typeName:Ne.ZodNever,...tt(e)});var jc=class extends rt{_parse(t){if(this._getType(t)!==ve.undefined){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.void,received:i.parsedType}),ze}return bi(t.data)}};jc.create=e=>new jc({typeName:Ne.ZodVoid,...tt(e)});var Gs=class e extends rt{_parse(t){let{ctx:r,status:i}=this._processInputParams(t),n=this._def;if(r.parsedType!==ve.array)return be(r,{code:fe.invalid_type,expected:ve.array,received:r.parsedType}),ze;if(n.exactLength!==null){let u=r.data.length>n.exactLength.value,m=r.data.length<n.exactLength.value;(u||m)&&(be(r,{code:u?fe.too_big:fe.too_small,minimum:m?n.exactLength.value:void 0,maximum:u?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(be(r,{code:fe.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(be(r,{code:fe.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((u,m)=>n.type._parseAsync(new pn(r,u,r.path,m)))).then(u=>ui.mergeArray(i,u));let o=[...r.data].map((u,m)=>n.type._parseSync(new pn(r,u,r.path,m)));return ui.mergeArray(i,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Ae.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Ae.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Ae.toString(r)}})}nonempty(t){return this.min(1,t)}};Gs.create=(e,t)=>new Gs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ne.ZodArray,...tt(t)});function zc(e){if(e instanceof ki){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=kn.create(zc(i))}return new ki({...e._def,shape:()=>t})}else return e instanceof Gs?new Gs({...e._def,type:zc(e.element)}):e instanceof kn?kn.create(zc(e.unwrap())):e instanceof $s?$s.create(zc(e.unwrap())):e instanceof ns?ns.create(e.items.map(t=>zc(t))):e}var ki=class e extends rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=St.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ve.object){let w=this._getOrReturnCtx(t);return be(w,{code:fe.invalid_type,expected:ve.object,received:w.parsedType}),ze}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:u}=this._getCached(),m=[];if(!(this._def.catchall instanceof Pn&&this._def.unknownKeys==="strip"))for(let w in n.data)u.includes(w)||m.push(w);let _=[];for(let w of u){let I=o[w],T=n.data[w];_.push({key:{status:"valid",value:w},value:I._parse(new pn(n,T,n.path,w)),alwaysSet:w in n.data})}if(this._def.catchall instanceof Pn){let w=this._def.unknownKeys;if(w==="passthrough")for(let I of m)_.push({key:{status:"valid",value:I},value:{status:"valid",value:n.data[I]}});else if(w==="strict")m.length>0&&(be(n,{code:fe.unrecognized_keys,keys:m}),i.dirty());else if(w!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let w=this._def.catchall;for(let I of m){let T=n.data[I];_.push({key:{status:"valid",value:I},value:w._parse(new pn(n,T,n.path,I)),alwaysSet:I in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let w=[];for(let I of _){let T=await I.key;w.push({key:T,value:await I.value,alwaysSet:I.alwaysSet})}return w}).then(w=>ui.mergeObjectSync(i,w)):ui.mergeObjectSync(i,_)}get shape(){return this._def.shape()}strict(t){return Ae.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,i)=>{var n,o,u,m;let _=(u=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,r,i).message)!==null&&u!==void 0?u:i.defaultError;return r.code==="unrecognized_keys"?{message:(m=Ae.errToObj(t).message)!==null&&m!==void 0?m:_}:{message:_}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ne.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return St.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return St.objectKeys(this.shape).forEach(i=>{t[i]||(r[i]=this.shape[i])}),new e({...this._def,shape:()=>r})}deepPartial(){return zc(this)}partial(t){let r={};return St.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];t&&!t[i]?r[i]=n:r[i]=n.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return St.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])r[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof kn;)o=o._def.innerType;r[i]=o}}),new e({...this._def,shape:()=>r})}keyof(){return b2(St.objectKeys(this.shape))}};ki.create=(e,t)=>new ki({shape:()=>e,unknownKeys:"strip",catchall:Pn.create(),typeName:Ne.ZodObject,...tt(t)});ki.strictCreate=(e,t)=>new ki({shape:()=>e,unknownKeys:"strict",catchall:Pn.create(),typeName:Ne.ZodObject,...tt(t)});ki.lazycreate=(e,t)=>new ki({shape:e,unknownKeys:"strip",catchall:Pn.create(),typeName:Ne.ZodObject,...tt(t)});var Lo=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i=this._def.options;function n(o){for(let m of o)if(m.result.status==="valid")return m.result;for(let m of o)if(m.result.status==="dirty")return r.common.issues.push(...m.ctx.common.issues),m.result;let u=o.map(m=>new Ki(m.ctx.common.issues));return be(r,{code:fe.invalid_union,unionErrors:u}),ze}if(r.common.async)return Promise.all(i.map(async o=>{let u={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:u}),ctx:u}})).then(n);{let o,u=[];for(let _ of i){let w={...r,common:{...r.common,issues:[]},parent:null},I=_._parseSync({data:r.data,path:r.path,parent:w});if(I.status==="valid")return I;I.status==="dirty"&&!o&&(o={result:I,ctx:w}),w.common.issues.length&&u.push(w.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let m=u.map(_=>new Ki(_));return be(r,{code:fe.invalid_union,unionErrors:m}),ze}}get options(){return this._def.options}};Lo.create=(e,t)=>new Lo({options:e,typeName:Ne.ZodUnion,...tt(t)});var Fp=e=>e instanceof Do?Fp(e.schema):e instanceof Gi?Fp(e.innerType()):e instanceof qo?[e.value]:e instanceof Fo?e.options:e instanceof Ho?Object.keys(e.enum):e instanceof zo?Fp(e._def.innerType):e instanceof Mo?[void 0]:e instanceof Co?[null]:null,jp=class e extends rt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ve.object)return be(r,{code:fe.invalid_type,expected:ve.object,received:r.parsedType}),ze;let i=this.discriminator,n=r.data[i],o=this.optionsMap.get(n);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(be(r,{code:fe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){let n=new Map;for(let o of r){let u=Fp(o.shape[t]);if(!u)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let m of u){if(n.has(m))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(m)}`);n.set(m,o)}}return new e({typeName:Ne.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...tt(i)})}};function Xm(e,t){let r=La(e),i=La(t);if(e===t)return{valid:!0,data:e};if(r===ve.object&&i===ve.object){let n=St.objectKeys(t),o=St.objectKeys(e).filter(m=>n.indexOf(m)!==-1),u={...e,...t};for(let m of o){let _=Xm(e[m],t[m]);if(!_.valid)return{valid:!1};u[m]=_.data}return{valid:!0,data:u}}else if(r===ve.array&&i===ve.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<e.length;o++){let u=e[o],m=t[o],_=Xm(u,m);if(!_.valid)return{valid:!1};n.push(_.data)}return{valid:!0,data:n}}else return r===ve.date&&i===ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Uo=class extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=(o,u)=>{if(Ym(o)||Ym(u))return ze;let m=Xm(o.value,u.value);return m.valid?((Zm(o)||Zm(u))&&r.dirty(),{status:r.value,value:m.data}):(be(i,{code:fe.invalid_intersection_types}),ze)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,u])=>n(o,u)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Uo.create=(e,t,r)=>new Uo({left:e,right:t,typeName:Ne.ZodIntersection,...tt(r)});var ns=class e extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.array)return be(i,{code:fe.invalid_type,expected:ve.array,received:i.parsedType}),ze;if(i.data.length<this._def.items.length)return be(i,{code:fe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&i.data.length>this._def.items.length&&(be(i,{code:fe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...i.data].map((u,m)=>{let _=this._def.items[m]||this._def.rest;return _?_._parse(new pn(i,u,i.path,m)):null}).filter(u=>!!u);return i.common.async?Promise.all(o).then(u=>ui.mergeArray(r,u)):ui.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ns.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ns({items:e,typeName:Ne.ZodTuple,rest:null,...tt(t)})};var Wp=class e extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.object)return be(i,{code:fe.invalid_type,expected:ve.object,received:i.parsedType}),ze;let n=[],o=this._def.keyType,u=this._def.valueType;for(let m in i.data)n.push({key:o._parse(new pn(i,m,i.path,m)),value:u._parse(new pn(i,i.data[m],i.path,m))});return i.common.async?ui.mergeObjectAsync(r,n):ui.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,i){return r instanceof rt?new e({keyType:t,valueType:r,typeName:Ne.ZodRecord,...tt(i)}):new e({keyType:Ua.create(),valueType:t,typeName:Ne.ZodRecord,...tt(r)})}},Wc=class extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.map)return be(i,{code:fe.invalid_type,expected:ve.map,received:i.parsedType}),ze;let n=this._def.keyType,o=this._def.valueType,u=[...i.data.entries()].map(([m,_],w)=>({key:n._parse(new pn(i,m,i.path,[w,"key"])),value:o._parse(new pn(i,_,i.path,[w,"value"]))}));if(i.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let _ of u){let w=await _.key,I=await _.value;if(w.status==="aborted"||I.status==="aborted")return ze;(w.status==="dirty"||I.status==="dirty")&&r.dirty(),m.set(w.value,I.value)}return{status:r.value,value:m}})}else{let m=new Map;for(let _ of u){let w=_.key,I=_.value;if(w.status==="aborted"||I.status==="aborted")return ze;(w.status==="dirty"||I.status==="dirty")&&r.dirty(),m.set(w.value,I.value)}return{status:r.value,value:m}}}};Wc.create=(e,t,r)=>new Wc({valueType:t,keyType:e,typeName:Ne.ZodMap,...tt(r)});var Kc=class e extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ve.set)return be(i,{code:fe.invalid_type,expected:ve.set,received:i.parsedType}),ze;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(be(i,{code:fe.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(be(i,{code:fe.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function u(_){let w=new Set;for(let I of _){if(I.status==="aborted")return ze;I.status==="dirty"&&r.dirty(),w.add(I.value)}return{status:r.value,value:w}}let m=[...i.data.values()].map((_,w)=>o._parse(new pn(i,_,i.path,w)));return i.common.async?Promise.all(m).then(_=>u(_)):u(m)}min(t,r){return new e({...this._def,minSize:{value:t,message:Ae.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Ae.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Kc.create=(e,t)=>new Kc({valueType:e,minSize:null,maxSize:null,typeName:Ne.ZodSet,...tt(t)});var Kp=class e extends rt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ve.function)return be(r,{code:fe.invalid_type,expected:ve.function,received:r.parsedType}),ze;function i(m,_){return zp({data:m,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hp(),Tf].filter(w=>!!w),issueData:{code:fe.invalid_arguments,argumentsError:_}})}function n(m,_){return zp({data:m,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hp(),Tf].filter(w=>!!w),issueData:{code:fe.invalid_return_type,returnTypeError:_}})}let o={errorMap:r.common.contextualErrorMap},u=r.data;if(this._def.returns instanceof qa){let m=this;return bi(async function(..._){let w=new Ki([]),I=await m._def.args.parseAsync(_,o).catch(C=>{throw w.addIssue(i(_,C)),w}),T=await Reflect.apply(u,this,I);return await m._def.returns._def.type.parseAsync(T,o).catch(C=>{throw w.addIssue(n(T,C)),w})})}else{let m=this;return bi(function(..._){let w=m._def.args.safeParse(_,o);if(!w.success)throw new Ki([i(_,w.error)]);let I=Reflect.apply(u,this,w.data),T=m._def.returns.safeParse(I,o);if(!T.success)throw new Ki([n(I,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ns.create(t).rest(Ks.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new e({args:t||ns.create([]).rest(Ks.create()),returns:r||Ks.create(),typeName:Ne.ZodFunction,...tt(i)})}},Do=class extends rt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Do.create=(e,t)=>new Do({getter:e,typeName:Ne.ZodLazy,...tt(t)});var qo=class extends rt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return be(r,{received:r.data,code:fe.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}};qo.create=(e,t)=>new qo({value:e,typeName:Ne.ZodLiteral,...tt(t)});function b2(e,t){return new Fo({values:e,typeName:Ne.ZodEnum,...tt(t)})}var Fo=class e extends rt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),i=this._def.values;return be(r,{expected:St.joinValues(i),received:r.parsedType,code:fe.invalid_type}),ze}if(this._def.values.indexOf(t.data)===-1){let r=this._getOrReturnCtx(t),i=this._def.values;return be(r,{received:r.data,code:fe.invalid_enum_value,options:i}),ze}return bi(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t){return e.create(t)}exclude(t){return e.create(this.options.filter(r=>!t.includes(r)))}};Fo.create=b2;var Ho=class extends rt{_parse(t){let r=St.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==ve.string&&i.parsedType!==ve.number){let n=St.objectValues(r);return be(i,{expected:St.joinValues(n),received:i.parsedType,code:fe.invalid_type}),ze}if(r.indexOf(t.data)===-1){let n=St.objectValues(r);return be(i,{received:i.data,code:fe.invalid_enum_value,options:n}),ze}return bi(t.data)}get enum(){return this._def.values}};Ho.create=(e,t)=>new Ho({values:e,typeName:Ne.ZodNativeEnum,...tt(t)});var qa=class extends rt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ve.promise&&r.common.async===!1)return be(r,{code:fe.invalid_type,expected:ve.promise,received:r.parsedType}),ze;let i=r.parsedType===ve.promise?r.data:Promise.resolve(r.data);return bi(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};qa.create=(e,t)=>new qa({type:e,typeName:Ne.ZodPromise,...tt(t)});var Gi=class extends rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:u=>{be(i,u),u.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let u=n.transform(i.data,o);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(u).then(m=>this._def.schema._parseAsync({data:m,path:i.path,parent:i})):this._def.schema._parseSync({data:u,path:i.path,parent:i})}if(n.type==="refinement"){let u=m=>{let _=n.refinement(m,o);if(i.common.async)return Promise.resolve(_);if(_ instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(i.common.async===!1){let m=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return m.status==="aborted"?ze:(m.status==="dirty"&&r.dirty(),u(m.value),{status:r.value,value:m.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(m=>m.status==="aborted"?ze:(m.status==="dirty"&&r.dirty(),u(m.value).then(()=>({status:r.value,value:m.value}))))}if(n.type==="transform")if(i.common.async===!1){let u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Rf(u))return u;let m=n.transform(u.value,o);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:m}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>Rf(u)?Promise.resolve(n.transform(u.value,o)).then(m=>({status:r.value,value:m})):u);St.assertNever(n)}};Gi.create=(e,t,r)=>new Gi({schema:e,typeName:Ne.ZodEffects,effect:t,...tt(r)});Gi.createWithPreprocess=(e,t,r)=>new Gi({schema:t,effect:{type:"preprocess",transform:e},typeName:Ne.ZodEffects,...tt(r)});var kn=class extends rt{_parse(t){return this._getType(t)===ve.undefined?bi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};kn.create=(e,t)=>new kn({innerType:e,typeName:Ne.ZodOptional,...tt(t)});var $s=class extends rt{_parse(t){return this._getType(t)===ve.null?bi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};$s.create=(e,t)=>new $s({innerType:e,typeName:Ne.ZodNullable,...tt(t)});var zo=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return r.parsedType===ve.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};zo.create=(e,t)=>new zo({innerType:e,typeName:Ne.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...tt(t)});var Gc=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Vp(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ki(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ki(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Gc.create=(e,t)=>new Gc({innerType:e,typeName:Ne.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...tt(t)});var $c=class extends rt{_parse(t){if(this._getType(t)!==ve.nan){let i=this._getOrReturnCtx(t);return be(i,{code:fe.invalid_type,expected:ve.nan,received:i.parsedType}),ze}return{status:"valid",value:t.data}}};$c.create=e=>new $c({typeName:Ne.ZodNaN,...tt(e)});var NN=Symbol("zod_brand"),Gp=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},Af=class e extends rt{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?ze:o.status==="dirty"?(r.dirty(),x2(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?ze:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,r){return new e({in:t,out:r,typeName:Ne.ZodPipeline})}},Yc=class extends rt{_parse(t){let r=this._def.innerType._parse(t);return Rf(r)&&(r.value=Object.freeze(r.value)),r}};Yc.create=(e,t)=>new Yc({innerType:e,typeName:Ne.ZodReadonly,...tt(t)});var _2=(e,t={},r)=>e?Da.create().superRefine((i,n)=>{var o,u;if(!e(i)){let m=typeof t=="function"?t(i):typeof t=="string"?{message:t}:t,_=(u=(o=m.fatal)!==null&&o!==void 0?o:r)!==null&&u!==void 0?u:!0,w=typeof m=="string"?{message:m}:m;n.addIssue({code:"custom",...w,fatal:_})}}):Da.create(),BN={object:ki.lazycreate},Ne;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ne||(Ne={}));var MN=(e,t={message:`Input not instance of ${e.name}`})=>_2(r=>r instanceof e,t),y2=Ua.create,w2=ko.create,CN=$c.create,LN=Po.create,S2=No.create,UN=Bo.create,DN=Vc.create,qN=Mo.create,FN=Co.create,HN=Da.create,zN=Ks.create,VN=Pn.create,jN=jc.create,WN=Gs.create,KN=ki.create,GN=ki.strictCreate,$N=Lo.create,YN=jp.create,ZN=Uo.create,XN=ns.create,JN=Wp.create,QN=Wc.create,e7=Kc.create,t7=Kp.create,r7=Do.create,i7=qo.create,n7=Fo.create,s7=Ho.create,a7=qa.create,v2=Gi.create,o7=kn.create,c7=$s.create,u7=Gi.createWithPreprocess,f7=Af.create,l7=()=>y2().optional(),p7=()=>w2().optional(),h7=()=>S2().optional(),d7={string:e=>Ua.create({...e,coerce:!0}),number:e=>ko.create({...e,coerce:!0}),boolean:e=>No.create({...e,coerce:!0}),bigint:e=>Po.create({...e,coerce:!0}),date:e=>Bo.create({...e,coerce:!0})},m7=ze,Nn=Object.freeze({__proto__:null,defaultErrorMap:Tf,setErrorMap:bN,getErrorMap:Hp,makeIssue:zp,EMPTY_PATH:_N,addIssueToContext:be,ParseStatus:ui,INVALID:ze,DIRTY:x2,OK:bi,isAborted:Ym,isDirty:Zm,isValid:Rf,isAsync:Vp,get util(){return St},get objectUtil(){return $m},ZodParsedType:ve,getParsedType:La,ZodType:rt,ZodString:Ua,ZodNumber:ko,ZodBigInt:Po,ZodBoolean:No,ZodDate:Bo,ZodSymbol:Vc,ZodUndefined:Mo,ZodNull:Co,ZodAny:Da,ZodUnknown:Ks,ZodNever:Pn,ZodVoid:jc,ZodArray:Gs,ZodObject:ki,ZodUnion:Lo,ZodDiscriminatedUnion:jp,ZodIntersection:Uo,ZodTuple:ns,ZodRecord:Wp,ZodMap:Wc,ZodSet:Kc,ZodFunction:Kp,ZodLazy:Do,ZodLiteral:qo,ZodEnum:Fo,ZodNativeEnum:Ho,ZodPromise:qa,ZodEffects:Gi,ZodTransformer:Gi,ZodOptional:kn,ZodNullable:$s,ZodDefault:zo,ZodCatch:Gc,ZodNaN:$c,BRAND:NN,ZodBranded:Gp,ZodPipeline:Af,ZodReadonly:Yc,custom:_2,Schema:rt,ZodSchema:rt,late:BN,get ZodFirstPartyTypeKind(){return Ne},coerce:d7,any:HN,array:WN,bigint:LN,boolean:S2,date:UN,discriminatedUnion:YN,effect:v2,enum:n7,function:t7,instanceof:MN,intersection:ZN,lazy:r7,literal:i7,map:QN,nan:CN,nativeEnum:s7,never:VN,null:FN,nullable:c7,number:w2,object:KN,oboolean:h7,onumber:p7,optional:o7,ostring:l7,pipeline:f7,preprocess:u7,promise:a7,record:JN,set:e7,strictObject:GN,string:y2,symbol:DN,transformer:v2,tuple:XN,undefined:qN,union:$N,unknown:zN,void:jN,NEVER:m7,ZodIssueCode:fe,quotelessJson:xN,ZodError:Ki});var g7=e=>e.message?e.message:"unspecified error",Ys=class extends Wr{constructor(t){super(),this.code=1100,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
37
37
  ${this._compileErrors().join(`
38
- `)}`}_compileErrors(){return this.errors.map(g7)}};var Bn={};Oa(Bn,{abiSchemaToJsonSchema:()=>Zp,codePointToInt:()=>R2,ensureIfUint8Array:()=>iv,ethAbiToJsonSchema:()=>ev,fetchArrayElement:()=>tv,hexToNumber:()=>Xp,hexToUint8Array:()=>Jp,numberToHex:()=>rv,padLeft:()=>A2,parseBaseType:()=>ns,transformJsonDataToAbiFormat:()=>Yp,uint8ArrayToHexString:()=>Of});var E2=["bool","int","uint","bytes","string","address","tuple"];var Jm=e=>typeof e=="object"&&"type"in e&&"name"in e;var I2=e=>typeof e=="string",hr=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e);var $p=e=>typeof e=="number"||typeof e=="bigint"||typeof e=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e);var x7=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],ns=e=>{let t=e.replace(/ /,""),r,i=!1,n=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),n=[...e.matchAll(/(?:\[(\d*)\])/g)].map(o=>parseInt(o[1],10)).map(o=>Number.isNaN(o)?-1:o),i=n.length>0),E2.includes(t))return{baseType:t,isArray:i,baseTypeSize:r,arraySizes:n};if(t.startsWith("int"))r=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))r=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))r=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:n};return{baseType:t,isArray:i,baseTypeSize:r,arraySizes:n}},Qm=(e,t={})=>{if(Object.keys(t).includes("type"))throw new Ys([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);let{baseType:i,baseTypeSize:n}=ns(e);if(!i&&!x7.includes(e))throw new Ys([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(i){if(i==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${i}${n??""}`,required:!0}}return e?{format:e,required:!0}:{}},Zp=(e,t="/0")=>{let r={type:"array",items:[],maxItems:e.length,minItems:e.length};for(let[i,n]of e.entries()){let o,u,m=[];Jm(n)?(o=n.type,u=n.name,m=n.components):typeof n=="string"?(o=n,u=`${t}/${i}`):Array.isArray(n)&&(n[0]&&typeof n[0]=="string"&&n[0].startsWith("tuple")&&!Array.isArray(n[0])&&n[1]&&Array.isArray(n[1])?(o=n[0],u=`${t}/${i}`,m=n[1]):(o="tuple",u=`${t}/${i}`,m=n));let{baseType:_,isArray:w,arraySizes:I}=ns(o),T,N=r;for(let C=I.length-1;C>0;C-=1)T={type:"array",items:[],maxItems:I[C],minItems:I[C]},I[C]<0&&(delete T.maxItems,delete T.minItems),Array.isArray(N.items)?N.items.length===0?N.items=T:N.items.push(T):N.items=[N.items,T],N=T;if(_==="tuple"&&!w){let C=Zp(m,u);C.$id=u,N.items.push(C)}else if(_==="tuple"&&w){let C=I[0],B={$id:u,type:"array",items:Zp(m,u),maxItems:C,minItems:C};C<0&&(delete B.maxItems,delete B.minItems),N.items.push(B)}else if(w){let C=I[0],B={type:"array",$id:u,items:Qm(String(_)),minItems:C,maxItems:C};C<0&&(delete B.maxItems,delete B.minItems),N.items.push(B)}else Array.isArray(N.items)?N.items.push(Object.assign({$id:u},Qm(o))):N.items.items.push(Object.assign({$id:u},Qm(o)));N=r}return r},ev=e=>Zp(e),tv=(e,t)=>t===1?e:tv(e[0],t-1),Yp=(e,t,r)=>{let i=[];for(let[n,o]of e.entries()){let u,m,_=[];Jm(o)?(u=o.type,m=o.name,_=o.components):typeof o=="string"?u=o:Array.isArray(o)&&(o[1]&&Array.isArray(o[1])?(u=o[0],_=o[1]):(u="tuple",_=o));let{baseType:w,isArray:I,arraySizes:T}=ns(u),N=Array.isArray(t)?t[n]:t[m];if(w==="tuple"&&!I)i.push(Yp(_,N,r));else if(w==="tuple"&&I){let C=[];for(let B of N)if(T.length>1){let U=tv(B,T.length-1),Z=[];for(let $ of U)Z.push(Yp(_,$,r));C.push(Z)}else C.push(Yp(_,B,r));i.push(C)}else i.push(N)}return r=r??[],r.push(...i),r},R2=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},Xp=e=>{if(!hr(e))throw new Error("Invalid hex string");let[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],i=BigInt(r);return i>Number.MAX_SAFE_INTEGER?t?-i:i:i<Number.MIN_SAFE_INTEGER?i:t?-1*Number(i):Number(i)},rv=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&hr(e)){let[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],i=r.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${i.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!hr(e))return rv(BigInt(e));throw new hf(e)},A2=(e,t,r="0")=>{if(typeof e=="string"&&!hr(e))return e.padStart(t,r);let i=typeof e=="string"&&hr(e)?e:rv(e),[n,o]=i.startsWith("-")?["-0x",i.slice(3)]:["0x",i.slice(2)];return`${n}${o.padStart(t,r)}`};function Of(e){let t="0x";for(let r of e){let i=r.toString(16);t+=i.length===1?`0${i}`:i}return t}var Zs={zero:48,nine:57,A:65,F:70,a:97,f:102};function T2(e){if(e>=Zs.zero&&e<=Zs.nine)return e-Zs.zero;if(e>=Zs.A&&e<=Zs.F)return e-(Zs.A-10);if(e>=Zs.a&&e<=Zs.f)return e-(Zs.a-10)}function Jp(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new Ca(`hex string has odd length: ${e}`);let r=(e.length-t)/2,i=new Uint8Array(r);for(let n=0,o=t;n<r;n+=1){let u=T2(e.charCodeAt(o++)),m=T2(e.charCodeAt(o++));if(u===void 0||m===void 0)throw new Ca(`Invalid byte sequence ("${e[o-2]}${e[o-1]}" in "${e}").`);i[n]=u*16+m}return i}function iv(e){var t;return!(e instanceof Uint8Array)&&((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}var Qp=e=>{var t;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"},nv=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!Qp(e)||typeof e=="string"&&hr(e)&&e.startsWith("-")||typeof e=="string"&&!hr(e))return!1;let r;if(typeof e=="string"){if(e.length%2!==0)return!1;r=Jp(e)}else if(Array.isArray(e)){if(e.some(i=>i<0||i>255||!Number.isInteger(i)))return!1;r=new Uint8Array(e)}else r=e;if(t?.abiType){let{baseTypeSize:i}=ns(t.abiType);return i?r.length===i:!0}return t?.size?r.length===t?.size:!0};var O2=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;let t=e.slice(2),r=Hc(t.toLowerCase()),i=Of(pf(iv(r))).slice(2);for(let n=0;n<40;n+=1)if(parseInt(i[n],16)>7&&t[n].toUpperCase()!==t[n]||parseInt(i[n],16)<=7&&t[n].toLowerCase()!==t[n])return!1;return!0},ss=(e,t=!0)=>{if(typeof e!="string"&&!Qp(e))return!1;let r;return Qp(e)?r=Of(e):typeof e=="string"&&!hr(e)?r=e.toLowerCase().startsWith("0x")?e:`0x${e}`:r=e,/^(0x)?[0-9a-f]{40}$/i.test(r)?/^(0x|0X)?[0-9a-f]{40}$/.test(r)||/^(0x|0X)?[0-9A-F]{40}$/.test(r)?!0:t?O2(r):!0:!1};var kf;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(kf||(kf={}));var Pf;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(Pf||(Pf={}));var nW={number:kf.BIGINT,bytes:Pf.HEX},sW={number:kf.HEX,bytes:Pf.HEX};var Nf;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized"})(Nf||(Nf={}));var k2;(function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"})(k2||(k2={}));var P2=Object.getPrototypeOf(Uint8Array);var N2=function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(u){u(o)})}return new(r||(r=Promise))(function(o,u){function m(I){try{w(i.next(I))}catch(T){u(T)}}function _(I){try{w(i.throw(I))}catch(T){u(T)}}function w(I){I.done?o(I.value):n(I.value).then(m,_)}w((i=i.apply(e,t||[])).next())})},B2=Symbol.for("web3/base-provider"),sv=class e{static isWeb3Provider(t){return t instanceof e||!!(t&&t[B2])}get[B2](){return!0}send(t,r){this.request(t).then(i=>{r(null,i)}).catch(i=>{r(i)})}sendAsync(t){return N2(this,void 0,void 0,function*(){return this.request(t)})}asEIP1193Provider(){let t=Object.create(this),r=t.request;return t.request=function(n){return N2(this,void 0,void 0,function*(){return(yield r(n)).result})},t.asEIP1193Provider=void 0,t}};var eh=(e,t)=>{let r=e;for(let i=1;i<t;i+=1)r*=e;return r},Fa=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="string"&&e.length===0)return!1;let r;if(t?.abiType){let{baseTypeSize:n}=ns(t.abiType);n&&(r=n)}else t.bitSize&&(r=t.bitSize);let i=eh(BigInt(2),BigInt(r??256))-BigInt(1);try{let n=typeof e=="string"&&hr(e)?BigInt(Xp(e)):BigInt(e);return n>=0&&n<=i}catch{return!1}},Vo=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="number"&&e>Number.MAX_SAFE_INTEGER)return!1;let r;if(t?.abiType){let{baseTypeSize:o,baseType:u}=ns(t.abiType);if(u!=="int")return!1;o&&(r=o)}else t.bitSize&&(r=t.bitSize);let i=eh(BigInt(2),BigInt((r??256)-1)),n=BigInt(-1)*eh(BigInt(2),BigInt((r??256)-1));try{let o=typeof e=="string"&&hr(e)?BigInt(Xp(e)):BigInt(e);return o>=n&&o<=i}catch{return!1}},M2=e=>!!(Vo(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number");var av=e=>Fa(e),th=e=>Object.values(Nf).includes(e),Bf=e=>th(e)||av(e);var rh=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(e)||/^(0x)?[0-9A-F]{512}$/.test(e));var C2=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!hr(e)?e==="1"||e==="0":typeof e=="string"&&hr(e)?e==="0x1"||e==="0x0":e===1||e===0:!1;var Pi=e=>e==null;var ih=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(e)||/^(0x)?[0-9A-F]{64}$/.test(e));var L2=e=>{let t=["fromBlock","toBlock","address","topics","blockHash"];if(Pi(e)||typeof e!="object"||!Object.keys(e).every(r=>t.includes(r))||!Pi(e.fromBlock)&&!Bf(e.fromBlock)||!Pi(e.toBlock)&&!Bf(e.toBlock))return!1;if(!Pi(e.address)){if(Array.isArray(e.address)){if(!e.address.every(r=>ss(r)))return!1}else if(!ss(e.address))return!1}return!(!Pi(e.topics)&&!e.topics.every(r=>Pi(r)?!0:Array.isArray(r)?r.every(i=>ih(i)):!!ih(r)))};var Zc={address:e=>ss(e),bloom:e=>rh(e),blockNumber:e=>av(e),blockTag:e=>th(e),blockNumberOrTag:e=>Bf(e),bool:e=>C2(e),bytes:e=>nv(e),filter:e=>L2(e),hex:e=>hr(e),uint:e=>Fa(e),int:e=>Vo(e),number:e=>M2(e),string:e=>I2(e)};for(let e=8;e<=256;e+=8)Zc[`int${e}`]=t=>Vo(t,{bitSize:e}),Zc[`uint${e}`]=t=>Fa(t,{bitSize:e});for(let e=1;e<=32;e+=1)Zc[`bytes${e}`]=t=>nv(t,{size:e});Zc.bytes256=Zc.bytes;var ov=Zc;var Mf=e=>{if((!e?.type||e?.type==="object")&&e?.properties){let t={};for(let r of Object.keys(e.properties)){let i=Mf(e.properties[r]);i&&(t[r]=i)}return Array.isArray(e.required)?Nn.object(t).partial().required(e.required.reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:!0}),{})):Nn.object(t).partial()}if(e?.type==="array"&&e?.items){if(Array.isArray(e.items)&&e.items.length>0){let t=[];for(let r of e.items){let i=Mf(r);i&&t.push(i)}return Nn.tuple(t)}return Nn.array(Mf(e.items))}if(e.oneOf&&Array.isArray(e.oneOf))return Nn.union(e.oneOf.map(t=>Mf(t)));if(e?.format){if(!ov[e.format])throw new qp(e.format);return Nn.any().refine(ov[e.format],t=>({params:{value:t,format:e.format}}))}return e?.type&&e?.type!=="object"&&typeof Nn[String(e.type)]=="function"?Nn[String(e.type)]():Nn.object({data:Nn.any()}).partial()},nh=class e{static factory(){return e.validatorInstance||(e.validatorInstance=new e),e.validatorInstance}validate(t,r,i){var n,o;let m=Mf(t).safeParse(r);if(!m.success){let _=this.convertErrors((o=(n=m.error)===null||n===void 0?void 0:n.issues)!==null&&o!==void 0?o:[]);if(_){if(i?.silent)return _;throw new Ys(_)}}}convertErrors(t){if(t&&Array.isArray(t)&&t.length>0)return t.map(r=>{var i;let n,o,u,m;m=r.path.join("/");let _=String(r.path[r.path.length-1]),w=r.path.join("/");if(r.code===fe.too_big)o="maxItems",m=`${w}/maxItems`,u={limit:r.maximum},n=`must NOT have more than ${r.maximum} items`;else if(r.code===fe.too_small)o="minItems",m=`${w}/minItems`,u={limit:r.minimum},n=`must NOT have fewer than ${r.minimum} items`;else if(r.code===fe.custom){let{value:I,format:T}=(i=r.params)!==null&&i!==void 0?i:{};typeof I>"u"?n=`value at "/${m}" is required`:n=`value "${typeof I=="object"?JSON.stringify(I):I}" at "/${m}" must pass "${T}" validation`,u={value:I}}return{keyword:o??_,instancePath:w?`/${w}`:"",schemaPath:m?`#${m}`:"#",params:u??{value:r.message},message:n??r.message}})}};var sh=class{constructor(){this._validator=nh.factory()}validateJSONSchema(t,r,i){return this._validator.validate(t,r,i)}validate(t,r,i={silent:!1}){var n,o;let u=ev(t);if(!(Array.isArray(u.items)&&((n=u.items)===null||n===void 0?void 0:n.length)===0&&r.length===0)){if(Array.isArray(u.items)&&((o=u.items)===null||o===void 0?void 0:o.length)===0&&r.length!==0)throw new Ys([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:r}]);return this._validator.validate(u,r,i)}}};var Cf=new sh;function cv(e){var t;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"}var WK={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},fv=e=>{if(Cf.validate(["bytes"],[e]),cv(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return Bn.hexToUint8Array(e);throw new Ca(e)},{uint8ArrayToHexString:w7}=Bn,Lf=e=>w7(fv(e));var Xc=(e,t)=>{typeof e!="bigint"&&Cf.validate(["int"],[e]);let r=Bn.numberToHex(e);return t&&(!r.startsWith("-")&&r.length%2===1?r="0x0".concat(r.slice(2)):r.length%2===0&&r.startsWith("-")&&(r="-0x0".concat(r.slice(3)))),r};var uv=e=>{Cf.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),Lf(new TextEncoder().encode(t))};var Uf=(e,t)=>{if(typeof e=="string"&&ss(e))return t?"address":`0x${e.toLowerCase().replace(/^0x/i,"")}`;if(typeof e=="boolean")return t?"bool":e?"0x01":"0x00";if(typeof e=="number")return t?e<0?"int256":"uint256":Xc(e);if(typeof e=="bigint")return t?"bigint":Xc(e);if(typeof e=="object"&&e)return t?"string":uv(JSON.stringify(e));if(typeof e=="string"){if(e.startsWith("-0x")||e.startsWith("-0X"))return t?"int256":Xc(e);if(hr(e))return t?"bytes":e;if($p(e)&&!Vo(e)&&!Fa(e))return t?"bytes":`0x${e}`;if($p(e)&&!Vo(e)&&Fa(e))return t?"uint":Xc(e);if(!Number.isFinite(e))return t?"string":uv(e)}throw new Dp(e)};var q2=Mr(D2(),1);var{parseBaseType:TG}=Bn;var R7;R7=Symbol.toStringTag;var A7=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,pv=Math.ceil,dn=Math.floor,Ni="[BigNumber Error] ",H2=Ni+"Number primitive has more than 15 significant digits: ",Mn=1e14,Qe=14,hv=9007199254740991,dv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ha=1e7,Zr=1e9;function z2(e){var t,r,i,n=H.prototype={constructor:H,toString:null,valueOf:null},o=new H(1),u=20,m=4,_=-7,w=21,I=-1e7,T=1e7,N=!1,C=1,B=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Z="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function H(O,E){var f,c,p,v,g,x,S,b,l=this;if(!(l instanceof H))return new H(O,E);if(E==null){if(O&&O._isBigNumber===!0){l.s=O.s,!O.c||O.e>T?l.c=l.e=null:O.e<I?l.c=[l.e=0]:(l.e=O.e,l.c=O.c.slice());return}if((x=typeof O=="number")&&O*0==0){if(l.s=1/O<0?(O=-O,-1):1,O===~~O){for(v=0,g=O;g>=10;g/=10,v++);v>T?l.c=l.e=null:(l.e=v,l.c=[O]);return}b=String(O)}else{if(!A7.test(b=String(O)))return i(l,b,x);l.s=b.charCodeAt(0)==45?(b=b.slice(1),-1):1}(v=b.indexOf("."))>-1&&(b=b.replace(".","")),(g=b.search(/e/i))>0?(v<0&&(v=g),v+=+b.slice(g+1),b=b.substring(0,g)):v<0&&(v=b.length)}else{if(xr(E,2,Z.length,"Base"),E==10&&$)return l=new H(O),Se(l,u+l.e+1,m);if(b=String(O),x=typeof O=="number"){if(O*0!=0)return i(l,b,x,E);if(l.s=1/O<0?(b=b.slice(1),-1):1,H.DEBUG&&b.replace(/^0\.0*|\./,"").length>15)throw Error(H2+O)}else l.s=b.charCodeAt(0)===45?(b=b.slice(1),-1):1;for(f=Z.slice(0,E),v=g=0,S=b.length;g<S;g++)if(f.indexOf(c=b.charAt(g))<0){if(c=="."){if(g>v){v=S;continue}}else if(!p&&(b==b.toUpperCase()&&(b=b.toLowerCase())||b==b.toLowerCase()&&(b=b.toUpperCase()))){p=!0,g=-1,v=0;continue}return i(l,String(O),x,E)}x=!1,b=r(b,E,10,l.s),(v=b.indexOf("."))>-1?b=b.replace(".",""):v=b.length}for(g=0;b.charCodeAt(g)===48;g++);for(S=b.length;b.charCodeAt(--S)===48;);if(b=b.slice(g,++S)){if(S-=g,x&&H.DEBUG&&S>15&&(O>hv||O!==dn(O)))throw Error(H2+l.s*O);if((v=v-g-1)>T)l.c=l.e=null;else if(v<I)l.c=[l.e=0];else{if(l.e=v,l.c=[],g=(v+1)%Qe,v<0&&(g+=Qe),g<S){for(g&&l.c.push(+b.slice(0,g)),S-=Qe;g<S;)l.c.push(+b.slice(g,g+=Qe));g=Qe-(b=b.slice(g)).length}else g-=S;for(;g--;b+="0");l.c.push(+b)}}else l.c=[l.e=0]}H.clone=z2,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(O){var E,f;if(O!=null)if(typeof O=="object"){if(O.hasOwnProperty(E="DECIMAL_PLACES")&&(f=O[E],xr(f,0,Zr,E),u=f),O.hasOwnProperty(E="ROUNDING_MODE")&&(f=O[E],xr(f,0,8,E),m=f),O.hasOwnProperty(E="EXPONENTIAL_AT")&&(f=O[E],f&&f.pop?(xr(f[0],-Zr,0,E),xr(f[1],0,Zr,E),_=f[0],w=f[1]):(xr(f,-Zr,Zr,E),_=-(w=f<0?-f:f))),O.hasOwnProperty(E="RANGE"))if(f=O[E],f&&f.pop)xr(f[0],-Zr,-1,E),xr(f[1],1,Zr,E),I=f[0],T=f[1];else if(xr(f,-Zr,Zr,E),f)I=-(T=f<0?-f:f);else throw Error(Ni+E+" cannot be zero: "+f);if(O.hasOwnProperty(E="CRYPTO"))if(f=O[E],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))N=f;else throw N=!f,Error(Ni+"crypto unavailable");else N=f;else throw Error(Ni+E+" not true or false: "+f);if(O.hasOwnProperty(E="MODULO_MODE")&&(f=O[E],xr(f,0,9,E),C=f),O.hasOwnProperty(E="POW_PRECISION")&&(f=O[E],xr(f,0,Zr,E),B=f),O.hasOwnProperty(E="FORMAT"))if(f=O[E],typeof f=="object")U=f;else throw Error(Ni+E+" not an object: "+f);if(O.hasOwnProperty(E="ALPHABET"))if(f=O[E],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))$=f.slice(0,10)=="0123456789",Z=f;else throw Error(Ni+E+" invalid: "+f)}else throw Error(Ni+"Object expected: "+O);return{DECIMAL_PLACES:u,ROUNDING_MODE:m,EXPONENTIAL_AT:[_,w],RANGE:[I,T],CRYPTO:N,MODULO_MODE:C,POW_PRECISION:B,FORMAT:U,ALPHABET:Z}},H.isBigNumber=function(O){if(!O||O._isBigNumber!==!0)return!1;if(!H.DEBUG)return!0;var E,f,c=O.c,p=O.e,v=O.s;e:if({}.toString.call(c)=="[object Array]"){if((v===1||v===-1)&&p>=-Zr&&p<=Zr&&p===dn(p)){if(c[0]===0){if(p===0&&c.length===1)return!0;break e}if(E=(p+1)%Qe,E<1&&(E+=Qe),String(c[0]).length==E){for(E=0;E<c.length;E++)if(f=c[E],f<0||f>=Mn||f!==dn(f))break e;if(f!==0)return!0}}}else if(c===null&&p===null&&(v===null||v===1||v===-1))return!0;throw Error(Ni+"Invalid BigNumber: "+O)},H.maximum=H.max=function(){return ce(arguments,-1)},H.minimum=H.min=function(){return ce(arguments,1)},H.random=function(){var O=9007199254740992,E=Math.random()*O&2097151?function(){return dn(Math.random()*O)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var c,p,v,g,x,S=0,b=[],l=new H(o);if(f==null?f=u:xr(f,0,Zr),g=pv(f/Qe),N)if(crypto.getRandomValues){for(c=crypto.getRandomValues(new Uint32Array(g*=2));S<g;)x=c[S]*131072+(c[S+1]>>>11),x>=9e15?(p=crypto.getRandomValues(new Uint32Array(2)),c[S]=p[0],c[S+1]=p[1]):(b.push(x%1e14),S+=2);S=g/2}else if(crypto.randomBytes){for(c=crypto.randomBytes(g*=7);S<g;)x=(c[S]&31)*281474976710656+c[S+1]*1099511627776+c[S+2]*4294967296+c[S+3]*16777216+(c[S+4]<<16)+(c[S+5]<<8)+c[S+6],x>=9e15?crypto.randomBytes(7).copy(c,S):(b.push(x%1e14),S+=7);S=g/7}else throw N=!1,Error(Ni+"crypto unavailable");if(!N)for(;S<g;)x=E(),x<9e15&&(b[S++]=x%1e14);for(g=b[--S],f%=Qe,g&&f&&(x=dv[Qe-f],b[S]=dn(g/x)*x);b[S]===0;b.pop(),S--);if(S<0)b=[v=0];else{for(v=-1;b[0]===0;b.splice(0,1),v-=Qe);for(S=1,x=b[0];x>=10;x/=10,S++);S<Qe&&(v-=Qe-S)}return l.e=v,l.c=b,l}}(),H.sum=function(){for(var O=1,E=arguments,f=new H(E[0]);O<E.length;)f=f.plus(E[O++]);return f},r=function(){var O="0123456789";function E(f,c,p,v){for(var g,x=[0],S,b=0,l=f.length;b<l;){for(S=x.length;S--;x[S]*=c);for(x[0]+=v.indexOf(f.charAt(b++)),g=0;g<x.length;g++)x[g]>p-1&&(x[g+1]==null&&(x[g+1]=0),x[g+1]+=x[g]/p|0,x[g]%=p)}return x.reverse()}return function(f,c,p,v,g){var x,S,b,l,d,A,D,V,Y=f.indexOf("."),se=u,ae=m;for(Y>=0&&(l=B,B=0,f=f.replace(".",""),V=new H(c),A=V.pow(f.length-Y),B=l,V.c=E(Xs(hn(A.c),A.e,"0"),10,p,O),V.e=V.c.length),D=E(f,c,p,g?(x=Z,O):(x=O,Z)),b=l=D.length;D[--l]==0;D.pop());if(!D[0])return x.charAt(0);if(Y<0?--b:(A.c=D,A.e=b,A.s=v,A=t(A,V,se,ae,p),D=A.c,d=A.r,b=A.e),S=b+se+1,Y=D[S],l=p/2,d=d||S<0||D[S+1]!=null,d=ae<4?(Y!=null||d)&&(ae==0||ae==(A.s<0?3:2)):Y>l||Y==l&&(ae==4||d||ae==6&&D[S-1]&1||ae==(A.s<0?8:7)),S<1||!D[0])f=d?Xs(x.charAt(1),-se,x.charAt(0)):x.charAt(0);else{if(D.length=S,d)for(--p;++D[--S]>p;)D[S]=0,S||(++b,D=[1].concat(D));for(l=D.length;!D[--l];);for(Y=0,f="";Y<=l;f+=x.charAt(D[Y++]));f=Xs(f,b,x.charAt(0))}return f}}(),t=function(){function O(c,p,v){var g,x,S,b,l=0,d=c.length,A=p%Ha,D=p/Ha|0;for(c=c.slice();d--;)S=c[d]%Ha,b=c[d]/Ha|0,g=D*S+b*A,x=A*S+g%Ha*Ha+l,l=(x/v|0)+(g/Ha|0)+D*b,c[d]=x%v;return l&&(c=[l].concat(c)),c}function E(c,p,v,g){var x,S;if(v!=g)S=v>g?1:-1;else for(x=S=0;x<v;x++)if(c[x]!=p[x]){S=c[x]>p[x]?1:-1;break}return S}function f(c,p,v,g){for(var x=0;v--;)c[v]-=x,x=c[v]<p[v]?1:0,c[v]=x*g+c[v]-p[v];for(;!c[0]&&c.length>1;c.splice(0,1));}return function(c,p,v,g,x){var S,b,l,d,A,D,V,Y,se,ae,pe,ye,de,ht,wt,Re,st,et=c.s==p.s?1:-1,Ie=c.c,Te=p.c;if(!Ie||!Ie[0]||!Te||!Te[0])return new H(!c.s||!p.s||(Ie?Te&&Ie[0]==Te[0]:!Te)?NaN:Ie&&Ie[0]==0||!Te?et*0:et/0);for(Y=new H(et),se=Y.c=[],b=c.e-p.e,et=v+b+1,x||(x=Mn,b=mn(c.e/Qe)-mn(p.e/Qe),et=et/Qe|0),l=0;Te[l]==(Ie[l]||0);l++);if(Te[l]>(Ie[l]||0)&&b--,et<0)se.push(1),d=!0;else{for(ht=Ie.length,Re=Te.length,l=0,et+=2,A=dn(x/(Te[0]+1)),A>1&&(Te=O(Te,A,x),Ie=O(Ie,A,x),Re=Te.length,ht=Ie.length),de=Re,ae=Ie.slice(0,Re),pe=ae.length;pe<Re;ae[pe++]=0);st=Te.slice(),st=[0].concat(st),wt=Te[0],Te[1]>=x/2&&wt++;do{if(A=0,S=E(Te,ae,Re,pe),S<0){if(ye=ae[0],Re!=pe&&(ye=ye*x+(ae[1]||0)),A=dn(ye/wt),A>1)for(A>=x&&(A=x-1),D=O(Te,A,x),V=D.length,pe=ae.length;E(D,ae,V,pe)==1;)A--,f(D,Re<V?st:Te,V,x),V=D.length,S=1;else A==0&&(S=A=1),D=Te.slice(),V=D.length;if(V<pe&&(D=[0].concat(D)),f(ae,D,pe,x),pe=ae.length,S==-1)for(;E(Te,ae,Re,pe)<1;)A++,f(ae,Re<pe?st:Te,pe,x),pe=ae.length}else S===0&&(A++,ae=[0]);se[l++]=A,ae[0]?ae[pe++]=Ie[de]||0:(ae=[Ie[de]],pe=1)}while((de++<ht||ae[0]!=null)&&et--);d=ae[0]!=null,se[0]||se.splice(0,1)}if(x==Mn){for(l=1,et=se[0];et>=10;et/=10,l++);Se(Y,v+(Y.e=l+b*Qe-1)+1,g,d)}else Y.e=b,Y.r=+d;return Y}}();function ee(O,E,f,c){var p,v,g,x,S;if(f==null?f=m:xr(f,0,8),!O.c)return O.toString();if(p=O.c[0],g=O.e,E==null)S=hn(O.c),S=c==1||c==2&&(g<=_||g>=w)?ch(S,g):Xs(S,g,"0");else if(O=Se(new H(O),E,f),v=O.e,S=hn(O.c),x=S.length,c==1||c==2&&(E<=v||v<=_)){for(;x<E;S+="0",x++);S=ch(S,v)}else if(E-=g,S=Xs(S,v,"0"),v+1>x){if(--E>0)for(S+=".";E--;S+="0");}else if(E+=v-x,E>0)for(v+1==x&&(S+=".");E--;S+="0");return O.s<0&&p?"-"+S:S}function ce(O,E){for(var f,c,p=1,v=new H(O[0]);p<O.length;p++)c=new H(O[p]),(!c.s||(f=jo(v,c))===E||f===0&&v.s===E)&&(v=c);return v}function ge(O,E,f){for(var c=1,p=E.length;!E[--p];E.pop());for(p=E[0];p>=10;p/=10,c++);return(f=c+f*Qe-1)>T?O.c=O.e=null:f<I?O.c=[O.e=0]:(O.e=f,O.c=E),O}i=function(){var O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,f=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,g,x,S){var b,l=x?g:g.replace(p,"");if(c.test(l))v.s=isNaN(l)?null:l<0?-1:1;else{if(!x&&(l=l.replace(O,function(d,A,D){return b=(D=D.toLowerCase())=="x"?16:D=="b"?2:8,!S||S==b?A:d}),S&&(b=S,l=l.replace(E,"$1").replace(f,"0.$1")),g!=l))return new H(l,b);if(H.DEBUG)throw Error(Ni+"Not a"+(S?" base "+S:"")+" number: "+g);v.s=null}v.c=v.e=null}}();function Se(O,E,f,c){var p,v,g,x,S,b,l,d=O.c,A=dv;if(d){e:{for(p=1,x=d[0];x>=10;x/=10,p++);if(v=E-p,v<0)v+=Qe,g=E,S=d[b=0],l=dn(S/A[p-g-1]%10);else if(b=pv((v+1)/Qe),b>=d.length)if(c){for(;d.length<=b;d.push(0));S=l=0,p=1,v%=Qe,g=v-Qe+1}else break e;else{for(S=x=d[b],p=1;x>=10;x/=10,p++);v%=Qe,g=v-Qe+p,l=g<0?0:dn(S/A[p-g-1]%10)}if(c=c||E<0||d[b+1]!=null||(g<0?S:S%A[p-g-1]),c=f<4?(l||c)&&(f==0||f==(O.s<0?3:2)):l>5||l==5&&(f==4||c||f==6&&(v>0?g>0?S/A[p-g]:0:d[b-1])%10&1||f==(O.s<0?8:7)),E<1||!d[0])return d.length=0,c?(E-=O.e+1,d[0]=A[(Qe-E%Qe)%Qe],O.e=-E||0):d[0]=O.e=0,O;if(v==0?(d.length=b,x=1,b--):(d.length=b+1,x=A[Qe-v],d[b]=g>0?dn(S/A[p-g]%A[g])*x:0),c)for(;;)if(b==0){for(v=1,g=d[0];g>=10;g/=10,v++);for(g=d[0]+=x,x=1;g>=10;g/=10,x++);v!=x&&(O.e++,d[0]==Mn&&(d[0]=1));break}else{if(d[b]+=x,d[b]!=Mn)break;d[b--]=0,x=1}for(v=d.length;d[--v]===0;d.pop());}O.e>T?O.c=O.e=null:O.e<I&&(O.c=[O.e=0])}return O}function me(O){var E,f=O.e;return f===null?O.toString():(E=hn(O.c),E=f<=_||f>=w?ch(E,f):Xs(E,f,"0"),O.s<0?"-"+E:E)}return n.absoluteValue=n.abs=function(){var O=new H(this);return O.s<0&&(O.s=1),O},n.comparedTo=function(O,E){return jo(this,new H(O,E))},n.decimalPlaces=n.dp=function(O,E){var f,c,p,v=this;if(O!=null)return xr(O,0,Zr),E==null?E=m:xr(E,0,8),Se(new H(v),O+v.e+1,E);if(!(f=v.c))return null;if(c=((p=f.length-1)-mn(this.e/Qe))*Qe,p=f[p])for(;p%10==0;p/=10,c--);return c<0&&(c=0),c},n.dividedBy=n.div=function(O,E){return t(this,new H(O,E),u,m)},n.dividedToIntegerBy=n.idiv=function(O,E){return t(this,new H(O,E),0,1)},n.exponentiatedBy=n.pow=function(O,E){var f,c,p,v,g,x,S,b,l,d=this;if(O=new H(O),O.c&&!O.isInteger())throw Error(Ni+"Exponent not an integer: "+me(O));if(E!=null&&(E=new H(E)),x=O.e>14,!d.c||!d.c[0]||d.c[0]==1&&!d.e&&d.c.length==1||!O.c||!O.c[0])return l=new H(Math.pow(+me(d),x?O.s*(2-oh(O)):+me(O))),E?l.mod(E):l;if(S=O.s<0,E){if(E.c?!E.c[0]:!E.s)return new H(NaN);c=!S&&d.isInteger()&&E.isInteger(),c&&(d=d.mod(E))}else{if(O.e>9&&(d.e>0||d.e<-1||(d.e==0?d.c[0]>1||x&&d.c[1]>=24e7:d.c[0]<8e13||x&&d.c[0]<=9999975e7)))return v=d.s<0&&oh(O)?-0:0,d.e>-1&&(v=1/v),new H(S?1/v:v);B&&(v=pv(B/Qe+2))}for(x?(f=new H(.5),S&&(O.s=1),b=oh(O)):(p=Math.abs(+me(O)),b=p%2),l=new H(o);;){if(b){if(l=l.times(d),!l.c)break;v?l.c.length>v&&(l.c.length=v):c&&(l=l.mod(E))}if(p){if(p=dn(p/2),p===0)break;b=p%2}else if(O=O.times(f),Se(O,O.e+1,1),O.e>14)b=oh(O);else{if(p=+me(O),p===0)break;b=p%2}d=d.times(d),v?d.c&&d.c.length>v&&(d.c.length=v):c&&(d=d.mod(E))}return c?l:(S&&(l=o.div(l)),E?l.mod(E):v?Se(l,B,m,g):l)},n.integerValue=function(O){var E=new H(this);return O==null?O=m:xr(O,0,8),Se(E,E.e+1,O)},n.isEqualTo=n.eq=function(O,E){return jo(this,new H(O,E))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(O,E){return jo(this,new H(O,E))>0},n.isGreaterThanOrEqualTo=n.gte=function(O,E){return(E=jo(this,new H(O,E)))===1||E===0},n.isInteger=function(){return!!this.c&&mn(this.e/Qe)>this.c.length-2},n.isLessThan=n.lt=function(O,E){return jo(this,new H(O,E))<0},n.isLessThanOrEqualTo=n.lte=function(O,E){return(E=jo(this,new H(O,E)))===-1||E===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(O,E){var f,c,p,v,g=this,x=g.s;if(O=new H(O,E),E=O.s,!x||!E)return new H(NaN);if(x!=E)return O.s=-E,g.plus(O);var S=g.e/Qe,b=O.e/Qe,l=g.c,d=O.c;if(!S||!b){if(!l||!d)return l?(O.s=-E,O):new H(d?g:NaN);if(!l[0]||!d[0])return d[0]?(O.s=-E,O):new H(l[0]?g:m==3?-0:0)}if(S=mn(S),b=mn(b),l=l.slice(),x=S-b){for((v=x<0)?(x=-x,p=l):(b=S,p=d),p.reverse(),E=x;E--;p.push(0));p.reverse()}else for(c=(v=(x=l.length)<(E=d.length))?x:E,x=E=0;E<c;E++)if(l[E]!=d[E]){v=l[E]<d[E];break}if(v&&(p=l,l=d,d=p,O.s=-O.s),E=(c=d.length)-(f=l.length),E>0)for(;E--;l[f++]=0);for(E=Mn-1;c>x;){if(l[--c]<d[c]){for(f=c;f&&!l[--f];l[f]=E);--l[f],l[c]+=Mn}l[c]-=d[c]}for(;l[0]==0;l.splice(0,1),--b);return l[0]?ge(O,l,b):(O.s=m==3?-1:1,O.c=[O.e=0],O)},n.modulo=n.mod=function(O,E){var f,c,p=this;return O=new H(O,E),!p.c||!O.s||O.c&&!O.c[0]?new H(NaN):!O.c||p.c&&!p.c[0]?new H(p):(C==9?(c=O.s,O.s=1,f=t(p,O,0,3),O.s=c,f.s*=c):f=t(p,O,0,C),O=p.minus(f.times(O)),!O.c[0]&&C==1&&(O.s=p.s),O)},n.multipliedBy=n.times=function(O,E){var f,c,p,v,g,x,S,b,l,d,A,D,V,Y,se,ae=this,pe=ae.c,ye=(O=new H(O,E)).c;if(!pe||!ye||!pe[0]||!ye[0])return!ae.s||!O.s||pe&&!pe[0]&&!ye||ye&&!ye[0]&&!pe?O.c=O.e=O.s=null:(O.s*=ae.s,!pe||!ye?O.c=O.e=null:(O.c=[0],O.e=0)),O;for(c=mn(ae.e/Qe)+mn(O.e/Qe),O.s*=ae.s,S=pe.length,d=ye.length,S<d&&(V=pe,pe=ye,ye=V,p=S,S=d,d=p),p=S+d,V=[];p--;V.push(0));for(Y=Mn,se=Ha,p=d;--p>=0;){for(f=0,A=ye[p]%se,D=ye[p]/se|0,g=S,v=p+g;v>p;)b=pe[--g]%se,l=pe[g]/se|0,x=D*b+l*A,b=A*b+x%se*se+V[v]+f,f=(b/Y|0)+(x/se|0)+D*l,V[v--]=b%Y;V[v]=f}return f?++c:V.splice(0,1),ge(O,V,c)},n.negated=function(){var O=new H(this);return O.s=-O.s||null,O},n.plus=function(O,E){var f,c=this,p=c.s;if(O=new H(O,E),E=O.s,!p||!E)return new H(NaN);if(p!=E)return O.s=-E,c.minus(O);var v=c.e/Qe,g=O.e/Qe,x=c.c,S=O.c;if(!v||!g){if(!x||!S)return new H(p/0);if(!x[0]||!S[0])return S[0]?O:new H(x[0]?c:p*0)}if(v=mn(v),g=mn(g),x=x.slice(),p=v-g){for(p>0?(g=v,f=S):(p=-p,f=x),f.reverse();p--;f.push(0));f.reverse()}for(p=x.length,E=S.length,p-E<0&&(f=S,S=x,x=f,E=p),p=0;E;)p=(x[--E]=x[E]+S[E]+p)/Mn|0,x[E]=Mn===x[E]?0:x[E]%Mn;return p&&(x=[p].concat(x),++g),ge(O,x,g)},n.precision=n.sd=function(O,E){var f,c,p,v=this;if(O!=null&&O!==!!O)return xr(O,1,Zr),E==null?E=m:xr(E,0,8),Se(new H(v),O,E);if(!(f=v.c))return null;if(p=f.length-1,c=p*Qe+1,p=f[p]){for(;p%10==0;p/=10,c--);for(p=f[0];p>=10;p/=10,c++);}return O&&v.e+1>c&&(c=v.e+1),c},n.shiftedBy=function(O){return xr(O,-hv,hv),this.times("1e"+O)},n.squareRoot=n.sqrt=function(){var O,E,f,c,p,v=this,g=v.c,x=v.s,S=v.e,b=u+4,l=new H("0.5");if(x!==1||!g||!g[0])return new H(!x||x<0&&(!g||g[0])?NaN:g?v:1/0);if(x=Math.sqrt(+me(v)),x==0||x==1/0?(E=hn(g),(E.length+S)%2==0&&(E+="0"),x=Math.sqrt(+E),S=mn((S+1)/2)-(S<0||S%2),x==1/0?E="5e"+S:(E=x.toExponential(),E=E.slice(0,E.indexOf("e")+1)+S),f=new H(E)):f=new H(x+""),f.c[0]){for(S=f.e,x=S+b,x<3&&(x=0);;)if(p=f,f=l.times(p.plus(t(v,p,b,1))),hn(p.c).slice(0,x)===(E=hn(f.c)).slice(0,x))if(f.e<S&&--x,E=E.slice(x-3,x+1),E=="9999"||!c&&E=="4999"){if(!c&&(Se(p,p.e+u+2,0),p.times(p).eq(v))){f=p;break}b+=4,x+=4,c=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Se(f,f.e+u+2,1),O=!f.times(f).eq(v));break}}return Se(f,f.e+u+1,m,O)},n.toExponential=function(O,E){return O!=null&&(xr(O,0,Zr),O++),ee(this,O,E,1)},n.toFixed=function(O,E){return O!=null&&(xr(O,0,Zr),O=O+this.e+1),ee(this,O,E)},n.toFormat=function(O,E,f){var c,p=this;if(f==null)O!=null&&E&&typeof E=="object"?(f=E,E=null):O&&typeof O=="object"?(f=O,O=E=null):f=U;else if(typeof f!="object")throw Error(Ni+"Argument not an object: "+f);if(c=p.toFixed(O,E),p.c){var v,g=c.split("."),x=+f.groupSize,S=+f.secondaryGroupSize,b=f.groupSeparator||"",l=g[0],d=g[1],A=p.s<0,D=A?l.slice(1):l,V=D.length;if(S&&(v=x,x=S,S=v,V-=v),x>0&&V>0){for(v=V%x||x,l=D.substr(0,v);v<V;v+=x)l+=b+D.substr(v,x);S>0&&(l+=b+D.slice(v)),A&&(l="-"+l)}c=d?l+(f.decimalSeparator||"")+((S=+f.fractionGroupSize)?d.replace(new RegExp("\\d{"+S+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):d):l}return(f.prefix||"")+c+(f.suffix||"")},n.toFraction=function(O){var E,f,c,p,v,g,x,S,b,l,d,A,D=this,V=D.c;if(O!=null&&(x=new H(O),!x.isInteger()&&(x.c||x.s!==1)||x.lt(o)))throw Error(Ni+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+me(x));if(!V)return new H(D);for(E=new H(o),b=f=new H(o),c=S=new H(o),A=hn(V),v=E.e=A.length-D.e-1,E.c[0]=dv[(g=v%Qe)<0?Qe+g:g],O=!O||x.comparedTo(E)>0?v>0?E:b:x,g=T,T=1/0,x=new H(A),S.c[0]=0;l=t(x,E,0,1),p=f.plus(l.times(c)),p.comparedTo(O)!=1;)f=c,c=p,b=S.plus(l.times(p=b)),S=p,E=x.minus(l.times(p=E)),x=p;return p=t(O.minus(f),c,0,1),S=S.plus(p.times(b)),f=f.plus(p.times(c)),S.s=b.s=D.s,v=v*2,d=t(b,c,v,m).minus(D).abs().comparedTo(t(S,f,v,m).minus(D).abs())<1?[b,c]:[S,f],T=g,d},n.toNumber=function(){return+me(this)},n.toPrecision=function(O,E){return O!=null&&xr(O,1,Zr),ee(this,O,E,2)},n.toString=function(O){var E,f=this,c=f.s,p=f.e;return p===null?c?(E="Infinity",c<0&&(E="-"+E)):E="NaN":(O==null?E=p<=_||p>=w?ch(hn(f.c),p):Xs(hn(f.c),p,"0"):O===10&&$?(f=Se(new H(f),u+p+1,m),E=Xs(hn(f.c),f.e,"0")):(xr(O,2,Z.length,"Base"),E=r(Xs(hn(f.c),p,"0"),10,O,c,!0)),c<0&&f.c[0]&&(E="-"+E)),E},n.valueOf=n.toJSON=function(){return me(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,e!=null&&H.set(e),H}function mn(e){var t=e|0;return e>0||e===t?t:t-1}function hn(e){for(var t,r,i=1,n=e.length,o=e[0]+"";i<n;){for(t=e[i++]+"",r=Qe-t.length;r--;t="0"+t);o+=t}for(n=o.length;o.charCodeAt(--n)===48;);return o.slice(0,n+1||1)}function jo(e,t){var r,i,n=e.c,o=t.c,u=e.s,m=t.s,_=e.e,w=t.e;if(!u||!m)return null;if(r=n&&!n[0],i=o&&!o[0],r||i)return r?i?0:-m:u;if(u!=m)return u;if(r=u<0,i=_==w,!n||!o)return i?0:!n^r?1:-1;if(!i)return _>w^r?1:-1;for(m=(_=n.length)<(w=o.length)?_:w,u=0;u<m;u++)if(n[u]!=o[u])return n[u]>o[u]^r?1:-1;return _==w?0:_>w^r?1:-1}function xr(e,t,r,i){if(e<t||e>r||e!==dn(e))throw Error(Ni+(i||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function oh(e){var t=e.c.length-1;return mn(e.e/Qe)==t&&e.c[t]%2!=0}function ch(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Xs(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(i=e.length,++t>i){for(n=r,t-=i;--t;n+=r);e+=n}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}var O7=z2(),Lr=O7;var q9=Mr(mv(),1),F9=Mr(vh(),1),H9=Mr(gh(),1),Cv=Mr(wh(),1),z9=Mr(Mv(),1);var Lv="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",V9=(e,t)=>{let r="1"+"0".repeat(t),i=new Lr(e.toString(10),10);return Uf(i.times(r).toString(16))},j9=(e,t)=>{let r="1"+"0".repeat(t),i=new Lr(e.toString(),10);return parseFloat(i.dividedBy(r).toString())},W9=e=>{typeof e=="string"&&(e=new Uint8Array(Buffer.from(e)));let t=[],r=BigInt("0x"+Buffer.from(e).toString("hex"));for(;r>BigInt(0);){let i=Number(r%BigInt(58));t.unshift(Lv[i]),r=r/BigInt(58)}for(let i=0;i<e.length&&e[i]===0;i++)t.unshift(Lv[0]);return t.join("")},K9=e=>{let t=BigInt(0);for(let n=0;n<e.length;n++)t=t*BigInt(58)+BigInt(Lv.indexOf(e[n]));let r=t.toString(16),i=r.length%2===0?r:"0"+r;return new Uint8Array(Buffer.from(i,"hex"))},G9=e=>Buffer.from(e).toString("utf8"),$9=e=>Buffer.from(e,"utf8"),Y9=e=>!isNaN(Number(e)),Uv=async e=>{await new Promise(t=>setTimeout(t,e))},Dv=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Z9=e=>{let[t,r]=e.toExponential().split("e").map(n=>parseFloat(n)),i=(t*Math.pow(10,r)).toString();return i=parseFloat(i).toString(),i},Yf=async e=>await new Promise((t,r)=>{let i;typeof window<"u"?i=new WebSocket(e):i=new Cv.default(e),i.onopen=()=>{t(!0),i.close()},i.onerror=n=>{r(new Error(n.message)),i.close()}}),Eh={add:(e,t,r=18)=>parseFloat(new Lr(e).plus(new Lr(t)).toFixed(r)),sub:(e,t,r=18)=>parseFloat(new Lr(e).minus(new Lr(t)).toFixed(r)),mul:(e,t,r=18)=>parseFloat(new Lr(e).times(new Lr(t)).toFixed(r)),div:(e,t,r=18)=>parseFloat(new Lr(e).div(new Lr(t)).toFixed(r)),pow:(e,t,r=18)=>parseFloat(new Lr(e).pow(t).toFixed(r)),sqrt:(e,t=18)=>parseFloat(new Lr(e).sqrt().toFixed(t)),abs:(e,t=18)=>parseFloat(new Lr(e).absoluteValue().toFixed(t)),ceil:(e,t=18)=>parseFloat(new Lr(e).integerValue(Lr.ROUND_CEIL).toFixed(t)),floor:(e,t=18)=>parseFloat(new Lr(e).integerValue(Lr.ROUND_FLOOR).toFixed(t)),round:(e,t=18)=>parseFloat(new Lr(e).integerValue(Lr.ROUND_HALF_UP).toFixed(t))},X9=()=>typeof window>"u"?!1:function(e){return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(e.substr(0,4)))}(navigator.userAgent||navigator.vendor||window.opera),J9=()=>{if(typeof window>"u")return!1;let e=window.navigator;if(window.WebViewJavascriptBridge||window.webkit&&window.webkit.messageHandlers||e.userAgent.match(/WebView/i))return!0;let t=e.standalone,r=e.userAgent.toLowerCase(),i=/safari/.test(r);return/iphone|ipod|ipad/.test(r)?!t&&!i:r.includes("wv")};var Fv={};Oa(Fv,{AssetDirectionEnum:()=>qv,ErrorTypeEnum:()=>Zf,TransactionListenerProcessIndex:()=>Rh,TransactionStatusEnum:()=>Th,TransactionTypeEnum:()=>Ih,WalletPlatformEnum:()=>zw});var qv=(r=>(r.INCOMING="INCOMING",r.OUTGOING="OUTGOING",r))(qv||{}),Ih=(o=>(o.GENERAL="GENERAL",o.CONTRACT="CONTRACT",o.COIN="COIN",o.TOKEN="TOKEN",o.NFT="NFT",o))(Ih||{}),Th=(i=>(i.FAILED="FAILED",i.PENDING="PENDING",i.CONFIRMED="CONFIRMED",i))(Th||{}),Zf=(c=>(c.RPC_TIMEOUT="RPC_TIMEOUT",c.RPC_REQUEST_ERROR="RPC_REQUEST_ERROR",c.RPC_ACCESS_DENIED="RPC_ACCESS_DENIED",c.WS_URL_NOT_DEFINED="WS_URL_NOT_DEFINED",c.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",c.UNACCEPTED_CHAIN="UNACCEPTED_CHAIN",c.UNAUTHORIZED_ADDRESS="UNAUTHORIZED_ADDRESS",c.INSUFFICIENT_BALANCE="INSUFFICIENT_BALANCE",c.INVALID_AMOUNT="INVALID_AMOUNT",c.INVALID_ADDRESS="INVALID_ADDRESS",c.INVALID_PRIVATE_KEY="INVALID_PRIVATE_KEY",c.INVALID_PUBLIC_KEY="INVALID_PUBLIC_KEY",c.INVALID_TRANSACTION_ID="INVALID_TRANSACTION_ID",c.PROVIDER_IS_REQUIRED="PROVIDER_IS_REQUIRED",c.PROVIDER_IS_NOT_INITIALIZED="PROVIDER_IS_NOT_INITIALIZED",c.PROVIDER_IS_ALREADY_INITIALIZED="PROVIDER_IS_ALREADY_INITIALIZED",c.WALLET_ALREADY_PROCESSING="WALLET_ALREADY_PROCESSING",c.WALLET_CONNECT_REJECTED="WALLET_CONNECT_REJECTED",c.WALLET_REQUEST_REJECTED="WALLET_REQUEST_REJECTED",c.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",c.WALLET_CONNECTION_TIMEOUT="WALLET_CONNECTION_TIMEOUT",c.TRANSACTION_CREATION_FAILED="TRANSACTION_CREATION_FAILED",c.TRANSACTION_NOT_FOUND="TRANSACTION_NOT_FOUND",c.CLOSED_WALLETCONNECT_MODAL="CLOSED_WALLETCONNECT_MODAL",c.PROJECT_ID_IS_REQUIRED="PROJECT_ID_IS_REQUIRED",c.METADATA_IS_REQUIRED="METADATA_IS_REQUIRED",c.CONFIG_IS_REQUIRED="CONFIG_IS_REQUIRED",c))(Zf||{}),zw=(n=>(n.BROWSER="BROWSER",n.MOBILE="MOBILE",n.DESKTOP="DESKTOP",n.UNIVERSAL="UNIVERSAL",n))(zw||{});var Rh={GENERAL:"generalProcess",CONTRACT:"contractProcess",COIN:"coinProcess",TOKEN:"tokenProcess",NFT:"nftProcess"};var Ln=class e{network;api;explorer;wsUrl;blockCypherToken;defaultBlockCypherToken="49d43a59a4f24d31a9731eb067ab971c";static _instance;constructor(t){this.update(t)}static get instance(){if(e._instance===void 0)throw new Error("PROVIDER_IS_NOT_INITIALIZED");return e._instance}static initialize(t){if(e._instance!==void 0)throw new Error("PROVIDER_IS_ALREADY_INITIALIZED");e._instance=new e(t)}async checkRpcConnection(t){try{let r=await ln.get(t??this.createEndpoint("blocks/tip/height"));return r.status!==200?new Error(r.statusText+": "+JSON.stringify(r.data)):!0}catch(r){return r}}async checkWsConnection(t){try{let r=await Yf(t??this.wsUrl);return r instanceof Error?r:!0}catch(r){return r}}update(t){this.network=t,e._instance=this;let r=this.network.testnet??!1;if(this.blockCypherToken=this.network.blockCypherToken,r){this.api="https://blockstream.info/testnet/api/",this.explorer="https://blockstream.info/testnet/";let i=this.network.blockCypherToken??this.defaultBlockCypherToken;this.wsUrl="wss://socket.blockcypher.com/v1/btc/test3?token="+i}else this.api="https://blockstream.info/api/",this.explorer="https://blockstream.info/",this.network.blockCypherToken!==void 0?this.wsUrl="wss://socket.blockcypher.com/v1/btc/main?token="+this.network.blockCypherToken:this.wsUrl="wss://ws.blockchain.info/inv";this.network.rpcUrl=this.api,this.network.wsUrl=this.wsUrl}createEndpoint(t){return this.api+t}isTestnet(){return this.network?.testnet??!1}};var _U=Mr(Rx(),1);var Px={};Oa(Px,{Coin:()=>kx});var Rl=Mr(Rx(),1);var Ox={};Oa(Ox,{base58Decode:()=>K9,base58Encode:()=>W9,bufferToString:()=>G9,checkWebSocket:()=>Yf,fromSatoshi:()=>_s,hexToNumber:()=>j9,isMobile:()=>X9,isNumeric:()=>Y9,isWebview:()=>J9,math:()=>Eh,numberToHex:()=>V9,objectsEqual:()=>Dv,sleep:()=>Uv,stringToBuffer:()=>$9,toHex:()=>Uf,toReadableString:()=>Z9,toSatoshi:()=>Ax});var _s=e=>Eh.div(e,1e8,8),Ax=e=>Eh.mul(e,1e8,8);var Tl=class{rawData;signedData;provider;constructor(t,r){this.rawData=t,this.provider=r??Ln.instance}async sign(t){return this.rawData.bitcoreLib.sign(t),this.signedData=this.rawData.bitcoreLib.serialize(),this}async send(){try{return(await ln({method:"POST",url:this.provider.createEndpoint("tx"),data:this.signedData})).data}catch(t){throw new Error(JSON.stringify(t.response?.data))}}getRawData(){return this.rawData}getSignedData(){return this.signedData??""}};var kx=class{provider;constructor(t){this.provider=t??Ln.instance}getName(){return"Bitcoin"}getSymbol(){return"BTC"}getDecimals(){return 8}async getBalance(t){let r=this.provider.createEndpoint("address/"+t),i=await ln.get(r).then(o=>o.data),n=i.chain_stats.funded_txo_sum-i.chain_stats.spent_txo_sum;return _s(n)}async transfer(t,r,i){if(i<0)throw new Error("INVALID_AMOUNT");if(i>await this.getBalance(t))throw new Error("INSUFFICIENT_BALANCE");if(t===r)throw new Error("INVALID_ADDRESS");let n=[],o=new Rl.default.Transaction,u=new Rl.default.Address(t),m=Ax(i),_=await ln.get(this.provider.createEndpoint("address/"+t+"/utxo")).then(w=>w.data);for(let w of _)n.push(new Rl.default.Transaction.UnspentOutput({txId:w.txid,satoshis:w.value,address:u,outputIndex:w.vout,script:Rl.default.Script.fromAddress(u)}));return o.from(n),o.change(t),o.to(r,m),new Tl({sender:t,receiver:r,amount:m,bitcoreLib:o})}};var Nx={};Oa(Nx,{CoinTransaction:()=>Al,Transaction:()=>bc});var wT=0,bc=class{id;provider;data=null;constructor(t,r){this.id=t,this.provider=r??Ln.instance}async getData(){if(this.data!==null)return this.data;try{let t=(await ln.get(this.provider.createEndpoint("tx/"+this.id))).data;return t?.txid!==this.id?this.data=null:this.data=t}catch(t){if(console.error("MC Bitcoin TX getData",t),String(t?.response?.data).includes("Transaction not found")){if(wT>5)throw new Error("TRANSACTION_NOT_FOUND");return wT++,await Uv(2e3),await this.getData()}throw new Error("RPC_REQUEST_ERROR")}}async wait(t=4e3){return await new Promise((r,i)=>{let n=async()=>{try{let o=await this.getStatus();if(o==="CONFIRMED"){r("CONFIRMED");return}else if(o==="FAILED"){i("FAILED");return}setTimeout(n,t)}catch(o){console.error("MC Bitcoin TX wait",o),i("FAILED")}};n()})}getId(){return this.id}async getType(){return"COIN"}getUrl(){return this.provider.explorer+"tx/"+this.id}async getSigner(){return(await this.getData())?.vin[0].prevout.scriptpubkey_address??""}async getFee(){let t=await this.getData();return _s(t?.fee??0)}async getBlockNumber(){return(await this.getData())?.status?.block_height??0}async getBlockTimestamp(){return(await this.getData())?.status?.block_time??0}async getBlockConfirmationCount(){let t=await this.getData();return t===null?0:(await ln.get(this.provider.createEndpoint("blocks/tip/height"))).data-t?.status?.block_height}async getStatus(){let t=await this.getData();return t===null?"PENDING":t.status?.block_height!==void 0?t.status.confirmed?"CONFIRMED":"FAILED":"PENDING"}};var Al=class extends bc{async getReceiver(){return(await this.getData())?.vout[0].scriptpubkey_address??""}async getSender(){return await this.getSigner()}async getAmount(){let t=await this.getData();return _s(t?.vout[0].value??0)}async verifyTransfer(t,r,i){if(await this.getStatus()==="PENDING")return"PENDING";if(await this.getAmount()!==i)return"FAILED";if(t==="INCOMING"){if((await this.getReceiver()).toLowerCase()!==r.toLowerCase())return"FAILED"}else if((await this.getSender()).toLowerCase()!==r.toLowerCase())return"FAILED";return"CONFIRMED"}};var Mx={};Oa(Mx,{TransactionListener:()=>Bx,TransactionSigner:()=>Tl});var RT=Mr(TT(),1);var Bx=class{type;provider;status=!1;callbacks=[];triggeredTransactions=[];filter;webSocket;dynamicStop=()=>{};constructor(t,r,i){this.type=t,this.filter=r??{},this.provider=i??Ln.instance}stop(){this.status&&(this.status=!1,this.dynamicStop())}start(){this.status||(this.status=!0,this[Rh[this.type]]())}getStatus(){return this.status}async on(t){if(this.webSocket===void 0)try{await Yf(this.provider.wsUrl),this.webSocket=new RT.default(this.provider.wsUrl)}catch(r){throw new Error("WebSocket connection is not available"+(r instanceof Error?": "+r.message:""))}return this.start(),this.callbacks.push(t),!0}trigger(t){this.triggeredTransactions.includes(t.id)||(this.triggeredTransactions.push(t.id),this.callbacks.forEach(r=>{r(t)}))}isBlockCypherProcess(){return this.provider.isTestnet()||this.provider.blockCypherToken!==void 0}createMessage(t){let r;if(this.isBlockCypherProcess()){let i={event:"unconfirmed-tx",token:this.provider.blockCypherToken??this.provider.defaultBlockCypherToken};t!==void 0&&(i.address=t),r=JSON.stringify(i)}else r=JSON.stringify({op:"unconfirmed_sub"});return this.dynamicStop=()=>{this.isBlockCypherProcess()||this.webSocket.send(JSON.stringify({op:"unconfirmed_unsub"})),this.webSocket.close()},r}getValues(t){let r={txId:""};return this.isBlockCypherProcess()?(r.txId=t.hash,r.sender=t.inputs[0].addresses[0],r.receiver=t.outputs[0].addresses[0],r.amount=_s(t.outputs[0].value)):(r.txId=t.x.hash,r.receiver=t.x.out[0].addr,r.sender=t.x.inputs[0].prev_out.addr,r.amount=_s(t.x.out[0].value)),r}generalProcess(){let t=this.createMessage();this.webSocket.addEventListener("open",()=>{this.webSocket.send(t)}),this.webSocket.addEventListener("message",async r=>{let i=this.getValues(JSON.parse(r.data));this.filter?.signer!==void 0&&i.sender?.toLowerCase()!==this.filter.signer.toLowerCase()||this.trigger(new bc(i.txId))})}contractProcess(){throw new Error("This method is not implemented for Bitcoin.")}coinProcess(){let t=this.filter;if(t.signer!==void 0&&t.sender!==void 0&&t.signer!==t.sender)throw new Error("Sender and signer must be the same in coin transactions. Or only one of them can be defined.");let r=t.sender??t.signer,i=this.createMessage(t.receiver);this.webSocket.addEventListener("open",()=>{this.webSocket.send(i)}),this.webSocket.addEventListener("message",async n=>{let o=JSON.parse(n.data),u={},m={};if(String(o.event).includes("events limit reached"))throw new Error("BlockCypher events limit reached.");let _=this.getValues(o);if(r!==void 0&&(u.sender=r.toLowerCase(),m.sender=_.sender?.toLowerCase()),t.receiver!==void 0&&(u.receiver=t.receiver.toLowerCase(),m.receiver=_.receiver?.toLowerCase()),!Dv(u,m))return;let w=new Al(_.txId);t.amount!==void 0&&_.amount!==t.amount||this.trigger(w)})}tokenProcess(){throw new Error("This method is not implemented for Bitcoin.")}nftProcess(){throw new Error("This method is not implemented for Bitcoin.")}};0&&(module.exports={Provider,assets,bitcore,models,services,types,utils});
38
+ `)}`}_compileErrors(){return this.errors.map(g7)}};var Bn={};Oa(Bn,{abiSchemaToJsonSchema:()=>Zp,codePointToInt:()=>R2,ensureIfUint8Array:()=>iv,ethAbiToJsonSchema:()=>ev,fetchArrayElement:()=>tv,hexToNumber:()=>Xp,hexToUint8Array:()=>Jp,numberToHex:()=>rv,padLeft:()=>A2,parseBaseType:()=>ss,transformJsonDataToAbiFormat:()=>Yp,uint8ArrayToHexString:()=>Of});var E2=["bool","int","uint","bytes","string","address","tuple"];var Jm=e=>typeof e=="object"&&"type"in e&&"name"in e;var I2=e=>typeof e=="string",hr=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e);var $p=e=>typeof e=="number"||typeof e=="bigint"||typeof e=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e);var x7=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],ss=e=>{let t=e.replace(/ /,""),r,i=!1,n=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),n=[...e.matchAll(/(?:\[(\d*)\])/g)].map(o=>parseInt(o[1],10)).map(o=>Number.isNaN(o)?-1:o),i=n.length>0),E2.includes(t))return{baseType:t,isArray:i,baseTypeSize:r,arraySizes:n};if(t.startsWith("int"))r=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))r=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))r=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:n};return{baseType:t,isArray:i,baseTypeSize:r,arraySizes:n}},Qm=(e,t={})=>{if(Object.keys(t).includes("type"))throw new Ys([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);let{baseType:i,baseTypeSize:n}=ss(e);if(!i&&!x7.includes(e))throw new Ys([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(i){if(i==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${i}${n??""}`,required:!0}}return e?{format:e,required:!0}:{}},Zp=(e,t="/0")=>{let r={type:"array",items:[],maxItems:e.length,minItems:e.length};for(let[i,n]of e.entries()){let o,u,m=[];Jm(n)?(o=n.type,u=n.name,m=n.components):typeof n=="string"?(o=n,u=`${t}/${i}`):Array.isArray(n)&&(n[0]&&typeof n[0]=="string"&&n[0].startsWith("tuple")&&!Array.isArray(n[0])&&n[1]&&Array.isArray(n[1])?(o=n[0],u=`${t}/${i}`,m=n[1]):(o="tuple",u=`${t}/${i}`,m=n));let{baseType:_,isArray:w,arraySizes:I}=ss(o),T,N=r;for(let C=I.length-1;C>0;C-=1)T={type:"array",items:[],maxItems:I[C],minItems:I[C]},I[C]<0&&(delete T.maxItems,delete T.minItems),Array.isArray(N.items)?N.items.length===0?N.items=T:N.items.push(T):N.items=[N.items,T],N=T;if(_==="tuple"&&!w){let C=Zp(m,u);C.$id=u,N.items.push(C)}else if(_==="tuple"&&w){let C=I[0],B={$id:u,type:"array",items:Zp(m,u),maxItems:C,minItems:C};C<0&&(delete B.maxItems,delete B.minItems),N.items.push(B)}else if(w){let C=I[0],B={type:"array",$id:u,items:Qm(String(_)),minItems:C,maxItems:C};C<0&&(delete B.maxItems,delete B.minItems),N.items.push(B)}else Array.isArray(N.items)?N.items.push(Object.assign({$id:u},Qm(o))):N.items.items.push(Object.assign({$id:u},Qm(o)));N=r}return r},ev=e=>Zp(e),tv=(e,t)=>t===1?e:tv(e[0],t-1),Yp=(e,t,r)=>{let i=[];for(let[n,o]of e.entries()){let u,m,_=[];Jm(o)?(u=o.type,m=o.name,_=o.components):typeof o=="string"?u=o:Array.isArray(o)&&(o[1]&&Array.isArray(o[1])?(u=o[0],_=o[1]):(u="tuple",_=o));let{baseType:w,isArray:I,arraySizes:T}=ss(u),N=Array.isArray(t)?t[n]:t[m];if(w==="tuple"&&!I)i.push(Yp(_,N,r));else if(w==="tuple"&&I){let C=[];for(let B of N)if(T.length>1){let U=tv(B,T.length-1),Z=[];for(let $ of U)Z.push(Yp(_,$,r));C.push(Z)}else C.push(Yp(_,B,r));i.push(C)}else i.push(N)}return r=r??[],r.push(...i),r},R2=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},Xp=e=>{if(!hr(e))throw new Error("Invalid hex string");let[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],i=BigInt(r);return i>Number.MAX_SAFE_INTEGER?t?-i:i:i<Number.MIN_SAFE_INTEGER?i:t?-1*Number(i):Number(i)},rv=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&hr(e)){let[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],i=r.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${i.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!hr(e))return rv(BigInt(e));throw new hf(e)},A2=(e,t,r="0")=>{if(typeof e=="string"&&!hr(e))return e.padStart(t,r);let i=typeof e=="string"&&hr(e)?e:rv(e),[n,o]=i.startsWith("-")?["-0x",i.slice(3)]:["0x",i.slice(2)];return`${n}${o.padStart(t,r)}`};function Of(e){let t="0x";for(let r of e){let i=r.toString(16);t+=i.length===1?`0${i}`:i}return t}var Zs={zero:48,nine:57,A:65,F:70,a:97,f:102};function T2(e){if(e>=Zs.zero&&e<=Zs.nine)return e-Zs.zero;if(e>=Zs.A&&e<=Zs.F)return e-(Zs.A-10);if(e>=Zs.a&&e<=Zs.f)return e-(Zs.a-10)}function Jp(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new Ca(`hex string has odd length: ${e}`);let r=(e.length-t)/2,i=new Uint8Array(r);for(let n=0,o=t;n<r;n+=1){let u=T2(e.charCodeAt(o++)),m=T2(e.charCodeAt(o++));if(u===void 0||m===void 0)throw new Ca(`Invalid byte sequence ("${e[o-2]}${e[o-1]}" in "${e}").`);i[n]=u*16+m}return i}function iv(e){var t;return!(e instanceof Uint8Array)&&((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}var Qp=e=>{var t;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"},nv=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!Qp(e)||typeof e=="string"&&hr(e)&&e.startsWith("-")||typeof e=="string"&&!hr(e))return!1;let r;if(typeof e=="string"){if(e.length%2!==0)return!1;r=Jp(e)}else if(Array.isArray(e)){if(e.some(i=>i<0||i>255||!Number.isInteger(i)))return!1;r=new Uint8Array(e)}else r=e;if(t?.abiType){let{baseTypeSize:i}=ss(t.abiType);return i?r.length===i:!0}return t?.size?r.length===t?.size:!0};var O2=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;let t=e.slice(2),r=Hc(t.toLowerCase()),i=Of(pf(iv(r))).slice(2);for(let n=0;n<40;n+=1)if(parseInt(i[n],16)>7&&t[n].toUpperCase()!==t[n]||parseInt(i[n],16)<=7&&t[n].toLowerCase()!==t[n])return!1;return!0},as=(e,t=!0)=>{if(typeof e!="string"&&!Qp(e))return!1;let r;return Qp(e)?r=Of(e):typeof e=="string"&&!hr(e)?r=e.toLowerCase().startsWith("0x")?e:`0x${e}`:r=e,/^(0x)?[0-9a-f]{40}$/i.test(r)?/^(0x|0X)?[0-9a-f]{40}$/.test(r)||/^(0x|0X)?[0-9A-F]{40}$/.test(r)?!0:t?O2(r):!0:!1};var kf;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(kf||(kf={}));var Pf;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(Pf||(Pf={}));var nW={number:kf.BIGINT,bytes:Pf.HEX},sW={number:kf.HEX,bytes:Pf.HEX};var Nf;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized"})(Nf||(Nf={}));var k2;(function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"})(k2||(k2={}));var P2=Object.getPrototypeOf(Uint8Array);var N2=function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(u){u(o)})}return new(r||(r=Promise))(function(o,u){function m(I){try{w(i.next(I))}catch(T){u(T)}}function _(I){try{w(i.throw(I))}catch(T){u(T)}}function w(I){I.done?o(I.value):n(I.value).then(m,_)}w((i=i.apply(e,t||[])).next())})},B2=Symbol.for("web3/base-provider"),sv=class e{static isWeb3Provider(t){return t instanceof e||!!(t&&t[B2])}get[B2](){return!0}send(t,r){this.request(t).then(i=>{r(null,i)}).catch(i=>{r(i)})}sendAsync(t){return N2(this,void 0,void 0,function*(){return this.request(t)})}asEIP1193Provider(){let t=Object.create(this),r=t.request;return t.request=function(n){return N2(this,void 0,void 0,function*(){return(yield r(n)).result})},t.asEIP1193Provider=void 0,t}};var eh=(e,t)=>{let r=e;for(let i=1;i<t;i+=1)r*=e;return r},Fa=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="string"&&e.length===0)return!1;let r;if(t?.abiType){let{baseTypeSize:n}=ss(t.abiType);n&&(r=n)}else t.bitSize&&(r=t.bitSize);let i=eh(BigInt(2),BigInt(r??256))-BigInt(1);try{let n=typeof e=="string"&&hr(e)?BigInt(Xp(e)):BigInt(e);return n>=0&&n<=i}catch{return!1}},Vo=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="number"&&e>Number.MAX_SAFE_INTEGER)return!1;let r;if(t?.abiType){let{baseTypeSize:o,baseType:u}=ss(t.abiType);if(u!=="int")return!1;o&&(r=o)}else t.bitSize&&(r=t.bitSize);let i=eh(BigInt(2),BigInt((r??256)-1)),n=BigInt(-1)*eh(BigInt(2),BigInt((r??256)-1));try{let o=typeof e=="string"&&hr(e)?BigInt(Xp(e)):BigInt(e);return o>=n&&o<=i}catch{return!1}},M2=e=>!!(Vo(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number");var av=e=>Fa(e),th=e=>Object.values(Nf).includes(e),Bf=e=>th(e)||av(e);var rh=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(e)||/^(0x)?[0-9A-F]{512}$/.test(e));var C2=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!hr(e)?e==="1"||e==="0":typeof e=="string"&&hr(e)?e==="0x1"||e==="0x0":e===1||e===0:!1;var Pi=e=>e==null;var ih=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(e)||/^(0x)?[0-9A-F]{64}$/.test(e));var L2=e=>{let t=["fromBlock","toBlock","address","topics","blockHash"];if(Pi(e)||typeof e!="object"||!Object.keys(e).every(r=>t.includes(r))||!Pi(e.fromBlock)&&!Bf(e.fromBlock)||!Pi(e.toBlock)&&!Bf(e.toBlock))return!1;if(!Pi(e.address)){if(Array.isArray(e.address)){if(!e.address.every(r=>as(r)))return!1}else if(!as(e.address))return!1}return!(!Pi(e.topics)&&!e.topics.every(r=>Pi(r)?!0:Array.isArray(r)?r.every(i=>ih(i)):!!ih(r)))};var Zc={address:e=>as(e),bloom:e=>rh(e),blockNumber:e=>av(e),blockTag:e=>th(e),blockNumberOrTag:e=>Bf(e),bool:e=>C2(e),bytes:e=>nv(e),filter:e=>L2(e),hex:e=>hr(e),uint:e=>Fa(e),int:e=>Vo(e),number:e=>M2(e),string:e=>I2(e)};for(let e=8;e<=256;e+=8)Zc[`int${e}`]=t=>Vo(t,{bitSize:e}),Zc[`uint${e}`]=t=>Fa(t,{bitSize:e});for(let e=1;e<=32;e+=1)Zc[`bytes${e}`]=t=>nv(t,{size:e});Zc.bytes256=Zc.bytes;var ov=Zc;var Mf=e=>{if((!e?.type||e?.type==="object")&&e?.properties){let t={};for(let r of Object.keys(e.properties)){let i=Mf(e.properties[r]);i&&(t[r]=i)}return Array.isArray(e.required)?Nn.object(t).partial().required(e.required.reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:!0}),{})):Nn.object(t).partial()}if(e?.type==="array"&&e?.items){if(Array.isArray(e.items)&&e.items.length>0){let t=[];for(let r of e.items){let i=Mf(r);i&&t.push(i)}return Nn.tuple(t)}return Nn.array(Mf(e.items))}if(e.oneOf&&Array.isArray(e.oneOf))return Nn.union(e.oneOf.map(t=>Mf(t)));if(e?.format){if(!ov[e.format])throw new qp(e.format);return Nn.any().refine(ov[e.format],t=>({params:{value:t,format:e.format}}))}return e?.type&&e?.type!=="object"&&typeof Nn[String(e.type)]=="function"?Nn[String(e.type)]():Nn.object({data:Nn.any()}).partial()},nh=class e{static factory(){return e.validatorInstance||(e.validatorInstance=new e),e.validatorInstance}validate(t,r,i){var n,o;let m=Mf(t).safeParse(r);if(!m.success){let _=this.convertErrors((o=(n=m.error)===null||n===void 0?void 0:n.issues)!==null&&o!==void 0?o:[]);if(_){if(i?.silent)return _;throw new Ys(_)}}}convertErrors(t){if(t&&Array.isArray(t)&&t.length>0)return t.map(r=>{var i;let n,o,u,m;m=r.path.join("/");let _=String(r.path[r.path.length-1]),w=r.path.join("/");if(r.code===fe.too_big)o="maxItems",m=`${w}/maxItems`,u={limit:r.maximum},n=`must NOT have more than ${r.maximum} items`;else if(r.code===fe.too_small)o="minItems",m=`${w}/minItems`,u={limit:r.minimum},n=`must NOT have fewer than ${r.minimum} items`;else if(r.code===fe.custom){let{value:I,format:T}=(i=r.params)!==null&&i!==void 0?i:{};typeof I>"u"?n=`value at "/${m}" is required`:n=`value "${typeof I=="object"?JSON.stringify(I):I}" at "/${m}" must pass "${T}" validation`,u={value:I}}return{keyword:o??_,instancePath:w?`/${w}`:"",schemaPath:m?`#${m}`:"#",params:u??{value:r.message},message:n??r.message}})}};var sh=class{constructor(){this._validator=nh.factory()}validateJSONSchema(t,r,i){return this._validator.validate(t,r,i)}validate(t,r,i={silent:!1}){var n,o;let u=ev(t);if(!(Array.isArray(u.items)&&((n=u.items)===null||n===void 0?void 0:n.length)===0&&r.length===0)){if(Array.isArray(u.items)&&((o=u.items)===null||o===void 0?void 0:o.length)===0&&r.length!==0)throw new Ys([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:r}]);return this._validator.validate(u,r,i)}}};var Cf=new sh;function cv(e){var t;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"}var WK={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},fv=e=>{if(Cf.validate(["bytes"],[e]),cv(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return Bn.hexToUint8Array(e);throw new Ca(e)},{uint8ArrayToHexString:w7}=Bn,Lf=e=>w7(fv(e));var Xc=(e,t)=>{typeof e!="bigint"&&Cf.validate(["int"],[e]);let r=Bn.numberToHex(e);return t&&(!r.startsWith("-")&&r.length%2===1?r="0x0".concat(r.slice(2)):r.length%2===0&&r.startsWith("-")&&(r="-0x0".concat(r.slice(3)))),r};var uv=e=>{Cf.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),Lf(new TextEncoder().encode(t))};var Uf=(e,t)=>{if(typeof e=="string"&&as(e))return t?"address":`0x${e.toLowerCase().replace(/^0x/i,"")}`;if(typeof e=="boolean")return t?"bool":e?"0x01":"0x00";if(typeof e=="number")return t?e<0?"int256":"uint256":Xc(e);if(typeof e=="bigint")return t?"bigint":Xc(e);if(typeof e=="object"&&e)return t?"string":uv(JSON.stringify(e));if(typeof e=="string"){if(e.startsWith("-0x")||e.startsWith("-0X"))return t?"int256":Xc(e);if(hr(e))return t?"bytes":e;if($p(e)&&!Vo(e)&&!Fa(e))return t?"bytes":`0x${e}`;if($p(e)&&!Vo(e)&&Fa(e))return t?"uint":Xc(e);if(!Number.isFinite(e))return t?"string":uv(e)}throw new Dp(e)};var q2=Mr(D2(),1);var{parseBaseType:TG}=Bn;var R7;R7=Symbol.toStringTag;var A7=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,pv=Math.ceil,dn=Math.floor,Ni="[BigNumber Error] ",H2=Ni+"Number primitive has more than 15 significant digits: ",Mn=1e14,Qe=14,hv=9007199254740991,dv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ha=1e7,Zr=1e9;function z2(e){var t,r,i,n=H.prototype={constructor:H,toString:null,valueOf:null},o=new H(1),u=20,m=4,_=-7,w=21,I=-1e7,T=1e7,N=!1,C=1,B=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Z="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function H(O,E){var f,c,p,v,g,x,S,b,l=this;if(!(l instanceof H))return new H(O,E);if(E==null){if(O&&O._isBigNumber===!0){l.s=O.s,!O.c||O.e>T?l.c=l.e=null:O.e<I?l.c=[l.e=0]:(l.e=O.e,l.c=O.c.slice());return}if((x=typeof O=="number")&&O*0==0){if(l.s=1/O<0?(O=-O,-1):1,O===~~O){for(v=0,g=O;g>=10;g/=10,v++);v>T?l.c=l.e=null:(l.e=v,l.c=[O]);return}b=String(O)}else{if(!A7.test(b=String(O)))return i(l,b,x);l.s=b.charCodeAt(0)==45?(b=b.slice(1),-1):1}(v=b.indexOf("."))>-1&&(b=b.replace(".","")),(g=b.search(/e/i))>0?(v<0&&(v=g),v+=+b.slice(g+1),b=b.substring(0,g)):v<0&&(v=b.length)}else{if(xr(E,2,Z.length,"Base"),E==10&&$)return l=new H(O),Se(l,u+l.e+1,m);if(b=String(O),x=typeof O=="number"){if(O*0!=0)return i(l,b,x,E);if(l.s=1/O<0?(b=b.slice(1),-1):1,H.DEBUG&&b.replace(/^0\.0*|\./,"").length>15)throw Error(H2+O)}else l.s=b.charCodeAt(0)===45?(b=b.slice(1),-1):1;for(f=Z.slice(0,E),v=g=0,S=b.length;g<S;g++)if(f.indexOf(c=b.charAt(g))<0){if(c=="."){if(g>v){v=S;continue}}else if(!p&&(b==b.toUpperCase()&&(b=b.toLowerCase())||b==b.toLowerCase()&&(b=b.toUpperCase()))){p=!0,g=-1,v=0;continue}return i(l,String(O),x,E)}x=!1,b=r(b,E,10,l.s),(v=b.indexOf("."))>-1?b=b.replace(".",""):v=b.length}for(g=0;b.charCodeAt(g)===48;g++);for(S=b.length;b.charCodeAt(--S)===48;);if(b=b.slice(g,++S)){if(S-=g,x&&H.DEBUG&&S>15&&(O>hv||O!==dn(O)))throw Error(H2+l.s*O);if((v=v-g-1)>T)l.c=l.e=null;else if(v<I)l.c=[l.e=0];else{if(l.e=v,l.c=[],g=(v+1)%Qe,v<0&&(g+=Qe),g<S){for(g&&l.c.push(+b.slice(0,g)),S-=Qe;g<S;)l.c.push(+b.slice(g,g+=Qe));g=Qe-(b=b.slice(g)).length}else g-=S;for(;g--;b+="0");l.c.push(+b)}}else l.c=[l.e=0]}H.clone=z2,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(O){var E,f;if(O!=null)if(typeof O=="object"){if(O.hasOwnProperty(E="DECIMAL_PLACES")&&(f=O[E],xr(f,0,Zr,E),u=f),O.hasOwnProperty(E="ROUNDING_MODE")&&(f=O[E],xr(f,0,8,E),m=f),O.hasOwnProperty(E="EXPONENTIAL_AT")&&(f=O[E],f&&f.pop?(xr(f[0],-Zr,0,E),xr(f[1],0,Zr,E),_=f[0],w=f[1]):(xr(f,-Zr,Zr,E),_=-(w=f<0?-f:f))),O.hasOwnProperty(E="RANGE"))if(f=O[E],f&&f.pop)xr(f[0],-Zr,-1,E),xr(f[1],1,Zr,E),I=f[0],T=f[1];else if(xr(f,-Zr,Zr,E),f)I=-(T=f<0?-f:f);else throw Error(Ni+E+" cannot be zero: "+f);if(O.hasOwnProperty(E="CRYPTO"))if(f=O[E],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))N=f;else throw N=!f,Error(Ni+"crypto unavailable");else N=f;else throw Error(Ni+E+" not true or false: "+f);if(O.hasOwnProperty(E="MODULO_MODE")&&(f=O[E],xr(f,0,9,E),C=f),O.hasOwnProperty(E="POW_PRECISION")&&(f=O[E],xr(f,0,Zr,E),B=f),O.hasOwnProperty(E="FORMAT"))if(f=O[E],typeof f=="object")U=f;else throw Error(Ni+E+" not an object: "+f);if(O.hasOwnProperty(E="ALPHABET"))if(f=O[E],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))$=f.slice(0,10)=="0123456789",Z=f;else throw Error(Ni+E+" invalid: "+f)}else throw Error(Ni+"Object expected: "+O);return{DECIMAL_PLACES:u,ROUNDING_MODE:m,EXPONENTIAL_AT:[_,w],RANGE:[I,T],CRYPTO:N,MODULO_MODE:C,POW_PRECISION:B,FORMAT:U,ALPHABET:Z}},H.isBigNumber=function(O){if(!O||O._isBigNumber!==!0)return!1;if(!H.DEBUG)return!0;var E,f,c=O.c,p=O.e,v=O.s;e:if({}.toString.call(c)=="[object Array]"){if((v===1||v===-1)&&p>=-Zr&&p<=Zr&&p===dn(p)){if(c[0]===0){if(p===0&&c.length===1)return!0;break e}if(E=(p+1)%Qe,E<1&&(E+=Qe),String(c[0]).length==E){for(E=0;E<c.length;E++)if(f=c[E],f<0||f>=Mn||f!==dn(f))break e;if(f!==0)return!0}}}else if(c===null&&p===null&&(v===null||v===1||v===-1))return!0;throw Error(Ni+"Invalid BigNumber: "+O)},H.maximum=H.max=function(){return ce(arguments,-1)},H.minimum=H.min=function(){return ce(arguments,1)},H.random=function(){var O=9007199254740992,E=Math.random()*O&2097151?function(){return dn(Math.random()*O)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var c,p,v,g,x,S=0,b=[],l=new H(o);if(f==null?f=u:xr(f,0,Zr),g=pv(f/Qe),N)if(crypto.getRandomValues){for(c=crypto.getRandomValues(new Uint32Array(g*=2));S<g;)x=c[S]*131072+(c[S+1]>>>11),x>=9e15?(p=crypto.getRandomValues(new Uint32Array(2)),c[S]=p[0],c[S+1]=p[1]):(b.push(x%1e14),S+=2);S=g/2}else if(crypto.randomBytes){for(c=crypto.randomBytes(g*=7);S<g;)x=(c[S]&31)*281474976710656+c[S+1]*1099511627776+c[S+2]*4294967296+c[S+3]*16777216+(c[S+4]<<16)+(c[S+5]<<8)+c[S+6],x>=9e15?crypto.randomBytes(7).copy(c,S):(b.push(x%1e14),S+=7);S=g/7}else throw N=!1,Error(Ni+"crypto unavailable");if(!N)for(;S<g;)x=E(),x<9e15&&(b[S++]=x%1e14);for(g=b[--S],f%=Qe,g&&f&&(x=dv[Qe-f],b[S]=dn(g/x)*x);b[S]===0;b.pop(),S--);if(S<0)b=[v=0];else{for(v=-1;b[0]===0;b.splice(0,1),v-=Qe);for(S=1,x=b[0];x>=10;x/=10,S++);S<Qe&&(v-=Qe-S)}return l.e=v,l.c=b,l}}(),H.sum=function(){for(var O=1,E=arguments,f=new H(E[0]);O<E.length;)f=f.plus(E[O++]);return f},r=function(){var O="0123456789";function E(f,c,p,v){for(var g,x=[0],S,b=0,l=f.length;b<l;){for(S=x.length;S--;x[S]*=c);for(x[0]+=v.indexOf(f.charAt(b++)),g=0;g<x.length;g++)x[g]>p-1&&(x[g+1]==null&&(x[g+1]=0),x[g+1]+=x[g]/p|0,x[g]%=p)}return x.reverse()}return function(f,c,p,v,g){var x,S,b,l,d,A,D,V,Y=f.indexOf("."),se=u,ae=m;for(Y>=0&&(l=B,B=0,f=f.replace(".",""),V=new H(c),A=V.pow(f.length-Y),B=l,V.c=E(Xs(hn(A.c),A.e,"0"),10,p,O),V.e=V.c.length),D=E(f,c,p,g?(x=Z,O):(x=O,Z)),b=l=D.length;D[--l]==0;D.pop());if(!D[0])return x.charAt(0);if(Y<0?--b:(A.c=D,A.e=b,A.s=v,A=t(A,V,se,ae,p),D=A.c,d=A.r,b=A.e),S=b+se+1,Y=D[S],l=p/2,d=d||S<0||D[S+1]!=null,d=ae<4?(Y!=null||d)&&(ae==0||ae==(A.s<0?3:2)):Y>l||Y==l&&(ae==4||d||ae==6&&D[S-1]&1||ae==(A.s<0?8:7)),S<1||!D[0])f=d?Xs(x.charAt(1),-se,x.charAt(0)):x.charAt(0);else{if(D.length=S,d)for(--p;++D[--S]>p;)D[S]=0,S||(++b,D=[1].concat(D));for(l=D.length;!D[--l];);for(Y=0,f="";Y<=l;f+=x.charAt(D[Y++]));f=Xs(f,b,x.charAt(0))}return f}}(),t=function(){function O(c,p,v){var g,x,S,b,l=0,d=c.length,A=p%Ha,D=p/Ha|0;for(c=c.slice();d--;)S=c[d]%Ha,b=c[d]/Ha|0,g=D*S+b*A,x=A*S+g%Ha*Ha+l,l=(x/v|0)+(g/Ha|0)+D*b,c[d]=x%v;return l&&(c=[l].concat(c)),c}function E(c,p,v,g){var x,S;if(v!=g)S=v>g?1:-1;else for(x=S=0;x<v;x++)if(c[x]!=p[x]){S=c[x]>p[x]?1:-1;break}return S}function f(c,p,v,g){for(var x=0;v--;)c[v]-=x,x=c[v]<p[v]?1:0,c[v]=x*g+c[v]-p[v];for(;!c[0]&&c.length>1;c.splice(0,1));}return function(c,p,v,g,x){var S,b,l,d,A,D,V,Y,se,ae,pe,ye,de,ht,wt,Re,st,et=c.s==p.s?1:-1,Ie=c.c,Te=p.c;if(!Ie||!Ie[0]||!Te||!Te[0])return new H(!c.s||!p.s||(Ie?Te&&Ie[0]==Te[0]:!Te)?NaN:Ie&&Ie[0]==0||!Te?et*0:et/0);for(Y=new H(et),se=Y.c=[],b=c.e-p.e,et=v+b+1,x||(x=Mn,b=mn(c.e/Qe)-mn(p.e/Qe),et=et/Qe|0),l=0;Te[l]==(Ie[l]||0);l++);if(Te[l]>(Ie[l]||0)&&b--,et<0)se.push(1),d=!0;else{for(ht=Ie.length,Re=Te.length,l=0,et+=2,A=dn(x/(Te[0]+1)),A>1&&(Te=O(Te,A,x),Ie=O(Ie,A,x),Re=Te.length,ht=Ie.length),de=Re,ae=Ie.slice(0,Re),pe=ae.length;pe<Re;ae[pe++]=0);st=Te.slice(),st=[0].concat(st),wt=Te[0],Te[1]>=x/2&&wt++;do{if(A=0,S=E(Te,ae,Re,pe),S<0){if(ye=ae[0],Re!=pe&&(ye=ye*x+(ae[1]||0)),A=dn(ye/wt),A>1)for(A>=x&&(A=x-1),D=O(Te,A,x),V=D.length,pe=ae.length;E(D,ae,V,pe)==1;)A--,f(D,Re<V?st:Te,V,x),V=D.length,S=1;else A==0&&(S=A=1),D=Te.slice(),V=D.length;if(V<pe&&(D=[0].concat(D)),f(ae,D,pe,x),pe=ae.length,S==-1)for(;E(Te,ae,Re,pe)<1;)A++,f(ae,Re<pe?st:Te,pe,x),pe=ae.length}else S===0&&(A++,ae=[0]);se[l++]=A,ae[0]?ae[pe++]=Ie[de]||0:(ae=[Ie[de]],pe=1)}while((de++<ht||ae[0]!=null)&&et--);d=ae[0]!=null,se[0]||se.splice(0,1)}if(x==Mn){for(l=1,et=se[0];et>=10;et/=10,l++);Se(Y,v+(Y.e=l+b*Qe-1)+1,g,d)}else Y.e=b,Y.r=+d;return Y}}();function ee(O,E,f,c){var p,v,g,x,S;if(f==null?f=m:xr(f,0,8),!O.c)return O.toString();if(p=O.c[0],g=O.e,E==null)S=hn(O.c),S=c==1||c==2&&(g<=_||g>=w)?ch(S,g):Xs(S,g,"0");else if(O=Se(new H(O),E,f),v=O.e,S=hn(O.c),x=S.length,c==1||c==2&&(E<=v||v<=_)){for(;x<E;S+="0",x++);S=ch(S,v)}else if(E-=g,S=Xs(S,v,"0"),v+1>x){if(--E>0)for(S+=".";E--;S+="0");}else if(E+=v-x,E>0)for(v+1==x&&(S+=".");E--;S+="0");return O.s<0&&p?"-"+S:S}function ce(O,E){for(var f,c,p=1,v=new H(O[0]);p<O.length;p++)c=new H(O[p]),(!c.s||(f=jo(v,c))===E||f===0&&v.s===E)&&(v=c);return v}function ge(O,E,f){for(var c=1,p=E.length;!E[--p];E.pop());for(p=E[0];p>=10;p/=10,c++);return(f=c+f*Qe-1)>T?O.c=O.e=null:f<I?O.c=[O.e=0]:(O.e=f,O.c=E),O}i=function(){var O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,f=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,g,x,S){var b,l=x?g:g.replace(p,"");if(c.test(l))v.s=isNaN(l)?null:l<0?-1:1;else{if(!x&&(l=l.replace(O,function(d,A,D){return b=(D=D.toLowerCase())=="x"?16:D=="b"?2:8,!S||S==b?A:d}),S&&(b=S,l=l.replace(E,"$1").replace(f,"0.$1")),g!=l))return new H(l,b);if(H.DEBUG)throw Error(Ni+"Not a"+(S?" base "+S:"")+" number: "+g);v.s=null}v.c=v.e=null}}();function Se(O,E,f,c){var p,v,g,x,S,b,l,d=O.c,A=dv;if(d){e:{for(p=1,x=d[0];x>=10;x/=10,p++);if(v=E-p,v<0)v+=Qe,g=E,S=d[b=0],l=dn(S/A[p-g-1]%10);else if(b=pv((v+1)/Qe),b>=d.length)if(c){for(;d.length<=b;d.push(0));S=l=0,p=1,v%=Qe,g=v-Qe+1}else break e;else{for(S=x=d[b],p=1;x>=10;x/=10,p++);v%=Qe,g=v-Qe+p,l=g<0?0:dn(S/A[p-g-1]%10)}if(c=c||E<0||d[b+1]!=null||(g<0?S:S%A[p-g-1]),c=f<4?(l||c)&&(f==0||f==(O.s<0?3:2)):l>5||l==5&&(f==4||c||f==6&&(v>0?g>0?S/A[p-g]:0:d[b-1])%10&1||f==(O.s<0?8:7)),E<1||!d[0])return d.length=0,c?(E-=O.e+1,d[0]=A[(Qe-E%Qe)%Qe],O.e=-E||0):d[0]=O.e=0,O;if(v==0?(d.length=b,x=1,b--):(d.length=b+1,x=A[Qe-v],d[b]=g>0?dn(S/A[p-g]%A[g])*x:0),c)for(;;)if(b==0){for(v=1,g=d[0];g>=10;g/=10,v++);for(g=d[0]+=x,x=1;g>=10;g/=10,x++);v!=x&&(O.e++,d[0]==Mn&&(d[0]=1));break}else{if(d[b]+=x,d[b]!=Mn)break;d[b--]=0,x=1}for(v=d.length;d[--v]===0;d.pop());}O.e>T?O.c=O.e=null:O.e<I&&(O.c=[O.e=0])}return O}function me(O){var E,f=O.e;return f===null?O.toString():(E=hn(O.c),E=f<=_||f>=w?ch(E,f):Xs(E,f,"0"),O.s<0?"-"+E:E)}return n.absoluteValue=n.abs=function(){var O=new H(this);return O.s<0&&(O.s=1),O},n.comparedTo=function(O,E){return jo(this,new H(O,E))},n.decimalPlaces=n.dp=function(O,E){var f,c,p,v=this;if(O!=null)return xr(O,0,Zr),E==null?E=m:xr(E,0,8),Se(new H(v),O+v.e+1,E);if(!(f=v.c))return null;if(c=((p=f.length-1)-mn(this.e/Qe))*Qe,p=f[p])for(;p%10==0;p/=10,c--);return c<0&&(c=0),c},n.dividedBy=n.div=function(O,E){return t(this,new H(O,E),u,m)},n.dividedToIntegerBy=n.idiv=function(O,E){return t(this,new H(O,E),0,1)},n.exponentiatedBy=n.pow=function(O,E){var f,c,p,v,g,x,S,b,l,d=this;if(O=new H(O),O.c&&!O.isInteger())throw Error(Ni+"Exponent not an integer: "+me(O));if(E!=null&&(E=new H(E)),x=O.e>14,!d.c||!d.c[0]||d.c[0]==1&&!d.e&&d.c.length==1||!O.c||!O.c[0])return l=new H(Math.pow(+me(d),x?O.s*(2-oh(O)):+me(O))),E?l.mod(E):l;if(S=O.s<0,E){if(E.c?!E.c[0]:!E.s)return new H(NaN);c=!S&&d.isInteger()&&E.isInteger(),c&&(d=d.mod(E))}else{if(O.e>9&&(d.e>0||d.e<-1||(d.e==0?d.c[0]>1||x&&d.c[1]>=24e7:d.c[0]<8e13||x&&d.c[0]<=9999975e7)))return v=d.s<0&&oh(O)?-0:0,d.e>-1&&(v=1/v),new H(S?1/v:v);B&&(v=pv(B/Qe+2))}for(x?(f=new H(.5),S&&(O.s=1),b=oh(O)):(p=Math.abs(+me(O)),b=p%2),l=new H(o);;){if(b){if(l=l.times(d),!l.c)break;v?l.c.length>v&&(l.c.length=v):c&&(l=l.mod(E))}if(p){if(p=dn(p/2),p===0)break;b=p%2}else if(O=O.times(f),Se(O,O.e+1,1),O.e>14)b=oh(O);else{if(p=+me(O),p===0)break;b=p%2}d=d.times(d),v?d.c&&d.c.length>v&&(d.c.length=v):c&&(d=d.mod(E))}return c?l:(S&&(l=o.div(l)),E?l.mod(E):v?Se(l,B,m,g):l)},n.integerValue=function(O){var E=new H(this);return O==null?O=m:xr(O,0,8),Se(E,E.e+1,O)},n.isEqualTo=n.eq=function(O,E){return jo(this,new H(O,E))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(O,E){return jo(this,new H(O,E))>0},n.isGreaterThanOrEqualTo=n.gte=function(O,E){return(E=jo(this,new H(O,E)))===1||E===0},n.isInteger=function(){return!!this.c&&mn(this.e/Qe)>this.c.length-2},n.isLessThan=n.lt=function(O,E){return jo(this,new H(O,E))<0},n.isLessThanOrEqualTo=n.lte=function(O,E){return(E=jo(this,new H(O,E)))===-1||E===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(O,E){var f,c,p,v,g=this,x=g.s;if(O=new H(O,E),E=O.s,!x||!E)return new H(NaN);if(x!=E)return O.s=-E,g.plus(O);var S=g.e/Qe,b=O.e/Qe,l=g.c,d=O.c;if(!S||!b){if(!l||!d)return l?(O.s=-E,O):new H(d?g:NaN);if(!l[0]||!d[0])return d[0]?(O.s=-E,O):new H(l[0]?g:m==3?-0:0)}if(S=mn(S),b=mn(b),l=l.slice(),x=S-b){for((v=x<0)?(x=-x,p=l):(b=S,p=d),p.reverse(),E=x;E--;p.push(0));p.reverse()}else for(c=(v=(x=l.length)<(E=d.length))?x:E,x=E=0;E<c;E++)if(l[E]!=d[E]){v=l[E]<d[E];break}if(v&&(p=l,l=d,d=p,O.s=-O.s),E=(c=d.length)-(f=l.length),E>0)for(;E--;l[f++]=0);for(E=Mn-1;c>x;){if(l[--c]<d[c]){for(f=c;f&&!l[--f];l[f]=E);--l[f],l[c]+=Mn}l[c]-=d[c]}for(;l[0]==0;l.splice(0,1),--b);return l[0]?ge(O,l,b):(O.s=m==3?-1:1,O.c=[O.e=0],O)},n.modulo=n.mod=function(O,E){var f,c,p=this;return O=new H(O,E),!p.c||!O.s||O.c&&!O.c[0]?new H(NaN):!O.c||p.c&&!p.c[0]?new H(p):(C==9?(c=O.s,O.s=1,f=t(p,O,0,3),O.s=c,f.s*=c):f=t(p,O,0,C),O=p.minus(f.times(O)),!O.c[0]&&C==1&&(O.s=p.s),O)},n.multipliedBy=n.times=function(O,E){var f,c,p,v,g,x,S,b,l,d,A,D,V,Y,se,ae=this,pe=ae.c,ye=(O=new H(O,E)).c;if(!pe||!ye||!pe[0]||!ye[0])return!ae.s||!O.s||pe&&!pe[0]&&!ye||ye&&!ye[0]&&!pe?O.c=O.e=O.s=null:(O.s*=ae.s,!pe||!ye?O.c=O.e=null:(O.c=[0],O.e=0)),O;for(c=mn(ae.e/Qe)+mn(O.e/Qe),O.s*=ae.s,S=pe.length,d=ye.length,S<d&&(V=pe,pe=ye,ye=V,p=S,S=d,d=p),p=S+d,V=[];p--;V.push(0));for(Y=Mn,se=Ha,p=d;--p>=0;){for(f=0,A=ye[p]%se,D=ye[p]/se|0,g=S,v=p+g;v>p;)b=pe[--g]%se,l=pe[g]/se|0,x=D*b+l*A,b=A*b+x%se*se+V[v]+f,f=(b/Y|0)+(x/se|0)+D*l,V[v--]=b%Y;V[v]=f}return f?++c:V.splice(0,1),ge(O,V,c)},n.negated=function(){var O=new H(this);return O.s=-O.s||null,O},n.plus=function(O,E){var f,c=this,p=c.s;if(O=new H(O,E),E=O.s,!p||!E)return new H(NaN);if(p!=E)return O.s=-E,c.minus(O);var v=c.e/Qe,g=O.e/Qe,x=c.c,S=O.c;if(!v||!g){if(!x||!S)return new H(p/0);if(!x[0]||!S[0])return S[0]?O:new H(x[0]?c:p*0)}if(v=mn(v),g=mn(g),x=x.slice(),p=v-g){for(p>0?(g=v,f=S):(p=-p,f=x),f.reverse();p--;f.push(0));f.reverse()}for(p=x.length,E=S.length,p-E<0&&(f=S,S=x,x=f,E=p),p=0;E;)p=(x[--E]=x[E]+S[E]+p)/Mn|0,x[E]=Mn===x[E]?0:x[E]%Mn;return p&&(x=[p].concat(x),++g),ge(O,x,g)},n.precision=n.sd=function(O,E){var f,c,p,v=this;if(O!=null&&O!==!!O)return xr(O,1,Zr),E==null?E=m:xr(E,0,8),Se(new H(v),O,E);if(!(f=v.c))return null;if(p=f.length-1,c=p*Qe+1,p=f[p]){for(;p%10==0;p/=10,c--);for(p=f[0];p>=10;p/=10,c++);}return O&&v.e+1>c&&(c=v.e+1),c},n.shiftedBy=function(O){return xr(O,-hv,hv),this.times("1e"+O)},n.squareRoot=n.sqrt=function(){var O,E,f,c,p,v=this,g=v.c,x=v.s,S=v.e,b=u+4,l=new H("0.5");if(x!==1||!g||!g[0])return new H(!x||x<0&&(!g||g[0])?NaN:g?v:1/0);if(x=Math.sqrt(+me(v)),x==0||x==1/0?(E=hn(g),(E.length+S)%2==0&&(E+="0"),x=Math.sqrt(+E),S=mn((S+1)/2)-(S<0||S%2),x==1/0?E="5e"+S:(E=x.toExponential(),E=E.slice(0,E.indexOf("e")+1)+S),f=new H(E)):f=new H(x+""),f.c[0]){for(S=f.e,x=S+b,x<3&&(x=0);;)if(p=f,f=l.times(p.plus(t(v,p,b,1))),hn(p.c).slice(0,x)===(E=hn(f.c)).slice(0,x))if(f.e<S&&--x,E=E.slice(x-3,x+1),E=="9999"||!c&&E=="4999"){if(!c&&(Se(p,p.e+u+2,0),p.times(p).eq(v))){f=p;break}b+=4,x+=4,c=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Se(f,f.e+u+2,1),O=!f.times(f).eq(v));break}}return Se(f,f.e+u+1,m,O)},n.toExponential=function(O,E){return O!=null&&(xr(O,0,Zr),O++),ee(this,O,E,1)},n.toFixed=function(O,E){return O!=null&&(xr(O,0,Zr),O=O+this.e+1),ee(this,O,E)},n.toFormat=function(O,E,f){var c,p=this;if(f==null)O!=null&&E&&typeof E=="object"?(f=E,E=null):O&&typeof O=="object"?(f=O,O=E=null):f=U;else if(typeof f!="object")throw Error(Ni+"Argument not an object: "+f);if(c=p.toFixed(O,E),p.c){var v,g=c.split("."),x=+f.groupSize,S=+f.secondaryGroupSize,b=f.groupSeparator||"",l=g[0],d=g[1],A=p.s<0,D=A?l.slice(1):l,V=D.length;if(S&&(v=x,x=S,S=v,V-=v),x>0&&V>0){for(v=V%x||x,l=D.substr(0,v);v<V;v+=x)l+=b+D.substr(v,x);S>0&&(l+=b+D.slice(v)),A&&(l="-"+l)}c=d?l+(f.decimalSeparator||"")+((S=+f.fractionGroupSize)?d.replace(new RegExp("\\d{"+S+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):d):l}return(f.prefix||"")+c+(f.suffix||"")},n.toFraction=function(O){var E,f,c,p,v,g,x,S,b,l,d,A,D=this,V=D.c;if(O!=null&&(x=new H(O),!x.isInteger()&&(x.c||x.s!==1)||x.lt(o)))throw Error(Ni+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+me(x));if(!V)return new H(D);for(E=new H(o),b=f=new H(o),c=S=new H(o),A=hn(V),v=E.e=A.length-D.e-1,E.c[0]=dv[(g=v%Qe)<0?Qe+g:g],O=!O||x.comparedTo(E)>0?v>0?E:b:x,g=T,T=1/0,x=new H(A),S.c[0]=0;l=t(x,E,0,1),p=f.plus(l.times(c)),p.comparedTo(O)!=1;)f=c,c=p,b=S.plus(l.times(p=b)),S=p,E=x.minus(l.times(p=E)),x=p;return p=t(O.minus(f),c,0,1),S=S.plus(p.times(b)),f=f.plus(p.times(c)),S.s=b.s=D.s,v=v*2,d=t(b,c,v,m).minus(D).abs().comparedTo(t(S,f,v,m).minus(D).abs())<1?[b,c]:[S,f],T=g,d},n.toNumber=function(){return+me(this)},n.toPrecision=function(O,E){return O!=null&&xr(O,1,Zr),ee(this,O,E,2)},n.toString=function(O){var E,f=this,c=f.s,p=f.e;return p===null?c?(E="Infinity",c<0&&(E="-"+E)):E="NaN":(O==null?E=p<=_||p>=w?ch(hn(f.c),p):Xs(hn(f.c),p,"0"):O===10&&$?(f=Se(new H(f),u+p+1,m),E=Xs(hn(f.c),f.e,"0")):(xr(O,2,Z.length,"Base"),E=r(Xs(hn(f.c),p,"0"),10,O,c,!0)),c<0&&f.c[0]&&(E="-"+E)),E},n.valueOf=n.toJSON=function(){return me(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,e!=null&&H.set(e),H}function mn(e){var t=e|0;return e>0||e===t?t:t-1}function hn(e){for(var t,r,i=1,n=e.length,o=e[0]+"";i<n;){for(t=e[i++]+"",r=Qe-t.length;r--;t="0"+t);o+=t}for(n=o.length;o.charCodeAt(--n)===48;);return o.slice(0,n+1||1)}function jo(e,t){var r,i,n=e.c,o=t.c,u=e.s,m=t.s,_=e.e,w=t.e;if(!u||!m)return null;if(r=n&&!n[0],i=o&&!o[0],r||i)return r?i?0:-m:u;if(u!=m)return u;if(r=u<0,i=_==w,!n||!o)return i?0:!n^r?1:-1;if(!i)return _>w^r?1:-1;for(m=(_=n.length)<(w=o.length)?_:w,u=0;u<m;u++)if(n[u]!=o[u])return n[u]>o[u]^r?1:-1;return _==w?0:_>w^r?1:-1}function xr(e,t,r,i){if(e<t||e>r||e!==dn(e))throw Error(Ni+(i||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function oh(e){var t=e.c.length-1;return mn(e.e/Qe)==t&&e.c[t]%2!=0}function ch(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Xs(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(i=e.length,++t>i){for(n=r,t-=i;--t;n+=r);e+=n}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}var O7=z2(),Lr=O7;var q9=Mr(mv(),1),F9=Mr(vh(),1),H9=Mr(gh(),1),Cv=Mr(wh(),1),z9=Mr(Mv(),1);var Lv="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",V9=(e,t)=>{let r="1"+"0".repeat(t),i=new Lr(e.toString(10),10);return Uf(i.times(r).toString(16))},j9=(e,t)=>{let r="1"+"0".repeat(t),i=new Lr(e.toString(),10);return parseFloat(i.dividedBy(r).toString())},W9=e=>{typeof e=="string"&&(e=new Uint8Array(Buffer.from(e)));let t=[],r=BigInt("0x"+Buffer.from(e).toString("hex"));for(;r>BigInt(0);){let i=Number(r%BigInt(58));t.unshift(Lv[i]),r=r/BigInt(58)}for(let i=0;i<e.length&&e[i]===0;i++)t.unshift(Lv[0]);return t.join("")},K9=e=>{let t=BigInt(0);for(let n=0;n<e.length;n++)t=t*BigInt(58)+BigInt(Lv.indexOf(e[n]));let r=t.toString(16),i=r.length%2===0?r:"0"+r;return new Uint8Array(Buffer.from(i,"hex"))},G9=e=>Buffer.from(e).toString("utf8"),$9=e=>Buffer.from(e,"utf8"),Y9=e=>!isNaN(Number(e)),Uv=async e=>{await new Promise(t=>setTimeout(t,e))},Dv=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Z9=e=>{let[t,r]=e.toExponential().split("e").map(n=>parseFloat(n)),i=(t*Math.pow(10,r)).toString();return i=parseFloat(i).toString(),i},Yf=async e=>await new Promise((t,r)=>{let i;typeof window<"u"?i=new WebSocket(e):i=new Cv.default(e),i.onopen=()=>{t(!0),i.close()},i.onerror=n=>{r(new Error(n.message)),i.close()}}),Eh={add:(e,t,r=18)=>parseFloat(new Lr(e).plus(new Lr(t)).toFixed(r)),sub:(e,t,r=18)=>parseFloat(new Lr(e).minus(new Lr(t)).toFixed(r)),mul:(e,t,r=18)=>parseFloat(new Lr(e).times(new Lr(t)).toFixed(r)),div:(e,t,r=18)=>parseFloat(new Lr(e).div(new Lr(t)).toFixed(r)),pow:(e,t,r=18)=>parseFloat(new Lr(e).pow(t).toFixed(r)),sqrt:(e,t=18)=>parseFloat(new Lr(e).sqrt().toFixed(t)),abs:(e,t=18)=>parseFloat(new Lr(e).absoluteValue().toFixed(t)),ceil:(e,t=18)=>parseFloat(new Lr(e).integerValue(Lr.ROUND_CEIL).toFixed(t)),floor:(e,t=18)=>parseFloat(new Lr(e).integerValue(Lr.ROUND_FLOOR).toFixed(t)),round:(e,t=18)=>parseFloat(new Lr(e).integerValue(Lr.ROUND_HALF_UP).toFixed(t))},X9=()=>typeof window>"u"?!1:function(e){return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(e.substr(0,4)))}(navigator.userAgent||navigator.vendor||window.opera),J9=()=>{if(typeof window>"u")return!1;let e=window.navigator;if(window.WebViewJavascriptBridge||window.webkit&&window.webkit.messageHandlers||e.userAgent.match(/WebView/i))return!0;let t=e.standalone,r=e.userAgent.toLowerCase(),i=/safari/.test(r);return/iphone|ipod|ipad/.test(r)?!t&&!i:r.includes("wv")};var Fv={};Oa(Fv,{AssetDirectionEnum:()=>qv,ErrorTypeEnum:()=>Zf,TransactionListenerProcessIndex:()=>Rh,TransactionStatusEnum:()=>Th,TransactionTypeEnum:()=>Ih,WalletPlatformEnum:()=>zw});var qv=(r=>(r.INCOMING="INCOMING",r.OUTGOING="OUTGOING",r))(qv||{}),Ih=(o=>(o.GENERAL="GENERAL",o.CONTRACT="CONTRACT",o.COIN="COIN",o.TOKEN="TOKEN",o.NFT="NFT",o))(Ih||{}),Th=(i=>(i.FAILED="FAILED",i.PENDING="PENDING",i.CONFIRMED="CONFIRMED",i))(Th||{}),Zf=(c=>(c.RPC_TIMEOUT="RPC_TIMEOUT",c.RPC_REQUEST_ERROR="RPC_REQUEST_ERROR",c.RPC_ACCESS_DENIED="RPC_ACCESS_DENIED",c.WS_URL_NOT_DEFINED="WS_URL_NOT_DEFINED",c.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",c.UNACCEPTED_CHAIN="UNACCEPTED_CHAIN",c.UNAUTHORIZED_ADDRESS="UNAUTHORIZED_ADDRESS",c.INSUFFICIENT_BALANCE="INSUFFICIENT_BALANCE",c.INVALID_AMOUNT="INVALID_AMOUNT",c.INVALID_ADDRESS="INVALID_ADDRESS",c.INVALID_PRIVATE_KEY="INVALID_PRIVATE_KEY",c.INVALID_PUBLIC_KEY="INVALID_PUBLIC_KEY",c.INVALID_TRANSACTION_ID="INVALID_TRANSACTION_ID",c.PROVIDER_IS_REQUIRED="PROVIDER_IS_REQUIRED",c.PROVIDER_IS_NOT_INITIALIZED="PROVIDER_IS_NOT_INITIALIZED",c.PROVIDER_IS_ALREADY_INITIALIZED="PROVIDER_IS_ALREADY_INITIALIZED",c.WALLET_ALREADY_PROCESSING="WALLET_ALREADY_PROCESSING",c.WALLET_CONNECT_REJECTED="WALLET_CONNECT_REJECTED",c.WALLET_REQUEST_REJECTED="WALLET_REQUEST_REJECTED",c.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",c.WALLET_CONNECTION_TIMEOUT="WALLET_CONNECTION_TIMEOUT",c.TRANSACTION_CREATION_FAILED="TRANSACTION_CREATION_FAILED",c.TRANSACTION_NOT_FOUND="TRANSACTION_NOT_FOUND",c.CLOSED_WALLETCONNECT_MODAL="CLOSED_WALLETCONNECT_MODAL",c.PROJECT_ID_IS_REQUIRED="PROJECT_ID_IS_REQUIRED",c.METADATA_IS_REQUIRED="METADATA_IS_REQUIRED",c.CONFIG_IS_REQUIRED="CONFIG_IS_REQUIRED",c))(Zf||{}),zw=(n=>(n.BROWSER="BROWSER",n.MOBILE="MOBILE",n.DESKTOP="DESKTOP",n.UNIVERSAL="UNIVERSAL",n))(zw||{});var Rh={GENERAL:"generalProcess",CONTRACT:"contractProcess",COIN:"coinProcess",TOKEN:"tokenProcess",NFT:"nftProcess"};var Ln=class e{network;api;explorer;wsUrl;blockCypherToken;static _instance;constructor(t){this.update(t)}static get instance(){if(e._instance===void 0)throw new Error("PROVIDER_IS_NOT_INITIALIZED");return e._instance}static initialize(t){if(e._instance!==void 0)throw new Error("PROVIDER_IS_ALREADY_INITIALIZED");e._instance=new e(t)}async checkRpcConnection(t){try{let r=await ln.get(t??this.createEndpoint("blocks/tip/height"));return r.status!==200?new Error(r.statusText+": "+JSON.stringify(r.data)):!0}catch(r){return r}}async checkWsConnection(t){try{let r=await Yf(t??this.wsUrl);return r instanceof Error?r:!0}catch(r){return r}}update(t){this.network=t,e._instance=this;let r=this.network.testnet??!1;this.blockCypherToken=this.network.blockCypherToken,r?(this.api="https://blockstream.info/testnet/api/",this.explorer="https://blockstream.info/testnet/",this.wsUrl="wss://mempool.space/testnet/api/v1/ws"):(this.api="https://blockstream.info/api/",this.explorer="https://blockstream.info/",this.network.blockCypherToken!==void 0?this.wsUrl="wss://socket.blockcypher.com/v1/btc/main?token="+this.network.blockCypherToken:this.wsUrl="wss://ws.blockchain.info/inv"),this.network.rpcUrl=this.api,this.network.wsUrl=this.wsUrl}createEndpoint(t){return this.api+t}isTestnet(){return this.network?.testnet??!1}};var _U=Mr(Rx(),1);var Px={};Oa(Px,{Coin:()=>kx});var Rl=Mr(Rx(),1);var Ox={};Oa(Ox,{base58Decode:()=>K9,base58Encode:()=>W9,bufferToString:()=>G9,checkWebSocket:()=>Yf,fromSatoshi:()=>Zn,hexToNumber:()=>j9,isMobile:()=>X9,isNumeric:()=>Y9,isWebview:()=>J9,math:()=>Eh,numberToHex:()=>V9,objectsEqual:()=>Dv,sleep:()=>Uv,stringToBuffer:()=>$9,toHex:()=>Uf,toReadableString:()=>Z9,toSatoshi:()=>Ax});var Zn=e=>Eh.div(e,1e8,8),Ax=e=>Eh.mul(e,1e8,8);var Tl=class{rawData;signedData;provider;constructor(t,r){this.rawData=t,this.provider=r??Ln.instance}async sign(t){return this.rawData.bitcoreLib.sign(t),this.signedData=this.rawData.bitcoreLib.serialize(),this}async send(){try{return(await ln({method:"POST",url:this.provider.createEndpoint("tx"),data:this.signedData})).data}catch(t){throw new Error(JSON.stringify(t.response?.data))}}getRawData(){return this.rawData}getSignedData(){return this.signedData??""}};var kx=class{provider;constructor(t){this.provider=t??Ln.instance}getName(){return"Bitcoin"}getSymbol(){return"BTC"}getDecimals(){return 8}async getBalance(t){let r=this.provider.createEndpoint("address/"+t),i=await ln.get(r).then(o=>o.data),n=i.chain_stats.funded_txo_sum-i.chain_stats.spent_txo_sum;return Zn(n)}async transfer(t,r,i){if(i<0)throw new Error("INVALID_AMOUNT");if(i>await this.getBalance(t))throw new Error("INSUFFICIENT_BALANCE");if(t===r)throw new Error("INVALID_ADDRESS");let n=[],o=new Rl.default.Transaction,u=new Rl.default.Address(t),m=Ax(i),_=await ln.get(this.provider.createEndpoint("address/"+t+"/utxo")).then(w=>w.data);for(let w of _)n.push(new Rl.default.Transaction.UnspentOutput({txId:w.txid,satoshis:w.value,address:u,outputIndex:w.vout,script:Rl.default.Script.fromAddress(u)}));return o.from(n),o.change(t),o.to(r,m),new Tl({sender:t,receiver:r,amount:m,bitcoreLib:o})}};var Nx={};Oa(Nx,{CoinTransaction:()=>Al,Transaction:()=>bc});var wT=0,bc=class{id;provider;data=null;constructor(t,r){this.id=t,this.provider=r??Ln.instance}async getData(){if(this.data!==null)return this.data;try{let t=(await ln.get(this.provider.createEndpoint("tx/"+this.id))).data;return t?.txid!==this.id?this.data=null:this.data=t}catch(t){if(console.error("MC Bitcoin TX getData",t),String(t?.response?.data).includes("Transaction not found")){if(wT>5)throw new Error("TRANSACTION_NOT_FOUND");return wT++,await Uv(2e3),await this.getData()}throw new Error("RPC_REQUEST_ERROR")}}async wait(t=4e3){return await new Promise((r,i)=>{let n=async()=>{try{let o=await this.getStatus();if(o==="CONFIRMED"){r("CONFIRMED");return}else if(o==="FAILED"){i("FAILED");return}setTimeout(n,t)}catch(o){console.error("MC Bitcoin TX wait",o),i("FAILED")}};n()})}getId(){return this.id}async getType(){return"COIN"}getUrl(){return this.provider.explorer+"tx/"+this.id}async getSigner(){return(await this.getData())?.vin[0].prevout.scriptpubkey_address??""}async getFee(){let t=await this.getData();return Zn(t?.fee??0)}async getBlockNumber(){return(await this.getData())?.status?.block_height??0}async getBlockTimestamp(){return(await this.getData())?.status?.block_time??0}async getBlockConfirmationCount(){let t=await this.getData();return t===null?0:(await ln.get(this.provider.createEndpoint("blocks/tip/height"))).data-t?.status?.block_height}async getStatus(){let t=await this.getData();return t===null?"PENDING":t.status?.block_height!==void 0?t.status.confirmed?"CONFIRMED":"FAILED":"PENDING"}};var Al=class extends bc{async getReceiver(){return(await this.getData())?.vout[0].scriptpubkey_address??""}async getSender(){return await this.getSigner()}async getAmount(){let t=await this.getData();return Zn(t?.vout[0].value??0)}async verifyTransfer(t,r,i){if(await this.getStatus()==="PENDING")return"PENDING";if(await this.getAmount()!==i)return"FAILED";if(t==="INCOMING"){if((await this.getReceiver()).toLowerCase()!==r.toLowerCase())return"FAILED"}else if((await this.getSender()).toLowerCase()!==r.toLowerCase())return"FAILED";return"CONFIRMED"}};var Mx={};Oa(Mx,{TransactionListener:()=>Bx,TransactionSigner:()=>Tl});var RT=Mr(TT(),1);var Bx=class{type;provider;status=!1;callbacks=[];triggeredTransactions=[];filter;webSocket;dynamicStop=()=>{};constructor(t,r,i){this.type=t,this.filter=r??{},this.provider=i??Ln.instance}stop(){this.status&&(this.status=!1,this.dynamicStop())}start(){this.status||(this.status=!0,this[Rh[this.type]]())}getStatus(){return this.status}async on(t){if(this.webSocket===void 0)try{await Yf(this.provider.wsUrl),this.webSocket=new RT.default(this.provider.wsUrl)}catch(r){throw new Error("WebSocket connection is not available"+(r instanceof Error?": "+r.message:""))}return this.start(),this.callbacks.push(t),!0}trigger(t){this.triggeredTransactions.includes(t.id)||(this.triggeredTransactions.push(t.id),this.callbacks.forEach(r=>{r(t)}))}createMessage(t){let r;if(this.provider.isTestnet())r=JSON.stringify({"track-address":t});else if(this.provider.blockCypherToken!==void 0){let i={event:"unconfirmed-tx",token:this.provider.blockCypherToken};t!==void 0&&(i.address=t),r=JSON.stringify(i)}else r=JSON.stringify({op:"unconfirmed_sub"});return this.dynamicStop=()=>{this.provider.blockCypherToken===void 0&&this.webSocket.send(JSON.stringify({op:"unconfirmed_unsub"})),this.webSocket.close()},r}getValues(t){let r={txId:""};if(this.provider.isTestnet()){let i=t["address-transactions"]?.[0]??t["block-transactions"]?.[0];r.txId=i.txid,r.sender=i.vin[0].prevout.scriptpubkey_address,r.receiver=i.vout[0].scriptpubkey_address,r.amount=Zn(i.vout[0].value)}else this.provider.blockCypherToken!==void 0?(r.txId=t.hash,r.sender=t.inputs[0].addresses[0],r.receiver=t.outputs[0].addresses[0],r.amount=Zn(t.outputs[0].value)):(r.txId=t.x.hash,r.receiver=t.x.out[0].addr,r.sender=t.x.inputs[0].prev_out.addr,r.amount=Zn(t.x.out[0].value));return r}generalProcess(){if(this.provider.isTestnet()&&this.filter?.signer===void 0)throw new Error("General transaction listener must have a signer filter in testnet.");let t=this.createMessage(this.filter?.signer);this.webSocket.addEventListener("open",()=>{this.webSocket.send(t)}),this.webSocket.addEventListener("message",async r=>{let i=this.getValues(JSON.parse(r.data));this.filter?.signer!==void 0&&i.sender?.toLowerCase()!==this.filter.signer.toLowerCase()||this.trigger(new bc(i.txId))})}contractProcess(){throw new Error("This method is not implemented for Bitcoin.")}coinProcess(){let t=this.filter;if(t.signer!==void 0&&t.sender!==void 0&&t.signer!==t.sender)throw new Error("Sender and signer must be the same in coin transactions. Or only one of them can be defined.");let r=t.sender??t.signer,i=this.createMessage(t.receiver);this.webSocket.addEventListener("open",()=>{this.webSocket.send(i)}),this.webSocket.addEventListener("message",async n=>{let o=JSON.parse(n.data),u={},m={};if(o.event&&String(o.event).includes("events limit reached"))throw new Error("BlockCypher events limit reached.");let _=this.getValues(o);if(r!==void 0&&(u.sender=r.toLowerCase(),m.sender=_.sender?.toLowerCase()),t.receiver!==void 0&&(u.receiver=t.receiver.toLowerCase(),m.receiver=_.receiver?.toLowerCase()),!Dv(u,m))return;let w=new Al(_.txId);t.amount!==void 0&&_.amount!==t.amount||this.trigger(w)})}tokenProcess(){throw new Error("This method is not implemented for Bitcoin.")}nftProcess(){throw new Error("This method is not implemented for Bitcoin.")}};0&&(module.exports={Provider,assets,bitcore,models,services,types,utils});
39
39
  /*! Bundled license information:
40
40
 
41
41
  mime-db/index.js: