@recoilpay/intent-widget 0.1.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/LICENSE +21 -0
- package/README.md +89 -0
- package/dist/chunks/add-6QI4IE74.js +15 -0
- package/dist/chunks/all-wallets-THC5DP7W.js +6 -0
- package/dist/chunks/app-store-FS2F7VYK.js +17 -0
- package/dist/chunks/apple-C2QR6WKS.js +18 -0
- package/dist/chunks/arrow-bottom-AW5LWHGC.js +8 -0
- package/dist/chunks/arrow-bottom-circle-3L4ACEWX.js +11 -0
- package/dist/chunks/arrow-left-OKHNGLQ4.js +8 -0
- package/dist/chunks/arrow-right-V4EYTZ5E.js +8 -0
- package/dist/chunks/arrow-top-XLD7PH65.js +8 -0
- package/dist/chunks/bank-DT5OX7C2.js +14 -0
- package/dist/chunks/basic-2ESEHJO2.js +2133 -0
- package/dist/chunks/browser-HWASO4BM.js +14 -0
- package/dist/chunks/card-AWLNHRWK.js +14 -0
- package/dist/chunks/ccip-7WYWVY5O.js +29 -0
- package/dist/chunks/ccip-CJPBHIYN.js +1 -0
- package/dist/chunks/ccip-P2XLZ2Q3.js +1 -0
- package/dist/chunks/ccip-TDNDQCYX.js +1 -0
- package/dist/chunks/checkmark-CFJVGYKN.js +11 -0
- package/dist/chunks/checkmark-bold-KYZGMQZC.js +8 -0
- package/dist/chunks/chevron-bottom-UFI5ZQCD.js +8 -0
- package/dist/chunks/chevron-left-IXZPWY6V.js +8 -0
- package/dist/chunks/chevron-right-YBXAUXMQ.js +8 -0
- package/dist/chunks/chevron-top-XGVJAAGN.js +8 -0
- package/dist/chunks/chrome-store-V7ZFZ4HF.js +61 -0
- package/dist/chunks/chunk-6XSLLSJX.js +1 -0
- package/dist/chunks/chunk-BFNNKT2C.js +20 -0
- package/dist/chunks/chunk-EZRXHJOM.js +9 -0
- package/dist/chunks/chunk-F7HZCPX2.js +1 -0
- package/dist/chunks/chunk-FK7PQ7YB.js +6 -0
- package/dist/chunks/chunk-FL3MRXUD.js +6 -0
- package/dist/chunks/chunk-FYS4NW6G.js +1 -0
- package/dist/chunks/chunk-GPOI2YA7.js +886 -0
- package/dist/chunks/chunk-H5GR6EPA.js +394 -0
- package/dist/chunks/chunk-JYRWMYZ2.js +36 -0
- package/dist/chunks/chunk-LQZA24C3.js +37 -0
- package/dist/chunks/chunk-MYICIF4X.js +6 -0
- package/dist/chunks/chunk-MYQCVH5Z.js +1 -0
- package/dist/chunks/chunk-OKQEFB6X.js +28 -0
- package/dist/chunks/chunk-QOQKSUB7.js +29 -0
- package/dist/chunks/chunk-WYVJ6QLD.js +29 -0
- package/dist/chunks/chunk-Z3OIWTR5.js +1 -0
- package/dist/chunks/clock-5HKMPIUO.js +8 -0
- package/dist/chunks/close-7Q5B2HQ4.js +8 -0
- package/dist/chunks/coinPlaceholder-3K6ZUCBB.js +8 -0
- package/dist/chunks/compass-W74LSHT5.js +8 -0
- package/dist/chunks/copy-6Q4PP5RG.js +15 -0
- package/dist/chunks/core-52H33BRG.js +15 -0
- package/dist/chunks/cursor-HIA7HILJ.js +3 -0
- package/dist/chunks/cursor-transparent-3QFUBR2Y.js +12 -0
- package/dist/chunks/desktop-AQ4JHUBR.js +9 -0
- package/dist/chunks/disconnect-DAKWOTZ3.js +8 -0
- package/dist/chunks/discord-5FRZ3W43.js +17 -0
- package/dist/chunks/etherscan-JBY3FG5R.js +6 -0
- package/dist/chunks/exclamation-triangle-3RG2YEHW.js +4 -0
- package/dist/chunks/extension-KJD6T6D2.js +8 -0
- package/dist/chunks/external-link-4TRP536K.js +8 -0
- package/dist/chunks/facebook-IYUAR5JX.js +26 -0
- package/dist/chunks/farcaster-32VRU3TK.js +12 -0
- package/dist/chunks/filters-XZ2LOG4T.js +8 -0
- package/dist/chunks/github-4DWZB2US.js +18 -0
- package/dist/chunks/google-7JIWLIDN.js +18 -0
- package/dist/chunks/help-circle-YBXI5V2B.js +12 -0
- package/dist/chunks/id-RY6NX47S.js +12 -0
- package/dist/chunks/image-TFG7VUHL.js +4 -0
- package/dist/chunks/index.es-SEE33E5T.js +15 -0
- package/dist/chunks/info-OGTYPPEO.js +3 -0
- package/dist/chunks/info-circle-KH5E4LQP.js +12 -0
- package/dist/chunks/lightbulb-U33OSZ3X.js +3 -0
- package/dist/chunks/mail-RCAHKDDA.js +8 -0
- package/dist/chunks/mine.wasm-DWLXBUXQ.js +1 -0
- package/dist/chunks/mobile-RMRLWRK2.js +9 -0
- package/dist/chunks/more-QN5BQZLT.js +11 -0
- package/dist/chunks/native-ESI6QOB3.js +1 -0
- package/dist/chunks/native-FKR3QBFJ.js +1 -0
- package/dist/chunks/native-J6GYQGMC.js +1 -0
- package/dist/chunks/native-YYHLKJS6.js +1 -0
- package/dist/chunks/network-placeholder-7TZ4FX3A.js +14 -0
- package/dist/chunks/nftPlaceholder-5A4AUYE2.js +8 -0
- package/dist/chunks/off-NW3B3Z3Q.js +8 -0
- package/dist/chunks/play-store-NST7OJXU.js +32 -0
- package/dist/chunks/plus-ZJXOSK2O.js +13 -0
- package/dist/chunks/qr-code-KDG2JZZK.js +6 -0
- package/dist/chunks/recycle-horizontal-3X37MC7E.js +9 -0
- package/dist/chunks/refresh-GL7N6ZKZ.js +8 -0
- package/dist/chunks/reown-logo-EXAEIT6H.js +12 -0
- package/dist/chunks/search-EDSER3WT.js +8 -0
- package/dist/chunks/secp256k1-6A42G7KH.js +11 -0
- package/dist/chunks/secp256k1-ACZE2VHK.js +10 -0
- package/dist/chunks/secp256k1-AHJALKHB.js +11 -0
- package/dist/chunks/secp256k1-Z3G34S2I.js +11 -0
- package/dist/chunks/send-G6RI7LIU.js +15 -0
- package/dist/chunks/swapHorizontal-PS74G3QM.js +8 -0
- package/dist/chunks/swapHorizontalBold-UXWIWNWD.js +8 -0
- package/dist/chunks/swapHorizontalMedium-RJ2OQ4TF.js +16 -0
- package/dist/chunks/swapHorizontalRoundedBold-7IWPKFFP.js +8 -0
- package/dist/chunks/swapVertical-BQ25C2TX.js +8 -0
- package/dist/chunks/telegram-D2ONVLTF.js +16 -0
- package/dist/chunks/three-dots-WTLTFKLX.js +5 -0
- package/dist/chunks/twitch-YCCDDY6J.js +18 -0
- package/dist/chunks/twitterIcon-W26URVWN.js +6 -0
- package/dist/chunks/verify-4BN2QIGK.js +8 -0
- package/dist/chunks/verify-filled-PMCOH3ZN.js +8 -0
- package/dist/chunks/w3m-modal-RWMJ7KYJ.js +642 -0
- package/dist/chunks/wallet-2P4SEUMP.js +8 -0
- package/dist/chunks/wallet-placeholder-V5RSTMZ2.js +14 -0
- package/dist/chunks/walletconnect-VJ2EPWKZ.js +30 -0
- package/dist/chunks/warning-circle-HB2VR6PY.js +12 -0
- package/dist/chunks/x-T5WBAOG3.js +12 -0
- package/dist/recoilpay-intent-widget.js +925 -0
- package/package.json +55 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{a as lr,b as mr,c as br,d as yr,e as hr,f as Jt,g as Kt,i as Xt,j as xr,k as gr,l as Yt,o as Qt,p as wr,r as vr,s as $r}from"./chunk-EZRXHJOM.js";var Ar="1.2.3";var g=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${Ar}`].join(`
|
|
2
|
+
`);super(i),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function E(e,t){return e.exec(t)?.groups}var en=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,tn=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Ge=/^\(.+?\).*?$/;var Pr=/^tuple(?<array>(\[(\d*)\])*)$/;function Ve(e){let t=e.type;if(Pr.test(e.type)&&"components"in e){t="(";let n=e.components.length;for(let o=0;o<n;o++){let i=e.components[o];t+=Ve(i),o<n-1&&(t+=", ")}let r=E(Pr,e.type);return t+=`)${r?.array||""}`,Ve({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function se(e){let t="",n=e.length;for(let r=0;r<n;r++){let o=e[r];t+=Ve(o),r!==n-1&&(t+=", ")}return t}function nn(e){return e.type==="function"?`function ${e.name}(${se(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${se(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${se(e.inputs)})`:e.type==="error"?`error ${e.name}(${se(e.inputs)})`:e.type==="constructor"?`constructor(${se(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}var Ir=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Er(e){return Ir.test(e)}function Mr(e){return E(Ir,e)}var Tr=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Sr(e){return Tr.test(e)}function Br(e){return E(Tr,e)}var Or=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function jr(e){return Or.test(e)}function Rr(e){return E(Or,e)}var zr=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function _e(e){return zr.test(e)}function kr(e){return E(zr,e)}var Fr=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Cr(e){return Fr.test(e)}function Nr(e){return E(Fr,e)}var Ur=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Hr(e){return Ur.test(e)}function Lr(e){return E(Ur,e)}var Ms=/^receive\(\) external payable$/;function Dr(e){return Ms.test(e)}var Gr=new Set(["indexed"]),We=new Set(["calldata","memory","storage"]);var qe=class extends g{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},Ze=class extends g{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}};var Je=class extends g{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},Ke=class extends g{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},Xe=class extends g{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},Ye=class extends g{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},Qe=class extends g{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}};var F=class extends g{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},et=class extends g{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},tt=class extends g{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}};var nt=class extends g{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}};var rt=class extends g{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};function Vr(e,t,n){let r="";if(n)for(let o of Object.entries(n)){if(!o)continue;let i="";for(let s of o[1])i+=`[${s.type}${s.name?`:${s.name}`:""}]`;r+=`(${o[0]}{${i}})`}return t?`${t}:${e}${r}`:`${e}${r}`}var ot=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function _r(e,t={}){if(jr(e))return Ts(e,t);if(Sr(e))return Ss(e,t);if(Er(e))return Bs(e,t);if(Cr(e))return Os(e,t);if(Hr(e))return js(e);if(Dr(e))return{type:"receive",stateMutability:"payable"};throw new et({signature:e})}function Ts(e,t={}){let n=Rr(e);if(!n)throw new F({signature:e,type:"function"});let r=j(n.parameters),o=[],i=r.length;for(let a=0;a<i;a++)o.push(J(r[a],{modifiers:We,structs:t,type:"function"}));let s=[];if(n.returns){let a=j(n.returns),c=a.length;for(let p=0;p<c;p++)s.push(J(a[p],{modifiers:We,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:s}}function Ss(e,t={}){let n=Br(e);if(!n)throw new F({signature:e,type:"event"});let r=j(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(J(r[s],{modifiers:Gr,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Bs(e,t={}){let n=Mr(e);if(!n)throw new F({signature:e,type:"error"});let r=j(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(J(r[s],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Os(e,t={}){let n=Nr(e);if(!n)throw new F({signature:e,type:"constructor"});let r=j(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(J(r[s],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function js(e){let t=Lr(e);if(!t)throw new F({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}var Rs=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,zs=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ks=/^u?int$/;function J(e,t){let n=Vr(e,t?.type,t?.structs);if(ot.has(n))return ot.get(n);let r=Ge.test(e),o=E(r?zs:Rs,e);if(!o)throw new Je({param:e});if(o.name&&Cs(o.name))throw new Ke({param:e,name:o.name});let i=o.name?{name:o.name}:{},s=o.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{},c,p={};if(r){c="tuple";let d=j(o.type),l=[],m=d.length;for(let b=0;b<m;b++)l.push(J(d[b],{structs:a}));p={components:l}}else if(o.type in a)c="tuple",p={components:a[o.type]};else if(ks.test(o.type))c=`${o.type}256`;else if(o.type==="address payable")c="address";else if(c=o.type,t?.type!=="struct"&&!rn(c))throw new Ze({type:c});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new Xe({param:e,type:t?.type,modifier:o.modifier});if(We.has(o.modifier)&&!Ns(c,!!o.array))throw new Ye({param:e,type:t?.type,modifier:o.modifier})}let f={type:`${c}${o.array??""}`,...i,...s,...p};return ot.set(n,f),f}function j(e,t=[],n="",r=0){let o=e.trim().length;for(let i=0;i<o;i++){let s=e[i],a=e.slice(i+1);switch(s){case",":return r===0?j(a,[...t,n.trim()]):j(a,t,`${n}${s}`,r);case"(":return j(a,t,`${n}${s}`,r+1);case")":return j(a,t,`${n}${s}`,r-1);default:return j(a,t,`${n}${s}`,r)}}if(n==="")return t;if(r!==0)throw new rt({current:n,depth:r});return t.push(n.trim()),t}function rn(e){return e==="address"||e==="bool"||e==="function"||e==="string"||en.test(e)||tn.test(e)}var Fs=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function Cs(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||en.test(e)||tn.test(e)||Fs.test(e)}function Ns(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Wr(e){let t={},n=e.length;for(let s=0;s<n;s++){let a=e[s];if(!_e(a))continue;let c=kr(a);if(!c)throw new F({signature:a,type:"struct"});let p=c.properties.split(";"),f=[],d=p.length;for(let l=0;l<d;l++){let b=p[l].trim();if(!b)continue;let h=J(b,{type:"struct"});f.push(h)}if(!f.length)throw new tt({signature:a});t[c.name]=f}let r={},o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){let[a,c]=o[s];r[a]=qr(c,t)}return r}var Us=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function qr(e=[],t={},n=new Set){let r=[],o=e.length;for(let i=0;i<o;i++){let s=e[i];if(Ge.test(s.type))r.push(s);else{let c=E(Us,s.type);if(!c?.type)throw new Qe({abiParameter:s});let{array:p,type:f}=c;if(f in t){if(n.has(f))throw new nt({type:f});r.push({...s,type:`tuple${p??""}`,components:qr(t[f],t,new Set([...n,f]))})}else if(rn(f))r.push(s);else throw new qe({type:f})}}return r}function st(e){let t=Wr(e),n=[],r=e.length;for(let o=0;o<r;o++){let i=e[o];_e(i)||n.push(_r(i,t))}return n}var Zr="0.1.1";function Jr(){return Zr}var K=class e extends Error{static setStaticOptions(t){e.prototype.docsOrigin=t.docsOrigin,e.prototype.showVersion=t.showVersion,e.prototype.version=t.version}constructor(t,n={}){let r=(()=>{if(n.cause instanceof e){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:n.cause?.message?n.cause.message:n.details})(),o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,i=n.docsOrigin??e.prototype.docsOrigin,s=`${i}${o??""}`,a=!!(n.version??e.prototype.showVersion),c=n.version??e.prototype.version,p=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o||a?["",r?`Details: ${r}`:void 0,o?`See: ${s}`:void 0,a?`Version: ${c}`:void 0]:[]].filter(f=>typeof f=="string").join(`
|
|
3
|
+
`);super(p,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=s,this.docsOrigin=i,this.docsPath=o,this.shortMessage=t,this.showVersion=a,this.version=c}walk(t){return Kr(this,t)}};Object.defineProperty(K,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${Jr()}`}});K.setStaticOptions(K.defaultStaticOptions);function Kr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Kr(e.cause,t):t?null:e}function Xr(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;let o=e.replace("0x","");if(o.length>r*2)throw new it({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}function R(e,t={}){let{signed:n,size:r}=t,o=BigInt(e),i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&n?-i-1n:0;if(i&&o>i||o<s){let p=typeof e=="bigint"?"n":"";throw new sn({max:i?`${i}${p}`:void 0,min:`${s}${p}`,signed:n,size:r,value:`${e}${p}`})}let c=`0x${(n&&o<0?BigInt.asUintN(r*8,BigInt(o)):o).toString(16)}`;return r?Ds(c,r):c}function Ds(e,t){return Xr(e,{dir:"left",size:t})}var sn=class extends K{constructor({max:t,min:n,signed:r,size:o,value:i}){super(`Number \`${i}\` is not in safe${o?` ${o*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};var it=class extends K{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};function Yr(e){return{address:e.address,amount:R(e.amount),index:R(e.index),validatorIndex:R(e.validatorIndex)}}function Qr(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:R(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:R(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:R(e.gasLimit)},...typeof e.number=="bigint"&&{number:R(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:R(e.prevRandao)},...typeof e.time=="bigint"&&{time:R(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Yr)}}}function ie(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}var an=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],at=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],eo=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],Za=[...eo,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Ja=[...eo,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}];var to="0x82ad56cb";var no="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",ro="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";var oo="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";var un="2.56.9";var cn={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${un}`};var u=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,i=cn.getDocsUrl?.({...n,docsPath:o}),s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...cn.version?[`Version: ${cn.version}`]:[]].join(`
|
|
4
|
+
`);super(s,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=un}walk(t){return so(this,t)}};function so(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?so(e.cause,t):t?null:e}var te=class extends u{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}},io=class extends u{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} \u2013 ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} \u2013 ${t.name}`],name:"ChainMismatchError"})}},ao=class extends u{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
|
|
5
|
+
`),{name:"ChainNotFoundError"})}},Me=class extends u{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}},uo=class extends u{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}};var co={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},ut={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},fo={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function A(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new ft(e.type);return`${e.name}(${ct(e.inputs,{includeName:t})})`}function ct(e,{includeName:t=!1}={}){return e?e.map(n=>_s(n,{includeName:t})).join(t?", ":","):""}function _s(e,{includeName:t}){return e.type.startsWith("tuple")?`(${ct(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function S(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function x(e){return S(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var pt=class extends u{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
6
|
+
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}},Te=class extends u{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
7
|
+
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}};var dt=class extends u{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
8
|
+
`),{metaMessages:[`Params: (${ct(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}},ae=class extends u{constructor({cause:t}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:t})}},lt=class extends u{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
|
|
9
|
+
`),{name:"AbiEncodingArrayLengthMismatchError"})}},mt=class extends u{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${x(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},bt=class extends u{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
|
|
10
|
+
`),{name:"AbiEncodingLengthMismatchError"})}},yt=class extends u{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
|
|
11
|
+
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}},Se=class extends u{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
|
|
12
|
+
`),{docsPath:n,name:"AbiErrorNotFoundError"})}},ue=class extends u{constructor(t,{docsPath:n,cause:r}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
13
|
+
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError",cause:r}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}};var z=class extends u{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
14
|
+
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}},ce=class extends u{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
15
|
+
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}},ht=class extends u{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
16
|
+
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}},xt=class extends u{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${A(t.abiItem)}\`, and`,`\`${n.type}\` in \`${A(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},po=class extends u{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};var gt=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
17
|
+
`),{docsPath:n,name:"InvalidAbiEncodingType"})}},wt=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
18
|
+
`),{docsPath:n,name:"InvalidAbiDecodingType"})}},fe=class extends u{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
19
|
+
`),{name:"InvalidArrayError"})}},ft=class extends u{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
20
|
+
`),{name:"InvalidDefinitionTypeError"})}};var Be=class extends u{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},Oe=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}},je=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}};function C(e,t,n,{strict:r}={}){return S(e,{strict:!1})?Ws(e,t,n,{strict:r}):fn(e,t,n,{strict:r})}function lo(e,t){if(typeof t=="number"&&t>0&&t>x(e)-1)throw new Be({offset:t,position:"start",size:x(e)})}function mo(e,t,n){if(typeof t=="number"&&typeof n=="number"&&x(e)!==n-t)throw new Be({offset:n,position:"end",size:x(e)})}function fn(e,t,n,{strict:r}={}){lo(e,t);let o=e.slice(t,n);return r&&mo(o,t,n),o}function Ws(e,t,n,{strict:r}={}){lo(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&mo(o,t,n),o}function X(e,{dir:t,size:n=32}={}){return typeof e=="string"?_(e,{dir:t,size:n}):qs(e,{dir:t,size:n})}function _(e,{dir:t,size:n=32}={}){if(n===null)return e;let r=e.replace("0x","");if(r.length>n*2)throw new Oe({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function qs(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Oe({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let o=0;o<n;o++){let i=t==="right";r[i?o:n-o-1]=e[i?o:e.length-o-1]}return r}var Y=class extends u{constructor({max:t,min:n,signed:r,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},vt=class extends u{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};var $t=class extends u{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function pn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function M(e,{size:t}){if(x(e)>t)throw new $t({givenSize:x(e),maxSize:t})}function dn(e,t={}){let{signed:n}=t;t.size&&M(e,{size:t.size});let r=BigInt(e);if(!n)return r;let o=Math.ceil((e.length-2)/2),i=(1n<<BigInt(o)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function bo(e,t={}){let n=dn(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new Y({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}var Zs=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function yo(e,t={}){return typeof e=="number"||typeof e=="bigint"?y(e,t):typeof e=="string"?mn(e,t):typeof e=="boolean"?ln(e,t):B(e,t)}function ln(e,t={}){let n=`0x${Number(e)}`;return typeof t.size=="number"?(M(n,{size:t.size}),X(n,{size:t.size})):n}function B(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Zs[e[o]];let r=`0x${n}`;return typeof t.size=="number"?(M(r,{size:t.size}),X(r,{dir:"right",size:t.size})):r}function y(e,t={}){let{signed:n,size:r}=t,o=BigInt(e),i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&n?-i-1n:0;if(i&&o>i||o<s){let c=typeof e=="bigint"?"n":"";throw new Y({max:i?`${i}${c}`:void 0,min:`${s}${c}`,signed:n,size:r,value:`${e}${c}`})}let a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?X(a,{size:r}):a}var Js=new TextEncoder;function mn(e,t={}){let n=Js.encode(e);return B(n,t)}var Ks=new TextEncoder;function At(e,t={}){return typeof e=="number"||typeof e=="bigint"?Ys(e,t):typeof e=="boolean"?Xs(e,t):S(e)?Pt(e,t):bn(e,t)}function Xs(e,t={}){let n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(M(n,{size:t.size}),X(n,{size:t.size})):n}var W={zero:48,nine:57,A:65,F:70,a:97,f:102};function ho(e){if(e>=W.zero&&e<=W.nine)return e-W.zero;if(e>=W.A&&e<=W.F)return e-(W.A-10);if(e>=W.a&&e<=W.f)return e-(W.a-10)}function Pt(e,t={}){let n=e;t.size&&(M(n,{size:t.size}),n=X(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);let o=r.length/2,i=new Uint8Array(o);for(let s=0,a=0;s<o;s++){let c=ho(r.charCodeAt(a++)),p=ho(r.charCodeAt(a++));if(c===void 0||p===void 0)throw new u(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[s]=c*16+p}return i}function Ys(e,t){let n=y(e,t);return Pt(n)}function bn(e,t={}){let n=Ks.encode(e);return typeof t.size=="number"?(M(n,{size:t.size}),X(n,{dir:"right",size:t.size})):n}var Qs=BigInt(0),Re=BigInt(1),ei=BigInt(2),ti=BigInt(7),ni=BigInt(256),ri=BigInt(113),wo=[],vo=[],$o=[];for(let e=0,t=Re,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],wo.push(2*(5*r+n)),vo.push((e+1)*(e+2)/2%64);let o=Qs;for(let i=0;i<7;i++)t=(t<<Re^(t>>ti)*ri)%ni,t&ei&&(o^=Re<<(Re<<BigInt(i))-Re);$o.push(o)}var Ao=lr($o,!0),oi=Ao[0],si=Ao[1],xo=(e,t,n)=>n>32?yr(e,t,n):mr(e,t,n),go=(e,t,n)=>n>32?hr(e,t,n):br(e,t,n);function ii(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,c=(s+2)%10,p=n[c],f=n[c+1],d=xo(p,f,1)^n[a],l=go(p,f,1)^n[a+1];for(let m=0;m<50;m+=10)e[s+m]^=d,e[s+m+1]^=l}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=vo[s],c=xo(o,i,a),p=go(o,i,a),f=wo[s];o=e[f],i=e[f+1],e[f]=c,e[f+1]=p}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=oi[r],e[1]^=si[r]}Yt(n)}var yn=class e extends vr{constructor(t,n,r,o=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,Jt(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=gr(this.state)}clone(){return this._cloneInto()}keccak(){Qt(this.state32),ii(this.state32,this.rounds),Qt(this.state32),this.posOut=0,this.pos=0}update(t){Xt(this),t=wr(t),Kt(t);let{blockLen:n,state:r}=this,o=t.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);for(let a=0;a<s;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,(n&128)!==0&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){Xt(this,!1),Kt(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Jt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(xr(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Yt(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new e(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},ai=(e,t,n)=>$r(()=>new yn(t,e,n));var Po=ai(1,136,256/8);function It(e,t){let n=t||"hex",r=Po(S(e,{strict:!1})?At(e):e);return n==="bytes"?r:yo(r)}var ui=e=>It(At(e));function Io(e){return ui(e)}function Eo(e){let t=!0,n="",r=0,o="",i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){e[s-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=a,n+=a}}if(!i)throw new u("Unable to normalize signature.");return o}var Mo=e=>{let t=typeof e=="string"?e:nn(e);return Eo(t)};function Et(e){return Io(Mo(e))}var N=e=>C(Et(e),0,4);var P=class extends u{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};var pe=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let n=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,n)),n}set(t,n){if(super.has(t)&&super.delete(t),super.set(t,n),this.maxSize&&this.size>this.maxSize){let r=super.keys().next().value;r!==void 0&&super.delete(r)}return this}};var ci=/^0x[a-fA-F0-9]{40}$/,hn=new pe(8192);function w(e,t){let{strict:n=!0}=t??{},r=`${e}.${n}`;if(hn.has(r))return hn.get(r);let o=ci.test(e)?e.toLowerCase()===e?!0:n?ze(e)===e:!0:!1;return hn.set(r,o),o}var xn=new pe(8192);function ze(e,t){if(xn.has(`${e}.${t}`))return xn.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=It(bn(n),"bytes"),o=(t?n.substring(`${t}0x`.length):n).split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&o[s]&&(o[s]=o[s].toUpperCase()),(r[s>>1]&15)>=8&&o[s+1]&&(o[s+1]=o[s+1].toUpperCase());let i=`0x${o.join("")}`;return xn.set(`${e}.${t}`,i),i}function gu(e,t){if(!w(e,{strict:!1}))throw new P({address:e});return ze(e,t)}var ke=class extends u{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Mt=class extends u{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},Tt=class extends u{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};var fi={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Tt({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Mt({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ke({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ke({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function To(e,{recursiveReadLimit:t=8192}={}){let n=Object.create(fi);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function So(e,t={}){typeof t.size<"u"&&M(e,{size:t.size});let n=B(e);return dn(n,t)}function Bo(e,t={}){let n=e;if(typeof t.size<"u"&&(M(n,{size:t.size}),n=pn(n)),n.length>1||n[0]>1)throw new vt(n);return!!n[0]}function U(e,t={}){typeof t.size<"u"&&M(e,{size:t.size});let n=B(e);return bo(n,t)}function Oo(e,t={}){let n=e;return typeof t.size<"u"&&(M(n,{size:t.size}),n=pn(n,{dir:"right"})),new TextDecoder().decode(n)}function jo(e){return typeof e[0]=="string"?I(e):pi(e)}function pi(e){let t=0;for(let o of e)t+=o.length;let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function I(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}var Ou=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ro=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function H(e,t){if(e.length!==t.length)throw new bt({expectedLength:e.length,givenLength:t.length});let n=di({params:e,values:t});return vn(n)}function di({params:e,values:t}){let n=[];for(let r=0;r<e.length;r++)n.push(wn({param:e[r],value:t[r]}));return n}function wn({param:e,value:t}){let n=Fe(e.type);if(n){let[r,o]=n;return mi(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return gi(t,{param:e});if(e.type==="address")return li(t);if(e.type==="bool")return yi(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let r=e.type.startsWith("int"),[,,o="256"]=Ro.exec(e.type)??[];return hi(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return bi(t,{param:e});if(e.type==="string")return xi(t);throw new gt(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function vn(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?t+=32:t+=x(a)}let n=[],r=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?(n.push(y(t+o,{size:32})),r.push(a),o+=x(a)):n.push(a)}return I([...n,...r])}function li(e){if(!w(e))throw new P({address:e});return{dynamic:!1,encoded:_(e.toLowerCase())}}function mi(e,{length:t,param:n}){let r=t===null;if(!Array.isArray(e))throw new fe(e);if(!r&&e.length!==t)throw new lt({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=e.length===0&&gn(n),i=[];for(let s=0;s<e.length;s++){let a=wn({param:n,value:e[s]});a.dynamic&&(o=!0),i.push(a)}if(r||o){let s=vn(i);if(r){let a=y(i.length,{size:32});return{dynamic:!0,encoded:I([a,s])}}if(o)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:I(i.map(({encoded:s})=>s))}}function bi(e,{param:t}){let[,n]=t.type.split("bytes"),r=x(e);if(!n){let o=e;return r%32!==0&&(o=_(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:I([_(y(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new mt({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:_(e,{dir:"right"})}}function yi(e){if(typeof e!="boolean")throw new u(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:_(ln(e))}}function hi(e,{signed:t,size:n=256}){if(typeof n=="number"){let r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Y({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:y(e,{size:32,signed:t})}}function xi(e){let t=mn(e),n=Math.ceil(x(t)/32),r=[];for(let o=0;o<n;o++)r.push(_(C(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:I([_(y(x(t),{size:32})),...r])}}function gi(e,{param:t}){let n=!1,r=[];for(let o=0;o<t.components.length;o++){let i=t.components[o],s=Array.isArray(e)?o:i.name,a=wn({param:i,value:e[s]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?vn(r):I(r.map(({encoded:o})=>o))}}function Fe(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function gn(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components.some(gn);let n=Fe(t);return n?gn({...e,type:n[1]}):!1}function le(e,t){let n=typeof t=="string"?Pt(t):t,r=To(n);if(x(n)===0&&e.length>0)throw new ae;if(x(t)&&x(t)<32)throw new dt({data:typeof t=="string"?t:B(t),params:e,size:x(t)});let o=0,i=[];for(let s=0;s<e.length;++s){let a=e[s];o<n.length&&r.setPosition(o);let[c,p]=de(r,a,{staticPosition:0});o+=p,i.push(c)}return i}function de(e,t,{staticPosition:n}){let r=Fe(t.type);if(r){let[o,i]=r;return vi(e,{...t,type:i},{length:o,staticPosition:n})}if(t.type==="tuple")return Ii(e,t,{staticPosition:n});if(t.type==="address")return wi(e);if(t.type==="bool")return $i(e);if(t.type.startsWith("bytes"))return Ai(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Pi(e,t);if(t.type==="string")return Ei(e,{staticPosition:n});throw new wt(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}var zo=32,$n=32;function wi(e){let t=e.readBytes(32);return[ze(B(fn(t,-20))),32]}function vi(e,t,{length:n,staticPosition:r}){if(n===null){let s=U(e.readBytes($n)),a=r+s,c=a+zo;e.setPosition(a);let p=U(e.readBytes(zo)),f=Ce(t),d=0,l=[];for(let m=0;m<p;++m){e.setPosition(c+(f?m*32:d));let[b,h]=de(e,t,{staticPosition:c});d+=h,l.push(b),h===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(r+32),[l,32]}if(Ce(t)){let s=U(e.readBytes($n)),a=r+s,c=[];for(let p=0;p<n;++p){e.setPosition(a+p*32);let[f]=de(e,t,{staticPosition:a});c.push(f)}return e.setPosition(r+32),[c,32]}let o=0,i=[];for(let s=0;s<n;++s){let[a,c]=de(e,t,{staticPosition:r+o});o+=c,i.push(a),c===0&&(e.assertReadLimit(),e._touch())}return[i,o]}function $i(e){return[Bo(e.readBytes(32),{size:32}),32]}function Ai(e,t,{staticPosition:n}){let[r,o]=t.type.split("bytes");if(!o){let s=U(e.readBytes(32));e.setPosition(n+s);let a=U(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];let c=e.readBytes(a);return e.setPosition(n+32),[B(c),32]}return[B(e.readBytes(Number.parseInt(o,10),32)),32]}function Pi(e,t){let n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?So(o,{signed:n}):U(o,{signed:n}),32]}function Ii(e,t,{staticPosition:n}){let r=t.components.length===0||t.components.some(({name:s})=>!s),o=r?[]:{},i=0;if(Ce(t)){let s=U(e.readBytes($n)),a=n+s;for(let c=0;c<t.components.length;++c){let p=t.components[c];e.setPosition(a+i);let[f,d]=de(e,p,{staticPosition:a});i+=d,o[r?c:p?.name]=f}return e.setPosition(n+32),[o,32]}for(let s=0;s<t.components.length;++s){let a=t.components[s],[c,p]=de(e,a,{staticPosition:n});o[r?s:a?.name]=c,i+=p}return[o,i]}function Ei(e,{staticPosition:t}){let n=U(e.readBytes(32)),r=t+n;e.setPosition(r);let o=U(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let i=e.readBytes(o,32),s=Oo(i);return e.setPosition(t+32),[s,32]}function Ce(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(Ce);let n=Fe(e.type);return!!(n&&Ce({...e,type:n[1]}))}function St(e){let{abi:t,data:n,cause:r}=e,o=C(n,0,4);if(o==="0x")throw new ae({cause:r});let s=[...t||[],ut,fo].find(a=>a.type==="error"&&o===N(A(a)));if(!s)throw new ue(o,{docsPath:"/docs/contract/decodeErrorResult",cause:r});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?le(s.inputs,C(n,4)):void 0,errorName:s.name}}var L=(e,t,n)=>JSON.stringify(e,(r,o)=>{let i=typeof o=="bigint"?o.toString():o;return typeof t=="function"?t(r,i):i},n);function An({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,i)=>`${r&&o.name?`${o.name}: `:""}${typeof t[i]=="object"?L(t[i]):t[i]}`).join(", ")})`}var ko=Et;function D(e){let{abi:t,args:n=[],name:r}=e,o=S(r,{strict:!1}),i=t.filter(a=>o?a.type==="function"?N(a)===r:a.type==="event"?ko(a)===r:!1:"name"in a&&a.name===r);if(i.length===0)return;if(i.length===1)return i[0];let s;for(let a of i){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((p,f)=>{let d="inputs"in a&&a.inputs[f];return d?Pn(p,d):!1})){if(s&&"inputs"in s&&s.inputs){let p=Fo(a.inputs,s.inputs,n);if(p)throw new xt({abiItem:a,type:p[0]},{abiItem:s,type:p[1]})}s=a}}return s||i[0]}function Pn(e,t){let n=typeof e,r=t.type;switch(r){case"address":return w(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>n==="object"&&Pn(Object.values(e)[i],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>Pn(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Fo(e,t,n){for(let r in e){let o=e[r],i=t[r];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return Fo(o.components,i.components,n[r]);let s=[o.type,i.type];if(s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?w(n[r],{strict:!1}):s.includes("address")&&s.includes("bytes")?w(n[r],{strict:!1}):!1)return s}}var Bt={wei:0,gwei:9,szabo:12,finney:15,ether:18};function Co(e,t=0){if(!Number.isInteger(t)||t<0)throw new Ot({decimals:t});let n=e.toString(),r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${i?`.${i}`:""}`}function No(e,t="wei"){return Co(e,Bt.ether-Bt[t])}function Uo(e,t="wei"){return Co(e,Bt.gwei-Bt[t])}function gc(e,t=0){if(!Number.isInteger(t)||t<0)throw new Ot({decimals:t});if(!/^-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/.test(e))throw new In({value:e});let[n="",r="0"]=e.split("."),o=n.startsWith("-");if(o&&(n=n.slice(1)),n===""&&(n="0"),r=r.replace(/(0+)$/,""),t===0)r.length>0&&Number.parseInt(r[0],10)>=5&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){let i=r.slice(0,t);if(Number.parseInt(r.slice(t,t+1),10)>=5){let a=Mi(i);a.length>t?(r=a.slice(1),n=`${BigInt(n)+1n}`):r=a}else r=i}else r=r.padEnd(t,"0");return BigInt(`${o?"-":""}${n}${r}`)}function Mi(e){let t=e.split(""),n=t.length-1;for(;n>=0;){let r=Number.parseInt(t[n],10)+1;if(r<10)return t[n]=String(r),t.join("");t[n]="0",n--}return`1${t.join("")}`}var In=class extends Error{constructor({value:t}){super(`Value \`${t}\` is not a valid decimal number.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}},Ot=class extends Error{constructor({decimals:t}){super(`\`decimals\` must be a non-negative integer. Got \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}};function jt(e,t="wei"){return No(e,t)}function T(e,t="wei"){return Uo(e,t)}var Rt=class extends u{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}},zt=class extends u{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}};function Lo(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
21
|
+
`,"")}function Do(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
|
|
22
|
+
`;return r.nonce&&(o+=` nonce: ${r.nonce}
|
|
23
|
+
`),r.balance&&(o+=` balance: ${r.balance}
|
|
24
|
+
`),r.code&&(o+=` code: ${r.code}
|
|
25
|
+
`),r.state&&(o+=` state:
|
|
26
|
+
`,o+=Lo(r.state)),r.stateDiff&&(o+=` stateDiff:
|
|
27
|
+
`,o+=Lo(r.stateDiff)),o},` State Override:
|
|
28
|
+
`).slice(0,-1)}function Ne(e){let t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
|
|
29
|
+
`)}var Go=class extends u{constructor({filledNonce:t,requestedNonce:n}){super("The filled transaction nonce does not match the requested nonce.",{metaMessages:[`Requested Nonce: ${n}`,`Filled Nonce: ${t}`],name:"FeePayerNonceMismatchError"})}},Vo=class extends u{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}};var _o=class extends u{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ne(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}};var Wo=class extends u{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}},qo=class extends u{constructor(t,{account:n,docsPath:r,chain:o,data:i,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:p,nonce:f,to:d,value:l}){let m=Ne({chain:o&&`${o?.name} (id: ${o?.id})`,from:n?.address,to:d,value:typeof l<"u"&&`${jt(l)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:typeof a<"u"&&`${T(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${T(c)} gwei`,maxPriorityFeePerGas:typeof p<"u"&&`${T(p)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",m].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}},Zo=class extends u{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:o,index:i}){let s="Transaction";r&&i!==void 0&&(s=`Transaction at block time "${r}" at index "${i}"`),t&&i!==void 0&&(s=`Transaction at block hash "${t}" at index "${i}"`),n&&i!==void 0&&(s=`Transaction at block number "${n}" at index "${i}"`),o&&(s=`Transaction with hash "${o}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}},Jo=class extends u{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}};var Ko=class extends u{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}};var Xo=e=>e;function me(e){if(e?.reason)return e.reason;if(typeof DOMException=="function")return new DOMException("This operation was aborted","AbortError");let t=new Error("This operation was aborted");return t.name="AbortError",t}function Ue(e){return typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}var ne=e=>{try{let t=new URL(e);return!t.username&&!t.password?e:(t.username="",t.password="",t.toString())}catch{return e}};var kt=class extends u{constructor(t,{account:n,docsPath:r,chain:o,data:i,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:p,nonce:f,to:d,value:l,stateOverride:m}){let b=n?ie(n):void 0,h=Ne({from:b?.address,to:d,value:typeof l<"u"&&`${jt(l)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:typeof a<"u"&&`${T(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${T(c)} gwei`,maxPriorityFeePerGas:typeof p<"u"&&`${T(p)} gwei`,nonce:f});m&&(h+=`
|
|
30
|
+
${Do(m)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",h].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}},Yo=class extends u{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:i,functionName:s,sender:a}){let c=D({abi:n,args:r,name:s}),p=c?An({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=c?A(c,{includeName:!0}):void 0,d=Ne({address:o&&Xo(o),function:f,args:p&&p!=="()"&&`${[...Array(s?.length??0).keys()].map(()=>" ").join("")}${p}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=o,this.functionName=s,this.sender=a}},Qo=class extends u{constructor({abi:t,data:n,functionName:r,message:o,cause:i}){let s,a,c,p;if(n&&n!=="0x")try{a=St({abi:t,data:n,cause:i});let{abiItem:d,errorName:l,args:m}=a;if(l==="Error")p=m[0];else if(l==="Panic"){let[b]=m;p=co[b]}else{let b=d?A(d,{includeName:!0}):void 0,h=d&&m?An({abiItem:d,args:m,includeFunctionName:!1,includeName:!1}):void 0;c=[b?`Error: ${b}`:"",h&&h!=="()"?` ${[...Array(l?.length??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(d){s=d}else o&&(p=o);let f;s instanceof ue&&(f=s.signature,c=[`Unable to decode signature "${f}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${f}.`]),super(p&&p!=="execution reverted"||f?[`The contract function "${r}" reverted with the following ${f?"signature":"reason"}:`,p||f].join(`
|
|
31
|
+
`):`The contract function "${r}" reverted.`,{cause:s??i,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=n,this.reason=p,this.signature=f}},es=class extends u{constructor({functionName:t,cause:n}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:n})}},Ft=class extends u{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}},Ct=class extends u{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}};var En="/docs/contract/decodeFunctionResult";function ts(e){let{abi:t,args:n,functionName:r,data:o}=e,i=t[0];if(r){let a=D({abi:t,args:n,name:r});if(!a)throw new z(r,{docsPath:En});i=a}if(i.type!=="function")throw new z(void 0,{docsPath:En});if(!i.outputs)throw new ce(i.name,{docsPath:En});let s=le(i.outputs,o);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}var Mn="/docs/contract/encodeDeployData";function Tn(e){let{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;let o=t.find(s=>"type"in s&&s.type==="constructor");if(!o)throw new pt({docsPath:Mn});if(!("inputs"in o))throw new Te({docsPath:Mn});if(!o.inputs||o.inputs.length===0)throw new Te({docsPath:Mn});let i=H(o.inputs,n);return I([r,i])}var ns="/docs/contract/encodeFunctionData";function rs(e){let{abi:t,args:n,functionName:r}=e,o=t[0];if(r){let i=D({abi:t,args:n,name:r});if(!i)throw new z(r,{docsPath:ns});o=i}if(o.type!=="function")throw new z(void 0,{docsPath:ns});return{abi:[o],functionName:N(A(o))}}function os(e){let{args:t}=e,{abi:n,functionName:r}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:rs(e),o=n[0],i=r,s="inputs"in o&&o.inputs?H(o.inputs,t??[]):void 0;return I([i,s??"0x"])}function Nt(e,t){if(!w(e,{strict:!1}))throw new P({address:e});if(!w(t,{strict:!1}))throw new P({address:t});return e.toLowerCase()===t.toLowerCase()}function Sn(e){let{blockHash:t,blockNumber:n,blockTag:r,requireCanonical:o}=e;if(o!==void 0&&!t)throw new u("`requireCanonical` can only be provided when `blockHash` is set.");return t?o?{blockHash:t,requireCanonical:o}:{blockHash:t}:typeof n=="bigint"?y(n):r??"latest"}function ss({blockNumber:e,chain:t,contract:n}){let r=t?.contracts?.[n];if(!r)throw new te({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new te({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}var q=class extends u{constructor({cause:t,message:n}={}){let r=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};Object.defineProperty(q,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(q,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});var Q=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${T(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(Q,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});var be=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${T(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};Object.defineProperty(be,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});var ye=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};Object.defineProperty(ye,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});var he=class extends u{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
32
|
+
`),{cause:t,name:"NonceTooLowError"})}};Object.defineProperty(he,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});var xe=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};Object.defineProperty(xe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});var ge=class extends u{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
33
|
+
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(ge,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});var we=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(we,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});var ve=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(ve,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});var $e=class extends u{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty($e,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});var ee=class extends u{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${T(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${T(r)} gwei`:""}).`].join(`
|
|
34
|
+
`),{cause:t,name:"TipAboveFeeCapError"})}};Object.defineProperty(ee,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});var Ae=class extends u{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}};var He=class extends u{constructor({body:t,cause:n,details:r,headers:o,status:i,url:s}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${ne(s)}`,t&&`Request body: ${L(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=i,this.url=s}},is=class extends u{constructor({maxSize:t,size:n}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${t} bytes`,`Received: ${n} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t,this.size=n}};var Ut=class extends u{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${ne(r)}`,`Request body: ${L(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}};var as=class extends u{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${ne(n)}`,`Request body: ${L(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}};var Ti=-1,v=class extends u{constructor(t,{code:n,docsPath:r,metaMessages:o,name:i,shortMessage:s}){super(s,{cause:t,docsPath:r,metaMessages:o||t?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||t.name,this.code=t instanceof Ut?t.code:n??Ti}},$=class extends v{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}},Bn=class e extends v{constructor(t){super(t,{code:e.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};Object.defineProperty(Bn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var On=class e extends v{constructor(t){super(t,{code:e.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};Object.defineProperty(On,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var jn=class e extends v{constructor(t,{method:n}={}){super(t,{code:e.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}};Object.defineProperty(jn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var Rn=class e extends v{constructor(t){super(t,{code:e.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
35
|
+
`)})}};Object.defineProperty(Rn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var zn=class e extends v{constructor(t){super(t,{code:e.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};Object.defineProperty(zn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var kn=class e extends v{constructor(t){super(t,{code:e.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
36
|
+
`)})}};Object.defineProperty(kn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var Fn=class e extends v{constructor(t){super(t,{code:e.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(Fn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var Cn=class e extends v{constructor(t){super(t,{code:e.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};Object.defineProperty(Cn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var Nn=class e extends v{constructor(t){super(t,{code:e.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};Object.defineProperty(Nn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var Un=class e extends v{constructor(t,{method:n}={}){super(t,{code:e.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}};Object.defineProperty(Un,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var Hn=class e extends v{constructor(t){super(t,{code:e.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};Object.defineProperty(Hn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var Ln=class e extends v{constructor(t){super(t,{code:e.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};Object.defineProperty(Ln,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var Dn=class e extends ${constructor(t){super(t,{code:e.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(Dn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var Gn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};Object.defineProperty(Gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var Vn=class e extends ${constructor(t,{method:n}={}){super(t,{code:e.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}};Object.defineProperty(Vn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var _n=class e extends ${constructor(t){super(t,{code:e.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};Object.defineProperty(_n,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var Wn=class e extends ${constructor(t){super(t,{code:e.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(Wn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});var qn=class e extends ${constructor(t){super(t,{code:e.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(qn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});var Zn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}};Object.defineProperty(Zn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});var Jn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}};Object.defineProperty(Jn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});var Kn=class e extends ${constructor(t){super(t,{code:e.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}};Object.defineProperty(Kn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});var Xn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}};Object.defineProperty(Xn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});var Yn=class e extends ${constructor(t){super(t,{code:e.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}};Object.defineProperty(Yn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});var Qn=class e extends ${constructor(t){super(t,{code:e.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}};Object.defineProperty(Qn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});var er=class e extends ${constructor(t){super(t,{code:e.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}};Object.defineProperty(er,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});var tr=class e extends ${constructor(t){super(t,{code:e.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}};Object.defineProperty(tr,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});var us=class extends v{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}};function cs(e,t){let n=(e.details||"").toLowerCase(),r=e instanceof u?e.walk(o=>o?.code===q.code):e;return r instanceof u?new q({cause:e,message:r.details}):q.nodeMessage.test(n)?new q({cause:e,message:e.details}):Q.nodeMessage.test(n)?new Q({cause:e,maxFeePerGas:t?.maxFeePerGas}):be.nodeMessage.test(n)?new be({cause:e,maxFeePerGas:t?.maxFeePerGas}):ye.nodeMessage.test(n)?new ye({cause:e,nonce:t?.nonce}):he.nodeMessage.test(n)?new he({cause:e,nonce:t?.nonce}):xe.nodeMessage.test(n)?new xe({cause:e,nonce:t?.nonce}):ge.nodeMessage.test(n)?new ge({cause:e}):we.nodeMessage.test(n)?new we({cause:e,gas:t?.gas}):ve.nodeMessage.test(n)?new ve({cause:e,gas:t?.gas}):$e.nodeMessage.test(n)?new $e({cause:e}):ee.nodeMessage.test(n)?new ee({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Ae({cause:e})}function fs(e,{docsPath:t,...n}){let r=(()=>{let o=cs(e,n);return o instanceof Ae?e:o})();return new kt(r,{docsPath:t,...n})}function ps(e,{format:t}){if(!t)return{};let n={};function r(i){let s=Object.keys(i);for(let a of s)a in e&&(n[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&r(i[a])}let o=t(e||{});return r(o),n}function Rf(e,t){return({exclude:n,format:r})=>({exclude:n,format:(o,i)=>{let s=t(o,i);if(n)for(let a of n)delete s[a];return{...s,...r(o,i)}},type:e})}var Si={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function ds(e,t){let n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Bi(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>B(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=y(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=y(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=y(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=y(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=y(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=y(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Si[e.type]),typeof e.value<"u"&&(n.value=y(e.value)),n}function Bi(e){return e.map(t=>({address:t.address,r:t.r?y(BigInt(t.r)):t.r,s:t.s?y(BigInt(t.s)):t.s,chainId:y(t.chainId),nonce:y(t.nonce),...typeof t.yParity<"u"?{yParity:y(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:y(t.v)}:{}}))}function ls(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}var nr=new Map;function ms({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){let i=async()=>{let f=c();s();let d=f.map(({args:l})=>l);d.length!==0&&e(d).then(l=>{o&&Array.isArray(l)&&l.sort(o);for(let m=0;m<f.length;m++){let{resolve:b}=f[m];b?.([l[m],l])}}).catch(l=>{for(let m=0;m<f.length;m++){let{reject:b}=f[m];b?.(l)}})},s=()=>nr.delete(t),a=()=>c().map(({args:f})=>f),c=()=>nr.get(t)||[],p=f=>nr.set(t,[...c(),f]);return{flush:s,async schedule(f){let{promise:d,resolve:l,reject:m}=ls();return n?.([...a(),f])&&i(),c().length>0?(p({args:f,resolve:l,reject:m}),d):(p({args:f,resolve:l,reject:m}),setTimeout(i,r),d)}}}function bs(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new je({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new je({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Oi(e){let{balance:t,nonce:n,state:r,stateDiff:o,code:i}=e,s={};if(i!==void 0&&(s.code=i),t!==void 0&&(s.balance=y(t)),n!==void 0&&(s.nonce=y(n)),r!==void 0&&(s.state=bs(r)),o!==void 0){if(s.state)throw new zt;s.stateDiff=bs(o)}return s}function ys(e){if(!e)return;let t={};for(let{address:n,...r}of e){if(!w(n,{strict:!1}))throw new P({address:n});if(t[n])throw new Rt({address:n});t[n]=Oi(r)}return t}var Wf=2n**(8n-1n)-1n,qf=2n**(16n-1n)-1n,Zf=2n**(24n-1n)-1n,Jf=2n**(32n-1n)-1n,Kf=2n**(40n-1n)-1n,Xf=2n**(48n-1n)-1n,Yf=2n**(56n-1n)-1n,Qf=2n**(64n-1n)-1n,e1=2n**(72n-1n)-1n,t1=2n**(80n-1n)-1n,n1=2n**(88n-1n)-1n,r1=2n**(96n-1n)-1n,o1=2n**(104n-1n)-1n,s1=2n**(112n-1n)-1n,i1=2n**(120n-1n)-1n,a1=2n**(128n-1n)-1n,u1=2n**(136n-1n)-1n,c1=2n**(144n-1n)-1n,f1=2n**(152n-1n)-1n,p1=2n**(160n-1n)-1n,d1=2n**(168n-1n)-1n,l1=2n**(176n-1n)-1n,m1=2n**(184n-1n)-1n,b1=2n**(192n-1n)-1n,y1=2n**(200n-1n)-1n,h1=2n**(208n-1n)-1n,x1=2n**(216n-1n)-1n,g1=2n**(224n-1n)-1n,w1=2n**(232n-1n)-1n,v1=2n**(240n-1n)-1n,$1=2n**(248n-1n)-1n,A1=2n**(256n-1n)-1n,P1=-(2n**(8n-1n)),I1=-(2n**(16n-1n)),E1=-(2n**(24n-1n)),M1=-(2n**(32n-1n)),T1=-(2n**(40n-1n)),S1=-(2n**(48n-1n)),B1=-(2n**(56n-1n)),O1=-(2n**(64n-1n)),j1=-(2n**(72n-1n)),R1=-(2n**(80n-1n)),z1=-(2n**(88n-1n)),k1=-(2n**(96n-1n)),F1=-(2n**(104n-1n)),C1=-(2n**(112n-1n)),N1=-(2n**(120n-1n)),U1=-(2n**(128n-1n)),H1=-(2n**(136n-1n)),L1=-(2n**(144n-1n)),D1=-(2n**(152n-1n)),G1=-(2n**(160n-1n)),V1=-(2n**(168n-1n)),_1=-(2n**(176n-1n)),W1=-(2n**(184n-1n)),q1=-(2n**(192n-1n)),Z1=-(2n**(200n-1n)),J1=-(2n**(208n-1n)),K1=-(2n**(216n-1n)),X1=-(2n**(224n-1n)),Y1=-(2n**(232n-1n)),Q1=-(2n**(240n-1n)),ep=-(2n**(248n-1n)),tp=-(2n**(256n-1n)),np=2n**8n-1n,rp=2n**16n-1n,op=2n**24n-1n,sp=2n**32n-1n,ip=2n**40n-1n,ap=2n**48n-1n,up=2n**56n-1n,cp=2n**64n-1n,fp=2n**72n-1n,pp=2n**80n-1n,dp=2n**88n-1n,lp=2n**96n-1n,mp=2n**104n-1n,bp=2n**112n-1n,yp=2n**120n-1n,hp=2n**128n-1n,xp=2n**136n-1n,gp=2n**144n-1n,wp=2n**152n-1n,vp=2n**160n-1n,$p=2n**168n-1n,Ap=2n**176n-1n,Pp=2n**184n-1n,Ip=2n**192n-1n,Ep=2n**200n-1n,Mp=2n**208n-1n,Tp=2n**216n-1n,Sp=2n**224n-1n,Bp=2n**232n-1n,Op=2n**240n-1n,jp=2n**248n-1n,hs=2n**256n-1n;function xs(e){let{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,i=t?ie(t):void 0;if(i&&!w(i.address))throw new P({address:i.address});if(o&&!w(o))throw new P({address:o});if(n&&n>hs)throw new Q({maxFeePerGas:n});if(r&&n&&r>n)throw new ee({maxFeePerGas:n,maxPriorityFeePerGas:r})}async function ws(e,t){let{account:n=e.account,authorizationList:r,batch:o=!!e.batch?.multicall,blockHash:i,blockNumber:s,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,accessList:p,blobs:f,blockOverrides:d,code:l,data:m,factory:b,factoryData:h,gas:Pe,gasPrice:Gt,maxFeePerBlobGas:Vt,maxFeePerGas:Ie,maxPriorityFeePerGas:_t,nonce:Ee,requestOptions:G,to:O,value:re,stateOverride:Wt,...Le}=t,ur=n?ie(n):void 0;if(l&&(b||h))throw new u("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&O)throw new u("Cannot provide both `code` & `to` as parameters.");let cr=l&&m,fr=b&&h&&O&&m,pr=cr||fr,Is=cr?$s({code:l,data:m}):fr?Ci({data:m,factory:b,factoryData:h,to:O}):m;try{xs(t);let oe=Sn({blockHash:i,blockNumber:s,blockTag:a,requireCanonical:c}),V=d?Qr(d):void 0,Z=ys(Wt),De=e.chain?.formatters?.transactionRequest?.format,qt=(De||ds)({...ps(Le,{format:De}),accessList:p,account:ur,authorizationList:r,blobs:f,data:Is,gas:Pe,gasPrice:Gt,maxFeePerBlobGas:Vt,maxFeePerGas:Ie,maxPriorityFeePerGas:_t,nonce:Ee,to:pr?void 0:O,value:re},"call");if(o&&ji({request:qt})&&!V&&i===void 0)try{let{deployless:k=!1}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},Zt=vs(e,{blockNumber:s,deployless:k});if(!Zt||!Fi(Z,Zt))return await ki(e,{...qt,blockHash:i,blockNumber:s,blockTag:a,multicallAddress:Zt,requestOptions:G,requireCanonical:c,rpcStateOverride:Z})}catch(k){if(!(k instanceof Me)&&!(k instanceof te))throw k}let Es=(()=>{let k=[qt,oe];return Z&&V?[...k,Z,V]:Z?[...k,Z]:V?[...k,{},V]:k})(),dr=await e.request({method:"eth_call",params:Es},G);return dr==="0x"?{data:void 0}:{data:dr}}catch(oe){if(G?.signal?.aborted)throw me(G.signal);if(Ue(oe))throw oe;let V=Ni(oe),{offchainLookup:Z,offchainLookupSignature:De}=await import("./ccip-CJPBHIYN.js");if(e.ccipRead!==!1&&V?.slice(0,10)===De&&O)return{data:await Z(e,{data:V,requestOptions:G,to:O})};throw pr&&V?.slice(0,10)==="0x101bb98d"?new Ft({factory:b}):fs(oe,{...t,account:ur,chain:e.chain})}}function ji({request:e}){let{data:t,to:n,...r}=e;return!(!t||t.startsWith(to)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}var Ri=0,gs=new WeakMap;function zi(e){if(!e)return"default";let t=gs.get(e);if(t!==void 0)return t;let n=Ri++;return gs.set(e,n),n}async function ki(e,t){let{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockHash:i,blockNumber:s,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,data:p,multicallAddress:f,requestOptions:d,rpcStateOverride:l,to:m}=t,b=f!==void 0?f:vs(e,{blockNumber:s,deployless:r}),h=Sn({blockHash:i,blockNumber:s,blockTag:a,requireCanonical:c}),Pe=typeof h=="string"?h:JSON.stringify(h),Gt=l?`.${JSON.stringify(l)}`:"",{schedule:Vt}=ms({id:`${e.uid}.${Pe}.${zi(d)}${Gt}`,wait:o,shouldSplitBatch(Ee){return Ee.reduce((O,{data:re})=>O+(re.length-2),0)>n*2},fn:async Ee=>{let G=Ee.map(Le=>({allowFailure:!0,callData:Le.data,target:Le.to})),O=os({abi:an,args:[G],functionName:"aggregate3"}),re={...b===null?{data:$s({code:oo,data:O})}:{to:b,data:O}},Wt=await e.request({method:"eth_call",params:l?[re,h,l]:[re,h]},d);return ts({abi:an,args:[G],functionName:"aggregate3",data:Wt||"0x"})}}),[{returnData:Ie,success:_t}]=await Vt({data:p,to:m});if(!_t)throw new Ct({data:Ie});return Ie==="0x"?{data:void 0}:{data:Ie}}function vs(e,t){let{blockNumber:n,deployless:r}=t;if(r)return null;if(e.chain)return ss({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new Me}function Fi(e,t){return e?Object.keys(e).some(n=>Nt(n,t)):!1}function $s(e){let{code:t,data:n}=e;return Tn({abi:st(["constructor(bytes, bytes)"]),bytecode:no,args:[t,n]})}function Ci(e){let{data:t,factory:n,factoryData:r,to:o}=e;return Tn({abi:st(["constructor(address, bytes, address, bytes)"]),bytecode:ro,args:[o,t,n,r]})}function Ni(e){if(!(e instanceof u))return;let t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}var Ht=class extends u{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:i,urls:s}){super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],n.metaMessages?.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(a=>` ${ne(a)}`)],` Sender: ${i}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}},Lt=class extends u{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${ne(n)}`,`Response: ${L(t)}`],name:"OffchainLookupResponseMalformedError"})}},Dt=class extends u{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}};function As(e){let{abi:t,data:n}=e,r=C(n,0,4),o=t.find(i=>i.type==="function"&&r===N(A(i)));if(!o)throw new ht(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?le(o.inputs,C(n,4)):void 0}}var rr="/docs/contract/encodeErrorResult";function or(e){let{abi:t,errorName:n,args:r}=e,o=t[0];if(n){let c=D({abi:t,args:r,name:n});if(!c)throw new Se(n,{docsPath:rr});o=c}if(o.type!=="error")throw new Se(void 0,{docsPath:rr});let i=A(o),s=N(i),a="0x";if(r&&r.length>0){if(!o.inputs)throw new yt(o.name,{docsPath:rr});a=H(o.inputs,r)}return I([s,a])}var sr="/docs/contract/encodeFunctionResult";function Ps(e){let{abi:t,functionName:n,result:r}=e,o=t[0];if(n){let s=D({abi:t,name:n});if(!s)throw new z(n,{docsPath:sr});o=s}if(o.type!=="function")throw new z(void 0,{docsPath:sr});if(!o.outputs)throw new ce(o.name,{docsPath:sr});let i=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new fe(r)})();return H(o.outputs,i)}var ir="x-batch-gateway:true";async function ar(e){let{data:t,ccipRequest:n}=e,{args:[r]}=As({abi:at,data:t}),o=[],i=[];return await Promise.all(r.map(async(s,a)=>{try{i[a]=s.urls.includes(ir)?await ar({data:s.data,ccipRequest:n}):await n(s),o[a]=!1}catch(c){o[a]=!0,i[a]=Ui(c)}})),Ps({abi:at,functionName:"query",result:[o,i]})}function Ui(e){return e.name==="HttpRequestError"&&e.status?or({abi:at,errorName:"HttpError",args:[e.status,e.shortMessage]}):or({abi:[ut],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}var Wd="0x556f1830",Hi={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function qd(e,{blockNumber:t,blockTag:n,data:r,requestOptions:o,to:i}){let{args:s}=St({data:r,abi:[Hi]}),[a,c,p,f,d]=s,{ccipRead:l}=e,m=l&&typeof l?.request=="function"?l.request:Li;try{if(!Nt(i,a))throw new Dt({sender:a,to:i});let b=c.includes(ir)?await ar({data:p,ccipRequest:Pe=>m({...Pe,requestOptions:o})}):await m({data:p,requestOptions:o,sender:a,urls:c}),{data:h}=await ws(e,{blockNumber:t,blockTag:n,data:jo([f,H([{type:"bytes"},{type:"bytes"}],[b,d])]),requestOptions:o,to:i});return h}catch(b){throw o?.signal?.aborted?me(o.signal):Ue(b)?b:new Ht({callbackSelector:f,cause:b,data:r,extraData:d,sender:a,urls:c})}}async function Li({data:e,requestOptions:t,sender:n,urls:r}){let o=new Error("An unknown error occurred.");for(let i=0;i<r.length;i++){if(t?.signal?.aborted)throw me(t.signal);let s=r[i],a=s.includes("{data}")?"GET":"POST",c=a==="POST"?{data:e,sender:n}:void 0,p=a==="POST"?{"Content-Type":"application/json"}:{};try{let f=await fetch(s.replace("{sender}",n.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:p,method:a,...t?.signal?{signal:t.signal}:{}}),d;if(f.headers.get("Content-Type")?.startsWith("application/json")?d=(await f.json()).data:d=await f.text(),!f.ok){o=new He({body:c,details:d?.error?L(d.error):f.statusText,headers:f.headers,status:f.status,url:s});continue}if(!S(d)){o=new Lt({result:d,url:s});continue}return d}catch(f){if(t?.signal?.aborted)throw me(t.signal);if(Ue(f))throw f;o=new He({body:c,details:f.message,url:s})}}throw o}export{S as a,x as b,u as c,ae as d,po as e,pn as f,dn as g,bo as h,yo as i,B as j,y as k,At as l,Pt as m,It as n,P as o,pe as p,ze as q,gu as r,w as s,jo as t,I as u,C as v,Ou as w,Ro as x,H as y,ie as z,os as A,To as B,L as C,Co as D,gc as E,jt as F,T as G,Ne as H,Go as I,Vo as J,_o as K,Wo as L,qo as M,Zo as N,Jo as O,Ko as P,me as Q,Ue as R,Yo as S,Qo as T,es as U,Ct as V,He as W,is as X,Ut as Y,as as Z,Bn as _,On as $,jn as aa,Rn as ba,zn as ca,kn as da,Fn as ea,Cn as fa,Nn as ga,Un as ha,Hn as ia,Ln as ja,Dn as ka,Gn as la,Vn as ma,_n as na,Wn as oa,qn as pa,Zn as qa,Jn as ra,Kn as sa,Xn as ta,Yn as ua,Qn as va,er as wa,tr as xa,us as ya,q as za,Q as Aa,ee as Ba,Ae as Ca,cs as Da,ps as Ea,Rf as Fa,ds as Ga,ys as Ha,hs as Ia,xs as Ja,Sn as Ka,ts as La,io as Ma,ao as Na,uo as Oa,ls as Pa,ms as Qa,Wd as Ra,Hi as Sa,qd as Ta,Li as Ua,ws as Va};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{a as Lr,b as Ye,c as Je,i as Wr,n as zr,o as Et,p as kr,u as vt}from"./chunk-BFNNKT2C.js";import{a as Vo,b as J,c as G,e as Ve,f as $e}from"./chunk-MYQCVH5Z.js";var Ie={};G(Ie,{__assign:()=>Ft,__asyncDelegator:()=>gi,__asyncGenerator:()=>Di,__asyncValues:()=>wi,__await:()=>Oe,__awaiter:()=>fi,__classPrivateFieldGet:()=>vi,__classPrivateFieldSet:()=>xi,__createBinding:()=>hi,__decorate:()=>ai,__exportStar:()=>di,__extends:()=>ii,__generator:()=>li,__importDefault:()=>Ei,__importStar:()=>yi,__makeTemplateObject:()=>mi,__metadata:()=>ci,__param:()=>ui,__read:()=>Vr,__rest:()=>si,__spread:()=>pi,__spreadArrays:()=>bi,__values:()=>St});function ii(e,t){xt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function si(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function ai(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(u=e[l])&&(i=(o<3?u(i):o>3?u(t,r,i):u(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function ui(e,t){return function(r,n){t(r,n,e)}}function ci(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function fi(e,t,r,n){function o(i){return i instanceof r?i:new r(function(u){u(i)})}return new(r||(r=Promise))(function(i,u){function l(a){try{s(n.next(a))}catch(f){u(f)}}function c(a){try{s(n.throw(a))}catch(f){u(f)}}function s(a){a.done?i(a.value):o(a.value).then(l,c)}s((n=n.apply(e,t||[])).next())})}function li(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(s){return function(a){return c([s,a])}}function c(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(a){s=[6,a],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function hi(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function di(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function St(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],u;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(l){u={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return i}function pi(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Vr(arguments[t]));return e}function bi(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],u=0,l=i.length;u<l;u++,o++)n[o]=i[u];return n}function Oe(e){return this instanceof Oe?(this.v=e,this):new Oe(e)}function Di(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(h){n[h]&&(o[h]=function(p){return new Promise(function(d,D){i.push([h,p,d,D])>1||l(h,p)})})}function l(h,p){try{c(n[h](p))}catch(d){f(i[0][3],d)}}function c(h){h.value instanceof Oe?Promise.resolve(h.value.v).then(s,a):f(i[0][2],h)}function s(h){l("next",h)}function a(h){l("throw",h)}function f(h,p){h(p),i.shift(),i.length&&l(i[0][0],i[0][1])}}function gi(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(u){return(r=!r)?{value:Oe(e[o](u)),done:o==="return"}:i?i(u):u}:i}}function wi(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof St=="function"?St(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(u){return new Promise(function(l,c){u=e[i](u),o(l,c,u.done,u.value)})}}function o(i,u,l,c){Promise.resolve(c).then(function(s){i({value:s,done:l})},u)}}function mi(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function yi(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Ei(e){return e&&e.__esModule?e:{default:e}}function vi(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function xi(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}var xt,Ft,Te=Vo(()=>{"use strict";xt=function(e,t){return xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},xt(e,t)};Ft=function(){return Ft=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ft.apply(this,arguments)}});var $r=J(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.delay=void 0;function Fi(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}Ge.delay=Fi});var Yr=J(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ONE_THOUSAND=we.ONE_HUNDRED=void 0;we.ONE_HUNDRED=100;we.ONE_THOUSAND=1e3});var Jr=J(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.ONE_YEAR=m.FOUR_WEEKS=m.THREE_WEEKS=m.TWO_WEEKS=m.ONE_WEEK=m.THIRTY_DAYS=m.SEVEN_DAYS=m.FIVE_DAYS=m.THREE_DAYS=m.ONE_DAY=m.TWENTY_FOUR_HOURS=m.TWELVE_HOURS=m.SIX_HOURS=m.THREE_HOURS=m.ONE_HOUR=m.SIXTY_MINUTES=m.THIRTY_MINUTES=m.TEN_MINUTES=m.FIVE_MINUTES=m.ONE_MINUTE=m.SIXTY_SECONDS=m.THIRTY_SECONDS=m.TEN_SECONDS=m.FIVE_SECONDS=m.ONE_SECOND=void 0;m.ONE_SECOND=1;m.FIVE_SECONDS=5;m.TEN_SECONDS=10;m.THIRTY_SECONDS=30;m.SIXTY_SECONDS=60;m.ONE_MINUTE=m.SIXTY_SECONDS;m.FIVE_MINUTES=m.ONE_MINUTE*5;m.TEN_MINUTES=m.ONE_MINUTE*10;m.THIRTY_MINUTES=m.ONE_MINUTE*30;m.SIXTY_MINUTES=m.ONE_MINUTE*60;m.ONE_HOUR=m.SIXTY_MINUTES;m.THREE_HOURS=m.ONE_HOUR*3;m.SIX_HOURS=m.ONE_HOUR*6;m.TWELVE_HOURS=m.ONE_HOUR*12;m.TWENTY_FOUR_HOURS=m.ONE_HOUR*24;m.ONE_DAY=m.TWENTY_FOUR_HOURS;m.THREE_DAYS=m.ONE_DAY*3;m.FIVE_DAYS=m.ONE_DAY*5;m.SEVEN_DAYS=m.ONE_DAY*7;m.THIRTY_DAYS=m.ONE_DAY*30;m.ONE_WEEK=m.SEVEN_DAYS;m.TWO_WEEKS=m.ONE_WEEK*2;m.THREE_WEEKS=m.ONE_WEEK*3;m.FOUR_WEEKS=m.ONE_WEEK*4;m.ONE_YEAR=m.ONE_DAY*365});var Ct=J(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});var Gr=(Te(),$e(Ie));Gr.__exportStar(Yr(),Xe);Gr.__exportStar(Jr(),Xe)});var Zr=J(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.fromMiliseconds=me.toMiliseconds=void 0;var Xr=Ct();function Si(e){return e*Xr.ONE_THOUSAND}me.toMiliseconds=Si;function Ci(e){return Math.floor(e/Xr.ONE_THOUSAND)}me.fromMiliseconds=Ci});var en=J(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});var Qr=(Te(),$e(Ie));Qr.__exportStar($r(),Ze);Qr.__exportStar(Zr(),Ze)});var tn=J(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.Watch=void 0;var Qe=class{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){let r=this.get(t);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);let n=Date.now()-r.started;this.timestamps.set(t,{started:r.started,elapsed:n})}get(t){let r=this.timestamps.get(t);if(typeof r>"u")throw new Error(`No timestamp found for label: ${t}`);return r}elapsed(t){let r=this.get(t);return r.elapsed||Date.now()-r.started}};Ne.Watch=Qe;Ne.default=Qe});var rn=J(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.IWatch=void 0;var At=class{};et.IWatch=At});var nn=J(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var Ai=(Te(),$e(Ie));Ai.__exportStar(rn(),_t)});var Bt=J(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});var tt=(Te(),$e(Ie));tt.__exportStar(en(),ye);tt.__exportStar(tn(),ye);tt.__exportStar(nn(),ye);tt.__exportStar(Ct(),ye)});var on=J(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.getLocalStorage=R.getLocalStorageOrThrow=R.getCrypto=R.getCryptoOrThrow=R.getLocation=R.getLocationOrThrow=R.getNavigator=R.getNavigatorOrThrow=R.getDocument=R.getDocumentOrThrow=R.getFromWindowOrThrow=R.getFromWindow=void 0;function he(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}R.getFromWindow=he;function Ee(e){let t=he(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}R.getFromWindowOrThrow=Ee;function _i(){return Ee("document")}R.getDocumentOrThrow=_i;function Bi(){return he("document")}R.getDocument=Bi;function Oi(){return Ee("navigator")}R.getNavigatorOrThrow=Oi;function Ii(){return he("navigator")}R.getNavigator=Ii;function Ti(){return Ee("location")}R.getLocationOrThrow=Ti;function Ni(){return he("location")}R.getLocation=Ni;function Ui(){return Ee("crypto")}R.getCryptoOrThrow=Ui;function Ri(){return he("crypto")}R.getCrypto=Ri;function Mi(){return Ee("localStorage")}R.getLocalStorageOrThrow=Mi;function Pi(){return he("localStorage")}R.getLocalStorage=Pi});var Wi=J(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.getWindowMetadata=void 0;var sn=on();function Li(){let e,t;try{e=sn.getDocumentOrThrow(),t=sn.getLocationOrThrow()}catch{return null}function r(){let f=e.getElementsByTagName("link"),h=[];for(let p=0;p<f.length;p++){let d=f[p],D=d.getAttribute("rel");if(D&&D.toLowerCase().indexOf("icon")>-1){let w=d.getAttribute("href");if(w)if(w.toLowerCase().indexOf("https:")===-1&&w.toLowerCase().indexOf("http:")===-1&&w.indexOf("//")!==0){let x=t.protocol+"//"+t.host;if(w.indexOf("/")===0)x+=w;else{let y=t.pathname.split("/");y.pop();let b=y.join("/");x+=b+"/"+w}h.push(x)}else if(w.indexOf("//")===0){let x=t.protocol+w;h.push(x)}else h.push(w)}}return h}function n(...f){let h=e.getElementsByTagName("meta");for(let p=0;p<h.length;p++){let d=h[p],D=["itemprop","property","name"].map(w=>d.getAttribute(w)).filter(w=>w?f.includes(w):!1);if(D.length&&D){let w=d.getAttribute("content");if(w)return w}}return""}function o(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=e.title),f}function i(){return n("description","og:description","twitter:description","keywords")}let u=o(),l=i(),c=t.origin,s=r();return{description:l,url:c,icons:s,name:u}}rt.getWindowMetadata=Li});var Co=J((Rl,So)=>{"use strict";So.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var jr=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},$o=(function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e})();var Yo=(function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e})();var Jo=(function(){function e(t,r,n,o){this.name=t,this.version=r,this.os=n,this.bot=o,this.type="bot-device"}return e})();var Go=(function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e})();var Xo=(function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e})();var Zo=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Qo=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Hr=3,ei=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Zo]],Kr=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function tf(e){return e?qr(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Xo:typeof navigator<"u"?qr(navigator.userAgent):ni()}function ti(e){return e!==""&&ei.reduce(function(t,r){var n=r[0],o=r[1];if(t)return t;var i=o.exec(e);return!!i&&[n,i]},!1)}function qr(e){var t=ti(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new Go;var o=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);o?o.length<Hr&&(o=jr(jr([],o,!0),oi(Hr-o.length),!0)):o=[];var i=o.join("."),u=ri(e),l=Qo.exec(e);return l&&l[1]?new Jo(r,i,u,l[1]):new $o(r,i,u)}function ri(e){for(var t=0,r=Kr.length;t<r;t++){var n=Kr[t],o=n[0],i=n[1],u=i.exec(e);if(u)return o}return null}function ni(){var e=typeof process<"u"&&process.version;return e?new Yo(process.version.slice(1)):null}function oi(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}function zi(e){if(e.length>=255)throw new TypeError("Alphabet too long");let t=new Uint8Array(256);for(let s=0;s<t.length;s++)t[s]=255;for(let s=0;s<e.length;s++){let a=e.charAt(s),f=a.charCodeAt(0);if(t[f]!==255)throw new TypeError(a+" is ambiguous");t[f]=s}let r=e.length,n=e.charAt(0),o=Math.log(r)/Math.log(256),i=Math.log(256)/Math.log(r);function u(s){if(s instanceof Uint8Array||(ArrayBuffer.isView(s)?s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength):Array.isArray(s)&&(s=Uint8Array.from(s))),!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(s.length===0)return"";let a=0,f=0,h=0,p=s.length;for(;h!==p&&s[h]===0;)h++,a++;let d=(p-h)*i+1>>>0,D=new Uint8Array(d);for(;h!==p;){let y=s[h],b=0;for(let E=d-1;(y!==0||b<f)&&E!==-1;E--,b++)y+=256*D[E]>>>0,D[E]=y%r>>>0,y=y/r>>>0;if(y!==0)throw new Error("Non-zero carry");f=b,h++}let w=d-f;for(;w!==d&&D[w]===0;)w++;let x=n.repeat(a);for(;w<d;++w)x+=e.charAt(D[w]);return x}function l(s){if(typeof s!="string")throw new TypeError("Expected String");if(s.length===0)return new Uint8Array;let a=0,f=0,h=0;for(;s[a]===n;)f++,a++;let p=(s.length-a)*o+1>>>0,d=new Uint8Array(p);for(;a<s.length;){let y=s.charCodeAt(a);if(y>255)return;let b=t[y];if(b===255)return;let E=0;for(let A=p-1;(b!==0||E<h)&&A!==-1;A--,E++)b+=r*d[A]>>>0,d[A]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");h=E,a++}let D=p-h;for(;D!==p&&d[D]===0;)D++;let w=new Uint8Array(f+(p-D)),x=f;for(;D!==p;)w[x++]=d[D++];return w}function c(s){let a=l(s);if(a)return a;throw new Error("Non-base"+r+" character")}return{encode:u,decodeUnsafe:l,decode:c}}var an=zi;var ki="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",wf=an(ki);var Cn=Ve(Bt());function ji(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function An(e,...t){if(!ji(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function un(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 Hi(e,t){An(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var ve=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Ot=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function Ki(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function _n(e){return typeof e=="string"&&(e=Ki(e)),An(e),e}var Lt=class{clone(){return this._cloneInto()}};function qi(e){let t=n=>e().update(_n(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Bn(e=32){if(ve&&typeof ve.getRandomValues=="function")return ve.getRandomValues(new Uint8Array(e));if(ve&&typeof ve.randomBytes=="function")return ve.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function Vi(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),i=BigInt(4294967295),u=Number(r>>o&i),l=Number(r&i),c=n?4:0,s=n?0:4;e.setUint32(t+c,u,n),e.setUint32(t+s,l,n)}var Wt=class extends Lt{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ot(this.buffer)}update(t){un(this);let{view:r,buffer:n,blockLen:o}=this;t=_n(t);let i=t.length;for(let u=0;u<i;){let l=Math.min(o-this.pos,i-u);if(l===o){let c=Ot(t);for(;o<=i-u;u+=o)this.process(c,u);continue}n.set(t.subarray(u,u+l),this.pos),this.pos+=l,u+=l,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){un(this),Hi(t,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:u}=this;r[u++]=128,this.buffer.subarray(u).fill(0),this.padOffset>o-u&&(this.process(n,0),u=0);for(let f=u;f<o;f++)r[f]=0;Vi(n,o-8,BigInt(this.length*8),i),this.process(n,0);let l=Ot(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let s=c/4,a=this.get();if(s>a.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<s;f++)l.setUint32(4*f,a[f],i)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:i,destroyed:u,pos:l}=this;return t.length=o,t.pos=l,t.finished=i,t.destroyed=u,o%r&&t.buffer.set(n),t}},nt=BigInt(2**32-1),zt=BigInt(32);function On(e,t=!1){return t?{h:Number(e&nt),l:Number(e>>zt&nt)}:{h:Number(e>>zt&nt)|0,l:Number(e&nt)|0}}function $i(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:i,l:u}=On(e[o],t);[r[o],n[o]]=[i,u]}return[r,n]}var Yi=(e,t)=>BigInt(e>>>0)<<zt|BigInt(t>>>0),Ji=(e,t,r)=>e>>>r,Gi=(e,t,r)=>e<<32-r|t>>>r,Xi=(e,t,r)=>e>>>r|t<<32-r,Zi=(e,t,r)=>e<<32-r|t>>>r,Qi=(e,t,r)=>e<<64-r|t>>>r-32,es=(e,t,r)=>e>>>r-32|t<<64-r,ts=(e,t)=>t,rs=(e,t)=>e,ns=(e,t,r)=>e<<r|t>>>32-r,os=(e,t,r)=>t<<r|e>>>32-r,is=(e,t,r)=>t<<r-32|e>>>64-r,ss=(e,t,r)=>e<<r-32|t>>>64-r;function as(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}var us=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),cs=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,fs=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),ls=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,hs=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),ds=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,C={fromBig:On,split:$i,toBig:Yi,shrSH:Ji,shrSL:Gi,rotrSH:Xi,rotrSL:Zi,rotrBH:Qi,rotrBL:es,rotr32H:ts,rotr32L:rs,rotlSH:ns,rotlSL:os,rotlBH:is,rotlBL:ss,add:as,add3L:us,add3H:cs,add4L:fs,add4H:ls,add5H:ds,add5L:hs},[ps,bs]=C.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))),ae=new Uint32Array(80),ue=new Uint32Array(80),kt=class extends Wt{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(){let{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:u,Dh:l,Dl:c,Eh:s,El:a,Fh:f,Fl:h,Gh:p,Gl:d,Hh:D,Hl:w}=this;return[t,r,n,o,i,u,l,c,s,a,f,h,p,d,D,w]}set(t,r,n,o,i,u,l,c,s,a,f,h,p,d,D,w){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=u|0,this.Dh=l|0,this.Dl=c|0,this.Eh=s|0,this.El=a|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=d|0,this.Hh=D|0,this.Hl=w|0}process(t,r){for(let b=0;b<16;b++,r+=4)ae[b]=t.getUint32(r),ue[b]=t.getUint32(r+=4);for(let b=16;b<80;b++){let E=ae[b-15]|0,A=ue[b-15]|0,N=C.rotrSH(E,A,1)^C.rotrSH(E,A,8)^C.shrSH(E,A,7),I=C.rotrSL(E,A,1)^C.rotrSL(E,A,8)^C.shrSL(E,A,7),_=ae[b-2]|0,M=ue[b-2]|0,De=C.rotrSH(_,M,19)^C.rotrBH(_,M,61)^C.shrSH(_,M,6),fe=C.rotrSL(_,M,19)^C.rotrBL(_,M,61)^C.shrSL(_,M,6),ge=C.add4L(I,fe,ue[b-7],ue[b-16]),Be=C.add4H(ge,N,De,ae[b-7],ae[b-16]);ae[b]=Be|0,ue[b]=ge|0}let{Ah:n,Al:o,Bh:i,Bl:u,Ch:l,Cl:c,Dh:s,Dl:a,Eh:f,El:h,Fh:p,Fl:d,Gh:D,Gl:w,Hh:x,Hl:y}=this;for(let b=0;b<80;b++){let E=C.rotrSH(f,h,14)^C.rotrSH(f,h,18)^C.rotrBH(f,h,41),A=C.rotrSL(f,h,14)^C.rotrSL(f,h,18)^C.rotrBL(f,h,41),N=f&p^~f&D,I=h&d^~h&w,_=C.add5L(y,A,I,bs[b],ue[b]),M=C.add5H(_,x,E,N,ps[b],ae[b]),De=_|0,fe=C.rotrSH(n,o,28)^C.rotrBH(n,o,34)^C.rotrBH(n,o,39),ge=C.rotrSL(n,o,28)^C.rotrBL(n,o,34)^C.rotrBL(n,o,39),Be=n&i^n&l^i&l,mt=o&u^o&c^u&c;x=D|0,y=w|0,D=p|0,w=d|0,p=f|0,d=h|0,{h:f,l:h}=C.add(s|0,a|0,M|0,De|0),s=l|0,a=c|0,l=i|0,c=u|0,i=n|0,u=o|0;let F=C.add3L(De,ge,mt);n=C.add3H(F,M,fe,Be),o=F|0}({h:n,l:o}=C.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:u}=C.add(this.Bh|0,this.Bl|0,i|0,u|0),{h:l,l:c}=C.add(this.Ch|0,this.Cl|0,l|0,c|0),{h:s,l:a}=C.add(this.Dh|0,this.Dl|0,s|0,a|0),{h:f,l:h}=C.add(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:d}=C.add(this.Fh|0,this.Fl|0,p|0,d|0),{h:D,l:w}=C.add(this.Gh|0,this.Gl|0,D|0,w|0),{h:x,l:y}=C.add(this.Hh|0,this.Hl|0,x|0,y|0),this.set(n,o,i,u,l,c,s,a,f,h,p,d,D,w,x,y)}roundClean(){ae.fill(0),ue.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)}},Ds=qi(()=>new kt);var Zt=BigInt(0),In=BigInt(1),gs=BigInt(2);function Qt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function er(e){if(!Qt(e))throw new Error("Uint8Array expected")}function It(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}var ws=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tr(e){er(e);let t="";for(let r=0;r<e.length;r++)t+=ws[e[r]];return t}function Tn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Zt:BigInt("0x"+e)}var ne={_0:48,_9:57,A:65,F:70,a:97,f:102};function cn(e){if(e>=ne._0&&e<=ne._9)return e-ne._0;if(e>=ne.A&&e<=ne.F)return e-(ne.A-10);if(e>=ne.a&&e<=ne.f)return e-(ne.a-10)}function Nn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let u=cn(e.charCodeAt(i)),l=cn(e.charCodeAt(i+1));if(u===void 0||l===void 0){let c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=u*16+l}return n}function ms(e){return Tn(tr(e))}function st(e){return er(e),Tn(tr(Uint8Array.from(e).reverse()))}function Un(e,t){return Nn(e.toString(16).padStart(t*2,"0"))}function jt(e,t){return Un(e,t).reverse()}function oe(e,t,r){let n;if(typeof t=="string")try{n=Nn(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(Qt(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function fn(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];er(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return r}var Tt=e=>typeof e=="bigint"&&Zt<=e;function ys(e,t,r){return Tt(e)&&Tt(t)&&Tt(r)&&t<=e&&e<r}function Ue(e,t,r,n){if(!ys(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Es(e){let t;for(t=0;e>Zt;e>>=In,t+=1);return t}var vs=e=>(gs<<BigInt(e-1))-In,xs={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Qt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function rr(e,t,r={}){let n=(o,i,u)=>{let l=xs[i];if(typeof l!="function")throw new Error("invalid validator function");let c=e[o];if(!(u&&c===void 0)&&!l(c,e))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+c)};for(let[o,i]of Object.entries(t))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return e}function ln(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let i=e(r,...n);return t.set(r,i),i}}var H=BigInt(0),z=BigInt(1),de=BigInt(2),Fs=BigInt(3),Ht=BigInt(4),hn=BigInt(5),dn=BigInt(8);function k(e,t){let r=e%t;return r>=H?r:t+r}function Ss(e,t,r){if(t<H)throw new Error("invalid exponent, negatives unsupported");if(r<=H)throw new Error("invalid modulus");if(r===z)return H;let n=z;for(;t>H;)t&z&&(n=n*e%r),e=e*e%r,t>>=z;return n}function Q(e,t,r){let n=e;for(;t-- >H;)n*=n,n%=r;return n}function pn(e,t){if(e===H)throw new Error("invert: expected non-zero number");if(t<=H)throw new Error("invert: expected positive modulus, got "+t);let r=k(e,t),n=t,o=H,i=z;for(;r!==H;){let u=n/r,l=n%r,c=o-i*u;n=r,r=l,o=i,i=c}if(n!==z)throw new Error("invert: does not exist");return k(o,t)}function Cs(e){let t=(e-z)/de,r,n,o;for(r=e-z,n=0;r%de===H;r/=de,n++);for(o=de;o<e&&Ss(o,t,e)!==e-z;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){let u=(e+z)/Ht;return function(l,c){let s=l.pow(c,u);if(!l.eql(l.sqr(s),c))throw new Error("Cannot find square root");return s}}let i=(r+z)/de;return function(u,l){if(u.pow(l,t)===u.neg(u.ONE))throw new Error("Cannot find square root");let c=n,s=u.pow(u.mul(u.ONE,o),r),a=u.pow(l,i),f=u.pow(l,r);for(;!u.eql(f,u.ONE);){if(u.eql(f,u.ZERO))return u.ZERO;let h=1;for(let d=u.sqr(f);h<c&&!u.eql(d,u.ONE);h++)d=u.sqr(d);let p=u.pow(s,z<<BigInt(c-h-1));s=u.sqr(p),a=u.mul(a,p),f=u.mul(f,s),c=h}return a}}function As(e){if(e%Ht===Fs){let t=(e+z)/Ht;return function(r,n){let o=r.pow(n,t);if(!r.eql(r.sqr(o),n))throw new Error("Cannot find square root");return o}}if(e%dn===hn){let t=(e-hn)/dn;return function(r,n){let o=r.mul(n,de),i=r.pow(o,t),u=r.mul(n,i),l=r.mul(r.mul(u,de),i),c=r.mul(u,r.sub(l,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return Cs(e)}var _s=(e,t)=>(k(e,t)&z)===z,Bs=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Os(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Bs.reduce((n,o)=>(n[o]="function",n),t);return rr(e,r)}function Is(e,t,r){if(r<H)throw new Error("invalid exponent, negatives unsupported");if(r===H)return e.ONE;if(r===z)return t;let n=e.ONE,o=t;for(;r>H;)r&z&&(n=e.mul(n,o)),o=e.sqr(o),r>>=z;return n}function Ts(e,t){let r=new Array(t.length),n=t.reduce((i,u,l)=>e.is0(u)?i:(r[l]=i,e.mul(i,u)),e.ONE),o=e.inv(n);return t.reduceRight((i,u,l)=>e.is0(u)?i:(r[l]=e.mul(i,r[l]),e.mul(i,u)),o),r}function Rn(e,t){let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Mn(e,t,r=!1,n={}){if(e<=H)throw new Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:i}=Rn(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u,l=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:vs(o),ZERO:H,ONE:z,create:c=>k(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return H<=c&&c<e},is0:c=>c===H,isOdd:c=>(c&z)===z,neg:c=>k(-c,e),eql:(c,s)=>c===s,sqr:c=>k(c*c,e),add:(c,s)=>k(c+s,e),sub:(c,s)=>k(c-s,e),mul:(c,s)=>k(c*s,e),pow:(c,s)=>Is(l,c,s),div:(c,s)=>k(c*pn(s,e),e),sqrN:c=>c*c,addN:(c,s)=>c+s,subN:(c,s)=>c-s,mulN:(c,s)=>c*s,inv:c=>pn(c,e),sqrt:n.sqrt||(c=>(u||(u=As(e)),u(l,c))),invertBatch:c=>Ts(l,c),cmov:(c,s,a)=>a?s:c,toBytes:c=>r?jt(c,i):Un(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+c.length);return r?st(c):ms(c)}});return Object.freeze(l)}var bn=BigInt(0),ot=BigInt(1);function Nt(e,t){let r=t.negate();return e?r:t}function Pn(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Ut(e,t){Pn(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function Ns(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function Us(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}var Rt=new WeakMap,Ln=new WeakMap;function Mt(e){return Ln.get(e)||1}function Rs(e,t){return{constTimeNegate:Nt,hasPrecomputes(r){return Mt(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;for(;n>bn;)n&ot&&(o=o.add(i)),i=i.double(),n>>=ot;return o},precomputeWindow(r,n){let{windows:o,windowSize:i}=Ut(n,t),u=[],l=r,c=l;for(let s=0;s<o;s++){c=l,u.push(c);for(let a=1;a<i;a++)c=c.add(l),u.push(c);l=c.double()}return u},wNAF(r,n,o){let{windows:i,windowSize:u}=Ut(r,t),l=e.ZERO,c=e.BASE,s=BigInt(2**r-1),a=2**r,f=BigInt(r);for(let h=0;h<i;h++){let p=h*u,d=Number(o&s);o>>=f,d>u&&(d-=a,o+=ot);let D=p,w=p+Math.abs(d)-1,x=h%2!==0,y=d<0;d===0?c=c.add(Nt(x,n[D])):l=l.add(Nt(y,n[w]))}return{p:l,f:c}},wNAFUnsafe(r,n,o,i=e.ZERO){let{windows:u,windowSize:l}=Ut(r,t),c=BigInt(2**r-1),s=2**r,a=BigInt(r);for(let f=0;f<u;f++){let h=f*l;if(o===bn)break;let p=Number(o&c);if(o>>=a,p>l&&(p-=s,o+=ot),p===0)continue;let d=n[h+Math.abs(p)-1];p<0&&(d=d.negate()),i=i.add(d)}return i},getPrecomputes(r,n,o){let i=Rt.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&Rt.set(n,o(i))),i},wNAFCached(r,n,o){let i=Mt(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){let u=Mt(r);return u===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(u,this.getPrecomputes(u,r,o),n,i)},setWindowSize(r,n){Pn(n,t),Ln.set(r,n),Rt.delete(r)}}}function Ms(e,t,r,n){if(Ns(r,e),Us(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");let o=e.ZERO,i=Es(BigInt(r.length)),u=i>12?i-3:i>4?i-2:i?2:1,l=(1<<u)-1,c=new Array(l+1).fill(o),s=Math.floor((t.BITS-1)/u)*u,a=o;for(let f=s;f>=0;f-=u){c.fill(o);for(let p=0;p<n.length;p++){let d=n[p],D=Number(d>>BigInt(f)&BigInt(l));c[D]=c[D].add(r[p])}let h=o;for(let p=c.length-1,d=o;p>0;p--)d=d.add(c[p]),h=h.add(d);if(a=a.add(h),f!==0)for(let p=0;p<u;p++)a=a.double()}return a}function Ps(e){return Os(e.Fp),rr(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Rn(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var Z=BigInt(0),Y=BigInt(1),it=BigInt(2),Ls=BigInt(8),Ws={zip215:!0};function zs(e){let t=Ps(e);return rr(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function ks(e){let t=zs(e),{Fp:r,n,prehash:o,hash:i,randomBytes:u,nByteLength:l,h:c}=t,s=it<<BigInt(l*8)-Y,a=r.create,f=Mn(t.n,t.nBitLength),h=t.uvRatio||((F,g)=>{try{return{isValid:!0,value:r.sqrt(F*r.inv(g))}}catch{return{isValid:!1,value:Z}}}),p=t.adjustScalarBytes||(F=>F),d=t.domain||((F,g,v)=>{if(It("phflag",v),g.length||v)throw new Error("Contexts/pre-hash are not supported");return F});function D(F,g){Ue("coordinate "+F,g,Z,s)}function w(F){if(!(F instanceof b))throw new Error("ExtendedPoint expected")}let x=ln((F,g)=>{let{ex:v,ey:S,ez:B}=F,O=F.is0();g==null&&(g=O?Ls:r.inv(B));let T=a(v*g),P=a(S*g),U=a(B*g);if(O)return{x:Z,y:Y};if(U!==Y)throw new Error("invZ was invalid");return{x:T,y:P}}),y=ln(F=>{let{a:g,d:v}=t;if(F.is0())throw new Error("bad point: ZERO");let{ex:S,ey:B,ez:O,et:T}=F,P=a(S*S),U=a(B*B),L=a(O*O),K=a(L*L),$=a(P*g),te=a(L*a($+U)),re=a(K+a(v*a(P*U)));if(te!==re)throw new Error("bad point: equation left != right (1)");let X=a(S*B),se=a(O*T);if(X!==se)throw new Error("bad point: equation left != right (2)");return!0});class b{constructor(g,v,S,B){this.ex=g,this.ey=v,this.ez=S,this.et=B,D("x",g),D("y",v),D("z",S),D("t",B),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(g){if(g instanceof b)throw new Error("extended point not allowed");let{x:v,y:S}=g||{};return D("x",v),D("y",S),new b(v,S,Y,a(v*S))}static normalizeZ(g){let v=r.invertBatch(g.map(S=>S.ez));return g.map((S,B)=>S.toAffine(v[B])).map(b.fromAffine)}static msm(g,v){return Ms(b,f,g,v)}_setWindowSize(g){N.setWindowSize(this,g)}assertValidity(){y(this)}equals(g){w(g);let{ex:v,ey:S,ez:B}=this,{ex:O,ey:T,ez:P}=g,U=a(v*P),L=a(O*B),K=a(S*P),$=a(T*B);return U===L&&K===$}is0(){return this.equals(b.ZERO)}negate(){return new b(a(-this.ex),this.ey,this.ez,a(-this.et))}double(){let{a:g}=t,{ex:v,ey:S,ez:B}=this,O=a(v*v),T=a(S*S),P=a(it*a(B*B)),U=a(g*O),L=v+S,K=a(a(L*L)-O-T),$=U+T,te=$-P,re=U-T,X=a(K*te),se=a($*re),le=a(K*re),qe=a(te*$);return new b(X,se,qe,le)}add(g){w(g);let{a:v,d:S}=t,{ex:B,ey:O,ez:T,et:P}=this,{ex:U,ey:L,ez:K,et:$}=g;if(v===BigInt(-1)){let Ir=a((O-B)*(L+U)),Tr=a((O+B)*(L-U)),yt=a(Tr-Ir);if(yt===Z)return this.double();let Nr=a(T*it*$),Ur=a(P*it*K),Rr=Ur+Nr,Mr=Tr+Ir,Pr=Ur-Nr,jo=a(Rr*yt),Ho=a(Mr*Pr),Ko=a(Rr*Pr),qo=a(yt*Mr);return new b(jo,Ho,qo,Ko)}let te=a(B*U),re=a(O*L),X=a(P*S*$),se=a(T*K),le=a((B+O)*(U+L)-te-re),qe=se-X,Br=se+X,Or=a(re-v*te),Lo=a(le*qe),Wo=a(Br*Or),zo=a(le*Or),ko=a(qe*Br);return new b(Lo,Wo,ko,zo)}subtract(g){return this.add(g.negate())}wNAF(g){return N.wNAFCached(this,g,b.normalizeZ)}multiply(g){let v=g;Ue("scalar",v,Y,n);let{p:S,f:B}=this.wNAF(v);return b.normalizeZ([S,B])[0]}multiplyUnsafe(g,v=b.ZERO){let S=g;return Ue("scalar",S,Z,n),S===Z?A:this.is0()||S===Y?this:N.wNAFCachedUnsafe(this,S,b.normalizeZ,v)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return N.unsafeLadder(this,n).is0()}toAffine(g){return x(this,g)}clearCofactor(){let{h:g}=t;return g===Y?this:this.multiplyUnsafe(g)}static fromHex(g,v=!1){let{d:S,a:B}=t,O=r.BYTES;g=oe("pointHex",g,O),It("zip215",v);let T=g.slice(),P=g[O-1];T[O-1]=P&-129;let U=st(T),L=v?s:r.ORDER;Ue("pointHex.y",U,Z,L);let K=a(U*U),$=a(K-Y),te=a(S*K-B),{isValid:re,value:X}=h($,te);if(!re)throw new Error("Point.fromHex: invalid y coordinate");let se=(X&Y)===Y,le=(P&128)!==0;if(!v&&X===Z&&le)throw new Error("Point.fromHex: x=0 and x_0=1");return le!==se&&(X=a(-X)),b.fromAffine({x:X,y:U})}static fromPrivateKey(g){return M(g).point}toRawBytes(){let{x:g,y:v}=this.toAffine(),S=jt(v,r.BYTES);return S[S.length-1]|=g&Y?128:0,S}toHex(){return tr(this.toRawBytes())}}b.BASE=new b(t.Gx,t.Gy,Y,a(t.Gx*t.Gy)),b.ZERO=new b(Z,Y,Y,Z);let{BASE:E,ZERO:A}=b,N=Rs(b,l*8);function I(F){return k(F,n)}function _(F){return I(st(F))}function M(F){let g=r.BYTES;F=oe("private key",F,g);let v=oe("hashed private key",i(F),2*g),S=p(v.slice(0,g)),B=v.slice(g,2*g),O=_(S),T=E.multiply(O),P=T.toRawBytes();return{head:S,prefix:B,scalar:O,point:T,pointBytes:P}}function De(F){return M(F).pointBytes}function fe(F=new Uint8Array,...g){let v=fn(...g);return _(i(d(v,oe("context",F),!!o)))}function ge(F,g,v={}){F=oe("message",F),o&&(F=o(F));let{prefix:S,scalar:B,pointBytes:O}=M(g),T=fe(v.context,S,F),P=E.multiply(T).toRawBytes(),U=fe(v.context,P,O,F),L=I(T+U*B);Ue("signature.s",L,Z,n);let K=fn(P,jt(L,r.BYTES));return oe("result",K,r.BYTES*2)}let Be=Ws;function mt(F,g,v,S=Be){let{context:B,zip215:O}=S,T=r.BYTES;F=oe("signature",F,2*T),g=oe("message",g),v=oe("publicKey",v,T),O!==void 0&&It("zip215",O),o&&(g=o(g));let P=st(F.slice(T,2*T)),U,L,K;try{U=b.fromHex(v,O),L=b.fromHex(F.slice(0,T),O),K=E.multiplyUnsafe(P)}catch{return!1}if(!O&&U.isSmallOrder())return!1;let $=fe(B,L.toRawBytes(),U.toRawBytes(),g);return L.add(U.multiplyUnsafe($)).subtract(K).clearCofactor().equals(b.ZERO)}return E._setWindowSize(8),{CURVE:t,getPublicKey:De,sign:ge,verify:mt,ExtendedPoint:b,utils:{getExtendedPublicKey:M,randomPrivateKey:()=>u(r.BYTES),precompute(F=8,g=b.BASE){return g._setWindowSize(F),g.multiply(BigInt(3)),g}}}}BigInt(0),BigInt(1);var nr=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Dn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);var js=BigInt(1),gn=BigInt(2);BigInt(3);var Hs=BigInt(5),Ks=BigInt(8);function qs(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=nr,u=e*e%i*e%i,l=Q(u,gn,i)*u%i,c=Q(l,js,i)*e%i,s=Q(c,Hs,i)*c%i,a=Q(s,t,i)*s%i,f=Q(a,r,i)*a%i,h=Q(f,n,i)*f%i,p=Q(h,o,i)*h%i,d=Q(p,o,i)*h%i,D=Q(d,t,i)*s%i;return{pow_p_5_8:Q(D,gn,i)*e%i,b2:u}}function Vs(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function $s(e,t){let r=nr,n=k(t*t*t,r),o=k(n*n*t,r),i=qs(e*o).pow_p_5_8,u=k(e*n*i,r),l=k(t*u*u,r),c=u,s=k(u*Dn,r),a=l===e,f=l===k(-e,r),h=l===k(-e*Dn,r);return a&&(u=c),(f||h)&&(u=s),_s(u,r)&&(u=k(-u,r)),{isValid:a||f,value:u}}var Ys=Mn(nr,void 0,!0),Js={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Ys,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Ks,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Ds,randomBytes:Bn,adjustScalarBytes:Vs,uvRatio:$s},Wn=ks(Js),Gs="EdDSA",Xs="JWT",at=".",ct="base64url",zn="utf8",kn="utf8",Zs=":",Qs="did",ea="key",wn="base58btc",ta="z",ra="K36";var na=32;function or(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function jn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?or(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Hn(e,t){t||(t=e.reduce((o,i)=>o+i.length,0));let r=jn(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return or(r)}function oa(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),u=i.charCodeAt(0);if(r[u]!==255)throw new TypeError(i+" is ambiguous");r[u]=o}var l=e.length,c=e.charAt(0),s=Math.log(l)/Math.log(256),a=Math.log(256)/Math.log(l);function f(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var D=0,w=0,x=0,y=d.length;x!==y&&d[x]===0;)x++,D++;for(var b=(y-x)*a+1>>>0,E=new Uint8Array(b);x!==y;){for(var A=d[x],N=0,I=b-1;(A!==0||N<w)&&I!==-1;I--,N++)A+=256*E[I]>>>0,E[I]=A%l>>>0,A=A/l>>>0;if(A!==0)throw new Error("Non-zero carry");w=N,x++}for(var _=b-w;_!==b&&E[_]===0;)_++;for(var M=c.repeat(D);_<b;++_)M+=e.charAt(E[_]);return M}function h(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var D=0;if(d[D]!==" "){for(var w=0,x=0;d[D]===c;)w++,D++;for(var y=(d.length-D)*s+1>>>0,b=new Uint8Array(y);d[D];){var E=r[d.charCodeAt(D)];if(E===255)return;for(var A=0,N=y-1;(E!==0||A<x)&&N!==-1;N--,A++)E+=l*b[N]>>>0,b[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");x=A,D++}if(d[D]!==" "){for(var I=y-x;I!==y&&b[I]===0;)I++;for(var _=new Uint8Array(w+(y-I)),M=w;I!==y;)_[M++]=b[I++];return _}}}function p(d){var D=h(d);if(D)return D;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:p}}var ia=oa,sa=ia,Kn=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},aa=e=>new TextEncoder().encode(e),ua=e=>new TextDecoder().decode(e),Kt=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},qt=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return qn(this,t)}},Vt=class{constructor(t){this.decoders=t}or(t){return qn(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},qn=(e,t)=>new Vt({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),$t=class{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new Kt(t,r,n),this.decoder=new qt(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},ft=({name:e,prefix:t,encode:r,decode:n})=>new $t(e,t,r,n),Re=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:o}=sa(r,t);return ft({prefix:e,name:t,encode:n,decode:i=>Kn(o(i))})},ca=(e,t,r,n)=>{let o={};for(let a=0;a<t.length;++a)o[t[a]]=a;let i=e.length;for(;e[i-1]==="=";)--i;let u=new Uint8Array(i*r/8|0),l=0,c=0,s=0;for(let a=0;a<i;++a){let f=o[e[a]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,l+=r,l>=8&&(l-=8,u[s++]=255&c>>l)}if(l>=r||255&c<<8-l)throw new SyntaxError("Unexpected end of data");return u},fa=(e,t,r)=>{let n=t[t.length-1]==="=",o=(1<<r)-1,i="",u=0,l=0;for(let c=0;c<e.length;++c)for(l=l<<8|e[c],u+=8;u>r;)u-=r,i+=t[o&l>>u];if(u&&(i+=t[o&l<<r-u]),n)for(;i.length*r&7;)i+="=";return i},q=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>ft({prefix:t,name:e,encode(o){return fa(o,n,r)},decode(o){return ca(o,n,r,e)}}),la=ft({prefix:"\0",name:"identity",encode:e=>ua(e),decode:e=>aa(e)}),ha=Object.freeze({__proto__:null,identity:la}),da=q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),pa=Object.freeze({__proto__:null,base2:da}),ba=q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Da=Object.freeze({__proto__:null,base8:ba}),ga=Re({prefix:"9",name:"base10",alphabet:"0123456789"}),wa=Object.freeze({__proto__:null,base10:ga}),ma=q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ya=q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Ea=Object.freeze({__proto__:null,base16:ma,base16upper:ya}),va=q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),xa=q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Fa=q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Sa=q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ca=q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Aa=q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_a=q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ba=q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Oa=q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Ia=Object.freeze({__proto__:null,base32:va,base32upper:xa,base32pad:Fa,base32padupper:Sa,base32hex:Ca,base32hexupper:Aa,base32hexpad:_a,base32hexpadupper:Ba,base32z:Oa}),Ta=Re({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Na=Re({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Ua=Object.freeze({__proto__:null,base36:Ta,base36upper:Na}),Ra=Re({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ma=Re({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Pa=Object.freeze({__proto__:null,base58btc:Ra,base58flickr:Ma}),La=q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Wa=q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),za=q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ka=q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ja=Object.freeze({__proto__:null,base64:La,base64pad:Wa,base64url:za,base64urlpad:ka}),Vn=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Ha=Vn.reduce((e,t,r)=>(e[r]=t,e),[]),Ka=Vn.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function qa(e){return e.reduce((t,r)=>(t+=Ha[r],t),"")}function Va(e){let t=[];for(let r of e){let n=Ka[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var $a=ft({prefix:"\u{1F680}",name:"base256emoji",encode:qa,decode:Va}),Ya=Object.freeze({__proto__:null,base256emoji:$a}),Ja=$n,mn=128,Ga=127,Xa=~Ga,Za=Math.pow(2,31);function $n(e,t,r){t=t||[],r=r||0;for(var n=r;e>=Za;)t[r++]=e&255|mn,e/=128;for(;e&Xa;)t[r++]=e&255|mn,e>>>=7;return t[r]=e|0,$n.bytes=r-n+1,t}var Qa=Yt,eu=128,yn=127;function Yt(e,n){var r=0,n=n||0,o=0,i=n,u,l=e.length;do{if(i>=l)throw Yt.bytes=0,new RangeError("Could not decode varint");u=e[i++],r+=o<28?(u&yn)<<o:(u&yn)*Math.pow(2,o),o+=7}while(u>=eu);return Yt.bytes=i-n,r}var tu=Math.pow(2,7),ru=Math.pow(2,14),nu=Math.pow(2,21),ou=Math.pow(2,28),iu=Math.pow(2,35),su=Math.pow(2,42),au=Math.pow(2,49),uu=Math.pow(2,56),cu=Math.pow(2,63),fu=function(e){return e<tu?1:e<ru?2:e<nu?3:e<ou?4:e<iu?5:e<su?6:e<au?7:e<uu?8:e<cu?9:10},lu={encode:Ja,decode:Qa,encodingLength:fu},Yn=lu,En=(e,t,r=0)=>(Yn.encode(e,t,r),t),vn=e=>Yn.encodingLength(e),Jt=(e,t)=>{let r=t.byteLength,n=vn(e),o=n+vn(r),i=new Uint8Array(o+r);return En(e,i,0),En(r,i,n),i.set(t,o),new Gt(e,r,t,i)},Gt=class{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}},Jn=({name:e,code:t,encode:r})=>new Xt(e,t,r),Xt=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?Jt(this.code,r):r.then(n=>Jt(this.code,n))}else throw Error("Unknown type, must be binary type")}},Gn=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),hu=Jn({name:"sha2-256",code:18,encode:Gn("SHA-256")}),du=Jn({name:"sha2-512",code:19,encode:Gn("SHA-512")}),pu=Object.freeze({__proto__:null,sha256:hu,sha512:du}),Xn=0,bu="identity",Zn=Kn,Du=e=>Jt(Xn,Zn(e)),gu={code:Xn,name:bu,encode:Zn,digest:Du},wu=Object.freeze({__proto__:null,identity:gu});new TextEncoder,new TextDecoder;var xn={...ha,...pa,...Da,...wa,...Ea,...Ia,...Ua,...Pa,...ja,...Ya};({...pu,...wu});function Qn(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var Fn=Qn("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Pt=Qn("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=jn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),eo={utf8:Fn,"utf-8":Fn,hex:xn.base16,latin1:Pt,ascii:Pt,binary:Pt,...xn};function lt(e,t="utf8"){let r=eo[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function xe(e,t="utf8"){let r=eo[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?or(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function Sn(e){return Ye(lt(xe(e,ct),zn))}function ut(e){return lt(xe(Je(e),zn),ct)}function mu(e){let t=xe(ra,wn),r=ta+lt(Hn([t,e]),wn);return[Qs,ea,r].join(Zs)}function yu(e){return lt(e,ct)}function Eu(e){return xe(e,ct)}function vu(e){return xe([ut(e.header),ut(e.payload)].join(at),kn)}function xu(e){return[ut(e.header),ut(e.payload),yu(e.signature)].join(at)}function Ef(e){let t=e.split(at),r=Sn(t[0]),n=Sn(t[1]),o=Eu(t[2]),i=xe(t.slice(0,2).join(at),kn);return{header:r,payload:n,signature:o,data:i}}function vf(e=Bn(na)){let t=Wn.getPublicKey(e);return{secretKey:Hn([e,t]),publicKey:t}}async function xf(e,t,r,n,o=(0,Cn.fromMiliseconds)(Date.now())){let i={alg:Gs,typ:Xs},u=mu(n.publicKey),l=o+r,c={iss:u,sub:e,aud:t,iat:o,exp:l},s=vu({header:i,payload:c}),a=Wn.sign(s,n.secretKey.slice(0,32));return xu({header:i,payload:c,signature:a})}function Me(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Fu(e,t){t||(t=e.reduce((o,i)=>o+i.length,0));let r=Me(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}var cr={};G(cr,{identity:()=>Ou});function Su(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),u=i.charCodeAt(0);if(r[u]!==255)throw new TypeError(i+" is ambiguous");r[u]=o}var l=e.length,c=e.charAt(0),s=Math.log(l)/Math.log(256),a=Math.log(256)/Math.log(l);function f(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var D=0,w=0,x=0,y=d.length;x!==y&&d[x]===0;)x++,D++;for(var b=(y-x)*a+1>>>0,E=new Uint8Array(b);x!==y;){for(var A=d[x],N=0,I=b-1;(A!==0||N<w)&&I!==-1;I--,N++)A+=256*E[I]>>>0,E[I]=A%l>>>0,A=A/l>>>0;if(A!==0)throw new Error("Non-zero carry");w=N,x++}for(var _=b-w;_!==b&&E[_]===0;)_++;for(var M=c.repeat(D);_<b;++_)M+=e.charAt(E[_]);return M}function h(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var D=0;if(d[D]!==" "){for(var w=0,x=0;d[D]===c;)w++,D++;for(var y=(d.length-D)*s+1>>>0,b=new Uint8Array(y);d[D];){var E=r[d.charCodeAt(D)];if(E===255)return;for(var A=0,N=y-1;(E!==0||A<x)&&N!==-1;N--,A++)E+=l*b[N]>>>0,b[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");x=A,D++}if(d[D]!==" "){for(var I=y-x;I!==y&&b[I]===0;)I++;for(var _=new Uint8Array(w+(y-I)),M=w;I!==y;)_[M++]=b[I++];return _}}}function p(d){var D=h(d);if(D)return D;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:p}}var Cu=Su,Au=Cu,to=Au;var Bf=new Uint8Array(0);var ro=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},ie=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};var no=e=>new TextEncoder().encode(e),oo=e=>new TextDecoder().decode(e);var ir=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},sr=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return so(this,t)}},ar=class{constructor(t){this.decoders=t}or(t){return so(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},so=(e,t)=>new ar({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),ur=class{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new ir(t,r,n),this.decoder=new sr(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Fe=({name:e,prefix:t,encode:r,decode:n})=>new ur(e,t,r,n),ce=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:o}=to(r,t);return Fe({prefix:e,name:t,encode:n,decode:i=>ie(o(i))})},_u=(e,t,r,n)=>{let o={};for(let a=0;a<t.length;++a)o[t[a]]=a;let i=e.length;for(;e[i-1]==="=";)--i;let u=new Uint8Array(i*r/8|0),l=0,c=0,s=0;for(let a=0;a<i;++a){let f=o[e[a]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,l+=r,l>=8&&(l-=8,u[s++]=255&c>>l)}if(l>=r||255&c<<8-l)throw new SyntaxError("Unexpected end of data");return u},Bu=(e,t,r)=>{let n=t[t.length-1]==="=",o=(1<<r)-1,i="",u=0,l=0;for(let c=0;c<e.length;++c)for(l=l<<8|e[c],u+=8;u>r;)u-=r,i+=t[o&l>>u];if(u&&(i+=t[o&l<<r-u]),n)for(;i.length*r&7;)i+="=";return i},W=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Fe({prefix:t,name:e,encode(o){return Bu(o,n,r)},decode(o){return _u(o,n,r,e)}});var Ou=Fe({prefix:"\0",name:"identity",encode:e=>oo(e),decode:e=>no(e)});var fr={};G(fr,{base2:()=>Iu});var Iu=W({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var lr={};G(lr,{base8:()=>Tu});var Tu=W({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var hr={};G(hr,{base10:()=>Nu});var Nu=ce({prefix:"9",name:"base10",alphabet:"0123456789"});var dr={};G(dr,{base16:()=>Uu,base16upper:()=>Ru});var Uu=W({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ru=W({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var pr={};G(pr,{base32:()=>Se,base32hex:()=>Wu,base32hexpad:()=>ku,base32hexpadupper:()=>ju,base32hexupper:()=>zu,base32pad:()=>Pu,base32padupper:()=>Lu,base32upper:()=>Mu,base32z:()=>Hu});var Se=W({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Mu=W({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Pu=W({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Lu=W({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Wu=W({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zu=W({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ku=W({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ju=W({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Hu=W({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var br={};G(br,{base36:()=>Ku,base36upper:()=>qu});var Ku=ce({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),qu=ce({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Dr={};G(Dr,{base58btc:()=>ee,base58flickr:()=>Vu});var ee=ce({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Vu=ce({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var gr={};G(gr,{base64:()=>$u,base64pad:()=>Yu,base64url:()=>Ju,base64urlpad:()=>Gu});var $u=W({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Yu=W({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ju=W({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Gu=W({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var wr={};G(wr,{base256emoji:()=>tc});var ao=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Xu=ao.reduce((e,t,r)=>(e[r]=t,e),[]),Zu=ao.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Qu(e){return e.reduce((t,r)=>(t+=Xu[r],t),"")}function ec(e){let t=[];for(let r of e){let n=Zu[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var tc=Fe({prefix:"\u{1F680}",name:"base256emoji",encode:Qu,decode:ec});var vr={};G(vr,{sha256:()=>yc,sha512:()=>Ec});var rc=fo,uo=128,nc=127,oc=~nc,ic=Math.pow(2,31);function fo(e,t,r){t=t||[],r=r||0;for(var n=r;e>=ic;)t[r++]=e&255|uo,e/=128;for(;e&oc;)t[r++]=e&255|uo,e>>>=7;return t[r]=e|0,fo.bytes=r-n+1,t}var sc=mr,ac=128,co=127;function mr(e,n){var r=0,n=n||0,o=0,i=n,u,l=e.length;do{if(i>=l)throw mr.bytes=0,new RangeError("Could not decode varint");u=e[i++],r+=o<28?(u&co)<<o:(u&co)*Math.pow(2,o),o+=7}while(u>=ac);return mr.bytes=i-n,r}var uc=Math.pow(2,7),cc=Math.pow(2,14),fc=Math.pow(2,21),lc=Math.pow(2,28),hc=Math.pow(2,35),dc=Math.pow(2,42),pc=Math.pow(2,49),bc=Math.pow(2,56),Dc=Math.pow(2,63),gc=function(e){return e<uc?1:e<cc?2:e<fc?3:e<lc?4:e<hc?5:e<dc?6:e<pc?7:e<bc?8:e<Dc?9:10},wc={encode:rc,decode:sc,encodingLength:gc},mc=wc,Pe=mc;var Le=(e,t=0)=>[Pe.decode(e,t),Pe.decode.bytes],Ce=(e,t,r=0)=>(Pe.encode(e,t,r),t),Ae=e=>Pe.encodingLength(e);var pe=(e,t)=>{let r=t.byteLength,n=Ae(e),o=n+Ae(r),i=new Uint8Array(o+r);return Ce(e,i,0),Ce(r,i,n),i.set(t,o),new _e(e,r,t,i)},lo=e=>{let t=ie(e),[r,n]=Le(t),[o,i]=Le(t.subarray(n)),u=t.subarray(n+i);if(u.byteLength!==o)throw new Error("Incorrect length");return new _e(r,o,u,t)},ho=(e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&ro(e.bytes,t.bytes),_e=class{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}};var Er=({name:e,code:t,encode:r})=>new yr(e,t,r),yr=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?pe(this.code,r):r.then(n=>pe(this.code,n))}else throw Error("Unknown type, must be binary type")}};var bo=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),yc=Er({name:"sha2-256",code:18,encode:bo("SHA-256")}),Ec=Er({name:"sha2-512",code:19,encode:bo("SHA-512")});var xr={};G(xr,{identity:()=>Fc});var Do=0,vc="identity",go=ie,xc=e=>pe(Do,go(e)),Fc={code:Do,name:vc,encode:go,digest:xc};var Gf=new TextEncoder,Xf=new TextDecoder;var bt=class e{constructor(t,r,n,o){this.code=r,this.version=t,this.multihash=n,this.bytes=o,this.byteOffset=o.byteOffset,this.byteLength=o.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:pt,byteLength:pt,code:dt,version:dt,multihash:dt,bytes:dt,_baseCache:pt,asCID:pt})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:r}=this;if(t!==ze)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Oc)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=pe(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(t){return t&&this.code===t.code&&this.version===t.version&&ho(this.multihash,t.multihash)}toString(t){let{bytes:r,version:n,_baseCache:o}=this;return n===0?_c(r,o,t||ee.encoder):Bc(r,o,t||Se.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(t){return Tc(/^0\.0/,Nc),!!(t&&(t[mo]||t.asCID===t))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(t){if(t instanceof e)return t;if(t!=null&&t.asCID===t){let{version:r,code:n,multihash:o,bytes:i}=t;return new e(r,n,o,i||wo(r,n,o.bytes))}else if(t!=null&&t[mo]===!0){let{version:r,multihash:n,code:o}=t,i=lo(n);return e.create(r,o,i)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(t){case 0:{if(r!==ze)throw new Error(`Version 0 CID must use dag-pb (code: ${ze}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let o=wo(t,r,n.bytes);return new e(t,r,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,ze,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,o=ie(t.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let i=o.subarray(r.multihashSize-r.digestSize),u=new _e(r.multihashCode,r.digestSize,i,o);return[r.version===0?e.createV0(u):e.createV1(r.codec,u),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[f,h]=Le(t.subarray(r));return r+=h,f},o=n(),i=ze;if(o===18?(o=0,r=0):o===1&&(i=n()),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let u=r,l=n(),c=n(),s=r+c,a=s-u;return{version:o,codec:i,multihashCode:l,digestSize:c,multihashSize:a,size:s}}static parse(t,r){let[n,o]=Ac(t,r),i=e.decode(o);return i._baseCache.set(n,t),i}},Ac=(e,t)=>{switch(e[0]){case"Q":{let r=t||ee;return[ee.prefix,r.decode(`${ee.prefix}${e}`)]}case ee.prefix:{let r=t||ee;return[ee.prefix,r.decode(e)]}case Se.prefix:{let r=t||Se;return[Se.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},_c=(e,t,r)=>{let{prefix:n}=r;if(n!==ee.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=t.get(n);if(o==null){let i=r.encode(e).slice(1);return t.set(n,i),i}else return o},Bc=(e,t,r)=>{let{prefix:n}=r,o=t.get(n);if(o==null){let i=r.encode(e);return t.set(n,i),i}else return o},ze=112,Oc=18,wo=(e,t,r)=>{let n=Ae(e),o=n+Ae(t),i=new Uint8Array(o+r.byteLength);return Ce(e,i,0),Ce(t,i,n),i.set(r,o),i},mo=Symbol.for("@ipld/js-cid/CID"),dt={writable:!1,configurable:!1,enumerable:!0},pt={writable:!1,enumerable:!1,configurable:!1},Ic="0.0.0-dev",Tc=(e,t)=>{if(e.test(Ic))console.warn(t);else throw new Error(t)},Nc=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
2
|
+
Following code pattern:
|
|
3
|
+
|
|
4
|
+
if (CID.isCID(value)) {
|
|
5
|
+
doSomethingWithCID(value)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
Is replaced with:
|
|
9
|
+
|
|
10
|
+
const cid = CID.asCID(value)
|
|
11
|
+
if (cid) {
|
|
12
|
+
// Make sure to use cid instead of value
|
|
13
|
+
doSomethingWithCID(cid)
|
|
14
|
+
}
|
|
15
|
+
`;var Fr={...cr,...fr,...lr,...hr,...dr,...pr,...br,...Dr,...gr,...wr},il={...vr,...xr};function Eo(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var yo=Eo("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Sr=Eo("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=Me(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Uc={utf8:yo,"utf-8":yo,hex:Fr.base16,latin1:Sr,ascii:Sr,binary:Sr,...Fr},Dt=Uc;function Rc(e,t="utf8"){let r=Dt[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function Mc(e,t="utf8"){let r=Dt[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var _l={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var gt=class{};var Fo=Ve(Lr()),wt=Ve(Bt());var Cr=class extends gt{constructor(t){super()}},vo=wt.FIVE_SECONDS,Pc={pulse:"heartbeat_pulse"},xo=class e extends Cr{constructor(t){super(t),this.events=new Fo.EventEmitter,this.interval=vo,this.interval=t?.interval||vo}static async init(t){let r=new e(t);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,wt.toMiliseconds)(this.interval))}pulse(){this.events.emit(Pc.pulse)}};var Oo=Ve(Lr());var Lc=()=>typeof WebSocket<"u"?WebSocket:typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:Co(),Wc=()=>typeof WebSocket<"u"||typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Ao=e=>e.split("?")[0],_o=10,zc=Lc(),Bo=class{constructor(t){if(this.url=t,this.events=new Oo.EventEmitter,this.registering=!1,!Et(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Je(t))}catch(r){this.onError(t.id,r)}}register(t=this.url){if(!Et(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){let r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",i=>{this.resetMaxListeners(),o(i)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=t,this.registering=!0,new Promise((r,n)=>{let o=(0,vt.isReactNative)()?void 0:{rejectUnauthorized:!kr(t)},i=new zc(t,[],o);Wc()?i.onerror=u=>{let l=u;n(this.emitError(l.error))}:i.on("error",u=>{n(this.emitError(u))}),i.onopen=()=>{this.onOpen(i),r(i)}})}onOpen(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;let r=typeof t.data=="string"?Ye(t.data):t.data;this.events.emit("payload",r)}onError(t,r){let n=this.parseError(r),o=n.message||n.toString(),i=zr(t,o);this.events.emit("payload",i)}parseError(t,r=this.url){return Wr(t,Ao(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>_o&&this.events.setMaxListeners(_o)}emitError(t){let r=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${Ao(this.url)}`));return this.events.emit("register_error",r),r}};var kc=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,jc=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Hc=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Kc(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){qc(e);return}return t}function qc(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function ke(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Hc.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(kc.test(e)||jc.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Kc)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function Vc(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function j(e,...t){try{return Vc(e(...t))}catch(r){return Promise.reject(r)}}function $c(e){let t=typeof e;return e===null||t!=="object"&&t!=="function"}function Yc(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function je(e){if($c(e))return String(e);if(Yc(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return je(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}var Ar="base64:";function Io(e){return typeof e=="string"?e:Ar+Gc(e)}function To(e){return typeof e!="string"||!e.startsWith(Ar)?e:Jc(e.slice(Ar.length))}function Jc(e){return globalThis.Buffer?Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function Gc(e){return globalThis.Buffer?Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function V(e){return e&&e.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function No(...e){return V(e.join(":"))}function He(e){return e=V(e),e?e+":":""}function Uo(e,t){if(t===void 0)return!0;let r=0,n=e.indexOf(":");for(;n>-1;)r++,n=e.indexOf(":",n+1);return r<=t}function Ro(e,t){return t?e.startsWith(t)&&e[e.length-1]!=="$":e[e.length-1]!=="$"}var Xc="memory",Zc=()=>{let e=new Map;return{name:Xc,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function Hl(e={}){let t={mounts:{"":e.driver||Zc()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=s=>{for(let a of t.mountpoints)if(s.startsWith(a))return{base:a,relativeKey:s.slice(a.length),driver:t.mounts[a]};return{base:"",relativeKey:s,driver:t.mounts[""]}},n=(s,a)=>t.mountpoints.filter(f=>f.startsWith(s)||a&&s.startsWith(f)).map(f=>({relativeBase:s.length>f.length?s.slice(f.length):void 0,mountpoint:f,driver:t.mounts[f]})),o=(s,a)=>{if(t.watching){a=V(a);for(let f of t.watchListeners)f(s,a)}},i=async()=>{if(!t.watching){t.watching=!0;for(let s in t.mounts)t.unwatch[s]=await Mo(t.mounts[s],o,s)}},u=async()=>{if(t.watching){for(let s in t.unwatch)await t.unwatch[s]();t.unwatch={},t.watching=!1}},l=(s,a,f)=>{let h=new Map,p=d=>{let D=h.get(d.base);return D||(D={driver:d.driver,base:d.base,items:[]},h.set(d.base,D)),D};for(let d of s){let D=typeof d=="string",w=V(D?d:d.key),x=D?void 0:d.value,y=D||!d.options?a:{...a,...d.options},b=r(w);p(b).items.push({key:w,value:x,relativeKey:b.relativeKey,options:y})}return Promise.all([...h.values()].map(d=>f(d))).then(d=>d.flat())},c={hasItem(s,a={}){s=V(s);let{relativeKey:f,driver:h}=r(s);return j(h.hasItem,f,a)},getItem(s,a={}){s=V(s);let{relativeKey:f,driver:h}=r(s);return j(h.getItem,f,a).then(p=>ke(p))},getItems(s,a={}){return l(s,a,f=>f.driver.getItems?j(f.driver.getItems,f.items.map(h=>({key:h.relativeKey,options:h.options})),a).then(h=>h.map(p=>({key:No(f.base,p.key),value:ke(p.value)}))):Promise.all(f.items.map(h=>j(f.driver.getItem,h.relativeKey,h.options).then(p=>({key:h.key,value:ke(p)})))))},getItemRaw(s,a={}){s=V(s);let{relativeKey:f,driver:h}=r(s);return h.getItemRaw?j(h.getItemRaw,f,a):j(h.getItem,f,a).then(p=>To(p))},async setItem(s,a,f={}){if(a===void 0)return c.removeItem(s);s=V(s);let{relativeKey:h,driver:p}=r(s);p.setItem&&(await j(p.setItem,h,je(a),f),p.watch||o("update",s))},async setItems(s,a){await l(s,a,async f=>{if(f.driver.setItems)return j(f.driver.setItems,f.items.map(h=>({key:h.relativeKey,value:je(h.value),options:h.options})),a);f.driver.setItem&&await Promise.all(f.items.map(h=>j(f.driver.setItem,h.relativeKey,je(h.value),h.options)))})},async setItemRaw(s,a,f={}){if(a===void 0)return c.removeItem(s,f);s=V(s);let{relativeKey:h,driver:p}=r(s);if(p.setItemRaw)await j(p.setItemRaw,h,a,f);else if(p.setItem)await j(p.setItem,h,Io(a),f);else return;p.watch||o("update",s)},async removeItem(s,a={}){typeof a=="boolean"&&(a={removeMeta:a}),s=V(s);let{relativeKey:f,driver:h}=r(s);h.removeItem&&(await j(h.removeItem,f,a),(a.removeMeta||a.removeMata)&&await j(h.removeItem,f+"$",a),h.watch||o("remove",s))},async getMeta(s,a={}){typeof a=="boolean"&&(a={nativeOnly:a}),s=V(s);let{relativeKey:f,driver:h}=r(s),p=Object.create(null);if(h.getMeta&&Object.assign(p,await j(h.getMeta,f,a)),!a.nativeOnly){let d=await j(h.getItem,f+"$",a).then(D=>ke(D));d&&typeof d=="object"&&(typeof d.atime=="string"&&(d.atime=new Date(d.atime)),typeof d.mtime=="string"&&(d.mtime=new Date(d.mtime)),Object.assign(p,d))}return p},setMeta(s,a,f={}){return this.setItem(s+"$",a,f)},removeMeta(s,a={}){return this.removeItem(s+"$",a)},async getKeys(s,a={}){s=He(s);let f=n(s,!0),h=[],p=[],d=!0;for(let w of f){w.driver.flags?.maxDepth||(d=!1);let x=await j(w.driver.getKeys,w.relativeBase,a);for(let y of x){let b=w.mountpoint+V(y);h.some(E=>b.startsWith(E))||p.push(b)}h=[w.mountpoint,...h.filter(y=>!y.startsWith(w.mountpoint))]}let D=a.maxDepth!==void 0&&!d;return p.filter(w=>(!D||Uo(w,a.maxDepth))&&Ro(w,s))},async clear(s,a={}){s=He(s),await Promise.all(n(s,!1).map(async f=>{if(f.driver.clear)return j(f.driver.clear,f.relativeBase,a);if(f.driver.removeItem){let h=await f.driver.getKeys(f.relativeBase||"",a);return Promise.all(h.map(p=>f.driver.removeItem(p,a)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(s=>Po(s)))},async watch(s){return await i(),t.watchListeners.push(s),async()=>{t.watchListeners=t.watchListeners.filter(a=>a!==s),t.watchListeners.length===0&&await u()}},async unwatch(){t.watchListeners=[],await u()},mount(s,a){if(s=He(s),s&&t.mounts[s])throw new Error(`already mounted at ${s}`);return s&&(t.mountpoints.push(s),t.mountpoints.sort((f,h)=>h.length-f.length)),t.mounts[s]=a,t.watching&&Promise.resolve(Mo(a,o,s)).then(f=>{t.unwatch[s]=f}).catch(console.error),c},async unmount(s,a=!0){s=He(s),!(!s||!t.mounts[s])&&(t.watching&&s in t.unwatch&&(t.unwatch[s]?.(),delete t.unwatch[s]),a&&await Po(t.mounts[s]),t.mountpoints=t.mountpoints.filter(f=>f!==s),delete t.mounts[s])},getMount(s=""){s=V(s)+":";let a=r(s);return{driver:a.driver,base:a.base}},getMounts(s="",a={}){return s=V(s),n(s,a.parents).map(h=>({driver:h.driver,base:h.mountpoint}))},keys:(s,a={})=>c.getKeys(s,a),get:(s,a={})=>c.getItem(s,a),set:(s,a,f={})=>c.setItem(s,a,f),has:(s,a={})=>c.hasItem(s,a),del:(s,a={})=>c.removeItem(s,a),remove:(s,a={})=>c.removeItem(s,a)};return c}function Mo(e,t,r){return e.watch?e.watch((n,o)=>t(n,r+o)):()=>{}}async function Po(e){typeof e.dispose=="function"&&await j(e.dispose)}function be(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function Qc(e,t){let r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);let n=be(r);return(o,i)=>n.then(u=>i(u.transaction(t,o).objectStore(t)))}var _r;function Ke(){return _r||(_r=Qc("keyval-store","keyval")),_r}function ql(e,t=Ke()){return t("readonly",r=>be(r.get(e)))}function Vl(e,t,r=Ke()){return r("readwrite",n=>(n.put(t,e),be(n.transaction)))}function $l(e,t=Ke()){return t("readwrite",r=>(r.delete(e),be(r.transaction)))}function Yl(e=Ke()){return e("readwrite",t=>(t.clear(),be(t.transaction)))}function ef(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},be(e.transaction)}function Jl(e=Ke()){return e("readonly",t=>{if(t.getAllKeys)return be(t.getAllKeys());let r=[];return ef(t,n=>r.push(n.key)).then(()=>r)})}export{tf as a,Bt as b,on as c,Wi as d,wf as e,mu as f,Ef as g,vf as h,xf as i,Fu as j,Rc as k,Mc as l,_l as m,gt as n,Pc as o,xo as p,Hl as q,Qc as r,ql as s,Vl as t,$l as u,Yl as v,Jl as w,Bo as x};
|
|
16
|
+
/*! Bundled license information:
|
|
17
|
+
|
|
18
|
+
tslib/tslib.es6.js:
|
|
19
|
+
(*! *****************************************************************************
|
|
20
|
+
Copyright (c) Microsoft Corporation.
|
|
21
|
+
|
|
22
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
23
|
+
purpose with or without fee is hereby granted.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
26
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
27
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
28
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
29
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
30
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
32
|
+
***************************************************************************** *)
|
|
33
|
+
|
|
34
|
+
@walletconnect/relay-auth/dist/index.es.js:
|
|
35
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
36
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
37
|
+
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var i=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function c(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function a(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function f(t,...e){if(!a(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function g(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");c(t.outputLen),c(t.blockLen)}function w(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function x(t,e){f(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function A(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function L(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function E(t,e){return t<<32-e|t>>>e}var B=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function l(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function U(t){for(let e=0;e<t.length;e++)t[e]=l(t[e])}function y(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function p(t){return typeof t=="string"&&(t=y(t)),f(t),t}function O(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];f(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let u=t[n];r.set(u,o),o+=u.length}return r}var s=class{clone(){return this._cloneInto()}};function T(t){let e=n=>t().update(p(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function k(t){let e=(n,o)=>t(o).update(p(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function S(t=32){if(i&&typeof i.getRandomValues=="function")return i.getRandomValues(new Uint8Array(t));if(i&&typeof i.randomBytes=="function")return i.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}export{c as a,f as b,g as c,w as d,x as e,A as f,L as g,E as h,B as i,U as j,p as k,O as l,s as m,T as n,k as o,S as p};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@noble/hashes/esm/utils.js:
|
|
5
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
6
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.create;var f=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty;var i=a=>{throw TypeError(a)};var o=(a,b,c)=>b in a?f(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c;var p=(a,b)=>()=>(a&&(b=a(a=0)),b);var q=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),r=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,d)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of l(b))!n.call(a,e)&&e!==c&&f(a,e,{get:()=>b[e],enumerable:!(d=k(b,e))||d.enumerable});return a},s=(a,b,c)=>(g(a,b,"default"),c&&g(c,b,"default")),t=(a,b,c)=>(c=a!=null?j(m(a)):{},g(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a)),u=a=>g(f({},"__esModule",{value:!0}),a);var v=(a,b,c)=>o(a,typeof b!="symbol"?b+"":b,c),h=(a,b,c)=>b.has(a)||i("Cannot "+c);var w=(a,b,c)=>(h(a,b,"read from private field"),c?c.call(a):b.get(a)),x=(a,b,c)=>b.has(a)?i("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),y=(a,b,c,d)=>(h(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c),z=(a,b,c)=>(h(a,b,"access private method"),c);export{p as a,q as b,r as c,s as d,t as e,u as f,v as g,w as h,x as i,y as j,z as k};
|