@btc-vision/transaction 1.0.0
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/.babelrc +7 -0
- package/.gitattributes +2 -0
- package/.github/workflows/node.js.yml +22 -0
- package/.idea/codeStyles/Project.xml +56 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/transaction.iml +16 -0
- package/.idea/vcs.xml +6 -0
- package/.prettierrc.json +12 -0
- package/CONTRIBUTING.md +71 -0
- package/LICENSE.md +16 -0
- package/README.md +213 -0
- package/browser/873e754d6c7c6e9361f1.module.wasm +0 -0
- package/browser/_version.d.ts +1 -0
- package/browser/bytecode/Compressor.d.ts +6 -0
- package/browser/crypto/crypto-browser.d.ts +40 -0
- package/browser/crypto/crypto.d.ts +2 -0
- package/browser/generators/Generator.d.ts +12 -0
- package/browser/generators/builders/CalldataGenerator.d.ts +8 -0
- package/browser/generators/builders/DeploymentGenerator.d.ts +7 -0
- package/browser/index.d.ts +3 -0
- package/browser/index.js +2 -0
- package/browser/index.js.LICENSE.txt +23 -0
- package/browser/keypair/EcKeyPair.d.ts +24 -0
- package/browser/keypair/Wallet.d.ts +16 -0
- package/browser/keypair/interfaces/IWallet.d.ts +5 -0
- package/browser/metadata/ContractBaseMetadata.d.ts +9 -0
- package/browser/metadata/ContractMetadataManager.d.ts +1 -0
- package/browser/metadata/contracts/wBTC.d.ts +12 -0
- package/browser/network/NetworkInformation.d.ts +6 -0
- package/browser/opnet.d.ts +22 -0
- package/browser/scripts/Regtest.d.ts +2 -0
- package/browser/scripts/test.d.ts +1 -0
- package/browser/signer/TweakedSigner.d.ts +9 -0
- package/browser/transaction/TransactionBuilder.d.ts +1 -0
- package/browser/transaction/TransactionFactory.d.ts +4 -0
- package/browser/transaction/builders/FundingTransaction.d.ts +11 -0
- package/browser/transaction/builders/InteractionTransaction.d.ts +47 -0
- package/browser/transaction/builders/TransactionBuilder.d.ts +64 -0
- package/browser/transaction/enums/TransactionType.d.ts +7 -0
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +33 -0
- package/browser/transaction/interfaces/Tap.d.ts +22 -0
- package/browser/utils/BitcoinUtils.d.ts +5 -0
- package/browser/utxo/UTXOManager.d.ts +7 -0
- package/browser/utxo/interfaces/IUTXO.d.ts +19 -0
- package/build/Utils.d.ts +0 -0
- package/build/Utils.js +1 -0
- package/build/_version.d.ts +1 -0
- package/build/_version.js +1 -0
- package/build/bytecode/Compressor.d.ts +6 -0
- package/build/bytecode/Compressor.js +13 -0
- package/build/contracts/ContractMetadataManager.d.ts +0 -0
- package/build/contracts/ContractMetadataManager.js +1 -0
- package/build/crypto/crypto.d.ts +2 -0
- package/build/crypto/crypto.js +1 -0
- package/build/generators/Generator.d.ts +12 -0
- package/build/generators/Generator.js +25 -0
- package/build/generators/builders/CalldataGenerator.d.ts +8 -0
- package/build/generators/builders/CalldataGenerator.js +79 -0
- package/build/generators/builders/DeploymentGenerator.d.ts +7 -0
- package/build/generators/builders/DeploymentGenerator.js +38 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +3 -0
- package/build/keypair/EcKeyPair.d.ts +24 -0
- package/build/keypair/EcKeyPair.js +107 -0
- package/build/keypair/Wallet.d.ts +16 -0
- package/build/keypair/Wallet.js +30 -0
- package/build/keypair/interfaces/GeneratedWallet.d.ts +5 -0
- package/build/keypair/interfaces/GeneratedWallet.js +1 -0
- package/build/keypair/interfaces/IWallet.d.ts +5 -0
- package/build/keypair/interfaces/IWallet.js +1 -0
- package/build/metadata/ContractBaseMetadata.d.ts +9 -0
- package/build/metadata/ContractBaseMetadata.js +13 -0
- package/build/metadata/ContractMetadataManager.d.ts +1 -0
- package/build/metadata/ContractMetadataManager.js +9 -0
- package/build/metadata/contracts/ContractBase.d.ts +9 -0
- package/build/metadata/contracts/ContractBase.js +13 -0
- package/build/metadata/contracts/ContractBaseMetadata.d.ts +9 -0
- package/build/metadata/contracts/ContractBaseMetadata.js +13 -0
- package/build/metadata/contracts/ContractMetadataManager.d.ts +0 -0
- package/build/metadata/contracts/ContractMetadataManager.js +1 -0
- package/build/metadata/contracts/wBTC.d.ts +12 -0
- package/build/metadata/contracts/wBTC.js +26 -0
- package/build/network/NetworkConverter.d.ts +0 -0
- package/build/network/NetworkConverter.js +14 -0
- package/build/network/NetworkInformation.d.ts +6 -0
- package/build/network/NetworkInformation.js +1 -0
- package/build/opnet.d.ts +22 -0
- package/build/opnet.js +22 -0
- package/build/scripts/Regtest.d.ts +2 -0
- package/build/scripts/Regtest.js +15 -0
- package/build/scripts/test.d.ts +1 -0
- package/build/scripts/test.js +74 -0
- package/build/signer/Regtest.d.ts +2 -0
- package/build/signer/Regtest.js +15 -0
- package/build/signer/TweakedSigner.d.ts +9 -0
- package/build/signer/TweakedSigner.js +22 -0
- package/build/transaction/TransactionBuilder.d.ts +60 -0
- package/build/transaction/TransactionBuilder.js +244 -0
- package/build/transaction/TransactionFactory.d.ts +4 -0
- package/build/transaction/TransactionFactory.js +32 -0
- package/build/transaction/builders/FundingTransaction.d.ts +11 -0
- package/build/transaction/builders/FundingTransaction.js +23 -0
- package/build/transaction/builders/GenericTransaction.d.ts +11 -0
- package/build/transaction/builders/GenericTransaction.js +23 -0
- package/build/transaction/builders/InteractionTransaction.d.ts +47 -0
- package/build/transaction/builders/InteractionTransaction.js +219 -0
- package/build/transaction/builders/TransactionBuilder.d.ts +64 -0
- package/build/transaction/builders/TransactionBuilder.js +288 -0
- package/build/transaction/enums/TransactionType.d.ts +7 -0
- package/build/transaction/enums/TransactionType.js +8 -0
- package/build/transaction/interfaces/ITransactionParameters.d.ts +33 -0
- package/build/transaction/interfaces/ITransactionParameters.js +1 -0
- package/build/transaction/interfaces/ITransactions.d.ts +32 -0
- package/build/transaction/interfaces/ITransactions.js +1 -0
- package/build/transaction/interfaces/Tap.d.ts +22 -0
- package/build/transaction/interfaces/Tap.js +1 -0
- package/build/utils/BitcoinUtils.d.ts +5 -0
- package/build/utils/BitcoinUtils.js +9 -0
- package/build/utxo/IUTXO.d.ts +0 -0
- package/build/utxo/IUTXO.js +1 -0
- package/build/utxo/UTXOManager.d.ts +7 -0
- package/build/utxo/UTXOManager.js +47 -0
- package/build/utxo/interfaces/IUTXO.d.ts +19 -0
- package/build/utxo/interfaces/IUTXO.js +1 -0
- package/cjs/_version.d.ts +1 -0
- package/cjs/_version.js +4 -0
- package/cjs/bytecode/Compressor.d.ts +6 -0
- package/cjs/bytecode/Compressor.js +20 -0
- package/cjs/crypto/crypto.d.ts +2 -0
- package/cjs/crypto/crypto.js +8 -0
- package/cjs/generators/Generator.d.ts +13 -0
- package/cjs/generators/Generator.js +31 -0
- package/cjs/generators/builders/CalldataGenerator.d.ts +8 -0
- package/cjs/generators/builders/CalldataGenerator.js +83 -0
- package/cjs/generators/builders/DeploymentGenerator.d.ts +7 -0
- package/cjs/generators/builders/DeploymentGenerator.js +42 -0
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +32 -0
- package/cjs/keypair/EcKeyPair.d.ts +24 -0
- package/cjs/keypair/EcKeyPair.js +137 -0
- package/cjs/keypair/Wallet.d.ts +16 -0
- package/cjs/keypair/Wallet.js +34 -0
- package/cjs/keypair/interfaces/IWallet.d.ts +5 -0
- package/cjs/keypair/interfaces/IWallet.js +2 -0
- package/cjs/metadata/ContractBaseMetadata.d.ts +9 -0
- package/cjs/metadata/ContractBaseMetadata.js +17 -0
- package/cjs/metadata/ContractMetadataManager.d.ts +0 -0
- package/cjs/metadata/ContractMetadataManager.js +1 -0
- package/cjs/metadata/contracts/wBTC.d.ts +12 -0
- package/cjs/metadata/contracts/wBTC.js +30 -0
- package/cjs/network/NetworkInformation.d.ts +6 -0
- package/cjs/network/NetworkInformation.js +2 -0
- package/cjs/opnet.d.ts +1 -0
- package/cjs/opnet.js +5 -0
- package/cjs/scripts/Regtest.d.ts +2 -0
- package/cjs/scripts/Regtest.js +18 -0
- package/cjs/scripts/test.d.ts +1 -0
- package/cjs/scripts/test.js +44 -0
- package/cjs/signer/TweakedSigner.d.ts +9 -0
- package/cjs/signer/TweakedSigner.js +49 -0
- package/cjs/transaction/TransactionBuilder.d.ts +0 -0
- package/cjs/transaction/TransactionBuilder.js +1 -0
- package/cjs/transaction/TransactionFactory.d.ts +4 -0
- package/cjs/transaction/TransactionFactory.js +33 -0
- package/cjs/transaction/builders/FundingTransaction.d.ts +11 -0
- package/cjs/transaction/builders/FundingTransaction.js +27 -0
- package/cjs/transaction/builders/InteractionTransaction.d.ts +45 -0
- package/cjs/transaction/builders/InteractionTransaction.js +214 -0
- package/cjs/transaction/builders/TransactionBuilder.d.ts +64 -0
- package/cjs/transaction/builders/TransactionBuilder.js +304 -0
- package/cjs/transaction/enums/TransactionType.d.ts +7 -0
- package/cjs/transaction/enums/TransactionType.js +11 -0
- package/cjs/transaction/interfaces/ITransactionParameters.d.ts +32 -0
- package/cjs/transaction/interfaces/ITransactionParameters.js +2 -0
- package/cjs/transaction/interfaces/Tap.d.ts +22 -0
- package/cjs/transaction/interfaces/Tap.js +2 -0
- package/cjs/utils/BitcoinUtils.d.ts +5 -0
- package/cjs/utils/BitcoinUtils.js +13 -0
- package/cjs/utxo/UTXOManager.d.ts +7 -0
- package/cjs/utxo/UTXOManager.js +51 -0
- package/cjs/utxo/interfaces/IUTXO.d.ts +19 -0
- package/cjs/utxo/interfaces/IUTXO.js +2 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +92 -0
- package/docs/assets/icons.js +15 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/material-style.css +247 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1412 -0
- package/docs/classes/BitcoinUtils.html +183 -0
- package/docs/classes/CalldataGenerator.html +211 -0
- package/docs/classes/Compressor.html +185 -0
- package/docs/classes/ContractBaseMetadata.html +182 -0
- package/docs/classes/DeploymentGenerator.html +200 -0
- package/docs/classes/EcKeyPair.html +280 -0
- package/docs/classes/FundingTransaction.html +293 -0
- package/docs/classes/Generator.html +199 -0
- package/docs/classes/InteractionTransaction.html +365 -0
- package/docs/classes/TransactionBuilder.html +303 -0
- package/docs/classes/TransactionFactory.html +180 -0
- package/docs/classes/TweakedSigner.html +181 -0
- package/docs/classes/UTXOManager.html +187 -0
- package/docs/classes/Wallet.html +191 -0
- package/docs/classes/wBTC.html +189 -0
- package/docs/enums/TransactionType.html +179 -0
- package/docs/hierarchy.html +174 -0
- package/docs/index.html +237 -0
- package/docs/interfaces/FetchUTXOParams.html +178 -0
- package/docs/interfaces/IFundingTransactionParameters.html +182 -0
- package/docs/interfaces/IInteractionParameters.html +185 -0
- package/docs/interfaces/ITransactionDataContractDeployment.html +184 -0
- package/docs/interfaces/ITransactionDataContractInteractionWrap.html +186 -0
- package/docs/interfaces/ITransactionParameters.html +181 -0
- package/docs/interfaces/IWallet.html +181 -0
- package/docs/interfaces/NetworkInformation.html +176 -0
- package/docs/interfaces/PsbtInputExtended.html +194 -0
- package/docs/interfaces/PsbtOutputExtendedAddress.html +183 -0
- package/docs/interfaces/PsbtOutputExtendedScript.html +183 -0
- package/docs/interfaces/RawUTXOResponse.html +178 -0
- package/docs/interfaces/TapLeafScript.html +177 -0
- package/docs/interfaces/TweakSettings.html +179 -0
- package/docs/interfaces/UTXO.html +178 -0
- package/docs/interfaces/UpdateInput.html +175 -0
- package/docs/modules.html +208 -0
- package/docs/types/PsbtOutputExtended.html +174 -0
- package/docs/variables/version.html +174 -0
- package/gulpfile.js +152 -0
- package/jest.config.ts +52 -0
- package/package.json +116 -0
- package/src/_version.ts +1 -0
- package/src/bytecode/Compressor.ts +27 -0
- package/src/crypto/crypto-browser.js +71 -0
- package/src/crypto/crypto.ts +1 -0
- package/src/generators/Generator.ts +75 -0
- package/src/generators/builders/CalldataGenerator.ts +143 -0
- package/src/generators/builders/DeploymentGenerator.ts +63 -0
- package/src/index.ts +4 -0
- package/src/keypair/EcKeyPair.ts +265 -0
- package/src/keypair/Wallet.ts +75 -0
- package/src/keypair/interfaces/IWallet.ts +19 -0
- package/src/metadata/ContractBaseMetadata.ts +23 -0
- package/src/metadata/contracts/wBTC.ts +44 -0
- package/src/network/NetworkInformation.ts +7 -0
- package/src/opnet.ts +42 -0
- package/src/scripts/Regtest.ts +19 -0
- package/src/scripts/test.ts +98 -0
- package/src/signer/TweakedSigner.ts +57 -0
- package/src/transaction/TransactionFactory.ts +57 -0
- package/src/transaction/builders/FundingTransaction.ts +36 -0
- package/src/transaction/builders/InteractionTransaction.ts +439 -0
- package/src/transaction/builders/TransactionBuilder.ts +603 -0
- package/src/transaction/enums/TransactionType.ts +7 -0
- package/src/transaction/interfaces/ITransactionParameters.ts +41 -0
- package/src/transaction/interfaces/Tap.ts +26 -0
- package/src/utils/BitcoinUtils.ts +24 -0
- package/src/utxo/UTXOManager.ts +67 -0
- package/src/utxo/interfaces/IUTXO.ts +22 -0
- package/tests/TransactionBuilder.test.ts +58 -0
- package/tests/contracts/wbtc.wasm +0 -0
- package/tsconfig.base.json +43 -0
- package/tsconfig.cjs.json +9 -0
- package/tsconfig.json +8 -0
- package/tsconfig.webpack.json +11 -0
- package/webpack.config.js +77 -0
package/browser/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
var e,t,r,n,i={7557:(e,t)=>{function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e,...t){if(!i(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(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 u(e,t){o(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=t.isBytes=void 0,t.number=r,t.bool=n,t.isBytes=i,t.bytes=o,t.hash=a,t.exists=s,t.output=u;const f={number:r,bool:n,bytes:o,hash:a,exists:s,output:u};t.default=f},7202:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=t.Maj=t.Chi=void 0;const n=r(7557),i=r(9175);t.Chi=(e,t,r)=>e&t^~e&r,t.Maj=(e,t,r)=>e&t^e&r^t&r;class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);const{view:t,buffer:r,blockLen:o}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const s=Math.min(o-this.pos,a-n);if(s!==o)r.set(e.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=a-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(r,0),s=0);for(let e=s;e<o;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),u=n?4:0,f=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+f,s,n)}(r,o-8,BigInt(8*this.length),a),this.process(r,0);const u=(0,i.createView)(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=f/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)u.setUint32(4*e,l[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.HashMD=o},2318:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:a,l:s}=i(e[o],t);[r[o],n[o]]=[a,s]}return[r,n]}t.fromBig=i,t.split=o;const a=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=a;const s=(e,t,r)=>e>>>r;t.shrSH=s;const u=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=u;const f=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=f;const c=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=c;const l=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=l;const h=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=h;const p=(e,t)=>t;t.rotr32H=p;const d=(e,t)=>e;t.rotr32L=d;const y=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=y;const b=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=b;const g=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=g;const w=(e,t,r)=>e<<r-32|t>>>64-r;function v(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.rotlBL=w,t.add=v;const m=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=m;const _=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=_;const E=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=E;const S=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;t.add4H=S;const k=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=k;const T=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;t.add5H=T;const O={fromBig:i,split:o,toBig:a,shrSH:s,shrSL:u,rotrSH:f,rotrSL:c,rotrBH:l,rotrBL:h,rotr32H:p,rotr32L:d,rotlSH:y,rotlSL:b,rotlBH:g,rotlBL:w,add:v,add3L:m,add3H:_,add4L:E,add4H:S,add5H:T,add5L:k};t.default=O},5145:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9615:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(7557),i=r(9175);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.hash)(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,a=new Uint8Array(o);a.set(r.length>o?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return(0,n.exists)(this),this.iHash.update(e),this}digestInto(e){(0,n.exists)(this),(0,n.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=o,t.hmac=(e,t,r)=>new o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},3238:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(7202),i=r(9175),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),a=new Uint8Array(new Array(16).fill(0).map(((e,t)=>t)));let s=[a],u=[a.map((e=>(9*e+5)%16))];for(let e=0;e<4;e++)for(let t of[s,u])t.push(t[e].map((e=>o[e])));const f=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),c=s.map(((e,t)=>e.map((e=>f[t][e])))),l=u.map(((e,t)=>e.map((e=>f[t][e])))),h=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function d(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const y=new Uint32Array(16);class b extends n.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)y[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,o=0|this.h1,a=o,f=0|this.h2,b=f,g=0|this.h3,w=g,v=0|this.h4,m=v;for(let e=0;e<5;e++){const t=4-e,_=h[e],E=p[e],S=s[e],k=u[e],T=c[e],O=l[e];for(let t=0;t<16;t++){const n=(0,i.rotl)(r+d(e,o,f,g)+y[S[t]]+_,T[t])+v|0;r=v,v=g,g=0|(0,i.rotl)(f,10),f=o,o=n}for(let e=0;e<16;e++){const r=(0,i.rotl)(n+d(t,a,b,w)+y[k[e]]+E,O[e])+m|0;n=m,m=w,w=0|(0,i.rotl)(b,10),b=a,a=r}}this.set(this.h1+f+w|0,this.h2+g+m|0,this.h3+v+n|0,this.h4+r+a|0,this.h0+o+b|0)}roundClean(){y.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=b,t.ripemd160=(0,i.wrapConstructor)((()=>new b))},1549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha1=void 0;const n=r(7202),i=r(9175),o=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),a=new Uint32Array(80);class s extends n.HashMD{constructor(){super(64,20,8,!1),this.A=0|o[0],this.B=0|o[1],this.C=0|o[2],this.D=0|o[3],this.E=0|o[4]}get(){const{A:e,B:t,C:r,D:n,E:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<80;e++)a[e]=(0,i.rotl)(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let{A:r,B:o,C:s,D:u,E:f}=this;for(let e=0;e<80;e++){let t,c;e<20?(t=(0,n.Chi)(o,s,u),c=1518500249):e<40?(t=o^s^u,c=1859775393):e<60?(t=(0,n.Maj)(o,s,u),c=2400959708):(t=o^s^u,c=3395469782);const l=(0,i.rotl)(r,5)+t+f+c+a[e]|0;f=u,u=s,s=(0,i.rotl)(o,30),o=r,r=l}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,u=u+this.D|0,f=f+this.E|0,this.set(r,o,s,u,f)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}}t.sha1=(0,i.wrapConstructor)((()=>new s))},2623:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(7202),i=r(9175),o=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint32Array(64);class u extends n.HashMD{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:a,H:s}=this;return[e,t,r,n,i,o,a,s]}set(e,t,r,n,i,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)s[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=s[e-15],r=s[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;s[e]=o+s[e-7]+n+s[e-16]|0}let{A:r,B:a,C:u,D:f,E:c,F:l,G:h,H:p}=this;for(let e=0;e<64;e++){const t=p+((0,i.rotr)(c,6)^(0,i.rotr)(c,11)^(0,i.rotr)(c,25))+(0,n.Chi)(c,l,h)+o[e]+s[e]|0,d=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+(0,n.Maj)(r,a,u)|0;p=h,h=l,l=c,c=f+t|0,f=u,u=a,a=r,r=t+d|0}r=r+this.A|0,a=a+this.B|0,u=u+this.C|0,f=f+this.D|0,c=c+this.E|0,l=l+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(r,a,u,f,c,l,h,p)}roundClean(){s.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class f extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)((()=>new u)),t.sha224=(0,i.wrapConstructor)((()=>new f))},102:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const n=r(7202),i=r(2318),o=r(9175),[a,s]=(()=>i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),u=new Uint32Array(80),f=new Uint32Array(80);class c extends n.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:a,Dl:s,Eh:u,El:f,Fh:c,Fl:l,Gh:h,Gl:p,Hh:d,Hl:y}=this;return[e,t,r,n,i,o,a,s,u,f,c,l,h,p,d,y]}set(e,t,r,n,i,o,a,s,u,f,c,l,h,p,d,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|f,this.Fh=0|c,this.Fl=0|l,this.Gh=0|h,this.Gl=0|p,this.Hh=0|d,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t),f[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|u[e-15],r=0|f[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),a=0|u[e-2],s=0|f[e-2],c=i.default.rotrSH(a,s,19)^i.default.rotrBH(a,s,61)^i.default.shrSH(a,s,6),l=i.default.rotrSL(a,s,19)^i.default.rotrBL(a,s,61)^i.default.shrSL(a,s,6),h=i.default.add4L(o,l,f[e-7],f[e-16]),p=i.default.add4H(h,n,c,u[e-7],u[e-16]);u[e]=0|p,f[e]=0|h}let{Ah:r,Al:n,Bh:o,Bl:c,Ch:l,Cl:h,Dh:p,Dl:d,Eh:y,El:b,Fh:g,Fl:w,Gh:v,Gl:m,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(y,b,14)^i.default.rotrSH(y,b,18)^i.default.rotrBH(y,b,41),S=i.default.rotrSL(y,b,14)^i.default.rotrSL(y,b,18)^i.default.rotrBL(y,b,41),k=y&g^~y&v,T=b&w^~b&m,O=i.default.add5L(E,S,T,s[e],f[e]),A=i.default.add5H(O,_,t,k,a[e],u[e]),I=0|O,P=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),x=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),R=r&o^r&l^o&l,B=n&c^n&h^c&h;_=0|v,E=0|m,v=0|g,m=0|w,g=0|y,w=0|b,({h:y,l:b}=i.default.add(0|p,0|d,0|A,0|I)),p=0|l,d=0|h,l=0|o,h=0|c,o=0|r,c=0|n;const N=i.default.add3L(I,x,B);r=i.default.add3H(N,A,P,R),n=0|N}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:c}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|c)),({h:l,l:h}=i.default.add(0|this.Ch,0|this.Cl,0|l,0|h)),({h:p,l:d}=i.default.add(0|this.Dh,0|this.Dl,0|p,0|d)),({h:y,l:b}=i.default.add(0|this.Eh,0|this.El,0|y,0|b)),({h:g,l:w}=i.default.add(0|this.Fh,0|this.Fl,0|g,0|w)),({h:v,l:m}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|m)),({h:_,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,o,c,l,h,p,d,y,b,g,w,v,m,_,E)}roundClean(){u.fill(0),f.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=c;class l extends c{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class h extends c{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class p extends c{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,o.wrapConstructor)((()=>new c)),t.sha512_224=(0,o.wrapConstructor)((()=>new l)),t.sha512_256=(0,o.wrapConstructor)((()=>new h)),t.sha384=(0,o.wrapConstructor)((()=>new p))},9175:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.byteSwap32=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=t.isBytes=void 0;const n=r(5145),i=r(7557);t.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.rotl=(e,t)=>e<<t|e>>>32-t>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,t.byteSwapIfBE=t.isLE?e=>e:e=>(0,t.byteSwap)(e),t.byteSwap32=function(e){for(let r=0;r<e.length;r++)e[r]=(0,t.byteSwap)(e[r])};const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=function(e){(0,i.bytes)(e);let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t};const a=48,s=57,u=65,f=70,c=97,l=102;function h(e){return e>=a&&e<=s?e-a:e>=u&&e<=f?e-(u-10):e>=c&&e<=l?e-(c-10):void 0}function p(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function d(e){return"string"==typeof e&&(e=p(e)),(0,i.bytes)(e),e}t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=h(e.charCodeAt(i)),o=h(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=p,t.toBytes=d,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];(0,i.bytes)(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},t.Hash=class{clone(){return this._cloneInto()}};const y={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==y.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(d(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},3203:(e,t)=>{function r(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function n(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function i(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map((e=>e.encode)).reduceRight(r,t),decode:e.map((e=>e.decode)).reduce(r,t)}}function o(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(r(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}}function a(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function s(e,t="="){if(r(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function u(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function f(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const o=[],a=Array.from(e);for(a.forEach((e=>{if(r(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,r=!0;for(let o=i;o<a.length;o++){const s=a[o],u=t*e+s;if(!Number.isSafeInteger(u)||t*e/t!==e||u-s!=t*e)throw new Error("convertRadix: carry overflow");e=u%n;const f=Math.floor(u/n);if(a[o]=f,!Number.isSafeInteger(f)||f*n+e!==u)throw new Error("convertRadix: carry overflow");r&&(f?r=!1:i=o)}if(o.push(e),r)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.createBase58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64urlnopad=t.base64url=t.base64nopad=t.base64=t.base32crockford=t.base32hex=t.base32=t.base16=t.utils=t.assertNumber=void 0,t.assertNumber=r;const c=(e,t)=>t?c(t,e%t):e,l=(e,t)=>e+(t-c(e,t));function h(e,t,n,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(l(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${l(t,n)}`);let o=0,a=0;const s=2**n-1,u=[];for(const i of e){if(r(i),i>=2**t)throw new Error(`convertRadix2: invalid data word=${i} from=${t}`);if(o=o<<t|i,a+t>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)u.push((o>>a-n&s)>>>0);o&=2**a-1}if(o=o<<n-a&s,!i&&a>=t)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&a>0&&u.push(o>>>0),u}function p(e){return r(e),{encode:t=>{if(!n(t))throw new Error("radix.encode input should be Uint8Array");return f(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(f(t,e,256))}}}function d(e,t=!1){if(r(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,e)>32||l(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!n(r))throw new Error("radix2.encode input should be Uint8Array");return h(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(h(r,e,8,t))}}}function y(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function b(e,t){if(r(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!n(r))throw new Error("checksum.encode: input should be Uint8Array");const i=t(r).slice(0,e),o=new Uint8Array(r.length+e);return o.set(r),o.set(i,r.length),o},decode(r){if(!n(r))throw new Error("checksum.decode: input should be Uint8Array");const i=r.slice(0,-e),o=t(i).slice(0,e),a=r.slice(-e);for(let t=0;t<e;t++)if(o[t]!==a[t])throw new Error("Invalid checksum");return i}}}t.utils={alphabet:o,chain:i,checksum:b,convertRadix:f,convertRadix2:h,radix:p,radix2:d,join:a,padding:s},t.base16=i(d(4),o("0123456789ABCDEF"),a("")),t.base32=i(d(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s(5),a("")),t.base32hex=i(d(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s(5),a("")),t.base32crockford=i(d(5),o("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),a(""),u((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),t.base64=i(d(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s(6),a("")),t.base64nopad=i(d(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a("")),t.base64url=i(d(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(6),a("")),t.base64urlnopad=i(d(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(""));const g=e=>i(p(58),o(e),a(""));t.base58=g("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=g("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=g("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const w=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){const i=e.subarray(n,n+8);r+=t.base58.encode(i).padStart(w[i.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){const i=e.slice(n,n+11),o=w.indexOf(i.length),a=t.base58.decode(i);for(let e=0;e<a.length-o;e++)if(0!==a[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(a.slice(a.length-o)))}return Uint8Array.from(r)}},t.createBase58check=e=>i(b(4,(t=>e(e(t)))),t.base58),t.base58check=t.createBase58check;const v=i(o("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),a("")),m=[996825010,642813549,513874426,1027748829,705979059];function _(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<m.length;e++)1==(t>>e&1)&&(r^=m[e]);return r}function E(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=_(i)^r>>5}i=_(i);for(let t=0;t<n;t++)i=_(i)^31&e.charCodeAt(t);for(let e of t)i=_(i)^e;for(let e=0;e<6;e++)i=_(i);return i^=r,v.encode(h([i%2**30],30,5,!1))}function S(e){const t="bech32"===e?1:734539939,r=d(5),n=r.decode,i=r.encode,o=y(n);function a(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=n.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=n.slice(0,i),a=n.slice(i+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");const s=v.decode(a).slice(0,-6),u=E(o,s,t);if(!a.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:o,words:s}}return{encode:function(e,r,n=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);if(0===e.length)throw new TypeError(`Invalid prefix length ${e.length}`);const i=e.length+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const o=e.toLowerCase(),a=E(o,r,t);return`${o}1${v.encode(r)}${a}`},decode:a,decodeToBytes:function(e){const{prefix:t,words:r}=a(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:y(a),fromWords:n,fromWordsUnsafe:o,toWords:i}}t.bech32=S("bech32"),t.bech32m=S("bech32m"),t.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.hex=i(d(4),o("0123456789abcdef"),a(""),u((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const k={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},T="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";t.bytesToString=(e,t)=>{if("string"!=typeof e||!k.hasOwnProperty(e))throw new TypeError(T);if(!n(t))throw new TypeError("bytesToString() expects Uint8Array");return k[e].encode(t)},t.str=t.bytesToString,t.stringToBytes=(e,t)=>{if(!k.hasOwnProperty(e))throw new TypeError(T);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return k[e].decode(t)},t.bytes=t.stringToBytes},4148:(e,t,r)=>{var n=r(3184);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===i(o)?o:String(o)),n)}var o}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var s,u,f=r(9597).codes,c=f.ERR_AMBIGUOUS_ARGUMENT,l=f.ERR_INVALID_ARG_TYPE,h=f.ERR_INVALID_ARG_VALUE,p=f.ERR_INVALID_RETURN_VALUE,d=f.ERR_MISSING_ARGS,y=r(3918),b=r(537).inspect,g=r(537).types,w=g.isPromise,v=g.isRegExp,m=r(1514)(),_=r(9394)(),E=r(8075)("RegExp.prototype.test");function S(){var e=r(2299);s=e.isDeepEqual,u=e.isDeepStrictEqual}new Map;var k=!1,T=e.exports=P,O={};function A(e){if(e.message instanceof Error)throw e.message;throw new y(e)}function I(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new y({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];I.apply(void 0,[P,t.length].concat(t))}T.fail=function e(t,r,i,o,a){var s,u=arguments.length;if(0===u?s="Failed":1===u?(i=t,t=void 0):(!1===k&&(k=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===u&&(o="!=")),i instanceof Error)throw i;var f={actual:t,expected:r,operator:void 0===o?"fail":o,stackStartFn:a||e};void 0!==i&&(f.message=i);var c=new y(f);throw s&&(c.message=s,c.generatedMessage=!0),c},T.AssertionError=y,T.ok=P,T.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&A({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},T.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&A({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},T.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===s&&S(),s(t,r)||A({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},T.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===s&&S(),s(t,r)&&A({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},T.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===s&&S(),u(t,r)||A({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},T.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===s&&S(),u(t,r)&&A({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},T.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");_(t,r)||A({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},T.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");_(t,r)&&A({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var x=a((function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&E(t[e],n[e])?i[e]=n[e]:i[e]=t[e])}))}));function R(e,t,r,n){if("function"!=typeof t){if(v(t))return E(t,e);if(2===arguments.length)throw new l("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var o=new y({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",t,"may not be an empty object");return void 0===s&&S(),a.forEach((function(i){"string"==typeof e[i]&&v(t[i])&&E(t[i],e[i])||function(e,t,r,n,i,o){if(!(r in e)||!u(e[r],t[r])){if(!n){var a=new x(e,i),s=new x(t,i,e),f=new y({actual:a,expected:s,operator:"deepStrictEqual",stackStartFn:o});throw f.actual=e,f.expected=t,f.operator=o.name,f}A({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}(e,t,i,r,a,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function B(e){if("function"!=typeof e)throw new l("fn","Function",e);try{e()}catch(e){return e}return O}function N(e){return w(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function L(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!N(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!N(e))throw new l("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return O})).catch((function(e){return e}))}))}function U(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(t===O){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";A({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:e})}if(r&&!R(t,r,n,e))throw t}function j(e,t,r,n){if(t!==O){if("string"==typeof r&&(n=r,r=void 0),!r||R(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";A({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function C(e,t,r,n,o){if(!v(t))throw new l("regexp","RegExp",t);var a="match"===o;if("string"!=typeof e||E(t,e)!==a){if(r instanceof Error)throw r;var s=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(i(e)," (").concat(b(e),")"):(a?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(b(t),". Input:\n\n").concat(b(e),"\n"));var u=new y({actual:e,expected:t,message:r,operator:o,stackStartFn:n});throw u.generatedMessage=s,u}}function M(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];I.apply(void 0,[M,t.length].concat(t))}T.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];U.apply(void 0,[e,B(t)].concat(n))},T.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return L(t).then((function(t){return U.apply(void 0,[e,t].concat(n))}))},T.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];j.apply(void 0,[e,B(t)].concat(n))},T.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return L(t).then((function(t){return j.apply(void 0,[e,t].concat(n))}))},T.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=b(t);var n=new y({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var f=s.indexOf(a[u]);if(-1!==f){s=s.slice(0,f);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},T.match=function e(t,r,n){C(t,r,n,e,"match")},T.doesNotMatch=function e(t,r,n){C(t,r,n,e,"doesNotMatch")},T.strict=m(M,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict},3918:(e,t,r)=>{var n=r(3184);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){var n,i,o;n=e,i=t,o=r[t],(i=s(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!==y(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===y(t)?t:String(t)}function u(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){var t="function"==typeof Map?new Map:void 0;return c=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)},c(e)}function l(e,t,r){return l=h()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&p(i,r.prototype),i},l.apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}var b=r(537).inspect,g=r(9597).codes.ERR_INVALID_ARG_TYPE;function w(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var v="",m="",_="",E="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function k(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function T(e){return b(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var O=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(O,e);var r,i,s,c,l=(r=O,i=h(),function(){var e,t=d(r);if(i){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function O(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,O),"object"!==y(e)||null===e)throw new g("options","Object",e);var r=e.message,i=e.operator,o=e.stackStartFn,a=e.actual,s=e.expected,c=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=l.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="[34m",m="[32m",E="[39m",_="[31m"):(v="",m="",E="",_="")),"object"===y(a)&&null!==a&&"object"===y(s)&&null!==s&&"stack"in a&&a instanceof Error&&"stack"in s&&s instanceof Error&&(a=k(a),s=k(s)),"deepStrictEqual"===i||"strictEqual"===i)t=l.call(this,function(e,t,r){var i="",o="",a=0,s="",u=!1,f=T(e),c=f.split("\n"),l=T(t).split("\n"),h=0,p="";if("strictEqual"===r&&"object"===y(e)&&"object"===y(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===l.length&&c[0]!==l[0]){var d=c[0].length+l[0].length;if(d<=10){if(!("object"===y(e)&&null!==e||"object"===y(t)&&null!==t||0===e&&0===t))return"".concat(S[r],"\n\n")+"".concat(c[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r&&d<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][h]===l[0][h];)h++;h>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var b=c[c.length-1],g=l[l.length-1];b===g&&(h++<2?s="\n ".concat(b).concat(s):i=b,c.pop(),l.pop(),0!==c.length&&0!==l.length);)b=c[c.length-1],g=l[l.length-1];var k=Math.max(c.length,l.length);if(0===k){var O=f.split("\n");if(O.length>30)for(O[26]="".concat(v,"...").concat(E);O.length>27;)O.pop();return"".concat(S.notIdentical,"\n\n").concat(O.join("\n"),"\n")}h>3&&(s="\n".concat(v,"...").concat(E).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var A=0,I=S[r]+"\n".concat(m,"+ actual").concat(E," ").concat(_,"- expected").concat(E),P=" ".concat(v,"...").concat(E," Lines skipped");for(h=0;h<k;h++){var x=h-a;if(c.length<h+1)x>1&&h>2&&(x>4?(o+="\n".concat(v,"...").concat(E),u=!0):x>3&&(o+="\n ".concat(l[h-2]),A++),o+="\n ".concat(l[h-1]),A++),a=h,i+="\n".concat(_,"-").concat(E," ").concat(l[h]),A++;else if(l.length<h+1)x>1&&h>2&&(x>4?(o+="\n".concat(v,"...").concat(E),u=!0):x>3&&(o+="\n ".concat(c[h-2]),A++),o+="\n ".concat(c[h-1]),A++),a=h,o+="\n".concat(m,"+").concat(E," ").concat(c[h]),A++;else{var R=l[h],B=c[h],N=B!==R&&(!w(B,",")||B.slice(0,-1)!==R);N&&w(R,",")&&R.slice(0,-1)===B&&(N=!1,B+=","),N?(x>1&&h>2&&(x>4?(o+="\n".concat(v,"...").concat(E),u=!0):x>3&&(o+="\n ".concat(c[h-2]),A++),o+="\n ".concat(c[h-1]),A++),a=h,o+="\n".concat(m,"+").concat(E," ").concat(B),i+="\n".concat(_,"-").concat(E," ").concat(R),A+=2):(o+=i,i="",1!==x&&0!==h||(o+="\n ".concat(B),A++))}if(A>20&&h<k-2)return"".concat(I).concat(P,"\n").concat(o,"\n").concat(v,"...").concat(E).concat(i,"\n")+"".concat(v,"...").concat(E)}return"".concat(I).concat(u?P:"","\n").concat(o).concat(i).concat(s).concat(p)}(a,s,i));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var h=S[i],p=T(a).split("\n");if("notStrictEqual"===i&&"object"===y(a)&&null!==a&&(h=S.notStrictEqualObject),p.length>30)for(p[26]="".concat(v,"...").concat(E);p.length>27;)p.pop();t=1===p.length?l.call(this,"".concat(h," ").concat(p[0])):l.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var d=T(a),b="",A=S[i];"notDeepEqual"===i||"notEqual"===i?(d="".concat(S[i],"\n\n").concat(d)).length>1024&&(d="".concat(d.slice(0,1021),"...")):(b="".concat(T(s)),d.length>512&&(d="".concat(d.slice(0,509),"...")),b.length>512&&(b="".concat(b.slice(0,509),"...")),"deepEqual"===i||"equal"===i?d="".concat(A,"\n\n").concat(d,"\n\nshould equal\n\n"):b=" ".concat(i," ").concat(b)),t=l.call(this,"".concat(d).concat(b))}return Error.stackTraceLimit=c,t.generatedMessage=!r,Object.defineProperty(f(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=a,t.expected=s,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(f(t),o),t.stack,t.name="AssertionError",u(t)}return s=O,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return b(this,o(o({},t),{},{customInspect:!1,depth:0}))}}])&&a(s.prototype,c),Object.defineProperty(s,"prototype",{writable:!1}),O}(c(Error),b.custom);e.exports=O},9597:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var a,s,u={};function f(e,t,r){r||(r=Error);var a=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(c,r);var a,s,u,f=(s=c,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=o(s);if(u){var r=o(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(r,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),o=f.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i)),o.code=e,o}return a=c,Object.defineProperty(a,"prototype",{writable:!1}),a}(r);u[e]=a}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,s,u,f,l;if(void 0===a&&(a=r(4148)),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,4)===s)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))u="The ".concat(e," ").concat(o," ").concat(c(t,"type"));else{var h=("number"!=typeof l&&(l=0),l+1>(f=e).length||-1===f.indexOf(".",l)?"argument":"property");u='The "'.concat(e,'" ').concat(h," ").concat(o," ").concat(c(t,"type"))}return u+". Received type ".concat(n(i))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(537));var i=s.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===a&&(a=r(4148)),a(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=u},2299:(e,t,r)=>{function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,f=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){f=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(f)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},u=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},f=Object.is?Object.is:r(7653),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(4133);function h(e){return e.call.bind(e)}var p=h(Object.prototype.hasOwnProperty),d=h(Object.prototype.propertyIsEnumerable),y=h(Object.prototype.toString),b=r(537).types,g=b.isAnyArrayBuffer,w=b.isArrayBufferView,v=b.isDate,m=b.isMap,_=b.isRegExp,E=b.isSet,S=b.isNativeError,k=b.isBoxedPrimitive,T=b.isNumberObject,O=b.isStringObject,A=b.isBooleanObject,I=b.isBigIntObject,P=b.isSymbolObject,x=b.isFloat32Array,R=b.isFloat64Array;function B(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function N(e){return Object.keys(e).filter(B).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function L(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}var U=0,j=1,C=2,M=3;function F(e,t,r,n){if(e===t)return 0!==e||!r||f(e,t);if(r){if("object"!==o(e))return"number"==typeof e&&l(e)&&l(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var i,s,u,c,h=y(e);if(h!==y(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var p=N(e),d=N(t);return p.length===d.length&&H(e,t,r,n,j,p)}if("[object Object]"===h&&(!m(e)&&m(t)||!E(e)&&E(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(_(e)){if(!_(t)||(u=e,c=t,!(a?u.source===c.source&&u.flags===c.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(c))))return!1}else if(S(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(w(e)){if(r||!x(e)&&!R(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===L(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var b=N(e),B=N(t);return b.length===B.length&&H(e,t,r,n,U,b)}if(E(e))return!(!E(t)||e.size!==t.size)&&H(e,t,r,n,C);if(m(e))return!(!m(t)||e.size!==t.size)&&H(e,t,r,n,M);if(g(e)){if(s=t,(i=e).byteLength!==s.byteLength||0!==L(new Uint8Array(i),new Uint8Array(s)))return!1}else if(k(e)&&!function(e,t){return T(e)?T(t)&&f(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):O(e)?O(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):I(e)?I(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):P(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return H(e,t,r,n,U)}function D(e,t){return t.filter((function(t){return d(e,t)}))}function H(e,t,r,i,a,f){if(5===arguments.length){f=Object.keys(e);var l=Object.keys(t);if(f.length!==l.length)return!1}for(var h=0;h<f.length;h++)if(!p(t,f[h]))return!1;if(r&&5===arguments.length){var y=c(e);if(0!==y.length){var b=0;for(h=0;h<y.length;h++){var g=y[h];if(d(e,g)){if(!d(t,g))return!1;f.push(g),b++}else if(d(t,g))return!1}var w=c(t);if(y.length!==w.length&&D(t,w).length!==b)return!1}else{var v=c(t);if(0!==v.length&&0!==D(t,v).length)return!1}}if(0===f.length&&(a===U||a===j&&0===e.length||0===e.size))return!0;if(void 0===i)i={val1:new Map,val2:new Map,position:0};else{var m=i.val1.get(e);if(void 0!==m){var _=i.val2.get(t);if(void 0!==_)return m===_}i.position++}i.val1.set(e,i.position),i.val2.set(t,i.position);var E=function(e,t,r,i,a,f){var c=0;if(f===C){if(!function(e,t,r,n){for(var i=null,a=s(e),u=0;u<a.length;u++){var f=a[u];if("object"===o(f)&&null!==f)null===i&&(i=new Set),i.add(f);else if(!t.has(f)){if(r)return!1;if(!V(e,t,f))return!1;null===i&&(i=new Set),i.add(f)}}if(null!==i){for(var c=s(t),l=0;l<c.length;l++){var h=c[l];if("object"===o(h)&&null!==h){if(!K(i,h,r,n))return!1}else if(!r&&!e.has(h)&&!K(i,h,r,n))return!1}return 0===i.size}return!0}(e,t,r,a))return!1}else if(f===M){if(!function(e,t,r,i){for(var a=null,s=u(e),f=0;f<s.length;f++){var c=n(s[f],2),l=c[0],h=c[1];if("object"===o(l)&&null!==l)null===a&&(a=new Set),a.add(l);else{var p=t.get(l);if(void 0===p&&!t.has(l)||!F(h,p,r,i)){if(r)return!1;if(!G(e,t,l,h,i))return!1;null===a&&(a=new Set),a.add(l)}}}if(null!==a){for(var d=u(t),y=0;y<d.length;y++){var b=n(d[y],2),g=b[0],w=b[1];if("object"===o(g)&&null!==g){if(!z(a,e,g,w,r,i))return!1}else if(!(r||e.has(g)&&F(e.get(g),w,!1,i)||z(a,e,g,w,!1,i)))return!1}return 0===a.size}return!0}(e,t,r,a))return!1}else if(f===j)for(;c<e.length;c++){if(!p(e,c)){if(p(t,c))return!1;for(var l=Object.keys(e);c<l.length;c++){var h=l[c];if(!p(t,h)||!F(e[h],t[h],r,a))return!1}return l.length===Object.keys(t).length}if(!p(t,c)||!F(e[c],t[c],r,a))return!1}for(c=0;c<i.length;c++){var d=i[c];if(!F(e[d],t[d],r,a))return!1}return!0}(e,t,r,f,i,a);return i.val1.delete(e),i.val2.delete(t),E}function K(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(F(t,a,r,n))return e.delete(a),!0}return!1}function W(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(l(e))return!1}return!0}function V(e,t,r){var n=W(r);return null!=n?n:t.has(n)&&!e.has(n)}function G(e,t,r,n,i){var o=W(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!F(n,a,!1,i))&&!e.has(o)&&F(n,a,!1,i)}function z(e,t,r,n,i,o){for(var a=s(e),u=0;u<a.length;u++){var f=a[u];if(F(r,f,i,o)&&F(n,t.get(f),i,o))return e.delete(f),!0}return!1}e.exports={isDeepEqual:function(e,t){return F(e,t,!1)},isDeepStrictEqual:function(e,t){return F(e,t,!0)}}},4822:(e,t,r)=>{r.d(t,{r:()=>n});var n="1.0.0"},5104:(e,t,r)=>{r.d(t,{w:()=>l});var n=r(8559),i=r.n(n);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u,f,c,l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"compress",value:function(t){return i().gzipSync(t,e.zlibOptions)}},{key:"decompress",value:function(t){return i().gunzipSync(t,e.zlibOptions)}}],null&&a(t.prototype,null),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();u=l,f="zlibOptions",c={level:i().constants.Z_MAX_LEVEL,maxOutputLength:16777216},(f=s(f))in u?Object.defineProperty(u,f,{value:c,enumerable:!0,configurable:!0,writable:!0}):u[f]=c},5901:(e,t,r)=>{r.d(t,{W:()=>f});var n=r(1757),i=r(8287).Buffer;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function s(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var f=function(){function e(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.o8.bitcoin;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,"senderPubKey",void 0),s(this,"contractSaltPubKey",void 0),s(this,"network",n.o8.bitcoin),this.senderPubKey=t,this.contractSaltPubKey=r,this.network=i}return t=e,r=[{key:"splitBufferIntoChunks",value:function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DATA_CHUNK_SIZE,n=[],o=0;o<t.length;o+=r){for(var a=Math.min(r,t.length-o),s=i.alloc(a),u=0;u<a;u++)s.writeUInt8(t[o+u],u);n.push([s])}return n}}],r&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();s(f,"DATA_CHUNK_SIZE",512),s(f,"MAGIC",i.from("bsi","utf-8"))},9068:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{G:()=>c});var i=r(1757),o=r(5104),a=r(5901),s=r(154),u=r(8287).Buffer,f=e([s]);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function h(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=y(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function p(e){return g(e)||b(e)||y(e)||d()}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){if(e){if("string"==typeof e)return w(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function b(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e){if(Array.isArray(e))return w(e)}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_(n.key),n)}}function _(e){var t=E(e,"string");return"symbol"==l(t)?t:t+""}function E(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function S(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(T=function(){return!!e})()}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I(e,t)}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}s=(f.then?(await f)():f)[0];var c=function(e){function t(e,r){var n,o,a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.o8.bitcoin;return v(this,t),n=this,a=[e,r,s],o=O(o=t),S(n,T()?Reflect.construct(o,a||[],O(n).constructor):o.apply(n,a))}return A(t,e),r=t,n=[{key:"compile",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=this.splitBufferIntoChunks(e);if(!s.length)throw new Error("No data chunks found");var f=[this.senderPubKey,i.Ez.OP_CHECKSIGVERIFY,this.contractSaltPubKey,i.Ez.OP_CHECKSIGVERIFY,i.Ez.OP_HASH160,i.Et.hash160(this.senderPubKey),i.Ez.OP_EQUALVERIFY,i.Ez.OP_HASH160,i.Et.hash160(t),i.Ez.OP_EQUALVERIFY,i.Ez.OP_DEPTH,i.Ez.OP_1,i.Ez.OP_NUMEQUAL,i.Ez.OP_IF,a.W.MAGIC];if(n.length>0){var c,l,h=this.getPubKeyAsBuffer(n),d=this.splitBufferIntoChunks(h);if(f=(c=f).concat.apply(c,[i.Ez.OP_0].concat(p(d))),!o)throw new Error("Minimum signatures must be provided");if(o>255)throw new Error("Minimum signatures cannot exceed 255");var y=u.alloc(2);y.writeUint16LE(o,0),f=(l=f).concat.apply(l,[i.Ez.OP_1,y])}var b=(f=(r=f).concat.apply(r,[i.Ez.OP_1NEGATE].concat(p(s),[i.Ez.OP_ELSE,i.Ez.OP_1,i.Ez.OP_ENDIF]))).flat(),g=i.K$.compile(b);if(!i.K$.decompile(g))throw new Error("Failed to decompile script??");return g}},{key:"getPubKeyAsBuffer",value:function(e){var t,r=u.alloc(0),n=h(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(!s.k.fromPublicKey(i,this.network).compressed)throw new Error("Public key must be compressed");if(33!==i.byteLength)throw new Error("Public key must be 33 bytes, got ".concat(i.byteLength," bytes."));r=u.concat([r,i])}}catch(e){n.e(e)}finally{n.f()}var a=o.w.compress(r);return a.byteLength>=r.byteLength?r:a}}],n&&m(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(a.W);n()}catch(P){n(P)}}))},7061:(e,t,r)=>{r.d(t,{z:()=>p});var n=r(1757),i=r(5901);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function f(e,t,r){return t=l(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.o8.bitcoin;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,t,[e,r,i])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),r=t,(o=[{key:"compile",value:function(e,t){var r=this.splitBufferIntoChunks(e),o=[this.senderPubKey,n.Ez.OP_CHECKSIGVERIFY,this.contractSaltPubKey,n.Ez.OP_CHECKSIGVERIFY,n.Ez.OP_HASH160,n.Et.hash160(this.senderPubKey),n.Ez.OP_EQUALVERIFY,n.Ez.OP_HASH256,n.Et.hash256(t),n.Ez.OP_EQUALVERIFY,n.Ez.OP_DEPTH,n.Ez.OP_1,n.Ez.OP_NUMEQUAL,n.Ez.OP_IF,i.W.MAGIC,n.Ez.OP_1NEGATE].concat(function(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r),[n.Ez.OP_ELSE,n.Ez.OP_1,n.Ez.OP_ENDIF]).flat(),s=n.K$.compile(o);if(!n.K$.decompile(s))throw new Error("Failed to decompile script??");return s}}])&&s(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,o}(i.W)},4317:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{$7:()=>i,Bc:()=>i.InteractionTransaction,D_:()=>i.TransactionType,G7:()=>i.BitcoinUtils,GF:()=>i.CalldataGenerator,P8:()=>i.ContractBaseMetadata,Qc:()=>i.TransactionBuilder,Wj:()=>i.Generator,aS:()=>i.TweakedSigner,cC:()=>i.FundingTransaction,dF:()=>i.TransactionFactory,kd:()=>i.EcKeyPair,rE:()=>i.version,rR:()=>i.wBTC,uW:()=>i.Wallet,wf:()=>i.Compressor,y4:()=>i.UTXOManager,z4:()=>i.DeploymentGenerator});var i=r(3827),o=e([i]);i=(o.then?(await o)():o)[0],n()}catch(e){n(e)}}))},154:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{k:()=>l});var i=r(852),o=r(1757),a=r(8700),s=r(6647),u=r(8287).Buffer,f=e([s]);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,b(n.key),n)}}function y(e,t,r){return(t=b(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){var t=g(e,"string");return"symbol"==h(t)?t:t+""}function g(e,t){if("object"!=h(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}s=(f.then?(await f)():f)[0],(0,o.f0)(s);var c="function"==typeof i.Ay?i.Ay:i.Ay.BIP32Factory,l=function(){function e(){p(this,e)}return t=e,r=[{key:"fromWIF",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin;return this.ECPair.fromWIF(e,t)}},{key:"fromPrivateKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin;return this.ECPair.fromPrivateKey(e,{network:t})}},{key:"fromPublicKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin;return this.ECPair.fromPublicKey(e,{network:t})}},{key:"generateMultiSigAddress",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.o8.bitcoin,n=this.verifyPubKeys(e,r),i=o.KT.p2wsh({redeem:o.KT.p2ms({m:t,pubkeys:n,network:r}),network:r}).address;if(!i)throw new Error("Failed to generate address");return i}},{key:"verifyPubKeys",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin;return t.map((function(t){var n=e.fromPublicKey(t,r);if(!n)throw new Error("Failed to regenerate key");return n.publicKey}))}},{key:"getP2WPKHAddress",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin,r=o.KT.p2wpkh({pubkey:e.publicKey,network:t});if(!r.address)throw new Error("Failed to generate wallet");return r.address}},{key:"generateWallet",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.o8.bitcoin,t=this.ECPair.makeRandom({network:e}),r=this.getP2WPKHAddress(t,e);if(!r)throw new Error("Failed to generate wallet");return{address:r,privateKey:t.toWIF(),publicKey:t.publicKey.toString("hex")}}},{key:"verifyContractAddress",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin;return!!o.hl.toOutputScript(e,t)}},{key:"getLegacyAddress",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin,r=o.KT.p2pkh({pubkey:e.publicKey,network:t});if(!r.address)throw new Error("Failed to generate wallet");return r.address}},{key:"generateRandomKeyPair",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.o8.bitcoin;return this.ECPair.makeRandom({network:e})}},{key:"fromSeed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin;return this.BIP32.fromSeed(e,t)}},{key:"getTaprootAddress",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin,r=e.publicKey.slice(1,33),n=u.concat([u.from([81,32]),r]);return o.hl.fromOutputScript(n,t)}},{key:"getTaprootAddressFromAddress",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin,r=o.KT.p2tr({address:e,network:t}).address;if(!r)throw new Error("Failed to generate sender address for transaction");return r}},{key:"fromSeedKeyPair",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin,r=this.BIP32.fromSeed(e,t).privateKey;if(!r)throw new Error("Failed to generate key pair");return this.ECPair.fromPrivateKey(r,{network:t})}}],null&&d(t.prototype,null),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();y(l,"BIP32",c(s)),y(l,"ECPair",(0,a.dg)(s)),n()}catch(w){n(w)}}))},8652:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{u:()=>s});var i=r(154),o=r(1757),a=e([i]);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function l(e,t,r){return(t=h(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e){var t=p(e,"string");return"symbol"==u(t)?t:t+""}function p(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}i=(a.then?(await a)():a)[0];var s=function(){return e=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.o8.bitcoin;f(this,e),l(this,"network",void 0),l(this,"_keypair",void 0),l(this,"_p2wpkh",void 0),l(this,"_p2tr",void 0),this.network=r,this._keypair=i.k.fromWIF(t.privateKey,this.network),this._p2wpkh=i.k.getP2WPKHAddress(this._keypair,this.network),this._p2tr=i.k.getTaprootAddress(this._keypair,this.network)},(t=[{key:"keypair",get:function(){if(!this._keypair)throw new Error("Keypair not set");return this._keypair}},{key:"p2wpkh",get:function(){return this._p2wpkh}},{key:"p2tr",get:function(){return this._p2tr}},{key:"publicKey",get:function(){if(!this.keypair)throw new Error("Keypair not set");return this.keypair.publicKey}}])&&c(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();n()}catch(d){n(d)}}))},525:(e,t,r)=>{r.d(t,{P:()=>s});var n=r(1757);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var s=function(){return e=function e(){var t,r,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.o8.bitcoin;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,i=void 0,(r=a(r="network"))in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,this.network=o},r=[{key:"getAddress",value:function(){throw arguments.length>0&&void 0!==arguments[0]||n.o8.bitcoin,new Error("Method not implemented.")}}],(t=[{key:"getAddress",value:function(){return this.address}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},1419:(e,t,r)=>{r.d(t,{r:()=>h});var n=r(1757);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function a(e,t,r){return t=u(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function c(e,t,r){return(t=l(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var h=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.o8.bitcoin;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(e=a(this,t,[r]),"network",void 0),c(e,"tokenName","Wrapped Bitcoin"),c(e,"tokenSymbol","wBTC"),c(e,"decimals",8),c(e,"address",void 0),e.network=r,e.address=t.getAddress(r),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),r=t,i=[{key:"getAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.o8.bitcoin;switch(e){case n.o8.bitcoin:case n.o8.regtest:return"bcrt1pcw0828yjrtlrc6mkp3lkq30j7wc7slsh7k7dyh53mrs4f8d74l6qumhqp4";case n.o8.testnet:return"tb1pq64lx73fwyrdp4asvl7xt5r5qvxvt9wy82x75taqtzvd64f58nasansurj";default:throw new Error("Invalid network: ".concat(e))}}}],null&&o(r.prototype,null),i&&o(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(r(525).P)},3827:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.r(t),r.d(t,{BitcoinUtils:()=>v.G,CalldataGenerator:()=>s.G,Compressor:()=>o.w,ContractBaseMetadata:()=>h.P,DeploymentGenerator:()=>u.z,EcKeyPair:()=>f.k,FundingTransaction:()=>g.c,Generator:()=>a.W,InteractionTransaction:()=>b.B,TransactionBuilder:()=>w.Q,TransactionFactory:()=>d.d,TransactionType:()=>y.D,TweakedSigner:()=>p.a,UTXOManager:()=>m.y,Wallet:()=>c.u,version:()=>i.r,wBTC:()=>l.r});var i=r(4822),o=r(5104),a=r(5901),s=r(9068),u=r(7061),f=r(154),c=r(8652),l=r(1419),h=r(525),p=r(4519),d=r(8582),y=r(3959),b=r(855),g=r(3608),w=r(2296),v=r(8284),m=r(9565),_=e([s,f,c,p,d,b,g,w]);[s,f,c,p,d,b,g,w]=_.then?(await _)():_,n()}catch(e){n(e)}}))},4519:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{a:()=>l});var i=r(1757),o=r(2218),a=r(477),s=r(6647),u=r(154),f=r(8287).Buffer,c=e([s,u]);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function y(e){var t=b(e,"string");return"symbol"==h(t)?t:t+""}function b(e,t){if("object"!=h(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}[s,u]=c.then?(await c)():c,(0,i.f0)(s);var l=function(){return e=function e(){p(this,e)},t=[{key:"tweakSigner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.privateKey;if(!r)throw new Error("Private key is required for tweaking signer!");3===e.publicKey[0]&&(r=s.privateNegate(r));var n=s.privateAdd(r,(0,o.tapTweakHash)((0,a.toXOnly)(e.publicKey),t.tweakHash));if(!n)throw new Error("Invalid tweaked private key!");return u.k.fromPrivateKey(f.from(n),t.network)}}],null&&d(e.prototype,null),t&&d(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();n()}catch(g){n(g)}}))},8582:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{d:()=>s});var i=r(3608),o=r(855),a=e([i,o]);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}}function d(e){var t=y(e,"string");return"symbol"==u(t)?t:t+""}function y(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}[i,o]=a.then?(await a)():a;var s=function(){return e=function e(){h(this,e)},(t=[{key:"signInteraction",value:function(e){var t=new o.B(e);t.signTransaction();var r=t.getFundingTransactionParameters(),n=new i.c(r).signTransaction();if(!n)throw new Error("Could not sign funding transaction.");var a=n.outs[0],s={transactionId:n.getId(),outputIndex:0,scriptPubKey:{hex:a.script.toString("hex"),address:t.getScriptAddress()},value:BigInt(a.value)},u=c(c({},e),{},{utxos:[s],randomBytes:t.getRndBytes()}),f=new o.B(u).signTransaction();return[n.toHex(),f.toHex()]}}])&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();n()}catch(b){n(b)}}))},3608:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{c:()=>s});var i=r(3959),o=r(2296),a=e([o]);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,w(n.key),n)}}function l(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function g(e,t,r){return(t=w(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e){var t=v(e,"string");return"symbol"==u(t)?t:t+""}function v(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var s=function(e){function t(e){var r,n,o,a;return f(this,t),n=this,a=[e],o=d(o=t),g(r=l(n,p()?Reflect.construct(o,a||[],d(n).constructor):o.apply(n,a)),"type",i.D.FUNDING),g(r,"childTransactionRequiredFees",void 0),r.childTransactionRequiredFees=e.childTransactionRequiredFees,r.internalInit(),r}return y(t,e),r=t,(n=[{key:"buildTransaction",value:function(){this.addInputsFromUTXO();var e=this.getTransactionOPNetFee()+this.childTransactionRequiredFees;this.addOutput({value:Number(e),address:this.to}),this.addRefundOutput(e)}},{key:"getSignerKey",value:function(){return this.signer}}])&&c(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}((o=(a.then?(await a)():a)[0]).Q);n()}catch(m){n(m)}}))},855:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{B:()=>d});var i=r(1757),o=r(2296),a=r(3959),s=r(9068),u=r(5104),f=r(154),c=r(8284),l=r(477),h=r(4519),p=e([o,s,f,h]);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=g(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function g(e,t){if(e){if("string"==typeof e)return w(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x(n.key),n)}}function _(e,t){if(t&&("object"==y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=T(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},k.apply(null,arguments)}function T(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I(e,t)}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function P(e,t,r){return(t=x(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x(e){var t=R(e,"string");return"symbol"==y(t)?t:t+""}function R(e,t){if("object"!=y(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}[o,s,f,h]=p.then?(await p)():p;var d=function(e){function t(e){var r,n,i,o;if(v(this,t),n=this,o=[e],i=O(i=t),P(r=_(n,S()?Reflect.construct(i,o||[],O(n).constructor):i.apply(n,o)),"type",a.D.INTERACTION),P(r,"randomBytes",void 0),P(r,"targetScriptRedeem",null),P(r,"leftOverFundsScriptRedeem",null),P(r,"compiledTargetScript",void 0),P(r,"scriptTree",void 0),P(r,"tapLeafScript",null),P(r,"calldataGenerator",void 0),P(r,"calldata",void 0),P(r,"contractSecret",r.generateSecret()),P(r,"tweakedSigner",void 0),P(r,"scriptSigner",void 0),P(r,"interactionPubKeys",void 0),P(r,"minimumSignatures",void 0),P(r,"customFinalizer",(function(e,t){if(!r.tapLeafScript)throw new Error("Tap leaf script is required");if(!t.tapScriptSig)throw new Error("Tap script signature is required");if(!r.contractSecret)throw new Error("Contract secret is required");var n=r.getScriptSolution(t).concat(r.tapLeafScript.script).concat(r.tapLeafScript.controlBlock);return{finalScriptWitness:r.witnessStackToScriptWitness(n)}})),!e.calldata)throw new Error("Calldata is required");return r.calldata=u.w.compress(e.calldata),r.interactionPubKeys=e.pubKeys||[],r.minimumSignatures=e.minimumSignatures||0,r.randomBytes=e.randomBytes||c.G.rndBytes(),r.scriptSigner=r.generateKeyPairFromSeed(),r.calldataGenerator=new s.G(r.internalPubKeyToXOnly(),r.scriptSignerXOnlyPubKey(),r.network),r.compiledTargetScript=r.calldataGenerator.compile(r.calldata,r.contractSecret,r.interactionPubKeys,r.minimumSignatures),r.scriptTree=r.getScriptTree(),r.internalInit(),r}return A(t,e),r=t,n=[{key:"getContractSecret",value:function(){return this.contractSecret}},{key:"getRndBytes",value:function(){return this.randomBytes}},{key:"generateSecret",value:function(){return i.hl.fromBech32(this.to).data}},{key:"tweakSigner",value:function(){this.tweakedSigner=this.getTweakedSigner()}},{key:"scriptSignerXOnlyPubKey",value:function(){return(0,l.toXOnly)(this.scriptSigner.publicKey)}},{key:"generateKeyPairFromSeed",value:function(){return f.k.fromSeedKeyPair(this.randomBytes,this.network)}},{key:"addInputsFromUTXO",value:function(){if(!this.tapLeafScript)throw new Error("Tap leaf script is required");var e,t=b(this.utxos);try{for(t.s();!(e=t.n()).done;){var r=e.value,n={hash:r.transactionId,index:r.outputIndex,witnessUtxo:{value:Number(r.value),script:this.getTapOutput()},tapLeafScript:[this.tapLeafScript],sequence:4294967293};this.addInput(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"buildTransaction",value:function(){var e=this.scriptSigner?this.targetScriptRedeem:this.leftOverFundsScriptRedeem;if(!e)throw new Error("Left over funds script redeem is required");if(!e.redeemVersion)throw new Error("Left over funds script redeem version is required");if(!e.output)throw new Error("Left over funds script redeem output is required");this.tapLeafScript={leafVersion:e.redeemVersion,script:e.output,controlBlock:this.getWitness()},this.addInputsFromUTXO();var t=this.getTransactionOPNetFee();this.addOutput({value:Number(t),address:this.to}),this.addRefundOutput(t)}},{key:"signInputs",value:function(e){this.scriptSigner?(e.signInput(0,this.scriptSigner),e.signInput(0,this.getSignerKey()),e.finalizeInput(0,this.customFinalizer)):k(O(t.prototype),"signInputs",this).call(this,e)}},{key:"getSignerKey",value:function(){return this.tweakedSigner?this.tweakedSigner:this.signer}},{key:"generateScriptAddress",value:function(){return{internalPubkey:this.internalPubKeyToXOnly(),network:this.network,scriptTree:this.scriptTree}}},{key:"generateTapData",value:function(){var e=this.scriptSigner?this.targetScriptRedeem:this.leftOverFundsScriptRedeem;if(!e)throw new Error("Left over funds script redeem is required");if(!this.scriptTree)throw new Error("Script tree is required");return{internalPubkey:this.internalPubKeyToXOnly(),network:this.network,scriptTree:this.scriptTree,redeem:e}}},{key:"getScriptSolution",value:function(e){if(!e.tapScriptSig)throw new Error("Tap script signature is required");return[this.contractSecret,this.internalPubKeyToXOnly(),e.tapScriptSig[0].signature,e.tapScriptSig[1].signature]}},{key:"getPubKeys",value:function(){var e=[this.signer.publicKey];return this.scriptSigner&&e.push(this.scriptSigner.publicKey),e}},{key:"getTweakerHash",value:function(){var e;return null===(e=this.tapData)||void 0===e?void 0:e.hash}},{key:"getTweakedSigner",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t={network:this.network};return e&&(t.tweakHash=this.getTweakerHash()),h.a.tweakSigner(this.signer,t)}},{key:"generateRedeemScripts",value:function(){this.targetScriptRedeem={pubkeys:this.getPubKeys(),output:this.compiledTargetScript,redeemVersion:192},this.leftOverFundsScriptRedeem={pubkeys:this.getPubKeys(),output:this.getLeafScript(),redeemVersion:192}}},{key:"getLeafScript",value:function(){return t.LOCK_LEAF_SCRIPT}},{key:"getScriptTree",value:function(){if(!this.calldata)throw new Error("Calldata is required");return this.generateRedeemScripts(),[{output:this.compiledTargetScript,version:192},{output:this.getLeafScript(),version:192}]}}],n&&m(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(o.Q);n()}catch(B){n(B)}}))},2296:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{Q:()=>l});var i=r(1757),o=r(606),a=r(477),s=r(6647),u=r(154),f=r(8287).Buffer,c=e([s,u]);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(e){if(Array.isArray(e))return w(e)}function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=g(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function g(e,t){if(e){if("string"==typeof e)return w(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E(n.key),n)}}function _(e,t,r){return(t=E(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(e){var t=S(e,"string");return"symbol"==h(t)?t:t+""}function S(e,t){if("object"!=h(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}[s,u]=c.then?(await c)():c;var l=function(){function e(t){if(v(this,e),_(this,"logColor","#785def"),_(this,"transactionFee",0n),_(this,"transaction",void 0),_(this,"inputs",[]),_(this,"updateInputs",[]),_(this,"outputs",[]),_(this,"feeOutput",null),_(this,"signed",!1),_(this,"tapData",null),_(this,"scriptData",null),_(this,"totalInputAmount",void 0),_(this,"signer",void 0),_(this,"network",void 0),_(this,"feeRate",void 0),_(this,"priorityFee",void 0),_(this,"utxos",void 0),_(this,"to",void 0),_(this,"from",void 0),_(this,"_maximumFeeRate",1e8),this.signer=t.signer,this.network=t.network,this.feeRate=t.feeRate,this.priorityFee=t.priorityFee,this.utxos=t.utxos,this.to=t.to,this.from=t.from||u.k.getTaprootAddress(this.signer,this.network),this.totalInputAmount=this.calculateTotalUTXOAmount(),this.calculateTotalVOutAmount()<this.totalInputAmount)throw new Error("Vout value is less than the value to send");if(this.totalInputAmount<e.MINIMUM_DUST)throw new Error("Value is less than the minimum dust");this.transaction=new i.iL({network:this.network})}return t=e,r=[{key:"getFundingTransactionParameters",value:function(){return{utxos:this.utxos,to:this.getScriptAddress(),signer:this.signer,network:this.network,feeRate:this.feeRate,priorityFee:this.priorityFee,from:this.from,childTransactionRequiredFees:this.transactionFee}}},{key:"setDestinationAddress",value:function(e){this.to=e}},{key:"setMaximumFeeRate",value:function(e){this._maximumFeeRate=e}},{key:"signTransaction",value:function(){if(!this.to)throw new Error("Transaction must have a recipient");if(!u.k.verifyContractAddress(this.to,this.network))throw new Error("Invalid contract address. The contract address must be a taproot address.");if(this.signed)throw new Error("Transaction is already signed");if(this.signed=!0,this.buildTransaction(),this.internalBuildTransaction(this.transaction))return this.transaction.extractTransaction(!1);throw new Error("Could not sign transaction")}},{key:"getTransaction",value:function(){return this.transaction.extractTransaction(!1)}},{key:"getScriptAddress",value:function(){if(!this.scriptData||!this.scriptData.address)throw new Error("Tap data is required");return this.scriptData.address}},{key:"disableRBF",value:function(){if(this.signed)throw new Error("Transaction is already signed");var e,t=b(this.inputs);try{for(t.s();!(e=t.n()).done;)e.value.sequence=4294967295}catch(e){t.e(e)}finally{t.f()}}},{key:"getTapAddress",value:function(){if(!this.tapData||!this.tapData.address)throw new Error("Tap data is required");return this.tapData.address}},{key:"addInput",value:function(e){this.inputs.push(e)}},{key:"addOutput",value:function(t){if(t.value<e.MINIMUM_DUST)throw new Error("Output value is less than the minimum dust ".concat(t.value," < ").concat(e.MINIMUM_DUST));this.outputs.push(t)}},{key:"addRefundOutput",value:function(t){var r=this.totalInputAmount-t;r>=e.MINIMUM_DUST?this.setFeeOutput({value:Number(r),address:this.from}):console.warn("Amount to send back is less than the minimum dust, will be consumed in fees instead.")}},{key:"getTransactionOPNetFee",value:function(){return this.priorityFee>e.MINIMUM_DUST?this.priorityFee:e.MINIMUM_DUST}},{key:"calculateTotalUTXOAmount",value:function(){var e,t=0n,r=b(this.utxos);try{for(r.s();!(e=r.n()).done;)t+=e.value.value}catch(e){r.e(e)}finally{r.f()}return t}},{key:"calculateTotalVOutAmount",value:function(){var e,t=0n,r=b(this.utxos);try{for(r.s();!(e=r.n()).done;)t+=e.value.value}catch(e){r.e(e)}finally{r.f()}return t}},{key:"addInputsFromUTXO",value:function(){var e,t=b(this.utxos);try{for(t.s();!(e=t.n()).done;){var r=e.value,n={hash:r.transactionId,index:r.outputIndex,witnessUtxo:{value:Number(r.value),script:f.from(r.scriptPubKey.hex,"hex")},sequence:4294967293};this.addInput(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"witnessStackToScriptWitness",value:function(e){var t,r=f.allocUnsafe(0);function n(e){var t=r.length,n=o.varuint.encodingLength(e);r=f.concat([r,f.allocUnsafe(n)]),o.varuint.encode(e,r,t)}return n((t=e).length),t.forEach((function(e){n(e.length),function(e){r=f.concat([r,f.from(e)])}(e)})),r}},{key:"internalInit",value:function(){this.verifyUTXOValidity(),this.scriptData=i.KT.p2tr(this.generateScriptAddress()),this.tapData=i.KT.p2tr(this.generateTapData())}},{key:"generateScriptAddress",value:function(){return{internalPubkey:this.internalPubKeyToXOnly(),network:this.network}}},{key:"generateTapData",value:function(){return{internalPubkey:this.internalPubKeyToXOnly(),network:this.network}}},{key:"updateInput",value:function(e){this.updateInputs.push(e)}},{key:"getWitness",value:function(){if(!this.tapData||!this.tapData.witness)throw new Error("Witness is required");if(0===this.tapData.witness.length)throw new Error("Witness is empty");return this.tapData.witness[this.tapData.witness.length-1]}},{key:"getTapOutput",value:function(){if(!this.tapData||!this.tapData.output)throw new Error("Tap data is required");return this.tapData.output}},{key:"getInputs",value:function(){return this.inputs}},{key:"getOutputs",value:function(){var e,t=y(e=this.outputs)||d(e)||g(e)||p();return this.feeOutput&&t.push(this.feeOutput),t}},{key:"verifyUTXOValidity",value:function(){var e,t=b(this.utxos);try{for(t.s();!(e=t.n()).done;)if(!e.value.scriptPubKey)throw new Error("Address is required")}catch(e){t.e(e)}finally{t.f()}}},{key:"setFeeOutput",value:function(t){var r=t.value;this.feeOutput=t;var n=this.estimateTransactionFees();if(n>BigInt(r))throw new Error("Insufficient funds");this.feeOutput.value=r-Number(n),this.feeOutput.value<e.MINIMUM_DUST&&(this.feeOutput=null)}},{key:"internalPubKeyToXOnly",value:function(){return(0,a.toXOnly)(this.signer.publicKey)}},{key:"signInputs",value:function(e){e.signAllInputs(this.getSignerKey()),e.finalizeAllInputs()}},{key:"internalBuildTransaction",value:function(e){var t=this.getInputs(),r=this.getOutputs();e.setMaximumFeeRate(this._maximumFeeRate),e.addInputs(t);for(var n=0;n<this.updateInputs.length;n++)e.updateInput(n,this.updateInputs[n]);e.addOutputs(r);try{return this.signInputs(e),this.transactionFee=BigInt(e.getFee()),!0}catch(e){var i=e;console.error("[internalBuildTransaction] Something went wrong while getting building the transaction: ".concat(i.stack))}return!1}},{key:"estimateTransactionFees",value:function(){var e=new i.iL({network:this.network});if(this.internalBuildTransaction(e)){var t=e.extractTransaction(!1).virtualSize(),r=this.feeRate*t+1;return BigInt(Math.ceil(r))}throw new Error("Could not build transaction to estimate fee. Something went wrong while building the transaction.")}}],r&&m(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();_(l,"LOCK_LEAF_SCRIPT",i.K$.compile([i.Ez.OP_0])),_(l,"MINIMUM_DUST",330n),(0,i.f0)(s),n()}catch(k){n(k)}}))},3959:(e,t,r)=>{var n;r.d(t,{D:()=>n}),function(e){e[e.GENERIC=0]="GENERIC",e[e.FUNDING=1]="FUNDING",e[e.DEPLOYMENT=2]="DEPLOYMENT",e[e.INTERACTION=3]="INTERACTION",e[e.WBTC_WRAP=4]="WBTC_WRAP"}(n||(n={}))},8284:(e,t,r)=>{r.d(t,{G:()=>s});var n=r(8287).Buffer;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"btcToSatoshi",value:function(e){return BigInt(1e8*e)}},{key:"rndBytes",value:function(){var e=crypto.getRandomValues(new Uint8Array(64));return n.from(e)}}],null&&o(e.prototype,null),t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},9565:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",f=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),s=new B(n||[]);return a(o,"_invoke",{value:I(e,r,s)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",y="suspendedYield",b="executing",g="completed",w={};function v(){}function m(){}function _(){}var E={};l(E,u,(function(){return this}));var S=Object.getPrototypeOf,k=S&&S(S(N([])));k&&k!==r&&o.call(k,u)&&(E=k);var T=_.prototype=v.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(i,a,s,u){var f=p(e[i],e,a);if("throw"!==f.type){var c=f.arg,l=c.value;return l&&"object"==n(l)&&o.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,u)}))}u(f.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}})}function I(t,r,n){var i=d;return function(o,a){if(i===b)throw Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===w)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=b;var f=p(t,r,n);if("normal"===f.type){if(i=n.done?g:y,f.arg===w)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(i=g,n.method="throw",n.arg=f.arg)}}}function P(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),w;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,w;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,w):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,w)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(o.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return m.prototype=_,a(T,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:m,configurable:!0}),m.displayName=l(_,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,l(e,c,"GeneratorFunction")),e.prototype=Object.create(T),e},t.awrap=function(e){return{__await:e}},O(A.prototype),l(A.prototype,f,(function(){return this})),t.AsyncIterator=A,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new A(h(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(T),l(T,c,"Generator"),l(T,u,(function(){return this})),l(T,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,w):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),w},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;R(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),w}},t}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function f(e,t,r){return(t=c(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}r.d(t,{y:()=>l});var l=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,"opnetAPIUrl",void 0),f(this,"utxoPath","address/utxos"),this.opnetAPIUrl=t},t=[{key:"fetchUTXO",value:(r=i().mark((function e(t){var r,n,a,s,u,f,c,l,h,p,d,y;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={method:"GET",headers:{"Content-Type":"application/json"}},n="".concat(this.opnetAPIUrl,"/api/v1/").concat(this.utxoPath,"?address=").concat(t.address),e.next=4,fetch(n,r);case 4:if((a=e.sent).ok){e.next=7;break}throw new Error("Failed to fetch UTXO data: ".concat(a.statusText));case 7:return e.next=9,a.json();case 9:if(0!==(s=e.sent).length){e.next=12;break}throw new Error("No UTXO found");case 12:if(u=s.filter((function(e){return BigInt(e.value)>=t.minAmount})),0!==u.length){e.next=15;break}throw new Error("No UTXO found (minAmount)");case 15:f=[],c=0n,l=t.requestedAmount,h=o(u),e.prev=19,h.s();case 21:if((p=h.n()).done){e.next=30;break}if(d=p.value,y=BigInt(d.value),c+=y,f.push({transactionId:d.transactionId,outputIndex:d.outputIndex,value:y,scriptPubKey:d.scriptPubKey}),!(c+y>l)){e.next=28;break}return e.abrupt("break",30);case 28:e.next=21;break;case 30:e.next=35;break;case 32:e.prev=32,e.t0=e.catch(19),h.e(e.t0);case 35:return e.prev=35,h.f(),e.finish(35);case 38:return e.abrupt("return",f);case 39:case"end":return e.stop()}}),e,this,[[19,32,35,38]])})),n=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)}))},function(e){return n.apply(this,arguments)})}],t&&u(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n}()},5364:e=>{e.exports=function(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 n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function c(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===s;)n++,r++;for(var o=(e.length-r)*u+1>>>0,f=new Uint8Array(o);e[r];){var c=t[e.charCodeAt(r)];if(255===c)return;for(var l=0,h=o-1;(0!==c||l<i)&&-1!==h;h--,l++)c+=a*f[h]>>>0,f[h]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");i=l,r++}for(var p=o-i;p!==o&&0===f[p];)p++;for(var d=new Uint8Array(n+(o-p)),y=n;p!==o;)d[y++]=f[p++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var u=(o-i)*f+1>>>0,c=new Uint8Array(u);i!==o;){for(var l=t[i],h=0,p=u-1;(0!==l||h<n)&&-1!==p;p--,h++)l+=256*c[p]>>>0,c[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");n=h,i++}for(var d=u-n;d!==u&&0===c[d];)d++;for(var y=s.repeat(r);d<u;++d)y+=e.charAt(c[d]);return y},decodeUnsafe:c,decode:function(e){var t=c(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},7526:(e,t)=>{t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],f=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),c=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],f[c++]=t>>16&255,f[c++]=t>>8&255,f[c++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,f[c++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,f[c++]=t>>8&255,f[c++]=255&t),f},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,f=n-i;s<f;s+=a)o.push(u(e,s,s+a>f?f:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={};for(let e=0;e<32;e++){const t=r.charAt(e);n[t]=e}function i(e){const t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function o(e){let t=1;for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=i(t)^n>>5}t=i(t);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t=i(t)^31&n}return t}function a(e,t,r,n){let i=0,o=0;const a=(1<<r)-1,s=[];for(let n=0;n<e.length;++n)for(i=i<<t|e[n],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}function s(e){return a(e,8,5,!0)}function u(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t}function f(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function c(e){let t;function a(e,r){if(r=r||90,e.length<8)return e+" too short";if(e.length>r)return"Exceeds length limit";const a=e.toLowerCase(),s=e.toUpperCase();if(e!==a&&e!==s)return"Mixed-case string "+e;const u=(e=a).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const f=e.slice(0,u),c=e.slice(u+1);if(c.length<6)return"Data too short";let l=o(f);if("string"==typeof l)return l;const h=[];for(let e=0;e<c.length;++e){const t=c.charAt(e),r=n[t];if(void 0===r)return"Unknown character "+t;l=i(l)^r,e+6>=c.length||h.push(r)}return l!==t?"Invalid checksum for "+e:{prefix:f,words:h}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const r=a(e,t);if("object"==typeof r)return r},decode:function(e,t){const r=a(e,t);if("object"==typeof r)return r;throw new Error(r)},encode:function(e,n,a){if(a=a||90,e.length+7+n.length>a)throw new TypeError("Exceeds length limit");let s=o(e=e.toLowerCase());if("string"==typeof s)throw new Error(s);let u=e+"1";for(let e=0;e<n.length;++e){const t=n[e];if(t>>5)throw new Error("Non 5-bit word");s=i(s)^t,u+=r.charAt(t)}for(let e=0;e<6;++e)s=i(s);s^=t;for(let e=0;e<6;++e)u+=r.charAt(s>>5*(5-e)&31);return u},toWords:s,fromWordsUnsafe:u,fromWords:f}}t.bech32=c("bech32"),t.bech32m=c("bech32m")},4863:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(1457);function i(e,t,r){return n=>{if(e.has(n))return;const i=r.filter((e=>e.key.toString("hex")===n))[0];t.push(i),e.add(n)}}function o(e){return e.globalMap.unsignedTx}function a(e){const t=new Set;return e.forEach((e=>{const r=e.key.toString("hex");if(t.has(r))throw new Error("Combine: KeyValue Map keys should be unique");t.add(r)})),t}t.combine=function(e){const t=e[0],r=n.psbtToKeyVals(t),s=e.slice(1);if(0===s.length)throw new Error("Combine: Nothing to combine");const u=o(t);if(void 0===u)throw new Error("Combine: Self missing transaction");const f=a(r.globalKeyVals),c=r.inputKeyVals.map(a),l=r.outputKeyVals.map(a);for(const e of s){const t=o(e);if(void 0===t||!t.toBuffer().equals(u.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const s=n.psbtToKeyVals(e);a(s.globalKeyVals).forEach(i(f,r.globalKeyVals,s.globalKeyVals)),s.inputKeyVals.map(a).forEach(((e,t)=>e.forEach(i(c[t],r.inputKeyVals[t],s.inputKeyVals[t])))),s.outputKeyVals.map(a).forEach(((e,t)=>e.forEach(i(l[t],r.outputKeyVals[t],s.outputKeyVals[t]))))}return n.psbtFromKeyVals(u,{globalMapKeyVals:r.globalKeyVals,inputKeyVals:r.inputKeyVals,outputKeyVals:r.outputKeyVals})}},4834:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const t=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:t,path:"m"};for(const t of(n=e.value.length/4-1,[...Array(n).keys()])){const n=e.value.readUInt32LE(4*t+4),i=!!(2147483648&n),o=2147483647&n;r.path+="/"+o.toString(10)+(i?"'":"")}var n;return r},t.encode=function(e){const t=n.from([i.GlobalTypes.GLOBAL_XPUB]),r=n.concat([t,e.extendedPubkey]),o=e.path.split("/"),a=n.allocUnsafe(4*o.length);e.masterFingerprint.copy(a,0);let s=4;return o.slice(1).forEach((e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),a.writeUInt32LE(r,s),s+=4})),{key:r,value:a}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(e){const t=e.extendedPubkey,r=e.masterFingerprint,i=e.path;return n.isBuffer(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&n.isBuffer(r)&&4===r.length&&"string"==typeof i&&!!i.match(/^m(\/\d+'?)*$/)},t.canAddToArray=function(e,t,r){const n=t.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.extendedPubkey.equals(t.extendedPubkey))).length)}},4213:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.encode=function(e){return{key:n.from([i.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}}},2706:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(9080),i=r(4834),o=r(4213),a=r(6605),s=r(1795),u=r(4431),f=r(6907),c=r(5949),l=r(9344),h=r(2760),p=r(1695),d=r(8454),y=r(9034),b=r(2926),g=r(7851),w=r(7545),v=r(2412),m=r(4307),_=r(7636),E=r(2223),S=r(5578),k={unsignedTx:o,globalXpub:i,checkPubkey:v.makeChecker([])};t.globals=k;const T={nonWitnessUtxo:u,partialSig:f,sighashType:l,finalScriptSig:a,finalScriptWitness:s,porCommitment:c,witnessUtxo:b,bip32Derivation:w.makeConverter(n.InputTypes.BIP32_DERIVATION),redeemScript:m.makeConverter(n.InputTypes.REDEEM_SCRIPT),witnessScript:S.makeConverter(n.InputTypes.WITNESS_SCRIPT),checkPubkey:v.makeChecker([n.InputTypes.PARTIAL_SIG,n.InputTypes.BIP32_DERIVATION]),tapKeySig:h,tapScriptSig:y,tapLeafScript:p,tapBip32Derivation:_.makeConverter(n.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:E.makeConverter(n.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot:d};t.inputs=T;const O={bip32Derivation:w.makeConverter(n.OutputTypes.BIP32_DERIVATION),redeemScript:m.makeConverter(n.OutputTypes.REDEEM_SCRIPT),witnessScript:S.makeConverter(n.OutputTypes.WITNESS_SCRIPT),checkPubkey:v.makeChecker([n.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:_.makeConverter(n.OutputTypes.TAP_BIP32_DERIVATION),tapTree:g,tapInternalKey:E.makeConverter(n.OutputTypes.TAP_INTERNAL_KEY)};t.outputs=O},6605:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:n.from([i.InputTypes.FINAL_SCRIPTSIG]),value:e}},t.expected="Buffer",t.check=function(e){return n.isBuffer(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}},1795:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:n.from([i.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},t.expected="Buffer",t.check=function(e){return n.isBuffer(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}},4431:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:n.from([i.InputTypes.NON_WITNESS_UTXO]),value:e}},t.expected="Buffer",t.check=function(e){return n.isBuffer(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo}},6907:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(e){const t=n.from([i.InputTypes.PARTIAL_SIG]);return{key:n.concat([t,e.pubkey]),value:e.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(e){return n.isBuffer(e.pubkey)&&n.isBuffer(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!n.isBuffer(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;const t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;const r=e[3+t+2];return!(r>33||r<1)&&e.length===3+t+2+r+2}(e.signature)},t.canAddToArray=function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.pubkey.equals(t.pubkey))).length)}},5949:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(e){return{key:n.from([i.InputTypes.POR_COMMITMENT]),value:n.from(e,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}},9344:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(e){const t=n.from([i.InputTypes.SIGHASH_TYPE]),r=n.allocUnsafe(4);return r.writeUInt32LE(e,0),{key:t,value:r}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}},2760:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);function o(e){return n.isBuffer(e)&&(64===e.length||65===e.length)}t.decode=function(e){if(e.key[0]!==i.InputTypes.TAP_KEY_SIG||1!==e.key.length)throw new Error("Decode Error: could not decode tapKeySig with key 0x"+e.key.toString("hex"));if(!o(e.value))throw new Error("Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature");return e.value},t.encode=function(e){return{key:n.from([i.InputTypes.TAP_KEY_SIG]),value:e}},t.expected="Buffer",t.check=o,t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapKeySig}},1695:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.TAP_LEAF_SCRIPT)throw new Error("Decode Error: could not decode tapLeafScript with key 0x"+e.key.toString("hex"));if((e.key.length-2)%32!=0)throw new Error("Decode Error: tapLeafScript has invalid control block in key 0x"+e.key.toString("hex"));const t=e.value[e.value.length-1];if((254&e.key[1])!==t)throw new Error("Decode Error: tapLeafScript bad leaf version in key 0x"+e.key.toString("hex"));const r=e.value.slice(0,-1);return{controlBlock:e.key.slice(1),script:r,leafVersion:t}},t.encode=function(e){const t=n.from([i.InputTypes.TAP_LEAF_SCRIPT]),r=n.from([e.leafVersion]);return{key:n.concat([t,e.controlBlock]),value:n.concat([e.script,r])}},t.expected="{ controlBlock: Buffer; leafVersion: number, script: Buffer; }",t.check=function(e){return n.isBuffer(e.controlBlock)&&(e.controlBlock.length-1)%32==0&&(254&e.controlBlock[0])===e.leafVersion&&n.isBuffer(e.script)},t.canAddToArray=function(e,t,r){const n=t.controlBlock.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.controlBlock.equals(t.controlBlock))).length)}},8454:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);function o(e){return n.isBuffer(e)&&32===e.length}t.decode=function(e){if(e.key[0]!==i.InputTypes.TAP_MERKLE_ROOT||1!==e.key.length)throw new Error("Decode Error: could not decode tapMerkleRoot with key 0x"+e.key.toString("hex"));if(!o(e.value))throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");return e.value},t.encode=function(e){return{key:n.from([i.InputTypes.TAP_MERKLE_ROOT]),value:e}},t.expected="Buffer",t.check=o,t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapMerkleRoot}},9034:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080);t.decode=function(e){if(e.key[0]!==i.InputTypes.TAP_SCRIPT_SIG)throw new Error("Decode Error: could not decode tapScriptSig with key 0x"+e.key.toString("hex"));if(65!==e.key.length)throw new Error("Decode Error: tapScriptSig has invalid key 0x"+e.key.toString("hex"));if(64!==e.value.length&&65!==e.value.length)throw new Error("Decode Error: tapScriptSig has invalid signature in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1,33),leafHash:e.key.slice(33),signature:e.value}},t.encode=function(e){const t=n.from([i.InputTypes.TAP_SCRIPT_SIG]);return{key:n.concat([t,e.pubkey,e.leafHash]),value:e.signature}},t.expected="{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }",t.check=function(e){return n.isBuffer(e.pubkey)&&n.isBuffer(e.leafHash)&&n.isBuffer(e.signature)&&32===e.pubkey.length&&32===e.leafHash.length&&(64===e.signature.length||65===e.signature.length)},t.canAddToArray=function(e,t,r){const n=t.pubkey.toString("hex")+t.leafHash.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.pubkey.equals(t.pubkey)&&e.leafHash.equals(t.leafHash))).length)}},2926:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080),o=r(8133),a=r(394);t.decode=function(e){if(e.key[0]!==i.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));const t=o.readUInt64LE(e.value,0);let r=8;const n=a.decode(e.value,r);r+=a.encodingLength(n);const s=e.value.slice(r);if(s.length!==n)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:s,value:t}},t.encode=function(e){const{script:t,value:r}=e,s=a.encodingLength(t.length),u=n.allocUnsafe(8+s+t.length);return o.writeUInt64LE(u,r,0),a.encode(t.length,u,8),t.copy(u,8+s),{key:n.from([i.InputTypes.WITNESS_UTXO]),value:u}},t.expected="{ script: Buffer; value: number; }",t.check=function(e){return n.isBuffer(e.script)&&"number"==typeof e.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo}},7851:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(9080),o=r(394);t.decode=function(e){if(e.key[0]!==i.OutputTypes.TAP_TREE||1!==e.key.length)throw new Error("Decode Error: could not decode tapTree with key 0x"+e.key.toString("hex"));let t=0;const r=[];for(;t<e.value.length;){const n=e.value[t++],i=e.value[t++],a=o.decode(e.value,t);t+=o.encodingLength(a),r.push({depth:n,leafVersion:i,script:e.value.slice(t,t+a)}),t+=a}return{leaves:r}},t.encode=function(e){const t=n.from([i.OutputTypes.TAP_TREE]),r=[].concat(...e.leaves.map((e=>[n.of(e.depth,e.leafVersion),o.encode(e.script.length),e.script])));return{key:t,value:n.concat(r)}},t.expected="{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }",t.check=function(e){return Array.isArray(e.leaves)&&e.leaves.every((e=>e.depth>=0&&e.depth<=128&&(254&e.leafVersion)===e.leafVersion&&n.isBuffer(e.script)))},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapTree}},7545:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=e=>33===e.length&&[2,3].includes(e[0])||65===e.length&&4===e[0];t.makeConverter=function(e,t=i){return{decode:function(r){if(r.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+r.key.toString("hex"));const n=r.key.slice(1);if(!t(n))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+r.key.toString("hex"));if(r.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const i={masterFingerprint:r.value.slice(0,4),pubkey:n,path:"m"};for(const e of(o=r.value.length/4-1,[...Array(o).keys()])){const t=r.value.readUInt32LE(4*e+4),n=!!(2147483648&t),o=2147483647&t;i.path+="/"+o.toString(10)+(n?"'":"")}var o;return i},encode:function(t){const r=n.from([e]),i=n.concat([r,t.pubkey]),o=t.path.split("/"),a=n.allocUnsafe(4*o.length);t.masterFingerprint.copy(a,0);let s=4;return o.slice(1).forEach((e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),a.writeUInt32LE(r,s),s+=4})),{key:i,value:a}},check:function(e){return n.isBuffer(e.pubkey)&&n.isBuffer(e.masterFingerprint)&&"string"==typeof e.path&&t(e.pubkey)&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.pubkey.equals(t.pubkey))).length)}}}},2412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){let r;if(e.includes(t.key[0])&&(r=t.key.slice(1),33!==r.length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return r}}},4307:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:n.from([e]),value:t}},check:function(e){return n.isBuffer(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}},7636:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(394),o=r(7545),a=e=>32===e.length;t.makeConverter=function(e){const t=o.makeConverter(e,a);return{decode:function(e){const r=i.decode(e.value),n=i.encodingLength(r),o=t.decode({key:e.key,value:e.value.slice(n+32*r)}),a=new Array(r);for(let t=0,i=n;t<r;t++,i+=32)a[t]=e.value.slice(i,i+32);return Object.assign({},o,{leafHashes:a})},encode:function(e){const r=t.encode(e),o=i.encodingLength(e.leafHashes.length),a=n.allocUnsafe(o);i.encode(e.leafHashes.length,a);const s=n.concat([a,...e.leafHashes,r.value]);return Object.assign({},r,{value:s})},check:function(e){return Array.isArray(e.leafHashes)&&e.leafHashes.every((e=>n.isBuffer(e)&&32===e.length))&&t.check(e)},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; leafHashes: Buffer[]; }",canAddToArray:t.canAddToArray}}},2223:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e||1!==t.key.length)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+t.key.toString("hex"));if(32!==t.value.length)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return t.value},encode:function(t){return{key:n.from([e]),value:t}},check:function(e){return n.isBuffer(e)&&32===e.length},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.tapInternalKey}}}},5578:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:n.from([e]),value:t}},check:function(e){return n.isBuffer(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}},8133:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(394);function o(e){const t=e.key.length,r=e.value.length,o=i.encodingLength(t),a=i.encodingLength(r),s=n.allocUnsafe(o+t+a+r);return i.encode(t,s,0),e.key.copy(s,o),i.encode(r,s,o+t),e.value.copy(s,o+t+a),s}function a(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}t.range=e=>[...Array(e).keys()],t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.keyValsToBuffer=function(e){const t=e.map(o);return t.push(n.from([0])),n.concat(t)},t.keyValToBuffer=o,t.readUInt64LE=function(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,a(n+r,9007199254740991),n+r},t.writeUInt64LE=function(e,t,r){return a(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}},394:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=9007199254740991;function o(e){if(e<0||e>i||e%1!=0)throw new RangeError("value out of range")}function a(e){return o(e),e<253?1:e<=65535?3:e<=4294967295?5:9}t.encode=function e(t,r,i){if(o(t),r||(r=n.allocUnsafe(a(t))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return i||(i=0),t<253?(r.writeUInt8(t,i),Object.assign(e,{bytes:1})):t<=65535?(r.writeUInt8(253,i),r.writeUInt16LE(t,i+1),Object.assign(e,{bytes:3})):t<=4294967295?(r.writeUInt8(254,i),r.writeUInt32LE(t,i+1),Object.assign(e,{bytes:5})):(r.writeUInt8(255,i),r.writeUInt32LE(t>>>0,i+1),r.writeUInt32LE(t/4294967296|0,i+5),Object.assign(e,{bytes:9})),r},t.decode=function e(t,r){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);const i=t.readUInt8(r);if(i<253)return Object.assign(e,{bytes:1}),i;if(253===i)return Object.assign(e,{bytes:3}),t.readUInt16LE(r+1);if(254===i)return Object.assign(e,{bytes:5}),t.readUInt32LE(r+1);{Object.assign(e,{bytes:9});const n=t.readUInt32LE(r+1),i=4294967296*t.readUInt32LE(r+5)+n;return o(i),i}},t.encodingLength=a},6263:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(2706),o=r(8133),a=r(394),s=r(9080);function u(e,t,r){if(!t.equals(n.from([r])))throw new Error(`Format Error: Invalid ${e} key: ${t.toString("hex")}`)}function f(e,{globalMapKeyVals:t,inputKeyVals:r,outputKeyVals:n}){const a={unsignedTx:e};let f=0;for(const e of t)switch(e.key[0]){case s.GlobalTypes.UNSIGNED_TX:if(u("global",e.key,s.GlobalTypes.UNSIGNED_TX),f>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");f++;break;case s.GlobalTypes.GLOBAL_XPUB:void 0===a.globalXpub&&(a.globalXpub=[]),a.globalXpub.push(i.globals.globalXpub.decode(e));break;default:a.unknownKeyVals||(a.unknownKeyVals=[]),a.unknownKeyVals.push(e)}const c=r.length,l=n.length,h=[],p=[];for(const e of o.range(c)){const t={};for(const n of r[e])switch(i.inputs.checkPubkey(n),n.key[0]){case s.InputTypes.NON_WITNESS_UTXO:if(u("input",n.key,s.InputTypes.NON_WITNESS_UTXO),void 0!==t.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");t.nonWitnessUtxo=i.inputs.nonWitnessUtxo.decode(n);break;case s.InputTypes.WITNESS_UTXO:if(u("input",n.key,s.InputTypes.WITNESS_UTXO),void 0!==t.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");t.witnessUtxo=i.inputs.witnessUtxo.decode(n);break;case s.InputTypes.PARTIAL_SIG:void 0===t.partialSig&&(t.partialSig=[]),t.partialSig.push(i.inputs.partialSig.decode(n));break;case s.InputTypes.SIGHASH_TYPE:if(u("input",n.key,s.InputTypes.SIGHASH_TYPE),void 0!==t.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");t.sighashType=i.inputs.sighashType.decode(n);break;case s.InputTypes.REDEEM_SCRIPT:if(u("input",n.key,s.InputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");t.redeemScript=i.inputs.redeemScript.decode(n);break;case s.InputTypes.WITNESS_SCRIPT:if(u("input",n.key,s.InputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");t.witnessScript=i.inputs.witnessScript.decode(n);break;case s.InputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(i.inputs.bip32Derivation.decode(n));break;case s.InputTypes.FINAL_SCRIPTSIG:u("input",n.key,s.InputTypes.FINAL_SCRIPTSIG),t.finalScriptSig=i.inputs.finalScriptSig.decode(n);break;case s.InputTypes.FINAL_SCRIPTWITNESS:u("input",n.key,s.InputTypes.FINAL_SCRIPTWITNESS),t.finalScriptWitness=i.inputs.finalScriptWitness.decode(n);break;case s.InputTypes.POR_COMMITMENT:u("input",n.key,s.InputTypes.POR_COMMITMENT),t.porCommitment=i.inputs.porCommitment.decode(n);break;case s.InputTypes.TAP_KEY_SIG:u("input",n.key,s.InputTypes.TAP_KEY_SIG),t.tapKeySig=i.inputs.tapKeySig.decode(n);break;case s.InputTypes.TAP_SCRIPT_SIG:void 0===t.tapScriptSig&&(t.tapScriptSig=[]),t.tapScriptSig.push(i.inputs.tapScriptSig.decode(n));break;case s.InputTypes.TAP_LEAF_SCRIPT:void 0===t.tapLeafScript&&(t.tapLeafScript=[]),t.tapLeafScript.push(i.inputs.tapLeafScript.decode(n));break;case s.InputTypes.TAP_BIP32_DERIVATION:void 0===t.tapBip32Derivation&&(t.tapBip32Derivation=[]),t.tapBip32Derivation.push(i.inputs.tapBip32Derivation.decode(n));break;case s.InputTypes.TAP_INTERNAL_KEY:u("input",n.key,s.InputTypes.TAP_INTERNAL_KEY),t.tapInternalKey=i.inputs.tapInternalKey.decode(n);break;case s.InputTypes.TAP_MERKLE_ROOT:u("input",n.key,s.InputTypes.TAP_MERKLE_ROOT),t.tapMerkleRoot=i.inputs.tapMerkleRoot.decode(n);break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(n)}h.push(t)}for(const e of o.range(l)){const t={};for(const r of n[e])switch(i.outputs.checkPubkey(r),r.key[0]){case s.OutputTypes.REDEEM_SCRIPT:if(u("output",r.key,s.OutputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");t.redeemScript=i.outputs.redeemScript.decode(r);break;case s.OutputTypes.WITNESS_SCRIPT:if(u("output",r.key,s.OutputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");t.witnessScript=i.outputs.witnessScript.decode(r);break;case s.OutputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(i.outputs.bip32Derivation.decode(r));break;case s.OutputTypes.TAP_INTERNAL_KEY:u("output",r.key,s.OutputTypes.TAP_INTERNAL_KEY),t.tapInternalKey=i.outputs.tapInternalKey.decode(r);break;case s.OutputTypes.TAP_TREE:u("output",r.key,s.OutputTypes.TAP_TREE),t.tapTree=i.outputs.tapTree.decode(r);break;case s.OutputTypes.TAP_BIP32_DERIVATION:void 0===t.tapBip32Derivation&&(t.tapBip32Derivation=[]),t.tapBip32Derivation.push(i.outputs.tapBip32Derivation.decode(r));break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(r)}p.push(t)}return{globalMap:a,inputs:h,outputs:p}}t.psbtFromBuffer=function(e,t){let r=0;function n(){const t=a.decode(e,r);r+=a.encodingLength(t);const n=e.slice(r,r+t);return r+=t,n}function i(){return{key:n(),value:n()}}function u(){if(r>=e.length)throw new Error("Format Error: Unexpected End of PSBT");const t=0===e.readUInt8(r);return t&&r++,t}if(1886610036!==function(){const t=e.readUInt32BE(r);return r+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){const t=e.readUInt8(r);return r+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");const c=[],l={};for(;!u();){const e=i(),t=e.key.toString("hex");if(l[t])throw new Error("Format Error: Keys must be unique for global keymap: key "+t);l[t]=1,c.push(e)}const h=c.filter((e=>e.key[0]===s.GlobalTypes.UNSIGNED_TX));if(1!==h.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const p=t(h[0].value),{inputCount:d,outputCount:y}=p.getInputOutputCounts(),b=[],g=[];for(const e of o.range(d)){const t={},r=[];for(;!u();){const n=i(),o=n.key.toString("hex");if(t[o])throw new Error("Format Error: Keys must be unique for each input: input index "+e+" key "+o);t[o]=1,r.push(n)}b.push(r)}for(const e of o.range(y)){const t={},r=[];for(;!u();){const n=i(),o=n.key.toString("hex");if(t[o])throw new Error("Format Error: Keys must be unique for each output: output index "+e+" key "+o);t[o]=1,r.push(n)}g.push(r)}return f(p,{globalMapKeyVals:c,inputKeyVals:b,outputKeyVals:g})},t.checkKeyBuffer=u,t.psbtFromKeyVals=f},1457:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(6263)),n(r(238))},238:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(2706),o=r(8133);t.psbtToBuffer=function({globalMap:e,inputs:t,outputs:r}){const{globalKeyVals:i,inputKeyVals:a,outputKeyVals:s}=u({globalMap:e,inputs:t,outputs:r}),f=o.keyValsToBuffer(i),c=e=>0===e.length?[n.from([0])]:e.map(o.keyValsToBuffer),l=c(a),h=c(s),p=n.allocUnsafe(5);return p.writeUIntBE(482972169471,0,5),n.concat([p,f].concat(l,h))};const a=(e,t)=>e.key.compare(t.key);function s(e,t){const r=new Set,n=Object.entries(e).reduce(((e,[n,i])=>{if("unknownKeyVals"===n)return e;const o=t[n];if(void 0===o)return e;const a=(Array.isArray(i)?i:[i]).map(o.encode);return a.map((e=>e.key.toString("hex"))).forEach((e=>{if(r.has(e))throw new Error("Serialize Error: Duplicate key: "+e);r.add(e)})),e.concat(a)}),[]),i=e.unknownKeyVals?e.unknownKeyVals.filter((e=>!r.has(e.key.toString("hex")))):[];return n.concat(i).sort(a)}function u({globalMap:e,inputs:t,outputs:r}){return{globalKeyVals:s(e,i.globals),inputKeyVals:t.map((e=>s(e,i.inputs))),outputKeyVals:r.map((e=>s(e,i.outputs)))}}t.psbtToKeyVals=u},1614:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(4863),o=r(1457),a=r(9080),s=r(5080);t.Psbt=class{constructor(e){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:e}}static fromBase64(e,t){const r=n.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t){const r=n.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t){const r=o.psbtFromBuffer(e,t),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return o.psbtToBuffer(this)}updateGlobal(e){return s.updateGlobal(e,this.globalMap),this}updateInput(e,t){const r=s.checkForInput(this.inputs,e);return s.updateInput(t,r),this}updateOutput(e,t){const r=s.checkForOutput(this.outputs,e);return s.updateOutput(t,r),this}addUnknownKeyValToGlobal(e){return s.checkHasKey(e,this.globalMap.unknownKeyVals,s.getEnumLength(a.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}addUnknownKeyValToInput(e,t){const r=s.checkForInput(this.inputs,e);return s.checkHasKey(t,r.unknownKeyVals,s.getEnumLength(a.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addUnknownKeyValToOutput(e,t){const r=s.checkForOutput(this.outputs,e);return s.checkHasKey(t,r.unknownKeyVals,s.getEnumLength(a.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addInput(e){this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach((e=>this.addUnknownKeyValToInput(r,e))),s.addInputAttributes(this.inputs,e),this}addOutput(e){this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach((e=>this.addUnknownKeyValToOutput(r,e))),s.addOutputAttributes(this.outputs,e),this}clearFinalizedInput(e){const t=s.checkForInput(this.inputs,e);s.inputCheckUncleanFinalized(e,t);for(const e of Object.keys(t))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(e)||delete t[e];return this}combine(...e){const t=i.combine([this].concat(e));return Object.assign(this,t),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}},9080:(e,t)=>{var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),(i=t.GlobalTypes||(t.GlobalTypes={}))[i.UNSIGNED_TX=0]="UNSIGNED_TX",i[i.GLOBAL_XPUB=1]="GLOBAL_XPUB",t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(n=t.InputTypes||(t.InputTypes={}))[n.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",n[n.WITNESS_UTXO=1]="WITNESS_UTXO",n[n.PARTIAL_SIG=2]="PARTIAL_SIG",n[n.SIGHASH_TYPE=3]="SIGHASH_TYPE",n[n.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",n[n.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",n[n.BIP32_DERIVATION=6]="BIP32_DERIVATION",n[n.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",n[n.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",n[n.POR_COMMITMENT=9]="POR_COMMITMENT",n[n.TAP_KEY_SIG=19]="TAP_KEY_SIG",n[n.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",n[n.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",n[n.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",n[n.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",n[n.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT",t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment","tapKeySig","tapScriptSig","tapLeafScript","tapBip32Derivation","tapInternalKey","tapMerkleRoot"],(r=t.OutputTypes||(t.OutputTypes={}))[r.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",r[r.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",r[r.BIP32_DERIVATION=2]="BIP32_DERIVATION",r[r.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",r[r.TAP_TREE=6]="TAP_TREE",r[r.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION",t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation","tapInternalKey","tapTree","tapBip32Derivation"]},5080:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0});const i=r(2706);function o(e,t){const r=e[t];if(void 0===r)throw new Error(`No input #${t}`);return r}function a(e,t){const r=e[t];if(void 0===r)throw new Error(`No output #${t}`);return r}function s(e,t,r,n){throw new Error(`Data for ${e} key ${t} is incorrect: Expected ${r} and got ${JSON.stringify(n)}`)}function u(e){return(t,r)=>{for(const n of Object.keys(t)){const o=t[n],{canAdd:a,canAddToArray:u,check:f,expected:c}=i[e+"s"][n]||{};if(f)if(u){if(!Array.isArray(o)||r[n]&&!Array.isArray(r[n]))throw new Error(`Key type ${n} must be an array`);o.every(f)||s(e,n,c,o);const t=r[n]||[],i=new Set;if(!o.every((e=>u(t,e,i))))throw new Error("Can not add duplicate data to array");r[n]=t.concat(o)}else{if(f(o)||s(e,n,c,o),!a(r,o))throw new Error(`Can not add duplicate data to ${e}`);r[n]=o}}}}t.checkForInput=o,t.checkForOutput=a,t.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter((t=>t.key.equals(e.key))).length)throw new Error(`Duplicate Key: ${e.key.toString("hex")}`)},t.getEnumLength=function(e){let t=0;return Object.keys(e).forEach((e=>{Number(isNaN(Number(e)))&&t++})),t},t.inputCheckUncleanFinalized=function(e,t){let r=!1;if(t.nonWitnessUtxo||t.witnessUtxo){const e=!!t.redeemScript,n=!!t.witnessScript,i=!e||!!t.finalScriptSig,o=!n||!!t.finalScriptWitness,a=!!t.finalScriptSig||!!t.finalScriptWitness;r=i&&o&&a}if(!1===r)throw new Error(`Input #${e} has too much or too little data to clean`)},t.updateGlobal=u("global"),t.updateInput=u("input"),t.updateOutput=u("output"),t.addInputAttributes=function(e,r){const n=o(e,e.length-1);t.updateInput(r,n)},t.addOutputAttributes=function(e,r){const n=a(e,e.length-1);t.updateOutput(r,n)},t.defaultVersionSetter=function(e,t){if(!n.isBuffer(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},t.defaultLocktimeSetter=function(e,t){if(!n.isBuffer(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}},4642:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.BIP32Factory=void 0;const i=r(9571),o=r(7757),a=r(3203),s=r(2623),u=r(8676),f=r(7513),c=(0,a.base58check)(s.sha256);t.BIP32Factory=function(e){(0,o.testEcc)(e);const t=u.BufferN(32),r=u.compile({wif:u.UInt8,bip32:{public:u.UInt32,private:u.UInt32}}),a={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},s=2147483648,l=Math.pow(2,31)-1;function h(e){return u.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function p(e){return u.UInt32(e)&&e<=l}class d{constructor(e,t){this.__D=e,this.__Q=t,this.lowR=!1}get publicKey(){return void 0===this.__Q&&(this.__Q=n.from(e.pointFromScalar(this.__D,!0))),this.__Q}get privateKey(){return this.__D}sign(t,r){if(!this.privateKey)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return n.from(e.sign(t,this.privateKey));{let r=n.from(e.sign(t,this.privateKey));const i=n.alloc(32,0);let o=0;for(;r[0]>127;)o++,i.writeUIntLE(o,0,6),r=n.from(e.sign(t,this.privateKey,i));return r}}signSchnorr(t){if(!this.privateKey)throw new Error("Missing private key");if(!e.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return n.from(e.signSchnorr(t,this.privateKey))}verify(t,r){return e.verify(t,this.publicKey,r)}verifySchnorr(t,r){if(!e.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return e.verifySchnorr(t,this.publicKey.subarray(1,33),r)}}class y extends d{constructor(e,t,n,i,o=0,a=0,s=0){super(e,t),this.chainCode=n,this.network=i,this.__DEPTH=o,this.__INDEX=a,this.__PARENT_FINGERPRINT=s,u(r,i)}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get identifier(){return i.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return w(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,r=n.allocUnsafe(78);return r.writeUInt32BE(t,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),i=r,c.encode(Uint8Array.from(i));var i}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return f.encode(this.network.wif,this.privateKey,!0)}derive(t){u(u.UInt32,t);const r=t>=s,o=n.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");o[0]=0,this.privateKey.copy(o,1),o.writeUInt32BE(t,33)}else this.publicKey.copy(o,0),o.writeUInt32BE(t,33);const a=i.hmacSHA512(this.chainCode,o),f=a.slice(0,32),c=a.slice(32);if(!e.isPrivate(f))return this.derive(t+1);let l;if(this.isNeutered()){const r=n.from(e.pointAddScalar(this.publicKey,f,!0));if(null===r)return this.derive(t+1);l=w(r,c,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}else{const r=n.from(e.privateAdd(this.privateKey,f));if(null==r)return this.derive(t+1);l=g(r,c,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}return l}deriveHardened(e){return u(p,e),this.derive(e+s)}derivePath(e){u(h,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce(((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))}),this)}tweak(e){return this.privateKey?this.tweakFromPrivateKey(e):this.tweakFromPublicKey(e)}tweakFromPublicKey(t){const r=32===(i=this.publicKey).length?i:i.slice(1,33);var i;if(!e.xOnlyPointAddTweak)throw new Error("xOnlyPointAddTweak not supported by ecc library");const o=e.xOnlyPointAddTweak(r,t);if(!o||null===o.xOnlyPubkey)throw new Error("Cannot tweak public key!");const a=n.from([0===o.parity?2:3]),s=n.concat([a,o.xOnlyPubkey]);return new d(void 0,s)}tweakFromPrivateKey(t){const r=3===this.publicKey[0]||4===this.publicKey[0]&&!(1&~this.publicKey[64]),i=(()=>{if(r){if(e.privateNegate)return e.privateNegate(this.privateKey);throw new Error("privateNegate not supported by ecc library")}return this.privateKey})(),o=e.privateAdd(i,t);if(!o)throw new Error("Invalid tweaked private key!");return new d(n.from(o),void 0)}}function b(e,t,r){return g(e,t,r)}function g(r,n,i,o,s,f){if(u({privateKey:t,chainCode:t},{privateKey:r,chainCode:n}),i=i||a,!e.isPrivate(r))throw new TypeError("Private key not in range [1, n)");return new y(r,void 0,n,i,o,s,f)}function w(r,n,i,o,s,f){if(u({publicKey:u.BufferN(33),chainCode:t},{publicKey:r,chainCode:n}),i=i||a,!e.isPoint(r))throw new TypeError("Point is not on the curve");return new y(void 0,r,n,i,o,s,f)}return{fromSeed:function(e,t){if(u(u.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||a;const r=i.hmacSHA512(n.from("Bitcoin seed","utf8"),e);return b(r.slice(0,32),r.slice(32),t)},fromBase58:function(e,t){const r=(i=e,n.from(c.decode(i)));var i;if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||a;const o=r.readUInt32BE(0);if(o!==t.bip32.private&&o!==t.bip32.public)throw new TypeError("Invalid network version");const s=r[4],u=r.readUInt32BE(5);if(0===s&&0!==u)throw new TypeError("Invalid parent fingerprint");const f=r.readUInt32BE(9);if(0===s&&0!==f)throw new TypeError("Invalid index");const l=r.slice(13,45);let h;if(o===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");h=g(r.slice(46,78),l,t,s,f,u)}else h=w(r.slice(45,78),l,t,s,f,u);return h},fromPublicKey:function(e,t,r){return w(e,t,r)},fromPrivateKey:b}}},9571:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hmacSHA512=t.hash160=void 0;const i=r(9615),o=r(3238),a=r(2623),s=r(102);t.hash160=function(e){const t=(0,a.sha256)(Uint8Array.from(e));return n.from((0,o.ripemd160)(t))},t.hmacSHA512=function(e,t){return n.from((0,i.hmac)(s.sha512,e,t))}},852:(e,t,r)=>{t.Ay=void 0;var n=r(4642);Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return n.BIP32Factory}})},7757:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.testEcc=void 0;const i=e=>n.from(e,"hex");function o(e){if(!e)throw new Error("ecc library invalid")}t.testEcc=function(e){if(o(e.isPoint(i("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),o(!e.isPoint(i("030000000000000000000000000000000000000000000000000000000000000005"))),o(e.isPrivate(i("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),o(e.isPrivate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),o(!e.isPrivate(i("0000000000000000000000000000000000000000000000000000000000000000"))),o(!e.isPrivate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),o(!e.isPrivate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),o(n.from(e.pointFromScalar(i("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(i("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),e.xOnlyPointAddTweak){o(null===e.xOnlyPointAddTweak(i("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140")));let t=e.xOnlyPointAddTweak(i("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),i("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));o(n.from(t.xOnlyPubkey).equals(i("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&1===t.parity),t=e.xOnlyPointAddTweak(i("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),i("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47"))}o(n.from(e.pointAddScalar(i("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),i("0000000000000000000000000000000000000000000000000000000000000003"))).equals(i("02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"))),o(n.from(e.privateAdd(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),i("0000000000000000000000000000000000000000000000000000000000000002"))).equals(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),e.privateNegate&&(o(n.from(e.privateNegate(i("0000000000000000000000000000000000000000000000000000000000000001"))).equals(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),o(n.from(e.privateNegate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(i("0000000000000000000000000000000000000000000000000000000000000003"))),o(n.from(e.privateNegate(i("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(i("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792")))),o(n.from(e.sign(i("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(i("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),o(e.verify(i("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),i("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),i("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),e.signSchnorr&&o(n.from(e.signSchnorr(i("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),i("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),i("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(i("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),e.verifySchnorr&&o(e.verifySchnorr(i("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),i("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),i("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}},57:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toOutputScript=t.fromOutputScript=t.toBech32=t.toBase58Check=t.fromBech32=t.fromBase58Check=void 0;const i=r(622),o=r(885),a=r(7038),s=r(8116),u=r(2343),f=r(1889),c="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function l(e){const t=n.from(f.decode(e));if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function h(e){let t,r;try{t=u.bech32.decode(e)}catch(e){}if(t){if(r=t.words[0],0!==r)throw new TypeError(e+" uses wrong encoding")}else if(t=u.bech32m.decode(e),r=t.words[0],0===r)throw new TypeError(e+" uses wrong encoding");const i=u.bech32.fromWords(t.words.slice(1));return{version:r,prefix:t.prefix,data:n.from(i)}}function p(e,t,r){const n=u.bech32.toWords(e);return n.unshift(t),0===t?u.bech32.encode(r,n):u.bech32m.encode(r,n)}t.fromBase58Check=l,t.fromBech32=h,t.toBase58Check=function(e,t){(0,s.typeforce)((0,s.tuple)(s.Hash160bit,s.UInt8),arguments);const r=n.allocUnsafe(21);return r.writeUInt8(t,0),e.copy(r,1),f.encode(r)},t.toBech32=p,t.fromOutputScript=function(e,t){t=t||i.bitcoin;try{return o.p2pkh({output:e,network:t}).address}catch(e){}try{return o.p2sh({output:e,network:t}).address}catch(e){}try{return o.p2wpkh({output:e,network:t}).address}catch(e){}try{return o.p2wsh({output:e,network:t}).address}catch(e){}try{return o.p2tr({output:e,network:t}).address}catch(e){}try{return function(e,t){const r=e.slice(2);if(r.length<2||r.length>40)throw new TypeError("Invalid program length for segwit address");const n=e[0]-80;if(n<2||n>16)throw new TypeError("Invalid version for segwit address");if(e[1]!==r.length)throw new TypeError("Invalid script for segwit address");return console.warn(c),p(r,n,t.bech32)}(e,t)}catch(e){}throw new Error(a.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let r,n;t=t||i.bitcoin;try{r=l(e)}catch(e){}if(r){if(r.version===t.pubKeyHash)return o.p2pkh({hash:r.hash}).output;if(r.version===t.scriptHash)return o.p2sh({hash:r.hash}).output}else{try{n=h(e)}catch(e){}if(n){if(n.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===n.version){if(20===n.data.length)return o.p2wpkh({hash:n.data}).output;if(32===n.data.length)return o.p2wsh({hash:n.data}).output}else if(1===n.version){if(32===n.data.length)return o.p2tr({pubkey:n.data}).output}else if(n.version>=2&&n.version<=16&&n.data.length>=2&&n.data.length<=40)return console.warn(c),a.compile([n.version+80,n.data])}}throw new Error(e+" has no matching Script")}},3966:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=t.check=void 0,t.check=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;const t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;const r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))},t.decode=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");const t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");const r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},t.encode=function(e,t){const r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");const o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}},1696:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Block=void 0;const i=r(606),o=r(1944),a=r(1015),s=r(2021),u=r(8116),{typeforce:f}=u,c=new TypeError("Cannot compute merkle root for zero transactions"),l=new TypeError("Cannot compute witness commit for non-segwit block");class h{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");const t=new i.BufferReader(e),r=new h;if(r.version=t.readInt32(),r.prevHash=t.readSlice(32),r.merkleRoot=t.readSlice(32),r.timestamp=t.readUInt32(),r.bits=t.readUInt32(),r.nonce=t.readUInt32(),80===e.length)return r;const n=()=>{const e=s.Transaction.fromBuffer(t.buffer.slice(t.offset),!0);return t.offset+=e.byteLength(),e},o=t.readVarInt();r.transactions=[];for(let e=0;e<o;++e){const e=n();r.transactions.push(e)}const a=r.getWitnessCommit();return a&&(r.witnessCommit=a),r}static fromHex(e){return h.fromBuffer(n.from(e,"hex"))}static calculateTarget(e){const t=((4278190080&e)>>24)-3,r=8388607&e,i=n.alloc(32,0);return i.writeUIntBE(r,29-t,3),i}static calculateMerkleRoot(e,t){if(f([{getHash:u.Function}],e),0===e.length)throw c;if(t&&!p(e))throw l;const r=e.map((e=>e.getHash(t))),i=(0,a.fastMerkleRoot)(r,o.hash256);return t?o.hash256(n.concat([i,e[0].ins[0].witness[0]])):i}getWitnessCommit(){if(!p(this.transactions))return null;const e=this.transactions[0].outs.filter((e=>e.script.slice(0,6).equals(n.from("6a24aa21a9ed","hex")))).map((e=>e.script.slice(6,38)));if(0===e.length)return null;const t=e[e.length-1];return t instanceof n&&32===t.length?t:null}hasWitnessCommit(){return this.witnessCommit instanceof n&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(e=this.transactions)instanceof Array&&e.some((e=>"object"==typeof e&&e.ins instanceof Array&&e.ins.some((e=>"object"==typeof e&&e.witness instanceof Array&&e.witness.length>0))));var e}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(e,t=!0){return e||!this.transactions?80:80+i.varuint.encodingLength(this.transactions.length)+this.transactions.reduce(((e,r)=>e+r.byteLength(t)),0)}getHash(){return o.hash256(this.toBuffer(!0))}getId(){return(0,i.reverseBuffer)(this.getHash()).toString("hex")}getUTCDate(){const e=new Date(0);return e.setUTCSeconds(this.timestamp),e}toBuffer(e){const t=n.allocUnsafe(this.byteLength(e)),r=new i.BufferWriter(t);return r.writeInt32(this.version),r.writeSlice(this.prevHash),r.writeSlice(this.merkleRoot),r.writeUInt32(this.timestamp),r.writeUInt32(this.bits),r.writeUInt32(this.nonce),e||!this.transactions||(i.varuint.encode(this.transactions.length,t,r.offset),r.offset+=i.varuint.encode.bytes,this.transactions.forEach((e=>{const n=e.byteLength();e.toBuffer(t,r.offset),r.offset+=n}))),t}toHex(e){return this.toBuffer(e).toString("hex")}checkTxRoots(){const e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit())}checkProofOfWork(){const e=(0,i.reverseBuffer)(this.getHash()),t=h.calculateTarget(this.bits);return e.compare(t)<=0}__checkMerkleRoot(){if(!this.transactions)throw c;const e=h.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}__checkWitnessCommit(){if(!this.transactions)throw c;if(!this.hasWitnessCommit())throw l;const e=h.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}function p(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=h},606:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.BufferReader=t.BufferWriter=t.cloneBuffer=t.reverseBuffer=t.writeUInt64LE=t.readUInt64LE=t.varuint=void 0;const i=r(8116),{typeforce:o}=i,a=r(8469);function s(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function u(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,s(n+r,9007199254740991),n+r}function f(e,t,r){return s(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}t.varuint=a,t.readUInt64LE=u,t.writeUInt64LE=f,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(e){const t=n.allocUnsafe(e.length);return e.copy(t),t};class c{static withCapacity(e){return new c(n.alloc(e))}constructor(e,t=0){this.buffer=e,this.offset=t,o(i.tuple(i.Buffer,i.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=f(this.buffer,e,this.offset)}writeVarInt(e){a.encode(e,this.buffer,this.offset),this.offset+=a.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach((e=>this.writeVarSlice(e)))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`)}}t.BufferWriter=c,t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,o(i.tuple(i.Buffer,i.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=u(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=a.decode(this.buffer,this.offset);return this.offset+=a.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}},1944:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.taggedHash=t.TAGGED_HASH_PREFIXES=t.TAGS=t.hash256=t.hash160=t.sha256=t.sha1=t.ripemd160=void 0;const i=r(3238),o=r(1549),a=r(2623);function s(e){return n.from((0,a.sha256)(Uint8Array.from(e)))}t.ripemd160=function(e){return n.from((0,i.ripemd160)(Uint8Array.from(e)))},t.sha1=function(e){return n.from((0,o.sha1)(Uint8Array.from(e)))},t.sha256=s,t.hash160=function(e){return n.from((0,i.ripemd160)((0,a.sha256)(Uint8Array.from(e))))},t.hash256=function(e){return n.from((0,a.sha256)((0,a.sha256)(Uint8Array.from(e))))},t.TAGS=["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"],t.TAGGED_HASH_PREFIXES={"BIP0340/challenge":n.from([123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124,123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124]),"BIP0340/aux":n.from([241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144,241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144]),"BIP0340/nonce":n.from([7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47,7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47]),TapLeaf:n.from([174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238,174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238]),TapBranch:n.from([25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21,25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21]),TapSighash:n.from([244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49,244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49]),TapTweak:n.from([232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233,232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233]),"KeyAgg list":n.from([72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240,72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240]),"KeyAgg coefficient":n.from([191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129,191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129])},t.taggedHash=function(e,r){return s(n.concat([t.TAGGED_HASH_PREFIXES[e],r]))}},916:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getEccLib=t.initEccLib=void 0;const i={};t.initEccLib=function(e){var t;e?e!==i.eccLib&&(a("function"==typeof(t=e).isXOnlyPoint),a(t.isXOnlyPoint(o("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(t.isXOnlyPoint(o("fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e"))),a(t.isXOnlyPoint(o("f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"))),a(t.isXOnlyPoint(o("0000000000000000000000000000000000000000000000000000000000000001"))),a(!t.isXOnlyPoint(o("0000000000000000000000000000000000000000000000000000000000000000"))),a(!t.isXOnlyPoint(o("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"))),a("function"==typeof t.xOnlyPointAddTweak),s.forEach((e=>{const r=t.xOnlyPointAddTweak(o(e.pubkey),o(e.tweak));null===e.result?a(null===r):(a(null!==r),a(r.parity===e.parity),a(n.from(r.xOnlyPubkey).equals(o(e.result))))})),i.eccLib=e):i.eccLib=e},t.getEccLib=function(){if(!i.eccLib)throw new Error("No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance");return i.eccLib};const o=e=>n.from(e,"hex");function a(e){if(!e)throw new Error("ecc library invalid")}const s=[{pubkey:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",tweak:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",parity:-1,result:null},{pubkey:"1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b",tweak:"a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac",parity:1,result:"e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"},{pubkey:"2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991",tweak:"823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47",parity:0,result:"9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"}]},1757:(e,t,r)=>{t.f0=t.Ez=t.iL=t.K$=t.KT=t.o8=t.Et=t.hl=void 0;const n=r(57);t.hl=n;const i=r(1944);t.Et=i;const o=r(622);t.o8=o;const a=r(885);t.KT=a;const s=r(7038);t.K$=s;r(1696);var u=r(9646);Object.defineProperty(t,"iL",{enumerable:!0,get:function(){return u.Psbt}});var f=r(8417);Object.defineProperty(t,"Ez",{enumerable:!0,get:function(){return f.OPS}});r(2021);var c=r(916);Object.defineProperty(t,"f0",{enumerable:!0,get:function(){return c.initEccLib}})},1015:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.fastMerkleRoot=void 0,t.fastMerkleRoot=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");let r=e.length;const i=e.concat();for(;r>1;){let e=0;for(let o=0;o<r;o+=2,++e){const a=i[o],s=o+1===r?a:i[o+1],u=n.concat([a,s]);i[e]=t(u)}r=e}return i[0]}},622:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.testnet=t.regtest=t.bitcoin=void 0,t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},8417:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REVERSE_OPS=t.OPS=void 0;const r={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_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY: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};t.OPS=r;const n={};t.REVERSE_OPS=n;for(const e of Object.keys(r))n[r[e]]=e},2218:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tweakKey=t.tapTweakHash=t.tapleafHash=t.findScriptPath=t.toHashTree=t.rootHashFromPath=t.MAX_TAPTREE_DEPTH=t.LEAF_VERSION_TAPSCRIPT=void 0;const n=r(8287),i=r(916),o=r(1944),a=r(606),s=r(8116);function u(e){const r=e.version||t.LEAF_VERSION_TAPSCRIPT;return o.taggedHash("TapLeaf",n.Buffer.concat([n.Buffer.from([r]),l(e.output)]))}function f(e,t){return o.taggedHash("TapTweak",n.Buffer.concat(t?[e,t]:[e]))}function c(e,t){return o.taggedHash("TapBranch",n.Buffer.concat([e,t]))}function l(e){const t=a.varuint.encodingLength(e.length),r=n.Buffer.allocUnsafe(t);return a.varuint.encode(e.length,r),n.Buffer.concat([r,e])}t.LEAF_VERSION_TAPSCRIPT=192,t.MAX_TAPTREE_DEPTH=128,t.rootHashFromPath=function(e,t){if(e.length<33)throw new TypeError(`The control-block length is too small. Got ${e.length}, expected min 33.`);const r=(e.length-33)/32;let n=t;for(let t=0;t<r;t++){const r=e.slice(33+32*t,65+32*t);n=n.compare(r)<0?c(n,r):c(r,n)}return n},t.toHashTree=function e(t){if((0,s.isTapleaf)(t))return{hash:u(t)};const r=[e(t[0]),e(t[1])];r.sort(((e,t)=>e.hash.compare(t.hash)));const[n,i]=r;return{hash:c(n.hash,i.hash),left:n,right:i}},t.findScriptPath=function e(t,r){if("left"in(n=t)&&"right"in n){const n=e(t.left,r);if(void 0!==n)return[...n,t.right.hash];const i=e(t.right,r);if(void 0!==i)return[...i,t.left.hash]}else if(t.hash.equals(r))return[];var n},t.tapleafHash=u,t.tapTweakHash=f,t.tweakKey=function(e,t){if(!n.Buffer.isBuffer(e))return null;if(32!==e.length)return null;if(t&&32!==t.length)return null;const r=f(e,t),o=(0,i.getEccLib)().xOnlyPointAddTweak(e,r);return o&&null!==o.xOnlyPubkey?{parity:o.parity,x:n.Buffer.from(o.xOnlyPubkey)}:null}},5472:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p2data=void 0;const n=r(622),i=r(7038),o=r(8116),a=r(7883),s=i.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),output:o.typeforce.maybe(o.typeforce.Buffer),data:o.typeforce.maybe(o.typeforce.arrayOf(o.typeforce.Buffer))},e);const r={name:"embed",network:e.network||n.bitcoin};if(a.prop(r,"output",(()=>{if(e.data)return i.compile([s.OP_RETURN].concat(e.data))})),a.prop(r,"data",(()=>{if(e.output)return i.decompile(e.output).slice(1)})),t.validate&&e.output){const t=i.decompile(e.output);if(t[0]!==s.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(o.typeforce.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}},885:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p2tr=t.p2wsh=t.p2wpkh=t.p2sh=t.p2pkh=t.p2pk=t.p2ms=t.embed=void 0;const n=r(5472);Object.defineProperty(t,"embed",{enumerable:!0,get:function(){return n.p2data}});const i=r(1395);Object.defineProperty(t,"p2ms",{enumerable:!0,get:function(){return i.p2ms}});const o=r(4930);Object.defineProperty(t,"p2pk",{enumerable:!0,get:function(){return o.p2pk}});const a=r(3504);Object.defineProperty(t,"p2pkh",{enumerable:!0,get:function(){return a.p2pkh}});const s=r(8368);Object.defineProperty(t,"p2sh",{enumerable:!0,get:function(){return s.p2sh}});const u=r(7027);Object.defineProperty(t,"p2wpkh",{enumerable:!0,get:function(){return u.p2wpkh}});const f=r(9041);Object.defineProperty(t,"p2wsh",{enumerable:!0,get:function(){return f.p2wsh}});const c=r(5501);Object.defineProperty(t,"p2tr",{enumerable:!0,get:function(){return c.p2tr}})},7883:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.value=t.prop=void 0,t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}},1395:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p2ms=void 0;const n=r(622),i=r(7038),o=r(8116),a=r(7883),s=i.OPS,u=s.OP_RESERVED;function f(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function r(e){return i.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===s.OP_0)}t=Object.assign({validate:!0},t||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),m:o.typeforce.maybe(o.typeforce.Number),n:o.typeforce.maybe(o.typeforce.Number),output:o.typeforce.maybe(o.typeforce.Buffer),pubkeys:o.typeforce.maybe(o.typeforce.arrayOf(o.isPoint)),signatures:o.typeforce.maybe(o.typeforce.arrayOf(r)),input:o.typeforce.maybe(o.typeforce.Buffer)},e);const c={network:e.network||n.bitcoin};let l=[],h=!1;function p(e){h||(h=!0,l=i.decompile(e),c.m=l[0]-u,c.n=l[l.length-2]-u,c.pubkeys=l.slice(1,-2))}if(a.prop(c,"output",(()=>{if(e.m&&c.n&&e.pubkeys)return i.compile([].concat(u+e.m,e.pubkeys,u+c.n,s.OP_CHECKMULTISIG))})),a.prop(c,"m",(()=>{if(c.output)return p(c.output),c.m})),a.prop(c,"n",(()=>{if(c.pubkeys)return c.pubkeys.length})),a.prop(c,"pubkeys",(()=>{if(e.output)return p(e.output),c.pubkeys})),a.prop(c,"signatures",(()=>{if(e.input)return i.decompile(e.input).slice(1)})),a.prop(c,"input",(()=>{if(e.signatures)return i.compile([s.OP_0].concat(e.signatures))})),a.prop(c,"witness",(()=>{if(c.input)return[]})),a.prop(c,"name",(()=>{if(c.m&&c.n)return`p2ms(${c.m} of ${c.n})`})),t.validate){if(e.output){if(p(e.output),!o.typeforce.Number(l[0]))throw new TypeError("Output is invalid");if(!o.typeforce.Number(l[l.length-2]))throw new TypeError("Output is invalid");if(l[l.length-1]!==s.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(c.m<=0||c.n>16||c.m>c.n||c.n!==l.length-3)throw new TypeError("Output is invalid");if(!c.pubkeys.every((e=>(0,o.isPoint)(e))))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==c.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==c.n)throw new TypeError("n mismatch");if(e.pubkeys&&!f(e.pubkeys,c.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(c.n=e.pubkeys.length,c.n<c.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<c.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>c.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==s.OP_0)throw new TypeError("Input is invalid");if(0===c.signatures.length||!c.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!f(e.signatures,c.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(c,e)}},4930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p2pk=void 0;const n=r(622),i=r(7038),o=r(8116),a=r(7883),s=i.OPS;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),output:o.typeforce.maybe(o.typeforce.Buffer),pubkey:o.typeforce.maybe(o.isPoint),signature:o.typeforce.maybe(i.isCanonicalScriptSignature),input:o.typeforce.maybe(o.typeforce.Buffer)},e);const r=a.value((()=>i.decompile(e.input))),u={name:"p2pk",network:e.network||n.bitcoin};if(a.prop(u,"output",(()=>{if(e.pubkey)return i.compile([e.pubkey,s.OP_CHECKSIG])})),a.prop(u,"pubkey",(()=>{if(e.output)return e.output.slice(1,-1)})),a.prop(u,"signature",(()=>{if(e.input)return r()[0]})),a.prop(u,"input",(()=>{if(e.signature)return i.compile([e.signature])})),a.prop(u,"witness",(()=>{if(u.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==s.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,o.isPoint)(u.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(u.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(u.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!i.isCanonicalScriptSignature(u.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(u,e)}},3504:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2pkh=void 0;const i=r(1944),o=r(622),a=r(7038),s=r(8116),u=r(7883),f=r(1889),c=a.OPS;t.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,s.typeforce)({network:s.typeforce.maybe(s.typeforce.Object),address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(20)),output:s.typeforce.maybe(s.typeforce.BufferN(25)),pubkey:s.typeforce.maybe(s.isPoint),signature:s.typeforce.maybe(a.isCanonicalScriptSignature),input:s.typeforce.maybe(s.typeforce.Buffer)},e);const r=u.value((()=>{const t=n.from(f.decode(e.address));return{version:t.readUInt8(0),hash:t.slice(1)}})),l=u.value((()=>a.decompile(e.input))),h=e.network||o.bitcoin,p={name:"p2pkh",network:h};if(u.prop(p,"address",(()=>{if(!p.hash)return;const e=n.allocUnsafe(21);return e.writeUInt8(h.pubKeyHash,0),p.hash.copy(e,1),f.encode(e)})),u.prop(p,"hash",(()=>e.output?e.output.slice(3,23):e.address?r().hash:e.pubkey||p.pubkey?i.hash160(e.pubkey||p.pubkey):void 0)),u.prop(p,"output",(()=>{if(p.hash)return a.compile([c.OP_DUP,c.OP_HASH160,p.hash,c.OP_EQUALVERIFY,c.OP_CHECKSIG])})),u.prop(p,"pubkey",(()=>{if(e.input)return l()[1]})),u.prop(p,"signature",(()=>{if(e.input)return l()[0]})),u.prop(p,"input",(()=>{if(e.pubkey&&e.signature)return a.compile([e.signature,e.pubkey])})),u.prop(p,"witness",(()=>{if(p.input)return[]})),t.validate){let t=n.from([]);if(e.address){if(r().version!==h.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==r().hash.length)throw new TypeError("Invalid address");t=r().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==c.OP_DUP||e.output[1]!==c.OP_HASH160||20!==e.output[2]||e.output[23]!==c.OP_EQUALVERIFY||e.output[24]!==c.OP_CHECKSIG)throw new TypeError("Output is invalid");const r=e.output.slice(3,23);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.pubkey){const r=i.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.input){const r=l();if(2!==r.length)throw new TypeError("Input is invalid");if(!a.isCanonicalScriptSignature(r[0]))throw new TypeError("Input has invalid signature");if(!(0,s.isPoint)(r[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(r[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(r[1]))throw new TypeError("Pubkey mismatch");const n=i.hash160(r[1]);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch")}}return Object.assign(p,e)}},8368:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2sh=void 0;const i=r(1944),o=r(622),a=r(7038),s=r(8116),u=r(7883),f=r(1889),c=a.OPS;t.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,s.typeforce)({network:s.typeforce.maybe(s.typeforce.Object),address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(20)),output:s.typeforce.maybe(s.typeforce.BufferN(23)),redeem:s.typeforce.maybe({network:s.typeforce.maybe(s.typeforce.Object),output:s.typeforce.maybe(s.typeforce.Buffer),input:s.typeforce.maybe(s.typeforce.Buffer),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))}),input:s.typeforce.maybe(s.typeforce.Buffer),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))},e);let r=e.network;r||(r=e.redeem&&e.redeem.network||o.bitcoin);const l={network:r},h=u.value((()=>{const t=n.from(f.decode(e.address));return{version:t.readUInt8(0),hash:t.slice(1)}})),p=u.value((()=>a.decompile(e.input))),d=u.value((()=>{const t=p(),i=t[t.length-1];return{network:r,output:i===c.OP_FALSE?n.from([]):i,input:a.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(u.prop(l,"address",(()=>{if(!l.hash)return;const e=n.allocUnsafe(21);return e.writeUInt8(l.network.scriptHash,0),l.hash.copy(e,1),f.encode(e)})),u.prop(l,"hash",(()=>e.output?e.output.slice(2,22):e.address?h().hash:l.redeem&&l.redeem.output?i.hash160(l.redeem.output):void 0)),u.prop(l,"output",(()=>{if(l.hash)return a.compile([c.OP_HASH160,l.hash,c.OP_EQUAL])})),u.prop(l,"redeem",(()=>{if(e.input)return d()})),u.prop(l,"input",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.output)return a.compile([].concat(a.decompile(e.redeem.input),e.redeem.output))})),u.prop(l,"witness",(()=>l.redeem&&l.redeem.witness?l.redeem.witness:l.input?[]:void 0)),u.prop(l,"name",(()=>{const e=["p2sh"];return void 0!==l.redeem&&void 0!==l.redeem.name&&e.push(l.redeem.name),e.join("-")})),t.validate){let t=n.from([]);if(e.address){if(h().version!==r.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==h().hash.length)throw new TypeError("Invalid address");t=h().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==c.OP_HASH160||20!==e.output[1]||e.output[22]!==c.OP_EQUAL)throw new TypeError("Output is invalid");const r=e.output.slice(2,22);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}const o=e=>{if(e.output){const r=a.decompile(e.output);if(!r||r.length<1)throw new TypeError("Redeem.output too short");if(e.output.byteLength>520)throw new TypeError("Redeem.output unspendable if larger than 520 bytes");if(a.countNonPushOnlyOPs(r)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const n=i.hash160(e.output);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=a.decompile(e.input);if(!a.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(e.input){const e=p();if(!e||e.length<1)throw new TypeError("Input too short");if(!n.isBuffer(d().output))throw new TypeError("Input is invalid");o(d())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==r)throw new TypeError("Network mismatch");if(e.input){const t=d();if(e.redeem.output&&!e.redeem.output.equals(t.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(t.input))throw new TypeError("Redeem.input mismatch")}o(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(l,e)}},5501:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p2tr=void 0;const n=r(8287),i=r(622),o=r(7038),a=r(8116),s=r(916),u=r(2218),f=r(7883),c=r(2343),l=o.OPS;t.p2tr=function(e,t){if(!(e.address||e.output||e.pubkey||e.internalPubkey||e.witness&&e.witness.length>1))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,a.typeforce)({address:a.typeforce.maybe(a.typeforce.String),input:a.typeforce.maybe(a.typeforce.BufferN(0)),network:a.typeforce.maybe(a.typeforce.Object),output:a.typeforce.maybe(a.typeforce.BufferN(34)),internalPubkey:a.typeforce.maybe(a.typeforce.BufferN(32)),hash:a.typeforce.maybe(a.typeforce.BufferN(32)),pubkey:a.typeforce.maybe(a.typeforce.BufferN(32)),signature:a.typeforce.maybe(a.typeforce.anyOf(a.typeforce.BufferN(64),a.typeforce.BufferN(65))),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer)),scriptTree:a.typeforce.maybe(a.isTaptree),redeem:a.typeforce.maybe({output:a.typeforce.maybe(a.typeforce.Buffer),redeemVersion:a.typeforce.maybe(a.typeforce.Number),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))}),redeemVersion:a.typeforce.maybe(a.typeforce.Number)},e);const r=f.value((()=>{const t=c.bech32m.decode(e.address),r=t.words.shift(),i=c.bech32m.fromWords(t.words);return{version:r,prefix:t.prefix,data:n.Buffer.from(i)}})),h=f.value((()=>{if(e.witness&&e.witness.length)return e.witness.length>=2&&80===e.witness[e.witness.length-1][0]?e.witness.slice(0,-1):e.witness.slice()})),p=f.value((()=>e.scriptTree?(0,u.toHashTree)(e.scriptTree):e.hash?{hash:e.hash}:void 0)),d=e.network||i.bitcoin,y={name:"p2tr",network:d};if(f.prop(y,"address",(()=>{if(!y.pubkey)return;const e=c.bech32m.toWords(y.pubkey);return e.unshift(1),c.bech32m.encode(d.bech32,e)})),f.prop(y,"hash",(()=>{const e=p();if(e)return e.hash;const t=h();if(t&&t.length>1){const e=t[t.length-1],r=e[0]&a.TAPLEAF_VERSION_MASK,n=t[t.length-2],i=(0,u.tapleafHash)({output:n,version:r});return(0,u.rootHashFromPath)(e,i)}return null})),f.prop(y,"output",(()=>{if(y.pubkey)return o.compile([l.OP_1,y.pubkey])})),f.prop(y,"redeemVersion",(()=>e.redeemVersion?e.redeemVersion:e.redeem&&void 0!==e.redeem.redeemVersion&&null!==e.redeem.redeemVersion?e.redeem.redeemVersion:u.LEAF_VERSION_TAPSCRIPT)),f.prop(y,"redeem",(()=>{const e=h();if(e&&!(e.length<2))return{output:e[e.length-2],witness:e.slice(0,-2),redeemVersion:e[e.length-1][0]&a.TAPLEAF_VERSION_MASK}})),f.prop(y,"pubkey",(()=>{if(e.pubkey)return e.pubkey;if(e.output)return e.output.slice(2);if(e.address)return r().data;if(y.internalPubkey){const e=(0,u.tweakKey)(y.internalPubkey,y.hash);if(e)return e.x}})),f.prop(y,"internalPubkey",(()=>{if(e.internalPubkey)return e.internalPubkey;const t=h();return t&&t.length>1?t[t.length-1].slice(1,33):void 0})),f.prop(y,"signature",(()=>{if(e.signature)return e.signature;const t=h();return t&&1===t.length?t[0]:void 0})),f.prop(y,"witness",(()=>{if(e.witness)return e.witness;const t=p();if(t&&e.redeem&&e.redeem.output&&e.internalPubkey){const r=(0,u.tapleafHash)({output:e.redeem.output,version:y.redeemVersion}),i=(0,u.findScriptPath)(t,r);if(!i)return;const o=(0,u.tweakKey)(e.internalPubkey,t.hash);if(!o)return;const a=n.Buffer.concat([n.Buffer.from([y.redeemVersion|o.parity]),e.internalPubkey].concat(i));return[e.redeem.output,a]}return e.signature?[e.signature]:void 0})),t.validate){let t=n.Buffer.from([]);if(e.address){if(d&&d.bech32!==r().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(1!==r().version)throw new TypeError("Invalid address version");if(32!==r().data.length)throw new TypeError("Invalid address data");t=r().data}if(e.pubkey){if(t.length>0&&!t.equals(e.pubkey))throw new TypeError("Pubkey mismatch");t=e.pubkey}if(e.output){if(34!==e.output.length||e.output[0]!==l.OP_1||32!==e.output[1])throw new TypeError("Output is invalid");if(t.length>0&&!t.equals(e.output.slice(2)))throw new TypeError("Pubkey mismatch");t=e.output.slice(2)}if(e.internalPubkey){const r=(0,u.tweakKey)(e.internalPubkey,y.hash);if(t.length>0&&!t.equals(r.x))throw new TypeError("Pubkey mismatch");t=r.x}if(t&&t.length&&!(0,s.getEccLib)().isXOnlyPoint(t))throw new TypeError("Invalid pubkey for p2tr");const i=p();if(e.hash&&i&&!e.hash.equals(i.hash))throw new TypeError("Hash mismatch");if(e.redeem&&e.redeem.output&&i){const t=(0,u.tapleafHash)({output:e.redeem.output,version:y.redeemVersion});if(!(0,u.findScriptPath)(i,t))throw new TypeError("Redeem script not in tree")}const f=h();if(e.redeem&&y.redeem){if(e.redeem.redeemVersion&&e.redeem.redeemVersion!==y.redeem.redeemVersion)throw new TypeError("Redeem.redeemVersion and witness mismatch");if(e.redeem.output){if(0===o.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");if(y.redeem.output&&!e.redeem.output.equals(y.redeem.output))throw new TypeError("Redeem.output and witness mismatch")}if(e.redeem.witness&&y.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.redeem.witness,y.redeem.witness))throw new TypeError("Redeem.witness and witness mismatch")}if(f&&f.length)if(1===f.length){if(e.signature&&!e.signature.equals(f[0]))throw new TypeError("Signature mismatch")}else{const r=f[f.length-1];if(r.length<33)throw new TypeError(`The control-block length is too small. Got ${r.length}, expected min 33.`);if((r.length-33)%32!=0)throw new TypeError(`The control-block length of ${r.length} is incorrect!`);const n=(r.length-33)/32;if(n>128)throw new TypeError(`The script path is too long. Got ${n}, expected max 128.`);const i=r.slice(1,33);if(e.internalPubkey&&!e.internalPubkey.equals(i))throw new TypeError("Internal pubkey mismatch");if(!(0,s.getEccLib)().isXOnlyPoint(i))throw new TypeError("Invalid internalPubkey for p2tr witness");const o=r[0]&a.TAPLEAF_VERSION_MASK,c=f[f.length-2],l=(0,u.tapleafHash)({output:c,version:o}),h=(0,u.rootHashFromPath)(r,l),p=(0,u.tweakKey)(i,h);if(!p)throw new TypeError("Invalid outputKey for p2tr witness");if(t.length&&!t.equals(p.x))throw new TypeError("Pubkey mismatch for p2tr witness");if(p.parity!==(1&r[0]))throw new Error("Incorrect parity")}}return Object.assign(y,e)}},7027:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2wpkh=void 0;const i=r(1944),o=r(622),a=r(7038),s=r(8116),u=r(7883),f=r(2343),c=a.OPS,l=n.alloc(0);t.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,s.typeforce)({address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(20)),input:s.typeforce.maybe(s.typeforce.BufferN(0)),network:s.typeforce.maybe(s.typeforce.Object),output:s.typeforce.maybe(s.typeforce.BufferN(22)),pubkey:s.typeforce.maybe(s.isPoint),signature:s.typeforce.maybe(a.isCanonicalScriptSignature),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))},e);const r=u.value((()=>{const t=f.bech32.decode(e.address),r=t.words.shift(),i=f.bech32.fromWords(t.words);return{version:r,prefix:t.prefix,data:n.from(i)}})),h=e.network||o.bitcoin,p={name:"p2wpkh",network:h};if(u.prop(p,"address",(()=>{if(!p.hash)return;const e=f.bech32.toWords(p.hash);return e.unshift(0),f.bech32.encode(h.bech32,e)})),u.prop(p,"hash",(()=>e.output?e.output.slice(2,22):e.address?r().data:e.pubkey||p.pubkey?i.hash160(e.pubkey||p.pubkey):void 0)),u.prop(p,"output",(()=>{if(p.hash)return a.compile([c.OP_0,p.hash])})),u.prop(p,"pubkey",(()=>e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0)),u.prop(p,"signature",(()=>{if(e.witness)return e.witness[0]})),u.prop(p,"input",(()=>{if(p.witness)return l})),u.prop(p,"witness",(()=>{if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){let t=n.from([]);if(e.address){if(h&&h.bech32!==r().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==r().version)throw new TypeError("Invalid address version");if(20!==r().data.length)throw new TypeError("Invalid address data");t=r().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==c.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(t.length>0&&!t.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");t=e.output.slice(2)}if(e.pubkey){const r=i.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");if(t=r,!(0,s.isPoint)(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!a.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,s.isPoint)(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");const r=i.hash160(e.witness[1]);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(p,e)}},9041:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2wsh=void 0;const i=r(1944),o=r(622),a=r(7038),s=r(8116),u=r(7883),f=r(2343),c=a.OPS,l=n.alloc(0);function h(e){return!(!n.isBuffer(e)||65!==e.length||4!==e[0]||!(0,s.isPoint)(e))}t.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,s.typeforce)({network:s.typeforce.maybe(s.typeforce.Object),address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(32)),output:s.typeforce.maybe(s.typeforce.BufferN(34)),redeem:s.typeforce.maybe({input:s.typeforce.maybe(s.typeforce.Buffer),network:s.typeforce.maybe(s.typeforce.Object),output:s.typeforce.maybe(s.typeforce.Buffer),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))}),input:s.typeforce.maybe(s.typeforce.BufferN(0)),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))},e);const r=u.value((()=>{const t=f.bech32.decode(e.address),r=t.words.shift(),i=f.bech32.fromWords(t.words);return{version:r,prefix:t.prefix,data:n.from(i)}})),p=u.value((()=>a.decompile(e.redeem.input)));let d=e.network;d||(d=e.redeem&&e.redeem.network||o.bitcoin);const y={network:d};if(u.prop(y,"address",(()=>{if(!y.hash)return;const e=f.bech32.toWords(y.hash);return e.unshift(0),f.bech32.encode(d.bech32,e)})),u.prop(y,"hash",(()=>e.output?e.output.slice(2):e.address?r().data:y.redeem&&y.redeem.output?i.sha256(y.redeem.output):void 0)),u.prop(y,"output",(()=>{if(y.hash)return a.compile([c.OP_0,y.hash])})),u.prop(y,"redeem",(()=>{if(e.witness)return{output:e.witness[e.witness.length-1],input:l,witness:e.witness.slice(0,-1)}})),u.prop(y,"input",(()=>{if(y.witness)return l})),u.prop(y,"witness",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){const t=a.toStack(p());return y.redeem=Object.assign({witness:t},e.redeem),y.redeem.input=l,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),u.prop(y,"name",(()=>{const e=["p2wsh"];return void 0!==y.redeem&&void 0!==y.redeem.name&&e.push(y.redeem.name),e.join("-")})),t.validate){let t=n.from([]);if(e.address){if(r().prefix!==d.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==r().version)throw new TypeError("Invalid address version");if(32!==r().data.length)throw new TypeError("Invalid address data");t=r().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==c.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");const r=e.output.slice(2);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.redeem){if(e.redeem.network&&e.redeem.network!==d)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){const r=a.decompile(e.redeem.output);if(!r||r.length<1)throw new TypeError("Redeem.output is invalid");if(e.redeem.output.byteLength>3600)throw new TypeError("Redeem.output unspendable if larger than 3600 bytes");if(a.countNonPushOnlyOPs(r)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const n=i.sha256(e.redeem.output);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.redeem.input&&!a.isPushOnly(p()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&p().some(h)||e.redeem.output&&(a.decompile(e.redeem.output)||[]).some(h))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){const t=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(t))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(h)||(a.decompile(t)||[]).some(h))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(y,e)}},9646:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Psbt=void 0;const i=r(1614),o=r(394),a=r(5080),s=r(57),u=r(606),f=r(622),c=r(885),l=r(2218),h=r(7038),p=r(2021),d=r(477),y=r(4929),b={network:f.bitcoin,maximumFeeRate:5e3};class g{static fromBase64(e,t={}){const r=n.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t={}){const r=n.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t={}){const r=i.Psbt.fromBuffer(e,w),n=new g(t,r);var o,a;return o=n.__CACHE.__TX,a=n.__CACHE,o.ins.forEach((e=>{A(a,e)})),n}constructor(e={},t=new i.Psbt(new v)){this.data=t,this.opts=Object.assign({},b,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const r=(e,t,r,n)=>Object.defineProperty(e,t,{enumerable:r,writable:n});r(this,"__CACHE",!1,!0),r(this,"opts",!1,!0)}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(e){this.setVersion(e)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(e){this.setLocktime(e)}get txInputs(){return this.__CACHE.__TX.ins.map((e=>({hash:(0,u.cloneBuffer)(e.hash),index:e.index,sequence:e.sequence})))}get txOutputs(){return this.__CACHE.__TX.outs.map((e=>{let t;try{t=(0,s.fromOutputScript)(e.script,this.opts.network)}catch(e){}return{script:(0,u.cloneBuffer)(e.script),value:e.value,address:t}}))}combine(...e){return this.data.combine(...e.map((e=>e.data))),this}clone(){const e=g.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}setMaximumFeeRate(e){k(e),this.opts.maximumFeeRate=e}setVersion(e){k(e),T(this.data.inputs,"setVersion");const t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}setLocktime(e){k(e),T(this.data.inputs,"setLocktime");const t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}setInputSequence(e,t){k(t),T(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}addInputs(e){return e.forEach((e=>this.addInput(e))),this}addInput(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");(0,d.checkTaprootInputFields)(e,e,"addInput"),T(this.data.inputs,"addInput"),e.witnessScript&&$(e.witnessScript);const t=this.__CACHE;this.data.addInput(e),A(t,t.__TX.ins[t.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&H(this.__CACHE,n,r),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}addOutputs(e){return e.forEach((e=>this.addOutput(e))),this}addOutput(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");T(this.data.inputs,"addOutput");const{address:t}=e;if("string"==typeof t){const{network:r}=this.opts,n=(0,s.toOutputScript)(t,r);e=Object.assign(e,{script:n})}(0,d.checkTaprootOutputFields)(e,e,"addOutput");const r=this.__CACHE;return this.data.addOutput(e),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(e){if(!this.data.inputs.every(E))throw new Error("Not finalized");const t=this.__CACHE;if(e||function(e,t,r){const n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in fees, which is ${n} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;const r=t.__TX.clone();return K(this.data.inputs,r,t,!0),r}getFeeRate(){return R("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return R("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return(0,a.checkForInput)(this.data.inputs,0),Z(this.data.inputs.length).forEach((e=>this.finalizeInput(e))),this}finalizeInput(e,t){const r=(0,a.checkForInput)(this.data.inputs,e);return(0,d.isTaprootInput)(r)?this._finalizeTaprootInput(e,r,void 0,t):this._finalizeInput(e,r,t)}finalizeTaprootInput(e,t,r=d.tapScriptFinalizer){const n=(0,a.checkForInput)(this.data.inputs,e);if((0,d.isTaprootInput)(n))return this._finalizeTaprootInput(e,n,t,r);throw new Error(`Cannot finalize input #${e}. Not Taproot.`)}_finalizeInput(e,t,r=B){const{script:n,isP2SH:i,isP2WSH:o,isSegwit:a}=function(e,t,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){const o=W(r,t,e),a=n.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);return(t.witnessScript||(0,y.isP2WPKH)(i.script))&&(i.isSegwit=!0),i}(e,t,this.__CACHE);if(!n)throw new Error(`No script found for input #${e}`);!function(e){if(!e.sighashType||!e.partialSig)return;const{partialSig:t,sighashType:r}=e;t.forEach((e=>{const{hashType:t}=h.signature.decode(e.signature);if(r!==t)throw new Error("Signature sighash does not match input sighash type")}))}(t);const{finalScriptSig:s,finalScriptWitness:u}=r(e,t,n,a,i,o);if(s&&this.data.updateInput(e,{finalScriptSig:s}),u&&this.data.updateInput(e,{finalScriptWitness:u}),!s&&!u)throw new Error(`Unknown error finalizing input #${e}`);return this.data.clearFinalizedInput(e),this}_finalizeTaprootInput(e,t,r,n=d.tapScriptFinalizer){if(!t.witnessUtxo)throw new Error(`Cannot finalize input #${e}. Missing withness utxo.`);if(t.tapKeySig){const r=c.p2tr({output:t.witnessUtxo.script,signature:t.tapKeySig}),n=(0,y.witnessStackToScriptWitness)(r.witness);this.data.updateInput(e,{finalScriptWitness:n})}else{const{finalScriptWitness:i}=n(e,t,r);this.data.updateInput(e,{finalScriptWitness:i})}return this.data.clearFinalizedInput(e),this}getInputType(e){const t=(0,a.checkForInput)(this.data.inputs,e),r=q(V(e,t,this.__CACHE),e,"input",t.redeemScript||function(e){if(!e)return;const t=h.decompile(e);if(!t)return;const r=t[t.length-1];var i;if(n.isBuffer(r)&&!z(r)&&(i=r,!h.isCanonicalScriptSignature(i))&&h.decompile(r))return r}(t.finalScriptSig),t.witnessScript||function(e){if(!e)return;const t=D(e),r=t[t.length-1];return!z(r)&&h.decompile(r)?r:void 0}(t.finalScriptWitness));return("raw"===r.type?"":r.type+"-")+X(r.meaningfulScript)}inputHasPubkey(e,t){return function(e,t,r,n){const i=V(r,t,n),{meaningfulScript:o}=q(i,r,"input",t.redeemScript,t.witnessScript);return(0,y.pubkeyInScript)(e,o)}(t,(0,a.checkForInput)(this.data.inputs,e),e,this.__CACHE)}inputHasHDKey(e,t){const r=(0,a.checkForInput)(this.data.inputs,e),n=S(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(e,t){return function(e,t,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=q(i,r,"output",t.redeemScript,t.witnessScript);return(0,y.pubkeyInScript)(e,o)}(t,(0,a.checkForOutput)(this.data.outputs,e),e,this.__CACHE)}outputHasHDKey(e,t){const r=(0,a.checkForOutput)(this.data.outputs,e),n=S(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(e){return(0,a.checkForInput)(this.data.inputs,0),Z(this.data.inputs.length).map((t=>this.validateSignaturesOfInput(t,e))).reduce(((e,t)=>!0===t&&e),!0)}validateSignaturesOfInput(e,t,r){const n=this.data.inputs[e];return(0,d.isTaprootInput)(n)?this.validateSignaturesOfTaprootInput(e,t,r):this._validateSignaturesOfInput(e,t,r)}_validateSignaturesOfInput(e,t,r){const n=this.data.inputs[e],i=(n||{}).partialSig;if(!n||!i||i.length<1)throw new Error("No signatures to validate");if("function"!=typeof t)throw new Error("Need validator function to validate signatures");const o=r?i.filter((e=>e.pubkey.equals(r))):i;if(o.length<1)throw new Error("No signatures for this pubkey");const a=[];let s,u,f;for(const r of o){const i=h.signature.decode(r.signature),{hash:o,script:c}=f!==i.hashType?L(e,Object.assign({},n,{sighashType:i.hashType}),this.__CACHE,!0):{hash:s,script:u};f=i.hashType,s=o,u=c,O(r.pubkey,c,"verify"),a.push(t(r.pubkey,o,i.signature))}return a.every((e=>!0===e))}validateSignaturesOfTaprootInput(e,t,r){const n=this.data.inputs[e],i=(n||{}).tapKeySig,o=(n||{}).tapScriptSig;if(!n&&!i&&(!o||o.length))throw new Error("No signatures to validate");if("function"!=typeof t)throw new Error("Need validator function to validate signatures");const a=(r=r&&(0,d.toXOnly)(r))?C(e,n,this.data.inputs,r,this.__CACHE):function(e,t,r,n){const i=[];if(t.tapInternalKey){const r=U(e,t,n);r&&i.push(r)}if(t.tapScriptSig){const e=t.tapScriptSig.map((e=>e.pubkey));i.push(...e)}return i.map((i=>C(e,t,r,i,n))).flat()}(e,n,this.data.inputs,this.__CACHE);if(!a.length)throw new Error("No signatures for this pubkey");const s=a.find((e=>!e.leafHash));let u=0;if(i&&s){if(!t(s.pubkey,s.hash,j(i)))return!1;u++}if(o)for(const e of o){const r=a.find((t=>e.pubkey.equals(t.pubkey)));if(r){if(!t(e.pubkey,r.hash,j(e.signature)))return!1;u++}}return u>0}signAllInputsHD(e,t=[p.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of Z(this.data.inputs.length))try{this.signInputHD(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every((e=>!1===e)))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(e,t=[p.Transaction.SIGHASH_ALL]){return new Promise(((r,n)=>{if(!e||!e.publicKey||!e.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of Z(this.data.inputs.length))o.push(this.signInputHDAsync(r,e,t).then((()=>{i.push(!0)}),(()=>{i.push(!1)})));return Promise.all(o).then((()=>{if(i.every((e=>!1===e)))return n(new Error("No inputs were signed"));r()}))}))}signInputHD(e,t,r=[p.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return F(e,this.data.inputs,t).forEach((t=>this.signInput(e,t,r))),this}signInputHDAsync(e,t,r=[p.Transaction.SIGHASH_ALL]){return new Promise(((n,i)=>{if(!t||!t.publicKey||!t.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=F(e,this.data.inputs,t).map((t=>this.signInputAsync(e,t,r)));return Promise.all(o).then((()=>{n()})).catch(i)}))}signAllInputs(e,t){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of Z(this.data.inputs.length))try{this.signInput(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every((e=>!1===e)))throw new Error("No inputs were signed");return this}signAllInputsAsync(e,t){return new Promise(((r,n)=>{if(!e||!e.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,e,t).then((()=>{i.push(!0)}),(()=>{i.push(!1)})));return Promise.all(o).then((()=>{if(i.every((e=>!1===e)))return n(new Error("No inputs were signed"));r()}))}))}signInput(e,t,r){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const n=(0,a.checkForInput)(this.data.inputs,e);return(0,d.isTaprootInput)(n)?this._signTaprootInput(e,n,t,void 0,r):this._signInput(e,t,r)}signTaprootInput(e,t,r,n){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const i=(0,a.checkForInput)(this.data.inputs,e);if((0,d.isTaprootInput)(i))return this._signTaprootInput(e,i,t,r,n);throw new Error(`Input #${e} is not of type Taproot.`)}_signInput(e,t,r=[p.Transaction.SIGHASH_ALL]){const{hash:n,sighashType:i}=N(this.data.inputs,e,t.publicKey,this.__CACHE,r),o=[{pubkey:t.publicKey,signature:h.signature.encode(t.sign(n),i)}];return this.data.updateInput(e,{partialSig:o}),this}_signTaprootInput(e,t,r,n,i=[p.Transaction.SIGHASH_DEFAULT]){const o=this.checkTaprootHashesForSig(e,t,r,n,i),a=o.filter((e=>!e.leafHash)).map((e=>(0,d.serializeTaprootSignature)(r.signSchnorr(e.hash),t.sighashType)))[0],s=o.filter((e=>!!e.leafHash)).map((e=>({pubkey:(0,d.toXOnly)(r.publicKey),signature:(0,d.serializeTaprootSignature)(r.signSchnorr(e.hash),t.sighashType),leafHash:e.leafHash})));return a&&this.data.updateInput(e,{tapKeySig:a}),s.length&&this.data.updateInput(e,{tapScriptSig:s}),this}signInputAsync(e,t,r){return Promise.resolve().then((()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const n=(0,a.checkForInput)(this.data.inputs,e);return(0,d.isTaprootInput)(n)?this._signTaprootInputAsync(e,n,t,void 0,r):this._signInputAsync(e,t,r)}))}signTaprootInputAsync(e,t,r,n){return Promise.resolve().then((()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const i=(0,a.checkForInput)(this.data.inputs,e);if((0,d.isTaprootInput)(i))return this._signTaprootInputAsync(e,i,t,r,n);throw new Error(`Input #${e} is not of type Taproot.`)}))}_signInputAsync(e,t,r=[p.Transaction.SIGHASH_ALL]){const{hash:n,sighashType:i}=N(this.data.inputs,e,t.publicKey,this.__CACHE,r);return Promise.resolve(t.sign(n)).then((r=>{const n=[{pubkey:t.publicKey,signature:h.signature.encode(r,i)}];this.data.updateInput(e,{partialSig:n})}))}async _signTaprootInputAsync(e,t,r,n,i=[p.Transaction.SIGHASH_DEFAULT]){const o=this.checkTaprootHashesForSig(e,t,r,n,i),a=[],s=o.filter((e=>!e.leafHash))[0];if(s){const e=Promise.resolve(r.signSchnorr(s.hash)).then((e=>({tapKeySig:(0,d.serializeTaprootSignature)(e,t.sighashType)})));a.push(e)}const u=o.filter((e=>!!e.leafHash));if(u.length){const e=u.map((e=>Promise.resolve(r.signSchnorr(e.hash)).then((n=>({tapScriptSig:[{pubkey:(0,d.toXOnly)(r.publicKey),signature:(0,d.serializeTaprootSignature)(n,t.sighashType),leafHash:e.leafHash}]})))));a.push(...e)}return Promise.all(a).then((t=>{t.forEach((t=>this.data.updateInput(e,t)))}))}checkTaprootHashesForSig(e,t,r,n,i){if("function"!=typeof r.signSchnorr)throw new Error(`Need Schnorr Signer to sign taproot input #${e}.`);const o=C(e,t,this.data.inputs,r.publicKey,this.__CACHE,n,i);if(!o||!o.length)throw new Error(`Can not sign for input #${e} with the key ${r.publicKey.toString("hex")}`);return o}toBuffer(){return m(this.__CACHE),this.data.toBuffer()}toHex(){return m(this.__CACHE),this.data.toHex()}toBase64(){return m(this.__CACHE),this.data.toBase64()}updateGlobal(e){return this.data.updateGlobal(e),this}updateInput(e,t){return t.witnessScript&&$(t.witnessScript),(0,d.checkTaprootInputFields)(this.data.inputs[e],t,"updateInput"),this.data.updateInput(e,t),t.nonWitnessUtxo&&H(this.__CACHE,this.data.inputs[e],e),this}updateOutput(e,t){const r=this.data.outputs[e];return(0,d.checkTaprootOutputFields)(r,t,"updateOutput"),this.data.updateOutput(e,t),this}addUnknownKeyValToGlobal(e){return this.data.addUnknownKeyValToGlobal(e),this}addUnknownKeyValToInput(e,t){return this.data.addUnknownKeyValToInput(e,t),this}addUnknownKeyValToOutput(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}clearFinalizedInput(e){return this.data.clearFinalizedInput(e),this}}t.Psbt=g;const w=e=>new v(e);class v{constructor(e=n.from([2,0,0,0,0,0,0,0,0,0])){this.tx=p.Transaction.fromBuffer(e),function(e){if(!e.ins.every((e=>e.script&&0===e.script.length&&e.witness&&0===e.witness.length)))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(e){if(void 0===e.hash||void 0===e.index||!n.isBuffer(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");const t="string"==typeof e.hash?(0,u.reverseBuffer)(n.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}addOutput(e){if(void 0===e.script||void 0===e.value||!n.isBuffer(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}toBuffer(){return this.tx.toBuffer()}}function m(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function _(e,t,r){if(!t)return!1;let n;if(n=r?r.map((e=>{const r=function(e){if(65===e.length){const t=1&e[64],r=e.slice(0,33);return r[0]=2|t,r}return e.slice()}(e);return t.find((e=>e.pubkey.equals(r)))})).filter((e=>!!e)):t,n.length>e)throw new Error("Too many signatures");return n.length===e}function E(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function S(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function k(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function T(e,t){e.forEach((e=>{if((0,d.isTaprootInput)(e)?(0,d.checkTaprootInputForSigs)(e,t):(0,y.checkInputForSig)(e,t))throw new Error("Can not modify transaction, signatures exist.")}))}function O(e,t,r){if(!(0,y.pubkeyInScript)(e,t))throw new Error(`Can not ${r} for this input with the key ${e.toString("hex")}`)}function A(e,t){const r=(0,u.reverseBuffer)(n.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[r])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[r]=1}function I(e,t){return(r,n,i,o)=>{const a=e({redeem:{output:i}}).output;if(!n.equals(a))throw new Error(`${t} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const P=I(c.p2sh,"Redeem script"),x=I(c.p2wsh,"Witness script");function R(e,t,r,n){if(!r.every(E))throw new Error(`PSBT must be finalized to calculate ${t}`);if("__FEE_RATE"===e&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===e&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),K(r,i,n,o),"__FEE_RATE"===e?n.__FEE_RATE:"__FEE"===e?n.__FEE:void 0}function B(e,t,r,n,i,o){const a=X(r);if(!function(e,t,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return _(1,e.partialSig);case"multisig":const r=c.p2ms({output:t});return _(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,r,a))throw new Error(`Can not finalize input #${e}`);return function(e,t,r,n,i,o){let a,s;const u=function(e,t,r){let n;switch(t){case"multisig":const t=function(e,t){return c.p2ms({output:e}).pubkeys.map((e=>(t.filter((t=>t.pubkey.equals(e)))[0]||{}).signature)).filter((e=>!!e))}(e,r);n=c.p2ms({output:e,signatures:t});break;case"pubkey":n=c.p2pk({output:e,signature:r[0].signature});break;case"pubkeyhash":n=c.p2pkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=c.p2wpkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(e,t,r),f=o?c.p2wsh({redeem:u}):null,l=i?c.p2sh({redeem:f||u}):null;return n?(s=f?(0,y.witnessStackToScriptWitness)(f.witness):(0,y.witnessStackToScriptWitness)(u.witness),l&&(a=l.input)):a=l?l.input:u.input,{finalScriptSig:a,finalScriptWitness:s}}(r,a,t.partialSig,n,i,o)}function N(e,t,r,n,i){const o=(0,a.checkForInput)(e,t),{hash:s,sighashType:u,script:f}=L(t,o,n,!1,i);return O(r,f,"sign"),{hash:s,sighashType:u}}function L(e,t,r,n,i){const o=r.__TX,a=t.sighashType||p.Transaction.SIGHASH_ALL;let s,u;if(M(a,i),t.nonWitnessUtxo){const n=W(r,t,e),i=o.ins[e].hash,a=n.getHash();if(!i.equals(a))throw new Error(`Non-witness UTXO hash for input #${e} doesn't match the hash specified in the prevout`);const s=o.ins[e].index;u=n.outs[s]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");u=t.witnessUtxo}const{meaningfulScript:f,type:l}=q(u.script,e,"input",t.redeemScript,t.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(l)>=0)s=o.hashForWitnessV0(e,f,u.value,a);else if((0,y.isP2WPKH)(f)){const t=c.p2pkh({hash:f.slice(2)}).output;s=o.hashForWitnessV0(e,t,u.value,a)}else{if(void 0===t.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${e} has witnessUtxo but non-segwit script: ${f.toString("hex")}`);n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),s=o.hashForSignature(e,f,a)}return{script:f,sighashType:a,hash:s}}function U(e,t,r){const{script:n}=G(e,t,r);return(0,y.isP2TR)(n)?n.subarray(2,34):null}function j(e){return 64===e.length?e:e.subarray(0,64)}function C(e,t,r,i,o,a,s){const u=o.__TX,f=t.sighashType||p.Transaction.SIGHASH_DEFAULT;M(f,s);const c=r.map(((e,t)=>G(t,e,o))),h=c.map((e=>e.script)),b=c.map((e=>e.value)),g=[];if(t.tapInternalKey&&!a){const r=U(e,t,o)||n.from([]);if((0,d.toXOnly)(i).equals(r)){const t=u.hashForWitnessV1(e,h,b,f);g.push({pubkey:i,hash:t})}}const w=(t.tapLeafScript||[]).filter((e=>(0,y.pubkeyInScript)(i,e.script))).map((e=>{const t=(0,l.tapleafHash)({output:e.script,version:e.leafVersion});return Object.assign({hash:t},e)})).filter((e=>!a||a.equals(e.hash))).map((t=>{const r=u.hashForWitnessV1(e,h,b,p.Transaction.SIGHASH_DEFAULT,t.hash);return{pubkey:i,hash:r,leafHash:t.hash}}));return g.concat(w)}function M(e,t){if(t&&t.indexOf(e)<0){const t=function(e){let t=e&p.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case p.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case p.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case p.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(e);throw new Error(`Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ${t}`)}}function F(e,t,r){const n=(0,a.checkForInput)(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map((e=>e.masterFingerprint.equals(r.fingerprint)?e:void 0)).filter((e=>!!e));if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map((e=>{const t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t}))}function D(e){let t=0;function r(){const r=o.decode(e,t);return t+=o.decode.bytes,r}return function(){const n=r(),i=[];for(let a=0;a<n;a++)i.push((o=void 0,o=r(),t+=o,e.slice(t-o,t)));var o;return i}()}function H(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;const n=p.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get(){const e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;{const e=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e,e}},set(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function K(e,t,r,n){let i=0;e.forEach(((e,o)=>{if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=D(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){const n=W(r,e,o),a=t.ins[o].index,s=n.outs[a];i+=s.value}}));const o=t.outs.reduce(((e,t)=>e+t.value),0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");const s=t.virtualSize();r.__FEE=a,r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(a/s)}function W(e,t,r){const n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||H(e,t,r),n[r]}function V(e,t,r){const{script:n}=G(e,t,r);return n}function G(e,t,r){if(void 0!==t.witnessUtxo)return{script:t.witnessUtxo.script,value:t.witnessUtxo.value};if(void 0!==t.nonWitnessUtxo){const n=W(r,t,e).outs[r.__TX.ins[e].index];return{script:n.script,value:n.value}}throw new Error("Can't find pubkey in input without Utxo data")}function z(e){return 33===e.length&&h.isCanonicalPubKey(e)}function q(e,t,r,n,i){const o=(0,y.isP2SHScript)(e),a=o&&n&&(0,y.isP2WSHScript)(n),s=(0,y.isP2WSHScript)(e);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((s||a)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let u;return a?(u=i,P(t,e,n,r),x(t,n,i,r),$(u)):s?(u=i,x(t,e,i,r),$(u)):o?(u=n,P(t,e,n,r)):u=e,{meaningfulScript:u,type:a?"p2sh-p2wsh":o?"p2sh":s?"p2wsh":"raw"}}function $(e){if((0,y.isP2WPKH)(e)||(0,y.isP2SHScript)(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function X(e){return(0,y.isP2WPKH)(e)?"witnesspubkeyhash":(0,y.isP2PKH)(e)?"pubkeyhash":(0,y.isP2MS)(e)?"multisig":(0,y.isP2PK)(e)?"pubkey":"nonstandard"}function Z(e){return[...Array(e).keys()]}},477:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.checkTaprootInputForSigs=t.tapTreeFromList=t.tapTreeToList=t.tweakInternalPubKey=t.checkTaprootOutputFields=t.checkTaprootInputFields=t.isTaprootOutput=t.isTaprootInput=t.serializeTaprootSignature=t.tapScriptFinalizer=t.toXOnly=void 0;const i=r(8116),o=r(2021),a=r(4929),s=r(2218),u=r(885),f=r(4929);function c(e){return e&&!!(e.tapInternalKey||e.tapMerkleRoot||e.tapLeafScript&&e.tapLeafScript.length||e.tapBip32Derivation&&e.tapBip32Derivation.length||e.witnessUtxo&&(0,a.isP2TR)(e.witnessUtxo.script))}function l(e,t){return e&&!!(e.tapInternalKey||e.tapTree||e.tapBip32Derivation&&e.tapBip32Derivation.length||t&&(0,a.isP2TR)(t))}function h(e=[]){return 1===e.length&&0===e[0].depth?{output:e[0].script,version:e[0].leafVersion}:function(e){let t;for(const r of e)if(t=y(r,t),!t)throw new Error("No room left to insert tapleaf in tree");return t}(e)}function p(e){return{signature:e.slice(0,64),hashType:e.slice(64)[0]||o.Transaction.SIGHASH_DEFAULT}}function d(e,t=[],r=0){if(r>s.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");return e?(0,i.isTapleaf)(e)?(t.push({depth:r,leafVersion:e.version||s.LEAF_VERSION_TAPSCRIPT,script:e.output}),t):(e[0]&&d(e[0],t,r+1),e[1]&&d(e[1],t,r+1),t):[]}function y(e,t,r=0){if(r>s.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");if(e.depth===r)return t?void 0:{output:e.script,version:e.leafVersion};if((0,i.isTapleaf)(t))return;const n=y(e,t&&t[0],r+1);if(n)return[n,t&&t[1]];const o=y(e,t&&t[1],r+1);return o?[t&&t[0],o]:void 0}function b(e,t){if(!t)return!0;const r=(0,s.tapleafHash)({output:e.script,version:e.leafVersion});return(0,s.rootHashFromPath)(e.controlBlock,r).equals(t)}function g(e){return e&&!!(e.redeemScript||e.witnessScript||e.bip32Derivation&&e.bip32Derivation.length)}t.toXOnly=e=>32===e.length?e:e.slice(1,33),t.tapScriptFinalizer=function(e,t,r){const n=function(e,t,r){if(!e.tapScriptSig||!e.tapScriptSig.length)throw new Error(`Can not finalize taproot input #${t}. No tapleaf script signature provided.`);const n=(e.tapLeafScript||[]).sort(((e,t)=>e.controlBlock.length-t.controlBlock.length)).find((t=>function(e,t,r){const n=(0,s.tapleafHash)({output:e.script,version:e.leafVersion});return(!r||r.equals(n))&&void 0!==t.find((e=>e.leafHash.equals(n)))}(t,e.tapScriptSig,r)));if(!n)throw new Error(`Can not finalize taproot input #${t}. Signature for tapleaf script not found.`);return n}(t,e,r);try{const e=function(e,t){const r=(0,s.tapleafHash)({output:t.script,version:t.leafVersion});return(e.tapScriptSig||[]).filter((e=>e.leafHash.equals(r))).map((e=>function(e,t){return Object.assign({positionInScript:(0,a.pubkeyPositionInScript)(t.pubkey,e)},t)}(t.script,e))).sort(((e,t)=>t.positionInScript-e.positionInScript)).map((e=>e.signature))}(t,n),r=e.concat(n.script).concat(n.controlBlock);return{finalScriptWitness:(0,a.witnessStackToScriptWitness)(r)}}catch(t){throw new Error(`Can not finalize taproot input #${e}: ${t}`)}},t.serializeTaprootSignature=function(e,t){const r=t?n.from([t]):n.from([]);return n.concat([e,r])},t.isTaprootInput=c,t.isTaprootOutput=l,t.checkTaprootInputFields=function(e,t,r){!function(e,t,r){const n=c(e)&&g(t),i=g(e)&&c(t),o=e===t&&c(t)&&g(t);if(n||i||o)throw new Error(`Invalid arguments for Psbt.${r}. Cannot use both taproot and non-taproot fields.`)}(e,t,r),function(e,t,r){if(t.tapMerkleRoot){const n=(t.tapLeafScript||[]).every((e=>b(e,t.tapMerkleRoot))),i=(e.tapLeafScript||[]).every((e=>b(e,t.tapMerkleRoot)));if(!n||!i)throw new Error(`Invalid arguments for Psbt.${r}. Tapleaf not part of taptree.`)}else if(e.tapMerkleRoot&&!(t.tapLeafScript||[]).every((t=>b(t,e.tapMerkleRoot))))throw new Error(`Invalid arguments for Psbt.${r}. Tapleaf not part of taptree.`)}(e,t,r)},t.checkTaprootOutputFields=function(e,t,r){!function(e,t,r){const n=l(e)&&g(t),i=g(e)&&l(t),o=e===t&&l(t)&&g(t);if(n||i||o)throw new Error(`Invalid arguments for Psbt.${r}. Cannot use both taproot and non-taproot fields.`)}(e,t,r),function(e,t){if(!t.tapTree&&!t.tapInternalKey)return;const r=t.tapInternalKey||e.tapInternalKey,n=t.tapTree||e.tapTree;if(r){const{script:t}=e,i=function(e,t){const r=t&&h(t.leaves),{output:n}=(0,u.p2tr)({internalPubkey:e,scriptTree:r});return n}(r,n);if(t&&!t.equals(i))throw new Error("Error adding output. Script or address missmatch.")}}(e,t)},t.tweakInternalPubKey=function(e,t){const r=t.tapInternalKey,n=r&&(0,s.tweakKey)(r,t.tapMerkleRoot);if(!n)throw new Error(`Cannot tweak tap internal key for input #${e}. Public key: ${r&&r.toString("hex")}`);return n.x},t.tapTreeToList=function(e){if(!(0,i.isTaptree)(e))throw new Error("Cannot convert taptree to tapleaf list. Expecting a tapree structure.");return d(e)},t.tapTreeFromList=h,t.checkTaprootInputForSigs=function(e,t){return function(e){const t=[];if(e.tapKeySig&&t.push(e.tapKeySig),e.tapScriptSig&&t.push(...e.tapScriptSig.map((e=>e.signature))),!t.length){const r=function(e){if(!e)return;const t=e.slice(2);return 64===t.length||65===t.length?t:void 0}(e.finalScriptWitness);r&&t.push(r)}return t}(e).some((e=>(0,f.signatureBlocksAction)(e,p,t)))}},4929:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.signatureBlocksAction=t.checkInputForSig=t.pubkeyInScript=t.pubkeyPositionInScript=t.witnessStackToScriptWitness=t.isP2TR=t.isP2SHScript=t.isP2WSHScript=t.isP2WPKH=t.isP2PKH=t.isP2PK=t.isP2MS=void 0;const i=r(394),o=r(7038),a=r(2021),s=r(1944),u=r(885);function f(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}function c(e,t){const r=(0,s.hash160)(e),n=e.slice(1,33),i=o.decompile(t);if(null===i)throw new Error("Unknown script error");return i.findIndex((t=>"number"!=typeof t&&(t.equals(e)||t.equals(r)||t.equals(n))))}function l(e,t,r){const{hashType:n}=t(e),i=[];switch(n&a.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&n){case a.Transaction.SIGHASH_ALL:break;case a.Transaction.SIGHASH_SINGLE:case a.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}return-1===i.indexOf(r)}t.isP2MS=f(u.p2ms),t.isP2PK=f(u.p2pk),t.isP2PKH=f(u.p2pkh),t.isP2WPKH=f(u.p2wpkh),t.isP2WSHScript=f(u.p2wsh),t.isP2SHScript=f(u.p2sh),t.isP2TR=f(u.p2tr),t.witnessStackToScriptWitness=function(e){let t=n.allocUnsafe(0);function r(e){const r=t.length,o=i.encodingLength(e);t=n.concat([t,n.allocUnsafe(o)]),i.encode(e,t,r)}var o;return r((o=e).length),o.forEach((function(e){r(e.length),function(e){t=n.concat([t,n.from(e)])}(e)})),t},t.pubkeyPositionInScript=c,t.pubkeyInScript=function(e,t){return-1!==c(e,t)},t.checkInputForSig=function(e,t){return function(e){let t=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return[];t=function(e){const t=e.finalScriptSig&&o.decompile(e.finalScriptSig)||[],r=e.finalScriptWitness&&o.decompile(e.finalScriptWitness)||[];return t.concat(r).filter((e=>n.isBuffer(e)&&o.isCanonicalScriptSignature(e))).map((e=>({signature:e})))}(e)}else t=e.partialSig;return t.map((e=>e.signature))}(e).some((e=>l(e,o.signature.decode,t)))},t.signatureBlocksAction=l},4344:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=t.encodingLength=void 0;const n=r(8417);function i(e){return e<n.OPS.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}t.encodingLength=i,t.encode=function(e,t,r){const o=i(t);return 1===o?e.writeUInt8(t,r):2===o?(e.writeUInt8(n.OPS.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===o?(e.writeUInt8(n.OPS.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(n.OPS.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),o},t.decode=function(e,t){const r=e.readUInt8(t);let i,o;if(r<n.OPS.OP_PUSHDATA1)i=r,o=1;else if(r===n.OPS.OP_PUSHDATA1){if(t+2>e.length)return null;i=e.readUInt8(t+1),o=2}else if(r===n.OPS.OP_PUSHDATA2){if(t+3>e.length)return null;i=e.readUInt16LE(t+1),o=3}else{if(t+5>e.length)return null;if(r!==n.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");i=e.readUInt32LE(t+1),o=5}return{opcode:r,number:i,size:o}}},7038:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.signature=t.number=t.isCanonicalScriptSignature=t.isDefinedHashType=t.isCanonicalPubKey=t.toStack=t.fromASM=t.toASM=t.decompile=t.compile=t.countNonPushOnlyOPs=t.isPushOnly=t.OPS=void 0;const i=r(3966),o=r(8417);Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return o.OPS}});const a=r(4344),s=r(9464),u=r(1043),f=r(8116),{typeforce:c}=f,l=o.OPS.OP_RESERVED;function h(e){return f.Buffer(e)||function(e){return f.Number(e)&&(e===o.OPS.OP_0||e>=o.OPS.OP_1&&e<=o.OPS.OP_16||e===o.OPS.OP_1NEGATE)}(e)}function p(e){return f.Array(e)&&e.every(h)}function d(e){return 0===e.length?o.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?l+e[0]:129===e[0]?o.OPS.OP_1NEGATE:void 0:void 0}function y(e){return n.isBuffer(e)}function b(e){return n.isBuffer(e)}function g(e){if(y(e))return e;c(f.Array,e);const t=e.reduce(((e,t)=>b(t)?1===t.length&&void 0!==d(t)?e+1:e+a.encodingLength(t.length)+t.length:e+1),0),r=n.allocUnsafe(t);let i=0;if(e.forEach((e=>{if(b(e)){const t=d(e);if(void 0!==t)return r.writeUInt8(t,i),void(i+=1);i+=a.encode(r,e.length,i),e.copy(r,i),i+=e.length}else r.writeUInt8(e,i),i+=1})),i!==r.length)throw new Error("Could not decode chunks");return r}function w(e){if(t=e,f.Array(t))return e;var t;c(f.Buffer,e);const r=[];let n=0;for(;n<e.length;){const t=e[n];if(t>o.OPS.OP_0&&t<=o.OPS.OP_PUSHDATA4){const t=a.decode(e,n);if(null===t)return null;if(n+=t.size,n+t.number>e.length)return null;const i=e.slice(n,n+t.number);n+=t.number;const o=d(i);void 0!==o?r.push(o):r.push(i)}else r.push(t),n+=1}return r}function v(e){const t=-129&e;return t>0&&t<4}t.isPushOnly=p,t.countNonPushOnlyOPs=function(e){return e.length-e.filter(h).length},t.compile=g,t.decompile=w,t.toASM=function(e){return y(e)&&(e=w(e)),e.map((e=>{if(b(e)){const t=d(e);if(void 0===t)return e.toString("hex");e=t}return o.REVERSE_OPS[e]})).join(" ")},t.fromASM=function(e){return c(f.String,e),g(e.split(" ").map((e=>void 0!==o.OPS[e]?o.OPS[e]:(c(f.Hex,e),n.from(e,"hex")))))},t.toStack=function(e){return e=w(e),c(p,e),e.map((e=>b(e)?e:e===o.OPS.OP_0?n.allocUnsafe(0):s.encode(e-l)))},t.isCanonicalPubKey=function(e){return f.isPoint(e)},t.isDefinedHashType=v,t.isCanonicalScriptSignature=function(e){return!!n.isBuffer(e)&&!!v(e[e.length-1])&&i.check(e.slice(0,-1))},t.number=s,t.signature=u},9464:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=void 0,t.decode=function(e,t,r){t=t||4,r=void 0===r||r;const n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&!(127&e[n-1]||!(n<=1)&&128&e[n-2]))throw new Error("Non-minimally encoded script number");if(5===n){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},t.encode=function(e){let t=Math.abs(e);const r=(i=t)>2147483647?5:i>8388607?4:i>32767?3:i>127?2:i>0?1:0;var i;const o=n.allocUnsafe(r),a=e<0;for(let e=0;e<r;++e)o.writeUInt8(255&t,e),t>>=8;return 128&o[r-1]?o.writeUInt8(a?128:0,r-1):a&&(o[r-1]|=128),o}},1043:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=void 0;const i=r(3966),o=r(8116),{typeforce:a}=o,s=n.alloc(1,0);function u(e){let t=0;for(;0===e[t];)++t;return t===e.length?s:128&(e=e.slice(t))[0]?n.concat([s,e],1+e.length):e}function f(e){0===e[0]&&(e=e.slice(1));const t=n.alloc(32,0),r=Math.max(0,32-e.length);return e.copy(t,r),t}t.decode=function(e){const t=e.readUInt8(e.length-1),r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const o=i.decode(e.slice(0,-1)),a=f(o.r),s=f(o.s);return{signature:n.concat([a,s],64),hashType:t}},t.encode=function(e,t){a({signature:o.BufferN(64),hashType:o.UInt8},{signature:e,hashType:t});const r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const s=n.allocUnsafe(1);s.writeUInt8(t,0);const f=u(e.slice(0,32)),c=u(e.slice(32,64));return n.concat([i.encode(f,c),s])}},2021:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;const i=r(606),o=r(1944),a=r(7038),s=r(7038),u=r(8116),{typeforce:f}=u;function c(e){const t=e.length;return i.varuint.encodingLength(t)+t}const l=n.allocUnsafe(0),h=[],p=n.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),d=n.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),y=n.from("ffffffffffffffff","hex"),b={script:l,valueBuffer:y};class g{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new i.BufferReader(e),n=new g;n.version=r.readInt32();const o=r.readUInt8(),a=r.readUInt8();let s=!1;o===g.ADVANCED_TRANSACTION_MARKER&&a===g.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;const u=r.readVarInt();for(let e=0;e<u;++e)n.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:h});const f=r.readVarInt();for(let e=0;e<f;++e)n.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(let e=0;e<u;++e)n.ins[e].witness=r.readVector();if(!n.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(n.locktime=r.readUInt32(),t)return n;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return n}static fromHex(e){return g.fromBuffer(n.from(e,"hex"),!1)}static isCoinbaseHash(e){f(u.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&g.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return f(u.tuple(u.Hash256bit,u.UInt32,u.maybe(u.UInt32),u.maybe(u.Buffer)),arguments),u.Null(r)&&(r=g.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||l,sequence:r,witness:h})-1}addOutput(e,t){return f(u.tuple(u.Buffer,u.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some((e=>0!==e.witness.length))}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+i.varuint.encodingLength(this.ins.length)+i.varuint.encodingLength(this.outs.length)+this.ins.reduce(((e,t)=>e+40+c(t.script)),0)+this.outs.reduce(((e,t)=>e+8+c(t.script)),0)+(t?this.ins.reduce(((e,t)=>e+function(e){const t=e.length;return i.varuint.encodingLength(t)+e.reduce(((e,t)=>e+c(t)),0)}(t.witness)),0):0)}clone(){const e=new g;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map((e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}))),e.outs=this.outs.map((e=>({script:e.script,value:e.value}))),e}hashForSignature(e,t,r){if(f(u.tuple(u.UInt32,u.Buffer,u.Number),arguments),e>=this.ins.length)return d;const i=a.compile(a.decompile(t).filter((e=>e!==s.OPS.OP_CODESEPARATOR))),c=this.clone();if((31&r)===g.SIGHASH_NONE)c.outs=[],c.ins.forEach(((t,r)=>{r!==e&&(t.sequence=0)}));else if((31&r)===g.SIGHASH_SINGLE){if(e>=this.outs.length)return d;c.outs.length=e+1;for(let t=0;t<e;t++)c.outs[t]=b;c.ins.forEach(((t,r)=>{r!==e&&(t.sequence=0)}))}r&g.SIGHASH_ANYONECANPAY?(c.ins=[c.ins[e]],c.ins[0].script=i):(c.ins.forEach((e=>{e.script=l})),c.ins[e].script=i);const h=n.allocUnsafe(c.byteLength(!1)+4);return h.writeInt32LE(r,h.length-4),c.__toBuffer(h,0,!1),o.hash256(h)}hashForWitnessV1(e,t,r,a,s,h){if(f(u.tuple(u.UInt32,f.arrayOf(u.Buffer),f.arrayOf(u.Satoshi),u.UInt32),arguments),r.length!==this.ins.length||t.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");const p=a===g.SIGHASH_DEFAULT?g.SIGHASH_ALL:a&g.SIGHASH_OUTPUT_MASK,d=(a&g.SIGHASH_INPUT_MASK)===g.SIGHASH_ANYONECANPAY,y=p===g.SIGHASH_NONE,b=p===g.SIGHASH_SINGLE;let w=l,v=l,m=l,_=l,E=l;if(!d){let e=i.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach((t=>{e.writeSlice(t.hash),e.writeUInt32(t.index)})),w=o.sha256(e.end()),e=i.BufferWriter.withCapacity(8*this.ins.length),r.forEach((t=>e.writeUInt64(t))),v=o.sha256(e.end()),e=i.BufferWriter.withCapacity(t.map(c).reduce(((e,t)=>e+t))),t.forEach((t=>e.writeVarSlice(t))),m=o.sha256(e.end()),e=i.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach((t=>e.writeUInt32(t.sequence))),_=o.sha256(e.end())}if(y||b){if(b&&e<this.outs.length){const t=this.outs[e],r=i.BufferWriter.withCapacity(8+c(t.script));r.writeUInt64(t.value),r.writeVarSlice(t.script),E=o.sha256(r.end())}}else{const e=this.outs.map((e=>8+c(e.script))).reduce(((e,t)=>e+t)),t=i.BufferWriter.withCapacity(e);this.outs.forEach((e=>{t.writeUInt64(e.value),t.writeVarSlice(e.script)})),E=o.sha256(t.end())}const S=(s?2:0)+(h?1:0),k=174-(d?49:0)-(y?32:0)+(h?32:0)+(s?37:0),T=i.BufferWriter.withCapacity(k);if(T.writeUInt8(a),T.writeInt32(this.version),T.writeUInt32(this.locktime),T.writeSlice(w),T.writeSlice(v),T.writeSlice(m),T.writeSlice(_),y||b||T.writeSlice(E),T.writeUInt8(S),d){const n=this.ins[e];T.writeSlice(n.hash),T.writeUInt32(n.index),T.writeUInt64(r[e]),T.writeVarSlice(t[e]),T.writeUInt32(n.sequence)}else T.writeUInt32(e);if(h){const e=i.BufferWriter.withCapacity(c(h));e.writeVarSlice(h),T.writeSlice(o.sha256(e.end()))}return b&&T.writeSlice(E),s&&(T.writeSlice(s),T.writeUInt8(0),T.writeUInt32(4294967295)),o.taggedHash("TapSighash",n.concat([n.from([0]),T.end()]))}hashForWitnessV0(e,t,r,a){f(u.tuple(u.UInt32,u.Buffer,u.Satoshi,u.UInt32),arguments);let s,l=n.from([]),h=p,d=p,y=p;if(a&g.SIGHASH_ANYONECANPAY||(l=n.allocUnsafe(36*this.ins.length),s=new i.BufferWriter(l,0),this.ins.forEach((e=>{s.writeSlice(e.hash),s.writeUInt32(e.index)})),d=o.hash256(l)),a&g.SIGHASH_ANYONECANPAY||(31&a)===g.SIGHASH_SINGLE||(31&a)===g.SIGHASH_NONE||(l=n.allocUnsafe(4*this.ins.length),s=new i.BufferWriter(l,0),this.ins.forEach((e=>{s.writeUInt32(e.sequence)})),y=o.hash256(l)),(31&a)!==g.SIGHASH_SINGLE&&(31&a)!==g.SIGHASH_NONE){const e=this.outs.reduce(((e,t)=>e+8+c(t.script)),0);l=n.allocUnsafe(e),s=new i.BufferWriter(l,0),this.outs.forEach((e=>{s.writeUInt64(e.value),s.writeVarSlice(e.script)})),h=o.hash256(l)}else if((31&a)===g.SIGHASH_SINGLE&&e<this.outs.length){const t=this.outs[e];l=n.allocUnsafe(8+c(t.script)),s=new i.BufferWriter(l,0),s.writeUInt64(t.value),s.writeVarSlice(t.script),h=o.hash256(l)}l=n.allocUnsafe(156+c(t)),s=new i.BufferWriter(l,0);const b=this.ins[e];return s.writeInt32(this.version),s.writeSlice(d),s.writeSlice(y),s.writeSlice(b.hash),s.writeUInt32(b.index),s.writeVarSlice(t),s.writeUInt64(r),s.writeUInt32(b.sequence),s.writeSlice(h),s.writeUInt32(this.locktime),s.writeUInt32(a),o.hash256(l)}getHash(e){return e&&this.isCoinbase()?n.alloc(32,0):o.hash256(this.__toBuffer(void 0,void 0,e))}getId(){return(0,i.reverseBuffer)(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){f(u.tuple(u.Number,u.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){f(u.tuple(u.Number,[u.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(e,t,r=!1){e||(e=n.allocUnsafe(this.byteLength(r)));const o=new i.BufferWriter(e,t||0);o.writeInt32(this.version);const a=r&&this.hasWitnesses();return a&&(o.writeUInt8(g.ADVANCED_TRANSACTION_MARKER),o.writeUInt8(g.ADVANCED_TRANSACTION_FLAG)),o.writeVarInt(this.ins.length),this.ins.forEach((e=>{o.writeSlice(e.hash),o.writeUInt32(e.index),o.writeVarSlice(e.script),o.writeUInt32(e.sequence)})),o.writeVarInt(this.outs.length),this.outs.forEach((e=>{void 0!==e.value?o.writeUInt64(e.value):o.writeSlice(e.valueBuffer),o.writeVarSlice(e.script)})),a&&this.ins.forEach((e=>{o.writeVector(e.witness)})),o.writeUInt32(this.locktime),void 0!==t?e.slice(t,o.offset):e}}t.Transaction=g,g.DEFAULT_SEQUENCE=4294967295,g.SIGHASH_DEFAULT=0,g.SIGHASH_ALL=1,g.SIGHASH_NONE=2,g.SIGHASH_SINGLE=3,g.SIGHASH_ANYONECANPAY=128,g.SIGHASH_OUTPUT_MASK=3,g.SIGHASH_INPUT_MASK=128,g.ADVANCED_TRANSACTION_MARKER=0,g.ADVANCED_TRANSACTION_FLAG=1},8116:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.oneOf=t.Null=t.BufferN=t.Function=t.UInt32=t.UInt8=t.tuple=t.maybe=t.Hex=t.Buffer=t.String=t.Boolean=t.Array=t.Number=t.Hash256bit=t.Hash160bit=t.Buffer256bit=t.isTaptree=t.isTapleaf=t.TAPLEAF_VERSION_MASK=t.Network=t.ECPoint=t.Satoshi=t.Signer=t.BIP32Path=t.UInt31=t.isPoint=t.typeforce=void 0;const n=r(8287);t.typeforce=r(8676);const i=n.Buffer.alloc(32,0),o=n.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");t.isPoint=function(e){if(!n.Buffer.isBuffer(e))return!1;if(e.length<33)return!1;const t=e[0],r=e.slice(1,33);if(0===r.compare(i))return!1;if(r.compare(o)>=0)return!1;if((2===t||3===t)&&33===e.length)return!0;const a=e.slice(33);return 0!==a.compare(i)&&!(a.compare(o)>=0)&&4===t&&65===e.length};const a=Math.pow(2,31)-1;function s(e){return t.typeforce.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function u(e){return!(!e||!("output"in e)||!n.Buffer.isBuffer(e.output)||void 0!==e.version&&(e.version&t.TAPLEAF_VERSION_MASK)!==e.version)}t.UInt31=function(e){return t.typeforce.UInt32(e)&&e<=a},t.BIP32Path=s,s.toJSON=()=>"BIP32 derivation path",t.Signer=function(e){return(t.typeforce.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign},t.Satoshi=function(e){return t.typeforce.UInt53(e)&&e<=21e14},t.ECPoint=t.typeforce.quacksLike("Point"),t.Network=t.typeforce.compile({messagePrefix:t.typeforce.oneOf(t.typeforce.Buffer,t.typeforce.String),bip32:{public:t.typeforce.UInt32,private:t.typeforce.UInt32},pubKeyHash:t.typeforce.UInt8,scriptHash:t.typeforce.UInt8,wif:t.typeforce.UInt8}),t.TAPLEAF_VERSION_MASK=254,t.isTapleaf=u,t.isTaptree=function e(r){return(0,t.Array)(r)?2===r.length&&r.every((t=>e(t))):u(r)},t.Buffer256bit=t.typeforce.BufferN(32),t.Hash160bit=t.typeforce.BufferN(20),t.Hash256bit=t.typeforce.BufferN(32),t.Number=t.typeforce.Number,t.Array=t.typeforce.Array,t.Boolean=t.typeforce.Boolean,t.String=t.typeforce.String,t.Buffer=t.typeforce.Buffer,t.Hex=t.typeforce.Hex,t.maybe=t.typeforce.maybe,t.tuple=t.typeforce.tuple,t.UInt8=t.typeforce.UInt8,t.UInt32=t.typeforce.UInt32,t.Function=t.typeforce.Function,t.BufferN=t.typeforce.BufferN,t.Null=t.typeforce.Null,t.oneOf=t.typeforce.oneOf},5974:(e,t,r)=>{var n=r(8287).Buffer,i=r(3184),o=r(4148),a=r(4442),s=r(8411),u=r(1447),f=r(9681);for(var c in f)t[c]=f[c];function l(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,l.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,o(this.init_done,"close before init"),o(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},l.prototype.write=function(e,t,r,n,i,o,a){return this._write(!0,e,t,r,n,i,o,a)},l.prototype.writeSync=function(e,t,r,n,i,o,a){return this._write(!1,e,t,r,n,i,o,a)},l.prototype._write=function(e,r,a,s,u,f,c,l){if(o.equal(arguments.length,8),o(this.init_done,"write before init"),o(this.mode!==t.NONE,"already finalized"),o.equal(!1,this.write_in_progress,"write already in progress"),o.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,o.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=n.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=f,this.strm.next_out=c,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return i.nextTick((function(){h._process(),h._after()})),this},l.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},l.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},l.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},l.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},l.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},l.prototype.init=function(e,r,n,i,a){o(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),o(e>=8&&e<=15,"invalid windowBits"),o(r>=-1&&r<=9,"invalid compression level"),o(n>=1&&n<=9,"invalid memlevel"),o(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,i,a),this._setDictionary()},l.prototype.params=function(){throw new Error("deflateParams Not supported")},l.prototype.reset=function(){this._reset(),this._setDictionary()},l.prototype._init=function(e,r,n,i,o){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=o,this.write_in_progress=!1,this.init_done=!0},l.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},l.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=l},8559:(e,t,r)=>{var n=r(3184),i=r(8287).Buffer,o=r(8310).Transform,a=r(5974),s=r(537),u=r(4148).ok,f=r(8287).kMaxLength,c="Cannot create final Buffer. It would be larger than 0x"+f.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16384,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(a),h=0;h<l.length;h++){var p=l[h];p.match(/^Z/)&&Object.defineProperty(t,p,{enumerable:!0,value:a[p],writable:!1})}for(var d={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},y=Object.keys(d),b=0;b<y.length;b++){var g=y[b];d[d[g]]=g}function w(e,t,r){var n=[],o=0;function a(){for(var t;null!==(t=e.read());)n.push(t),o+=t.length;e.once("readable",a)}function s(){var t,a=null;o>=f?a=new RangeError(c):t=i.concat(n,o),n=[],e.close(),r(a,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",a),r(t)})),e.on("end",s),e.end(t),a()}function v(e,t){if("string"==typeof t&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function m(e){if(!(this instanceof m))return new m(e);I.call(this,e,a.DEFLATE)}function _(e){if(!(this instanceof _))return new _(e);I.call(this,e,a.INFLATE)}function E(e){if(!(this instanceof E))return new E(e);I.call(this,e,a.GZIP)}function S(e){if(!(this instanceof S))return new S(e);I.call(this,e,a.GUNZIP)}function k(e){if(!(this instanceof k))return new k(e);I.call(this,e,a.DEFLATERAW)}function T(e){if(!(this instanceof T))return new T(e);I.call(this,e,a.INFLATERAW)}function O(e){if(!(this instanceof O))return new O(e);I.call(this,e,a.UNZIP)}function A(e){return e===a.Z_NO_FLUSH||e===a.Z_PARTIAL_FLUSH||e===a.Z_SYNC_FLUSH||e===a.Z_FULL_FLUSH||e===a.Z_FINISH||e===a.Z_BLOCK}function I(e,r){var n=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,o.call(this,e),e.flush&&!A(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!A(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||a.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:a.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!i.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],s.emit("error",n)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var f=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(f=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,f,e.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=f,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!n._handle},configurable:!0,enumerable:!0})}function P(e,t){t&&n.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function x(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=m,t.Inflate=_,t.Gzip=E,t.Gunzip=S,t.DeflateRaw=k,t.InflateRaw=T,t.Unzip=O,t.createDeflate=function(e){return new m(e)},t.createInflate=function(e){return new _(e)},t.createDeflateRaw=function(e){return new k(e)},t.createInflateRaw=function(e){return new T(e)},t.createGzip=function(e){return new E(e)},t.createGunzip=function(e){return new S(e)},t.createUnzip=function(e){return new O(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),w(new m(t),e,r)},t.deflateSync=function(e,t){return v(new m(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),w(new E(t),e,r)},t.gzipSync=function(e,t){return v(new E(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),w(new k(t),e,r)},t.deflateRawSync=function(e,t){return v(new k(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),w(new O(t),e,r)},t.unzipSync=function(e,t){return v(new O(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),w(new _(t),e,r)},t.inflateSync=function(e,t){return v(new _(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),w(new S(t),e,r)},t.gunzipSync=function(e,t){return v(new S(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),w(new T(t),e,r)},t.inflateRawSync=function(e,t){return v(new T(t),e)},s.inherits(I,o),I.prototype.params=function(e,r,i){if(e<t.Z_MIN_LEVEL||e>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var o=this;this.flush(a.Z_SYNC_FLUSH,(function(){u(o._handle,"zlib binding closed"),o._handle.params(e,r),o._hadError||(o._level=e,o._strategy=r,i&&i())}))}else n.nextTick(i)},I.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},I.prototype._flush=function(e){this._transform(i.alloc(0),"",e)},I.prototype.flush=function(e,t){var r=this,o=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=a.Z_FULL_FLUSH),o.ended?t&&n.nextTick(t):o.ending?t&&this.once("end",t):o.needDrain?t&&this.once("drain",(function(){return r.flush(e,t)})):(this._flushFlag=e,this.write(i.alloc(0),"",t))},I.prototype.close=function(e){P(this,e),n.nextTick(x,this)},I.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||i.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},I.prototype._processChunk=function(e,t,r){var n=e&&e.length,o=this._chunkSize-this._offset,a=0,s=this,l="function"==typeof r;if(!l){var h,p=[],d=0;this.on("error",(function(e){h=e})),u(this._handle,"zlib binding closed");do{var y=this._handle.writeSync(t,e,a,n,this._buffer,this._offset,o)}while(!this._hadError&&w(y[0],y[1]));if(this._hadError)throw h;if(d>=f)throw P(this),new RangeError(c);var b=i.concat(p,d);return P(this),b}u(this._handle,"zlib binding closed");var g=this._handle.write(t,e,a,n,this._buffer,this._offset,o);function w(f,c){if(this&&(this.buffer=null,this.callback=null),!s._hadError){var h=o-c;if(u(h>=0,"have should not go down"),h>0){var y=s._buffer.slice(s._offset,s._offset+h);s._offset+=h,l?s.push(y):(p.push(y),d+=y.length)}if((0===c||s._offset>=s._chunkSize)&&(o=s._chunkSize,s._offset=0,s._buffer=i.allocUnsafe(s._chunkSize)),0===c){if(a+=n-f,n=f,!l)return!0;var b=s._handle.write(t,e,a,n,s._buffer,s._offset,s._chunkSize);return b.callback=w,void(b.buffer=e)}if(!l)return!1;r()}}g.buffer=e,g.callback=w},s.inherits(m,I),s.inherits(_,I),s.inherits(E,I),s.inherits(S,I),s.inherits(k,I),s.inherits(T,I),s.inherits(O,I)},6763:(e,t,r)=>{const n=r(5364);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},9204:(e,t,r)=>{var n=r(6763);e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=Uint8Array.from(t),i=e(r),o=r.length+4,a=new Uint8Array(o);return a.set(r,0),a.set(i.subarray(0,4),r.length),n.encode(a,o)},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},1889:(e,t,r)=>{var{sha256:n}=r(2623),i=r(9204);e.exports=i((function(e){return n(n(e))}))},8287:(e,t,r)=>{const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return f(e,t,r)}function f(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Z(e.length)?s(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),s(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function b(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(f(e,o)===f(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(f(e,o+n)!==f(t,n)){r=!1;break}if(r)return o}return-1}function m(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Z(n))return a;e[r+a]=n}return a}function _(e,t,r,n){return $(z(t,e.length-r),e,r,n)}function E(e,t,r,n){return $(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return $(q(t),e,r,n)}function k(e,t,r,n){return $(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return f(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(X(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(X(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):b.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(X(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),f=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<s;++e)if(f[e]!==c[e]){o=f[e],a=c[e];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function x(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){K(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function U(e,t,r,n,i){K(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const F={};function D(e,t,r){F[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function K(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function W(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},8075:(e,t,r)=>{var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},487:(e,t,r)=>{var n=r(6743),i=r(453),o=r(6897),a=r(9675),s=i("%Function.prototype.apply%"),u=i("%Function.prototype.call%"),f=i("%Reflect.apply%",!0)||n.call(u,s),c=r(655),l=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=f(n,u,arguments);return o(t,1+l(0,e.length-(arguments.length-1)),!0)};var h=function(){return f(n,s,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h},6168:(e,t,r)=>{var n=r(2861).Buffer,i=r(8310).Transform,o=r(3141).I;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(6698)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},7108:(e,t,r)=>{var n=r(6698),i=r(320),o=r(6011),a=r(2802),s=r(6168);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},320:(e,t,r)=>{var n=r(320);e.exports=function(e){return(new n).update(e).digest()}},41:(e,t,r)=>{var n=r(655),i=r(8068),o=r(9675),a=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],l=!!a&&a(e,t);if(n)n(e,t,{configurable:null===f&&l?l.configurable:!f,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===u&&l?l.writable:!u});else{if(!c&&(s||u||f))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},8452:(e,t,r)=>{var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=r(41),u=r(592)(),f=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;u?s(e,t,r,!0):s(e,t,r)},c=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)f(e,o[s],t[o[s]],r[o[s]])};c.supportsDescriptors=!!u,e.exports=c},5170:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.ECPairFactory=t.networks=void 0;const i=r(5249);t.networks=i;const o=r(953),a=r(3209),s=r(7513),u=r(709),f=o.typeforce.maybe(o.typeforce.compile({compressed:o.maybe(o.Boolean),network:o.maybe(o.Network)}));t.ECPairFactory=function(e){function t(t,r){if(o.typeforce(o.Buffer256bit,t),!e.isPrivate(t))throw new TypeError("Private key not in range [1, n)");return o.typeforce(f,r),new c(t,void 0,r)}function r(t,r){return o.typeforce(e.isPoint,t),o.typeforce(f,r),new c(void 0,t,r)}(0,u.testEcc)(e);class c{__D;__Q;compressed;network;lowR;constructor(t,r,o){this.__D=t,this.__Q=r,this.lowR=!1,void 0===o&&(o={}),this.compressed=void 0===o.compressed||o.compressed,this.network=o.network||i.bitcoin,void 0!==r&&(this.__Q=n.from(e.pointCompress(r,this.compressed)))}get privateKey(){return this.__D}get publicKey(){if(!this.__Q){const t=e.pointFromScalar(this.__D,this.compressed);this.__Q=n.from(t)}return this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return s.encode(this.network.wif,this.__D,this.compressed)}tweak(e){return this.privateKey?this.tweakFromPrivateKey(e):this.tweakFromPublicKey(e)}sign(t,r){if(!this.__D)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return n.from(e.sign(t,this.__D));{let r=e.sign(t,this.__D);const i=n.alloc(32,0);let o=0;for(;r[0]>127;)o++,i.writeUIntLE(o,0,6),r=e.sign(t,this.__D,i);return n.from(r)}}signSchnorr(t){if(!this.privateKey)throw new Error("Missing private key");if(!e.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return n.from(e.signSchnorr(t,this.privateKey))}verify(t,r){return e.verify(t,this.publicKey,r)}verifySchnorr(t,r){if(!e.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return e.verifySchnorr(t,this.publicKey.subarray(1,33),r)}tweakFromPublicKey(t){const i=32===(o=this.publicKey).length?o:o.slice(1,33);var o;const a=e.xOnlyPointAddTweak(i,t);if(!a||null===a.xOnlyPubkey)throw new Error("Cannot tweak public key!");const s=n.from([0===a.parity?2:3]);return r(n.concat([s,a.xOnlyPubkey]),{network:this.network,compressed:this.compressed})}tweakFromPrivateKey(r){const i=3!==this.publicKey[0]&&(4!==this.publicKey[0]||1&~this.publicKey[64])?this.privateKey:e.privateNegate(this.privateKey),o=e.privateAdd(i,r);if(!o)throw new Error("Invalid tweaked private key!");return t(n.from(o),{network:this.network,compressed:this.compressed})}}return{isPoint:function(t){return e.isPoint(t)},fromPrivateKey:t,fromPublicKey:r,fromWIF:function(e,r){const n=s.decode(e),a=n.version;if(o.Array(r)){if(!(r=r.filter((e=>a===e.wif)).pop()))throw new Error("Unknown network version")}else if(r=r||i.bitcoin,a!==r.wif)throw new Error("Invalid network version");return t(n.privateKey,{compressed:n.compressed,network:r})},makeRandom:function(r){o.typeforce(f,r),void 0===r&&(r={});const n=r.rng||a;let i;do{i=n(32),o.typeforce(o.Buffer256bit,i)}while(!e.isPrivate(i));return t(i,r)}}}},8700:(e,t,r)=>{t.dg=void 0;var n=r(5170);Object.defineProperty(t,"dg",{enumerable:!0,get:function(){return n.ECPairFactory}})},5249:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.testnet=t.bitcoin=void 0,t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},709:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.testEcc=void 0;const i=e=>n.from(e,"hex");function o(e){if(!e)throw new Error("ecc library invalid")}t.testEcc=function(e){o(e.isPoint(i("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),o(!e.isPoint(i("030000000000000000000000000000000000000000000000000000000000000005"))),o(e.isPrivate(i("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),o(e.isPrivate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),o(!e.isPrivate(i("0000000000000000000000000000000000000000000000000000000000000000"))),o(!e.isPrivate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),o(!e.isPrivate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),o(n.from(e.privateAdd(i("0000000000000000000000000000000000000000000000000000000000000001"),i("0000000000000000000000000000000000000000000000000000000000000000"))).equals(i("0000000000000000000000000000000000000000000000000000000000000001"))),o(null===e.privateAdd(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),i("0000000000000000000000000000000000000000000000000000000000000003"))),o(n.from(e.privateAdd(i("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),i("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665"))).equals(i("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24"))),o(n.from(e.privateNegate(i("0000000000000000000000000000000000000000000000000000000000000001"))).equals(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),o(n.from(e.privateNegate(i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(i("0000000000000000000000000000000000000000000000000000000000000003"))),o(n.from(e.privateNegate(i("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(i("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792"))),o(n.from(e.pointCompress(i("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!0)).equals(i("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),o(n.from(e.pointCompress(i("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!1)).equals(i("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),o(n.from(e.pointCompress(i("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!0)).equals(i("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),o(n.from(e.pointCompress(i("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!1)).equals(i("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),o(n.from(e.pointFromScalar(i("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(i("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),o(null===e.xOnlyPointAddTweak(i("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140")));let t=e.xOnlyPointAddTweak(i("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),i("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));o(n.from(t.xOnlyPubkey).equals(i("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&1===t.parity),t=e.xOnlyPointAddTweak(i("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),i("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")),o(n.from(t.xOnlyPubkey).equals(i("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"))&&0===t.parity),o(n.from(e.sign(i("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(i("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),o(e.verify(i("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),i("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),i("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),e.signSchnorr&&o(n.from(e.signSchnorr(i("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),i("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),i("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(i("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),e.verifySchnorr&&o(e.verifySchnorr(i("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),i("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),i("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}},953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.maybe=t.Boolean=t.Array=t.Buffer256bit=t.Network=t.typeforce=void 0,t.typeforce=r(8676),t.Network=t.typeforce.compile({messagePrefix:t.typeforce.oneOf(t.typeforce.Buffer,t.typeforce.String),bip32:{public:t.typeforce.UInt32,private:t.typeforce.UInt32},pubKeyHash:t.typeforce.UInt8,scriptHash:t.typeforce.UInt8,wif:t.typeforce.UInt8}),t.Buffer256bit=t.typeforce.BufferN(32),t.Array=t.typeforce.Array,t.Boolean=t.typeforce.Boolean,t.maybe=t.typeforce.maybe},655:(e,t,r)=>{var n=r(453)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},1237:e=>{e.exports=EvalError},9383:e=>{e.exports=Error},9290:e=>{e.exports=RangeError},9538:e=>{e.exports=ReferenceError},8068:e=>{e.exports=SyntaxError},9675:e=>{e.exports=TypeError},5345:e=>{e.exports=URIError},7007:e=>{var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,a,f;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,f=c,console&&console.warn&&console.warn(f)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):d(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var f=u.length,c=d(u,f);for(r=0;r<f;++r)n(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},2682:(e,t,r)=>{var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,a):function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a)}},9353:e=>{var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,a=function(e,t){for(var r=[],n=1,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r}(arguments),s=r(0,i.length-a.length),u=[],f=0;f<s;f++)u[f]="$"+f;if(o=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=",");return r}(u)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var t=i.apply(this,n(a,arguments));return Object(t)===t?t:this}return i.apply(e,n(a,arguments))})),i.prototype){var c=function(){};c.prototype=i.prototype,o.prototype=new c,c.prototype=null}return o}},6743:(e,t,r)=>{var n=r(9353);e.exports=Function.prototype.bind||n},453:(e,t,r)=>{var n,i=r(9383),o=r(1237),a=r(9290),s=r(9538),u=r(8068),f=r(9675),c=r(5345),l=Function,h=function(e){try{return l('"use strict"; return ('+e+").constructor;")()}catch(e){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(e){p=null}var d=function(){throw new f},y=p?function(){try{return d}catch(e){try{return p(arguments,"callee").get}catch(e){return d}}}():d,b=r(4039)(),g=r(24)(),w=Object.getPrototypeOf||(g?function(e){return e.__proto__}:null),v={},m="undefined"!=typeof Uint8Array&&w?w(Uint8Array):n,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":b&&w?w([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b&&w?w(w([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&b&&w?w((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&b&&w?w((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b&&w?w(""[Symbol.iterator]()):n,"%Symbol%":b?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":y,"%TypedArray%":m,"%TypeError%":f,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(w)try{null.error}catch(e){var E=w(w(e));_["%Error.prototype%"]=E}var S=function e(t){var r;if("%AsyncFunction%"===t)r=h("async function () {}");else if("%GeneratorFunction%"===t)r=h("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=h("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&w&&(r=w(i.prototype))}return _[t]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=r(6743),O=r(9957),A=T.call(Function.call,Array.prototype.concat),I=T.call(Function.apply,Array.prototype.splice),P=T.call(Function.call,String.prototype.replace),x=T.call(Function.call,String.prototype.slice),R=T.call(Function.call,RegExp.prototype.exec),B=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,L=function(e,t){var r,n=e;if(O(k,n)&&(n="%"+(r=k[n])[0]+"%"),O(_,n)){var i=_[n];if(i===v&&(i=S(n)),void 0===i&&!t)throw new f("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new f('"allowMissing" argument must be a boolean');if(null===R(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=x(e,0,1),r=x(e,-1);if("%"===t&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return P(e,B,(function(e,t,r,i){n[n.length]=r?P(i,N,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=L("%"+n+"%",t),o=i.name,a=i.value,s=!1,c=i.alias;c&&(n=c[0],I(r,A([0,1],c)));for(var l=1,h=!0;l<r.length;l+=1){var d=r[l],y=x(d,0,1),b=x(d,-1);if(('"'===y||"'"===y||"`"===y||'"'===b||"'"===b||"`"===b)&&y!==b)throw new u("property names with quotes must have matching quotes");if("constructor"!==d&&h||(s=!0),O(_,o="%"+(n+="."+d)+"%"))a=_[o];else if(null!=a){if(!(d in a)){if(!t)throw new f("base intrinsic for "+e+" exists, but the property is not available.");return}if(p&&l+1>=r.length){var g=p(a,d);a=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[d]}else h=O(a,d),a=a[d];h&&!s&&(_[o]=a)}}return a}},5795:(e,t,r)=>{var n=r(453)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},592:(e,t,r)=>{var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},24:e=>{var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},4039:(e,t,r)=>{var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:e=>{e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(e,t,r)=>{var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},4729:(e,t,r)=>{var n=r(2861).Buffer,i=r(1603).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(6698)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},2260:e=>{var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,a,s,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var f=("number"!=typeof u&&(u=0),u+1>(s=e).length||-1===s.indexOf(".",u)?"argument":"property");a='The "'.concat(e,'" ').concat(f," ").concat(i," ").concat(n(t,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},2818:(e,t,r)=>{var n=r(3184),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var o=r(6736),a=r(2192);r(6698)(c,o);for(var s=i(a.prototype),u=0;u<s.length;u++){var f=s[u];c.prototype[f]||(c.prototype[f]=a.prototype[f])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},5860:(e,t,r)=>{e.exports=i;var n=r(3054);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},6736:(e,t,r)=>{var n,i=r(3184);e.exports=T,T.ReadableState=k,r(7007).EventEmitter;var o,a=function(e,t){return e.listeners(t).length},s=r(1181),u=r(8287).Buffer,f=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=r(2382);o=c&&c.debuglog?c.debuglog("stream"):function(){};var l,h,p,d=r(2389),y=r(1468),b=r(8775).getHighWaterMark,g=r(2260).F,w=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,m=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(T,s);var E=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function k(e,t,i){n=n||r(2818),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function T(e){if(n=n||r(2818),!(this instanceof T))return new T(e);var t=this instanceof n;this._readableState=new k(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function O(e,t,r,n,i){o("readableAddChunk",t);var a,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}(e,s);else if(i||(a=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new w("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),a)E(e,a);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?E(e,new _):A(e,s,t,!0);else if(s.ended)E(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?A(e,s,t,!1):B(e,s)):A(e,s,t,!1)}else n||(s.reading=!1,B(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),B(e,t)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=y.destroy,T.prototype._undestroy=y.undestroy,T.prototype._destroy=function(e,t){t(e)},T.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),O(this,e,t,!1,r)},T.prototype.unshift=function(e){return O(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(e){l||(l=r(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var I=1073741824;function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(R,e))}function R(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function B(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){o("readable nexttick read 0"),e.read(0)}function j(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function H(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}T.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):x(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?M(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(e){E(this,new m("_read()"))},T.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?y:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",(function t(i,a){o("onunpipe"),i===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}));var f=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",f);var c=!1;function l(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==H(n.pipes,e))&&!c&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),y(),e.removeListener("error",h),0===a(e,"error")&&E(e,t)}function p(){e.removeListener("finish",d),y()}function d(){o("onfinish"),e.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=H(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},T.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?x(this):n.reading||i.nextTick(U,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(L,this),r},T.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(L,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(j,e,t))}(this,e)),e.paused=!1,this},T.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(4743)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=M,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(e,t){return void 0===p&&(p=r(5049)),p(T,e,t)})},3054:(e,t,r)=>{e.exports=c;var n=r(2260).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(2818);function f(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(6698)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},2192:(e,t,r)=>{var n,i=r(3184);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=T,T.WritableState=k;var a,s={deprecate:r(4643)},u=r(1181),f=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=r(1468),h=r(8775).getHighWaterMark,p=r(2260).F,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,b=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,w=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,m=p.ERR_STREAM_WRITE_AFTER_END,_=p.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function S(){}function k(e,t,a){n=n||r(2818),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(R,e,t),e._writableState.errorEmitted=!0,E(e,n)):(o(n),e._writableState.errorEmitted=!0,E(e,n),R(e,t))}(e,r,n,t,o);else{var a=P(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||I(e,r),n?i.nextTick(A,e,r,a,o):A(e,r,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function T(e){var t=this instanceof(n=n||r(2818));if(!t&&!a.call(T,this))return new T(e);this._writableState=new k(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function O(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new w("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),R(e,t)}function I(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,O(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(O(e,t,!1,t.objectMode?1:f.length,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function P(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var r=P(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(T,u),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===T&&e&&e._writableState instanceof k}})):a=function(e){return e instanceof this},T.prototype.pipe=function(){E(this,new g)},T.prototype.write=function(e,t,r){var n,o=this._writableState,a=!1,s=!o.objectMode&&(n=e,f.isBuffer(n)||n instanceof c);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(e,t){var r=new m;E(e,r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var o;return null===r?o=new v:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(E(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else O(e,t,!1,s,n,i,o);return u}(this,o,s,e,t,r)),a},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||I(this,e))},T.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=l.destroy,T.prototype._undestroy=l.undestroy,T.prototype._destroy=function(e,t){t(e)}},4743:(e,t,r)=>{var n,i=r(3184);function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(5826),s=Symbol("lastResolve"),u=Symbol("lastReject"),f=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[l]=null,e[s]=null,e[u]=null,t(d(r,!1)))}}function b(e){i.nextTick(y,e)}var g=Object.getPrototypeOf((function(){})),w=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[f];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[f]?r(e[f]):t(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(d(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(w,(o(t={},p,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,f,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[p].read();n?(r[l]=null,r[s]=null,r[u]=null,e(d(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[l]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[l]=null,r[s]=null,r[u]=null,t(e)),void(r[f]=e)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(d(void 0,!0))),r[c]=!0})),e.on("readable",b.bind(null,r)),r}},2389:(e,t,r)=>{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=r(8287).Buffer,f=r(8460).inspect,c=f&&f.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,u.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return f(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1468:(e,t,r)=>{var n=r(3184);function i(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},5826:(e,t,r)=>{var n=r(2260).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||c()},f=t._writableState&&t._writableState.finished,c=function(){s=!1,f=!0,a||o.call(t)},l=t._readableState&&t._readableState.endEmitted,h=function(){a=!1,l=!0,s||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!f?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",d),t.req?y():t.on("request",y)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",c),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",c),t.removeListener("abort",d),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",d)}}},5049:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9434:(e,t,r)=>{var n,i=r(2260).F,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function f(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var c,l=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(5826)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}(e,o,i>0,(function(e){c||(c=e),e&&h.forEach(u),o||(h.forEach(u),l(c))}))}));return t.reduce(f)}},8775:(e,t,r)=>{var n=r(2260).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},1181:(e,t,r)=>{e.exports=r(7007).EventEmitter},1603:(e,t,r)=>{(t=e.exports=r(6736)).Stream=t,t.Readable=t,t.Writable=r(2192),t.Duplex=r(2818),t.Transform=r(3054),t.PassThrough=r(5860),t.finished=r(5826),t.pipeline=r(9434)},9957:(e,t,r)=>{var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);e.exports=o.call(n,i)},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,f=u>>1,c=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=f}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<<f)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+p]=255&a,p+=d,a/=256,f-=8);e[r+p-d]|=128*y}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7244:(e,t,r)=>{var n=r(9092)(),i=r(8075)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},9600:e=>{var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),l=function(){return!1};if("object"==typeof document){var h=document.all;u.call(h)===u.call(document.all)&&(l=function(e){if((c||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(l(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(l(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(f)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},8184:(e,t,r)=>{var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(9092)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},3003:e=>{e.exports=function(e){return e!=e}},4133:(e,t,r)=>{var n=r(487),i=r(8452),o=r(3003),a=r(6642),s=r(2464),u=n(a(),Number);i(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},6642:(e,t,r)=>{var n=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},2464:(e,t,r)=>{var n=r(8452),i=r(6642);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5680:(e,t,r)=>{var n=r(5767);e.exports=function(e){return!!n(e)}},9211:e=>{var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7653:(e,t,r)=>{var n=r(8452),i=r(487),o=r(9211),a=r(9394),s=r(6576),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},9394:(e,t,r)=>{var n=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},6576:(e,t,r)=>{var n=r(9394),i=r(8452);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8875:(e,t,r)=>{var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(1093),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),f=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{l(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),h=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=f&&r;if(s&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)h.push(String(y));if(n&&e.length>0)for(var b=0;b<e.length;++b)h.push(String(b));else for(var g in e)d&&"prototype"===g||!i.call(e,g)||h.push(String(g));if(u)for(var w=function(e){if("undefined"==typeof window||!p)return l(e);try{return l(e)}catch(e){return!1}}(e),v=0;v<c.length;++v)w&&"constructor"===c[v]||!i.call(e,c[v])||h.push(c[v]);return h}}e.exports=n},1189:(e,t,r)=>{var n=Array.prototype.slice,i=r(1093),o=Object.keys,a=o?function(e){return o(e)}:r(8875),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1093:e=>{var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},8403:(e,t,r)=>{var n=r(1189),i=r(1333)(),o=r(8075),a=Object,s=o("Array.prototype.push"),u=o("Object.prototype.propertyIsEnumerable"),f=i?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=a(e);if(1===arguments.length)return r;for(var o=1;o<arguments.length;++o){var c=a(arguments[o]),l=n(c),h=i&&(Object.getOwnPropertySymbols||f);if(h)for(var p=h(c),d=0;d<p.length;++d){var y=p[d];u(c,y)&&s(l,y)}for(var b=0;b<l.length;++b){var g=l[b];if(u(c,g)){var w=c[g];r[g]=w}}}return r}},1514:(e,t,r)=>{var n=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var i=Object.assign({},r),o="";for(var a in i)o+=a;return e!==o}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},9805:(e,t)=>{var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(r)},3269:e=>{e.exports=function(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16}},9681:e=>{e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823:e=>{var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var o=t,a=i+n;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^r[s])];return~e}},8411:(e,t,r)=>{var n,i=r(9805),o=r(3665),a=r(3269),s=r(4823),u=r(4674),f=0,c=0,l=-2,h=2,p=8,d=286,y=30,b=19,g=2*d+1,w=15,v=3,m=258,_=m+v+1,E=42,S=103,k=113,T=666;function O(e,t){return e.msg=u[t],t}function A(e){return(e<<1)-(e>4?9:0)}function I(e){for(var t=e.length;--t>=0;)e[t]=0}function P(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function x(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function R(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function N(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-_?e.strstart-(e.w_size-_):0,f=e.window,c=e.w_mask,l=e.prev,h=e.strstart+m,p=f[o+a-1],d=f[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(f[(r=t)+a]===d&&f[r+a-1]===p&&f[r]===f[o]&&f[++r]===f[o+1]){o+=2,r++;do{}while(f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&o<h);if(n=m-(h-o),o=h-m,n>a){if(e.match_start=t,a=n,n>=s)break;p=f[o+a-1],d=f[o+a]}}}while((t=l[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function L(e){var t,r,n,o,u,f,c,l,h,p,d=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-_)){i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=d?n-d:0}while(--r);t=r=d;do{n=e.prev[--t],e.prev[t]=n>=d?n-d:0}while(--r);o+=d}if(0===e.strm.avail_in)break;if(f=e.strm,c=e.window,l=e.strstart+e.lookahead,h=o,p=void 0,(p=f.avail_in)>h&&(p=h),r=0===p?0:(f.avail_in-=p,i.arraySet(c,f.input,f.next_in,p,l),1===f.state.wrap?f.adler=a(f.adler,c,p,l):2===f.state.wrap&&(f.adler=s(f.adler,c,p,l)),f.next_in+=p,f.total_in+=p,p),e.lookahead+=r,e.lookahead+e.insert>=v)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+v-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<v)););}while(e.lookahead<_&&0!==e.strm.avail_in)}function U(e,t){for(var r,n;;){if(e.lookahead<_){if(L(e),e.lookahead<_&&t===f)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=v&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+v-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-_&&(e.match_length=N(e,r)),e.match_length>=v)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-v),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=v){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+v-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<v-1?e.strstart:v-1,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}function j(e,t){for(var r,n,i;;){if(e.lookahead<_){if(L(e),e.lookahead<_&&t===f)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=v&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+v-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=v-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-_&&(e.match_length=N(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===v&&e.strstart-e.match_start>4096)&&(e.match_length=v-1)),e.prev_length>=v&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-v,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-v),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+v-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=v-1,e.strstart++,n&&(x(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&x(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<v-1?e.strstart:v-1,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}function C(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function M(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=p,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*g),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*b+1)),I(this.dyn_ltree),I(this.dyn_dtree),I(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(w+1),this.heap=new i.Buf16(2*d+1),I(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*d+1),I(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function F(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:k,e.adler=2===t.wrap?0:1,t.last_flush=f,o._tr_init(t),c):O(e,l)}function D(e){var t,r=F(e);return r===c&&((t=e.state).window_size=2*t.w_size,I(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=v-1,t.match_available=0,t.ins_h=0),r}function H(e,t,r,n,o,a){if(!e)return l;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>9||r!==p||n<8||n>15||t<0||t>9||a<0||a>4)return O(e,l);8===n&&(n=9);var u=new M;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+v-1)/v),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=a,u.method=r,D(e)}n=[new C(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(L(e),0===e.lookahead&&t===f)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,x(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-_&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(x(e,!1),e.strm.avail_out),1)})),new C(4,4,8,4,U),new C(4,5,16,8,U),new C(4,6,32,32,U),new C(4,4,16,16,j),new C(8,16,32,32,j),new C(8,16,128,128,j),new C(8,32,128,256,j),new C(32,128,258,1024,j),new C(32,258,258,4096,j)],t.deflateInit=function(e,t){return H(e,t,p,15,8,0)},t.deflateInit2=H,t.deflateReset=D,t.deflateResetKeep=F,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?l:(e.state.gzhead=t,c):l},t.deflate=function(e,t){var r,i,a,u;if(!e||!e.state||t>5||t<0)return e?O(e,l):l;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===T&&4!==t)return O(e,0===e.avail_out?-5:l);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,R(i,31),R(i,139),R(i,8),i.gzhead?(R(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),R(i,255&i.gzhead.time),R(i,i.gzhead.time>>8&255),R(i,i.gzhead.time>>16&255),R(i,i.gzhead.time>>24&255),R(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),R(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(R(i,255&i.gzhead.extra.length),R(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(R(i,0),R(i,0),R(i,0),R(i,0),R(i,0),R(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),R(i,3),i.status=k);else{var h=p+(i.w_bits-8<<4)<<8;h|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=k,B(i,h),0!==i.strstart&&(B(i,e.adler>>>16),B(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),P(e),a=i.pending,i.pending!==i.pending_buf_size));)R(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),P(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,R(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),P(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,R(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=S)}else i.status=S;if(i.status===S&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&P(e),i.pending+2<=i.pending_buf_size&&(R(i,255&e.adler),R(i,e.adler>>8&255),e.adler=0,i.status=k)):i.status=k),0!==i.pending){if(P(e),0===e.avail_out)return i.last_flush=-1,c}else if(0===e.avail_in&&A(t)<=A(r)&&4!==t)return O(e,-5);if(i.status===T&&0!==e.avail_in)return O(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&i.status!==T){var d=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(L(e),0===e.lookahead)){if(t===f)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=m){if(L(e),e.lookahead<=m&&t===f)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=v&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+m;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=m-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=v?(r=o._tr_tally(e,1,e.match_length-v),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==d&&4!==d||(i.status=T),1===d||3===d)return 0===e.avail_out&&(i.last_flush=-1),c;if(2===d&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(I(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),P(e),0===e.avail_out))return i.last_flush=-1,c}return 4!==t?c:i.wrap<=0?1:(2===i.wrap?(R(i,255&e.adler),R(i,e.adler>>8&255),R(i,e.adler>>16&255),R(i,e.adler>>24&255),R(i,255&e.total_in),R(i,e.total_in>>8&255),R(i,e.total_in>>16&255),R(i,e.total_in>>24&255)):(B(i,e.adler>>>16),B(i,65535&e.adler)),P(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?c:1)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&t!==S&&t!==k&&t!==T?O(e,l):(e.state=null,t===k?O(e,-3):c):l},t.deflateSetDictionary=function(e,t){var r,n,o,s,u,f,h,p,d=t.length;if(!e||!e.state)return l;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==E||r.lookahead)return l;for(1===s&&(e.adler=a(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(I(r.head),r.strstart=0,r.block_start=0,r.insert=0),p=new i.Buf8(r.w_size),i.arraySet(p,t,d-r.w_size,r.w_size,0),t=p,d=r.w_size),u=e.avail_in,f=e.next_in,h=e.input,e.avail_in=d,e.next_in=0,e.input=t,L(r);r.lookahead>=v;){n=r.strstart,o=r.lookahead-(v-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+v-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=v-1,L(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=v-1,r.match_available=0,e.next_in=f,e.input=h,e.avail_in=u,r.wrap=s,c},t.deflateInfo="pako deflate (from Nodeca project)"},7293:e=>{e.exports=function(e,t){var r,n,i,o,a,s,u,f,c,l,h,p,d,y,b,g,w,v,m,_,E,S,k,T,O;r=e.state,n=e.next_in,T=e.input,i=n+(e.avail_in-5),o=e.next_out,O=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,f=r.wsize,c=r.whave,l=r.wnext,h=r.window,p=r.hold,d=r.bits,y=r.lencode,b=r.distcode,g=(1<<r.lenbits)-1,w=(1<<r.distbits)-1;e:do{d<15&&(p+=T[n++]<<d,d+=8,p+=T[n++]<<d,d+=8),v=y[p&g];t:for(;;){if(p>>>=m=v>>>24,d-=m,0==(m=v>>>16&255))O[o++]=65535&v;else{if(!(16&m)){if(64&m){if(32&m){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}v=y[(65535&v)+(p&(1<<m)-1)];continue t}for(_=65535&v,(m&=15)&&(d<m&&(p+=T[n++]<<d,d+=8),_+=p&(1<<m)-1,p>>>=m,d-=m),d<15&&(p+=T[n++]<<d,d+=8,p+=T[n++]<<d,d+=8),v=b[p&w];;){if(p>>>=m=v>>>24,d-=m,16&(m=v>>>16&255)){if(E=65535&v,d<(m&=15)&&(p+=T[n++]<<d,(d+=8)<m&&(p+=T[n++]<<d,d+=8)),(E+=p&(1<<m)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=m,d-=m,E>(m=o-a)){if((m=E-m)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,k=h,0===l){if(S+=f-m,m<_){_-=m;do{O[o++]=h[S++]}while(--m);S=o-E,k=O}}else if(l<m){if(S+=f+l-m,(m-=l)<_){_-=m;do{O[o++]=h[S++]}while(--m);if(S=0,l<_){_-=m=l;do{O[o++]=h[S++]}while(--m);S=o-E,k=O}}}else if(S+=l-m,m<_){_-=m;do{O[o++]=h[S++]}while(--m);S=o-E,k=O}for(;_>2;)O[o++]=k[S++],O[o++]=k[S++],O[o++]=k[S++],_-=3;_&&(O[o++]=k[S++],_>1&&(O[o++]=k[S++]))}else{S=o-E;do{O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],_-=3}while(_>2);_&&(O[o++]=O[S++],_>1&&(O[o++]=O[S++]))}break}if(64&m){e.msg="invalid distance code",r.mode=30;break e}v=b[(65535&v)+(p&(1<<m)-1)]}}break}}while(n<i&&o<s);n-=_=d>>3,p&=(1<<(d-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=p,r.bits=d}},1447:(e,t,r)=>{var n=r(9805),i=r(3269),o=r(4823),a=r(7293),s=r(1998),u=0,f=-2,c=1,l=12,h=30,p=852,d=592;function y(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function g(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=c,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(p),t.distcode=t.distdyn=new n.Buf32(d),t.sane=1,t.back=-1,u):f}function w(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,g(e)):f}function v(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?f:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,w(e))):f}function m(e,t){var r,n;return e?(n=new b,e.state=n,n.window=null,(r=v(e,t))!==u&&(e.state=null),r):f}var _,E,S=!0;function k(e){if(S){var t;for(_=new n.Buf32(512),E=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,_,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,E,0,e.work,{bits:5}),S=!1}e.lencode=_,e.lenbits=9,e.distcode=E,e.distbits=5}function T(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}t.inflateReset=w,t.inflateReset2=v,t.inflateResetKeep=g,t.inflateInit=function(e){return m(e,15)},t.inflateInit2=m,t.inflate=function(e,t){var r,p,d,b,g,w,v,m,_,E,S,O,A,I,P,x,R,B,N,L,U,j,C,M,F=0,D=new n.Buf8(4),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return f;(r=e.state).mode===l&&(r.mode=13),g=e.next_out,d=e.output,v=e.avail_out,b=e.next_in,p=e.input,w=e.avail_in,m=r.hold,_=r.bits,E=w,S=v,j=u;e:for(;;)switch(r.mode){case c:if(0===r.wrap){r.mode=13;break}for(;_<16;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(2&r.wrap&&35615===m){r.check=0,D[0]=255&m,D[1]=m>>>8&255,r.check=o(r.check,D,2,0),m=0,_=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=h;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=h;break}if(_-=4,U=8+(15&(m>>>=4)),0===r.wbits)r.wbits=U;else if(U>r.wbits){e.msg="invalid window size",r.mode=h;break}r.dmax=1<<U,e.adler=r.check=1,r.mode=512&m?10:l,m=0,_=0;break;case 2:for(;_<16;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(r.flags=m,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=h;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=h;break}r.head&&(r.head.text=m>>8&1),512&r.flags&&(D[0]=255&m,D[1]=m>>>8&255,r.check=o(r.check,D,2,0)),m=0,_=0,r.mode=3;case 3:for(;_<32;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}r.head&&(r.head.time=m),512&r.flags&&(D[0]=255&m,D[1]=m>>>8&255,D[2]=m>>>16&255,D[3]=m>>>24&255,r.check=o(r.check,D,4,0)),m=0,_=0,r.mode=4;case 4:for(;_<16;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}r.head&&(r.head.xflags=255&m,r.head.os=m>>8),512&r.flags&&(D[0]=255&m,D[1]=m>>>8&255,r.check=o(r.check,D,2,0)),m=0,_=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}r.length=m,r.head&&(r.head.extra_len=m),512&r.flags&&(D[0]=255&m,D[1]=m>>>8&255,r.check=o(r.check,D,2,0)),m=0,_=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((O=r.length)>w&&(O=w),O&&(r.head&&(U=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,p,b,O,U)),512&r.flags&&(r.check=o(r.check,p,O,b)),w-=O,b+=O,r.length-=O),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===w)break e;O=0;do{U=p[b+O++],r.head&&U&&r.length<65536&&(r.head.name+=String.fromCharCode(U))}while(U&&O<w);if(512&r.flags&&(r.check=o(r.check,p,O,b)),w-=O,b+=O,U)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===w)break e;O=0;do{U=p[b+O++],r.head&&U&&r.length<65536&&(r.head.comment+=String.fromCharCode(U))}while(U&&O<w);if(512&r.flags&&(r.check=o(r.check,p,O,b)),w-=O,b+=O,U)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;_<16;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(m!==(65535&r.check)){e.msg="header crc mismatch",r.mode=h;break}m=0,_=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=l;break;case 10:for(;_<32;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}e.adler=r.check=y(m),m=0,_=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=g,e.avail_out=v,e.next_in=b,e.avail_in=w,r.hold=m,r.bits=_,2;e.adler=r.check=1,r.mode=l;case l:if(5===t||6===t)break e;case 13:if(r.last){m>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}switch(r.last=1&m,_-=1,3&(m>>>=1)){case 0:r.mode=14;break;case 1:if(k(r),r.mode=20,6===t){m>>>=2,_-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=h}m>>>=2,_-=2;break;case 14:for(m>>>=7&_,_-=7&_;_<32;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",r.mode=h;break}if(r.length=65535&m,m=0,_=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(O=r.length){if(O>w&&(O=w),O>v&&(O=v),0===O)break e;n.arraySet(d,p,b,O,g),w-=O,b+=O,v-=O,g+=O,r.length-=O;break}r.mode=l;break;case 17:for(;_<14;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(r.nlen=257+(31&m),m>>>=5,_-=5,r.ndist=1+(31&m),m>>>=5,_-=5,r.ncode=4+(15&m),m>>>=4,_-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=h;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;_<3;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}r.lens[H[r.have++]]=7&m,m>>>=3,_-=3}for(;r.have<19;)r.lens[H[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},j=s(0,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,j){e.msg="invalid code lengths set",r.mode=h;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;x=(F=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,R=65535&F,!((P=F>>>24)<=_);){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(R<16)m>>>=P,_-=P,r.lens[r.have++]=R;else{if(16===R){for(M=P+2;_<M;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(m>>>=P,_-=P,0===r.have){e.msg="invalid bit length repeat",r.mode=h;break}U=r.lens[r.have-1],O=3+(3&m),m>>>=2,_-=2}else if(17===R){for(M=P+3;_<M;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}_-=P,U=0,O=3+(7&(m>>>=P)),m>>>=3,_-=3}else{for(M=P+7;_<M;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}_-=P,U=0,O=11+(127&(m>>>=P)),m>>>=7,_-=7}if(r.have+O>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=h;break}for(;O--;)r.lens[r.have++]=U}}if(r.mode===h)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=h;break}if(r.lenbits=9,C={bits:r.lenbits},j=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,j){e.msg="invalid literal/lengths set",r.mode=h;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},j=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,j){e.msg="invalid distances set",r.mode=h;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(w>=6&&v>=258){e.next_out=g,e.avail_out=v,e.next_in=b,e.avail_in=w,r.hold=m,r.bits=_,a(e,S),g=e.next_out,d=e.output,v=e.avail_out,b=e.next_in,p=e.input,w=e.avail_in,m=r.hold,_=r.bits,r.mode===l&&(r.back=-1);break}for(r.back=0;x=(F=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,R=65535&F,!((P=F>>>24)<=_);){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(x&&!(240&x)){for(B=P,N=x,L=R;x=(F=r.lencode[L+((m&(1<<B+N)-1)>>B)])>>>16&255,R=65535&F,!(B+(P=F>>>24)<=_);){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}m>>>=B,_-=B,r.back+=B}if(m>>>=P,_-=P,r.back+=P,r.length=R,0===x){r.mode=26;break}if(32&x){r.back=-1,r.mode=l;break}if(64&x){e.msg="invalid literal/length code",r.mode=h;break}r.extra=15&x,r.mode=22;case 22:if(r.extra){for(M=r.extra;_<M;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}r.length+=m&(1<<r.extra)-1,m>>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;x=(F=r.distcode[m&(1<<r.distbits)-1])>>>16&255,R=65535&F,!((P=F>>>24)<=_);){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(!(240&x)){for(B=P,N=x,L=R;x=(F=r.distcode[L+((m&(1<<B+N)-1)>>B)])>>>16&255,R=65535&F,!(B+(P=F>>>24)<=_);){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}m>>>=B,_-=B,r.back+=B}if(m>>>=P,_-=P,r.back+=P,64&x){e.msg="invalid distance code",r.mode=h;break}r.offset=R,r.extra=15&x,r.mode=24;case 24:if(r.extra){for(M=r.extra;_<M;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}r.offset+=m&(1<<r.extra)-1,m>>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=h;break}r.mode=25;case 25:if(0===v)break e;if(O=S-v,r.offset>O){if((O=r.offset-O)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=h;break}O>r.wnext?(O-=r.wnext,A=r.wsize-O):A=r.wnext-O,O>r.length&&(O=r.length),I=r.window}else I=d,A=g-r.offset,O=r.length;O>v&&(O=v),v-=O,r.length-=O;do{d[g++]=I[A++]}while(--O);0===r.length&&(r.mode=21);break;case 26:if(0===v)break e;d[g++]=r.length,v--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===w)break e;w--,m|=p[b++]<<_,_+=8}if(S-=v,e.total_out+=S,r.total+=S,S&&(e.adler=r.check=r.flags?o(r.check,d,S,g-S):i(r.check,d,S,g-S)),S=v,(r.flags?m:y(m))!==r.check){e.msg="incorrect data check",r.mode=h;break}m=0,_=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===w)break e;w--,m+=p[b++]<<_,_+=8}if(m!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=h;break}m=0,_=0}r.mode=29;case 29:j=1;break e;case h:j=-3;break e;case 31:return-4;default:return f}return e.next_out=g,e.avail_out=v,e.next_in=b,e.avail_in=w,r.hold=m,r.bits=_,(r.wsize||S!==e.avail_out&&r.mode<h&&(r.mode<27||4!==t))&&T(e,e.output,e.next_out,S-e.avail_out)?(r.mode=31,-4):(E-=e.avail_in,S-=e.avail_out,e.total_in+=E,e.total_out+=S,r.total+=S,r.wrap&&S&&(e.adler=r.check=r.flags?o(r.check,d,S,e.next_out-S):i(r.check,d,S,e.next_out-S)),e.data_type=r.bits+(r.last?64:0)+(r.mode===l?128:0)+(20===r.mode||15===r.mode?256:0),(0===E&&0===S||4===t)&&j===u&&(j=-5),j)},t.inflateEnd=function(e){if(!e||!e.state)return f;var t=e.state;return t.window&&(t.window=null),e.state=null,u},t.inflateGetHeader=function(e,t){var r;return e&&e.state&&2&(r=e.state).wrap?(r.head=t,t.done=!1,u):f},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?f:11===r.mode&&i(1,t,n,0)!==r.check?-3:T(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,u):f},t.inflateInfo="pako inflate (from Nodeca project)"},1998:(e,t,r)=>{var n=r(9805),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,u,f,c,l,h){var p,d,y,b,g,w,v,m,_,E=h.bits,S=0,k=0,T=0,O=0,A=0,I=0,P=0,x=0,R=0,B=0,N=null,L=0,U=new n.Buf16(16),j=new n.Buf16(16),C=null,M=0;for(S=0;S<=15;S++)U[S]=0;for(k=0;k<u;k++)U[t[r+k]]++;for(A=E,O=15;O>=1&&0===U[O];O--);if(A>O&&(A=O),0===O)return f[c++]=20971520,f[c++]=20971520,h.bits=1,0;for(T=1;T<O&&0===U[T];T++);for(A<T&&(A=T),x=1,S=1;S<=15;S++)if(x<<=1,(x-=U[S])<0)return-1;if(x>0&&(0===e||1!==O))return-1;for(j[1]=0,S=1;S<15;S++)j[S+1]=j[S]+U[S];for(k=0;k<u;k++)0!==t[r+k]&&(l[j[t[r+k]]++]=k);if(0===e?(N=C=l,w=19):1===e?(N=i,L-=257,C=o,M-=257,w=256):(N=a,C=s,w=-1),B=0,k=0,S=T,g=c,I=A,P=0,y=-1,b=(R=1<<A)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){v=S-P,l[k]<w?(m=0,_=l[k]):l[k]>w?(m=C[M+l[k]],_=N[L+l[k]]):(m=96,_=0),p=1<<S-P,T=d=1<<I;do{f[g+(B>>P)+(d-=p)]=v<<24|m<<16|_}while(0!==d);for(p=1<<S-1;B&p;)p>>=1;if(0!==p?(B&=p-1,B+=p):B=0,k++,0==--U[S]){if(S===O)break;S=t[r+l[k]]}if(S>A&&(B&b)!==y){for(0===P&&(P=A),g+=T,x=1<<(I=S-P);I+P<O&&!((x-=U[I+P])<=0);)I++,x<<=1;if(R+=1<<I,1===e&&R>852||2===e&&R>592)return 1;f[y=B&b]=A<<24|I<<16|g-c}}return 0!==B&&(f[g+B]=S-P<<24|64<<16),h.bits=A,0}},4674:e=>{e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665:(e,t,r)=>{var n=r(9805);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=256,a=286,s=30,u=15,f=16,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],p=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);i(d);var y=new Array(60);i(y);var b=new Array(512);i(b);var g=new Array(256);i(g);var w=new Array(29);i(w);var v,m,_,E=new Array(s);function S(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function k(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function T(e){return e<256?b[e]:b[256+(e>>>7)]}function O(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function A(e,t,r){e.bi_valid>f-r?(e.bi_buf|=t<<e.bi_valid&65535,O(e,e.bi_buf),e.bi_buf=t>>f-e.bi_valid,e.bi_valid+=r-f):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function I(e,t,r){A(e,r[2*t],r[2*t+1])}function P(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function x(e,t,r){var n,i,o=new Array(u+1),a=0;for(n=1;n<=u;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=P(o[s]++,s))}}function R(e){var t;for(t=0;t<a;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function B(e){e.bi_valid>8?O(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function N(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function L(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&N(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!N(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function U(e,t,r){var n,i,a,s,u=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===n?I(e,i,t):(I(e,(a=g[i])+o+1,t),0!==(s=c[a])&&A(e,i-=w[a],s),I(e,a=T(--n),r),0!==(s=l[a])&&A(e,n-=E[a],s))}while(u<e.last_lit);I(e,256,t)}function j(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,f=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<f;r++)0!==o[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;r>=1;r--)L(e,o,r);i=f;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,L(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,f=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,b=0;for(o=0;o<=u;o++)e.bl_count[o]=0;for(f[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=f[2*f[2*(n=e.heap[r])+1]+1]+1)>y&&(o=y,b++),f[2*n+1]=o,n>c||(e.bl_count[o]++,a=0,n>=d&&(a=p[n-d]),s=f[2*n],e.opt_len+=s*(o+a),h&&(e.static_len+=s*(l[2*n+1]+a)));if(0!==b){do{for(o=y-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[y]--,b-=2}while(b>0);for(o=y;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>c||(f[2*i+1]!==o&&(e.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(e,t),x(o,c,e.bl_count)}function C(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<f?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,f=3):i===a?(u=6,f=3):(u=7,f=4))}function M(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<f)do{I(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(I(e,i,e.bl_tree),s--),I(e,16,e.bl_tree),A(e,s-3,2)):s<=10?(I(e,17,e.bl_tree),A(e,s-3,3)):(I(e,18,e.bl_tree),A(e,s-11,7));s=0,o=i,0===a?(u=138,f=3):i===a?(u=6,f=3):(u=7,f=4)}}i(E);var F=!1;function D(e,t,r,i){A(e,0+(i?1:0),3),function(e,t,r,i){B(e),O(e,r),O(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}t._tr_init=function(e){F||(function(){var e,t,r,n,i,o=new Array(u+1);for(r=0,n=0;n<28;n++)for(w[n]=r,e=0;e<1<<c[n];e++)g[r++]=n;for(g[r-1]=n,i=0,n=0;n<16;n++)for(E[n]=i,e=0;e<1<<l[n];e++)b[i++]=n;for(i>>=7;n<s;n++)for(E[n]=i<<7,e=0;e<1<<l[n]-7;e++)b[256+i++]=n;for(t=0;t<=u;t++)o[t]=0;for(e=0;e<=143;)d[2*e+1]=8,e++,o[8]++;for(;e<=255;)d[2*e+1]=9,e++,o[9]++;for(;e<=279;)d[2*e+1]=7,e++,o[7]++;for(;e<=287;)d[2*e+1]=8,e++,o[8]++;for(x(d,287,o),e=0;e<s;e++)y[2*e+1]=5,y[2*e]=P(e,5);v=new S(d,c,257,a,u),m=new S(y,l,0,s,u),_=new S(new Array(0),h,0,19,7)}(),F=!0),e.l_desc=new k(e.dyn_ltree,v),e.d_desc=new k(e.dyn_dtree,m),e.bl_desc=new k(e.bl_tree,_),e.bi_buf=0,e.bi_valid=0,R(e)},t._tr_stored_block=D,t._tr_flush_block=function(e,t,r,n){var i,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),j(e,e.l_desc),j(e,e.d_desc),s=function(e){var t;for(C(e,e.dyn_ltree,e.l_desc.max_code),C(e,e.dyn_dtree,e.d_desc.max_code),j(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*p[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?D(e,t,r,n):4===e.strategy||a===i?(A(e,2+(n?1:0),3),U(e,d,y)):(A(e,4+(n?1:0),3),function(e,t,r,n){var i;for(A(e,t-257,5),A(e,r-1,5),A(e,n-4,4),i=0;i<n;i++)A(e,e.bl_tree[2*p[i]+1],3);M(e,e.dyn_ltree,t-1),M(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),U(e,e.dyn_ltree,e.dyn_dtree)),R(e),n&&B(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(g[r]+o+1)]++,e.dyn_dtree[2*T(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){A(e,2,3),I(e,256,d),function(e){16===e.bi_valid?(O(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},4442:e=>{e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},6578:e=>{e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},3209:(e,t,r)=>{var n=r(3184),i=65536,o=r(2861).Buffer,a=r.g.crypto||r.g.msCrypto;a&&a.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>i)for(var s=0;s<e;s+=i)a.getRandomValues(r.slice(s,s+i));else a.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},6011:(e,t,r)=>{var n=r(8287).Buffer,i=r(6698),o=r(4729),a=new Array(16),s=[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],u=[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],f=[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],c=[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],l=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function p(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(e,t){return e<<t|e>>>32-t}function y(e,t,r,n,i,o,a,s){return d(e+(t^r^n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return d(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return d(e+((t|~r)^n)+o+a|0,s)+i|0}function w(e,t,r,n,i,o,a,s){return d(e+(t&n|r&~n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return d(e+(t^(r|~n))+o+a|0,s)+i|0}i(p,o),p.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,p=0|this._e,m=0|this._a,_=0|this._b,E=0|this._c,S=0|this._d,k=0|this._e,T=0;T<80;T+=1){var O,A;T<16?(O=y(r,n,i,o,p,e[s[T]],l[0],f[T]),A=v(m,_,E,S,k,e[u[T]],h[0],c[T])):T<32?(O=b(r,n,i,o,p,e[s[T]],l[1],f[T]),A=w(m,_,E,S,k,e[u[T]],h[1],c[T])):T<48?(O=g(r,n,i,o,p,e[s[T]],l[2],f[T]),A=g(m,_,E,S,k,e[u[T]],h[2],c[T])):T<64?(O=w(r,n,i,o,p,e[s[T]],l[3],f[T]),A=b(m,_,E,S,k,e[u[T]],h[3],c[T])):(O=v(r,n,i,o,p,e[s[T]],l[4],f[T]),A=y(m,_,E,S,k,e[u[T]],h[4],c[T])),r=p,p=o,o=d(i,10),i=n,n=O,m=k,k=S,S=d(E,10),E=_,_=A}var I=this._b+i+S|0;this._b=this._c+o+k|0,this._c=this._d+p+m|0,this._d=this._e+r+_|0,this._e=this._a+n+E|0,this._a=I},p.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=p},2861:(e,t,r)=>{var n=r(8287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},6897:(e,t,r)=>{var n=r(453),i=r(41),o=r(592)(),a=r(5795),s=r(9675),u=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,f=!0;if("length"in e&&a){var c=a(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(f=!1)}return(n||f||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},392:(e,t,r)=>{var n=r(2861).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,f=Math.min(o-s,i-u),c=0;c<f;c++)r[u+c]=e[s+c];s+=f,(a+=f)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},2802:(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(7816),n.sha1=r(3737),n.sha224=r(6710),n.sha256=r(4107),n.sha384=r(2827),n.sha512=r(2890)},7816:(e,t,r)=>{var n=r(6698),i=r(392),o=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<30|e>>>2}function c(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var p=~~(h/20),d=0|((t=n)<<5|t>>>27)+c(p,i,o,s)+u+r[h]+a[p];u=s,s=o,o=f(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},3737:(e,t,r)=>{var n=r(6698),i=r(392),o=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var p=0;p<80;++p){var d=~~(p/20),y=f(n)+l(d,i,o,s)+u+r[p]+a[d]|0;u=s,s=o,o=c(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},6710:(e,t,r)=>{var n=r(6698),i=r(4107),o=r(392),a=r(2861).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},4107:(e,t,r)=>{var n=r(6698),i=r(392),o=r(2861).Buffer,a=[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],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function p(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0|this._f,y=0|this._g,b=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+p(r[g-15])+r[g-16];for(var w=0;w<64;++w){var v=b+h(u)+f(u,d,y)+a[w]+r[w]|0,m=l(n)+c(n,i,o)|0;b=y,y=d,d=u,u=s+v|0,s=o,o=i,i=n,n=v+m|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},2827:(e,t,r)=>{var n=r(6698),i=r(2890),o=r(392),a=r(2861).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},2890:(e,t,r)=>{var n=r(6698),i=r(392),o=r(2861).Buffer,a=[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],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,w=0|this._gh,v=0|this._hh,m=0|this._al,_=0|this._bl,E=0|this._cl,S=0|this._dl,k=0|this._el,T=0|this._fl,O=0|this._gl,A=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var P=t[I-30],x=t[I-30+1],R=p(P,x),B=d(x,P),N=y(P=t[I-4],x=t[I-4+1]),L=b(x,P),U=t[I-14],j=t[I-14+1],C=t[I-32],M=t[I-32+1],F=B+j|0,D=R+U+g(F,B)|0;D=(D=D+N+g(F=F+L|0,L)|0)+C+g(F=F+M|0,M)|0,t[I]=D,t[I+1]=F}for(var H=0;H<160;H+=2){D=t[H],F=t[H+1];var K=c(r,n,i),W=c(m,_,E),V=l(r,m),G=l(m,r),z=h(s,k),q=h(k,s),$=a[H],X=a[H+1],Z=f(s,u,w),Y=f(k,T,O),J=A+q|0,Q=v+z+g(J,A)|0;Q=(Q=(Q=Q+Z+g(J=J+Y|0,Y)|0)+$+g(J=J+X|0,X)|0)+D+g(J=J+F|0,F)|0;var ee=G+W|0,te=V+K+g(ee,G)|0;v=w,A=O,w=u,O=T,u=s,T=k,s=o+Q+g(k=S+J|0,S)|0,o=i,S=E,i=n,E=_,n=r,_=m,r=Q+te+g(m=J+ee|0,J)|0}this._al=this._al+m|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+k|0,this._fl=this._fl+T|0,this._gl=this._gl+O|0,this._hl=this._hl+A|0,this._ah=this._ah+r+g(this._al,m)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,E)|0,this._dh=this._dh+o+g(this._dl,S)|0,this._eh=this._eh+s+g(this._el,k)|0,this._fh=this._fh+u+g(this._fl,T)|0,this._gh=this._gh+w+g(this._gl,O)|0,this._hh=this._hh+v+g(this._hl,A)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},8310:(e,t,r)=>{e.exports=i;var n=r(7007).EventEmitter;function i(){n.call(this)}r(6698)(i,n),i.Readable=r(6891),i.Writable=r(1999),i.Duplex=r(8101),i.Transform=r(9083),i.PassThrough=r(3681),i.finished=r(4257),i.pipeline=r(5267),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function f(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",f),e.on("error",f),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},2463:e=>{var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,a,s,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var f=("number"!=typeof u&&(u=0),u+1>(s=e).length||-1===s.indexOf(".",u)?"argument":"property");a='The "'.concat(e,'" ').concat(f," ").concat(i," ").concat(n(t,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},8101:(e,t,r)=>{var n=r(3184),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var o=r(6891),a=r(1999);r(6698)(c,o);for(var s=i(a.prototype),u=0;u<s.length;u++){var f=s[u];c.prototype[f]||(c.prototype[f]=a.prototype[f])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3681:(e,t,r)=>{e.exports=i;var n=r(9083);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},6891:(e,t,r)=>{var n,i=r(3184);e.exports=T,T.ReadableState=k,r(7007).EventEmitter;var o,a=function(e,t){return e.listeners(t).length},s=r(1396),u=r(8287).Buffer,f=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=r(7199);o=c&&c.debuglog?c.debuglog("stream"):function(){};var l,h,p,d=r(1766),y=r(4347),b=r(6644).getHighWaterMark,g=r(2463).F,w=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,m=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(T,s);var E=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function k(e,t,i){n=n||r(8101),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function T(e){if(n=n||r(8101),!(this instanceof T))return new T(e);var t=this instanceof n;this._readableState=new k(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function O(e,t,r,n,i){o("readableAddChunk",t);var a,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}(e,s);else if(i||(a=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new w("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),a)E(e,a);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?E(e,new _):A(e,s,t,!0);else if(s.ended)E(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?A(e,s,t,!1):B(e,s)):A(e,s,t,!1)}else n||(s.reading=!1,B(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),B(e,t)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=y.destroy,T.prototype._undestroy=y.undestroy,T.prototype._destroy=function(e,t){t(e)},T.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),O(this,e,t,!1,r)},T.prototype.unshift=function(e){return O(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(e){l||(l=r(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var I=1073741824;function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(R,e))}function R(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function B(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){o("readable nexttick read 0"),e.read(0)}function j(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function H(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}T.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):x(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?M(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(e){E(this,new m("_read()"))},T.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?y:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",(function t(i,a){o("onunpipe"),i===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}));var f=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",f);var c=!1;function l(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==H(n.pipes,e))&&!c&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),y(),e.removeListener("error",h),0===a(e,"error")&&E(e,t)}function p(){e.removeListener("finish",d),y()}function d(){o("onfinish"),e.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=H(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},T.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?x(this):n.reading||i.nextTick(U,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(L,this),r},T.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(L,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(j,e,t))}(this,e)),e.paused=!1,this},T.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5034)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=M,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(e,t){return void 0===p&&(p=r(968)),p(T,e,t)})},9083:(e,t,r)=>{e.exports=c;var n=r(2463).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(8101);function f(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(6698)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},1999:(e,t,r)=>{var n,i=r(3184);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=T,T.WritableState=k;var a,s={deprecate:r(4643)},u=r(1396),f=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=r(4347),h=r(6644).getHighWaterMark,p=r(2463).F,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,b=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,w=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,m=p.ERR_STREAM_WRITE_AFTER_END,_=p.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function S(){}function k(e,t,a){n=n||r(8101),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(R,e,t),e._writableState.errorEmitted=!0,E(e,n)):(o(n),e._writableState.errorEmitted=!0,E(e,n),R(e,t))}(e,r,n,t,o);else{var a=P(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||I(e,r),n?i.nextTick(A,e,r,a,o):A(e,r,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function T(e){var t=this instanceof(n=n||r(8101));if(!t&&!a.call(T,this))return new T(e);this._writableState=new k(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function O(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new w("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),R(e,t)}function I(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,O(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(O(e,t,!1,t.objectMode?1:f.length,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function P(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var r=P(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(T,u),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===T&&e&&e._writableState instanceof k}})):a=function(e){return e instanceof this},T.prototype.pipe=function(){E(this,new g)},T.prototype.write=function(e,t,r){var n,o=this._writableState,a=!1,s=!o.objectMode&&(n=e,f.isBuffer(n)||n instanceof c);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(e,t){var r=new m;E(e,r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var o;return null===r?o=new v:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(E(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else O(e,t,!1,s,n,i,o);return u}(this,o,s,e,t,r)),a},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||I(this,e))},T.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=l.destroy,T.prototype._undestroy=l.undestroy,T.prototype._destroy=function(e,t){t(e)}},5034:(e,t,r)=>{var n,i=r(3184);function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(4257),s=Symbol("lastResolve"),u=Symbol("lastReject"),f=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[l]=null,e[s]=null,e[u]=null,t(d(r,!1)))}}function b(e){i.nextTick(y,e)}var g=Object.getPrototypeOf((function(){})),w=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[f];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[f]?r(e[f]):t(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(d(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(w,(o(t={},p,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,f,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[p].read();n?(r[l]=null,r[s]=null,r[u]=null,e(d(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[l]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[l]=null,r[s]=null,r[u]=null,t(e)),void(r[f]=e)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(d(void 0,!0))),r[c]=!0})),e.on("readable",b.bind(null,r)),r}},1766:(e,t,r)=>{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=r(8287).Buffer,f=r(3779).inspect,c=f&&f.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,u.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return f(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},4347:(e,t,r)=>{var n=r(3184);function i(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},4257:(e,t,r)=>{var n=r(2463).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||c()},f=t._writableState&&t._writableState.finished,c=function(){s=!1,f=!0,a||o.call(t)},l=t._readableState&&t._readableState.endEmitted,h=function(){a=!1,l=!0,s||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!f?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",d),t.req?y():t.on("request",y)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",c),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",c),t.removeListener("abort",d),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",d)}}},968:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},5267:(e,t,r)=>{var n,i=r(2463).F,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function f(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var c,l=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(4257)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}(e,o,i>0,(function(e){c||(c=e),e&&h.forEach(u),o||(h.forEach(u),l(c))}))}));return t.reduce(f)}},6644:(e,t,r)=>{var n=r(2463).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},1396:(e,t,r)=>{e.exports=r(7007).EventEmitter},3141:(e,t,r)=>{var n=r(5003).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=f,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=l,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},5003:(e,t,r)=>{var n=r(8287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},1061:(e,t,r)=>{var n=r(2113);function i(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function o(e){return n.Nil(e)?"":i(e.constructor)}function a(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():i(e):n.Array(e)?"Array":e&&n.Object(e)?"Object":void 0!==e?e:""}function u(e,t,r){var i=function(e){return n.Function(e)?"":n.String(e)?JSON.stringify(e):e&&n.Object(e)?"":e}(t);return"Expected "+s(e)+", got"+(""!==r?" "+r:"")+(""!==i?" "+i:"")}function f(e,t,r){r=r||o(t),this.message=u(e,t,r),a(this,f),this.__type=e,this.__value=t,this.__valueTypeName=r}function c(e,t,r,n,i){e?(i=i||o(n),this.message=function(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),u('property "'+s(r)+o+s(e),n,i)}(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',a(this,f),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,c.prototype=Object.create(Error.prototype),c.prototype.constructor=f,e.exports={TfTypeError:f,TfPropertyTypeError:c,tfCustomError:function(e,t){return new f(e,{},t)},tfSubError:function(e,t,r){return e instanceof c?(t=t+"."+e.__property,e=new c(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof f&&(e=new c(e.__type,t,r,e.__value,e.__valueTypeName)),a(e),e},tfJSON:s,getValueTypeName:o}},9542:(e,t,r)=>{var n=r(8287).Buffer,i=r(2113),o=r(1061);function a(e){return n.isBuffer(e)}function s(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function u(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw o.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var f=u.bind(null,i.Array),c=u.bind(null,a),l=u.bind(null,s),h=u.bind(null,i.String),p=Math.pow(2,53)-1,d={ArrayN:f,Buffer:a,BufferN:c,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:s,HexN:l,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-p&&e<=p&&Math.floor(e)===e},Range:function(e,t,r){function n(n,i){return r(n,i)&&n>e&&n<t}return r=r||i.Number,n.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},n},StringN:h,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=p&&Math.floor(e)===e}};for(var y in d)d[y].toJSON=function(e){return e}.bind(null,y);e.exports=d},8676:(e,t,r)=>{var n=r(1061),i=r(2113),o=n.tfJSON,a=n.TfTypeError,s=n.TfPropertyTypeError,u=n.tfSubError,f=n.getValueTypeName,c={arrayOf:function(e,t){function r(r,n){return!!i.Array(r)&&!i.Nil(r)&&!(void 0!==t.minLength&&r.length<t.minLength)&&!(void 0!==t.maxLength&&r.length>t.maxLength)&&(void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return h(e,t,n)}catch(e){throw u(e,r)}}))}return e=l(e),t=t||{},r.toJSON=function(){var r="["+o(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,n){return i.Nil(r)||t(r,n,e)}return t=l(t),r.toJSON=function(){return"?"+o(t)},r},map:function(e,t){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{t&&h(t,o,n)}catch(e){throw u(e,o,"key")}try{var a=r[o];h(e,a,n)}catch(e){throw u(e,o)}}return!0}return e=l(e),t&&(t=l(t)),r.toJSON=t?function(){return"{"+o(t)+": "+o(e)+"}"}:function(){return"{"+o(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=l(e[r]);function n(e,r){if(!i.Object(e))return!1;if(i.Nil(e))return!1;var n;try{for(n in t)h(t[n],e[n],r)}catch(e){throw u(e,n)}if(r)for(n in e)if(!t[n])throw new s(void 0,n);return!0}return n.toJSON=function(){return o(t)},n},anyOf:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return e.some((function(e){try{return h(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(o).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return e.every((function(e){try{return h(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(o).join(" & ")},t},quacksLike:function(e){function t(t){return e===f(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return!i.Nil(t)&&!i.Nil(t.length)&&(!r||t.length===e.length)&&e.every((function(e,n){try{return h(e,t[n],r)}catch(e){throw u(e,n)}}))}return t.toJSON=function(){return"("+e.map(o).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function l(e){if(i.String(e))return"?"===e[0]?c.maybe(e.slice(1)):i[e]||c.quacksLike(e);if(e&&i.Object(e)){if(i.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return c.arrayOf(e[0])}return c.object(e)}return i.Function(e)?e:c.value(e)}function h(e,t,r,n){if(i.Function(e)){if(e(t,r))return!0;throw new a(n||e,t)}return h(l(e),t,r)}for(var p in c.oneOf=c.anyOf,i)h[p]=i[p];for(p in c)h[p]=c[p];var d=r(9542);for(p in d)h[p]=d[p];h.compile=l,h.TfTypeError=a,h.TfPropertyTypeError=s,e.exports=h},2113:e=>{var t={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var r in t.Null=t.Nil,t)t[r].toJSON=function(e){return e}.bind(null,r);e.exports=t},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},9032:(e,t,r)=>{var n=r(7244),i=r(8184),o=r(5767),a=r(5680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,c=s(Object.prototype.toString),l=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var d=s(BigInt.prototype.valueOf);if(f)var y=s(Symbol.prototype.valueOf);function b(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===c(e)}function w(e){return"[object Set]"===c(e)}function v(e){return"[object WeakMap]"===c(e)}function m(e){return"[object WeakSet]"===c(e)}function _(e){return"[object ArrayBuffer]"===c(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===c(e)}function k(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||k(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},w.working="undefined"!=typeof Set&&w(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(w.working?w(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},m.working="undefined"!=typeof WeakSet&&m(new WeakSet),t.isWeakSet=function(e){return m(e)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),t.isArrayBuffer=E,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=k;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(e){return"[object SharedArrayBuffer]"===c(e)}function A(e){return void 0!==T&&(void 0===O.working&&(O.working=O(new T)),O.working?O(e):e instanceof T)}function I(e){return b(e,l)}function P(e){return b(e,h)}function x(e){return b(e,p)}function R(e){return u&&b(e,d)}function B(e){return f&&b(e,y)}t.isSharedArrayBuffer=A,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},t.isGeneratorObject=function(e){return"[object Generator]"===c(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},t.isNumberObject=I,t.isStringObject=P,t.isBooleanObject=x,t.isBigIntObject=R,t.isSymbolObject=B,t.isBoxedPrimitive=function(e){return I(e)||P(e)||x(e)||R(e)||B(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||A(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},537:(e,t,r)=>{var n=r(3184),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(f(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(e).replace(o,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<i;s=n[++r])g(s)||!E(s)?a+=" "+s:a+=" "+f(s);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var a={},s=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}function f(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),h(n,e,n.depth)}function c(e,t){var r=f.styles[t];return r?"["+f.colors[r][0]+"m"+e+"["+f.colors[r][1]+"m":e}function l(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&T(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=h(e,i,n)),i}var o=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return w(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),k(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(T(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return e.stylize(Date.prototype.toString.call(r),"date");if(k(r))return p(r)}var f,c="",l=!1,E=["{","}"];return y(r)&&(l=!0,E=["[","]"]),T(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(c=" "+RegExp.prototype.toString.call(r)),S(r)&&(c=" "+Date.prototype.toUTCString.call(r)),k(r)&&(c=" "+p(r)),0!==a.length||l&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),f=l?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)P(t,String(a))?o.push(d(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return d(e,r,n,s,t,l)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(f,c,E)):E[0]+c+E[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),P(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(r)?h(e,u.value,null):h(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function y(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function g(e){return null===e}function w(e){return"number"==typeof e}function v(e){return"string"==typeof e}function m(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===O(e)}function E(e){return"object"==typeof e&&null!==e}function S(e){return E(e)&&"[object Date]"===O(e)}function k(e){return E(e)&&("[object Error]"===O(e)||e instanceof Error)}function T(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=y,t.isBoolean=b,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=w,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=_,t.types.isRegExp=_,t.isObject=E,t.isDate=S,t.types.isDate=S,t.isError=k,t.types.isNativeError=k,t.isFunction=T,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[A((e=new Date).getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),I[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!E(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(x&&e[x]){var t;if("function"!=typeof(t=e[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),x&&Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=x,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(R.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},8469:(e,t,r)=>{var n=r(2861).Buffer,i=9007199254740991;function o(e){if(e<0||e>i||e%1!=0)throw new RangeError("value out of range")}function a(e){return o(e),e<253?1:e<=65535?3:e<=4294967295?5:9}e.exports={encode:function e(t,r,i){if(o(t),r||(r=n.allocUnsafe(a(t))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return i||(i=0),t<253?(r.writeUInt8(t,i),e.bytes=1):t<=65535?(r.writeUInt8(253,i),r.writeUInt16LE(t,i+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,i),r.writeUInt32LE(t,i+1),e.bytes=5):(r.writeUInt8(255,i),r.writeUInt32LE(t>>>0,i+1),r.writeUInt32LE(t/4294967296|0,i+5),e.bytes=9),r},decode:function e(t,r){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=t.readUInt8(r);if(i<253)return e.bytes=1,i;if(253===i)return e.bytes=3,t.readUInt16LE(r+1);if(254===i)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var a=t.readUInt32LE(r+1),s=4294967296*t.readUInt32LE(r+5)+a;return o(s),s},encodingLength:a}},5767:(e,t,r)=>{var n=r(2682),i=r(9209),o=r(487),a=r(8075),s=r(5795),u=a("Object.prototype.toString"),f=r(9092)(),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=a("String.prototype.slice"),p=Object.getPrototypeOf,d=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};n(l,f&&s&&p?function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=s(r,Symbol.toStringTag);if(!n){var i=p(r);n=s(i,Symbol.toStringTag)}y["$"+e]=o(n.get)}}:function(e){var t=new c[e],r=t.slice||t.set;r&&(y["$"+e]=o(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!f){var t=h(u(e),8,-1);return d(l,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(y,(function(r,n){if(!t)try{r(e),t=h(n,1)}catch(e){}})),t}(e)}return s?function(e){var t=!1;return n(y,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(e){}})),t}(e):null}},7513:(e,t,r)=>{var n=r(8287).Buffer,i=r(7701);function o(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function a(e,t,r){var i=new n(r?34:33);return i.writeUInt8(e,0),t.copy(i,1),r&&(i[33]=1),i}e.exports={decode:function(e,t){return o(i.decode(e),t)},decodeRaw:o,encode:function(e,t,r){return"number"==typeof e?i.encode(a(e,t,r)):i.encode(a(e.version,e.privateKey,e.compressed))},encodeRaw:a}},1448:(e,t,r)=>{var n=r(2861).Buffer;e.exports=function(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 o=e.charAt(i),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=i}var s=e.length,u=e.charAt(0),f=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===u;)i++,r++;for(var a=(e.length-r)*f+1>>>0,c=new Uint8Array(a);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var h=0,p=a-1;(0!==l||h<o)&&-1!==p;p--,h++)l+=s*c[p]>>>0,c[p]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=h,r++}for(var d=a-o;d!==a&&0===c[d];)d++;var y=n.allocUnsafe(i+(a-d));y.fill(0,0,i);for(var b=i;d!==a;)y[b++]=c[d++];return y}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var f=(a-o)*c+1>>>0,l=new Uint8Array(f);o!==a;){for(var h=t[o],p=0,d=f-1;(0!==h||p<i)&&-1!==d;d--,p++)h+=256*l[d]>>>0,l[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=p,o++}for(var y=f-i;y!==f&&0===l[y];)y++;for(var b=u.repeat(r);y<f;++y)b+=e.charAt(l[y]);return b},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},3119:(e,t,r)=>{var n=r(1448);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8016:(e,t,r)=>{var n=r(3119),i=r(2861).Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},7701:(e,t,r)=>{var n=r(7108),i=r(8016);e.exports=i((function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}))},3184:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,u=[],f=!1,c=-1;function l(){f&&s&&(f=!1,s.length?u=s.concat(u):c=-1,u.length&&h())}function h(){if(!f){var e=a(l);f=!0;for(var t=u.length;t;){for(s=u,u=[];++c<t;)s&&s[c].run();c=-1,t=u.length}s=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||f||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},8460:()=>{},2382:()=>{},3779:()=>{},7199:()=>{},9209:(e,t,r)=>{var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},6647:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.r(t),r.d(t,{__initializeContext:()=>P,isPoint:()=>x,isPointCompressed:()=>R,isPrivate:()=>N,isXOnlyPoint:()=>B,pointAdd:()=>L,pointAddScalar:()=>U,pointCompress:()=>j,pointFromScalar:()=>C,pointMultiply:()=>D,privateAdd:()=>H,privateNegate:()=>W,privateSub:()=>K,recover:()=>Z,sign:()=>z,signRecoverable:()=>q,signSchnorr:()=>$,verify:()=>X,verifySchnorr:()=>Y,xOnlyPointAddTweak:()=>V,xOnlyPointAddTweakCheck:()=>G,xOnlyPointFromPoint:()=>F,xOnlyPointFromScalar:()=>M});var i=r(5005),o=r(6597),a=r(3423),s=e([a]);a=(s.then?(await s)():s)[0];const u=new Uint8Array(a.A.memory.buffer),f=a.A.PRIVATE_INPUT.value,c=a.A.PUBLIC_KEY_INPUT.value,l=a.A.PUBLIC_KEY_INPUT2.value,h=a.A.X_ONLY_PUBLIC_KEY_INPUT.value,p=a.A.X_ONLY_PUBLIC_KEY_INPUT2.value,d=a.A.TWEAK_INPUT.value,y=a.A.HASH_INPUT.value,b=a.A.EXTRA_DATA_INPUT.value,g=a.A.SIGNATURE_INPUT.value,w=u.subarray(f,f+o.uS),v=u.subarray(c,c+o.Lv),m=u.subarray(l,l+o.Lv),_=u.subarray(h,h+o.Sl),E=u.subarray(p,p+o.Sl),S=u.subarray(d,d+o.jp),k=u.subarray(y,y+o.Ts),T=u.subarray(b,b+o.C9),O=u.subarray(g,g+o.JZ);function A(e,t){return void 0===e?void 0!==t?t.length:o.Ah:e?o.Ah:o.Lv}function I(e){try{return v.set(e),1===a.A.isPoint(e.length)}finally{v.fill(0)}}function P(){a.A.initializeContext()}function x(e){return o._n(e)&&I(e)}function R(e){return o.uE(e)&&I(e)}function B(e){return o.xm(e)&&I(e)}function N(e){return o.Gw(e)}function L(e,t,r){o.j4(e),o.j4(t);const n=A(r,e);try{return v.set(e),m.set(t),1===a.A.pointAdd(e.length,t.length,n)?v.slice(0,n):null}finally{v.fill(0),m.fill(0)}}function U(e,t,r){o.j4(e),o.ZO(t);const n=A(r,e);try{return v.set(e),S.set(t),1===a.A.pointAddScalar(e.length,n)?v.slice(0,n):null}finally{v.fill(0),S.fill(0)}}function j(e,t){o.j4(e);const r=A(t,e);try{return v.set(e),a.A.pointCompress(e.length,r),v.slice(0,r)}finally{v.fill(0)}}function C(e,t){o.w6(e);const r=A(t);try{return w.set(e),1===a.A.pointFromScalar(r)?v.slice(0,r):null}finally{w.fill(0),v.fill(0)}}function M(e){o.w6(e);try{return w.set(e),a.A.xOnlyPointFromScalar(),_.slice(0,o.Sl)}finally{w.fill(0),_.fill(0)}}function F(e){o.j4(e);try{return v.set(e),a.A.xOnlyPointFromPoint(e.length),_.slice(0,o.Sl)}finally{v.fill(0),_.fill(0)}}function D(e,t,r){o.j4(e),o.ZO(t);const n=A(r,e);try{return v.set(e),S.set(t),1===a.A.pointMultiply(e.length,n)?v.slice(0,n):null}finally{v.fill(0),S.fill(0)}}function H(e,t){o.w6(e),o.ZO(t);try{return w.set(e),S.set(t),1===a.A.privateAdd()?w.slice(0,o.uS):null}finally{w.fill(0),S.fill(0)}}function K(e,t){if(o.w6(e),o.ZO(t),o.be(t))return new Uint8Array(e);try{return w.set(e),S.set(t),1===a.A.privateSub()?w.slice(0,o.uS):null}finally{w.fill(0),S.fill(0)}}function W(e){o.w6(e);try{return w.set(e),a.A.privateNegate(),w.slice(0,o.uS)}finally{w.fill(0)}}function V(e,t){o.L6(e),o.ZO(t);try{_.set(e),S.set(t);const r=a.A.xOnlyPointAddTweak();return-1!==r?{parity:r,xOnlyPubkey:_.slice(0,o.Sl)}:null}finally{_.fill(0),S.fill(0)}}function G(e,t,r,n){o.L6(e),o.L6(r),o.ZO(t);const s=void 0!==n;s&&o.Iq(n);try{if(_.set(e),E.set(r),S.set(t),s)return 1===a.A.xOnlyPointAddTweakCheck(n);{a.A.xOnlyPointAddTweak();const e=_.slice(0,o.Sl);return 0===(0,i.UD)(e,r)}}finally{_.fill(0),E.fill(0),S.fill(0)}}function z(e,t,r){o.Fd(e),o.w6(t),o.F1(r);try{return k.set(e),w.set(t),void 0!==r&&T.set(r),a.A.sign(void 0===r?0:1),O.slice(0,o.JZ)}finally{k.fill(0),w.fill(0),void 0!==r&&T.fill(0),O.fill(0)}}function q(e,t,r){o.Fd(e),o.w6(t),o.F1(r);try{k.set(e),w.set(t),void 0!==r&&T.set(r);const n=a.A.signRecoverable(void 0===r?0:1);return{signature:O.slice(0,o.JZ),recoveryId:n}}finally{k.fill(0),w.fill(0),void 0!==r&&T.fill(0),O.fill(0)}}function $(e,t,r){o.Fd(e),o.w6(t),o.F1(r);try{return k.set(e),w.set(t),void 0!==r&&T.set(r),a.A.signSchnorr(void 0===r?0:1),O.slice(0,o.JZ)}finally{k.fill(0),w.fill(0),void 0!==r&&T.fill(0),O.fill(0)}}function X(e,t,r,n=!1){o.Fd(e),o.j4(t),o.fK(r);try{return k.set(e),v.set(t),O.set(r),1===a.A.verify(t.length,!0===n?1:0)}finally{k.fill(0),v.fill(0),O.fill(0)}}function Z(e,t,r,n=!1){o.Fd(e),o.fK(t),o.tT(t),2&r&&o.ML(t),o.Mf((()=>B(t.subarray(0,32))));const i=A(n);try{return k.set(e),O.set(t),1===a.A.recover(i,r)?v.slice(0,i):null}finally{k.fill(0),O.fill(0),v.fill(0)}}function Y(e,t,r){o.Fd(e),o.L6(t),o.fK(r);try{return k.set(e),_.set(t),O.set(r),1===a.A.verifySchnorr()}finally{k.fill(0),_.fill(0),O.fill(0)}}n()}catch(J){n(J)}}))},4086:(e,t,r)=>{function n(){const e=function(){const e=new Uint8Array(4);if("undefined"==typeof crypto)throw new Error("The crypto object is unavailable. This may occur if your environment does not support the Web Cryptography API.");return crypto.getRandomValues(e),e}();return(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3]}r.d(t,{q:()=>n})},6597:(e,t,r)=>{r.d(t,{Ah:()=>o,C9:()=>c,F1:()=>I,Fd:()=>A,Gw:()=>w,Iq:()=>E,JZ:()=>l,L6:()=>T,Lv:()=>a,ML:()=>B,Mf:()=>x,Sl:()=>s,Ts:()=>f,ZO:()=>O,_n:()=>m,be:()=>g,fK:()=>P,j4:()=>k,jp:()=>u,tT:()=>R,uE:()=>_,uS:()=>i,w6:()=>S,xm:()=>v});var n=r(6924);const i=32,o=33,a=65,s=32,u=32,f=32,c=32,l=64,h=new Uint8Array(32),p=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65]),d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,69,81,35,25,80,183,95,196,64,45,161,114,47,201,186,238]);function y(e){return e instanceof Uint8Array}function b(e,t){for(let r=0;r<32;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function g(e){return 0===b(e,h)}function w(e){return y(e)&&e.length===i&&b(e,h)>0&&b(e,p)<0}function v(e){return y(e)&&e.length===s}function m(e){return y(e)&&(e.length===o||e.length===a)}function _(e){return y(e)&&e.length===o}function E(e){0!==e&&1!==e&&(0,n.$8)(n.H_)}function S(e){w(e)||(0,n.$8)(n.hK)}function k(e){(function(e){return y(e)&&(e.length===o||e.length===a||e.length===s)})(e)||(0,n.$8)(n.Md)}function T(e){v(e)||(0,n.$8)(n.Md)}function O(e){(function(e){return y(e)&&e.length===u&&b(e,p)<0})(e)||(0,n.$8)(n._1)}function A(e){(function(e){return y(e)&&e.length===f})(e)||(0,n.$8)(n.EW)}function I(e){(function(e){return void 0===e||y(e)&&e.length===c})(e)||(0,n.$8)(n.pA)}function P(e){(function(e){return y(e)&&64===e.length&&b(e.subarray(0,32),p)<0&&b(e.subarray(32,64),p)<0})(e)||(0,n.$8)(n.u4)}function x(e){e()||(0,n.$8)(n.u4)}function R(e){g(e.subarray(0,32))&&(0,n.$8)(n.u4),g(e.subarray(32,64))&&(0,n.$8)(n.u4)}function B(e){(function(e){return y(e)&&64===e.length&&b(e.subarray(0,32),d)<0})(e)||(0,n.$8)(n.bU)}},6924:(e,t,r)=>{r.d(t,{$8:()=>h,EW:()=>a,H_:()=>f,Md:()=>i,_1:()=>o,bU:()=>c,hK:()=>n,pA:()=>u,u4:()=>s});const n=0,i=1,o=2,a=3,s=4,u=5,f=6,c=7,l={[n.toString()]:"Expected Private",[i.toString()]:"Expected Point",[o.toString()]:"Expected Tweak",[a.toString()]:"Expected Hash",[s.toString()]:"Expected Signature",[u.toString()]:"Expected Extra Data (32 bytes)",[f.toString()]:"Expected Parity (1 | 0)",[c.toString()]:"Bad Recovery Id"};function h(e){const t=l[e.toString()]||`Unknow error code: ${e}`;throw new TypeError(t)}},3423:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{A:()=>a});var i=r(5598),o=e([i]);const a=i=(o.then?(await o)():o)[0];n()}catch(e){n(e)}}))},5005:(e,t,r)=>{r.d(t,{UD:()=>i});const n="0123456789abcdefABCDEF";function i(e,t){const r=Math.min(e.length,t.length);for(let n=0;n<r;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return e.length===t.length?0:e.length>t.length?1:-1}n.split("").map((e=>e.codePointAt(0))),Array(256).fill(!0).map(((e,t)=>{const r=String.fromCodePoint(t),i=n.indexOf(r);return i<0?void 0:i<16?i:i-6})),new TextEncoder,new TextDecoder("ascii")},5598:(e,t,r)=>{var n=r(4086),i=r(6924);e.exports=r.v(t,e.id,"873e754d6c7c6e9361f1",{"./rand.js":{generateInt32:n.q},"./validate_error.js":{throwError:i.$8}})}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,exports:{}};return i[e](r,r.exports,a),r.exports}e="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",t="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",r="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",n=e=>{e&&e.d<1&&(e.d=1,e.forEach((e=>e.r--)),e.forEach((e=>e.r--?e.r++:e())))},a.a=(i,o,a)=>{var s;a&&((s=[]).d=-1);var u,f,c,l=new Set,h=i.exports,p=new Promise(((e,t)=>{c=t,f=e}));p[t]=h,p[e]=e=>(s&&e(s),l.forEach(e),p.catch((e=>{}))),i.exports=p,o((i=>{var o;u=(i=>i.map((i=>{if(null!==i&&"object"==typeof i){if(i[e])return i;if(i.then){var o=[];o.d=0,i.then((e=>{a[t]=e,n(o)}),(e=>{a[r]=e,n(o)}));var a={};return a[e]=e=>e(o),a}}var s={};return s[e]=e=>{},s[t]=i,s})))(i);var a=()=>u.map((e=>{if(e[r])throw e[r];return e[t]})),f=new Promise((t=>{(o=()=>t(a)).r=0;var r=e=>e!==s&&!l.has(e)&&(l.add(e),e&&!e.d&&(o.r++,e.push(o)));u.map((t=>t[e](r)))}));return o.r?f:a()}),(e=>(e?c(p[r]=e):f(h),n(s)))),s&&s.d<0&&(s.d=0)},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.v=(e,t,r,n)=>{var i=fetch(a.p+""+r+".module.wasm"),o=()=>i.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,n))).then((t=>Object.assign(e,t.instance.exports)));return i.then((t=>"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t,n).then((t=>Object.assign(e,t.instance.exports)),(e=>{if("application/wasm"!==t.headers.get("Content-Type"))return console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e),o();throw e})):o()))},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})();var s=a(4317),u=(s=await s).G7,f=s.GF,c=s.wf,l=s.P8,h=s.z4,p=s.kd,d=s.cC,y=s.Wj,b=s.Bc,g=s.Qc,w=s.dF,v=s.D_,m=s.aS,_=s.y4,E=s.uW,S=s.$7,k=s.rE,T=s.rR;export{u as BitcoinUtils,f as CalldataGenerator,c as Compressor,l as ContractBaseMetadata,h as DeploymentGenerator,p as EcKeyPair,d as FundingTransaction,y as Generator,b as InteractionTransaction,g as TransactionBuilder,w as TransactionFactory,v as TransactionType,m as TweakedSigner,_ as UTXOManager,E as Wallet,S as opnet,k as version,T as wBTC};
|